@dsebastien/music-notation 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/dist/THIRD_PARTY_LICENSES.md +256 -0
- package/dist/blocks/note-set-field.d.ts +4 -1
- package/dist/cli.js +70 -0
- package/dist/fretboard/positions.d.ts +34 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +244 -51
- package/dist/index.js.map +15 -15
- package/dist/music-notation.publish.min.js +17 -17
- package/dist/music-notation.tab.min.js +1 -1
- package/dist/publish/index.js +242 -51
- package/dist/publish/index.js.map +15 -15
- package/dist/tab/index.js +79 -15
- package/dist/tab/index.js.map +5 -5
- package/dist/theory/note-set.d.ts +19 -5
- package/dist/theory/suffix.d.ts +8 -1
- package/dist/voicings/index.d.ts +3 -2
- package/dist/voicings/index.js +945 -4
- package/dist/voicings/index.js.map +11 -5
- package/package.json +5 -1
package/dist/cli.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire}from"node:module";var __create=Object.create;var{getPrototypeOf:__getProtoOf,defineProperty:__defProp,getOwnPropertyNames:__getOwnPropNames}=Object;var __hasOwnProp=Object.prototype.hasOwnProperty;function __accessProp(key){return this[key]}var __toESMCache_node,__toESMCache_esm,__toESM=(mod,isNodeMode,target)=>{var canCache=mod!=null&&typeof mod==="object";if(canCache){var cache=isNodeMode?__toESMCache_node??=new WeakMap:__toESMCache_esm??=new WeakMap,cached=cache.get(mod);if(cached)return cached}target=mod!=null?__create(__getProtoOf(mod)):{};let to=isNodeMode||!mod||!mod.__esModule||!__hasOwnProp.call(mod,"default")?__defProp(target,"default",{value:mod,enumerable:!0}):target;if(mod&&typeof mod==="object"||typeof mod==="function"){for(let key of __getOwnPropNames(mod))if(!__hasOwnProp.call(to,key))__defProp(to,key,{get:__accessProp.bind(mod,key),enumerable:!0})}if(canCache)cache.set(mod,to);return to};var __commonJS=(cb,mod)=>()=>(mod||cb((mod={exports:{}}).exports,mod),mod.exports);var __returnValue=(v)=>v;function __exportSetter(name,newValue){this[name]=__returnValue.bind(null,newValue)}var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0,configurable:!0,set:__exportSetter.bind(all,name)})};var __require=createRequire(import.meta.url);var require_CSSOM=__commonJS(function(exports2,module2){var CSSOM2={setup:function(opts){var instance=Object.create(this);if(opts.globalObject){if(instance.CSSStyleSheet){var factoryCSSStyleSheet=createFunctionFactory(instance.CSSStyleSheet),CSSStyleSheet=factoryCSSStyleSheet();CSSStyleSheet.prototype.__globalObject=opts.globalObject,instance.CSSStyleSheet=CSSStyleSheet}}return instance}};function createFunctionFactory(fn){return function(){var newFn=function(){return fn.apply(this,arguments)};Object.setPrototypeOf(newFn,Object.getPrototypeOf(fn));for(var key in fn)if(Object.prototype.hasOwnProperty.call(fn,key))newFn[key]=fn[key];if(fn.prototype)newFn.prototype=Object.create(fn.prototype);return newFn}}module2.exports=CSSOM2});var require_errorUtils=__commonJS(function(exports,module){function getErrorConstructor(context,errorType){if(context.parentStyleSheet&&context.parentStyleSheet.__globalObject&&context.parentStyleSheet.__globalObject[errorType])return context.parentStyleSheet.__globalObject[errorType];if(context.__parentStyleSheet&&context.__parentStyleSheet.__globalObject&&context.__parentStyleSheet.__globalObject[errorType])return context.__parentStyleSheet.__globalObject[errorType];if(context.__globalObject&&context.__globalObject[errorType])return context.__globalObject[errorType];return typeof global<"u"&&global[errorType]||typeof window<"u"&&window[errorType]||eval(errorType)}function createError(context2,errorType2,message,name){var ErrorConstructor=getErrorConstructor(context2,errorType2);return new ErrorConstructor(message,name)}function throwError(context2,errorType2,message,name){throw createError(context2,errorType2,message,name)}function throwMissingArguments(context2,methodName,objectName,required,provided){required=required||1,provided=provided||0;var message="Failed to execute '"+methodName+"' on '"+objectName+"': "+required+" argument"+(required>1?"s":"")+" required, but only "+provided+" present.";throwError(context2,"TypeError",message)}function throwParseError(context2,methodName,objectName,rule,name){var message="Failed to execute '"+methodName+"' on '"+objectName+"': Failed to parse the rule '"+rule+"'.";throwError(context2,"DOMException",message,name||"SyntaxError")}function throwIndexError(context2,methodName,objectName,index,maxIndex,name){var message="Failed to execute '"+methodName+"' on '"+objectName+"': The index provided ("+index+") is larger than the maximum index ("+maxIndex+").";throwError(context2,"DOMException",message,name||"IndexSizeError")}var errorUtils={createError,getErrorConstructor,throwError,throwMissingArguments,throwParseError,throwIndexError};exports.errorUtils=errorUtils});var require_regexPatterns=__commonJS(function(exports2){var atKeyframesRegExp=/@(-(?:\w+-)+)?keyframes/g,beforeRulePortionRegExp=/{(?!.*{)|}(?!.*})|;(?!.*;)|\*\/(?!.*\*\/)/g,beforeRuleValidationRegExp=/^[\s{};]*(\*\/\s*)?$/,forwardRuleValidationRegExp=/(?:\s|\/\*|\{|\()/,forwardImportRuleValidationRegExp=/(?:\s|\/\*|'|")/,forwardRuleClosingBraceRegExp=/{[^{}]*}|}/,forwardRuleSemicolonAndOpeningBraceRegExp=/^.*?({|;)/,cssCustomIdentifierRegExp=/^(-?[_a-zA-Z]+(\.[_a-zA-Z]+)*[_a-zA-Z0-9-]*)$/,startsWithCombinatorRegExp=/^\s*[>+~]/,atPageRuleSelectorRegExp=/^([^\s:]+)?((?::\w+)*)$/,layerRegExp=/layer\(([^)]*)\)/,layerRuleNameRegExp=/^(-?[_a-zA-Z]+(\.[_a-zA-Z]+)*[_a-zA-Z0-9-]*)$/,doubleOrMoreSpacesRegExp=/\s{2,}/g,startsWithHexEscapeRegExp=/^\\[0-9a-fA-F]/,identStartCharRegExp=/[a-zA-Z_\u00A0-\uFFFF]/,identCharRegExp=/^[a-zA-Z0-9_\-\u00A0-\uFFFF\\]/,specialCharsNeedEscapeRegExp=/[!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~\s]/,combinatorOrSeparatorRegExp=/[\s>+~,()]/,afterHexEscapeSeparatorRegExp=/[\s>+~,(){}\[\]]/,trailingSpaceSeparatorRegExp=/[\s>+~,(){}]/,endsWithHexEscapeRegExp=/\\[0-9a-fA-F]{1,6}\s+$/,basicStylePropertyValueValidationRegExp=/:(?![^(]*\))(?=(?:[^'"]|'[^']*'|"[^"]*")*$)/,attributeSelectorContentRegExp=/^([^\s=~|^$*]+)\s*(~=|\|=|\^=|\$=|\*=|=)\s*(.+)$/,pseudoElementRegExp=/::[a-zA-Z][\w-]*|:(before|after|first-line|first-letter)(?![a-zA-Z0-9_-])/,invalidCombinatorLtGtRegExp=/<>/,invalidCombinatorDoubleGtRegExp=/>>/,consecutiveCombinatorsRegExp=/[>+~]\s*[>+~]/,invalidSlottedRegExp=/(?:^|[\s>+~,\[])slotted\s*\(/i,invalidPartRegExp=/(?:^|[\s>+~,\[])part\s*\(/i,invalidCueRegExp=/(?:^|[\s>+~,\[])cue\s*\(/i,invalidCueRegionRegExp=/(?:^|[\s>+~,\[])cue-region\s*\(/i,invalidNestingPattern=/&(?![.\#\[:>\+~\s])[a-zA-Z]/,emptyPseudoClassRegExp=/:(?:is|not|where|has)\(\s*\)/,whitespaceNormalizationRegExp=/(['"])(?:\\.|[^\\])*?\1|(\r\n|\r|\n)/g,newlineRemovalRegExp=/\n/g,whitespaceAndDotRegExp=/[\s.]/,declarationOrOpenBraceRegExp=/[{;}]/,ampersandRegExp=/&/,hexEscapeSequenceRegExp=/^([0-9a-fA-F]{1,6})[ \t\r\n\f]?/,attributeCaseFlagRegExp=/^(.+?)\s+([is])$/i,prependedAmpersandRegExp=/^&\s+[:\\.]/,openBraceGlobalRegExp=/{/g,closeBraceGlobalRegExp=/}/g,scopePreludeSplitRegExp=/\s*\)\s*to\s+\(/,leadingWhitespaceRegExp=/^\s+/,doubleQuoteRegExp=/"/g,backslashRegExp=/\\/g,invalidMediaOperatorWithoutSpaceRegExp=/\)(and|or)\(/i,invalidMediaNotAfterOperatorRegExp=/\b(and|or)\s+not\b/i,invalidMediaNotIdentifierRegExp=/\)\s+not\(/i,invalidMediaNotAfterFeatureRegExp=/\)\s+not\s+/i,invalidMediaOperatorBetweenParensRegExp=/\)\s+(?!and\b|or\b)[a-z]+\s+\(/i,invalidMediaNotWithMediaTypeRegExp=/\bnot\s+[a-z][a-z0-9_-]*\s+\(/i,mediaFeatureColonRegExp=/(\(\s*)([^():]+):(\s*)([^()]*\))/g,identifierBeforeParenRegExp=/[a-z0-9_-]/i,mediaAndOperatorRegExp=/\s*\band\b\s*/gi,mediaOrOperatorRegExp=/\s*\bor\b\s*/gi,mediaNotOperatorStartRegExp=/^\s*not\s+(?=\S)/i,mediaNotOperatorRegExp=/\s+\bnot\s+(?=\S)/gi,regexPatterns={atKeyframesRegExp,beforeRulePortionRegExp,beforeRuleValidationRegExp,forwardRuleValidationRegExp,forwardImportRuleValidationRegExp,forwardRuleClosingBraceRegExp,forwardRuleSemicolonAndOpeningBraceRegExp,cssCustomIdentifierRegExp,startsWithCombinatorRegExp,atPageRuleSelectorRegExp,layerRegExp,layerRuleNameRegExp,doubleOrMoreSpacesRegExp,startsWithHexEscapeRegExp,identStartCharRegExp,identCharRegExp,specialCharsNeedEscapeRegExp,combinatorOrSeparatorRegExp,afterHexEscapeSeparatorRegExp,trailingSpaceSeparatorRegExp,endsWithHexEscapeRegExp,basicStylePropertyValueValidationRegExp,attributeSelectorContentRegExp,pseudoElementRegExp,invalidCombinatorLtGtRegExp,invalidCombinatorDoubleGtRegExp,consecutiveCombinatorsRegExp,invalidSlottedRegExp,invalidPartRegExp,invalidCueRegExp,invalidCueRegionRegExp,invalidNestingPattern,emptyPseudoClassRegExp,whitespaceNormalizationRegExp,newlineRemovalRegExp,whitespaceAndDotRegExp,declarationOrOpenBraceRegExp,ampersandRegExp,hexEscapeSequenceRegExp,attributeCaseFlagRegExp,prependedAmpersandRegExp,openBraceGlobalRegExp,closeBraceGlobalRegExp,scopePreludeSplitRegExp,leadingWhitespaceRegExp,doubleQuoteRegExp,backslashRegExp,invalidMediaOperatorWithoutSpaceRegExp,invalidMediaNotAfterOperatorRegExp,invalidMediaNotIdentifierRegExp,invalidMediaNotAfterFeatureRegExp,invalidMediaOperatorBetweenParensRegExp,invalidMediaNotWithMediaTypeRegExp,mediaFeatureColonRegExp,identifierBeforeParenRegExp,mediaAndOperatorRegExp,mediaOrOperatorRegExp,mediaNotOperatorStartRegExp,mediaNotOperatorRegExp};exports2.regexPatterns=regexPatterns});var require_MediaList=__commonJS(function(exports2){var CSSOM2={};CSSOM2.MediaList=function(){this.length=0};CSSOM2.MediaList.prototype={constructor:CSSOM2.MediaList,get mediaText(){return Array.prototype.join.call(this,", ")},set mediaText(value){if(typeof value==="string"){var values=value.split(",").filter(function(text){return!!text}),length=this.length=values.length;for(var i=0;i<length;i++)this[i]=values[i].trim()}else if(value===null){var length=this.length;for(var i=0;i<length;i++)delete this[i];this.length=0}},appendMedium:function(medium){if(Array.prototype.indexOf.call(this,medium)===-1)this[this.length]=medium,this.length++},deleteMedium:function(medium){var index=Array.prototype.indexOf.call(this,medium);if(index!==-1)Array.prototype.splice.call(this,index,1)},item:function(index){return this[index]||null},toString:function(){return this.mediaText}};exports2.MediaList=CSSOM2.MediaList});var require_StyleSheet=__commonJS(function(exports2){var CSSOM2={MediaList:require_MediaList().MediaList};CSSOM2.StyleSheet=function(){this.__href=null,this.__ownerNode=null,this.__title=null,this.__media=new CSSOM2.MediaList,this.__parentStyleSheet=null,this.disabled=!1};Object.defineProperties(CSSOM2.StyleSheet.prototype,{type:{get:function(){return"text/css"}},href:{get:function(){return this.__href}},ownerNode:{get:function(){return this.__ownerNode}},title:{get:function(){return this.__title}},media:{get:function(){return this.__media},set:function(value){if(typeof value==="string")this.__media.mediaText=value;else this.__media=value}},parentStyleSheet:{get:function(){return this.__parentStyleSheet}}});exports2.StyleSheet=CSSOM2.StyleSheet});var require_CSSRuleList=__commonJS(function(exports2){var CSSOM2={};CSSOM2.CSSRuleList=function(){var arr=[];return Object.setPrototypeOf(arr,CSSOM2.CSSRuleList.prototype),arr};CSSOM2.CSSRuleList.prototype=Object.create(Array.prototype);CSSOM2.CSSRuleList.prototype.constructor=CSSOM2.CSSRuleList;CSSOM2.CSSRuleList.prototype.item=function(index){return this[index]||null};exports2.CSSRuleList=CSSOM2.CSSRuleList});var require_CSSRule=__commonJS(function(exports2){var CSSOM2={};CSSOM2.CSSRule=function(){this.__parentRule=null,this.__parentStyleSheet=null};CSSOM2.CSSRule.UNKNOWN_RULE=0;CSSOM2.CSSRule.STYLE_RULE=1;CSSOM2.CSSRule.CHARSET_RULE=2;CSSOM2.CSSRule.IMPORT_RULE=3;CSSOM2.CSSRule.MEDIA_RULE=4;CSSOM2.CSSRule.FONT_FACE_RULE=5;CSSOM2.CSSRule.PAGE_RULE=6;CSSOM2.CSSRule.KEYFRAMES_RULE=7;CSSOM2.CSSRule.KEYFRAME_RULE=8;CSSOM2.CSSRule.MARGIN_RULE=9;CSSOM2.CSSRule.NAMESPACE_RULE=10;CSSOM2.CSSRule.COUNTER_STYLE_RULE=11;CSSOM2.CSSRule.SUPPORTS_RULE=12;CSSOM2.CSSRule.DOCUMENT_RULE=13;CSSOM2.CSSRule.FONT_FEATURE_VALUES_RULE=14;CSSOM2.CSSRule.VIEWPORT_RULE=15;CSSOM2.CSSRule.REGION_STYLE_RULE=16;CSSOM2.CSSRule.CONTAINER_RULE=17;CSSOM2.CSSRule.LAYER_BLOCK_RULE=18;CSSOM2.CSSRule.STARTING_STYLE_RULE=1002;Object.defineProperties(CSSOM2.CSSRule.prototype,{constructor:{value:CSSOM2.CSSRule},cssRule:{value:"",configurable:!0,enumerable:!0},cssText:{get:function(){return""},set:function(cssText){return cssText}},parentRule:{get:function(){return this.__parentRule}},parentStyleSheet:{get:function(){return this.__parentStyleSheet}},UNKNOWN_RULE:{value:0,enumerable:!0},STYLE_RULE:{value:1,enumerable:!0},CHARSET_RULE:{value:2,enumerable:!0},IMPORT_RULE:{value:3,enumerable:!0},MEDIA_RULE:{value:4,enumerable:!0},FONT_FACE_RULE:{value:5,enumerable:!0},PAGE_RULE:{value:6,enumerable:!0},KEYFRAMES_RULE:{value:7,enumerable:!0},KEYFRAME_RULE:{value:8,enumerable:!0},MARGIN_RULE:{value:9,enumerable:!0},NAMESPACE_RULE:{value:10,enumerable:!0},COUNTER_STYLE_RULE:{value:11,enumerable:!0},SUPPORTS_RULE:{value:12,enumerable:!0},DOCUMENT_RULE:{value:13,enumerable:!0},FONT_FEATURE_VALUES_RULE:{value:14,enumerable:!0},VIEWPORT_RULE:{value:15,enumerable:!0},REGION_STYLE_RULE:{value:16,enumerable:!0},CONTAINER_RULE:{value:17,enumerable:!0},LAYER_BLOCK_RULE:{value:18,enumerable:!0},STARTING_STYLE_RULE:{value:1002,enumerable:!0}});exports2.CSSRule=CSSOM2.CSSRule});var require_CSSGroupingRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,parse:require_parse().parse},errorUtils2=require_errorUtils().errorUtils;CSSOM2.CSSGroupingRule=function(){CSSOM2.CSSRule.call(this),this.__cssRules=new CSSOM2.CSSRuleList};CSSOM2.CSSGroupingRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSGroupingRule.prototype.constructor=CSSOM2.CSSGroupingRule;Object.setPrototypeOf(CSSOM2.CSSGroupingRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSGroupingRule.prototype,"cssRules",{get:function(){return this.__cssRules}});CSSOM2.CSSGroupingRule.prototype.insertRule=function(rule,index){if(rule===void 0&&index===void 0)errorUtils2.throwMissingArguments(this,"insertRule",this.constructor.name);if(index===void 0)index=0;if(index=Number(index),index<0)index=4294967296+index;if(index>this.cssRules.length)errorUtils2.throwIndexError(this,"insertRule",this.constructor.name,index,this.cssRules.length);var ruleToParse=processedRuleToParse=String(rule);ruleToParse=ruleToParse.trim().replace(/^\/\*[\s\S]*?\*\/\s*/,"");var isNestedSelector=this.constructor.name==="CSSStyleRule";if(isNestedSelector===!1){var currentRule=this;while(currentRule.parentRule)if(currentRule=currentRule.parentRule,currentRule.constructor.name==="CSSStyleRule"){isNestedSelector=!0;break}}if(isNestedSelector)processedRuleToParse="s { n { } "+ruleToParse+"}";var isScopeRule=this.constructor.name==="CSSScopeRule";if(isScopeRule)if(isNestedSelector)processedRuleToParse="s { @scope {"+ruleToParse+"}}";else processedRuleToParse="@scope {"+ruleToParse+"}";var parsedRules=new CSSOM2.CSSRuleList;if(CSSOM2.parse(processedRuleToParse,{styleSheet:this.parentStyleSheet,cssRules:parsedRules}),isScopeRule)if(isNestedSelector)parsedRules=parsedRules[0].cssRules[0].cssRules;else parsedRules=parsedRules[0].cssRules;if(isNestedSelector)parsedRules=parsedRules[0].cssRules.slice(1);if(parsedRules.length!==1)if(isNestedSelector&&parsedRules.length===0&&ruleToParse.indexOf("@font-face")===0)errorUtils2.throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': Only conditional nested group rules, style rules, @scope rules, @apply rules, and nested declaration rules may be nested.","HierarchyRequestError");else errorUtils2.throwParseError(this,"insertRule",this.constructor.name,ruleToParse,"SyntaxError");var cssRule=parsedRules[0];if(cssRule.constructor.name==="CSSNestedDeclarations"&&cssRule.style.length===0)errorUtils2.throwParseError(this,"insertRule",this.constructor.name,ruleToParse,"SyntaxError");if(cssRule.constructor.name==="CSSImportRule"||cssRule.constructor.name==="CSSNamespaceRule"){var ruleKeyword=cssRule.constructor.name==="CSSImportRule"?"@import":"@namespace";errorUtils2.throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': '"+ruleKeyword+"' rules cannot be inserted inside a group rule.","HierarchyRequestError")}if(cssRule.constructor.name==="CSSLayerStatementRule")errorUtils2.throwParseError(this,"insertRule",this.constructor.name,ruleToParse,"SyntaxError");return cssRule.__parentRule=this,this.cssRules.splice(index,0,cssRule),index};CSSOM2.CSSGroupingRule.prototype.deleteRule=function(index){if(index===void 0)errorUtils2.throwMissingArguments(this,"deleteRule",this.constructor.name);if(index=Number(index),index<0)index=4294967296+index;if(index>=this.cssRules.length)errorUtils2.throwIndexError(this,"deleteRule",this.constructor.name,index,this.cssRules.length);this.cssRules[index].__parentRule=null,this.cssRules[index].__parentStyleSheet=null,this.cssRules.splice(index,1)};exports2.CSSGroupingRule=CSSOM2.CSSGroupingRule});var require_CSSStyleRule=__commonJS(function(exports2){var CSSOM2={CSSStyleDeclaration:require_CSSStyleDeclaration().CSSStyleDeclaration,CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,CSSGroupingRule:require_CSSGroupingRule().CSSGroupingRule},regexPatterns=require_regexPatterns().regexPatterns;try{CSSOM2.CSSStyleDeclaration=(()=>{throw new Error("Cannot require module "+"cssstyle");})().CSSStyleDeclaration}catch(e){}CSSOM2.CSSStyleRule=function(){CSSOM2.CSSGroupingRule.call(this),this.__selectorText="",this.__style=new CSSOM2.CSSStyleDeclaration,this.__style.parentRule=this};CSSOM2.CSSStyleRule.prototype=Object.create(CSSOM2.CSSGroupingRule.prototype);CSSOM2.CSSStyleRule.prototype.constructor=CSSOM2.CSSStyleRule;Object.setPrototypeOf(CSSOM2.CSSStyleRule,CSSOM2.CSSGroupingRule);Object.defineProperty(CSSOM2.CSSStyleRule.prototype,"type",{value:1,writable:!1});Object.defineProperty(CSSOM2.CSSStyleRule.prototype,"selectorText",{get:function(){return this.__selectorText},set:function(value){if(typeof value==="string"){var endsWithHexEscapeRegExp=regexPatterns.endsWithHexEscapeRegExp,endsWithEscape=endsWithHexEscapeRegExp.test(value),trimmedValue=endsWithEscape?value.replace(/\s+$/," ").trimStart():value.trim();if(trimmedValue==="")return;this.__selectorText=trimmedValue}},configurable:!0});Object.defineProperty(CSSOM2.CSSStyleRule.prototype,"style",{get:function(){return this.__style},set:function(value){if(typeof value==="string")this.__style.cssText=value;else this.__style=value},configurable:!0});Object.defineProperty(CSSOM2.CSSStyleRule.prototype,"cssText",{get:function(){var text;if(this.selectorText){var values="";if(this.cssRules.length){var valuesArr=[" {"];this.style.cssText&&valuesArr.push(this.style.cssText),valuesArr.push(this.cssRules.reduce(function(acc,rule){if(rule.cssText!=="")acc.push(rule.cssText);return acc},[]).join(`
|
|
3
|
+
`)),values=valuesArr.join(`
|
|
4
|
+
`)+`
|
|
5
|
+
}`}else values=" {"+(this.style.cssText?" "+this.style.cssText:"")+" }";text=this.selectorText+values}else text="";return text}});exports2.CSSStyleRule=CSSOM2.CSSStyleRule});var require_CSSStyleSheet=__commonJS(function(exports2){var CSSOM2={MediaList:require_MediaList().MediaList,StyleSheet:require_StyleSheet().StyleSheet,CSSRuleList:require_CSSRuleList().CSSRuleList,CSSStyleRule:require_CSSStyleRule().CSSStyleRule},errorUtils2=require_errorUtils().errorUtils;CSSOM2.CSSStyleSheet=function(opts){if(CSSOM2.StyleSheet.call(this),this.__constructed=!0,this.__cssRules=new CSSOM2.CSSRuleList,this.__ownerRule=null,opts&&typeof opts==="object"){if(opts.baseURL&&typeof opts.baseURL==="string")this.__baseURL=opts.baseURL;if(opts.media&&typeof opts.media==="string")this.media.mediaText=opts.media;if(typeof opts.disabled==="boolean")this.disabled=opts.disabled}};CSSOM2.CSSStyleSheet.prototype=Object.create(CSSOM2.StyleSheet.prototype);CSSOM2.CSSStyleSheet.prototype.constructor=CSSOM2.CSSStyleSheet;Object.setPrototypeOf(CSSOM2.CSSStyleSheet,CSSOM2.StyleSheet);Object.defineProperty(CSSOM2.CSSStyleSheet.prototype,"cssRules",{get:function(){return this.__cssRules}});Object.defineProperty(CSSOM2.CSSStyleSheet.prototype,"rules",{get:function(){return this.__cssRules}});Object.defineProperty(CSSOM2.CSSStyleSheet.prototype,"ownerRule",{get:function(){return this.__ownerRule}});CSSOM2.CSSStyleSheet.prototype.insertRule=function(rule,index){if(rule===void 0&&index===void 0)errorUtils2.throwMissingArguments(this,"insertRule",this.constructor.name);if(index===void 0)index=0;if(index=Number(index),index<0)index=4294967296+index;if(index>this.cssRules.length)errorUtils2.throwIndexError(this,"insertRule",this.constructor.name,index,this.cssRules.length);var ruleToParse=String(rule),parseErrors=[],parsedSheet=CSSOM2.parse(ruleToParse,void 0,function(err){parseErrors.push(err)});if(parsedSheet.cssRules.length!==1)errorUtils2.throwParseError(this,"insertRule",this.constructor.name,ruleToParse,"SyntaxError");var cssRule=parsedSheet.cssRules[0];function findLastIndexOfConstructor(rules,constructorName){for(var i=rules.length-1;i>=0;i--)if(rules[i].constructor.name===constructorName)return i;return-1}function findFirstNonConstructorIndex(rules,constructorNames){for(var i=0;i<rules.length;i++)if(constructorNames.indexOf(rules[i].constructor.name)===-1)return i;return rules.length}if(cssRule.constructor.name==="CSSImportRule"){if(this.__constructed===!0)errorUtils2.throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': Can't insert @import rules into a constructed stylesheet.","SyntaxError");var firstLayerIndex=findFirstNonConstructorIndex(this.cssRules,["CSSImportRule"]);if(firstLayerIndex<this.cssRules.length&&this.cssRules[firstLayerIndex].constructor.name==="CSSLayerStatementRule"&&index>firstLayerIndex)errorUtils2.throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': Failed to insert the rule.","HierarchyRequestError");var firstNonImportIndex=findFirstNonConstructorIndex(this.cssRules,["CSSImportRule"]);if(index>firstNonImportIndex&&firstNonImportIndex<this.cssRules.length&&this.cssRules[firstNonImportIndex].constructor.name!=="CSSLayerStatementRule")errorUtils2.throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': Failed to insert the rule.","HierarchyRequestError")}else if(cssRule.constructor.name==="CSSNamespaceRule"){var firstImportIndex=-1;for(var i=0;i<this.cssRules.length;i++)if(this.cssRules[i].constructor.name==="CSSImportRule"){firstImportIndex=i;break}var firstNonImportNamespaceIndex=findFirstNonConstructorIndex(this.cssRules,["CSSLayerStatementRule","CSSImportRule","CSSNamespaceRule"]);if(firstImportIndex!==-1&&index<=firstImportIndex)errorUtils2.throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': Failed to insert the rule.","HierarchyRequestError");if(firstNonImportNamespaceIndex<this.cssRules.length)errorUtils2.throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': Failed to insert the rule.","InvalidStateError");if(index>firstNonImportNamespaceIndex)errorUtils2.throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': Failed to insert the rule.","HierarchyRequestError")}else if(cssRule.constructor.name==="CSSLayerStatementRule");else{var firstNonSpecialRuleIndex=findFirstNonConstructorIndex(this.cssRules,["CSSLayerStatementRule","CSSImportRule","CSSNamespaceRule"]);if(index<firstNonSpecialRuleIndex)errorUtils2.throwError(this,"DOMException","Failed to execute 'insertRule' on '"+this.constructor.name+"': Failed to insert the rule.","HierarchyRequestError");if(parseErrors.filter(function(error){return!error.isNested}).length!==0)errorUtils2.throwParseError(this,"insertRule",this.constructor.name,ruleToParse,"SyntaxError")}return cssRule.__parentStyleSheet=this,this.cssRules.splice(index,0,cssRule),index};CSSOM2.CSSStyleSheet.prototype.addRule=function(selector,styleBlock,index){if(index===void 0)index=this.cssRules.length;return this.insertRule(selector+"{"+styleBlock+"}",index),-1};CSSOM2.CSSStyleSheet.prototype.deleteRule=function(index){if(index===void 0)errorUtils2.throwMissingArguments(this,"deleteRule",this.constructor.name);if(index=Number(index),index<0)index=4294967296+index;if(index>=this.cssRules.length)errorUtils2.throwIndexError(this,"deleteRule",this.constructor.name,index,this.cssRules.length);if(this.cssRules[index]){if(this.cssRules[index].constructor.name=="CSSNamespaceRule"){var shouldContinue=this.cssRules.every(function(rule){return["CSSImportRule","CSSLayerStatementRule","CSSNamespaceRule"].indexOf(rule.constructor.name)!==-1});if(!shouldContinue)errorUtils2.throwError(this,"DOMException","Failed to execute 'deleteRule' on '"+this.constructor.name+"': Failed to delete rule.","InvalidStateError")}if(this.cssRules[index].constructor.name=="CSSImportRule")this.cssRules[index].styleSheet.__parentStyleSheet=null;this.cssRules[index].__parentStyleSheet=null}this.cssRules.splice(index,1)};CSSOM2.CSSStyleSheet.prototype.removeRule=function(index){if(index===void 0)index=0;this.deleteRule(index)};CSSOM2.CSSStyleSheet.prototype.replace=function(text){var _Promise;if(this.__globalObject&&this.__globalObject.Promise)_Promise=this.__globalObject.Promise;else _Promise=Promise;var _setTimeout;if(this.__globalObject&&this.__globalObject.setTimeout)_setTimeout=this.__globalObject.setTimeout;else _setTimeout=setTimeout;var sheet=this;return new _Promise(function(resolve,reject){if(!sheet.__constructed||sheet.__disallowModification)reject(errorUtils2.createError(sheet,"DOMException","Failed to execute 'replaceSync' on '"+sheet.constructor.name+"': Not allowed.","NotAllowedError"));sheet.__disallowModification=!0,_setTimeout(function(){var rules=new CSSOM2.CSSRuleList;CSSOM2.parse(text,{styleSheet:sheet,cssRules:rules});var i=0;while(i<rules.length)if(rules[i].constructor.name==="CSSImportRule")rules.splice(i,1);else i++;sheet.__cssRules.splice.apply(sheet.__cssRules,[0,sheet.__cssRules.length].concat(rules)),delete sheet.__disallowModification,resolve(sheet)})})};CSSOM2.CSSStyleSheet.prototype.replaceSync=function(text){var sheet=this;if(!sheet.__constructed||sheet.__disallowModification)errorUtils2.throwError(sheet,"DOMException","Failed to execute 'replaceSync' on '"+sheet.constructor.name+"': Not allowed.","NotAllowedError");var rules=new CSSOM2.CSSRuleList;CSSOM2.parse(text,{styleSheet:sheet,cssRules:rules});var i=0;while(i<rules.length)if(rules[i].constructor.name==="CSSImportRule")rules.splice(i,1);else i++;sheet.__cssRules.splice.apply(sheet.__cssRules,[0,sheet.__cssRules.length].concat(rules))};CSSOM2.CSSStyleSheet.prototype.toString=function(){var result="",rules=this.cssRules;for(var i=0;i<rules.length;i++)result+=rules[i].cssText+`
|
|
6
|
+
`;return result};exports2.CSSStyleSheet=CSSOM2.CSSStyleSheet;CSSOM2.parse=require_parse().parse});var require_CSSNestedDeclarations=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSStyleDeclaration:require_CSSStyleDeclaration().CSSStyleDeclaration};try{CSSOM2.CSSStyleDeclaration=(()=>{throw new Error("Cannot require module "+"cssstyle");})().CSSStyleDeclaration}catch(e){}CSSOM2.CSSNestedDeclarations=function(){CSSOM2.CSSRule.call(this),this.__style=new CSSOM2.CSSStyleDeclaration,this.__style.parentRule=this};CSSOM2.CSSNestedDeclarations.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSNestedDeclarations.prototype.constructor=CSSOM2.CSSNestedDeclarations;Object.setPrototypeOf(CSSOM2.CSSNestedDeclarations,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSNestedDeclarations.prototype,"type",{value:0,writable:!1});Object.defineProperty(CSSOM2.CSSNestedDeclarations.prototype,"style",{get:function(){return this.__style},set:function(value){if(typeof value==="string")this.__style.cssText=value;else this.__style=value}});Object.defineProperty(CSSOM2.CSSNestedDeclarations.prototype,"cssText",{get:function(){return this.style.cssText}});exports2.CSSNestedDeclarations=CSSOM2.CSSNestedDeclarations});var require_CSSImportRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSStyleSheet:require_CSSStyleSheet().CSSStyleSheet,MediaList:require_MediaList().MediaList},regexPatterns=require_regexPatterns().regexPatterns;CSSOM2.CSSImportRule=function(){CSSOM2.CSSRule.call(this),this.__href="",this.__media=new CSSOM2.MediaList,this.__layerName=null,this.__supportsText=null,this.__styleSheet=new CSSOM2.CSSStyleSheet};CSSOM2.CSSImportRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSImportRule.prototype.constructor=CSSOM2.CSSImportRule;Object.setPrototypeOf(CSSOM2.CSSImportRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSImportRule.prototype,"type",{value:3,writable:!1});Object.defineProperty(CSSOM2.CSSImportRule.prototype,"cssText",{get:function(){var mediaText=this.media.mediaText;return'@import url("'+this.href.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")+'")'+(this.layerName!==null?" layer"+(this.layerName&&"("+this.layerName+")"):"")+(this.supportsText?" supports("+this.supportsText+")":"")+(mediaText?" "+mediaText:"")+";"}});Object.defineProperty(CSSOM2.CSSImportRule.prototype,"href",{get:function(){return this.__href}});Object.defineProperty(CSSOM2.CSSImportRule.prototype,"media",{get:function(){return this.__media},set:function(value){if(typeof value==="string")this.__media.mediaText=value;else this.__media=value}});Object.defineProperty(CSSOM2.CSSImportRule.prototype,"layerName",{get:function(){return this.__layerName}});Object.defineProperty(CSSOM2.CSSImportRule.prototype,"supportsText",{get:function(){return this.__supportsText}});Object.defineProperty(CSSOM2.CSSImportRule.prototype,"styleSheet",{get:function(){return this.__styleSheet}});Object.defineProperty(CSSOM2.CSSImportRule.prototype,"parse",{value:function(cssText){var i=0,state="",buffer="",index,{layerRegExp,layerRuleNameRegExp,doubleOrMoreSpacesRegExp}=regexPatterns;function extractSupportsContent(text){var supportsIndex=text.indexOf("supports(");if(supportsIndex!==0)return null;var depth=0,start=supportsIndex+9,i=start;for(;i<text.length;i++)if(text[i]==="(")depth++;else if(text[i]===")"){if(depth===0)return{content:text.slice(start,i),endIndex:i};depth--}return null}for(var character;character=cssText.charAt(i);i++)switch(character){case" ":case"\t":case"\r":case`
|
|
7
|
+
`:case"\f":if(state==="after-import")state="url";else buffer+=character;break;case"@":if(!state&&cssText.indexOf("@import",i)===i)state="after-import",i+=6,buffer="";break;case"u":if(state==="media")buffer+=character;if(state==="url"&&cssText.indexOf("url(",i)===i){if(index=cssText.indexOf(")",i+1),index===-1)throw i+': ")" not found';i+=4;var url=cssText.slice(i,index);if(url[0]===url[url.length-1]){if(url[0]==='"'||url[0]==="'")url=url.slice(1,-1)}this.__href=url,i=index,state="media"}break;case'"':if(state==="after-import"||state==="url"){if(index=cssText.indexOf('"',i+1),!index)throw i+`: '"' not found`;this.__href=cssText.slice(i+1,index),i=index,state="media"}break;case"'":if(state==="after-import"||state==="url"){if(index=cssText.indexOf("'",i+1),!index)throw i+`: "'" not found`;this.__href=cssText.slice(i+1,index),i=index,state="media"}break;case";":if(state==="media"){if(buffer){var bufferTrimmed=buffer.trim();if(bufferTrimmed.indexOf("layer")===0){var layerMatch=bufferTrimmed.match(layerRegExp);if(layerMatch){var layerName=layerMatch[1].trim();if(layerName.match(layerRuleNameRegExp)!==null)this.__layerName=layerMatch[1].trim(),bufferTrimmed=bufferTrimmed.replace(layerRegExp,"").replace(doubleOrMoreSpacesRegExp," ").trim();else if(bufferTrimmed){this.media.mediaText=bufferTrimmed;return}}else this.__layerName="",bufferTrimmed=bufferTrimmed.substring(5).trim()}var supportsResult=extractSupportsContent(bufferTrimmed);if(supportsResult)this.__supportsText=supportsResult.content.trim(),bufferTrimmed=bufferTrimmed.slice(0,0)+bufferTrimmed.slice(supportsResult.endIndex+1),bufferTrimmed=bufferTrimmed.replace(doubleOrMoreSpacesRegExp," ").trim();if(bufferTrimmed)this.media.mediaText=bufferTrimmed}}break;default:if(state==="media")buffer+=character;break}}});exports2.CSSImportRule=CSSOM2.CSSImportRule});var require_CSSNamespaceRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSStyleSheet:require_CSSStyleSheet().CSSStyleSheet};CSSOM2.CSSNamespaceRule=function(){CSSOM2.CSSRule.call(this),this.__prefix="",this.__namespaceURI=""};CSSOM2.CSSNamespaceRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSNamespaceRule.prototype.constructor=CSSOM2.CSSNamespaceRule;Object.setPrototypeOf(CSSOM2.CSSNamespaceRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSNamespaceRule.prototype,"type",{value:10,writable:!1});Object.defineProperty(CSSOM2.CSSNamespaceRule.prototype,"cssText",{get:function(){return"@namespace"+(this.prefix&&" "+this.prefix)+' url("'+this.namespaceURI+'");'}});Object.defineProperty(CSSOM2.CSSNamespaceRule.prototype,"prefix",{get:function(){return this.__prefix}});Object.defineProperty(CSSOM2.CSSNamespaceRule.prototype,"namespaceURI",{get:function(){return this.__namespaceURI}});Object.defineProperty(CSSOM2.CSSNamespaceRule.prototype,"parse",{value:function(cssText){var newPrefix="",newNamespaceURI="",text=cssText.trim();if(text.indexOf("@namespace")===0)text=text.slice(10).trim();if(text.charAt(text.length-1)===";")text=text.slice(0,-1).trim();var re=/^(?:([a-zA-Z_][a-zA-Z0-9_-]*)\s+)?(?:url\(\s*(?:(['"])(.*?)\2\s*|([^)]*?))\s*\)|(['"])(.*?)\5)$/,match=text.match(re);if(match){if(match[1])newPrefix=match[1];if(typeof match[3]<"u")newNamespaceURI=match[3];else if(typeof match[4]<"u")newNamespaceURI=match[4].trim();else if(typeof match[6]<"u")newNamespaceURI=match[6];this.__prefix=newPrefix,this.__namespaceURI=newNamespaceURI}else throw new DOMException("Invalid @namespace rule","InvalidStateError")}});exports2.CSSNamespaceRule=CSSOM2.CSSNamespaceRule});var require_CSSConditionRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,CSSGroupingRule:require_CSSGroupingRule().CSSGroupingRule};CSSOM2.CSSConditionRule=function(){CSSOM2.CSSGroupingRule.call(this),this.__conditionText=""};CSSOM2.CSSConditionRule.prototype=Object.create(CSSOM2.CSSGroupingRule.prototype);CSSOM2.CSSConditionRule.prototype.constructor=CSSOM2.CSSConditionRule;Object.setPrototypeOf(CSSOM2.CSSConditionRule,CSSOM2.CSSGroupingRule);Object.defineProperty(CSSOM2.CSSConditionRule.prototype,"conditionText",{get:function(){return this.__conditionText}});exports2.CSSConditionRule=CSSOM2.CSSConditionRule});var require_CSSMediaRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,CSSGroupingRule:require_CSSGroupingRule().CSSGroupingRule,CSSConditionRule:require_CSSConditionRule().CSSConditionRule,MediaList:require_MediaList().MediaList};CSSOM2.CSSMediaRule=function(){CSSOM2.CSSConditionRule.call(this),this.__media=new CSSOM2.MediaList};CSSOM2.CSSMediaRule.prototype=Object.create(CSSOM2.CSSConditionRule.prototype);CSSOM2.CSSMediaRule.prototype.constructor=CSSOM2.CSSMediaRule;Object.setPrototypeOf(CSSOM2.CSSMediaRule,CSSOM2.CSSConditionRule);Object.defineProperty(CSSOM2.CSSMediaRule.prototype,"type",{value:4,writable:!1});Object.defineProperties(CSSOM2.CSSMediaRule.prototype,{media:{get:function(){return this.__media},set:function(value){if(typeof value==="string")this.__media.mediaText=value;else this.__media=value},configurable:!0,enumerable:!0},conditionText:{get:function(){return this.media.mediaText}},cssText:{get:function(){var values="",valuesArr=[" {"];if(this.cssRules.length)valuesArr.push(this.cssRules.reduce(function(acc,rule){if(rule.cssText!=="")acc.push(rule.cssText);return acc},[]).join(`
|
|
8
|
+
`));return values=valuesArr.join(`
|
|
9
|
+
`)+`
|
|
10
|
+
}`,"@media "+this.media.mediaText+values}}});exports2.CSSMediaRule=CSSOM2.CSSMediaRule});var require_CSSCounterStyleRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule};CSSOM2.CSSCounterStyleRule=function(){CSSOM2.CSSRule.call(this),this.name="",this.__props=""};CSSOM2.CSSCounterStyleRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSCounterStyleRule.prototype.constructor=CSSOM2.CSSCounterStyleRule;Object.setPrototypeOf(CSSOM2.CSSCounterStyleRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSCounterStyleRule.prototype,"type",{value:11,writable:!1});Object.defineProperty(CSSOM2.CSSCounterStyleRule.prototype,"cssText",{get:function(){return"@counter-style "+this.name+" { "+this.__props+" }"}});Object.defineProperty(CSSOM2.CSSCounterStyleRule.prototype,"parse",{value:function(cssText){var match=cssText.match(/@counter-style\s+([^\s{]+)\s*\{([^]*)\}/);if(match){this.name=match[1];var propsText=match[2];this.__props=propsText.trim().replace(/\n/g," ").replace(/(['"])(?:\\.|[^\\])*?\1|(\s{2,})/g,function(match,quote){return quote?match:" "})}}});exports2.CSSCounterStyleRule=CSSOM2.CSSCounterStyleRule});var require_CSSPropertyRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule};CSSOM2.CSSPropertyRule=function(){CSSOM2.CSSRule.call(this),this.__name="",this.__syntax="",this.__inherits=!1,this.__initialValue=null};CSSOM2.CSSPropertyRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSPropertyRule.prototype.constructor=CSSOM2.CSSPropertyRule;Object.setPrototypeOf(CSSOM2.CSSPropertyRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSPropertyRule.prototype,"type",{value:0,writable:!1});Object.defineProperty(CSSOM2.CSSPropertyRule.prototype,"cssText",{get:function(){var text="@property "+this.name+" {";if(this.syntax!=="")text+=' syntax: "'+this.syntax.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")+'";';if(text+=" inherits: "+(this.inherits?"true":"false")+";",this.initialValue!==null)text+=" initial-value: "+this.initialValue+";";return text+=" }",text}});Object.defineProperty(CSSOM2.CSSPropertyRule.prototype,"name",{get:function(){return this.__name}});Object.defineProperty(CSSOM2.CSSPropertyRule.prototype,"syntax",{get:function(){return this.__syntax}});Object.defineProperty(CSSOM2.CSSPropertyRule.prototype,"inherits",{get:function(){return this.__inherits}});Object.defineProperty(CSSOM2.CSSPropertyRule.prototype,"initialValue",{get:function(){return this.__initialValue}});Object.defineProperty(CSSOM2.CSSPropertyRule.prototype,"parse",{value:function(cssText){var match=cssText.match(/@property\s+(--[^\s{]+)\s*\{([^]*)\}/);if(!match)return!1;this.__name=match[1];var bodyText=match[2],syntaxMatch=bodyText.match(/syntax\s*:\s*(['"])([^]*?)\1\s*;/);if(!syntaxMatch)return!1;if(this.__syntax=syntaxMatch[2],this.__syntax==="")return!1;var inheritsMatch=bodyText.match(/inherits\s*:\s*(true|false)\s*;/);if(!inheritsMatch)return!1;this.__inherits=inheritsMatch[1]==="true";var initialValueMatch=bodyText.match(/initial-value\s*:\s*([^;]+);/);if(initialValueMatch)this.__initialValue=initialValueMatch[1].trim();else if(this.__syntax!=="*")return!1;return!0}});exports2.CSSPropertyRule=CSSOM2.CSSPropertyRule});var require_CSSContainerRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,CSSGroupingRule:require_CSSGroupingRule().CSSGroupingRule,CSSConditionRule:require_CSSConditionRule().CSSConditionRule};CSSOM2.CSSContainerRule=function(){CSSOM2.CSSConditionRule.call(this)};CSSOM2.CSSContainerRule.prototype=Object.create(CSSOM2.CSSConditionRule.prototype);CSSOM2.CSSContainerRule.prototype.constructor=CSSOM2.CSSContainerRule;Object.setPrototypeOf(CSSOM2.CSSContainerRule,CSSOM2.CSSConditionRule);Object.defineProperty(CSSOM2.CSSContainerRule.prototype,"type",{value:17,writable:!1});Object.defineProperties(CSSOM2.CSSContainerRule.prototype,{cssText:{get:function(){var values="",valuesArr=[" {"];if(this.cssRules.length)valuesArr.push(this.cssRules.reduce(function(acc,rule){if(rule.cssText!=="")acc.push(rule.cssText);return acc},[]).join(`
|
|
11
|
+
`));return values=valuesArr.join(`
|
|
12
|
+
`)+`
|
|
13
|
+
}`,"@container "+this.conditionText+values}},containerName:{get:function(){var parts=this.conditionText.trim().split(/\s+/);if(parts.length>1&&parts[0]!=="("&&!parts[0].startsWith("("))return parts[0];return""}},containerQuery:{get:function(){var parts=this.conditionText.trim().split(/\s+/);if(parts.length>1&&parts[0]!=="("&&!parts[0].startsWith("("))return parts.slice(1).join(" ");return this.conditionText}}});exports2.CSSContainerRule=CSSOM2.CSSContainerRule});var require_CSSSupportsRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,CSSGroupingRule:require_CSSGroupingRule().CSSGroupingRule,CSSConditionRule:require_CSSConditionRule().CSSConditionRule};CSSOM2.CSSSupportsRule=function(){CSSOM2.CSSConditionRule.call(this)};CSSOM2.CSSSupportsRule.prototype=Object.create(CSSOM2.CSSConditionRule.prototype);CSSOM2.CSSSupportsRule.prototype.constructor=CSSOM2.CSSSupportsRule;Object.setPrototypeOf(CSSOM2.CSSSupportsRule,CSSOM2.CSSConditionRule);Object.defineProperty(CSSOM2.CSSSupportsRule.prototype,"type",{value:12,writable:!1});Object.defineProperty(CSSOM2.CSSSupportsRule.prototype,"cssText",{get:function(){var values="",valuesArr=[" {"];if(this.cssRules.length)valuesArr.push(this.cssRules.reduce(function(acc,rule){if(rule.cssText!=="")acc.push(rule.cssText);return acc},[]).join(`
|
|
14
|
+
`));return values=valuesArr.join(`
|
|
15
|
+
`)+`
|
|
16
|
+
}`,"@supports "+this.conditionText+values}});exports2.CSSSupportsRule=CSSOM2.CSSSupportsRule});var require_CSSFontFaceRule=__commonJS(function(exports2){var CSSOM2={CSSStyleDeclaration:require_CSSStyleDeclaration().CSSStyleDeclaration,CSSRule:require_CSSRule().CSSRule};try{CSSOM2.CSSStyleDeclaration=(()=>{throw new Error("Cannot require module "+"cssstyle");})().CSSStyleDeclaration}catch(e){}CSSOM2.CSSFontFaceRule=function(){CSSOM2.CSSRule.call(this),this.__style=new CSSOM2.CSSStyleDeclaration,this.__style.parentRule=this};CSSOM2.CSSFontFaceRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSFontFaceRule.prototype.constructor=CSSOM2.CSSFontFaceRule;Object.setPrototypeOf(CSSOM2.CSSFontFaceRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSFontFaceRule.prototype,"type",{value:5,writable:!1});Object.defineProperty(CSSOM2.CSSFontFaceRule.prototype,"style",{get:function(){return this.__style},set:function(value){if(typeof value==="string")this.__style.cssText=value;else this.__style=value}});Object.defineProperty(CSSOM2.CSSFontFaceRule.prototype,"cssText",{get:function(){return"@font-face {"+(this.style.cssText?" "+this.style.cssText:"")+" }"}});exports2.CSSFontFaceRule=CSSOM2.CSSFontFaceRule});var require_CSSHostRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList};CSSOM2.CSSHostRule=function(){CSSOM2.CSSRule.call(this),this.cssRules=new CSSOM2.CSSRuleList};CSSOM2.CSSHostRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSHostRule.prototype.constructor=CSSOM2.CSSHostRule;Object.setPrototypeOf(CSSOM2.CSSHostRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSHostRule.prototype,"type",{value:1001,writable:!1});Object.defineProperty(CSSOM2.CSSHostRule.prototype,"cssText",{get:function(){var values="",valuesArr=[" {"];if(this.cssRules.length)valuesArr.push(this.cssRules.reduce(function(acc,rule){if(rule.cssText!=="")acc.push(rule.cssText);return acc},[]).join(`
|
|
17
|
+
`));return values=valuesArr.join(`
|
|
18
|
+
`)+`
|
|
19
|
+
}`,"@host"+values}});exports2.CSSHostRule=CSSOM2.CSSHostRule});var require_CSSStartingStyleRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,CSSGroupingRule:require_CSSGroupingRule().CSSGroupingRule};CSSOM2.CSSStartingStyleRule=function(){CSSOM2.CSSGroupingRule.call(this)};CSSOM2.CSSStartingStyleRule.prototype=Object.create(CSSOM2.CSSGroupingRule.prototype);CSSOM2.CSSStartingStyleRule.prototype.constructor=CSSOM2.CSSStartingStyleRule;Object.setPrototypeOf(CSSOM2.CSSStartingStyleRule,CSSOM2.CSSGroupingRule);Object.defineProperty(CSSOM2.CSSStartingStyleRule.prototype,"type",{value:1002,writable:!1});Object.defineProperty(CSSOM2.CSSStartingStyleRule.prototype,"cssText",{get:function(){var values="",valuesArr=[" {"];if(this.cssRules.length)valuesArr.push(this.cssRules.reduce(function(acc,rule){if(rule.cssText!=="")acc.push(rule.cssText);return acc},[]).join(`
|
|
20
|
+
`));return values=valuesArr.join(`
|
|
21
|
+
`)+`
|
|
22
|
+
}`,"@starting-style"+values}});exports2.CSSStartingStyleRule=CSSOM2.CSSStartingStyleRule});var require_CSSKeyframeRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSStyleDeclaration:require_CSSStyleDeclaration().CSSStyleDeclaration};try{CSSOM2.CSSStyleDeclaration=(()=>{throw new Error("Cannot require module "+"cssstyle");})().CSSStyleDeclaration}catch(e){}CSSOM2.CSSKeyframeRule=function(){CSSOM2.CSSRule.call(this),this.keyText="",this.__style=new CSSOM2.CSSStyleDeclaration,this.__style.parentRule=this};CSSOM2.CSSKeyframeRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSKeyframeRule.prototype.constructor=CSSOM2.CSSKeyframeRule;Object.setPrototypeOf(CSSOM2.CSSKeyframeRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSKeyframeRule.prototype,"type",{value:8,writable:!1});Object.defineProperty(CSSOM2.CSSKeyframeRule.prototype,"style",{get:function(){return this.__style},set:function(value){if(typeof value==="string")this.__style.cssText=value;else this.__style=value}});Object.defineProperty(CSSOM2.CSSKeyframeRule.prototype,"cssText",{get:function(){return this.keyText+" {"+(this.style.cssText?" "+this.style.cssText:"")+" }"}});exports2.CSSKeyframeRule=CSSOM2.CSSKeyframeRule});var require_CSSKeyframesRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,parse:require_parse().parse},errorUtils2=require_errorUtils().errorUtils;CSSOM2.CSSKeyframesRule=function(){CSSOM2.CSSRule.call(this),this.name="",this.cssRules=new CSSOM2.CSSRuleList,this._setupIndexedAccess();var self=this,originalPush=this.cssRules.push,originalSplice=this.cssRules.splice;Object.defineProperty(this.cssRules,"push",{value:function(){var result=originalPush.apply(this,arguments);return self._setupIndexedAccess(),result},writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(this.cssRules,"splice",{value:function(){var result=originalSplice.apply(this,arguments);return self._setupIndexedAccess(),result},writable:!0,enumerable:!1,configurable:!0})};CSSOM2.CSSKeyframesRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSKeyframesRule.prototype.constructor=CSSOM2.CSSKeyframesRule;Object.setPrototypeOf(CSSOM2.CSSKeyframesRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSKeyframesRule.prototype,"type",{value:7,writable:!1});Object.defineProperty(CSSOM2.CSSKeyframesRule.prototype,"cssText",{get:function(){var values="",valuesArr=[" {"];if(this.cssRules.length)valuesArr.push(this.cssRules.reduce(function(acc,rule){if(rule.cssText!=="")acc.push(rule.cssText);return acc},[]).join(`
|
|
23
|
+
`));values=valuesArr.join(`
|
|
24
|
+
`)+`
|
|
25
|
+
}`;var cssWideKeywords=["initial","inherit","revert","revert-layer","unset","none"],processedName=cssWideKeywords.includes(this.name)?'"'+this.name+'"':this.name;return"@"+(this._vendorPrefix||"")+"keyframes "+processedName+values}});CSSOM2.CSSKeyframesRule.prototype.appendRule=function(rule){if(arguments.length===0)errorUtils2.throwMissingArguments(this,"appendRule","CSSKeyframesRule");var parsedRule;try{var tempStyleSheet=CSSOM2.parse("@keyframes temp { "+rule+" }");if(tempStyleSheet.cssRules.length>0&&tempStyleSheet.cssRules[0].cssRules.length>0)parsedRule=tempStyleSheet.cssRules[0].cssRules[0];else throw Error("Failed to parse keyframe rule")}catch(e){errorUtils2.throwParseError(this,"appendRule","CSSKeyframesRule",rule)}parsedRule.__parentRule=this,this.cssRules.push(parsedRule)};CSSOM2.CSSKeyframesRule.prototype.deleteRule=function(select){if(arguments.length===0)errorUtils2.throwMissingArguments(this,"deleteRule","CSSKeyframesRule");var normalizedSelect=this._normalizeKeyText(select);for(var i=0;i<this.cssRules.length;i++){var rule=this.cssRules[i];if(this._normalizeKeyText(rule.keyText)===normalizedSelect){rule.__parentRule=null,this.cssRules.splice(i,1);return}}};CSSOM2.CSSKeyframesRule.prototype.findRule=function(select){if(arguments.length===0)errorUtils2.throwMissingArguments(this,"findRule","CSSKeyframesRule");var normalizedSelect=this._normalizeKeyText(select);for(var i=this.cssRules.length-1;i>=0;i--){var rule=this.cssRules[i];if(this._normalizeKeyText(rule.keyText)===normalizedSelect)return rule}return null};CSSOM2.CSSKeyframesRule.prototype._normalizeKeyText=function(keyText){if(!keyText)return"";var normalized2=keyText.toString().trim().toLowerCase();if(normalized2==="from")return"0%";else if(normalized2==="to")return"100%";return normalized2};if(typeof Symbol<"u"&&Symbol.iterator)CSSOM2.CSSKeyframesRule.prototype[Symbol.iterator]=function(){var index=0,cssRules=this.cssRules;return{next:function(){if(index<cssRules.length)return{value:cssRules[index++],done:!1};else return{done:!0}}}};CSSOM2.CSSKeyframesRule.prototype._setupIndexedAccess=function(){for(var i=0;i<1000;i++)if(this.hasOwnProperty(i))delete this[i];else break;for(var i=0;i<this.cssRules.length;i++)(function(index){Object.defineProperty(this,index,{get:function(){return this.cssRules[index]},enumerable:!1,configurable:!0})}).call(this,i);Object.defineProperty(this,"length",{get:function(){return this.cssRules.length},enumerable:!1,configurable:!0})};exports2.CSSKeyframesRule=CSSOM2.CSSKeyframesRule});var require_CSSValue=__commonJS(function(exports2){var CSSOM2={};CSSOM2.CSSValue=function(){};CSSOM2.CSSValue.prototype={constructor:CSSOM2.CSSValue,set cssText(text){var name=this._getConstructorName();throw Error('DOMException: property "cssText" of "'+name+'" is readonly and can not be replaced with "'+text+'"!')},get cssText(){var name=this._getConstructorName();throw Error('getter "cssText" of "'+name+'" is not implemented!')},_getConstructorName:function(){var s=this.constructor.toString(),c=s.match(/function\s([^\(]+)/),name=c[1];return name}};exports2.CSSValue=CSSOM2.CSSValue});var require_CSSValueExpression=__commonJS(function(exports2){var CSSOM2={CSSValue:require_CSSValue().CSSValue};CSSOM2.CSSValueExpression=function(token,idx){this._token=token,this._idx=idx};CSSOM2.CSSValueExpression.prototype=Object.create(CSSOM2.CSSValue.prototype);CSSOM2.CSSValueExpression.prototype.constructor=CSSOM2.CSSValueExpression;Object.setPrototypeOf(CSSOM2.CSSValueExpression,CSSOM2.CSSValue);CSSOM2.CSSValueExpression.prototype.parse=function(){var token=this._token,idx=this._idx,character="",expression="",error="",info,paren=[];for(;;++idx){if(character=token.charAt(idx),character===""){error="css expression error: unfinished expression!";break}switch(character){case"(":paren.push(character),expression+=character;break;case")":paren.pop(character),expression+=character;break;case"/":if(info=this._parseJSComment(token,idx))if(info.error)error="css expression error: unfinished comment in expression!";else idx=info.idx;else if(info=this._parseJSRexExp(token,idx))idx=info.idx,expression+=info.text;else expression+=character;break;case"'":case'"':if(info=this._parseJSString(token,idx,character),info)idx=info.idx,expression+=info.text;else expression+=character;break;default:expression+=character;break}if(error)break;if(paren.length===0)break}var ret;if(error)ret={error};else ret={idx,expression};return ret};CSSOM2.CSSValueExpression.prototype._parseJSComment=function(token,idx){var nextChar=token.charAt(idx+1),text;if(nextChar==="/"||nextChar==="*"){var startIdx=idx,endIdx,commentEndChar;if(nextChar==="/")commentEndChar=`
|
|
26
|
+
`;else if(nextChar==="*")commentEndChar="*/";if(endIdx=token.indexOf(commentEndChar,startIdx+1+1),endIdx!==-1)return endIdx=endIdx+commentEndChar.length-1,text=token.substring(idx,endIdx+1),{idx:endIdx,text};else{var error="css expression error: unfinished comment in expression!";return{error}}}else return!1};CSSOM2.CSSValueExpression.prototype._parseJSString=function(token,idx,sep){var endIdx=this._findMatchedIdx(token,idx,sep),text;if(endIdx===-1)return!1;else return text=token.substring(idx,endIdx+sep.length),{idx:endIdx,text}};CSSOM2.CSSValueExpression.prototype._parseJSRexExp=function(token,idx){var before=token.substring(0,idx).replace(/\s+$/,""),legalRegx=[/^$/,/\($/,/\[$/,/\!$/,/\+$/,/\-$/,/\*$/,/\/\s+/,/\%$/,/\=$/,/\>$/,/<$/,/\&$/,/\|$/,/\^$/,/\~$/,/\?$/,/\,$/,/delete$/,/in$/,/instanceof$/,/new$/,/typeof$/,/void$/],isLegal=legalRegx.some(function(reg){return reg.test(before)});if(!isLegal)return!1;else{var sep="/";return this._parseJSString(token,idx,sep)}};CSSOM2.CSSValueExpression.prototype._findMatchedIdx=function(token,idx,sep){var startIdx=idx,endIdx,NOT_FOUND=-1;while(!0)if(endIdx=token.indexOf(sep,startIdx+1),endIdx===-1){endIdx=NOT_FOUND;break}else{var text=token.substring(idx+1,endIdx),matched=text.match(/\\+$/);if(!matched||matched[0]%2===0)break;else startIdx=endIdx}var nextNewLineIdx=token.indexOf(`
|
|
27
|
+
`,idx+1);if(nextNewLineIdx<endIdx)endIdx=NOT_FOUND;return endIdx};exports2.CSSValueExpression=CSSOM2.CSSValueExpression});var require_MatcherList=__commonJS(function(exports2){var CSSOM2={};CSSOM2.MatcherList=function(){this.length=0};CSSOM2.MatcherList.prototype={constructor:CSSOM2.MatcherList,get matcherText(){return Array.prototype.join.call(this,", ")},set matcherText(value){var values=value.split(","),length=this.length=values.length;for(var i=0;i<length;i++)this[i]=values[i].trim()},appendMatcher:function(matcher){if(Array.prototype.indexOf.call(this,matcher)===-1)this[this.length]=matcher,this.length++},deleteMatcher:function(matcher){var index=Array.prototype.indexOf.call(this,matcher);if(index!==-1)Array.prototype.splice.call(this,index,1)}};exports2.MatcherList=CSSOM2.MatcherList});var require_CSSDocumentRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,MatcherList:require_MatcherList().MatcherList};CSSOM2.CSSDocumentRule=function(){CSSOM2.CSSRule.call(this),this.matcher=new CSSOM2.MatcherList,this.cssRules=new CSSOM2.CSSRuleList};CSSOM2.CSSDocumentRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSDocumentRule.prototype.constructor=CSSOM2.CSSDocumentRule;Object.setPrototypeOf(CSSOM2.CSSDocumentRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSDocumentRule.prototype,"type",{value:10,writable:!1});Object.defineProperty(CSSOM2.CSSDocumentRule.prototype,"cssText",{get:function(){var cssTexts=[];for(var i=0,length=this.cssRules.length;i<length;i++)cssTexts.push(this.cssRules[i].cssText);return"@-moz-document "+this.matcher.matcherText+" {"+(cssTexts.length?`
|
|
28
|
+
`+cssTexts.join(`
|
|
29
|
+
`):"")+`
|
|
30
|
+
}`}});exports2.CSSDocumentRule=CSSOM2.CSSDocumentRule});var require_CSSScopeRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,CSSGroupingRule:require_CSSGroupingRule().CSSGroupingRule};CSSOM2.CSSScopeRule=function(){CSSOM2.CSSGroupingRule.call(this),this.__start=null,this.__end=null};CSSOM2.CSSScopeRule.prototype=Object.create(CSSOM2.CSSGroupingRule.prototype);CSSOM2.CSSScopeRule.prototype.constructor=CSSOM2.CSSScopeRule;Object.setPrototypeOf(CSSOM2.CSSScopeRule,CSSOM2.CSSGroupingRule);Object.defineProperties(CSSOM2.CSSScopeRule.prototype,{type:{value:0,writable:!1},cssText:{get:function(){var values="",valuesArr=[" {"];if(this.cssRules.length)valuesArr.push(this.cssRules.reduce(function(acc,rule){if(rule.cssText!=="")acc.push(rule.cssText);return acc},[]).join(`
|
|
31
|
+
`));return values=valuesArr.join(`
|
|
32
|
+
`)+`
|
|
33
|
+
}`,"@scope"+(this.start?" ("+this.start+")":"")+(this.end?" to ("+this.end+")":"")+values},configurable:!0,enumerable:!0},start:{get:function(){return this.__start}},end:{get:function(){return this.__end}}});exports2.CSSScopeRule=CSSOM2.CSSScopeRule});var require_CSSLayerBlockRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,CSSGroupingRule:require_CSSGroupingRule().CSSGroupingRule};CSSOM2.CSSLayerBlockRule=function(){CSSOM2.CSSGroupingRule.call(this),this.name=""};CSSOM2.CSSLayerBlockRule.prototype=Object.create(CSSOM2.CSSGroupingRule.prototype);CSSOM2.CSSLayerBlockRule.prototype.constructor=CSSOM2.CSSLayerBlockRule;Object.setPrototypeOf(CSSOM2.CSSLayerBlockRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSLayerBlockRule.prototype,"type",{value:18,writable:!1});Object.defineProperties(CSSOM2.CSSLayerBlockRule.prototype,{cssText:{get:function(){var values="",valuesArr=[" {"];if(this.cssRules.length)valuesArr.push(this.cssRules.reduce(function(acc,rule){if(rule.cssText!=="")acc.push(rule.cssText);return acc},[]).join(`
|
|
34
|
+
`));return values=valuesArr.join(`
|
|
35
|
+
`)+`
|
|
36
|
+
}`,"@layer"+(this.name?" "+this.name:"")+values}}});exports2.CSSLayerBlockRule=CSSOM2.CSSLayerBlockRule});var require_CSSLayerStatementRule=__commonJS(function(exports2){var CSSOM2={CSSRule:require_CSSRule().CSSRule};CSSOM2.CSSLayerStatementRule=function(){CSSOM2.CSSRule.call(this),this.nameList=[]};CSSOM2.CSSLayerStatementRule.prototype=Object.create(CSSOM2.CSSRule.prototype);CSSOM2.CSSLayerStatementRule.prototype.constructor=CSSOM2.CSSLayerStatementRule;Object.setPrototypeOf(CSSOM2.CSSLayerStatementRule,CSSOM2.CSSRule);Object.defineProperty(CSSOM2.CSSLayerStatementRule.prototype,"type",{value:0,writable:!1});Object.defineProperties(CSSOM2.CSSLayerStatementRule.prototype,{cssText:{get:function(){return"@layer "+this.nameList.join(", ")+";"}}});exports2.CSSLayerStatementRule=CSSOM2.CSSLayerStatementRule});var require_CSSPageRule=__commonJS(function(exports2){var CSSOM2={CSSStyleDeclaration:require_CSSStyleDeclaration().CSSStyleDeclaration,CSSRule:require_CSSRule().CSSRule,CSSRuleList:require_CSSRuleList().CSSRuleList,CSSGroupingRule:require_CSSGroupingRule().CSSGroupingRule},regexPatterns=require_regexPatterns().regexPatterns;try{CSSOM2.CSSStyleDeclaration=(()=>{throw new Error("Cannot require module "+"cssstyle");})().CSSStyleDeclaration}catch(e){}CSSOM2.CSSPageRule=function(){CSSOM2.CSSGroupingRule.call(this),this.__style=new CSSOM2.CSSStyleDeclaration,this.__style.parentRule=this};CSSOM2.CSSPageRule.prototype=Object.create(CSSOM2.CSSGroupingRule.prototype);CSSOM2.CSSPageRule.prototype.constructor=CSSOM2.CSSPageRule;Object.setPrototypeOf(CSSOM2.CSSPageRule,CSSOM2.CSSGroupingRule);Object.defineProperty(CSSOM2.CSSPageRule.prototype,"type",{value:6,writable:!1});Object.defineProperty(CSSOM2.CSSPageRule.prototype,"selectorText",{get:function(){return this.__selectorText},set:function(value){if(typeof value==="string"){var trimmedValue=value.trim();if(trimmedValue===""){this.__selectorText="";return}var{atPageRuleSelectorRegExp,cssCustomIdentifierRegExp}=regexPatterns,match=trimmedValue.match(atPageRuleSelectorRegExp);if(match){var pageName=match[1]||"",pseudoPages=match[2]||"";if(pageName){if(!cssCustomIdentifierRegExp.test(pageName))return}if(pseudoPages){var pseudos=pseudoPages.split(":").filter(function(p){return p}),validPseudos=["left","right","first","blank"],allValid=!0;for(var j=0;j<pseudos.length;j++)if(validPseudos.indexOf(pseudos[j].toLowerCase())===-1){allValid=!1;break}if(!allValid)return}this.__selectorText=pageName+pseudoPages.toLowerCase()}}}});Object.defineProperty(CSSOM2.CSSPageRule.prototype,"style",{get:function(){return this.__style},set:function(value){if(typeof value==="string")this.__style.cssText=value;else this.__style=value}});Object.defineProperty(CSSOM2.CSSPageRule.prototype,"cssText",{get:function(){var values="";if(this.cssRules.length){var valuesArr=[" {"];this.style.cssText&&valuesArr.push(this.style.cssText),valuesArr.push(this.cssRules.reduce(function(acc,rule){if(rule.cssText!=="")acc.push(rule.cssText);return acc},[]).join(`
|
|
37
|
+
`)),values=valuesArr.join(`
|
|
38
|
+
`)+`
|
|
39
|
+
}`}else values=" {"+(this.style.cssText?" "+this.style.cssText:"")+" }";return"@page"+(this.selectorText?" "+this.selectorText:"")+values}});exports2.CSSPageRule=CSSOM2.CSSPageRule});var require_cssstyleTryCatchBlock=__commonJS(function(){try{CSSOM.CSSStyleDeclaration=(()=>{throw new Error("Cannot require module "+"cssstyle");})().CSSStyleDeclaration}catch(e){}});var require_parse=__commonJS(function(exports2){var CSSOM2={},regexPatterns=require_regexPatterns().regexPatterns;CSSOM2.parse=function(token,opts,errorHandler){errorHandler=errorHandler===!0?console&&console.error:errorHandler;var i=0,state="before-selector",index,buffer="",valueParenthesisDepth=0,hasUnmatchedQuoteInSelector=!1,SIGNIFICANT_WHITESPACE={name:!0,"before-name":!0,selector:!0,value:!0,"value-parenthesis":!0,atRule:!0,"importRule-begin":!0,importRule:!0,"namespaceRule-begin":!0,namespaceRule:!0,atBlock:!0,containerBlock:!0,conditionBlock:!0,counterStyleBlock:!0,propertyBlock:!0,"documentRule-begin":!0,scopeBlock:!0,layerBlock:!0,pageBlock:!0},styleSheet;if(opts&&opts.styleSheet)styleSheet=opts.styleSheet;else{if(opts&&opts.globalObject&&opts.globalObject.CSSStyleSheet)styleSheet=new opts.globalObject.CSSStyleSheet;else styleSheet=new CSSOM2.CSSStyleSheet;styleSheet.__constructed=!1}var topScope;if(opts&&opts.cssRules)topScope={cssRules:opts.cssRules};else topScope=styleSheet;if(opts&&opts.ownerNode){styleSheet.__ownerNode=opts.ownerNode;var ownerNodeMedia=opts.ownerNode.media||opts.ownerNode.getAttribute&&opts.ownerNode.getAttribute("media");if(ownerNodeMedia)styleSheet.media.mediaText=ownerNodeMedia;var ownerNodeTitle=opts.ownerNode.title||opts.ownerNode.getAttribute&&opts.ownerNode.getAttribute("title");if(ownerNodeTitle)styleSheet.__title=ownerNodeTitle}if(opts&&opts.ownerRule)styleSheet.__ownerRule=opts.ownerRule;var currentScope=topScope,parentRule,ancestorRules=[],prevScope,name,priority="",styleRule,mediaRule,containerRule,counterStyleRule,propertyRule,supportsRule,importRule,fontFaceRule,keyframesRule,documentRule,hostRule,startingStyleRule,scopeRule,pageRule,layerBlockRule,layerStatementRule,nestedSelectorRule,namespaceRule,definedNamespacePrefixes={},ruleIdCounter=0,addedToParent={},addedToTopScope={},addedToCurrentScope={};function getRuleId(rule){if(!rule.__parseId)rule.__parseId=++ruleIdCounter;return rule.__parseId}var lastValidationBoundary=0,validationRegexCache={};function getValidationRegex(atRuleKey){if(!validationRegexCache[atRuleKey]){var sourceRuleRegExp=atRuleKey==="@import"?forwardImportRuleValidationRegExp:forwardRuleValidationRegExp;validationRegexCache[atRuleKey]=new RegExp(atRuleKey+sourceRuleRegExp.source,sourceRuleRegExp.flags)}return validationRegexCache[atRuleKey]}var{atKeyframesRegExp,beforeRulePortionRegExp,beforeRuleValidationRegExp,forwardRuleValidationRegExp,forwardImportRuleValidationRegExp}=regexPatterns,regexBefore=new RegExp(beforeRulePortionRegExp.source,beforeRulePortionRegExp.flags),{forwardRuleClosingBraceRegExp,forwardRuleSemicolonAndOpeningBraceRegExp,cssCustomIdentifierRegExp,startsWithCombinatorRegExp,atPageRuleSelectorRegExp,startsWithHexEscapeRegExp,identStartCharRegExp,identCharRegExp,specialCharsNeedEscapeRegExp,combinatorOrSeparatorRegExp,afterHexEscapeSeparatorRegExp,trailingSpaceSeparatorRegExp,endsWithHexEscapeRegExp,attributeSelectorContentRegExp,pseudoElementRegExp,invalidCombinatorLtGtRegExp,invalidCombinatorDoubleGtRegExp,consecutiveCombinatorsRegExp,invalidSlottedRegExp,invalidPartRegExp,invalidCueRegExp,invalidCueRegionRegExp,invalidNestingPattern,emptyPseudoClassRegExp,whitespaceNormalizationRegExp,newlineRemovalRegExp,whitespaceAndDotRegExp,declarationOrOpenBraceRegExp,ampersandRegExp,hexEscapeSequenceRegExp,attributeCaseFlagRegExp,prependedAmpersandRegExp,openBraceGlobalRegExp,closeBraceGlobalRegExp,scopePreludeSplitRegExp,leadingWhitespaceRegExp,doubleQuoteRegExp,backslashRegExp,invalidMediaOperatorWithoutSpaceRegExp,invalidMediaNotAfterOperatorRegExp,invalidMediaNotIdentifierRegExp,invalidMediaNotAfterFeatureRegExp,invalidMediaOperatorBetweenParensRegExp,invalidMediaNotWithMediaTypeRegExp,mediaFeatureColonRegExp,identifierBeforeParenRegExp,mediaAndOperatorRegExp,mediaOrOperatorRegExp,mediaNotOperatorStartRegExp,mediaNotOperatorRegExp}=regexPatterns;function atRulesStatemenRegExpES5Alternative(ruleSlice){for(var i=0;i<ruleSlice.length;i++){var char=ruleSlice[i];if(char===";"||char==="}"){var sliceBefore=ruleSlice.substring(0,i),openBraceIndex=sliceBefore.indexOf("{");if(openBraceIndex===-1){var match=char,j=i+1;while(j<ruleSlice.length&&/\s/.test(ruleSlice[j]))match+=ruleSlice[j],j++;var matchObj=[match];return matchObj.index=i,matchObj.input=ruleSlice,matchObj}}}return null}function matchBalancedBlock(str,fromIndex){fromIndex=fromIndex||0;var openIndex=str.indexOf("{",fromIndex);if(openIndex===-1)return null;var depth=0;for(var i=openIndex;i<str.length;i++)if(str[i]==="{")depth++;else if(str[i]==="}"){if(depth--,depth===0){var matchedString=str.slice(openIndex,i+1);return{0:matchedString,index:openIndex,input:str}}}return null}function ignoreBalancedBlock(i,str,fromIndex){var ruleClosingMatch=matchBalancedBlock(str,fromIndex);if(ruleClosingMatch){var ignoreRange=ruleClosingMatch.index+ruleClosingMatch[0].length;if(i+=ignoreRange,token.charAt(i)==="}")i-=1}else i+=str.length;return i}function parseScopePrelude(preludeContent){var parts=preludeContent.split(scopePreludeSplitRegExp);if(parts.length===2)parts[0]=parts[0]+")",parts[1]="("+parts[1];var hasStart=parts[0]&&parts[0].charAt(0)==="("&&parts[0].charAt(parts[0].length-1)===")",hasEnd=parts[1]&&parts[1].charAt(0)==="("&&parts[1].charAt(parts[1].length-1)===")",hasOnlyEnd=!hasStart&&!hasEnd&&parts[0].indexOf("to (")===0&&parts[0].charAt(parts[0].length-1)===")",startSelector="",endSelector="";if(hasStart)startSelector=parts[0].slice(1,-1).trim();if(hasEnd)endSelector=parts[1].slice(1,-1).trim();if(hasOnlyEnd)endSelector=parts[0].slice(4,-1).trim();return{startSelector,endSelector,hasStart,hasEnd,hasOnlyEnd}}function hasPseudoElement(selector){return pseudoElementRegExp.test(selector)}function validateBalancedSyntax(selector,trackAttributes,useStack){var parenDepth=0,bracketDepth=0,inSingleQuote=!1,inDoubleQuote=!1,inAttr=!1,stack=useStack?[]:null;for(var i=0;i<selector.length;i++){var char=selector[i];if(char==="\\"){var escapeLen=getEscapeSequenceLength(selector,i);if(escapeLen>0){i+=escapeLen-1;continue}}if(inSingleQuote){if(char==="'")inSingleQuote=!1}else if(inDoubleQuote){if(char==='"')inDoubleQuote=!1}else if(trackAttributes&&inAttr){if(char==="]")inAttr=!1;else if(char==="'")inSingleQuote=!0;else if(char==='"')inDoubleQuote=!0}else if(trackAttributes&&char==="[")inAttr=!0;else if(char==="'")inSingleQuote=!0;else if(char==='"')inDoubleQuote=!0;else if(char==="(")if(useStack)stack.push("(");else parenDepth++;else if(char===")"){if(useStack){if(!stack.length||stack.pop()!=="(")return!1}else if(parenDepth--,parenDepth<0)return!1}else if(char==="[")bracketDepth++;else if(char==="]"){if(bracketDepth--,bracketDepth<0)return!1}}if(useStack)return stack.length===0&&bracketDepth===0&&!inSingleQuote&&!inDoubleQuote&&!inAttr;else return parenDepth===0&&bracketDepth===0&&!inSingleQuote&&!inDoubleQuote}function hasBasicSyntaxError(selector){return!validateBalancedSyntax(selector,!1,!1)}function hasInvalidCombinators(selector){if(invalidCombinatorLtGtRegExp.test(selector))return!0;if(invalidCombinatorDoubleGtRegExp.test(selector))return!0;if(consecutiveCombinatorsRegExp.test(selector))return!0;return!1}function hasInvalidPseudoSyntax(selector){var invalidPatterns=[invalidSlottedRegExp,invalidPartRegExp,invalidCueRegExp,invalidCueRegionRegExp];for(var i=0;i<invalidPatterns.length;i++)if(invalidPatterns[i].test(selector))return!0;return!1}function hasInvalidNestingSelector(selector){return invalidNestingPattern.test(selector)}function canAtRuleBeNested(){if(currentScope===topScope)return!0;var hasStyleRuleInChain=!1,hasValidParent=!1;if(currentScope.constructor.name==="CSSStyleRule")hasStyleRuleInChain=!0;else if(currentScope instanceof CSSOM2.CSSScopeRule||currentScope instanceof CSSOM2.CSSConditionRule)hasValidParent=!0;if(!hasStyleRuleInChain)for(var j=0;j<ancestorRules.length;j++){if(ancestorRules[j].constructor.name==="CSSStyleRule"){hasStyleRuleInChain=!0;break}if(ancestorRules[j]instanceof CSSOM2.CSSScopeRule||ancestorRules[j]instanceof CSSOM2.CSSConditionRule)hasValidParent=!0}return hasValidParent&&!hasStyleRuleInChain}function validateAtRule(atRuleKey,validCallback,cannotBeNested){var isValid=!1,ruleRegExp=getValidationRegex(atRuleKey),lookAheadLength=Math.min(100,token.length-i),ruleSlice=token.slice(i,i+lookAheadLength),shouldPerformCheck=cannotBeNested&¤tScope!==topScope?!1:!0;if(shouldPerformCheck&&ruleSlice.search(ruleRegExp)===0){var searchStart=Math.max(0,lastValidationBoundary),beforeSlice=token.slice(searchStart,i),matches=beforeSlice.match(regexBefore),lastI=matches?searchStart+beforeSlice.lastIndexOf(matches[matches.length-1]):searchStart,toCheckSlice=token.slice(lastI,i),checkedSlice=toCheckSlice.search(beforeRuleValidationRegExp);if(checkedSlice===0)isValid=!0,lastValidationBoundary=lastI}if(isValid&&atRuleKey==="@scope"){var openBraceIndex=ruleSlice.indexOf("{");if(openBraceIndex!==-1){var rulePrelude=ruleSlice.slice(0,openBraceIndex).trim(),preludeContent=rulePrelude.slice(6).trim();if(preludeContent.length>0){var parsedScopePrelude=parseScopePrelude(preludeContent),{startSelector,endSelector,hasStart,hasEnd,hasOnlyEnd}=parsedScopePrelude;if(hasStart&&startSelector===""||hasEnd&&endSelector===""||hasOnlyEnd&&endSelector==="")isValid=!1;else if(startSelector&&hasPseudoElement(startSelector)||endSelector&&hasPseudoElement(endSelector))isValid=!1;else if(startSelector&&hasBasicSyntaxError(startSelector)||endSelector&&hasBasicSyntaxError(endSelector))isValid=!1;else if(startSelector&&hasInvalidCombinators(startSelector)||endSelector&&hasInvalidCombinators(endSelector))isValid=!1;else if(startSelector&&hasInvalidPseudoSyntax(startSelector)||endSelector&&hasInvalidPseudoSyntax(endSelector))isValid=!1;else if(!hasStart&&!hasOnlyEnd)isValid=!1}}}if(isValid&&atRuleKey==="@page"){var openBraceIndex=ruleSlice.indexOf("{");if(openBraceIndex!==-1){var rulePrelude=ruleSlice.slice(0,openBraceIndex).trim(),preludeContent=rulePrelude.slice(5).trim();if(preludeContent.length>0){var trimmedValue=preludeContent.trim();if(trimmedValue!==""){var match=trimmedValue.match(atPageRuleSelectorRegExp);if(match){var pageName=match[1]||"",pseudoPages=match[2]||"";if(pageName){if(!cssCustomIdentifierRegExp.test(pageName))isValid=!1}if(pseudoPages){var pseudos=pseudoPages.split(":").filter(function(p){return p}),validPseudos=["left","right","first","blank"],allValid=!0;for(var j=0;j<pseudos.length;j++)if(validPseudos.indexOf(pseudos[j].toLowerCase())===-1){allValid=!1;break}if(!allValid)isValid=!1}}else isValid=!1}}}}if(!isValid){var ruleStatementMatch=atRulesStatemenRegExpES5Alternative(ruleSlice);if(ruleStatementMatch&¤tScope!==topScope){var ignoreEnd=ruleStatementMatch[0].indexOf(";");i+=ruleStatementMatch.index+ignoreEnd;return}if(atRuleKey==="@layer"){var ruleSemicolonAndOpeningBraceMatch=ruleSlice.match(forwardRuleSemicolonAndOpeningBraceRegExp);if(ruleSemicolonAndOpeningBraceMatch&&ruleSemicolonAndOpeningBraceMatch[1]===";"){i+=ruleSemicolonAndOpeningBraceMatch.index+ruleSemicolonAndOpeningBraceMatch[0].length,state="before-selector";return}}i=ignoreBalancedBlock(i,ruleSlice),state="before-selector"}else validCallback.call(this)}function isIdentStart(c){return/[a-zA-Z_\u00A0-\uFFFF]/.test(c)}function isIdentChar(c){return/[a-zA-Z0-9_\u00A0-\uFFFF\-]/.test(c)}function looseSelectorValidator(selector){if(!selector||selector.length===0)return!1;var i=0,len=selector.length,hasMatchedComponent=!1;function skipEscape(){if(i<len&&selector[i]==="\\"){var escapeLen=getEscapeSequenceLength(selector,i);if(escapeLen>0)return i+=escapeLen,!0}return!1}function parseIdentifier(){var start=i;while(i<len)if(skipEscape())continue;else if(isIdentChar(selector[i]))i++;else break;return i>start}function parseNamespace(){var start=i;if(i<len&&selector[i]==="*")i++;else if(i<len&&(isIdentStart(selector[i])||selector[i]==="\\"))parseIdentifier();if(i<len&&selector[i]==="|")return i++,!0;return i=start,!1}function parsePseudoArgs(){if(i>=len||selector[i]!=="(")return!1;i++;var depth=1,inString=!1,stringChar="";while(i<len&&depth>0){var c=selector[i];if(c==="\\"&&i+1<len)i+=2;else if(!inString&&(c==='"'||c==="'"))inString=!0,stringChar=c,i++;else if(inString&&c===stringChar)inString=!1,i++;else if(!inString&&c==="(")depth++,i++;else if(!inString&&c===")")depth--,i++;else i++}return depth===0}while(i<len){var matched=!1,start=i;while(i<len&&/\s/.test(selector[i]))i++;if(i>start){hasMatchedComponent=!0;continue}if(i<len&&/[>+~]/.test(selector[i])){i++,hasMatchedComponent=!0;while(i<len&&/\s/.test(selector[i]))i++;continue}if(i<len&&selector[i]==="&")i++,hasMatchedComponent=!0,matched=!0;else if(i<len&&selector[i]==="."){if(i++,parseIdentifier())hasMatchedComponent=!0,matched=!0}else if(i<len&&selector[i]==="#"){if(i++,parseIdentifier())hasMatchedComponent=!0,matched=!0}else if(i<len&&selector[i]===":"){if(i++,i<len&&selector[i]===":")i++;if(parseIdentifier())parsePseudoArgs(),hasMatchedComponent=!0,matched=!0}else if(i<len&&selector[i]==="["){i++;var depth=1;while(i<len&&depth>0)if(selector[i]==="\\")i+=2;else if(selector[i]==="'"){i++;while(i<len&&selector[i]!=="'")if(selector[i]==="\\")i+=2;else i++;if(i<len)i++}else if(selector[i]==='"'){i++;while(i<len&&selector[i]!=='"')if(selector[i]==="\\")i+=2;else i++;if(i<len)i++}else if(selector[i]==="[")depth++,i++;else if(selector[i]==="]")depth--,i++;else i++;if(depth===0)hasMatchedComponent=!0,matched=!0}else if(i<len&&(isIdentStart(selector[i])||selector[i]==="\\"||selector[i]==="*"||selector[i]==="|"||selector[i]==="-")){if(parseNamespace(),i<len&&selector[i]==="*")i++,hasMatchedComponent=!0,matched=!0;else if(i<len&&(isIdentStart(selector[i])||selector[i]==="\\"||selector[i]==="-")){if(parseIdentifier())hasMatchedComponent=!0,matched=!0}}if(!matched&&i===start)return!1}return hasMatchedComponent}function basicSelectorValidator(selector){if(selector.length>1e4)return!1;if(!validateBalancedSyntax(selector,!0,!0))return!1;if(hasInvalidCombinators(selector))return!1;if(hasInvalidPseudoSyntax(selector))return!1;if(hasInvalidNestingSelector(selector))return!1;var noQuotesPseudos=["lang","dir","nth-child","nth-last-child","nth-of-type","nth-last-of-type"];for(var idx=0;idx<selector.length;idx++)if(selector[idx]===":"){var pseudoStart=idx;if(idx++,idx<selector.length&&selector[idx]===":")idx++;var nameStart=idx;while(idx<selector.length&&/[a-zA-Z0-9\-]/.test(selector[idx]))idx++;if(idx===nameStart)continue;var pseudoName=selector.substring(nameStart,idx).toLowerCase();if(idx<selector.length&&selector[idx]==="("){idx++;var contentStart=idx,depth=1;while(idx<selector.length&&depth>0)if(selector[idx]==="\\")idx+=2;else if(selector[idx]==="(")depth++,idx++;else if(selector[idx]===")")depth--,idx++;else idx++;if(depth===0){var pseudoContent=selector.substring(contentStart,idx-1);for(var j=0;j<noQuotesPseudos.length;j++)if(pseudoName===noQuotesPseudos[j]&&/['"]/.test(pseudoContent))return!1}}}return looseSelectorValidator(selector)}function extractPseudoClasses(selector){var matches=[];for(var i=0;i<selector.length;i++)if(selector[i]===":"){var pseudoStart=i;if(i++,i<selector.length&&selector[i]===":")i++;var nameStart=i;while(i<selector.length&&/[a-zA-Z\-]/.test(selector[i]))i++;if(i===nameStart)continue;var pseudoName=selector.substring(nameStart,i);if(i<selector.length&&selector[i]==="("){i++;var argsStart=i,depth=1,inSingleQuote=!1,inDoubleQuote=!1;while(i<selector.length&&depth>0){var ch=selector[i];if(ch==="\\")i+=2;else if(ch==="'"&&!inDoubleQuote)inSingleQuote=!inSingleQuote,i++;else if(ch==='"'&&!inSingleQuote)inDoubleQuote=!inDoubleQuote,i++;else if(ch==="("&&!inSingleQuote&&!inDoubleQuote)depth++,i++;else if(ch===")"&&!inSingleQuote&&!inDoubleQuote)depth--,i++;else i++}if(depth===0){var pseudoArgs=selector.substring(argsStart,i-1),fullMatch=selector.substring(pseudoStart,i);matches.push([fullMatch,pseudoName,pseudoArgs,pseudoStart])}i--}}return matches}function parseAndSplitNestedSelectors(selector){var depth=0,buffer="",parts=[],inSingleQuote=!1,inDoubleQuote=!1,i,char;for(i=0;i<selector.length;i++){if(char=selector.charAt(i),char==="\\"&&i+1<selector.length){buffer+=char,i++,buffer+=selector.charAt(i);continue}if(char==="'"&&!inDoubleQuote)inSingleQuote=!inSingleQuote,buffer+=char;else if(char==='"'&&!inSingleQuote)inDoubleQuote=!inDoubleQuote,buffer+=char;else if(!inSingleQuote&&!inDoubleQuote)if(char==="(")depth++,buffer+=char;else if(char===")")depth--,buffer+=char;else if(char===","&&depth===0){if(buffer.trim())parts.push(buffer.trim());buffer=""}else buffer+=char;else buffer+=char}var trimmed=buffer.trim();if(trimmed){var endsWithHexEscape=endsWithHexEscapeRegExp.test(buffer);parts.push(endsWithHexEscape?buffer.replace(leadingWhitespaceRegExp,""):trimmed)}return parts}var validatedSelectorsCache={},selectorListPseudoClasses={not:!0,is:!0,has:!0,where:!0};function validateSelector(selector){if(validatedSelectorsCache.hasOwnProperty(selector))return validatedSelectorsCache[selector];var pseudoClassMatches=extractPseudoClasses(selector);for(var j=0;j<pseudoClassMatches.length;j++){var pseudoClass=pseudoClassMatches[j][1];if(selectorListPseudoClasses.hasOwnProperty(pseudoClass)){var nestedSelectors=parseAndSplitNestedSelectors(pseudoClassMatches[j][2]),hasAmpersand=!1;for(var k=0;k<nestedSelectors.length;k++)if(ampersandRegExp.test(nestedSelectors[k])){hasAmpersand=!0;break}if(hasAmpersand)continue;for(var i=0;i<nestedSelectors.length;i++){var nestedSelector=nestedSelectors[i];if(!validatedSelectorsCache.hasOwnProperty(nestedSelector)){var nestedSelectorValidation=validateSelector(nestedSelector);if(validatedSelectorsCache[nestedSelector]=nestedSelectorValidation,!nestedSelectorValidation)return validatedSelectorsCache[selector]=!1,!1}else if(!validatedSelectorsCache[nestedSelector])return validatedSelectorsCache[selector]=!1,!1}}}var basicSelectorValidation=basicSelectorValidator(selector);return validatedSelectorsCache[selector]=basicSelectorValidation,basicSelectorValidation}function validateNamespaceSelector(selector){var pipeIndex=-1,inAttr=!1,inSingleQuote=!1,inDoubleQuote=!1;for(var i=0;i<selector.length;i++){var char=selector[i];if(char==="\\"){var escapeLen=getEscapeSequenceLength(selector,i);if(escapeLen>0){i+=escapeLen-1;continue}}if(inSingleQuote){if(char==="'")inSingleQuote=!1}else if(inDoubleQuote){if(char==='"')inDoubleQuote=!1}else if(inAttr){if(char==="]")inAttr=!1;else if(char==="'")inSingleQuote=!0;else if(char==='"')inDoubleQuote=!0}else if(char==="[")inAttr=!0;else if(char==="|"&&!inAttr){pipeIndex=i;break}}if(pipeIndex===-1)return!0;var namespacePrefix=selector.substring(0,pipeIndex);if(namespacePrefix==="*"||namespacePrefix==="")return!0;return definedNamespacePrefixes.hasOwnProperty(namespacePrefix)}function normalizeSelectorEscapes(selector){var result="",i=0,nextChar="",inIdentifier=!1,inAttribute=!1,attributeDepth=0,needsEscapeForIdent=!1,lastWasHexEscape=!1;while(i<selector.length){var char=selector[i];if(char==="["&&!inAttribute){inAttribute=!0,attributeDepth=1,result+=char,i++,needsEscapeForIdent=!1,inIdentifier=!1,lastWasHexEscape=!1;continue}if(inAttribute){if(char==="[")attributeDepth++;if(char==="]"){if(attributeDepth--,attributeDepth===0)inAttribute=!1}if(char==="\\"&&i+1<selector.length){var escapeLen=getEscapeSequenceLength(selector,i);result+=selector.substr(i,escapeLen),i+=escapeLen}else result+=char,i++;lastWasHexEscape=!1;continue}if(char==="\\"){var escapeLen=getEscapeSequenceLength(selector,i);if(escapeLen>0){var escapeSeq=selector.substr(i,escapeLen),decoded=decodeEscapeSequence(escapeSeq),wasHexEscape=startsWithHexEscapeRegExp.test(escapeSeq),hadTerminatingSpace=wasHexEscape&&escapeSeq[escapeLen-1]===" ";nextChar=selector[i+escapeLen]||"";var needsEscape=!1,useHexEscape=!1;if(needsEscapeForIdent){if(isDigit(decoded))needsEscape=!0,useHexEscape=!0;else if(decoded==="-"){var remainingSelector=selector.substring(i+escapeLen),hasMoreIdentChars=remainingSelector&&identCharRegExp.test(remainingSelector[0]);needsEscape=!hasMoreIdentChars}else if(!identStartCharRegExp.test(decoded))needsEscape=!0}else if(specialCharsNeedEscapeRegExp.test(decoded))needsEscape=!0;if(needsEscape)if(useHexEscape){var codePoint=decoded.charCodeAt(0),hex=codePoint.toString(16);if(result+="\\"+hex,isHexDigit(nextChar)||!nextChar||afterHexEscapeSeparatorRegExp.test(nextChar))result+=" ",lastWasHexEscape=!1;else lastWasHexEscape=!0}else result+="\\"+decoded,lastWasHexEscape=!1;else{if(lastWasHexEscape&&!hadTerminatingSpace&&isAlphanumeric(decoded))result+=" ";if(result+=decoded,hadTerminatingSpace&&(!nextChar||afterHexEscapeSeparatorRegExp.test(nextChar)))result+=" ";lastWasHexEscape=!1}i+=escapeLen,needsEscapeForIdent=needsEscapeForIdent&&decoded==="-",inIdentifier=!0;continue}}if(char==="."||char==="#")result+=char,needsEscapeForIdent=!0,inIdentifier=!1,lastWasHexEscape=!1,i++;else if(char==="-"&&needsEscapeForIdent)result+=char,needsEscapeForIdent=!0,lastWasHexEscape=!1,i++;else if(isDigit(char)&&needsEscapeForIdent){var codePoint=char.charCodeAt(0),hex=codePoint.toString(16);if(result+="\\"+hex,nextChar=selector[i+1]||"",isHexDigit(nextChar)||!nextChar||afterHexEscapeSeparatorRegExp.test(nextChar))result+=" ",lastWasHexEscape=!1;else lastWasHexEscape=!0;needsEscapeForIdent=!1,inIdentifier=!0,i++}else if(char===":"||combinatorOrSeparatorRegExp.test(char)){if(!(char===" "&&lastWasHexEscape&&result[result.length-1]===" "))result+=char;needsEscapeForIdent=!1,inIdentifier=!1,lastWasHexEscape=!1,i++}else if(isLetter(char)&&lastWasHexEscape)result+=" "+char,needsEscapeForIdent=!1,inIdentifier=!0,lastWasHexEscape=!1,i++;else if(char===" "&&lastWasHexEscape){if(nextChar=selector[i+1]||"",!nextChar||trailingSpaceSeparatorRegExp.test(nextChar))result+=char;needsEscapeForIdent=!1,inIdentifier=!1,lastWasHexEscape=!1,i++}else result+=char,needsEscapeForIdent=!1,inIdentifier=!0,lastWasHexEscape=!1,i++}return result}function decodeEscapeSequencesInString(str){var result="";for(var i=0;i<str.length;i++){if(str[i]==="\\"&&i+1<str.length){var escapeLen=getEscapeSequenceLength(str,i);if(escapeLen>0){var escapeSeq=str.substr(i,escapeLen),decoded=decodeEscapeSequence(escapeSeq);result+=decoded,i+=escapeLen-1;continue}}result+=str[i]}return result}function decodeEscapeSequence(escapeSeq){if(escapeSeq.length<2||escapeSeq[0]!=="\\")return escapeSeq;var content=escapeSeq.substring(1),hexMatch=content.match(hexEscapeSequenceRegExp);if(hexMatch){var codePoint=parseInt(hexMatch[1],16);if(codePoint>65535){codePoint-=65536;var high=55296+(codePoint>>10),low=56320+(codePoint&1023);return String.fromCharCode(high,low)}return String.fromCharCode(codePoint)}return content[0]||""}function normalizeAttributeSelectors(selector){var result="",i=0;while(i<selector.length)if(selector[i]==="["){result+="[",i++;var attrContent="",depth=1;while(i<selector.length&&depth>0){if(selector[i]==="\\"&&i+1<selector.length){attrContent+=selector.substring(i,i+2),i+=2;continue}if(selector[i]==="[")depth++;if(selector[i]==="]"){if(depth--,depth===0)break}attrContent+=selector[i],i++}var normalized2=normalizeAttributeContent(attrContent);if(normalized2===null)return null;if(result+=normalized2,i<selector.length&&selector[i]==="]")result+="]",i++}else result+=selector[i],i++;return result}function processQuotedAttributeValue(trimmedValue,quoteChar,attrName,operator,flag){if(trimmedValue.length<2)return null;var i=1,foundClose=!1;while(i<trimmedValue.length){if(trimmedValue[i]==="\\"&&i+1<trimmedValue.length){var escapeLen=getEscapeSequenceLength(trimmedValue,i);i+=escapeLen;continue}if(trimmedValue[i]===quoteChar){foundClose=i===trimmedValue.length-1;break}i++}if(!foundClose)return null;var innerValue=trimmedValue.slice(1,-1),decodedValue=decodeEscapeSequencesInString(innerValue),escapedValue=decodedValue.replace(doubleQuoteRegExp,"\\\"");return attrName+operator+'"'+escapedValue+'"'+(flag?" "+flag:"")}function normalizeAttributeContent(content){var match=content.match(attributeSelectorContentRegExp);if(!match)return content;var attrName=match[1],operator=match[2],valueAndFlag=match[3].trim(),flagMatch=valueAndFlag.match(attributeCaseFlagRegExp),value=flagMatch?flagMatch[1]:valueAndFlag,flag=flagMatch?flagMatch[2]:"",trimmedValue=value.trim(),firstChar=trimmedValue[0];if(firstChar==='"')return processQuotedAttributeValue(trimmedValue,'"',attrName,operator,flag);if(firstChar==="'")return processQuotedAttributeValue(trimmedValue,"'",attrName,operator,flag);var hasUnescapedSpecialChar=!1;for(var i=0;i<trimmedValue.length;i++){var char=trimmedValue[i];if(char==="\\"&&i+1<trimmedValue.length){var escapeLen=getEscapeSequenceLength(trimmedValue,i);if(escapeLen>0){i+=escapeLen-1;continue}}if(specialCharsNeedEscapeRegExp.test(char)){hasUnescapedSpecialChar=!0;break}}if(hasUnescapedSpecialChar)return null;var decodedValue=decodeEscapeSequencesInString(trimmedValue),escapedValue=decodedValue.replace(backslashRegExp,"\\\\").replace(doubleQuoteRegExp,"\\\"");return attrName+operator+'"'+escapedValue+'"'+(flag?" "+flag:"")}function processSelectorText(selectorText){var normalized2=selectorText.replace(whitespaceNormalizationRegExp,function(match,_,newline){if(newline)return" ";return match});if(normalized2=normalizeSelectorEscapes(normalized2),normalized2=normalizeAttributeSelectors(normalized2),normalized2===null)return"";return processNestedPseudoClasses(normalized2)}function processNestedPseudoClasses(selectorText,depth){if(typeof depth>"u")depth=0;if(depth>10)return selectorText;var pseudoClassMatches=extractPseudoClasses(selectorText);if(pseudoClassMatches.length===0)return selectorText;var result=selectorText;for(var j=pseudoClassMatches.length-1;j>=0;j--){var pseudoClass=pseudoClassMatches[j][1];if(selectorListPseudoClasses.hasOwnProperty(pseudoClass)){var fullMatch=pseudoClassMatches[j][0],pseudoArgs=pseudoClassMatches[j][2],matchStart=pseudoClassMatches[j][3],nestedSelectorsRaw=parseAndSplitNestedSelectors(pseudoArgs),hasAmpersand=!1;for(var k=0;k<nestedSelectorsRaw.length;k++)if(ampersandRegExp.test(nestedSelectorsRaw[k])){hasAmpersand=!0;break}if(hasAmpersand)continue;var processedArgs=processNestedPseudoClasses(pseudoArgs,depth+1),nestedSelectors=parseAndSplitNestedSelectors(processedArgs),validSelectors=[];for(var i=0;i<nestedSelectors.length;i++){var nestedSelector=nestedSelectors[i];if(basicSelectorValidator(nestedSelector))validSelectors.push(nestedSelector)}var newArgs=validSelectors.join(", "),newPseudoClass=":"+pseudoClass+"("+newArgs+")";result=result.substring(0,matchStart)+newPseudoClass+result.substring(matchStart+fullMatch.length)}}return result}function hasNewlineInQuotedString(selectorText){for(var i=0;i<selectorText.length;i++){var char=selectorText[i];if(char==="'"){i++;while(i<selectorText.length){if(selectorText[i]==="\\"&&i+1<selectorText.length){i+=2;continue}if(selectorText[i]==="'")break;if(selectorText[i]==="\r"||selectorText[i]===`
|
|
40
|
+
`)return!0;i++}}else if(char==='"'){i++;while(i<selectorText.length){if(selectorText[i]==="\\"&&i+1<selectorText.length){i+=2;continue}if(selectorText[i]==='"')break;if(selectorText[i]==="\r"||selectorText[i]===`
|
|
41
|
+
`)return!0;i++}}}return!1}function isValidSelectorText(selectorText){if(!selectorText||selectorText.trim()==="")return!1;if(emptyPseudoClassRegExp.test(selectorText))return!1;if(hasNewlineInQuotedString(selectorText))return!1;var selectors=parseAndSplitNestedSelectors(selectorText);for(var i=0;i<selectors.length;i++){var selector=selectors[i].trim();if(!validateSelector(selector)||!validateNamespaceSelector(selector))return!1}return!0}function pushToAncestorRules(rule){ancestorRules.push(rule)}function parseError(message,isNested){var lines=token.substring(0,i).split(`
|
|
42
|
+
`),lineCount=lines.length,charCount=lines.pop().length+1,error=Error(message+" (line "+lineCount+", char "+charCount+")");error.line=lineCount,error.char=charCount,error.styleSheet=styleSheet,error.isNested=!!isNested;try{throw error}catch(e){errorHandler&&errorHandler(e)}}function handleUnmatchedQuoteInSelector(nextState){var ruleClosingMatch=token.slice(i).match(forwardRuleClosingBraceRegExp);if(ruleClosingMatch)i+=ruleClosingMatch.index+ruleClosingMatch[0].length-1;styleRule=null,buffer="",hasUnmatchedQuoteInSelector=!1,state=nextState}function isSelectorStartChar(char){return".:#&*[\\".indexOf(char)!==-1}function isWhitespaceChar(char){return`
|
|
43
|
+
\r`.indexOf(char)!==-1}function isDigit(char){var code=char.charCodeAt(0);return code>=48&&code<=57}function isHexDigit(char){if(!char)return!1;var code=char.charCodeAt(0);return code>=48&&code<=57||code>=65&&code<=70||code>=97&&code<=102}function isLetter(char){if(!char)return!1;var code=char.charCodeAt(0);return code>=65&&code<=90||code>=97&&code<=122}function isAlphanumeric(char){var code=char.charCodeAt(0);return code>=48&&code<=57||code>=65&&code<=90||code>=97&&code<=122}function getEscapeSequenceLength(str,pos){if(str[pos]!=="\\"||pos+1>=str.length)return 0;var nextChar=str[pos+1];if(isHexDigit(nextChar)){var hexLength=1;while(hexLength<6&&pos+1+hexLength<str.length&&isHexDigit(str[pos+1+hexLength]))hexLength++;if(pos+1+hexLength<str.length&&isWhitespaceChar(str[pos+1+hexLength]))return 1+hexLength+1;return 1+hexLength}return 2}function containsUnescaped(str,char){for(var i=0;i<str.length;i++){if(str[i]==="\\"){var escapeLen=getEscapeSequenceLength(str,i);if(escapeLen>0){i+=escapeLen-1;continue}}if(str[i]===char)return!0}return!1}function isInvalidConditionText(text){return invalidMediaOperatorWithoutSpaceRegExp.test(text)||invalidMediaNotAfterOperatorRegExp.test(text)||invalidMediaNotIdentifierRegExp.test(text)||invalidMediaNotAfterFeatureRegExp.test(text)||invalidMediaOperatorBetweenParensRegExp.test(text)||invalidMediaNotWithMediaTypeRegExp.test(text)}function normalizeConditionText(text){if(isInvalidConditionText(text))return"not all";var result=text;return result=result.replace(mediaFeatureColonRegExp,function(match,openParen,name,spaces,rest){var beforeMatch=result.lastIndexOf(match),beforeParen=beforeMatch>0?result.charAt(beforeMatch-1):"";if(identifierBeforeParenRegExp.test(beforeParen))return match;return openParen+name+": "+rest}),result=result.replace(mediaAndOperatorRegExp," and "),result=result.replace(mediaOrOperatorRegExp," or "),result=result.replace(mediaNotOperatorStartRegExp,"not "),result=result.replace(mediaNotOperatorRegExp," not "),result.trim()}var endingIndex=token.length-1,initialEndingIndex=endingIndex;for(var character;character=token.charAt(i);i++){if(i===endingIndex)switch(state){case"importRule":case"namespaceRule":case"layerBlock":if(character!==";")token+=";",endingIndex+=1;break;case"value":if(character!=="}"){if(character===";")token+="}";else token+=";";endingIndex+=1;break}case"name":case"before-name":if(character==="}")token+=" ";else token+="}";endingIndex+=1;break;case"before-selector":if(character!=="}"&¤tScope!==styleSheet){token+="}",endingIndex+=1;break}}if(character==="\\"&&i+1<token.length){var escapeLen=getEscapeSequenceLength(token,i);if(escapeLen>0){buffer+=token.substr(i,escapeLen),i+=escapeLen-1;continue}}switch(character){case" ":case"\t":case"\r":case`
|
|
44
|
+
`:case"\f":if(SIGNIFICANT_WHITESPACE[state])buffer+=character;break;case'"':index=i+1;do if(index=token.indexOf('"',index)+1,!index){if(parseError('Unmatched "'),state==="selector"||state==="atRule")hasUnmatchedQuoteInSelector=!0}while(token[index-2]==="\\");if(index===0)break;switch(buffer+=token.slice(i,index),i=index-1,state){case"before-value":state="value";break;case"importRule-begin":if(state="importRule",i===endingIndex)token+=";";break;case"namespaceRule-begin":if(state="namespaceRule",i===endingIndex)token+=";";break}break;case"'":index=i+1;do if(index=token.indexOf("'",index)+1,!index){if(parseError("Unmatched '"),state==="selector"||state==="atRule")hasUnmatchedQuoteInSelector=!0}while(token[index-2]==="\\");if(index===0)break;switch(buffer+=token.slice(i,index),i=index-1,state){case"before-value":state="value";break;case"importRule-begin":state="importRule";break;case"namespaceRule-begin":state="namespaceRule";break}break;case"/":if(token.charAt(i+1)==="*")if(i+=2,index=token.indexOf("*/",i),index===-1)i=token.length-1,buffer="";else i=index+1;else buffer+=character;if(state==="importRule-begin")buffer+=" ",state="importRule";if(state==="namespaceRule-begin")buffer+=" ",state="namespaceRule";break;case"@":if(nestedSelectorRule){if(styleRule&&styleRule.constructor.name==="CSSNestedDeclarations")currentScope.cssRules.push(styleRule);if(styleRule!==nestedSelectorRule&&nestedSelectorRule.parentRule&&nestedSelectorRule.parentRule.constructor.name==="CSSStyleRule")styleRule=nestedSelectorRule.parentRule}if(token.indexOf("@-moz-document",i)===i){validateAtRule("@-moz-document",function(){state="documentRule-begin",documentRule=new CSSOM2.CSSDocumentRule,documentRule.__starts=i,i+=13}),buffer="";break}else if(token.indexOf("@media",i)===i){validateAtRule("@media",function(){state="atBlock",mediaRule=new CSSOM2.CSSMediaRule,mediaRule.__starts=i,i+=5}),buffer="";break}else if(token.indexOf("@container",i)===i){validateAtRule("@container",function(){state="containerBlock",containerRule=new CSSOM2.CSSContainerRule,containerRule.__starts=i,i+=9}),buffer="";break}else if(token.indexOf("@counter-style",i)===i){buffer="";var cannotBeNested=!canAtRuleBeNested();validateAtRule("@counter-style",function(){state="counterStyleBlock",counterStyleRule=new CSSOM2.CSSCounterStyleRule,counterStyleRule.__starts=i,i+=13},cannotBeNested);break}else if(token.indexOf("@property",i)===i){buffer="";var cannotBeNested=!canAtRuleBeNested();validateAtRule("@property",function(){state="propertyBlock",propertyRule=new CSSOM2.CSSPropertyRule,propertyRule.__starts=i,i+=8},cannotBeNested);break}else if(token.indexOf("@scope",i)===i){validateAtRule("@scope",function(){state="scopeBlock",scopeRule=new CSSOM2.CSSScopeRule,scopeRule.__starts=i,i+=5}),buffer="";break}else if(token.indexOf("@layer",i)===i){validateAtRule("@layer",function(){state="layerBlock",layerBlockRule=new CSSOM2.CSSLayerBlockRule,layerBlockRule.__starts=i,i+=5}),buffer="";break}else if(token.indexOf("@page",i)===i){validateAtRule("@page",function(){state="pageBlock",pageRule=new CSSOM2.CSSPageRule,pageRule.__starts=i,i+=4}),buffer="";break}else if(token.indexOf("@supports",i)===i){validateAtRule("@supports",function(){state="conditionBlock",supportsRule=new CSSOM2.CSSSupportsRule,supportsRule.__starts=i,i+=8}),buffer="";break}else if(token.indexOf("@host",i)===i){validateAtRule("@host",function(){state="hostRule-begin",i+=4,hostRule=new CSSOM2.CSSHostRule,hostRule.__starts=i}),buffer="";break}else if(token.indexOf("@starting-style",i)===i){validateAtRule("@starting-style",function(){state="startingStyleRule-begin",i+=14,startingStyleRule=new CSSOM2.CSSStartingStyleRule,startingStyleRule.__starts=i}),buffer="";break}else if(token.indexOf("@import",i)===i){buffer="",validateAtRule("@import",function(){state="importRule-begin",i+=6,buffer+="@import"},!0);break}else if(token.indexOf("@namespace",i)===i){buffer="",validateAtRule("@namespace",function(){state="namespaceRule-begin",i+=9,buffer+="@namespace"},!0);break}else if(token.indexOf("@font-face",i)===i){buffer="";var cannotBeNested=!canAtRuleBeNested();validateAtRule("@font-face",function(){state="fontFaceRule-begin",i+=9,fontFaceRule=new CSSOM2.CSSFontFaceRule,fontFaceRule.__starts=i},cannotBeNested);break}else{atKeyframesRegExp.lastIndex=i;var matchKeyframes=atKeyframesRegExp.exec(token);if(matchKeyframes&&matchKeyframes.index===i){state="keyframesRule-begin",keyframesRule=new CSSOM2.CSSKeyframesRule,keyframesRule.__starts=i,keyframesRule._vendorPrefix=matchKeyframes[1],i+=matchKeyframes[0].length-1,buffer="";break}else if(state==="selector")state="atRule"}buffer+=character;break;case"{":if(currentScope===topScope)nestedSelectorRule=null;if(state==="before-selector"){parseError("Unexpected {"),i=ignoreBalancedBlock(i,token.slice(i));break}if(state==="selector"||state==="atRule"){if(!nestedSelectorRule&&containsUnescaped(buffer,";")){var ruleClosingMatch=token.slice(i).match(forwardRuleClosingBraceRegExp);if(ruleClosingMatch){styleRule=null,buffer="",state="before-selector",i+=ruleClosingMatch.index+ruleClosingMatch[0].length;break}}if(!styleRule)styleRule=new CSSOM2.CSSStyleRule,styleRule.__starts=i;if(hasUnmatchedQuoteInSelector){handleUnmatchedQuoteInSelector("before-selector");break}var originalParentRule=parentRule;if(parentRule)styleRule.__parentRule=parentRule,pushToAncestorRules(parentRule);currentScope=parentRule=styleRule;var processedSelectorText=processSelectorText(buffer.trim());if(originalParentRule&&originalParentRule.constructor.name==="CSSStyleRule")styleRule.selectorText=parseAndSplitNestedSelectors(processedSelectorText).map(function(sel){return sel.indexOf("&")===-1||startsWithCombinatorRegExp.test(sel)?"& "+sel:sel}).join(", ");else styleRule.selectorText=parseAndSplitNestedSelectors(processedSelectorText).join(", ");styleRule.style.__starts=i,styleRule.__parentStyleSheet=styleSheet,buffer="",state="before-name"}else if(state==="atBlock"){if(mediaRule.media.mediaText=normalizeConditionText(buffer.trim()),parentRule){if(mediaRule.__parentRule=parentRule,pushToAncestorRules(parentRule),parentRule.constructor.name==="CSSStyleRule"&&!nestedSelectorRule)nestedSelectorRule=parentRule}if(currentScope=parentRule=mediaRule,pushToAncestorRules(mediaRule),mediaRule.__parentStyleSheet=styleSheet,!styleRule||styleRule.constructor.name!=="CSSStyleRule"||!styleRule.__parentRule)styleRule=null;buffer="",state="before-selector"}else if(state==="containerBlock"){if(containerRule.__conditionText=normalizeConditionText(buffer.trim()),parentRule){if(containerRule.__parentRule=parentRule,pushToAncestorRules(parentRule),parentRule.constructor.name==="CSSStyleRule"&&!nestedSelectorRule)nestedSelectorRule=parentRule}currentScope=parentRule=containerRule,pushToAncestorRules(containerRule),containerRule.__parentStyleSheet=styleSheet,styleRule=null,buffer="",state="before-selector"}else if(state==="counterStyleBlock"){var counterStyleName=buffer.trim().replace(newlineRemovalRegExp,""),isValidCounterStyleName=counterStyleName.length>0&&!whitespaceAndDotRegExp.test(counterStyleName);if(isValidCounterStyleName){if(counterStyleRule.name=counterStyleName,parentRule)counterStyleRule.__parentRule=parentRule;counterStyleRule.__parentStyleSheet=styleSheet,styleRule=counterStyleRule}buffer=""}else if(state==="propertyBlock"){var propertyName=buffer.trim().replace(newlineRemovalRegExp,""),isValidPropertyName=propertyName.indexOf("--")===0;if(isValidPropertyName){if(propertyRule.__name=propertyName,parentRule)propertyRule.__parentRule=parentRule;propertyRule.__parentStyleSheet=styleSheet,styleRule=propertyRule}buffer=""}else if(state==="conditionBlock"){if(supportsRule.__conditionText=normalizeConditionText(buffer.trim()),parentRule){if(supportsRule.__parentRule=parentRule,pushToAncestorRules(parentRule),parentRule.constructor.name==="CSSStyleRule"&&!nestedSelectorRule)nestedSelectorRule=parentRule}currentScope=parentRule=supportsRule,pushToAncestorRules(supportsRule),supportsRule.__parentStyleSheet=styleSheet,styleRule=null,buffer="",state="before-selector"}else if(state==="scopeBlock"){var parsedScopePrelude=parseScopePrelude(buffer.trim());if(parsedScopePrelude.hasStart)scopeRule.__start=parsedScopePrelude.startSelector;if(parsedScopePrelude.hasEnd)scopeRule.__end=parsedScopePrelude.endSelector;if(parsedScopePrelude.hasOnlyEnd)scopeRule.__end=parsedScopePrelude.endSelector;if(parentRule){if(scopeRule.__parentRule=parentRule,pushToAncestorRules(parentRule),parentRule.constructor.name==="CSSStyleRule"&&!nestedSelectorRule)nestedSelectorRule=parentRule}currentScope=parentRule=scopeRule,pushToAncestorRules(scopeRule),scopeRule.__parentStyleSheet=styleSheet,styleRule=null,buffer="",state="before-selector"}else if(state==="layerBlock"){layerBlockRule.name=buffer.trim();var isValidName=layerBlockRule.name.length===0||layerBlockRule.name.match(cssCustomIdentifierRegExp)!==null;if(isValidName){if(parentRule){if(layerBlockRule.__parentRule=parentRule,pushToAncestorRules(parentRule),parentRule.constructor.name==="CSSStyleRule"&&!nestedSelectorRule)nestedSelectorRule=parentRule}currentScope=parentRule=layerBlockRule,pushToAncestorRules(layerBlockRule),layerBlockRule.__parentStyleSheet=styleSheet}styleRule=null,buffer="",state="before-selector"}else if(state==="pageBlock"){if(pageRule.selectorText=buffer.trim(),parentRule)pageRule.__parentRule=parentRule,pushToAncestorRules(parentRule);currentScope=parentRule=pageRule,pageRule.__parentStyleSheet=styleSheet,styleRule=pageRule,buffer="",state="before-name"}else if(state==="hostRule-begin"){if(parentRule)pushToAncestorRules(parentRule);currentScope=parentRule=hostRule,pushToAncestorRules(hostRule),hostRule.__parentStyleSheet=styleSheet,buffer="",state="before-selector"}else if(state==="startingStyleRule-begin"){if(parentRule){if(startingStyleRule.__parentRule=parentRule,pushToAncestorRules(parentRule),parentRule.constructor.name==="CSSStyleRule"&&!nestedSelectorRule)nestedSelectorRule=parentRule}currentScope=parentRule=startingStyleRule,pushToAncestorRules(startingStyleRule),startingStyleRule.__parentStyleSheet=styleSheet,styleRule=null,buffer="",state="before-selector"}else if(state==="fontFaceRule-begin"){if(parentRule)fontFaceRule.__parentRule=parentRule;fontFaceRule.__parentStyleSheet=styleSheet,styleRule=fontFaceRule,buffer="",state="before-name"}else if(state==="keyframesRule-begin"){if(keyframesRule.name=buffer.trim(),parentRule)pushToAncestorRules(parentRule),keyframesRule.__parentRule=parentRule;keyframesRule.__parentStyleSheet=styleSheet,currentScope=parentRule=keyframesRule,buffer="",state="keyframeRule-begin"}else if(state==="keyframeRule-begin")styleRule=new CSSOM2.CSSKeyframeRule,styleRule.keyText=buffer.trim(),styleRule.__starts=i,buffer="",state="before-name";else if(state==="documentRule-begin"){if(documentRule.matcher.matcherText=buffer.trim(),parentRule)pushToAncestorRules(parentRule),documentRule.__parentRule=parentRule;currentScope=parentRule=documentRule,pushToAncestorRules(documentRule),documentRule.__parentStyleSheet=styleSheet,buffer="",state="before-selector"}else if(state==="before-name"||state==="name"){if(styleRule.constructor.name==="CSSFontFaceRule"||styleRule.constructor.name==="CSSKeyframeRule"||styleRule.constructor.name==="CSSPageRule"&&parentRule===styleRule){var ruleClosingMatch=token.slice(i).match(forwardRuleClosingBraceRegExp);if(ruleClosingMatch){i+=ruleClosingMatch.index+ruleClosingMatch[0].length-1,buffer="",state="before-name";break}}if(styleRule.constructor.name==="CSSNestedDeclarations")if(styleRule.style.length)parentRule.cssRules.push(styleRule),styleRule.__parentRule=parentRule,styleRule.__parentStyleSheet=styleSheet,pushToAncestorRules(parentRule);else pushToAncestorRules(parentRule);else currentScope=parentRule=styleRule,pushToAncestorRules(parentRule),styleRule.__parentStyleSheet=styleSheet;if(styleRule=new CSSOM2.CSSStyleRule,hasUnmatchedQuoteInSelector){handleUnmatchedQuoteInSelector("before-name");break}var processedSelectorText=processSelectorText(buffer.trim());if(parentRule.constructor.name==="CSSScopeRule"||parentRule.constructor.name!=="CSSStyleRule"&&parentRule.parentRule===null)styleRule.selectorText=parseAndSplitNestedSelectors(processedSelectorText).join(", ");else styleRule.selectorText=parseAndSplitNestedSelectors(processedSelectorText).map(function(sel){return sel.indexOf("&")===-1||startsWithCombinatorRegExp.test(sel)?"& "+sel:sel}).join(", ");if(styleRule.style.__starts=i-buffer.length,styleRule.__parentRule=parentRule,parentRule.constructor.name==="CSSStyleRule"||parentRule.constructor.name==="CSSScopeRule")nestedSelectorRule=styleRule;styleRule.__parentStyleSheet=styleSheet,currentScope=parentRule=styleRule,buffer="",state="before-name"}break;case":":if(state==="name"){var openBraceBeforeMatch=token.slice(i).match(declarationOrOpenBraceRegExp),hasOpenBraceBefore=openBraceBeforeMatch&&openBraceBeforeMatch[0]==="{";if(hasOpenBraceBefore)buffer+=character;else name=buffer.trim(),buffer="",state="before-value"}else buffer+=character;break;case"(":if(state==="value")if(buffer.trim()==="expression"){var info=new CSSOM2.CSSValueExpression(token,i).parse();if(info.error)parseError(info.error);else buffer+=info.expression,i=info.idx}else state="value-parenthesis",valueParenthesisDepth=1,buffer+=character;else if(state==="value-parenthesis")valueParenthesisDepth++,buffer+=character;else buffer+=character;break;case")":if(state==="value-parenthesis"){if(valueParenthesisDepth--,valueParenthesisDepth===0)state="value"}buffer+=character;break;case"!":if(state==="value"&&token.indexOf("!important",i)===i)priority="important",i+=9;else buffer+=character;break;case";":switch(state){case"before-value":case"before-name":parseError("Unexpected ;"),buffer="",state="before-name";break;case"value":styleRule.style.setProperty(name,buffer.trim(),priority,parseError),priority="",buffer="",state="before-name";break;case"atRule":buffer="",state="before-selector";break;case"importRule":var isValid=topScope.cssRules.length===0||topScope.cssRules.some(function(rule){return["CSSImportRule","CSSLayerStatementRule"].indexOf(rule.constructor.name)!==-1});if(isValid){if(importRule=new CSSOM2.CSSImportRule,opts&&opts.globalObject&&opts.globalObject.CSSStyleSheet)importRule.__styleSheet=new opts.globalObject.CSSStyleSheet;importRule.styleSheet.__constructed=!1,importRule.__parentStyleSheet=importRule.styleSheet.__parentStyleSheet=styleSheet,importRule.parse(buffer+character),topScope.cssRules.push(importRule)}buffer="",state="before-selector";break;case"namespaceRule":var isValid=topScope.cssRules.length===0||topScope.cssRules.every(function(rule){return["CSSImportRule","CSSLayerStatementRule","CSSNamespaceRule"].indexOf(rule.constructor.name)!==-1});if(isValid)try{var testNamespaceRule=new CSSOM2.CSSNamespaceRule;if(testNamespaceRule.parse(buffer+character),namespaceRule=testNamespaceRule,namespaceRule.__parentStyleSheet=styleSheet,topScope.cssRules.push(namespaceRule),namespaceRule.prefix)definedNamespacePrefixes[namespaceRule.prefix]=namespaceRule.namespaceURI}catch(e){parseError(e.message)}buffer="",state="before-selector";break;case"layerBlock":var nameListStr=buffer.trim().split(",").map(function(name){return name.trim()}),isInvalid=nameListStr.some(function(name){return name.trim().match(cssCustomIdentifierRegExp)===null}),hasStyleRuleParent=!1;if(parentRule){var checkParent=parentRule;while(checkParent){if(checkParent.constructor.name==="CSSStyleRule"){hasStyleRuleParent=!0;break}checkParent=checkParent.__parentRule}}if(!isInvalid&&!hasStyleRuleParent)if(layerStatementRule=new CSSOM2.CSSLayerStatementRule,layerStatementRule.__parentStyleSheet=styleSheet,layerStatementRule.__starts=layerBlockRule.__starts,layerStatementRule.__ends=i,layerStatementRule.nameList=nameListStr,parentRule)layerStatementRule.__parentRule=parentRule,parentRule.cssRules.push(layerStatementRule);else topScope.cssRules.push(layerStatementRule);buffer="",state="before-selector";break;default:buffer+=character;break}break;case"}":if(state==="counterStyleBlock"){if(counterStyleRule.name)if(counterStyleRule.parse("@counter-style "+counterStyleRule.name+" { "+buffer+" }"),counterStyleRule.__ends=i+1,counterStyleRule.__parentRule)counterStyleRule.__parentRule.cssRules.push(counterStyleRule);else topScope.cssRules.push(counterStyleRule);if(counterStyleRule.__parentRule)currentScope=counterStyleRule.__parentRule;styleRule=null,buffer="",state="before-selector";break}if(state==="propertyBlock"){if(propertyRule.__name){var parseSuccess=propertyRule.parse("@property "+propertyRule.__name+" { "+buffer+" }");if(parseSuccess)if(propertyRule.__ends=i+1,propertyRule.__parentRule)propertyRule.__parentRule.cssRules.push(propertyRule);else topScope.cssRules.push(propertyRule)}if(propertyRule.__parentRule)currentScope=propertyRule.__parentRule;styleRule=null,buffer="",state="before-selector";break}switch(state){case"value":styleRule.style.setProperty(name,buffer.trim(),priority,parseError),priority="";case"before-value":case"before-name":case"name":if(styleRule.__ends=i+1,parentRule===styleRule)parentRule=ancestorRules.pop();if(parentRule)styleRule.__parentRule=parentRule;if(styleRule.__parentStyleSheet=styleSheet,currentScope===styleRule)currentScope=parentRule||topScope;if(styleRule.constructor.name==="CSSStyleRule"&&!isValidSelectorText(styleRule.selectorText)){if(styleRule===nestedSelectorRule)nestedSelectorRule=null;parseError('Invalid CSSStyleRule (selectorText = "'+styleRule.selectorText+'")',styleRule.parentRule!==null)}else if(styleRule.parentRule)styleRule.parentRule.cssRules.push(styleRule);else currentScope.cssRules.push(styleRule);if(buffer="",currentScope.constructor===CSSOM2.CSSKeyframesRule)state="keyframeRule-begin";else state="before-selector";if(styleRule.constructor.name==="CSSNestedDeclarations"){if(currentScope!==topScope){if(currentScope.constructor.name==="CSSStyleRule"||currentScope.constructor.name==="CSSScopeRule")nestedSelectorRule=currentScope}styleRule=null}else{if(styleRule===nestedSelectorRule){var selector=styleRule.selectorText&&styleRule.selectorText.trim(),isPrependedAmpersand=selector&&selector.match(prependedAmpersandRegExp),isGroupingRule=currentScope&¤tScope instanceof CSSOM2.CSSGroupingRule;if(!isPrependedAmpersand&&isGroupingRule){if(currentScope.constructor.name==="CSSStyleRule"||currentScope.constructor.name==="CSSScopeRule")nestedSelectorRule=currentScope}else nestedSelectorRule=null}else if(nestedSelectorRule&¤tScope instanceof CSSOM2.CSSGroupingRule);styleRule=null;break}case"keyframeRule-begin":case"before-selector":case"selector":if(!parentRule){parseError("Unexpected }");var hasPreviousStyleRule=currentScope.cssRules.length&¤tScope.cssRules[currentScope.cssRules.length-1].constructor.name==="CSSStyleRule";if(hasPreviousStyleRule)i=ignoreBalancedBlock(i,token.slice(i),1);break}while(ancestorRules.length>0){if(parentRule=ancestorRules.pop(),parentRule===currentScope)continue;if(!(parentRule instanceof CSSOM2.CSSGroupingRule&&(parentRule.constructor.name!=="CSSStyleRule"||parentRule.__parentRule)))continue;var isClosingNestedSelectorContext=nestedSelectorRule&&(currentScope===nestedSelectorRule||nestedSelectorRule.__parentRule===currentScope);if(isClosingNestedSelectorContext)if(nestedSelectorRule.parentRule){prevScope=nestedSelectorRule,currentScope=nestedSelectorRule.parentRule;var scopeId=getRuleId(prevScope);if(!addedToCurrentScope[scopeId])currentScope.cssRules.push(prevScope),addedToCurrentScope[scopeId]=!0;nestedSelectorRule=currentScope;break}else{prevScope=currentScope;var actualParent=ancestorRules.length>0?ancestorRules[ancestorRules.length-1]:nestedSelectorRule;if(actualParent!==prevScope)actualParent.cssRules.push(prevScope);currentScope=actualParent,parentRule=actualParent;break}else{if(prevScope=currentScope,parentRule!==prevScope)parentRule.cssRules.push(prevScope);break}}if(ancestorRules.length===0&¤tScope.__parentRule&¤tScope.__parentRule.cssRules){var parentId=getRuleId(currentScope);if(!addedToParent[parentId])currentScope.__parentRule.cssRules.push(currentScope),addedToParent[parentId]=!0}if(ancestorRules.length===0&¤tScope.parentRule==null){currentScope.__ends=i+1;var topId=getRuleId(currentScope);if(currentScope!==topScope&&!addedToTopScope[topId])topScope.cssRules.push(currentScope),addedToTopScope[topId]=!0;if(currentScope=topScope,nestedSelectorRule===parentRule){var nestedSelectorTokenToCurrentSelectorToken=token.slice(nestedSelectorRule.__starts,i+1),openingBraceMatch=nestedSelectorTokenToCurrentSelectorToken.match(openBraceGlobalRegExp),closingBraceMatch=nestedSelectorTokenToCurrentSelectorToken.match(closeBraceGlobalRegExp),openingBraceLen=openingBraceMatch&&openingBraceMatch.length,closingBraceLen=closingBraceMatch&&closingBraceMatch.length;if(openingBraceLen===closingBraceLen)nestedSelectorRule.__ends=i+1,nestedSelectorRule=null,parentRule=null}else parentRule=null}else currentScope=parentRule;buffer="",state="before-selector";break}break;default:switch(state){case"before-selector":if(state="selector",(styleRule||scopeRule)&&parentRule){if(!isSelectorStartChar(character)&&!isWhitespaceChar(character)&&parentRule instanceof CSSOM2.CSSGroupingRule){if(state="before-name",styleRule!==parentRule)styleRule=new CSSOM2.CSSNestedDeclarations,styleRule.__starts=i}}else if(nestedSelectorRule&&parentRule&&parentRule instanceof CSSOM2.CSSGroupingRule){if(isSelectorStartChar(character))styleRule=new CSSOM2.CSSStyleRule,styleRule.__starts=i;else if(!isWhitespaceChar(character))if(state="before-name",parentRule.cssRules.length||nestedSelectorRule){if(currentScope=parentRule,parentRule.constructor.name==="CSSStyleRule"||parentRule.constructor.name==="CSSScopeRule")nestedSelectorRule=parentRule;styleRule=new CSSOM2.CSSNestedDeclarations,styleRule.__starts=i}else if(parentRule.constructor.name==="CSSStyleRule")styleRule=parentRule;else styleRule=new CSSOM2.CSSStyleRule,styleRule.__starts=i}break;case"before-name":state="name";break;case"before-value":state="value";break;case"importRule-begin":state="importRule";break;case"namespaceRule-begin":state="namespaceRule";break}buffer+=character;break}if(i===initialEndingIndex&&(currentScope!==topScope||ancestorRules.length>0)){var needsClosing=ancestorRules.length;if(currentScope!==topScope&&ancestorRules.indexOf(currentScope)===-1)needsClosing+=1;for(var closeIdx=0;closeIdx<needsClosing;closeIdx++)token+="}",endingIndex+=1}}if(buffer.trim()!=="")parseError("Unexpected end of input");return styleSheet};exports2.parse=CSSOM2.parse;CSSOM2.CSSStyleSheet=require_CSSStyleSheet().CSSStyleSheet;CSSOM2.CSSStyleRule=require_CSSStyleRule().CSSStyleRule;CSSOM2.CSSNestedDeclarations=require_CSSNestedDeclarations().CSSNestedDeclarations;CSSOM2.CSSImportRule=require_CSSImportRule().CSSImportRule;CSSOM2.CSSNamespaceRule=require_CSSNamespaceRule().CSSNamespaceRule;CSSOM2.CSSGroupingRule=require_CSSGroupingRule().CSSGroupingRule;CSSOM2.CSSMediaRule=require_CSSMediaRule().CSSMediaRule;CSSOM2.CSSCounterStyleRule=require_CSSCounterStyleRule().CSSCounterStyleRule;CSSOM2.CSSPropertyRule=require_CSSPropertyRule().CSSPropertyRule;CSSOM2.CSSContainerRule=require_CSSContainerRule().CSSContainerRule;CSSOM2.CSSConditionRule=require_CSSConditionRule().CSSConditionRule;CSSOM2.CSSSupportsRule=require_CSSSupportsRule().CSSSupportsRule;CSSOM2.CSSFontFaceRule=require_CSSFontFaceRule().CSSFontFaceRule;CSSOM2.CSSHostRule=require_CSSHostRule().CSSHostRule;CSSOM2.CSSStartingStyleRule=require_CSSStartingStyleRule().CSSStartingStyleRule;CSSOM2.CSSStyleDeclaration=require_CSSStyleDeclaration().CSSStyleDeclaration;CSSOM2.CSSKeyframeRule=require_CSSKeyframeRule().CSSKeyframeRule;CSSOM2.CSSKeyframesRule=require_CSSKeyframesRule().CSSKeyframesRule;CSSOM2.CSSValueExpression=require_CSSValueExpression().CSSValueExpression;CSSOM2.CSSDocumentRule=require_CSSDocumentRule().CSSDocumentRule;CSSOM2.CSSScopeRule=require_CSSScopeRule().CSSScopeRule;CSSOM2.CSSLayerBlockRule=require_CSSLayerBlockRule().CSSLayerBlockRule;CSSOM2.CSSLayerStatementRule=require_CSSLayerStatementRule().CSSLayerStatementRule;CSSOM2.CSSPageRule=require_CSSPageRule().CSSPageRule;require_cssstyleTryCatchBlock()});var require_CSSStyleDeclaration=__commonJS(function(exports2){var CSSOM2={},regexPatterns=require_regexPatterns().regexPatterns,indexedPropertyNameRegExp=/^(0|[1-9][0-9]*)$/;CSSOM2.CSSStyleDeclaration=function(){this.length=0,this.parentRule=null,this._importants={}};CSSOM2.CSSStyleDeclaration.prototype={constructor:CSSOM2.CSSStyleDeclaration,getPropertyValue:function(name){return this[name]||""},setProperty:function(name,value,priority,parseErrorHandler){if(name==="length"||name==="parentRule"||name==="_importants"||name==="__starts"||name in CSSOM2.CSSStyleDeclaration.prototype||indexedPropertyNameRegExp.test(name))return;var basicStylePropertyValueValidationRegExp=regexPatterns.basicStylePropertyValueValidationRegExp;if(basicStylePropertyValueValidationRegExp.test(value))parseErrorHandler&&parseErrorHandler('Invalid CSSStyleDeclaration property (name = "'+name+'", value = "'+value+'")');else if(this[name]){var index=Array.prototype.indexOf.call(this,name);if(index<0)this[this.length]=name,this.length++;if(priority||!this._importants[name])this.removeProperty(name),this[this.length]=name,this.length++,this[name]=value+"",this._importants[name]=priority}else this[this.length]=name,this.length++,this[name]=value+"",this._importants[name]=priority},removeProperty:function(name){if(!(name in this))return"";var index=Array.prototype.indexOf.call(this,name);if(index<0)return"";var prevValue=this[name];return this[name]="",Array.prototype.splice.call(this,index,1),prevValue},getPropertyCSSValue:function(){},getPropertyPriority:function(name){return this._importants[name]||""},getPropertyShorthand:function(){},isPropertyImplicit:function(){},get cssText(){var properties=[];for(var i=0,length=this.length;i<length;++i){var name=this[i],value=this.getPropertyValue(name),priority=this.getPropertyPriority(name);if(priority)priority=" !"+priority;properties[i]=name+": "+value+priority+";"}return properties.join(" ")},set cssText(text){var i,name;for(i=this.length;i--;)name=this[i],this[name]="";Array.prototype.splice.call(this,0,this.length),this._importants={};var dummyRule=CSSOM2.parse("#bogus{"+text+"}").cssRules[0].style,length=dummyRule.length;for(i=0;i<length;++i)name=dummyRule[i],this.setProperty(dummyRule[i],dummyRule.getPropertyValue(name),dummyRule.getPropertyPriority(name))}};exports2.CSSStyleDeclaration=CSSOM2.CSSStyleDeclaration;CSSOM2.parse=require_parse().parse});var require_clone=__commonJS(function(exports2){var CSSOM2={CSSStyleSheet:require_CSSStyleSheet().CSSStyleSheet,CSSRule:require_CSSRule().CSSRule,CSSNestedDeclarations:require_CSSNestedDeclarations().CSSNestedDeclarations,CSSStyleRule:require_CSSStyleRule().CSSStyleRule,CSSGroupingRule:require_CSSGroupingRule().CSSGroupingRule,CSSConditionRule:require_CSSConditionRule().CSSConditionRule,CSSMediaRule:require_CSSMediaRule().CSSMediaRule,CSSContainerRule:require_CSSContainerRule().CSSContainerRule,CSSSupportsRule:require_CSSSupportsRule().CSSSupportsRule,CSSStyleDeclaration:require_CSSStyleDeclaration().CSSStyleDeclaration,CSSKeyframeRule:require_CSSKeyframeRule().CSSKeyframeRule,CSSKeyframesRule:require_CSSKeyframesRule().CSSKeyframesRule,CSSScopeRule:require_CSSScopeRule().CSSScopeRule,CSSLayerBlockRule:require_CSSLayerBlockRule().CSSLayerBlockRule,CSSLayerStatementRule:require_CSSLayerStatementRule().CSSLayerStatementRule};try{CSSOM2.CSSStyleDeclaration=(()=>{throw new Error("Cannot require module "+"cssstyle");})().CSSStyleDeclaration}catch(e){}CSSOM2.clone=function clone(stylesheet){var cloned=new CSSOM2.CSSStyleSheet,rules=stylesheet.cssRules;if(!rules)return cloned;for(var i=0,rulesLength=rules.length;i<rulesLength;i++){var rule=rules[i],ruleClone=cloned.cssRules[i]=new rule.constructor,style=rule.style;if(style){var styleClone=ruleClone.style=new CSSOM2.CSSStyleDeclaration;for(var j=0,styleLength=style.length;j<styleLength;j++){var name=style[j];styleClone.setProperty(name,style.getPropertyValue(name),style.getPropertyPriority(name))}}if(rule.hasOwnProperty("keyText"))ruleClone.keyText=rule.keyText;if(rule.hasOwnProperty("selectorText"))ruleClone.selectorText=rule.selectorText;if(rule.hasOwnProperty("mediaText"))ruleClone.mediaText=rule.mediaText;if(rule.hasOwnProperty("supportsText"))ruleClone.supports=rule.supports;if(rule.hasOwnProperty("conditionText"))ruleClone.conditionText=rule.conditionText;if(rule.hasOwnProperty("layerName"))ruleClone.layerName=rule.layerName;if(rule.hasOwnProperty("href"))ruleClone.href=rule.href;if(rule.hasOwnProperty("name"))ruleClone.name=rule.name;if(rule.hasOwnProperty("nameList"))ruleClone.nameList=rule.nameList;if(rule.hasOwnProperty("cssRules"))ruleClone.cssRules=clone(rule).cssRules}return cloned};exports2.clone=CSSOM2.clone});var require_canvas_shim=__commonJS(function(exports2,module2){class Canvas{constructor(width,height){this.width=width,this.height=height}getContext(){return null}toDataURL(){return""}}module2.exports={createCanvas:(width,height)=>new Canvas(width,height)}});var require_canvas=__commonJS(function(exports2,module2){try{module2.exports=(()=>{throw new Error("Cannot require module "+"canvas");})()}catch(fallback){module2.exports=require_canvas_shim()}});import{readFileSync}from"node:fs";var CHANGED=Symbol("changed"),CLASS_LIST=Symbol("classList"),CUSTOM_ELEMENTS=Symbol("CustomElements"),CONTENT=Symbol("content"),DATASET=Symbol("dataset"),DOCTYPE=Symbol("doctype"),DOM_PARSER=Symbol("DOMParser"),END=Symbol("end"),EVENT_TARGET=Symbol("EventTarget"),GLOBALS=Symbol("globals"),IMAGE=Symbol("image"),MIME=Symbol("mime"),MUTATION_OBSERVER=Symbol("MutationObserver"),NEXT=Symbol("next"),OWNER_ELEMENT=Symbol("ownerElement"),PREV=Symbol("prev"),PRIVATE=Symbol("private"),SHEET=Symbol("sheet"),START=Symbol("start"),STYLE=Symbol("style"),UPGRADE=Symbol("upgrade"),VALUE=Symbol("value");var exports_esm3={};__export(exports_esm3,{DefaultHandler:()=>DomHandler,DomHandler:()=>DomHandler,DomUtils:()=>exports_esm2,ElementType:()=>exports_esm,Parser:()=>Parser,QuoteType:()=>QuoteType,Tokenizer:()=>Tokenizer,createDocumentStream:()=>createDocumentStream,createDomStream:()=>createDomStream,getFeed:()=>getFeed,parseDOM:()=>parseDOM,parseDocument:()=>parseDocument,parseFeed:()=>parseFeed});var _a,decodeMap=new Map([[0,65533],[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]]),fromCodePoint=(_a=String.fromCodePoint)!==null&&_a!==void 0?_a:(codePoint)=>{let output="";if(codePoint>65535)codePoint-=65536,output+=String.fromCharCode(codePoint>>>10&1023|55296),codePoint=56320|codePoint&1023;return output+=String.fromCharCode(codePoint),output};function replaceCodePoint(codePoint){var _a;if(codePoint>=55296&&codePoint<=57343||codePoint>1114111)return 65533;return(_a=decodeMap.get(codePoint))!==null&&_a!==void 0?_a:codePoint}function decodeBase64(input){let binary=typeof atob==="function"?atob(input):typeof Buffer.from==="function"?Buffer.from(input,"base64").toString("binary"):new Buffer(input,"base64").toString("binary"),evenLength=binary.length&-2,out=new Uint16Array(evenLength/2);for(let index=0,outIndex=0;index<evenLength;index+=2){let lo=binary.charCodeAt(index),hi=binary.charCodeAt(index+1);out[outIndex++]=lo|hi<<8}return out}var htmlDecodeTree=decodeBase64("QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW5jdGlvbgCgYSBpAG4AZwA7gMUAxUAAAWNzpACoAHIAAOA12Jzc6SFnbgCgVCJpAGwAZABlADuAwwDDQG0AbAA7gMQAxEAABGFjZWZvcnN1xQDYANoA7QDxAPYA+QD8AAABY3LJAM8AayNzbGFzaAAAoBYidgHTANUAAKDnKmUAZAAAoAYjeQARZIABY3J0AOAA5QDrAGEidXNlAACgNSLuI291bGxpcwCgLCFhAJJjcgAA4DXYBd1wAGYAAOA12Dnd5SF2ZdhiYwDyAOoAbSJw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2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg");var xmlDecodeTree=decodeBase64("AAJhZ2xxBwARABMAFQBtAg0AAAAAAA8AcAAmYG8AcwAnYHQAPmB0ADxg9SFvdCJg");var BinTrieFlags;(function(BinTrieFlags){BinTrieFlags[BinTrieFlags.VALUE_LENGTH=49152]="VALUE_LENGTH",BinTrieFlags[BinTrieFlags.FLAG13=8192]="FLAG13",BinTrieFlags[BinTrieFlags.BRANCH_LENGTH=8064]="BRANCH_LENGTH",BinTrieFlags[BinTrieFlags.JUMP_TABLE=127]="JUMP_TABLE"})(BinTrieFlags||(BinTrieFlags={}));var CharCodes;(function(CharCodes){CharCodes[CharCodes.NUM=35]="NUM",CharCodes[CharCodes.SEMI=59]="SEMI",CharCodes[CharCodes.EQUALS=61]="EQUALS",CharCodes[CharCodes.ZERO=48]="ZERO",CharCodes[CharCodes.NINE=57]="NINE",CharCodes[CharCodes.LOWER_A=97]="LOWER_A",CharCodes[CharCodes.LOWER_F=102]="LOWER_F",CharCodes[CharCodes.LOWER_X=120]="LOWER_X",CharCodes[CharCodes.LOWER_Z=122]="LOWER_Z",CharCodes[CharCodes.UPPER_A=65]="UPPER_A",CharCodes[CharCodes.UPPER_F=70]="UPPER_F",CharCodes[CharCodes.UPPER_Z=90]="UPPER_Z"})(CharCodes||(CharCodes={}));var TO_LOWER_BIT=32;function isNumber(code){return code>=CharCodes.ZERO&&code<=CharCodes.NINE}function isHexadecimalCharacter(code){return code>=CharCodes.UPPER_A&&code<=CharCodes.UPPER_F||code>=CharCodes.LOWER_A&&code<=CharCodes.LOWER_F}function isAsciiAlphaNumeric(code){return code>=CharCodes.UPPER_A&&code<=CharCodes.UPPER_Z||code>=CharCodes.LOWER_A&&code<=CharCodes.LOWER_Z||isNumber(code)}function isEntityInAttributeInvalidEnd(code){return code===CharCodes.EQUALS||isAsciiAlphaNumeric(code)}var EntityDecoderState;(function(EntityDecoderState){EntityDecoderState[EntityDecoderState.EntityStart=0]="EntityStart",EntityDecoderState[EntityDecoderState.NumericStart=1]="NumericStart",EntityDecoderState[EntityDecoderState.NumericDecimal=2]="NumericDecimal",EntityDecoderState[EntityDecoderState.NumericHex=3]="NumericHex",EntityDecoderState[EntityDecoderState.NamedEntity=4]="NamedEntity"})(EntityDecoderState||(EntityDecoderState={}));var DecodingMode;(function(DecodingMode){DecodingMode[DecodingMode.Legacy=0]="Legacy",DecodingMode[DecodingMode.Strict=1]="Strict",DecodingMode[DecodingMode.Attribute=2]="Attribute"})(DecodingMode||(DecodingMode={}));class EntityDecoder{constructor(decodeTree,emitCodePoint,errors){this.decodeTree=decodeTree,this.emitCodePoint=emitCodePoint,this.errors=errors,this.state=EntityDecoderState.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=DecodingMode.Strict,this.runConsumed=0}startEntity(decodeMode){this.decodeMode=decodeMode,this.state=EntityDecoderState.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(input,offset){switch(this.state){case EntityDecoderState.EntityStart:{if(input.charCodeAt(offset)===CharCodes.NUM)return this.state=EntityDecoderState.NumericStart,this.consumed+=1,this.stateNumericStart(input,offset+1);return this.state=EntityDecoderState.NamedEntity,this.stateNamedEntity(input,offset)}case EntityDecoderState.NumericStart:return this.stateNumericStart(input,offset);case EntityDecoderState.NumericDecimal:return this.stateNumericDecimal(input,offset);case EntityDecoderState.NumericHex:return this.stateNumericHex(input,offset);case EntityDecoderState.NamedEntity:return this.stateNamedEntity(input,offset)}}stateNumericStart(input,offset){if(offset>=input.length)return-1;if((input.charCodeAt(offset)|TO_LOWER_BIT)===CharCodes.LOWER_X)return this.state=EntityDecoderState.NumericHex,this.consumed+=1,this.stateNumericHex(input,offset+1);return this.state=EntityDecoderState.NumericDecimal,this.stateNumericDecimal(input,offset)}stateNumericHex(input,offset){while(offset<input.length){let char=input.charCodeAt(offset);if(isNumber(char)||isHexadecimalCharacter(char)){let digit=char<=CharCodes.NINE?char-CharCodes.ZERO:(char|TO_LOWER_BIT)-CharCodes.LOWER_A+10;this.result=this.result*16+digit,this.consumed++,offset++}else return this.emitNumericEntity(char,3)}return-1}stateNumericDecimal(input,offset){while(offset<input.length){let char=input.charCodeAt(offset);if(isNumber(char))this.result=this.result*10+(char-CharCodes.ZERO),this.consumed++,offset++;else return this.emitNumericEntity(char,2)}return-1}emitNumericEntity(lastCp,expectedLength){var _a;if(this.consumed<=expectedLength)return(_a=this.errors)===null||_a===void 0||_a.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(lastCp===CharCodes.SEMI)this.consumed+=1;else if(this.decodeMode===DecodingMode.Strict)return 0;if(this.emitCodePoint(replaceCodePoint(this.result),this.consumed),this.errors){if(lastCp!==CharCodes.SEMI)this.errors.missingSemicolonAfterCharacterReference();this.errors.validateNumericCharacterReference(this.result)}return this.consumed}stateNamedEntity(input,offset){let{decodeTree}=this,current=decodeTree[this.treeIndex],valueLength=(current&BinTrieFlags.VALUE_LENGTH)>>14;while(offset<input.length){if(valueLength===0&&(current&BinTrieFlags.FLAG13)!==0){let runLength=(current&BinTrieFlags.BRANCH_LENGTH)>>7;if(this.runConsumed===0){let firstChar=current&BinTrieFlags.JUMP_TABLE;if(input.charCodeAt(offset)!==firstChar)return this.result===0?0:this.emitNotTerminatedNamedEntity();offset++,this.excess++,this.runConsumed++}while(this.runConsumed<runLength){if(offset>=input.length)return-1;let charIndexInPacked=this.runConsumed-1,packedWord=decodeTree[this.treeIndex+1+(charIndexInPacked>>1)],expectedChar=charIndexInPacked%2===0?packedWord&255:packedWord>>8&255;if(input.charCodeAt(offset)!==expectedChar)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();offset++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(runLength>>1),current=decodeTree[this.treeIndex],valueLength=(current&BinTrieFlags.VALUE_LENGTH)>>14}if(offset>=input.length)break;let char=input.charCodeAt(offset);if(char===CharCodes.SEMI&&valueLength!==0&&(current&BinTrieFlags.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,valueLength,this.consumed+this.excess);if(this.treeIndex=determineBranch(decodeTree,current,this.treeIndex+Math.max(1,valueLength),char),this.treeIndex<0)return this.result===0||this.decodeMode===DecodingMode.Attribute&&(valueLength===0||isEntityInAttributeInvalidEnd(char))?0:this.emitNotTerminatedNamedEntity();if(current=decodeTree[this.treeIndex],valueLength=(current&BinTrieFlags.VALUE_LENGTH)>>14,valueLength!==0){if(char===CharCodes.SEMI)return this.emitNamedEntityData(this.treeIndex,valueLength,this.consumed+this.excess);if(this.decodeMode!==DecodingMode.Strict&&(current&BinTrieFlags.FLAG13)===0)this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0}offset++,this.excess++}return-1}emitNotTerminatedNamedEntity(){var _a;let{result,decodeTree}=this,valueLength=(decodeTree[result]&BinTrieFlags.VALUE_LENGTH)>>14;return this.emitNamedEntityData(result,valueLength,this.consumed),(_a=this.errors)===null||_a===void 0||_a.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(result,valueLength,consumed){let{decodeTree}=this;if(this.emitCodePoint(valueLength===1?decodeTree[result]&~(BinTrieFlags.VALUE_LENGTH|BinTrieFlags.FLAG13):decodeTree[result+1],consumed),valueLength===3)this.emitCodePoint(decodeTree[result+2],consumed);return consumed}end(){var _a;switch(this.state){case EntityDecoderState.NamedEntity:return this.result!==0&&(this.decodeMode!==DecodingMode.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case EntityDecoderState.NumericDecimal:return this.emitNumericEntity(0,2);case EntityDecoderState.NumericHex:return this.emitNumericEntity(0,3);case EntityDecoderState.NumericStart:return(_a=this.errors)===null||_a===void 0||_a.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case EntityDecoderState.EntityStart:return 0}}}function determineBranch(decodeTree,current,nodeIndex,char){let branchCount=(current&BinTrieFlags.BRANCH_LENGTH)>>7,jumpOffset=current&BinTrieFlags.JUMP_TABLE;if(branchCount===0)return jumpOffset!==0&&char===jumpOffset?nodeIndex:-1;if(jumpOffset){let value=char-jumpOffset;return value<0||value>=branchCount?-1:decodeTree[nodeIndex+value]-1}let packedKeySlots=branchCount+1>>1,lo=0,hi=branchCount-1;while(lo<=hi){let mid=lo+hi>>>1,slot=mid>>1,midKey=decodeTree[nodeIndex+slot]>>(mid&1)*8&255;if(midKey<char)lo=mid+1;else if(midKey>char)hi=mid-1;else return decodeTree[nodeIndex+packedKeySlots+mid]}return-1}var CharCodes2;(function(CharCodes){CharCodes[CharCodes.Tab=9]="Tab",CharCodes[CharCodes.NewLine=10]="NewLine",CharCodes[CharCodes.FormFeed=12]="FormFeed",CharCodes[CharCodes.CarriageReturn=13]="CarriageReturn",CharCodes[CharCodes.Space=32]="Space",CharCodes[CharCodes.ExclamationMark=33]="ExclamationMark",CharCodes[CharCodes.Number=35]="Number",CharCodes[CharCodes.Amp=38]="Amp",CharCodes[CharCodes.SingleQuote=39]="SingleQuote",CharCodes[CharCodes.DoubleQuote=34]="DoubleQuote",CharCodes[CharCodes.Dash=45]="Dash",CharCodes[CharCodes.Slash=47]="Slash",CharCodes[CharCodes.Zero=48]="Zero",CharCodes[CharCodes.Nine=57]="Nine",CharCodes[CharCodes.Semi=59]="Semi",CharCodes[CharCodes.Lt=60]="Lt",CharCodes[CharCodes.Eq=61]="Eq",CharCodes[CharCodes.Gt=62]="Gt",CharCodes[CharCodes.Questionmark=63]="Questionmark",CharCodes[CharCodes.UpperA=65]="UpperA",CharCodes[CharCodes.LowerA=97]="LowerA",CharCodes[CharCodes.UpperF=70]="UpperF",CharCodes[CharCodes.LowerF=102]="LowerF",CharCodes[CharCodes.UpperZ=90]="UpperZ",CharCodes[CharCodes.LowerZ=122]="LowerZ",CharCodes[CharCodes.LowerX=120]="LowerX",CharCodes[CharCodes.OpeningSquareBracket=91]="OpeningSquareBracket"})(CharCodes2||(CharCodes2={}));var State;(function(State){State[State.Text=1]="Text",State[State.BeforeTagName=2]="BeforeTagName",State[State.InTagName=3]="InTagName",State[State.InSelfClosingTag=4]="InSelfClosingTag",State[State.BeforeClosingTagName=5]="BeforeClosingTagName",State[State.InClosingTagName=6]="InClosingTagName",State[State.AfterClosingTagName=7]="AfterClosingTagName",State[State.BeforeAttributeName=8]="BeforeAttributeName",State[State.InAttributeName=9]="InAttributeName",State[State.AfterAttributeName=10]="AfterAttributeName",State[State.BeforeAttributeValue=11]="BeforeAttributeValue",State[State.InAttributeValueDq=12]="InAttributeValueDq",State[State.InAttributeValueSq=13]="InAttributeValueSq",State[State.InAttributeValueNq=14]="InAttributeValueNq",State[State.BeforeDeclaration=15]="BeforeDeclaration",State[State.InDeclaration=16]="InDeclaration",State[State.InProcessingInstruction=17]="InProcessingInstruction",State[State.BeforeComment=18]="BeforeComment",State[State.CDATASequence=19]="CDATASequence",State[State.InSpecialComment=20]="InSpecialComment",State[State.InCommentLike=21]="InCommentLike",State[State.BeforeSpecialS=22]="BeforeSpecialS",State[State.BeforeSpecialT=23]="BeforeSpecialT",State[State.SpecialStartSequence=24]="SpecialStartSequence",State[State.InSpecialTag=25]="InSpecialTag",State[State.InEntity=26]="InEntity"})(State||(State={}));function isWhitespace(c){return c===CharCodes2.Space||c===CharCodes2.NewLine||c===CharCodes2.Tab||c===CharCodes2.FormFeed||c===CharCodes2.CarriageReturn}function isEndOfTagSection(c){return c===CharCodes2.Slash||c===CharCodes2.Gt||isWhitespace(c)}function isASCIIAlpha(c){return c>=CharCodes2.LowerA&&c<=CharCodes2.LowerZ||c>=CharCodes2.UpperA&&c<=CharCodes2.UpperZ}var QuoteType;(function(QuoteType){QuoteType[QuoteType.NoValue=0]="NoValue",QuoteType[QuoteType.Unquoted=1]="Unquoted",QuoteType[QuoteType.Single=2]="Single",QuoteType[QuoteType.Double=3]="Double"})(QuoteType||(QuoteType={}));var Sequences={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97]),XmpEnd:new Uint8Array([60,47,120,109,112])};class Tokenizer{constructor({xmlMode=!1,decodeEntities=!0},cbs){this.cbs=cbs,this.state=State.Text,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=State.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.xmlMode=xmlMode,this.decodeEntities=decodeEntities,this.entityDecoder=new EntityDecoder(xmlMode?xmlDecodeTree:htmlDecodeTree,(cp,consumed)=>this.emitCodePoint(cp,consumed))}reset(){this.state=State.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=State.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(chunk){this.offset+=this.buffer.length,this.buffer=chunk,this.parse()}end(){if(this.running)this.finish()}pause(){this.running=!1}resume(){if(this.running=!0,this.index<this.buffer.length+this.offset)this.parse()}stateText(c){if(c===CharCodes2.Lt||!this.decodeEntities&&this.fastForwardTo(CharCodes2.Lt)){if(this.index>this.sectionStart)this.cbs.ontext(this.sectionStart,this.index);this.state=State.BeforeTagName,this.sectionStart=this.index}else if(this.decodeEntities&&c===CharCodes2.Amp)this.startEntity()}stateSpecialStartSequence(c){let isEnd=this.sequenceIndex===this.currentSequence.length;if(!(isEnd?isEndOfTagSection(c):(c|32)===this.currentSequence[this.sequenceIndex]))this.isSpecial=!1;else if(!isEnd){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=State.InTagName,this.stateInTagName(c)}stateInSpecialTag(c){if(this.sequenceIndex===this.currentSequence.length){if(c===CharCodes2.Gt||isWhitespace(c)){let endOfText=this.index-this.currentSequence.length;if(this.sectionStart<endOfText){let actualIndex=this.index;this.index=endOfText,this.cbs.ontext(this.sectionStart,endOfText),this.index=actualIndex}this.isSpecial=!1,this.sectionStart=endOfText+2,this.stateInClosingTagName(c);return}this.sequenceIndex=0}if((c|32)===this.currentSequence[this.sequenceIndex])this.sequenceIndex+=1;else if(this.sequenceIndex===0){if(this.currentSequence===Sequences.TitleEnd){if(this.decodeEntities&&c===CharCodes2.Amp)this.startEntity()}else if(this.fastForwardTo(CharCodes2.Lt))this.sequenceIndex=1}else this.sequenceIndex=Number(c===CharCodes2.Lt)}stateCDATASequence(c){if(c===Sequences.Cdata[this.sequenceIndex]){if(++this.sequenceIndex===Sequences.Cdata.length)this.state=State.InCommentLike,this.currentSequence=Sequences.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1}else this.sequenceIndex=0,this.state=State.InDeclaration,this.stateInDeclaration(c)}fastForwardTo(c){while(++this.index<this.buffer.length+this.offset)if(this.buffer.charCodeAt(this.index-this.offset)===c)return!0;return this.index=this.buffer.length+this.offset-1,!1}stateInCommentLike(c){if(c===this.currentSequence[this.sequenceIndex]){if(++this.sequenceIndex===this.currentSequence.length){if(this.currentSequence===Sequences.CdataEnd)this.cbs.oncdata(this.sectionStart,this.index,2);else this.cbs.oncomment(this.sectionStart,this.index,2);this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=State.Text}}else if(this.sequenceIndex===0){if(this.fastForwardTo(this.currentSequence[0]))this.sequenceIndex=1}else if(c!==this.currentSequence[this.sequenceIndex-1])this.sequenceIndex=0}isTagStartChar(c){return this.xmlMode?!isEndOfTagSection(c):isASCIIAlpha(c)}startSpecial(sequence,offset){this.isSpecial=!0,this.currentSequence=sequence,this.sequenceIndex=offset,this.state=State.SpecialStartSequence}stateBeforeTagName(c){if(c===CharCodes2.ExclamationMark)this.state=State.BeforeDeclaration,this.sectionStart=this.index+1;else if(c===CharCodes2.Questionmark)this.state=State.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(c)){let lower=c|32;if(this.sectionStart=this.index,this.xmlMode)this.state=State.InTagName;else if(lower===Sequences.ScriptEnd[2])this.state=State.BeforeSpecialS;else if(lower===Sequences.TitleEnd[2]||lower===Sequences.XmpEnd[2])this.state=State.BeforeSpecialT;else this.state=State.InTagName}else if(c===CharCodes2.Slash)this.state=State.BeforeClosingTagName;else this.state=State.Text,this.stateText(c)}stateInTagName(c){if(isEndOfTagSection(c))this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=State.BeforeAttributeName,this.stateBeforeAttributeName(c)}stateBeforeClosingTagName(c){if(isWhitespace(c));else if(c===CharCodes2.Gt)this.state=State.Text;else this.state=this.isTagStartChar(c)?State.InClosingTagName:State.InSpecialComment,this.sectionStart=this.index}stateInClosingTagName(c){if(c===CharCodes2.Gt||isWhitespace(c))this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=State.AfterClosingTagName,this.stateAfterClosingTagName(c)}stateAfterClosingTagName(c){if(c===CharCodes2.Gt||this.fastForwardTo(CharCodes2.Gt))this.state=State.Text,this.sectionStart=this.index+1}stateBeforeAttributeName(c){if(c===CharCodes2.Gt){if(this.cbs.onopentagend(this.index),this.isSpecial)this.state=State.InSpecialTag,this.sequenceIndex=0;else this.state=State.Text;this.sectionStart=this.index+1}else if(c===CharCodes2.Slash)this.state=State.InSelfClosingTag;else if(!isWhitespace(c))this.state=State.InAttributeName,this.sectionStart=this.index}stateInSelfClosingTag(c){if(c===CharCodes2.Gt)this.cbs.onselfclosingtag(this.index),this.state=State.Text,this.sectionStart=this.index+1,this.isSpecial=!1;else if(!isWhitespace(c))this.state=State.BeforeAttributeName,this.stateBeforeAttributeName(c)}stateInAttributeName(c){if(c===CharCodes2.Eq||isEndOfTagSection(c))this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=State.AfterAttributeName,this.stateAfterAttributeName(c)}stateAfterAttributeName(c){if(c===CharCodes2.Eq)this.state=State.BeforeAttributeValue;else if(c===CharCodes2.Slash||c===CharCodes2.Gt)this.cbs.onattribend(QuoteType.NoValue,this.sectionStart),this.sectionStart=-1,this.state=State.BeforeAttributeName,this.stateBeforeAttributeName(c);else if(!isWhitespace(c))this.cbs.onattribend(QuoteType.NoValue,this.sectionStart),this.state=State.InAttributeName,this.sectionStart=this.index}stateBeforeAttributeValue(c){if(c===CharCodes2.DoubleQuote)this.state=State.InAttributeValueDq,this.sectionStart=this.index+1;else if(c===CharCodes2.SingleQuote)this.state=State.InAttributeValueSq,this.sectionStart=this.index+1;else if(!isWhitespace(c))this.sectionStart=this.index,this.state=State.InAttributeValueNq,this.stateInAttributeValueNoQuotes(c)}handleInAttributeValue(c,quote){if(c===quote||!this.decodeEntities&&this.fastForwardTo(quote))this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(quote===CharCodes2.DoubleQuote?QuoteType.Double:QuoteType.Single,this.index+1),this.state=State.BeforeAttributeName;else if(this.decodeEntities&&c===CharCodes2.Amp)this.startEntity()}stateInAttributeValueDoubleQuotes(c){this.handleInAttributeValue(c,CharCodes2.DoubleQuote)}stateInAttributeValueSingleQuotes(c){this.handleInAttributeValue(c,CharCodes2.SingleQuote)}stateInAttributeValueNoQuotes(c){if(isWhitespace(c)||c===CharCodes2.Gt)this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(QuoteType.Unquoted,this.index),this.state=State.BeforeAttributeName,this.stateBeforeAttributeName(c);else if(this.decodeEntities&&c===CharCodes2.Amp)this.startEntity()}stateBeforeDeclaration(c){if(c===CharCodes2.OpeningSquareBracket)this.state=State.CDATASequence,this.sequenceIndex=0;else this.state=c===CharCodes2.Dash?State.BeforeComment:State.InDeclaration}stateInDeclaration(c){if(c===CharCodes2.Gt||this.fastForwardTo(CharCodes2.Gt))this.cbs.ondeclaration(this.sectionStart,this.index),this.state=State.Text,this.sectionStart=this.index+1}stateInProcessingInstruction(c){if(c===CharCodes2.Gt||this.fastForwardTo(CharCodes2.Gt))this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=State.Text,this.sectionStart=this.index+1}stateBeforeComment(c){if(c===CharCodes2.Dash)this.state=State.InCommentLike,this.currentSequence=Sequences.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1;else this.state=State.InDeclaration}stateInSpecialComment(c){if(c===CharCodes2.Gt||this.fastForwardTo(CharCodes2.Gt))this.cbs.oncomment(this.sectionStart,this.index,0),this.state=State.Text,this.sectionStart=this.index+1}stateBeforeSpecialS(c){let lower=c|32;if(lower===Sequences.ScriptEnd[3])this.startSpecial(Sequences.ScriptEnd,4);else if(lower===Sequences.StyleEnd[3])this.startSpecial(Sequences.StyleEnd,4);else this.state=State.InTagName,this.stateInTagName(c)}stateBeforeSpecialT(c){switch(c|32){case Sequences.TitleEnd[3]:{this.startSpecial(Sequences.TitleEnd,4);break}case Sequences.TextareaEnd[3]:{this.startSpecial(Sequences.TextareaEnd,4);break}case Sequences.XmpEnd[3]:{this.startSpecial(Sequences.XmpEnd,4);break}default:this.state=State.InTagName,this.stateInTagName(c)}}startEntity(){this.baseState=this.state,this.state=State.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?DecodingMode.Strict:this.baseState===State.Text||this.baseState===State.InSpecialTag?DecodingMode.Legacy:DecodingMode.Attribute)}stateInEntity(){let indexInBuffer=this.index-this.offset,length=this.entityDecoder.write(this.buffer,indexInBuffer);if(length>=0){if(this.state=this.baseState,length===0)this.index-=1}else{if(indexInBuffer<this.buffer.length&&this.buffer.charCodeAt(indexInBuffer)===CharCodes2.Amp){this.state=this.baseState,this.index-=1;return}this.index=this.offset+this.buffer.length-1}}cleanup(){if(this.running&&this.sectionStart!==this.index){if(this.state===State.Text||this.state===State.InSpecialTag&&this.sequenceIndex===0)this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index;else if(this.state===State.InAttributeValueDq||this.state===State.InAttributeValueSq||this.state===State.InAttributeValueNq)this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index}}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){while(this.shouldContinue()){let c=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case State.Text:{this.stateText(c);break}case State.SpecialStartSequence:{this.stateSpecialStartSequence(c);break}case State.InSpecialTag:{this.stateInSpecialTag(c);break}case State.CDATASequence:{this.stateCDATASequence(c);break}case State.InAttributeValueDq:{this.stateInAttributeValueDoubleQuotes(c);break}case State.InAttributeName:{this.stateInAttributeName(c);break}case State.InCommentLike:{this.stateInCommentLike(c);break}case State.InSpecialComment:{this.stateInSpecialComment(c);break}case State.BeforeAttributeName:{this.stateBeforeAttributeName(c);break}case State.InTagName:{this.stateInTagName(c);break}case State.InClosingTagName:{this.stateInClosingTagName(c);break}case State.BeforeTagName:{this.stateBeforeTagName(c);break}case State.AfterAttributeName:{this.stateAfterAttributeName(c);break}case State.InAttributeValueSq:{this.stateInAttributeValueSingleQuotes(c);break}case State.BeforeAttributeValue:{this.stateBeforeAttributeValue(c);break}case State.BeforeClosingTagName:{this.stateBeforeClosingTagName(c);break}case State.AfterClosingTagName:{this.stateAfterClosingTagName(c);break}case State.BeforeSpecialS:{this.stateBeforeSpecialS(c);break}case State.BeforeSpecialT:{this.stateBeforeSpecialT(c);break}case State.InAttributeValueNq:{this.stateInAttributeValueNoQuotes(c);break}case State.InSelfClosingTag:{this.stateInSelfClosingTag(c);break}case State.InDeclaration:{this.stateInDeclaration(c);break}case State.BeforeDeclaration:{this.stateBeforeDeclaration(c);break}case State.BeforeComment:{this.stateBeforeComment(c);break}case State.InProcessingInstruction:{this.stateInProcessingInstruction(c);break}case State.InEntity:{this.stateInEntity();break}}this.index++}this.cleanup()}finish(){if(this.state===State.InEntity)this.entityDecoder.end(),this.state=this.baseState;this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){let endIndex=this.buffer.length+this.offset;if(this.sectionStart>=endIndex)return;if(this.state===State.InCommentLike)if(this.currentSequence===Sequences.CdataEnd)this.cbs.oncdata(this.sectionStart,endIndex,0);else this.cbs.oncomment(this.sectionStart,endIndex,0);else if(this.state===State.InTagName||this.state===State.BeforeAttributeName||this.state===State.BeforeAttributeValue||this.state===State.AfterAttributeName||this.state===State.InAttributeName||this.state===State.InAttributeValueSq||this.state===State.InAttributeValueDq||this.state===State.InAttributeValueNq||this.state===State.InClosingTagName);else this.cbs.ontext(this.sectionStart,endIndex)}emitCodePoint(cp,consumed){if(this.baseState!==State.Text&&this.baseState!==State.InSpecialTag){if(this.sectionStart<this.entityStart)this.cbs.onattribdata(this.sectionStart,this.entityStart);this.sectionStart=this.entityStart+consumed,this.index=this.sectionStart-1,this.cbs.onattribentity(cp)}else{if(this.sectionStart<this.entityStart)this.cbs.ontext(this.sectionStart,this.entityStart);this.sectionStart=this.entityStart+consumed,this.index=this.sectionStart-1,this.cbs.ontextentity(cp,this.sectionStart)}}}var formTags=new Set(["input","option","optgroup","select","button","datalist","textarea"]),pTag=new Set(["p"]),tableSectionTags=new Set(["thead","tbody"]),ddtTags=new Set(["dd","dt"]),rtpTags=new Set(["rt","rp"]),openImpliesClose=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",pTag],["h1",pTag],["h2",pTag],["h3",pTag],["h4",pTag],["h5",pTag],["h6",pTag],["select",formTags],["input",formTags],["output",formTags],["button",formTags],["datalist",formTags],["textarea",formTags],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",ddtTags],["dt",ddtTags],["address",pTag],["article",pTag],["aside",pTag],["blockquote",pTag],["details",pTag],["div",pTag],["dl",pTag],["fieldset",pTag],["figcaption",pTag],["figure",pTag],["footer",pTag],["form",pTag],["header",pTag],["hr",pTag],["main",pTag],["nav",pTag],["ol",pTag],["pre",pTag],["section",pTag],["table",pTag],["ul",pTag],["rt",rtpTags],["rp",rtpTags],["tbody",tableSectionTags],["tfoot",tableSectionTags]]),voidElements=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),foreignContextElements=new Set(["math","svg"]),htmlIntegrationElements=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),reNameEnd=/\s|\//;class Parser{constructor(cbs,options={}){var _a,_b,_c,_d,_e,_f;this.options=options,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=cbs!==null&&cbs!==void 0?cbs:{},this.htmlMode=!this.options.xmlMode,this.lowerCaseTagNames=(_a=options.lowerCaseTags)!==null&&_a!==void 0?_a:this.htmlMode,this.lowerCaseAttributeNames=(_b=options.lowerCaseAttributeNames)!==null&&_b!==void 0?_b:this.htmlMode,this.recognizeSelfClosing=(_c=options.recognizeSelfClosing)!==null&&_c!==void 0?_c:!this.htmlMode,this.tokenizer=new((_d=options.Tokenizer)!==null&&_d!==void 0?_d:Tokenizer)(this.options,this),this.foreignContext=[!this.htmlMode],(_f=(_e=this.cbs).onparserinit)===null||_f===void 0||_f.call(_e,this)}ontext(start,endIndex){var _a,_b;let data=this.getSlice(start,endIndex);this.endIndex=endIndex-1,(_b=(_a=this.cbs).ontext)===null||_b===void 0||_b.call(_a,data),this.startIndex=endIndex}ontextentity(cp,endIndex){var _a,_b;this.endIndex=endIndex-1,(_b=(_a=this.cbs).ontext)===null||_b===void 0||_b.call(_a,fromCodePoint(cp)),this.startIndex=endIndex}isVoidElement(name){return this.htmlMode&&voidElements.has(name)}onopentagname(start,endIndex){this.endIndex=endIndex;let name=this.getSlice(start,endIndex);if(this.lowerCaseTagNames)name=name.toLowerCase();this.emitOpenTag(name)}emitOpenTag(name){var _a,_b,_c,_d;this.openTagStart=this.startIndex,this.tagname=name;let impliesClose=this.htmlMode&&openImpliesClose.get(name);if(impliesClose)while(this.stack.length>0&&impliesClose.has(this.stack[0])){let element=this.stack.shift();(_b=(_a=this.cbs).onclosetag)===null||_b===void 0||_b.call(_a,element,!0)}if(!this.isVoidElement(name)){if(this.stack.unshift(name),this.htmlMode){if(foreignContextElements.has(name))this.foreignContext.unshift(!0);else if(htmlIntegrationElements.has(name))this.foreignContext.unshift(!1)}}if((_d=(_c=this.cbs).onopentagname)===null||_d===void 0||_d.call(_c,name),this.cbs.onopentag)this.attribs={}}endOpenTag(isImplied){var _a,_b;if(this.startIndex=this.openTagStart,this.attribs)(_b=(_a=this.cbs).onopentag)===null||_b===void 0||_b.call(_a,this.tagname,this.attribs,isImplied),this.attribs=null;if(this.cbs.onclosetag&&this.isVoidElement(this.tagname))this.cbs.onclosetag(this.tagname,!0);this.tagname=""}onopentagend(endIndex){this.endIndex=endIndex,this.endOpenTag(!1),this.startIndex=endIndex+1}onclosetag(start,endIndex){var _a,_b,_c,_d,_e,_f,_g,_h;this.endIndex=endIndex;let name=this.getSlice(start,endIndex);if(this.lowerCaseTagNames)name=name.toLowerCase();if(this.htmlMode&&(foreignContextElements.has(name)||htmlIntegrationElements.has(name)))this.foreignContext.shift();if(!this.isVoidElement(name)){let pos=this.stack.indexOf(name);if(pos!==-1)for(let index=0;index<=pos;index++){let element=this.stack.shift();(_b=(_a=this.cbs).onclosetag)===null||_b===void 0||_b.call(_a,element,index!==pos)}else if(this.htmlMode&&name==="p")this.emitOpenTag("p"),this.closeCurrentTag(!0)}else if(this.htmlMode&&name==="br")(_d=(_c=this.cbs).onopentagname)===null||_d===void 0||_d.call(_c,"br"),(_f=(_e=this.cbs).onopentag)===null||_f===void 0||_f.call(_e,"br",{},!0),(_h=(_g=this.cbs).onclosetag)===null||_h===void 0||_h.call(_g,"br",!1);this.startIndex=endIndex+1}onselfclosingtag(endIndex){if(this.endIndex=endIndex,this.recognizeSelfClosing||this.foreignContext[0])this.closeCurrentTag(!1),this.startIndex=endIndex+1;else this.onopentagend(endIndex)}closeCurrentTag(isOpenImplied){var _a,_b;let name=this.tagname;if(this.endOpenTag(isOpenImplied),this.stack[0]===name)(_b=(_a=this.cbs).onclosetag)===null||_b===void 0||_b.call(_a,name,!isOpenImplied),this.stack.shift()}onattribname(start,endIndex){this.startIndex=start;let name=this.getSlice(start,endIndex);this.attribname=this.lowerCaseAttributeNames?name.toLowerCase():name}onattribdata(start,endIndex){this.attribvalue+=this.getSlice(start,endIndex)}onattribentity(cp){this.attribvalue+=fromCodePoint(cp)}onattribend(quote,endIndex){var _a,_b;if(this.endIndex=endIndex,(_b=(_a=this.cbs).onattribute)===null||_b===void 0||_b.call(_a,this.attribname,this.attribvalue,quote===QuoteType.Double?'"':quote===QuoteType.Single?"'":quote===QuoteType.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname))this.attribs[this.attribname]=this.attribvalue;this.attribvalue=""}getInstructionName(value){let index=value.search(reNameEnd),name=index<0?value:value.substr(0,index);if(this.lowerCaseTagNames)name=name.toLowerCase();return name}ondeclaration(start,endIndex){this.endIndex=endIndex;let value=this.getSlice(start,endIndex);if(this.cbs.onprocessinginstruction){let name=this.getInstructionName(value);this.cbs.onprocessinginstruction(`!${name}`,`!${value}`)}this.startIndex=endIndex+1}onprocessinginstruction(start,endIndex){this.endIndex=endIndex;let value=this.getSlice(start,endIndex);if(this.cbs.onprocessinginstruction){let name=this.getInstructionName(value);this.cbs.onprocessinginstruction(`?${name}`,`?${value}`)}this.startIndex=endIndex+1}oncomment(start,endIndex,offset){var _a,_b,_c,_d;this.endIndex=endIndex,(_b=(_a=this.cbs).oncomment)===null||_b===void 0||_b.call(_a,this.getSlice(start,endIndex-offset)),(_d=(_c=this.cbs).oncommentend)===null||_d===void 0||_d.call(_c),this.startIndex=endIndex+1}oncdata(start,endIndex,offset){var _a,_b,_c,_d,_e,_f,_g,_h,_j,_k;this.endIndex=endIndex;let value=this.getSlice(start,endIndex-offset);if(!this.htmlMode||this.options.recognizeCDATA)(_b=(_a=this.cbs).oncdatastart)===null||_b===void 0||_b.call(_a),(_d=(_c=this.cbs).ontext)===null||_d===void 0||_d.call(_c,value),(_f=(_e=this.cbs).oncdataend)===null||_f===void 0||_f.call(_e);else(_h=(_g=this.cbs).oncomment)===null||_h===void 0||_h.call(_g,`[CDATA[${value}]]`),(_k=(_j=this.cbs).oncommentend)===null||_k===void 0||_k.call(_j);this.startIndex=endIndex+1}onend(){var _a,_b;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let index=0;index<this.stack.length;index++)this.cbs.onclosetag(this.stack[index],!0)}(_b=(_a=this.cbs).onend)===null||_b===void 0||_b.call(_a)}reset(){var _a,_b,_c,_d;(_b=(_a=this.cbs).onreset)===null||_b===void 0||_b.call(_a),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(_d=(_c=this.cbs).onparserinit)===null||_d===void 0||_d.call(_c,this),this.buffers.length=0,this.foreignContext.length=0,this.foreignContext.unshift(!this.htmlMode),this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(data){this.reset(),this.end(data)}getSlice(start,end){while(start-this.bufferOffset>=this.buffers[0].length)this.shiftBuffer();let slice=this.buffers[0].slice(start-this.bufferOffset,end-this.bufferOffset);while(end-this.bufferOffset>this.buffers[0].length)this.shiftBuffer(),slice+=this.buffers[0].slice(0,end-this.bufferOffset);return slice}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(chunk){var _a,_b;if(this.ended){(_b=(_a=this.cbs).onerror)===null||_b===void 0||_b.call(_a,Error(".write() after done!"));return}if(this.buffers.push(chunk),this.tokenizer.running)this.tokenizer.write(chunk),this.writeIndex++}end(chunk){var _a,_b;if(this.ended){(_b=(_a=this.cbs).onerror)===null||_b===void 0||_b.call(_a,Error(".end() after done!"));return}if(chunk)this.write(chunk);this.ended=!0,this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){this.tokenizer.resume();while(this.tokenizer.running&&this.writeIndex<this.buffers.length)this.tokenizer.write(this.buffers[this.writeIndex++]);if(this.ended)this.tokenizer.end()}parseChunk(chunk){this.write(chunk)}done(chunk){this.end(chunk)}}var exports_esm={};__export(exports_esm,{CDATA:()=>CDATA,Comment:()=>Comment,Directive:()=>Directive,Doctype:()=>Doctype,ElementType:()=>ElementType,Root:()=>Root,Script:()=>Script,Style:()=>Style,Tag:()=>Tag,Text:()=>Text,isTag:()=>isTag});var ElementType;(function(ElementType2){ElementType2.Root="root",ElementType2.Text="text",ElementType2.Directive="directive",ElementType2.Comment="comment",ElementType2.Script="script",ElementType2.Style="style",ElementType2.Tag="tag",ElementType2.CDATA="cdata",ElementType2.Doctype="doctype"})(ElementType||(ElementType={}));function isTag(elem){return elem.type===ElementType.Tag||elem.type===ElementType.Script||elem.type===ElementType.Style}var Root=ElementType.Root,Text=ElementType.Text,Directive=ElementType.Directive,Comment=ElementType.Comment,Script=ElementType.Script,Style=ElementType.Style,Tag=ElementType.Tag,CDATA=ElementType.CDATA,Doctype=ElementType.Doctype;class Node{constructor(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}get parentNode(){return this.parent}set parentNode(parent){this.parent=parent}get previousSibling(){return this.prev}set previousSibling(prev){this.prev=prev}get nextSibling(){return this.next}set nextSibling(next){this.next=next}cloneNode(recursive=!1){return cloneNode(this,recursive)}}class DataNode extends Node{constructor(data){super();this.data=data}get nodeValue(){return this.data}set nodeValue(data){this.data=data}}class Text2 extends DataNode{constructor(){super(...arguments);this.type=ElementType.Text}get nodeType(){return 3}}class Comment2 extends DataNode{constructor(){super(...arguments);this.type=ElementType.Comment}get nodeType(){return 8}}class ProcessingInstruction extends DataNode{constructor(name,data){super(data);this.name=name,this.type=ElementType.Directive}get nodeType(){return 1}}class NodeWithChildren extends Node{constructor(children){super();this.children=children}get firstChild(){var _a;return(_a=this.children[0])!==null&&_a!==void 0?_a:null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(children){this.children=children}}class CDATA2 extends NodeWithChildren{constructor(){super(...arguments);this.type=ElementType.CDATA}get nodeType(){return 4}}class Document extends NodeWithChildren{constructor(){super(...arguments);this.type=ElementType.Root}get nodeType(){return 9}}class Element extends NodeWithChildren{constructor(name,attribs,children=[],type=name==="script"?ElementType.Script:name==="style"?ElementType.Style:ElementType.Tag){super(children);this.name=name,this.attribs=attribs,this.type=type}get nodeType(){return 1}get tagName(){return this.name}set tagName(name){this.name=name}get attributes(){return Object.keys(this.attribs).map((name)=>{var _a,_b;return{name,value:this.attribs[name],namespace:(_a=this["x-attribsNamespace"])===null||_a===void 0?void 0:_a[name],prefix:(_b=this["x-attribsPrefix"])===null||_b===void 0?void 0:_b[name]}})}}function isTag2(node){return isTag(node)}function isCDATA(node){return node.type===ElementType.CDATA}function isText(node){return node.type===ElementType.Text}function isComment(node){return node.type===ElementType.Comment}function isDirective(node){return node.type===ElementType.Directive}function isDocument(node){return node.type===ElementType.Root}function hasChildren(node){return Object.prototype.hasOwnProperty.call(node,"children")}function cloneNode(node,recursive=!1){let result;if(isText(node))result=new Text2(node.data);else if(isComment(node))result=new Comment2(node.data);else if(isTag2(node)){let children=recursive?cloneChildren(node.children):[],clone=new Element(node.name,{...node.attribs},children);if(children.forEach((child)=>child.parent=clone),node.namespace!=null)clone.namespace=node.namespace;if(node["x-attribsNamespace"])clone["x-attribsNamespace"]={...node["x-attribsNamespace"]};if(node["x-attribsPrefix"])clone["x-attribsPrefix"]={...node["x-attribsPrefix"]};result=clone}else if(isCDATA(node)){let children=recursive?cloneChildren(node.children):[],clone=new CDATA2(children);children.forEach((child)=>child.parent=clone),result=clone}else if(isDocument(node)){let children=recursive?cloneChildren(node.children):[],clone=new Document(children);if(children.forEach((child)=>child.parent=clone),node["x-mode"])clone["x-mode"]=node["x-mode"];result=clone}else if(isDirective(node)){let instruction=new ProcessingInstruction(node.name,node.data);if(node["x-name"]!=null)instruction["x-name"]=node["x-name"],instruction["x-publicId"]=node["x-publicId"],instruction["x-systemId"]=node["x-systemId"];result=instruction}else throw Error(`Not implemented yet: ${node.type}`);if(result.startIndex=node.startIndex,result.endIndex=node.endIndex,node.sourceCodeLocation!=null)result.sourceCodeLocation=node.sourceCodeLocation;return result}function cloneChildren(childs){let children=childs.map((child)=>cloneNode(child,!0));for(let i=1;i<children.length;i++)children[i].prev=children[i-1],children[i-1].next=children[i];return children}var defaultOpts={withStartIndices:!1,withEndIndices:!1,xmlMode:!1};class DomHandler{constructor(callback,options,elementCB){if(this.dom=[],this.root=new Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof options==="function")elementCB=options,options=defaultOpts;if(typeof callback==="object")options=callback,callback=void 0;this.callback=callback!==null&&callback!==void 0?callback:null,this.options=options!==null&&options!==void 0?options:defaultOpts,this.elementCB=elementCB!==null&&elementCB!==void 0?elementCB:null}onparserinit(parser){this.parser=parser}onreset(){this.dom=[],this.root=new Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null}onend(){if(this.done)return;this.done=!0,this.parser=null,this.handleCallback(null)}onerror(error){this.handleCallback(error)}onclosetag(){this.lastNode=null;let elem=this.tagStack.pop();if(this.options.withEndIndices)elem.endIndex=this.parser.endIndex;if(this.elementCB)this.elementCB(elem)}onopentag(name,attribs){let type=this.options.xmlMode?ElementType.Tag:void 0,element=new Element(name,attribs,void 0,type);this.addNode(element),this.tagStack.push(element)}ontext(data){let{lastNode}=this;if(lastNode&&lastNode.type===ElementType.Text){if(lastNode.data+=data,this.options.withEndIndices)lastNode.endIndex=this.parser.endIndex}else{let node2=new Text2(data);this.addNode(node2),this.lastNode=node2}}oncomment(data){if(this.lastNode&&this.lastNode.type===ElementType.Comment){this.lastNode.data+=data;return}let node2=new Comment2(data);this.addNode(node2),this.lastNode=node2}oncommentend(){this.lastNode=null}oncdatastart(){let text=new Text2(""),node2=new CDATA2([text]);this.addNode(node2),text.parent=node2,this.lastNode=text}oncdataend(){this.lastNode=null}onprocessinginstruction(name,data){let node2=new ProcessingInstruction(name,data);this.addNode(node2)}handleCallback(error){if(typeof this.callback==="function")this.callback(error,this.dom);else if(error)throw error}addNode(node2){let parent=this.tagStack[this.tagStack.length-1],previousSibling=parent.children[parent.children.length-1];if(this.options.withStartIndices)node2.startIndex=this.parser.startIndex;if(this.options.withEndIndices)node2.endIndex=this.parser.endIndex;if(parent.children.push(node2),previousSibling)node2.prev=previousSibling,previousSibling.next=node2;node2.parent=parent,this.lastNode=null}}var exports_esm2={};__export(exports_esm2,{DocumentPosition:()=>DocumentPosition,append:()=>append,appendChild:()=>appendChild,compareDocumentPosition:()=>compareDocumentPosition,existsOne:()=>existsOne,filter:()=>filter,find:()=>find,findAll:()=>findAll,findOne:()=>findOne,findOneChild:()=>findOneChild,getAttributeValue:()=>getAttributeValue,getChildren:()=>getChildren,getElementById:()=>getElementById,getElements:()=>getElements,getElementsByClassName:()=>getElementsByClassName,getElementsByTagName:()=>getElementsByTagName,getElementsByTagType:()=>getElementsByTagType,getFeed:()=>getFeed,getInnerHTML:()=>getInnerHTML,getName:()=>getName,getOuterHTML:()=>getOuterHTML,getParent:()=>getParent,getSiblings:()=>getSiblings,getText:()=>getText,hasAttrib:()=>hasAttrib,hasChildren:()=>hasChildren,innerText:()=>innerText,isCDATA:()=>isCDATA,isComment:()=>isComment,isDocument:()=>isDocument,isTag:()=>isTag2,isText:()=>isText,nextElementSibling:()=>nextElementSibling,prepend:()=>prepend,prependChild:()=>prependChild,prevElementSibling:()=>prevElementSibling,removeElement:()=>removeElement,removeSubsets:()=>removeSubsets,replaceElement:()=>replaceElement,testElement:()=>testElement,textContent:()=>textContent,uniqueSort:()=>uniqueSort});var xmlReplacer=/["&'<>$\x80-\uFFFF]/g,xmlCodeMap=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]),getCodePoint=String.prototype.codePointAt!=null?(str,index)=>str.codePointAt(index):(c,index)=>(c.charCodeAt(index)&64512)===55296?(c.charCodeAt(index)-55296)*1024+c.charCodeAt(index+1)-56320+65536:c.charCodeAt(index);function encodeXML(str){let ret="",lastIdx=0,match;while((match=xmlReplacer.exec(str))!==null){let i=match.index,char=str.charCodeAt(i),next=xmlCodeMap.get(char);if(next!==void 0)ret+=str.substring(lastIdx,i)+next,lastIdx=i+1;else ret+=`${str.substring(lastIdx,i)}&#x${getCodePoint(str,i).toString(16)};`,lastIdx=xmlReplacer.lastIndex+=Number((char&64512)===55296)}return ret+str.substr(lastIdx)}function getEscaper(regex,map){return function(data){let match,lastIdx=0,result="";while(match=regex.exec(data)){if(lastIdx!==match.index)result+=data.substring(lastIdx,match.index);result+=map.get(match[0].charCodeAt(0)),lastIdx=match.index+1}return result+data.substring(lastIdx)}}var escapeUTF8=getEscaper(/[&<>'"]/g,xmlCodeMap),escapeAttribute=getEscaper(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),escapeText=getEscaper(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]));var EntityLevel;(function(EntityLevel){EntityLevel[EntityLevel.XML=0]="XML",EntityLevel[EntityLevel.HTML=1]="HTML"})(EntityLevel||(EntityLevel={}));var EncodingMode;(function(EncodingMode){EncodingMode[EncodingMode.UTF8=0]="UTF8",EncodingMode[EncodingMode.ASCII=1]="ASCII",EncodingMode[EncodingMode.Extensive=2]="Extensive",EncodingMode[EncodingMode.Attribute=3]="Attribute",EncodingMode[EncodingMode.Text=4]="Text"})(EncodingMode||(EncodingMode={}));var elementNames=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","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","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map((val)=>[val.toLowerCase(),val])),attributeNames=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map((val)=>[val.toLowerCase(),val]));var unencodedElements=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]);function replaceQuotes(value){return value.replace(/"/g,""")}function formatAttributes(attributes,opts){var _a;if(!attributes)return;let encode=((_a=opts.encodeEntities)!==null&&_a!==void 0?_a:opts.decodeEntities)===!1?replaceQuotes:opts.xmlMode||opts.encodeEntities!=="utf8"?encodeXML:escapeAttribute;return Object.keys(attributes).map((key)=>{var _a,_b;let value=(_a=attributes[key])!==null&&_a!==void 0?_a:"";if(opts.xmlMode==="foreign")key=(_b=attributeNames.get(key))!==null&&_b!==void 0?_b:key;if(!opts.emptyAttrs&&!opts.xmlMode&&value==="")return key;return`${key}="${encode(value)}"`}).join(" ")}var singleTag=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);function render(node,options={}){let nodes="length"in node?node:[node],output="";for(let i=0;i<nodes.length;i++)output+=renderNode(nodes[i],options);return output}var esm_default=render;function renderNode(node,options){switch(node.type){case Root:return render(node.children,options);case Doctype:case Directive:return renderDirective(node);case Comment:return renderComment(node);case CDATA:return renderCdata(node);case Script:case Style:case Tag:return renderTag(node,options);case Text:return renderText(node,options)}}var foreignModeIntegrationPoints=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),foreignElements=new Set(["svg","math"]);function renderTag(elem,opts){var _a;if(opts.xmlMode==="foreign"){if(elem.name=(_a=elementNames.get(elem.name))!==null&&_a!==void 0?_a:elem.name,elem.parent&&foreignModeIntegrationPoints.has(elem.parent.name))opts={...opts,xmlMode:!1}}if(!opts.xmlMode&&foreignElements.has(elem.name))opts={...opts,xmlMode:"foreign"};let tag=`<${elem.name}`,attribs=formatAttributes(elem.attribs,opts);if(attribs)tag+=` ${attribs}`;if(elem.children.length===0&&(opts.xmlMode?opts.selfClosingTags!==!1:opts.selfClosingTags&&singleTag.has(elem.name))){if(!opts.xmlMode)tag+=" ";tag+="/>"}else{if(tag+=">",elem.children.length>0)tag+=render(elem.children,opts);if(opts.xmlMode||!singleTag.has(elem.name))tag+=`</${elem.name}>`}return tag}function renderDirective(elem){return`<${elem.data}>`}function renderText(elem,opts){var _a;let data=elem.data||"";if(((_a=opts.encodeEntities)!==null&&_a!==void 0?_a:opts.decodeEntities)!==!1&&!(!opts.xmlMode&&elem.parent&&unencodedElements.has(elem.parent.name)))data=opts.xmlMode||opts.encodeEntities!=="utf8"?encodeXML(data):escapeText(data);return data}function renderCdata(elem){return`<![CDATA[${elem.children[0].data}]]>`}function renderComment(elem){return`<!--${elem.data}-->`}function getOuterHTML(node,options){return esm_default(node,options)}function getInnerHTML(node,options){return hasChildren(node)?node.children.map((node)=>getOuterHTML(node,options)).join(""):""}function getText(node){if(Array.isArray(node))return node.map(getText).join("");if(isTag2(node))return node.name==="br"?`
|
|
45
|
+
`:getText(node.children);if(isCDATA(node))return getText(node.children);if(isText(node))return node.data;return""}function textContent(node){if(Array.isArray(node))return node.map(textContent).join("");if(hasChildren(node)&&!isComment(node))return textContent(node.children);if(isText(node))return node.data;return""}function innerText(node){if(Array.isArray(node))return node.map(innerText).join("");if(hasChildren(node)&&(node.type===ElementType.Tag||isCDATA(node)))return innerText(node.children);if(isText(node))return node.data;return""}function getChildren(elem){return hasChildren(elem)?elem.children:[]}function getParent(elem){return elem.parent||null}function getSiblings(elem){let parent=getParent(elem);if(parent!=null)return getChildren(parent);let siblings=[elem],{prev,next}=elem;while(prev!=null)siblings.unshift(prev),{prev}=prev;while(next!=null)siblings.push(next),{next}=next;return siblings}function getAttributeValue(elem,name){var _a;return(_a=elem.attribs)===null||_a===void 0?void 0:_a[name]}function hasAttrib(elem,name){return elem.attribs!=null&&Object.prototype.hasOwnProperty.call(elem.attribs,name)&&elem.attribs[name]!=null}function getName(elem){return elem.name}function nextElementSibling(elem){let{next}=elem;while(next!==null&&!isTag2(next))({next}=next);return next}function prevElementSibling(elem){let{prev}=elem;while(prev!==null&&!isTag2(prev))({prev}=prev);return prev}function removeElement(elem){if(elem.prev)elem.prev.next=elem.next;if(elem.next)elem.next.prev=elem.prev;if(elem.parent){let childs=elem.parent.children,childsIndex=childs.lastIndexOf(elem);if(childsIndex>=0)childs.splice(childsIndex,1)}elem.next=null,elem.prev=null,elem.parent=null}function replaceElement(elem,replacement){let prev=replacement.prev=elem.prev;if(prev)prev.next=replacement;let next=replacement.next=elem.next;if(next)next.prev=replacement;let parent=replacement.parent=elem.parent;if(parent){let childs=parent.children;childs[childs.lastIndexOf(elem)]=replacement,elem.parent=null}}function appendChild(parent,child){if(removeElement(child),child.next=null,child.parent=parent,parent.children.push(child)>1){let sibling=parent.children[parent.children.length-2];sibling.next=child,child.prev=sibling}else child.prev=null}function append(elem,next){removeElement(next);let{parent}=elem,currNext=elem.next;if(next.next=currNext,next.prev=elem,elem.next=next,next.parent=parent,currNext){if(currNext.prev=next,parent){let childs=parent.children;childs.splice(childs.lastIndexOf(currNext),0,next)}}else if(parent)parent.children.push(next)}function prependChild(parent,child){if(removeElement(child),child.parent=parent,child.prev=null,parent.children.unshift(child)!==1){let sibling=parent.children[1];sibling.prev=child,child.next=sibling}else child.next=null}function prepend(elem,prev){removeElement(prev);let{parent}=elem;if(parent){let childs=parent.children;childs.splice(childs.indexOf(elem),0,prev)}if(elem.prev)elem.prev.next=prev;prev.parent=parent,prev.prev=elem.prev,prev.next=elem,elem.prev=prev}function filter(test,node,recurse=!0,limit=1/0){return find(test,Array.isArray(node)?node:[node],recurse,limit)}function find(test,nodes,recurse,limit){let result=[],nodeStack=[Array.isArray(nodes)?nodes:[nodes]],indexStack=[0];for(;;){if(indexStack[0]>=nodeStack[0].length){if(indexStack.length===1)return result;nodeStack.shift(),indexStack.shift();continue}let elem=nodeStack[0][indexStack[0]++];if(test(elem)){if(result.push(elem),--limit<=0)return result}if(recurse&&hasChildren(elem)&&elem.children.length>0)indexStack.unshift(0),nodeStack.unshift(elem.children)}}function findOneChild(test,nodes){return nodes.find(test)}function findOne(test,nodes,recurse=!0){let searchedNodes=Array.isArray(nodes)?nodes:[nodes];for(let i=0;i<searchedNodes.length;i++){let node=searchedNodes[i];if(isTag2(node)&&test(node))return node;if(recurse&&hasChildren(node)&&node.children.length>0){let found=findOne(test,node.children,!0);if(found)return found}}return null}function existsOne(test,nodes){return(Array.isArray(nodes)?nodes:[nodes]).some((node)=>isTag2(node)&&test(node)||hasChildren(node)&&existsOne(test,node.children))}function findAll(test,nodes){let result=[],nodeStack=[Array.isArray(nodes)?nodes:[nodes]],indexStack=[0];for(;;){if(indexStack[0]>=nodeStack[0].length){if(nodeStack.length===1)return result;nodeStack.shift(),indexStack.shift();continue}let elem=nodeStack[0][indexStack[0]++];if(isTag2(elem)&&test(elem))result.push(elem);if(hasChildren(elem)&&elem.children.length>0)indexStack.unshift(0),nodeStack.unshift(elem.children)}}var Checks={tag_name(name){if(typeof name==="function")return(elem)=>isTag2(elem)&&name(elem.name);else if(name==="*")return isTag2;return(elem)=>isTag2(elem)&&elem.name===name},tag_type(type){if(typeof type==="function")return(elem)=>type(elem.type);return(elem)=>elem.type===type},tag_contains(data){if(typeof data==="function")return(elem)=>isText(elem)&&data(elem.data);return(elem)=>isText(elem)&&elem.data===data}};function getAttribCheck(attrib,value){if(typeof value==="function")return(elem)=>isTag2(elem)&&value(elem.attribs[attrib]);return(elem)=>isTag2(elem)&&elem.attribs[attrib]===value}function combineFuncs(a,b){return(elem)=>a(elem)||b(elem)}function compileTest(options){let funcs=Object.keys(options).map((key)=>{let value=options[key];return Object.prototype.hasOwnProperty.call(Checks,key)?Checks[key](value):getAttribCheck(key,value)});return funcs.length===0?null:funcs.reduce(combineFuncs)}function testElement(options,node){let test=compileTest(options);return test?test(node):!0}function getElements(options,nodes,recurse,limit=1/0){let test=compileTest(options);return test?filter(test,nodes,recurse,limit):[]}function getElementById(id,nodes,recurse=!0){if(!Array.isArray(nodes))nodes=[nodes];return findOne(getAttribCheck("id",id),nodes,recurse)}function getElementsByTagName(tagName,nodes,recurse=!0,limit=1/0){return filter(Checks.tag_name(tagName),nodes,recurse,limit)}function getElementsByClassName(className,nodes,recurse=!0,limit=1/0){return filter(getAttribCheck("class",className),nodes,recurse,limit)}function getElementsByTagType(type,nodes,recurse=!0,limit=1/0){return filter(Checks.tag_type(type),nodes,recurse,limit)}function removeSubsets(nodes){let idx=nodes.length;while(--idx>=0){let node=nodes[idx];if(idx>0&&nodes.lastIndexOf(node,idx-1)>=0){nodes.splice(idx,1);continue}for(let ancestor=node.parent;ancestor;ancestor=ancestor.parent)if(nodes.includes(ancestor)){nodes.splice(idx,1);break}}return nodes}var DocumentPosition;(function(DocumentPosition){DocumentPosition[DocumentPosition.DISCONNECTED=1]="DISCONNECTED",DocumentPosition[DocumentPosition.PRECEDING=2]="PRECEDING",DocumentPosition[DocumentPosition.FOLLOWING=4]="FOLLOWING",DocumentPosition[DocumentPosition.CONTAINS=8]="CONTAINS",DocumentPosition[DocumentPosition.CONTAINED_BY=16]="CONTAINED_BY"})(DocumentPosition||(DocumentPosition={}));function compareDocumentPosition(nodeA,nodeB){let aParents=[],bParents=[];if(nodeA===nodeB)return 0;let current=hasChildren(nodeA)?nodeA:nodeA.parent;while(current)aParents.unshift(current),current=current.parent;current=hasChildren(nodeB)?nodeB:nodeB.parent;while(current)bParents.unshift(current),current=current.parent;let maxIdx=Math.min(aParents.length,bParents.length),idx=0;while(idx<maxIdx&&aParents[idx]===bParents[idx])idx++;if(idx===0)return DocumentPosition.DISCONNECTED;let sharedParent=aParents[idx-1],siblings=sharedParent.children,aSibling=aParents[idx],bSibling=bParents[idx];if(siblings.indexOf(aSibling)>siblings.indexOf(bSibling)){if(sharedParent===nodeB)return DocumentPosition.FOLLOWING|DocumentPosition.CONTAINED_BY;return DocumentPosition.FOLLOWING}if(sharedParent===nodeA)return DocumentPosition.PRECEDING|DocumentPosition.CONTAINS;return DocumentPosition.PRECEDING}function uniqueSort(nodes){return nodes=nodes.filter((node,i,arr)=>!arr.includes(node,i+1)),nodes.sort((a,b)=>{let relative=compareDocumentPosition(a,b);if(relative&DocumentPosition.PRECEDING)return-1;else if(relative&DocumentPosition.FOLLOWING)return 1;return 0}),nodes}function getFeed(doc){let feedRoot=getOneElement(isValidFeed,doc);return!feedRoot?null:feedRoot.name==="feed"?getAtomFeed(feedRoot):getRssFeed(feedRoot)}function getAtomFeed(feedRoot){var _a;let childs=feedRoot.children,feed={type:"atom",items:getElementsByTagName("entry",childs).map((item)=>{var _a;let{children}=item,entry={media:getMediaElements(children)};addConditionally(entry,"id","id",children),addConditionally(entry,"title","title",children);let href=(_a=getOneElement("link",children))===null||_a===void 0?void 0:_a.attribs.href;if(href)entry.link=href;let description=fetch("summary",children)||fetch("content",children);if(description)entry.description=description;let pubDate=fetch("updated",children);if(pubDate)entry.pubDate=new Date(pubDate);return entry})};addConditionally(feed,"id","id",childs),addConditionally(feed,"title","title",childs);let href=(_a=getOneElement("link",childs))===null||_a===void 0?void 0:_a.attribs.href;if(href)feed.link=href;addConditionally(feed,"description","subtitle",childs);let updated=fetch("updated",childs);if(updated)feed.updated=new Date(updated);return addConditionally(feed,"author","email",childs,!0),feed}function getRssFeed(feedRoot){var _a,_b;let childs=(_b=(_a=getOneElement("channel",feedRoot.children))===null||_a===void 0?void 0:_a.children)!==null&&_b!==void 0?_b:[],feed={type:feedRoot.name.substr(0,3),id:"",items:getElementsByTagName("item",feedRoot.children).map((item)=>{let{children}=item,entry={media:getMediaElements(children)};addConditionally(entry,"id","guid",children),addConditionally(entry,"title","title",children),addConditionally(entry,"link","link",children),addConditionally(entry,"description","description",children);let pubDate=fetch("pubDate",children)||fetch("dc:date",children);if(pubDate)entry.pubDate=new Date(pubDate);return entry})};addConditionally(feed,"title","title",childs),addConditionally(feed,"link","link",childs),addConditionally(feed,"description","description",childs);let updated=fetch("lastBuildDate",childs);if(updated)feed.updated=new Date(updated);return addConditionally(feed,"author","managingEditor",childs,!0),feed}var MEDIA_KEYS_STRING=["url","type","lang"],MEDIA_KEYS_INT=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function getMediaElements(where){return getElementsByTagName("media:content",where).map((elem)=>{let{attribs}=elem,media={medium:attribs.medium,isDefault:!!attribs.isDefault};for(let attrib of MEDIA_KEYS_STRING)if(attribs[attrib])media[attrib]=attribs[attrib];for(let attrib of MEDIA_KEYS_INT)if(attribs[attrib])media[attrib]=parseInt(attribs[attrib],10);if(attribs.expression)media.expression=attribs.expression;return media})}function getOneElement(tagName,node){return getElementsByTagName(tagName,node,!0,1)[0]}function fetch(tagName,where,recurse=!1){return textContent(getElementsByTagName(tagName,where,recurse,1)).trim()}function addConditionally(obj,prop,tagName,where,recurse=!1){let val=fetch(tagName,where,recurse);if(val)obj[prop]=val}function isValidFeed(value){return value==="rss"||value==="feed"||value==="rdf:RDF"}function parseDocument(data,options){let handler=new DomHandler(void 0,options);return new Parser(handler,options).end(data),handler.root}function parseDOM(data,options){return parseDocument(data,options).children}function createDocumentStream(callback,options,elementCallback){let handler=new DomHandler((error)=>callback(error,handler.root),options,elementCallback);return new Parser(handler,options)}function createDomStream(callback,options,elementCallback){let handler=new DomHandler(callback,options,elementCallback);return new Parser(handler,options)}var parseFeedDefaultOptions={xmlMode:!0};function parseFeed(feed,options=parseFeedDefaultOptions){return getFeed(parseDOM(feed,options))}var NODE_END=-1,ELEMENT_NODE=1,ATTRIBUTE_NODE=2,TEXT_NODE=3,CDATA_SECTION_NODE=4,COMMENT_NODE=8,DOCUMENT_NODE=9,DOCUMENT_TYPE_NODE=10,DOCUMENT_FRAGMENT_NODE=11,BLOCK_ELEMENTS=new Set(["ARTICLE","ASIDE","BLOCKQUOTE","BODY","BR","BUTTON","CANVAS","CAPTION","COL","COLGROUP","DD","DIV","DL","DT","EMBED","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","LI","UL","OL","P"]),SHOW_ALL=-1,SHOW_ELEMENT=1,SHOW_TEXT=4,SHOW_CDATA_SECTION=8,SHOW_COMMENT=128,DOCUMENT_POSITION_DISCONNECTED=1,DOCUMENT_POSITION_PRECEDING=2,DOCUMENT_POSITION_FOLLOWING=4,DOCUMENT_POSITION_CONTAINS=8,DOCUMENT_POSITION_CONTAINED_BY=16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,SVG_NAMESPACE="http://www.w3.org/2000/svg";var{assign,create,defineProperties,entries,getOwnPropertyDescriptors,keys,setPrototypeOf}=Object;var $String=String;var getEnd=(node)=>node.nodeType===ELEMENT_NODE?node[END]:node,ignoreCase=({ownerDocument})=>ownerDocument[MIME].ignoreCase,knownAdjacent=(prev,next)=>{prev[NEXT]=next,next[PREV]=prev},knownBoundaries=(prev,current,next)=>{knownAdjacent(prev,current),knownAdjacent(getEnd(current),next)},knownSegment=(prev,start,end,next)=>{knownAdjacent(prev,start),knownAdjacent(getEnd(end),next)},knownSiblings=(prev,current,next)=>{knownAdjacent(prev,current),knownAdjacent(current,next)},localCase=({localName,ownerDocument})=>ownerDocument[MIME].ignoreCase?localName.toUpperCase():localName,setAdjacent=(prev,next)=>{if(prev)prev[NEXT]=next;if(next)next[PREV]=prev},htmlToFragment=(ownerDocument,html)=>{let fragment=ownerDocument.createDocumentFragment(),elem=ownerDocument.createElement("");elem.innerHTML=html;let{firstChild,lastChild}=elem;if(firstChild){knownSegment(fragment,firstChild,lastChild,fragment[END]);let child=firstChild;do child.parentNode=fragment;while(child!==lastChild&&(child=getEnd(child)[NEXT]))}return fragment};var shadowRoots=new WeakMap;var reactive=!1,Classes=new WeakMap,customElements=new WeakMap,attributeChangedCallback=(element,attributeName,oldValue,newValue)=>{if(reactive&&customElements.has(element)&&element.attributeChangedCallback&&element.constructor.observedAttributes.includes(attributeName))element.attributeChangedCallback(attributeName,oldValue,newValue)},createTrigger=(method,isConnected)=>(element)=>{if(customElements.has(element)){let info=customElements.get(element);if(info.connected!==isConnected&&element.isConnected===isConnected){if(info.connected=isConnected,method in element)element[method]()}}},triggerConnected=createTrigger("connectedCallback",!0),connectedCallback=(element)=>{if(reactive){if(triggerConnected(element),shadowRoots.has(element))element=shadowRoots.get(element).shadowRoot;let{[NEXT]:next,[END]:end}=element;while(next!==end){if(next.nodeType===ELEMENT_NODE)triggerConnected(next);next=next[NEXT]}}},triggerDisconnected=createTrigger("disconnectedCallback",!1),disconnectedCallback=(element)=>{if(reactive){if(triggerDisconnected(element),shadowRoots.has(element))element=shadowRoots.get(element).shadowRoot;let{[NEXT]:next,[END]:end}=element;while(next!==end){if(next.nodeType===ELEMENT_NODE)triggerDisconnected(next);next=next[NEXT]}}};class CustomElementRegistry{constructor(ownerDocument){this.ownerDocument=ownerDocument,this.registry=new Map,this.waiting=new Map,this.active=!1}define(localName,Class,options={}){let{ownerDocument,registry,waiting}=this;if(registry.has(localName))throw Error("unable to redefine "+localName);if(Classes.has(Class))throw Error("unable to redefine the same class: "+Class);this.active=reactive=!0;let{extends:extend}=options;Classes.set(Class,{ownerDocument,options:{is:extend?localName:""},localName:extend||localName});let check=extend?(element)=>element.localName===extend&&element.getAttribute("is")===localName:(element)=>element.localName===localName;if(registry.set(localName,{Class,check}),waiting.has(localName)){for(let resolve of waiting.get(localName))resolve(Class);waiting.delete(localName)}ownerDocument.querySelectorAll(extend?`${extend}[is="${localName}"]`:localName).forEach(this.upgrade,this)}upgrade(element){if(customElements.has(element))return;let{ownerDocument,registry}=this,ce=element.getAttribute("is")||element.localName;if(registry.has(ce)){let{Class,check}=registry.get(ce);if(check(element)){let{attributes,isConnected}=element;for(let attr of attributes)element.removeAttributeNode(attr);let values=entries(element);for(let[key]of values)delete element[key];setPrototypeOf(element,Class.prototype),ownerDocument[UPGRADE]={element,values},new Class(ownerDocument,ce),customElements.set(element,{connected:isConnected});for(let attr of attributes)element.setAttributeNode(attr);if(isConnected&&element.connectedCallback)element.connectedCallback()}}}whenDefined(localName){let{registry,waiting}=this;return new Promise((resolve)=>{if(registry.has(localName))resolve(registry.get(localName).Class);else{if(!waiting.has(localName))waiting.set(localName,[]);waiting.get(localName).push(resolve)}})}get(localName){let info=this.registry.get(localName);return info&&info.Class}getName(Class){if(Classes.has(Class)){let{localName}=Classes.get(Class);return localName}return null}}var{Parser:Parser2}=exports_esm3,notParsing=!0,append2=(self,node,active)=>{let end=self[END];if(node.parentNode=self,knownBoundaries(end[PREV],node,end),active&&node.nodeType===ELEMENT_NODE)connectedCallback(node);return node},attribute=(element,end,attribute,value,active)=>{if(attribute[VALUE]=value,attribute.ownerElement=element,knownSiblings(end[PREV],attribute,end),attribute.name==="class")element.className=value;if(active)attributeChangedCallback(element,attribute.name,null,value)};var parseFromString=(document,isHTML,markupLanguage)=>{let{active,registry}=document[CUSTOM_ELEMENTS],node=document,ownerSVGElement=null,parsingCData=!1;notParsing=!1;let content=new Parser2({onprocessinginstruction(name,data){if(name.toLowerCase()==="!doctype")document.doctype=data.slice(name.length).trim()},onopentag(name,attributes){let create=!0;if(isHTML){if(ownerSVGElement)node=append2(node,document.createElementNS(SVG_NAMESPACE,name),active),node.ownerSVGElement=ownerSVGElement,create=!1;else if(name==="svg"||name==="SVG")ownerSVGElement=document.createElementNS(SVG_NAMESPACE,name),node=append2(node,ownerSVGElement,active),create=!1;else if(active){let ce=name.includes("-")?name:attributes.is||"";if(ce&®istry.has(ce)){let{Class}=registry.get(ce);node=append2(node,new Class,active),delete attributes.is,create=!1}}}if(create)node=append2(node,document.createElement(name),!1);let end=node[END];for(let name of keys(attributes))attribute(node,end,document.createAttribute(name),attributes[name],active)},oncomment(data){append2(node,document.createComment(data),active)},ontext(text){if(parsingCData)append2(node,document.createCDATASection(text),active);else append2(node,document.createTextNode(text),active)},oncdatastart(){parsingCData=!0},oncdataend(){parsingCData=!1},onclosetag(){if(isHTML&&node===ownerSVGElement)ownerSVGElement=null;node=node.parentNode}},{lowerCaseAttributeNames:!1,decodeEntities:!0,xmlMode:!isHTML});return content.write(markupLanguage),content.end(),notParsing=!0,document};var htmlClasses=new Map,registerHTMLClass=(names,Class)=>{for(let name of[].concat(names))htmlClasses.set(name,Class),htmlClasses.set(name.toUpperCase(),Class)};var loopSegment=({[NEXT]:next,[END]:end},json)=>{while(next!==end){switch(next.nodeType){case ATTRIBUTE_NODE:attrAsJSON(next,json);break;case TEXT_NODE:case COMMENT_NODE:case CDATA_SECTION_NODE:characterDataAsJSON(next,json);break;case ELEMENT_NODE:elementAsJSON(next,json),next=getEnd(next);break;case DOCUMENT_TYPE_NODE:documentTypeAsJSON(next,json);break}next=next[NEXT]}let last=json.length-1,value=json[last];if(typeof value==="number"&&value<0)json[last]+=NODE_END;else json.push(NODE_END)},attrAsJSON=(attr,json)=>{json.push(ATTRIBUTE_NODE,attr.name);let value=attr[VALUE].trim();if(value)json.push(value)},characterDataAsJSON=(node,json)=>{let value=node[VALUE];if(value.trim())json.push(node.nodeType,value)},nonElementAsJSON=(node,json)=>{json.push(node.nodeType),loopSegment(node,json)},documentTypeAsJSON=({name,publicId,systemId},json)=>{if(json.push(DOCUMENT_TYPE_NODE,name),publicId)json.push(publicId);if(systemId)json.push(systemId)},elementAsJSON=(element,json)=>{json.push(ELEMENT_NODE,element.localName),loopSegment(element,json)};var createRecord=(type,target,element,addedNodes,removedNodes,attributeName,oldValue)=>({type,target,addedNodes,removedNodes,attributeName,oldValue,previousSibling:element?.previousSibling||null,nextSibling:element?.nextSibling||null}),queueAttribute=(observer,target,attributeName,attributeFilter,attributeOldValue,oldValue)=>{if(!attributeFilter||attributeFilter.includes(attributeName)){let{callback,records,scheduled}=observer;if(records.push(createRecord("attributes",target,null,[],[],attributeName,attributeOldValue?oldValue:void 0)),!scheduled)observer.scheduled=!0,Promise.resolve().then(()=>{observer.scheduled=!1,callback(records.splice(0),observer)})}},attributeChangedCallback2=(element,attributeName,oldValue)=>{let{ownerDocument}=element,{active,observers}=ownerDocument[MUTATION_OBSERVER];if(active){for(let observer of observers)for(let[target,{childList,subtree,attributes,attributeFilter,attributeOldValue}]of observer.nodes)if(childList){if(subtree&&(target===ownerDocument||target.contains(element))||!subtree&&target.children.includes(element)){queueAttribute(observer,element,attributeName,attributeFilter,attributeOldValue,oldValue);break}}else if(attributes&&target===element){queueAttribute(observer,element,attributeName,attributeFilter,attributeOldValue,oldValue);break}}},moCallback=(element,parentNode)=>{let{ownerDocument}=element,{active,observers}=ownerDocument[MUTATION_OBSERVER];if(active){for(let observer of observers)for(let[target,{subtree,childList,characterData}]of observer.nodes)if(childList){if(parentNode&&(target===parentNode||subtree&&target.contains(parentNode))||!parentNode&&(subtree&&(target===ownerDocument||target.contains(element))||!subtree&&target[characterData?"childNodes":"children"].includes(element))){let{callback,records,scheduled}=observer;if(records.push(createRecord("childList",target,element,parentNode?[]:[element],parentNode?[element]:[])),!scheduled)observer.scheduled=!0,Promise.resolve().then(()=>{observer.scheduled=!1,callback(records.splice(0),observer)});break}}}};class MutationObserverClass{constructor(ownerDocument){let observers=new Set;this.observers=observers,this.active=!1,this.class=class{constructor(callback){this.callback=callback,this.nodes=new Map,this.records=[],this.scheduled=!1}disconnect(){this.records.splice(0),this.nodes.clear(),observers.delete(this),ownerDocument[MUTATION_OBSERVER].active=!!observers.size}observe(target,options={subtree:!1,childList:!1,attributes:!1,attributeFilter:null,attributeOldValue:!1,characterData:!1}){if("attributeOldValue"in options||"attributeFilter"in options)options.attributes=!0;options.childList=!!options.childList,options.subtree=!!options.subtree,this.nodes.set(target,options),observers.add(this),ownerDocument[MUTATION_OBSERVER].active=!0}takeRecords(){return this.records.splice(0)}}}}var emptyAttributes=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","class","contenteditable","controls","default","defer","disabled","draggable","formnovalidate","hidden","id","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","style","truespeed"]),setAttribute=(element,attribute)=>{let{[VALUE]:value,name}=attribute;if(attribute.ownerElement=element,knownSiblings(element,attribute,element[NEXT]),name==="class")element.className=value;attributeChangedCallback2(element,name,null),attributeChangedCallback(element,name,null,value)},removeAttribute=(element,attribute)=>{let{[VALUE]:value,name}=attribute;if(knownAdjacent(attribute[PREV],attribute[NEXT]),attribute.ownerElement=attribute[PREV]=attribute[NEXT]=null,name==="class")element[CLASS_LIST]=null;attributeChangedCallback2(element,name,value),attributeChangedCallback(element,name,value,null)},booleanAttribute={get(element,name){return element.hasAttribute(name)},set(element,name,value){if(value)element.setAttribute(name,"");else element.removeAttribute(name)}},numericAttribute={get(element,name){return parseFloat(element.getAttribute(name)||0)},set(element,name,value){element.setAttribute(name,value)}},stringAttribute={get(element,name){return element.getAttribute(name)||""},set(element,name,value){element.setAttribute(name,value)}};var wm=new WeakMap;function dispatch(event,listener){if(typeof listener==="function")listener.call(event.target,event);else listener.handleEvent(event);return event._stopImmediatePropagationFlag}function invokeListeners({currentTarget,target}){let map=wm.get(currentTarget);if(map&&map.has(this.type)){let listeners=map.get(this.type);if(currentTarget===target)this.eventPhase=this.AT_TARGET;else this.eventPhase=this.BUBBLING_PHASE;this.currentTarget=currentTarget,this.target=target;for(let[listener,options]of listeners){if(options&&options.once)listeners.delete(listener);if(dispatch(this,listener))break}return delete this.currentTarget,delete this.target,this.cancelBubble}}class DOMEventTarget{constructor(){wm.set(this,new Map)}_getParent(){return null}addEventListener(type,listener,options){let map=wm.get(this);if(!map.has(type))map.set(type,new Map);map.get(type).set(listener,options)}removeEventListener(type,listener){let map=wm.get(this);if(map.has(type)){let listeners=map.get(type);if(listeners.delete(listener)&&!listeners.size)map.delete(type)}}dispatchEvent(event){let node=this;event.eventPhase=event.CAPTURING_PHASE;while(node){if(node.dispatchEvent)event._path.push({currentTarget:node,target:this});node=event.bubbles&&node._getParent&&node._getParent()}return event._path.some(invokeListeners,event),event._path=[],event.eventPhase=event.NONE,!event.defaultPrevented}}class NodeList extends Array{item(i){return i<this.length?this[i]:null}}var getParentNodeCount=({parentNode})=>{let count=0;while(parentNode)count++,parentNode=parentNode.parentNode;return count};class Node2 extends DOMEventTarget{static get ELEMENT_NODE(){return ELEMENT_NODE}static get ATTRIBUTE_NODE(){return ATTRIBUTE_NODE}static get TEXT_NODE(){return TEXT_NODE}static get CDATA_SECTION_NODE(){return CDATA_SECTION_NODE}static get COMMENT_NODE(){return COMMENT_NODE}static get DOCUMENT_NODE(){return DOCUMENT_NODE}static get DOCUMENT_FRAGMENT_NODE(){return DOCUMENT_FRAGMENT_NODE}static get DOCUMENT_TYPE_NODE(){return DOCUMENT_TYPE_NODE}constructor(ownerDocument,localName,nodeType){super();this.ownerDocument=ownerDocument,this.localName=localName,this.nodeType=nodeType,this.parentNode=null,this[NEXT]=null,this[PREV]=null}get ELEMENT_NODE(){return ELEMENT_NODE}get ATTRIBUTE_NODE(){return ATTRIBUTE_NODE}get TEXT_NODE(){return TEXT_NODE}get CDATA_SECTION_NODE(){return CDATA_SECTION_NODE}get COMMENT_NODE(){return COMMENT_NODE}get DOCUMENT_NODE(){return DOCUMENT_NODE}get DOCUMENT_FRAGMENT_NODE(){return DOCUMENT_FRAGMENT_NODE}get DOCUMENT_TYPE_NODE(){return DOCUMENT_TYPE_NODE}get baseURI(){let ownerDocument=this.nodeType===DOCUMENT_NODE?this:this.ownerDocument;if(ownerDocument){let base=ownerDocument.querySelector("base");if(base)return base.getAttribute("href");let{location}=ownerDocument.defaultView;if(location)return location.href}return null}get isConnected(){return!1}get nodeName(){return this.localName}get parentElement(){return null}get previousSibling(){return null}get previousElementSibling(){return null}get nextSibling(){return null}get nextElementSibling(){return null}get childNodes(){return new NodeList}get firstChild(){return null}get lastChild(){return null}get nodeValue(){return null}set nodeValue(value){}get textContent(){return null}set textContent(value){}normalize(){}cloneNode(){return null}contains(){return!1}insertBefore(newNode,referenceNode){return newNode}appendChild(child){return child}replaceChild(newChild,oldChild){return oldChild}removeChild(child){return child}toString(){return""}hasChildNodes(){return!!this.lastChild}isSameNode(node){return this===node}compareDocumentPosition(target){let result=0;if(this!==target){let self=getParentNodeCount(this),other=getParentNodeCount(target);if(self<other){if(result+=DOCUMENT_POSITION_FOLLOWING,this.contains(target))result+=DOCUMENT_POSITION_CONTAINED_BY}else if(other<self){if(result+=DOCUMENT_POSITION_PRECEDING,target.contains(this))result+=DOCUMENT_POSITION_CONTAINS}else if(self&&other){let{childNodes}=this.parentNode;if(childNodes.indexOf(this)<childNodes.indexOf(target))result+=DOCUMENT_POSITION_FOLLOWING;else result+=DOCUMENT_POSITION_PRECEDING}if(!self||!other)result+=DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC,result+=DOCUMENT_POSITION_DISCONNECTED}return result}isEqualNode(node){if(this===node)return!0;if(this.nodeType===node.nodeType){switch(this.nodeType){case DOCUMENT_NODE:case DOCUMENT_FRAGMENT_NODE:{let aNodes=this.childNodes,bNodes=node.childNodes;return aNodes.length===bNodes.length&&aNodes.every((node,i)=>node.isEqualNode(bNodes[i]))}}return this.toString()===node.toString()}return!1}_getParent(){return this.parentNode}getRootNode(){let root=this;while(root.parentNode)root=root.parentNode;return root}}var{replace}="",ca=/[<>&\xA0]/g,esca={" ":" ","&":"&","<":"<",">":">"},pe=(m)=>esca[m],escape2=(es)=>replace.call(es,ca,pe);var QUOTE=/"/g;class Attr extends Node2{constructor(ownerDocument,name,value=""){super(ownerDocument,name,ATTRIBUTE_NODE);this.ownerElement=null,this.name=$String(name),this[VALUE]=$String(value),this[CHANGED]=!1}get value(){return this[VALUE]}set value(newValue){let{[VALUE]:oldValue,name,ownerElement}=this;if(this[VALUE]=$String(newValue),this[CHANGED]=!0,ownerElement)attributeChangedCallback2(ownerElement,name,oldValue),attributeChangedCallback(ownerElement,name,oldValue,this[VALUE])}cloneNode(){let{ownerDocument,name,[VALUE]:value}=this;return new Attr(ownerDocument,name,value)}toString(){let{name,[VALUE]:value}=this;if(emptyAttributes.has(name)&&!value)return ignoreCase(this)?name:`${name}=""`;let escapedValue=(ignoreCase(this)?value:escape2(value)).replace(QUOTE,""");return`${name}="${escapedValue}"`}toJSON(){let json=[];return attrAsJSON(this,json),json}}var isConnected=({ownerDocument,parentNode})=>{while(parentNode){if(parentNode===ownerDocument)return!0;parentNode=parentNode.parentNode||parentNode.host}return!1},parentElement=({parentNode})=>{if(parentNode)switch(parentNode.nodeType){case DOCUMENT_NODE:case DOCUMENT_FRAGMENT_NODE:return null}return parentNode},previousSibling=({[PREV]:prev})=>{switch(prev?prev.nodeType:0){case NODE_END:return prev[START];case TEXT_NODE:case COMMENT_NODE:case CDATA_SECTION_NODE:return prev}return null},nextSibling=(node)=>{let next=getEnd(node)[NEXT];return next&&(next.nodeType===NODE_END?null:next)};var nextElementSibling2=(node)=>{let next=nextSibling(node);while(next&&next.nodeType!==ELEMENT_NODE)next=nextSibling(next);return next},previousElementSibling=(node)=>{let prev=previousSibling(node);while(prev&&prev.nodeType!==ELEMENT_NODE)prev=previousSibling(prev);return prev};var asFragment=(ownerDocument,nodes)=>{let fragment=ownerDocument.createDocumentFragment();return fragment.append(...nodes),fragment},before=(node,nodes)=>{let{ownerDocument,parentNode}=node;if(parentNode)parentNode.insertBefore(asFragment(ownerDocument,nodes),node)},after=(node,nodes)=>{let{ownerDocument,parentNode}=node;if(parentNode)parentNode.insertBefore(asFragment(ownerDocument,nodes),getEnd(node)[NEXT])},replaceWith=(node,nodes)=>{let{ownerDocument,parentNode}=node;if(parentNode){if(nodes.includes(node))replaceWith(node,[node=node.cloneNode()]);parentNode.insertBefore(asFragment(ownerDocument,nodes),node),node.remove()}},remove=(prev,current,next)=>{let{parentNode,nodeType}=current;if(prev||next)setAdjacent(prev,next),current[PREV]=null,getEnd(current)[NEXT]=null;if(parentNode){if(current.parentNode=null,moCallback(current,parentNode),nodeType===ELEMENT_NODE)disconnectedCallback(current)}};class CharacterData extends Node2{constructor(ownerDocument,localName,nodeType,data){super(ownerDocument,localName,nodeType);this[VALUE]=$String(data)}get isConnected(){return isConnected(this)}get parentElement(){return parentElement(this)}get previousSibling(){return previousSibling(this)}get nextSibling(){return nextSibling(this)}get previousElementSibling(){return previousElementSibling(this)}get nextElementSibling(){return nextElementSibling2(this)}before(...nodes){before(this,nodes)}after(...nodes){after(this,nodes)}replaceWith(...nodes){replaceWith(this,nodes)}remove(){remove(this[PREV],this,this[NEXT])}get data(){return this[VALUE]}set data(value){this[VALUE]=$String(value),moCallback(this,this.parentNode)}get nodeValue(){return this.data}set nodeValue(value){this.data=value}get textContent(){return this.data}set textContent(value){this.data=value}get length(){return this.data.length}substringData(offset,count){return this.data.substr(offset,count)}appendData(data){this.data+=data}insertData(offset,data){let{data:t}=this;this.data=t.slice(0,offset)+data+t.slice(offset)}deleteData(offset,count){let{data:t}=this;this.data=t.slice(0,offset)+t.slice(offset+count)}replaceData(offset,count,data){let{data:t}=this;this.data=t.slice(0,offset)+data+t.slice(offset+count)}toJSON(){let json=[];return characterDataAsJSON(this,json),json}}class CDATASection extends CharacterData{constructor(ownerDocument,data=""){super(ownerDocument,"#cdatasection",CDATA_SECTION_NODE,data)}cloneNode(){let{ownerDocument,[VALUE]:data}=this;return new CDATASection(ownerDocument,data)}toString(){return`<![CDATA[${this[VALUE]}]]>`}}class Comment3 extends CharacterData{constructor(ownerDocument,data=""){super(ownerDocument,"#comment",COMMENT_NODE,data)}cloneNode(){let{ownerDocument,[VALUE]:data}=this;return new Comment3(ownerDocument,data)}toString(){return`<!--${this[VALUE]}-->`}}function trueFunc(){return!0}function falseFunc(){return!1}var SelectorType;(function(SelectorType){SelectorType.Attribute="attribute",SelectorType.Pseudo="pseudo",SelectorType.PseudoElement="pseudo-element",SelectorType.Tag="tag",SelectorType.Universal="universal",SelectorType.Adjacent="adjacent",SelectorType.Child="child",SelectorType.Descendant="descendant",SelectorType.Parent="parent",SelectorType.Sibling="sibling",SelectorType.ColumnCombinator="column-combinator"})(SelectorType||(SelectorType={}));var AttributeAction;(function(AttributeAction){AttributeAction.Any="any",AttributeAction.Element="element",AttributeAction.End="end",AttributeAction.Equals="equals",AttributeAction.Exists="exists",AttributeAction.Hyphen="hyphen",AttributeAction.Not="not",AttributeAction.Start="start"})(AttributeAction||(AttributeAction={}));var reName=/^[^#\\]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\u00B0-\uFFFF-])+/,reEscape=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,CharCode;(function(CharCode){CharCode[CharCode.LeftParenthesis=40]="LeftParenthesis",CharCode[CharCode.RightParenthesis=41]="RightParenthesis",CharCode[CharCode.LeftSquareBracket=91]="LeftSquareBracket",CharCode[CharCode.RightSquareBracket=93]="RightSquareBracket",CharCode[CharCode.Comma=44]="Comma",CharCode[CharCode.Period=46]="Period",CharCode[CharCode.Colon=58]="Colon",CharCode[CharCode.SingleQuote=39]="SingleQuote",CharCode[CharCode.DoubleQuote=34]="DoubleQuote",CharCode[CharCode.Plus=43]="Plus",CharCode[CharCode.Tilde=126]="Tilde",CharCode[CharCode.QuestionMark=63]="QuestionMark",CharCode[CharCode.ExclamationMark=33]="ExclamationMark",CharCode[CharCode.Slash=47]="Slash",CharCode[CharCode.Equal=61]="Equal",CharCode[CharCode.Dollar=36]="Dollar",CharCode[CharCode.Pipe=124]="Pipe",CharCode[CharCode.Circumflex=94]="Circumflex",CharCode[CharCode.Asterisk=42]="Asterisk",CharCode[CharCode.GreaterThan=62]="GreaterThan",CharCode[CharCode.LessThan=60]="LessThan",CharCode[CharCode.Hash=35]="Hash",CharCode[CharCode.LowerI=105]="LowerI",CharCode[CharCode.LowerS=115]="LowerS",CharCode[CharCode.BackSlash=92]="BackSlash",CharCode[CharCode.Space=32]="Space",CharCode[CharCode.Tab=9]="Tab",CharCode[CharCode.NewLine=10]="NewLine",CharCode[CharCode.FormFeed=12]="FormFeed",CharCode[CharCode.CarriageReturn=13]="CarriageReturn"})(CharCode||(CharCode={}));var actionTypes=new Map([[CharCode.Tilde,AttributeAction.Element],[CharCode.Circumflex,AttributeAction.Start],[CharCode.Dollar,AttributeAction.End],[CharCode.Asterisk,AttributeAction.Any],[CharCode.ExclamationMark,AttributeAction.Not],[CharCode.Pipe,AttributeAction.Hyphen]]),unpackPseudos=new Set(["has","not","matches","is","where","host","host-context"]),pseudosToPseudoElements=new Set(["before","after","first-line","first-letter"]);function isTraversal(selector){switch(selector.type){case SelectorType.Adjacent:case SelectorType.Child:case SelectorType.Descendant:case SelectorType.Parent:case SelectorType.Sibling:case SelectorType.ColumnCombinator:return!0;case SelectorType.Attribute:case SelectorType.Pseudo:case SelectorType.PseudoElement:case SelectorType.Tag:case SelectorType.Universal:return!1}}var stripQuotesFromPseudos=new Set(["contains","icontains"]);function funescape(_,escaped,escapedWhitespace){let high=Number.parseInt(escaped,16)-65536;return Number.isNaN(high)||escapedWhitespace?escaped:high<0?String.fromCharCode(high+65536):String.fromCharCode(high>>10|55296,high&1023|56320)}function unescapeCSS(cssString){return cssString.replace(reEscape,funescape)}function isQuote(c){return c===CharCode.SingleQuote||c===CharCode.DoubleQuote}function isWhitespace2(c){return c===CharCode.Space||c===CharCode.Tab||c===CharCode.NewLine||c===CharCode.FormFeed||c===CharCode.CarriageReturn}function parse(selector){let subselects=[],endIndex=parseSelector(subselects,`${selector}`,0);if(endIndex<selector.length)throw Error(`Unmatched selector: ${selector.slice(endIndex)}`);return subselects}function parseSelector(subselects,selector,selectorIndex){let tokens=[];function getName(offset){let match=selector.slice(selectorIndex+offset).match(reName);if(!match)throw Error(`Expected name, found ${selector.slice(selectorIndex)}`);let[name]=match;return selectorIndex+=offset+name.length,unescapeCSS(name)}function stripWhitespace(offset){selectorIndex+=offset;while(selectorIndex<selector.length&&isWhitespace2(selector.charCodeAt(selectorIndex)))selectorIndex++}function readValueWithParenthesis(){selectorIndex+=1;let start=selectorIndex;for(let counter=1;selectorIndex<selector.length;selectorIndex++)switch(selector.charCodeAt(selectorIndex)){case CharCode.BackSlash:{selectorIndex+=1;break}case CharCode.LeftParenthesis:{counter+=1;break}case CharCode.RightParenthesis:{if(counter-=1,counter===0)return unescapeCSS(selector.slice(start,selectorIndex++));break}}throw Error("Parenthesis not matched")}function ensureNotTraversal(){if(tokens.length>0&&isTraversal(tokens[tokens.length-1]))throw Error("Did not expect successive traversals.")}function addTraversal(type){if(tokens.length>0&&tokens[tokens.length-1].type===SelectorType.Descendant){tokens[tokens.length-1].type=type;return}ensureNotTraversal(),tokens.push({type})}function addSpecialAttribute(name,action){tokens.push({type:SelectorType.Attribute,name,action,value:getName(1),namespace:null,ignoreCase:"quirks"})}function finalizeSubselector(){if(tokens.length>0&&tokens[tokens.length-1].type===SelectorType.Descendant)tokens.pop();if(tokens.length===0)throw Error("Empty sub-selector");subselects.push(tokens)}if(stripWhitespace(0),selector.length===selectorIndex)return selectorIndex;loop:while(selectorIndex<selector.length){let firstChar=selector.charCodeAt(selectorIndex);switch(firstChar){case CharCode.Space:case CharCode.Tab:case CharCode.NewLine:case CharCode.FormFeed:case CharCode.CarriageReturn:{if(tokens.length===0||tokens[0].type!==SelectorType.Descendant)ensureNotTraversal(),tokens.push({type:SelectorType.Descendant});stripWhitespace(1);break}case CharCode.GreaterThan:{addTraversal(SelectorType.Child),stripWhitespace(1);break}case CharCode.LessThan:{addTraversal(SelectorType.Parent),stripWhitespace(1);break}case CharCode.Tilde:{addTraversal(SelectorType.Sibling),stripWhitespace(1);break}case CharCode.Plus:{addTraversal(SelectorType.Adjacent),stripWhitespace(1);break}case CharCode.Period:{addSpecialAttribute("class",AttributeAction.Element);break}case CharCode.Hash:{addSpecialAttribute("id",AttributeAction.Equals);break}case CharCode.LeftSquareBracket:{stripWhitespace(1);let name,namespace=null;if(selector.charCodeAt(selectorIndex)===CharCode.Pipe)name=getName(1);else if(selector.startsWith("*|",selectorIndex))namespace="*",name=getName(2);else if(name=getName(0),selector.charCodeAt(selectorIndex)===CharCode.Pipe&&selector.charCodeAt(selectorIndex+1)!==CharCode.Equal)namespace=name,name=getName(1);stripWhitespace(0);let action=AttributeAction.Exists,possibleAction=actionTypes.get(selector.charCodeAt(selectorIndex));if(possibleAction){if(action=possibleAction,selector.charCodeAt(selectorIndex+1)!==CharCode.Equal)throw Error("Expected `=`");stripWhitespace(2)}else if(selector.charCodeAt(selectorIndex)===CharCode.Equal)action=AttributeAction.Equals,stripWhitespace(1);let value="",ignoreCase=null;if(action!=="exists"){if(isQuote(selector.charCodeAt(selectorIndex))){let quote=selector.charCodeAt(selectorIndex);selectorIndex+=1;let sectionStart=selectorIndex;while(selectorIndex<selector.length&&selector.charCodeAt(selectorIndex)!==quote)selectorIndex+=selector.charCodeAt(selectorIndex)===CharCode.BackSlash?2:1;if(selector.charCodeAt(selectorIndex)!==quote)throw Error("Attribute value didn't end");value=unescapeCSS(selector.slice(sectionStart,selectorIndex)),selectorIndex+=1}else{let valueStart=selectorIndex;while(selectorIndex<selector.length&&!isWhitespace2(selector.charCodeAt(selectorIndex))&&selector.charCodeAt(selectorIndex)!==CharCode.RightSquareBracket)selectorIndex+=selector.charCodeAt(selectorIndex)===CharCode.BackSlash?2:1;value=unescapeCSS(selector.slice(valueStart,selectorIndex))}switch(stripWhitespace(0),selector.charCodeAt(selectorIndex)|32){case CharCode.LowerI:{ignoreCase=!0,stripWhitespace(1);break}case CharCode.LowerS:{ignoreCase=!1,stripWhitespace(1);break}}}if(selector.charCodeAt(selectorIndex)!==CharCode.RightSquareBracket)throw Error("Attribute selector didn't terminate");selectorIndex+=1;let attributeSelector={type:SelectorType.Attribute,name,action,value,namespace,ignoreCase};tokens.push(attributeSelector);break}case CharCode.Colon:{if(selector.charCodeAt(selectorIndex+1)===CharCode.Colon){tokens.push({type:SelectorType.PseudoElement,name:getName(2).toLowerCase(),data:selector.charCodeAt(selectorIndex)===CharCode.LeftParenthesis?readValueWithParenthesis():null});break}let name=getName(1).toLowerCase();if(pseudosToPseudoElements.has(name)){tokens.push({type:SelectorType.PseudoElement,name,data:null});break}let data=null;if(selector.charCodeAt(selectorIndex)===CharCode.LeftParenthesis)if(unpackPseudos.has(name)){if(isQuote(selector.charCodeAt(selectorIndex+1)))throw Error(`Pseudo-selector ${name} cannot be quoted`);if(data=[],selectorIndex=parseSelector(data,selector,selectorIndex+1),selector.charCodeAt(selectorIndex)!==CharCode.RightParenthesis)throw Error(`Missing closing parenthesis in :${name} (${selector})`);selectorIndex+=1}else{if(data=readValueWithParenthesis(),stripQuotesFromPseudos.has(name)){let quot=data.charCodeAt(0);if(quot===data.charCodeAt(data.length-1)&&isQuote(quot))data=data.slice(1,-1)}data=unescapeCSS(data)}tokens.push({type:SelectorType.Pseudo,name,data});break}case CharCode.Comma:{finalizeSubselector(),tokens=[],stripWhitespace(1);break}default:{if(selector.startsWith("/*",selectorIndex)){let endIndex=selector.indexOf("*/",selectorIndex+2);if(endIndex===-1)throw Error("Comment was not terminated");if(selectorIndex=endIndex+2,tokens.length===0)stripWhitespace(0);break}let namespace=null,name;if(firstChar===CharCode.Asterisk)selectorIndex+=1,name="*";else if(firstChar===CharCode.Pipe){if(name="",selector.charCodeAt(selectorIndex+1)===CharCode.Pipe){addTraversal(SelectorType.ColumnCombinator),stripWhitespace(2);break}}else if(reName.test(selector.slice(selectorIndex)))name=getName(0);else break loop;if(selector.charCodeAt(selectorIndex)===CharCode.Pipe&&selector.charCodeAt(selectorIndex+1)!==CharCode.Pipe)if(namespace=name,selector.charCodeAt(selectorIndex+1)===CharCode.Asterisk)name="*",selectorIndex+=2;else name=getName(1);tokens.push(name==="*"?{type:SelectorType.Universal,namespace}:{type:SelectorType.Tag,name,namespace})}}}return finalizeSubselector(),selectorIndex}var ElementType2;(function(ElementType){ElementType.Root="root",ElementType.Text="text",ElementType.Directive="directive",ElementType.Comment="comment",ElementType.Script="script",ElementType.Style="style",ElementType.Tag="tag",ElementType.CDATA="cdata",ElementType.Doctype="doctype"})(ElementType2||(ElementType2={}));function isTag3(element){return element.type===ElementType2.Tag||element.type===ElementType2.Script||element.type===ElementType2.Style}var Root2=ElementType2.Root,Text3=ElementType2.Text,Directive2=ElementType2.Directive,Comment4=ElementType2.Comment,Script2=ElementType2.Script,Style2=ElementType2.Style,Tag2=ElementType2.Tag,CDATA3=ElementType2.CDATA,Doctype2=ElementType2.Doctype;function isTag4(node){return isTag3(node)}function isCDATA2(node){return node.type===ElementType2.CDATA}function isText2(node){return node.type===ElementType2.Text}function isComment2(node){return node.type===ElementType2.Comment}function hasChildren2(node){return Object.hasOwn(node,"children")}var exports_dist2={};__export(exports_dist2,{DocumentPosition:()=>DocumentPosition2,append:()=>append3,appendChild:()=>appendChild2,compareDocumentPosition:()=>compareDocumentPosition2,existsOne:()=>existsOne2,filter:()=>filter2,find:()=>find2,findAll:()=>findAll2,findOne:()=>findOne2,getAttributeValue:()=>getAttributeValue2,getChildren:()=>getChildren2,getElementById:()=>getElementById2,getElements:()=>getElements2,getElementsByClassName:()=>getElementsByClassName2,getElementsByTagName:()=>getElementsByTagName2,getElementsByTagType:()=>getElementsByTagType2,getFeed:()=>getFeed2,getInnerHTML:()=>getInnerHTML2,getName:()=>getName2,getOuterHTML:()=>getOuterHTML2,getParent:()=>getParent2,getSiblings:()=>getSiblings2,getText:()=>getText2,hasAttrib:()=>hasAttrib2,innerText:()=>innerText2,nextElementSibling:()=>nextElementSibling3,prepend:()=>prepend2,prependChild:()=>prependChild2,prevElementSibling:()=>prevElementSibling2,removeElement:()=>removeElement2,removeSubsets:()=>removeSubsets2,replaceElement:()=>replaceElement2,testElement:()=>testElement2,textContent:()=>textContent2,uniqueSort:()=>uniqueSort2});function filter2(test,node,recurse=!0,limit=Number.POSITIVE_INFINITY){return find2(test,Array.isArray(node)?node:[node],recurse,limit)}function find2(test,nodes,recurse,limit){let result=[],nodeStack=[Array.isArray(nodes)?nodes:[nodes]],indexStack=[0];for(;;){if(indexStack[0]>=nodeStack[0].length){if(indexStack.length===1)return result;nodeStack.shift(),indexStack.shift();continue}let element=nodeStack[0][indexStack[0]++];if(test(element)){if(result.push(element),--limit<=0)return result}if(recurse&&hasChildren2(element)&&element.children.length>0)indexStack.unshift(0),nodeStack.unshift(element.children)}}function findOne2(test,nodes,recurse=!0){let searchedNodes=Array.isArray(nodes)?nodes:[nodes];for(let node of searchedNodes){if(isTag4(node)&&test(node))return node;if(recurse&&hasChildren2(node)&&node.children.length>0){let found=findOne2(test,node.children,!0);if(found)return found}}return null}function existsOne2(test,nodes){return(Array.isArray(nodes)?nodes:[nodes]).some((node)=>isTag4(node)&&test(node)||hasChildren2(node)&&existsOne2(test,node.children))}function findAll2(test,nodes){let result=[],nodeStack=[Array.isArray(nodes)?nodes:[nodes]],indexStack=[0];for(;;){if(indexStack[0]>=nodeStack[0].length){if(nodeStack.length===1)return result;nodeStack.shift(),indexStack.shift();continue}let element=nodeStack[0][indexStack[0]++];if(isTag4(element)&&test(element))result.push(element);if(hasChildren2(element)&&element.children.length>0)indexStack.unshift(0),nodeStack.unshift(element.children)}}var Checks2={tag_name(name){if(typeof name==="function")return(element)=>isTag4(element)&&name(element.name);if(name==="*")return isTag4;return(element)=>isTag4(element)&&element.name===name},tag_type(type){if(typeof type==="function")return(element)=>type(element.type);return(element)=>element.type===type},tag_contains(data){if(typeof data==="function")return(element)=>isText2(element)&&data(element.data);return(element)=>isText2(element)&&element.data===data}};function getAttribCheck2(attrib,value){if(typeof value==="function")return(element)=>isTag4(element)&&value(element.attribs[attrib]);return(element)=>isTag4(element)&&element.attribs[attrib]===value}function combineFuncs2(a,b){return(element)=>a(element)||b(element)}function compileTest2(options){let funcs=Object.keys(options).map((key)=>{let value=options[key];return Object.hasOwn(Checks2,key)?Checks2[key](value):getAttribCheck2(key,value)});return funcs.length===0?null:funcs.reduce(combineFuncs2)}function testElement2(options,node){let test=compileTest2(options);return test?test(node):!0}function getElements2(options,nodes,recurse,limit=Number.POSITIVE_INFINITY){let test=compileTest2(options);return test?filter2(test,nodes,recurse,limit):[]}function getElementById2(id,nodes,recurse=!0){if(!Array.isArray(nodes))nodes=[nodes];return findOne2(getAttribCheck2("id",id),nodes,recurse)}function getElementsByTagName2(tagName,nodes,recurse=!0,limit=Number.POSITIVE_INFINITY){return filter2(Checks2.tag_name(tagName),nodes,recurse,limit)}function getElementsByClassName2(className,nodes,recurse=!0,limit=Number.POSITIVE_INFINITY){return filter2(getAttribCheck2("class",className),nodes,recurse,limit)}function getElementsByTagType2(type,nodes,recurse=!0,limit=Number.POSITIVE_INFINITY){return filter2(Checks2.tag_type(type),nodes,recurse,limit)}var ElementType3;(function(ElementType){ElementType.Root="root",ElementType.Text="text",ElementType.Directive="directive",ElementType.Comment="comment",ElementType.Script="script",ElementType.Style="style",ElementType.Tag="tag",ElementType.CDATA="cdata",ElementType.Doctype="doctype"})(ElementType3||(ElementType3={}));var Root3=ElementType3.Root,Text4=ElementType3.Text,Directive3=ElementType3.Directive,Comment5=ElementType3.Comment,Script3=ElementType3.Script,Style3=ElementType3.Style,Tag3=ElementType3.Tag,CDATA4=ElementType3.CDATA,Doctype3=ElementType3.Doctype;function getEscape(char){return char===34?""":char===38?"&":char===39?"'":char===60?"<":char===62?">":" "}var XML_BITSET_VALUE=1342177476,xmlEncodeRegex=/["&'<>\u0080-\uFFFF]/g;function isXmlEscapable(code){return code>=128||code>=32&&code<64&&(XML_BITSET_VALUE>>>code&1)===1}function encodeXML2(input){let{length}=input,out,last=0,index=0;while(index<length){let char=input.charCodeAt(index);if(!isXmlEscapable(char)){let bound=Math.min(index+32,length),next=index+1;while(next<bound&&!isXmlEscapable(input.charCodeAt(next)))next++;if(next<bound){index=next;continue}if(next>=length)break;if(xmlEncodeRegex.lastIndex=next,!xmlEncodeRegex.test(input))break;index=xmlEncodeRegex.lastIndex-1;continue}if(out===void 0)out=input.substring(0,index);else if(last!==index)out+=input.substring(last,index);if(char<64){out+=getEscape(char),last=index+=1;continue}let cp=input.codePointAt(index);if(out+=`&#x${cp.toString(16)};`,cp!==char)index++;last=index+=1}if(out===void 0)return input;if(last<length)out+=input.substr(last);return out}function escapeWithRegex(re,data){if(re.lastIndex=0,!re.test(data))return data;let out="",last=0;do{let index=re.lastIndex-1;if(last!==index)out+=data.substring(last,index);let char=data.charCodeAt(index);out+=getEscape(char),last=index+1}while(re.test(data));return out+data.substring(last)}var attributeEscapeRegex=/["&\u{A0}]/gu;function escapeAttribute2(data){return escapeWithRegex(attributeEscapeRegex,data)}var textEscapeRegex=/[&<>\u{A0}]/gu;function escapeText2(data){return escapeWithRegex(textEscapeRegex,data)}var EntityLevel2;(function(EntityLevel){EntityLevel[EntityLevel.XML=0]="XML",EntityLevel[EntityLevel.HTML=1]="HTML"})(EntityLevel2||(EntityLevel2={}));var EncodingMode2;(function(EncodingMode){EncodingMode[EncodingMode.UTF8=0]="UTF8",EncodingMode[EncodingMode.ASCII=1]="ASCII",EncodingMode[EncodingMode.Extensive=2]="Extensive",EncodingMode[EncodingMode.Attribute=3]="Attribute",EncodingMode[EncodingMode.Text=4]="Text"})(EncodingMode2||(EncodingMode2={}));var elementNames2=new Map("altGlyph altGlyphDef altGlyphItem animateColor animateMotion animateTransform clipPath 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 foreignObject glyphRef linearGradient radialGradient textPath".split(" ").map((name)=>[name.toLowerCase(),name])),attributeNames2=new Map("definitionURL attributeName attributeType baseFrequency baseProfile calcMode clipPathUnits diffuseConstant edgeMode filterUnits glyphRef gradientTransform gradientUnits kernelMatrix kernelUnitLength keyPoints keySplines keyTimes lengthAdjust limitingConeAngle markerHeight markerUnits markerWidth maskContentUnits maskUnits numOctaves pathLength patternContentUnits patternTransform patternUnits pointsAtX pointsAtY pointsAtZ preserveAlpha preserveAspectRatio primitiveUnits refX refY repeatCount repeatDur requiredExtensions requiredFeatures specularConstant specularExponent spreadMethod startOffset stdDeviation stitchTiles surfaceScale systemLanguage tableValues targetX targetY textLength viewBox viewTarget xChannelSelector yChannelSelector zoomAndPan".split(" ").map((name)=>[name.toLowerCase(),name]));var unencodedElements2=new Set("style script xmp iframe noembed noframes plaintext noscript".split(" ")),voidElements2=new Set("area base basefont br col command embed frame hr img input isindex keygen link meta param source track wbr".split(" ")),foreignElements2=new Set(["svg","math"]),foreignModeIntegrationPoints2=new Set("mi mo mn ms mtext annotation-xml foreignObject desc title".split(" "));function render2(node,options={}){let nodes="length"in node?node:[node],xmlMode=options.xmlMode??!1,output="";for(let index=0;index<nodes.length;index++)output+=renderNode2(nodes[index],options,xmlMode);return output}var dist_default=render2;function renderChildren(children,options,xmlMode){let output="";for(let index=0;index<children.length;index++)output+=renderNode2(children[index],options,xmlMode);return output}function renderNode2(node,options,xmlMode){switch(node.type){case Root3:return renderChildren(node.children,options,xmlMode);case Directive3:return`<${node.data}>`;case Comment5:return`<!--${node.data}-->`;case CDATA4:return`<![CDATA[${node.children[0].data}]]>`;case Script3:case Style3:case Tag3:return renderTag2(node,options,xmlMode);case Text4:{let element=node,data=element.data||"";if((options.encodeEntities??options.decodeEntities)!==!1&&!(!xmlMode&&element.parent&&unencodedElements2.has(element.parent.name)))return xmlMode||options.encodeEntities!=="utf8"?encodeXML2(data):escapeText2(data);return data}}}function renderTag2(element,options,xmlMode){if(xmlMode==="foreign"){if(element.name=elementNames2.get(element.name)??element.name,element.parent&&foreignModeIntegrationPoints2.has(element.parent.name))xmlMode=!1}if(!xmlMode&&foreignElements2.has(element.name))xmlMode="foreign";let{name,children}=element,isVoid=!xmlMode&&voidElements2.has(name),tag=`<${name}${formatAttributes2(element.attribs,options,xmlMode)}`;if(children.length===0&&(xmlMode?options.selfClosingTags!==!1:options.selfClosingTags&&isVoid))tag+=xmlMode?"/>":" />";else{if(tag+=">",children.length>0)tag+=renderChildren(children,options,xmlMode);if(!isVoid)tag+=`</${name}>`}return tag}function replaceQuotes2(value){return value.replaceAll('"',""")}function formatAttributes2(attributes,options,xmlMode){if(!attributes)return"";let encode=(options.encodeEntities??options.decodeEntities)===!1?replaceQuotes2:xmlMode||options.encodeEntities!=="utf8"?encodeXML2:escapeAttribute2,isForeign=xmlMode==="foreign",showEmpty=!!(options.emptyAttrs??xmlMode),result="";for(let key in attributes){if(!Object.hasOwn(attributes,key))continue;let value=attributes[key],k=isForeign?attributeNames2.get(key)??key:key;result+=!showEmpty&&(value==null||value==="")?` ${k}`:` ${k}="${encode(value==null?"":String(value))}"`}return result}var ElementType4;(function(ElementType){ElementType.Root="root",ElementType.Text="text",ElementType.Directive="directive",ElementType.Comment="comment",ElementType.Script="script",ElementType.Style="style",ElementType.Tag="tag",ElementType.CDATA="cdata",ElementType.Doctype="doctype"})(ElementType4||(ElementType4={}));var Root4=ElementType4.Root,Text5=ElementType4.Text,Directive4=ElementType4.Directive,Comment6=ElementType4.Comment,Script4=ElementType4.Script,Style4=ElementType4.Style,Tag4=ElementType4.Tag,CDATA5=ElementType4.CDATA,Doctype4=ElementType4.Doctype;function getOuterHTML2(node,options){return dist_default(node,options)}function getInnerHTML2(node,options){return hasChildren2(node)?node.children.map((node)=>getOuterHTML2(node,options)).join(""):""}function getText2(node){if(Array.isArray(node))return node.map(getText2).join("");if(isTag4(node))return node.name==="br"?`
|
|
46
|
+
`:getText2(node.children);if(isCDATA2(node))return getText2(node.children);if(isText2(node))return node.data;return""}function textContent2(node){if(Array.isArray(node))return node.map(textContent2).join("");if(hasChildren2(node)&&!isComment2(node))return textContent2(node.children);if(isText2(node))return node.data;return""}function innerText2(node){if(Array.isArray(node))return node.map(innerText2).join("");if(hasChildren2(node)&&(node.type===ElementType4.Tag||isCDATA2(node)))return innerText2(node.children);if(isText2(node))return node.data;return""}function getFeed2(document){let feedRoot=getOneElement2(isValidFeed2,document);return feedRoot?feedRoot.name==="feed"?getAtomFeed2(feedRoot):getRssFeed2(feedRoot):null}function getAtomFeed2(feedRoot){let childs=feedRoot.children,feed={type:"atom",items:getElementsByTagName2("entry",childs).map((item)=>{let{children}=item,entry={media:getMediaElements2(children)};addConditionally2(entry,"id","id",children),addConditionally2(entry,"title","title",children);let href=getOneElement2("link",children)?.attribs.href;if(href)entry.link=href;let description=fetch2("summary",children)||fetch2("content",children);if(description)entry.description=description;let pubDate=fetch2("updated",children);if(pubDate)entry.pubDate=new Date(pubDate);return entry})};addConditionally2(feed,"id","id",childs),addConditionally2(feed,"title","title",childs);let href=getOneElement2("link",childs)?.attribs.href;if(href)feed.link=href;addConditionally2(feed,"description","subtitle",childs);let updated=fetch2("updated",childs);if(updated)feed.updated=new Date(updated);return addConditionally2(feed,"author","email",childs,!0),feed}function getRssFeed2(feedRoot){let childs=getOneElement2("channel",feedRoot.children)?.children??[],feed={type:feedRoot.name.substr(0,3),id:"",items:getElementsByTagName2("item",feedRoot.children).map((item)=>{let{children}=item,entry={media:getMediaElements2(children)};addConditionally2(entry,"id","guid",children),addConditionally2(entry,"title","title",children),addConditionally2(entry,"link","link",children),addConditionally2(entry,"description","description",children);let pubDate=fetch2("pubDate",children)||fetch2("dc:date",children);if(pubDate)entry.pubDate=new Date(pubDate);return entry})};addConditionally2(feed,"title","title",childs),addConditionally2(feed,"link","link",childs),addConditionally2(feed,"description","description",childs);let updated=fetch2("lastBuildDate",childs);if(updated)feed.updated=new Date(updated);return addConditionally2(feed,"author","managingEditor",childs,!0),feed}var MEDIA_KEYS_STRING2=["url","type","lang"],MEDIA_KEYS_INT2=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function getMediaElements2(where){return getElementsByTagName2("media:content",where).map((element)=>{let{attribs}=element,media={medium:attribs.medium,isDefault:!!attribs.isDefault};for(let attrib of MEDIA_KEYS_STRING2)if(attribs[attrib])media[attrib]=attribs[attrib];for(let attrib of MEDIA_KEYS_INT2)if(attribs[attrib])media[attrib]=Number.parseInt(attribs[attrib],10);if(attribs.expression)media.expression=attribs.expression;return media})}function getOneElement2(tagName,node){return getElementsByTagName2(tagName,node,!0,1)[0]}function fetch2(tagName,where,recurse=!1){return textContent2(getElementsByTagName2(tagName,where,recurse,1)).trim()}function addConditionally2(object,property,tagName,where,recurse=!1){let value=fetch2(tagName,where,recurse);if(value)object[property]=value}function isValidFeed2(value){return value==="rss"||value==="feed"||value==="rdf:RDF"}function removeSubsets2(nodes){let index=nodes.length;while(--index>=0){let node=nodes[index];if(index>0&&nodes.lastIndexOf(node,index-1)>=0){nodes.splice(index,1);continue}for(let ancestor=node.parent;ancestor;ancestor=ancestor.parent)if(nodes.includes(ancestor)){nodes.splice(index,1);break}}return nodes}var DocumentPosition2;(function(DocumentPosition){DocumentPosition[DocumentPosition.DISCONNECTED=1]="DISCONNECTED",DocumentPosition[DocumentPosition.PRECEDING=2]="PRECEDING",DocumentPosition[DocumentPosition.FOLLOWING=4]="FOLLOWING",DocumentPosition[DocumentPosition.CONTAINS=8]="CONTAINS",DocumentPosition[DocumentPosition.CONTAINED_BY=16]="CONTAINED_BY"})(DocumentPosition2||(DocumentPosition2={}));function compareDocumentPosition2(nodeA,nodeB){let aParents=[],bParents=[];if(nodeA===nodeB)return 0;let current=hasChildren2(nodeA)?nodeA:nodeA.parent;while(current)aParents.unshift(current),current=current.parent;current=hasChildren2(nodeB)?nodeB:nodeB.parent;while(current)bParents.unshift(current),current=current.parent;let maxIndex=Math.min(aParents.length,bParents.length),index=0;while(index<maxIndex&&aParents[index]===bParents[index])index++;if(index===0)return DocumentPosition2.DISCONNECTED;let sharedParent=aParents[index-1],siblings=sharedParent.children,aSibling=aParents[index],bSibling=bParents[index];if(siblings.indexOf(aSibling)>siblings.indexOf(bSibling)){if(sharedParent===nodeB)return DocumentPosition2.FOLLOWING|DocumentPosition2.CONTAINED_BY;return DocumentPosition2.FOLLOWING}if(sharedParent===nodeA)return DocumentPosition2.PRECEDING|DocumentPosition2.CONTAINS;return DocumentPosition2.PRECEDING}function uniqueSort2(nodes){return nodes=nodes.filter((node,index,array)=>!array.includes(node,index+1)),nodes.sort((a,b)=>{let relative=compareDocumentPosition2(a,b);if(relative&DocumentPosition2.PRECEDING)return-1;if(relative&DocumentPosition2.FOLLOWING)return 1;return 0}),nodes}function removeElement2(element){if(element.prev)element.prev.next=element.next;if(element.next)element.next.prev=element.prev;if(element.parent){let childs=element.parent.children,childsIndex=childs.lastIndexOf(element);if(childsIndex!==-1)childs.splice(childsIndex,1)}element.next=null,element.prev=null,element.parent=null}function replaceElement2(element,replacement){if(replacement.prev=element.prev,replacement.prev)replacement.prev.next=replacement;if(replacement.next=element.next,replacement.next)replacement.next.prev=replacement;if(replacement.parent=element.parent,replacement.parent){let{children}=replacement.parent,elementIndex=children.lastIndexOf(element);if(elementIndex===-1)return;children[elementIndex]=replacement,element.parent=null}}function appendChild2(parent,child){if(removeElement2(child),child.next=null,child.parent=parent,parent.children.push(child)>1){let sibling=parent.children[parent.children.length-2];sibling.next=child,child.prev=sibling}else child.prev=null}function append3(element,next){removeElement2(next);let{parent}=element,currentNext=element.next;if(next.next=currentNext,next.prev=element,element.next=next,next.parent=parent,currentNext){if(currentNext.prev=next,parent){let childs=parent.children;childs.splice(childs.lastIndexOf(currentNext),0,next)}}else if(parent)parent.children.push(next)}function prependChild2(parent,child){if(removeElement2(child),child.parent=parent,child.prev=null,parent.children.unshift(child)===1)child.next=null;else{let sibling=parent.children[1];sibling.prev=child,child.next=sibling}}function prepend2(element,previous){removeElement2(previous);let{parent}=element;if(parent){let childs=parent.children;childs.splice(childs.indexOf(element),0,previous)}if(element.prev)element.prev.next=previous;previous.parent=parent,previous.prev=element.prev,previous.next=element,element.prev=previous}function getChildren2(element){return hasChildren2(element)?element.children:[]}function getParent2(element){return element.parent||null}function getSiblings2(element){let parent=getParent2(element);if(parent!=null)return getChildren2(parent);let siblings=[element],{prev,next}=element;while(prev!=null)siblings.unshift(prev),{prev}=prev;while(next!=null)siblings.push(next),{next}=next;return siblings}function getAttributeValue2(element,name){let{attribs}=element;return attribs?.[name]}function hasAttrib2(element,name){let{attribs}=element;return attribs!=null&&Object.hasOwn(attribs,name)&&attribs[name]!=null}function getName2(element){return element.name}function nextElementSibling3(element){let{next}=element;while(next!==null&&!isTag4(next))({next}=next);return next}function prevElementSibling2(element){let{prev}=element;while(prev!==null&&!isTag4(prev))({prev}=prev);return prev}var reChars=/[-[\]{}()*+?.,\\^$|#\s]/g,whitespaceRe=/\s/;function escapeRegex(value){return value.replace(reChars,"\\$&")}var caseInsensitiveAttributes=new Set(["accept","accept-charset","align","alink","axis","bgcolor","charset","checked","clear","codetype","color","compact","declare","defer","dir","direction","disabled","enctype","face","frame","hreflang","http-equiv","lang","language","link","media","method","multiple","nohref","noresize","noshade","nowrap","readonly","rel","rev","rules","scope","scrolling","selected","shape","target","text","type","valign","valuetype","vlink"]);function shouldIgnoreCase(selector,options){return typeof selector.ignoreCase==="boolean"?selector.ignoreCase:selector.ignoreCase==="quirks"?!!options.quirksMode:!options.xmlMode&&caseInsensitiveAttributes.has(selector.name)}var attributeRules={equals(next,data,options){let{adapter}=options,{name}=data,{value}=data;if(shouldIgnoreCase(data,options))return value=value.toLowerCase(),(element)=>{let attribute=adapter.getAttributeValue(element,name);return attribute!=null&&attribute.length===value.length&&attribute.toLowerCase()===value&&next(element)};return(element)=>adapter.getAttributeValue(element,name)===value&&next(element)},hyphen(next,data,options){let{adapter}=options,{name}=data,{value}=data,{length}=value;if(shouldIgnoreCase(data,options))return value=value.toLowerCase(),function(element){let attribute=adapter.getAttributeValue(element,name);return attribute!=null&&(attribute.length===length||attribute.charAt(length)==="-")&&attribute.substr(0,length).toLowerCase()===value&&next(element)};return function(element){let attribute=adapter.getAttributeValue(element,name);return attribute!=null&&(attribute.length===length||attribute.charAt(length)==="-")&&attribute.substr(0,length)===value&&next(element)}},element(next,data,options){let{adapter}=options,{name,value}=data;if(whitespaceRe.test(value))return falseFunc;let regex=new RegExp(`(?:^|\\s)${escapeRegex(value)}(?:$|\\s)`,shouldIgnoreCase(data,options)?"i":"");return function(node){let attribute=adapter.getAttributeValue(node,name);return attribute!=null&&attribute.length>=value.length&®ex.test(attribute)&&next(node)}},exists(next,{name},{adapter}){return(element)=>adapter.hasAttrib(element,name)&&next(element)},start(next,data,options){let{adapter}=options,{name}=data,{value}=data,{length}=value;if(length===0)return falseFunc;if(shouldIgnoreCase(data,options))return value=value.toLowerCase(),(element)=>{let attribute=adapter.getAttributeValue(element,name);return attribute!=null&&attribute.length>=length&&attribute.substr(0,length).toLowerCase()===value&&next(element)};return(element)=>!!adapter.getAttributeValue(element,name)?.startsWith(value)&&next(element)},end(next,data,options){let{adapter}=options,{name}=data,{value}=data,length=-value.length;if(length===0)return falseFunc;if(shouldIgnoreCase(data,options))return value=value.toLowerCase(),(element)=>adapter.getAttributeValue(element,name)?.substr(length).toLowerCase()===value&&next(element);return(element)=>!!adapter.getAttributeValue(element,name)?.endsWith(value)&&next(element)},any(next,data,options){let{adapter}=options,{name,value}=data;if(value==="")return falseFunc;if(shouldIgnoreCase(data,options)){let regex=new RegExp(escapeRegex(value),"i");return function(element){let attribute=adapter.getAttributeValue(element,name);return attribute!=null&&attribute.length>=value.length&®ex.test(attribute)&&next(element)}}return(element)=>!!adapter.getAttributeValue(element,name)?.includes(value)&&next(element)},not(next,data,options){let{adapter}=options,{name}=data,{value}=data;if(value==="")return(element)=>!!adapter.getAttributeValue(element,name)&&next(element);if(shouldIgnoreCase(data,options))return value=value.toLowerCase(),(element)=>{let attribute=adapter.getAttributeValue(element,name);return(attribute==null||attribute.length!==value.length||attribute.toLowerCase()!==value)&&next(element)};return(element)=>adapter.getAttributeValue(element,name)!==value&&next(element)}};function findAll3(query,nodes,options){let{adapter,xmlMode=!1}=options,result=[],nodeStack=[nodes],indexStack=[0];for(;;){if(indexStack[0]>=nodeStack[0].length){if(nodeStack.length===1)return result;nodeStack.shift(),indexStack.shift();continue}let element=nodeStack[0][indexStack[0]++];if(!adapter.isTag(element))continue;if(query(element))result.push(element);if(xmlMode||adapter.getName(element)!=="template"){let children=adapter.getChildren(element);if(children.length>0)nodeStack.unshift(children),indexStack.unshift(0)}}}function findOne3(query,nodes,options){let{adapter,xmlMode=!1}=options,nodeStack=[nodes],indexStack=[0];for(;;){if(indexStack[0]>=nodeStack[0].length){if(nodeStack.length===1)return null;nodeStack.shift(),indexStack.shift();continue}let element=nodeStack[0][indexStack[0]++];if(!adapter.isTag(element))continue;if(query(element))return element;if(xmlMode||adapter.getName(element)!=="template"){let children=adapter.getChildren(element);if(children.length>0)nodeStack.unshift(children),indexStack.unshift(0)}}}function getNextSiblings(element,adapter){let siblings=adapter.getSiblings(element);if(siblings.length<=1)return[];let elementIndex=siblings.indexOf(element);if(elementIndex===-1||elementIndex===siblings.length-1)return[];return siblings.slice(elementIndex+1).filter(adapter.isTag)}function getElementParent(node,adapter){let parent=adapter.getParent(node);return parent!=null&&adapter.isTag(parent)?parent:null}var aliases={"any-link":":is(a, area, link)[href]",link:":any-link:not(:visited)",disabled:`:is(
|
|
47
|
+
:is(button, input, select, textarea, optgroup, option)[disabled],
|
|
48
|
+
optgroup[disabled] > option,
|
|
49
|
+
fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
|
|
50
|
+
)`,enabled:":is(button, input, select, textarea, optgroup, option, fieldset):not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], :selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])","read-only":"[readonly]:is(textarea, input:is([type=text i],[type=search i],[type=url i],[type=tel i],[type=email i],[type=password i],[type=date i],[type=month i],[type=week i],[type=time i],[type=datetime-local i],[type=number i]))","read-write":":not([readonly]):is(textarea, input:is([type=text i],[type=search i],[type=url i],[type=tel i],[type=email i],[type=password i],[type=date i],[type=month i],[type=week i],[type=time i],[type=datetime-local i],[type=number i]))",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"};function compile(parsed){let a=parsed[0],b=parsed[1]-1;if(b<0&&a<=0)return falseFunc;if(a===-1)return(index)=>index<=b;if(a===0)return(index)=>index===b;if(a===1)return b<0?trueFunc:(index)=>index>=b;let absA=Math.abs(a),bModulo=(b%absA+absA)%absA;return a>1?(index)=>index>=b&&index%absA===bModulo:(index)=>index<=b&&index%absA===bModulo}var whitespace=new Set([9,10,12,13,32]);function parse2(formula){switch(formula=formula.trim().toLowerCase(),formula){case"even":return[2,0];case"odd":return[2,1]}let index=0,a=0,sign=readSign(),number=readNumber();if(index<formula.length&&formula.charAt(index)==="n")if(index++,a=sign*(number??1),skipWhitespace(),index<formula.length)sign=readSign(),skipWhitespace(),number=readNumber();else sign=number=0;if(number===null||index<formula.length)throw Error(`n-th rule couldn't be parsed ('${formula}')`);return[a,sign*number];function readSign(){switch(formula.charAt(index)){case"-":return index++,-1;case"+":{index++;break}}return 1}function readNumber(){let start=index,value=0;while(index<formula.length&&formula.charCodeAt(index)>=48&&formula.charCodeAt(index)<=57)value=value*10+(formula.charCodeAt(index)-48),index++;return index===start?null:value}function skipWhitespace(){while(index<formula.length&&whitespace.has(formula.charCodeAt(index)))index++}}function nthCheck(formula){return compile(parse2(formula))}function cacheParentResults(next,{adapter,cacheResults},matches){if(cacheResults===!1||typeof WeakMap>"u")return(element)=>next(element)&&matches(element);let resultCache=new WeakMap;function addResultToCache(element){let result=matches(element);return resultCache.set(element,result),result}return function(element){if(!next(element))return!1;if(resultCache.has(element))return resultCache.get(element)??!1;let node=element;do{let parent=getElementParent(node,adapter);if(parent===null)return addResultToCache(element);node=parent}while(!resultCache.has(node));return resultCache.get(node)?addResultToCache(element):!1}}function copyOptions(options){let{context:_,rootFunc:__,...copied}=options;return copied}function extendedFilter(tag,range){if(range[0]!=="*"&&range[0]!==tag[0])return!1;let tagIndex=1;for(let rangeIndex=1;rangeIndex<range.length;rangeIndex++){if(range[rangeIndex]==="*")continue;while(tagIndex<tag.length&&tag[tagIndex]!==range[rangeIndex])if(tag[tagIndex++].length<=1)return!1;if(tagIndex>=tag.length)return!1;tagIndex++}return!0}var nthOfRegex=/^(.+?)\s+of\s+(.+)$/is;function compileNth(reverse,ofType){return function(next,rule,options,context2,compileToken){let{adapter,equals}=options,ofMatch=ofType?null:rule.match(nthOfRegex),nthCheck2=nthCheck(ofMatch?ofMatch[1].trim():rule);if(nthCheck2===falseFunc)return falseFunc;let ofSelector=ofMatch&&compileToken?compileToken(parse(ofMatch[2].trim()),copyOptions(options),context2):void 0;if(ofSelector===falseFunc)return falseFunc;if(nthCheck2===trueFunc&&!ofSelector)return(element)=>getElementParent(element,adapter)!==null&&next(element);let shouldCount=ofSelector?(_element,sibling)=>ofSelector(sibling):ofType?(element,sibling)=>adapter.getName(sibling)===adapter.getName(element):trueFunc;if(reverse)return function(element){if(ofSelector&&!ofSelector(element))return!1;let siblings=adapter.getSiblings(element),pos=0;for(let index=siblings.length-1;index>=0;index--){let sibling=siblings[index];if(equals(element,sibling))break;if(adapter.isTag(sibling)&&shouldCount(element,sibling))pos++}return nthCheck2(pos)&&next(element)};return function(element){if(ofSelector&&!ofSelector(element))return!1;let siblings=adapter.getSiblings(element),pos=0;for(let sibling of siblings){if(equals(element,sibling))break;if(adapter.isTag(sibling)&&shouldCount(element,sibling))pos++}return nthCheck2(pos)&&next(element)}}}var filters={contains(next,text,options){let{getText}=options.adapter;return cacheParentResults(next,options,(element)=>getText(element).includes(text))},icontains(next,text,options){let itext=text.toLowerCase(),{getText}=options.adapter;return cacheParentResults(next,options,(element)=>getText(element).toLowerCase().includes(itext))},"nth-child":compileNth(!1,!1),"nth-last-child":compileNth(!0,!1),"nth-of-type":compileNth(!1,!0),"nth-last-of-type":compileNth(!0,!0),root(next,_rule,{adapter}){return(element)=>getElementParent(element,adapter)===null&&next(element)},scope(next,rule,options,context2){let{equals}=options;if(!context2||context2.length===0)return filters.root(next,rule,options);if(context2.length===1)return(element)=>equals(context2[0],element)&&next(element);return(element)=>context2.includes(element)&&next(element)},lang(next,code,{adapter}){let ranges=code.split(",").map((r)=>r.trim()).filter((r)=>r.length>0).map((r)=>r.replace(/^['"]|['"]$/g,"").toLowerCase().split("-"));return function(element){let node=element;while(node!=null){let value=adapter.getAttributeValue(node,"xml:lang")??adapter.getAttributeValue(node,"lang");if(value!=null){if(!value)return ranges.some((r)=>r[0]==="")&&next(element);let tag=value.toLowerCase().split("-");return ranges.some((r)=>extendedFilter(tag,r))&&next(element)}let parent=adapter.getParent(node);node=parent!=null&&adapter.isTag(parent)?parent:null}return ranges.some((r)=>r[0]==="")&&next(element)}},hover:dynamicStatePseudo("isHovered"),visited:dynamicStatePseudo("isVisited"),active:dynamicStatePseudo("isActive")};function dynamicStatePseudo(name){return function(next,_rule,{adapter}){let filterFunction=adapter[name];if(typeof filterFunction!=="function")return falseFunc;return function(element){return filterFunction(element)&&next(element)}}}var isDocumentWhiteSpace=/^[ \t\r\n]*$/,pseudos={empty(element,{adapter}){let children=adapter.getChildren(element);return children.every((element)=>!adapter.isTag(element))&&children.every((element)=>isDocumentWhiteSpace.test(adapter.getText(element)))},"first-child"(element,{adapter,equals}){if(adapter.prevElementSibling)return adapter.prevElementSibling(element)==null;let firstChild=adapter.getSiblings(element).find((sibling)=>adapter.isTag(sibling));return firstChild!=null&&equals(element,firstChild)},"last-child"(element,{adapter,equals}){let siblings=adapter.getSiblings(element);for(let index=siblings.length-1;index>=0;index--){if(equals(element,siblings[index]))return!0;if(adapter.isTag(siblings[index]))break}return!1},"first-of-type"(element,{adapter,equals}){let siblings=adapter.getSiblings(element),elementName=adapter.getName(element);for(let currentSibling of siblings){if(equals(element,currentSibling))return!0;if(adapter.isTag(currentSibling)&&adapter.getName(currentSibling)===elementName)break}return!1},"last-of-type"(element,{adapter,equals}){let siblings=adapter.getSiblings(element),elementName=adapter.getName(element);for(let index=siblings.length-1;index>=0;index--){let currentSibling=siblings[index];if(equals(element,currentSibling))return!0;if(adapter.isTag(currentSibling)&&adapter.getName(currentSibling)===elementName)break}return!1},"only-of-type"(element,{adapter,equals}){let elementName=adapter.getName(element);return adapter.getSiblings(element).every((sibling)=>equals(element,sibling)||!adapter.isTag(sibling)||adapter.getName(sibling)!==elementName)},"only-child"(element,{adapter,equals}){return adapter.getSiblings(element).every((sibling)=>equals(element,sibling)||!adapter.isTag(sibling))}};function verifyPseudoArguments(pseudoClassCondition,name,subselect,argumentIndex){if(subselect===null){if(pseudoClassCondition.length>argumentIndex)throw Error(`Pseudo-class :${name} requires an argument`)}else if(pseudoClassCondition.length===argumentIndex)throw Error(`Pseudo-class :${name} doesn't have any arguments`)}function isTraversal2(token){return token.type==="_flexibleDescendant"||isTraversal(token)}function sortRules(array){let ratings=array.map(getQuality);for(let index=1;index<array.length;index++){let procNew=ratings[index];if(procNew<0)continue;for(let currentIndex=index;currentIndex>0&&procNew<ratings[currentIndex-1];currentIndex--){let token=array[currentIndex];array[currentIndex]=array[currentIndex-1],array[currentIndex-1]=token,ratings[currentIndex]=ratings[currentIndex-1],ratings[currentIndex-1]=procNew}}}function getAttributeQuality(token){switch(token.action){case AttributeAction.Exists:return 10;case AttributeAction.Equals:return token.name==="id"?9:8;case AttributeAction.Not:return 7;case AttributeAction.Start:return 6;case AttributeAction.End:return 6;case AttributeAction.Any:return 5;case AttributeAction.Hyphen:return 4;case AttributeAction.Element:return 3}}function getQuality(token){switch(token.type){case SelectorType.Universal:return 50;case SelectorType.Tag:return 30;case SelectorType.Attribute:return Math.floor(getAttributeQuality(token)/(token.ignoreCase?2:1));case SelectorType.Pseudo:return token.data?token.name==="has"||token.name==="contains"||token.name==="icontains"?0:Array.isArray(token.data)?Math.max(0,Math.min(...token.data.map((d)=>Math.min(...d.map(getQuality))))):2:3;default:return-1}}function includesScopePseudo(t){return t.type===SelectorType.Pseudo&&(t.name==="scope"||Array.isArray(t.data)&&t.data.some((data)=>data.some(includesScopePseudo)))}var PLACEHOLDER_ELEMENT={};function hasDependsOnCurrentElement(selector){return selector.some((sel)=>sel.length>0&&(isTraversal2(sel[0])||sel.some(includesScopePseudo)))}var is=(next,token,options,context2,compileToken)=>{let compiledToken=compileToken(token,copyOptions(options),context2);return compiledToken===trueFunc?next:compiledToken===falseFunc?falseFunc:(element)=>compiledToken(element)&&next(element)},subselects={is,matches:is,where:is,not(next,token,options,context2,compileToken){let compiledToken=compileToken(token,copyOptions(options),context2);return compiledToken===falseFunc?next:compiledToken===trueFunc?falseFunc:(element)=>!compiledToken(element)&&next(element)},has(next,subselect,options,_context,compileToken){let{adapter}=options,copiedOptions=copyOptions(options);copiedOptions.relativeSelector=!0;let context2=subselect.some((s)=>s.some(isTraversal2))?[PLACEHOLDER_ELEMENT]:void 0,skipCache=hasDependsOnCurrentElement(subselect),compiled=compileToken(subselect,copiedOptions,context2);if(compiled===falseFunc)return falseFunc;if(context2&&compiled!==trueFunc)return skipCache?(element)=>{if(!next(element))return!1;context2[0]=element;let childs=adapter.getChildren(element);return findOne3(compiled,compiled.shouldTestNextSiblings?[...childs,...getNextSiblings(element,adapter)]:childs,options)!==null}:cacheParentResults(next,options,(element)=>(context2[0]=element,findOne3(compiled,adapter.getChildren(element),options)!==null));let hasOne=(element)=>findOne3(compiled,adapter.getChildren(element),options)!==null;return skipCache?(element)=>next(element)&&hasOne(element):cacheParentResults(next,options,hasOne)}};function compilePseudoSelector(next,selector,options,context2,compileToken){let{name,data}=selector;if(Array.isArray(data)){if(!(name in subselects))throw Error(`Unknown pseudo-class :${name}(${data})`);return subselects[name](next,data,options,context2,compileToken)}let userPseudo=options.pseudos?.[name],stringPseudo=typeof userPseudo==="string"?userPseudo:aliases[name];if(typeof stringPseudo==="string"){if(data!=null)throw Error(`Pseudo ${name} doesn't have any arguments`);let alias=parse(stringPseudo);return subselects.is(next,alias,options,context2,compileToken)}if(typeof userPseudo==="function")return verifyPseudoArguments(userPseudo,name,data,1),(element)=>userPseudo(element,data)&&next(element);if(name in filters)return filters[name](next,data,options,context2,compileToken);if(name in pseudos){let pseudo=pseudos[name];return verifyPseudoArguments(pseudo,name,data,2),(element)=>pseudo(element,options,data)&&next(element)}throw Error(`Unknown pseudo-class :${name}`)}function compileGeneralSelector(next,selector,options,context2,compileToken,hasExpensiveSubselector){let{adapter,equals,cacheResults}=options;switch(selector.type){case SelectorType.PseudoElement:throw Error("Pseudo-elements are not supported by css-select");case SelectorType.ColumnCombinator:throw Error("Column combinators are not yet supported by css-select");case SelectorType.Attribute:{if(selector.namespace!=null)throw Error("Namespaced attributes are not yet supported by css-select");if(!options.xmlMode||options.lowerCaseAttributeNames)selector.name=selector.name.toLowerCase();return attributeRules[selector.action](next,selector,options)}case SelectorType.Pseudo:return compilePseudoSelector(next,selector,options,context2,compileToken);case SelectorType.Tag:{if(selector.namespace!=null)throw Error("Namespaced tag names are not yet supported by css-select");let{name}=selector;if(!options.xmlMode||options.lowerCaseTags)name=name.toLowerCase();return function(element){return adapter.getName(element)===name&&next(element)}}case SelectorType.Descendant:{if(!hasExpensiveSubselector||cacheResults===!1||typeof WeakMap>"u")return function(element){let current=element;while(current=getElementParent(current,adapter))if(next(current))return!0;return!1};let resultCache=new WeakMap;return function(element){let current=element,result;while(current=getElementParent(current,adapter)){let cached=resultCache.get(current);if(cached===void 0){if(result??={matches:!1},result.matches=next(current),resultCache.set(current,result),result.matches)return!0}else{if(result)result.matches=cached.matches;return cached.matches}}return!1}}case"_flexibleDescendant":return function(element){let current=element;do{if(next(current))return!0;current=getElementParent(current,adapter)}while(current);return!1};case SelectorType.Parent:return function(element){return adapter.getChildren(element).some((element)=>adapter.isTag(element)&&next(element))};case SelectorType.Child:return function(element){let parent=getElementParent(element,adapter);return parent!==null&&next(parent)};case SelectorType.Sibling:return function(element){let siblings=adapter.getSiblings(element);for(let currentSibling of siblings){if(equals(element,currentSibling))break;if(adapter.isTag(currentSibling)&&next(currentSibling))return!0}return!1};case SelectorType.Adjacent:{if(adapter.prevElementSibling)return function(element){let previous=adapter.prevElementSibling(element);return previous!=null&&next(previous)};return function(element){let siblings=adapter.getSiblings(element),lastElement;for(let currentSibling of siblings){if(equals(element,currentSibling))break;if(adapter.isTag(currentSibling))lastElement=currentSibling}return!!lastElement&&next(lastElement)}}case SelectorType.Universal:{if(selector.namespace!=null&&selector.namespace!=="*")throw Error("Namespaced universal selectors are not yet supported by css-select");return next}}}var DESCENDANT_TOKEN={type:SelectorType.Descendant},FLEXIBLE_DESCENDANT_TOKEN={type:"_flexibleDescendant"},SCOPE_TOKEN={type:SelectorType.Pseudo,name:"scope",data:null};function absolutize(token,{adapter},context2){let hasContext=!!context2?.every((element)=>element===PLACEHOLDER_ELEMENT||adapter.isTag(element)&&getElementParent(element,adapter)!==null);for(let t of token){if(t.length>0&&isTraversal2(t[0])&&t[0].type!==SelectorType.Descendant);else if(hasContext&&!t.some(includesScopePseudo))t.unshift(DESCENDANT_TOKEN);else continue;t.unshift(SCOPE_TOKEN)}}function compileToken(token,options,compilationContext){for(let rules of token)sortRules(rules);let{context:context2=compilationContext,rootFunc:rootFunction=trueFunc}=options,isArrayContext=Array.isArray(context2),finalContext=context2&&(Array.isArray(context2)?context2:[context2]);if(options.relativeSelector!==!1)absolutize(token,options,finalContext);else if(token.some((t)=>t.length>0&&isTraversal2(t[0])))throw Error("Relative selectors are not allowed when the `relativeSelector` option is disabled");let shouldTestNextSiblings=!1,query=falseFunc;combineLoop:for(let rules of token){if(rules.length>=2){let[first,second]=rules;if(first.type!==SelectorType.Pseudo||first.name!=="scope");else if(isArrayContext&&second.type===SelectorType.Descendant)rules[1]=FLEXIBLE_DESCENDANT_TOKEN;else if(second.type===SelectorType.Adjacent||second.type===SelectorType.Sibling)shouldTestNextSiblings=!0}let next=rootFunction,hasExpensiveSubselector=!1;for(let rule of rules){if(next=compileGeneralSelector(next,rule,options,finalContext,compileToken,hasExpensiveSubselector),getQuality(rule)===0)hasExpensiveSubselector=!0;if(next===falseFunc)continue combineLoop}if(next===rootFunction)return rootFunction;query=query===falseFunc?next:or(query,next)}return query.shouldTestNextSiblings=shouldTestNextSiblings,query}function or(a,b){return(element)=>a(element)||b(element)}var defaultEquals=(a,b)=>a===b,defaultOptions={adapter:{...exports_dist2,isTag:isTag4},equals:defaultEquals};function convertOptionFormats(options){let finalOptions=options??defaultOptions;return finalOptions.adapter??=defaultOptions.adapter,finalOptions.equals??=finalOptions.adapter?.equals??defaultEquals,finalOptions}function compile2(selector,options,context2){let convertedOptions=convertOptionFormats(options),next=_compileUnsafe(selector,convertedOptions,context2);return next===falseFunc?falseFunc:(element)=>convertedOptions.adapter.isTag(element)&&next(element)}function _compileUnsafe(selector,options,context2){return compileToken(typeof selector==="string"?parse(selector):selector,convertOptionFormats(options),context2)}function getSelectorFunction(searchFunction){return function(query,elements,options){let convertedOptions=convertOptionFormats(options);if(typeof query!=="function")query=_compileUnsafe(query,convertedOptions,elements);let filteredElements=prepareContext(elements,convertedOptions.adapter,query.shouldTestNextSiblings);return searchFunction(query,filteredElements,convertedOptions)}}function prepareContext(elements,adapter,shouldTestNextSiblings=!1){if(shouldTestNextSiblings)elements=appendNextSiblings(elements,adapter);return Array.isArray(elements)?adapter.removeSubsets(elements):adapter.getChildren(elements)}function appendNextSiblings(element,adapter){let elements=Array.isArray(element)?[...element]:[element],elementsLength=elements.length;for(let index=0;index<elementsLength;index++){let nextSiblings=getNextSiblings(elements[index],adapter);elements.push(...nextSiblings)}return elements}var selectAll=getSelectorFunction((query,elements,options)=>query===falseFunc||!elements||elements.length===0?[]:findAll3(query,elements,options)),selectOne=getSelectorFunction((query,elements,options)=>query===falseFunc||!elements||elements.length===0?null:findOne3(query,elements,options));function is2(element,query,options){return(typeof query==="function"?query:compile2(query,options))(element)}var{isArray}=Array,isTag5=({nodeType})=>nodeType===ELEMENT_NODE,existsOne3=(test,elements)=>elements.some((element)=>isTag5(element)&&(test(element)||existsOne3(test,getChildren3(element)))),getAttributeValue3=(element,name)=>name==="class"?element.getAttributeNode("class")?.value??null:element.getAttribute(name),getChildren3=({childNodes})=>childNodes,getName3=(element)=>{let{localName}=element;return ignoreCase(element)?localName.toLowerCase():localName},getParent3=({parentNode})=>parentNode,getSiblings3=(element)=>{let{parentNode}=element;return parentNode?getChildren3(parentNode):element},getText3=(node)=>{if(isArray(node))return node.map(getText3).join("");if(isTag5(node))return getText3(getChildren3(node));if(node.nodeType===TEXT_NODE)return node.data;return""},hasAttrib3=(element,name)=>element.hasAttribute(name),removeSubsets3=(nodes)=>{let{length}=nodes;while(length--){let node=nodes[length];if(length&&-1<nodes.lastIndexOf(node,length-1)){nodes.splice(length,1);continue}for(let{parentNode}=node;parentNode;parentNode=parentNode.parentNode)if(nodes.includes(parentNode)){nodes.splice(length,1);break}}return nodes},findAll4=(test,nodes)=>{let matches=[];for(let node of nodes)if(isTag5(node)){if(test(node))matches.push(node);matches.push(...findAll4(test,getChildren3(node)))}return matches},findOne4=(test,nodes)=>{for(let node of nodes)if(test(node)||(node=findOne4(test,getChildren3(node))))return node;return null},adapter={isTag:isTag5,existsOne:existsOne3,getAttributeValue:getAttributeValue3,getChildren:getChildren3,getName:getName3,getParent:getParent3,getSiblings:getSiblings3,getText:getText3,hasAttrib:hasAttrib3,removeSubsets:removeSubsets3,findAll:findAll4,findOne:findOne4},prepareMatch=(element,selectors)=>compile2(selectors,{context:selectors.includes(":scope")?element:void 0,xmlMode:!ignoreCase(element),adapter}),matches=(element,selectors)=>is2(element,selectors,{strict:!0,context:selectors.includes(":scope")?element:void 0,xmlMode:!ignoreCase(element),adapter});class Text6 extends CharacterData{constructor(ownerDocument,data=""){super(ownerDocument,"#text",TEXT_NODE,data)}get wholeText(){let text=[],{previousSibling,nextSibling}=this;while(previousSibling){if(previousSibling.nodeType===TEXT_NODE)text.unshift(previousSibling[VALUE]);else break;previousSibling=previousSibling.previousSibling}text.push(this[VALUE]);while(nextSibling){if(nextSibling.nodeType===TEXT_NODE)text.push(nextSibling[VALUE]);else break;nextSibling=nextSibling.nextSibling}return text.join("")}cloneNode(){let{ownerDocument,[VALUE]:data}=this;return new Text6(ownerDocument,data)}toString(){return escape2(this[VALUE])}}var isNode=(node)=>node instanceof Node2,insert=(parentNode,child,nodes)=>{let{ownerDocument}=parentNode;for(let node of nodes)parentNode.insertBefore(isNode(node)?node:new Text6(ownerDocument,node),child)};class ParentNode extends Node2{constructor(ownerDocument,localName,nodeType){super(ownerDocument,localName,nodeType);this[PRIVATE]=null,this[NEXT]=this[END]={[NEXT]:null,[PREV]:this,[START]:this,nodeType:NODE_END,ownerDocument:this.ownerDocument,parentNode:null}}get childNodes(){let childNodes=new NodeList,{firstChild}=this;while(firstChild)childNodes.push(firstChild),firstChild=nextSibling(firstChild);return childNodes}get children(){let children=new NodeList,{firstElementChild}=this;while(firstElementChild)children.push(firstElementChild),firstElementChild=nextElementSibling2(firstElementChild);return children}get firstChild(){let{[NEXT]:next,[END]:end}=this;while(next.nodeType===ATTRIBUTE_NODE)next=next[NEXT];return next===end?null:next}get firstElementChild(){let{firstChild}=this;while(firstChild){if(firstChild.nodeType===ELEMENT_NODE)return firstChild;firstChild=nextSibling(firstChild)}return null}get lastChild(){let prev=this[END][PREV];switch(prev.nodeType){case NODE_END:return prev[START];case ATTRIBUTE_NODE:return null}return prev===this?null:prev}get lastElementChild(){let{lastChild}=this;while(lastChild){if(lastChild.nodeType===ELEMENT_NODE)return lastChild;lastChild=previousSibling(lastChild)}return null}get childElementCount(){return this.children.length}prepend(...nodes){insert(this,this.firstChild,nodes)}append(...nodes){insert(this,this[END],nodes)}replaceChildren(...nodes){let{[NEXT]:next,[END]:end}=this;while(next!==end&&next.nodeType===ATTRIBUTE_NODE)next=next[NEXT];while(next!==end){let after=getEnd(next)[NEXT];next.remove(),next=after}if(nodes.length)insert(this,end,nodes)}getElementsByClassName(className){let elements=new NodeList,{[NEXT]:next,[END]:end}=this;while(next!==end){if(next.nodeType===ELEMENT_NODE&&next.hasAttribute("class")&&next.classList.has(className))elements.push(next);next=next[NEXT]}return elements}getElementsByTagName(tagName){let elements=new NodeList,{[NEXT]:next,[END]:end}=this;while(next!==end){if(next.nodeType===ELEMENT_NODE&&(next.localName===tagName||localCase(next)===tagName))elements.push(next);next=next[NEXT]}return elements}querySelector(selectors){let matches=prepareMatch(this,selectors),{[NEXT]:next,[END]:end}=this;while(next!==end){if(next.nodeType===ELEMENT_NODE&&matches(next))return next;next=next.nodeType===ELEMENT_NODE&&next.localName==="template"?next[END]:next[NEXT]}return null}querySelectorAll(selectors){let matches=prepareMatch(this,selectors),elements=new NodeList,{[NEXT]:next,[END]:end}=this;while(next!==end){if(next.nodeType===ELEMENT_NODE&&matches(next))elements.push(next);next=next.nodeType===ELEMENT_NODE&&next.localName==="template"?next[END]:next[NEXT]}return elements}appendChild(node){return this.insertBefore(node,this[END])}contains(node){let parentNode=node;while(parentNode&&parentNode!==this)parentNode=parentNode.parentNode;return parentNode===this}insertBefore(node,before=null){if(node===before)return node;if(node===this)throw Error("unable to append a node to itself");let next=before||this[END];switch(node.nodeType){case ELEMENT_NODE:node.remove(),node.parentNode=this,knownBoundaries(next[PREV],node,next),moCallback(node,null),connectedCallback(node);break;case DOCUMENT_FRAGMENT_NODE:{let{[PRIVATE]:parentNode,firstChild,lastChild}=node;if(firstChild){if(knownSegment(next[PREV],firstChild,lastChild,next),knownAdjacent(node,node[END]),parentNode)parentNode.replaceChildren();do if(firstChild.parentNode=this,moCallback(firstChild,null),firstChild.nodeType===ELEMENT_NODE)connectedCallback(firstChild);while(firstChild!==lastChild&&(firstChild=nextSibling(firstChild)))}break}case TEXT_NODE:case COMMENT_NODE:case CDATA_SECTION_NODE:node.remove();default:node.parentNode=this,knownSiblings(next[PREV],node,next),moCallback(node,null);break}return node}normalize(){let{[NEXT]:next,[END]:end}=this;while(next!==end){let{[NEXT]:$next,[PREV]:$prev,nodeType}=next;if(nodeType===TEXT_NODE){if(!next[VALUE])next.remove();else if($prev&&$prev.nodeType===TEXT_NODE)$prev.textContent+=next.textContent,next.remove()}next=$next}}removeChild(node){if(node.parentNode!==this)throw Error("node is not a child");return node.remove(),node}replaceChild(node,replaced){let next=getEnd(replaced)[NEXT];return replaced.remove(),this.insertBefore(node,next),replaced}}class NonElementParentNode extends ParentNode{getElementById(id){let{[NEXT]:next,[END]:end}=this;while(next!==end){if(next.nodeType===ELEMENT_NODE&&next.id===id)return next;next=next[NEXT]}return null}cloneNode(deep){let{ownerDocument,constructor}=this,nonEPN=new constructor(ownerDocument);if(deep){let{[END]:end}=nonEPN;for(let node of this.childNodes)nonEPN.insertBefore(node.cloneNode(deep),end)}return nonEPN}toString(){let{childNodes,localName}=this;return`<${localName}>${childNodes.join("")}</${localName}>`}toJSON(){let json=[];return nonElementAsJSON(this,json),json}}class DocumentFragment extends NonElementParentNode{constructor(ownerDocument){super(ownerDocument,"#document-fragment",DOCUMENT_FRAGMENT_NODE)}}class DocumentType extends Node2{constructor(ownerDocument,name,publicId="",systemId=""){super(ownerDocument,"#document-type",DOCUMENT_TYPE_NODE);this.name=name,this.publicId=publicId,this.systemId=systemId}cloneNode(){let{ownerDocument,name,publicId,systemId}=this;return new DocumentType(ownerDocument,name,publicId,systemId)}toString(){let{name,publicId,systemId}=this,hasPublic=0<publicId.length,str=[name];if(hasPublic)str.push("PUBLIC",`"${publicId}"`);if(systemId.length){if(!hasPublic)str.push("SYSTEM");str.push(`"${systemId}"`)}return`<!DOCTYPE ${str.join(" ")}>`}toJSON(){let json=[];return documentTypeAsJSON(this,json),json}}var getInnerHtml=(node)=>node.childNodes.join(""),setInnerHtml=(node,html)=>{let{ownerDocument}=node,{constructor}=ownerDocument,document=new constructor;document[CUSTOM_ELEMENTS]=ownerDocument[CUSTOM_ELEMENTS];let{childNodes}=parseFromString(document,ignoreCase(node),html);node.replaceChildren(...childNodes.map(setOwnerDocument,ownerDocument))};function setOwnerDocument(node){switch(node.ownerDocument=this,node.nodeType){case ELEMENT_NODE:case DOCUMENT_FRAGMENT_NODE:node.childNodes.forEach(setOwnerDocument,this);break}return node}var esm_default2=(camel)=>camel.replace(/(([A-Z0-9])([A-Z0-9][a-z]))|(([a-z0-9]+)([A-Z]))/g,"$2$5-$3$6").toLowerCase();var refs=new WeakMap,key=(name)=>`data-${esm_default2(name)}`,prop=(name)=>name.slice(5).replace(/-([a-z])/g,(_,$1)=>$1.toUpperCase()),handler={get(dataset,name){if(name in dataset)return refs.get(dataset).getAttribute(key(name))},set(dataset,name,value){return dataset[name]=value,refs.get(dataset).setAttribute(key(name),value),!0},deleteProperty(dataset,name){if(name in dataset)refs.get(dataset).removeAttribute(key(name));return delete dataset[name]}};class DOMStringMap{constructor(ref){for(let{name,value}of ref.attributes)if(/^data-/.test(name))this[prop(name)]=value;return refs.set(this,ref),new Proxy(this,handler)}}setPrototypeOf(DOMStringMap.prototype,null);var{add}=Set.prototype,addTokens=(self,tokens)=>{for(let token of tokens)if(token)add.call(self,token)},update=({[OWNER_ELEMENT]:ownerElement,value})=>{let attribute=ownerElement.getAttributeNode("class");if(attribute)attribute.value=value;else setAttribute(ownerElement,new Attr(ownerElement.ownerDocument,"class",value))};class DOMTokenList extends Set{constructor(ownerElement){super();this[OWNER_ELEMENT]=ownerElement;let attribute=ownerElement.getAttributeNode("class");if(attribute)addTokens(this,attribute.value.split(/\s+/))}get length(){return this.size}get value(){return[...this].join(" ")}add(...tokens){addTokens(this,tokens),update(this)}contains(token){return this.has(token)}remove(...tokens){for(let token of tokens)this.delete(token);update(this)}toggle(token,force){if(this.has(token)){if(force)return!0;this.delete(token),update(this)}else if(force||arguments.length===1)return super.add(token),update(this),!0;return!1}replace(token,newToken){if(this.has(token))return this.delete(token),super.add(newToken),update(this),!0;return!1}supports(){return!0}}var refs2=new WeakMap,getKeys=(style)=>[...style.keys()].filter((key)=>key!==PRIVATE),updateKeys=(style)=>{let attr=refs2.get(style).getAttributeNode("style");if(!attr||attr[CHANGED]||style.get(PRIVATE)!==attr){if(style.clear(),attr){style.set(PRIVATE,attr);for(let rule of attr[VALUE].split(/\s*;\s*/)){let[key,...rest]=rule.split(":");if(rest.length>0){key=key.trim();let value=rest.join(":").trim();if(key&&value)style.set(key,value)}}}}return attr},handler2={get(style,name){if(name in prototype)return style[name];if(updateKeys(style),name==="length")return getKeys(style).length;if(/^\d+$/.test(name))return getKeys(style)[name];return style.get(esm_default2(name))??""},set(style,name,value){if(name==="cssText")style[name]=value;else{let attr=updateKeys(style);if(value==null)style.delete(esm_default2(name));else style.set(esm_default2(name),value);if(!attr){let element=refs2.get(style);attr=element.ownerDocument.createAttribute("style"),element.setAttributeNode(attr),style.set(PRIVATE,attr)}attr[CHANGED]=!1,attr[VALUE]=style.toString()}return!0}};class CSSStyleDeclaration extends Map{constructor(element){super();return refs2.set(this,element),new Proxy(this,handler2)}get cssText(){return this.toString()}set cssText(value){refs2.get(this).setAttribute("style",value)}getPropertyValue(name){let self=this[PRIVATE];return handler2.get(self,name)}setProperty(name,value){let self=this[PRIVATE];handler2.set(self,name,value)}removeProperty(name){let self=this[PRIVATE];handler2.set(self,name,null)}[Symbol.iterator](){let self=this[PRIVATE];updateKeys(self);let keys=getKeys(self),{length}=keys,i=0;return{next(){let done=i===length;return{done,value:done?null:keys[i++]}}}}get[PRIVATE](){return this}toString(){let self=this[PRIVATE];updateKeys(self);let cssText=[];return self.forEach(push,cssText),cssText.join(";")}}var{prototype}=CSSStyleDeclaration;function push(value,key){if(key!==PRIVATE)this.push(`${key}:${value}`)}function getCurrentTarget(ev){return ev.currentTarget}class GlobalEvent{static get BUBBLING_PHASE(){return 3}static get AT_TARGET(){return 2}static get CAPTURING_PHASE(){return 1}static get NONE(){return 0}constructor(type,eventInitDict={}){this.type=type,this.bubbles=!!eventInitDict.bubbles,this.cancelBubble=!1,this._stopImmediatePropagationFlag=!1,this.cancelable=!!eventInitDict.cancelable,this.eventPhase=this.NONE,this.timeStamp=Date.now(),this.defaultPrevented=!1,this.originalTarget=null,this.returnValue=null,this.srcElement=null,this.target=null,this._path=[]}get BUBBLING_PHASE(){return 3}get AT_TARGET(){return 2}get CAPTURING_PHASE(){return 1}get NONE(){return 0}preventDefault(){this.defaultPrevented=!0}composedPath(){return this._path.map(getCurrentTarget)}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this.stopPropagation(),this._stopImmediatePropagationFlag=!0}}class NamedNodeMap extends Array{constructor(ownerElement){super();this.ownerElement=ownerElement}getNamedItem(name){return this.ownerElement.getAttributeNode(name)}setNamedItem(attr){this.ownerElement.setAttributeNode(attr),this.unshift(attr)}removeNamedItem(name){let item=this.getNamedItem(name);this.ownerElement.removeAttribute(name),this.splice(this.indexOf(item),1)}item(index){return index<this.length?this[index]:null}getNamedItemNS(_,name){return this.getNamedItem(name)}setNamedItemNS(_,attr){return this.setNamedItem(attr)}removeNamedItemNS(_,name){return this.removeNamedItem(name)}}class ShadowRoot extends NonElementParentNode{constructor(host){super(host.ownerDocument,"#shadow-root",DOCUMENT_FRAGMENT_NODE);this.host=host}get innerHTML(){return getInnerHtml(this)}set innerHTML(html){setInnerHtml(this,html)}}var attributesHandler={get(target,key){return key in target?target[key]:target.find(({name})=>name===key)}},create2=(ownerDocument,element,localName)=>{if("ownerSVGElement"in element){let svg=ownerDocument.createElementNS(SVG_NAMESPACE,localName);return svg.ownerSVGElement=element.ownerSVGElement,svg}return ownerDocument.createElement(localName)},isVoid=({localName,ownerDocument})=>ownerDocument[MIME].voidElements.test(localName);class Element2 extends ParentNode{constructor(ownerDocument,localName){super(ownerDocument,localName,ELEMENT_NODE);this[CLASS_LIST]=null,this[DATASET]=null,this[STYLE]=null}get isConnected(){return isConnected(this)}get parentElement(){return parentElement(this)}get previousSibling(){return previousSibling(this)}get nextSibling(){return nextSibling(this)}get namespaceURI(){return"http://www.w3.org/1999/xhtml"}get previousElementSibling(){return previousElementSibling(this)}get nextElementSibling(){return nextElementSibling2(this)}before(...nodes){before(this,nodes)}after(...nodes){after(this,nodes)}replaceWith(...nodes){replaceWith(this,nodes)}remove(){remove(this[PREV],this,this[END][NEXT])}get id(){return stringAttribute.get(this,"id")}set id(value){stringAttribute.set(this,"id",value)}get className(){return this.classList.value}set className(value){let{classList}=this;classList.clear(),classList.add(...$String(value).split(/\s+/))}get nodeName(){return localCase(this)}get tagName(){return localCase(this)}get classList(){return this[CLASS_LIST]||(this[CLASS_LIST]=new DOMTokenList(this))}get dataset(){return this[DATASET]||(this[DATASET]=new DOMStringMap(this))}getBoundingClientRect(){return{x:0,y:0,bottom:0,height:0,left:0,right:0,top:0,width:0}}get nonce(){return stringAttribute.get(this,"nonce")}set nonce(value){stringAttribute.set(this,"nonce",value)}get style(){return this[STYLE]||(this[STYLE]=new CSSStyleDeclaration(this))}get tabIndex(){return numericAttribute.get(this,"tabindex")||-1}set tabIndex(value){numericAttribute.set(this,"tabindex",value)}get slot(){return stringAttribute.get(this,"slot")}set slot(value){stringAttribute.set(this,"slot",value)}get innerText(){let text=[],{[NEXT]:next,[END]:end}=this;while(next!==end){if(next.nodeType===TEXT_NODE)text.push(next.textContent.replace(/\s+/g," "));else if(text.length&&next[NEXT]!=end&&BLOCK_ELEMENTS.has(next.tagName))text.push(`
|
|
51
|
+
`);next=next[NEXT]}return text.join("")}get textContent(){let text=[],{[NEXT]:next,[END]:end}=this;while(next!==end){let nodeType=next.nodeType;if(nodeType===TEXT_NODE||nodeType===CDATA_SECTION_NODE)text.push(next.textContent);next=next[NEXT]}return text.join("")}set textContent(text){if(this.replaceChildren(),text!=null&&text!=="")this.appendChild(new Text6(this.ownerDocument,text))}get innerHTML(){return getInnerHtml(this)}set innerHTML(html){setInnerHtml(this,html)}get outerHTML(){return this.toString()}set outerHTML(html){let template=this.ownerDocument.createElement("");template.innerHTML=html,this.replaceWith(...template.childNodes)}get attributes(){let attributes=new NamedNodeMap(this),next=this[NEXT];while(next.nodeType===ATTRIBUTE_NODE)attributes.push(next),next=next[NEXT];return new Proxy(attributes,attributesHandler)}focus(){this.dispatchEvent(new GlobalEvent("focus"))}getAttribute(name){if(name==="class")return this.className;let attribute=this.getAttributeNode(name);return attribute&&(ignoreCase(this)?attribute.value:escape2(attribute.value))}getAttributeNode(name){let next=this[NEXT];while(next.nodeType===ATTRIBUTE_NODE){if(next.name===name)return next;next=next[NEXT]}return null}getAttributeNames(){let attributes=new NodeList,next=this[NEXT];while(next.nodeType===ATTRIBUTE_NODE)attributes.push(next.name),next=next[NEXT];return attributes}hasAttribute(name){return!!this.getAttributeNode(name)}hasAttributes(){return this[NEXT].nodeType===ATTRIBUTE_NODE}removeAttribute(name){if(name==="class"&&this[CLASS_LIST])this[CLASS_LIST].clear();let next=this[NEXT];while(next.nodeType===ATTRIBUTE_NODE){if(next.name===name){removeAttribute(this,next);return}next=next[NEXT]}}removeAttributeNode(attribute){let next=this[NEXT];while(next.nodeType===ATTRIBUTE_NODE){if(next===attribute){removeAttribute(this,next);return}next=next[NEXT]}}setAttribute(name,value){if(name==="class")this.className=value;else{let attribute=this.getAttributeNode(name);if(attribute)attribute.value=value;else setAttribute(this,new Attr(this.ownerDocument,name,value))}}setAttributeNode(attribute){let{name}=attribute,previously=this.getAttributeNode(name);if(previously!==attribute){if(previously)this.removeAttributeNode(previously);let{ownerElement}=attribute;if(ownerElement)ownerElement.removeAttributeNode(attribute);setAttribute(this,attribute)}return previously}toggleAttribute(name,force){if(this.hasAttribute(name)){if(!force)return this.removeAttribute(name),!1;return!0}else if(force||arguments.length===1)return this.setAttribute(name,""),!0;return!1}get shadowRoot(){if(shadowRoots.has(this)){let{mode,shadowRoot}=shadowRoots.get(this);if(mode==="open")return shadowRoot}return null}attachShadow(init){if(shadowRoots.has(this))throw Error("operation not supported");let shadowRoot=new ShadowRoot(this);return shadowRoots.set(this,{mode:init.mode,shadowRoot}),shadowRoot}matches(selectors){return matches(this,selectors)}closest(selectors){let parentElement=this,matches=prepareMatch(parentElement,selectors);while(parentElement&&!matches(parentElement))parentElement=parentElement.parentElement;return parentElement}insertAdjacentElement(position,element){let{parentElement}=this;switch(position){case"beforebegin":if(parentElement){parentElement.insertBefore(element,this);break}return null;case"afterbegin":this.insertBefore(element,this.firstChild);break;case"beforeend":this.insertBefore(element,null);break;case"afterend":if(parentElement){parentElement.insertBefore(element,this.nextSibling);break}return null}return element}insertAdjacentHTML(position,html){this.insertAdjacentElement(position,htmlToFragment(this.ownerDocument,html))}insertAdjacentText(position,text){let node=this.ownerDocument.createTextNode(text);this.insertAdjacentElement(position,node)}cloneNode(deep=!1){let{ownerDocument,localName}=this,addNext=(next)=>{next.parentNode=parentNode,knownAdjacent($next,next),$next=next},clone=create2(ownerDocument,this,localName),parentNode=clone,$next=clone,{[NEXT]:next,[END]:prev}=this;while(next!==prev&&(deep||next.nodeType===ATTRIBUTE_NODE)){switch(next.nodeType){case NODE_END:knownAdjacent($next,parentNode[END]),$next=parentNode[END],parentNode=parentNode.parentNode;break;case ELEMENT_NODE:{let node=create2(ownerDocument,next,next.localName);addNext(node),parentNode=node;break}case ATTRIBUTE_NODE:{let attr=next.cloneNode(deep);attr.ownerElement=parentNode,addNext(attr);break}case TEXT_NODE:case COMMENT_NODE:case CDATA_SECTION_NODE:addNext(next.cloneNode(deep));break}next=next[NEXT]}return knownAdjacent($next,clone[END]),clone}toString(){let out=[],{[END]:end}=this,next={[NEXT]:this},isOpened=!1;do switch(next=next[NEXT],next.nodeType){case ATTRIBUTE_NODE:{let attr=" "+next;switch(attr){case" id":case" class":case" style":break;default:out.push(attr)}break}case NODE_END:{let start=next[START];if(isOpened){if("ownerSVGElement"in start)out.push(" />");else if(isVoid(start))out.push(ignoreCase(start)?">":" />");else out.push(`></${start.localName}>`);isOpened=!1}else out.push(`</${start.localName}>`);break}case ELEMENT_NODE:if(isOpened)out.push(">");if(next.toString!==this.toString)out.push(next.toString()),next=next[END],isOpened=!1;else out.push(`<${next.localName}`),isOpened=!0;break;case TEXT_NODE:case COMMENT_NODE:case CDATA_SECTION_NODE:out.push((isOpened?">":"")+next),isOpened=!1;break}while(next!==end);return out.join("")}toJSON(){let json=[];return elementAsJSON(this,json),json}getAttributeNS(_,name){return this.getAttribute(name)}getElementsByTagNameNS(_,name){return this.getElementsByTagName(name)}hasAttributeNS(_,name){return this.hasAttribute(name)}removeAttributeNS(_,name){this.removeAttribute(name)}setAttributeNS(_,name,value){this.setAttribute(name,value)}setAttributeNodeNS(attr){return this.setAttributeNode(attr)}}var classNames=new WeakMap,handler3={get(target,name){return target[name]},set(target,name,value){return target[name]=value,!0}};class SVGElement extends Element2{constructor(ownerDocument,localName,ownerSVGElement=null){super(ownerDocument,localName);this.ownerSVGElement=ownerSVGElement}get className(){if(!classNames.has(this))classNames.set(this,new Proxy({baseVal:"",animVal:""},handler3));return classNames.get(this)}set className(value){let{classList}=this;classList.clear(),classList.add(...$String(value).split(/\s+/))}get namespaceURI(){return"http://www.w3.org/2000/svg"}getAttribute(name){return name==="class"?[...this.classList].join(" "):super.getAttribute(name)}setAttribute(name,value){if(name==="class")this.className=value;else if(name==="style"){let{className}=this;className.baseVal=className.animVal=value}super.setAttribute(name,value)}}var illegalConstructor=()=>{throw TypeError("Illegal constructor")};function Attr2(){illegalConstructor()}setPrototypeOf(Attr2,Attr);Attr2.prototype=Attr.prototype;function CDATASection2(){illegalConstructor()}setPrototypeOf(CDATASection2,CDATASection);CDATASection2.prototype=CDATASection.prototype;function CharacterData2(){illegalConstructor()}setPrototypeOf(CharacterData2,CharacterData);CharacterData2.prototype=CharacterData.prototype;function Comment7(){illegalConstructor()}setPrototypeOf(Comment7,Comment3);Comment7.prototype=Comment3.prototype;function DocumentFragment2(){illegalConstructor()}setPrototypeOf(DocumentFragment2,DocumentFragment);DocumentFragment2.prototype=DocumentFragment.prototype;function DocumentType2(){illegalConstructor()}setPrototypeOf(DocumentType2,DocumentType);DocumentType2.prototype=DocumentType.prototype;function Element3(){illegalConstructor()}setPrototypeOf(Element3,Element2);Element3.prototype=Element2.prototype;function Node3(){illegalConstructor()}setPrototypeOf(Node3,Node2);Node3.prototype=Node2.prototype;function ShadowRoot2(){illegalConstructor()}setPrototypeOf(ShadowRoot2,ShadowRoot);ShadowRoot2.prototype=ShadowRoot.prototype;function Text7(){illegalConstructor()}setPrototypeOf(Text7,Text6);Text7.prototype=Text6.prototype;function SVGElement2(){illegalConstructor()}setPrototypeOf(SVGElement2,SVGElement);SVGElement2.prototype=SVGElement.prototype;var Facades={Attr:Attr2,CDATASection:CDATASection2,CharacterData:CharacterData2,Comment:Comment7,DocumentFragment:DocumentFragment2,DocumentType:DocumentType2,Element:Element3,Node:Node3,ShadowRoot:ShadowRoot2,Text:Text7,SVGElement:SVGElement2};var Level0=new WeakMap,level0={get(element,name){return Level0.has(element)&&Level0.get(element)[name]||null},set(element,name,value){if(!Level0.has(element))Level0.set(element,{});let handlers=Level0.get(element),type=name.slice(2);if(handlers[name])element.removeEventListener(type,handlers[name],!1);if(handlers[name]=value)element.addEventListener(type,value,!1)}};class HTMLElement extends Element2{static get observedAttributes(){return[]}constructor(ownerDocument=null,localName=""){super(ownerDocument,localName);let ownerLess=!ownerDocument,options;if(ownerLess){let{constructor:Class}=this;if(!Classes.has(Class))throw Error("unable to initialize this Custom Element");({ownerDocument,localName,options}=Classes.get(Class))}if(ownerDocument[UPGRADE]){let{element,values}=ownerDocument[UPGRADE];ownerDocument[UPGRADE]=null;for(let[key,value]of values)element[key]=value;return element}if(ownerLess){if(this.ownerDocument=this[END].ownerDocument=ownerDocument,this.localName=localName,customElements.set(this,{connected:!1}),options.is)this.setAttribute("is",options.is)}}blur(){this.dispatchEvent(new GlobalEvent("blur"))}click(){let clickEvent=new GlobalEvent("click",{bubbles:!0,cancelable:!0});clickEvent.button=0,this.dispatchEvent(clickEvent)}get accessKeyLabel(){let{accessKey}=this;return accessKey&&`Alt+Shift+${accessKey}`}get isContentEditable(){return this.hasAttribute("contenteditable")}get contentEditable(){return booleanAttribute.get(this,"contenteditable")}set contentEditable(value){booleanAttribute.set(this,"contenteditable",value)}get draggable(){return booleanAttribute.get(this,"draggable")}set draggable(value){booleanAttribute.set(this,"draggable",value)}get hidden(){return booleanAttribute.get(this,"hidden")}set hidden(value){booleanAttribute.set(this,"hidden",value)}get spellcheck(){return booleanAttribute.get(this,"spellcheck")}set spellcheck(value){booleanAttribute.set(this,"spellcheck",value)}get accessKey(){return stringAttribute.get(this,"accesskey")}set accessKey(value){stringAttribute.set(this,"accesskey",value)}get dir(){return stringAttribute.get(this,"dir")}set dir(value){stringAttribute.set(this,"dir",value)}get lang(){return stringAttribute.get(this,"lang")}set lang(value){stringAttribute.set(this,"lang",value)}get title(){return stringAttribute.get(this,"title")}set title(value){stringAttribute.set(this,"title",value)}get onabort(){return level0.get(this,"onabort")}set onabort(value){level0.set(this,"onabort",value)}get onblur(){return level0.get(this,"onblur")}set onblur(value){level0.set(this,"onblur",value)}get oncancel(){return level0.get(this,"oncancel")}set oncancel(value){level0.set(this,"oncancel",value)}get oncanplay(){return level0.get(this,"oncanplay")}set oncanplay(value){level0.set(this,"oncanplay",value)}get oncanplaythrough(){return level0.get(this,"oncanplaythrough")}set oncanplaythrough(value){level0.set(this,"oncanplaythrough",value)}get onchange(){return level0.get(this,"onchange")}set onchange(value){level0.set(this,"onchange",value)}get onclick(){return level0.get(this,"onclick")}set onclick(value){level0.set(this,"onclick",value)}get onclose(){return level0.get(this,"onclose")}set onclose(value){level0.set(this,"onclose",value)}get oncontextmenu(){return level0.get(this,"oncontextmenu")}set oncontextmenu(value){level0.set(this,"oncontextmenu",value)}get oncuechange(){return level0.get(this,"oncuechange")}set oncuechange(value){level0.set(this,"oncuechange",value)}get ondblclick(){return level0.get(this,"ondblclick")}set ondblclick(value){level0.set(this,"ondblclick",value)}get ondrag(){return level0.get(this,"ondrag")}set ondrag(value){level0.set(this,"ondrag",value)}get ondragend(){return level0.get(this,"ondragend")}set ondragend(value){level0.set(this,"ondragend",value)}get ondragenter(){return level0.get(this,"ondragenter")}set ondragenter(value){level0.set(this,"ondragenter",value)}get ondragleave(){return level0.get(this,"ondragleave")}set ondragleave(value){level0.set(this,"ondragleave",value)}get ondragover(){return level0.get(this,"ondragover")}set ondragover(value){level0.set(this,"ondragover",value)}get ondragstart(){return level0.get(this,"ondragstart")}set ondragstart(value){level0.set(this,"ondragstart",value)}get ondrop(){return level0.get(this,"ondrop")}set ondrop(value){level0.set(this,"ondrop",value)}get ondurationchange(){return level0.get(this,"ondurationchange")}set ondurationchange(value){level0.set(this,"ondurationchange",value)}get onemptied(){return level0.get(this,"onemptied")}set onemptied(value){level0.set(this,"onemptied",value)}get onended(){return level0.get(this,"onended")}set onended(value){level0.set(this,"onended",value)}get onerror(){return level0.get(this,"onerror")}set onerror(value){level0.set(this,"onerror",value)}get onfocus(){return level0.get(this,"onfocus")}set onfocus(value){level0.set(this,"onfocus",value)}get oninput(){return level0.get(this,"oninput")}set oninput(value){level0.set(this,"oninput",value)}get oninvalid(){return level0.get(this,"oninvalid")}set oninvalid(value){level0.set(this,"oninvalid",value)}get onkeydown(){return level0.get(this,"onkeydown")}set onkeydown(value){level0.set(this,"onkeydown",value)}get onkeypress(){return level0.get(this,"onkeypress")}set onkeypress(value){level0.set(this,"onkeypress",value)}get onkeyup(){return level0.get(this,"onkeyup")}set onkeyup(value){level0.set(this,"onkeyup",value)}get onload(){return level0.get(this,"onload")}set onload(value){level0.set(this,"onload",value)}get onloadeddata(){return level0.get(this,"onloadeddata")}set onloadeddata(value){level0.set(this,"onloadeddata",value)}get onloadedmetadata(){return level0.get(this,"onloadedmetadata")}set onloadedmetadata(value){level0.set(this,"onloadedmetadata",value)}get onloadstart(){return level0.get(this,"onloadstart")}set onloadstart(value){level0.set(this,"onloadstart",value)}get onmousedown(){return level0.get(this,"onmousedown")}set onmousedown(value){level0.set(this,"onmousedown",value)}get onmouseenter(){return level0.get(this,"onmouseenter")}set onmouseenter(value){level0.set(this,"onmouseenter",value)}get onmouseleave(){return level0.get(this,"onmouseleave")}set onmouseleave(value){level0.set(this,"onmouseleave",value)}get onmousemove(){return level0.get(this,"onmousemove")}set onmousemove(value){level0.set(this,"onmousemove",value)}get onmouseout(){return level0.get(this,"onmouseout")}set onmouseout(value){level0.set(this,"onmouseout",value)}get onmouseover(){return level0.get(this,"onmouseover")}set onmouseover(value){level0.set(this,"onmouseover",value)}get onmouseup(){return level0.get(this,"onmouseup")}set onmouseup(value){level0.set(this,"onmouseup",value)}get onmousewheel(){return level0.get(this,"onmousewheel")}set onmousewheel(value){level0.set(this,"onmousewheel",value)}get onpause(){return level0.get(this,"onpause")}set onpause(value){level0.set(this,"onpause",value)}get onplay(){return level0.get(this,"onplay")}set onplay(value){level0.set(this,"onplay",value)}get onplaying(){return level0.get(this,"onplaying")}set onplaying(value){level0.set(this,"onplaying",value)}get onprogress(){return level0.get(this,"onprogress")}set onprogress(value){level0.set(this,"onprogress",value)}get onratechange(){return level0.get(this,"onratechange")}set onratechange(value){level0.set(this,"onratechange",value)}get onreset(){return level0.get(this,"onreset")}set onreset(value){level0.set(this,"onreset",value)}get onresize(){return level0.get(this,"onresize")}set onresize(value){level0.set(this,"onresize",value)}get onscroll(){return level0.get(this,"onscroll")}set onscroll(value){level0.set(this,"onscroll",value)}get onseeked(){return level0.get(this,"onseeked")}set onseeked(value){level0.set(this,"onseeked",value)}get onseeking(){return level0.get(this,"onseeking")}set onseeking(value){level0.set(this,"onseeking",value)}get onselect(){return level0.get(this,"onselect")}set onselect(value){level0.set(this,"onselect",value)}get onshow(){return level0.get(this,"onshow")}set onshow(value){level0.set(this,"onshow",value)}get onstalled(){return level0.get(this,"onstalled")}set onstalled(value){level0.set(this,"onstalled",value)}get onsubmit(){return level0.get(this,"onsubmit")}set onsubmit(value){level0.set(this,"onsubmit",value)}get onsuspend(){return level0.get(this,"onsuspend")}set onsuspend(value){level0.set(this,"onsuspend",value)}get ontimeupdate(){return level0.get(this,"ontimeupdate")}set ontimeupdate(value){level0.set(this,"ontimeupdate",value)}get ontoggle(){return level0.get(this,"ontoggle")}set ontoggle(value){level0.set(this,"ontoggle",value)}get onvolumechange(){return level0.get(this,"onvolumechange")}set onvolumechange(value){level0.set(this,"onvolumechange",value)}get onwaiting(){return level0.get(this,"onwaiting")}set onwaiting(value){level0.set(this,"onwaiting",value)}get onauxclick(){return level0.get(this,"onauxclick")}set onauxclick(value){level0.set(this,"onauxclick",value)}get ongotpointercapture(){return level0.get(this,"ongotpointercapture")}set ongotpointercapture(value){level0.set(this,"ongotpointercapture",value)}get onlostpointercapture(){return level0.get(this,"onlostpointercapture")}set onlostpointercapture(value){level0.set(this,"onlostpointercapture",value)}get onpointercancel(){return level0.get(this,"onpointercancel")}set onpointercancel(value){level0.set(this,"onpointercancel",value)}get onpointerdown(){return level0.get(this,"onpointerdown")}set onpointerdown(value){level0.set(this,"onpointerdown",value)}get onpointerenter(){return level0.get(this,"onpointerenter")}set onpointerenter(value){level0.set(this,"onpointerenter",value)}get onpointerleave(){return level0.get(this,"onpointerleave")}set onpointerleave(value){level0.set(this,"onpointerleave",value)}get onpointermove(){return level0.get(this,"onpointermove")}set onpointermove(value){level0.set(this,"onpointermove",value)}get onpointerout(){return level0.get(this,"onpointerout")}set onpointerout(value){level0.set(this,"onpointerout",value)}get onpointerover(){return level0.get(this,"onpointerover")}set onpointerover(value){level0.set(this,"onpointerover",value)}get onpointerup(){return level0.get(this,"onpointerup")}set onpointerup(value){level0.set(this,"onpointerup",value)}}var tagName="template";class HTMLTemplateElement extends HTMLElement{constructor(ownerDocument){super(ownerDocument,tagName);let content=this.ownerDocument.createDocumentFragment();(this[CONTENT]=content)[PRIVATE]=this}get content(){if(this.hasChildNodes()&&!this[CONTENT].hasChildNodes())for(let node of this.childNodes)this[CONTENT].appendChild(node.cloneNode(!0));return this[CONTENT]}}registerHTMLClass(tagName,HTMLTemplateElement);class HTMLHtmlElement extends HTMLElement{constructor(ownerDocument,localName="html"){super(ownerDocument,localName)}}var{toString}=HTMLElement.prototype;class TextElement extends HTMLElement{get innerHTML(){return this.textContent}set innerHTML(html){this.textContent=html}toString(){return toString.call(this.cloneNode()).replace("><",()=>`>${this.textContent}<`)}}var tagName2="script";class HTMLScriptElement extends TextElement{constructor(ownerDocument,localName=tagName2){super(ownerDocument,localName)}get type(){return stringAttribute.get(this,"type")}set type(value){stringAttribute.set(this,"type",value)}get src(){return stringAttribute.get(this,"src")}set src(value){stringAttribute.set(this,"src",value)}get defer(){return booleanAttribute.get(this,"defer")}set defer(value){booleanAttribute.set(this,"defer",value)}get crossOrigin(){return stringAttribute.get(this,"crossorigin")}set crossOrigin(value){stringAttribute.set(this,"crossorigin",value)}get nomodule(){return booleanAttribute.get(this,"nomodule")}set nomodule(value){booleanAttribute.set(this,"nomodule",value)}get referrerPolicy(){return stringAttribute.get(this,"referrerpolicy")}set referrerPolicy(value){stringAttribute.set(this,"referrerpolicy",value)}get nonce(){return stringAttribute.get(this,"nonce")}set nonce(value){stringAttribute.set(this,"nonce",value)}get async(){return booleanAttribute.get(this,"async")}set async(value){booleanAttribute.set(this,"async",value)}get text(){return this.textContent}set text(content){this.textContent=content}}registerHTMLClass(tagName2,HTMLScriptElement);class HTMLFrameElement extends HTMLElement{constructor(ownerDocument,localName="frame"){super(ownerDocument,localName)}}var tagName3="iframe";class HTMLIFrameElement extends HTMLElement{constructor(ownerDocument,localName=tagName3){super(ownerDocument,localName)}get src(){return stringAttribute.get(this,"src")}set src(value){stringAttribute.set(this,"src",value)}get srcdoc(){return stringAttribute.get(this,"srcdoc")}set srcdoc(value){stringAttribute.set(this,"srcdoc",value)}get name(){return stringAttribute.get(this,"name")}set name(value){stringAttribute.set(this,"name",value)}get allow(){return stringAttribute.get(this,"allow")}set allow(value){stringAttribute.set(this,"allow",value)}get allowFullscreen(){return booleanAttribute.get(this,"allowfullscreen")}set allowFullscreen(value){booleanAttribute.set(this,"allowfullscreen",value)}get referrerPolicy(){return stringAttribute.get(this,"referrerpolicy")}set referrerPolicy(value){stringAttribute.set(this,"referrerpolicy",value)}get loading(){return stringAttribute.get(this,"loading")}set loading(value){stringAttribute.set(this,"loading",value)}}registerHTMLClass(tagName3,HTMLIFrameElement);class HTMLObjectElement extends HTMLElement{constructor(ownerDocument,localName="object"){super(ownerDocument,localName)}}class HTMLHeadElement extends HTMLElement{constructor(ownerDocument,localName="head"){super(ownerDocument,localName)}}class HTMLBodyElement extends HTMLElement{constructor(ownerDocument,localName="body"){super(ownerDocument,localName)}}var $setup=require_CSSOM().setup;require_errorUtils();require_regexPatterns();var $CSSStyleDeclaration=require_CSSStyleDeclaration().CSSStyleDeclaration;require_cssstyleTryCatchBlock();var $CSSRule=require_CSSRule().CSSRule,$CSSRuleList=require_CSSRuleList().CSSRuleList,$CSSNestedDeclarations=require_CSSNestedDeclarations().CSSNestedDeclarations,$CSSGroupingRule=require_CSSGroupingRule().CSSGroupingRule,$CSSCounterStyleRule=require_CSSCounterStyleRule().CSSCounterStyleRule,$CSSPropertyRule=require_CSSPropertyRule().CSSPropertyRule,$CSSConditionRule=require_CSSConditionRule().CSSConditionRule,$CSSStyleRule=require_CSSStyleRule().CSSStyleRule,$MediaList=require_MediaList().MediaList,$CSSMediaRule=require_CSSMediaRule().CSSMediaRule,$CSSContainerRule=require_CSSContainerRule().CSSContainerRule,$CSSSupportsRule=require_CSSSupportsRule().CSSSupportsRule,$CSSImportRule=require_CSSImportRule().CSSImportRule,$CSSNamespaceRule=require_CSSNamespaceRule().CSSNamespaceRule,$CSSFontFaceRule=require_CSSFontFaceRule().CSSFontFaceRule,$CSSHostRule=require_CSSHostRule().CSSHostRule,$CSSStartingStyleRule=require_CSSStartingStyleRule().CSSStartingStyleRule,$StyleSheet=require_StyleSheet().StyleSheet,$CSSStyleSheet=require_CSSStyleSheet().CSSStyleSheet,$CSSKeyframesRule=require_CSSKeyframesRule().CSSKeyframesRule,$CSSKeyframeRule=require_CSSKeyframeRule().CSSKeyframeRule,$MatcherList=require_MatcherList().MatcherList,$CSSDocumentRule=require_CSSDocumentRule().CSSDocumentRule,$CSSValue=require_CSSValue().CSSValue,$CSSValueExpression=require_CSSValueExpression().CSSValueExpression,$CSSScopeRule=require_CSSScopeRule().CSSScopeRule,$CSSLayerBlockRule=require_CSSLayerBlockRule().CSSLayerBlockRule,$CSSLayerStatementRule=require_CSSLayerStatementRule().CSSLayerStatementRule,$CSSPageRule=require_CSSPageRule().CSSPageRule,$parse=require_parse().parse,$clone=require_clone().clone;var tagName4="style";class HTMLStyleElement extends TextElement{constructor(ownerDocument,localName=tagName4){super(ownerDocument,localName);this[SHEET]=null}get sheet(){let sheet=this[SHEET];if(sheet!==null)return sheet;return this[SHEET]=$parse(this.textContent)}get innerHTML(){return super.innerHTML||""}set innerHTML(value){super.textContent=value,this[SHEET]=null}get innerText(){return super.innerText||""}set innerText(value){super.textContent=value,this[SHEET]=null}get textContent(){return super.textContent||""}set textContent(value){super.textContent=value,this[SHEET]=null}}registerHTMLClass(tagName4,HTMLStyleElement);class HTMLTimeElement extends HTMLElement{constructor(ownerDocument,localName="time"){super(ownerDocument,localName)}get dateTime(){return stringAttribute.get(this,"datetime")}set dateTime(value){stringAttribute.set(this,"datetime",value)}}registerHTMLClass("time",HTMLTimeElement);class HTMLFieldSetElement extends HTMLElement{constructor(ownerDocument,localName="fieldset"){super(ownerDocument,localName)}}class HTMLEmbedElement extends HTMLElement{constructor(ownerDocument,localName="embed"){super(ownerDocument,localName)}}class HTMLHRElement extends HTMLElement{constructor(ownerDocument,localName="hr"){super(ownerDocument,localName)}}class HTMLProgressElement extends HTMLElement{constructor(ownerDocument,localName="progress"){super(ownerDocument,localName)}}class HTMLParagraphElement extends HTMLElement{constructor(ownerDocument,localName="p"){super(ownerDocument,localName)}}class HTMLTableElement extends HTMLElement{constructor(ownerDocument,localName="table"){super(ownerDocument,localName)}}class HTMLFrameSetElement extends HTMLElement{constructor(ownerDocument,localName="frameset"){super(ownerDocument,localName)}}class HTMLLIElement extends HTMLElement{constructor(ownerDocument,localName="li"){super(ownerDocument,localName)}}class HTMLBaseElement extends HTMLElement{constructor(ownerDocument,localName="base"){super(ownerDocument,localName)}}class HTMLDataListElement extends HTMLElement{constructor(ownerDocument,localName="datalist"){super(ownerDocument,localName)}}var tagName5="input";class HTMLInputElement extends HTMLElement{constructor(ownerDocument,localName=tagName5){super(ownerDocument,localName)}get autofocus(){return booleanAttribute.get(this,"autofocus")||-1}set autofocus(value){booleanAttribute.set(this,"autofocus",value)}get disabled(){return booleanAttribute.get(this,"disabled")}set disabled(value){booleanAttribute.set(this,"disabled",value)}get name(){return this.getAttribute("name")}set name(value){this.setAttribute("name",value)}get placeholder(){return this.getAttribute("placeholder")}set placeholder(value){this.setAttribute("placeholder",value)}get type(){return this.getAttribute("type")}set type(value){this.setAttribute("type",value)}get value(){return stringAttribute.get(this,"value")}set value(value){stringAttribute.set(this,"value",value)}}registerHTMLClass(tagName5,HTMLInputElement);class HTMLParamElement extends HTMLElement{constructor(ownerDocument,localName="param"){super(ownerDocument,localName)}}class HTMLMediaElement extends HTMLElement{constructor(ownerDocument,localName="media"){super(ownerDocument,localName)}}class HTMLAudioElement extends HTMLElement{constructor(ownerDocument,localName="audio"){super(ownerDocument,localName)}}var tagName6="h1";class HTMLHeadingElement extends HTMLElement{constructor(ownerDocument,localName=tagName6){super(ownerDocument,localName)}}registerHTMLClass([tagName6,"h2","h3","h4","h5","h6"],HTMLHeadingElement);class HTMLDirectoryElement extends HTMLElement{constructor(ownerDocument,localName="dir"){super(ownerDocument,localName)}}class HTMLQuoteElement extends HTMLElement{constructor(ownerDocument,localName="quote"){super(ownerDocument,localName)}}var import_canvas=__toESM(require_canvas(),1);var{createCanvas}=import_canvas.default,tagName7="canvas";class HTMLCanvasElement extends HTMLElement{constructor(ownerDocument,localName=tagName7){super(ownerDocument,localName);this[IMAGE]=createCanvas(300,150)}get width(){return this[IMAGE].width}set width(value){numericAttribute.set(this,"width",value),this[IMAGE].width=value}get height(){return this[IMAGE].height}set height(value){numericAttribute.set(this,"height",value),this[IMAGE].height=value}getContext(type){return this[IMAGE].getContext(type)}toDataURL(...args){return this[IMAGE].toDataURL(...args)}}registerHTMLClass(tagName7,HTMLCanvasElement);class HTMLLegendElement extends HTMLElement{constructor(ownerDocument,localName="legend"){super(ownerDocument,localName)}}var tagName8="option";class HTMLOptionElement extends HTMLElement{constructor(ownerDocument,localName=tagName8){super(ownerDocument,localName)}get value(){return stringAttribute.get(this,"value")}set value(value){stringAttribute.set(this,"value",value)}get selected(){return booleanAttribute.get(this,"selected")}set selected(value){let option=this.parentElement?.querySelector("option[selected]");if(option&&option!==this)option.selected=!1;booleanAttribute.set(this,"selected",value)}}registerHTMLClass(tagName8,HTMLOptionElement);class HTMLSpanElement extends HTMLElement{constructor(ownerDocument,localName="span"){super(ownerDocument,localName)}}class HTMLMeterElement extends HTMLElement{constructor(ownerDocument,localName="meter"){super(ownerDocument,localName)}}class HTMLVideoElement extends HTMLElement{constructor(ownerDocument,localName="video"){super(ownerDocument,localName)}}class HTMLTableCellElement extends HTMLElement{constructor(ownerDocument,localName="td"){super(ownerDocument,localName)}}var tagName9="title";class HTMLTitleElement extends TextElement{constructor(ownerDocument,localName=tagName9){super(ownerDocument,localName)}}registerHTMLClass(tagName9,HTMLTitleElement);class HTMLOutputElement extends HTMLElement{constructor(ownerDocument,localName="output"){super(ownerDocument,localName)}}class HTMLTableRowElement extends HTMLElement{constructor(ownerDocument,localName="tr"){super(ownerDocument,localName)}}class HTMLDataElement extends HTMLElement{constructor(ownerDocument,localName="data"){super(ownerDocument,localName)}}class HTMLMenuElement extends HTMLElement{constructor(ownerDocument,localName="menu"){super(ownerDocument,localName)}}var tagName10="select";class HTMLSelectElement extends HTMLElement{constructor(ownerDocument,localName=tagName10){super(ownerDocument,localName)}get options(){let children=new NodeList,{firstElementChild}=this;while(firstElementChild){if(firstElementChild.tagName==="OPTGROUP")children.push(...firstElementChild.children);else children.push(firstElementChild);firstElementChild=firstElementChild.nextElementSibling}return children}get disabled(){return booleanAttribute.get(this,"disabled")}set disabled(value){booleanAttribute.set(this,"disabled",value)}get name(){return this.getAttribute("name")}set name(value){this.setAttribute("name",value)}get value(){return this.querySelector("option[selected]")?.value}}registerHTMLClass(tagName10,HTMLSelectElement);class HTMLBRElement extends HTMLElement{constructor(ownerDocument,localName="br"){super(ownerDocument,localName)}}var tagName11="button";class HTMLButtonElement extends HTMLElement{constructor(ownerDocument,localName=tagName11){super(ownerDocument,localName)}get disabled(){return booleanAttribute.get(this,"disabled")}set disabled(value){booleanAttribute.set(this,"disabled",value)}get name(){return this.getAttribute("name")}set name(value){this.setAttribute("name",value)}get type(){return this.getAttribute("type")}set type(value){this.setAttribute("type",value)}}registerHTMLClass(tagName11,HTMLButtonElement);class HTMLMapElement extends HTMLElement{constructor(ownerDocument,localName="map"){super(ownerDocument,localName)}}class HTMLOptGroupElement extends HTMLElement{constructor(ownerDocument,localName="optgroup"){super(ownerDocument,localName)}}class HTMLDListElement extends HTMLElement{constructor(ownerDocument,localName="dl"){super(ownerDocument,localName)}}var tagName12="textarea";class HTMLTextAreaElement extends TextElement{constructor(ownerDocument,localName=tagName12){super(ownerDocument,localName)}get disabled(){return booleanAttribute.get(this,"disabled")}set disabled(value){booleanAttribute.set(this,"disabled",value)}get name(){return this.getAttribute("name")}set name(value){this.setAttribute("name",value)}get placeholder(){return this.getAttribute("placeholder")}set placeholder(value){this.setAttribute("placeholder",value)}get type(){return this.getAttribute("type")}set type(value){this.setAttribute("type",value)}get value(){return this.textContent}set value(content){this.textContent=content}}registerHTMLClass(tagName12,HTMLTextAreaElement);class HTMLFontElement extends HTMLElement{constructor(ownerDocument,localName="font"){super(ownerDocument,localName)}}class HTMLDivElement extends HTMLElement{constructor(ownerDocument,localName="div"){super(ownerDocument,localName)}}var tagName13="link";class HTMLLinkElement extends HTMLElement{constructor(ownerDocument,localName=tagName13){super(ownerDocument,localName)}get disabled(){return booleanAttribute.get(this,"disabled")}set disabled(value){booleanAttribute.set(this,"disabled",value)}get href(){return stringAttribute.get(this,"href").trim()}set href(value){stringAttribute.set(this,"href",value)}get hreflang(){return stringAttribute.get(this,"hreflang")}set hreflang(value){stringAttribute.set(this,"hreflang",value)}get media(){return stringAttribute.get(this,"media")}set media(value){stringAttribute.set(this,"media",value)}get rel(){return stringAttribute.get(this,"rel")}set rel(value){stringAttribute.set(this,"rel",value)}get type(){return stringAttribute.get(this,"type")}set type(value){stringAttribute.set(this,"type",value)}}registerHTMLClass(tagName13,HTMLLinkElement);var tagName14="slot";class HTMLSlotElement extends HTMLElement{constructor(ownerDocument,localName=tagName14){super(ownerDocument,localName)}get name(){return this.getAttribute("name")}set name(value){this.setAttribute("name",value)}assign(){}assignedNodes(options){let isNamedSlot=!!this.name,hostChildNodes=this.getRootNode().host?.childNodes??[],slottables;if(isNamedSlot)slottables=[...hostChildNodes].filter((node)=>node.slot===this.name);else slottables=[...hostChildNodes].filter((node)=>!node.slot);if(options?.flatten){let result=[];for(let slottable of slottables)if(slottable.localName==="slot")result.push(...slottable.assignedNodes({flatten:!0}));else result.push(slottable);slottables=result}return slottables.length?slottables:[...this.childNodes]}assignedElements(options){let slottables=this.assignedNodes(options).filter((n)=>n.nodeType===1);return slottables.length?slottables:[...this.children]}}registerHTMLClass(tagName14,HTMLSlotElement);class HTMLFormElement extends HTMLElement{constructor(ownerDocument,localName="form"){super(ownerDocument,localName)}}var tagName15="img";class HTMLImageElement extends HTMLElement{constructor(ownerDocument,localName=tagName15){super(ownerDocument,localName)}get alt(){return stringAttribute.get(this,"alt")}set alt(value){stringAttribute.set(this,"alt",value)}get sizes(){return stringAttribute.get(this,"sizes")}set sizes(value){stringAttribute.set(this,"sizes",value)}get src(){return stringAttribute.get(this,"src")}set src(value){stringAttribute.set(this,"src",value)}get srcset(){return stringAttribute.get(this,"srcset")}set srcset(value){stringAttribute.set(this,"srcset",value)}get title(){return stringAttribute.get(this,"title")}set title(value){stringAttribute.set(this,"title",value)}get width(){return numericAttribute.get(this,"width")}set width(value){numericAttribute.set(this,"width",value)}get height(){return numericAttribute.get(this,"height")}set height(value){numericAttribute.set(this,"height",value)}}registerHTMLClass(tagName15,HTMLImageElement);class HTMLPreElement extends HTMLElement{constructor(ownerDocument,localName="pre"){super(ownerDocument,localName)}}class HTMLUListElement extends HTMLElement{constructor(ownerDocument,localName="ul"){super(ownerDocument,localName)}}var tagName16="meta";class HTMLMetaElement extends HTMLElement{constructor(ownerDocument,localName=tagName16){super(ownerDocument,localName)}get name(){return stringAttribute.get(this,"name")}set name(value){stringAttribute.set(this,"name",value)}get httpEquiv(){return stringAttribute.get(this,"http-equiv")}set httpEquiv(value){stringAttribute.set(this,"http-equiv",value)}get content(){return stringAttribute.get(this,"content")}set content(value){stringAttribute.set(this,"content",value)}get charset(){return stringAttribute.get(this,"charset")}set charset(value){stringAttribute.set(this,"charset",value)}get media(){return stringAttribute.get(this,"media")}set media(value){stringAttribute.set(this,"media",value)}}registerHTMLClass(tagName16,HTMLMetaElement);class HTMLPictureElement extends HTMLElement{constructor(ownerDocument,localName="picture"){super(ownerDocument,localName)}}class HTMLAreaElement extends HTMLElement{constructor(ownerDocument,localName="area"){super(ownerDocument,localName)}}class HTMLOListElement extends HTMLElement{constructor(ownerDocument,localName="ol"){super(ownerDocument,localName)}}class HTMLTableCaptionElement extends HTMLElement{constructor(ownerDocument,localName="caption"){super(ownerDocument,localName)}}var tagName17="a";class HTMLAnchorElement extends HTMLElement{constructor(ownerDocument,localName=tagName17){super(ownerDocument,localName)}get href(){return encodeURI(decodeURI(stringAttribute.get(this,"href"))).trim()}set href(value){stringAttribute.set(this,"href",decodeURI(value))}get download(){return encodeURI(decodeURI(stringAttribute.get(this,"download")))}set download(value){stringAttribute.set(this,"download",decodeURI(value))}get target(){return stringAttribute.get(this,"target")}set target(value){stringAttribute.set(this,"target",value)}get type(){return stringAttribute.get(this,"type")}set type(value){stringAttribute.set(this,"type",value)}get rel(){return stringAttribute.get(this,"rel")}set rel(value){stringAttribute.set(this,"rel",value)}}registerHTMLClass(tagName17,HTMLAnchorElement);class HTMLLabelElement extends HTMLElement{constructor(ownerDocument,localName="label"){super(ownerDocument,localName)}}class HTMLUnknownElement extends HTMLElement{constructor(ownerDocument,localName="unknown"){super(ownerDocument,localName)}}class HTMLModElement extends HTMLElement{constructor(ownerDocument,localName="mod"){super(ownerDocument,localName)}}class HTMLDetailsElement extends HTMLElement{constructor(ownerDocument,localName="details"){super(ownerDocument,localName)}}var tagName18="source";class HTMLSourceElement extends HTMLElement{constructor(ownerDocument,localName=tagName18){super(ownerDocument,localName)}get src(){return stringAttribute.get(this,"src")}set src(value){stringAttribute.set(this,"src",value)}get srcset(){return stringAttribute.get(this,"srcset")}set srcset(value){stringAttribute.set(this,"srcset",value)}get sizes(){return stringAttribute.get(this,"sizes")}set sizes(value){stringAttribute.set(this,"sizes",value)}get type(){return stringAttribute.get(this,"type")}set type(value){stringAttribute.set(this,"type",value)}}registerHTMLClass(tagName18,HTMLSourceElement);class HTMLTrackElement extends HTMLElement{constructor(ownerDocument,localName="track"){super(ownerDocument,localName)}}class HTMLMarqueeElement extends HTMLElement{constructor(ownerDocument,localName="marquee"){super(ownerDocument,localName)}}var HTMLClasses={HTMLElement,HTMLTemplateElement,HTMLHtmlElement,HTMLScriptElement,HTMLFrameElement,HTMLIFrameElement,HTMLObjectElement,HTMLHeadElement,HTMLBodyElement,HTMLStyleElement,HTMLTimeElement,HTMLFieldSetElement,HTMLEmbedElement,HTMLHRElement,HTMLProgressElement,HTMLParagraphElement,HTMLTableElement,HTMLFrameSetElement,HTMLLIElement,HTMLBaseElement,HTMLDataListElement,HTMLInputElement,HTMLParamElement,HTMLMediaElement,HTMLAudioElement,HTMLHeadingElement,HTMLDirectoryElement,HTMLQuoteElement,HTMLCanvasElement,HTMLLegendElement,HTMLOptionElement,HTMLSpanElement,HTMLMeterElement,HTMLVideoElement,HTMLTableCellElement,HTMLTitleElement,HTMLOutputElement,HTMLTableRowElement,HTMLDataElement,HTMLMenuElement,HTMLSelectElement,HTMLBRElement,HTMLButtonElement,HTMLMapElement,HTMLOptGroupElement,HTMLDListElement,HTMLTextAreaElement,HTMLFontElement,HTMLDivElement,HTMLLinkElement,HTMLSlotElement,HTMLFormElement,HTMLImageElement,HTMLPreElement,HTMLUListElement,HTMLMetaElement,HTMLPictureElement,HTMLAreaElement,HTMLOListElement,HTMLTableCaptionElement,HTMLAnchorElement,HTMLLabelElement,HTMLUnknownElement,HTMLModElement,HTMLDetailsElement,HTMLSourceElement,HTMLTrackElement,HTMLMarqueeElement};var voidElements3={test:()=>!0},Mime={"text/html":{docType:"<!DOCTYPE html>",ignoreCase:!0,voidElements:/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i},"image/svg+xml":{docType:'<?xml version="1.0" encoding="utf-8"?>',ignoreCase:!1,voidElements:voidElements3},"text/xml":{docType:'<?xml version="1.0" encoding="utf-8"?>',ignoreCase:!1,voidElements:voidElements3},"application/xml":{docType:'<?xml version="1.0" encoding="utf-8"?>',ignoreCase:!1,voidElements:voidElements3},"application/xhtml+xml":{docType:'<?xml version="1.0" encoding="utf-8"?>',ignoreCase:!1,voidElements:voidElements3}};class CustomEvent extends GlobalEvent{constructor(type,eventInitDict={}){super(type,eventInitDict);this.detail=eventInitDict.detail}}class InputEvent extends GlobalEvent{constructor(type,inputEventInit={}){super(type,inputEventInit);this.inputType=inputEventInit.inputType,this.data=inputEventInit.data,this.dataTransfer=inputEventInit.dataTransfer,this.isComposing=inputEventInit.isComposing||!1,this.ranges=inputEventInit.ranges}}var ImageClass=(ownerDocument)=>class extends HTMLImageElement{constructor(width,height){super(ownerDocument);switch(arguments.length){case 1:this.height=width,this.width=width;break;case 2:this.height=height,this.width=width;break}}};var deleteContents=({[START]:start,[END]:end},fragment=null)=>{setAdjacent(start[PREV],end[NEXT]);do{let after=getEnd(start),next=after===end?after:after[NEXT];if(fragment)fragment.insertBefore(start,fragment[END]);else start.remove();start=next}while(start!==end)};class Range{constructor(){this[START]=null,this[END]=null,this.commonAncestorContainer=null}insertNode(newNode){this[END].parentNode.insertBefore(newNode,this[START])}selectNode(node){this[START]=node,this[END]=getEnd(node)}selectNodeContents(node){this.selectNode(node),this.commonAncestorContainer=node}surroundContents(parentNode){parentNode.replaceChildren(this.extractContents())}setStartBefore(node){this[START]=node}setStartAfter(node){this[START]=node.nextSibling}setEndBefore(node){this[END]=getEnd(node.previousSibling)}setEndAfter(node){this[END]=getEnd(node)}cloneContents(){let{[START]:start,[END]:end}=this,fragment=start.ownerDocument.createDocumentFragment();while(start!==end)if(fragment.insertBefore(start.cloneNode(!0),fragment[END]),start=getEnd(start),start!==end)start=start[NEXT];return fragment}deleteContents(){deleteContents(this)}extractContents(){let fragment=this[START].ownerDocument.createDocumentFragment();return deleteContents(this,fragment),fragment}createContextualFragment(html){let{commonAncestorContainer:doc}=this,isSVG="ownerSVGElement"in doc,document=isSVG?doc.ownerDocument:doc,content=htmlToFragment(document,html);if(isSVG){let childNodes=[...content.childNodes];content=document.createDocumentFragment(),Object.setPrototypeOf(content,SVGElement.prototype),content.ownerSVGElement=document;for(let child of childNodes)Object.setPrototypeOf(child,SVGElement.prototype),child.ownerSVGElement=document,content.appendChild(child)}else this.selectNode(content);return content}cloneRange(){let range=new Range;return range[START]=this[START],range[END]=this[END],range}}var isOK=({nodeType},mask)=>{switch(nodeType){case ELEMENT_NODE:return mask&SHOW_ELEMENT;case TEXT_NODE:return mask&SHOW_TEXT;case COMMENT_NODE:return mask&SHOW_COMMENT;case CDATA_SECTION_NODE:return mask&SHOW_CDATA_SECTION}return 0};class TreeWalker{constructor(root,whatToShow=SHOW_ALL){this.root=root,this.currentNode=root,this.whatToShow=whatToShow;let{[NEXT]:next,[END]:end}=root;if(root.nodeType===DOCUMENT_NODE){let{documentElement}=root;next=documentElement,end=documentElement[END]}let nodes=[];while(next&&next!==end){if(isOK(next,whatToShow))nodes.push(next);next=next[NEXT]}this[PRIVATE]={i:0,nodes}}nextNode(){let $=this[PRIVATE];return this.currentNode=$.i<$.nodes.length?$.nodes[$.i++]:null,this.currentNode}}var query=(method,ownerDocument,selectors)=>{let{[NEXT]:next,[END]:end}=ownerDocument;return method.call({ownerDocument,[NEXT]:next,[END]:end},selectors)},globalExports=assign({},Facades,HTMLClasses,{CustomEvent,Event:GlobalEvent,EventTarget:DOMEventTarget,InputEvent,NamedNodeMap,NodeList}),window2=new WeakMap;class Document2 extends NonElementParentNode{constructor(type){super(null,"#document",DOCUMENT_NODE);this[CUSTOM_ELEMENTS]={active:!1,registry:null},this[MUTATION_OBSERVER]={active:!1,class:null},this[MIME]=Mime[type],this[DOCTYPE]=null,this[DOM_PARSER]=null,this[GLOBALS]=null,this[IMAGE]=null,this[UPGRADE]=null}get defaultView(){if(!window2.has(this))window2.set(this,new Proxy(globalThis,{set:(target,name,value)=>{switch(name){case"addEventListener":case"removeEventListener":case"dispatchEvent":this[EVENT_TARGET][name]=value;break;default:target[name]=value;break}return!0},get:(globalThis2,name)=>{switch(name){case"addEventListener":case"removeEventListener":case"dispatchEvent":if(!this[EVENT_TARGET]){let et=this[EVENT_TARGET]=new DOMEventTarget;et.dispatchEvent=et.dispatchEvent.bind(et),et.addEventListener=et.addEventListener.bind(et),et.removeEventListener=et.removeEventListener.bind(et)}return this[EVENT_TARGET][name];case"document":return this;case"navigator":return{userAgent:"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36"};case"window":return window2.get(this);case"customElements":if(!this[CUSTOM_ELEMENTS].registry)this[CUSTOM_ELEMENTS]=new CustomElementRegistry(this);return this[CUSTOM_ELEMENTS];case"performance":return globalThis2.performance;case"DOMParser":return this[DOM_PARSER];case"Image":if(!this[IMAGE])this[IMAGE]=ImageClass(this);return this[IMAGE];case"MutationObserver":if(!this[MUTATION_OBSERVER].class)this[MUTATION_OBSERVER]=new MutationObserverClass(this);return this[MUTATION_OBSERVER].class}return this[GLOBALS]&&this[GLOBALS][name]||globalExports[name]||globalThis2[name]}}));return window2.get(this)}get doctype(){let docType=this[DOCTYPE];if(docType)return docType;let{firstChild}=this;if(firstChild&&firstChild.nodeType===DOCUMENT_TYPE_NODE)return this[DOCTYPE]=firstChild;return null}set doctype(value){if(/^([a-z:]+)(\s+system|\s+public(\s+"([^"]+)")?)?(\s+"([^"]+)")?/i.test(value)){let{$1:name,$4:publicId,$6:systemId}=RegExp;this[DOCTYPE]=new DocumentType(this,name,publicId,systemId),knownSiblings(this,this[DOCTYPE],this[NEXT])}}get documentElement(){return this.firstElementChild}get isConnected(){return!0}_getParent(){return this[EVENT_TARGET]}createAttribute(name){return new Attr(this,name)}createCDATASection(data){return new CDATASection(this,data)}createComment(textContent){return new Comment3(this,textContent)}createDocumentFragment(){return new DocumentFragment(this)}createDocumentType(name,publicId,systemId){return new DocumentType(this,name,publicId,systemId)}createElement(localName){return new Element2(this,localName)}createRange(){let range=new Range;return range.commonAncestorContainer=this,range}createTextNode(textContent){return new Text6(this,textContent)}createTreeWalker(root,whatToShow=-1){return new TreeWalker(root,whatToShow)}createNodeIterator(root,whatToShow=-1){return this.createTreeWalker(root,whatToShow)}createEvent(name){let event=create(name==="Event"?new GlobalEvent(""):new CustomEvent(""));return event.initEvent=event.initCustomEvent=(type,canBubble=!1,cancelable=!1,detail)=>{event.bubbles=!!canBubble,defineProperties(event,{type:{value:type},canBubble:{value:canBubble},cancelable:{value:cancelable},detail:{value:detail}})},event}cloneNode(deep=!1){let{constructor,[CUSTOM_ELEMENTS]:customElements,[DOCTYPE]:doctype}=this,document=new constructor;if(document[CUSTOM_ELEMENTS]=customElements,deep){let end=document[END],{childNodes}=this;for(let{length}=childNodes,i=0;i<length;i++)document.insertBefore(childNodes[i].cloneNode(!0),end);if(doctype)document[DOCTYPE]=childNodes[0]}return document}importNode(externalNode){let deep=1<arguments.length&&!!arguments[1],node=externalNode.cloneNode(deep),{[CUSTOM_ELEMENTS]:customElements}=this,{active}=customElements,upgrade=(element)=>{let{ownerDocument,nodeType}=element;if(element.ownerDocument=this,active&&ownerDocument!==this&&nodeType===ELEMENT_NODE)customElements.upgrade(element)};if(upgrade(node),deep)switch(node.nodeType){case ELEMENT_NODE:case DOCUMENT_FRAGMENT_NODE:{let{[NEXT]:next,[END]:end}=node;while(next!==end){if(next.nodeType===ELEMENT_NODE)upgrade(next);next=next[NEXT]}break}}return node}toString(){return this.childNodes.join("")}querySelector(selectors){return query(super.querySelector,this,selectors)}querySelectorAll(selectors){return query(super.querySelectorAll,this,selectors)}getElementsByTagNameNS(_,name){return this.getElementsByTagName(name)}createAttributeNS(_,name){return this.createAttribute(name)}createElementNS(nsp,localName,options){return nsp===SVG_NAMESPACE?new SVGElement(this,localName,null):this.createElement(localName,options)}}setPrototypeOf(globalExports.Document=function(){illegalConstructor()},Document2).prototype=Document2.prototype;var createHTMLElement=(ownerDocument,builtin,localName,options)=>{if(!builtin&&htmlClasses.has(localName))return new(htmlClasses.get(localName))(ownerDocument,localName);let{[CUSTOM_ELEMENTS]:{active,registry}}=ownerDocument;if(active){let ce=builtin?options.is:localName;if(registry.has(ce)){let{Class}=registry.get(ce),element=new Class(ownerDocument,localName);return customElements.set(element,{connected:!1}),element}}return new HTMLElement(ownerDocument,localName)};class HTMLDocument extends Document2{constructor(){super("text/html")}get all(){let nodeList=new NodeList,{[NEXT]:next,[END]:end}=this;while(next!==end){switch(next.nodeType){case ELEMENT_NODE:nodeList.push(next);break}next=next[NEXT]}return nodeList}get head(){let{documentElement}=this,{firstElementChild}=documentElement;if(!firstElementChild||firstElementChild.tagName!=="HEAD")firstElementChild=this.createElement("head"),documentElement.prepend(firstElementChild);return firstElementChild}get body(){let{head}=this,{nextElementSibling}=head;if(!nextElementSibling||nextElementSibling.tagName!=="BODY")nextElementSibling=this.createElement("body"),head.after(nextElementSibling);return nextElementSibling}get title(){let{head}=this;return head.getElementsByTagName("title").at(0)?.textContent||""}set title(textContent){let{head}=this,title=head.getElementsByTagName("title").at(0);if(title)title.textContent=textContent;else head.insertBefore(this.createElement("title"),head.firstChild).textContent=textContent}createElement(localName,options){let builtin=!!(options&&options.is),element=createHTMLElement(this,builtin,localName,options);if(builtin)element.setAttribute("is",options.is);return element}}class SVGDocument extends Document2{constructor(){super("image/svg+xml")}toString(){return this[MIME].docType+super.toString()}}class XMLDocument extends Document2{constructor(){super("text/xml")}toString(){return this[MIME].docType+super.toString()}}class DOMParser{parseFromString(markupLanguage,mimeType,globals=null){let isHTML=!1,document;if(mimeType==="text/html")isHTML=!0,document=new HTMLDocument;else if(mimeType==="image/svg+xml")document=new SVGDocument;else document=new XMLDocument;if(document[DOM_PARSER]=DOMParser,globals)document[GLOBALS]=globals;if(isHTML&&markupLanguage==="...")markupLanguage="<!doctype html><html><head></head><body></body></html>";return markupLanguage?parseFromString(document,isHTML,markupLanguage):document}}var{parse:parse3}=JSON;var parseHTML=(html,globals=null)=>new DOMParser().parseFromString(html,"text/html",globals).defaultView;function Document3(){illegalConstructor()}setPrototypeOf(Document3,Document2).prototype=Document2.prototype;import{readdir,readFile,stat}from"node:fs/promises";import{join,relative,resolve}from"node:path";import{isNotationLanguage,renderBlock}from"./index.js";import{parseTabSource}from"./tab/index.js";import{lookupGuitarVoicing}from"./voicings/index.js";var QUOTE2=/^[ \t]{0,3}>[ \t]?/,OPENING=/^(`{3,}|~{3,})(.*)$/,LIST_MARKER=/^(?:[-*+]|\d{1,9}[.)])[ \t]+/;function unquote(line,depth){let rest=line;for(let i=0;i<depth;i++){let m=QUOTE2.exec(rest);if(!m)return null;rest=rest.slice(m[0].length)}return rest}var dedent=(line,indent)=>{let i=0;while(i<indent&&(line[i]===" "||line[i]==="\t"))i++;return line.slice(i)},columns=(lead)=>[...lead].reduce((n,c)=>n+(c==="\t"?4-n%4:1),0);function opensComment(line){if((line.split("%%").length-1)%2===1)return!0;let html=line.lastIndexOf("<!--");return html>=0&&!line.includes("-->",html+4)}var commentEnd=(line)=>(line.split("%%").length-1)%2===1?"%%":"-->";function parseMarkdown(text){let lines=text.replace(/^\uFEFF/,"").split(/\r\n|\r|\n/),i=0,frontMatter=null;if(lines[0]?.trimEnd()==="---"){let end=lines.findIndex((l,n)=>n>0&&/^(?:---|\.\.\.)\s*$/.test(l));if(end>0)frontMatter=lines.slice(1,end).join(`
|
|
52
|
+
`),i=end+1}let blocks=[],comment=null,inList=!1;for(;i<lines.length;i++){let line=lines[i];if(comment){let end=line.indexOf(comment);if(end<0)continue;if(comment=null,opensComment(line.slice(end+2)))comment=commentEnd(line.slice(end+2));continue}let rest=line,depth=0;for(let m=QUOTE2.exec(rest);m;m=QUOTE2.exec(rest))rest=rest.slice(m[0].length),depth++;let spaces=/^[ \t]*/.exec(rest)[0].length,marker=LIST_MARKER.exec(rest.slice(spaces))?.[0].length??0,indent=spaces+marker;if(marker)inList=!0;else if(rest.trim()&&columns(rest.slice(0,spaces))===0)inList=!1;let open=OPENING.exec(rest.slice(indent));if(!open){if(opensComment(rest))comment=commentEnd(rest);continue}if(!marker&&!inList&&columns(rest.slice(0,spaces))>3)continue;let fence=open[1],info=open[2];if(fence[0]==="`"&&info.includes("`"))continue;let body=[],start=i;for(i++;i<lines.length;i++){let inner=unquote(lines[i],depth);if(inner===null){i--;break}let close=/^[ \t]*(`{3,}|~{3,})[ \t]*$/.exec(inner);if(close&&close[1][0]===fence[0]&&close[1].length>=fence.length)break;body.push(dedent(inner,indent))}blocks.push({language:info.trim().split(/\s+/)[0]??"",line:start+1,source:body.join(`
|
|
53
|
+
`)})}return{frontMatter,blocks}}import{chordNoteSet,midiOf,nameOf,noteOf}from"./index.js";var classes=(el)=>(el.getAttribute("class")??"").split(/\s+/),has=(el,cls)=>classes(el).includes(cls),text=(el)=>el?.textContent?.trim()||null,int=(value)=>value===null?null:Number(value),marksOf=(el)=>classes(el).flatMap((c)=>c==="mn-char"?["characteristic"]:c==="mn-diff"?["different"]:[]);function spelled(name,midi){let octave=Math.floor(midi/12)-1;for(let o of[octave,octave-1,octave+1])if(midiOf(`${name}${o}`)===midi)return`${name}${o}`;return noteOf(midi)}var labelAfter=(el,cls)=>{let next=el.nextElementSibling;return next&&has(next,cls)?text(next):null};function guitarChord(svg){let chord=svg.getAttribute("data-mn-chord"),set=chord?chordNoteSet(chord):null,strings=[...svg.querySelectorAll("[data-mn-string]")].map((el)=>{let fret=int(el.getAttribute("data-mn-fret")),midi=int(el.getAttribute("data-midi")),name=midi===null?null:set?.members.find((m)=>m.chroma===midi%12)?.name??nameOf(midi,set?.preferFlats);return{string:Number(el.getAttribute("data-mn-string")),fret,note:name!==null&&midi!==null?spelled(name,midi):null,label:fret?labelAfter(el,"mn-dot-text"):null,root:has(el,"mn-root"),mark:has(el,"mn-anchor")?"anchor":has(el,"mn-guide")?"guide":null}}),base=parseInt(text(svg.querySelector(".mn-base-fret"))??"1",10),rows=svg.querySelectorAll("line.mn-fret, line.mn-nut").length-1,frets=strings.map((s)=>s.fret===null?"x":String(s.fret));return{type:"guitar-chord",title:text(svg.querySelector(".mn-title")),chord,frets:frets.join(frets.some((f)=>f.length>1)?"-":""),fretRange:[base,base+rows-1],strings}}function fretboard(svg){let range=(svg.getAttribute("data-mn-frets")??"0-0").split("-").map(Number),tuning=[...svg.querySelectorAll(".mn-string-name")].map((el)=>text(el)??"?"),dots=[...svg.querySelectorAll("circle[data-mn-string]")].map((el)=>({string:Number(el.getAttribute("data-mn-string")),fret:Number(el.getAttribute("data-mn-fret")),note:spelled(el.getAttribute("data-mn-note")??"",Number(el.getAttribute("data-midi"))),label:labelAfter(el,"mn-dot-text"),root:has(el,"mn-root"),marks:marksOf(el)})).sort((a,b)=>b.string-a.string||a.fret-b.fret),ghosts=[...svg.querySelectorAll("circle[data-mn-ghost-string]")].map((el)=>({string:Number(el.getAttribute("data-mn-ghost-string")),fret:Number(el.getAttribute("data-mn-fret")),note:spelled(el.getAttribute("data-mn-note")??"",Number(el.getAttribute("data-mn-pitch")))})).sort((a,b)=>b.string-a.string||a.fret-b.fret);return{type:"fretboard",title:text(svg.querySelector(".mn-title")),notes:svg.getAttribute("data-mn-set"),fretRange:[range[0]??0,range[1]??0],tuning:tuning.reverse(),dots,ghosts}}function keyboard(svg){let all=[...svg.querySelectorAll("rect[data-midi]")],midis=all.map((el)=>Number(el.getAttribute("data-midi"))),fingers=new Map([...svg.querySelectorAll(".mn-key-finger")].map((el)=>[Number(el.getAttribute("data-mn-key")),text(el)])),keys=all.filter((el)=>has(el,"mn-on")).map((el)=>{let midi=Number(el.getAttribute("data-midi"));return{midi,note:spelled(el.getAttribute("data-mn-note")??"",midi),label:labelAfter(el,"mn-key-label"),finger:fingers.get(midi)??null,root:has(el,"mn-root"),marks:marksOf(el)}}).sort((a,b)=>a.midi-b.midi).map(({midi:_,...key})=>key);return{type:"keyboard",title:text(svg.querySelector(".mn-title")),chord:svg.getAttribute("data-mn-chord"),notes:svg.getAttribute("data-mn-set"),keyRange:[noteOf(Math.min(...midis)),noteOf(Math.max(...midis))],keys,ghosts:all.filter((el)=>has(el,"mn-ghost")).map((el)=>{let midi=Number(el.getAttribute("data-midi"));return spelled(el.getAttribute("data-mn-note")??"",midi)})}}function chart(el){let chords=[];for(let c of el.querySelectorAll(".mn-chord")){let name=text(c);if(name&&!chords.includes(name))chords.push(name)}return{type:"chart",title:text(el.querySelector(".mn-chart-title")),chords,sections:[...el.querySelectorAll(".mn-section-label")].map((s)=>text(s)??"")}}function describeBlock(el){return[...el.querySelectorAll("svg.mn-svg, .mn-chart, .mn-cell.mn-error")].map((d)=>{if(has(d,"mn-error"))return{type:"error",message:(text(d.querySelector(".mn-error-message"))??"").replace(/^[a-z]+, /,"")};if(has(d,"mn-chart"))return chart(d);if(has(d,"mn-fretboard"))return fretboard(d);if(has(d,"mn-keyboard"))return keyboard(d);return guitarChord(d)})}var quoted=(s)=>s?`"${s}"`:null,listed=(parts)=>parts.filter(Boolean).join(", "),extra=(label,root,more=[])=>[label!==null?`"${label}"`:null,root?"root":null,...more].filter(Boolean).join(" ");function formatDiagram(d,n){let head=`${n}. `,pad=" ".repeat(head.length);switch(d.type){case"error":return[`${head}error: ${d.message}`];case"chart":return[`${head}${listed(["chart",quoted(d.title),d.sections.length>0&&`sections ${d.sections.join(", ")}`,`chords ${d.chords.join(" ")||"none"}`])}`];case"guitar-chord":{let strings=d.strings.map((s)=>`${s.string} ${s.fret===null?"x":[s.fret,s.note,extra(s.label,s.root,s.mark?[s.mark]:[])].filter((p)=>p!==null&&p!=="").join(" ")}`);return[`${head}${listed(["chord diagram",quoted(d.title),d.chord&&`chord ${d.chord}`,`frets ${d.fretRange[0]}-${d.fretRange[1]}`,d.frets])}`,`${pad}strings: ${strings.join(" | ")}`]}case"fretboard":{let lines=[`${head}${listed(["fretboard",quoted(d.title),d.notes,`frets ${d.fretRange[0]}-${d.fretRange[1]}`,`tuning ${d.tuning.join(" ")}`])}`],count=d.tuning.length;for(let string=count;string>=1;string--){let dots=d.dots.filter((dot)=>dot.string===string);if(!dots.length)continue;let name=d.tuning[count-string]??"?";lines.push(`${pad}string ${string} (${name}): ${dots.map((dot)=>[dot.fret,dot.note,extra(dot.label,dot.root,dot.marks)].filter((p)=>p!=="").join(" ")).join(", ")}`)}if(d.ghosts.length)lines.push(`${pad}ghosts (compared scale): ${d.ghosts.map((g)=>`string ${g.string} fret ${g.fret} ${g.note}`).join(", ")}`);return lines}case"keyboard":return[`${head}${listed(["keyboard",quoted(d.title),d.chord&&`chord ${d.chord}`,d.notes,`keys ${d.keyRange[0]}-${d.keyRange[1]}`])}`,`${pad}keys: ${d.keys.map((k)=>[k.note,extra(k.label,k.root,[...k.finger?[`finger ${k.finger}`]:[],...k.marks])].filter(Boolean).join(" ")).join(", ")||"none"}`,...d.ghosts.length?[`${pad}ghosts (compared scale): ${d.ghosts.join(", ")}`]:[]]}}var DIAGRAM_LANGUAGES=["chord","keyboard","fretboard"],oneLine=(s)=>s.split(/[\r\n]+/).map((line)=>line.trim()).filter(Boolean).join(" ");function checkNote(file,text,doc){let note=parseMarkdown(text),reports=[];for(let block of note.blocks){let{language,line,source}=block,report=(status,message,diagrams=[])=>reports.push({file,line,language,status,message,diagrams}),isTab=language==="tab"||language==="score";if((isTab||isNotationLanguage(language))&&!source.trim()){if(note.frontMatter!==null&&DIAGRAM_LANGUAGES.includes(language))report("skipped","empty block: draws from the note's properties, not checked");else report("empty","empty block: draws nothing");continue}if(isTab){try{parseTabSource(language,source),report("skipped","alphaTex is not checked (it needs alphaTab)")}catch(e){report("error",oneLine(e instanceof Error?e.message:String(e)))}continue}if(!isNotationLanguage(language))continue;let host=doc.createElement("div"),result=renderBlock(language,source,host,{voicings:lookupGuitarVoicing}),diagrams=describeBlock(result.el);if(result.ok)report("ok",null,diagrams);else report("error",oneLine(result.error??"error"),diagrams);result.destroy()}return reports}function summarize(files,reports){let count=(status)=>reports.filter((r)=>r.status===status).length;return{files,blocks:reports.length,ok:count("ok"),errors:count("error"),skipped:count("skipped"),empty:count("empty")}}var formatError=(r)=>`${r.file}:${r.line}: ${r.language}: ${r.message}`;function formatReport(r){let where=`${r.file}:${r.line}: ${r.language}`;return r.status==="ok"?`${where}: ok`:`${where}: ${r.status}: ${r.message??""}`}function formatDescription(r){return[formatReport(r),...r.diagrams.flatMap((d,i)=>formatDiagram(d,i+1)).map((l)=>` ${l}`)]}var GLOB=/[*?[{]/;function globToRegExp(pattern){let out="";for(let i=0;i<pattern.length;i++){let c=pattern[i];if(c==="*"&&pattern[i+1]==="*"){let slash=pattern[i+2]==="/";out+=slash?"(?:.*/)?":".*",i+=slash?2:1}else if(c==="*")out+="[^/]*";else if(c==="?")out+="[^/]";else if(c==="{"){let end=pattern.indexOf("}",i);if(end<0)out+="\\{";else out+=`(?:${pattern.slice(i+1,end).split(",").map((p)=>p.replace(/[.+^$()|\\]/g,"\\$&").replace(/\*/g,"[^/]*")).join("|")})`,i=end}else if(c==="["){let end=pattern.indexOf("]",i+1);if(end<0)out+="\\[";else out+=`[${pattern.slice(i+1,end).replace(/^!/,"^").replace(/\\/g,"\\\\")}]`,i=end}else out+=c.replace(/[.+^$()|\\\]}]/g,"\\$&")}return new RegExp(`^${out}$`)}async function walk(dir){let entries=await readdir(dir,{withFileTypes:!0}),files=[];for(let entry of entries.sort((a,b)=>a.name.localeCompare(b.name))){let path=join(dir,entry.name);if(entry.isDirectory()){if(!entry.name.startsWith(".")&&entry.name!=="node_modules")files.push(...await walk(path))}else if(entry.isFile())files.push(path)}return files}var isMarkdown=(path)=>/\.(md|markdown)$/i.test(path);async function expand(arg,cwd){let pattern=arg.replace(/\\/g,"/"),path=resolve(cwd,arg),info=await stat(path).catch(()=>null);if(info)return info.isDirectory()?(await walk(path)).filter(isMarkdown):[path];if(!GLOB.test(pattern))throw Error(`${arg}: no such file or folder`);let segments=pattern.split("/"),first=segments.findIndex((s)=>GLOB.test(s)),base=resolve(cwd,segments.slice(0,first).join("/")||"."),matcher=globToRegExp(segments.slice(first).join("/"));if(!(await stat(base).catch(()=>null))?.isDirectory())return[];return(await walk(base)).filter((f)=>matcher.test(relative(base,f).replace(/\\/g,"/")))}var USAGE=`Usage: music-notation check [options] <files, folders or globs...>
|
|
54
|
+
|
|
55
|
+
Renders every chord, chords, keyboard and fretboard block of Markdown files
|
|
56
|
+
and reports each mistake as file:line: language: message.
|
|
57
|
+
|
|
58
|
+
Options:
|
|
59
|
+
--describe also print what each block draws (titles, chords, notes, frets, keys)
|
|
60
|
+
--json print every block and what it draws as JSON
|
|
61
|
+
-h, --help show this help
|
|
62
|
+
--version show the version
|
|
63
|
+
|
|
64
|
+
Exit code: 0 when every block renders, 1 when a block has a mistake,
|
|
65
|
+
2 when the command is wrong (unknown option, no file, a file not found).
|
|
66
|
+
Tab and score blocks only get their settings lines checked (alphaTex needs alphaTab).
|
|
67
|
+
Empty blocks in a note with properties are skipped: in Obsidian they draw from
|
|
68
|
+
the properties, which this check doesn't read.`;async function run(args,io){let usage=(message)=>(io.err(`music-notation: ${message}`),io.err(USAGE),2);if(args.includes("-h")||args.includes("--help"))return io.out(USAGE),0;if(args[0]==="--version")return io.out(io.version??"unknown"),0;let[command,...rest]=args;if(command!=="check")return usage(command?`unknown command "${command}"`:"no command");let end=rest.indexOf("--"),flags=end<0?rest:rest.slice(0,end),options=flags.filter((a)=>a.startsWith("-")),unknown=options.find((o)=>o!=="--describe"&&o!=="--json");if(unknown)return usage(`unknown option "${unknown}"`);let patterns=[...flags.filter((a)=>!a.startsWith("-")),...end<0?[]:rest.slice(end+1)];if(!patterns.length)return usage("give the Markdown files to check");let json=options.includes("--json"),describe=options.includes("--describe"),files=[];for(let pattern of patterns){let found;try{found=await expand(pattern,io.cwd)}catch(e){return usage(e instanceof Error?e.message:String(e))}if(!found.length)return usage(`${pattern}: no file matches`);for(let f of found)if(!files.includes(f))files.push(f)}let reports=[];for(let path of files){let text;try{text=await readFile(path,"utf8")}catch(e){return usage(`${relative(io.cwd,path)}: ${e instanceof Error?e.message:String(e)}`)}let inside=relative(io.cwd,path),file=(inside&&!inside.startsWith("..")?inside:path).replace(/\\/g,"/"),found=checkNote(file,text,io.doc);if(reports.push(...found),json)continue;for(let r of found)if(describe)for(let line of formatDescription(r))io.out(line);else if(r.status==="error")io.out(formatError(r))}let summary=summarize(files.length,reports);if(json)io.out(JSON.stringify({ok:summary.errors===0,summary,blocks:reports},null,2));else io.err(`${summary.files} ${summary.files===1?"file":"files"}, ${summary.blocks} blocks: ${summary.ok} ok, ${summary.errors} with errors, ${summary.skipped} skipped, ${summary.empty} empty`);return summary.errors?1:0}function version(){try{let text=readFileSync(new URL("../package.json",import.meta.url),"utf8");return JSON.parse(text).version}catch{return}}process.stdout.on("error",(error)=>{if(error.code==="EPIPE")process.exit(process.exitCode??0);throw error});var{document}=parseHTML("<!doctype html><html><head></head><body></body></html>");process.exitCode=await run(process.argv.slice(2),{cwd:process.cwd(),out:(line)=>process.stdout.write(`${line}
|
|
69
|
+
`),err:(line)=>process.stderr.write(`${line}
|
|
70
|
+
`),doc:document,version:version()});
|