@mdfriday/foundry 26.2.1 → 26.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* @mdfriday/foundry - bundled and minified */
2
- var t,e,n,r,i,s,a,o=Object.create,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,h=Object.getOwnPropertyNames,u=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty,d=(t,e)=>function(){return t&&(e=(0,t[h(t)[0]])(t=0)),e},p=(t,e)=>{for(var n in e)l(t,n,{get:e[n],enumerable:!0})},g=(t,e,n,r)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let i of h(e))f.call(t,i)||i===n||l(t,i,{get:()=>e[i],enumerable:!(r=c(e,i))||r.enumerable});return t},m=(t,e,n)=>(n=null!=t?o(u(t)):{},g(!e&&t&&t.t?n:l(n,"default",{value:t,enumerable:!0}),t)),w=t=>g(l({},"__esModule",{value:!0}),t),y=d({"pkg/lang/data.ts"(){t=[{code:"en",name:"English",direction:"ltr",englishName:"English"},{code:"zh",name:"中文",direction:"ltr",englishName:"Chinese"},{code:"ja",name:"日本語",direction:"ltr",englishName:"Japanese"},{code:"ko",name:"한국어",direction:"ltr",englishName:"Korean"},{code:"fr",name:"Français",direction:"ltr",englishName:"French"},{code:"de",name:"Deutsch",direction:"ltr",englishName:"German"},{code:"es",name:"Español",direction:"ltr",englishName:"Spanish"},{code:"pt",name:"Português",direction:"ltr",englishName:"Portuguese"},{code:"ru",name:"Русский",direction:"ltr",englishName:"Russian"},{code:"hi",name:"हिंदी",direction:"ltr",englishName:"Hindi"},{code:"it",name:"Italiano",direction:"ltr",englishName:"Italian"},{code:"nl",name:"Nederlands",direction:"ltr",englishName:"Dutch"},{code:"tr",name:"Türkçe",direction:"ltr",englishName:"Turkish"},{code:"vi",name:"Tiếng Việt",direction:"ltr",englishName:"Vietnamese"},{code:"th",name:"ไทย",direction:"ltr",englishName:"Thai"}],e=[],n=[...t,...e],r=n.reduce((t,e)=>(t[e.code]=e,t),{}),i=n.reduce((t,e)=>(t[e.code]=e.name,t),{})}});function b(){return a||(a=new s),a}function v(){return new s}var E,k,S=d({"pkg/lang/service.ts"(){y(),s=class{getAllCodes(){return n.map(t=>t.code)}getAllNames(){return n.map(t=>t.name)}getCodesByDirection(n){return("ltr"===n?t:e).map(t=>t.code)}getNamesByDirection(n){return("ltr"===n?t:e).map(t=>t.name)}getCodeNameMap(){return{...i}}getCodeNameMapByDirection(n){return("ltr"===n?t:e).reduce((t,e)=>(t[e.code]=e.name,t),{})}getNameByCode(t){return r[t]?.name}getLanguageInfo(t){const e=r[t];return e?{...e}:void 0}isSupported(t){return t in r}getDirection(t){return r[t]?.direction}isLTR(t){return"ltr"===r[t]?.direction}isRTL(t){return"rtl"===r[t]?.direction}},a=null}}),T={};p(T,{ALL_LANGUAGES:()=>n,CODE_NAME_MAP:()=>i,DefaultLanguageService:()=>s,LANGUAGE_MAP:()=>r,LTR_LANGUAGES:()=>t,RTL_LANGUAGES:()=>e,createLanguageService:()=>v,getLanguageService:()=>b,lang:()=>E,languages:()=>k});var x,A,C,D=d({"pkg/lang/index.ts"(){y(),S(),S(),E=b(),k={getAllCodes:()=>E.getAllCodes(),getAllNames:()=>E.getAllNames(),getCodesByDirection:t=>E.getCodesByDirection(t),getNamesByDirection:t=>E.getNamesByDirection(t),getCodeNameMap:()=>E.getCodeNameMap(),getCodeNameMapByDirection:t=>E.getCodeNameMapByDirection(t),getNameByCode:t=>E.getNameByCode(t),getLanguageInfo:t=>E.getLanguageInfo(t),isSupported:t=>E.isSupported(t),getDirection:t=>E.getDirection(t),isLTR:t=>E.isLTR(t),isRTL:t=>E.isRTL(t)}}}),P=d({"pkg/log/types.ts"(){}}),L=d({"pkg/log/logger.ts"(){x=m(require("util")),P(),A=class t{config;fields;constructor(t){this.config={enableCaller:!0,jsonFormat:!0,...t},this.fields={}}shouldLog(t){const e=["debug","info","warn","error","fatal"],n=e.indexOf(this.config.level);return e.indexOf(t)>=n}getCaller(){if(!this.config.enableCaller)return;const t=(new Error).stack;if(!t)return;const e=t.split("\n")[4];if(!e)return;const n=e.match(/at .* \((.+):(\d+):(\d+)\)/);if(n){const[,t,e]=n;return`${t.split("/").pop()}:${e}`}const r=e.match(/at (.+):(\d+):(\d+)/);if(r){const[,t,e]=r;return`${t.split("/").pop()}:${e}`}}formatMessage(t,e){return 0===e.length?t:x.format(t,...e)}writeLog(t,e){if(!this.shouldLog(t))return;const n={level:t,timestamp:(new Date).toISOString(),message:e,...this.fields},r=this.getCaller();r&&(n.caller=r);const i=this.config.jsonFormat?JSON.stringify(n):this.formatPlainText(n);"error"===t||"fatal"===t?process.stderr.write(i+"\n"):process.stdout.write(i+"\n"),"fatal"===t&&process.exit(1)}formatPlainText(t){const e=[t.timestamp,t.level.toUpperCase()];t.caller&&e.push(`[${t.caller}]`),e.push(t.message);const n=Object.keys(t).filter(t=>!["level","timestamp","message","caller"].includes(t)).map(e=>`${e}=${JSON.stringify(t[e])}`).join(" ");return n&&e.push(n),e.join(" ")}debug(t,...e){this.writeLog("debug",this.formatMessage(t,e))}info(t,...e){this.writeLog("info",this.formatMessage(t,e))}warn(t,...e){this.writeLog("warn",this.formatMessage(t,e))}error(t,...e){this.writeLog("error",this.formatMessage(t,e))}fatal(t,...e){this.writeLog("fatal",this.formatMessage(t,e))}debugf(t,...e){this.writeLog("debug",this.formatMessage(t,e))}infof(t,...e){this.writeLog("info",this.formatMessage(t,e))}warnf(t,...e){this.writeLog("warn",this.formatMessage(t,e))}errorf(t,...e){this.writeLog("error",this.formatMessage(t,e))}fatalf(t,...e){this.writeLog("fatal",this.formatMessage(t,e))}with(e){const n=new t(this.config);return n.fields={...this.fields,...e},n}}}}),R=d({"pkg/log/http.ts"(){}});function N(t,e){return C.getLogger(t,e)}var _,O,I,M,F,$,U,B,q=d({"pkg/log/manager.ts"(){L(),P(),C=class t{static instance;globalConfig;loggers;constructor(){this.globalConfig={level:"debug",enableCaller:!0,jsonFormat:!0},this.loggers=new Map}static getInstance(){return t.instance||(t.instance=new t),t.instance}setGlobalConfig(t){this.globalConfig={...this.globalConfig,...t},this.loggers.clear()}getGlobalConfig(){return{...this.globalConfig}}getLogger(t,e){const n=t+(e?JSON.stringify(e):"");if(!this.loggers.has(n)){const i=(r=this.globalConfig,new A(r)),s={domain:t,...e},a=i.with(s);this.loggers.set(n,a)}var r;return this.loggers.get(n)}getComponentLogger(t,e,n){const r={component:e,...n};return this.getLogger(t,r)}clearCache(){this.loggers.clear()}getCachedDomains(){return Array.from(this.loggers.keys())}setLogLevel(t){this.setGlobalConfig({level:t})}setCallerEnabled(t){this.setGlobalConfig({enableCaller:t})}setJsonFormat(t){this.setGlobalConfig({jsonFormat:t})}}.getInstance()}}),j=d({"pkg/log/index.ts"(){P(),L(),R(),q(),L(),P(),function(t="info"){new A({level:t})}("info")}}),H={};p(H,{OrderedTaxonomy:()=>$,OrderedTaxonomyEntry:()=>F,TaxonomiesBuilder:()=>B,Taxonomy:()=>M,TaxonomyList:()=>U,WeightedPage:()=>O,WeightedPages:()=>I});var z,W,G=d({"internal/domain/site/entity/taxonomies-builder.ts"(){j(),_=N("site",{component:"taxonomies-builder"}),O=class{page;ordinalWeightPage;constructor(t,e){this.page=t,this.ordinalWeightPage=e}get Page(){return this.page}weight(){return this.ordinalWeightPage.weight()}ordinal(){return this.ordinalWeightPage.ordinal()}owner(){return this.ordinalWeightPage.owner()}get Permalink(){return this.page.Permalink}get RelPermalink(){return this.page.RelPermalink}get Title(){return this.page.Title}},I=class extends Array{page(){return 0===this.length?(_.error("Page called on empty WeightedPages"),null):this[0]}get Page(){return this.page()}pages(){return Array.from(this)}sortByWeight(){this.stableSort((t,e)=>t.weight()-e.weight())}count(){return this.length}get Count(){return this.count()}stableSort(t){const e=this.map((t,e)=>({item:t,index:e}));e.sort((e,n)=>{const r=t(e.item,n.item);return 0!==r?r:e.index-n.index}),this.splice(0,this.length,...e.map(t=>t.item))}},M=class{terms=new Map;get(t){return this.terms.get(t)}set(t,e){this.terms.set(t,e)}has(t){return this.terms.has(t)}keys(){return Array.from(this.terms.keys())}values(){return Array.from(this.terms.values())}get Values(){return this.terms}entries(){return Array.from(this.terms.entries())}size(){return this.terms.size}byCount(){const t=this.taxonomyArray();return t.sort((t,e)=>{const n=t.weightedPages.length,r=e.weightedPages.length;return n===r?t.name.localeCompare(e.name):r-n}),new $(t)}taxonomyArray(){const t=[];for(const[e,n]of this.terms.entries())t.push(new F(e,n));return t}},F=class{name;weightedPages;constructor(t,e){this.name=t,this.weightedPages=e}count(){return this.weightedPages.count()}term(){return this.name}},$=class extends Array{constructor(t){super(),t&&this.push(...t)}getOneOPage(){return 0===this.length?null:this[0].weightedPages.page()}},U=class{taxonomies=new Map;get(t){return this.taxonomies.get(t)}set(t,e){this.taxonomies.set(t,e)}has(t){return this.taxonomies.has(t)}keys(){return Array.from(this.taxonomies.keys())}values(){return Array.from(this.taxonomies.values())}get Values(){return this.taxonomies}entries(){return Array.from(this.taxonomies.entries())}size(){return this.taxonomies.size}},B=class{contentService;constructor(t){this.contentService=t}async buildTaxonomiesForLanguage(t,e){const n=new U;try{return await this.contentService.walkTaxonomies(t,async(t,r,i)=>{n.has(t)||n.set(t,new M);const s=n.get(t);s.has(r)||s.set(r,new I);const a=await e.siteWeightedPage(i);s.get(r).push(a)}),n}catch(t){throw _.error(`Failed to create taxonomies: ${t}`),t}}}}}),V=(z={"node_modules/extend/index.js"(t,e){var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===r.call(t)},o=function(t){if(!t||"[object Object]"!==r.call(t))return!1;var e,i=n.call(t,"constructor"),s=t.constructor&&t.constructor.prototype&&n.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!i&&!s)return!1;for(e in t);return void 0===e||n.call(t,e)},l=function(t,e){i&&"__proto__"===e.name?i(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},c=function(t,e){if("__proto__"===e){if(!n.call(t,e))return;if(s)return s(t,e).value}return t[e]};e.exports=function t(){var e,n,r,i,s,h,u=arguments[0],f=1,d=arguments.length,p=!1;for("boolean"==typeof u&&(p=u,u=arguments[1]||{},f=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});f<d;++f)if(null!=(e=arguments[f]))for(n in e)r=c(u,n),u!==(i=c(e,n))&&(p&&i&&(o(i)||(s=a(i)))?(s?(s=!1,h=r&&a(r)?r:[]):h=r&&o(r)?r:{},l(u,{name:n,newValue:t(p,h,i)})):void 0!==i&&l(u,{name:n,newValue:i}));return u}}},function(){return W||(0,z[h(z)[0]])((W={exports:{}}).exports,W),W.exports}),Y={};p(Y,{AutoIDGenerator:()=>ln,IncrementalBuildCoordinator:()=>Xp,processSSG:()=>Rp,processSSGWithProgress:()=>_p,startIncrementalBuild:()=>Zp}),module.exports=w(Y);var K=class extends Error{constructor(t,e){super(t),this.code=e,this.name="ConfigError"}},X=(new K("configuration not found","CONFIG_NOT_FOUND"),new K("invalid configuration","INVALID_CONFIG"),new K("workspace not found","WORKSPACE_NOT_FOUND"),new K("configuration file not found","CONFIG_FILE_NOT_FOUND"),new K("invalid configuration format","INVALID_CONFIG_FORMAT"),class{configSourceFs;provider;root;dir;module;service;social;language;taxonomy;markdown;constructor(t,e,n,r,i,s,a,o,l,c){this.configSourceFs=t,this.provider=e,this.root=n,this.dir=r,this.module=i,this.service=s,this.social=a,this.language=o,this.taxonomy=l,this.markdown=c}fs(){return this.configSourceFs}getProvider(){return this.provider}theme(){return this.root.defaultTheme()}getDir(){return this.dir}getRoot(){return this.root}getModule(){return this.module}getService(){return this.service}getSocial(){return this.social}getLanguage(){return this.language}getTaxonomy(){return this.taxonomy}getMarkdown(){return this.markdown}setLanguage(t){this.language=t}setTaxonomy(t){this.taxonomy=t}setMarkdown(t){this.markdown=t}validate(){let t=!0;return this.language&&(t=t&&this.language.validate()),this.markdown&&(t=t&&this.markdown.validate()),t}}),Z={baseURL:"",title:"",theme:[],timeout:"30s",contentDir:"content",dataDir:"data",layoutDir:"layouts",staticDir:"static",archetypeDir:"archetypes",assetDir:"assets",publishDir:"public",buildDrafts:!1,buildExpired:!1,buildFuture:!1,copyright:"",defaultContentLanguage:"en",defaultContentLanguageInSubdir:!1,disableAliases:!1,disablePathToLower:!1,disableKinds:[],disableLanguages:[],renderSegments:[],disableHugoGeneratorInject:!1,disableLiveReload:!1,enableEmoji:!1},J=class{rootConfig;rootParams;constructor(t,e={}){this.rootConfig=t,this.rootParams=e}defaultTheme(){return this.rootConfig.theme.length>0?this.rootConfig.theme[0]:""}compiledTimeout(){const t=this.rootConfig.timeout;if(/^\d+$/.test(t))return 1e3*parseInt(t,10);const e=t.match(/^(\d+)([smh])$/);if(e){const t=parseInt(e[1],10);switch(e[2]){case"s":return 1e3*t;case"m":return 60*t*1e3;case"h":return 60*t*60*1e3}}return 3e4}baseUrl(){return this.rootConfig.baseURL}configParams(){return this.rootParams}siteTitle(){return this.rootConfig.title}getRootConfig(){return this.rootConfig}getThemes(){return this.rootConfig.theme}getDefaultContentLanguage(){return this.rootConfig.defaultContentLanguage}shouldBuildDrafts(){return this.rootConfig.buildDrafts}shouldBuildFuture(){return this.rootConfig.buildFuture}shouldBuildExpired(){return this.rootConfig.buildExpired}},Q=class{moduleConfig;constructor(t){this.moduleConfig=t}importPaths(){return this.moduleConfig.imports.map(t=>t.path)}getModuleConfig(){return this.moduleConfig}getImports(){return this.moduleConfig.imports}getMounts(){return this.moduleConfig.mounts}importCount(){return this.moduleConfig.imports.length}mountCount(){return this.moduleConfig.mounts.length}hasImports(){return this.moduleConfig.imports.length>0}hasMounts(){return this.moduleConfig.mounts.length>0}findImport(t){return this.moduleConfig.imports.find(e=>e.path===t)}findMount(t){return this.moduleConfig.mounts.find(e=>e.source===t)}},tt={disqus:{disable:!1,shortname:""},googleAnalytics:{disable:!1,respectDoNotTrack:!1,id:""},rss:{limit:0},x:{respectDoNotTrack:!1,disableInlineCSS:!1}},et=class{serviceConfig;constructor(t){this.serviceConfig=t}isGoogleAnalyticsEnabled(){return!this.serviceConfig.googleAnalytics.disable}googleAnalyticsID(){return this.serviceConfig.googleAnalytics.id}isGoogleAnalyticsRespectDoNotTrack(){return this.serviceConfig.googleAnalytics.respectDoNotTrack}isDisqusEnabled(){return!this.serviceConfig.disqus.disable}disqusShortname(){return this.serviceConfig.disqus.shortname}isXRespectDoNotTrack(){return this.serviceConfig.x.respectDoNotTrack}isXDisableInlineCSS(){return this.serviceConfig.x.disableInlineCSS}rssLimit(){return this.serviceConfig.rss.limit}getServiceConfig(){return this.serviceConfig}getGoogleAnalytics(){return this.serviceConfig.googleAnalytics}getDisqus(){return this.serviceConfig.disqus}getRSS(){return this.serviceConfig.rss}hasEnabledServices(){return this.isGoogleAnalyticsEnabled()||this.isDisqusEnabled()}};D();var nt={languageCode:"en",languageName:"English",title:"",weight:0,contentDir:"content",disabled:!1,params:{}},rt=class{defaultLang;configs;indices;constructor(t){this.configs=t,this.defaultLang=this.calculateDefaultLanguage(),this.indices=[],this.setIndices()}calculateDefaultLanguage(){if(0===Object.keys(this.configs).length)return"en";let t="",e=Number.MAX_SAFE_INTEGER;for(const[n,r]of Object.entries(this.configs))r.weight<e&&(e=r.weight,t=n);return t||Object.keys(this.configs)[0]}languages(){return Object.values(this.configs)}defaultLanguage(){return this.defaultLang}isLanguageValid(t){return Object.prototype.hasOwnProperty.call(this.configs,t)}otherLanguageKeys(){return Object.keys(this.configs).filter(t=>t!==this.defaultLang)}getRelDir(t,e){const n=this.configs[e];if(!n)throw new Error(`Language "${e}" not found`);return n.contentDir||"content"}validate(){return t=this.configs,e=this.defaultLang,Object.prototype.hasOwnProperty.call(t,e);var t,e}setIndices(){const t=[];this.configs[this.defaultLang]&&t.push(this.defaultLang);for(const e of Object.keys(this.configs))e!==this.defaultLang&&t.push(e);this.indices=t}languageKeys(){return[...this.indices]}languageIndexes(){return this.indices.map((t,e)=>e)}getLanguageIndex(t){const e=this.indices.indexOf(t);if(-1===e)throw new Error("Language not found in indices");return e}getLanguageByIndex(t){if(t<0||t>=this.indices.length)throw new Error("Language index out of range");return this.indices[t]}getLanguageName(t){const e=this.configs[t];return e?e.languageName:""}getLanguageConfig(t){return this.configs[t]}getConfigs(){return this.configs}},it={tag:"tags",category:"categories"};function st(...t){let e="";return t.length>0&&(e=t[0],t.length>1&&(e=t.join("/"))),e=e.replace(/^[.\s/]+|[.\s/]+$/g,""),e=e.toLowerCase(),e=e.replace(/\\/g,"/"),""===e||"/"===e?"":(e.startsWith("/")||(e="/"+e),e)}var at=class{taxonomies;views;viewsByTreeKey;constructor(t){this.taxonomies=t,this.views=[],this.viewsByTreeKey={},this.setupViews()}getViews(){return[...this.views]}getTaxonomies(){return{...this.taxonomies}}getViewByTreeKey(t){return this.viewsByTreeKey[t]}hasTaxonomy(t){return Object.prototype.hasOwnProperty.call(this.taxonomies,t)}getPluralForm(t){return this.taxonomies[t]}getSingularForm(t){for(const[e,n]of Object.entries(this.taxonomies))if(n===t)return e}getSingularForms(){return Object.keys(this.taxonomies)}getPluralForms(){return Object.values(this.taxonomies)}setupViews(){this.views=function(t){const e=[];for(const[n,r]of Object.entries(t))e.push({singular:n,plural:r,pluralTreeKey:st(r)});return e.sort((t,e)=>t.plural.localeCompare(e.plural)),e}(this.taxonomies),this.viewsByTreeKey={};for(const t of this.views)this.viewsByTreeKey[t.pluralTreeKey]=t}getViewCount(){return this.views.length}isEmpty(){return 0===Object.keys(this.taxonomies).length}};function ot(t){const e=function(t){if(t.taxonomies&&"object"==typeof t.taxonomies){const e={};for(const[n,r]of Object.entries(t.taxonomies))"string"==typeof r&&(e[n]=r);return e}return{...it}}(t);return new at(e)}var lt=[{id:"email",title:"Email me"},{id:"facebook",title:"Facebook"},{id:"github",title:"GitHub"},{id:"gitlab",title:"GitLab"},{id:"bitbucket",title:"Bitbucket"},{id:"twitter",title:"Twitter"},{id:"slack",title:"Slack"},{id:"reddit",title:"Reddit"},{id:"linkedin",title:"LinkedIn"},{id:"xing",title:"Xing"},{id:"stackoverflow",title:"StackOverflow"},{id:"snapchat",title:"Snapchat"},{id:"instagram",title:"Instagram"},{id:"youtube",title:"Youtube"},{id:"soundcloud",title:"SoundCloud"},{id:"spotify",title:"Spotify"},{id:"bandcamp",title:"Bandcamp"},{id:"itchio",title:"Itch.io"},{id:"keybase",title:"Keybase"},{id:"vk",title:"VK"},{id:"paypal",title:"PayPal"},{id:"telegram",title:"Telegram"},{id:"500px",title:"500px"},{id:"codepen",title:"CodePen"},{id:"kaggle",title:"kaggle"},{id:"mastodon",title:"Mastodon"},{id:"weibo",title:"Weibo"},{id:"medium",title:"Medium"},{id:"discord",title:"Discord"},{id:"strava",title:"Strava"},{id:"steam",title:"Steam"},{id:"quora",title:"Quora"},{id:"amazonwishlist",title:"Amazon Wishlist"},{id:"slideshare",title:"Slideshare"},{id:"angellist",title:"AngelList"},{id:"about",title:"About"},{id:"lastfm",title:"Last.fm"},{id:"bluesky",title:"Bluesky"},{id:"goodreads",title:"Goodreads"}],ct=class{socialConfig;constructor(t){this.socialConfig=t}getUserConfig(){return this.socialConfig.userConfig}getPlatformTemplates(){return this.socialConfig.platformTemplates}getPlatformTemplate(t){return e=t,lt.find(t=>t.id===e);var e}isPlatformConfigured(t){return t in this.socialConfig.userConfig}getConfiguredPlatforms(){return Object.keys(this.socialConfig.userConfig)}getProcessedSocialLinks(){const t=[];for(const[e,n]of Object.entries(this.socialConfig.userConfig)){const r=this.getPlatformTemplate(e);r?t.push({id:e,title:r.title,url:n.link}):t.push({id:e,title:e.charAt(0).toUpperCase()+e.slice(1),url:n.link})}return t}getSocialLink(t){const e=this.socialConfig.userConfig[t];if(!e)return;const n=this.getPlatformTemplate(t);return n?{id:t,title:n.title,url:e.link}:{id:t,title:t.charAt(0).toUpperCase()+t.slice(1),url:e.link}}hasSocialLinks(){return Object.keys(this.socialConfig.userConfig).length>0}getSocialLinkCount(){return Object.keys(this.socialConfig.userConfig).length}getAvailablePlatforms(){return this.socialConfig.platformTemplates.map(t=>t.id)}getSocialConfig(){return this.socialConfig}},ht={useInternalRenderer:!1,plugins:{wikilink:!0,tag:!0,callout:!0,latex:!0,mermaid:!0}},ut=class{markdownConfig;constructor(t){this.markdownConfig=t}useInternalRenderer(){return this.markdownConfig.useInternalRenderer}isWikilinkEnabled(){return this.markdownConfig.plugins.wikilink}isTagEnabled(){return this.markdownConfig.plugins.tag}isCalloutEnabled(){return this.markdownConfig.plugins.callout}isLatexEnabled(){return this.markdownConfig.plugins.latex}isMermaidEnabled(){return this.markdownConfig.plugins.mermaid}getMarkdownConfig(){return this.markdownConfig}getPlugins(){return this.markdownConfig.plugins}hasEnabledPlugins(){const t=this.markdownConfig.plugins;return t.wikilink||t.tag||t.callout||t.latex||t.mermaid}validate(){return!this.markdownConfig.useInternalRenderer||this.hasEnabledPlugins()}},ft=m(require("path")),dt="public",pt=class{workingDir;themesDir;publishDir;constructor(t,e,n=dt){this.workingDir=t,this.themesDir=e,this.publishDir=n}getWorkingDir(){return ft.default.resolve(this.workingDir)}getThemesDir(){return ft.default.resolve(this.themesDir)}getThemesCacheDir(){return ft.default.resolve(this.themesDir,".cache")}getPublishDir(){return ft.default.resolve(this.publishDir)}},gt=class{root;keyCache;constructor(t={}){this.root=this.prepareParams(t),this.keyCache=new Map}prepareParams(t){const e={};for(const[n,r]of Object.entries(t))e[n.toLowerCase()]=r;return e}getNestedKeyAndMap(t,e){let n;this.keyCache.has(t)?n=this.keyCache.get(t):(n=t.split("."),this.keyCache.set(t,n));let r=this.root;for(let t=0;t<n.length-1;t++){const i=n[t];if(!(i in r)){if(!e)return["",null];r[i]={}}const s=r[i];if("object"!=typeof s||null===s)return["",null];r=s}return[n[n.length-1],r]}getString(t){const e=this.get(t);return String(e||"")}getInt(t){const e=this.get(t),n=Number(e);return isNaN(n)?0:Math.floor(n)}getBool(t){const e=this.get(t);return"boolean"==typeof e?e:"string"==typeof e?"true"===e.toLowerCase():Boolean(e)}getParams(t){const e=this.get(t);return e&&"object"==typeof e?e:{}}getStringMap(t){const e=this.get(t);return e&&"object"==typeof e?e:{}}getStringMapString(t){const e=this.get(t);if(e&&"object"==typeof e){const t={};for(const[n,r]of Object.entries(e))t[n]=String(r);return t}return{}}getStringSlice(t){const e=this.get(t);return Array.isArray(e)?e.map(t=>String(t)):[]}get(t){if(""===t)return this.root;const[e,n]=this.getNestedKeyAndMap(t.toLowerCase(),!1);return null!==n?n[e]:void 0}set(t,e){const n=t.toLowerCase();if(""===n)return void(e&&"object"==typeof e?Object.assign(this.root,this.prepareParams(e)):this.root[n]=e);const[r,i]=this.getNestedKeyAndMap(n,!0);null!==i&&(r in i&&"object"==typeof i[r]&&"object"==typeof e&&null!==e?Object.assign(i[r],e):i[r]=e)}keys(){return Object.keys(this.root)}merge(t,e){const n=t.toLowerCase();if(""===n)return void(e&&"object"==typeof e&&Object.assign(this.root,this.prepareParams(e)));const[r,i]=this.getNestedKeyAndMap(n,!0);null!==i&&(r in i&&"object"==typeof i[r]&&"object"==typeof e&&null!==e?Object.assign(i[r],e):i[r]=e)}setDefaults(t){const e=this.prepareParams(t);for(const[t,n]of Object.entries(e))t in this.root||(this.root[t]=n)}setDefaultMergeStrategy(){}walkParams(t){const e=n=>{if(n&&"object"==typeof n&&!Array.isArray(n)){if(t(n))return!0;for(const t of Object.values(n))if(e(t))return!0}return!1};e(this.root)}isSet(t){const[e,n]=this.getNestedKeyAndMap(t.toLowerCase(),!1);return null!==n&&e in n}},mt=m(require("path")),wt=class{cfg;sourceDescriptor;baseDirs;constructor(t,e){this.cfg=new gt,this.sourceDescriptor=t,this.baseDirs=e}async loadConfigByDefault(){const t=this.sourceDescriptor.filename();if(await this.loadProvider(t),this.applyDefaultConfig(),this.cfg.setDefaultMergeStrategy(),!this.cfg.isSet("languages")){const t=this.cfg.getString("defaultContentLanguage");this.cfg.set("languages",{[t]:{}})}return this.cfg}deleteMergeStrategies(){this.cfg.walkParams(t=>!1)}async loadProvider(t){const e=this.baseDirs.workingDir;let n;n=mt.isAbsolute(t)?t:mt.join(e,t);let r="";if(""!==mt.extname(t)&&await this.fileExists(n)&&(r=n),""===r)throw new Error("Unable to locate config file or config directory.");const i=await this.loadConfigFromFile(r);this.cfg.set("",i)}applyDefaultConfig(){this.cfg.setDefaults({baseURL:"",cleanDestinationDir:!1,watch:!1,contentDir:"content",resourceDir:"resources",publishDir:"public",publishDirOrig:"public",themesDir:"themes",assetDir:"assets",layoutDir:"layouts",i18nDir:"i18n",dataDir:"data",archetypeDir:"archetypes",configDir:"config",staticDir:"static",buildDrafts:!1,buildFuture:!1,buildExpired:!1,params:{},environment:"production",uglyURLs:!1,verbose:!1,ignoreCache:!1,canonifyURLs:!1,relativeURLs:!1,removePathAccents:!1,titleCaseStyle:"AP",taxonomies:{tag:"tags",category:"categories"},permalinks:{},sitemap:{priority:-1,filename:"sitemap.xml"},menus:{},disableLiveReload:!1,pluralizeListTitles:!0,capitalizeListTitles:!0,forceSyncStatic:!1,footnoteAnchorPrefix:"",footnoteReturnLinkContents:"",newContentEditor:"",paginate:10,paginatePath:"page",summaryLength:70,rssLimit:-1,sectionPagesMenu:"",disablePathToLower:!1,hasCJKLanguage:!1,enableEmoji:!1,defaultContentLanguage:"en",defaultContentLanguageInSubdir:!1,enableMissingTranslationPlaceholders:!1,enableGitInfo:!1,ignoreFiles:[],disableAliases:!1,debug:!1,disableFastRender:!1,timeout:"30s",timeZone:"",enableInlineShortcodes:!1})}async fileExists(t){try{const e=this.sourceDescriptor.fs();return!(await e.stat(t)).isDir()}catch{return!1}}async loadConfigFromFile(t){const e=this.sourceDescriptor.fs(),n=await e.open(t);try{const t=new Uint8Array(1048576),{bytesRead:e}=await n.read(t),r=(new TextDecoder).decode(t.slice(0,e));try{return JSON.parse(r)}catch{return{}}}finally{await n.close()}}},yt=class{fileSystem;configFilename;constructor(t,e){this.fileSystem=t,this.configFilename=e}fs(){return this.fileSystem}filename(){return this.configFilename}},bt=m(require("path"));var vt="content",Et=["workflows","prompts",vt,"layouts","static","assets","i18n"],kt=class extends Error{constructor(t,e){super(t),this.code=e,this.name="ModuleError"}},St=(new kt("module not found","MODULE_NOT_FOUND"),new kt("download failed","DOWNLOAD_FAILED"),new kt("invalid zip file","INVALID_ZIP"),new kt("mount failed","MOUNT_FAILED"),m(require("path"))),Tt=class t{constructor(t,e,n=""){this.sourcePath=t,this.targetPath=e,this.language=n}source(){return this.sourcePath}target(){return this.targetPath}lang(){return this.language}setLanguage(t){this.language=t}component(){return this.targetPath.split(St.sep)[0]||""}componentAndName(){const t=this.targetPath.split(St.sep);return{component:t[0]||"",name:t.slice(1).join(St.sep)}}copy(){return new t(this.sourcePath,this.targetPath,this.language)}equals(t){return this.sourcePath===t.sourcePath&&this.targetPath===t.targetPath&&this.language===t.language}toConfig(){const t={sourcePath:this.sourcePath,targetPath:this.targetPath};return this.language&&(t.language=this.language),t}toString(){return`${this.sourcePath} -> ${this.targetPath} (${this.language})`}},xt=m(require("path")),At=m(require("http")),Ct=m(require("https"));j();var Dt=N("module",{component:"httpclient"}),Pt=class{constructor(t,e=3e4,n={}){this.fs=t,this.timeout=e,this.headers=n}defaultTimeout=3e4;defaultHeaders={"User-Agent":"MDFriday-CLI/1.0.0"};async download(t,e,n){return new Promise((r,i)=>{try{const s=new URL(t),a="https:"===s.protocol,o=a?Ct:At,l={...this.defaultHeaders,...this.headers,...n?.headers},c={hostname:s.hostname,port:s.port||(a?443:80),path:s.pathname+s.search,method:"GET",headers:l,timeout:n?.timeout||this.timeout},h=o.request(c,async t=>{if(!t.statusCode||t.statusCode<200||t.statusCode>=300)return void i(new kt(`HTTP ${t.statusCode}: ${t.statusMessage}`,"HTTP_ERROR"));const s=parseInt(t.headers["content-length"]||"0",10);let a=0,o=Date.now(),l=-1;try{const c=xt.dirname(e);await this.fs.mkdirAll(c,493);const h=await this.fs.create(e),u=[];t.on("data",t=>{if(u.push(t),a+=t.length,n?.onProgress&&s>0){const t=Date.now(),e=Math.round(a/s*100);if(t-o>=100&&e!==l||e-l>=5){const r={loaded:a,total:s,percentage:e};try{n.onProgress(r),l=e}catch(t){Dt.error(`Progress callback error: ${t}`)}o=t}}}),t.on("end",async()=>{try{const t=Buffer.concat(u),e=new Uint8Array(t);if(await h.write(e),await h.sync(),await h.close(),n?.onProgress&&s>0){const t={loaded:s,total:s,percentage:100};try{n.onProgress(t)}catch(t){Dt.warn(`Progress callback error: ${t}`)}}r()}catch(t){const e=t instanceof Error?t.message:String(t);i(new kt(`File write failed: ${e}`,"WRITE_FAILED"))}}),t.on("error",t=>{Dt.error(`Response error: ${t.message}`),i(new kt(`Download failed: ${t.message}`,"DOWNLOAD_FAILED"))})}catch(t){const e=t instanceof Error?t.message:String(t);i(new kt(`File system error: ${e}`,"FS_ERROR"))}});h.on("error",t=>{Dt.error("Request error:",t),i(new kt(`Request failed: ${t.message}`,"REQUEST_FAILED"))}),h.on("timeout",()=>{h.destroy(),Dt.error(`Request timeout for ${t}`),i(new kt("Request timeout","TIMEOUT"))}),h.end()}catch(t){const e=t instanceof Error?t.message:String(t);i(new kt(`Download failed: ${e}`,"DOWNLOAD_FAILED"))}})}async get(t,e){return new Promise((n,r)=>{try{const i=new URL(t),s="https:"===i.protocol,a=s?Ct:At,o={...this.defaultHeaders,...this.headers,...e?.headers},l={hostname:i.hostname,port:i.port||(s?443:80),path:i.pathname+i.search,method:"GET",headers:o,timeout:e?.timeout||this.timeout},c=a.request(l,t=>{const e=[],i={};Object.entries(t.headers).forEach(([t,e])=>{i[t]=Array.isArray(e)?e.join(", "):e||""}),t.on("data",t=>{e.push(t)}),t.on("end",()=>{const r=Buffer.concat(e),s=r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);n({data:s,headers:i,status:t.statusCode||0})}),t.on("error",t=>{r(new kt(`Response error: ${t.message}`,"RESPONSE_ERROR"))})});c.on("error",t=>{r(new kt(`GET request failed: ${t.message}`,"REQUEST_FAILED"))}),c.on("timeout",()=>{c.destroy(),r(new kt("GET request timeout","TIMEOUT"))}),c.end()}catch(t){const e=t instanceof Error?t.message:String(t);r(new kt(`GET request failed: ${e}`,"REQUEST_FAILED"))}})}};function Lt(t,e,n,r){return r||new Pt(t,e,n)}j();var Rt=m(require("jszip")),Nt=m(require("path")),_t=N("module",{component:"zipextractor"}),Ot=class{constructor(t){this.fs=t}async extract(t,e){try{const n=await this.fs.open(t),r=(await n.stat()).size(),i=new Uint8Array(r),s=await n.read(i);await n.close(),await this.extractZipData(s.buffer,e)}catch(e){const n=e instanceof Error?e.message:String(e);throw _t.error(`ZIP extraction failed for ${t}: ${n}`),new kt(`ZIP extraction failed: ${n}`,"EXTRACTION_FAILED")}}async list(t){try{const e=await this.fs.open(t),n=await e.stat(),r=new Uint8Array(n.size()),i=await e.read(r);return await e.close(),await this.listZipContents(i.buffer)}catch(t){const e=t instanceof Error?t.message:String(t);throw new kt(`ZIP listing failed: ${e}`,"LIST_FAILED")}}async extractZipData(t,e){try{await this.fs.mkdirAll(e,493);const n=new Rt.default,r=await n.loadAsync(t),i=[];r.forEach((t,e)=>{e.dir||i.push(t)});const s=[];let a=0;r.forEach((t,n)=>{s.push(this.extractSingleEntry(t,n,e).then(()=>{a++}))}),await Promise.all(s)}catch(t){const e=t instanceof Error?t.message:String(t);throw _t.error(`Failed to extract ZIP data: ${e}`),new kt(`Failed to extract ZIP data: ${e}`,"EXTRACTION_FAILED")}}async extractSingleEntry(t,e,n){const r=Nt.join(n,t);if(e.dir)await this.fs.mkdirAll(r,493);else{const t=Nt.dirname(r);t!==n&&await this.fs.mkdirAll(t,493);const i=await e.async("uint8array"),s=await this.fs.create(r);await s.write(i),await s.close()}}async listZipContents(t){try{const e=new Rt.default,n=await e.loadAsync(t),r=[];return n.forEach(t=>{r.push(t)}),r}catch(t){const e=t instanceof Error?t.message:String(t);throw new kt(`Failed to list ZIP contents: ${e}`,"LIST_FAILED")}}},It=class{constructor(t){this.fs=t}async extract(t,e){try{throw new kt("Web ZIP extraction not implemented","NOT_IMPLEMENTED")}catch(t){const e=t instanceof Error?t.message:String(t);throw new kt(`Web ZIP extraction failed: ${e}`,"WEB_EXTRACTION_FAILED")}}async list(t){try{throw new kt("Web ZIP listing not implemented","NOT_IMPLEMENTED")}catch(t){const e=t instanceof Error?t.message:String(t);throw new kt(`Web ZIP listing failed: ${e}`,"WEB_LIST_FAILED")}}};function Mt(t,e="node"){switch(e){case"node":return new Ot(t);case"browser":return new It(t);default:throw new Error(`Unsupported environment: ${e}`)}}j();var Ft=m(require("path")),$t=N("module",{component:"cache"}),Ut=class{constructor(t,e="./module/cache"){this.fs=t,this.cacheDir=e}cacheDir;async get(t){try{const e=this.getCacheFilePath(t),n=await this.fs.open(e),r=await n.stat(),i=new Uint8Array(r.size());await n.read(i),await n.close();const s=(new TextDecoder).decode(i);return JSON.parse(s)}catch(e){if(e.message?.includes("ENOENT")||e.message?.includes("no such file"))return $t.error(`Cache miss: ${t}`,e),null;const n=e instanceof Error?e.message:String(e);throw $t.error(`Cache read error for ${t}: ${n}`),new kt(`Failed to read cache: ${n}`,"CACHE_READ_FAILED")}}async set(t,e){try{await this.fs.mkdirAll(this.cacheDir,493);const n=this.getCacheFilePath(t),r=JSON.stringify(e,null,2),i=(new TextEncoder).encode(r),s=await this.fs.create(n);await s.write(i),await s.sync(),await s.close()}catch(e){const n=e instanceof Error?e.message:String(e);throw $t.error(`Cache write error for ${t}: ${n}`),new kt(`Failed to write cache: ${n}`,"CACHE_WRITE_FAILED")}}async has(t){try{const e=this.getCacheFilePath(t);return await this.fs.stat(e),!0}catch(t){return!1}}async delete(t){try{const e=this.getCacheFilePath(t);await this.fs.remove(e)}catch(e){if(!e.message?.includes("ENOENT")&&!e.message?.includes("no such file")){const n=e instanceof Error?e.message:String(e);throw $t.error(`Cache delete error for ${t}: ${n}`),new kt(`Failed to delete cache: ${n}`,"CACHE_DELETE_FAILED")}}}async clear(){try{await this.fs.removeAll(this.cacheDir)}catch(t){if(!t.message?.includes("ENOENT")&&!t.message?.includes("no such file")){const e=t instanceof Error?t.message:String(t);throw $t.error(`Cache clear error: ${e}`),new kt(`Failed to clear cache: ${e}`,"CACHE_CLEAR_FAILED")}}}getCacheFilePath(t){const e=t.replace(/[/\\:*?"<>|]/g,"_").replace(/^_+|_+$/g,"")+".json";return Ft.join(this.cacheDir,e)}getCacheDir(){return this.cacheDir}async getStats(){try{const t=await this.listCacheFiles();let e=0;for(const n of t)try{const t=Ft.join(this.cacheDir,n);e+=(await this.fs.stat(t)).size()}catch(t){}return{totalEntries:t.length,totalSize:e}}catch(t){return{totalEntries:0,totalSize:0}}}async listCached(){try{return(await this.listCacheFiles()).map(t=>Ft.basename(t,".json").replace(/_/g,"/"))}catch(t){return[]}}async listCacheFiles(){try{const t=await this.fs.open(this.cacheDir),e=await t.readdirnames(-1);return await t.close(),e.filter(t=>t.endsWith(".json"))}catch(t){return[]}}};function Bt(t,e){return new Ut(t,e)}var qt=m(require("path")),jt=class t{constructor(t,e,n,r=null,i=!1){this.fs=t,this.absoluteDir=e,this.modulePath=n,this.parentModule=r,this.mountDirs=[],this.metadata=null,this.isProject=i}absoluteDir;modulePath;parentModule;mountDirs;metadata;isProject=!1;isProjectModule(){return this.isProject}owner(){return this.parentModule}mounts(){return this.mountDirs.map(t=>t)}dir(){return this.absoluteDir}path(){return this.modulePath}setMetadata(t){this.metadata=t}getMetadata(){return this.metadata}async applyMounts(t){try{let e=t.mounts||[];if(0===e.length)for(const t of Et){const n=qt.join(this.absoluteDir,t);try{(await this.fs.stat(n)).isDir()&&e.push({sourcePath:t,targetPath:t})}catch(t){}}this.mountDirs=e.map(t=>{return e=t.sourcePath,n=t.targetPath,new Tt(e,n);var e,n})}catch(t){const e=t instanceof Error?t.message:String(t);throw new kt(`Failed to apply mounts: ${e}`,"MOUNT_FAILED")}}appendMount(t){this.mountDirs.push(t)}removeMount(t){const e=this.mountDirs.findIndex(e=>e.equals(t));return e>=0&&(this.mountDirs.splice(e,1),!0)}getMountByTarget(t){return this.mountDirs.find(e=>e.target()===t)||null}getMountsByComponent(t){return this.mountDirs.filter(e=>e.component()===t)}isDownloaded(){return"completed"===this.metadata?.downloadStatus}isDownloading(){return"downloading"===this.metadata?.downloadStatus}isDownloadFailed(){return"failed"===this.metadata?.downloadStatus}async exists(){try{return(await this.fs.stat(this.absoluteDir)).isDir()}catch(t){return!1}}copy(){const e=new t(this.fs,this.absoluteDir,this.modulePath,this.parentModule,this.isProject);return e.mountDirs=this.mountDirs.map(t=>t.copy()),e.metadata=this.metadata?{...this.metadata}:null,e}toString(){return`Module{path: ${this.modulePath}, dir: ${this.absoluteDir}, mounts: ${this.mountDirs.length}}`}},Ht=class{constructor(t){this.module=t}getModule(){return this.module}appendMount(t){this.module.appendMount(t)}setDefaultLanguage(t){const e=this.module.mounts();for(const n of e)n instanceof Tt&&n.setLanguage(t)}applyDefaultMounts(){const t=Et.map(t=>new Tt(t,t));for(const e of t)this.module.appendMount(e)}owner(){return this.module.owner()}mounts(){return this.module.mounts()}dir(){return this.module.dir()}path(){return this.module.path()}};function zt(t,e,n,r){return new jt(t,e,n,r||null,!1)}var Wt=m(require("path")),Gt=class{sourceLangMap;constructor(t){this.sourceLangMap=new Map;for(const e of t)for(const t of e.mounts())this.sourceLangMap.set(t.source(),t.lang())}getSourceLang(t){const e=this.sourceLangMap.get(Wt.default.basename(t));return void 0!==e?[e,!0]:["",!1]}},Vt=class t{themes;constructor(t){this.themes=t}static fromJson(e){return new t(e)}findThemeByUrl(t){const e=this.extractBaseUrl(t);for(const t of this.themes)if(e===this.extractBaseUrl(t.download_url))return t;return null}resolveLatestVersion(t){const e=this.findThemeByUrl(t);return e?e.download_url:t}extractBaseUrl(t){try{const e=new URL(t);return e.searchParams.delete("version"),e.toString()}catch(e){const n=t.indexOf("?");if(-1===n)return t;const r=t.substring(0,n),i=new URLSearchParams(t.substring(n+1));i.delete("version");const s=i.toString();return s?`${r}?${s}`:r}}getAllThemes(){return[...this.themes]}getThemeByName(t){return this.themes.find(e=>e.name.toLowerCase()===t.toLowerCase())||null}getThemesByTag(t){return this.themes.filter(e=>e.tags.some(e=>e.toLowerCase()===t.toLowerCase()))}};j();var Yt=require("smol-toml"),Kt=m(require("path")),Xt=N("module",{component:"modules"}),Zt=class{constructor(t,e,n,r){var i;this.info=t,this.httpClient=e,this.zipExtractor=n,this.moduleCache=r,this.projectModule=function(t){const e=t.osFs(),n=t.projDir(),r=t.defaultLanguageKey(),i=new jt(e,n,"project-root",null,!0),s=new Ht(i);s.applyDefaultMounts(),r&&s.setDefaultLanguage(r);const a=t.otherLanguageKeys();for(const e of a)try{const n=t.getRelDir(vt,e);if(n&&""!==n){const t=new Tt(n,vt,e);s.appendMount(t)}}catch(t){console.warn(`Failed to get relative directory for language ${e}:`,t)}return s}(this.info),this.lang=(i=this.all(),new Gt(i))}projectModule;modules=[];downloadedModules=new Set;lang;themesCache=new Map;proj(){return this.projectModule.getModule()}all(){const t=[this.projectModule.getModule()];return t.push(...this.modules),t}isProjMod(t){return t===this.projectModule.getModule()}async load(t){const e=this.info.importPaths();if(0!==e.length)for(let n=0;n<e.length;n++){const r=e[n],{cleanUrl:i,version:s}=this.parseVersionFromImportPath(r);let a=r;"latest"===s&&(a=await this.resolveLatestVersion(r)),this.downloadedModules.has(a)?Xt.info(`Module already downloaded: ${a}`):await this.addModule(this.projectModule.getModule(),a,e=>{t?.({modulePath:a,downloadPercentage:e.percentage})})}else Xt.warn("No import paths configured - no modules will be downloaded")}parseVersionFromImportPath(t){try{const e=new URL(t),n=e.searchParams.get("version")||"latest";return e.searchParams.delete("version"),{cleanUrl:e.toString(),version:n}}catch(e){return Xt.warn(`Failed to parse import path ${t}:`,e),{cleanUrl:t,version:"latest"}}}getThemeRegistryUrl(t){try{const e=new URL(t).hostname;return"sunwei.xyz"===e||"www.sunwei.xyz"===e?"https://sunwei.xyz/mdf/themes-zh.json":"https://gohugo.net/themes.json"}catch(e){return Xt.warn(`Failed to parse import path ${t}, using default theme registry`),"https://gohugo.net/themes.json"}}async resolveLatestVersion(t){const{version:e}=this.parseVersionFromImportPath(t);if("latest"!==e)return t;try{const e=this.getThemeRegistryUrl(t);Xt.info(`Fetching latest theme versions from ${e}...`);let n=this.themesCache.get(e);if(!n){const t=await this.httpClient.get(e),r=(new TextDecoder).decode(t.data),i=JSON.parse(r);n=Vt.fromJson(i),this.themesCache.set(e,n)}const r=n.resolveLatestVersion(t);return r!==t?Xt.info(`Resolved latest version: ${t} -> ${r}`):Xt.warn(`Could not resolve latest version for ${t}, using original path`),r}catch(e){return Xt.error(`Failed to resolve latest version for ${t}:`,e),t}}async downloadModule(t,e){try{let n=t.version;if("latest"===t.version){const e=await this.resolveLatestVersion(t.path),{version:r}=this.parseVersionFromImportPath(e);n=r}const r=await this.moduleCache.get(t.path);if(r&&"completed"===r.downloadStatus&&this.isCacheValidForVersion(r.version,n)){const e=await this.createModuleFromCache(t,r);if(await e.exists())return Xt.info(`Using cached module ${t.path} version ${r.version}`),e}r&&"completed"===r.downloadStatus&&!this.isCacheValidForVersion(r.version,n)&&Xt.info(`Cache version mismatch for ${t.path}: cached=${r.version}, requested=${n||"latest"}`);const i=this.getModuleDir(t.path),s=Kt.join(i,"module.zip"),a={path:t.path,version:t.version||"latest",url:t.url,dir:i,downloadStatus:"downloading",downloadedAt:new Date};await this.moduleCache.set(t.path,a);try{const n=this.addTimestampToUrl(t.url);await this.httpClient.download(n,s,{onProgress:t=>{e?.({percentage:t.percentage})}}),await this.zipExtractor.extract(s,i),a.downloadStatus="completed",a.downloadedAt=new Date;try{const t=await this.info.osFs().stat(s);a.size=t.size()}catch(t){}try{await this.info.osFs().remove(s)}catch(t){}await this.moduleCache.set(t.path,a);const r=zt(this.info.osFs(),i,t.path);return r.setMetadata(a),await r.applyMounts(t),r}catch(e){a.downloadStatus="failed",await this.moduleCache.set(t.path,a);const n=e instanceof Error?e.message:String(e);throw new kt(`Failed to download module ${t.path}: ${n}`,"DOWNLOAD_FAILED")}}catch(t){if(t instanceof kt)throw t;const e=t instanceof Error?t.message:String(t);throw new kt(`Module download failed: ${e}`,"DOWNLOAD_FAILED")}}async addModule(t,e,n){try{if(this.downloadedModules.has(e))return;const{cleanUrl:t,version:r}=this.parseVersionFromImportPath(e),i={path:e,url:this.getDownloadUrl(t),...r&&{version:r}},s=await this.downloadModule(i,n);this.modules.push(s),this.downloadedModules.add(e);try{const t=await this.parseThemeToml(s);for(const e of t){if(this.downloadedModules.has(e)){Xt.info(`Module ${e} already downloaded, skipping`);continue}Xt.info(`Recursively downloading module dependency: ${e}`);const t=e,{cleanUrl:r,version:i}=this.parseVersionFromImportPath(t);let a=t;"latest"===i&&(a=await this.resolveLatestVersion(t)),await this.addModule(s,a,t=>{n?.({percentage:.5*t.percentage})})}}catch(t){const n=t instanceof Error?t.message:String(t);Xt.warn(`Failed to process recursive imports for module ${e}: ${n}`)}}catch(t){const n=t instanceof Error?t.message:String(t);throw new kt(`Failed to add module ${e}: ${n}`,"ADD_MODULE_FAILED")}}async createModuleFromCache(t,e){const n=zt(this.info.osFs(),e.dir,t.path);return n.setMetadata(e),await n.applyMounts(t),n}getModuleDir(t){const e=t.replace(/[/\\:*?"<>|]/g,"_").replace(/^_+|_+$/g,"");return Kt.join(this.info.moduleDir(),e)}getDownloadUrl(t){return t}isCacheValidForVersion(t,e){return!e||t===e}addTimestampToUrl(t){try{const e=new URL(t),n=Date.now().toString();return e.searchParams.set("_t",n),e.toString()}catch(e){const n=t.includes("?")?"&":"?";return`${t}${n}_t=${Date.now()}`}}getModuleByPath(t){return this.modules.find(e=>e.path()===t)||null}isModuleDownloaded(t){return this.downloadedModules.has(t)}async getModuleStatus(t){const e=await this.moduleCache.get(t);return e?.downloadStatus||"pending"}async removeModule(t){try{const e=this.modules.findIndex(e=>e.path()===t);if(e>=0){const n=this.modules[e];try{await this.info.osFs().removeAll(n.dir())}catch(t){}this.modules.splice(e,1),this.downloadedModules.delete(t),await this.moduleCache.delete(t)}}catch(e){const n=e instanceof Error?e.message:String(e);throw new kt(`Failed to remove module ${t}: ${n}`,"REMOVE_MODULE_FAILED")}}async clearAll(){try{for(const t of this.modules)try{await this.info.osFs().removeAll(t.dir())}catch(t){}this.modules=[],this.downloadedModules.clear(),await this.moduleCache.clear()}catch(t){const e=t instanceof Error?t.message:String(t);throw new kt(`Failed to clear modules: ${e}`,"CLEAR_MODULES_FAILED")}}getSourceLang(t){return this.lang.getSourceLang(t)}async parseThemeToml(t){try{const e=Kt.join(t.dir(),"theme.toml");try{if((await this.info.osFs().stat(e)).isDir())return[]}catch(t){return[]}let n;try{const t=await this.info.osFs().open(e);try{const e=[],r=new Uint8Array(4096);for(;;){const n=await t.read(r);if(0===n.bytesRead)break;e.push(r.slice(0,n.bytesRead))}const i=e.reduce((t,e)=>t+e.length,0),s=new Uint8Array(i);let a=0;for(const t of e)s.set(t,a),a+=t.length;n=new TextDecoder("utf-8").decode(s)}finally{await t.close()}}catch(e){const n=e instanceof Error?e.message:String(e);return Xt.warn(`Failed to read theme.toml for module ${t.path()}: ${n}`),[]}const r=(0,Yt.parse)(n);return r.module?.imports?(Xt.info(`Found ${r.module.imports.length} module imports in ${t.path()}/theme.toml`),r.module.imports.map(t=>t.path)):[]}catch(e){const n=e instanceof Error?e.message:String(e);return Xt.warn(`Failed to parse theme.toml for module ${t.path()}: ${n}`),[]}}};function Jt(t,e,n,r){return new Zt(t,e,n,r)}j();var Qt=N("module",{component:"factory"}),te=class extends Error{constructor(t,e){super(t),this.code=e,this.name="FsError"}},ee=new te("File is closed","FILE_CLOSED"),ne=(new te("out of range","OUT_OF_RANGE"),new te("too large","TOO_LARGE"),new te("file not found","FILE_NOT_FOUND")),re=(new te("file exists","FILE_EXISTS"),new te("destination exists","DESTINATION_EXISTS"),new Error("skip directory")),ie=(new te("walkway already walked","ALREADY_WALKED"),class extends te{constructor(t,e){super(t,e),this.name="OverlayFsError"}}),se=new ie("no filesystems to write to","NO_FILESYSTEMS"),ae=(new ie("operation not supported","OPERATION_NOT_SUPPORTED"),class{source;origin;publishDir;constructor(t,e,n){this.source=t,this.origin=e,this.publishDir=n}getSource(){return this.source}getOrigin(){return this.origin}publish(){return this.publishDir}});j(),N("fs",{component:"filemeta"});var oe=class{filename;componentRoot;componentDir;openFunc;constructor(t="",e=null){this.filename=t,this.componentRoot="",this.componentDir="",this.openFunc=e}fileName(){return this.filename}relativeFilename(){if(""===this.componentRoot)return this.filename;const t=this.filename.indexOf(this.componentRoot);if(-1===t)throw new Error(`filename ${this.filename} has no root ${this.componentRoot}`);let e=this.filename.substring(t+this.componentRoot.length);return e.startsWith("/")||(e="/"+e),e}component(){return this.componentDir}root(){return this.componentRoot}async open(){if(null===this.openFunc)throw new Error("OpenFunc not set");return await this.openFunc()}setFileName(t){this.filename=t}setComponentRoot(t){this.componentRoot=t}setComponentDir(t){this.componentDir=t}setOpenFunc(t){this.openFunc=t}merge(t){t&&(t.filename&&!this.filename&&(this.filename=t.filename),t.componentRoot&&!this.componentRoot&&(this.componentRoot=t.componentRoot),t.componentDir&&!this.componentDir&&(this.componentDir=t.componentDir),t.openFunc&&!this.openFunc&&(this.openFunc=t.openFunc))}};function le(t,e){return new oe(t,e)}var ce=class{fileInfo;i;constructor(t,e){this.fileInfo=t,this.i=e}meta(){return this.i}type(){return this.fileInfo.mode()}info(){return this.fileInfo}setMeta(t){this.i=t}name(){return this.fileInfo.name()}size(){return this.fileInfo.size()}mode(){return this.fileInfo.mode()}modTime(){return this.fileInfo.modTime()}isDir(){return this.fileInfo.isDir()}sys(){return this.fileInfo.sys()}fileName(){return this.i.fileName()}relativeFilename(){return this.i.relativeFilename()}component(){return this.i.component()}root(){return this.i.root()}async open(){return await this.i.open()}};function he(t,e){const n=le(e),r=new ce(t,n);return fe(t)&&r.meta().merge(t.meta()),r}function ue(t,e){const n=new ce(t,e);return fe(t)&&n.meta().merge(t.meta()),n}function fe(t){return t&&"function"==typeof t.meta}var de=m(require("path")),pe=class{file;fileMeta;fs;o;constructor(t,e,n,r=!1){this.file=t,this.fileMeta=e,this.fs=n,this.o=r}isNop(){return null===this.file}async close(){if(null!==this.file)return await this.file.close()}async readDir(t){const e=[];if(this.o&&this.file){const n=await this.file.readdir(t);for(const t of n){const n=this.joinPath(this.fileMeta.fileName(),t.name()),r=le(n,async()=>await this.fs.open(n));r.merge(this.fileMeta);const i=he(t,n);i.setMeta(r),e.push(i)}}return e}meta(){return this.fileMeta}joinPath(t,e){return t.endsWith("/")?t+e:t+"/"+e}async read(t){if(null===this.file)throw new Error("File is null");return await this.file.read(t)}async readAt(t,e){if(null===this.file)throw new Error("File is null");return await this.file.readAt(t,e)}async seek(t,e){if(null===this.file)throw new Error("File is null");return await this.file.seek(t,e)}async write(t){if(null===this.file)throw new Error("File is null");return await this.file.write(t)}async writeAt(t,e){if(null===this.file)throw new Error("File is null");return await this.file.writeAt(t,e)}name(){return de.basename(this.fileMeta.fileName())}async readdir(t){if(null===this.file)throw new Error("File is null");return await this.readDir(t)}async readdirnames(t){if(null===this.file)throw new Error("File is null");return await this.file.readdirnames(t)}async stat(){if(null===this.file)throw new Error("File is null");return await this.file.stat()}async sync(){if(null!==this.file)return await this.file.sync()}async truncate(t){if(null===this.file)throw new Error("File is null");return await this.file.truncate(t)}async writeString(t){if(null===this.file)throw new Error("File is null");return await this.file.writeString(t)}},ge=class extends pe{virtualOpener;filter;constructor(t,e=null,n=null){super(t.isNop()?null:t,t.meta(),t.fs,!0),this.virtualOpener=e,this.filter=n}async readDir(t){if(!this.isNop()){let e=await super.readDir(t);return null!==this.filter&&(e=await this.filter(e)),e}return await this.readVirtualDir()}async readVirtualDir(){if(null!==this.virtualOpener)return await this.virtualOpener();throw new Error("virtual dir opener not found")}setFilter(t){this.filter=t}setVirtualOpener(t){this.virtualOpener=t}getFilter(){return this.filter}getVirtualOpener(){return this.virtualOpener}},me=m(require("path"));j(),N("fs",{component:"basefs"});var we=class{fs;roots;constructor(t,e){this.fs=t,this.roots=e}toAbsolutePath(t){if(0===this.roots.length)return t;const e=this.roots[0];return""===t?e:me.isAbsolute(t)?t.startsWith(e)?t:me.join(e,t.substring(1)):me.join(e,t)}isSameRootedPath(t){const e=this.roots[0];return t.startsWith(me.join(e,me.sep))||t===e}async stat(t){const e=this.toAbsolutePath(t);if(!this.isSameRootedPath(e))throw new Error(`path ${t} is outside of the BaseFs root`);try{const n=await this.fs.stat(e);if(n.isDir()){const r=he(n,e);return r.meta().setOpenFunc(async()=>await this.openDir(t)),r}const r=he(n,e),i=this.getRoot(e);return r.meta().setComponentRoot(i),r.meta().setOpenFunc(async()=>await this.openInternal(t)),r}catch(t){throw t}}async open(t){const e=this.toAbsolutePath(t);return(await this.fs.stat(e)).isDir()?await this.openDir(t):await this.openInternal(t)}async openInternal(t,e=!1){const n=this.toAbsolutePath(t),r=await this.fs.open(n),i=this.getRoot(n),s=le(n);return s.setComponentRoot(i),e?function(t,e,n){return new pe(t,e,n,!0)}(r,s,this.fs):function(t,e,n){return new pe(t,e,n)}(r,s,this.fs)}getRoot(t){for(const e of this.roots)if(t.startsWith(e))return e;return""}async openDir(t){const e=await this.openInternal(t,!0),n=this.toAbsolutePath(t),r=this.getRoot(n),i=le(n);return i.setComponentRoot(r),function(t,e,n){const r=new pe(t,e,n,!0);return new ge(r)}(e,i,this.fs)}async create(t){const e=this.toAbsolutePath(t);return await this.fs.create(e)}async mkdir(t,e){const n=this.toAbsolutePath(t);return await this.fs.mkdir(n,e)}async mkdirAll(t,e){const n=this.toAbsolutePath(t);return await this.fs.mkdirAll(n,e)}async openFile(t,e,n){const r=this.toAbsolutePath(t);return await this.fs.openFile(r,e,n)}async remove(t){const e=this.toAbsolutePath(t);return await this.fs.remove(e)}async removeAll(t){const e=this.toAbsolutePath(t);return await this.fs.removeAll(e)}async rename(t,e){const n=this.toAbsolutePath(t),r=this.toAbsolutePath(e);return await this.fs.rename(n,r)}name(){return`BaseFs(${this.fs.name()})`}async chmod(t,e){const n=this.toAbsolutePath(t);return await this.fs.chmod(n,e)}async chown(t,e,n){const r=this.toAbsolutePath(t);return await this.fs.chown(r,e,n)}async chtimes(t,e,n){const r=this.toAbsolutePath(t);return await this.fs.chtimes(r,e,n)}};function ye(t,e){return new we(t,e)}var be=m(require("path"));j();var ve=N("fs",{component:"walkway"}),Ee=class{fs;root;cb;cfg;walked=!1;constructor(t,e){if(!t)throw new Error("fs must be set");if(!e.walkFn)throw new Error("walkFn must be set");this.fs=t,this.cb=e,this.root="",this.cfg={}}async walkWith(t,e){return this.cfg=e,this.root=t,await this.walk()}async walk(){if(this.walked)throw new Error("this walkway is already walked");return this.walked=!0,await this.walkRecursive(this.root,this.cfg.info,this.cfg.dirEntries)}checkErr(t,e){return!(!this.isNotExistError(e)||this.cfg.failOnNotExist||(ve.warn(`File "${t}" not found, skipping.`),0))}isNotExistError(t){return t.message.includes("ENOENT")||t.message.includes("no such file")||"ENOENT"===t.code}async walkRecursive(t,e,n){if(!e)try{const n=await this.fs.stat(t),r=le(t);r.setOpenFunc(async()=>await this.fs.open(t)),e=ue(n,r)}catch(e){if(t===this.root&&this.isNotExistError(e)){if(this.cfg.failOnNotExist)throw new te(`walk: root not found: ${e.message}`,"WALK_ROOT_NOT_FOUND");return}if(this.checkErr(t,e))return;throw new te(`walk: stat: ${e.message}`,"WALK_STAT_FAILED")}try{const n=await this.cb.walkFn(t,e);if(n instanceof Error)throw n}catch(t){if(e.isDir()&&t===re)return;throw t}if(e.isDir()){if(!n)try{const e=await this.fs.open(t),r=await e.readdir(-1);await e.close(),n=r.map(t=>t),this.cfg.sortDirEntries&&n.sort((t,e)=>t.name().localeCompare(e.name()))}catch(e){if(this.checkErr(t,e))return;throw new te(`walk: readdir: ${e.message}`,"WALK_READDIR_FAILED")}if(this.cfg.ignoreFile&&(n=n.filter(t=>!this.cfg.ignoreFile(t.fileName()))),this.cb.hookPre)try{n=await this.cb.hookPre(e,t,n)}catch(t){if(t===re)return;throw t}for(const e of n){const n=be.join(t,e.name());try{await this.walkRecursive(n,e)}catch(t){if(!e.isDir()||t!==re)throw t}}if(this.cb.hookPost)try{await this.cb.hookPost(e,t,n)}catch(t){if(t===re)return;throw t}}}};j();var ke=N("fs",{component:"static-copier"}),Se=class{fromFss;toFs;constructor(t,e){this.fromFss=t,this.toFs=e}async copy(){this.fromFss&&0!==this.fromFss.length?this.toFs?await this.doWithPublishDirs(this.toFs,async t=>{for(const e of this.fromFss)await this.copyStaticTo(e,t)}):ke.error("No publish filesystem found"):ke.error("No static filesystems found")}async doWithPublishDirs(t,e){try{await e("/")}catch(t){throw ke.error("Error in doWithPublishDirs:",t),t}}async copyStaticTo(t,e){try{return await this.walkSourceFiles(t,e)}catch(t){throw ke.error(`Error copying static files to ${e}:`,t),t}}async walkSourceFiles(t,e){let n=0;try{await this.walkFileSystem(t,"/",async(r,i)=>{i||(await this.copyFile(t,r,this.toFs,e),n++)})}catch(t){throw ke.error("Error walking source files:",t),t}return n}async walkFileSystem(t,e,n){try{const r=await t.open(e);if(!(await r.stat()).isDir())return await r.close(),void await n(e,!1);const i=await r.readdir(-1);await r.close();for(const r of i){const i=this.joinPath(e,r.name());r.isDir()?(await n(i,!0),await this.walkFileSystem(t,i,n)):await n(i,!1)}}catch(t){ke.error(`Could not read directory ${e}:`,t)}}async copyFile(t,e,n,r){let i=null,s=null;try{const a=e.startsWith("/")?e.slice(1):e,o=this.joinPath(r,a),l=this.dirname(o);"/"!==l&&await n.mkdirAll(l,493),i=await t.open(e);const c=await i.stat(),h=new Uint8Array(c.size());await i.read(h),s=await n.create(o),await s.write(h)}catch(t){ke.warn(`Failed to copy static file ${e}:`,t)}finally{if(s)try{await s.close()}catch(t){ke.warn(`Failed to close target file: ${t}`)}if(i)try{await i.close()}catch(t){ke.warn(`Failed to close source file: ${t}`)}}}joinPath(...t){return t.map(t=>t.replace(/^\/+|\/+$/g,"")).filter(t=>t.length>0).join("/").replace(/^/,"/")}dirname(t){const e=t.split("/").filter(t=>t.length>0);return e.length<=1?"/":"/"+e.slice(0,-1).join("/")}};j();var Te=N("fs",{component:"incremental-file-collector"});async function xe(t,e){try{const n=await e.stat(t),r=le(t);return r.setOpenFunc(async()=>await e.open(t)),ue(n,r)}catch(e){throw new Error(`Failed to stat file ${t}: ${e.message}`)}}var Ae=class{originFs;prompts;workflows;content;layouts;statics;assets;i18n;work;service;constructor(t,e,n,r,i,s,a,o,l){this.originFs=t,this.prompts=e,this.workflows=n,this.content=r,this.layouts=i,this.statics=s,this.assets=a,this.i18n=o,this.work=l,this.service=new $e}os(){return this.originFs.getOrigin()}workFs(){return this.work}workflowFs(){return this.workflows}promptFs(){return this.prompts}contentFs(){return this.content}layoutsFs(){return this.layouts}staticFs(){return this.statics}assetsFs(){return this.assets}publishFs(){return this.originFs.publish()}copyStatic(t,e){return new Se(t,e).copy()}newFileMetaInfo(t){return this.service.newFileMetaInfo(t)}newFileMetaInfoWithContent(t){return this.service.newFileMetaInfoWithContent(t)}async getFileMetaInfos(t){return async function(t,e){const n=new Map;let r=!1;for(const i of t)for(const t of e)try{const e=await xe(i,t);if(n.set(i,e),r=!0,r)break}catch(e){Te.error(`Failed to create FileMetaInfo for ${i} with fs=${t}:`,e)}return n}(t,this.content)}newBasePathFs(t,e){return ye(t,[e])}async walkPrompts(t,e,n){return await this.walk(this.prompts,t,e,n)}async walkWorkflows(t,e,n){return await this.walk(this.workflows,t,e,n)}async walkLayouts(t,e,n){return await this.walk(this.layouts,t,e,n)}async walkContent(t,e,n,r){await this.walk(t,e,n,r)}async walkStatics(t,e,n){return await this.walk(this.statics,t,e,n)}async walkI18n(t,e,n){return await this.walk(this.i18n,t,e,n)}async walk(t,e,n,r){const i=function(t,e){return new Ee(t,e)}(t,n);return""===e&&(e="/"),await i.walkWith(e,r)}},Ce=(t,e)=>{const n=[...t];for(const r of e){let e=!1;for(const n of t)if(r.name()===n.name()){e=!0;break}e||n.push(r)}return n},De=class t{fss;firstWritable;dirsMerger;constructor(t){this.fss=[...t.fss],this.firstWritable=t.firstWritable??!1,this.dirsMerger=t.dirsMerger??Ce}withFilesystems(...e){return new t({fss:[...this.fss,...e],firstWritable:this.firstWritable,dirsMerger:this.dirsMerger})}withFirstWritable(e){return new t({fss:this.fss,firstWritable:e,dirsMerger:this.dirsMerger})}withDirsMerger(e){return new t({fss:this.fss,firstWritable:this.firstWritable,dirsMerger:e})}getWritableFs(){return this.firstWritable&&0!==this.fss.length?this.fss[0]:null}isValid(){return void 0!==this.dirsMerger}getFilesystemCount(){return this.fss.length}getFilesystem(t){return t<0||t>=this.fss.length?null:this.fss[t]}hasFilesystem(t){return this.fss.includes(t)}getFilesystems(){return this.fss}};function Pe(t,e=!1,n){const r={fss:t,firstWritable:e};return void 0!==n&&(r.dirsMerger=n),new De(r)}function Le(t){return Pe(t,!1,Ce)}var Re=class{u;fss;dirOpeners;info;merge;err;offset;fis;closed;constructor(t={}){this.u=t.name||"",this.fss=t.fss?[...t.fss]:[],this.dirOpeners=t.dirOpeners?[...t.dirOpeners]:[],void 0!==t.info&&(this.info=t.info),this.merge=t.merge||Ce,this.offset=0,this.fis=[],this.closed=!1}name(){return this.u}isClosed(){return this.closed||0===this.fss.length&&0===this.dirOpeners.length}async readdir(t){if(this.isClosed())throw ee;if(this.err)throw this.err;0===this.offset&&await this.loadDirectoryEntries();const e=this.fis.slice(this.offset);if(t<=0){if(this.err=new Error("EOF"),this.offset>0&&0===e.length)throw this.err;return[...e]}if(0===e.length)throw this.err=new Error("EOF"),this.err;const n=e.slice(0,t);return this.offset+=n.length,n}async readdirnames(t){if(this.isClosed())throw ee;return(await this.readdir(t)).map(t=>t.name())}async loadDirectoryEntries(){for(let t=0;t<this.fss.length;t++){const e=this.fss[t];await this.readFromFilesystem(e,null)}for(let t=0;t<this.dirOpeners.length;t++){const e=await this.dirOpeners[t]();await this.readFromFilesystem(null,e)}}async readFromFilesystem(t,e){let n=e;try{if(!n&&t){const e="/"===this.u?"":this.u;n=await t.open(e)}if(!n)return;const e=await n.readdir(-1);this.fis=this.merge(this.fis,e)}catch(t){}finally{n&&!e&&await n.close()}}async stat(){if(this.isClosed())throw ee;if(this.info)return await this.info();if(this.fss.length>0)return await this.fss[0].stat(this.u);throw new ie("no filesystem available for stat","NO_FILESYSTEM")}async close(){this.closed=!0,this.fss=[],this.dirOpeners=[],this.fis=[],delete this.info,this.offset=0,delete this.err}notSupported(t){throw new ie(`operation ${t} not supported on directory "${this.u}"`,"OPERATION_NOT_SUPPORTED")}async read(t){this.notSupported("read")}async readAt(t,e){this.notSupported("readAt")}async seek(t,e){this.notSupported("seek")}async write(t){this.notSupported("write")}async writeAt(t,e){this.notSupported("writeAt")}async sync(){this.notSupported("sync")}async truncate(t){this.notSupported("truncate")}async writeString(t){this.notSupported("writeString")}},Ne=new class{pool=[];get(){return this.pool.length>0?this.pool.pop():new Re}release(t){t.fss=[],t.dirOpeners=[],t.fis=[],delete t.info,t.offset=0,t.u="",delete t.err,t.closed=!1,this.pool.push(t)}};j(),N("fs",{component:"overlayfs"});var _e=class t{fss;mergeDirs;firstWritable;constructor(t){this.fss=[...t.fss],this.mergeDirs=t.dirsMerger,this.firstWritable=t.firstWritable}name(){return"overlayfs"}filesystem(t){return t<0||t>=this.fss.length?null:this.fss[t]}numFilesystems(){return this.fss.length}append(...e){const n=new De({fss:[...this.fss,...e],firstWritable:this.firstWritable,dirsMerger:this.mergeDirs});return new t(n)}withDirsMerger(e){const n=new De({fss:this.fss,firstWritable:this.firstWritable,dirsMerger:e});return new t(n)}writeFs(){if(0===this.fss.length)throw se;return this.fss[0]}async collectDirs(t,e){for(const n of this.fss)await this.collectDirsRecursive(n,t,e)}async collectDirsRecursive(t,e,n){try{(await t.stat(e)).isDir()&&n(t)}catch(t){}const r=t;if(r.filesystem&&r.numFilesystems)for(let t=0;t<r.numFilesystems();t++){const i=r.filesystem(t);i&&await this.collectDirsRecursive(i,e,n)}}async statInternal(t,e){for(let n=0;n<this.fss.length;n++){const r=this.fss[n],[i,s,a,o]=await this.statRecursive(r,t,e);if(null===o||!this.isNotExistError(o))return[i,s,a,o]}return[null,null,!1,ne]}async statRecursive(t,e,n){try{const n=await t.stat(e);return[t,n,!1,null]}catch(e){if(!this.isNotExistError(e))return[t,null,!1,e]}const r=t;if(r.filesystem&&r.numFilesystems)for(let t=0;t<r.numFilesystems();t++){const i=r.filesystem(t);if(i){const[t,r,s,a]=await this.statRecursive(i,e,n);if(null===a||!this.isNotExistError(a))return[t,r,s,a]}}return[null,null,!1,ne]}isNotExistError(t){return t.message.includes("ENOENT")||t.message.includes("no such file")||t===ne}async create(t){if(!this.firstWritable)throw new ie("filesystem is read-only","READ_ONLY");return await this.writeFs().create(t)}async mkdir(t,e){if(!this.firstWritable)throw new ie("filesystem is read-only","READ_ONLY");return await this.writeFs().mkdir(t,e)}async mkdirAll(t,e){if(!this.firstWritable)throw new ie("filesystem is read-only","READ_ONLY");return await this.writeFs().mkdirAll(t,e)}async open(t){if(0===this.fss.length)throw ne;const[e,n,,r]=await this.statInternal(t,!1);if(r)throw r;if(n.isDir()){const e=[];if(await this.collectDirs(t,t=>{e.push(t)}),0===e.length)throw ne;return 1===e.length?await e[0].open(t):await async function(t,e,n,r){if(!n)throw new ie("info function must not be null","INFO_REQUIRED");const i=Ne.get(),s={name:t,fss:[...r],info:n,merge:e||Ce};return Object.assign(i,new Re(s)),i}(t,this.mergeDirs,async()=>n,e)}return await e.open(t)}async openFile(t,e,n){const r=!!(1&e)||!!(2&e);if(r&&!this.firstWritable)throw new ie("filesystem is read-only","READ_ONLY");return r?await this.writeFs().openFile(t,e,n):await this.open(t)}async remove(t){if(!this.firstWritable)throw new ie("filesystem is read-only","READ_ONLY");return await this.writeFs().remove(t)}async removeAll(t){if(!this.firstWritable)throw new ie("filesystem is read-only","READ_ONLY");return await this.writeFs().removeAll(t)}async rename(t,e){if(!this.firstWritable)throw new ie("filesystem is read-only","READ_ONLY");return await this.writeFs().rename(t,e)}async stat(t){const e="/"===t?"":t,[,n,,r]=await this.statInternal(e,!1);if(r)throw r;return n}async chmod(t,e){if(!this.firstWritable)throw new ie("filesystem is read-only","READ_ONLY");return await this.writeFs().chmod(t,e)}async chown(t,e,n){if(!this.firstWritable)throw new ie("filesystem is read-only","READ_ONLY");return await this.writeFs().chown(t,e,n)}async chtimes(t,e,n){if(!this.firstWritable)throw new ie("filesystem is read-only","READ_ONLY");return await this.writeFs().chtimes(t,e,n)}};function Oe(t){return new _e(t)}var Ie=class{u;T;C;constructor(t,e="This is a virtual file."){this.u=t,this.T=e,this.C=new Date}name(){return this.u}size(){return Buffer.byteLength(this.T,"utf8")}mode(){return 420}modTime(){return this.C}isDir(){return!1}sys(){return null}getContent(){return this.T}},Me=class{D;L;R=null;constructor(t,e){this.D=t,this.L=e}fullName(){return this.D}async open(){return{name:()=>this.D,close:async()=>{},read:async t=>{const e=Buffer.from(this.L,"utf8"),n=Math.min(t.length,e.length);return e.copy(t,0,0,n),{bytesRead:n,buffer:t}},readAt:async(t,e)=>{const n=Buffer.from(this.L,"utf8"),r=Math.min(e,n.length),i=Math.min(t.length,n.length-r);return i>0&&n.copy(t,0,r,r+i),{bytesRead:i,buffer:t}},seek:async(t,e)=>t,write:async t=>({bytesWritten:t.length,buffer:t}),writeAt:async(t,e)=>({bytesWritten:t.length,buffer:t}),readdir:async t=>[],readdirnames:async t=>[],stat:async()=>this.getFileInfo(),sync:async()=>{},truncate:async t=>{},writeString:async t=>({bytesWritten:Buffer.byteLength(t,"utf8")})}}getFileInfo(){return this.R||(this.R=new Ie(this.D,this.L)),this.R}},Fe=null,$e=class{newFileMetaInfo(t){return function(t){const e=(Fe||(Fe=new Me("/content/file.txt","This is a virtual file.")),Fe.getFileInfo()),n=le(t);return new ce(e,n)}(t)}newFileMetaInfoWithContent(t){return function(t){const e=function(t){const e=Math.floor(1e6*Math.random()).toString().padStart(6,"0");return new Me(`/content/file_${e}.md`,t)}(t),n=e.getFileInfo(),r=le(e.fullName(),()=>e.open());return r.setComponentRoot("content"),r.setComponentDir("content"),new ce(n,r)}(t)}},Ue=class{create(t){return Oe(Le(t))}createWithOptions(t){return function(t){const e=new De(t);return new _e(e)}(t)}createReadOnly(t){return Oe(Le(t))}createWritable(t){const e=function(t){return Pe(t,!0,void 0)}(t);return Oe(e)}createWithMerger(t,e){return Oe(Le(t).withDirsMerger(e))}};function Be(t){return(new Ue).createReadOnly(t)}var qe=m(require("path"));j(),N("fs",{component:"filesystemscollector"});var je=class{from;to;toBase;constructor(t,e,n=""){this.from=t,this.to=e,this.toBase=n}fs(t){return ye(t,[this.to])}},He=class{sourceProject;overlayMountsPrompt;overlayMountsWorkflow;overlayMountsContent;overlayMountsLayouts;overlayMountsStatics;overlayMountsAssets;overlayMountsI18n;constructor(t){this.sourceProject=t,this.overlayMountsPrompt=Be([]),this.overlayMountsWorkflow=Be([]),this.overlayMountsContent=[],this.overlayMountsLayouts=Be([]),this.overlayMountsStatics=Be([]),this.overlayMountsAssets=Be([]),this.overlayMountsI18n=Be([])}async collect(t){const e=t.all();for(const t of e){const e=[],n=[],r=[],i=[],s=[],a=[],o=[],l=e=>qe.isAbsolute(e)?["",e]:[t.dir(),this.absPathify(t.dir(),e)],c=t.mounts();for(const t of c){const[c,h]=l(t.source()),u=new je(t.target(),h,c).fs(this.sourceProject);this.isPrompts(t.target())?n.push(u):this.isWorkflows(t.target())?e.push(u):this.isContent(t.target())?r.push(u):this.isLayouts(t.target())?i.push(u):this.isStatics(t.target())?s.push(u):this.isAssets(t.target())?a.push(u):this.isI18n(t.target())&&o.push(u)}if(e.length>0&&(this.overlayMountsWorkflow=this.overlayMountsWorkflow.append(...e)),n.length>0&&(this.overlayMountsPrompt=this.overlayMountsPrompt.append(...n)),t.isProjectModule())for(const t of r){let e=Be([]);e=e.append(t),this.overlayMountsContent.push(e)}i.length>0&&(this.overlayMountsLayouts=this.overlayMountsLayouts.append(...i)),s.length>0&&(this.overlayMountsStatics=this.overlayMountsStatics.append(...s)),a.length>0&&(this.overlayMountsAssets=this.overlayMountsAssets.append(...a)),o.length>0&&(this.overlayMountsI18n=this.overlayMountsI18n.append(...o))}}isPrompts(t){return"prompts"===t||t.startsWith("prompts/")||t.startsWith("/prompts/")}isWorkflows(t){return"workflows"===t||t.startsWith("workflows/")||t.startsWith("/workflows/")}isContent(t){return"content"===t||t.startsWith("content/")||t.startsWith("/content/")}isLayouts(t){return"layouts"===t||t.startsWith("layouts/")||t.startsWith("/layouts/")}isStatics(t){return"static"===t||t.startsWith("static/")||t.startsWith("/static/")}isAssets(t){return"assets"===t||t.startsWith("assets/")||t.startsWith("/assets/")}isI18n(t){return"i18n"===t||t.startsWith("i18n/")||t.startsWith("/i18n/")}absPathify(t,e){return qe.resolve(t,e)}},ze=m(require("fs/promises")),We=m(require("path"));j();var Ge=N("fs",{component:"osfs"}),Ve=class{constructor(t,e){this.stats=t,this.u=e}name(){return this.u}size(){return this.stats.size}mode(){return this.stats.mode}modTime(){return this.stats.mtime}isDir(){return this.stats.isDirectory()}sys(){return this.stats}},Ye=class{constructor(t,e="r"){this.filePath=t,this.flags=e}handle=null;closed=!1;position=0;async ensureOpen(){this.handle||this.closed||(this.handle=await ze.open(this.filePath,this.flags))}async close(){if(this.handle){try{await this.handle.close()}catch(t){throw Ge.error(`❌ Error closing file handle for ${this.filePath}:`,t),t}this.handle=null}this.closed=!0}async read(t){if(this.closed)throw new Error("File is closed");if(await this.ensureOpen(),!this.handle)throw new Error("Failed to open file");const e=await this.handle.read(t,0,t.length,this.position);return this.position+=e.bytesRead,{bytesRead:e.bytesRead,buffer:t}}async readAt(t,e){if(this.closed)throw new Error("File is closed");if(await this.ensureOpen(),!this.handle)throw new Error("Failed to open file");return{bytesRead:(await this.handle.read(t,0,t.length,e)).bytesRead,buffer:t}}async seek(t,e){if(this.closed)throw new Error("File is closed");switch(e){case 0:default:this.position=t;break;case 1:this.position+=t;break;case 2:if(await this.ensureOpen(),this.handle){const e=await this.handle.stat();this.position=e.size+t}}return this.position}async write(t){if(this.closed)throw new Error("File is closed");if(await this.ensureOpen(),!this.handle)throw new Error("Failed to open file");const e=await this.handle.write(t,0,t.length,this.position);return this.position+=e.bytesWritten,{bytesWritten:e.bytesWritten,buffer:t}}async writeAt(t,e){if(this.closed)throw new Error("File is closed");if(await this.ensureOpen(),!this.handle)throw new Error("Failed to open file");return{bytesWritten:(await this.handle.write(t,0,t.length,e)).bytesWritten,buffer:t}}name(){return this.filePath}async readdir(t){if(this.closed)throw new Error("File is closed");const e=await ze.readdir(this.filePath,{withFileTypes:!0}),n=[],r=t>0?Math.min(t,e.length):e.length;for(let t=0;t<r;t++){const r=e[t],i=We.join(this.filePath,r.name),s=await ze.stat(i);n.push(new Ve(s,r.name))}return n}async readdirnames(t){if(this.closed)throw new Error("File is closed");const e=await ze.readdir(this.filePath);return t>0?e.slice(0,t):e}async stat(){if(this.closed)throw new Error("File is closed");const t=await ze.stat(this.filePath);return new Ve(t,We.basename(this.filePath))}async sync(){if(this.closed)throw new Error("File is closed");await this.ensureOpen(),this.handle&&await this.handle.sync()}async truncate(t){if(this.closed)throw new Error("File is closed");await this.ensureOpen(),this.handle&&(await this.handle.truncate(t),this.position>t&&(this.position=t))}async writeString(t){const e=Buffer.from(t,"utf8");return{bytesWritten:(await this.write(e)).bytesWritten}}},Ke=class{async create(t){return await ze.writeFile(t,""),new Ye(t,"w+")}async mkdir(t,e){await ze.mkdir(t,{mode:e})}async mkdirAll(t,e){await ze.mkdir(t,{mode:e,recursive:!0})}async open(t){return await ze.access(t),(await ze.stat(t)).isDirectory(),new Ye(t,"r")}async openFile(t,e,n){let r="r";return 1&e&&(r="w"),2&e&&(r="r+"),64&e&&(r="w"),512&e&&(r="w"),1024&e&&(r="a"),new Ye(t,r)}async remove(t){(await ze.stat(t)).isDirectory()?await ze.rmdir(t):await ze.unlink(t)}async removeAll(t){await ze.rm(t,{recursive:!0,force:!0})}async rename(t,e){await ze.rename(t,e)}async stat(t){const e=await ze.stat(t);return new Ve(e,We.basename(t))}name(){return"OsFs"}async chmod(t,e){await ze.chmod(t,e)}async chown(t,e,n){await ze.chown(t,e,n)}async chtimes(t,e,n){await ze.utimes(t,e,n)}};var Xe="page",Ze="home",Je="section",Qe="taxonomy",tn="term",en="sitemap",nn="404",rn=class{buffer;position;capacity;constructor(t=1024){this.capacity=t,this.buffer=new Uint8Array(this.capacity),this.position=0}async write(t){this.ensureCapacity(t.length),this.buffer.set(t,this.position),this.position+=t.length}async writeString(t){const e=(new TextEncoder).encode(t);await this.write(e)}async writeByte(t){this.ensureCapacity(1),this.buffer[this.position]=t,this.position++}bytes(){return this.buffer.slice(0,this.position)}length(){return this.position}truncate(t){if(t<0||t>this.position)throw new Error("Invalid truncate size");this.position=t}ensureCapacity(t){const e=this.position+t;if(e<=this.capacity)return;const n=Math.max(2*this.capacity,e),r=new Uint8Array(n);r.set(this.buffer),this.buffer=r,this.capacity=n}},sn=class{constructor(t=[]){this.fragments=t}toHTML(t,e,n){if(0===this.fragments.length)return"";const r=this.filterByLevel(this.fragments,t,e);if(0===r.length)return"";const i=n?"ol":"ul";return`<${i}>\n${this.renderFragments(r,n)}</${i}>\n`}filterByLevel(t,e,n){return t.filter(t=>t.level>=e&&t.level<=n).map(t=>{const r={id:t.id,text:t.text,level:t.level};return t.children&&(r.children=this.filterByLevel(t.children,e,n)),r})}renderFragments(t,e){const n=e?"ol":"ul";return t.map(t=>{let r=` <li><a href="#${t.id}">${this.escapeHTML(t.text)}</a>`;return t.children&&t.children.length>0&&(r+=`\n <${n}>\n${this.renderFragments(t.children,e)} </${n}>`),r+="</li>",r}).join("\n")}escapeHTML(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}addFragment(t){this.fragments.push(t)}getFragments(){return[...this.fragments]}},an=class{constructor(t,e,n=[],r=[],i=[]){this.u=t,this.N=e,this._=n,this.O=r,this.M=i}name(){return this.u}level(){return this.N}links(){return[...this._]}paragraphs(){return[...this.O]}listParagraphs(){return[...this.M]}addLink(t){this._.push(t)}addParagraph(t){this.O.push(t)}addListParagraph(t){this.M.push(t)}},on=class{fragments=[];stack=[];addHeading(t,e,n){for(;this.stack.length>0&&this.stack[this.stack.length-1].level>=e;)this.stack.pop();const r={id:n,text:t,level:e,children:[]};if(0===this.stack.length)this.fragments.push(r);else{const t=this.stack[this.stack.length-1];t.children||(t.children=[]),t.children.push(r)}this.stack.push(r)}build(){return new sn(this.fragments)}reset(){this.fragments=[],this.stack=[]}},ln=class{usedIds=new Set;generateID(t,e="github"){let n;switch(e){case"github":default:n=this.githubStyle(t);break;case"github-ascii":n=this.githubAsciiStyle(t);break;case"blackfriday":n=this.blackfridayStyle(t)}if(this.usedIds.has(n)){let t=1,e=`${n}-${t}`;for(;this.usedIds.has(e);)t++,e=`${n}-${t}`;n=e}return this.usedIds.add(n),n}githubStyle(t){return t.toLowerCase().replace(/[^\w\u4e00-\u9fff\s-]/g,"").replace(/\s+/g,"-").replace(/^-+|-+$/g,"")}githubAsciiStyle(t){return t.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").replace(/^-+|-+$/g,"")}blackfridayStyle(t){return t.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/^-+|-+$/g,"")}reset(){this.usedIds.clear()}},cn=class{constructor(t,e){this.wrappedContent=t,this.innerContent=e}wrapped(){return this.wrappedContent}inner(){return this.innerContent}},hn=class{constructor(t){this.config=t}async highlight(t,e,n){if(!e||"text"===e||"plain"===e)return this.escapeHTML(t);const r=this.escapeHTML(t),i=`language-${e}`;return this.config.lineNos?this.addLineNumbers(r,i):`<code class="${i}">${r}</code>`}async highlightCodeBlock(t,e){const n=t.type(),r=t.inner(),i=await this.highlight(r,n,e);return new cn(`<pre>${i}</pre>`,i)}async renderCodeblock(t,e,n){const r=await this.highlightCodeBlock(n);await e.writeString(r.wrapped())}isDefaultCodeBlockRenderer(){return!0}escapeHTML(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}addLineNumbers(t,e){const n=t.split("\n").map((t,n)=>{const r=n+this.config.lineNoStart;return this.config.lineNumbersInTable?`<tr><td class="line-number">${r}</td><td class="line-code"><code class="${e}">${t}</code></td></tr>`:`<span class="line-number">${r}</span><code class="${e}">${t}</code>`});return this.config.lineNumbersInTable?`<table class="code-table"><tbody>${n.join("")}</tbody></table>`:n.join("\n")}};j();var un=class{Type;Err;low;high;segments;firstByte;isString;content;bytes;constructor(){this.Type=0,this.Err=null,this.low=0,this.high=0,this.segments=[],this.firstByte=0,this.isString=!1,this.content="",this.bytes=[]}Pos(){return this.segments.length>0?this.segments[0].Low:this.low}Val(t){if(0===this.segments.length)return t.slice(this.low,this.high);if(1===this.segments.length)return t.slice(this.segments[0].Low,this.segments[0].High);const e=[];for(const n of this.segments)e.push(t.slice(n.Low,n.High));const n=e.reduce((t,e)=>t+e.length,0),r=new Uint8Array(n);let i=0;for(const t of e)r.set(t,i),i+=t.length;return r}ValStr(t){return(new TextDecoder).decode(this.Val(t))}ValTyped(t){const e=this.ValStr(t);if(this.isString)return e;if(fn.test(e))return"true"===e;if(dn.test(e)){const t=parseInt(e,10);return isNaN(t)?e:t}if(pn.test(e)){const t=parseFloat(e);return isNaN(t)?e:t}return e}IsText(){return 18===this.Type||17===this.Type}IsIndentation(){return 17===this.Type}IsNonWhitespace(t){return this.ValStr(t).trim().length>0}IsShortcodeName(){return 13===this.Type}IsInlineShortcodeName(){return 14===this.Type}IsLeftShortcodeDelim(){return 10===this.Type||8===this.Type}IsRightShortcodeDelim(){return 11===this.Type||9===this.Type}IsShortcodeClose(){return 12===this.Type}IsShortcodeParam(){return 15===this.Type}IsShortcodeParamVal(){return 16===this.Type}IsShortcodeMarkupDelimiter(){return 10===this.Type||11===this.Type}IsFrontMatter(){return this.Type>=3&&this.Type<=6}IsDone(){return 0===this.Type||1===this.Type}IsEOF(){return 1===this.Type}IsError(){return 0===this.Type}ToString(t){const e=this.Val(t),n=this.ValStr(t),r=function(t){const e=t;return e<0||e>=mn.length-1?`ItemType(${e})`:gn.slice(mn[e],mn[e+1])}(this.Type);switch(!0){case 1===this.Type:return"EOF";case 0===this.Type:return n;case 17===this.Type:return`${r}:[${i=n,i.replace(/ /g,"␣").replace(/\t/g,"→")}]`;case this.Type>19:return`<${n}>`;case e.length>50:return`${r}:${n.substring(0,20)}...`;default:return`${r}:[${n}]`}var i}},fn=/^(true|false)$/,dn=/^[-+]?\d+$/,pn=/^[-+]?\d*\.\d+$/,gn="tErrortEOFTypeLeadSummaryDividerTypeFrontMatterYAMLTypeFrontMatterTOMLTypeFrontMatterJSONTypeFrontMatterORGTypeIgnoretLeftDelimScNoMarkuptRightDelimScNoMarkuptLeftDelimScWithMarkuptRightDelimScWithMarkuptScClosetScNametScNameInlinetScParamtScParamValtIndentationtTexttKeywordMarker",mn=[0,6,10,32,51,70,89,107,117,137,158,180,203,211,218,231,239,250,262,267,281],wn=-1,yn=(new Uint8Array([239,187,191]),(new TextEncoder).encode("\x3c!--more--\x3e")),bn=(new TextEncoder).encode("# more"),vn=(new TextEncoder).encode("+++"),En=(new TextEncoder).encode("---"),kn=(new TextEncoder).encode("#+"),Sn=(new TextEncoder).encode("{{"),Tn=(new TextEncoder).encode("{{<"),xn=(new TextEncoder).encode(">}}"),An=(new TextEncoder).encode("{{%"),Cn=(new TextEncoder).encode("%}}"),Dn=(new TextEncoder).encode("/*"),Pn=(new TextEncoder).encode("*/"),Ln=(new TextEncoder).encode("inline "),Rn=class{l;skipAll;handlers;skipIndexes;constructor(t){this.l=t,this.skipAll=!1,this.handlers=[],this.skipIndexes=[]}skip(){if(this.skipAll)return-1;this.skipIndexes=[];let t=!1;for(const e of this.handlers){if(e.skipAll)continue;const n=e.skip();-1!==n&&(t=!0,this.skipIndexes.push(n))}return t?function(...t){let e=-1;for(const n of t)n<0||(-1===e||n<e)&&(e=n);return e}(...this.skipIndexes):(this.skipAll=!0,-1)}lex(t){if(this.skipAll)return null;this.l.pos>this.l.start&&this.l.emit(18);for(const e of this.handlers){if(e.skipAll)continue;const[n,r]=e.lexFunc(t,e.l);if(null===n||r)return n}return this.l.pos++,t}},Nn=class{l;skipAll;skipFunc;lexFunc;constructor(t,e,n){this.l=t,this.skipAll=!1,this.skipFunc=e,this.lexFunc=n}skip(){if(this.skipAll)return-1;const t=this.skipFunc(this.l);return-1===t&&(this.skipAll=!0),t}};function _n(t){return 32===t||9===t}function On(t){return Mn(t)||45===t}function In(t){return 13===t||10===t}function Mn(t){return 95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57}var Fn=class{items;lastPos;constructor(t){this.items=t,this.lastPos=-1}Next(){return this.lastPos++,this.Current()}Current(){if(this.lastPos>=this.items.length){const t=new un;return t.Type=0,t.Err=new Error("no more tokens"),t}return this.items[this.lastPos]}Backup(){if(this.lastPos<0)throw new Error("need to go forward before going back");this.lastPos--}Pos(){return this.lastPos}IsValueNext(){const t=this.Peek();return 0!==t.Type&&1!==t.Type}Peek(){return this.items[this.lastPos+1]}PeekWalk(t){for(let e=this.lastPos+1;e<this.items.length&&t(this.items[e]);e++);}Consume(t){for(let e=0;e<t;e++){const t=this.Next();if(0===t.Type||1===t.Type){this.Backup();break}}}LineNumber(t){const e=new Uint8Array([10]),n=t.slice(0,this.Current().low);let r=0;for(let t=0;t<n.length;t++)n[t]===e[0]&&r++;return r+1}},$n=class{input;stateStart;state;pos;start;width;sectionHandlers;cfg;summaryDivider;summaryDividerChecked;lexerShortcodeState;items;err;inFrontMatter;parenDepth;constructor(t,e,n){this.input=t,this.stateStart=e,this.state=null,this.pos=0,this.start=0,this.width=0,this.cfg=n,this.summaryDivider=null,this.summaryDividerChecked=!1,this.err=null,this.items=[],this.inFrontMatter=!1,this.parenDepth=0,this.lexerShortcodeState={currLeftDelimItem:8,currRightDelimItem:9,isInline:!1,currShortcodeName:"",closingState:0,elementStepNum:0,paramElements:0,paramState:0,openShortcodes:{}},this.lexSummaryDivider=this.lexSummaryDivider.bind(this),this.lexMainSection=this.lexMainSection.bind(this),this.lexIdentifierInShortcode=this.lexIdentifierInShortcode.bind(this),this.lexEndOfShortcode=this.lexEndOfShortcode.bind(this),this.lexShortcodeLeftDelim=this.lexShortcodeLeftDelim.bind(this),this.lexShortcodeRightDelim=this.lexShortcodeRightDelim.bind(this),this.lexShortcodeParam=this.lexShortcodeParam.bind(this),this.lexShortcodeValue=this.lexShortcodeValue.bind(this),this.lexShortcodeValueQuoted=this.lexShortcodeValueQuoted.bind(this),this.lexShortcodeValueUnquoted=this.lexShortcodeValueUnquoted.bind(this),this.lexInsideShortcode=this.lexInsideShortcode.bind(this),this.lexDone=this.lexDone.bind(this),this.sectionHandlers=function(t){const e=new Rn(t),n=new Nn(t,t=>t.index(Sn),(t,e)=>{if(!e.isShortCodeStart())return[t,!1];if(e.lexerShortcodeState.isInline){const t=e.input.slice(e.pos+3),n=function(t){for(let e=0;e<t.length;e++)if(!_n(t[e])){if(47===t[e])return e;break}return-1}(t);if(n!==e.input.length-1){const r=(new TextDecoder).decode(t.slice(n+1)).trim();if(-1===n||!r.startsWith(e.lexerShortcodeState.currShortcodeName+" "))return[e.errorf("inline shortcodes do not support nesting"),!0]}}return e.hasPrefix(An)?(e.lexerShortcodeState.currLeftDelimItem=10,e.lexerShortcodeState.currRightDelimItem=11):(e.lexerShortcodeState.currLeftDelimItem=8,e.lexerShortcodeState.currRightDelimItem=9),[e.lexShortcodeLeftDelim,!0]}),r=new Nn(t,t=>t.summaryDividerChecked||!t.summaryDivider?-1:t.index(t.summaryDivider),(t,e)=>e.summaryDivider&&e.hasPrefix(e.summaryDivider)?(e.summaryDividerChecked=!0,e.pos+=e.summaryDivider.length,e.consumeSpace(),e.emit(2),[t,!0]):[t,!1]);return e.handlers=[n,r],e.skipIndexes=new Array(e.handlers.length),e}(this)}Iterator(){return t=this.items,new Fn(t);var t}Input(){return this.input}run(){for(this.state=this.stateStart;null!==this.state;)this.state=this.state(this);return this}next(){if(this.pos>=this.input.length)return this.width=0,wn;const t=this.input[this.pos];return this.width=1,this.pos+=this.width,t}peek(){const t=this.next();return this.backup(),t}backup(){this.pos-=this.width}append(t){t.Pos()<this.input.length&&(7===t.Type&&239===this.input[t.Pos()]?t.firstByte=239:t.firstByte=this.input[t.Pos()]),this.items.push(t)}emit(t){const e=()=>{this.start=this.pos};if(18===t)for(let n=this.pos-1;n>=this.start;n--){const r=this.input[n];if(32!==r&&9!==r&&13!==r&&10!==r)break;if(n===this.start&&10!==r){const t=new un;return t.Type=17,t.low=this.start,t.high=this.pos,this.append(t),void e()}if(10===r&&n<this.pos-1){const r=new un;r.Type=t,r.low=this.start,r.high=n+1,this.append(r);const i=new un;return i.Type=17,i.low=n+1,i.high=this.pos,this.append(i),void e()}if(10===r&&n===this.pos-1)break}const n=new un;n.Type=t,n.low=this.start,n.high=this.pos,n.low<this.input.length&&(7===t&&239===this.input[n.low]?n.firstByte=239:n.firstByte=this.input[n.low]),this.append(n),e()}emitString(t){const e=new un;e.Type=t,e.low=this.start,e.high=this.pos,e.isString=!0,this.pos>this.start&&(e.firstByte=this.input[this.start]),this.items.push(e),this.start=this.pos}isEOF(){return this.pos>=this.input.length}ignoreEscapesAndEmit(t,e){let n=this.start,r=n;const i=[];for(;n<this.pos;){const t=1;92===this.input[n]&&(n>r&&i.push({Low:r,High:n}),r=n+t),n+=t}if(r<this.pos&&i.push({Low:r,High:this.pos}),i.length>0){const e=new un;e.Type=t,e.segments=i,i[0].High>i[0].Low&&(e.firstByte=this.input[i[0].Low]),this.items.push(e),this.start=this.pos}this.start=this.pos}current(){return this.input.slice(this.start,this.pos)}ignore(){this.start=this.pos}errorf(t,...e){const n=new Error(t.replace(/%[a-z]/g,()=>String(e.shift()))),r=new un;return r.Type=0,r.Err=n,r.low=this.start,r.high=this.pos,this.append(r),null}consumeCRLF(){let t=!1;const e=this.peek();return 13===e?(this.next(),10===this.peek()&&(this.next(),t=!0)):10===e&&(this.next(),t=!0),t}consumeToSpace(){for(;;){const t=this.next();if(t===wn||_n(t))return void this.backup()}}consumeSpace(){for(;;){const t=this.next();if(t===wn||!this.isUnicodeSpace(t))return void this.backup()}}isUnicodeSpace(t){return 32===t||9===t||10===t||12===t||13===t||133===t||160===t||8192===t||8193===t||8194===t||8195===t||8196===t||8197===t||8198===t||8199===t||8200===t||8201===t||8202===t||8232===t||8233===t||8239===t||8287===t||12288===t}index(t){const e=this.input.slice(this.pos),n=t.length,r=e.length;if(n>r)return-1;t:for(let i=0;i<=r-n;i++){for(let r=0;r<n;r++)if(e[i+r]!==t[r])continue t;return i}return-1}hasPrefix(t){if(this.pos+t.length>this.input.length)return!1;for(let e=0;e<t.length;e++)if(this.input[this.pos+e]!==t[e])return!1;return!0}isShortCodeStart(){return this.hasPrefix(An)||this.hasPrefix(Tn)}lexFrontMatterSection(t,e,n,r){for(let t=0;t<2;t++)if(this.next()!==e)return this.errorf(`invalid ${n} delimiter`);let i,s=this.consumeCRLF();for(this.ignore();;){if(!s&&(i=this.next(),i===wn))return this.errorf(`EOF looking for end ${n} front matter delimiter`);if((s||In(i))&&this.hasPrefix(r)){this.emit(t),this.pos+=3,this.consumeCRLF(),this.ignore();break}s=!1}return()=>this.lexMainSection()}currentLeftShortcodeDelimItem(){return this.lexerShortcodeState.currLeftDelimItem}currentRightShortcodeDelimItem(){return this.lexerShortcodeState.currRightDelimItem}currentLeftShortcodeDelim(){return 10===this.lexerShortcodeState.currLeftDelimItem?An:Tn}currentRightShortcodeDelim(){return 11===this.lexerShortcodeState.currRightDelimItem?Cn:xn}lexIdentifier(){for(;;)if(!On(this.next()))return this.backup(),0===(new TextDecoder).decode(this.input.slice(this.start,this.pos)).length||this.emit(15),null}lexMainSection(){if(this.isEOF())return()=>this.lexDone();const t=this.sectionHandlers.skip();if(-1===t)return this.pos=this.input.length,()=>this.lexDone();t>0&&(this.pos+=t);const e=this.sectionHandlers.lex(this.lexMainSection);return null!==e?e:(this.pos=this.input.length,this.lexDone)}lexInlineShortcodeContent(){for(;;){if(this.pos>=this.input.length)return this.errorf("unclosed inline shortcode");if(this.hasPrefix(An)||this.hasPrefix(Tn))return this.errorf("inline shortcodes do not support nesting");if(this.hasPrefix(this.currentRightShortcodeDelim()))return this.backup(),this.pos>this.start&&this.emit(18),()=>this.lexShortcodeRightDelim();this.next()}}lexIdentifierInShortcode(){let t=!1;for(;;){const e=this.next();switch(!0){case On(e):case 47===e:break;case 46===e:if(this.lexerShortcodeState.isInline=this.hasPrefix(Ln),!this.lexerShortcodeState.isInline)return this.errorf("period in shortcode name only allowed for inline identifiers");break;default:this.backup();const n=(new TextDecoder).decode(this.input.slice(this.start,this.pos));return this.lexerShortcodeState.closingState>0&&!this.lexerShortcodeState.openShortcodes[n]?this.errorf(`closing tag for shortcode '${n}' does not match start tag`):(this.lexerShortcodeState.closingState>0&&(this.lexerShortcodeState.openShortcodes[n]=!1,t=!0),this.lexerShortcodeState.closingState=0,this.lexerShortcodeState.currShortcodeName=n,this.lexerShortcodeState.openShortcodes[n]=!0,this.lexerShortcodeState.elementStepNum++,this.lexerShortcodeState.isInline?this.emit(14):this.emit(13),t?()=>this.lexEndOfShortcode():this.lexInsideShortcode)}}}lexEndOfShortcode(){return this.lexerShortcodeState.isInline=!1,this.hasPrefix(this.currentRightShortcodeDelim())?()=>this.lexShortcodeRightDelim():!0!==_n(this.next())?this.errorf("unclosed shortcode"):(this.ignore(),()=>this.lexEndOfShortcode())}lexShortcodeLeftDelim(){return this.pos+=this.currentLeftShortcodeDelim().length,this.isComment()?()=>this.lexComment():(this.emit(this.lexerShortcodeState.currLeftDelimItem),this.lexerShortcodeState.elementStepNum=0,this.lexerShortcodeState.paramElements=0,this.lexerShortcodeState.paramState=0,this.start=this.pos,this.lexInsideShortcode)}peekString(t){const e=(Uint8Array,t.length);if(this.pos+e>this.input.length)return null;const n=this.input.slice(this.pos,this.pos+e);if(t instanceof Uint8Array){for(let r=0;r<e;r++)if(n[r]!==t[r])return null;return(new TextDecoder).decode(n)}{const e=(new TextDecoder).decode(n);return e===t?e:null}}lexSummaryDivider(){if(!this.hasPrefix(yn))return null;if(this.start<this.pos){const t=new un;t.Type=18,t.low=this.start,t.high=this.pos,t.low<this.input.length&&(t.firstByte=this.input[t.low]),this.append(t)}const t=new un;return t.Type=2,t.low=this.pos,t.high=this.pos+yn.length,t.low<this.input.length&&(t.firstByte=this.input[t.low]),this.append(t),this.pos+=yn.length,this.start=this.pos,()=>this.lexMainSection()}handleBOM(){if(this.pos+3<=this.input.length){const t=this.input.slice(this.pos,this.pos+3);if(239===t[0]&&187===t[1]&&191===t[2]){const t=new un;return t.Type=7,t.low=this.pos,t.high=this.pos+3,t.firstByte=239,this.append(t),this.pos+=3,this.start=this.pos,!0}}return!1}lexIntroSection(){this.summaryDivider=yn,0===this.pos&&this.handleBOM();t:for(;;){const t=this.next();if(t===wn)break;switch(!0){case 43===t:if(this.hasPrefix(vn.slice(1)))return()=>this.lexFrontMatterSection(4,t,"TOML",vn);this.backup();break t;case 45===t:if(this.hasPrefix(En.slice(1)))return()=>this.lexFrontMatterSection(3,t,"YAML",En);this.backup();break t;case 123===t:return Un;case 35===t:return Bn;case 65279===t:this.emit(7);break;case!_n(t)&&!In(t):break t}}return()=>this.lexMainSection()}lexInsideShortcode(){if(this.hasPrefix(this.currentRightShortcodeDelim()))return this.lexShortcodeRightDelim;const t=this.next();if(t===wn)return this.errorf("unclosed shortcode action");if(_n(t)||In(t))this.ignore();else{if(61===t){this.consumeSpace(),this.ignore();const t=this.peek();return 34===t||92===t?this.lexShortcodeQuotedParamVal(92!==t,16):96===t?this.lexShortCodeParamRawStringVal(16):this.lexShortcodeParamVal}if(47===t){if(""===this.lexerShortcodeState.currShortcodeName)return this.errorf("got closing shortcode, but none is open");this.lexerShortcodeState.closingState++,this.lexerShortcodeState.isInline=!1,this.emit(12)}else{if(92!==t)return this.lexerShortcodeState.elementStepNum>0&&(On(t)||34===t||96===t)?(this.backup(),this.lexShortcodeParam(!1)):Mn(t)?(this.backup(),this.lexIdentifierInShortcode):this.errorf(`unrecognized character in shortcode action: U+${t.toString(16).toUpperCase()} '${String.fromCharCode(t)}'. Note: Parameters with non-alphanumeric args must be quoted`);if(this.ignore(),34===this.peek()||96===this.peek())return this.lexShortcodeParam(!0)}}return this.lexInsideShortcode}lexShortcodeParam(t){let e,n=!0,r=!1;for(;;){if(e=this.next(),n){if(34===e||96===e&&!t)return 2===this.lexerShortcodeState.paramElements?this.errorf("got quoted positional parameter. Cannot mix named and positional parameters"):(this.lexerShortcodeState.paramElements=1,this.backup(),34===e?()=>this.lexShortcodeQuotedParamVal(!t,15):()=>this.lexShortCodeParamRawStringVal(15));if(96===e&&t)return this.errorf("unrecognized escape character");n=!1}else if(61===e){this.backup(),r=!0;break}if(!On(e)&&46!==e){this.backup();break}}if(0===this.lexerShortcodeState.paramElements)this.lexerShortcodeState.paramElements++,r&&this.lexerShortcodeState.paramElements++;else{if(r&&1===this.lexerShortcodeState.paramElements)return this.errorf(`got named parameter '${(new TextDecoder).decode(this.current())}'. Cannot mix named and positional parameters`);if(!r&&2===this.lexerShortcodeState.paramElements)return this.errorf(`got positional parameter '${(new TextDecoder).decode(this.current())}'. Cannot mix named and positional parameters`)}return this.emit(15),this.lexInsideShortcode}lexShortcodeParamVal(){const t=this.next();if(_n(t))return this.ignore(),()=>this.lexShortcodeParamVal();switch(this.backup(),t){case 34:return this.next(),this.ignore(),()=>this.lexShortcodeQuotedParamVal(!1,16);case 96:return this.next(),this.ignore(),()=>this.lexShortCodeParamRawStringVal(16);default:return()=>this.lexShortcodeValueUnquoted()}}lexShortcodeValueUnquoted(){for(;;){const t=this.next();if(t===wn||_n(t)||this.isRightShortcodeDelim())return this.backup(),this.pos>this.start&&this.emit(16),this.lexInsideShortcode}}lexShortcodeQuotedParamVal(t,e){let n=!1,r=!1,i=0;t:for(;;){const e=this.next();switch(!0){case 92===e:if(34===this.peek()){if(n&&!t){this.backup();break t}n&&(r=!0,i=1)}else if(96===this.peek())return this.errorf("unrecognized escape character");break;case e===wn:case 10===e:return this.errorf(`unterminated quoted string in shortcode parameter-argument: '${(new TextDecoder).decode(this.current())}'`);case 34===e:if(0===i){if(n){this.backup();break t}n=!0,this.ignore()}else i=0}}r?this.ignoreEscapesAndEmit(e,!0):this.emitString(e);const s=this.next();return 92===s?34===this.peek()&&(this.ignore(),this.next(),this.ignore()):34===s?this.ignore():this.backup(),this.lexInsideShortcode}lexShortCodeParamRawStringVal(t){let e=!1;t:for(;;)switch(this.next()){case 96:if(e){this.backup();break t}e=!0,this.ignore();break;case wn:return this.errorf(`unterminated raw string in shortcode parameter-argument: '${(new TextDecoder).decode(this.input.slice(this.start,this.pos))}'`)}return this.emitString(t),this.next(),this.ignore(),this.lexInsideShortcode}lexDone(){return this.pos>this.start&&this.emit(18),this.emit(1),null}lexShortcodeRightDelim(){return this.pos+=this.currentRightShortcodeDelim().length,this.emit(this.lexerShortcodeState.currRightDelimItem),this.lexerShortcodeState.closingState=0,()=>this.lexMainSection()}lexShortcodeValue(){switch(this.next()){case wn:return this.errorf("unterminated quoted string in shortcode parameter");case 32:case 9:return this.ignore(),()=>this.lexShortcodeValue();case 34:return this.ignore(),()=>this.lexShortcodeValueQuoted();default:return this.backup(),()=>this.lexShortcodeValueUnquoted()}}lexShortcodeValueQuoted(){for(;;)switch(this.next()){case wn:return this.errorf("unterminated quoted string in shortcode parameter");case 92:34===this.peek()&&this.next();break;case 34:return this.backup(),this.emitString(16),this.next(),this.ignore(),this.lexInsideShortcode}}isRightShortcodeDelim(){return this.hasPrefix(this.currentRightShortcodeDelim())}lexComment(){const t=this.index(new Uint8Array([...Pn,...this.currentRightShortcodeDelim()]));return t<=1?this.errorf("comment must be closed"):(this.emit(18),this.pos+=Dn.length,this.ignore(),this.pos+=t-Dn.length,this.emit(18),this.pos+=Pn.length,this.ignore(),this.pos+=this.currentRightShortcodeDelim().length,this.emit(18),this.lexMainSection)}isComment(){return!(this.pos+2>this.input.length)&&47===this.input[this.pos]&&42===this.input[this.pos+1]}};function Un(t){t.backup();let e=!1,n=0;for(;;){const r=t.next();switch(!0){case r===wn:return t.errorf("unexpected EOF parsing JSON front matter");case 123===r:e||n++;break;case 125===r:e||n--;break;case 34===r:e=!e;break;case 92===r:t.next()}if(0===n)break}return t.consumeCRLF(),t.emit(5),()=>t.lexMainSection()}function Bn(t){if(t.summaryDivider=bn,t.backup(),!t.hasPrefix(kn))return()=>t.lexMainSection();t:for(;;){const e=t.next();switch(!0){case 10===e:if(!t.hasPrefix(kn))break t;break;case e===wn:break t}}return t.emit(6),()=>t.lexMainSection()}function qn(t){return t.lexIntroSection()}var jn=N("markdown",{component:"pageparser"});j();var Hn=N("markdown",{component:"parseinfo"}),zn=class{source;posMainContent=-1;itemsStep1=[];handlers;constructor(t,e){this.source=t,this.handlers=e,this.validateHandlers()}validateHandlers(){if(!this.handlers.frontMatterHandler())throw new Error("no front matter handler");if(!this.handlers.summaryHandler())throw new Error("no summary handler");if(!this.handlers.shortcodeHandler())throw new Error("no shortcode handler");if(!this.handlers.bytesHandler())throw new Error("no bytes handler")}isEmpty(){return 0===this.itemsStep1.length}async parse(){const t=function(t,e={}){const[n,r]=function(t,e){const[n,r]=function(t,e){const n=function(t,e,n){return new $n(t,qn,n)}(t,0,e);return n.run(),[n,null]}(t,e);return r?[[],r]:[n.items,n.err]}(t,e);if(r)throw jn.error("Error parsing bytes:",r),r;return n}(this.source,{});this.itemsStep1=t}async handle(){if(this.isEmpty())return;const t=new Fn(this.itemsStep1);for(;;){const e=t.Next();try{if(7===e.Type)Hn.info(`Ignoring item at position ${e.Pos()}: ${e.ValStr(this.source)}`);else if(e.IsFrontMatter()){await this.handlers.frontMatterHandler()(e);const n=t.Peek();n.IsDone()||(this.posMainContent=n.Pos())}else if(2===e.Type)await this.handlers.summaryHandler()(e,t);else if(e.IsLeftShortcodeDelim()){t.Backup();const e=t.Current();await this.handlers.shortcodeHandler()(e,t)}else{if(e.IsEOF())break;if(e.IsError())throw Hn.error(`Error parsing item at position ${e.Pos()}: ${e.Err}`),this.createError(e.Err||new Error("Unknown parsing error"),e);await this.handlers.bytesHandler()(e)}}catch(t){throw this.createError(t,e)}}}getMainContentPosition(){return this.posMainContent}getItems(){return this.itemsStep1}getSource(){return this.source}createError(t,e){const n=function(t,e,n){const r="string"==typeof e?(i=e,(new TextEncoder).encode(i)):e;var i;if(n<0)return{filename:"",line:1,column:1,offset:0};let s=1,a=1;for(let t=0;t<Math.min(n,r.length);t++)10===r[t]?(s++,a=1):a++;return{filename:"",line:s,column:a,offset:n}}(0,this.source,e.Pos()),r=new Error(`${t.message} at line ${n.line}, column ${n.column}`);return r.position=n,r}};j();var Wn=N("markdown",{component:"vo/shortcode"}),Gn=class{name;params;pos;length;rawContent;placeholder;inline;closed;inner;ordinal;indentation;doMarkup;isClosing;info;templs;constructor(t=0,e="",n=null,r=0,i=0,s=!1,a=!1){this.ordinal=t,this.name=e,this.params=n,this.pos=r,this.length=i,this.rawContent="",this.inline=s,this.closed=a,this.doMarkup=!1,this.isClosing=!1,this.placeholder="",this.inner=[]}needsInner(){return!this.inline}},Vn=class{shortcodes=[];nameSet=new Set;source;ordinal=0;pid;openShortcodes=new Map;paramElements=0;constructor(t,e=Date.now()){this.source=t,this.pid=e}parseItem(t,e){const n=this.extractShortcode(this.ordinal,0,e);if(!n)throw new Error("Failed to extract shortcode");n.pos=t.Pos()+t.ValStr(this.source).length,n.length=e.Current().Pos()+e.Current().ValStr(this.source).length-n.pos;const r=this.source.slice(n.pos,n.pos+n.length);return n.rawContent=(new TextDecoder).decode(r),n.name&&this.nameSet.add(n.name),n.params??=[],n.placeholder=Kn("s",this.pid,this.ordinal),this.ordinal++,this.shortcodes.push(n),n}extractShortcode(t,e,n){const r=new Gn(t);if(n.Pos()>0){n.Backup();const t=n.Next();t.IsIndentation()&&(r.indentation=t.ValStr(this.source))}let i=0,s=0;const a=e+1;let o=!1;const l="failed to extract shortcode";let c=0;for(;;){const t=n.Next();if(t.IsLeftShortcodeDelim()){const e=n.Peek();if(e.IsRightShortcodeDelim())throw new Error("shortcode has no name");if(e.IsShortcodeClose())continue;if(i>0){n.Backup();const t=this.extractShortcode(s,a,n);s++,t&&t.name&&(this.nameSet.add(t.name),Array.isArray(r.inner)||(r.inner=[]),r.inner.push(t))}else r.doMarkup=t.IsShortcodeMarkupDelimiter();i++}else if(t.IsRightShortcodeDelim()){if(!r.inline&&!r.needsInner())return this.openShortcodes.set(r.name,!1),r}else{if(t.IsShortcodeClose()){o=!0;const t=n.Peek();if(!r.inline&&!r.needsInner()){if(t.IsError())continue;throw new Error(`${l}: shortcode "${r.name}" does not evaluate .Inner or .InnerDeindent, yet a closing tag was provided`)}return t.IsRightShortcodeDelim()?n.Consume(1):(r.isClosing=!0,n.Consume(2)),r.inline||this.openShortcodes.set(r.name,!1),r}if(t.IsText()){Array.isArray(r.inner)||(r.inner=[]);const e=t.ValStr(this.source);r.inner.push(e)}else if(t.IsShortcodeName()||t.IsInlineShortcodeName()){if(r.name=t.ValStr(this.source).trim(),r.inline=t.IsInlineShortcodeName(),this.openShortcodes.has(r.name)&&this.openShortcodes.get(r.name))throw new Error(`shortcode ${r.name} nested in itself`);if(r.inline||this.openShortcodes.set(r.name,!0),r.inline){const t=this.source.slice(n.Pos()+3),e=Xn(t,"/");if(e!==this.source.length-1){const n=(new TextDecoder).decode(t.slice(e+1));if(-1===e||!n.startsWith(r.name+" "))throw new Error("inline shortcodes do not support nesting")}}}else if(t.IsShortcodeParam()){if(!n.IsValueNext()){Wn.warn(`${l}: shortcode "${r.name}" has a parameter without a value`);continue}if(n.Peek().IsShortcodeParamVal())if(null===r.params||void 0===r.params){const e={},i=t.ValStr(this.source);n.Next(),e[i]=n.Current().ValTyped(this.source),r.params=e}else{if(Array.isArray(r.params))throw new Error(`${l}: invalid state: invalid param type Array for shortcode "${r.name}", expected a map`);{const e=t.ValStr(this.source);n.Next(),r.params[e]=n.Current().ValTyped(this.source)}}else if(null===r.params||void 0===r.params){const e=[];e.push(t.ValTyped(this.source)),r.params=e}else{if(!Array.isArray(r.params))throw new Error(`${l}: invalid state: invalid param type Object for shortcode "${r.name}", expected an array`);r.params.push(t.ValTyped(this.source))}}else if(t.IsShortcodeParamVal()){if(0===c&&(c=1),Array.isArray(r.params))r.params.push(t.ValTyped(this.source));else if(null===r.params||void 0===r.params){const e=[];e.push(t.ValTyped(this.source)),r.params=e}}else if(t.IsDone()){if(!t.IsError()&&!o&&r.needsInner())throw new Error(`${l}: shortcode "${r.name}" must be closed or self-closed`);n.Backup();break}}}return r.inline||this.openShortcodes.set(r.name,!1),r}getShortcodes(){return this.shortcodes}getNames(){return Array.from(this.nameSet)}},Yn=(Kn("TOC",0,0),"HAHAHUGOSHORTCODE");function Kn(t,e,n){return`${Yn}${t}${e}${n}HBHB`}function Xn(t,e){const n=e.charCodeAt(0);for(let e=0;e<t.length;e++)if(!Zn(t[e])&&t[e]===n)return e;return-1}function Zn(t){return 32===t||9===t||13===t||10===t}var Jn=class{type;mainType;subType;delimiter;firstSuffix;mimeSuffix;suffixesCSV;constructor(t){this.type=t.type,this.mainType=t.mainType,this.subType=t.subType,this.delimiter=t.delimiter,this.firstSuffix=t.firstSuffix,this.mimeSuffix=t.mimeSuffix,this.suffixesCSV=t.suffixesCSV}sub(){if(this.subType)return this.subType;const t=this.type.split("/");return 2===t.length?t[1].split("+")[0]:""}getMimeSuffix(){if(this.mimeSuffix)return this.mimeSuffix;const t=this.type.indexOf("+");return-1!==t?this.type.substring(t+1):void 0}getSuffixList(){return this.suffixesCSV?this.suffixesCSV.split(","):[]}};j(),N("markdown",{component:"content"});var Qn="HUGOMORE42",tr=(new TextEncoder).encode(`\n\n${Qn}\n\n`),er=class{hasSummaryDivider=!1;summaryTruncated=!1;rawSource;items=[];renderer;constructor(t,e){this.rawSource=t,this.renderer=e}isEmpty(){return!this.rawSource||0===this.rawSource.length}setSummaryDivider(){this.hasSummaryDivider=!0}getHasSummaryDivider(){return this.hasSummaryDivider}setSummaryTruncated(){this.summaryTruncated=!0}getTruncated(){return this.summaryTruncated}addReplacement(t,e){const n={val:t,source:e};this.items.push(n)}addShortcode(t){this.items.push(t)}addItem(t){this.items.push(t)}addItems(...t){this.items.push(...t)}rawContent(){return(new TextDecoder).decode(this.rawSource)}pureContent(){const t=[],e=new TextDecoder,n=new TextEncoder;for(const e of this.items)if(this.isItem(e)){const n=this.rawSource.slice(e.Pos(),e.Pos()+e.Val(this.rawSource).length);t.push(n)}else this.isContentReplacement(e)?t.push(e.val):this.isShortcode(e)&&t.push(n.encode(e.placeholder));const r=t.reduce((t,e)=>t+e.length,0),i=new Uint8Array(r);let s=0;for(const e of t)i.set(e,s),s+=e.length;return e.decode(i)}pureContentWithoutPlaceholder(){const t=[],e=new TextDecoder;for(const e of this.items)if(this.isItem(e)){const n=this.rawSource.slice(e.Pos(),e.Pos()+e.Val(this.rawSource).length);t.push(n)}else this.isContentReplacement(e)?t.push(e.val):this.isShortcode(e);const n=t.reduce((t,e)=>t+e.length,0),r=new Uint8Array(n);let i=0;for(const e of t)r.set(e,i),i+=e.length;return e.decode(r)}renderedContent(t){let e=this.pureContent();if(t)for(const n of this.items)if(this.isShortcode(n)){const r=t(n);e=e.replace(n.placeholder,r)}return e}async renderedContentAsync(t){let e=await this.renderer.render(this.pureContent());if(t)for(const n of this.items)if(this.isShortcode(n))try{const r=await t(n);e=e.replace(n.placeholder,r)}catch(t){}return e}getItems(){return[...this.items]}getShortcodes(){return this.items.filter(this.isShortcode)}getTextItems(){return this.items.filter(this.isItem)}getReplacements(){return this.items.filter(this.isContentReplacement)}extractSummary(t,e){const n=(new TextDecoder).decode(t),r=this.extractSummaryFromHTML(e,n,70,this.containsCJK(n)),i=r.summaryLowHigh.high>r.summaryLowHigh.low?n.substring(r.summaryLowHigh.low,r.summaryLowHigh.high).trim():"";if(i)return this.summaryTruncated=r.truncated,{summary:i,truncated:r.truncated};const s=this.trimShortHTML(t);return this.summaryTruncated=s.length<t.length,{summary:(new TextDecoder).decode(t),truncated:this.summaryTruncated}}extractSummaryFromHTML(t,e,n,r){const i={source:e,summaryLowHigh:{low:0,high:e.length},truncated:!1};if(n<=0)return i;let s=0;const a=e.split(/\s+/);for(let t=0;t<a.length&&s<n;t++){const o=a[t].trim();if(0!==o.length&&!this.isProbablyHTMLToken(o)){if(r){const t=this.stripHTML(o),e=[...t].length;s+=t.length===t.replace(/[^\u0000-\u007F]/g,"").length?1:e}else s+=1;if(s>=n){const n=a.slice(0,t+1).join(" "),r=e.indexOf(n)+n.length;i.summaryLowHigh={low:0,high:Math.min(r,e.length)},i.truncated=!0;break}}}return i}containsCJK(t){return/[\u4e00-\u9fff\u3400-\u4dbf\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af]/.test(t)}isProbablyHTMLToken(t){return">"===t||/^<\/?[A-Za-z]+>?$/.test(t)||/^[A-Za-z]+=["']/.test(t)}stripHTML(t){return t.replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim()}trimShortHTML(t){const e=new TextDecoder,n=new TextEncoder;let r=e.decode(t);return 1===(r.match(/<p>/g)||[]).length&&(r=r.trim(),r.startsWith("<p>")&&r.endsWith("</p>")&&(r=r.slice(3,-4).trim())),n.encode(r)}cleanDividerPlaceholders(t){return this.hasSummaryDivider?t.replace(new RegExp(Qn,"g"),""):t}getDividedSummary(t){const e=t;if(this.hasSummaryDivider){const t=e.indexOf(Qn);if(-1!==t)return e.substring(0,t).trim()}return""}async getRenderedSummary(t,e){if(this.hasSummaryDivider&&t)return this.getDividedSummary(t);const n=this.pureContentWithoutPlaceholder(),r=(new TextEncoder).encode(n),i=new Jn({type:"text/html",mainType:"text",subType:"html",delimiter:".",firstSuffix:{suffix:"html",fullSuffix:".html"},mimeSuffix:"",suffixesCSV:"html"}),s=this.extractSummary(r,i);let a=s.summary;return s.truncated&&(a+="..."),e&&a.length>e&&(a=a.substring(0,e).trim()+"..."),await this.renderer.render(a)}getWordCount(){return this.pureContent().trim().split(/\s+/).filter(t=>t.length>0).length}getReadingTime(t=200){const e=this.getWordCount();return Math.ceil(e/t)}isItem(t){return"Type"in t&&"firstByte"in t&&"low"in t&&"high"in t}isShortcode(t){return"name"in t&&"placeholder"in t&&"params"in t}isContentReplacement(t){return"val"in t&&"source"in t}},nr=m(require("js-yaml")),rr=require("smol-toml"),ir=class{constructor(t){this.buffer=t}bytes(){return this.buffer.bytes()}toString(){return(new TextDecoder).decode(this.bytes())}},sr=class{constructor(t,e){this.parsingResult=t,this.renderingResult=e}headers(){return this.parsingResult.headers()}tableOfContents(){return this.parsingResult.tableOfContents()}bytes(){return this.renderingResult.bytes()}};j();var ar=N("markdown",{component:"MarkdownImpl"}),or=class{constructor(t,e){this.renderer=t,this.highlighter=e}async render(t,e){const n=await this.parse(t),r=await this.renderToBytes(t,e,n);return new sr(n,r)}async highlight(t,e,n){return this.highlighter.highlight(t,e,n)}async highlightCodeBlock(t,e){return this.highlighter.highlightCodeBlock(t,e)}async renderCodeblock(t,e,n){return this.highlighter.renderCodeblock(t,e,n)}isDefaultCodeBlockRenderer(){return this.highlighter.isDefaultCodeBlockRenderer()}async prepareRender(t){const e=await this.parseContent(t),n=e.frontMatter?.params,r=await this.renderer.parse(e.content.pureContent());return{frontMatter:()=>n||{},toc:()=>r.tableOfContents(),render:async t=>{const r=await e.content.renderedContentAsync(t.shortcodeRenderer),i=await e.content.getRenderedSummary(r,t.maxSummaryLength),s=e.content.getWordCount(),a=e.content.getReadingTime(t.wordsPerMinute),o={renderedContent:e.content.cleanDividerPlaceholders(r),wordCount:s,readingTime:a};return n&&(o.frontMatter=n),i&&(o.summary=i),o}}}async parseAndRenderContent(t,e={}){const n=await this.parseContent(t),r=n.frontMatter?.params;let i;i=e.shortcodeRenderer&&n.shortcodes.length>0?await n.content.renderedContentAsync(e.shortcodeRenderer):n.content.pureContent();const s=await this.renderer.render(i);if(this.hasCollectedTagsSupport()){const t=this.getCollectedTags();if(t.length>0){const e=r||{},i=Array.isArray(e.tags)?e.tags:e.tags?[e.tags]:[],s=[...new Set([...i,...t])];e.tags=s,n.frontMatter&&(n.frontMatter.params=e),ar.debug(`Merged tags: YAML [${i.join(", ")}] + inline [${t.join(", ")}] = [${s.join(", ")}]`)}}const a=n.content.getDividedSummary(s),o={renderedContent:s,wordCount:n.content.getWordCount(),readingTime:n.content.getReadingTime(e.wordsPerMinute)};return r&&(o.frontMatter=r),a&&(o.summary=a),o}hasCollectedTagsSupport(){return"function"==typeof this.renderer.getCollectedTags}getCollectedTags(){return this.hasCollectedTagsSupport()?this.renderer.getCollectedTags():[]}async parseContent(t){let e;const n=new er(t,this.renderer),r=new Vn(t),i=[],s=function(t,e){return new zn(t,e)}(t,{frontMatterHandler:()=>n=>{e=this.parseFrontMatter(n,t)},summaryHandler:()=>(e,r)=>{let i=-1;r.PeekWalk(e=>(-1!==i||e.IsDone()||(i=e.Pos()),!e.IsNonWhitespace(t)||(n.setSummaryTruncated(),!1))),n.setSummaryDivider(),n.addReplacement(tr,e)},shortcodeHandler:()=>(t,e)=>{const s=r.parseItem(t,e);i.push(s),n.addShortcode(s)},bytesHandler:()=>t=>{n.addItem(t)}});return await s.parse(),await s.handle(),{frontMatter:e,content:n,shortcodes:i,summary:await n.getRenderedSummary(),wordCount:n.getWordCount(),readingTime:n.getReadingTime()}}parseFrontMatter(t,e){const n=t.ValStr(e);let r,i={};switch(t.Type){case 3:r="yaml",i=this.parseYAML(n);break;case 4:r="toml",i=this.parseTOML(n);break;case 5:r="json",i=this.parseJSON(n);break;case 6:r="org",i=this.parseOrg(n);break;default:r="yaml"}return{params:i,format:r}}parseYAML(t){try{const e=nr.load(t);return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}catch(t){return{}}}parseTOML(t){try{const e=(0,rr.parse)(t);return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}catch(t){return{}}}parseJSON(t){try{return JSON.parse(t)}catch(t){return{}}}parseOrg(t){const e={},n=t.split("\n");for(const t of n){const n=t.trim();if(!n.startsWith("#+"))continue;const r=n.match(/^#\+([^:]+):\s*(.*)$/);if(r){const t=r[1].trim().toLowerCase(),n=r[2].trim();e[t]=this.parseValue(n)}}return e}parseValue(t){if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);if("true"===t)return!0;if("false"===t)return!1;if(/^-?\d+$/.test(t))return parseInt(t,10);if(/^-?\d*\.\d+$/.test(t))return parseFloat(t);if(t.startsWith("[")&&t.endsWith("]")){const e=t.slice(1,-1).trim();return e?e.split(",").map(t=>this.parseValue(t.trim())):[]}return t}async parse(t){const e=(new TextDecoder).decode(t.src);return await this.renderer.parse(e)}async renderToBytes(t,e,n){const r=(new TextDecoder).decode(t.src),i=await this.renderer.render(r),s=new rn;return await s.writeString(i),new ir(s)}},lr=m(require("markdown-it")),cr=class{F=[];$;tokens;source;idGenerator;constructor(t,e,n){this.tokens=t,this.source=e,this.idGenerator=n||new ln,this.$=this.buildTableOfContents(),this.F=this.extractHeaders()}headers(){return[...this.F]}tableOfContents(){return this.$}getTokens(){return[...this.tokens]}getSource(){return this.source}buildTableOfContents(){const t=new on;for(const e of this.tokens)if("heading_open"===e.type){const n=parseInt(e.tag.substring(1)),r=this.findNextTextToken(e);if(r){const e=r.content,i=this.idGenerator.generateID(e);t.addHeading(e,n,i)}}return t.build()}extractHeaders(){const t=[];for(let e=0;e<this.tokens.length;e++){const n=this.tokens[e];if("heading_open"===n.type){const r=parseInt(n.tag.substring(1)),i=this.findNextTextToken(n,e);if(i){const e=new an(i.content,r);t.push(e)}}}return t}findNextTextToken(t,e){for(let n=void 0!==e?e+1:this.tokens.indexOf(t)+1;n<this.tokens.length;n++){const t=this.tokens[n];if("inline"===t.type)return t;if("heading_close"===t.type)break}return null}};function hr(t,e){t=function(t){return t.startsWith("/")&&(t=t.substring(1)),t.endsWith("/")&&(t=t.slice(0,-1)),t}(t);let n=(r=t,r.match(/\.[A-Za-z0-9]+$/)?.[0]);var r;const i=t.replace(new RegExp(n+"$"),"");(e||[".md",".html",void 0].includes(n))&&(n="");let s=function(t){return t.split("/").map(t=>t.replace(/\s/g,"-").replace(/&/g,"-and-").replace(/%/g,"-percent").replace(/\?/g,"").replace(/#/g,"")).join("/").replace(/\/$/,"")}(i);return function(t,e){return t===e||t.endsWith("/"+e)}(s,"_index")&&(s=s.replace(/_index$/,"index")),s+n}function ur(t){let[e,n]=t.split("#",2);return e.endsWith(".pdf")?[e,void 0===n?"":`#${n}`]:(n=void 0===n?"":"#"+n.toLowerCase().trim().replace(/\s+/g,"-").replace(/[^\w\u4e00-\u9fa5\-]+/g,"").replace(/\-+/g,"-").replace(/^-+|-+$/g,""),[e,n])}var fr=/^https?:\/\//i,dr=new RegExp(/!?\[\[([^\[\]\|\#\\]+)?(#+[^\[\]\|\#\\]+)?(\\?\|[^\[\]\#]*)?\]\]/g),pr=new RegExp(/^\|([^\n])+\|\n(\|)( ?:?-{3,}:? ?\|)+\n(\|([^\n])+\|\n?)+/gm),gr=new RegExp(/(!?\[\[[^\]]*?\]\]|\[\^[^\]]*?\])/g);function mr(t,e){const n=t.pos,r=t.posMax;if(n+5>r)return!1;const i=33===t.src.charCodeAt(n),s=i?1:0;if(91!==t.src.charCodeAt(n+s)||91!==t.src.charCodeAt(n+s+1))return!1;let a=n+s+2,o=!1;for(;a<r-1;){if(93===t.src.charCodeAt(a)&&93===t.src.charCodeAt(a+1)){o=!0;break}a++}if(!o)return!1;const l=t.src.slice(n+s+2,a);if(0===l.trim().length)return!1;const c=l.indexOf("|"),h=l.indexOf("#");let u,f="",d="";if(-1!==c){const t=l.slice(0,c);u=l.slice(c+1).trim();const e=t.indexOf("#");-1!==e?(f=t.slice(0,e).trim(),d=t.slice(e).trim()):f=t.trim()}else-1!==h?(f=l.slice(0,h).trim(),d=l.slice(h).trim()):f=l.trim();if(!e){const e=i?"wikilink_embed":"wikilink_link",n=t.push(e,"",0),r={isEmbed:i,filepath:f,anchor:d,alias:u,url:f+d};n.meta=r,n.content=u||f}return t.pos=a+2,!0}function wr(t,e){const n=t[e].meta,[r,i]=ur(n.url),s=hr(r),a=vr(n.alias??n.filepath);return`<a class="internal" data-slug="${s}" data-wikilink="${vr(n.url)}">${a}</a>`}var yr=new RegExp(/^(?<alt>(?!^\d*x?\d*$).*?)?(\|?\s*?(?<width>\d+)(x(?<height>\d+))?)?$/);function br(t,e){const n=t[e].meta,{filepath:r,anchor:i,alias:s}=n,a=hr(r),o=function(t){const e=t.toLowerCase().match(/\.[a-z0-9]+$/);return e?e[0]:""}(r);if([".png",".jpg",".jpeg",".gif",".bmp",".svg",".webp"].includes(o)){const{alt:t,width:e,height:n}=function(t){if(!t)return{alt:"",width:"auto",height:"auto"};const e=yr.exec(t);return e&&e.groups?{alt:e.groups.alt||"",width:e.groups.width||"auto",height:e.groups.height||"auto"}:{alt:t,width:"auto",height:"auto"}}(s);return`<img src="${a}" alt="${vr(t)}" width="${e}" height="${n}" />`}return[".mp4",".webm",".ogv",".mov",".mkv"].includes(o)?`<video src="${a}" controls></video>`:[".mp3",".webm",".wav",".m4a",".ogg",".3gp",".flac"].includes(o)?`<audio src="${a}" controls></audio>`:[".pdf"].includes(o)?`<iframe src="${a}" class="pdf"></iframe>`:`<blockquote class="transclude" data-url="${a}" data-block="${i}"><a href="${a+i}" class="transclude-inner">Transclude of ${a}</a></blockquote>`}function vr(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function Er(t,e){!1!==e?.enable&&(t.inline.ruler.before("link","wikilink",mr),t.renderer.rules.wikilink_link=wr,t.renderer.rules.wikilink_embed=br)}function kr(t,e){const n=t.pos;if(n+2>t.posMax)return!1;if(35!==t.src.charCodeAt(n))return!1;if(n>0){const e=t.src.charCodeAt(n-1);if(32!==e&&10!==e&&9!==e)return!1}const r=t.src.slice(n),i=/^#((?:[-_\p{L}\p{Emoji}\p{M}\d])+(?:\/[-_\p{L}\p{Emoji}\p{M}\d]+)*)/u.exec(r);if(!i)return!1;const s=i[0],a=i[1];if(/^[\/\d]+$/.test(a))return!1;if(!e){const e=t.push("tag","",0),n=a.split("/").map(t=>t.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^\p{L}\p{Emoji}\p{M}\d\-_]/gu,"")).join("/"),r=t.md.q,i={rawTag:a,slugTag:n,url:`${r?.tagBaseURL||"tags/"}${n}`};e.meta=i,e.content=a,r?.onTagFound&&r.onTagFound(n)}return t.pos=n+s.length,!0}function Sr(t,e){const n=t[e].meta,r=n.rawTag.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;");return`<a href="${n.url}" class="internal tag-link">${r}</a>`}function Tr(t,e){const n={enable:!0,tagBaseURL:"tags/",...e};!1!==n.enable&&(t.q={tagBaseURL:n.tagBaseURL,onTagFound:n.onTagFound},t.inline.ruler.before("emphasis","tag",kr),t.renderer.rules.tag=Sr)}new RegExp(/(?<=^| )#((?:[-_\p{L}\p{Emoji}\p{M}\d])+(?:\/[-_\p{L}\p{Emoji}\p{M}\d]+)*)/gu);var xr=m(require("markdown-it/lib/token.mjs")),Ar={note:"note",abstract:"abstract",summary:"abstract",tldr:"abstract",info:"info",todo:"todo",tip:"tip",hint:"tip",important:"tip",success:"success",check:"success",done:"success",question:"question",help:"question",faq:"question",warning:"warning",caution:"warning",attention:"warning",failure:"failure",fail:"failure",missing:"failure",danger:"danger",error:"danger",bug:"bug",example:"example",quote:"quote",cite:"quote"},Cr=/^\[\!([\w-]+)\|?(.+?)?\]([+-]?)/;function Dr(t,e){if("blockquote_open"!==t[e].type)return null;let n=e+1;for(;n<t.length&&"paragraph_open"!==t[n].type;){if("blockquote_close"===t[n].type)return null;n++}if(n>=t.length)return null;const r=n+1;if("inline"!==t[r].type)return null;const i=t[r].content,s=i.match(Cr);if(!s)return null;const[a,o,l="",c]=s;var h;return{type:function(t){const e=t.toLowerCase();return Ar[e]??t}(o.toLowerCase()),title:i.split("\n")[0].slice(a.length).trim()||(h=o.replace(/-/g," ")).charAt(0).toUpperCase()+h.slice(1),collapse:c,metadata:l,firstLineIdx:r}}function Pr(t,e,n){const r=Dr(t,e);if(!r)return e;const{type:i,title:s,collapse:a,metadata:o,firstLineIdx:l}=r;let c=e+1,h=1;for(;c<t.length&&h>0;)"blockquote_open"===t[c].type&&h++,"blockquote_close"===t[c].type&&h--,c++;c--,t[e].type="callout_open",t[e].tag="div",t[e].attrSet("class",`callout ${i}${a?" is-collapsible":""}${"-"===a?" is-collapsed":""}`),t[e].attrSet("data-callout",i),a&&t[e].attrSet("data-callout-fold",a),o&&t[e].attrSet("data-callout-metadata",o);const u=t[l],f=u.content.split("\n"),d=f[0],p=d.match(Cr);if(p){const e=p[0],n=d.slice(e.length).trim(),r=f.slice(1);if(u.content=n,r.length>0&&r.join("\n").trim()){const e=l+1,n=new xr.default("paragraph_open","p",1),i=new xr.default("inline","",0);i.content=r.join("\n").trim(),i.children=[];const s=new xr.default("paragraph_close","p",-1);t.splice(e+1,0,n,i,s),c+=3}}let g=e+1;for(;g<c&&"paragraph_open"!==t[g].type;)g++;let m=g+1;for(;m<c&&"paragraph_close"!==t[m].type;)m++;const w=[],y=new xr.default("callout_title_open","div",1);y.attrSet("class","callout-title"),w.push(y);const b=new xr.default("callout_icon","div",0);b.attrSet("class","callout-icon"),w.push(b);const v=new xr.default("callout_title_inner_open","div",1);v.attrSet("class","callout-title-inner"),w.push(v);const E=new xr.default("inline","",0);E.content=s,E.children=[],w.push(E);const k=new xr.default("callout_title_inner_close","div",-1);if(w.push(k),a){const t=new xr.default("callout_fold_icon","div",0);t.attrSet("class","fold-callout-icon"),w.push(t)}const S=new xr.default("callout_title_close","div",-1);w.push(S),t.splice(g,m-g+1),c-=m-g+1,t.splice(e+1,0,...w),c+=w.length;const T=e+1+w.length;if(T<c){const e=new xr.default("callout_content_open","div",1);e.attrSet("class","callout-content"),t.splice(T,0,e),c++;const n=new xr.default("callout_content_close","div",-1);t.splice(c,0,n),c++}return t[c].type="callout_close",t[c].tag="div",c}function Lr(t){let e=0,n=0;for(;e<t.tokens.length;)"blockquote_open"===t.tokens[e].type&&Dr(t.tokens,e)?(Pr(t.tokens,e,t.md),n++,e++):e++;return n>0}function Rr(t,e){!1!=={enable:!0,...e}.enable&&(t.core.ruler.after("block","callout",Lr),function(t){t.renderer.rules.callout_open=(t,e)=>{const n=t[e];return`<div${n.attrs?n.attrs.map(t=>{return` ${t[0]}="${e=t[1],e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}"`;var e}).join(""):""}>`},t.renderer.rules.callout_close=()=>"</div>\n",t.renderer.rules.callout_title_open=(t,e)=>'<div class="callout-title">',t.renderer.rules.callout_title_close=()=>"</div>",t.renderer.rules.callout_title_inner_open=()=>'<div class="callout-title-inner">',t.renderer.rules.callout_title_inner_close=()=>"</div>",t.renderer.rules.callout_icon=()=>'<div class="callout-icon"></div>',t.renderer.rules.callout_fold_icon=()=>'<div class="fold-callout-icon"></div>',t.renderer.rules.callout_content_open=()=>'<div class="callout-content">',t.renderer.rules.callout_content_close=()=>"</div>"}(t))}function Nr(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function _r(t,e){const n=t.pos,r=t.posMax;if(36!==t.src.charCodeAt(n))return!1;if(n>0&&92===t.src.charCodeAt(n-1))return!1;if(36===t.src.charCodeAt(n+1))return!1;let i=n+1,s=!1;for(;i<r;){const e=t.src.charCodeAt(i);if(10===e)return!1;if(36===e&&92!==t.src.charCodeAt(i-1)){s=!0;break}i++}if(!s)return!1;const a=t.src.slice(n+1,i);if(0===a.trim().length)return!1;if(!e){const e=t.push("math_inline","math",0);e.content=a,e.markup="$"}return t.pos=i+1,!0}function Or(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(i+2>s)return!1;if(36!==t.src.charCodeAt(i)||36!==t.src.charCodeAt(i+1))return!1;if("$$"!==t.src.slice(i,s).trim())return!1;let a=e+1,o=!1;for(;a<n;){if(i=t.bMarks[a]+t.tShift[a],s=t.eMarks[a],"$$"===t.src.slice(i,s).trim()){o=!0;break}a++}if(!o)return!1;const l=[];for(let n=e+1;n<a;n++){const e=t.bMarks[n]+t.tShift[n],r=t.eMarks[n];l.push(t.src.slice(e,r))}const c=l.join("\n");if(!r){const n=t.push("math_block","math",0);n.content=c,n.markup="$$",n.block=!0,n.map=[e,a+1]}return t.line=a+1,!0}function Ir(t,e){return`<span class="math math-inline" data-math="inline">${Nr(t[e].content)}</span>`}function Mr(t,e){return`<div class="math math-display" data-math="block">${Nr(t[e].content)}</div>\n`}function Fr(t,e){!1!==e?.enable&&(t.inline.ruler.before("escape","math_inline",_r),t.block.ruler.before("fence","math_block",Or,{alt:["paragraph","reference","blockquote","list"]}),t.renderer.rules.math_inline=Ir,t.renderer.rules.math_block=Mr)}function $r(t,e){if(!1===e?.enable)return;const n=t.renderer.rules.fence||function(t,e,n,r,i){return i.renderToken(t,e,n)};t.renderer.rules.fence=function(e,r,i,s,a){const o=e[r],l=o.info?t.utils.unescapeAll(o.info).trim():"";if("mermaid"===(l?l.split(/\s+/g)[0]:"")){const e=o.content;return`<pre class="mermaid-wrapper"><code class="language-mermaid mermaid">${t.utils.escapeHtml(e)}</code><button class="expand-button" aria-label="Expand diagram"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"/></svg></button><div id="mermaid-container"><div id="mermaid-space"><div class="mermaid-content"></div></div></div></pre>\n`}return n(e,r,i,s,a)}}var Ur=class{md;config;idGenerator;collectedTags=new Set;constructor(t,e){this.config=t,this.idGenerator=new ln,e?(this.md=e,this.config.extensions.wikilink?.enable&&this.md.use(Er,{enable:!0}),this.config.extensions.parseTags&&this.md.use(Tr,{enable:!0,tagBaseURL:"tags/",onTagFound:t=>this.collectedTags.add(t)}),this.config.extensions.callouts&&this.md.use(Rr,{enable:!0}),this.config.extensions.latex?.enable&&this.md.use(Fr,{enable:!0}),this.config.extensions.mermaid?.enable&&this.md.use($r,{enable:!0})):this.md=this.createMarkdownItInstance(),this.setupRendererRules()}setupRendererRules(){const t=this.idGenerator;this.md.renderer.rules.heading_open=function(e,n){const r=e[n+1].content,i=t.generateID(r);return e[n].attrPush(["id",i]),`<${e[n].tag} id="${i}">`}}async render(t){return this.idGenerator.reset(),this.collectedTags.clear(),this.config.extensions.wikilink?.enable&&(t=t.replace(pr,t=>t.replace(gr,(t,e)=>{let n=e??"";return n=n.replace("#","\\#"),n=n.replace(/((^|[^\\])(\\\\)*)\|/g,"$1\\|"),n})).replace(dr,(t,...e)=>{const[n,r,i]=e,[s,a]=ur(`${n??""}${r??""}`),o=Boolean(r?.startsWith("#^"))?"^":"",l=a?`#${o}${a.trim().replace(/^#+/,"")}`:"",c=i??r?.replace("#","|")??"",h=t.startsWith("!")?"!":"";return n?.match(fr)?`${h}[${c.replace(/^\|/,"")}](${n})`:`${h}[[${s}${l}${c}]]`})),this.md.render(t)}getCollectedTags(){return Array.from(this.collectedTags)}async parse(t){this.idGenerator.reset();const e=await this.j(t);return new cr(e,(new TextEncoder).encode(t),this.idGenerator)}async j(t){return this.md.parse(t,{})}getMarkdownIt(){return this.md}addPlugin(t,e){this.md.use(t,e)}createMarkdownItInstance(){const t=new lr.default({html:this.config.renderer.unsafe,breaks:!1,linkify:this.config.extensions.linkify,typographer:!this.config.extensions.typographer.disable});return this.config.extensions.typographer.disable||(t.options.quotes=[this.config.extensions.typographer.leftDoubleQuote,this.config.extensions.typographer.rightDoubleQuote,this.config.extensions.typographer.leftSingleQuote,this.config.extensions.typographer.rightSingleQuote]),this.configureBasicPlugins(t),this.config.extensions.wikilink?.enable&&t.use(Er,{enable:!0}),this.config.extensions.parseTags&&t.use(Tr,{enable:!0,tagBaseURL:"tags/",onTagFound:t=>this.collectedTags.add(t)}),this.config.extensions.callouts&&t.use(Rr,{enable:!0}),this.config.extensions.latex?.enable&&t.use(Fr,{enable:!0}),this.config.extensions.mermaid?.enable&&t.use($r,{enable:!0}),t}configureBasicPlugins(t){this.config.extensions.table&&t.enable(["table"]),this.config.extensions.strikethrough&&t.enable(["strikethrough"])}};j();var Br=m(require("js-yaml")),qr=(t=>(t[t.File=0]="File",t[t.ContentResource=1]="ContentResource",t[t.ContentSingle=2]="ContentSingle",t[t.Leaf=3]="Leaf",t[t.Branch=4]="Branch",t))(qr||{}),jr={CONTENT_EXTENSIONS:[".md",".markdown",".mdown",".mkd",".mkdn",".html",".htm",".xml"],HTML_EXTENSIONS:[".html",".htm"],INDEX_NAMES:["index","_index"],PATH_SEPARATOR:"/",EXTENSION_SEPARATOR:".",LANGUAGE_SEPARATOR:".",SYSTEM_PATH_SEPARATOR:(()=>{try{return require("path").sep}catch{return"/"}})(),COMPONENT_FOLDER_CONTENT:"content",COMPONENT_FOLDER_STATIC:"static",COMPONENT_FOLDER_LAYOUTS:"layouts",COMPONENT_FOLDER_ARCHETYPES:"archetypes",COMPONENT_FOLDER_DATA:"data",COMPONENT_FOLDER_ASSETS:"assets",COMPONENT_FOLDER_I18N:"i18n",normalizePath:t=>{let e=t.replace(/\\/g,"/");return e.startsWith("//")&&(e=e.substring(1)),e}},Hr=class t{constructor(t,e,n,r,i,s=!1,a){this.original=t,this.normalized=e,this.positions=n,this.identifiers=r,this.bundleType=i,this.disabled=s,this.component=a}withBundleType(e){return new t(this.original,this.normalized,this.positions,this.identifiers,e,this.disabled)}withDisabled(e){return new t(this.original,this.normalized,this.positions,this.identifiers,this.bundleType,e)}hasIdentifiers(){return this.identifiers.length>0}firstIdentifier(){return this.identifiers.length>0?this.identifiers[0]:null}lastIdentifier(){return this.identifiers.length>0?this.identifiers[this.identifiers.length-1]:null}getIdentifier(t){return t>=0&&t<this.identifiers.length?this.identifiers[t]:null}isContentComponent(t){return"content"===t||"archetypes"===t}clone(){return new t(this.original,this.normalized,{...this.positions},[...this.identifiers],this.bundleType,this.disabled,this.component)}toString(){return`PathComponents{original="${this.original}", normalized="${this.normalized}", bundleType=${qr[this.bundleType]}, identifiers=${this.identifiers.length}}`}},zr=class t{constructor(t=-1,e=-1,n=-1,r=-1){this.containerLow=t,this.containerHigh=e,this.sectionHigh=n,this.identifierLanguage=r}reset(){this.containerLow=-1,this.containerHigh=-1,this.sectionHigh=-1,this.identifierLanguage=-1}hasContainer(){return-1!==this.containerLow&&-1!==this.containerHigh}hasSection(){return this.sectionHigh>0}hasLanguageIdentifier(){return-1!==this.identifierLanguage}clone(){return new t(this.containerLow,this.containerHigh,this.sectionHigh,this.identifierLanguage)}},Wr=class{constructor(t,e){if(this.low=t,this.high=e,t>e)throw new Error(`Invalid range: low (${t}) must be <= high (${e})`)}length(){return this.high-this.low}isEmpty(){return this.low===this.high}contains(t){return t>=this.low&&t<this.high}substring(t){return t.substring(this.low,this.high)}toString(){return`[${this.low}, ${this.high})`}},Gr=class{static createEmpty(t="",e=0){return new Hr(t,t,new zr,[],e,!1)}static create(t,e,n=0){return new Hr(t,e||t,new zr,[],n,!1)}static createFull(t,e,n,r,i,s=!1){return new Hr(t,e,n,r,i,s)}},Vr=class t{constructor(t){this.components=t}H;shouldTrimLeadingSlash=!1;component(){if(this.components.component)return this.components.component;const t=this.components.normalized.split("/").filter(t=>t.length>0);return 0===t.length?"content":{static:"static",layouts:"layouts",themes:"themes",archetypes:"archetypes",data:"data",i18n:"i18n",assets:"assets"}[t[0]]||"content"}path(){return this.norm(this.components.normalized)}name(){return this.components.positions.containerHigh>0?this.components.normalized.substring(this.components.positions.containerHigh):this.components.normalized}originalNameNoExt(){const t=this.components.firstIdentifier();return t?this.components.original.substring(this.components.positions.containerHigh,t.low-1):this.components.original.substring(this.components.positions.containerHigh)}nameNoExt(){const t=this.components.firstIdentifier();return t?this.components.normalized.substring(this.components.positions.containerHigh,t.low-1):this.components.normalized.substring(this.components.positions.containerHigh)}nameNoLang(){if(this.components.identifiers.length>=2){const t=this.components.identifiers[this.components.identifiers.length-1],e=this.components.identifiers[this.components.identifiers.length-2],n=this.components.normalized.substring(e.low,e.high);if(["en","fr","es","de","zh","ja","ko","pt","it","ru","ar"].includes(n)){const n=this.components.positions.containerHigh;return this.components.normalized.substring(n,e.low-1)+this.components.normalized.substring(t.low-1)}}return this.name()}dir(){let t="";return this.components.positions.containerHigh>0&&(t=this.components.normalized.substring(0,this.components.positions.containerHigh-1)),""===t&&(t="/"),this.norm(t)}ext(){if(0===this.components.identifiers.length)return"";const t=this.components.identifiers[this.components.identifiers.length-1],e=this.components.normalized.substring(t.low,t.high);return e?"."+e:""}lang(){if(this.components.identifiers.length>=2){const t=this.components.identifiers[this.components.identifiers.length-2],e=this.components.normalized.substring(t.low,t.high);if(["en","fr","es","de","zh","ja","ko","pt","it","ru","ar"].includes(e))return"."+e}return""}section(){if(this.components.positions.sectionHigh<=0)return"";const t=this.components.normalized.substring(1,this.components.positions.sectionHigh);return"_index.md"===t||"index.md"===t||t.endsWith("/_index.md")||t.endsWith("/index.md")?"":this.norm(t)}sections(){const t=this.dir();if("/"===t||""===t)return[];const e=[],n=(t.startsWith("/")?t.substring(1):t).split("/").filter(t=>t.length>0);let r="";for(const t of n)""===r?r=t:r+="/"+t,e.push(this.norm(r));return e}container(){return-1===this.components.positions.containerLow?"":this.norm(this.components.normalized.substring(this.components.positions.containerLow,this.components.positions.containerHigh-1))}containerDir(){return this.isLeafBundle()||this.isBranchBundle(),this.dir()}base(){return this.isBranchBundle()&&"/_index.md"===this.components.normalized?"/":this.isLeafBundle()?this.baseInternal(!1,!0):this.isContent()&&!this.isBundle()?this.pathNoIdentifier():this.isContent()?this.isBundle()?this.baseInternal(!1,!0):this.baseInternal(!this.isContentPage(),this.isBundle()):this.path()}baseNoLeadingSlash(){return this.base().substring(1)}baseNameNoIdentifier(){return this.isBundle()?this.container():this.nameNoIdentifier()}nameNoIdentifier(){if(0===this.components.identifiers.length)return this.name();const t=this.components.identifiers[0],e=this.components.positions.containerHigh;return this.components.normalized.substring(e,t.low-1)}pathNoLang(){return this.baseInternal(!0,!1)}pathNoIdentifier(){if(0===this.components.identifiers.length)return this.path();const t=this.components.identifiers[0],e=this.components.normalized.substring(0,t.low-1);return this.norm(e)}pathRel(t){let e=t.base();return e.endsWith("/")||(e+="/"),this.path().replace(new RegExp("^"+this.escapeRegExp(e)),"")}baseRel(t){let e=t.base();return"/"===e&&(e=""),this.base().substring(e.length+1)}trimLeadingSlash(){const e=this.components.clone(),n=new t(e);return n.setShouldTrimLeadingSlash(!0),n}identifier(t){const e=this.components.identifiers.length;if(0===e||t<0||t>=e)return"";let n;n=1===e?0:0===t?e-1:e-1-t;const r=this.identifierAsString(n);return r?"."+r:""}identifiers(){const t=[],e=this.components.identifiers.length;for(let n=0;n<e;n++){const e=this.identifier(n);e&&t.push(e)}return t}bundleType(){return this.components.bundleType}isContent(){return this.bundleType()>=1}isBundle(){return this.bundleType()>3}isBranchBundle(){return 4===this.bundleType()}isLeafBundle(){return 3===this.bundleType()}isHTML(){const t=this.ext().toLowerCase();return jr.HTML_EXTENSIONS.some(e=>e===t)}disabled(){return this.components.disabled}forBundleType(e){const n=this.components.withBundleType(e);return new t(n)}unnormalized(){if(!this.H)if(this.components.original===this.components.normalized)this.H=this;else{const e=new Hr(this.components.original,this.components.original,this.components.positions,this.components.identifiers,this.components.bundleType,this.components.disabled);this.H=new t(e)}return this.H}setShouldTrimLeadingSlash(t){this.shouldTrimLeadingSlash=t}norm(t){return this.shouldTrimLeadingSlash&&t.startsWith("/")?t.substring(1):t}isContentPage(){return this.bundleType()>=2}baseInternal(t,e){if(0===this.components.identifiers.length)return this.norm(this.components.normalized);if(t&&1===this.components.identifiers.length)return this.norm(this.components.normalized);let n=this.components.identifiers[this.components.identifiers.length-1].low-1;if(e&&(n=this.components.positions.containerHigh-1),0===n&&n++,!t)return this.norm(this.components.normalized.substring(0,n));const r=this.components.identifiers[0];return this.norm(this.components.normalized.substring(0,n)+this.components.normalized.substring(r.low-1,r.high))}identifierAsString(t){const e=this.identifierIndex(t);if(-1===e)return"";const n=this.components.identifiers[e];return this.components.normalized.substring(n.low,n.high)}identifierIndex(t){return t<0||t>=this.components.identifiers.length?-1:t}escapeRegExp(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}toString(){return`Path{path="${this.path()}", component="${this.component()}", bundleType=${qr[this.bundleType()]}}`}equals(t){return this.path()===t.path()&&this.component()===t.component()&&this.bundleType()===t.bundleType()}hashCode(){return`${this.component()}:${this.path()}:${this.bundleType()}`}},Yr=class{static fromString(t,e){const n=new Hr(e,e,{containerLow:-1,containerHigh:-1,sectionHigh:-1,identifierLanguage:-1},[],0,!1);return new Vr(n)}static hasExtension(t,e){const n=t.ext(),r=e.startsWith(".")?e:"."+e;return n.toLowerCase()===r.toLowerCase()}static isUnder(t,e){const n=t.path();let r;r=e.isBranchBundle()?e.dir():e.path();const i="/"===r?"/":r+"/";return n!==r&&n.startsWith(i)}static relativeTo(t,e){return e.pathRel(t)}static compare(t,e){const n=t.path().localeCompare(e.path());if(0!==n)return n;const r=t.component().localeCompare(e.component());return 0!==r?r:t.bundleType()-e.bundleType()}},Kr=class{normalizer;extChecker;constructor(t,e){this.normalizer=t||new Xr,this.extChecker=e||new Jr}parse(t,e){let n=e;n&&""!==n||(n="/");const r=this.normalizer.normalize(n),i=this.createPathComponents(t,r,e);return new Vr(i)}parseIdentity(t,e){const n=this.parse(t,e);return{identifierBase:()=>n.base()}}parseBaseAndBaseNameNoIdentifier(t,e){const n=this.parse(t,e);return[n.base(),n.baseNameNoIdentifier()]}createPathComponents(t,e,n){let r=t,i=e;if(e.startsWith("/")){const n=e.split("/").filter(t=>t.length>0);if(n.length>0){const e=n[0];["static","layouts","themes","archetypes","data","i18n","assets"].includes(e)&&"content"===t&&(r=e),["images","assets","static","css","js","fonts"].includes(e)&&"content"===t&&(r="static")}}const s=i.lastIndexOf("/"),a=s>=0?i.substring(s+1):i;s>=0&&i.substring(0,s);let o=this.detectBundleType(a,r);const l=this.calculatePathPositions(i),c=this.extractIdentifiers(i,a);return new Hr(n,i,l,c,o,!1,r)}detectBundleType(t,e){if("content"!==e&&"archetypes"!==e)return 0;let n=t.split(".")[0];return"index"===n&&this.isContentFile(t)?3:"_index"===n&&this.isContentFile(t)?4:this.isContentFile(t)?2:0}isContentFile(t){const e=this.getFileExtension(t);return["md","html","markdown","mdown","mkd","mkdn","htm"].includes(e.toLowerCase())}getFileExtension(t){const e=t.lastIndexOf(".");return e>0&&e<t.length-1?t.substring(e+1):""}calculatePathPositions(t){let e=-1,n=-1,r=-1;for(let i=t.length-1;i>=0;i--)"/"===t[i]&&(-1===r?r=i+1:-1===n&&(n=i+1),i>0&&(e=i));return new zr(n,r,e,-1)}extractIdentifiers(t,e){const n=[],r=t.substring(0,t.length-e.length).length,i=e.split(".");if(i.length<=1)return n;let s=r+i[0].length;for(let t=1;t<i.length;t++){const e=s+1,r=e+i[t].length;n.push(new Wr(e,r)),s=r}return n}},Xr=class{constructor(t=!0,e=!0){this.toLowerCase=t,this.replaceSpaces=e}normalize(t){let e=t;return e=e.replace(/\\/g,"/"),this.toLowerCase&&(e=e.toLowerCase()),this.replaceSpaces&&(e=e.replace(/\s/g,"-")),e}},Zr=class{constructor(t=!0,e=!0){this.toLowerCase=t,this.replaceSpaces=e}normalize(t){let e=t;return e=e.replace(/\\/g,"/"),this.toLowerCase&&(e=e.toLowerCase()),this.replaceSpaces&&(e=e.replace(/\s+/g,"-")),e}},Jr=class{isContentExt(t){return jr.CONTENT_EXTENSIONS.includes(t.toLowerCase())}isHTML(t){return jr.HTML_EXTENSIONS.includes(t.toLowerCase())}hasExt(t){for(let e=t.length-1;e>=0;e--){if("."===t[e])return!0;if("/"===t[e])return!1}return!1}},Qr=class t{static parseBasic(t){const e=t.lastIndexOf("/"),n=e>=0?t.substring(0,e):"",r=e>=0?t.substring(e+1):t,i=r.lastIndexOf("."),s=i>=0?r.substring(i):"",a=i>=0?r.substring(0,i):r;return{dir:n,name:r,ext:s,nameWithoutExt:a}}static join(...t){return t.filter(t=>t.length>0).map(t=>t.replace(/^\/+|\/+$/g,"")).join("/").replace(/\/+/g,"/")}static normalizeBasic(t){return(new Zr).normalize(t)}static isBundle(e){const n=t.parseBasic(e);return jr.INDEX_NAMES.includes(n.nameWithoutExt)}static extractSection(t){const e=t.startsWith("/")?t.substring(1):t,n=e.indexOf("/");return n>=0?e.substring(0,n):e}static removeExtension(t){const e=t.lastIndexOf(".");return e>t.lastIndexOf("/")?t.substring(0,e):t}static hasExtension(t){return(new Jr).hasExt(t)}},ti=class{processor;pool;constructor(t,e){const n=t?.normalizer?{normalize:t.normalizer}:new Zr(!1!==t?.normalize,!1!==t?.replaceSpaces),r=new Jr;this.processor=new Kr(n,r),e&&(this.pool=e)}create(t,e,n){return this.pool&&this.pool.get(),this.processor.parse(t,e)}createFromComponents(t){return new Vr(t)}createMany(t,e,n){return e.map(e=>this.create(t,e,n))}createWithConfig(t,e,n){const r={};return void 0!==n?.toLowerCase&&(r.normalize=n.toLowerCase),void 0!==n?.replaceSpaces&&(r.replaceSpaces=n.replaceSpaces),void 0!==n?.customNormalizer&&(r.normalizer=n.customNormalizer),this.create(t,e,r)}},ei=class extends ti{constructor(){super({normalize:!0,replaceSpaces:!0})}},ni=class{pool=[];maxSize;constructor(t=100){this.maxSize=t}get(){if(this.pool.length>0)return this.pool.pop();const t=Gr.createEmpty();return new Vr(t)}put(t){this.pool.length<this.maxSize&&this.pool.push(t)}clear(){this.pool=[]}size(){return this.pool.length}},ri=class{component="";path="";config={};factory;constructor(t){this.factory=t||new ei}withComponent(t){return this.component=t,this}withPath(t){return this.path=t,this}withNormalization(t){return this.config.normalize=t,this}withSpaceReplacement(t){return this.config.replaceSpaces=t,this}withNormalizer(t){return this.config.normalizer=t,this}build(){if(!this.component||!this.path)throw new Error("Component and path must be set");return this.factory.create(this.component,this.path,this.config)}reset(){return this.component="",this.path="",this.config={},this}},ii=class t{static defaultFactory=new ei;static createContentPath(e){return t.defaultFactory.create("content",e)}static createStaticPath(e){return t.defaultFactory.create("static",e)}static createLayoutPath(e){return t.defaultFactory.create("layouts",e)}static createArchetypePath(e){return t.defaultFactory.create("archetypes",e)}static createDataPath(e){return t.defaultFactory.create("data",e)}static createThemePath(e){return t.defaultFactory.create("themes",e)}static createFromConfig(t){const e={};void 0!==t.normalize&&(e.normalize=t.normalize),void 0!==t.replaceSpaces&&(e.replaceSpaces=t.replaceSpaces);const n=new ti(e);return t.paths.map(e=>n.create(t.component,e))}static builder(){return new ri}static createWithPool(t,e,n){return new ti(void 0,n).create(t,e)}},si={createContentPath:ii.createContentPath,createStaticPath:ii.createStaticPath,createLayoutPath:ii.createLayoutPath,createArchetypePath:ii.createArchetypePath,createDataPath:ii.createDataPath,createThemePath:ii.createThemePath,builder:ii.builder,parseBasic:Qr.parseBasic,join:Qr.join,normalizeBasic:Qr.normalizeBasic,isBundle:Qr.isBundle,extractSection:Qr.extractSection,removeExtension:Qr.removeExtension,checkExtension:Qr.hasExtension,hasSpecificExtension:Yr.hasExtension,isUnder:Yr.isUnder,relativeTo:Yr.relativeTo,compare:Yr.compare,createProcessor:()=>new Kr,createFactory:()=>new ei,createPool:t=>new ni(t),createNormalizer:t=>new Zr(t?.toLowerCase,t?.replaceSpaces)},ai=N("content",{component:"translator"}),oi=class{contentLanguage;translateFuncs=new Map;constructor(t){this.contentLanguage=t}translate(t,e){const n=t.toLowerCase(),r=this.translateFuncs.get(n);if(r){const t=r(e);if(t)return t}ai.info(`Translation func for language ${t} not found, use default.`);const i=this.translateFuncs.get(this.contentLanguage.toLowerCase());if(i){const t=i(e);if(t)return t}return ai.info("i18n not initialized; if you need string translations, check that you have a bundle in /i18n that matches the site language or the default language."),`[i18n] ${e}`}async setupTranslateFuncs(t){try{await t.walkI18n("",{walkFn:async(t,e)=>{if(t.endsWith(".yaml")||t.endsWith(".yml"))try{const n=(jr.normalizePath(t).split("/").pop()||"").replace(/\.(yaml|yml)$/,"").toLowerCase(),r=await this.readI18nFile(e),i=this.parseI18nContent(r),s=new Map;i.forEach(t=>{s.set(t.id,t.translation)});const a=t=>s.get(t)||(ai.warn(`i18n|MISSING_TRANSLATION|${n}|${t}`),"");this.translateFuncs.set(n,a),ai.info(`✅ Loaded i18n translations for language: ${n} (${i.length} items)`)}catch(e){ai.error(`❌ Failed to load i18n file ${t}:`,e)}}},{}),ai.info(`🌍 Translation setup complete. Loaded ${this.translateFuncs.size} languages: [${Array.from(this.translateFuncs.keys()).join(", ")}]`)}catch(t){throw t}}async readI18nFile(t){let e=null;try{e=await t.open();const n=await e.stat(),r=new Uint8Array(n.size()),i=await e.read(r),s=new TextDecoder("utf-8").decode(i.buffer);return 65279===s.charCodeAt(0)?s.slice(1):s}catch(t){throw ai.error("❌ Failed to read i18n file:",t),t}finally{if(e)try{await e.close()}catch(t){ai.warn(`Failed to close i18n file: ${t}`)}}}parseI18nContent(t){try{const e=Br.load(t);return Array.isArray(e)?e.filter(t=>t&&"object"==typeof t&&t.id&&t.translation).map(t=>({id:String(t.id),translation:String(t.translation)})):(ai.warn("i18n YAML content is not an array"),[])}catch(t){return ai.error("❌ Failed to parse i18n YAML content:",t),[]}}getAvailableLanguages(){return Array.from(this.translateFuncs.keys())}hasLanguage(t){return this.translateFuncs.has(t.toLowerCase())}};j();var li=N("content",{component:"content"});var ci={[Xe]:Xe,[Ze]:Ze,[Je]:Je,[Qe]:Qe,[tn]:tn,[nn]:"404",[en]:en,taxonomyterm:Qe};function hi(t){return ci[t.toLowerCase()]||""}j(),N("content",{component:"identity"});var ui=class{id;lang;langIdx;stale=!0;constructor(t,e="",n=0){this.id=t,this.lang=e,this.langIdx=n}ID(){return this.id}identifierBase(){return`${this.id}-${this.lang}`}pageLanguage(){return this.lang}pageLanguageIndex(){return this.langIdx}pageIdentity(){return this}markStale(){this.stale||(this.stale=!0)}isStale(){return this.stale}clearStale(){this.stale&&(this.stale=!1)}},fi=m(require("crypto")),di=m(require("path"));j(),N("content",{component:"FileInfo"});var pi=new Set([".md"]),gi=class t{fileMetaInfo;pathInfo;bundleType;uniqueIDCache;lazyInitDone=!1;constructor(t,e){this.fileMetaInfo=t;const n=si.createProcessor();this.pathInfo=n.parse(jr.COMPONENT_FOLDER_CONTENT,e),this.bundleType=0,this.determineBundleType()}static newFileInfo(e){const n=jr.normalizePath(e.relativeFilename());return new t(e,n)}pageFile(){return this}shiftToResource(){this.isContent()&&(this.bundleType=1)}relPath(){const t=this.pathInfo.dir(),e=t.startsWith("/")?t.substring(1):t;return di.join(e,this.pathInfo.name())}section(){return this.pathInfo.section()}isZero(){return null==this.fileMetaInfo}filename(){return this.fileMetaInfo.fileName()}dir(){return this.pathToDir(this.pathInfo.dir())}ext(){return this.pathInfo.ext()}logicalName(){return this.pathInfo.name()}originalBaseFileName(){return this.pathInfo.originalNameNoExt()}baseFileName(){return this.pathInfo.nameNoExt()}translationBaseName(){return this.pathInfo.nameNoIdentifier()}contentBaseName(){return this.pathInfo.baseNameNoIdentifier()}baseNameNoIdentifier(){return this.pathInfo.baseNameNoIdentifier()}root(){return this.pathInfo.dir()||"/"}uniqueID(){return this.init(),this.uniqueIDCache}fileInfo(){return this.fileMetaInfo}type(){const t=this.section();return""!==t?t:"page"}async open(){return await this.fileMetaInfo.open()}paths(){return this.pathInfo}path(){return this.pathInfo.path()}toString(){return this.baseFileName()}getBundleType(){return this.bundleType}isBundle(){return this.bundleType>=3}isLeafBundle(){return 3===this.bundleType}isBranchBundle(){return 4===this.bundleType}isContentResource(){return 1===this.bundleType}isContent(){return this.bundleType>=1}init(){if(!this.lazyInitDone){this.lazyInitDone=!0;const t=this.relPath().replace(/\\/g,"/");this.uniqueIDCache=fi.createHash("md5").update(t).digest("hex")}}pathToDir(t){return""===t?t:di.normalize(t.substring(1)+"/")}determineBundleType(){var t;if(t=this.pathInfo.ext(),pi.has(t))switch(this.pathInfo.nameNoIdentifier()){case"index":this.bundleType=3;break;case"_index":this.bundleType=4;break;default:this.bundleType=2}}};function mi(t){return gi.newFileInfo(t)}function wi(t){yi(vi).sort(t)}function yi(t){return new bi(t)}var bi=class{constructor(t){this.by=t}sort(t){!function(t,e){const n=Array.from({length:e.len()},(t,e)=>e);n.sort((t,n)=>e.less(t,n)?-1:e.less(n,t)?1:t-n);const r=[...t];for(let e=0;e<n.length;e++)t[e]=r[n[e]]}(t,new Ti(t,this.by))}},vi=(t,e)=>Si(t=>t.title(),t,e)<0,Ei=(t,e)=>Si(t=>t.pageIdentity().pageLanguage(),t,e)<0,ki=(t,e)=>t.pageWeight()<e.pageWeight(),Si=(t,e,n)=>{const r=t(e),i=t(n);return r<i?-1:r>i?1:0},Ti=class{constructor(t,e){this.pages=t,this.by=e}len(){return this.pages.length}swap(t,e){[this.pages[t],this.pages[e]]=[this.pages[e],this.pages[t]]}less(t,e){return this.by(this.pages[t],this.pages[e])}},xi=class{static toString(t){return null==t?"":"string"==typeof t?t:"number"==typeof t||"boolean"==typeof t?t.toString():String(t)}static toInt(t){if(null==t)return 0;if("number"==typeof t)return Math.floor(t);if("string"==typeof t){const e=parseInt(t,10);return isNaN(e)?0:e}return 0}static toTime(t){if(null==t)return new Date;if(t instanceof Date)return t;if("string"==typeof t){const e=new Date(t);return isNaN(e.getTime())?new Date:e}return"number"==typeof t?new Date(t):new Date}},Ai=class{static sliceToLower(t){return t.map(t=>t.toLowerCase())}},Ci=class{static toStringSlicePreserveString(t){return null==t?null:Array.isArray(t)?t.map(t=>xi.toString(t)):"string"==typeof t?[t]:[xi.toString(t)]}},Di=m(require("path")),Pi=class{params;langSvc;taxonomySvc;constructor(t,e,n){this.params=t,this.langSvc=e,this.taxonomySvc=n}async parse(t){const e={terms:{},params:this.params,path:"",lang:"",kind:"",title:"",description:"",weight:0};try{await this.parseCustomized(e)}catch(t){throw t}try{await this.parseTerms(e)}catch(t){throw t}try{await this.parseTitle(e)}catch(t){throw t}try{await this.parseDescription(e)}catch(t){throw t}try{await this.parseWeight(e)}catch(t){throw t}try{await this.parseDate(e)}catch(t){throw t}try{await this.parseOrganization(e,t)}catch(t){throw t}try{await this.parseAuthor(e,t)}catch(t){throw t}try{await this.parseMenu(e)}catch(t){throw t}return e}async parseDate(t){if(this.params){const e=this.params.date;null!=e&&(t.date=xi.toTime(e))}}async parseWeight(t){if(t.weight=1e4,this.params){const e=this.params.weight;null!=e&&(t.weight=xi.toInt(e))}}async parseTitle(t){if(this.params){const e=this.params.title;null!=e&&(t.title=xi.toString(e))}}async parseDescription(t){if(this.params){const e=this.params.description;null!=e&&(t.description=xi.toString(e))}}async parseCustomized(t){if(!this.params)return;const e=this.params.path;null!=e&&(t.path=this.toSlashPreserveLeading(xi.toString(e)));const n=this.params.lang;if(null!=n){const e=xi.toString(n).toLowerCase();this.langSvc.isLanguageValid(e)&&(t.lang=e)}const r=this.params.kind;if(null!=r){const e=xi.toString(r);if(""!==e){const n=hi(e);if(""===n)throw new Error(`unknown kind "${e}" in front matter`);t.kind=n}}}async parseTerms(t){const e=this.taxonomySvc.views();for(const n of e){const e=Ci.toStringSlicePreserveString(Ri(this.params||{},n.plural(),!1));null!==e&&(t.terms[n.plural()]=e)}}async parseOrganization(t,e){if(!this.params)return;const n=this.params.organization;if(!n||"object"!=typeof n)return;const r={};void 0!==n.name&&null!==n.name&&(r.name=xi.toString(n.name)),void 0!==n.description&&null!==n.description&&(r.description=xi.toString(n.description)),void 0!==n.vision&&null!==n.vision&&(r.vision=xi.toString(n.vision)),void 0!==n.website&&null!==n.website&&(r.website=xi.toString(n.website)),void 0!==n.logo&&null!==n.logo&&(r.logo=Di.default.join(e,xi.toString(n.logo)));const i=this.parseContact(n.contact);i&&(r.contact=i);const s=this.parseSocial(n.social);s&&(r.social=s),Object.keys(r).length>0&&(t.organization=r)}async parseMenu(t){if(!this.params)return;const e=this.params.menu;if(!e||"object"!=typeof e)return;const n={};for(const[t,r]of Object.entries(e))if(!1!==r){if(Array.isArray(r)){const e=this.parseMenuItems(r);e.length>0&&(n[t]=e)}else if(r&&"object"==typeof r){const e={};for(const[t,n]of Object.entries(r))if(!1===n)e[t]=!1;else if(Array.isArray(n)){const r=this.parseMenuItems(n);r.length>0&&(e[t]=r)}Object.keys(e).length>0&&(n[t]=e)}}else n[t]=!1;Object.keys(n).length>0&&(t.menu=n)}parseMenuItems(t){const e=[];for(const n of t){if(!n||"object"!=typeof n)continue;const t={title:"",url:""};if(void 0!==n.title&&null!==n.title&&(t.title=xi.toString(n.title),void 0!==n.url&&null!==n.url)){{const e=xi.toString(n.url);t.url=""===e?"":e}if(void 0!==n.weight&&null!==n.weight&&(t.weight=xi.toInt(n.weight)),Array.isArray(n.children)){const e=this.parseMenuItems(n.children);e.length>0&&(t.children=e)}e.push(t)}}return e}async parseAuthor(t,e){if(!this.params)return;const n=this.params.author;if(!n||"object"!=typeof n)return;const r={};void 0!==n.name&&null!==n.name&&(r.name=xi.toString(n.name)),void 0!==n.description&&null!==n.description&&(r.description=xi.toString(n.description)),void 0!==n.website&&null!==n.website&&(r.website=xi.toString(n.website)),void 0!==n.avatar&&null!==n.avatar&&(r.avatar=Di.default.join(e,xi.toString(n.avatar)));const i=this.parseContact(n.contact);i&&(r.contact=i);const s=this.parseSocial(n.social);s&&(r.social=s),Object.keys(r).length>0&&(t.author=r)}parseContact(t){if(!t||"object"!=typeof t)return null;const e={};return void 0!==t.email&&null!==t.email&&(e.email=xi.toString(t.email)),void 0!==t.address&&null!==t.address&&(e.address=xi.toString(t.address)),void 0!==t.phone&&null!==t.phone&&(e.phone=xi.toString(t.phone)),Object.keys(e).length>0?e:null}parseSocial(t){if(!t||"object"!=typeof t)return null;const e={},n=["github","twitter","linkedin"];for(const r of n)void 0!==t[r]&&null!==t[r]&&(e[r]=xi.toString(t[r]));for(const[r,i]of Object.entries(t))n.includes(r)||null==i||(e[r]=xi.toString(i));return Object.keys(e).length>0?e:null}toSlashPreserveLeading(t){return t.replace(/\\/g,"/")}};function Li(t,e){return Ri(t,e,!0)}function Ri(t,e,n){const r=t[e.toLowerCase()];if(null==r)return null;switch(typeof r){case"boolean":return r;case"string":return n?r.toLowerCase():r;case"number":return Number.isInteger(r)?xi.toInt(r):r;default:return r instanceof Date?r:Array.isArray(r)&&r.every(t=>"string"==typeof t)&&n?Ai.sliceToLower(r):r}}var Ni=t=>{if(0===t)throw new Error("dimension flag not set");return t-1},_i=class{key;val;constructor(t,e){this.key=t,this.val=e}},Oi=class{label;node;constructor(t,e){this.label=t,this.node=e}},Ii=class{leaf=null;prefix="";edges=[];isLeaf(){return null!==this.leaf}addEdge(t){const e=this.edges.length;let n=0;for(;n<e&&this.edges[n].label<t.label;)n++;this.edges.splice(n,0,t)}updateEdge(t,e){const n=this.edges.length;let r=0;for(;r<n&&this.edges[r].label<t;)r++;if(!(r<n&&this.edges[r].label===t))throw new Error("replacing missing edge");this.edges[r].node=e}getEdge(t){const e=this.edges.length;let n=0;for(;n<e&&this.edges[n].label<t;)n++;return n<e&&this.edges[n].label===t?this.edges[n].node:null}delEdge(t){const e=this.edges.length;let n=0;for(;n<e&&this.edges[n].label<t;)n++;n<e&&this.edges[n].label===t&&this.edges.splice(n,1)}mergeChild(){const t=this.edges[0].node;this.prefix=this.prefix+t.prefix,this.leaf=t.leaf,this.edges=t.edges}};function Mi(t,e){const n=Math.min(t.length,e.length);let r=0;for(r=0;r<n&&t[r]===e[r];r++);return r}var Fi=class t{root;size;constructor(){this.root=new Ii,this.size=0}static newFromMap(e){const n=new t;if(e)if(e instanceof Map)e.forEach((t,e)=>{n.insert(e,t)});else for(const[t,r]of Object.entries(e))n.insert(t,r);return n}len(){return this.size}insert(t,e){let n=null,r=this.root,i=t;for(;;){if(0===i.length){if(r.isLeaf()){const t=r.leaf.val;return r.leaf.val=e,[t,!0]}return r.leaf=new _i(t,e),this.size++,[void 0,!1]}if(n=r,r=r.getEdge(i.charCodeAt(0)),null===r){const r=new Oi(i.charCodeAt(0),new Ii);return r.node.leaf=new _i(t,e),r.node.prefix=i,n.addEdge(r),this.size++,[void 0,!1]}const s=Mi(i,r.prefix);if(s===r.prefix.length){i=i.substring(s);continue}this.size++;const a=new Ii;a.prefix=i.substring(0,s),n.updateEdge(i.charCodeAt(0),a),a.addEdge(new Oi(r.prefix.charCodeAt(s),r)),r.prefix=r.prefix.substring(s);const o=new _i(t,e);if(i=i.substring(s),0===i.length)return a.leaf=o,[void 0,!1];const l=new Ii;return l.leaf=o,l.prefix=i,a.addEdge(new Oi(i.charCodeAt(0),l)),[void 0,!1]}}delete(t){let e=null,n=0,r=this.root,i=t;for(;;){if(0===i.length){if(!r.isLeaf())break;const t=r.leaf;return r.leaf=null,this.size--,null!==e&&0===r.edges.length&&e.delEdge(n),r!==this.root&&1===r.edges.length&&r.mergeChild(),null===e||e===this.root||1!==e.edges.length||e.isLeaf()||e.mergeChild(),[t.val,!0]}if(e=r,n=i.charCodeAt(0),r=r.getEdge(n),null===r)break;if(!i.startsWith(r.prefix))break;i=i.substring(r.prefix.length)}return[void 0,!1]}async deletePrefix(t){return await this.W(null,this.root,t)}async W(t,e,n){if(0===n.length){let n=0;return await $i(e,(t,e)=>(n++,Promise.resolve(!1))),e.isLeaf()&&(e.leaf=null),e.edges=[],null===t||t===this.root||1!==t.edges.length||t.isLeaf()||t.mergeChild(),this.size-=n,n}const r=n.charCodeAt(0),i=e.getEdge(r);return null===i||!i.prefix.startsWith(n)&&!n.startsWith(i.prefix)?0:(n=i.prefix.length>n.length?n.substring(n.length):n.substring(i.prefix.length),this.W(e,i,n))}get(t){let e=this.root,n=t;for(;;){if(0===n.length){if(e.isLeaf())return[e.leaf.val,!0];break}if(e=e.getEdge(n.charCodeAt(0)),null===e)break;if(!n.startsWith(e.prefix))break;n=n.substring(e.prefix.length)}return[void 0,!1]}longestPrefix(t){let e=null,n=this.root,r=t;for(;n.isLeaf()&&(e=n.leaf),0!==r.length&&(n=n.getEdge(r.charCodeAt(0)),null!==n)&&r.startsWith(n.prefix);)r=r.substring(n.prefix.length);return null!==e?[e.key,e.val,!0]:["",void 0,!1]}minimum(){let t=this.root;for(;;){if(t.isLeaf())return[t.leaf.key,t.leaf.val,!0];if(!(t.edges.length>0))break;t=t.edges[0].node}return["",void 0,!1]}maximum(){let t=this.root;for(;;){const e=t.edges.length;if(!(e>0)){if(t.isLeaf())return[t.leaf.key,t.leaf.val,!0];break}t=t.edges[e-1].node}return["",void 0,!1]}async walk(t){await $i(this.root,t)}async walkPrefix(t,e){let n=this.root,r=t;for(;;){if(0===r.length)return void await $i(n,e);if(n=n.getEdge(r.charCodeAt(0)),null===n)return;if(!r.startsWith(n.prefix))return void(n.prefix.startsWith(r)&&await $i(n,e));r=r.substring(n.prefix.length)}}async walkPath(t,e){let n=this.root,r=t;for(;;){if(null!==n.leaf&&await e(n.leaf.key,n.leaf.val))return;if(0===r.length)return;if(n=n.getEdge(r.charCodeAt(0)),null===n)return;if(!r.startsWith(n.prefix))break;r=r.substring(n.prefix.length)}}async toMap(){const t={};return await this.walk((e,n)=>(t[e]=n,Promise.resolve(!1))),t}};async function $i(t,e){if(null!==t.leaf&&await e(t.leaf.key,t.leaf.val))return!0;let n=0,r=t.edges.length;for(;n<r;){const i=t.edges[n];if(await $i(i.node,e))return!0;if(0===t.edges.length)return $i(t,e);t.edges.length>=r&&n++,r=t.edges.length}return!1}var Ui=class{trees;constructor(t){this.trees=t}walkPrefixRaw(t,e){for(const n of this.trees)n.walkPrefixRaw(t,e)}},Bi=class{trees;constructor(t){this.trees=t}delete(t){for(const e of this.trees)e.delete(t)}deleteAll(t){for(const e of this.trees)e.deleteAll(t)}async deletePrefix(t){let e=0;for(const n of this.trees)e+=await n.deletePrefix(t);return Promise.resolve(e)}async deletePrefixAll(t){let e=0;for(const n of this.trees)e+=await n.deletePrefixAll(t);return e}lock(t){const e=this.trees.map(e=>e.lock(t));return()=>{for(const t of e)t()}}canLock(){for(const t of this.trees)if(!t.canLock())return!1;return!0}};function qi(t){return"/"===t?"":t}function ji(t){const e=function(t){return""===t?null:t.length<2?new Error(`too short key: "${t}"`):"/"!==t[0]?new Error(`key must start with '/': "${t}"`):"/"===t[t.length-1]?new Error(`key must not end with '/': "${t}"`):null}(t);if(e)throw e;return t}function Hi(){return new zi}var zi=class{mu;tree;zero;constructor(){this.tree=new Fi,this.zero=void 0;let t=!1,e=0;this.mu={lock:()=>{for(;t||e>0;);t=!0},unlock:()=>{t=!1},rLock:()=>{for(;t;);e++},rUnlock:()=>{e--}}}get(t){this.mu.rLock();try{const[e,n]=this.tree.get(t);return n?e:this.zero}finally{this.mu.rUnlock()}}longestPrefix(t){this.mu.rLock();try{const[e,n,r]=this.tree.longestPrefix(t);return r?[e,n]:["",this.zero]}finally{this.mu.rUnlock()}}insert(t,e){this.mu.lock();try{return this.tree.insert(t,e),e}finally{this.mu.unlock()}}async walkPrefix(t,e,n){switch(t){case 0:break;case 1:this.mu.rLock();break;case 2:this.mu.lock()}try{let t=null;return await this.tree.walkPrefix(e,async(e,r)=>{const[i,s]=n(e,r);return s?(t=s,Promise.resolve(!0)):i}),t}finally{switch(t){case 0:break;case 1:this.mu.rUnlock();break;case 2:this.mu.unlock()}}}},Wi=class t{d;v;trees;constructor(t,e){if(e<=0)throw new Error("length must be > 0");this.d=t,this.v=0,this.trees=[];for(let t=0;t<e;t++)this.trees.push(Hi())}static newTreeShiftTree(e,n){return new t(e,n)}shape(e,n){if(e!==this.d)throw new Error("dimension mismatch");if(n>=this.trees.length)throw new Error("value out of range");const r=Object.create(t.prototype);return Object.assign(r,this),r.v=n,r}get(t){return this.trees[this.v].get(t)}longestPrefix(t){return this.trees[this.v].longestPrefix(t)}insert(t,e){return this.trees[this.v].insert(t,e)}async walkPrefix(t,e,n){return await this.trees[this.v].walkPrefix(t,e,n)}delete(t){for(const e of this.trees)e.tree.delete(t)}async deletePrefix(t){let e=0;for(const n of this.trees)e+=await n.tree.deletePrefix(t);return e}lock(t){if(t){for(const t of this.trees)t.mu.lock();return()=>{for(const t of this.trees)t.mu.unlock()}}for(const t of this.trees)t.mu.rLock();return()=>{for(const t of this.trees)t.mu.rUnlock()}}},Gi=class t{tree;dims;shifter;mu;constructor(t){if(!t.shifter)throw new Error("Shifter is required");this.shifter=t.shifter,this.tree=new Fi,this.dims=[0];let e=!1,n=0;this.mu={lock:()=>{for(;e||n>0;);e=!0},unlock:()=>{e=!1},rLock:()=>{for(;e;);n++},rUnlock:()=>{n--},tryLock:()=>!(e||n>0||(e=!0,0))}}static new(e){return new t(e)}delete(t){this.deleteInternal(t)}async deleteAll(t){await this.tree.walkPrefix(t,(t,e)=>{const[n,r]=this.tree.delete(t);return Promise.resolve(!1)})}async deletePrefix(t){let e=0;const n=[];await this.tree.walkPrefix(t,(t,e)=>(n.push(t),Promise.resolve(!1)));for(const t of n)this.deleteInternal(t)&&e++;return e}deleteInternal(t){let e=!1;const[n,r]=this.tree.get(t);if(r){const[r,i]=this.shifter.delete(n,this.dims);e=r,i&&this.tree.delete(t)}return e}async deletePrefixAll(t){let e=0;return await this.tree.walkPrefix(t,(t,n)=>{const[r,i]=this.tree.delete(t);return i&&e++,Promise.resolve(!1)}),e}increment(t){return this.shape(t,this.dims[t]+1)}insertIntoCurrentDimension(t,e){t=ji(qi(t));const[n,r]=this.tree.get(t);return r&&(e=this.shifter.insertInto(n,e,this.dims)),this.tree.insert(t,e),[e,!0]}insertIntoValuesDimension(t,e){t=ji(qi(t));const[n,r]=this.tree.get(t);return r&&(e=this.shifter.insert(n,e)),this.tree.insert(t,e),[e,!0]}insertRawWithLock(t,e){this.mu.lock();try{return this.tree.insert(t,e)}finally{this.mu.unlock()}}insertWithLock(t,e){this.mu.lock();try{return this.insertIntoValuesDimension(t,e)}finally{this.mu.unlock()}}len(){return this.tree.len()}canLock(){const t=this.mu.tryLock();return t&&this.mu.unlock(),t}lock(t){return t?this.mu.lock():this.mu.rLock(),()=>{t?this.mu.unlock():this.mu.rUnlock()}}longestPrefix(t,e,n){let r=t;for(;;){const[t,i,s]=this.tree.longestPrefix(r);if(s){const[r,s]=this.shift(i,e);if(s&&(!n||n(r)))return[t,r]}if(""===r||"/"===r)return["",void 0];const a=r.lastIndexOf("/");if(0===a)r="";else{if(!(a>0))break;r=r.substring(0,a)}}return["",void 0]}longestPrefixAll(t){const[e,,n]=this.tree.longestPrefix(t);return[e,n]}getRaw(t){const[e,n]=this.tree.get(t);return n?[e,!0]:[void 0,!1]}async walkPrefixRaw(t,e){await this.tree.walkPrefix(t,(t,n)=>e(t,n))}shape(t,e){const n=this.clone();return n.dims[t]=e,n}toString(){return`Root{${this.dims}}`}get(t){const[e]=this.getInternal(t);return e}forEachInDimension(t,e,n){t=qi(t);const[r,i]=this.tree.get(t);i&&this.shifter.forEachInDimension(r,e,n)}has(t){const[,e]=this.getInternal(t);return e}clone(){const e=Object.create(t.prototype);return Object.assign(e,this),e.dims=[...this.dims],e}shift(t,e){const[n,r]=this.shifter.shift(t,this.dims,e);return[n,r]}getInternal(t){t=qi(t);const[e,n]=this.tree.get(t);if(!n)return[void 0,!1];const[r,i]=this.shift(e,!0);return[r,i]}},Vi=class t{tree;handle;prefix;lockType;noShift;exact;debug;walkContext;skipPrefixes=[];constructor(t){if(!t.tree)throw new Error("Tree is required");this.tree=t.tree,this.handle=t.handle,this.prefix=t.prefix||"",this.lockType=t.lockType||0,this.noShift=t.noShift||!1,this.exact=t.exact||!1,this.debug=t.debug||!1,this.walkContext=t.walkContext}extend(){const e=new t({tree:this.tree,handle:this.handle,prefix:this.prefix,lockType:this.lockType,noShift:this.noShift,exact:this.exact,debug:this.debug,walkContext:this.walkContext});return e.resetLocalState(),e}skipPrefix(...t){this.skipPrefixes.push(...t)}shouldSkip(t){for(const e of this.skipPrefixes)if(t.startsWith(e))return!0;return!1}async walk(){this.resetLocalState();let t=null;this.lockType>0&&(t=this.tree.lock(2===this.lockType));try{let t=null;const e=async(e,n)=>{if(this.shouldSkip(e))return!1;const[r,i,s]=this.toT(this.tree,n);if(!i)return!1;const[a,o]=await this.handle(e,r,s);return!(!a&&!o||(t=o,0))};return""!==this.prefix?await this.tree.tree.walkPrefix(this.prefix,e):await this.tree.tree.walk(e),t}finally{t&&t()}}resetLocalState(){this.skipPrefixes=[]}toT(t,e){if(this.noShift)return[e,!0,2];{const[n,r,i]=t.shifter.shift(e,t.dims,this.exact);return[n,r,i]}}},Yi=class{delete(t,e){return[t.delete(e[Ni(1)]),t.isEmpty()]}shift(t,e,n){const[r,i]=t.shift(e[Ni(1)],n);return null!==r?i?[r,!0,1]:[r,!0,2]:[new Ji,!1,2]}forEachInDimension(t,e,n){if(e!==Ni(1))throw new Error("only language dimension supported");n(t)}insertInto(t,e,n){return t.mergeWithLang(e,n[Ni(1)])}insert(t,e){return t.merge(e)}},Ki=class extends Yi{shift(t,e,n){const[r,i]=t.shift(e[Ni(1)],n);return null!==r&&i?[r,!0,1]:[new Ji,!1,2]}},Xi=class extends Yi{shift(t,e,n){const[r,i]=t.shift(e[Ni(1)],n);return null!==r?i?[r,!0,1]:[r,!0,2]:[new Ji,!1,2]}},Zi=class{pageTreesNodeInstance;term;constructor(t,e){this.pageTreesNodeInstance=t,this.term=e}getPage(){return this.pageTreesNodeInstance.getPage()}getPages(){return this.pageTreesNodeInstance.getPages()}getResource(){return this.pageTreesNodeInstance.getResource()}isEmpty(){return this.pageTreesNodeInstance.isEmpty()}shift(t,e){return this.pageTreesNodeInstance.shift(t,e)}},Ji=class{nodes;constructor(){this.nodes=new Map}setNode(t,e){this.nodes.set(t,e)}merge(t){const e=new Map;for(const t of this.nodes.keys())e.set(t.pageLanguage(),t);for(const[n,r]of t.nodes.entries()){const t=e.get(n.pageLanguage());t?this.nodes.set(t,r):this.nodes.set(n,r)}return this}mergeWithLang(t,e){const n=new Map;for(const t of this.nodes.keys())n.set(t.pageLanguage(),t);for(const[r,i]of t.nodes.entries()){const t=n.get(r.pageLanguage());if(t){const n=this.nodes.get(t);n&&n.pageIdentity().pageLanguageIndex()===e&&this.remove(t)}this.nodes.set(r,i)}return this}remove(t){const e=this.nodes.get(t);return!!e&&(this.markStale(e),this.nodes.delete(t),!0)}delete(t){for(const[e,n]of this.nodes.entries())if(n.pageIdentity().pageLanguageIndex()===t)return this.remove(e);return!1}isEmpty(){return 0===this.nodes.size}shift(t,e){let n=null;for(const[e,r]of this.nodes.entries())if(null===n&&(n=r),r.pageIdentity().pageLanguageIndex()===t)return[ts(r),!0];return null===n||e?[null,!1]:[ts(n),!1]}getPage(){for(const t of this.nodes.values())if(t&&"function"==typeof t.kind)return[t,!0];return[null,!1]}getPages(){const t=[];for(const e of this.nodes.values())e&&"function"==typeof e.kind&&t.push(e);return t}getResource(){for(const t of this.nodes.values())return[t,!0];return[null,!1]}markStale(t){"staleVersions"in t&&t.staleVersions}},Qi=class{treePages;treeResources;treePagesResources;treeTaxonomyEntries;resourceTrees;constructor(){this.treePages=new Gi({shifter:new Ki}),this.treeResources=new Gi({shifter:new Xi}),this.treeTaxonomyEntries=Wi.newTreeShiftTree(0,10),this.treePagesResources=new Ui([]),this.resourceTrees=new Bi([]),this.treePagesResources=new Ui([this.treePages,this.treeResources]),this.resourceTrees=new Bi([this.treeResources])}createMutableTrees(){this.treePagesResources=new Ui([this.treePages,this.treeResources]),this.resourceTrees=new Bi([this.treeResources])}get TreePages(){return this.treePages}get TreeResources(){return this.treeResources}get TreePagesResources(){return this.treePagesResources}get TreeTaxonomyEntries(){return this.treeTaxonomyEntries}get ResourceTrees(){return this.resourceTrees}};function ts(t){const e=new Ji;return t&&e.setNode(t.pageIdentity(),t),e}j();var es=0,ns=N("content",{component:"pagesource"}),rs=class{id;identity;file;constructor(t){this.id=(++es).toString(),this.identity=new ui(es),this.file=t}sourceKey(){return`${this.identity.lang}/${this.file.filename()}`.replace(/\\/g,"/")}async contentSource(){return await this.readSourceAll()}async readSourceAll(){try{const t=await this.file.open(),e=await t.stat(),n=new Uint8Array(e.size()),r=await t.read(n);return await t.close(),r.buffer}catch(t){const e=t instanceof Error?t.message:String(t);throw new Error(`Failed to read file content: ${e}`)}}async posOffset(t){try{const e=await this.contentSource();return function(t,e,n){if(n<0)return{filename:t,lineNumber:0,columnNumber:0,offset:0};const r=e.slice(0,n);let i=1;for(let t=0;t<r.length;t++)10===r[t]&&i++;let s=-1;for(let t=r.length-1;t>=0;t--)if(10===r[t]){s=t;break}return{filename:t,lineNumber:i,columnNumber:n-s,offset:n}}(this.file.filename(),e,t)}catch(t){throw new Error(`failed to read content source for "${this.file.filename()}": ${t}`)}}pageIdentity(){return this.identity}pageFile(){return this.file}staleVersions(){return[]}section(){return this.file.section()}paths(){return this.file.paths()}path(){return this.file.paths().path()}slug(){return this.pathToSlug(this.path())}pathToSlug(t){let e=t.replace(/^\//,"");return e=e.replace(/\.md$/,""),e.endsWith("/index")&&(e=e.replace(/\/index$/,"")),"index"!==e&&""!==e||(e="index"),e.endsWith("/_index")&&(e=e.replace(/\/_index$/,"")),e}opener(){return()=>this.file.open()}openReader(){return{read:async()=>new Uint8Array(0)}}async content(){try{return ns.error(`Reading content not implemented from: ${this.file.filename()}`),new Uint8Array(0)}catch(t){const e=`failed to read content source for "${this.file.filename()}": ${t}`;throw ns.error(e),new Error(e)}}};function is(t){return new rs(t)}j();var ss=N("content",{component:"pagemap"});function as(t){return t.endsWith("/")||(t+="/"),t}var os=new Ji,ls=class{initOnce=!1;m=new Map;constructor(){}},cs=class{initFn;contentTreeReverseIndexMap;constructor(t){this.initFn=t,this.contentTreeReverseIndexMap=new ls}reset(){this.contentTreeReverseIndexMap=new ls}get(t){return this.contentTreeReverseIndexMap.initOnce||(this.contentTreeReverseIndexMap.m=new Map,this.initFn(this.contentTreeReverseIndexMap.m),this.contentTreeReverseIndexMap.initOnce=!0),this.contentTreeReverseIndexMap.m.get(t)||null}},hs=t=>"page"===t.kind(),us=t=>!t.shouldList||t.shouldList(!1),fs=t=>!t.shouldList||t.shouldList(!0),ds=class{path;keyPart;include;constructor(t,e,n=us){this.path=t,this.keyPart=e,this.include=n}key(){return this.path+"/"+this.keyPart}},ps=class extends ds{recursive;includeSelf;index;constructor(t,e,n,r,i,s){super(t,e,s),this.recursive=n,this.includeSelf=r,this.index=i}key(){return"gagesInSection/"+super.key()+"/"+this.recursive.toString()+"/"+this.index.toString()+"/"+this.includeSelf.toString()}},gs=class extends Qi{pageReverseIndex=null;pageBuilder;constructor(t){super(),this.pageBuilder=t}setupReverseIndex(){this.pageReverseIndex=new cs(async t=>{const e=new Vi({tree:this.treePages,lockType:1,handle:async(e,n,r)=>{if(n){const[e,r]=n.getPage();if(!r)return[!1,null];e.pageFile&&e.pageFile()&&((e,n)=>{const r=t.get(e);r&&r!==os?t.set(e,os):r||t.set(e,n)})(e.paths().baseNameNoIdentifier(),n)}return[!1,null]}});try{await e.walk()}catch(t){ss.error(`setupReverseIndex error: ${t}`)}})}insertResourceNode(t,e){const n=this.treeResources,r=n.lock(!0);try{n.insertIntoValuesDimension(t,e)}finally{r()}}async addFi(t){if(t.fileInfo().isDir())return;const e=is(t),n=e.paths().base();switch(e.file.getBundleType()){case 0:this.insertResourceNode(n,ts(e));break;case 1:const t=await this.pageBuilder.withSource(e).build();if(!t)return;this.insertResourceNode(n,ts(t));break;default:const r=await this.pageBuilder.withSource(e).build();this.treePages.insertWithLock(e.paths().base(),ts(r))}}async assemble(){await this.assembleStructurePages(),await this.applyAggregates(),await this.cleanPages(),await this.assembleTerms()}async assembleTerms(){for(const t of this.pageBuilder.langSvc.languageIndexes()){const e=this.treePages.shape(0,t),n=this.treeTaxonomyEntries.shape(0,t);await this.pageBuilder.term.assemble(e,n,this.pageBuilder,t)}}async cleanPages(){}async applyAggregates(){}async assembleStructurePages(){await this.addMissingTaxonomies();for(const t of this.pageBuilder.langSvc.languageIndexes()){const e=this.treePages.shape(0,t);await this.pageBuilder.section.assemble(e,this.pageBuilder,t)}await this.addMissingStandalone()}async addMissingTaxonomies(){const t=this.treePages.lock(!0);try{for(const t of this.pageBuilder.langSvc.languageIndexes()){const e=this.treePages.shape(0,t);await this.pageBuilder.taxonomy.assemble(e,this.pageBuilder,t)}}finally{t()}}async addMissingStandalone(){const t=this.treePages,e=t.lock(!0);try{await this.pageBuilder.standalone.assemble(t,this.pageBuilder)}finally{e()}}async getResourcesForPage(t){const e=[];return await this.forEachResourceInPage(t,0,!1,(t,n,r)=>{const[i,s]=n.getResource();return s&&e.push(i),[!1,null]}),e}async forEachResourceInPage(t,e,n,r){let i=t.paths().base();"/"===i&&(i="");const s=as(i),a="page"!==t.kind(),o=new Vi({tree:this.treeResources.shape(0,t.pageIdentity().pageLanguageIndex()),prefix:s,lockType:e,exact:n,handle:async(t,e,n)=>{if(a){const[e]=this.treePages.longestPrefixAll(t);if(e!==i&&this.pathDir(e)!==this.pathDir(t))return o.skipPrefix(e+"/"),[!1,null]}return r(t,e,n)}});try{await o.walk()}catch(t){ss.error(`forEachResourceInPage error: ${t}`)}}async getPagesInSection(t,e){const n=e.key(),r=this.treePages.shape(0,t);return this.getOrCreatePagesFromCacheSync(null,n,async t=>{const n=as(e.path),i=[];let s="";const a=e.include,o=new Vi({tree:r,prefix:n,handle:async(t,n,r)=>{if(e.recursive){const[t,e]=n.getPage();return e&&a(t)&&i.push(t),[!1,null]}const[l,c]=n.getPage();if(c&&a(l)&&i.push(l),!l.isPage||!l.isPage()){const e=t+"/";""!==s&&s===e||o.skipPrefix(e),s=e}return[!1,null]}});try{if(await o.walk(),e.includeSelf){const t=r.get(e.path);if(t){const[e,n]=t.getPage();n&&a(e)&&i.push(e)}}const t=i;return function(t){yi(ki).sort(t)}(t),Promise.resolve(t)}catch(t){ss.error(`getPagesInSection error: ${t}`)}return Promise.resolve(i)})}async getOrCreatePagesFromCacheSync(t,e,n){return await n(e)}async getPagesWithTerm(t,e){const n=e.key(),r=this.treeTaxonomyEntries.shape(0,t);return await this.getOrCreatePagesFromCacheSync(null,n,async t=>{const n=[],i=e.include;try{await r.walkPrefix(0,as(e.path),(t,e)=>{const[r,s]=e.getPage();return s&&i(r)&&n.push(r),[!1,null]});const t=n;return wi(t),t}catch(t){ss.error(`getPagesWithTerm error: ${t}`)}return n})}getTermsForPageInTaxonomy(t,e,n){const r=((i=n).startsWith("/")||(i="/"+i),i);var i;const s=this.treeTaxonomyEntries.shape(0,t);return this.getOrCreatePagesFromCacheSync(null,r+e,async t=>{const n=[];try{await s.walkPrefix(0,as(r),(t,r)=>(t.endsWith(e)&&n.push(r.term.page),[!1,null]));const t=n;return wi(t),t}catch(t){ss.error(`getTermsForPageInTaxonomy error: ${t}`)}return n})}async getSections(t,e){const n=[];let r="";const i=this.treePages.shape(0,t),s=new Vi({tree:i,prefix:e,handle:async(t,e,i)=>{const[a,o]=e.getPage();return o?(a.isPage&&a.isPage()||(""!==r&&t.startsWith(r)||(a.isSection&&a.isSection()&&a.shouldList&&a.shouldList(!1)&&a.parent&&a.parent()===a?n.push(a):s.skipPrefix(t+"/")),r=t+"/"),[!1,null]):[!1,null]}});try{await s.walk();const t=n;return wi(t),t}catch(t){ss.error(`getSections error: ${t}`)}return n}pathDir(t){const e=t.lastIndexOf("/");return-1===e?"":t.substring(0,e)}};j();var ms=N("content",{component:"pagecollector"}),ws=class{m;fs;processedPaths=new Set;constructor(t,e){this.m=t,this.fs=e}async collect(){try{const t="",e=this.fs.contentFs();for(const n of e){this.processedPaths.clear();const e=await n.stat(t);await this.collectDir(n,t,e)}}catch(t){ms.error(`Failed to collect directory: ${t}, continuing...`)}}async collectDir(t,e,n){try{await this.fs.walkContent(t,e,{hookPre:async(t,e,n)=>{const r=e;if(this.processedPaths.has(r))return ms.warn("Path already processed!",{path:r,dirName:t.name(),dirIsDir:t.isDir(),readdirLength:n.length}),[];if(this.processedPaths.add(r),0===n.length)return[];for(const t of n){if(t.isDir&&t.isDir())continue;const e=mi(t);await this.m.addFi(e)}return n},walkFn:async(t,e)=>{}},{info:n})}catch(t){throw ms.error(`Failed to collect directory: ${t}`,{path:e,rootName:n.name(),rootIsDir:n.isDir(),stack:t.stack||"No stack trace available"}),new Error(`Failed to collect directory: ${t}`)}}async handleBundleLeaf(t,e,n,r){const i=e.paths(),s=async(t,n)=>{if(n.isDir())return;const r=mi(n);n!==e.fileInfo()&&(r.isLeafBundle()&&r.paths().dir()===i.dir()||r.shiftToResource()),await this.m.addFi(r)},a=this.fs.contentFs();for(const e of a)await this.fs.walkContent(e,n,{walkFn:s},{info:t,dirEntries:r})}};j();var ys=N("content",{component:"content"}),bs=class{fs;converter;pageMap;translator;constructor(t,e,n,r){this.fs=t,this.converter=e,this.pageMap=n,this.translator=r}setTemplateSvc(t){this.pageMap.pageBuilder.templateSvc=t}async renderString(t,...e){if(e.length<1||e.length>2)throw new Error("RenderString want 1 or 2 arguments");let n=1;if(1!==e.length){const t=e[0];if("object"!=typeof t||null===t)throw new Error("first argument must be a map");throw new Error("RenderString not implemented yet")}n=0;const r=e[0],i=String(r);return mi(this.fs.newFileMetaInfoWithContent(i)),i}async collectPages(){try{await this.process(),await this.assemble()}catch(t){throw new Error(`process/assemble: ${t}`)}}async process(){try{const t=new ws(this.pageMap,this.fs);await t.collect()}catch(t){throw t}}async assemble(){try{await this.pageMap.assemble()}catch(t){throw t}}async getPageSources(t){let e=t.paths().base();return"/"===e&&(e=""),await this.pageMap.getResourcesForPage(t)}async globalPages(t){return await this.pageMap.getPagesInSection(t,new ps("","global",!0,!0,0,fs))}async globalRegularPages(){return await this.pageMap.getPagesInSection(0,new ps("","global",!0,!0,0,t=>fs(t)&&hs(t)))}async walkPages(t,e){const n=this.pageMap.treePages.shape(0,t),r=new Vi({tree:n,handle:async(t,n,r)=>{const[i,s]=n.getPage();if(!s)return[!1,null];try{await e(i)}catch(t){return[!1,t instanceof Error?t:new Error(String(t))]}return[!1,null]}});try{await r.walk()}catch(e){throw ys.error(`WalkPages failed for langIndex ${t}:`,e),e}}async walkTaxonomies(t,e){try{const n=this.pageMap.treePages.shape(0,t),r=this.pageMap.pageBuilder.taxonomy;for(const i of r.views){const s=r.pluralTreeKey(i.plural()),a=new Vi({tree:n,prefix:as(s),lockType:1,handle:async(n,r,s)=>{const[a,o]=r.getPage();if(!o)return[!1,null];if("term"===a.kind()){const r=a;if(!r.term)return[!0,new Error("term is empty")];const s=r.term.toLowerCase();try{const a=this.pageMap.treeTaxonomyEntries.shape(0,t);return await a.walkPrefix(1,as(n),(t,n)=>{const[a,o]=n.getPage();return o?(e(i.plural(),s,{weight:()=>n.term.Weight(),ordinal:()=>n.term.Ordinal(),page:()=>a,owner:()=>r}).catch(t=>{ys.error("Error in taxonomy walker:",t)}),[!1,null]):[!1,null]}),[!1,null]}catch(t){return[!0,t]}}return[!1,null]}});await a.walk()}}catch(t){throw t}}getPageFromPath(t,e){try{const n=si.createProcessor().parse(jr.COMPONENT_FOLDER_CONTENT,e);let r=this.pageMap.treePages.shape(0,t).get(n.base());if(r){const[t,e]=r.getPage();if(e)return t}return null}catch(t){return ys.error(`❌ Content.getPageFromPath error for path "${e}":`,t),null}}getPageFromFile(t,e){try{let n=this.pageMap.treePages.shape(0,t).get(e.paths().base());if(n){const[t,e]=n.getPage();if(e)return t}return null}catch(t){return ys.error(`❌ Content.getPageFromPath error for path "${e.path()}":`,t),null}}async handleChangeFiles(t){const e=[];for(const[n,r]of t)try{await this.addOrUpdateFile(r,e)}catch(t){ys.error(`Failed to process file change for ${n}:`,t)}return e}async addOrUpdateFile(t,e){if(!t.isDir())try{const n=mi(t),r=n.paths().base();r&&e.push(r),await this.pageMap.addFi(n);const i=this.getPageFromFile(0,n);i&&i.pageIdentity&&i.pageIdentity().markStale()}catch(e){throw ys.error(`Failed to add/update file in PageMap: ${t.fileName()}`,e),e}}translate(t,e){return this.translator?this.translator.translate(t,e):(ys.warn("Translator not initialized, returning fallback translation"),`[i18n] ${e}`)}getAvailableLanguages(){return this.translator?this.translator.getAvailableLanguages():[]}hasLanguageSupport(t){return!!this.translator&&this.translator.hasLanguage(t)}},vs=class{md;constructor(t){this.md=t}async convert(t,e){return this.md.render(e,t)}async parseContent(t){return this.md.parseContent(t)}async parseAndRenderContent(t,e){return this.md.parseAndRenderContent(t,e)}async prepareRender(t){return this.md.prepareRender(t)}},Es=class{rawSource;frontMatter;renderedContent="";summary="";wordCount=0;readingTime=0;toc;lazyRendered=!0;lazyRender;constructor(t){this.rawSource=t}updateWithContentResult(t){t.frontMatter&&(this.frontMatter=t.frontMatter),this.renderedContent=t.renderedContent||"",this.summary=t.summary,this.wordCount=t.wordCount||0,this.readingTime=t.readingTime||0}getRawSource(){return this.rawSource}async RenderedContent(){return await this.render(),this.renderedContent}async Summary(){return await this.render(),this.summary}async WordCount(){return await this.render(),this.wordCount}async ReadingTime(){return await this.render(),this.readingTime}async render(){return this.lazyRendered&&this.lazyRender&&(await this.lazyRender(),this.lazyRendered=!1),Promise.resolve()}isEmpty(){return!this.rawSource||0===this.rawSource.length}};function ks(t){return new Es(t)}j();var Ss=N("content",{component:"section"}),Ts=class{home;seen;fsSvc;constructor(t){this.home=null,this.seen={},this.fsSvc=t}isHome(t){return""===t}isSectionExist(t){return!(""!==t&&!this.seen[t]&&(this.seen[t]=!0,1))}async assemble(t,e,n){this.seen={};const r=new Vi({tree:t,lockType:2,handle:async(t,i,s)=>{if(!i)throw new Error("n is null");const[a,o]=i.getPage();if(!o)return[!1,null];if(this.isHome(t))return this.home=a,[!1,null];const l=a.kind();if(l!==hi("page")&&l!==hi("section"))return[!1,null];const c=a.paths().sections();for(const t of c)if(!this.isSectionExist(t))try{const i=is(mi(this.fsSvc.newFileMetaInfo("/"+t+"/_index.md"))),s=i.paths().base();if(!r.tree.get(s)){const t=await e.withSource(i).withLangIdx(n).kindBuild();r.tree.insertIntoValuesDimension(s,ts(t))}}catch(t){return[!1,t]}return[!1,null]}});try{await r.walk()}catch(t){throw Ss.error("Error walking pages:",t),t}if(!this.home&&(await this.createHome(e),this.home)){const e=this.home;t.insertWithLock(e.paths().base(),ts(e))}}async createHome(t){const e=is(mi(this.fsSvc.newFileMetaInfo("/_index.md"))),n=await t.withSource(e).kindBuild();this.home=n}},xs="_sitemap",As=class{fsSvc;constructor(t){this.fsSvc=t}async assemble(t,e){const n="/404",r=await this.addStandalone(n,e);t.insertIntoValuesDimension(n,ts(r));const i="/"+xs,s=await this.addStandalone(i,e);t.insertIntoValuesDimension(i,ts(s))}async addStandalone(t,e){const n=is(mi(this.fsSvc.newFileMetaInfo(t+".md")));return await e.withSource(n).kindBuild()}};j();var Cs=class{source;pageKind;baseName;target=null;constructor(t,e){this.source=t,this.pageKind=e,this.baseName="",this.setBasename(),this.buildTarget()}setBasename(){switch(this.pageKind){case hi("404"):this.baseName="404";break;case hi("sitemap"):this.baseName="sitemap";break;default:this.baseName=this.source.paths().baseNameNoIdentifier()||"index"}}buildTarget(){let t="",e="";const n="index";switch(this.pageKind){case hi("home"):t=`${n}.html`,e="";break;case hi("page"):const r=this.source.paths().containerDir();t=r&&"/"!==r?`${r}/${this.baseName}.html`:`/${this.baseName}.html`,e=r||"";break;case hi("section"):case hi("taxonomy"):case hi("term"):const i=this.source.paths().dir();t=i?`${i}/${n}.html`:`${n}.html`,e=i||"";break;case hi("404"):const s=this.source.paths().dir();t=s?`${s}/${this.baseName}.html`:`${this.baseName}.html`,e=s||"";break;case hi("sitemap"):const a=this.source.paths().dir();t=a?`${a}/${this.baseName}.xml`:`${this.baseName}.xml`,e=a||"";break;default:t=`${n}.html`,e=""}this.target={prefix:this.source.identity.pageLanguage(),filePath:t,subResourceBaseTarget:e}}createBasicResult(){return{bytes:()=>new Uint8Array,headers:()=>[],tableOfContents:()=>({toHTML:(t,e,n)=>""})}}output(t){return{targetFileBase:()=>{if(!this.target)return"index.html";const t=this.target.filePath,e=t.lastIndexOf("/");return e>=0?t.substring(e+1):t},targetFilePath:()=>this.target.filePath,targetSubResourceDir:()=>this.target.subResourceBaseTarget,targetPrefix:()=>this.target.prefix,content:async()=>t.content?t.content.RenderedContent():"",summary:async()=>t.content?t.content.Summary():"",tableOfContents:()=>t.content&&t.content.toc?t.content.toc.toHTML(1,6,!1):"",result:()=>this.createBasicResult(),readingTime:async()=>t.content?t.content.ReadingTime():0,wordCount:async()=>t.content?t.content.WordCount():0}}};j(),N("content",{component:"paginator"});var Ds=class{paginatedElements;G;base;total;size;constructor(t,e,n,r){if(this.paginatedElements=t,this.base=r,this.total=e,this.size=n,this.G=[],t.length>0)for(let e=0;e<t.length;e++)this.G.push(new Ps(e+1,this));else this.G.push(new Ps(1,this))}totalPages(){return this.paginatedElements.length}pagers(){return[...this.G]}getElement(t){return 0===this.paginatedElements.length?[]:this.paginatedElements[t-1]||[]}getBase(){return this.base}getPagers(){return this.G}getAllPages(){const t=[];for(const e of this.paginatedElements)t.push(...e);return t}},Ps=class{number;paginator;constructor(t,e){this.number=t,this.paginator=e}pageNumber(){return this.number}totalPages(){return this.paginator.totalPages()}url(){const t=this.pageNumber();if(t>1){const e=`/page/${t}/`;return this.pathJoin(this.paginator.getBase(),e)}return this.paginator.getBase()}pages(){return this.element()}allPages(){return this.paginator.getAllPages()}pagers(){return this.paginator.pagers()}first(){return this.paginator.getPagers()[0]}last(){const t=this.paginator.getPagers();return t[t.length-1]}hasPrev(){return this.pageNumber()>1}prev(){return this.hasPrev()?this.paginator.getPagers()[this.pageNumber()-2]:null}hasNext(){return this.pageNumber()<this.paginator.totalPages()}next(){return this.hasNext()?this.paginator.getPagers()[this.pageNumber()]:null}element(){return this.paginator.getElement(this.pageNumber())}pathJoin(t,e){return t.endsWith("/")&&(t=t.slice(0,-1)),e.startsWith("/")||(e="/"+e),t+e}},Ls=class{currentPager=null;initialized=!1;svc;page;constructor(t,e){this.svc=t,this.page=e}async current(){return this.initialized||await this.initializePaginator(),this.currentPager?this.currentPager:new Ds([],0,10,this.page.paths().base()).pagers()[0]}setCurrent(t){this.currentPager=t}async paginate(t){if(!this.initialized){const e=this.svc.pageSize();let n;n=Array.isArray(t)&&t.length>0&&"key"in t[0]?this.newPaginatorFromPageGroups(t,e,this.page.paths().base()):this.newPaginatorFromPages(t,e,this.page.paths().base()),this.currentPager=n.pagers()[0],this.initialized=!0}return this.currentPager||this.current()}async paginator(){return this.initialized||await this.initializePaginator(),this.currentPager||this.current()}async initializePaginator(){try{const t=this.svc.pageSize();let e=[];switch(this.page.kind()){case"home":e=await this.svc.globalRegularPages();break;case"term":case"taxonomy":const t=await this.page.pages();e=t?.length?Array.from({length:t.length},(e,n)=>t[n]):[];break;default:const n=await this.page.regularPages();e=n&&n.length>0?Array.from({length:n.length},(t,e)=>n[e]):await this.svc.globalRegularPages()}const n=this.page.paths().base(),r=this.newPaginatorFromPages(e,t,n);this.currentPager=r.pagers()[0],this.initialized=!0}catch(t){const e=this.page.paths().base(),n=new Ds([],0,10,e);this.currentPager=n.pagers()[0],this.initialized=!0}}newPaginatorFromPages(t,e,n){if(e<=0)throw new Error("paginator size must be positive");const r=this.splitPages(t,e);return new Ds(r,t.length,e,n)}newPaginatorFromPageGroups(t,e,n){if(e<=0)throw new Error("paginator size must be positive");const r=[];if(t&&t.length>0)for(let e=0;e<t.length;e++){const n=t[e];if(n&&n.pages){const t=n.pages();if(t)for(let e=0;e<t.length;e++)r.push(t[e])}}const i=this.splitPages(r,e);return new Ds(i,r.length,e,n)}splitPages(t,e){const n=[];for(let r=0;r<t.length;r+=e){const i=Math.min(r+e,t.length);n.push(t.slice(r,i))}return n}},Rs=class{values;constructor(){this.values=new Map}add(t,e){const n=this.values.get(t);let r;return r=void 0!==n?Array.isArray(n)?[...n,e]:"number"==typeof n&&"number"==typeof e||"string"==typeof n&&"string"==typeof e?n+e:e:e,this.values.set(t,r),""}Add(t,e){return this.add(t,e)}set(t,e){return this.values.set(t,e),""}Set(t,e){return this.set(t,e)}delete(t){return this.values.delete(t),""}get(t){return this.values.get(t)}Get(t){return this.get(t)}getValues(){return this.values}setInMap(t,e,n){let r=this.values.get(t);return r&&"object"==typeof r||(r={},this.values.set(t,r)),r[e]=n,""}};function Ns(t){const e=t.lastIndexOf("/");if(-1===e)return"";let n=t.slice(0,e+1);return n.length>1&&n.endsWith("/")&&(n=n.slice(0,-1)),n}var _s=m(require("path"));j(),N("content",{component:"page"});var Os=class{source;content;meta;layout;pagerManager;title_;description_="";kind_;pageMap;output_=null;store_=null;constructor(t,e,n,r,i="",s="page",a=null){this.source=t,this.content=e,this.meta=n,this.layout=r,this.title_=i,this.kind_=s,this.pageMap=a,this.pagerManager=new Ls({pageSize:()=>10,globalRegularPages:async()=>[]},this)}rawContent(){if(!this.content)return"";const t=this.content.getRawSource();return(new TextDecoder).decode(t)}pageIdentity(){return this.source.identity}pageFile(){return this.source.file}staleVersions(){return[]}section(){return this.source.file.section()}paths(){return this.source.file.paths()}path(){return this.source.file.paths().path()}slug(){return this.pathToSlug(this.path())}pathToSlug(t){let e=t.replace(/^\//,"");return e=e.replace(/\.md$/,""),e.endsWith("/index")&&(e=e.replace(/\/index$/,"")),"index"!==e&&""!==e||(e="index"),e.endsWith("/_index")&&(e=e.replace(/\/_index$/,"")),e}posOffset(t){return this.source.posOffset(t)}description(){return this.description_}get Description(){return this.description()}StaticURL(t){return/^(https?:)?\/\//.test(t)?t:((t=(t=_s.default.normalize(t)).replace(/\\/g,"/")).startsWith("/")&&(t=t.slice(1)),`${this.meta.pageBaseUrl().replace(/\/+$/,"")}/${t}`)}params(){return this.meta.params()}get Params(){return this.params()}store(){return this.store_||(this.store_=new Rs),this.store_}get Store(){return this.store()}scratch(){return this.store()}get Scratch(){return this.scratch()}pageBaseUrl(){return this.meta.pageBaseUrl()}pageWeight(){return this.meta.pageWeight()}pageDate(){return this.meta.pageDate()}publishDate(){return this.meta.publishDate()}async relatedKeywords(t){return this.meta.relatedKeywords(t)}shouldList(t){return this.meta.shouldList(t)}shouldListAny(){return this.meta.shouldListAny()}noLink(){return this.meta.noLink()}organization(){return this.meta.organization()}author(){return this.meta.author()}menu(){return this.meta.menu()}async current(){return await this.pagerManager.current()}setCurrent(t){this.pagerManager.setCurrent(t)}async paginator(){return await this.pagerManager.paginator()}async paginate(t){return this.pagerManager.paginate(t)}file(){return this.source.file}get Type(){return this.file().type()}name(){return this.source.file.baseFileName()}title(){return this.title_}get Title(){return this.title()}kind(){return this.kind_}isHome(){return this.kind()===hi("home")}isPage(){return this.kind()===hi("page")}isSection(){return this.kind()===hi("section")}isAncestor(t){return t.path()!==this.path()&&t.paths().base().startsWith(this.paths().base())}eq(t){return this.pageIdentity().identifierBase()===t.pageIdentity().identifierBase()}layouts(){switch(this.kind_){case hi("home"):return this.source.file.isBranchBundle()?this.layout.homeList():this.layout.home();case hi("page"):return this.layout.page(this.source.file.section(),this.source.file.baseFileName());case hi("section"):return this.layout.section(this.source.file.section());case hi("taxonomy"):return this.layout.taxonomy();case hi("term"):return this.layout.term();case hi("404"):return this.layout.standalone404();case hi("sitemap"):return this.layout.standaloneSitemap();default:return[]}}output(){return this.output_||(this.output_=new Cs(this.source,this.kind())),this.output_.output(this)}get TargetPath(){return this.output().targetFilePath()}get Summary(){return this.output().summary()}truncated(){return!0}parent(){if(this.isHome())return null;let t=this.paths().containerDir();if(""===t)return null;for(;;){const e=this.pageMap?.treePages.longestPrefix(t,!0);if(!e)return null;const[n,r]=e;if(!r)return null;const[i,s]=r.getPage();if(!i)return null;if(this.isBundled())return s?i:null;if(!i.isPage())return s?i:null;t=Ns(t)}}async Pages(){return await this.pages()}async pages(){const t=this.pageIdentity().pageLanguageIndex();switch(this.kind()){case Xe:case Je:case Ze:return await this.pageMap.getPagesInSection(t,new ps(this.paths().base(),"page-section",!1,!1,t,t=>us(t)&&(hs(t)||(t=>"section"===t.kind())(t))));case tn:return await this.pageMap.getPagesWithTerm(t,new ds(this.paths().base(),"term"));case Qe:return await this.pageMap.getPagesInSection(t,new ps(this.paths().base(),"term",!0,!1,t,t=>us(t)&&(t=>"term"===t.kind())(t)));default:return Promise.resolve([])}}prevInSection(){return null}nextInSection(){return null}sections(t){return[]}async regularPages(){const t=this.pageIdentity().pageLanguageIndex();switch(this.kind()){case Xe:case Je:case Ze:case Qe:return this.pageMap?await this.pageMap.getPagesInSection(t,new ps(this.paths().base(),"",!1,!1,t,t=>us(t)&&hs(t))):[];case tn:return this.pageMap?await this.pageMap.getPagesWithTerm(t,new ds(this.paths().base(),"",t=>us(t)&&hs(t))):[];default:return[]}}regularPagesRecursive(){return[]}async terms(t,e){return this.pageMap?this.pageMap?.getTermsForPageInTaxonomy(t,this.paths().base(),e):null}async isTranslated(){return(await this.translations()).length>0}async translations(){const t=this.path()+"/"+this.pageIdentity().pageLanguage()+"/translations";if(!this.pageMap)return[];try{return await this.pageMap.getOrCreatePagesFromCacheSync(null,t,async t=>{const e=await this.allTranslations(),n=[];for(let t=0;t<e.length;t++){const r=e.at(t);r&&!r.eq(this)&&n.push(r)}return n})}catch(t){throw t}}async allTranslations(){const t=this.path()+"/translations-all";if(!this.pageMap)return[];try{return await this.pageMap.getOrCreatePagesFromCacheSync(null,t,async t=>{const e=[];var n;return this.pageMap.treePages.forEachInDimension(this.paths().base(),Ni(1),t=>{if(null!=t){const n=t.getPages();e.push(...n)}return!1}),n=e,yi(Ei).sort(n),e})}catch(t){throw t}}isBundled(){return this.source.file.isBundle()}},Is=class extends Os{singular;constructor(t,e,n,r,i,s="",a="taxonomy",o=null){super(t,e,n,r,s,a,o),this.singular=i}params(){const t=super.params();return t.Singular=this.singular,t}},Ms=class extends Is{term;constructor(t,e,n,r,i,s,a="",o="term",l=null){super(t,e,n,r,i,a,o,l),this.term=s}params(){const t=super.params();return t.Term=this.term,t}},Fs=class{baseURL;list;parameters;weight;date;org;authorInfo;menuConfig;constructor(t,e="always",n={},r=0,i=new Date,s,a,o){this.baseURL=t,this.list=e,this.parameters=n,this.weight=r,this.date=i,this.org=s,this.authorInfo=a,this.menuConfig=o}description(){return""}params(){return this.parameters}pageBaseUrl(){return this.baseURL}pageWeight(){return this.weight}pageDate(){return this.date}publishDate(){return this.pageDate()}async relatedKeywords(t){return[]}shouldList(t){switch(this.list){case"always":default:return!0;case"never":return!1;case"local":return!t}}shouldListAny(){return this.shouldList(!0)||this.shouldList(!1)}noLink(){return!1}organization(){return this.org}author(){return this.authorInfo}menu(){return this.menuConfig}},$s=class{home(){return["index.html","_default/index.html","_default/single.html"]}homeList(){return["index.html","_default/index.html","_default/list.html"]}section(t){return[`${t}/section.html`,`${t}/list.html`,"_default/section.html","_default/list.html","_default/index.html"]}page(t,e){const n=t?`${t}/${e}`:e,r=t?`${t}/single.html`:"single.html",i=[];return"index"!==n&&i.push(`${n}.html`),i.push(r),"index"!==e&&i.push(`_default/${e}.html`),i.push("_default/single.html"),i.push("index.html"),i.push("_default/index.html"),i}taxonomy(){return["taxonomy/taxonomy.html","taxonomy/list.html","_default/list.html","_default/taxonomy.html"]}term(){return["taxonomy/tag.html","term/term.html","taxonomy/list.html","_default/list.html","_default/term.html"]}standalone404(){return["404.html"]}standaloneSitemap(){return["sitemap.xml","_default/sitemap.xml"]}},Us=class{V;Y;K;X;u;Z;J;tt;et=null;nt;it=null;st=null;constructor(t,e,n,r,i,s,a,o="",l=0){this.V=t,this.Y=e,this.K=n,this.X=r,this.u=i,this.Z=s,this.J=a,this.tt=o,this.nt=l}get params(){return this.V}get Params(){return this.V}get IsNamedParams(){return this.Z}get inner(){return this.Y}get Inner(){return this.Y}get page(){return this.K}get Page(){return this.K}get parent(){return this.X}get Parent(){return this.X}get name(){return this.u}get isNamedParams(){return this.Z}get ordinal(){return this.J}get Ordinal(){return this.J}innerDeindent(){if(""===this.tt)return this.Y;if(null===this.et){const t=this.Y.split("\n");this.et=t.map(t=>t.startsWith(this.tt)?t.substring(this.tt.length):t).join("\n")}return this.et}get InnerDeindent(){return this.innerDeindent()}async position(){return this.it||(this.it=await this.K.posOffset(this.nt)),this.it}scratch(){return this.st||(this.st=new Rs),this.st}get(t){return this.V?Array.isArray(this.V)?"number"==typeof t?t>=this.V.length?"":this.V[t]:null:"object"==typeof this.V&&"string"==typeof t?this.V[t]||"":null:null}Get(t){return this.get(t)}},Bs="partials/",qs=class extends Error{constructor(t,e){super(t),this.code=e,this.name="TemplateError"}},js=(new qs("template not found","TEMPLATE_NOT_FOUND"),new qs("template parse failed","PARSE_FAILED"),new qs("template execute failed","EXECUTE_FAILED"),new qs("invalid template","INVALID_TEMPLATE"),m(require("path"))),Hs=class{baseof=new Map;needsBaseof=new Map;getTemplateSearchOrder(t){const e=[];return e.push("_default/baseof.html"),e}getBaseOf(t){return this.baseof.get(t)||null}getNeedsBaseOf(t){return this.needsBaseof.get(t)||null}addBaseOf(t,e){this.baseof.set(t,e)}addNeedsBaseOf(t,e){this.needsBaseof.set(t,e)}isBaseTemplatePath(t){return js.basename(t).includes("baseof")}needsBaseOf(t,e){return!this.noBaseNeeded(t)&&this.needsBaseTemplate(e)}noBaseNeeded(t){return!!t.startsWith(Bs)}needsBaseTemplate(t){let e=-1,n=!1;for(let r=0;r<t.length;)if(!n&&t.substring(r).startsWith("{{/*"))n=!0,r+=4;else if(!n&&t.substring(r).startsWith("{{- /*"))n=!0,r+=6;else if(n&&t.substring(r).startsWith("*/}}"))n=!1,r+=4;else if(n&&t.substring(r).startsWith("*/ -}}"))n=!1,r+=6;else{const i=t[r];if(!n){if(t.substring(r).startsWith("{{")){e=r;break}if(!/\s/.test(i))break}r++}return-1!==e&&/^{{-?\s*define/.test(t.substring(e))}getAllBaseOf(){return new Map(this.baseof)}getAllNeedsBaseOf(){return new Map(this.needsBaseof)}clear(){this.baseof.clear(),this.needsBaseof.clear()}getStats(){return{baseOfCount:this.baseof.size,needsBaseOfCount:this.needsBaseof.size}}},zs=class t{constructor(t,e,n){this.name=t,this.template=e,this.fi=n}identifierBase(){return this.name}errWithFileContext(t,e){const n=`${t}: ${e.message}`,r=new qs(n,"TEMPLATE_FILE_ERROR");return Object.defineProperty(r,"fileName",{value:this.name,enumerable:!0}),Object.defineProperty(r,"fileContent",{value:this.template,enumerable:!0}),r}isZero(){return""===this.name}copy(){return new t(this.name,this.template,this.fi)}getCleanContent(){return Ws(this.template)}};function Ws(t){for(let e=0;e<t.length;e++){const n=t[e];if(0===e&&"\ufeff"!==n)return t;if(e>0)return t.substring(e)}return t}function Gs(t){return function(t){return t.includes("_shortcodes/")}(t)?1:t.includes("_partials/")?2:0}j(),N("template",{component:"namespace"});var Vs=class{templates=new Map;mutex=new Set;addTemplate(t,e){this.withLock(()=>{this.templates.set(t,e)})}findTemplate(t){return this.withReadLock(()=>{if(this.templates.has(t))return this.templates.get(t)||null;if(!t.endsWith(".html")){const e=t+".html";if(this.templates.has(e))return this.templates.get(e)||null}for(const[e,n]of this.templates.entries())if(e.includes(t))return n;return null})}getTemplates(){return this.withReadLock(()=>new Map(this.templates))}hasTemplate(t){return this.withReadLock(()=>this.templates.has(t))}getTemplateNames(){return this.withReadLock(()=>Array.from(this.templates.keys()))}removeTemplate(t){return this.withLock(()=>this.templates.delete(t))}clear(){this.withLock(()=>{this.templates.clear()})}size(){return this.withReadLock(()=>this.templates.size)}getTemplatesByPattern(t){return this.withReadLock(()=>{const e=[];for(const[n,r]of this.templates)t.test(n)&&e.push(r);return e})}withLock(t){const e="write";for(;this.mutex.has(e););this.mutex.add(e);try{return t()}finally{this.mutex.delete(e)}}withReadLock(t){const e="read";this.mutex.add(e);try{return t()}finally{this.mutex.delete(e)}}},Ys=class extends Vs{lookup(t){const e=this.findTemplate(t);return e?e.template:null}findTemplateWithDependencies(t){return this.findTemplate(t)}getTemplatesNeedingBase(){return this.withReadLock(()=>Array.from(this.templates.values()).filter(t=>t.baseInfo))}},Ks=class extends Vs{lookup(t){const e=this.findTemplate(t);return e?e.template:null}addPartialTemplate(t,e){const n={...e,type:2};this.addTemplate(t,n)}},Xs=class extends Vs{lookup(t){const e=this.findTemplate(t);return e?e.template:null}addShortcodeTemplate(t,e){const n={...e,type:1};this.addTemplate(t,n)}getShortcode(t){return this.lookup("_shortcodes/"+t)}hasShortcode(t){return this.hasTemplate(t)}getShortcodeNames(){return this.getTemplateNames()}},Zs=class{async execute(t,e){try{const[n,r]=await t.Execute(e);if(r)throw new qs(`Template execution failed: ${r.message}`,"EXECUTION_FAILED");return n}catch(t){if(t instanceof qs)throw t;const e=t instanceof Error?t.message:String(t);throw new qs(`Template execution failed: ${e}`,"EXECUTION_FAILED")}}async executeWithTimeout(t,e,n){return new Promise(async(r,i)=>{const s=setTimeout(()=>{i(new qs("Template execution timeout","EXECUTION_TIMEOUT"))},n);await this.execute(t,e).then(t=>{clearTimeout(s),r(t)}).catch(t=>{clearTimeout(s),i(t)})})}async executeSafely(t,e){try{return{result:await this.execute(t,e),error:null}}catch(t){if(t instanceof qs)return{result:null,error:t};const e=t instanceof Error?t.message:String(t);return{result:null,error:new qs(`Execution failed: ${e}`,"EXECUTION_ERROR")}}}async executeBatch(t){return(await Promise.allSettled(t.map(async({name:t,template:e,data:n})=>{try{return{name:t,result:await this.execute(e,n),error:null}}catch(e){return{name:t,result:null,error:e instanceof qs?e:new qs(`Batch execution failed: ${e.message}`,"BATCH_EXECUTION_FAILED")}}}))).map(t=>"fulfilled"===t.status?t.value:{name:"unknown",result:null,error:new qs(`Batch execution failed: ${t.reason}`,"BATCH_EXECUTION_FAILED")})}async executeWithContext(t,e,n){if(n.signal?.aborted)throw new qs("Template execution was cancelled","EXECUTION_CANCELLED");const r=new Promise((t,e)=>{n.signal&&n.signal.addEventListener("abort",()=>{e(new qs("Template execution was cancelled","EXECUTION_CANCELLED"))})}),i=n.timeout?new Promise((t,e)=>{setTimeout(()=>{e(new qs("Template execution timeout","EXECUTION_TIMEOUT"))},n.timeout)}):new Promise(()=>{});try{return await Promise.race([this.execute(t,e),r,i])}catch(t){if(t instanceof qs)throw t;throw new qs(`Context execution failed: ${t.message}`,"CONTEXT_EXECUTION_FAILED")}}},Js=require("@mdfriday/text-template"),Qs=require("@mdfriday/text-template");j(),j();var ta=N("content",{component:"cache"}),ea=class{cache=new Map;pendingPromises=new Map;deletedKeys=new Set;constructor(){}get(t){return this.cache.get(t)}set(t,e){this.deletedKeys.has(t)||this.cache.set(t,e),this.pendingPromises.delete(t),this.deletedKeys.delete(t)}has(t){return this.cache.has(t)}isPending(t){return this.pendingPromises.has(t)}delete(t){return this.deletedKeys.add(t),this.pendingPromises.delete(t),this.cache.delete(t)}clear(){this.cache.clear(),this.pendingPromises.clear(),this.deletedKeys.clear()}size(){return this.cache.size}pendingCount(){return this.pendingPromises.size}async getOrCreate(t,e){const n=this.cache.get(t);if(void 0!==n)return n;const r=this.pendingPromises.get(t);return r?await r:this.createAndCache(t,e)}async createAndCache(t,e){const n=this.executeCreate(t,e);this.pendingPromises.set(t,n);try{const e=await n;return this.deletedKeys.has(t)?(this.deletedKeys.delete(t),this.pendingPromises.delete(t),e):(this.set(t,e),e)}catch(e){throw this.pendingPromises.delete(t),ta.error(`Failed to create value for key ${String(t)} : ${e}`),e}}async executeCreate(t,e){try{return await e(t)}catch(e){const n=e instanceof Error?e.message:String(e),r=new Error(`Cache creation failed for key ${String(t)}: ${n}`);throw e instanceof Error&&e.stack&&(r.stack=e.stack,r.originalError=e),r}}getStats(){return{size:this.cache.size,pendingCount:this.pendingPromises.size,keys:Array.from(this.cache.keys()),pendingKeys:Array.from(this.pendingPromises.keys())}}async preload(t){const e=t.filter(({key:t})=>!this.has(t)&&!this.isPending(t)).map(({key:t,create:e})=>this.getOrCreate(t,e));e.length>0&&await Promise.allSettled(e)}},na=(new ea,N("template",{component:"parser"})),ra=class{prototypeText;prototypeTextClone;readyInit=!1;funcMap;parseOverlapCache;constructor(t=new Map){this.funcMap=t,this.prototypeText=(0,Js.New)(""),this.parseOverlapCache=new ea,this.funcMap.size>0&&this.prototypeText.Funcs(this.funcMap)}async markReady(){this.readyInit||(this.prototypeTextClone=this.prototypeText,this.readyInit=!0)}async parse(t){try{const e=(0,Js.New)(t.name);this.funcMap&&this.funcMap.size>0&&e.Funcs(this.funcMap);const[n,r]=e.Parse(t.template);if(r)throw new qs(`Parse failed: ${r.message}`,"PARSE_FAILED");return{template:n,info:t,type:Gs(t.name)}}catch(t){if(t instanceof qs)throw t;const e=t instanceof Error?t.message:String(t);throw new qs(`Parse failed: ${e}`,"PARSE_FAILED")}}async parseWithLock(t,e){try{this.prototypeTextClone||await this.markReady();const n=(0,Js.New)(t);this.funcMap&&this.funcMap.size>0&&n.Funcs(this.funcMap);const[r,i]=n.Parse(e);if(i)throw new qs(`Parse with lock failed: ${i.message}`,"PARSE_LOCK_FAILED");return r}catch(t){if(t instanceof qs)throw t;const e=t instanceof Error?t.message:String(t);throw new qs(`Parse with lock failed: ${e}`,"PARSE_LOCK_FAILED")}}async parseOverlap(t,e,n){const r=`${t.name}::${e.name||"empty"}`;return this.parseOverlapCache.getOrCreate(r,async()=>{try{const r={template:await this.applyBaseTemplate(t,e,n),info:t,type:Gs(t.name)};return e.isZero&&!e.name||(r.baseInfo=e),[r,!0,null]}catch(t){const e=t instanceof qs?t:new qs(`Parse overlap failed: ${t.message}`,"PARSE_OVERLAP_FAILED");return na.error(`Failed to parse template overlap for key: ${r}: ${e.message}`),[null,!1,e]}})}async applyBaseTemplate(t,e,n){try{const r=(0,Js.New)(t.name);if(this.funcMap&&this.funcMap.size>0&&r.Funcs(this.funcMap),!e.isZero||e.name){const[t,n]=r.Parse(e.template);if(n)throw new qs(`Base template parse failed: ${n.message}`,"BASE_PARSE_FAILED")}const[i,s]=r.Clone();if(s)throw new qs(`Template clone failed: ${s.message}`,"CLONE_FAILED");const[a,o]=i.Parse(t.template);if(o)throw new qs(`Overlay template parse failed: ${o.message}`,"OVERLAY_PARSE_FAILED");const l=await this.getDependencies(a,new Map,n);for(const[e,n]of l)if(e!==t.name)try{if(n.template.Tree){const[,t]=a.AddParseTree(e,n.template.Tree);if(t)throw na.error(`AddParseTree failed: ${t.message} with name ${e}`),new qs(`AddParseTree failed: ${t.message}`,"ADD_PARSE_TREE_FAILED")}}catch(n){throw na.error(`Error adding dependency ${e} to template ${t.name}:`,n),new qs(`Failed to add dependency ${e}: ${n.message}`,"DEPENDENCY_ADD_FAILED")}return a}catch(t){if(t instanceof qs)throw t;const e=t instanceof Error?t.message:String(t);throw new qs(`Apply base template failed: ${e}`,"APPLY_BASE_FAILED")}}async getDependencies(t,e,n){const r=new Map;if(e.has(t.Name()))return r;e.set(t.Name(),t);try{const i=new Set,s=t=>{if(!t)return;const e=t.Type();if(e===Qs.NodeType.NodeTemplate){const e=t.Name;e&&i.add(e)}else if(e===Qs.NodeType.NodeList){const e=t;if(e.Nodes)for(const t of e.Nodes)s(t)}if(e===Qs.NodeType.NodeAction){const e=t;e.Pipe&&s(e.Pipe)}else if(e===Qs.NodeType.NodePipe){const e=t;if(e.Cmds)for(const t of e.Cmds)s(t)}else if(e===Qs.NodeType.NodeCommand){const e=t;if(e.Args)for(const t of e.Args)s(t)}else if(e===Qs.NodeType.NodeIf||e===Qs.NodeType.NodeRange||e===Qs.NodeType.NodeWith){const e=t;e.Pipe&&s(e.Pipe),e.List&&s(e.List),e.ElseList&&s(e.ElseList)}};t.Tree&&t.Tree.Root&&s(t.Tree.Root);for(const t of i){const i=n(t);if(i&&(r.set(t,i),!e.has(i.template.Name()))){const t=await this.getDependencies(i.template,e,n);for(const[e,n]of t)r.has(e)||r.set(e,n)}}}catch(e){na.error(`Error getting dependencies for template ${t.Name()}:`,e)}return r}setFuncMap(t){this.funcMap=new Map([...this.funcMap,...t]),this.funcMap.size>0&&this.prototypeText.Funcs(this.funcMap)}getFuncMap(){return new Map(this.funcMap)}async parseMultiple(t){const e=await Promise.allSettled(t.map(t=>this.parse(t))),n=[],r=[];for(const t of e)"fulfilled"===t.status?n.push(t.value):r.push(t.reason);if(r.length>0)throw new qs(`Failed to parse ${r.length} templates: ${r.map(t=>t.message).join(", ")}`,"MULTIPLE_PARSE_FAILED");return n}clearCache(){this.parseOverlapCache.clear()}getCacheStats(){return this.parseOverlapCache.getStats()}},ia=class{baseOf;funcsv;constructor(t,e){if(this.baseOf=t||new Hs,this.funcsv=new Map,e)for(const[t,n]of e)this.funcsv.set(t,n)}findNoDependence(t,e){try{const n=e.lookup(t);return n?[n,!0,null]:[null,!1,null]}catch(t){return[null,!1,t]}}findTemplate(t,e){try{const n=e.lookup(t);if(n)return[n,!0,null];const r=e.findTemplateWithDependencies(t);return r&&r.baseInfo?[r.template,!0,null]:[null,!1,null]}catch(t){return[null,!1,t]}}findPartial(t,e){try{const n=e.lookup(t);return n?[n,!0,null]:[null,!1,null]}catch(t){return[null,!1,t]}}findShortcode(t,e){try{const n=e.getShortcode(t);return n?[n,!0,null]:[null,!1,null]}catch(t){return[null,!1,t]}}findDependentInfo(t){const e=this.baseOf.getNeedsBaseOf(t);if(!e)return[null,null,!1];let n=null,r=!1;for(const e of this.baseOf.getTemplateSearchOrder(t))if(n=this.baseOf.getBaseOf(e),n){r=!0;break}return[e,n,r]}getFunc(t){return this.funcsv.get(t)}setFunc(t,e){this.funcsv.set(t,e)}setFuncMap(t){this.funcsv.clear();for(const[e,n]of t)this.funcsv.set(e,n)}getFuncMap(){return new Map(this.funcsv)}newTemplateLookup(t){return e=>t.findTemplate(e)}getBaseOf(){return this.baseOf}setBaseOf(t){this.baseOf=t}hasDependencies(t){const[e,n,r]=this.findDependentInfo(t);return r&&(null!==e||null!==n)}getAllFunctions(){return Array.from(this.funcsv.keys())}clearFunctions(){this.funcsv.clear()}getStats(){const t=this.baseOf.getStats();return{functionCount:this.funcsv.size,baseTemplateCount:t.baseOfCount,dependentTemplateCount:t.needsBaseOfCount}}};j();var sa=N("template",{component:"template-engine"}),aa=class{executor;lookup;parser;templateNamespace;partialNamespace;shortcodeNamespace;fs;constructor(t,e,n,r,i,s,a){this.executor=t,this.lookup=e,this.parser=n,this.templateNamespace=r,this.partialNamespace=i,this.shortcodeNamespace=s,this.fs=a}async markReady(){try{await this.parser.markReady()}catch(t){throw new qs(`Failed to mark template engine ready: ${t.message}`,"TEMPLATE_ENGINE_READY_FAILED")}}async getTemplate(t){const[e,n,r]=this.lookup.findTemplate(t,this.templateNamespace);if(r)return[null,!1,r];if(n&&e)return[e,!0,null];const[i,s,a]=this.lookup.findDependentInfo(t);if(a&&i)try{const[t,e,n]=await this.parser.parseOverlap(i,s||i,this.lookup.newTemplateLookup(this.templateNamespace));if(n)return[null,!1,n];if(e&&t)return[t.template,!0,null]}catch(t){return[null,!1,t]}return[null,!1,null]}async getPartial(t){let e=t.startsWith(Bs)?t:`${Bs}${t}`;return e=t.endsWith(".html")?e:`${e}.html`,this.lookup.findPartial(e,this.partialNamespace)}async getShortcode(t){return this.lookup.findShortcode(t,this.shortcodeNamespace)}async get(t){switch(Gs(t)){case 1:return this.getShortcode(t);case 2:return this.getPartial(t);default:return this.getTemplate(t)}}async findFirst(t){if(!t||0===t.length)return[null,null,!1,null];for(const e of t)try{const[t,n,r]=await this.get(e);if(r)continue;if(n&&t)return[t,e,!0,null]}catch(t){sa.error("Error finding template:",t)}return[null,null,!1,null]}hasShortcode(t){return this.shortcodeNamespace.hasShortcode(t)}getShortcodeNames(){return this.shortcodeNamespace.getShortcodeNames()}getShortcodeCount(){return this.getShortcodeNames().length}async loadTemplates(){const t=async(t,e)=>{if(e.isDir())return;const n=t.startsWith(jr.SYSTEM_PATH_SEPARATOR)?t.substring(1):t,r=jr.normalizePath(n);try{await this.addTemplateFileInfo(r,e)}catch(t){sa.error("Error adding template:",new qs(`Failed to add template ${r}: ${t.message}`,"LOAD_TEMPLATE_FAILED"))}};try{await this.fs.walk("",{walkFn:t},{})}catch(t){if(!t.message?.includes("ENOENT")&&!t.message?.includes("no such file"))throw t}}async addTemplateFileInfo(t,e){try{const n=await async function(t,e){let n=null;try{n=await e.open();const r=await n.stat(),i=new Uint8Array(r.size()),s=await n.read(i),a=Ws(new TextDecoder("utf-8").decode(s.buffer));return new zs(t,a,e)}catch(n){throw new zs(t,"",e).errWithFileContext("failed to load template",n)}finally{if(n)try{await n.close()}catch(t){console.warn(`Failed to close template file: ${t}`)}}}(t,e);await this.addTemplate(n.name,n)}catch(e){throw new qs(`Failed to load template info for ${t}: ${e.message}`,"LOAD_TEMPLATE_INFO_FAILED")}}async addTemplate(t,e){try{if(this.lookup.getBaseOf().isBaseTemplatePath(t))return void this.lookup.getBaseOf().addBaseOf(t,e);if(this.lookup.getBaseOf().needsBaseOf(t,e.template))return void this.lookup.getBaseOf().addNeedsBaseOf(t,e);const n=Gs(t),r=await this.parser.parse(e);switch(n){case 1:this.shortcodeNamespace.addShortcodeTemplate(t,r);break;case 2:this.partialNamespace.addPartialTemplate(t,r);break;default:this.templateNamespace.addTemplate(t,r)}}catch(e){throw new qs(`Failed to add template ${t}: ${e.message}`,"ADD_TEMPLATE_FAILED")}}async execute(t,e){const[n,r,i]=await this.get(t);if(i)throw i;if(!r||!n)throw new qs(`Template not found: ${t}`,"TEMPLATE_NOT_FOUND");return await this.executor.execute(n,e)}async executeRaw(t,e,n){const r=await this.parser.parseWithLock(t,e);if(!r)throw new qs(`Raw Template parse error: ${t}`,"TEMPLATE_PARSE_ERROR");return await this.executor.execute(r,n)}async executeShortcode(t,e){const n=this.shortcodeNamespace.getShortcode(t);if(!n)throw new qs(`Shortcode template '${t}' not found`,"SHORTCODE_NOT_FOUND");try{return await this.executor.execute(n,e)}catch(e){throw new qs(`Error executing shortcode template '${t}': ${e.message}`,"SHORTCODE_EXECUTION_FAILED")}}async executeSafely(t,e){try{return{result:await this.execute(t,e),error:null}}catch(t){return t instanceof qs?{result:null,error:t}:{result:null,error:new qs(`Execute safely failed: ${t.message}`,"EXECUTE_SAFELY_FAILED")}}}async executeShortcodeSafely(t,e){try{return{result:await this.executeShortcode(t,e),error:null}}catch(t){return t instanceof qs?{result:null,error:t}:{result:null,error:new qs(`Execute shortcode safely failed: ${t.message}`,"EXECUTE_SHORTCODE_SAFELY_FAILED")}}}async hasTemplate(t){const[,e]=await this.get(t);return e}getTemplateNames(){return this.templateNamespace.getTemplateNames()}getPartialTemplateNames(){return this.partialNamespace.getTemplateNames()}getAllTemplateNames(){return[...this.templateNamespace.getTemplateNames(),...this.partialNamespace.getTemplateNames(),...this.shortcodeNamespace.getTemplateNames()]}getPartialNamespace(){return this.partialNamespace}getShortcodeNamespace(){return this.shortcodeNamespace}getTemplateNamespace(){return this.templateNamespace}clear(){this.templateNamespace.clear(),this.lookup.getBaseOf().clear()}getTemplatesByPattern(t){return this.templateNamespace.getTemplatesByPattern(t).map(t=>t.info.name)}};j();var oa=m(require("crypto")),la=N("template",{component:"registry"}),ca=[],ha=class{engine=null;getFunctionName(){return"partial"}updateEngine(t){this.engine=t}execute=async(t,e)=>{if(!this.engine)return la.error(`Partial function called but engine not set: ${t}`),`\x3c!-- Partial function called but engine not ready: ${t} --\x3e`;try{const n=t.startsWith("partials/")?t:`partials/${t}`;return await this.executePartial(n,e)}catch(e){return la.error(`Partial execution failed for "${t}":`,e),`\x3c!-- Partial execution failed: ${t} - ${e.message} --\x3e`}};async executePartial(t,e){if(!this.engine)return`\x3c!-- Template engine not available: ${t} --\x3e`;try{const[n,r,i]=await this.engine.getPartial(t);if(i)return la.error("Error getting partial template:",i),`\x3c!-- Error getting partial template: ${t} - ${i.message} --\x3e`;if(!r||!n)return la.warn(`Template not found: ${t}`),`\x3c!-- Template not found: ${t} --\x3e`;const[s,a]=await n.Execute(e);return a?(la.error("Template execution error:",a),`\x3c!-- Template execution error: ${t} - ${a.message} --\x3e`):s}catch(e){return la.error("Sync partial execution failed:",e),`\x3c!-- Partial sync execution failed: ${t} - ${e.message} --\x3e`}}},ua=class{registerCoreFunctions(t){this.registerCryptoFunctions(t),this.registerStringFunctions(t),this.registerMathFunctions(t),this.registerTimeFunctions(t),this.registerCollectionFunctions(t),this.registerSafeFunctions(t),this.registerReflectFunctions(t),this.registerFmtFunctions(t),this.registerPathFunctions(t),this.registerTransformFunctions(t)}registerCryptoFunctions(t){t.set("md5",t=>t?oa.createHash("md5").update(t).digest("hex"):""),t.set("encryptAESGCM",(t,e)=>{if(!t||!e)return"";const n=oa.randomBytes(16),r=oa.randomBytes(12),i=oa.pbkdf2Sync(t,n,1e5,32,"sha256"),s=oa.createCipheriv("aes-256-gcm",i,r),a=Buffer.concat([s.update(e,"utf8"),s.final()]),o=s.getAuthTag();return Buffer.concat([n,r,o,a]).toString("base64")})}registerExtendedFunctions(t,e){this.registerURLFunctions(t,e),this.registerSiteFunctions(t,e),this.registerResourcesFunctions(t,e),this.registerHugoFunctions(t,e),this.registerLanguageFunctions(t,e)}registerAllFunctions(t,e){this.registerCoreFunctions(t),this.registerStringFunctions(t),this.registerMathFunctions(t),this.registerTimeFunctions(t),this.registerCollectionFunctions(t),this.registerEngineDependentFunctions(t),e&&(this.registerURLFunctions(t,e),this.registerExtendedFunctions(t,e))}registerEngineDependentFunctions(t){const e=new ha;ca.push(e),t.set(e.getFunctionName(),e.execute)}registerURLFunctions(t,e){t.set("urls",()=>({Parse:t=>{try{return{Host:new URL(t).host}}catch{return{Host:""}}},JoinPath:(...t)=>t.filter(t=>""!==t).map(t=>t.replace(/^\/+|\/+$/g,"")).join("/"),URLize:t=>e.urlize(t),Abs:t=>e.absURL(t),Rel:t=>e.relURL(t),AbsLangURL:t=>e.absURL(t),RelLangURL:t=>e.relURL(t),Sanitize:t=>{try{return new URL(t).toString()}catch{return t.replace(/[<>"'%{}|\\^`]/g,"")}},PathEscape:t=>encodeURIComponent(t).replace(/%2F/g,"/").replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),QueryEscape:t=>encodeURIComponent(t),QueryUnescape:t=>{try{return decodeURIComponent(t)}catch{return t}},IsAbs:t=>{try{return""!==new URL(t).protocol}catch{return!1}},IsRelative:t=>{try{return new URL(t),!1}catch{return!0}}})),t.set("absURL",t=>e.absURL(t)),t.set("relURL",t=>e.relURL(t)),t.set("urlize",t=>e.urlize(t)),t.set("relref",(t,n)=>{if(/^https?:\/\//.test(n))return n;let r="";const i=n.indexOf("#");return-1!==i&&(r=n.slice(i),n=n.slice(0,i)),(n=n.replace(/^\/+|\/+$/g,"")).startsWith("./")||n.startsWith("../")||n.startsWith("/")?e.relURL(n+r):e.relURL("/"+n+r)}),t.set("ref",(t,n)=>{if(/^https?:\/\//.test(n))return n;let r="";const i=n.indexOf("#");return-1!==i&&(r=n.slice(i),n=n.slice(0,i)),(n=n.replace(/^\/+|\/+$/g,"")).startsWith("./")||n.startsWith("../")||n.startsWith("/")?e.absURL(n+r):e.absURL("/"+n+r)}),t.set("absLangURL",t=>e.absURL(t)),t.set("relLangURL",t=>e.relURL(t))}registerSiteFunctions(t,e){t.set("Site",()=>({Title:e.title(),BaseURL:e.baseURL(),Params:e.params(),Menus:e.menus(),IsMultiLingual:e.isMultiLanguage(),LanguageCode:e.defaultLanguage()}))}registerResourcesFunctions(t,e){t.set("resources",()=>({Get:async t=>await e.Get(t),GetRemote:async t=>await e.GetRemote(t),Minify:async t=>await e.Minify(t),Fingerprint:async t=>await e.Fingerprint(t),ExecuteAsTemplate:async(t,n,r)=>await e.ExecuteAsTemplate(t,n,r)}))}registerHugoFunctions(t,e){t.set("hugo",()=>({Version:e.version(),Environment:e.environment(),Generator:e.generator()}))}registerLanguageFunctions(t,e){const{lang:n}=(D(),w(T));t.set("lang",()=>({getAllCodes:()=>n.getAllCodes(),getAllNames:()=>n.getAllNames(),getCodesByDirection:t=>n.getCodesByDirection(t),getNamesByDirection:t=>n.getNamesByDirection(t),getCodeNameMap:()=>n.getCodeNameMap(),getCodeNameMapByDirection:t=>n.getCodeNameMapByDirection(t),getNameByCode:t=>n.getNameByCode(t),getLanguageInfo:t=>n.getLanguageInfo(t),isSupported:t=>n.isSupported(t),getDirection:t=>n.getDirection(t),isLTR:t=>n.isLTR(t),isRTL:t=>n.isRTL(t)})),t.set("langName",t=>n.getNameByCode(t)||t),t.set("langDirection",t=>n.getDirection(t)||"ltr"),t.set("isLTR",t=>n.isLTR(t)),t.set("isRTL",t=>n.isRTL(t)),t.set("i18n",t=>e.translate(t))}registerStringFunctions(t){t.set("humanize",t=>t?(t=(t=(t=(t=t.replace(/([a-z])([A-Z])/g,"$1 $2")).replace(/[_-]+/g," ")).replace(/\.[^/.]+$/,"")).charAt(0).toUpperCase()+t.slice(1).toLowerCase()).trim():""),t.set("upper",t=>t.toUpperCase()),t.set("lower",t=>t.toLowerCase()),t.set("title",t=>t.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase())),t.set("trim",t=>t.trim()),t.set("replace",(...t)=>{if(t.length<3)throw new Error("replace requires at least 3 arguments: string, old, new");const e=String(t[0]),n=String(t[1]),r=String(t[2]);if(t.length>=4){const i=Number(t[3]);if(isNaN(i))throw new Error("replace limit must be a number");let s=e,a=0,o=0;for(;a<i&&o<s.length;){const t=s.indexOf(n,o);if(-1===t)break;s=s.substring(0,t)+r+s.substring(t+n.length),o=t+r.length,a++}return s}return e.split(n).join(r)}),t.set("replaceRE",(...e)=>{if(e.length<3)throw new Error("replaceRE requires at least 3 arguments: pattern, replacement, string");const n=e[0],r=e[1],i=e[2],s=e.length>=4?e[3]:void 0;return t.get("strings")().ReplaceRE(n,r,i,s)}),t.set("split",(t,e)=>null==t?(la.warn("split function: first argument is null or undefined"),[]):"string"!=typeof t?(la.warn("split function: first argument must be a string, got:",typeof t,"value:",t),Array.isArray(t)?t:String(t).split(e)):t.split(e)),t.set("splitRegex",(t,e)=>{if(null==t)return la.warn("splitRegex function: first argument is null or undefined"),[];if("string"!=typeof t){if(la.warn("splitRegex function: first argument must be a string, got:",typeof t,"value:",t),Array.isArray(t))return t;const n=String(t);try{const t=new RegExp(e);return n.split(t)}catch(t){return la.warn("splitRegex function: invalid regex pattern:",e,"error:",t),[n]}}try{const n=new RegExp(e);return t.split(n)}catch(n){return la.warn("splitRegex function: invalid regex pattern:",e,"error:",n),[t]}}),t.set("delimit",(t,e)=>Array.isArray(t)?t.join(e):String(t)),t.set("in",(t,e)=>(Array.isArray(t)||"string"==typeof t&&"string"==typeof e)&&t.includes(e)),t.set("hasPrefix",(t,e)=>t.startsWith(e)),t.set("hasSuffix",(t,e)=>t.endsWith(e)),t.set("strings",()=>({ToLower:t=>String(t).toLowerCase(),ToUpper:t=>String(t).toUpperCase(),Title:t=>String(t).replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),Trim:(t,e)=>String(t).split("").filter(t=>!e.includes(t)).join(""),TrimSpace:t=>String(t).trim(),TrimLeft:(t,e)=>{const n=String(e);let r=0;for(;r<n.length&&t.includes(n[r]);)r++;return n.slice(r)},TrimRight:(t,e)=>{const n=String(e);let r=n.length-1;for(;r>=0&&t.includes(n[r]);)r--;return n.slice(0,r+1)},TrimPrefix:(t,e)=>{const n=String(e);return n.startsWith(t)?n.slice(t.length):n},TrimSuffix:(t,e)=>{const n=String(e);return n.endsWith(t)?n.slice(0,-t.length):n},Contains:(t,e)=>String(t).includes(e),ContainsAny:(t,e)=>{const n=String(t);return e.split("").some(t=>n.includes(t))},HasPrefix:(t,e)=>String(t).startsWith(e),HasSuffix:(t,e)=>String(t).endsWith(e),Replace:(t,e,n,r)=>{const i=String(t);if(void 0===r)return i.split(e).join(n);let s=i,a=0,o=0;for(;a<r&&o<s.length;){const t=s.indexOf(e,o);if(-1===t)break;s=s.substring(0,t)+n+s.substring(t+e.length),o=t+n.length,a++}return s},ReplaceRE:(t,e,n,r)=>{const i=String(t),s=String(e),a=String(n);let o,l=-1;if(void 0!==r){const t=parseInt(String(r),10);if(isNaN(t))throw new Error("limit argument must be integer");l=t}try{o=new RegExp(i,"g")}catch(t){throw new Error(`invalid regular expression: ${i}`)}let c=0;return a.replace(o,t=>l>=0&&c>=l?t:(c++,s))},Split:(t,e)=>String(t).split(e),SliceString:(t,e,n)=>{const r=String(t);return void 0!==n?r.slice(e,n):r.slice(e)},Substr:(t,e,n)=>{const r=String(t);return e<0&&(e=r.length+e),e<0&&(e=0),e>=r.length?"":void 0===n?r.slice(e):n<=0?"":r.slice(e,e+n)},Count:(t,e)=>{const n=String(e);return t?(n.match(new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"))||[]).length:n.length+1},CountWords:t=>{const e=String(t).trim();return e?e.split(/\s+/).length:0},CountRunes:t=>String(t).replace(/\s/g,"").length,RuneCount:t=>String(t).length,Repeat:(t,e)=>{if(t<0)throw new Error("strings: negative Repeat count");return String(e).repeat(t)},FirstUpper:t=>{const e=String(t);return e.charAt(0).toUpperCase()+e.slice(1)}})),t.set("substr",(t,...e)=>{const n=String(t),r=Array.from(n),i=r.length;let s,a;switch(e.length){case 0:throw new Error("too few arguments");case 1:const t=Number(e[0]);if(isNaN(t)||!Number.isInteger(t))throw new Error("start argument must be an integer");s=t,a=i;break;case 2:const n=Number(e[0]),r=Number(e[1]);if(isNaN(n)||!Number.isInteger(n))throw new Error("start argument must be an integer");if(isNaN(r)||!Number.isInteger(r))throw new Error("length argument must be an integer");s=n,a=r;break;default:throw new Error("too many arguments")}if(0===i)return"";if(s<0&&(s+=i),s<0&&(s=0),s>i-1)return"";let o=i;return 0===a?"":(a<0?o+=a:a>0&&(o=s+a),s>=o||o<0?"":(o>i&&(o=i),r.slice(s,o).join("")))}),t.set("truncate",(t,...e)=>{const n=Number(t);if(isNaN(n)||!Number.isInteger(n))throw new Error("truncate length must be an integer");let r,i=" …";switch(e.length){case 0:throw new Error("truncate requires a length and a string");case 1:r=e[0],i=" …";break;case 2:i=String(e[0]),r=e[1];break;default:throw new Error("too many arguments passed to truncate")}const s=String(r),a=/<[^>]+>/.test(s);return Array.from(s).length<=n?a?s:this.escapeHTML(s):a?this.truncateHTML(s,n,i):this.truncateText(s,n,i)})}escapeHTML(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}truncateText(t,e,n){const r=Array.from(t);if(r.length<=e)return this.escapeHTML(t);let i=0,s=0;for(let t=0;t<r.length&&s<e;t++){const e=r[t];s++,/\s/.test(e)&&(i=t),/[\u4e00-\u9fff\u3400-\u4dbf\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af]/.test(e)&&(i=t)}let a=s>=e?i>0?i:e:r.length;const o=r.slice(0,a).join("");return this.escapeHTML(o)+n}truncateHTML(t,e,n){const r=/^<(\/)?([^ ]+?)(?:(\s*\/)| .*?)?>/,i=new Set(["br","col","link","base","img","param","area","hr","input"]),s=[];let a=0,o=0,l=0,c=0,h=0;const u=Array.from(t);for(;h<u.length;){const t=u[h];if("<"===t){const t=u.slice(h).join("").match(r);if(t){const e=t[0],n="/"===t[1],r=t[2].toLowerCase(),l="/"===t[3];h+=e.length,a=o,i.has(r)||l||s.push({name:r,pos:h-e.length,openTag:!n});continue}}if(l++,/\s/.test(t)?a=o:/[\u4e00-\u9fff\u3400-\u4dbf\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af]/.test(t)?a=h:o=h+1,l>e){c=a>0?a:h;break}h++}if(l<=e)return t;let f=u.slice(0,c).join("")+n,d=null;for(let t=s.length-1;t>=0;t--){const e=s[t];e.pos>=c||null!==d?null!==d&&d.name===e.name&&(d=null):e.openTag?f+=`</${e.name}>`:d=e}return f}registerMathFunctions(t){t.set("add",(t,e)=>t+e),t.set("sub",(t,e)=>t-e),t.set("mul",(t,e)=>t*e),t.set("div",(t,e)=>0!==e?t/e:0),t.set("mod",(t,e)=>0!==e?t%e:0),t.set("math",()=>({Abs:t=>{const e=Number(t);if(isNaN(e))throw new Error("the math.Abs function requires a numeric argument");return Math.abs(e)},Add:(...t)=>{if(t.length<2)throw new Error("must provide at least two numbers");return t.reduce((t,e)=>{const n=Number(e);if(isNaN(n))throw new Error("Add operator can't be used with non-numeric values");return t+n},0)},Ceil:t=>{const e=Number(t);if(isNaN(e))throw new Error("Ceil operator can't be used with non-numeric value");return Math.ceil(e)},Div:(...t)=>{if(t.length<2)throw new Error("must provide at least two numbers");return t.reduce((t,e,n)=>{const r=Number(e);if(isNaN(r))throw new Error("Div operator can't be used with non-numeric values");if(0===n)return r;if(0===r)throw new Error("division by zero");return t/r})},Floor:t=>{const e=Number(t);if(isNaN(e))throw new Error("Floor operator can't be used with non-numeric value");return Math.floor(e)},Log:t=>{const e=Number(t);if(isNaN(e))throw new Error("Log operator can't be used with non-numeric value");return Math.log(e)},Max:(...t)=>{if(0===t.length)throw new Error("must provide at least one number");const e=t.flat().map(t=>{const e=Number(t);if(isNaN(e))throw new Error("Max operator can't be used with non-numeric values");return e});return Math.max(...e)},Min:(...t)=>{if(0===t.length)throw new Error("must provide at least one number");const e=t.flat().map(t=>{const e=Number(t);if(isNaN(e))throw new Error("Min operator can't be used with non-numeric values");return e});return Math.min(...e)},Mod:(t,e)=>{const n=Number(t),r=Number(e);if(isNaN(n)||isNaN(r))throw new Error("modulo operator can't be used with non-numeric value");if(0===r)throw new Error("the number can't be divided by zero at modulo operation");return n%r},ModBool:(t,e)=>{const n=Number(t),r=Number(e);if(isNaN(n)||isNaN(r))throw new Error("modulo operator can't be used with non-numeric value");if(0===r)throw new Error("the number can't be divided by zero at modulo operation");return n%r===0},Mul:(...t)=>{if(t.length<2)throw new Error("must provide at least two numbers");return t.reduce((t,e)=>{const n=Number(e);if(isNaN(n))throw new Error("Mul operator can't be used with non-numeric values");return t*n},1)},Pow:(t,e)=>{const n=Number(t),r=Number(e);if(isNaN(n)||isNaN(r))throw new Error("Pow operator can't be used with non-numeric value");return Math.pow(n,r)},Rand:()=>Math.random(),Round:t=>{const e=Number(t);if(isNaN(e))throw new Error("Round operator can't be used with non-numeric value");return Math.round(e)},Sqrt:t=>{const e=Number(t);if(isNaN(e))throw new Error("Sqrt operator can't be used with non-numeric value");return Math.sqrt(e)},Sub:(...t)=>{if(t.length<2)throw new Error("must provide at least two numbers");return t.reduce((t,e,n)=>{const r=Number(e);if(isNaN(r))throw new Error("Sub operator can't be used with non-numeric values");return 0===n?r:t-r})},Sum:(...t)=>{if(0===t.length)throw new Error("must provide at least one number");return t.flat().map(t=>{const e=Number(t);if(isNaN(e))throw new Error("Sum operator can't be used with non-numeric values");return e}).reduce((t,e)=>t+e,0)},Product:(...t)=>{if(0===t.length)throw new Error("must provide at least one number");return t.flat().map(t=>{const e=Number(t);if(isNaN(e))throw new Error("Product operator can't be used with non-numeric values");return e}).reduce((t,e)=>t*e,1)}}))}registerTimeFunctions(t){t.set("time",()=>({AsTime:t=>{if(!t)return null;if(t instanceof Date)return t;if("string"==typeof t){const e=new Date(t);return isNaN(e.getTime())?null:e}if("number"==typeof t){const e=new Date(t<1e10?1e3*t:t);return isNaN(e.getTime())?null:e}return null},Format:(t,e)=>{const n=e instanceof Date?e:new Date(e);if(isNaN(n.getTime()))return"";const r=n.getFullYear(),i=n.getMonth()+1,s=n.getDate(),a=n.getHours(),o=n.getMinutes(),l=n.getSeconds(),c=n.toLocaleString("en-US",{weekday:"short"}),h=n.toLocaleString("en-US",{month:"short"}),u=[{pattern:"2006",placeholder:"{{YEAR_FULL}}",value:r.toString()},{pattern:"January",placeholder:"{{MONTH_FULL}}",value:n.toLocaleString("en-US",{month:"long"})},{pattern:"Monday",placeholder:"{{WEEKDAY_FULL}}",value:n.toLocaleString("en-US",{weekday:"long"})},{pattern:"MST",placeholder:"{{TIMEZONE}}",value:n.toLocaleString("en-US",{timeZoneName:"short"})},{pattern:"Jan",placeholder:"{{MONTH_SHORT}}",value:h},{pattern:"Mon",placeholder:"{{WEEKDAY_SHORT}}",value:c},{pattern:"06",placeholder:"{{YEAR_SHORT}}",value:r.toString().slice(-2)},{pattern:"15",placeholder:"{{HOUR_24}}",value:a.toString().padStart(2,"0")},{pattern:"01",placeholder:"{{MONTH_ZERO}}",value:i.toString().padStart(2,"0")},{pattern:"02",placeholder:"{{DAY_ZERO}}",value:s.toString().padStart(2,"0")},{pattern:"04",placeholder:"{{MINUTE_ZERO}}",value:o.toString().padStart(2,"0")},{pattern:"05",placeholder:"{{SECOND_ZERO}}",value:l.toString().padStart(2,"0")},{pattern:"PM",placeholder:"{{AMPM_UPPER}}",value:a>=12?"PM":"AM"},{pattern:"pm",placeholder:"{{AMPM_LOWER}}",value:a>=12?"pm":"am"},{pattern:"3",placeholder:"{{HOUR_12}}",value:((a+11)%12+1).toString()},{pattern:"1",placeholder:"{{MONTH_NUM}}",value:i.toString()},{pattern:"2",placeholder:"{{DAY_NUM}}",value:s.toString()},{pattern:"4",placeholder:"{{MINUTE_NUM}}",value:o.toString()},{pattern:"5",placeholder:"{{SECOND_NUM}}",value:l.toString()}];let f=t;for(const{pattern:t,placeholder:e}of u){const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");f=f.replace(new RegExp(n,"g"),e)}for(const{placeholder:t,value:e}of u)f=f.replace(new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),e);return f},Now:()=>new Date,Parse:(t,e)=>{try{const t=new Date(e);return isNaN(t.getTime())?null:t}catch{return null}},Unix:t=>{const e=t instanceof Date?t:new Date(t);return Math.floor(e.getTime()/1e3)},UnixNano:t=>1e6*(t instanceof Date?t:new Date(t)).getTime()})),t.set("now",()=>{const t=new Date;return{Format:e=>{const n=t.getFullYear(),r=t.getMonth()+1,i=t.getDate(),s=t.getHours(),a=t.getMinutes(),o=t.getSeconds(),l=[{pattern:"2006",value:n.toString()},{pattern:"06",value:n.toString().slice(-2)},{pattern:"01",value:r.toString().padStart(2,"0")},{pattern:"1",value:r.toString()},{pattern:"02",value:i.toString().padStart(2,"0")},{pattern:"2",value:i.toString()},{pattern:"15",value:s.toString().padStart(2,"0")},{pattern:"3",value:(s%12||12).toString()},{pattern:"04",value:a.toString().padStart(2,"0")},{pattern:"4",value:a.toString()},{pattern:"05",value:o.toString().padStart(2,"0")},{pattern:"5",value:o.toString()}];let c=e;for(const{pattern:t,value:e}of l){const n=new RegExp(`\\b${t}\\b`,"g");c=c.replace(n,e)}return"2006"===e?n.toString():"06"===e?n.toString().slice(-2):"01"===e?r.toString().padStart(2,"0"):"02"===e?i.toString().padStart(2,"0"):"15"===e?s.toString().padStart(2,"0"):"04"===e?a.toString().padStart(2,"0"):"05"===e?o.toString().padStart(2,"0"):c},getTime:()=>t.getTime(),toString:()=>t.toString(),toISOString:()=>t.toISOString()}}),t.set("dateFormat",(t,e)=>e.toLocaleDateString())}registerCollectionFunctions(t){t.set("len",t=>Array.isArray(t)||"string"==typeof t?t.length:t&&"object"==typeof t?Object.keys(t).length:0),t.set("first",(t,e)=>Array.isArray(t)?t.slice(0,1):Array.isArray(e)?e.slice(0,t):[]),t.set("last",(t,e)=>Array.isArray(t)?t.slice(-1):Array.isArray(e)?e.slice(-t):[]),t.set("merge",(...t)=>{const e={};for(const n of t)n&&"object"==typeof n&&!Array.isArray(n)&&Object.assign(e,n);return e}),t.set("index",(t,...e)=>{try{return this.doIndex(t,e)}catch(n){return la.error(`Index of type ${typeof t} with args [${e.join(", ")}] failed:`,n),null}}),t.set("reverse",t=>Array.isArray(t)?[...t].reverse():t),t.set("append",(...t)=>{if(t.length<2)return t[0]||[];const e=Array.isArray(t[0])?[...t[0]]:[t[0]];for(let n=1;n<t.length;n++)Array.isArray(t[n])?e.push(...t[n]):e.push(t[n]);return e}),t.set("prepend",(t,...e)=>Array.isArray(t)?[...e,...t]:[...e,t]),t.set("seq",(...t)=>{if(t.length<1||t.length>3)throw new Error("invalid number of arguments to Seq");const e=t.map(t=>{const e=Number(t);if(isNaN(e))throw new Error("invalid arguments to Seq");return Math.floor(e)});let n,r=1,i=e[0];if(1===e.length){if(n=i,0===n)return[];n>0?i=1:(i=-1,r=-1)}else if(2===e.length)n=e[1],n<i&&(r=-1);else{if(r=e[1],n=e[2],0===r)throw new Error("'increment' must not be 0");if(i<n&&r<0)throw new Error("'increment' must be > 0");if(i>n&&r>0)throw new Error("'increment' must be < 0")}if(n<-1e5)throw new Error("size of result exceeds limit");const s=Math.floor((n-i)/r)+1;if(s<=0||s>2e3)throw new Error("size of result exceeds limit");const a=new Array(s);let o=i;for(let t=0;t<s&&(a[t]=o,o+=r,!(r<0&&o<n||r>0&&o>n));t++);return a}),t.set("sort",(t,...e)=>{if(null==t)throw new Error("sequence must be provided");let n;if(Array.isArray(t))n=[...t];else{if("object"!=typeof t||null===t)throw new Error("can't sort "+typeof t);n=Object.values(t)}if(0===n.length)return n;let r="",i=!0;for(let t=0;t<e.length;t++){const n=e[t];0===t?"string"==typeof n&&(r=n):1===t&&"string"==typeof n&&"desc"===n.toLowerCase()&&(i=!1)}const s=(t,e)=>{if(!e||"value"===e)return t;const n=e.split(".");let r=t;for(const t of n){if(null==r)return;if("object"!=typeof r)return;r=r[t]}return r};return n.sort((t,e)=>{let n=r?s(t,r):t,a=r?s(e,r):e;if(null==n)return null==a?0:i?-1:1;if(null==a)return i?1:-1;if("string"==typeof n&&"string"==typeof a){const t=n.localeCompare(a);return i?t:-t}if("number"==typeof n&&"number"==typeof a){const t=n-a;return i?t:-t}const o=String(n),l=String(a),c=o.localeCompare(l);return i?c:-c})}),t.set("where",(()=>(t,e,...n)=>{if(!t)return[];let r,i="==";if(1===n.length)r=n[0];else{if(2!==n.length)throw new Error("where function requires 2-4 arguments");i=n[0],r=n[1]}const s=[];if(Array.isArray(t))for(let n=0;n<t.length;n++){const a=t[n],o=this.getNestedValue(a,e);this.checkCondition(o,r,i)&&s.push(a)}else if("object"==typeof t)for(const[n,a]of Object.entries(t))if(Array.isArray(a)){const t=a.filter(t=>{const n=this.getNestedValue(t,e);return this.checkCondition(n,r,i)});t.length>0&&s.push({[n]:t})}return s})()),t.set("intersect",(t,e)=>Array.isArray(t)&&Array.isArray(e)?t.filter(t=>e.includes(t)):[]),t.set("querify",(...t)=>{let e=[];if(e=1===t.length&&Array.isArray(t[0])?t[0]:t,e.length%2!=0)throw new Error("querify requires an even number of arguments (key-value pairs)");const n=[];for(let t=0;t<e.length;t+=2){const r=String(e[t]),i=String(e[t+1]);n.push([r,i])}return n.sort((t,e)=>t[0].localeCompare(e[0])),n.map(([t,e])=>`${encodeURIComponent(t).replace(/%20/g,"+")}=${encodeURIComponent(e).replace(/%20/g,"+")}`).join("&")}),t.set("isset",(t,e)=>{if(null==t)return!1;if(Array.isArray(t)){const n=Number(e);return isNaN(n)||!Number.isInteger(n)?(console.warn(`isset unable to use key of type ${typeof e} as index`),!1):t.length>n&&n>=0}if("object"==typeof t)return e in t;if("string"==typeof t){const n=Number(e);return isNaN(n)||!Number.isInteger(n)?(console.warn(`isset unable to use key of type ${typeof e} as index`),!1):t.length>n&&n>=0}return console.warn(`calling isset with unsupported type "${typeof t}" (${t.constructor?.name||typeof t}) will always return false.`),!1})}doIndex(t,e){if(null==t)return null;if(0===e.length)return t;let n=t;for(const t of e){if(null==n)return null;if(Array.isArray(n))n=this.indexArray(n,t);else if("string"==typeof n)n=this.indexString(n,t);else{if("object"!=typeof n)throw new Error("can't index item of type "+typeof n);n=this.indexObject(n,t)}}return n}indexArray(t,e){const n=this.toInteger(e);if(null===n)throw new Error("cannot index slice/array with type "+typeof e);return n<0||n>=t.length?null:t[n]}indexString(t,e){const n=this.toInteger(e);if(null===n)throw new Error("cannot index string with type "+typeof e);return n<0||n>=t.length?null:t.charAt(n)}indexObject(t,e){const n=String(e);if(t.hasOwnProperty(n))return t[n];const r=Object.keys(t).find(t=>t.toLowerCase()===n.toLowerCase());if(r)return t[r];if(t instanceof Map){if(t.has(n))return t.get(n);for(const e of t.keys())if(String(e).toLowerCase()===n.toLowerCase())return t.get(e)}return null}toInteger(t){if("number"==typeof t)return Number.isInteger(t)?t:Math.floor(t);if("string"==typeof t){const e=parseInt(t,10);if(!isNaN(e))return e}return null}checkCondition(t,e,n){const r=n.toLowerCase().trim();if(null==t&&null==e)return["==","=","eq",""].includes(r);if(null==t||null==e)return["!=","<>","ne"].includes(r);if("in"===r)return(Array.isArray(e)||"string"==typeof e&&"string"==typeof t)&&e.includes(t);if("intersect"===r)return!(!Array.isArray(t)||!Array.isArray(e))&&t.some(t=>e.includes(t));const[i,s]=this.normalizeForComparison(t,e);switch(r){case"":case"=":case"==":case"eq":return i===s;case"!=":case"<>":case"ne":return i!==s;case"<":case"lt":return i<s;case"<=":case"le":return i<=s;case">":case"gt":return i>s;case">=":case"ge":return i>=s;default:return!1}}normalizeForComparison(t,e){if("number"==typeof t&&"number"==typeof e)return[t,e];if("number"==typeof t&&"string"==typeof e){const n=parseFloat(e);if(!isNaN(n))return[t,n]}if("string"==typeof t&&"number"==typeof e){const n=parseFloat(t);if(!isNaN(n))return[n,e]}return"string"==typeof t&&"string"==typeof e||"boolean"==typeof t&&"boolean"==typeof e?[t,e]:[String(t),String(e)]}registerSafeFunctions(t){t.set("return",(...t)=>0===t.length?"":1===t.length?t[0]:t),t.set("cond",(...t)=>{if(t.length<2)throw new Error("cond requires at least 2 arguments");const e=t[0],n=t[1],r=t.length>2?t[2]:"";let i=!1;return!0===e||1===e?i=!0:"string"==typeof e?i=e.length>0&&"false"!==e&&"0"!==e:"number"==typeof e?i=0!==e:Array.isArray(e)?i=e.length>0:e&&"object"==typeof e&&(i=Object.keys(e).length>0),i?n:r}),t.set("safeHTML",t=>t),t.set("safeCSS",t=>t),t.set("safeJS",t=>t),t.set("safeURL",t=>t),t.set("dict",(...t)=>{if(t.length%2!=0)throw new Error("dict requires an even number of arguments");const e={};for(let n=0;n<t.length;n+=2)e[String(t[n])]=t[n+1];return e}),t.set("slice",(...t)=>t),t.set("default",(t,e)=>null!=e&&""!==e&&0!==e?e:t),t.set("jsonify",(...t)=>{if(0===t.length)return"";let e,n={};if(1===t.length)e=t[0];else{if(2!==t.length)throw new Error("too many arguments to jsonify");{const r=t[0];e=t[1],r&&"object"==typeof r&&(n.prefix=r.prefix||"",n.indent=r.indent||"",n.noHTMLEscape=r.noHTMLEscape||!1)}}try{let t;return n.indent?(t=JSON.stringify(e,null,n.indent),n.prefix&&(t=t.split("\n").map(t=>n.prefix+t).join("\n"))):t=JSON.stringify(e),n.noHTMLEscape||(t=t.replace(/&/g,"\\u0026").replace(/</g,"\\u003c").replace(/>/g,"\\u003e")),t}catch(t){throw new Error(`failed to jsonify object: ${t.message}`)}})}registerFmtFunctions(t){t.set("printf",(t,...e)=>{let n=t,r=0;return n=n.replace(/%[vsdft%]/g,t=>{if("%%"===t)return"%";if(r>=e.length)return t;const n=e[r++];switch(t){case"%v":case"%s":default:return String(n);case"%d":return String(Math.floor(Number(n)||0));case"%f":return String(Number(n)||0);case"%t":return String(Boolean(n))}}),n}),t.set("print",(...t)=>t.map(t=>String(t)).join(" ")),t.set("println",(...t)=>t.map(t=>String(t)).join(" ")+"\n"),t.set("errorf",(t,...e)=>{let n=t;for(let t=0;t<e.length;t++)n=n.replace(/%[sd%]/,String(e[t]));return la.error("Template Error:",n),""}),t.set("warnf",(t,...e)=>{let n=t;for(let t=0;t<e.length;t++)n=n.replace(/%[sd%]/,String(e[t]));return la.warn("Template Warning:",n),""}),t.set("fmt",()=>({Print:(...t)=>t.map(t=>String(t)).join(" "),Printf:(t,...e)=>{let n=t;for(let t=0;t<e.length;t++)n=n.replace(/%[sd%]/,String(e[t]));return n},Println:(...t)=>t.map(t=>String(t)).join(" ")+"\n",Errorf:(t,...e)=>{let n=t;for(let t=0;t<e.length;t++)n=n.replace(/%[sd%]/,String(e[t]));return la.error("Template Error:",n),""},Erroridf:(t,e,...n)=>{let r=e;for(let t=0;t<n.length;t++)r=r.replace(/%[sd%]/,String(n[t]));return la.error("Template Error:",r),""},Warnf:(t,...e)=>{let n=t;for(let t=0;t<e.length;t++)n=n.replace(/%[sd%]/,String(e[t]));return la.error("Template Warning:",n),""},Warnidf:(t,e,...n)=>{let r=e;for(let t=0;t<n.length;t++)r=r.replace(/%[sd%]/,String(n[t]));return la.error("Template Warning:",r),""}}))}registerReflectFunctions(t){t.set("reflect",()=>({IsMap:t=>{if(null==t)return!1;if("object"!=typeof t||Array.isArray(t))return!1;if(t instanceof Map)return!0;if(t.constructor===Object)return!0;const e=Object.getPrototypeOf(t);return e===Object.prototype||null===e},IsSlice:t=>Array.isArray(t)}))}registerPathFunctions(t){t.set("path",()=>({Base:t=>{if(!t)return".";if(!(t=(t=t.replace(/\\/g,"/")).replace(/\/+$/,"")))return"/";const e=t.split("/");return e[e.length-1]||"/"},Clean:t=>{if(!t)return".";const e=(t=t.replace(/\\/g,"/")).startsWith("/"),n=t.split("/").filter(t=>t&&"."!==t),r=[];for(const t of n)".."===t?r.length>0&&".."!==r[r.length-1]?r.pop():e||r.push(".."):r.push(t);return t=r.join("/"),e&&(t="/"+t),t||(e?"/":".")},Dir:t=>{if(!t)return".";if(!(t=t.replace(/\/+$/,"")))return"/";const e=t.split("/");return e.pop(),e.join("/")||"."},Ext:t=>{const e=t.split("/").pop()||"",n=e.lastIndexOf(".");return-1===n||0===n?"":e.substring(n)},IsAbs:t=>t.startsWith("/"),Join:(...t)=>{if(0===t.length)return".";let e=t.filter(t=>t).map(t=>t.replace(/^\/+|\/+$/g,"")).join("/");return t[0]&&t[0].startsWith("/")&&(e="/"+e),e||"."},Split:t=>{if(!t)return[".",""];const e=t.lastIndexOf("/");return-1===e?["",t]:[t.substring(0,e),t.substring(e+1)]}}))}registerTransformFunctions(t){t.set("transform",()=>({Unmarshal:(...t)=>{if(t.length<1||t.length>2)throw new Error("unmarshal takes 1 or 2 arguments");let e,n,r={};if(1===t.length)e=t[0];else{const n=t[0];if(!n||"object"!=typeof n)throw new Error("first argument must be a map");r=n,e=t[1]}if(e&&"object"==typeof e&&"function"==typeof e.Content)try{const t=e.Content();return this.unmarshalContent(t,r)}catch(t){throw new Error(`failed to get content from resource: ${t.message}`)}if("string"==typeof e)n=e;else{if(!e||"function"!=typeof e.toString)throw new Error(`type ${typeof e} not supported`);n=e.toString()}return n&&""!==n.trim()?this.unmarshalContent(n,r):null},Plainify:t=>{const e=String(t);return this.stripHTML(e)}})),t.set("unmarshal",(...e)=>t.get("transform")().Unmarshal(...e)),t.set("plainify",t=>{const e=String(t);return this.stripHTML(e)})}stripHTML(t){if(!t.includes("<")&&!t.includes(">"))return t;let e=t.replace(/\n/g," ").replace(/<\/p>/gi,"\n").replace(/<br\s*\/?>/gi,"\n").replace(/<\/div>/gi,"\n").replace(/<\/h[1-6]>/gi,"\n").replace(/<\/li>/gi,"\n").replace(/<\/tr>/gi,"\n").replace(/<\/blockquote>/gi,"\n");e=e.replace(/<[^>]*>/g,"");const n=e.split("\n");return e=n.map(t=>t.trim().replace(/\s+/g," ")).filter(t=>t.length>0).join("\n").trim(),e=e.replace(/\n\s*\n/g,"\n"),e}unmarshalContent(t,e={}){const n=t.trim();if(!n)return null;let r=e.format;r||(r=this.detectFormat(n));try{switch(r.toLowerCase()){case"json":return JSON.parse(n);case"yaml":case"yml":return this.parseYAML(n);case"toml":return this.parseTOML(n);case"csv":return this.parseCSV(n);default:throw new Error(`format "${r}" not supported`)}}catch(t){throw new Error(`failed to unmarshal ${r}: ${t.message}`)}}detectFormat(t){const e=t.trim();if(e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]"))try{return JSON.parse(e),"json"}catch{}return e.startsWith("---")||/^[a-zA-Z_][a-zA-Z0-9_]*\s*:\s*.+/m.test(e)?"yaml":/^\[.*\]$/m.test(e)||/^[a-zA-Z_][a-zA-Z0-9_]*\s*=\s*.+/m.test(e)?"toml":/^[^,\n]*,[^,\n]*/.test(e)?"csv":"json"}parseYAML(t){const e=t.split("\n"),n={};for(const t of e){const e=t.trim();if(!e||e.startsWith("#")||"---"===e)continue;const r=e.indexOf(":");if(r>0){const t=e.substring(0,r).trim();let i=e.substring(r+1).trim();(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1)),"true"===i?n[t]=!0:"false"===i?n[t]=!1:/^\d+$/.test(i)?n[t]=parseInt(i,10):/^\d*\.\d+$/.test(i)?n[t]=parseFloat(i):n[t]=i}}return n}parseTOML(t){const e=t.split("\n"),n={};let r="";for(const t of e){const e=t.trim();if(!e||e.startsWith("#"))continue;if(e.startsWith("[")&&e.endsWith("]")){r=e.slice(1,-1),n[r]||(n[r]={});continue}const i=e.indexOf("=");if(i>0){const t=e.substring(0,i).trim();let s,a=e.substring(i+1).trim();(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))&&(a=a.slice(1,-1)),s="true"===a||"false"!==a&&(/^\d+$/.test(a)?parseInt(a,10):/^\d*\.\d+$/.test(a)?parseFloat(a):a),r?n[r][t]=s:n[t]=s}}return n}parseCSV(t){const e=t.trim().split("\n");if(0===e.length)return[];const n=this.parseCSVLine(e[0]),r=[];for(let t=1;t<e.length;t++){const i=this.parseCSVLine(e[t]),s={};for(let t=0;t<n.length;t++){const e=n[t],r=t<i.length?i[t]:"";/^\d+$/.test(r)?s[e]=parseInt(r,10):/^\d*\.\d+$/.test(r)?s[e]=parseFloat(r):s[e]="true"===r||"false"!==r&&r}r.push(s)}return r}parseCSVLine(t){const e=[];let n="",r=!1;for(let i=0;i<t.length;i++){const s=t[i];'"'===s?r&&'"'===t[i+1]?(n+='"',i++):r=!r:","!==s||r?n+=s:(e.push(n.trim()),n="")}return e.push(n.trim()),e}getNestedValue(t,e){if(!t||!e)return;const n=e.replace(/^\\.+/,"").split(".");let r=t;for(let t=0;t<n.length;t++){const e=n[t];if(null==r)return;if("object"==typeof r){if(r.hasOwnProperty(e)){r=r[e];continue}const t=Object.keys(r).find(t=>t.toLowerCase()===e.toLowerCase());if(t){r=r[t];continue}const n=e.toLowerCase();if("function"==typeof r[n])try{r=r[n]();continue}catch(t){return}return}return}return r}};function fa(){return new ua}var da=class{async create(t){return this.createWithConfig(t,{})}async createWithConfig(t,e){try{const n=(new pa).withFs(t).withNamespaces(new Ys,new Ks,new Xs);e.services?n.withServices(e.services):e.funcMap?n.withFuncMap(e.funcMap):n.withFuncMap(function(){const t=new Map;return fa().registerCoreFunctions(t),t}());const r=await n.buildLookup().buildParser().buildExecutor().build();return await r.markReady(),r}catch(t){const e=t instanceof Error?t.message:String(t);throw new qs(`Failed to create template engine: ${e}`,"FACTORY_CREATE_FAILED")}}async createWithServices(t,e){return this.createWithConfig(t,{services:e})}},pa=class{funcMap=new Map;services;fs;templateNamespace;partialNamespace;shortcodeNamespace;lookup;parser;executor;withFs(t){return this.fs=t,this}withNamespaces(t,e,n){return this.templateNamespace=t,this.partialNamespace=e,this.shortcodeNamespace=n,this}withFuncMap(t){return this.funcMap=new Map([...this.funcMap,...t]),this}withServices(t){return this.services=t,this.funcMap=function(t){const e=new Map;return fa().registerAllFunctions(e,t),e}(t),this}buildLookup(){const t=new Hs;return this.lookup=function(t,e){return new ia(t,e)}(t,this.funcMap),this}buildParser(){return this.parser=function(t=new Map){return new ra(t)}(this.funcMap),this}buildExecutor(){return this.executor=new Zs,this}async build(){if(!this.fs)throw new qs("File system is required","BUILDER_FS_REQUIRED");if(!this.templateNamespace)throw new qs("Template namespace is required","BUILDER_TEMPLATE_NAMESPACE_REQUIRED");if(!this.partialNamespace)throw new qs("Partial namespace is required","BUILDER_PARTIAL_NAMESPACE_REQUIRED");if(!this.shortcodeNamespace)throw new qs("Shortcode namespace is required","BUILDER_SHORTCODE_NAMESPACE_REQUIRED");if(!this.lookup)throw new qs("Lookup is required","BUILDER_LOOKUP_REQUIRED");if(!this.parser)throw new qs("Parser is required","BUILDER_PARSER_REQUIRED");if(!this.executor)throw new qs("Executor is required","BUILDER_EXECUTOR_REQUIRED");const t=(e=this.executor,n=this.lookup,r=this.parser,i=this.templateNamespace,s=this.partialNamespace,a=this.shortcodeNamespace,o=this.fs,new aa(e,n,r,i,s,a,o));var e,n,r,i,s,a,o;!function(t){for(const e of ca)try{e.updateEngine(t)}catch(t){la.error(`❌ Failed to update function ${e.getFunctionName()}:`,t)}}(t);try{await t.loadTemplates()}catch(t){const e=t instanceof Error?t.message:String(t);throw new qs(`Failed to load templates: ${e}`,"BUILDER_LOAD_TEMPLATES_FAILED")}return t}},ga=N("content",{component:"pagebuilder"}),ma=class{urlSvc;langSvc;taxonomySvc;templateSvc;pageMapper;taxonomy;term;section;standalone;converter;contentHub;source;sourceByte;kind;singular;term_;langIdx;fm;fmParser;c;renderableDocument=null;constructor(t,e,n,r,i,s,a,o,l,c,h){this.urlSvc=t,this.langSvc=e,this.taxonomySvc=n,this.templateSvc=r,this.pageMapper=null,this.taxonomy=s,this.term=a,this.section=o,this.standalone=l,this.converter=c,this.contentHub=h,this.source=null,this.sourceByte=new Uint8Array,this.kind="",this.singular="",this.term_="",this.langIdx=-1,this.fm=null,this.fmParser=null,this.c=null}withSource(t){const e=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return e.reset(),e.source=t,e}withLangIdx(t){return this.langIdx=t,this}reset(){this.c=null,this.kind="",this.langIdx=-1}async build(){if(!this.source)throw new Error("source for page builder is nil");const t=await this.source.contentSource();this.sourceByte=t,await this.parse(t);const e=await this.buildInternal();return await this.render(e),e}async kindBuild(){if(!this.source)throw new Error("source for page builder is nil");return await this.parseKind(),-1===this.langIdx?await this.parseLanguageByDefault():await this.parseLanguageByIdx(this.langIdx),this.fm={path:"",lang:"",kind:"",title:"",description:"",weight:999,terms:{},params:{}},this.c=ks(new Uint8Array),await this.buildInternal()}async buildInternal(){switch(this.kind){case hi("home"):return await this.buildHome();case hi("section"):return await this.buildSection();case hi("page"):return await this.buildPage();case hi("taxonomy"):return await this.buildTaxonomy();case hi("term"):return await this.buildTerm();case hi("404"):return await this.build404();case hi("sitemap"):return await this.buildSitemap();default:throw new Error(`unknown kind "${this.kind}"`)}}async buildPage(){const t=await this.newPage(this.source,this.c);return await this.applyFrontMatter(t),t.pageMap=this.pageMapper,await this.buildOutput(t),await this.adaptPagination(t),t}async buildPageWithKind(t){const e=await this.newPage(this.source,this.c);if(await this.applyFrontMatter(e),e.pageMap=this.pageMapper,e.kind_=t,t===hi("sitemap")||t===hi("404")){const t=e.meta;t&&(t.list="never")}return await this.buildOutput(e),e}async applyFrontMatter(t){if(this.fm){t.title_=this.fm.title,t.description_=this.fm.description;const e=t.meta;e&&(e.weight=this.fm.weight,e.parameters=this.fm.params||{},this.fm.date&&(e.date=this.fm.date),void 0!==this.fm.organization&&(e.org=this.fm.organization),void 0!==this.fm.author&&(e.authorInfo=this.fm.author),void 0!==this.fm.menu&&(e.menuConfig=this.fm.menu))}}async buildHome(){const t=await this.buildPageWithKind(hi("home"));return await this.buildPagination(t),t}async buildSection(){const t=await this.buildPageWithKind(hi("section"));return await this.buildPagination(t),t}async build404(){const t=await this.buildPageWithKind(hi("404"));return await this.adaptPagination(t),t}async buildSitemap(){const t=await this.buildPageWithKind(hi("sitemap"));return await this.adaptPagination(t),t}async buildTaxonomy(){const t=this.taxonomy.getTaxonomy(this.source.file.paths().path()),e=t?t.singular():"",n=await this.newTaxonomy(this.source,this.c,e);return n.pageMap=this.pageMapper,await this.buildOutput(n),await this.buildPagination(n),n}async buildTerm(){const t=this.source.file.paths(),e=this.taxonomy.getTaxonomy(t.path()),n=e?e.singular():"",r=t.unnormalized().baseNameNoIdentifier(),i=await this.newTerm(this.source,this.c,n,r);return i.pageMap=this.pageMapper,await this.buildOutput(i),await this.buildPagination(i),i}async render(t){if(this.c?.lazyRendered)return void(this.c.lazyRender=async()=>{const e=await(this.renderableDocument?.render({maxSummaryLength:300,wordsPerMinute:200,shortcodeRenderer:this.createShortcodeRenderer(t)}));this.c?.updateWithContentResult(e)});const e=await(this.renderableDocument?.render({maxSummaryLength:300,wordsPerMinute:200,shortcodeRenderer:this.createShortcodeRenderer(t)}));this.c?.updateWithContentResult(e)}async parse(t){this.renderableDocument=await this.converter.prepareRender(t),this.c=ks(t),this.c.toc=this.renderableDocument.toc(),this.fmParser=new Pi(this.renderableDocument.frontMatter(),this.langSvc,this.taxonomySvc),await this.parseFrontMatter(),await this.parseLanguage(),await this.parseKind(),await this.parseTerms()}async parseTerms(){this.fm&&this.fm.terms&&(this.term.terms=this.fm.terms)}async parseKind(){const t=this.source.file.paths();let e="";if(this.fm&&(e=this.fm.kind||""),""===e)switch(e=hi("page"),t.baseNoLeadingSlash()){case"/":case"":e=hi("home");break;case"404":e=hi("404");break;case xs:e=hi("sitemap");break;default:if(this.source.file.isBranchBundle()){e=hi("section");const n=this.taxonomy.getTaxonomy(t.path());this.taxonomy.isZero(n)||(e=this.taxonomy.isTaxonomyPath(t.path())?hi("taxonomy"):hi("term"))}}this.kind=e}async parseLanguageByDefault(){const t=this.langSvc.defaultLanguage(),e=await this.langSvc.getLanguageIndex(t);this.source.identity.lang=t,this.source.identity.langIdx=e}async parseLanguageByIdx(t){const e=this.langSvc.getLanguageByIndex(t);this.source.identity.lang=e,this.source.identity.langIdx=t}async parseLanguage(){const[t,e]=this.langSvc.getSourceLang(this.source.file.fileInfo().root());if(e){const e=this.langSvc.getLanguageIndex(t);return this.source.identity.lang=t,void(this.source.identity.langIdx=e)}await this.parseLanguageByDefault()}async parseFrontMatter(){this.fmParser?this.fm=await this.fmParser.parse(this.urlSvc.baseUrl()):this.fm={path:"",lang:"",kind:"",title:"",description:"",weight:999,terms:{},params:{}}}createShortcodeRenderer(t){return async e=>{if(!this.templateSvc)return ga.warn(`Template service not available for shortcode: ${e.name}`),"";try{return e.name?await this.doRenderShortcode(e,null,0,t):(ga.warn("Shortcode missing name"),"")}catch(t){return ga.error(`Error rendering shortcode "${e.name}":`,t),""}}}async doRenderShortcode(t,e,n,r){if(t.inline)return ga.warn("Inline shortcodes are not supported yet."),"";let i=new Us(t.params||{},"",r,e,t.name,"object"==typeof t.params&&!Array.isArray(t.params),t.ordinal||0,t.indentation||"",t.pos||0);if(t.inner&&t.inner.length>0){let s="";for(const e of t.inner)if("string"==typeof e)s+=e;else{if("object"!=typeof e||!("name"in e))return ga.error(`Illegal state on shortcode rendering of "${t.name}". Illegal type in inner data: ${typeof e}`),"";s+=await this.doRenderShortcode(e,i,n+1,r)}if(t.doMarkup)try{const n=await this.renderShortcodeMarkdown(r,s);i=new Us(t.params||{},n,r,e,t.name,"object"==typeof t.params&&!Array.isArray(t.params),t.ordinal||0,t.indentation||"",t.pos||0)}catch(t){throw new Error(`Failed to process inner content: ${t}`)}else i=new Us(t.params||{},s,r,e,t.name,"object"==typeof t.params&&!Array.isArray(t.params),t.ordinal||0,t.indentation||"",t.pos||0)}try{let e=await(this.templateSvc?.execute(t.name,i));if(!t.inner?.length&&t.indentation){const n=e?.split("\n");e=n?.map((e,n)=>0===n?e:t.indentation+e).join("\n")}return e||""}catch(e){if(e instanceof qs&&"SHORTCODE_NOT_FOUND"===e.code)return t.rawContent;throw new Error(`Failed to process shortcode: ${e instanceof Error?e.message:String(e)}`)}}async renderShortcodeMarkdown(t,e){try{const n={document:t,documentID:t.path(),documentName:t.name(),filename:t.pageFile().filename()},r={ctx:{},src:(new TextEncoder).encode(e),renderTOC:!1,getRenderer:()=>null},i=await this.converter.convert(n,r);let s=(new TextDecoder).decode(i.bytes());return s.includes("\n")||(s=s.replace(/^<p>(.*)<\/p>\n$/,"$1")),s}catch(t){return ga.error("Error rendering shortcode markdown:",t),""}}async buildPagination(t){const e=new Ls({pageSize:()=>10,globalRegularPages:async()=>this.contentHub?await this.contentHub.globalRegularPages():[]},t);t.pagerManager=e}async adaptPagination(t){const e={current:()=>new Ds([],0,10,t.path()).pagers()[0],setCurrent:e=>{throw new Error(`pagination not supported for this page: ${t.path()}`)},paginator:async()=>{throw new Error(`pagination not supported for this page: ${t.path()}`)},paginate:async e=>{throw new Error(`pagination not supported for this page: ${t.path()}`)}};t.pagerManager=e}async buildOutput(t){}async newPage(t,e){const n=new Fs(this.urlSvc.baseUrl(),"always",{},0,t.file.fileInfo().modTime()),r=new $s;return new Os(t,e,n,r,"",hi("page"),this.pageMapper)}async newTaxonomy(t,e,n){const r=new Fs(this.urlSvc.baseUrl(),"always",{},0,t.file.fileInfo().modTime()),i=new $s;return new Is(t,e,r,i,n,n,hi("taxonomy"),this.pageMapper)}async newTerm(t,e,n,r){const i=new Fs(this.urlSvc.baseUrl(),"always",{},0,t.file.fileInfo().modTime()),s=new $s;return new Ms(t,e,i,s,n,r,r,hi("term"),this.pageMapper)}},wa=m(require("path")),ya=m(require("path")),ba=class{views;fsSvc;constructor(t,e){this.views=t,this.fsSvc=e}async assemble(t,e,n){for(const r of this.views){const i=this.pluralTreeKey(r.plural()),s=(t.get(i),is(mi(this.fsSvc.newFileMetaInfo(i+"/_index.md")))),a=await e.withSource(s).withLangIdx(n).kindBuild();t.insertIntoValuesDimension(i,ts(a))}}isTaxonomyPath(t){const e=this.getTaxonomy(t);return!!e&&t===wa.join(this.pluralTreeKey(e.plural()),"_index.md")}pluralTreeKey(t){return function(...t){let e="";return t.length>0&&(e=t[0],t.length>1&&(e=wa.join(...t))),e=e.replace(/^[\.\/ \s]+|[\.\/ \s]+$/g,""),e=ya.posix.normalize(e.toLowerCase().replace(/[^\w\-_\/]/g,"")),""===e||"/"===e?"":("/"!==e[0]&&(e="/"+e),e)}(t)}getTaxonomy(t){for(const e of this.views)if(t.startsWith(this.pluralTreeKey(e.plural())))return e;return null}isZero(t){return!t||""===t.singular()}};j();var va=N("content",{component:"term"});function Ea(t){return t?Array.isArray(t)?t.map(t=>String(t)):"string"==typeof t?[t]:[String(t)]:null}function ka(t){if("number"==typeof t)return Math.floor(t);if("string"==typeof t){const e=parseInt(t,10);if(isNaN(e))throw new Error(`cannot convert "${t}" to int`);return e}throw new Error(`cannot convert ${typeof t} to int`)}var Sa=class{terms;fsSvc;constructor(t){this.terms={},this.fsSvc=t}async assemble(t,e,n,r){const i=new Vi({tree:t,lockType:2,handle:async(i,s,a)=>{const[o,l]=s.getPage();if(!l)return[!1,null];for(const s of n.taxonomy.views){const a=Ea(Ri(o.params(),s.plural(),!1));if(!a)continue;const l=Li(o.params(),s.plural()+"_weight");let c=0;if(null==l||""===l)c=0;else try{c=ka(l)}catch(t){va.warn(`Unable to convert taxonomy weight ${l} to int for "${o.paths().path()}"`)}for(let l=0;l<a.length;l++){const h=a[l];if(""===h)continue;const u="/"+s.plural()+"/"+h;try{const a=mi(this.fsSvc.newFileMetaInfo(u+"/_index.md")),f=a.paths(),d=is(a),p=await n.withSource(d).withLangIdx(r).kindBuild();t.insertIntoValuesDimension(f.base(),ts(p));const g=t.get(f.base());if(g){const[t,e]=g.getPage();if(!e)return[!1,null];const n=t;n.term=h,n.singular=s.singular()}let m=i;""===m&&(m="/");const w=f.base()+m,[y,b]=g.getPage();if(!b)return[!1,null];e.insert(w,new Zi(ts(o),{page:y,ordinal:l,weight:c,Weight:()=>c,Ordinal:()=>l}))}catch(t){return[!1,t]}}}return[!1,null]}});try{return await i.walk(),null}catch(t){return t}}},Ta=m(require("path"));j(),j(),N("site",{component:"pager"});var xa=class t{page;pager;constructor(t,e){this.page=t,this.pager=e}pageNumber(){return this.pager.pageNumber()}totalPages(){return this.pager.totalPages()}url(){return this.pager.url()}pages(){return this.pager.pages()}allPages(){return this.pager.allPages()}pagers(){return this.pager.pagers()}first(){return this.pager.first()}last(){return this.pager.last()}hasPrev(){return this.pager.hasPrev()}prev(){return this.pager.prev()}hasNext(){return this.pager.hasNext()}next(){return this.pager.next()}get PageNumber(){return this.pageNumber()}get TotalPages(){return this.totalPages()}get URL(){let t=this.url();return t.startsWith("/")&&(t=t.slice(1)),this.page.Site.getURL().relURL(t)}get HasPrev(){return this.hasPrev()}get HasNext(){return this.hasNext()}get First(){const e=this.first();return e?new t(this.page,e):null}get Last(){const e=this.last();return e?new t(this.page,e):null}get Prev(){const e=this.prev();return e?new t(this.page,e):null}get Next(){const e=this.next();return e?new t(this.page,e):null}get Pagers(){return this.pagers().map(e=>new t(this.page,e))}get Pages(){const t=this.pages();return this.page.sitePages(t)}get AllPages(){const t=this.pager.allPages();return this.page.sitePages(t)}},Aa=N("site",{component:"page"}),Ca=class t{tmplSvc;langSvc;publisher;contentPage;pageOutput=null;site;resources=[];ot=null;ct=null;constructor(t,e,n,r,i){this.tmplSvc=t,this.langSvc=e,this.publisher=n,this.contentPage=r,this.site=i}async processResources(t){this.resources=t}async render(){try{await this.renderResources(),await this.renderPage()}catch(t){Aa.error(`Failed to render page ${this.paths().path()}: ${t}`)}}getPageOutput(){return this.pageOutput||(this.pageOutput=this.output()),this.pageOutput}async renderPage(){const t=this.layouts(),{preparer:e,found:n}=await this.tmplSvc.lookupLayout(t);if(!n)return void Aa.warn(`Failed to find layout: ${t.join(",")} for page ${this.paths().path()}`);const r=[];let i=this.getPageOutput().targetPrefix();i=this.site.getLanguage().getCurrentLanguage()===i&&i===this.langSvc.defaultLanguage()?"":this.site.getLanguage().getCurrentLanguage(),r.push(Ta.default.join(i,this.getPageOutput().targetFilePath())),await this.renderAndWritePage(e,r);const s=await this.current();if(s){let t=s.next();for(;t;){this.setCurrent(t);const n=[Ta.default.join(i,t.url(),this.getPageOutput().targetFileBase())];await this.renderAndWritePage(e,n),t=t.next()}}}async renderAndWritePage(t,e){try{const n=await this.tmplSvc.executeWithContext(t,this);await this.publisher.publishSource(n,...e)}catch(t){throw this.errorf(t,"failed to publish page")}}async renderResources(){for(const t of this.resources){const e=[];let n=this.getPageOutput().targetPrefix();n=this.site.getLanguage().getCurrentLanguage()===n&&n===this.langSvc.defaultLanguage()?"":this.site.getLanguage().getCurrentLanguage();let r=t.path();e.push(Ta.default.join(n,r));let i=null;try{const n=()=>t.pageFile().open();if(i=await n(),!i)throw new Error("Failed to open resource stream");let r;r="function"==typeof i.read?new ReadableStream({async start(t){try{const e=new Uint8Array(8192);for(;;){const n=await i.read(e);if(0===n.bytesRead)break;t.enqueue(e.slice(0,n.bytesRead))}t.close()}catch(e){t.error(e)}}}):new ReadableStream({start(t){t.close()}}),await this.publisher.publishFiles(r,...e)}catch(t){throw this.errorf(t,"failed to publish page resources")}finally{if(i)try{await i.close()}catch(t){Aa.warn(`Failed to close resource stream: ${t}`)}}}}errorf(t,e,...n){const r=[this.pageIdentity().pageLanguage(),this.paths().path(),...n],i=`[%s] page "%s": ${e}: %s`,s=this.sprintf(i,...r,t.message||t);return new Error(s)}sprintf(t,...e){let n=0;return t.replace(/%s/g,()=>e[n++]||"")}clone(){const e=new t(this.tmplSvc,this.langSvc,this.publisher,this.contentPage,this.site);return e.resources=[...this.resources],e.pageOutput=this.pageOutput,e}pageIdentity(){return this.contentPage.pageIdentity()}pageFile(){return this.contentPage.pageFile()}staleVersions(){return this.contentPage.staleVersions()}section(){return this.contentPage.section()}paths(){return this.contentPage.paths()}path(){return this.contentPage.path()}slug(){return this.contentPage.slug()}file(){return this.contentPage.file()}name(){return this.contentPage.name()}title(){return this.contentPage.title()}kind(){return this.contentPage.kind()}scratch(){return this.contentPage.scratch()}get Scratch(){return this.contentPage.scratch()}IsAncestor(t){return this.contentPage.isAncestor(t.contentPage)}get Title(){return this.title()}get Section(){return this.contentPage.section()}get LinkTitle(){return this.title()}get IsSection(){return this.contentPage.isSection()}get IsPage(){return this.contentPage.isPage()}get Content(){return this.getPageOutput().content()}async WikilinkContent(){if(null!==this.ct)return this.ct;const t=await this.getPageOutput().content();return t?(this.ct=await this.site.ProcessWikilinks(this.slug(),t),this.ct):t}async Summary(){return this.contentPage.output().summary()}async ReadingTime(){return await this.getPageOutput().readingTime()}async WordCount(){return await this.getPageOutput().wordCount()}async Backlinks(){const t=this.site.GetBacklinks(this.slug()),e=[],n=await this.site.RegularPages();for(const r of t){const t=n.find(t=>t.slug()===r);t&&e.push(t)}return e}OutgoingLinks(){const t=this.site.getPageGraph();return t?t.getOutgoingLinks(this.slug()):[]}get Description(){return this.description()}get Date(){return this.pageDate()}get LocalDate(){return this.pageDate().toLocaleDateString()}get RelPermalink(){let t;if(this.pageIdentity().pageLanguage()===this.langSvc.defaultLanguage())t=this.getPageOutput().targetFilePath();else{const e=this.getPageOutput().targetPrefix(),n=this.getPageOutput().targetFilePath();t=this.pathJoin(e,n)}return t.startsWith("/")&&(t=t.slice(1)),this.site.getURL().relURL(t)}get GitInfo(){return{}}get File(){return{BaseFileName:this.contentPage.file().baseFileName(),OriginalBaseName:this.contentPage.file().originalBaseFileName(),Dir:this.contentPage.file().dir()}}isHome(){return this.contentPage.isHome()}get IsHome(){return this.isHome()}isPage(){return this.contentPage.isPage()}isSection(){return this.contentPage.isSection()}isAncestor(t){return this.contentPage.isAncestor(t)}eq(t){return this.contentPage.eq(t)}isBundled(){return this.contentPage.isBundled()}layouts(){return this.contentPage.layouts()}output(){return this.contentPage.output()}pageOutputs(){return[this.contentPage.output()]}truncated(){return this.contentPage.truncated()}get Truncated(){return this.contentPage.truncated()}parent(){return this.contentPage.parent()}pages(){return this.contentPage.pages()}isStale(){return this.contentPage.pageIdentity().isStale()}clearStale(){this.contentPage.pageIdentity().clearStale()}prevInSection(){return this.contentPage.prevInSection()}nextInSection(){return this.contentPage.nextInSection()}sections(t){return this.contentPage.sections(t)}regularPages(){return this.contentPage.regularPages()}regularPagesRecursive(){return this.contentPage.regularPagesRecursive()}terms(t,e){return this.contentPage.terms(t,e)}isTranslated(){return this.contentPage.isTranslated()}translations(){return this.contentPage.translations()}rawContent(){return this.contentPage.rawContent()}description(){return this.contentPage.description?this.contentPage.description():""}params(){return this.contentPage.params?this.contentPage.params():{}}pageBaseUrl(){return this.contentPage.pageBaseUrl()?this.contentPage.pageBaseUrl():""}pageWeight(){return this.contentPage.pageWeight?this.contentPage.pageWeight():0}pageDate(){return this.contentPage.pageDate?this.contentPage.pageDate():new Date}publishDate(){return this.contentPage.publishDate?this.contentPage.publishDate():new Date}get PublishDate(){return this.publishDate()}async relatedKeywords(t){return this.contentPage.relatedKeywords?await this.contentPage.relatedKeywords(t):[]}shouldList(t){return!this.contentPage.shouldList||this.contentPage.shouldList(t)}shouldListAny(){return!this.contentPage.shouldListAny||this.contentPage.shouldListAny()}noLink(){return!!this.contentPage.noLink&&this.contentPage.noLink()}organization(){return this.contentPage.organization?this.contentPage.organization():void 0}author(){return this.contentPage.author?this.contentPage.author():void 0}menu(){return this.contentPage.menu?this.contentPage.menu():void 0}current(){return this.contentPage.current()}setCurrent(t){this.contentPage.setCurrent(t)}posOffset(t){return this.contentPage.posOffset(t)}paginator(){return this.contentPage.paginator()}async paginate(t){return this.contentPage.paginate(t)}get Plain(){return this.rawContent()}get TableOfContents(){return this.getPageOutput().tableOfContents()}get Params(){return this.params()}get Site(){return this.site}get Sites(){return{First:this.site,Default:this.site}}get Lastmod(){return this.contentPage.pageDate?this.contentPage.pageDate():null}get Sitemap(){return{ChangeFreq:"weekly",Priority:.5,Filename:"sitemap.xml"}}get IsTranslated(){return this.isTranslated()}async Paginator(){return this.ot||await this.setupCurrentPaginator(),this.ot}async Paginate(t){try{const e=t.map(t=>t.contentPage),n=await this.contentPage.paginate(e);return n&&(this.ot=new xa(this,n)),this.ot}catch(t){return Aa.error("Error during pagination:",t),null}}async setupCurrentPaginator(){try{const t=await this.contentPage.paginator();this.ot=t?new xa(this,t):null}catch(t){Aa.error("Error initializing Paginator:",t),this.ot=null}}get Language(){return{Lang:this.pageIdentity().pageLanguage(),LanguageName:this.langSvc.getLanguageName(this.pageIdentity().pageLanguage()),Title:this.title(),Weight:this.pageWeight()}}get Permalink(){return this.RelPermalink}sitePages(t){const e=[];for(const n of t){const t=this.sitePage(n);t&&e.push(t)}return e}sitePage(e){try{return null===e?(Aa.warn(`Invalid content page provided: ${e}`),null):new t(this.tmplSvc,this.langSvc,this.publisher,e,this.site)}catch(t){return Aa.error(`Error creating site page: ${t}`),null}}pathJoin(...t){return t.filter(t=>t&&t.length>0).map(t=>t.replace(/^\/+|\/+$/g,"")).filter(t=>t.length>0).join("/")}joinURL(t,e){return t?e?(t.endsWith("/")&&(t=t.slice(0,-1)),e.startsWith("/")||(e="/"+e),t+e):t:e}async Translations(){const t=await this.translations();return Array.isArray(t)?t.map(t=>this.sitePage(t)).filter(t=>null!==t):[]}async GetTerms(t){const e=await this.terms(this.site.getLanguage().currentLanguageIndex(),t);return Array.isArray(e)?e.map(t=>this.sitePage(t)).filter(t=>null!==t):[]}async Pages(){return await this.getSitePages()}get Page(){return this.contentPage}get Kind(){return this.kind()}get Type(){if("home"===this.kind())return"page";if("page"===this.kind()){const t=this.section();if(t&&t.length>0)return t}return"page"}get Parent(){return this.sitePage(this.contentPage.parent())}async getSitePages(){const t=await this.contentPage.pages();return!t||Array.isArray(t)&&0===t.length?[]:this.sitePages(t)}},Da=class t{url;withPath;withPathNoTrailingSlash;withoutPath;basePath;basePathNoTrailingSlash;isRelative;constructor(t,e=!1){if(this.url=t,this.isRelative=e,this.withPath=t.toString(),this.withPathNoTrailingSlash=this.withPath.replace(/\/$/,""),e)this.withoutPath="/";else{const e=new URL(t.toString());e.pathname="",this.withoutPath=e.toString().replace(/\/$/,"")}this.basePath=t.pathname,this.basePathNoTrailingSlash=this.basePath.replace(/\/$/,"")}static fromString(e){try{e&&"/"!==e||(e="/");const n=e.trim();if(n.startsWith("/")&&!n.startsWith("//")){const e=new URL(n,"http://localhost");return e.pathname.endsWith("/")||(e.pathname+="/"),new t(e,!0)}if(n.startsWith("//")){const e=new URL("https:"+n);return e.pathname.endsWith("/")||(e.pathname+="/"),new t(e)}if(n.includes("://")){const e=new URL(n);if(!["http:","https:"].includes(e.protocol))throw new Error(`Unsupported protocol: ${e.protocol}. Only http and https are supported.`);return e.pathname.endsWith("/")||(e.pathname+="/"),new t(e)}if(n.includes(":")&&!n.includes("/")){const t=n.indexOf(":"),e=n.substring(0,t+1);throw new Error(`Unsupported protocol: ${e}. Only http and https are supported.`)}const r=new URL("https://"+n);return r.pathname.endsWith("/")||(r.pathname+="/"),new t(r)}catch(t){throw new Error(`Invalid URL: ${t?.message||"Unknown error"}`)}}getRoot(t){return this.isRelative?this.basePath:t.startsWith("/")?this.withoutPath:this.withPath}toString(){return this.isRelative?this.basePath:this.withPath}path(){return this.url.pathname}port(){return this.url.port?parseInt(this.url.port):0}hostURL(){return this.isRelative?"/":this.toString().replace(this.path(),"")}protocol(){return this.url.protocol}host(){return this.url.host}hostname(){return this.url.hostname}getURL(){return new URL(this.url.toString())}withProtocol(e){if(this.isRelative)throw new Error("Cannot change protocol of relative URL");const n=this.getURL();let r=e;const i=r.endsWith("://"),s=r.endsWith(":");if(i?r=r.slice(0,-3):s&&(r=r.slice(0,-1)),s&&!n.pathname)throw new Error(`cannot determine BaseURL for protocol ${e}`);return n.protocol=r,t.fromString(n.toString())}withPort(e){if(this.isRelative)throw new Error("Cannot set port on relative URL");const n=this.getURL();return n.port=e.toString(),t.fromString(n.toString())}isRelativeURL(){return this.isRelative}isAbsoluteURL(){return!this.isRelative}},Pa=class t{base;canonical;baseURL=null;constructor(t,e=!1){this.base=t,this.canonical=e,this.setup()}setup(){try{this.baseURL=Da.fromString(this.base)}catch(t){throw new Error(t?.message||"Failed to setup URL")}}isAbsURL(t){return t.startsWith("http://")||t.startsWith("https://")?[!0,null]:[/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(t),null]}startWithBaseUrlRoot(t){return!!this.baseURL&&t.startsWith(this.baseURL.getRoot(t))}isProtocolRelPath(t){return t.startsWith("//")}trimBaseUrlRoot(t){if(!this.baseURL)return t;const e=this.baseURL.getRoot(t);return t.endsWith(e)?t.slice(0,-e.length):t}addContextRoot(t){if(!this.baseURL)return t;let e=t;return this.canonical||(r=t,e=!(n=this.baseURL.getRoot(t))||r.startsWith(n)?r:function(...t){return t.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/\/$/,"")}(n,r)),e;var n,r}handleRootSuffix(t,e){return this.baseURL?(""===t&&this.baseURL.getRoot(t).endsWith("/")&&(e+="/"),e):e}handlePrefix(t){return t.startsWith("/")||(t="/"+t),t}relURL(t){if(!t)return this.baseURL?this.baseURL.basePath:"";const[e,n]=this.isAbsURL(t);if(n)return t;if(e||this.isProtocolRelPath(t))return t;if(!this.baseURL)return t;let r=t;if(t.startsWith("/"))return this.baseURL.isRelativeURL()?t:this.baseURL.withoutPath+t;if(r=this.baseURL.isRelativeURL()?(this.baseURL.basePath.endsWith("/")?this.baseURL.basePath:this.baseURL.basePath+"/")+t:(this.baseURL.withPath.endsWith("/")?this.baseURL.withPath:this.baseURL.withPath+"/")+t,r.includes("://")){const t=r.indexOf("://"),e=r.substring(0,t+3),n=r.substring(t+3);r=e+n.replace(/\/+/g,"/")}else r=r.replace(/\/+/g,"/");return r}absURL(t,e=!1,n=""){const[r,i]=this.isAbsURL(t);if(i)return t;if(r||this.isProtocolRelPath(t))return t;if(!this.baseURL)return t;const s=this.baseURL.getRoot(t);if(e&&n){let e=!1,r=t;if(t.startsWith("/")&&(r=t.slice(1)),e=r===n||r.startsWith(n+"/"),!e){const e=""===t||t.endsWith("/");t=this.joinPaths(n,t),e&&(t+="/")}}return function(t,e){const n=`${t.replace(/\/$/,"")}/${e.replace(/^\//,"")}`;try{return new URL(n)}catch{return new URL("http://"+n)}}(s,t).toString()}urlize(t){return this.urlEscape(this.makePathSanitized(t))}makePathSanitized(t){return this.makePath(t).toLowerCase()}urlEscape(e){try{if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e))return new t(e).toString();const n=e.match(/^([^?#]*)(\?[^#]*)?(#.*)?$/);if(!n)return encodeURI(e);const[,r="",i="",s=""]=n;return encodeURI(r)+(i||"")+(s||"")}catch{return encodeURI(e)}}makePath(t){let e=function(t){return t.replace(/[\s\t\n\r]+/g,"-").replace(/[^\w\-_]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}(t);return e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),e}basePathNoSlash(){return this.baseURL?this.baseURL.basePathNoTrailingSlash:""}joinPaths(...t){return t.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/\/$/,"")}};j(),G(),j(),N("site",{component:"menu"});var La=class t{ht;ut;ft;wt;yt;constructor(t){this.ht=t.title,this.ut=t.url,this.ft=t.children||[],this.wt=t.weight||0,this.yt=t.identifier||this.ut}title(){return this.ht}get Title(){return this.title()}url(){return this.ut}get URL(){return this.url()}children(){return[...this.ft]}get Children(){return this.children()}weight(){return this.wt}identifier(){return this.yt}hasChildren(){return this.ft.length>0}get HasChildren(){return this.hasChildren()}addChild(e){const n=[...this.ft,e];return new t({title:this.ht,url:this.ut,children:n,weight:this.wt,identifier:this.yt})}toJSON(){return{title:this.ht,url:this.ut,weight:this.wt,children:this.ft.map(t=>t.toJSON())}}withChildren(e){return new t({title:this.ht,url:this.ut,children:e,weight:this.wt,identifier:this.yt})}},Ra=class{bt;vt;constructor(t={}){this.bt=t.nav?this.sortMenus([...t.nav]):[],this.vt=t.footer?this.sortMenus([...t.footer]):[]}nav(){return[...this.bt]}get Nav(){return this.nav()}footer(){return[...this.vt]}get Footer(){return this.footer()}sortMenus(t){return t.sort((t,e)=>{if(t.weight()!==e.weight())return 0===e.weight()?-1:0===t.weight()?1:t.weight()-e.weight();const n=t.title().localeCompare(e.title());return 0!==n?n:t.identifier().localeCompare(e.identifier())})}toJSON(){return{nav:this.bt.map(t=>t.toJSON()),footer:this.vt.map(t=>t.toJSON())}}};function Na(){return new Ra({})}var _a=require("github-slugger");function Oa(t){let[e,n]=t.split("#",2);return e.endsWith(".pdf")?[e,void 0===n?"":`#${n}`]:(n=void 0===n?"":"#"+(0,_a.slug)(n),[e,n])}function Ia(t){const e=ja((Ba(n=t,"index")&&(n=n.slice(0,-5)),n),!0);var n;return 0===e.length?"/":e}function Ma(t){let e=t.split("/").filter(t=>""!==t).slice(0,-1).map(t=>"..").join("/");return 0===e.length&&(e="."),e}function Fa(...t){if(0===t.length)return"";let e=t.filter(t=>""!==t&&"/"!==t).map(t=>ja(t)).join("/");return t[0].startsWith("/")&&(e="/"+e),t[t.length-1].endsWith("/")&&(e+="/"),e}function $a(t,e,n){let r=function(t){let[e,n]=Oa(decodeURI(t));const r=Ua(e);let i=e.split("/").filter(t=>t.length>0),s=i.filter(qa).join("/");const a=Ia(function(t){let e=(n=t=ja(t),n.match(/\.[A-Za-z0-9]+$/)?.[0]);var n;const r=t.replace(new RegExp(e+"$"),"");[".md",".html",void 0].includes(e)&&(e="");let i=function(t){return t.split("/").map(t=>t.replace(/\s/g,"-").replace(/&/g,"-and-").replace(/%/g,"-percent").replace(/\?/g,"").replace(/#/g,"")).join("/").replace(/\/$/,"")}(r);return Ba(i,"_index")&&(i=i.replace(/_index$/,"index")),i+e}(i.filter(t=>!qa(t)&&""!==t).join("/"))),o=r?"/":"";return""===(l=Fa(ja(s),ja(a)))&&(l="."),l.startsWith(".")||(l=Fa(".",l)),l+o+n;var l}(e);if("relative"===n.strategy)return r;{const e=Ua(r)?"/":"",i=ja(r.slice(1));let[s,a]=Oa(i);if("shortest"===n.strategy){const e=n.allSlugs.filter(t=>{const e=t.split("/").at(-1);return s.toLowerCase()===e?.toLowerCase()});if(1===e.length)return function(t,e){return Fa(Ma(t),Ia(e))}(t,e[0])+a}return Fa(Ma(t),i)+e}}function Ua(t){return t.endsWith("/")||Ba(t,"index")||Ba(t,"index.md")||Ba(t,"index.html")}function Ba(t,e){return t===e||t.endsWith("/"+e)}function qa(t){return/^\.{0,2}$/.test(t)}function ja(t,e){return t.startsWith("/")&&(t=t.substring(1)),!e&&t.endsWith("/")&&(t=t.slice(0,-1)),t}j();var Ha=N("site",{component:"PageGraph"}),za=class{allSlugs;outgoingLinks=new Map;constructor(t){this.allSlugs=[...t],Ha.info(`PageGraph initialized with ${t.length} items (pages + resources)`)}registerOutgoingLinks(t,e){const n=Ia(t);this.outgoingLinks.set(n,e)}getBacklinks(t){const e=Ia(t),n=[];for(const[t,r]of this.outgoingLinks.entries())r.includes(e)&&n.push(t);return n}getAllSlugs(){return[...this.allSlugs]}hasSlug(t){return this.allSlugs.includes(t)}resolveLink(t,e,n){return $a(t,e,{strategy:n,allSlugs:this.allSlugs})}getOutgoingLinks(t){const e=Ia(t);return this.outgoingLinks.get(e)||[]}getAllOutgoingLinks(){return new Map(this.outgoingLinks)}getStats(){return{totalPages:this.allSlugs.length,slugs:[...this.allSlugs]}}};function Wa(t){if(t)throw t}var Ga=m(V(),1);function Va(t){if("object"!=typeof t||null===t)return!1;const e=Object.getPrototypeOf(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)}function Ya(t){return Xa(t&&t.line)+":"+Xa(t&&t.column)}function Ka(t){return Ya(t&&t.start)+"-"+Ya(t&&t.end)}function Xa(t){return t&&"number"==typeof t?t:1}var Za=class extends Error{constructor(t,e,n){super(),"string"==typeof e&&(n=e,e=void 0);let r="",i={},s=!1;if(e&&(i="line"in e&&"column"in e||"start"in e&&"end"in e?{place:e}:"type"in e?{ancestors:[e],place:e.position}:{...e}),"string"==typeof t?r=t:!i.cause&&t&&(s=!0,r=t.message,i.cause=t),!i.ruleId&&!i.source&&"string"==typeof n){const t=n.indexOf(":");-1===t?i.ruleId=n:(i.source=n.slice(0,t),i.ruleId=n.slice(t+1))}if(!i.place&&i.ancestors&&i.ancestors){const t=i.ancestors[i.ancestors.length-1];t&&(i.place=t.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;var o;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=((o=i.place)&&"object"==typeof o?"position"in o||"type"in o?Ka(o.position):"start"in o||"end"in o?Ka(o):"line"in o||"column"in o?Ya(o):"":"")||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Za.prototype.file="",Za.prototype.name="",Za.prototype.reason="",Za.prototype.message="",Za.prototype.stack="",Za.prototype.column=void 0,Za.prototype.line=void 0,Za.prototype.ancestors=void 0,Za.prototype.cause=void 0,Za.prototype.fatal=void 0,Za.prototype.place=void 0,Za.prototype.ruleId=void 0,Za.prototype.source=void 0;var Ja=m(require("path"),1),Qa=m(require("process"),1),to=require("url");function eo(t){return Boolean(null!==t&&"object"==typeof t&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&void 0===t.auth)}var no=["history","path","basename","stem","extname","dirname"],ro=class{constructor(t){let e;e=t?eo(t)?{path:t}:"string"==typeof t||function(t){return Boolean(t&&"object"==typeof t&&"byteLength"in t&&"byteOffset"in t)}(t)?{value:t}:t:{},this.cwd="cwd"in e?"":Qa.default.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,r=-1;for(;++r<no.length;){const t=no[r];t in e&&void 0!==e[t]&&null!==e[t]&&(this[t]="history"===t?[...e[t]]:e[t])}for(n in e)no.includes(n)||(this[n]=e[n])}get basename(){return"string"==typeof this.path?Ja.default.basename(this.path):void 0}set basename(t){so(t,"basename"),io(t,"basename"),this.path=Ja.default.join(this.dirname||"",t)}get dirname(){return"string"==typeof this.path?Ja.default.dirname(this.path):void 0}set dirname(t){ao(this.basename,"dirname"),this.path=Ja.default.join(t||"",this.basename)}get extname(){return"string"==typeof this.path?Ja.default.extname(this.path):void 0}set extname(t){if(io(t,"extname"),ao(this.dirname,"extname"),t){if(46!==t.codePointAt(0))throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ja.default.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){eo(t)&&(t=(0,to.fileURLToPath)(t)),so(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return"string"==typeof this.path?Ja.default.basename(this.path,this.extname):void 0}set stem(t){so(t,"stem"),io(t,"stem"),this.path=Ja.default.join(this.dirname||"",t+(this.extname||""))}fail(t,e,n){const r=this.message(t,e,n);throw r.fatal=!0,r}info(t,e,n){const r=this.message(t,e,n);return r.fatal=void 0,r}message(t,e,n){const r=new Za(t,e,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(t){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(t||void 0).decode(this.value)}};function io(t,e){if(t&&t.includes(Ja.default.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+Ja.default.sep+"`")}function so(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function ao(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}var oo=function(t){const e=this.constructor.prototype,n=e[t],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,e),r},lo={}.hasOwnProperty,co=(new class t extends oo{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){const t=[],e={run:function(...e){let n=-1;const r=e.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function i(s,...a){const o=t[++n];let l=-1;if(s)r(s);else{for(;++l<e.length;)null!==a[l]&&void 0!==a[l]||(a[l]=e[l]);e=a,o?function(t,e){let n;return function(...e){const s=t.length>e.length;let a;s&&e.push(r);try{a=t.apply(this,e)}catch(t){if(s&&n)throw t;return r(t)}s||(a&&a.then&&"function"==typeof a.then?a.then(i,r):a instanceof Error?r(a):i(a))};function r(t,...r){n||(n=!0,e(t,...r))}function i(t){r(null,t)}}(o,i)(...a):r(null,...a)}}(null,...e)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return t.push(n),e}};return e}()}copy(){const e=new t;let n=-1;for(;++n<this.attachers.length;){const t=this.attachers[n];e.use(...t)}return e.data((0,Ga.default)(!0,{},this.namespace)),e}data(t,e){return"string"==typeof t?2===arguments.length?(fo("data",this.frozen),this.namespace[t]=e,this):lo.call(this.namespace,t)&&this.namespace[t]||void 0:t?(fo("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[e,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=e.call(t,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const e=mo(t),n=this.parser||this.Parser;return ho("parse",n),n(String(e),e)}process(t,e){const n=this;return this.freeze(),ho("process",this.parser||this.Parser),uo("process",this.compiler||this.Compiler),e?r(void 0,e):new Promise(r);function r(r,i){const s=mo(t),a=n.parse(s);function o(t,n){t||!n?i(t):r?r(n):e(void 0,n)}n.run(a,s,function(t,e,r){if(t||!e||!r)return o(t);const i=e,s=n.stringify(i,r);var a;"string"==typeof(a=s)||function(t){return Boolean(t&&"object"==typeof t&&"byteLength"in t&&"byteOffset"in t)}(a)?r.value=s:r.result=s,o(t,r)})}}processSync(t){let e,n=!1;return this.freeze(),ho("processSync",this.parser||this.Parser),uo("processSync",this.compiler||this.Compiler),this.process(t,function(t,r){n=!0,Wa(t),e=r}),go("processSync","process",n),e}run(t,e,n){po(t),this.freeze();const r=this.transformers;return n||"function"!=typeof e||(n=e,e=void 0),n?i(void 0,n):new Promise(i);function i(i,s){const a=mo(e);r.run(t,a,function(e,r,a){const o=r||t;e?s(e):i?i(o):n(void 0,o,a)})}}runSync(t,e){let n,r=!1;return this.run(t,e,function(t,e){Wa(t),n=e,r=!0}),go("runSync","run",r),n}stringify(t,e){this.freeze();const n=mo(e),r=this.compiler||this.Compiler;return uo("stringify",r),po(t),r(t,n)}use(t,...e){const n=this.attachers,r=this.namespace;if(fo("use",this.frozen),null==t);else if("function"==typeof t)o(t,e);else{if("object"!=typeof t)throw new TypeError("Expected usable value, not `"+t+"`");Array.isArray(t)?a(t):s(t)}return this;function i(t){if("function"==typeof t)o(t,[]);else{if("object"!=typeof t)throw new TypeError("Expected usable value, not `"+t+"`");if(Array.isArray(t)){const[e,...n]=t;o(e,n)}else s(t)}}function s(t){if(!("plugins"in t)&&!("settings"in t))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(t.plugins),t.settings&&(r.settings=(0,Ga.default)(!0,r.settings,t.settings))}function a(t){let e=-1;if(null==t);else{if(!Array.isArray(t))throw new TypeError("Expected a list of plugins, not `"+t+"`");for(;++e<t.length;)i(t[e])}}function o(t,e){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===t){i=r;break}if(-1===i)n.push([t,...e]);else if(e.length>0){let[r,...s]=e;const a=n[i][1];Va(a)&&Va(r)&&(r=(0,Ga.default)(!0,a,r)),n[i]=[t,r,...s]}}}}).freeze();function ho(t,e){if("function"!=typeof e)throw new TypeError("Cannot `"+t+"` without `parser`")}function uo(t,e){if("function"!=typeof e)throw new TypeError("Cannot `"+t+"` without `compiler`")}function fo(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function po(t){if(!Va(t)||"string"!=typeof t.type)throw new TypeError("Expected node, got `"+t+"`")}function go(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function mo(t){return function(t){return Boolean(t&&"object"==typeof t&&"message"in t&&"messages"in t)}(t)?t:new ro(t)}var wo=class{constructor(t,e,n){this.normal=e,this.property=t,n&&(this.space=n)}};function yo(t,e){const n={},r={};for(const e of t)Object.assign(n,e.property),Object.assign(r,e.normal);return new wo(n,r,e)}function bo(t){return t.toLowerCase()}wo.prototype.normal={},wo.prototype.property={},wo.prototype.space=void 0;var vo=class{constructor(t,e){this.attribute=e,this.property=t}};vo.prototype.attribute="",vo.prototype.booleanish=!1,vo.prototype.boolean=!1,vo.prototype.commaOrSpaceSeparated=!1,vo.prototype.commaSeparated=!1,vo.prototype.defined=!1,vo.prototype.mustUseProperty=!1,vo.prototype.number=!1,vo.prototype.overloadedBoolean=!1,vo.prototype.property="",vo.prototype.spaceSeparated=!1,vo.prototype.space=void 0;var Eo={};p(Eo,{boolean:()=>So,booleanish:()=>To,commaOrSpaceSeparated:()=>Po,commaSeparated:()=>Do,number:()=>Ao,overloadedBoolean:()=>xo,spaceSeparated:()=>Co});var ko=0,So=Lo(),To=Lo(),xo=Lo(),Ao=Lo(),Co=Lo(),Do=Lo(),Po=Lo();function Lo(){return 2**++ko}var Ro=Object.keys(Eo),No=class extends vo{constructor(t,e,n,r){let i=-1;if(super(t,e),_o(this,"space",r),"number"==typeof n)for(;++i<Ro.length;){const t=Ro[i];_o(this,Ro[i],(n&Eo[t])===Eo[t])}}};function _o(t,e,n){n&&(t[e]=n)}function Oo(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const s=new No(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[bo(r)]=r,n[bo(s.attribute)]=r}return new wo(e,n,t.space)}No.prototype.defined=!0;var Io=Oo({properties:{ariaActiveDescendant:null,ariaAtomic:To,ariaAutoComplete:null,ariaBusy:To,ariaChecked:To,ariaColCount:Ao,ariaColIndex:Ao,ariaColSpan:Ao,ariaControls:Co,ariaCurrent:null,ariaDescribedBy:Co,ariaDetails:null,ariaDisabled:To,ariaDropEffect:Co,ariaErrorMessage:null,ariaExpanded:To,ariaFlowTo:Co,ariaGrabbed:To,ariaHasPopup:null,ariaHidden:To,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Co,ariaLevel:Ao,ariaLive:null,ariaModal:To,ariaMultiLine:To,ariaMultiSelectable:To,ariaOrientation:null,ariaOwns:Co,ariaPlaceholder:null,ariaPosInSet:Ao,ariaPressed:To,ariaReadOnly:To,ariaRelevant:null,ariaRequired:To,ariaRoleDescription:Co,ariaRowCount:Ao,ariaRowIndex:Ao,ariaRowSpan:Ao,ariaSelected:To,ariaSetSize:Ao,ariaSort:null,ariaValueMax:Ao,ariaValueMin:Ao,ariaValueNow:Ao,ariaValueText:null,role:null},transform:(t,e)=>"role"===e?e:"aria-"+e.slice(4).toLowerCase()});function Mo(t,e){return e in t?t[e]:e}function Fo(t,e){return Mo(t,e.toLowerCase())}var $o=Oo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Do,acceptCharset:Co,accessKey:Co,action:null,allow:null,allowFullScreen:So,allowPaymentRequest:So,allowUserMedia:So,alt:null,as:null,async:So,autoCapitalize:null,autoComplete:Co,autoFocus:So,autoPlay:So,blocking:Co,capture:null,charSet:null,checked:So,cite:null,className:Co,cols:Ao,colSpan:null,content:null,contentEditable:To,controls:So,controlsList:Co,coords:Ao|Do,crossOrigin:null,data:null,dateTime:null,decoding:null,default:So,defer:So,dir:null,dirName:null,disabled:So,download:xo,draggable:To,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:So,formTarget:null,headers:Co,height:Ao,hidden:xo,high:Ao,href:null,hrefLang:null,htmlFor:Co,httpEquiv:Co,id:null,imageSizes:null,imageSrcSet:null,inert:So,inputMode:null,integrity:null,is:null,isMap:So,itemId:null,itemProp:Co,itemRef:Co,itemScope:So,itemType:Co,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:So,low:Ao,manifest:null,max:null,maxLength:Ao,media:null,method:null,min:null,minLength:Ao,multiple:So,muted:So,name:null,nonce:null,noModule:So,noValidate:So,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:So,optimum:Ao,pattern:null,ping:Co,placeholder:null,playsInline:So,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:So,referrerPolicy:null,rel:Co,required:So,reversed:So,rows:Ao,rowSpan:Ao,sandbox:Co,scope:null,scoped:So,seamless:So,selected:So,shadowRootClonable:So,shadowRootDelegatesFocus:So,shadowRootMode:null,shape:null,size:Ao,sizes:null,slot:null,span:Ao,spellCheck:To,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ao,step:null,style:null,tabIndex:Ao,target:null,title:null,translate:null,type:null,typeMustMatch:So,useMap:null,value:To,width:Ao,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Co,axis:null,background:null,bgColor:null,border:Ao,borderColor:null,bottomMargin:Ao,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:So,declare:So,event:null,face:null,frame:null,frameBorder:null,hSpace:Ao,leftMargin:Ao,link:null,longDesc:null,lowSrc:null,marginHeight:Ao,marginWidth:Ao,noResize:So,noHref:So,noShade:So,noWrap:So,object:null,profile:null,prompt:null,rev:null,rightMargin:Ao,rules:null,scheme:null,scrolling:To,standby:null,summary:null,text:null,topMargin:Ao,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ao,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:So,disableRemotePlayback:So,prefix:null,property:null,results:Ao,security:null,unselectable:null},space:"html",transform:Fo}),Uo=Oo({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Po,accentHeight:Ao,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ao,amplitude:Ao,arabicForm:null,ascent:Ao,attributeName:null,attributeType:null,azimuth:Ao,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ao,by:null,calcMode:null,capHeight:Ao,className:Co,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ao,diffuseConstant:Ao,direction:null,display:null,dur:null,divisor:Ao,dominantBaseline:null,download:So,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ao,enableBackground:null,end:null,event:null,exponent:Ao,externalResourcesRequired:null,fill:null,fillOpacity:Ao,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Do,g2:Do,glyphName:Do,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ao,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ao,horizOriginX:Ao,horizOriginY:Ao,id:null,ideographic:Ao,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ao,k:Ao,k1:Ao,k2:Ao,k3:Ao,k4:Ao,kernelMatrix:Po,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ao,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ao,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ao,overlineThickness:Ao,paintOrder:null,panose1:null,path:null,pathLength:Ao,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Co,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ao,pointsAtY:Ao,pointsAtZ:Ao,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Po,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Po,rev:Po,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Po,requiredFeatures:Po,requiredFonts:Po,requiredFormats:Po,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ao,specularExponent:Ao,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ao,strikethroughThickness:Ao,string:null,stroke:null,strokeDashArray:Po,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ao,strokeOpacity:Ao,strokeWidth:null,style:null,surfaceScale:Ao,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Po,tabIndex:Ao,tableValues:null,target:null,targetX:Ao,targetY:Ao,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Po,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ao,underlineThickness:Ao,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ao,values:null,vAlphabetic:Ao,vMathematical:Ao,vectorEffect:null,vHanging:Ao,vIdeographic:Ao,version:null,vertAdvY:Ao,vertOriginX:Ao,vertOriginY:Ao,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ao,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Mo}),Bo=Oo({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(t,e)=>"xlink:"+e.slice(5).toLowerCase()}),qo=Oo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Fo}),jo=Oo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(t,e)=>"xml:"+e.slice(3).toLowerCase()}),Ho=/[A-Z]/g,zo=/-[a-z]/g,Wo=/^data[-\w.:]+$/i;function Go(t){return"-"+t.toLowerCase()}function Vo(t){return t.charAt(1).toUpperCase()}var Yo=yo([Io,$o,Bo,qo,jo],"html"),Ko=yo([Io,Uo,Bo,qo,jo],"svg");function Xo(t){const e=[],n=String(t||"");let r=n.indexOf(","),i=0,s=!1;for(;!s;){-1===r&&(r=n.length,s=!0);const t=n.slice(i,r).trim();!t&&s||e.push(t),i=r+1,r=n.indexOf(",",i)}return e}function Zo(t,e){const n=e||{};return(""===t[t.length-1]?[...t,""]:t).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}var Jo=/[#.]/g;function Qo(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function tl(t){return t.join(" ").trim()}function el(t,e,n){const r=n?function(t){const e=new Map;for(const n of t)e.set(n.toLowerCase(),n);return e}(n):void 0;return function(n,i,...s){let a;if(null==n){a={type:"root",children:[]};const t=i;s.unshift(t)}else{a=function(t,e){const n=t||"",r={};let i,s,a=0;for(;a<n.length;){Jo.lastIndex=a;const t=Jo.exec(n),e=n.slice(a,t?t.index:n.length);e&&(i?"#"===i?r.id=e:Array.isArray(r.className)?r.className.push(e):r.className=[e]:s=e,a+=e.length),t&&(i=t[0],a++)}return{type:"element",tagName:s||e||"div",properties:r,children:[]}}(n,e);const o=a.tagName.toLowerCase(),l=r?r.get(o):void 0;if(a.tagName=l||o,function(t){if(null===t||"object"!=typeof t||Array.isArray(t))return!0;if("string"!=typeof t.type)return!1;const e=t,n=Object.keys(t);for(const t of n){const n=e[t];if(n&&"object"==typeof n){if(!Array.isArray(n))return!0;const t=n;for(const e of t)if("number"!=typeof e&&"string"!=typeof e)return!0}}return!(!("children"in t)||!Array.isArray(t.children))}(i))s.unshift(i);else for(const[e,n]of Object.entries(i))nl(t,a.properties,e,n)}for(const t of s)rl(a.children,t);return"element"===a.type&&"template"===a.tagName&&(a.content={type:"root",children:a.children},a.children=[]),a}}function nl(t,e,n,r){const i=function(t,e){const n=bo(e);let r=e,i=vo;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&Wo.test(e)){if("-"===e.charAt(4)){const t=e.slice(5).replace(zo,Vo);r="data"+t.charAt(0).toUpperCase()+t.slice(1)}else{const t=e.slice(4);if(!zo.test(t)){let n=t.replace(Ho,Go);"-"!==n.charAt(0)&&(n="-"+n),e="data"+n}}i=No}return new i(r,e)}(t,n);let s;if(null!=r){if("number"==typeof r){if(Number.isNaN(r))return;s=r}else s="boolean"==typeof r?r:"string"==typeof r?i.spaceSeparated?Qo(r):i.commaSeparated?Xo(r):i.commaOrSpaceSeparated?Qo(Xo(r).join(" ")):il(i,i.property,r):Array.isArray(r)?[...r]:"style"===i.property?function(t){const e=[];for(const[n,r]of Object.entries(t))e.push([n,r].join(": "));return e.join("; ")}(r):String(r);if(Array.isArray(s)){const t=[];for(const e of s)t.push(il(i,i.property,e));s=t}"className"===i.property&&Array.isArray(e.className)&&(s=e.className.concat(s)),e[i.property]=s}}function rl(t,e){if(null==e);else if("number"==typeof e||"string"==typeof e)t.push({type:"text",value:String(e)});else if(Array.isArray(e))for(const n of e)rl(t,n);else{if("object"!=typeof e||!("type"in e))throw new Error("Expected node, nodes, or string, got `"+e+"`");"root"===e.type?rl(t,e.children):t.push(e)}}function il(t,e,n){if("string"==typeof n){if(t.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((t.boolean||t.overloadedBoolean)&&(""===n||bo(n)===bo(e)))return!0}return n}var sl=el(Yo,"div"),al=el(Ko,"g",["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","solidColor","textArea","textPath"]),ol=class{constructor(t,e,n){this.normal=e,this.property=t,n&&(this.space=n)}};function ll(t,e){const n={},r={};for(const e of t)Object.assign(n,e.property),Object.assign(r,e.normal);return new ol(n,r,e)}function cl(t){return t.toLowerCase()}ol.prototype.normal={},ol.prototype.property={},ol.prototype.space=void 0;var hl=class{constructor(t,e){this.attribute=e,this.property=t}};hl.prototype.attribute="",hl.prototype.booleanish=!1,hl.prototype.boolean=!1,hl.prototype.commaOrSpaceSeparated=!1,hl.prototype.commaSeparated=!1,hl.prototype.defined=!1,hl.prototype.mustUseProperty=!1,hl.prototype.number=!1,hl.prototype.overloadedBoolean=!1,hl.prototype.property="",hl.prototype.spaceSeparated=!1,hl.prototype.space=void 0;var ul={};p(ul,{boolean:()=>dl,booleanish:()=>pl,commaOrSpaceSeparated:()=>bl,commaSeparated:()=>yl,number:()=>ml,overloadedBoolean:()=>gl,spaceSeparated:()=>wl});var fl=0,dl=vl(),pl=vl(),gl=vl(),ml=vl(),wl=vl(),yl=vl(),bl=vl();function vl(){return 2**++fl}var El=Object.keys(ul),kl=class extends hl{constructor(t,e,n,r){let i=-1;if(super(t,e),Sl(this,"space",r),"number"==typeof n)for(;++i<El.length;){const t=El[i];Sl(this,El[i],(n&ul[t])===ul[t])}}};function Sl(t,e,n){n&&(t[e]=n)}function Tl(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const s=new kl(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[cl(r)]=r,n[cl(s.attribute)]=r}return new ol(e,n,t.space)}kl.prototype.defined=!0;var xl=Tl({properties:{ariaActiveDescendant:null,ariaAtomic:pl,ariaAutoComplete:null,ariaBusy:pl,ariaChecked:pl,ariaColCount:ml,ariaColIndex:ml,ariaColSpan:ml,ariaControls:wl,ariaCurrent:null,ariaDescribedBy:wl,ariaDetails:null,ariaDisabled:pl,ariaDropEffect:wl,ariaErrorMessage:null,ariaExpanded:pl,ariaFlowTo:wl,ariaGrabbed:pl,ariaHasPopup:null,ariaHidden:pl,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:wl,ariaLevel:ml,ariaLive:null,ariaModal:pl,ariaMultiLine:pl,ariaMultiSelectable:pl,ariaOrientation:null,ariaOwns:wl,ariaPlaceholder:null,ariaPosInSet:ml,ariaPressed:pl,ariaReadOnly:pl,ariaRelevant:null,ariaRequired:pl,ariaRoleDescription:wl,ariaRowCount:ml,ariaRowIndex:ml,ariaRowSpan:ml,ariaSelected:pl,ariaSetSize:ml,ariaSort:null,ariaValueMax:ml,ariaValueMin:ml,ariaValueNow:ml,ariaValueText:null,role:null},transform:(t,e)=>"role"===e?e:"aria-"+e.slice(4).toLowerCase()});function Al(t,e){return e in t?t[e]:e}function Cl(t,e){return Al(t,e.toLowerCase())}var Dl=Tl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:yl,acceptCharset:wl,accessKey:wl,action:null,allow:null,allowFullScreen:dl,allowPaymentRequest:dl,allowUserMedia:dl,alt:null,as:null,async:dl,autoCapitalize:null,autoComplete:wl,autoFocus:dl,autoPlay:dl,blocking:wl,capture:null,charSet:null,checked:dl,cite:null,className:wl,cols:ml,colSpan:null,content:null,contentEditable:pl,controls:dl,controlsList:wl,coords:ml|yl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:dl,defer:dl,dir:null,dirName:null,disabled:dl,download:gl,draggable:pl,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:dl,formTarget:null,headers:wl,height:ml,hidden:gl,high:ml,href:null,hrefLang:null,htmlFor:wl,httpEquiv:wl,id:null,imageSizes:null,imageSrcSet:null,inert:dl,inputMode:null,integrity:null,is:null,isMap:dl,itemId:null,itemProp:wl,itemRef:wl,itemScope:dl,itemType:wl,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:dl,low:ml,manifest:null,max:null,maxLength:ml,media:null,method:null,min:null,minLength:ml,multiple:dl,muted:dl,name:null,nonce:null,noModule:dl,noValidate:dl,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:dl,optimum:ml,pattern:null,ping:wl,placeholder:null,playsInline:dl,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:dl,referrerPolicy:null,rel:wl,required:dl,reversed:dl,rows:ml,rowSpan:ml,sandbox:wl,scope:null,scoped:dl,seamless:dl,selected:dl,shadowRootClonable:dl,shadowRootDelegatesFocus:dl,shadowRootMode:null,shape:null,size:ml,sizes:null,slot:null,span:ml,spellCheck:pl,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ml,step:null,style:null,tabIndex:ml,target:null,title:null,translate:null,type:null,typeMustMatch:dl,useMap:null,value:pl,width:ml,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:wl,axis:null,background:null,bgColor:null,border:ml,borderColor:null,bottomMargin:ml,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:dl,declare:dl,event:null,face:null,frame:null,frameBorder:null,hSpace:ml,leftMargin:ml,link:null,longDesc:null,lowSrc:null,marginHeight:ml,marginWidth:ml,noResize:dl,noHref:dl,noShade:dl,noWrap:dl,object:null,profile:null,prompt:null,rev:null,rightMargin:ml,rules:null,scheme:null,scrolling:pl,standby:null,summary:null,text:null,topMargin:ml,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ml,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:dl,disableRemotePlayback:dl,prefix:null,property:null,results:ml,security:null,unselectable:null},space:"html",transform:Cl}),Pl=Tl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:bl,accentHeight:ml,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ml,amplitude:ml,arabicForm:null,ascent:ml,attributeName:null,attributeType:null,azimuth:ml,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ml,by:null,calcMode:null,capHeight:ml,className:wl,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ml,diffuseConstant:ml,direction:null,display:null,dur:null,divisor:ml,dominantBaseline:null,download:dl,dx:null,dy:null,edgeMode:null,editable:null,elevation:ml,enableBackground:null,end:null,event:null,exponent:ml,externalResourcesRequired:null,fill:null,fillOpacity:ml,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:yl,g2:yl,glyphName:yl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ml,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ml,horizOriginX:ml,horizOriginY:ml,id:null,ideographic:ml,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ml,k:ml,k1:ml,k2:ml,k3:ml,k4:ml,kernelMatrix:bl,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ml,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ml,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ml,overlineThickness:ml,paintOrder:null,panose1:null,path:null,pathLength:ml,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:wl,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ml,pointsAtY:ml,pointsAtZ:ml,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bl,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bl,rev:bl,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bl,requiredFeatures:bl,requiredFonts:bl,requiredFormats:bl,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ml,specularExponent:ml,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ml,strikethroughThickness:ml,string:null,stroke:null,strokeDashArray:bl,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ml,strokeOpacity:ml,strokeWidth:null,style:null,surfaceScale:ml,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bl,tabIndex:ml,tableValues:null,target:null,targetX:ml,targetY:ml,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bl,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ml,underlineThickness:ml,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ml,values:null,vAlphabetic:ml,vMathematical:ml,vectorEffect:null,vHanging:ml,vIdeographic:ml,version:null,vertAdvY:ml,vertOriginX:ml,vertOriginY:ml,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ml,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Al}),Ll=Tl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(t,e)=>"xlink:"+e.slice(5).toLowerCase()}),Rl=Tl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Cl}),Nl=Tl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(t,e)=>"xml:"+e.slice(3).toLowerCase()}),_l=/[A-Z]/g,Ol=/-[a-z]/g,Il=/^data[-\w.:]+$/i;function Ml(t,e){const n=cl(e);let r=e,i=hl;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&Il.test(e)){if("-"===e.charAt(4)){const t=e.slice(5).replace(Ol,$l);r="data"+t.charAt(0).toUpperCase()+t.slice(1)}else{const t=e.slice(4);if(!Ol.test(t)){let n=t.replace(_l,Fl);"-"!==n.charAt(0)&&(n="-"+n),e="data"+n}}i=kl}return new i(r,e)}function Fl(t){return"-"+t.toLowerCase()}function $l(t){return t.charAt(1).toUpperCase()}var Ul=ll([xl,Dl,Ll,Rl,Nl],"html"),Bl=ll([xl,Pl,Ll,Rl,Nl],"svg");function ql(t,e){const n=t.indexOf("\r",e),r=t.indexOf("\n",e);return-1===r?n:-1===n||n+1===r?r:n<r?n:r}var jl={}.hasOwnProperty,Hl=Object.prototype;function zl(t,e){let n;switch(e.nodeName){case"#comment":{const r=e;return n={type:"comment",value:r.data},Gl(t,r,n),n}case"#document":case"#document-fragment":{const r=e,i="mode"in r&&("quirks"===r.mode||"limited-quirks"===r.mode);if(n={type:"root",children:Wl(t,e.childNodes),data:{quirksMode:i}},t.file&&t.location){const e=String(t.file),r=function(t){const e=String(t),n=[];return{toOffset:function(t){if(t&&"number"==typeof t.line&&"number"==typeof t.column&&!Number.isNaN(t.line)&&!Number.isNaN(t.column)){for(;n.length<t.line;){const t=n[n.length-1],r=ql(e,t),i=-1===r?e.length+1:r+1;if(t===i)break;n.push(i)}const r=(t.line>1?n[t.line-2]:0)+t.column-1;if(r<n[t.line-1])return r}},toPoint:function(t){if("number"==typeof t&&t>-1&&t<=e.length){let r=0;for(;;){let i=n[r];if(void 0===i){const t=ql(e,n[r-1]);i=-1===t?e.length+1:t+1,n[r]=i}if(i>t)return{line:r+1,column:t-(r>0?n[r-1]:0)+1,offset:t};r++}}}}}(e),i=r.toPoint(0),s=r.toPoint(e.length);n.position={start:i,end:s}}return n}case"#documentType":return n={type:"doctype"},Gl(t,e,n),n;case"#text":{const r=e;return n={type:"text",value:r.value},Gl(t,r,n),n}default:return n=function(t,e){const n=t.schema;t.schema="http://www.w3.org/2000/svg"===e.namespaceURI?Bl:Ul;let r=-1;const i={};for(;++r<e.attrs.length;){const t=e.attrs[r],n=(t.prefix?t.prefix+":":"")+t.name;jl.call(Hl,n)||(i[n]=t.value)}const s=("svg"===t.schema.space?al:sl)(e.tagName,i,Wl(t,e.childNodes));if(Gl(t,e,s),"template"===s.tagName){const n=e,r=n.sourceCodeLocation,i=r&&r.startTag&&Vl(r.startTag),a=r&&r.endTag&&Vl(r.endTag),o=zl(t,n.content);i&&a&&t.file&&(o.position={start:i.end,end:a.start}),s.content=o}return t.schema=n,s}(t,e),n}}function Wl(t,e){let n=-1;const r=[];for(;++n<e.length;){const i=zl(t,e[n]);r.push(i)}return r}function Gl(t,e,n){if("sourceCodeLocation"in e&&e.sourceCodeLocation&&t.file){const r=function(t,e,n){const r=Vl(n);if("element"===e.type){const i=e.children[e.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),t.verbose){const r={};let i;if(n.attrs)for(i in n.attrs)jl.call(n.attrs,i)&&(r[Ml(t.schema,i).property]=Vl(n.attrs[i]));n.startTag;const s=Vl(n.startTag),a=n.endTag?Vl(n.endTag):void 0,o={opening:s};a&&(o.closing=a),o.properties=r,e.data={position:o}}}return r}(t,n,e.sourceCodeLocation);r&&(t.location=!0,n.position=r)}}function Vl(t){const e=Yl({line:t.startLine,column:t.startCol,offset:t.startOffset}),n=Yl({line:t.endLine,column:t.endCol,offset:t.endOffset});return e||n?{start:e,end:n}:void 0}function Yl(t){return t.line&&t.column?t:void 0}var Kl,Xl,Zl=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Jl="�";(Xl=Kl||(Kl={}))[Xl.EOF=-1]="EOF",Xl[Xl.NULL=0]="NULL",Xl[Xl.TABULATION=9]="TABULATION",Xl[Xl.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",Xl[Xl.LINE_FEED=10]="LINE_FEED",Xl[Xl.FORM_FEED=12]="FORM_FEED",Xl[Xl.SPACE=32]="SPACE",Xl[Xl.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",Xl[Xl.QUOTATION_MARK=34]="QUOTATION_MARK",Xl[Xl.AMPERSAND=38]="AMPERSAND",Xl[Xl.APOSTROPHE=39]="APOSTROPHE",Xl[Xl.HYPHEN_MINUS=45]="HYPHEN_MINUS",Xl[Xl.SOLIDUS=47]="SOLIDUS",Xl[Xl.DIGIT_0=48]="DIGIT_0",Xl[Xl.DIGIT_9=57]="DIGIT_9",Xl[Xl.SEMICOLON=59]="SEMICOLON",Xl[Xl.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",Xl[Xl.EQUALS_SIGN=61]="EQUALS_SIGN",Xl[Xl.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",Xl[Xl.QUESTION_MARK=63]="QUESTION_MARK",Xl[Xl.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",Xl[Xl.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",Xl[Xl.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",Xl[Xl.GRAVE_ACCENT=96]="GRAVE_ACCENT",Xl[Xl.LATIN_SMALL_A=97]="LATIN_SMALL_A",Xl[Xl.LATIN_SMALL_Z=122]="LATIN_SMALL_Z";var Ql,tc,ec="script";function nc(t){return t>=55296&&t<=57343}function rc(t){return 32!==t&&10!==t&&13!==t&&9!==t&&12!==t&&t>=1&&t<=31||t>=127&&t<=159}function ic(t){return t>=64976&&t<=65007||Zl.has(t)}(tc=Ql||(Ql={})).controlCharacterInInputStream="control-character-in-input-stream",tc.noncharacterInInputStream="noncharacter-in-input-stream",tc.surrogateInInputStream="surrogate-in-input-stream",tc.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",tc.endTagWithAttributes="end-tag-with-attributes",tc.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",tc.unexpectedSolidusInTag="unexpected-solidus-in-tag",tc.unexpectedNullCharacter="unexpected-null-character",tc.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",tc.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",tc.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",tc.missingEndTagName="missing-end-tag-name",tc.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",tc.unknownNamedCharacterReference="unknown-named-character-reference",tc.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",tc.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",tc.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",tc.eofBeforeTagName="eof-before-tag-name",tc.eofInTag="eof-in-tag",tc.missingAttributeValue="missing-attribute-value",tc.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",tc.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",tc.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",tc.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",tc.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",tc.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",tc.missingDoctypePublicIdentifier="missing-doctype-public-identifier",tc.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",tc.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",tc.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",tc.cdataInHtmlContent="cdata-in-html-content",tc.incorrectlyOpenedComment="incorrectly-opened-comment",tc.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",tc.eofInDoctype="eof-in-doctype",tc.nestedComment="nested-comment",tc.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",tc.eofInComment="eof-in-comment",tc.incorrectlyClosedComment="incorrectly-closed-comment",tc.eofInCdata="eof-in-cdata",tc.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",tc.nullCharacterReference="null-character-reference",tc.surrogateCharacterReference="surrogate-character-reference",tc.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",tc.controlCharacterReference="control-character-reference",tc.noncharacterCharacterReference="noncharacter-character-reference",tc.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",tc.missingDoctypeName="missing-doctype-name",tc.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",tc.duplicateAttribute="duplicate-attribute",tc.nonConformingDoctype="non-conforming-doctype",tc.missingDoctype="missing-doctype",tc.misplacedDoctype="misplaced-doctype",tc.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",tc.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",tc.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",tc.openElementsLeftAfterEof="open-elements-left-after-eof",tc.abandonedHeadElementChild="abandoned-head-element-child",tc.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",tc.nestedNoscriptInHead="nested-noscript-in-head",tc.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text";var sc,ac,oc=class{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=65536,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,e){const{line:n,col:r,offset:i}=this,s=r+e,a=i+e;return{code:t,startLine:n,endLine:n,startCol:s,endCol:s,startOffset:a,endOffset:a}}Et(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}kt(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}St(t){if(this.pos!==this.html.length-1){const e=this.html.charCodeAt(this.pos+1);if(function(t){return t>=56320&&t<=57343}(e))return this.pos++,this.kt(),1024*(t-55296)+9216+e}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,Kl.EOF;return this.Et(Ql.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,e){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=e}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,e){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(e)return this.html.startsWith(t,this.pos);for(let e=0;e<t.length;e++)if((32|this.html.charCodeAt(this.pos+e))!==t.charCodeAt(e))return!1;return!0}peek(t){const e=this.pos+t;if(e>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Kl.EOF;const n=this.html.charCodeAt(e);return n===Kl.CARRIAGE_RETURN?Kl.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Kl.EOF;let t=this.html.charCodeAt(this.pos);return t===Kl.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,Kl.LINE_FEED):t===Kl.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this.kt(),this.advance()):(this.skipNextNewLine=!1,nc(t)&&(t=this.St(t)),null===this.handler.onParseError||t>31&&t<127||t===Kl.LINE_FEED||t===Kl.CARRIAGE_RETURN||t>159&&t<64976||this.Tt(t),t)}Tt(t){rc(t)?this.Et(Ql.controlCharacterInInputStream):ic(t)&&this.Et(Ql.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}};function lc(t,e){for(let n=t.attrs.length-1;n>=0;n--)if(t.attrs[n].name===e)return t.attrs[n].value;return null}(ac=sc||(sc={}))[ac.CHARACTER=0]="CHARACTER",ac[ac.NULL_CHARACTER=1]="NULL_CHARACTER",ac[ac.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",ac[ac.START_TAG=3]="START_TAG",ac[ac.END_TAG=4]="END_TAG",ac[ac.COMMENT=5]="COMMENT",ac[ac.DOCTYPE=6]="DOCTYPE",ac[ac.EOF=7]="EOF",ac[ac.HIBERNATION=8]="HIBERNATION";var cc,hc,uc,fc,dc,pc,gc,mc,wc=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),yc=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]]);function bc(t){return t>=cc.ZERO&&t<=cc.NINE}function vc(t){return t>=cc.UPPER_A&&t<=cc.UPPER_F||t>=cc.LOWER_A&&t<=cc.LOWER_F}function Ec(t){return t===cc.EQUALS||function(t){return t>=cc.UPPER_A&&t<=cc.UPPER_Z||t>=cc.LOWER_A&&t<=cc.LOWER_Z||bc(t)}(t)}String.fromCodePoint,(hc=cc||(cc={}))[hc.NUM=35]="NUM",hc[hc.SEMI=59]="SEMI",hc[hc.EQUALS=61]="EQUALS",hc[hc.ZERO=48]="ZERO",hc[hc.NINE=57]="NINE",hc[hc.LOWER_A=97]="LOWER_A",hc[hc.LOWER_F=102]="LOWER_F",hc[hc.LOWER_X=120]="LOWER_X",hc[hc.LOWER_Z=122]="LOWER_Z",hc[hc.UPPER_A=65]="UPPER_A",hc[hc.UPPER_F=70]="UPPER_F",hc[hc.UPPER_Z=90]="UPPER_Z",(fc=uc||(uc={}))[fc.VALUE_LENGTH=49152]="VALUE_LENGTH",fc[fc.BRANCH_LENGTH=16256]="BRANCH_LENGTH",fc[fc.JUMP_TABLE=127]="JUMP_TABLE",(pc=dc||(dc={}))[pc.EntityStart=0]="EntityStart",pc[pc.NumericStart=1]="NumericStart",pc[pc.NumericDecimal=2]="NumericDecimal",pc[pc.NumericHex=3]="NumericHex",pc[pc.NamedEntity=4]="NamedEntity",(mc=gc||(gc={}))[mc.Legacy=0]="Legacy",mc[mc.Strict=1]="Strict",mc[mc.Attribute=2]="Attribute";var kc,Sc,Tc,xc,Ac,Cc,Dc,Pc,Lc,Rc,Nc=class{constructor(t,e,n){this.decodeTree=t,this.emitCodePoint=e,this.errors=n,this.state=dc.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=gc.Strict}startEntity(t){this.decodeMode=t,this.state=dc.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,e){switch(this.state){case dc.EntityStart:return t.charCodeAt(e)===cc.NUM?(this.state=dc.NumericStart,this.consumed+=1,this.stateNumericStart(t,e+1)):(this.state=dc.NamedEntity,this.stateNamedEntity(t,e));case dc.NumericStart:return this.stateNumericStart(t,e);case dc.NumericDecimal:return this.stateNumericDecimal(t,e);case dc.NumericHex:return this.stateNumericHex(t,e);case dc.NamedEntity:return this.stateNamedEntity(t,e)}}stateNumericStart(t,e){return e>=t.length?-1:(32|t.charCodeAt(e))===cc.LOWER_X?(this.state=dc.NumericHex,this.consumed+=1,this.stateNumericHex(t,e+1)):(this.state=dc.NumericDecimal,this.stateNumericDecimal(t,e))}addToNumericResult(t,e,n,r){if(e!==n){const i=n-e;this.result=this.result*Math.pow(r,i)+Number.parseInt(t.substr(e,i),r),this.consumed+=i}}stateNumericHex(t,e){const n=e;for(;e<t.length;){const r=t.charCodeAt(e);if(!bc(r)&&!vc(r))return this.addToNumericResult(t,n,e,16),this.emitNumericEntity(r,3);e+=1}return this.addToNumericResult(t,n,e,16),-1}stateNumericDecimal(t,e){const n=e;for(;e<t.length;){const r=t.charCodeAt(e);if(!bc(r))return this.addToNumericResult(t,n,e,10),this.emitNumericEntity(r,2);e+=1}return this.addToNumericResult(t,n,e,10),-1}emitNumericEntity(t,e){var n;if(this.consumed<=e)return null===(n=this.errors)||void 0===n||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===cc.SEMI)this.consumed+=1;else if(this.decodeMode===gc.Strict)return 0;return this.emitCodePoint(function(t){var e;return t>=55296&&t<=57343||t>1114111?65533:null!==(e=yc.get(t))&&void 0!==e?e:t}(this.result),this.consumed),this.errors&&(t!==cc.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,e){const{decodeTree:n}=this;let r=n[this.treeIndex],i=(r&uc.VALUE_LENGTH)>>14;for(;e<t.length;e++,this.excess++){const s=t.charCodeAt(e);if(this.treeIndex=_c(n,r,this.treeIndex+Math.max(1,i),s),this.treeIndex<0)return 0===this.result||this.decodeMode===gc.Attribute&&(0===i||Ec(s))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&uc.VALUE_LENGTH)>>14,0!==i){if(s===cc.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==gc.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:e,decodeTree:n}=this,r=(n[e]&uc.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,r,this.consumed),null===(t=this.errors)||void 0===t||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,e,n){const{decodeTree:r}=this;return this.emitCodePoint(1===e?r[t]&~uc.VALUE_LENGTH:r[t+1],n),3===e&&this.emitCodePoint(r[t+2],n),n}end(){var t;switch(this.state){case dc.NamedEntity:return 0===this.result||this.decodeMode===gc.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case dc.NumericDecimal:return this.emitNumericEntity(0,2);case dc.NumericHex:return this.emitNumericEntity(0,3);case dc.NumericStart:return null===(t=this.errors)||void 0===t||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case dc.EntityStart:return 0}}};function _c(t,e,n,r){const i=(e&uc.BRANCH_LENGTH)>>7,s=e&uc.JUMP_TABLE;if(0===i)return 0!==s&&r===s?n:-1;if(s){const e=r-s;return e<0||e>=i?-1:t[n+e]-1}let a=n,o=a+i-1;for(;a<=o;){const e=a+o>>>1,n=t[e];if(n<r)a=e+1;else{if(!(n>r))return t[e+i];o=e-1}}return-1}(Sc=kc||(kc={})).HTML="http://www.w3.org/1999/xhtml",Sc.MATHML="http://www.w3.org/1998/Math/MathML",Sc.SVG="http://www.w3.org/2000/svg",Sc.XLINK="http://www.w3.org/1999/xlink",Sc.XML="http://www.w3.org/XML/1998/namespace",Sc.XMLNS="http://www.w3.org/2000/xmlns/",(xc=Tc||(Tc={})).TYPE="type",xc.ACTION="action",xc.ENCODING="encoding",xc.PROMPT="prompt",xc.NAME="name",xc.COLOR="color",xc.FACE="face",xc.SIZE="size",(Cc=Ac||(Ac={})).NO_QUIRKS="no-quirks",Cc.QUIRKS="quirks",Cc.LIMITED_QUIRKS="limited-quirks",(Pc=Dc||(Dc={})).A="a",Pc.ADDRESS="address",Pc.ANNOTATION_XML="annotation-xml",Pc.APPLET="applet",Pc.AREA="area",Pc.ARTICLE="article",Pc.ASIDE="aside",Pc.B="b",Pc.BASE="base",Pc.BASEFONT="basefont",Pc.BGSOUND="bgsound",Pc.BIG="big",Pc.BLOCKQUOTE="blockquote",Pc.BODY="body",Pc.BR="br",Pc.BUTTON="button",Pc.CAPTION="caption",Pc.CENTER="center",Pc.CODE="code",Pc.COL="col",Pc.COLGROUP="colgroup",Pc.DD="dd",Pc.DESC="desc",Pc.DETAILS="details",Pc.DIALOG="dialog",Pc.DIR="dir",Pc.DIV="div",Pc.DL="dl",Pc.DT="dt",Pc.EM="em",Pc.EMBED="embed",Pc.FIELDSET="fieldset",Pc.FIGCAPTION="figcaption",Pc.FIGURE="figure",Pc.FONT="font",Pc.FOOTER="footer",Pc.FOREIGN_OBJECT="foreignObject",Pc.FORM="form",Pc.FRAME="frame",Pc.FRAMESET="frameset",Pc.H1="h1",Pc.H2="h2",Pc.H3="h3",Pc.H4="h4",Pc.H5="h5",Pc.H6="h6",Pc.HEAD="head",Pc.HEADER="header",Pc.HGROUP="hgroup",Pc.HR="hr",Pc.HTML="html",Pc.I="i",Pc.IMG="img",Pc.IMAGE="image",Pc.INPUT="input",Pc.IFRAME="iframe",Pc.KEYGEN="keygen",Pc.LABEL="label",Pc.LI="li",Pc.LINK="link",Pc.LISTING="listing",Pc.MAIN="main",Pc.MALIGNMARK="malignmark",Pc.MARQUEE="marquee",Pc.MATH="math",Pc.MENU="menu",Pc.META="meta",Pc.MGLYPH="mglyph",Pc.MI="mi",Pc.MO="mo",Pc.MN="mn",Pc.MS="ms",Pc.MTEXT="mtext",Pc.NAV="nav",Pc.NOBR="nobr",Pc.NOFRAMES="noframes",Pc.NOEMBED="noembed",Pc.NOSCRIPT="noscript",Pc.OBJECT="object",Pc.OL="ol",Pc.OPTGROUP="optgroup",Pc.OPTION="option",Pc.P="p",Pc.PARAM="param",Pc.PLAINTEXT="plaintext",Pc.PRE="pre",Pc.RB="rb",Pc.RP="rp",Pc.RT="rt",Pc.RTC="rtc",Pc.RUBY="ruby",Pc.S="s",Pc.SCRIPT="script",Pc.SEARCH="search",Pc.SECTION="section",Pc.SELECT="select",Pc.SOURCE="source",Pc.SMALL="small",Pc.SPAN="span",Pc.STRIKE="strike",Pc.STRONG="strong",Pc.STYLE="style",Pc.SUB="sub",Pc.SUMMARY="summary",Pc.SUP="sup",Pc.TABLE="table",Pc.TBODY="tbody",Pc.TEMPLATE="template",Pc.TEXTAREA="textarea",Pc.TFOOT="tfoot",Pc.TD="td",Pc.TH="th",Pc.THEAD="thead",Pc.TITLE="title",Pc.TR="tr",Pc.TRACK="track",Pc.TT="tt",Pc.U="u",Pc.UL="ul",Pc.SVG="svg",Pc.VAR="var",Pc.WBR="wbr",Pc.XMP="xmp",(Rc=Lc||(Lc={}))[Rc.UNKNOWN=0]="UNKNOWN",Rc[Rc.A=1]="A",Rc[Rc.ADDRESS=2]="ADDRESS",Rc[Rc.ANNOTATION_XML=3]="ANNOTATION_XML",Rc[Rc.APPLET=4]="APPLET",Rc[Rc.AREA=5]="AREA",Rc[Rc.ARTICLE=6]="ARTICLE",Rc[Rc.ASIDE=7]="ASIDE",Rc[Rc.B=8]="B",Rc[Rc.BASE=9]="BASE",Rc[Rc.BASEFONT=10]="BASEFONT",Rc[Rc.BGSOUND=11]="BGSOUND",Rc[Rc.BIG=12]="BIG",Rc[Rc.BLOCKQUOTE=13]="BLOCKQUOTE",Rc[Rc.BODY=14]="BODY",Rc[Rc.BR=15]="BR",Rc[Rc.BUTTON=16]="BUTTON",Rc[Rc.CAPTION=17]="CAPTION",Rc[Rc.CENTER=18]="CENTER",Rc[Rc.CODE=19]="CODE",Rc[Rc.COL=20]="COL",Rc[Rc.COLGROUP=21]="COLGROUP",Rc[Rc.DD=22]="DD",Rc[Rc.DESC=23]="DESC",Rc[Rc.DETAILS=24]="DETAILS",Rc[Rc.DIALOG=25]="DIALOG",Rc[Rc.DIR=26]="DIR",Rc[Rc.DIV=27]="DIV",Rc[Rc.DL=28]="DL",Rc[Rc.DT=29]="DT",Rc[Rc.EM=30]="EM",Rc[Rc.EMBED=31]="EMBED",Rc[Rc.FIELDSET=32]="FIELDSET",Rc[Rc.FIGCAPTION=33]="FIGCAPTION",Rc[Rc.FIGURE=34]="FIGURE",Rc[Rc.FONT=35]="FONT",Rc[Rc.FOOTER=36]="FOOTER",Rc[Rc.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",Rc[Rc.FORM=38]="FORM",Rc[Rc.FRAME=39]="FRAME",Rc[Rc.FRAMESET=40]="FRAMESET",Rc[Rc.H1=41]="H1",Rc[Rc.H2=42]="H2",Rc[Rc.H3=43]="H3",Rc[Rc.H4=44]="H4",Rc[Rc.H5=45]="H5",Rc[Rc.H6=46]="H6",Rc[Rc.HEAD=47]="HEAD",Rc[Rc.HEADER=48]="HEADER",Rc[Rc.HGROUP=49]="HGROUP",Rc[Rc.HR=50]="HR",Rc[Rc.HTML=51]="HTML",Rc[Rc.I=52]="I",Rc[Rc.IMG=53]="IMG",Rc[Rc.IMAGE=54]="IMAGE",Rc[Rc.INPUT=55]="INPUT",Rc[Rc.IFRAME=56]="IFRAME",Rc[Rc.KEYGEN=57]="KEYGEN",Rc[Rc.LABEL=58]="LABEL",Rc[Rc.LI=59]="LI",Rc[Rc.LINK=60]="LINK",Rc[Rc.LISTING=61]="LISTING",Rc[Rc.MAIN=62]="MAIN",Rc[Rc.MALIGNMARK=63]="MALIGNMARK",Rc[Rc.MARQUEE=64]="MARQUEE",Rc[Rc.MATH=65]="MATH",Rc[Rc.MENU=66]="MENU",Rc[Rc.META=67]="META",Rc[Rc.MGLYPH=68]="MGLYPH",Rc[Rc.MI=69]="MI",Rc[Rc.MO=70]="MO",Rc[Rc.MN=71]="MN",Rc[Rc.MS=72]="MS",Rc[Rc.MTEXT=73]="MTEXT",Rc[Rc.NAV=74]="NAV",Rc[Rc.NOBR=75]="NOBR",Rc[Rc.NOFRAMES=76]="NOFRAMES",Rc[Rc.NOEMBED=77]="NOEMBED",Rc[Rc.NOSCRIPT=78]="NOSCRIPT",Rc[Rc.OBJECT=79]="OBJECT",Rc[Rc.OL=80]="OL",Rc[Rc.OPTGROUP=81]="OPTGROUP",Rc[Rc.OPTION=82]="OPTION",Rc[Rc.P=83]="P",Rc[Rc.PARAM=84]="PARAM",Rc[Rc.PLAINTEXT=85]="PLAINTEXT",Rc[Rc.PRE=86]="PRE",Rc[Rc.RB=87]="RB",Rc[Rc.RP=88]="RP",Rc[Rc.RT=89]="RT",Rc[Rc.RTC=90]="RTC",Rc[Rc.RUBY=91]="RUBY",Rc[Rc.S=92]="S",Rc[Rc.SCRIPT=93]="SCRIPT",Rc[Rc.SEARCH=94]="SEARCH",Rc[Rc.SECTION=95]="SECTION",Rc[Rc.SELECT=96]="SELECT",Rc[Rc.SOURCE=97]="SOURCE",Rc[Rc.SMALL=98]="SMALL",Rc[Rc.SPAN=99]="SPAN",Rc[Rc.STRIKE=100]="STRIKE",Rc[Rc.STRONG=101]="STRONG",Rc[Rc.STYLE=102]="STYLE",Rc[Rc.SUB=103]="SUB",Rc[Rc.SUMMARY=104]="SUMMARY",Rc[Rc.SUP=105]="SUP",Rc[Rc.TABLE=106]="TABLE",Rc[Rc.TBODY=107]="TBODY",Rc[Rc.TEMPLATE=108]="TEMPLATE",Rc[Rc.TEXTAREA=109]="TEXTAREA",Rc[Rc.TFOOT=110]="TFOOT",Rc[Rc.TD=111]="TD",Rc[Rc.TH=112]="TH",Rc[Rc.THEAD=113]="THEAD",Rc[Rc.TITLE=114]="TITLE",Rc[Rc.TR=115]="TR",Rc[Rc.TRACK=116]="TRACK",Rc[Rc.TT=117]="TT",Rc[Rc.U=118]="U",Rc[Rc.UL=119]="UL",Rc[Rc.SVG=120]="SVG",Rc[Rc.VAR=121]="VAR",Rc[Rc.WBR=122]="WBR",Rc[Rc.XMP=123]="XMP";var Oc=new Map([[Dc.A,Lc.A],[Dc.ADDRESS,Lc.ADDRESS],[Dc.ANNOTATION_XML,Lc.ANNOTATION_XML],[Dc.APPLET,Lc.APPLET],[Dc.AREA,Lc.AREA],[Dc.ARTICLE,Lc.ARTICLE],[Dc.ASIDE,Lc.ASIDE],[Dc.B,Lc.B],[Dc.BASE,Lc.BASE],[Dc.BASEFONT,Lc.BASEFONT],[Dc.BGSOUND,Lc.BGSOUND],[Dc.BIG,Lc.BIG],[Dc.BLOCKQUOTE,Lc.BLOCKQUOTE],[Dc.BODY,Lc.BODY],[Dc.BR,Lc.BR],[Dc.BUTTON,Lc.BUTTON],[Dc.CAPTION,Lc.CAPTION],[Dc.CENTER,Lc.CENTER],[Dc.CODE,Lc.CODE],[Dc.COL,Lc.COL],[Dc.COLGROUP,Lc.COLGROUP],[Dc.DD,Lc.DD],[Dc.DESC,Lc.DESC],[Dc.DETAILS,Lc.DETAILS],[Dc.DIALOG,Lc.DIALOG],[Dc.DIR,Lc.DIR],[Dc.DIV,Lc.DIV],[Dc.DL,Lc.DL],[Dc.DT,Lc.DT],[Dc.EM,Lc.EM],[Dc.EMBED,Lc.EMBED],[Dc.FIELDSET,Lc.FIELDSET],[Dc.FIGCAPTION,Lc.FIGCAPTION],[Dc.FIGURE,Lc.FIGURE],[Dc.FONT,Lc.FONT],[Dc.FOOTER,Lc.FOOTER],[Dc.FOREIGN_OBJECT,Lc.FOREIGN_OBJECT],[Dc.FORM,Lc.FORM],[Dc.FRAME,Lc.FRAME],[Dc.FRAMESET,Lc.FRAMESET],[Dc.H1,Lc.H1],[Dc.H2,Lc.H2],[Dc.H3,Lc.H3],[Dc.H4,Lc.H4],[Dc.H5,Lc.H5],[Dc.H6,Lc.H6],[Dc.HEAD,Lc.HEAD],[Dc.HEADER,Lc.HEADER],[Dc.HGROUP,Lc.HGROUP],[Dc.HR,Lc.HR],[Dc.HTML,Lc.HTML],[Dc.I,Lc.I],[Dc.IMG,Lc.IMG],[Dc.IMAGE,Lc.IMAGE],[Dc.INPUT,Lc.INPUT],[Dc.IFRAME,Lc.IFRAME],[Dc.KEYGEN,Lc.KEYGEN],[Dc.LABEL,Lc.LABEL],[Dc.LI,Lc.LI],[Dc.LINK,Lc.LINK],[Dc.LISTING,Lc.LISTING],[Dc.MAIN,Lc.MAIN],[Dc.MALIGNMARK,Lc.MALIGNMARK],[Dc.MARQUEE,Lc.MARQUEE],[Dc.MATH,Lc.MATH],[Dc.MENU,Lc.MENU],[Dc.META,Lc.META],[Dc.MGLYPH,Lc.MGLYPH],[Dc.MI,Lc.MI],[Dc.MO,Lc.MO],[Dc.MN,Lc.MN],[Dc.MS,Lc.MS],[Dc.MTEXT,Lc.MTEXT],[Dc.NAV,Lc.NAV],[Dc.NOBR,Lc.NOBR],[Dc.NOFRAMES,Lc.NOFRAMES],[Dc.NOEMBED,Lc.NOEMBED],[Dc.NOSCRIPT,Lc.NOSCRIPT],[Dc.OBJECT,Lc.OBJECT],[Dc.OL,Lc.OL],[Dc.OPTGROUP,Lc.OPTGROUP],[Dc.OPTION,Lc.OPTION],[Dc.P,Lc.P],[Dc.PARAM,Lc.PARAM],[Dc.PLAINTEXT,Lc.PLAINTEXT],[Dc.PRE,Lc.PRE],[Dc.RB,Lc.RB],[Dc.RP,Lc.RP],[Dc.RT,Lc.RT],[Dc.RTC,Lc.RTC],[Dc.RUBY,Lc.RUBY],[Dc.S,Lc.S],[Dc.SCRIPT,Lc.SCRIPT],[Dc.SEARCH,Lc.SEARCH],[Dc.SECTION,Lc.SECTION],[Dc.SELECT,Lc.SELECT],[Dc.SOURCE,Lc.SOURCE],[Dc.SMALL,Lc.SMALL],[Dc.SPAN,Lc.SPAN],[Dc.STRIKE,Lc.STRIKE],[Dc.STRONG,Lc.STRONG],[Dc.STYLE,Lc.STYLE],[Dc.SUB,Lc.SUB],[Dc.SUMMARY,Lc.SUMMARY],[Dc.SUP,Lc.SUP],[Dc.TABLE,Lc.TABLE],[Dc.TBODY,Lc.TBODY],[Dc.TEMPLATE,Lc.TEMPLATE],[Dc.TEXTAREA,Lc.TEXTAREA],[Dc.TFOOT,Lc.TFOOT],[Dc.TD,Lc.TD],[Dc.TH,Lc.TH],[Dc.THEAD,Lc.THEAD],[Dc.TITLE,Lc.TITLE],[Dc.TR,Lc.TR],[Dc.TRACK,Lc.TRACK],[Dc.TT,Lc.TT],[Dc.U,Lc.U],[Dc.UL,Lc.UL],[Dc.SVG,Lc.SVG],[Dc.VAR,Lc.VAR],[Dc.WBR,Lc.WBR],[Dc.XMP,Lc.XMP]]);function Ic(t){var e;return null!==(e=Oc.get(t))&&void 0!==e?e:Lc.UNKNOWN}var Mc,Fc,$c=Lc,Uc={[kc.HTML]:new Set([$c.ADDRESS,$c.APPLET,$c.AREA,$c.ARTICLE,$c.ASIDE,$c.BASE,$c.BASEFONT,$c.BGSOUND,$c.BLOCKQUOTE,$c.BODY,$c.BR,$c.BUTTON,$c.CAPTION,$c.CENTER,$c.COL,$c.COLGROUP,$c.DD,$c.DETAILS,$c.DIR,$c.DIV,$c.DL,$c.DT,$c.EMBED,$c.FIELDSET,$c.FIGCAPTION,$c.FIGURE,$c.FOOTER,$c.FORM,$c.FRAME,$c.FRAMESET,$c.H1,$c.H2,$c.H3,$c.H4,$c.H5,$c.H6,$c.HEAD,$c.HEADER,$c.HGROUP,$c.HR,$c.HTML,$c.IFRAME,$c.IMG,$c.INPUT,$c.LI,$c.LINK,$c.LISTING,$c.MAIN,$c.MARQUEE,$c.MENU,$c.META,$c.NAV,$c.NOEMBED,$c.NOFRAMES,$c.NOSCRIPT,$c.OBJECT,$c.OL,$c.P,$c.PARAM,$c.PLAINTEXT,$c.PRE,$c.SCRIPT,$c.SECTION,$c.SELECT,$c.SOURCE,$c.STYLE,$c.SUMMARY,$c.TABLE,$c.TBODY,$c.TD,$c.TEMPLATE,$c.TEXTAREA,$c.TFOOT,$c.TH,$c.THEAD,$c.TITLE,$c.TR,$c.TRACK,$c.UL,$c.WBR,$c.XMP]),[kc.MATHML]:new Set([$c.MI,$c.MO,$c.MN,$c.MS,$c.MTEXT,$c.ANNOTATION_XML]),[kc.SVG]:new Set([$c.TITLE,$c.FOREIGN_OBJECT,$c.DESC]),[kc.XLINK]:new Set,[kc.XML]:new Set,[kc.XMLNS]:new Set},Bc=new Set([$c.H1,$c.H2,$c.H3,$c.H4,$c.H5,$c.H6]);Dc.STYLE,Dc.SCRIPT,Dc.XMP,Dc.IFRAME,Dc.NOEMBED,Dc.NOFRAMES,Dc.PLAINTEXT,(Fc=Mc||(Mc={}))[Fc.DATA=0]="DATA",Fc[Fc.RCDATA=1]="RCDATA",Fc[Fc.RAWTEXT=2]="RAWTEXT",Fc[Fc.SCRIPT_DATA=3]="SCRIPT_DATA",Fc[Fc.PLAINTEXT=4]="PLAINTEXT",Fc[Fc.TAG_OPEN=5]="TAG_OPEN",Fc[Fc.END_TAG_OPEN=6]="END_TAG_OPEN",Fc[Fc.TAG_NAME=7]="TAG_NAME",Fc[Fc.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",Fc[Fc.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",Fc[Fc.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",Fc[Fc.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",Fc[Fc.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",Fc[Fc.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",Fc[Fc.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",Fc[Fc.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",Fc[Fc.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",Fc[Fc.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",Fc[Fc.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",Fc[Fc.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",Fc[Fc.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",Fc[Fc.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",Fc[Fc.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",Fc[Fc.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",Fc[Fc.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",Fc[Fc.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",Fc[Fc.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",Fc[Fc.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",Fc[Fc.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",Fc[Fc.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",Fc[Fc.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",Fc[Fc.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",Fc[Fc.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",Fc[Fc.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",Fc[Fc.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",Fc[Fc.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",Fc[Fc.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",Fc[Fc.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",Fc[Fc.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",Fc[Fc.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",Fc[Fc.BOGUS_COMMENT=40]="BOGUS_COMMENT",Fc[Fc.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",Fc[Fc.COMMENT_START=42]="COMMENT_START",Fc[Fc.COMMENT_START_DASH=43]="COMMENT_START_DASH",Fc[Fc.COMMENT=44]="COMMENT",Fc[Fc.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",Fc[Fc.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",Fc[Fc.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",Fc[Fc.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",Fc[Fc.COMMENT_END_DASH=49]="COMMENT_END_DASH",Fc[Fc.COMMENT_END=50]="COMMENT_END",Fc[Fc.COMMENT_END_BANG=51]="COMMENT_END_BANG",Fc[Fc.DOCTYPE=52]="DOCTYPE",Fc[Fc.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",Fc[Fc.DOCTYPE_NAME=54]="DOCTYPE_NAME",Fc[Fc.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",Fc[Fc.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",Fc[Fc.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",Fc[Fc.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",Fc[Fc.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",Fc[Fc.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",Fc[Fc.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",Fc[Fc.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",Fc[Fc.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",Fc[Fc.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",Fc[Fc.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",Fc[Fc.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",Fc[Fc.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",Fc[Fc.CDATA_SECTION=68]="CDATA_SECTION",Fc[Fc.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",Fc[Fc.CDATA_SECTION_END=70]="CDATA_SECTION_END",Fc[Fc.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",Fc[Fc.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND";var qc={DATA:Mc.DATA,RCDATA:Mc.RCDATA,RAWTEXT:Mc.RAWTEXT,SCRIPT_DATA:Mc.SCRIPT_DATA,PLAINTEXT:Mc.PLAINTEXT,CDATA_SECTION:Mc.CDATA_SECTION};function jc(t){return t>=Kl.LATIN_CAPITAL_A&&t<=Kl.LATIN_CAPITAL_Z}function Hc(t){return function(t){return t>=Kl.LATIN_SMALL_A&&t<=Kl.LATIN_SMALL_Z}(t)||jc(t)}function zc(t){return Hc(t)||function(t){return t>=Kl.DIGIT_0&&t<=Kl.DIGIT_9}(t)}function Wc(t){return t+32}function Gc(t){return t===Kl.SPACE||t===Kl.LINE_FEED||t===Kl.TABULATION||t===Kl.FORM_FEED}function Vc(t){return Gc(t)||t===Kl.SOLIDUS||t===Kl.GREATER_THAN_SIGN}var Yc,Kc,Xc=class{constructor(t,e){this.options=t,this.handler=e,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=Mc.DATA,this.returnState=Mc.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new oc(e),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Nc(wc,(t,e)=>{this.preprocessor.pos=this.entityStartPos+e-1,this.xt(t)},e.onParseError?{missingSemicolonAfterCharacterReference:()=>{this.Et(Ql.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:t=>{this.Et(Ql.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+t)},validateNumericCharacterReference:t=>{const e=function(t){return t===Kl.NULL?Ql.nullCharacterReference:t>1114111?Ql.characterReferenceOutsideUnicodeRange:nc(t)?Ql.surrogateCharacterReference:ic(t)?Ql.noncharacterCharacterReference:rc(t)||t===Kl.CARRIAGE_RETURN?Ql.controlCharacterReference:null}(t);e&&this.Et(e,1)}}:void 0)}Et(t,e=0){var n,r;null===(r=(n=this.handler).onParseError)||void 0===r||r.call(n,this.preprocessor.getError(t,e))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}At(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this.Ct();this.Dt()||this.Pt(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,this.inLoop||(this.At(),this.paused||null==t||t())}write(t,e,n){this.active=!0,this.preprocessor.write(t,e),this.At(),this.paused||null==n||n()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this.At()}Dt(){return!!this.preprocessor.endOfChunkHit&&(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0)}Ct(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}Lt(t){this.consumedAfterSnapshot+=t;for(let e=0;e<t;e++)this.preprocessor.advance()}Rt(t,e){return!!this.preprocessor.startsWith(t,e)&&(this.Lt(t.length-1),!0)}Nt(){this.currentToken={type:sc.START_TAG,tagName:"",tagID:Lc.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_t(){this.currentToken={type:sc.END_TAG,tagName:"",tagID:Lc.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}Ot(t){this.currentToken={type:sc.COMMENT,data:"",location:this.getCurrentLocation(t)}}It(t){this.currentToken={type:sc.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}Mt(t,e){this.currentCharacterToken={type:t,chars:e,location:this.currentLocation}}Ft(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}$t(){var t,e;const n=this.currentToken;null===lc(n,this.currentAttr.name)?(n.attrs.push(this.currentAttr),n.location&&this.currentLocation&&((null!==(t=(e=n.location).attrs)&&void 0!==t?t:e.attrs=Object.create(null))[this.currentAttr.name]=this.currentLocation,this.Ut())):this.Et(Ql.duplicateAttribute)}Ut(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this.Bt(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=Ic(t.tagName),t.type===sc.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this.Et(Ql.endTagWithAttributes),t.selfClosing&&this.Et(Ql.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}Bt(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case sc.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case sc.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case sc.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}qt(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this.Bt(t),this.handler.onEof({type:sc.EOF,location:t}),this.active=!1}jt(t,e){if(this.currentCharacterToken){if(this.currentCharacterToken.type===t)return void(this.currentCharacterToken.chars+=e);this.currentLocation=this.getCurrentLocation(0),this.Bt(this.currentLocation),this.preprocessor.dropParsedChunk()}this.Mt(t,e)}Ht(t){const e=Gc(t)?sc.WHITESPACE_CHARACTER:t===Kl.NULL?sc.NULL_CHARACTER:sc.CHARACTER;this.jt(e,String.fromCodePoint(t))}zt(t){this.jt(sc.CHARACTER,t)}Wt(){this.returnState=this.state,this.state=Mc.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this.Gt()?gc.Attribute:gc.Legacy)}Gt(){return this.returnState===Mc.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Mc.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Mc.ATTRIBUTE_VALUE_UNQUOTED}xt(t){this.Gt()?this.currentAttr.value+=String.fromCodePoint(t):this.Ht(t)}Pt(t){switch(this.state){case Mc.DATA:this.Vt(t);break;case Mc.RCDATA:this.Yt(t);break;case Mc.RAWTEXT:this.Kt(t);break;case Mc.SCRIPT_DATA:this.Xt(t);break;case Mc.PLAINTEXT:this.Zt(t);break;case Mc.TAG_OPEN:this.Jt(t);break;case Mc.END_TAG_OPEN:this.Qt(t);break;case Mc.TAG_NAME:this.te(t);break;case Mc.RCDATA_LESS_THAN_SIGN:this.ee(t);break;case Mc.RCDATA_END_TAG_OPEN:this.re(t);break;case Mc.RCDATA_END_TAG_NAME:this.ie(t);break;case Mc.RAWTEXT_LESS_THAN_SIGN:this.se(t);break;case Mc.RAWTEXT_END_TAG_OPEN:this.ae(t);break;case Mc.RAWTEXT_END_TAG_NAME:this.oe(t);break;case Mc.SCRIPT_DATA_LESS_THAN_SIGN:this.ce(t);break;case Mc.SCRIPT_DATA_END_TAG_OPEN:this.he(t);break;case Mc.SCRIPT_DATA_END_TAG_NAME:this.ue(t);break;case Mc.SCRIPT_DATA_ESCAPE_START:this.fe(t);break;case Mc.SCRIPT_DATA_ESCAPE_START_DASH:this.de(t);break;case Mc.SCRIPT_DATA_ESCAPED:this.pe(t);break;case Mc.SCRIPT_DATA_ESCAPED_DASH:this.me(t);break;case Mc.SCRIPT_DATA_ESCAPED_DASH_DASH:this.we(t);break;case Mc.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this.ye(t);break;case Mc.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this.be(t);break;case Mc.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this.ve(t);break;case Mc.SCRIPT_DATA_DOUBLE_ESCAPE_START:this.Ee(t);break;case Mc.SCRIPT_DATA_DOUBLE_ESCAPED:this.ke(t);break;case Mc.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this.Se(t);break;case Mc.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this.Te(t);break;case Mc.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this.xe(t);break;case Mc.SCRIPT_DATA_DOUBLE_ESCAPE_END:this.Ae(t);break;case Mc.BEFORE_ATTRIBUTE_NAME:this.Ce(t);break;case Mc.ATTRIBUTE_NAME:this.De(t);break;case Mc.AFTER_ATTRIBUTE_NAME:this.Pe(t);break;case Mc.BEFORE_ATTRIBUTE_VALUE:this.Le(t);break;case Mc.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this.Re(t);break;case Mc.ATTRIBUTE_VALUE_SINGLE_QUOTED:this.Ne(t);break;case Mc.ATTRIBUTE_VALUE_UNQUOTED:this._e(t);break;case Mc.AFTER_ATTRIBUTE_VALUE_QUOTED:this.Oe(t);break;case Mc.SELF_CLOSING_START_TAG:this.Ie(t);break;case Mc.BOGUS_COMMENT:this.Me(t);break;case Mc.MARKUP_DECLARATION_OPEN:this.Fe(t);break;case Mc.COMMENT_START:this.$e(t);break;case Mc.COMMENT_START_DASH:this.Ue(t);break;case Mc.COMMENT:this.Be(t);break;case Mc.COMMENT_LESS_THAN_SIGN:this.qe(t);break;case Mc.COMMENT_LESS_THAN_SIGN_BANG:this.je(t);break;case Mc.COMMENT_LESS_THAN_SIGN_BANG_DASH:this.He(t);break;case Mc.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this.ze(t);break;case Mc.COMMENT_END_DASH:this.We(t);break;case Mc.COMMENT_END:this.Ge(t);break;case Mc.COMMENT_END_BANG:this.Ve(t);break;case Mc.DOCTYPE:this.Ye(t);break;case Mc.BEFORE_DOCTYPE_NAME:this.Ke(t);break;case Mc.DOCTYPE_NAME:this.Xe(t);break;case Mc.AFTER_DOCTYPE_NAME:this.Ze(t);break;case Mc.AFTER_DOCTYPE_PUBLIC_KEYWORD:this.Je(t);break;case Mc.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this.Qe(t);break;case Mc.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this.tn(t);break;case Mc.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this.nn(t);break;case Mc.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this.rn(t);break;case Mc.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this.sn(t);break;case Mc.AFTER_DOCTYPE_SYSTEM_KEYWORD:this.an(t);break;case Mc.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this.ln(t);break;case Mc.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this.cn(t);break;case Mc.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this.hn(t);break;case Mc.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this.un(t);break;case Mc.BOGUS_DOCTYPE:this.fn(t);break;case Mc.CDATA_SECTION:this.dn(t);break;case Mc.CDATA_SECTION_BRACKET:this.pn(t);break;case Mc.CDATA_SECTION_END:this.gn(t);break;case Mc.CHARACTER_REFERENCE:this.mn();break;case Mc.AMBIGUOUS_AMPERSAND:this.wn(t);break;default:throw new Error("Unknown state")}}Vt(t){switch(t){case Kl.LESS_THAN_SIGN:this.state=Mc.TAG_OPEN;break;case Kl.AMPERSAND:this.Wt();break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.Ht(t);break;case Kl.EOF:this.qt();break;default:this.Ht(t)}}Yt(t){switch(t){case Kl.AMPERSAND:this.Wt();break;case Kl.LESS_THAN_SIGN:this.state=Mc.RCDATA_LESS_THAN_SIGN;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.zt(Jl);break;case Kl.EOF:this.qt();break;default:this.Ht(t)}}Kt(t){switch(t){case Kl.LESS_THAN_SIGN:this.state=Mc.RAWTEXT_LESS_THAN_SIGN;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.zt(Jl);break;case Kl.EOF:this.qt();break;default:this.Ht(t)}}Xt(t){switch(t){case Kl.LESS_THAN_SIGN:this.state=Mc.SCRIPT_DATA_LESS_THAN_SIGN;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.zt(Jl);break;case Kl.EOF:this.qt();break;default:this.Ht(t)}}Zt(t){switch(t){case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.zt(Jl);break;case Kl.EOF:this.qt();break;default:this.Ht(t)}}Jt(t){if(Hc(t))this.Nt(),this.state=Mc.TAG_NAME,this.te(t);else switch(t){case Kl.EXCLAMATION_MARK:this.state=Mc.MARKUP_DECLARATION_OPEN;break;case Kl.SOLIDUS:this.state=Mc.END_TAG_OPEN;break;case Kl.QUESTION_MARK:this.Et(Ql.unexpectedQuestionMarkInsteadOfTagName),this.Ot(1),this.state=Mc.BOGUS_COMMENT,this.Me(t);break;case Kl.EOF:this.Et(Ql.eofBeforeTagName),this.zt("<"),this.qt();break;default:this.Et(Ql.invalidFirstCharacterOfTagName),this.zt("<"),this.state=Mc.DATA,this.Vt(t)}}Qt(t){if(Hc(t))this._t(),this.state=Mc.TAG_NAME,this.te(t);else switch(t){case Kl.GREATER_THAN_SIGN:this.Et(Ql.missingEndTagName),this.state=Mc.DATA;break;case Kl.EOF:this.Et(Ql.eofBeforeTagName),this.zt("</"),this.qt();break;default:this.Et(Ql.invalidFirstCharacterOfTagName),this.Ot(2),this.state=Mc.BOGUS_COMMENT,this.Me(t)}}te(t){const e=this.currentToken;switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:this.state=Mc.BEFORE_ATTRIBUTE_NAME;break;case Kl.SOLIDUS:this.state=Mc.SELF_CLOSING_START_TAG;break;case Kl.GREATER_THAN_SIGN:this.state=Mc.DATA,this.emitCurrentTagToken();break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),e.tagName+=Jl;break;case Kl.EOF:this.Et(Ql.eofInTag),this.qt();break;default:e.tagName+=String.fromCodePoint(jc(t)?Wc(t):t)}}ee(t){t===Kl.SOLIDUS?this.state=Mc.RCDATA_END_TAG_OPEN:(this.zt("<"),this.state=Mc.RCDATA,this.Yt(t))}re(t){Hc(t)?(this.state=Mc.RCDATA_END_TAG_NAME,this.ie(t)):(this.zt("</"),this.state=Mc.RCDATA,this.Yt(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this.Dt();switch(this._t(),this.currentToken.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:return this.Lt(this.lastStartTagName.length),this.state=Mc.BEFORE_ATTRIBUTE_NAME,!1;case Kl.SOLIDUS:return this.Lt(this.lastStartTagName.length),this.state=Mc.SELF_CLOSING_START_TAG,!1;case Kl.GREATER_THAN_SIGN:return this.Lt(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=Mc.DATA,!1;default:return!this.Dt()}}ie(t){this.handleSpecialEndTag(t)&&(this.zt("</"),this.state=Mc.RCDATA,this.Yt(t))}se(t){t===Kl.SOLIDUS?this.state=Mc.RAWTEXT_END_TAG_OPEN:(this.zt("<"),this.state=Mc.RAWTEXT,this.Kt(t))}ae(t){Hc(t)?(this.state=Mc.RAWTEXT_END_TAG_NAME,this.oe(t)):(this.zt("</"),this.state=Mc.RAWTEXT,this.Kt(t))}oe(t){this.handleSpecialEndTag(t)&&(this.zt("</"),this.state=Mc.RAWTEXT,this.Kt(t))}ce(t){switch(t){case Kl.SOLIDUS:this.state=Mc.SCRIPT_DATA_END_TAG_OPEN;break;case Kl.EXCLAMATION_MARK:this.state=Mc.SCRIPT_DATA_ESCAPE_START,this.zt("<!");break;default:this.zt("<"),this.state=Mc.SCRIPT_DATA,this.Xt(t)}}he(t){Hc(t)?(this.state=Mc.SCRIPT_DATA_END_TAG_NAME,this.ue(t)):(this.zt("</"),this.state=Mc.SCRIPT_DATA,this.Xt(t))}ue(t){this.handleSpecialEndTag(t)&&(this.zt("</"),this.state=Mc.SCRIPT_DATA,this.Xt(t))}fe(t){t===Kl.HYPHEN_MINUS?(this.state=Mc.SCRIPT_DATA_ESCAPE_START_DASH,this.zt("-")):(this.state=Mc.SCRIPT_DATA,this.Xt(t))}de(t){t===Kl.HYPHEN_MINUS?(this.state=Mc.SCRIPT_DATA_ESCAPED_DASH_DASH,this.zt("-")):(this.state=Mc.SCRIPT_DATA,this.Xt(t))}pe(t){switch(t){case Kl.HYPHEN_MINUS:this.state=Mc.SCRIPT_DATA_ESCAPED_DASH,this.zt("-");break;case Kl.LESS_THAN_SIGN:this.state=Mc.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.zt(Jl);break;case Kl.EOF:this.Et(Ql.eofInScriptHtmlCommentLikeText),this.qt();break;default:this.Ht(t)}}me(t){switch(t){case Kl.HYPHEN_MINUS:this.state=Mc.SCRIPT_DATA_ESCAPED_DASH_DASH,this.zt("-");break;case Kl.LESS_THAN_SIGN:this.state=Mc.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.state=Mc.SCRIPT_DATA_ESCAPED,this.zt(Jl);break;case Kl.EOF:this.Et(Ql.eofInScriptHtmlCommentLikeText),this.qt();break;default:this.state=Mc.SCRIPT_DATA_ESCAPED,this.Ht(t)}}we(t){switch(t){case Kl.HYPHEN_MINUS:this.zt("-");break;case Kl.LESS_THAN_SIGN:this.state=Mc.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case Kl.GREATER_THAN_SIGN:this.state=Mc.SCRIPT_DATA,this.zt(">");break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.state=Mc.SCRIPT_DATA_ESCAPED,this.zt(Jl);break;case Kl.EOF:this.Et(Ql.eofInScriptHtmlCommentLikeText),this.qt();break;default:this.state=Mc.SCRIPT_DATA_ESCAPED,this.Ht(t)}}ye(t){t===Kl.SOLIDUS?this.state=Mc.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Hc(t)?(this.zt("<"),this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPE_START,this.Ee(t)):(this.zt("<"),this.state=Mc.SCRIPT_DATA_ESCAPED,this.pe(t))}be(t){Hc(t)?(this.state=Mc.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this.ve(t)):(this.zt("</"),this.state=Mc.SCRIPT_DATA_ESCAPED,this.pe(t))}ve(t){this.handleSpecialEndTag(t)&&(this.zt("</"),this.state=Mc.SCRIPT_DATA_ESCAPED,this.pe(t))}Ee(t){if(this.preprocessor.startsWith(ec,!1)&&Vc(this.preprocessor.peek(6))){this.Ht(t);for(let t=0;t<6;t++)this.Ht(this.Ct());this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED}else this.Dt()||(this.state=Mc.SCRIPT_DATA_ESCAPED,this.pe(t))}ke(t){switch(t){case Kl.HYPHEN_MINUS:this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this.zt("-");break;case Kl.LESS_THAN_SIGN:this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this.zt("<");break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.zt(Jl);break;case Kl.EOF:this.Et(Ql.eofInScriptHtmlCommentLikeText),this.qt();break;default:this.Ht(t)}}Se(t){switch(t){case Kl.HYPHEN_MINUS:this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this.zt("-");break;case Kl.LESS_THAN_SIGN:this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this.zt("<");break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED,this.zt(Jl);break;case Kl.EOF:this.Et(Ql.eofInScriptHtmlCommentLikeText),this.qt();break;default:this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED,this.Ht(t)}}Te(t){switch(t){case Kl.HYPHEN_MINUS:this.zt("-");break;case Kl.LESS_THAN_SIGN:this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this.zt("<");break;case Kl.GREATER_THAN_SIGN:this.state=Mc.SCRIPT_DATA,this.zt(">");break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED,this.zt(Jl);break;case Kl.EOF:this.Et(Ql.eofInScriptHtmlCommentLikeText),this.qt();break;default:this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED,this.Ht(t)}}xe(t){t===Kl.SOLIDUS?(this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPE_END,this.zt("/")):(this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED,this.ke(t))}Ae(t){if(this.preprocessor.startsWith(ec,!1)&&Vc(this.preprocessor.peek(6))){this.Ht(t);for(let t=0;t<6;t++)this.Ht(this.Ct());this.state=Mc.SCRIPT_DATA_ESCAPED}else this.Dt()||(this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED,this.ke(t))}Ce(t){switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:break;case Kl.SOLIDUS:case Kl.GREATER_THAN_SIGN:case Kl.EOF:this.state=Mc.AFTER_ATTRIBUTE_NAME,this.Pe(t);break;case Kl.EQUALS_SIGN:this.Et(Ql.unexpectedEqualsSignBeforeAttributeName),this.Ft("="),this.state=Mc.ATTRIBUTE_NAME;break;default:this.Ft(""),this.state=Mc.ATTRIBUTE_NAME,this.De(t)}}De(t){switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:case Kl.SOLIDUS:case Kl.GREATER_THAN_SIGN:case Kl.EOF:this.$t(),this.state=Mc.AFTER_ATTRIBUTE_NAME,this.Pe(t);break;case Kl.EQUALS_SIGN:this.$t(),this.state=Mc.BEFORE_ATTRIBUTE_VALUE;break;case Kl.QUOTATION_MARK:case Kl.APOSTROPHE:case Kl.LESS_THAN_SIGN:this.Et(Ql.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.currentAttr.name+=Jl;break;default:this.currentAttr.name+=String.fromCodePoint(jc(t)?Wc(t):t)}}Pe(t){switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:break;case Kl.SOLIDUS:this.state=Mc.SELF_CLOSING_START_TAG;break;case Kl.EQUALS_SIGN:this.state=Mc.BEFORE_ATTRIBUTE_VALUE;break;case Kl.GREATER_THAN_SIGN:this.state=Mc.DATA,this.emitCurrentTagToken();break;case Kl.EOF:this.Et(Ql.eofInTag),this.qt();break;default:this.Ft(""),this.state=Mc.ATTRIBUTE_NAME,this.De(t)}}Le(t){switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:break;case Kl.QUOTATION_MARK:this.state=Mc.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case Kl.APOSTROPHE:this.state=Mc.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.missingAttributeValue),this.state=Mc.DATA,this.emitCurrentTagToken();break;default:this.state=Mc.ATTRIBUTE_VALUE_UNQUOTED,this._e(t)}}Re(t){switch(t){case Kl.QUOTATION_MARK:this.state=Mc.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case Kl.AMPERSAND:this.Wt();break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.currentAttr.value+=Jl;break;case Kl.EOF:this.Et(Ql.eofInTag),this.qt();break;default:this.currentAttr.value+=String.fromCodePoint(t)}}Ne(t){switch(t){case Kl.APOSTROPHE:this.state=Mc.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case Kl.AMPERSAND:this.Wt();break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.currentAttr.value+=Jl;break;case Kl.EOF:this.Et(Ql.eofInTag),this.qt();break;default:this.currentAttr.value+=String.fromCodePoint(t)}}_e(t){switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:this.Ut(),this.state=Mc.BEFORE_ATTRIBUTE_NAME;break;case Kl.AMPERSAND:this.Wt();break;case Kl.GREATER_THAN_SIGN:this.Ut(),this.state=Mc.DATA,this.emitCurrentTagToken();break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.currentAttr.value+=Jl;break;case Kl.QUOTATION_MARK:case Kl.APOSTROPHE:case Kl.LESS_THAN_SIGN:case Kl.EQUALS_SIGN:case Kl.GRAVE_ACCENT:this.Et(Ql.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break;case Kl.EOF:this.Et(Ql.eofInTag),this.qt();break;default:this.currentAttr.value+=String.fromCodePoint(t)}}Oe(t){switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:this.Ut(),this.state=Mc.BEFORE_ATTRIBUTE_NAME;break;case Kl.SOLIDUS:this.Ut(),this.state=Mc.SELF_CLOSING_START_TAG;break;case Kl.GREATER_THAN_SIGN:this.Ut(),this.state=Mc.DATA,this.emitCurrentTagToken();break;case Kl.EOF:this.Et(Ql.eofInTag),this.qt();break;default:this.Et(Ql.missingWhitespaceBetweenAttributes),this.state=Mc.BEFORE_ATTRIBUTE_NAME,this.Ce(t)}}Ie(t){switch(t){case Kl.GREATER_THAN_SIGN:this.currentToken.selfClosing=!0,this.state=Mc.DATA,this.emitCurrentTagToken();break;case Kl.EOF:this.Et(Ql.eofInTag),this.qt();break;default:this.Et(Ql.unexpectedSolidusInTag),this.state=Mc.BEFORE_ATTRIBUTE_NAME,this.Ce(t)}}Me(t){const e=this.currentToken;switch(t){case Kl.GREATER_THAN_SIGN:this.state=Mc.DATA,this.emitCurrentComment(e);break;case Kl.EOF:this.emitCurrentComment(e),this.qt();break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),e.data+=Jl;break;default:e.data+=String.fromCodePoint(t)}}Fe(t){this.Rt("--",!0)?(this.Ot(3),this.state=Mc.COMMENT_START):this.Rt("doctype",!1)?(this.currentLocation=this.getCurrentLocation(8),this.state=Mc.DOCTYPE):this.Rt("[CDATA[",!0)?this.inForeignNode?this.state=Mc.CDATA_SECTION:(this.Et(Ql.cdataInHtmlContent),this.Ot(8),this.currentToken.data="[CDATA[",this.state=Mc.BOGUS_COMMENT):this.Dt()||(this.Et(Ql.incorrectlyOpenedComment),this.Ot(2),this.state=Mc.BOGUS_COMMENT,this.Me(t))}$e(t){switch(t){case Kl.HYPHEN_MINUS:this.state=Mc.COMMENT_START_DASH;break;case Kl.GREATER_THAN_SIGN:{this.Et(Ql.abruptClosingOfEmptyComment),this.state=Mc.DATA;const t=this.currentToken;this.emitCurrentComment(t);break}default:this.state=Mc.COMMENT,this.Be(t)}}Ue(t){const e=this.currentToken;switch(t){case Kl.HYPHEN_MINUS:this.state=Mc.COMMENT_END;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.abruptClosingOfEmptyComment),this.state=Mc.DATA,this.emitCurrentComment(e);break;case Kl.EOF:this.Et(Ql.eofInComment),this.emitCurrentComment(e),this.qt();break;default:e.data+="-",this.state=Mc.COMMENT,this.Be(t)}}Be(t){const e=this.currentToken;switch(t){case Kl.HYPHEN_MINUS:this.state=Mc.COMMENT_END_DASH;break;case Kl.LESS_THAN_SIGN:e.data+="<",this.state=Mc.COMMENT_LESS_THAN_SIGN;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),e.data+=Jl;break;case Kl.EOF:this.Et(Ql.eofInComment),this.emitCurrentComment(e),this.qt();break;default:e.data+=String.fromCodePoint(t)}}qe(t){const e=this.currentToken;switch(t){case Kl.EXCLAMATION_MARK:e.data+="!",this.state=Mc.COMMENT_LESS_THAN_SIGN_BANG;break;case Kl.LESS_THAN_SIGN:e.data+="<";break;default:this.state=Mc.COMMENT,this.Be(t)}}je(t){t===Kl.HYPHEN_MINUS?this.state=Mc.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=Mc.COMMENT,this.Be(t))}He(t){t===Kl.HYPHEN_MINUS?this.state=Mc.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=Mc.COMMENT_END_DASH,this.We(t))}ze(t){t!==Kl.GREATER_THAN_SIGN&&t!==Kl.EOF&&this.Et(Ql.nestedComment),this.state=Mc.COMMENT_END,this.Ge(t)}We(t){const e=this.currentToken;switch(t){case Kl.HYPHEN_MINUS:this.state=Mc.COMMENT_END;break;case Kl.EOF:this.Et(Ql.eofInComment),this.emitCurrentComment(e),this.qt();break;default:e.data+="-",this.state=Mc.COMMENT,this.Be(t)}}Ge(t){const e=this.currentToken;switch(t){case Kl.GREATER_THAN_SIGN:this.state=Mc.DATA,this.emitCurrentComment(e);break;case Kl.EXCLAMATION_MARK:this.state=Mc.COMMENT_END_BANG;break;case Kl.HYPHEN_MINUS:e.data+="-";break;case Kl.EOF:this.Et(Ql.eofInComment),this.emitCurrentComment(e),this.qt();break;default:e.data+="--",this.state=Mc.COMMENT,this.Be(t)}}Ve(t){const e=this.currentToken;switch(t){case Kl.HYPHEN_MINUS:e.data+="--!",this.state=Mc.COMMENT_END_DASH;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.incorrectlyClosedComment),this.state=Mc.DATA,this.emitCurrentComment(e);break;case Kl.EOF:this.Et(Ql.eofInComment),this.emitCurrentComment(e),this.qt();break;default:e.data+="--!",this.state=Mc.COMMENT,this.Be(t)}}Ye(t){switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:this.state=Mc.BEFORE_DOCTYPE_NAME;break;case Kl.GREATER_THAN_SIGN:this.state=Mc.BEFORE_DOCTYPE_NAME,this.Ke(t);break;case Kl.EOF:{this.Et(Ql.eofInDoctype),this.It(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this.qt();break}default:this.Et(Ql.missingWhitespaceBeforeDoctypeName),this.state=Mc.BEFORE_DOCTYPE_NAME,this.Ke(t)}}Ke(t){if(jc(t))this.It(String.fromCharCode(Wc(t))),this.state=Mc.DOCTYPE_NAME;else switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.It(Jl),this.state=Mc.DOCTYPE_NAME;break;case Kl.GREATER_THAN_SIGN:{this.Et(Ql.missingDoctypeName),this.It(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Mc.DATA;break}case Kl.EOF:{this.Et(Ql.eofInDoctype),this.It(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this.qt();break}default:this.It(String.fromCodePoint(t)),this.state=Mc.DOCTYPE_NAME}}Xe(t){const e=this.currentToken;switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:this.state=Mc.AFTER_DOCTYPE_NAME;break;case Kl.GREATER_THAN_SIGN:this.state=Mc.DATA,this.emitCurrentDoctype(e);break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),e.name+=Jl;break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:e.name+=String.fromCodePoint(jc(t)?Wc(t):t)}}Ze(t){const e=this.currentToken;switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:break;case Kl.GREATER_THAN_SIGN:this.state=Mc.DATA,this.emitCurrentDoctype(e);break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:this.Rt("public",!1)?this.state=Mc.AFTER_DOCTYPE_PUBLIC_KEYWORD:this.Rt("system",!1)?this.state=Mc.AFTER_DOCTYPE_SYSTEM_KEYWORD:this.Dt()||(this.Et(Ql.invalidCharacterSequenceAfterDoctypeName),e.forceQuirks=!0,this.state=Mc.BOGUS_DOCTYPE,this.fn(t))}}Je(t){const e=this.currentToken;switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:this.state=Mc.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case Kl.QUOTATION_MARK:this.Et(Ql.missingWhitespaceAfterDoctypePublicKeyword),e.publicId="",this.state=Mc.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case Kl.APOSTROPHE:this.Et(Ql.missingWhitespaceAfterDoctypePublicKeyword),e.publicId="",this.state=Mc.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.missingDoctypePublicIdentifier),e.forceQuirks=!0,this.state=Mc.DATA,this.emitCurrentDoctype(e);break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:this.Et(Ql.missingQuoteBeforeDoctypePublicIdentifier),e.forceQuirks=!0,this.state=Mc.BOGUS_DOCTYPE,this.fn(t)}}Qe(t){const e=this.currentToken;switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:break;case Kl.QUOTATION_MARK:e.publicId="",this.state=Mc.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case Kl.APOSTROPHE:e.publicId="",this.state=Mc.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.missingDoctypePublicIdentifier),e.forceQuirks=!0,this.state=Mc.DATA,this.emitCurrentDoctype(e);break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:this.Et(Ql.missingQuoteBeforeDoctypePublicIdentifier),e.forceQuirks=!0,this.state=Mc.BOGUS_DOCTYPE,this.fn(t)}}tn(t){const e=this.currentToken;switch(t){case Kl.QUOTATION_MARK:this.state=Mc.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),e.publicId+=Jl;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.abruptDoctypePublicIdentifier),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=Mc.DATA;break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:e.publicId+=String.fromCodePoint(t)}}nn(t){const e=this.currentToken;switch(t){case Kl.APOSTROPHE:this.state=Mc.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),e.publicId+=Jl;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.abruptDoctypePublicIdentifier),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=Mc.DATA;break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:e.publicId+=String.fromCodePoint(t)}}rn(t){const e=this.currentToken;switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:this.state=Mc.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case Kl.GREATER_THAN_SIGN:this.state=Mc.DATA,this.emitCurrentDoctype(e);break;case Kl.QUOTATION_MARK:this.Et(Ql.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),e.systemId="",this.state=Mc.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case Kl.APOSTROPHE:this.Et(Ql.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),e.systemId="",this.state=Mc.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:this.Et(Ql.missingQuoteBeforeDoctypeSystemIdentifier),e.forceQuirks=!0,this.state=Mc.BOGUS_DOCTYPE,this.fn(t)}}sn(t){const e=this.currentToken;switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:break;case Kl.GREATER_THAN_SIGN:this.emitCurrentDoctype(e),this.state=Mc.DATA;break;case Kl.QUOTATION_MARK:e.systemId="",this.state=Mc.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case Kl.APOSTROPHE:e.systemId="",this.state=Mc.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:this.Et(Ql.missingQuoteBeforeDoctypeSystemIdentifier),e.forceQuirks=!0,this.state=Mc.BOGUS_DOCTYPE,this.fn(t)}}an(t){const e=this.currentToken;switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:this.state=Mc.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case Kl.QUOTATION_MARK:this.Et(Ql.missingWhitespaceAfterDoctypeSystemKeyword),e.systemId="",this.state=Mc.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case Kl.APOSTROPHE:this.Et(Ql.missingWhitespaceAfterDoctypeSystemKeyword),e.systemId="",this.state=Mc.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.missingDoctypeSystemIdentifier),e.forceQuirks=!0,this.state=Mc.DATA,this.emitCurrentDoctype(e);break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:this.Et(Ql.missingQuoteBeforeDoctypeSystemIdentifier),e.forceQuirks=!0,this.state=Mc.BOGUS_DOCTYPE,this.fn(t)}}ln(t){const e=this.currentToken;switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:break;case Kl.QUOTATION_MARK:e.systemId="",this.state=Mc.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case Kl.APOSTROPHE:e.systemId="",this.state=Mc.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.missingDoctypeSystemIdentifier),e.forceQuirks=!0,this.state=Mc.DATA,this.emitCurrentDoctype(e);break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:this.Et(Ql.missingQuoteBeforeDoctypeSystemIdentifier),e.forceQuirks=!0,this.state=Mc.BOGUS_DOCTYPE,this.fn(t)}}cn(t){const e=this.currentToken;switch(t){case Kl.QUOTATION_MARK:this.state=Mc.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),e.systemId+=Jl;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.abruptDoctypeSystemIdentifier),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=Mc.DATA;break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:e.systemId+=String.fromCodePoint(t)}}hn(t){const e=this.currentToken;switch(t){case Kl.APOSTROPHE:this.state=Mc.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),e.systemId+=Jl;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.abruptDoctypeSystemIdentifier),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=Mc.DATA;break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:e.systemId+=String.fromCodePoint(t)}}un(t){const e=this.currentToken;switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:break;case Kl.GREATER_THAN_SIGN:this.emitCurrentDoctype(e),this.state=Mc.DATA;break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:this.Et(Ql.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=Mc.BOGUS_DOCTYPE,this.fn(t)}}fn(t){const e=this.currentToken;switch(t){case Kl.GREATER_THAN_SIGN:this.emitCurrentDoctype(e),this.state=Mc.DATA;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter);break;case Kl.EOF:this.emitCurrentDoctype(e),this.qt()}}dn(t){switch(t){case Kl.RIGHT_SQUARE_BRACKET:this.state=Mc.CDATA_SECTION_BRACKET;break;case Kl.EOF:this.Et(Ql.eofInCdata),this.qt();break;default:this.Ht(t)}}pn(t){t===Kl.RIGHT_SQUARE_BRACKET?this.state=Mc.CDATA_SECTION_END:(this.zt("]"),this.state=Mc.CDATA_SECTION,this.dn(t))}gn(t){switch(t){case Kl.GREATER_THAN_SIGN:this.state=Mc.DATA;break;case Kl.RIGHT_SQUARE_BRACKET:this.zt("]");break;default:this.zt("]]"),this.state=Mc.CDATA_SECTION,this.dn(t)}}mn(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0){if(!this.preprocessor.lastChunkWritten)return this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,void(this.preprocessor.endOfChunkHit=!0);t=this.entityDecoder.end()}0===t?(this.preprocessor.pos=this.entityStartPos,this.xt(Kl.AMPERSAND),this.state=!this.Gt()&&zc(this.preprocessor.peek(1))?Mc.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}wn(t){zc(t)?this.xt(t):(t===Kl.SEMICOLON&&this.Et(Ql.unknownNamedCharacterReference),this.state=this.returnState,this.Pt(t))}},Zc=new Set([Lc.DD,Lc.DT,Lc.LI,Lc.OPTGROUP,Lc.OPTION,Lc.P,Lc.RB,Lc.RP,Lc.RT,Lc.RTC]),Jc=new Set([...Zc,Lc.CAPTION,Lc.COLGROUP,Lc.TBODY,Lc.TD,Lc.TFOOT,Lc.TH,Lc.THEAD,Lc.TR]),Qc=new Set([Lc.APPLET,Lc.CAPTION,Lc.HTML,Lc.MARQUEE,Lc.OBJECT,Lc.TABLE,Lc.TD,Lc.TEMPLATE,Lc.TH]),th=new Set([...Qc,Lc.OL,Lc.UL]),eh=new Set([...Qc,Lc.BUTTON]),nh=new Set([Lc.ANNOTATION_XML,Lc.MI,Lc.MN,Lc.MO,Lc.MS,Lc.MTEXT]),rh=new Set([Lc.DESC,Lc.FOREIGN_OBJECT,Lc.TITLE]),ih=new Set([Lc.TR,Lc.TEMPLATE,Lc.HTML]),sh=new Set([Lc.TBODY,Lc.TFOOT,Lc.THEAD,Lc.TEMPLATE,Lc.HTML]),ah=new Set([Lc.TABLE,Lc.TEMPLATE,Lc.HTML]),oh=new Set([Lc.TD,Lc.TH]),lh=class{get currentTmplContentOrNode(){return this.yn()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,e,n){this.treeAdapter=e,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=Lc.UNKNOWN,this.current=t}bn(t){return this.items.lastIndexOf(t,this.stackTop)}yn(){return this.currentTagId===Lc.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===kc.HTML}vn(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,e){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=e,this.currentTagId=e,this.yn()&&this.tmplCount++,this.handler.onItemPush(t,e,!0)}pop(){const t=this.current;this.tmplCount>0&&this.yn()&&this.tmplCount--,this.stackTop--,this.vn(),this.handler.onItemPop(t,!0)}replace(t,e){const n=this.bn(t);this.items[n]=e,n===this.stackTop&&(this.current=e)}insertAfter(t,e,n){const r=this.bn(t)+1;this.items.splice(r,0,e),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this.vn(),this.current&&void 0!==this.currentTagId&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(t){let e=this.stackTop+1;do{e=this.tagIDs.lastIndexOf(t,e-1)}while(e>0&&this.treeAdapter.getNamespaceURI(this.items[e])!==kc.HTML);this.shortenToLength(Math.max(e,0))}shortenToLength(t){for(;this.stackTop>=t;){const e=this.current;this.tmplCount>0&&this.yn()&&(this.tmplCount-=1),this.stackTop--,this.vn(),this.handler.onItemPop(e,this.stackTop<t)}}popUntilElementPopped(t){const e=this.bn(t);this.shortenToLength(Math.max(e,0))}popUntilPopped(t,e){const n=this.En(t,e);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Bc,kc.HTML)}popUntilTableCellPopped(){this.popUntilPopped(oh,kc.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}En(t,e){for(let n=this.stackTop;n>=0;n--)if(t.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===e)return n;return-1}clearBackTo(t,e){const n=this.En(t,e);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(ah,kc.HTML)}clearBackToTableBodyContext(){this.clearBackTo(sh,kc.HTML)}clearBackToTableRowContext(){this.clearBackTo(ih,kc.HTML)}remove(t){const e=this.bn(t);e>=0&&(e===this.stackTop?this.pop():(this.items.splice(e,1),this.tagIDs.splice(e,1),this.stackTop--,this.vn(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===Lc.BODY?this.items[1]:null}contains(t){return this.bn(t)>-1}getCommonAncestor(t){const e=this.bn(t)-1;return e>=0?this.items[e]:null}isRootHtmlElementCurrent(){return 0===this.stackTop&&this.tagIDs[0]===Lc.HTML}hasInDynamicScope(t,e){for(let n=this.stackTop;n>=0;n--){const r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case kc.HTML:if(r===t)return!0;if(e.has(r))return!1;break;case kc.SVG:if(rh.has(r))return!1;break;case kc.MATHML:if(nh.has(r))return!1}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Qc)}hasInListItemScope(t){return this.hasInDynamicScope(t,th)}hasInButtonScope(t){return this.hasInDynamicScope(t,eh)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const e=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case kc.HTML:if(Bc.has(e))return!0;if(Qc.has(e))return!1;break;case kc.SVG:if(rh.has(e))return!1;break;case kc.MATHML:if(nh.has(e))return!1}}return!0}hasInTableScope(t){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===kc.HTML)switch(this.tagIDs[e]){case t:return!0;case Lc.TABLE:case Lc.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===kc.HTML)switch(this.tagIDs[t]){case Lc.TBODY:case Lc.THEAD:case Lc.TFOOT:return!0;case Lc.TABLE:case Lc.HTML:return!1}return!0}hasInSelectScope(t){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===kc.HTML)switch(this.tagIDs[e]){case t:return!0;case Lc.OPTION:case Lc.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;void 0!==this.currentTagId&&Zc.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;void 0!==this.currentTagId&&Jc.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;void 0!==this.currentTagId&&this.currentTagId!==t&&Jc.has(this.currentTagId);)this.pop()}};(Kc=Yc||(Yc={}))[Kc.Marker=0]="Marker",Kc[Kc.Element=1]="Element";var ch={type:Yc.Marker},hh=class{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}kn(t,e){const n=[],r=e.length,i=this.treeAdapter.getTagName(t),s=this.treeAdapter.getNamespaceURI(t);for(let t=0;t<this.entries.length;t++){const e=this.entries[t];if(e.type===Yc.Marker)break;const{element:a}=e;if(this.treeAdapter.getTagName(a)===i&&this.treeAdapter.getNamespaceURI(a)===s){const e=this.treeAdapter.getAttrList(a);e.length===r&&n.push({idx:t,attrs:e})}}return n}Sn(t){if(this.entries.length<3)return;const e=this.treeAdapter.getAttrList(t),n=this.kn(t,e);if(n.length<3)return;const r=new Map(e.map(t=>[t.name,t.value]));let i=0;for(let t=0;t<n.length;t++){const e=n[t];e.attrs.every(t=>r.get(t.name)===t.value)&&(i+=1,i>=3&&this.entries.splice(e.idx,1))}}insertMarker(){this.entries.unshift(ch)}pushElement(t,e){this.Sn(t),this.entries.unshift({type:Yc.Element,element:t,token:e})}insertElementAfterBookmark(t,e){const n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:Yc.Element,element:t,token:e})}removeEntry(t){const e=this.entries.indexOf(t);-1!==e&&this.entries.splice(e,1)}clearToLastMarker(){const t=this.entries.indexOf(ch);-1===t?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const e=this.entries.find(e=>e.type===Yc.Marker||this.treeAdapter.getTagName(e.element)===t);return e&&e.type===Yc.Element?e:null}getElementEntry(t){return this.entries.find(e=>e.type===Yc.Element&&e.element===t)}},uh={createDocument:()=>({nodeName:"#document",mode:Ac.NO_QUIRKS,childNodes:[]}),createDocumentFragment:()=>({nodeName:"#document-fragment",childNodes:[]}),createElement:(t,e,n)=>({nodeName:t,tagName:t,attrs:n,namespaceURI:e,childNodes:[],parentNode:null}),createCommentNode:t=>({nodeName:"#comment",data:t,parentNode:null}),createTextNode:t=>({nodeName:"#text",value:t,parentNode:null}),appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,n){const r=t.childNodes.indexOf(n);t.childNodes.splice(r,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent:t=>t.content,setDocumentType(t,e,n,r){const i=t.childNodes.find(t=>"#documentType"===t.nodeName);if(i)i.name=e,i.publicId=n,i.systemId=r;else{const i={nodeName:"#documentType",name:e,publicId:n,systemId:r,parentNode:null};uh.appendChild(t,i)}},setDocumentMode(t,e){t.mode=e},getDocumentMode:t=>t.mode,detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const n=t.childNodes[t.childNodes.length-1];if(uh.isTextNode(n))return void(n.value+=e)}uh.appendChild(t,uh.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&uh.isTextNode(r)?r.value+=e:uh.insertBefore(t,uh.createTextNode(e),n)},adoptAttributes(t,e){const n=new Set(t.attrs.map(t=>t.name));for(let r=0;r<e.length;r++)n.has(e[r].name)||t.attrs.push(e[r])},getFirstChild:t=>t.childNodes[0],getChildNodes:t=>t.childNodes,getParentNode:t=>t.parentNode,getAttrList:t=>t.attrs,getTagName:t=>t.tagName,getNamespaceURI:t=>t.namespaceURI,getTextNodeContent:t=>t.value,getCommentNodeContent:t=>t.data,getDocumentTypeNodeName:t=>t.name,getDocumentTypeNodePublicId:t=>t.publicId,getDocumentTypeNodeSystemId:t=>t.systemId,isTextNode:t=>"#text"===t.nodeName,isCommentNode:t=>"#comment"===t.nodeName,isDocumentTypeNode:t=>"#documentType"===t.nodeName,isElementNode:t=>Object.prototype.hasOwnProperty.call(t,"tagName"),setNodeSourceCodeLocation(t,e){t.sourceCodeLocation=e},getNodeSourceCodeLocation:t=>t.sourceCodeLocation,updateNodeSourceCodeLocation(t,e){t.sourceCodeLocation={...t.sourceCodeLocation,...e}}},fh="html",dh=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],ph=[...dh,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],gh=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),mh=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],wh=[...mh,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function yh(t,e){return e.some(e=>t.startsWith(e))}var bh,vh,Eh=new Map(["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(t=>[t.toLowerCase(),t])),kh=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:kc.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:kc.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:kc.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:kc.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:kc.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:kc.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:kc.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:kc.XML}],["xml:space",{prefix:"xml",name:"space",namespace:kc.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:kc.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:kc.XMLNS}]]),Sh=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(t=>[t.toLowerCase(),t])),Th=new Set([Lc.B,Lc.BIG,Lc.BLOCKQUOTE,Lc.BODY,Lc.BR,Lc.CENTER,Lc.CODE,Lc.DD,Lc.DIV,Lc.DL,Lc.DT,Lc.EM,Lc.EMBED,Lc.H1,Lc.H2,Lc.H3,Lc.H4,Lc.H5,Lc.H6,Lc.HEAD,Lc.HR,Lc.I,Lc.IMG,Lc.LI,Lc.LISTING,Lc.MENU,Lc.META,Lc.NOBR,Lc.OL,Lc.P,Lc.PRE,Lc.RUBY,Lc.S,Lc.SMALL,Lc.SPAN,Lc.STRONG,Lc.STRIKE,Lc.SUB,Lc.SUP,Lc.TABLE,Lc.TT,Lc.U,Lc.UL,Lc.VAR]);function xh(t){for(let e=0;e<t.attrs.length;e++)if("definitionurl"===t.attrs[e].name){t.attrs[e].name="definitionURL";break}}function Ah(t){for(let e=0;e<t.attrs.length;e++){const n=Eh.get(t.attrs[e].name);null!=n&&(t.attrs[e].name=n)}}function Ch(t){for(let e=0;e<t.attrs.length;e++){const n=kh.get(t.attrs[e].name);n&&(t.attrs[e].prefix=n.prefix,t.attrs[e].name=n.name,t.attrs[e].namespace=n.namespace)}}(vh=bh||(bh={}))[vh.INITIAL=0]="INITIAL",vh[vh.BEFORE_HTML=1]="BEFORE_HTML",vh[vh.BEFORE_HEAD=2]="BEFORE_HEAD",vh[vh.IN_HEAD=3]="IN_HEAD",vh[vh.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",vh[vh.AFTER_HEAD=5]="AFTER_HEAD",vh[vh.IN_BODY=6]="IN_BODY",vh[vh.TEXT=7]="TEXT",vh[vh.IN_TABLE=8]="IN_TABLE",vh[vh.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",vh[vh.IN_CAPTION=10]="IN_CAPTION",vh[vh.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",vh[vh.IN_TABLE_BODY=12]="IN_TABLE_BODY",vh[vh.IN_ROW=13]="IN_ROW",vh[vh.IN_CELL=14]="IN_CELL",vh[vh.IN_SELECT=15]="IN_SELECT",vh[vh.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",vh[vh.IN_TEMPLATE=17]="IN_TEMPLATE",vh[vh.AFTER_BODY=18]="AFTER_BODY",vh[vh.IN_FRAMESET=19]="IN_FRAMESET",vh[vh.AFTER_FRAMESET=20]="AFTER_FRAMESET",vh[vh.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",vh[vh.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET";var Dh={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Ph=new Set([Lc.TABLE,Lc.TBODY,Lc.TFOOT,Lc.THEAD,Lc.TR]),Lh={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:uh,onParseError:null},Rh=class{constructor(t,e,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=bh.INITIAL,this.originalInsertionMode=bh.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Lh,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=null!=e?e:this.treeAdapter.createDocument(),this.tokenizer=new Xc(this.options,this),this.activeFormattingElements=new hh(this.treeAdapter),this.fragmentContextID=n?Ic(this.treeAdapter.getTagName(n)):Lc.UNKNOWN,this.Tn(null!=n?n:this.document,this.fragmentContextID),this.openElements=new lh(this.document,this.treeAdapter,this)}static parse(t,e){const n=new this(e);return n.tokenizer.write(t,!0),n.document}static getFragmentParser(t,e){const n={...Lh,...e};null!=t||(t=n.treeAdapter.createElement(Dc.TEMPLATE,kc.HTML,[]));const r=n.treeAdapter.createElement("documentmock",kc.HTML,[]),i=new this(n,r,t);return i.fragmentContextID===Lc.TEMPLATE&&i.tmplInsertionModeStack.unshift(bh.IN_TEMPLATE),i.xn(),i.An(),i.Cn(),i.Dn(),i}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),e=this.treeAdapter.createDocumentFragment();return this.Pn(t,e),e}Et(t,e,n){var r;if(!this.onParseError)return;const i=null!==(r=t.location)&&void 0!==r?r:Dh,s={code:e,startLine:i.startLine,startCol:i.startCol,startOffset:i.startOffset,endLine:n?i.startLine:i.endLine,endCol:n?i.startCol:i.endCol,endOffset:n?i.startOffset:i.endOffset};this.onParseError(s)}onItemPush(t,e,n){var r,i;null===(i=(r=this.treeAdapter).onItemPush)||void 0===i||i.call(r,t),n&&this.openElements.stackTop>0&&this.Tn(t,e)}onItemPop(t,e){var n,r;if(this.options.sourceCodeLocationInfo&&this.Ln(t,this.currentToken),null===(r=(n=this.treeAdapter).onItemPop)||void 0===r||r.call(n,t,this.openElements.current),e){let t,e;0===this.openElements.stackTop&&this.fragmentContext?(t=this.fragmentContext,e=this.fragmentContextID):({current:t,currentTagId:e}=this.openElements),this.Tn(t,e)}}Tn(t,e){const n=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===kc.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&void 0!==t&&void 0!==e&&!this.Rn(e,t)}Nn(t,e){this._n(t,kc.HTML),this.tokenizer.state=e,this.originalInsertionMode=this.insertionMode,this.insertionMode=bh.TEXT}switchToPlaintextParsing(){this.insertionMode=bh.TEXT,this.originalInsertionMode=bh.IN_BODY,this.tokenizer.state=qc.PLAINTEXT}On(){return 0===this.openElements.stackTop&&this.fragmentContext?this.fragmentContext:this.openElements.current}Dn(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===Dc.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}xn(){if(this.fragmentContext&&this.treeAdapter.getNamespaceURI(this.fragmentContext)===kc.HTML)switch(this.fragmentContextID){case Lc.TITLE:case Lc.TEXTAREA:this.tokenizer.state=qc.RCDATA;break;case Lc.STYLE:case Lc.XMP:case Lc.IFRAME:case Lc.NOEMBED:case Lc.NOFRAMES:case Lc.NOSCRIPT:this.tokenizer.state=qc.RAWTEXT;break;case Lc.SCRIPT:this.tokenizer.state=qc.SCRIPT_DATA;break;case Lc.PLAINTEXT:this.tokenizer.state=qc.PLAINTEXT}}In(t){const e=t.name||"",n=t.publicId||"",r=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,e,n,r),t.location){const e=this.treeAdapter.getChildNodes(this.document).find(t=>this.treeAdapter.isDocumentTypeNode(t));e&&this.treeAdapter.setNodeSourceCodeLocation(e,t.location)}}Mn(t,e){if(this.options.sourceCodeLocationInfo){const n=e&&{...e,startTag:e};this.treeAdapter.setNodeSourceCodeLocation(t,n)}if(this.Fn())this.$n(t);else{const e=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(null!=e?e:this.document,t)}}Un(t,e){const n=this.treeAdapter.createElement(t.tagName,e,t.attrs);this.Mn(n,t.location)}_n(t,e){const n=this.treeAdapter.createElement(t.tagName,e,t.attrs);this.Mn(n,t.location),this.openElements.push(n,t.tagID)}Bn(t,e){const n=this.treeAdapter.createElement(t,kc.HTML,[]);this.Mn(n,null),this.openElements.push(n,e)}qn(t){const e=this.treeAdapter.createElement(t.tagName,kc.HTML,t.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(e,n),this.Mn(e,t.location),this.openElements.push(e,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}An(){const t=this.treeAdapter.createElement(Dc.HTML,kc.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,Lc.HTML)}jn(t,e){const n=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(e,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,t.location)}Hn(t){let e,n;if(this.Fn()?(({parent:e,beforeElement:n}=this.zn()),n?this.treeAdapter.insertTextBefore(e,t.chars,n):this.treeAdapter.insertText(e,t.chars)):(e=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(e,t.chars)),!t.location)return;const r=this.treeAdapter.getChildNodes(e),i=n?r.lastIndexOf(n):r.length,s=r[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:e,endCol:n,endOffset:r}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:e,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}Pn(t,e){for(let n=this.treeAdapter.getFirstChild(t);n;n=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(e,n)}Ln(t,e){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&e.location){const n=e.location,r=this.treeAdapter.getTagName(t),i=e.type===sc.END_TAG&&r===e.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,i)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let e,n;return 0===this.openElements.stackTop&&this.fragmentContext?(e=this.fragmentContext,n=this.fragmentContextID):({current:e,currentTagId:n}=this.openElements),(t.tagID!==Lc.SVG||this.treeAdapter.getTagName(e)!==Dc.ANNOTATION_XML||this.treeAdapter.getNamespaceURI(e)!==kc.MATHML)&&(this.tokenizer.inForeignNode||(t.tagID===Lc.MGLYPH||t.tagID===Lc.MALIGNMARK)&&void 0!==n&&!this.Rn(n,e,kc.HTML))}Wn(t){switch(t.type){case sc.CHARACTER:this.onCharacter(t);break;case sc.NULL_CHARACTER:this.onNullCharacter(t);break;case sc.COMMENT:this.onComment(t);break;case sc.DOCTYPE:this.onDoctype(t);break;case sc.START_TAG:this.Gn(t);break;case sc.END_TAG:this.onEndTag(t);break;case sc.EOF:this.onEof(t);break;case sc.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(t)}}Rn(t,e,n){return function(t,e,n,r){return(!r||r===kc.HTML)&&function(t,e,n){if(e===kc.MATHML&&t===Lc.ANNOTATION_XML)for(let t=0;t<n.length;t++)if(n[t].name===Tc.ENCODING){const e=n[t].value.toLowerCase();return"text/html"===e||"application/xhtml+xml"===e}return e===kc.SVG&&(t===Lc.FOREIGN_OBJECT||t===Lc.DESC||t===Lc.TITLE)}(t,e,n)||(!r||r===kc.MATHML)&&function(t,e){return e===kc.MATHML&&(t===Lc.MI||t===Lc.MO||t===Lc.MN||t===Lc.MS||t===Lc.MTEXT)}(t,e)}(t,this.treeAdapter.getNamespaceURI(e),this.treeAdapter.getAttrList(e),n)}Vn(){const t=this.activeFormattingElements.entries.length;if(t){const e=this.activeFormattingElements.entries.findIndex(t=>t.type===Yc.Marker||this.openElements.contains(t.element));for(let n=-1===e?t-1:e-1;n>=0;n--){const t=this.activeFormattingElements.entries[n];this._n(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}Yn(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=bh.IN_ROW}Kn(){this.openElements.generateImpliedEndTagsWithExclusion(Lc.P),this.openElements.popUntilTagNamePopped(Lc.P)}Cn(){for(let t=this.openElements.stackTop;t>=0;t--)switch(0===t&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case Lc.TR:return void(this.insertionMode=bh.IN_ROW);case Lc.TBODY:case Lc.THEAD:case Lc.TFOOT:return void(this.insertionMode=bh.IN_TABLE_BODY);case Lc.CAPTION:return void(this.insertionMode=bh.IN_CAPTION);case Lc.COLGROUP:return void(this.insertionMode=bh.IN_COLUMN_GROUP);case Lc.TABLE:return void(this.insertionMode=bh.IN_TABLE);case Lc.BODY:return void(this.insertionMode=bh.IN_BODY);case Lc.FRAMESET:return void(this.insertionMode=bh.IN_FRAMESET);case Lc.SELECT:return void this.Xn(t);case Lc.TEMPLATE:return void(this.insertionMode=this.tmplInsertionModeStack[0]);case Lc.HTML:return void(this.insertionMode=this.headElement?bh.AFTER_HEAD:bh.BEFORE_HEAD);case Lc.TD:case Lc.TH:if(t>0)return void(this.insertionMode=bh.IN_CELL);break;case Lc.HEAD:if(t>0)return void(this.insertionMode=bh.IN_HEAD)}this.insertionMode=bh.IN_BODY}Xn(t){if(t>0)for(let e=t-1;e>0;e--){const t=this.openElements.tagIDs[e];if(t===Lc.TEMPLATE)break;if(t===Lc.TABLE)return void(this.insertionMode=bh.IN_SELECT_IN_TABLE)}this.insertionMode=bh.IN_SELECT}Zn(t){return Ph.has(t)}Fn(){return this.fosterParentingEnabled&&void 0!==this.openElements.currentTagId&&this.Zn(this.openElements.currentTagId)}zn(){for(let t=this.openElements.stackTop;t>=0;t--){const e=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case Lc.TEMPLATE:if(this.treeAdapter.getNamespaceURI(e)===kc.HTML)return{parent:this.treeAdapter.getTemplateContent(e),beforeElement:null};break;case Lc.TABLE:{const n=this.treeAdapter.getParentNode(e);return n?{parent:n,beforeElement:e}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}$n(t){const e=this.zn();e.beforeElement?this.treeAdapter.insertBefore(e.parent,t,e.beforeElement):this.treeAdapter.appendChild(e.parent,t)}Jn(t,e){const n=this.treeAdapter.getNamespaceURI(t);return Uc[n].has(e)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)!function(t,e){t.Hn(e),t.framesetOk=!1}(this,t);else switch(this.insertionMode){case bh.INITIAL:qh(this,t);break;case bh.BEFORE_HTML:jh(this,t);break;case bh.BEFORE_HEAD:Hh(this,t);break;case bh.IN_HEAD:Gh(this,t);break;case bh.IN_HEAD_NO_SCRIPT:Vh(this,t);break;case bh.AFTER_HEAD:Yh(this,t);break;case bh.IN_BODY:case bh.IN_CAPTION:case bh.IN_CELL:case bh.IN_TEMPLATE:Zh(this,t);break;case bh.TEXT:case bh.IN_SELECT:case bh.IN_SELECT_IN_TABLE:this.Hn(t);break;case bh.IN_TABLE:case bh.IN_TABLE_BODY:case bh.IN_ROW:au(this,t);break;case bh.IN_TABLE_TEXT:uu(this,t);break;case bh.IN_COLUMN_GROUP:gu(this,t);break;case bh.AFTER_BODY:Tu(this,t);break;case bh.AFTER_AFTER_BODY:xu(this,t)}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)!function(t,e){e.chars=Jl,t.Hn(e)}(this,t);else switch(this.insertionMode){case bh.INITIAL:qh(this,t);break;case bh.BEFORE_HTML:jh(this,t);break;case bh.BEFORE_HEAD:Hh(this,t);break;case bh.IN_HEAD:Gh(this,t);break;case bh.IN_HEAD_NO_SCRIPT:Vh(this,t);break;case bh.AFTER_HEAD:Yh(this,t);break;case bh.TEXT:this.Hn(t);break;case bh.IN_TABLE:case bh.IN_TABLE_BODY:case bh.IN_ROW:au(this,t);break;case bh.IN_COLUMN_GROUP:gu(this,t);break;case bh.AFTER_BODY:Tu(this,t);break;case bh.AFTER_AFTER_BODY:xu(this,t)}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML)Uh(this,t);else switch(this.insertionMode){case bh.INITIAL:case bh.BEFORE_HTML:case bh.BEFORE_HEAD:case bh.IN_HEAD:case bh.IN_HEAD_NO_SCRIPT:case bh.AFTER_HEAD:case bh.IN_BODY:case bh.IN_TABLE:case bh.IN_CAPTION:case bh.IN_COLUMN_GROUP:case bh.IN_TABLE_BODY:case bh.IN_ROW:case bh.IN_CELL:case bh.IN_SELECT:case bh.IN_SELECT_IN_TABLE:case bh.IN_TEMPLATE:case bh.IN_FRAMESET:case bh.AFTER_FRAMESET:Uh(this,t);break;case bh.IN_TABLE_TEXT:fu(this,t);break;case bh.AFTER_BODY:!function(t,e){t.jn(e,t.openElements.items[0])}(this,t);break;case bh.AFTER_AFTER_BODY:case bh.AFTER_AFTER_FRAMESET:!function(t,e){t.jn(e,t.document)}(this,t)}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case bh.INITIAL:!function(t,e){t.In(e);const n=e.forceQuirks?Ac.QUIRKS:function(t){if(t.name!==fh)return Ac.QUIRKS;const{systemId:e}=t;if(e&&"http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"===e.toLowerCase())return Ac.QUIRKS;let{publicId:n}=t;if(null!==n){if(n=n.toLowerCase(),gh.has(n))return Ac.QUIRKS;let t=null===e?ph:dh;if(yh(n,t))return Ac.QUIRKS;if(t=null===e?mh:wh,yh(n,t))return Ac.LIMITED_QUIRKS}return Ac.NO_QUIRKS}(e);(function(t){return t.name===fh&&null===t.publicId&&(null===t.systemId||"about:legacy-compat"===t.systemId)})(e)||t.Et(e,Ql.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=bh.BEFORE_HTML}(this,t);break;case bh.BEFORE_HEAD:case bh.IN_HEAD:case bh.IN_HEAD_NO_SCRIPT:case bh.AFTER_HEAD:this.Et(t,Ql.misplacedDoctype);break;case bh.IN_TABLE_TEXT:fu(this,t)}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.Gn(t),t.selfClosing&&!t.ackSelfClosing&&this.Et(t,Ql.nonVoidHtmlElementStartTagWithTrailingSolidus)}Gn(t){this.shouldProcessStartTagTokenInForeignContent(t)?function(t,e){if(function(t){const e=t.tagID;return e===Lc.FONT&&t.attrs.some(({name:t})=>t===Tc.COLOR||t===Tc.SIZE||t===Tc.FACE)||Th.has(e)}(e))Au(t),t.Qn(e);else{const n=t.On(),r=t.treeAdapter.getNamespaceURI(n);r===kc.MATHML?xh(e):r===kc.SVG&&(function(t){const e=Sh.get(t.tagName);null!=e&&(t.tagName=e,t.tagID=Ic(t.tagName))}(e),Ah(e)),Ch(e),e.selfClosing?t.Un(e,r):t._n(e,r),e.ackSelfClosing=!0}}(this,t):this.Qn(t)}Qn(t){switch(this.insertionMode){case bh.INITIAL:qh(this,t);break;case bh.BEFORE_HTML:!function(t,e){e.tagID===Lc.HTML?(t._n(e,kc.HTML),t.insertionMode=bh.BEFORE_HEAD):jh(t,e)}(this,t);break;case bh.BEFORE_HEAD:!function(t,e){switch(e.tagID){case Lc.HTML:nu(t,e);break;case Lc.HEAD:t._n(e,kc.HTML),t.headElement=t.openElements.current,t.insertionMode=bh.IN_HEAD;break;default:Hh(t,e)}}(this,t);break;case bh.IN_HEAD:zh(this,t);break;case bh.IN_HEAD_NO_SCRIPT:!function(t,e){switch(e.tagID){case Lc.HTML:nu(t,e);break;case Lc.BASEFONT:case Lc.BGSOUND:case Lc.HEAD:case Lc.LINK:case Lc.META:case Lc.NOFRAMES:case Lc.STYLE:zh(t,e);break;case Lc.NOSCRIPT:t.Et(e,Ql.nestedNoscriptInHead);break;default:Vh(t,e)}}(this,t);break;case bh.AFTER_HEAD:!function(t,e){switch(e.tagID){case Lc.HTML:nu(t,e);break;case Lc.BODY:t._n(e,kc.HTML),t.framesetOk=!1,t.insertionMode=bh.IN_BODY;break;case Lc.FRAMESET:t._n(e,kc.HTML),t.insertionMode=bh.IN_FRAMESET;break;case Lc.BASE:case Lc.BASEFONT:case Lc.BGSOUND:case Lc.LINK:case Lc.META:case Lc.NOFRAMES:case Lc.SCRIPT:case Lc.STYLE:case Lc.TEMPLATE:case Lc.TITLE:t.Et(e,Ql.abandonedHeadElementChild),t.openElements.push(t.headElement,Lc.HEAD),zh(t,e),t.openElements.remove(t.headElement);break;case Lc.HEAD:t.Et(e,Ql.misplacedStartTagForHeadElement);break;default:Yh(t,e)}}(this,t);break;case bh.IN_BODY:nu(this,t);break;case bh.IN_TABLE:ou(this,t);break;case bh.IN_TABLE_TEXT:fu(this,t);break;case bh.IN_CAPTION:!function(t,e){const n=e.tagID;du.has(n)?t.openElements.hasInTableScope(Lc.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(Lc.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=bh.IN_TABLE,ou(t,e)):nu(t,e)}(this,t);break;case bh.IN_COLUMN_GROUP:pu(this,t);break;case bh.IN_TABLE_BODY:mu(this,t);break;case bh.IN_ROW:yu(this,t);break;case bh.IN_CELL:!function(t,e){const n=e.tagID;du.has(n)?(t.openElements.hasInTableScope(Lc.TD)||t.openElements.hasInTableScope(Lc.TH))&&(t.Yn(),yu(t,e)):nu(t,e)}(this,t);break;case bh.IN_SELECT:vu(this,t);break;case bh.IN_SELECT_IN_TABLE:!function(t,e){const n=e.tagID;n===Lc.CAPTION||n===Lc.TABLE||n===Lc.TBODY||n===Lc.TFOOT||n===Lc.THEAD||n===Lc.TR||n===Lc.TD||n===Lc.TH?(t.openElements.popUntilTagNamePopped(Lc.SELECT),t.Cn(),t.Gn(e)):vu(t,e)}(this,t);break;case bh.IN_TEMPLATE:!function(t,e){switch(e.tagID){case Lc.BASE:case Lc.BASEFONT:case Lc.BGSOUND:case Lc.LINK:case Lc.META:case Lc.NOFRAMES:case Lc.SCRIPT:case Lc.STYLE:case Lc.TEMPLATE:case Lc.TITLE:zh(t,e);break;case Lc.CAPTION:case Lc.COLGROUP:case Lc.TBODY:case Lc.TFOOT:case Lc.THEAD:t.tmplInsertionModeStack[0]=bh.IN_TABLE,t.insertionMode=bh.IN_TABLE,ou(t,e);break;case Lc.COL:t.tmplInsertionModeStack[0]=bh.IN_COLUMN_GROUP,t.insertionMode=bh.IN_COLUMN_GROUP,pu(t,e);break;case Lc.TR:t.tmplInsertionModeStack[0]=bh.IN_TABLE_BODY,t.insertionMode=bh.IN_TABLE_BODY,mu(t,e);break;case Lc.TD:case Lc.TH:t.tmplInsertionModeStack[0]=bh.IN_ROW,t.insertionMode=bh.IN_ROW,yu(t,e);break;default:t.tmplInsertionModeStack[0]=bh.IN_BODY,t.insertionMode=bh.IN_BODY,nu(t,e)}}(this,t);break;case bh.AFTER_BODY:!function(t,e){e.tagID===Lc.HTML?nu(t,e):Tu(t,e)}(this,t);break;case bh.IN_FRAMESET:!function(t,e){switch(e.tagID){case Lc.HTML:nu(t,e);break;case Lc.FRAMESET:t._n(e,kc.HTML);break;case Lc.FRAME:t.Un(e,kc.HTML),e.ackSelfClosing=!0;break;case Lc.NOFRAMES:zh(t,e)}}(this,t);break;case bh.AFTER_FRAMESET:!function(t,e){switch(e.tagID){case Lc.HTML:nu(t,e);break;case Lc.NOFRAMES:zh(t,e)}}(this,t);break;case bh.AFTER_AFTER_BODY:!function(t,e){e.tagID===Lc.HTML?nu(t,e):xu(t,e)}(this,t);break;case bh.AFTER_AFTER_FRAMESET:!function(t,e){switch(e.tagID){case Lc.HTML:nu(t,e);break;case Lc.NOFRAMES:zh(t,e)}}(this,t)}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?function(t,e){if(e.tagID===Lc.P||e.tagID===Lc.BR)return Au(t),void t.er(e);for(let n=t.openElements.stackTop;n>0;n--){const r=t.openElements.items[n];if(t.treeAdapter.getNamespaceURI(r)===kc.HTML){t.er(e);break}const i=t.treeAdapter.getTagName(r);if(i.toLowerCase()===e.tagName){e.tagName=i,t.openElements.shortenToLength(n);break}}}(this,t):this.er(t)}er(t){switch(this.insertionMode){case bh.INITIAL:qh(this,t);break;case bh.BEFORE_HTML:!function(t,e){const n=e.tagID;n!==Lc.HTML&&n!==Lc.HEAD&&n!==Lc.BODY&&n!==Lc.BR||jh(t,e)}(this,t);break;case bh.BEFORE_HEAD:!function(t,e){const n=e.tagID;n===Lc.HEAD||n===Lc.BODY||n===Lc.HTML||n===Lc.BR?Hh(t,e):t.Et(e,Ql.endTagWithoutMatchingOpenElement)}(this,t);break;case bh.IN_HEAD:!function(t,e){switch(e.tagID){case Lc.HEAD:t.openElements.pop(),t.insertionMode=bh.AFTER_HEAD;break;case Lc.BODY:case Lc.BR:case Lc.HTML:Gh(t,e);break;case Lc.TEMPLATE:Wh(t,e);break;default:t.Et(e,Ql.endTagWithoutMatchingOpenElement)}}(this,t);break;case bh.IN_HEAD_NO_SCRIPT:!function(t,e){switch(e.tagID){case Lc.NOSCRIPT:t.openElements.pop(),t.insertionMode=bh.IN_HEAD;break;case Lc.BR:Vh(t,e);break;default:t.Et(e,Ql.endTagWithoutMatchingOpenElement)}}(this,t);break;case bh.AFTER_HEAD:!function(t,e){switch(e.tagID){case Lc.BODY:case Lc.HTML:case Lc.BR:Yh(t,e);break;case Lc.TEMPLATE:Wh(t,e);break;default:t.Et(e,Ql.endTagWithoutMatchingOpenElement)}}(this,t);break;case bh.IN_BODY:iu(this,t);break;case bh.TEXT:!function(t,e){var n;e.tagID===Lc.SCRIPT&&(null===(n=t.scriptHandler)||void 0===n||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}(this,t);break;case bh.IN_TABLE:lu(this,t);break;case bh.IN_TABLE_TEXT:fu(this,t);break;case bh.IN_CAPTION:!function(t,e){const n=e.tagID;switch(n){case Lc.CAPTION:case Lc.TABLE:t.openElements.hasInTableScope(Lc.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(Lc.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=bh.IN_TABLE,n===Lc.TABLE&&lu(t,e));break;case Lc.BODY:case Lc.COL:case Lc.COLGROUP:case Lc.HTML:case Lc.TBODY:case Lc.TD:case Lc.TFOOT:case Lc.TH:case Lc.THEAD:case Lc.TR:break;default:iu(t,e)}}(this,t);break;case bh.IN_COLUMN_GROUP:!function(t,e){switch(e.tagID){case Lc.COLGROUP:t.openElements.currentTagId===Lc.COLGROUP&&(t.openElements.pop(),t.insertionMode=bh.IN_TABLE);break;case Lc.TEMPLATE:Wh(t,e);break;case Lc.COL:break;default:gu(t,e)}}(this,t);break;case bh.IN_TABLE_BODY:wu(this,t);break;case bh.IN_ROW:bu(this,t);break;case bh.IN_CELL:!function(t,e){const n=e.tagID;switch(n){case Lc.TD:case Lc.TH:t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=bh.IN_ROW);break;case Lc.TABLE:case Lc.TBODY:case Lc.TFOOT:case Lc.THEAD:case Lc.TR:t.openElements.hasInTableScope(n)&&(t.Yn(),bu(t,e));break;case Lc.BODY:case Lc.CAPTION:case Lc.COL:case Lc.COLGROUP:case Lc.HTML:break;default:iu(t,e)}}(this,t);break;case bh.IN_SELECT:Eu(this,t);break;case bh.IN_SELECT_IN_TABLE:!function(t,e){const n=e.tagID;n===Lc.CAPTION||n===Lc.TABLE||n===Lc.TBODY||n===Lc.TFOOT||n===Lc.THEAD||n===Lc.TR||n===Lc.TD||n===Lc.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(Lc.SELECT),t.Cn(),t.onEndTag(e)):Eu(t,e)}(this,t);break;case bh.IN_TEMPLATE:!function(t,e){e.tagID===Lc.TEMPLATE&&Wh(t,e)}(this,t);break;case bh.AFTER_BODY:Su(this,t);break;case bh.IN_FRAMESET:!function(t,e){e.tagID!==Lc.FRAMESET||t.openElements.isRootHtmlElementCurrent()||(t.openElements.pop(),t.fragmentContext||t.openElements.currentTagId===Lc.FRAMESET||(t.insertionMode=bh.AFTER_FRAMESET))}(this,t);break;case bh.AFTER_FRAMESET:!function(t,e){e.tagID===Lc.HTML&&(t.insertionMode=bh.AFTER_AFTER_FRAMESET)}(this,t);break;case bh.AFTER_AFTER_BODY:xu(this,t)}}onEof(t){switch(this.insertionMode){case bh.INITIAL:qh(this,t);break;case bh.BEFORE_HTML:jh(this,t);break;case bh.BEFORE_HEAD:Hh(this,t);break;case bh.IN_HEAD:Gh(this,t);break;case bh.IN_HEAD_NO_SCRIPT:Vh(this,t);break;case bh.AFTER_HEAD:Yh(this,t);break;case bh.IN_BODY:case bh.IN_TABLE:case bh.IN_CAPTION:case bh.IN_COLUMN_GROUP:case bh.IN_TABLE_BODY:case bh.IN_ROW:case bh.IN_CELL:case bh.IN_SELECT:case bh.IN_SELECT_IN_TABLE:su(this,t);break;case bh.TEXT:!function(t,e){t.Et(e,Ql.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}(this,t);break;case bh.IN_TABLE_TEXT:fu(this,t);break;case bh.IN_TEMPLATE:ku(this,t);break;case bh.AFTER_BODY:case bh.IN_FRAMESET:case bh.AFTER_FRAMESET:case bh.AFTER_AFTER_BODY:case bh.AFTER_AFTER_FRAMESET:Bh(this,t)}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===Kl.LINE_FEED)){if(1===t.chars.length)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode)this.Hn(t);else switch(this.insertionMode){case bh.IN_HEAD:case bh.IN_HEAD_NO_SCRIPT:case bh.AFTER_HEAD:case bh.TEXT:case bh.IN_COLUMN_GROUP:case bh.IN_SELECT:case bh.IN_SELECT_IN_TABLE:case bh.IN_FRAMESET:case bh.AFTER_FRAMESET:this.Hn(t);break;case bh.IN_BODY:case bh.IN_CAPTION:case bh.IN_CELL:case bh.IN_TEMPLATE:case bh.AFTER_BODY:case bh.AFTER_AFTER_BODY:case bh.AFTER_AFTER_FRAMESET:Xh(this,t);break;case bh.IN_TABLE:case bh.IN_TABLE_BODY:case bh.IN_ROW:au(this,t);break;case bh.IN_TABLE_TEXT:hu(this,t)}}};function Nh(t,e){let n=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return n?t.openElements.contains(n.element)?t.openElements.hasInScope(e.tagID)||(n=null):(t.activeFormattingElements.removeEntry(n),n=null):ru(t,e),n}function _h(t,e){let n=null,r=t.openElements.stackTop;for(;r>=0;r--){const i=t.openElements.items[r];if(i===e.element)break;t.Jn(i,t.openElements.tagIDs[r])&&(n=i)}return n||(t.openElements.shortenToLength(Math.max(r,0)),t.activeFormattingElements.removeEntry(e)),n}function Oh(t,e,n){let r=e,i=t.openElements.getCommonAncestor(e);for(let s=0,a=i;a!==n;s++,a=i){i=t.openElements.getCommonAncestor(a);const n=t.activeFormattingElements.getElementEntry(a),o=n&&s>=3;!n||o?(o&&t.activeFormattingElements.removeEntry(n),t.openElements.remove(a)):(a=Ih(t,n),r===e&&(t.activeFormattingElements.bookmark=n),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(a,r),r=a)}return r}function Ih(t,e){const n=t.treeAdapter.getNamespaceURI(e.element),r=t.treeAdapter.createElement(e.token.tagName,n,e.token.attrs);return t.openElements.replace(e.element,r),e.element=r,r}function Mh(t,e,n){const r=Ic(t.treeAdapter.getTagName(e));if(t.Zn(r))t.$n(n);else{const i=t.treeAdapter.getNamespaceURI(e);r===Lc.TEMPLATE&&i===kc.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function Fh(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=t.treeAdapter.createElement(i.tagName,r,i.attrs);t.Pn(e,s),t.treeAdapter.appendChild(e,s),t.activeFormattingElements.insertElementAfterBookmark(s,i),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,s,i.tagID)}function $h(t,e){for(let n=0;n<8;n++){const n=Nh(t,e);if(!n)break;const r=_h(t,n);if(!r)break;t.activeFormattingElements.bookmark=n;const i=Oh(t,r,n.element),s=t.openElements.getCommonAncestor(n.element);t.treeAdapter.detachNode(i),s&&Mh(t,s,i),Fh(t,r,n)}}function Uh(t,e){t.jn(e,t.openElements.currentTmplContentOrNode)}function Bh(t,e){if(t.stopped=!0,e.location){const n=t.fragmentContext?0:2;for(let r=t.openElements.stackTop;r>=n;r--)t.Ln(t.openElements.items[r],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const n=t.openElements.items[0],r=t.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(t.Ln(n,e),t.openElements.stackTop>=1)){const n=t.openElements.items[1],r=t.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&t.Ln(n,e)}}}}function qh(t,e){t.Et(e,Ql.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,Ac.QUIRKS),t.insertionMode=bh.BEFORE_HTML,t.Wn(e)}function jh(t,e){t.An(),t.insertionMode=bh.BEFORE_HEAD,t.Wn(e)}function Hh(t,e){t.Bn(Dc.HEAD,Lc.HEAD),t.headElement=t.openElements.current,t.insertionMode=bh.IN_HEAD,t.Wn(e)}function zh(t,e){switch(e.tagID){case Lc.HTML:nu(t,e);break;case Lc.BASE:case Lc.BASEFONT:case Lc.BGSOUND:case Lc.LINK:case Lc.META:t.Un(e,kc.HTML),e.ackSelfClosing=!0;break;case Lc.TITLE:t.Nn(e,qc.RCDATA);break;case Lc.NOSCRIPT:t.options.scriptingEnabled?t.Nn(e,qc.RAWTEXT):(t._n(e,kc.HTML),t.insertionMode=bh.IN_HEAD_NO_SCRIPT);break;case Lc.NOFRAMES:case Lc.STYLE:t.Nn(e,qc.RAWTEXT);break;case Lc.SCRIPT:t.Nn(e,qc.SCRIPT_DATA);break;case Lc.TEMPLATE:t.qn(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=bh.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(bh.IN_TEMPLATE);break;case Lc.HEAD:t.Et(e,Ql.misplacedStartTagForHeadElement);break;default:Gh(t,e)}}function Wh(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==Lc.TEMPLATE&&t.Et(e,Ql.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(Lc.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t.Cn()):t.Et(e,Ql.endTagWithoutMatchingOpenElement)}function Gh(t,e){t.openElements.pop(),t.insertionMode=bh.AFTER_HEAD,t.Wn(e)}function Vh(t,e){const n=e.type===sc.EOF?Ql.openElementsLeftAfterEof:Ql.disallowedContentInNoscriptInHead;t.Et(e,n),t.openElements.pop(),t.insertionMode=bh.IN_HEAD,t.Wn(e)}function Yh(t,e){t.Bn(Dc.BODY,Lc.BODY),t.insertionMode=bh.IN_BODY,Kh(t,e)}function Kh(t,e){switch(e.type){case sc.CHARACTER:Zh(t,e);break;case sc.WHITESPACE_CHARACTER:Xh(t,e);break;case sc.COMMENT:Uh(t,e);break;case sc.START_TAG:nu(t,e);break;case sc.END_TAG:iu(t,e);break;case sc.EOF:su(t,e)}}function Xh(t,e){t.Vn(),t.Hn(e)}function Zh(t,e){t.Vn(),t.Hn(e),t.framesetOk=!1}function Jh(t,e){t.Vn(),t.Un(e,kc.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function Qh(t){const e=lc(t,Tc.TYPE);return null!=e&&"hidden"===e.toLowerCase()}function tu(t,e){t.Nn(e,qc.RAWTEXT)}function eu(t,e){t.Vn(),t._n(e,kc.HTML)}function nu(t,e){switch(e.tagID){case Lc.I:case Lc.S:case Lc.B:case Lc.U:case Lc.EM:case Lc.TT:case Lc.BIG:case Lc.CODE:case Lc.FONT:case Lc.SMALL:case Lc.STRIKE:case Lc.STRONG:!function(t,e){t.Vn(),t._n(e,kc.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}(t,e);break;case Lc.A:!function(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(Dc.A);n&&($h(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t.Vn(),t._n(e,kc.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}(t,e);break;case Lc.H1:case Lc.H2:case Lc.H3:case Lc.H4:case Lc.H5:case Lc.H6:!function(t,e){t.openElements.hasInButtonScope(Lc.P)&&t.Kn(),void 0!==t.openElements.currentTagId&&Bc.has(t.openElements.currentTagId)&&t.openElements.pop(),t._n(e,kc.HTML)}(t,e);break;case Lc.P:case Lc.DL:case Lc.OL:case Lc.UL:case Lc.DIV:case Lc.DIR:case Lc.NAV:case Lc.MAIN:case Lc.MENU:case Lc.ASIDE:case Lc.CENTER:case Lc.FIGURE:case Lc.FOOTER:case Lc.HEADER:case Lc.HGROUP:case Lc.DIALOG:case Lc.DETAILS:case Lc.ADDRESS:case Lc.ARTICLE:case Lc.SEARCH:case Lc.SECTION:case Lc.SUMMARY:case Lc.FIELDSET:case Lc.BLOCKQUOTE:case Lc.FIGCAPTION:!function(t,e){t.openElements.hasInButtonScope(Lc.P)&&t.Kn(),t._n(e,kc.HTML)}(t,e);break;case Lc.LI:case Lc.DD:case Lc.DT:!function(t,e){t.framesetOk=!1;const n=e.tagID;for(let e=t.openElements.stackTop;e>=0;e--){const r=t.openElements.tagIDs[e];if(n===Lc.LI&&r===Lc.LI||(n===Lc.DD||n===Lc.DT)&&(r===Lc.DD||r===Lc.DT)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.popUntilTagNamePopped(r);break}if(r!==Lc.ADDRESS&&r!==Lc.DIV&&r!==Lc.P&&t.Jn(t.openElements.items[e],r))break}t.openElements.hasInButtonScope(Lc.P)&&t.Kn(),t._n(e,kc.HTML)}(t,e);break;case Lc.BR:case Lc.IMG:case Lc.WBR:case Lc.AREA:case Lc.EMBED:case Lc.KEYGEN:Jh(t,e);break;case Lc.HR:!function(t,e){t.openElements.hasInButtonScope(Lc.P)&&t.Kn(),t.Un(e,kc.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}(t,e);break;case Lc.RB:case Lc.RTC:!function(t,e){t.openElements.hasInScope(Lc.RUBY)&&t.openElements.generateImpliedEndTags(),t._n(e,kc.HTML)}(t,e);break;case Lc.RT:case Lc.RP:!function(t,e){t.openElements.hasInScope(Lc.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(Lc.RTC),t._n(e,kc.HTML)}(t,e);break;case Lc.PRE:case Lc.LISTING:!function(t,e){t.openElements.hasInButtonScope(Lc.P)&&t.Kn(),t._n(e,kc.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}(t,e);break;case Lc.XMP:!function(t,e){t.openElements.hasInButtonScope(Lc.P)&&t.Kn(),t.Vn(),t.framesetOk=!1,t.Nn(e,qc.RAWTEXT)}(t,e);break;case Lc.SVG:!function(t,e){t.Vn(),Ah(e),Ch(e),e.selfClosing?t.Un(e,kc.SVG):t._n(e,kc.SVG),e.ackSelfClosing=!0}(t,e);break;case Lc.HTML:!function(t,e){0===t.openElements.tmplCount&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}(t,e);break;case Lc.BASE:case Lc.LINK:case Lc.META:case Lc.STYLE:case Lc.TITLE:case Lc.SCRIPT:case Lc.BGSOUND:case Lc.BASEFONT:case Lc.TEMPLATE:zh(t,e);break;case Lc.BODY:!function(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&0===t.openElements.tmplCount&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}(t,e);break;case Lc.FORM:!function(t,e){const n=t.openElements.tmplCount>0;t.formElement&&!n||(t.openElements.hasInButtonScope(Lc.P)&&t.Kn(),t._n(e,kc.HTML),n||(t.formElement=t.openElements.current))}(t,e);break;case Lc.NOBR:!function(t,e){t.Vn(),t.openElements.hasInScope(Lc.NOBR)&&($h(t,e),t.Vn()),t._n(e,kc.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}(t,e);break;case Lc.MATH:!function(t,e){t.Vn(),xh(e),Ch(e),e.selfClosing?t.Un(e,kc.MATHML):t._n(e,kc.MATHML),e.ackSelfClosing=!0}(t,e);break;case Lc.TABLE:!function(t,e){t.treeAdapter.getDocumentMode(t.document)!==Ac.QUIRKS&&t.openElements.hasInButtonScope(Lc.P)&&t.Kn(),t._n(e,kc.HTML),t.framesetOk=!1,t.insertionMode=bh.IN_TABLE}(t,e);break;case Lc.INPUT:!function(t,e){t.Vn(),t.Un(e,kc.HTML),Qh(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}(t,e);break;case Lc.PARAM:case Lc.TRACK:case Lc.SOURCE:!function(t,e){t.Un(e,kc.HTML),e.ackSelfClosing=!0}(t,e);break;case Lc.IMAGE:!function(t,e){e.tagName=Dc.IMG,e.tagID=Lc.IMG,Jh(t,e)}(t,e);break;case Lc.BUTTON:!function(t,e){t.openElements.hasInScope(Lc.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(Lc.BUTTON)),t.Vn(),t._n(e,kc.HTML),t.framesetOk=!1}(t,e);break;case Lc.APPLET:case Lc.OBJECT:case Lc.MARQUEE:!function(t,e){t.Vn(),t._n(e,kc.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}(t,e);break;case Lc.IFRAME:!function(t,e){t.framesetOk=!1,t.Nn(e,qc.RAWTEXT)}(t,e);break;case Lc.SELECT:!function(t,e){t.Vn(),t._n(e,kc.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===bh.IN_TABLE||t.insertionMode===bh.IN_CAPTION||t.insertionMode===bh.IN_TABLE_BODY||t.insertionMode===bh.IN_ROW||t.insertionMode===bh.IN_CELL?bh.IN_SELECT_IN_TABLE:bh.IN_SELECT}(t,e);break;case Lc.OPTION:case Lc.OPTGROUP:!function(t,e){t.openElements.currentTagId===Lc.OPTION&&t.openElements.pop(),t.Vn(),t._n(e,kc.HTML)}(t,e);break;case Lc.NOEMBED:case Lc.NOFRAMES:tu(t,e);break;case Lc.FRAMESET:!function(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._n(e,kc.HTML),t.insertionMode=bh.IN_FRAMESET)}(t,e);break;case Lc.TEXTAREA:!function(t,e){t._n(e,kc.HTML),t.skipNextNewLine=!0,t.tokenizer.state=qc.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=bh.TEXT}(t,e);break;case Lc.NOSCRIPT:t.options.scriptingEnabled?tu(t,e):eu(t,e);break;case Lc.PLAINTEXT:!function(t,e){t.openElements.hasInButtonScope(Lc.P)&&t.Kn(),t._n(e,kc.HTML),t.tokenizer.state=qc.PLAINTEXT}(t,e);break;case Lc.COL:case Lc.TH:case Lc.TD:case Lc.TR:case Lc.HEAD:case Lc.FRAME:case Lc.TBODY:case Lc.TFOOT:case Lc.THEAD:case Lc.CAPTION:case Lc.COLGROUP:break;default:eu(t,e)}}function ru(t,e){const n=e.tagName,r=e.tagID;for(let e=t.openElements.stackTop;e>0;e--){const i=t.openElements.items[e],s=t.openElements.tagIDs[e];if(r===s&&(r!==Lc.UNKNOWN||t.treeAdapter.getTagName(i)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=e&&t.openElements.shortenToLength(e);break}if(t.Jn(i,s))break}}function iu(t,e){switch(e.tagID){case Lc.A:case Lc.B:case Lc.I:case Lc.S:case Lc.U:case Lc.EM:case Lc.TT:case Lc.BIG:case Lc.CODE:case Lc.FONT:case Lc.NOBR:case Lc.SMALL:case Lc.STRIKE:case Lc.STRONG:$h(t,e);break;case Lc.P:!function(t){t.openElements.hasInButtonScope(Lc.P)||t.Bn(Dc.P,Lc.P),t.Kn()}(t);break;case Lc.DL:case Lc.UL:case Lc.OL:case Lc.DIR:case Lc.DIV:case Lc.NAV:case Lc.PRE:case Lc.MAIN:case Lc.MENU:case Lc.ASIDE:case Lc.BUTTON:case Lc.CENTER:case Lc.FIGURE:case Lc.FOOTER:case Lc.HEADER:case Lc.HGROUP:case Lc.DIALOG:case Lc.ADDRESS:case Lc.ARTICLE:case Lc.DETAILS:case Lc.SEARCH:case Lc.SECTION:case Lc.SUMMARY:case Lc.LISTING:case Lc.FIELDSET:case Lc.BLOCKQUOTE:case Lc.FIGCAPTION:!function(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}(t,e);break;case Lc.LI:!function(t){t.openElements.hasInListItemScope(Lc.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(Lc.LI),t.openElements.popUntilTagNamePopped(Lc.LI))}(t);break;case Lc.DD:case Lc.DT:!function(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}(t,e);break;case Lc.H1:case Lc.H2:case Lc.H3:case Lc.H4:case Lc.H5:case Lc.H6:!function(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}(t);break;case Lc.BR:!function(t){t.Vn(),t.Bn(Dc.BR,Lc.BR),t.openElements.pop(),t.framesetOk=!1}(t);break;case Lc.BODY:!function(t,e){if(t.openElements.hasInScope(Lc.BODY)&&(t.insertionMode=bh.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.Ln(n,e)}}(t,e);break;case Lc.HTML:!function(t,e){t.openElements.hasInScope(Lc.BODY)&&(t.insertionMode=bh.AFTER_BODY,Su(t,e))}(t,e);break;case Lc.FORM:!function(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(Lc.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(Lc.FORM):n&&t.openElements.remove(n))}(t);break;case Lc.APPLET:case Lc.OBJECT:case Lc.MARQUEE:!function(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}(t,e);break;case Lc.TEMPLATE:Wh(t,e);break;default:ru(t,e)}}function su(t,e){t.tmplInsertionModeStack.length>0?ku(t,e):Bh(t,e)}function au(t,e){if(void 0!==t.openElements.currentTagId&&Ph.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=bh.IN_TABLE_TEXT,e.type){case sc.CHARACTER:uu(t,e);break;case sc.WHITESPACE_CHARACTER:hu(t,e)}else cu(t,e)}function ou(t,e){switch(e.tagID){case Lc.TD:case Lc.TH:case Lc.TR:!function(t,e){t.openElements.clearBackToTableContext(),t.Bn(Dc.TBODY,Lc.TBODY),t.insertionMode=bh.IN_TABLE_BODY,mu(t,e)}(t,e);break;case Lc.STYLE:case Lc.SCRIPT:case Lc.TEMPLATE:zh(t,e);break;case Lc.COL:!function(t,e){t.openElements.clearBackToTableContext(),t.Bn(Dc.COLGROUP,Lc.COLGROUP),t.insertionMode=bh.IN_COLUMN_GROUP,pu(t,e)}(t,e);break;case Lc.FORM:!function(t,e){t.formElement||0!==t.openElements.tmplCount||(t._n(e,kc.HTML),t.formElement=t.openElements.current,t.openElements.pop())}(t,e);break;case Lc.TABLE:!function(t,e){t.openElements.hasInTableScope(Lc.TABLE)&&(t.openElements.popUntilTagNamePopped(Lc.TABLE),t.Cn(),t.Gn(e))}(t,e);break;case Lc.TBODY:case Lc.TFOOT:case Lc.THEAD:!function(t,e){t.openElements.clearBackToTableContext(),t._n(e,kc.HTML),t.insertionMode=bh.IN_TABLE_BODY}(t,e);break;case Lc.INPUT:!function(t,e){Qh(e)?t.Un(e,kc.HTML):cu(t,e),e.ackSelfClosing=!0}(t,e);break;case Lc.CAPTION:!function(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._n(e,kc.HTML),t.insertionMode=bh.IN_CAPTION}(t,e);break;case Lc.COLGROUP:!function(t,e){t.openElements.clearBackToTableContext(),t._n(e,kc.HTML),t.insertionMode=bh.IN_COLUMN_GROUP}(t,e);break;default:cu(t,e)}}function lu(t,e){switch(e.tagID){case Lc.TABLE:t.openElements.hasInTableScope(Lc.TABLE)&&(t.openElements.popUntilTagNamePopped(Lc.TABLE),t.Cn());break;case Lc.TEMPLATE:Wh(t,e);break;case Lc.BODY:case Lc.CAPTION:case Lc.COL:case Lc.COLGROUP:case Lc.HTML:case Lc.TBODY:case Lc.TD:case Lc.TFOOT:case Lc.TH:case Lc.THEAD:case Lc.TR:break;default:cu(t,e)}}function cu(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,Kh(t,e),t.fosterParentingEnabled=n}function hu(t,e){t.pendingCharacterTokens.push(e)}function uu(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function fu(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)cu(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t.Hn(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t.Wn(e)}var du=new Set([Lc.CAPTION,Lc.COL,Lc.COLGROUP,Lc.TBODY,Lc.TD,Lc.TFOOT,Lc.TH,Lc.THEAD,Lc.TR]);function pu(t,e){switch(e.tagID){case Lc.HTML:nu(t,e);break;case Lc.COL:t.Un(e,kc.HTML),e.ackSelfClosing=!0;break;case Lc.TEMPLATE:zh(t,e);break;default:gu(t,e)}}function gu(t,e){t.openElements.currentTagId===Lc.COLGROUP&&(t.openElements.pop(),t.insertionMode=bh.IN_TABLE,t.Wn(e))}function mu(t,e){switch(e.tagID){case Lc.TR:t.openElements.clearBackToTableBodyContext(),t._n(e,kc.HTML),t.insertionMode=bh.IN_ROW;break;case Lc.TH:case Lc.TD:t.openElements.clearBackToTableBodyContext(),t.Bn(Dc.TR,Lc.TR),t.insertionMode=bh.IN_ROW,yu(t,e);break;case Lc.CAPTION:case Lc.COL:case Lc.COLGROUP:case Lc.TBODY:case Lc.TFOOT:case Lc.THEAD:t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=bh.IN_TABLE,ou(t,e));break;default:ou(t,e)}}function wu(t,e){const n=e.tagID;switch(e.tagID){case Lc.TBODY:case Lc.TFOOT:case Lc.THEAD:t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=bh.IN_TABLE);break;case Lc.TABLE:t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=bh.IN_TABLE,lu(t,e));break;case Lc.BODY:case Lc.CAPTION:case Lc.COL:case Lc.COLGROUP:case Lc.HTML:case Lc.TD:case Lc.TH:case Lc.TR:break;default:lu(t,e)}}function yu(t,e){switch(e.tagID){case Lc.TH:case Lc.TD:t.openElements.clearBackToTableRowContext(),t._n(e,kc.HTML),t.insertionMode=bh.IN_CELL,t.activeFormattingElements.insertMarker();break;case Lc.CAPTION:case Lc.COL:case Lc.COLGROUP:case Lc.TBODY:case Lc.TFOOT:case Lc.THEAD:case Lc.TR:t.openElements.hasInTableScope(Lc.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=bh.IN_TABLE_BODY,mu(t,e));break;default:ou(t,e)}}function bu(t,e){switch(e.tagID){case Lc.TR:t.openElements.hasInTableScope(Lc.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=bh.IN_TABLE_BODY);break;case Lc.TABLE:t.openElements.hasInTableScope(Lc.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=bh.IN_TABLE_BODY,wu(t,e));break;case Lc.TBODY:case Lc.TFOOT:case Lc.THEAD:(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(Lc.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=bh.IN_TABLE_BODY,wu(t,e));break;case Lc.BODY:case Lc.CAPTION:case Lc.COL:case Lc.COLGROUP:case Lc.HTML:case Lc.TD:case Lc.TH:break;default:lu(t,e)}}function vu(t,e){switch(e.tagID){case Lc.HTML:nu(t,e);break;case Lc.OPTION:t.openElements.currentTagId===Lc.OPTION&&t.openElements.pop(),t._n(e,kc.HTML);break;case Lc.OPTGROUP:t.openElements.currentTagId===Lc.OPTION&&t.openElements.pop(),t.openElements.currentTagId===Lc.OPTGROUP&&t.openElements.pop(),t._n(e,kc.HTML);break;case Lc.HR:t.openElements.currentTagId===Lc.OPTION&&t.openElements.pop(),t.openElements.currentTagId===Lc.OPTGROUP&&t.openElements.pop(),t.Un(e,kc.HTML),e.ackSelfClosing=!0;break;case Lc.INPUT:case Lc.KEYGEN:case Lc.TEXTAREA:case Lc.SELECT:t.openElements.hasInSelectScope(Lc.SELECT)&&(t.openElements.popUntilTagNamePopped(Lc.SELECT),t.Cn(),e.tagID!==Lc.SELECT&&t.Gn(e));break;case Lc.SCRIPT:case Lc.TEMPLATE:zh(t,e)}}function Eu(t,e){switch(e.tagID){case Lc.OPTGROUP:t.openElements.stackTop>0&&t.openElements.currentTagId===Lc.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===Lc.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===Lc.OPTGROUP&&t.openElements.pop();break;case Lc.OPTION:t.openElements.currentTagId===Lc.OPTION&&t.openElements.pop();break;case Lc.SELECT:t.openElements.hasInSelectScope(Lc.SELECT)&&(t.openElements.popUntilTagNamePopped(Lc.SELECT),t.Cn());break;case Lc.TEMPLATE:Wh(t,e)}}function ku(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(Lc.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t.Cn(),t.onEof(e)):Bh(t,e)}function Su(t,e){var n;if(e.tagID===Lc.HTML){if(t.fragmentContext||(t.insertionMode=bh.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===Lc.HTML){t.Ln(t.openElements.items[0],e);const r=t.openElements.items[1];r&&!(null===(n=t.treeAdapter.getNodeSourceCodeLocation(r))||void 0===n?void 0:n.endTag)&&t.Ln(r,e)}}else Tu(t,e)}function Tu(t,e){t.insertionMode=bh.IN_BODY,Kh(t,e)}function xu(t,e){t.insertionMode=bh.IN_BODY,Kh(t,e)}function Au(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==kc.HTML&&void 0!==t.openElements.currentTagId&&!t.Rn(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function Cu(t,e){return Rh.parse(t,e)}function Du(t,e,n){"string"==typeof t&&(n=e,e=t,t=null);const r=Rh.getFragmentParser(t,n);return r.tokenizer.write(e,!0),r.getFragment()}String.prototype.codePointAt,Dc.AREA,Dc.BASE,Dc.BASEFONT,Dc.BGSOUND,Dc.BR,Dc.COL,Dc.EMBED,Dc.FRAME,Dc.HR,Dc.IMG,Dc.INPUT,Dc.KEYGEN,Dc.LINK,Dc.META,Dc.PARAM,Dc.SOURCE,Dc.TRACK,Dc.WBR;var Pu={abandonedHeadElementChild:{reason:"Unexpected metadata element after head",description:"Unexpected element after head. Expected the element before `</head>`",url:!1},abruptClosingOfEmptyComment:{reason:"Unexpected abruptly closed empty comment",description:"Unexpected `>` or `->`. Expected `--\x3e` to close comments"},abruptDoctypePublicIdentifier:{reason:"Unexpected abruptly closed public identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:"Unexpected abruptly closed system identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:"Unexpected non-digit at start of numeric character reference",description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:"Unexpected CDATA section in HTML",description:"Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead"},characterReferenceOutsideUnicodeRange:{reason:"Unexpected too big numeric character reference",description:"Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)"},closingOfElementWithOpenChildElements:{reason:"Unexpected closing tag with open child elements",description:"Unexpectedly closing tag. Expected other tags to be closed first",url:!1},controlCharacterInInputStream:{reason:"Unexpected control character",description:"Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace"},controlCharacterReference:{reason:"Unexpected control character reference",description:"Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace"},disallowedContentInNoscriptInHead:{reason:"Disallowed content inside `<noscript>` in `<head>`",description:"Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`",url:!1},duplicateAttribute:{reason:"Unexpected duplicate attribute",description:"Unexpectedly double attribute. Expected attributes to occur only once"},endTagWithAttributes:{reason:"Unexpected attribute on closing tag",description:"Unexpected attribute. Expected `>` instead"},endTagWithTrailingSolidus:{reason:"Unexpected slash at end of closing tag",description:"Unexpected `%c-1`. Expected `>` instead"},endTagWithoutMatchingOpenElement:{reason:"Unexpected unopened end tag",description:"Unexpected end tag. Expected no end tag or another end tag",url:!1},eofBeforeTagName:{reason:"Unexpected end of file",description:"Unexpected end of file. Expected tag name instead"},eofInCdata:{reason:"Unexpected end of file in CDATA",description:"Unexpected end of file. Expected `]]>` to close the CDATA"},eofInComment:{reason:"Unexpected end of file in comment",description:"Unexpected end of file. Expected `--\x3e` to close the comment"},eofInDoctype:{reason:"Unexpected end of file in doctype",description:"Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)"},eofInElementThatCanContainOnlyText:{reason:"Unexpected end of file in element that can only contain text",description:"Unexpected end of file. Expected text or a closing tag",url:!1},eofInScriptHtmlCommentLikeText:{reason:"Unexpected end of file in comment inside script",description:"Unexpected end of file. Expected `--\x3e` to close the comment"},eofInTag:{reason:"Unexpected end of file in tag",description:"Unexpected end of file. Expected `>` to close the tag"},incorrectlyClosedComment:{reason:"Incorrectly closed comment",description:"Unexpected `%c-1`. Expected `--\x3e` to close the comment"},incorrectlyOpenedComment:{reason:"Incorrectly opened comment",description:"Unexpected `%c`. Expected `\x3c!--` to open the comment"},invalidCharacterSequenceAfterDoctypeName:{reason:"Invalid sequence after doctype name",description:"Unexpected sequence at `%c`. Expected `public` or `system`"},invalidFirstCharacterOfTagName:{reason:"Invalid first character in tag name",description:"Unexpected `%c`. Expected an ASCII letter instead"},misplacedDoctype:{reason:"Misplaced doctype",description:"Unexpected doctype. Expected doctype before head",url:!1},misplacedStartTagForHeadElement:{reason:"Misplaced `<head>` start tag",description:"Unexpected start tag `<head>`. Expected `<head>` directly after doctype",url:!1},missingAttributeValue:{reason:"Missing attribute value",description:"Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead"},missingDoctype:{reason:"Missing doctype before other content",description:"Expected a `<!doctype html>` before anything else",url:!1},missingDoctypeName:{reason:"Missing doctype name",description:"Unexpected doctype end at `%c`. Expected `html` instead"},missingDoctypePublicIdentifier:{reason:"Missing public identifier in doctype",description:"Unexpected `%c`. Expected identifier for `public` instead"},missingDoctypeSystemIdentifier:{reason:"Missing system identifier in doctype",description:'Unexpected `%c`. Expected identifier for `system` instead (suggested: `"about:legacy-compat"`)'},missingEndTagName:{reason:"Missing name in end tag",description:"Unexpected `%c`. Expected an ASCII letter instead"},missingQuoteBeforeDoctypePublicIdentifier:{reason:"Missing quote before public identifier in doctype",description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingQuoteBeforeDoctypeSystemIdentifier:{reason:"Missing quote before system identifier in doctype",description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingSemicolonAfterCharacterReference:{reason:"Missing semicolon after character reference",description:"Unexpected `%c`. Expected `;` instead"},missingWhitespaceAfterDoctypePublicKeyword:{reason:"Missing whitespace after public identifier in doctype",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceAfterDoctypeSystemKeyword:{reason:"Missing whitespace after system identifier in doctype",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBeforeDoctypeName:{reason:"Missing whitespace before doctype name",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenAttributes:{reason:"Missing whitespace between attributes",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:{reason:"Missing whitespace between public and system identifiers in doctype",description:"Unexpected `%c`. Expected ASCII whitespace instead"},nestedComment:{reason:"Unexpected nested comment",description:"Unexpected `\x3c!--`. Expected `--\x3e`"},nestedNoscriptInHead:{reason:"Unexpected nested `<noscript>` in `<head>`",description:"Unexpected `<noscript>`. Expected a closing tag or a meta element",url:!1},nonConformingDoctype:{reason:"Unexpected non-conforming doctype declaration",description:'Expected `<!doctype html>` or `<!doctype html system "about:legacy-compat">`',url:!1},nonVoidHtmlElementStartTagWithTrailingSolidus:{reason:"Unexpected trailing slash on start tag of non-void element",description:"Unexpected `/`. Expected `>` instead"},noncharacterCharacterReference:{reason:"Unexpected noncharacter code point referenced by character reference",description:"Unexpected code point. Do not use noncharacters in HTML"},noncharacterInInputStream:{reason:"Unexpected noncharacter character",description:"Unexpected code point `%x`. Do not use noncharacters in HTML"},nullCharacterReference:{reason:"Unexpected NULL character referenced by character reference",description:"Unexpected code point. Do not use NULL characters in HTML"},openElementsLeftAfterEof:{reason:"Unexpected end of file",description:"Unexpected end of file. Expected closing tag instead",url:!1},surrogateCharacterReference:{reason:"Unexpected surrogate character referenced by character reference",description:"Unexpected code point. Do not use lone surrogate characters in HTML"},surrogateInInputStream:{reason:"Unexpected surrogate character",description:"Unexpected code point `%x`. Do not use lone surrogate characters in HTML"},unexpectedCharacterAfterDoctypeSystemIdentifier:{reason:"Invalid character after system identifier in doctype",description:"Unexpected character at `%c`. Expected `>`"},unexpectedCharacterInAttributeName:{reason:"Unexpected character in attribute name",description:"Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter"},unexpectedCharacterInUnquotedAttributeValue:{reason:"Unexpected character in unquoted attribute value",description:"Unexpected `%c`. Quote the attribute value to include it"},unexpectedEqualsSignBeforeAttributeName:{reason:"Unexpected equals sign before attribute name",description:"Unexpected `%c`. Add an attribute name before it"},unexpectedNullCharacter:{reason:"Unexpected NULL character",description:"Unexpected code point `%x`. Do not use NULL characters in HTML"},unexpectedQuestionMarkInsteadOfTagName:{reason:"Unexpected question mark instead of tag name",description:"Unexpected `%c`. Expected an ASCII letter instead"},unexpectedSolidusInTag:{reason:"Unexpected slash in tag",description:"Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value"},unknownNamedCharacterReference:{reason:"Unexpected unknown named character reference",description:"Unexpected character reference. Expected known named character references"}},Lu=/-[a-z]/g,Ru=/%c(?:([-+])(\d+))?/g,Nu=/%x/g,_u={2:!0,1:!1,0:null},Ou={};function Iu(t){return t.charAt(1).toUpperCase()}function Mu(t){const{emitParseErrors:e,...n}={...this.data("settings"),...t};this.parser=function(t,r){return function(t,e){const n=e||Ou,r=n.onerror,i=t instanceof ro?t:new ro(t),s=n.fragment?Du:Cu,a=String(i),o=s(a,{sourceCodeLocationInfo:!0,onParseError:n.onerror?function(t){const e=t.code,s=function(t){return t.replace(Lu,Iu)}(e),o=n[s],l=null==o||o,c="number"==typeof l?l:l?1:0;if(c){const n=Pu[s],a=new Za(h(n.reason),{place:{start:{line:t.startLine,column:t.startCol,offset:t.startOffset},end:{line:t.endLine,column:t.endCol,offset:t.endOffset}},ruleId:e,source:"hast-util-from-html"});i.path&&(a.file=i.path,a.name=i.path+":"+a.name),a.fatal=_u[c],a.note=h(n.description),a.url=!1===n.url?void 0:"https://html.spec.whatwg.org/multipage/parsing.html#parse-error-"+e,r(a)}function h(e){return e.replace(Ru,function(e,n,r){const i=(r?Number.parseInt(r,10):0)*("-"===n?-1:1);return"`"===(s=a.charAt(t.startOffset+i))?"` ` `":s;var s}).replace(Nu,function(){return"0x"+a.charCodeAt(t.startOffset).toString(16).toUpperCase()})}}:null,scriptingEnabled:!1});return function(t,e){const n=e||{};return zl({file:n.file||void 0,location:!1,schema:"svg"===n.space?Bl:Ul,verbose:n.verbose||!1},t)}(o,{file:i,space:n.space,verbose:n.verbose})}(t,{...n,onerror:e?function(t){r.path&&(t.name=r.path+":"+t.name,t.file=r.path),r.messages.push(t)}:void 0})}}var Fu=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],$u=class{constructor(t,e,n){this.normal=e,this.property=t,n&&(this.space=n)}};function Uu(t,e){const n={},r={};for(const e of t)Object.assign(n,e.property),Object.assign(r,e.normal);return new $u(n,r,e)}function Bu(t){return t.toLowerCase()}$u.prototype.normal={},$u.prototype.property={},$u.prototype.space=void 0;var qu=class{constructor(t,e){this.attribute=e,this.property=t}};qu.prototype.attribute="",qu.prototype.booleanish=!1,qu.prototype.boolean=!1,qu.prototype.commaOrSpaceSeparated=!1,qu.prototype.commaSeparated=!1,qu.prototype.defined=!1,qu.prototype.mustUseProperty=!1,qu.prototype.number=!1,qu.prototype.overloadedBoolean=!1,qu.prototype.property="",qu.prototype.spaceSeparated=!1,qu.prototype.space=void 0;var ju={};p(ju,{boolean:()=>zu,booleanish:()=>Wu,commaOrSpaceSeparated:()=>Xu,commaSeparated:()=>Ku,number:()=>Vu,overloadedBoolean:()=>Gu,spaceSeparated:()=>Yu});var Hu=0,zu=Zu(),Wu=Zu(),Gu=Zu(),Vu=Zu(),Yu=Zu(),Ku=Zu(),Xu=Zu();function Zu(){return 2**++Hu}var Ju=Object.keys(ju),Qu=class extends qu{constructor(t,e,n,r){let i=-1;if(super(t,e),tf(this,"space",r),"number"==typeof n)for(;++i<Ju.length;){const t=Ju[i];tf(this,Ju[i],(n&ju[t])===ju[t])}}};function tf(t,e,n){n&&(t[e]=n)}function ef(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const s=new Qu(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[Bu(r)]=r,n[Bu(s.attribute)]=r}return new $u(e,n,t.space)}Qu.prototype.defined=!0;var nf=ef({properties:{ariaActiveDescendant:null,ariaAtomic:Wu,ariaAutoComplete:null,ariaBusy:Wu,ariaChecked:Wu,ariaColCount:Vu,ariaColIndex:Vu,ariaColSpan:Vu,ariaControls:Yu,ariaCurrent:null,ariaDescribedBy:Yu,ariaDetails:null,ariaDisabled:Wu,ariaDropEffect:Yu,ariaErrorMessage:null,ariaExpanded:Wu,ariaFlowTo:Yu,ariaGrabbed:Wu,ariaHasPopup:null,ariaHidden:Wu,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Yu,ariaLevel:Vu,ariaLive:null,ariaModal:Wu,ariaMultiLine:Wu,ariaMultiSelectable:Wu,ariaOrientation:null,ariaOwns:Yu,ariaPlaceholder:null,ariaPosInSet:Vu,ariaPressed:Wu,ariaReadOnly:Wu,ariaRelevant:null,ariaRequired:Wu,ariaRoleDescription:Yu,ariaRowCount:Vu,ariaRowIndex:Vu,ariaRowSpan:Vu,ariaSelected:Wu,ariaSetSize:Vu,ariaSort:null,ariaValueMax:Vu,ariaValueMin:Vu,ariaValueNow:Vu,ariaValueText:null,role:null},transform:(t,e)=>"role"===e?e:"aria-"+e.slice(4).toLowerCase()});function rf(t,e){return e in t?t[e]:e}function sf(t,e){return rf(t,e.toLowerCase())}var af=ef({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ku,acceptCharset:Yu,accessKey:Yu,action:null,allow:null,allowFullScreen:zu,allowPaymentRequest:zu,allowUserMedia:zu,alt:null,as:null,async:zu,autoCapitalize:null,autoComplete:Yu,autoFocus:zu,autoPlay:zu,blocking:Yu,capture:null,charSet:null,checked:zu,cite:null,className:Yu,cols:Vu,colSpan:null,content:null,contentEditable:Wu,controls:zu,controlsList:Yu,coords:Vu|Ku,crossOrigin:null,data:null,dateTime:null,decoding:null,default:zu,defer:zu,dir:null,dirName:null,disabled:zu,download:Gu,draggable:Wu,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:zu,formTarget:null,headers:Yu,height:Vu,hidden:Gu,high:Vu,href:null,hrefLang:null,htmlFor:Yu,httpEquiv:Yu,id:null,imageSizes:null,imageSrcSet:null,inert:zu,inputMode:null,integrity:null,is:null,isMap:zu,itemId:null,itemProp:Yu,itemRef:Yu,itemScope:zu,itemType:Yu,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:zu,low:Vu,manifest:null,max:null,maxLength:Vu,media:null,method:null,min:null,minLength:Vu,multiple:zu,muted:zu,name:null,nonce:null,noModule:zu,noValidate:zu,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:zu,optimum:Vu,pattern:null,ping:Yu,placeholder:null,playsInline:zu,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:zu,referrerPolicy:null,rel:Yu,required:zu,reversed:zu,rows:Vu,rowSpan:Vu,sandbox:Yu,scope:null,scoped:zu,seamless:zu,selected:zu,shadowRootClonable:zu,shadowRootDelegatesFocus:zu,shadowRootMode:null,shape:null,size:Vu,sizes:null,slot:null,span:Vu,spellCheck:Wu,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Vu,step:null,style:null,tabIndex:Vu,target:null,title:null,translate:null,type:null,typeMustMatch:zu,useMap:null,value:Wu,width:Vu,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Yu,axis:null,background:null,bgColor:null,border:Vu,borderColor:null,bottomMargin:Vu,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:zu,declare:zu,event:null,face:null,frame:null,frameBorder:null,hSpace:Vu,leftMargin:Vu,link:null,longDesc:null,lowSrc:null,marginHeight:Vu,marginWidth:Vu,noResize:zu,noHref:zu,noShade:zu,noWrap:zu,object:null,profile:null,prompt:null,rev:null,rightMargin:Vu,rules:null,scheme:null,scrolling:Wu,standby:null,summary:null,text:null,topMargin:Vu,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Vu,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:zu,disableRemotePlayback:zu,prefix:null,property:null,results:Vu,security:null,unselectable:null},space:"html",transform:sf}),of=ef({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Xu,accentHeight:Vu,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Vu,amplitude:Vu,arabicForm:null,ascent:Vu,attributeName:null,attributeType:null,azimuth:Vu,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Vu,by:null,calcMode:null,capHeight:Vu,className:Yu,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Vu,diffuseConstant:Vu,direction:null,display:null,dur:null,divisor:Vu,dominantBaseline:null,download:zu,dx:null,dy:null,edgeMode:null,editable:null,elevation:Vu,enableBackground:null,end:null,event:null,exponent:Vu,externalResourcesRequired:null,fill:null,fillOpacity:Vu,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ku,g2:Ku,glyphName:Ku,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Vu,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Vu,horizOriginX:Vu,horizOriginY:Vu,id:null,ideographic:Vu,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Vu,k:Vu,k1:Vu,k2:Vu,k3:Vu,k4:Vu,kernelMatrix:Xu,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Vu,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Vu,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Vu,overlineThickness:Vu,paintOrder:null,panose1:null,path:null,pathLength:Vu,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Yu,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Vu,pointsAtY:Vu,pointsAtZ:Vu,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Xu,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Xu,rev:Xu,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Xu,requiredFeatures:Xu,requiredFonts:Xu,requiredFormats:Xu,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Vu,specularExponent:Vu,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Vu,strikethroughThickness:Vu,string:null,stroke:null,strokeDashArray:Xu,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Vu,strokeOpacity:Vu,strokeWidth:null,style:null,surfaceScale:Vu,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Xu,tabIndex:Vu,tableValues:null,target:null,targetX:Vu,targetY:Vu,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Xu,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Vu,underlineThickness:Vu,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Vu,values:null,vAlphabetic:Vu,vMathematical:Vu,vectorEffect:null,vHanging:Vu,vIdeographic:Vu,version:null,vertAdvY:Vu,vertOriginX:Vu,vertOriginY:Vu,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Vu,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:rf}),lf=ef({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(t,e)=>"xlink:"+e.slice(5).toLowerCase()}),cf=ef({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:sf}),hf=ef({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(t,e)=>"xml:"+e.slice(3).toLowerCase()}),uf=/[A-Z]/g,ff=/-[a-z]/g,df=/^data[-\w.:]+$/i;function pf(t){return"-"+t.toLowerCase()}function gf(t){return t.charAt(1).toUpperCase()}var mf,wf=Uu([nf,af,lf,cf,hf],"html"),yf=Uu([nf,of,lf,cf,hf],"svg"),bf={}.hasOwnProperty,vf=/["&'<>`]/g,Ef=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,kf=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Sf=/[|\\{}()[\]^$+*?.]/g,Tf=new WeakMap,xf=/[\dA-Fa-f]/,Af=/\d/,Cf=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Df={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Pf=["cent","copy","divide","gt","lt","not","para","times"],Lf={}.hasOwnProperty,Rf={};for(mf in Df)Lf.call(Df,mf)&&(Rf[Df[mf]]=mf);var Nf=/[^\dA-Za-z]/;function _f(t,e,n){let r,i=function(t,e,n){const r="&#x"+t.toString(16).toUpperCase();return n&&e&&!xf.test(String.fromCharCode(e))?r:r+";"}(t,e,n.omitOptionalSemicolons);if((n.useNamedReferences||n.useShortestReferences)&&(r=function(t,e,n,r){const i=String.fromCharCode(t);if(Lf.call(Rf,i)){const t=Rf[i],s="&"+t;return n&&Cf.includes(t)&&!Pf.includes(t)&&(!r||e&&61!==e&&Nf.test(String.fromCharCode(e)))?s:s+";"}return""}(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const r=function(t,e,n){const r="&#"+String(t);return n&&e&&!Af.test(String.fromCharCode(e))?r:r+";"}(t,e,n.omitOptionalSemicolons);r.length<i.length&&(i=r)}return r&&(!n.useShortestReferences||r.length<i.length)?r:i}function Of(t,e){return function(t,e){return t=t.replace(e.subset?function(t){let e=Tf.get(t);return e||(e=function(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(Sf,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}(t),Tf.set(t,e)),e}(e.subset):vf,n),e.subset||e.escapeOnly?t:t.replace(Ef,function(t,n,r){return e.format(1024*(t.charCodeAt(0)-55296)+t.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),e)}).replace(kf,n);function n(t,n,r){return e.format(t.charCodeAt(0),r.charCodeAt(n+1),e)}}(t,Object.assign({format:_f},e))}var If=/^>|^->|<!--|-->|--!>|<!-$/g,Mf=[">"],Ff=["<",">"];function $f(t,e){const n=String(t);if("string"!=typeof e)throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;-1!==i;)r++,i=n.indexOf(e,i+e.length);return r}var Uf=/[ \t\n\f\r]/g;function Bf(t){return"object"==typeof t?"text"===t.type&&qf(t.value):qf(t)}function qf(t){return""===t.replace(Uf,"")}var jf=Wf(1),Hf=Wf(-1),zf=[];function Wf(t){return function(e,n,r){const i=e?e.children:zf;let s=(n||0)+t,a=i[s];if(!r)for(;a&&Bf(a);)s+=t,a=i[s];return a}}var Gf={}.hasOwnProperty;function Vf(t){return function(e,n,r){return Gf.call(t,e.tagName)&&t[e.tagName](e,n,r)}}var Yf=Vf({body:function(t,e,n){const r=jf(n,e);return!r||"comment"!==r.type},caption:Kf,colgroup:Kf,dd:function(t,e,n){const r=jf(n,e);return!r||"element"===r.type&&("dt"===r.tagName||"dd"===r.tagName)},dt:function(t,e,n){const r=jf(n,e);return Boolean(r&&"element"===r.type&&("dt"===r.tagName||"dd"===r.tagName))},head:Kf,html:function(t,e,n){const r=jf(n,e);return!r||"comment"!==r.type},li:function(t,e,n){const r=jf(n,e);return!r||"element"===r.type&&"li"===r.tagName},optgroup:function(t,e,n){const r=jf(n,e);return!r||"element"===r.type&&"optgroup"===r.tagName},option:function(t,e,n){const r=jf(n,e);return!r||"element"===r.type&&("option"===r.tagName||"optgroup"===r.tagName)},p:function(t,e,n){const r=jf(n,e);return r?"element"===r.type&&("address"===r.tagName||"article"===r.tagName||"aside"===r.tagName||"blockquote"===r.tagName||"details"===r.tagName||"div"===r.tagName||"dl"===r.tagName||"fieldset"===r.tagName||"figcaption"===r.tagName||"figure"===r.tagName||"footer"===r.tagName||"form"===r.tagName||"h1"===r.tagName||"h2"===r.tagName||"h3"===r.tagName||"h4"===r.tagName||"h5"===r.tagName||"h6"===r.tagName||"header"===r.tagName||"hgroup"===r.tagName||"hr"===r.tagName||"main"===r.tagName||"menu"===r.tagName||"nav"===r.tagName||"ol"===r.tagName||"p"===r.tagName||"pre"===r.tagName||"section"===r.tagName||"table"===r.tagName||"ul"===r.tagName):!n||!("element"===n.type&&("a"===n.tagName||"audio"===n.tagName||"del"===n.tagName||"ins"===n.tagName||"map"===n.tagName||"noscript"===n.tagName||"video"===n.tagName))},rp:Xf,rt:Xf,tbody:function(t,e,n){const r=jf(n,e);return!r||"element"===r.type&&("tbody"===r.tagName||"tfoot"===r.tagName)},td:Zf,tfoot:function(t,e,n){return!jf(n,e)},th:Zf,thead:function(t,e,n){const r=jf(n,e);return Boolean(r&&"element"===r.type&&("tbody"===r.tagName||"tfoot"===r.tagName))},tr:function(t,e,n){const r=jf(n,e);return!r||"element"===r.type&&"tr"===r.tagName}});function Kf(t,e,n){const r=jf(n,e,!0);return!r||"comment"!==r.type&&!("text"===r.type&&Bf(r.value.charAt(0)))}function Xf(t,e,n){const r=jf(n,e);return!r||"element"===r.type&&("rp"===r.tagName||"rt"===r.tagName)}function Zf(t,e,n){const r=jf(n,e);return!r||"element"===r.type&&("td"===r.tagName||"th"===r.tagName)}var Jf=Vf({body:function(t){const e=jf(t,-1,!0);return!(e&&("comment"===e.type||"text"===e.type&&Bf(e.value.charAt(0))||"element"===e.type&&("meta"===e.tagName||"link"===e.tagName||"script"===e.tagName||"style"===e.tagName||"template"===e.tagName)))},colgroup:function(t,e,n){const r=Hf(n,e),i=jf(t,-1,!0);return!(n&&r&&"element"===r.type&&"colgroup"===r.tagName&&Yf(r,n.children.indexOf(r),n))&&Boolean(i&&"element"===i.type&&"col"===i.tagName)},head:function(t){const e=new Set;for(const n of t.children)if("element"===n.type&&("base"===n.tagName||"title"===n.tagName)){if(e.has(n.tagName))return!1;e.add(n.tagName)}const n=t.children[0];return!n||"element"===n.type},html:function(t){const e=jf(t,-1);return!e||"comment"!==e.type},tbody:function(t,e,n){const r=Hf(n,e),i=jf(t,-1);return(!n||!r||"element"!==r.type||"thead"!==r.tagName&&"tbody"!==r.tagName||!Yf(r,n.children.indexOf(r),n))&&Boolean(i&&"element"===i.type&&"tr"===i.tagName)}}),Qf={name:[["\t\n\f\r &/=>".split(""),"\t\n\f\r \"&'/=>`".split("")],["\0\t\n\f\r \"&'/<=>".split(""),"\0\t\n\f\r \"&'/<=>`".split("")]],unquoted:[["\t\n\f\r &>".split(""),"\0\t\n\f\r \"&'<=>`".split("")],["\0\t\n\f\r \"&'<=>`".split(""),"\0\t\n\f\r \"&'<=>`".split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function td(t,e,n){const r=function(t,e){const n=Bu(e);let r=e,i=qu;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&df.test(e)){if("-"===e.charAt(4)){const t=e.slice(5).replace(ff,gf);r="data"+t.charAt(0).toUpperCase()+t.slice(1)}else{const t=e.slice(4);if(!ff.test(t)){let n=t.replace(uf,pf);"-"!==n.charAt(0)&&(n="-"+n),e="data"+n}}i=Qu}return new i(r,e)}(t.schema,e),i=t.settings.allowParseErrors&&"html"===t.schema.space?0:1,s=t.settings.allowDangerousCharacters?0:1;let a,o=t.quote;if(!r.overloadedBoolean||n!==r.attribute&&""!==n?!r.boolean&&!r.overloadedBoolean||"string"==typeof n&&n!==r.attribute&&""!==n||(n=Boolean(n)):n=!0,null==n||!1===n||"number"==typeof n&&Number.isNaN(n))return"";const l=Of(r.attribute,Object.assign({},t.settings.characterReferences,{subset:Qf.name[i][s]}));return!0===n?l:(n=Array.isArray(n)?(r.commaSeparated?Zo:tl)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n?l:(t.settings.preferUnquoted&&(a=Of(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:Qf.unquoted[i][s]}))),a!==n&&(t.settings.quoteSmart&&$f(n,o)>$f(n,t.alternative)&&(o=t.alternative),a=o+Of(n,Object.assign({},t.settings.characterReferences,{subset:("'"===o?Qf.single:Qf.double)[i][s],attribute:!0}))+o),l+(a?"="+a:a)))}var ed=["<","&"];function nd(t,e,n,r){return!n||"element"!==n.type||"script"!==n.tagName&&"style"!==n.tagName?Of(t.value,Object.assign({},r.settings.characterReferences,{subset:ed})):t.value}var rd=function(t,e){const n=e||{};function r(e,...n){let i=r.invalid;const s=r.handlers;if(e&&bf.call(e,t)){const n=String(e[t]);i=bf.call(s,n)?s[n]:r.unknown}if(i)return i.call(this,e,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}("type",{invalid:function(t){throw new Error("Expected node, not `"+t+"`")},unknown:function(t){throw new Error("Cannot compile unknown node `"+t.type+"`")},handlers:{comment:function(t,e,n,r){return r.settings.bogusComments?"<?"+Of(t.value,Object.assign({},r.settings.characterReferences,{subset:Mf}))+">":"\x3c!--"+t.value.replace(If,function(t){return Of(t,Object.assign({},r.settings.characterReferences,{subset:Ff}))})+"--\x3e"},doctype:function(t,e,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"},element:function(t,e,n,r){const i=r.schema,s="svg"!==i.space&&r.settings.omitOptionalTags;let a="svg"===i.space?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const o=[];let l;"html"===i.space&&"svg"===t.tagName&&(r.schema=yf);const c=function(t,e){const n=[];let r,i=-1;if(e)for(r in e)if(null!==e[r]&&void 0!==e[r]){const i=td(t,r,e[r]);i&&n.push(i)}for(;++i<n.length;){const e=t.settings.tightAttributes?n[i].charAt(n[i].length-1):void 0;i!==n.length-1&&'"'!==e&&"'"!==e&&(n[i]+=" ")}return n.join("")}(r,t.properties),h=r.all("html"===i.space&&"template"===t.tagName?t.content:t);return r.schema=i,h&&(a=!1),!c&&s&&Jf(t,e,n)||(o.push("<",t.tagName,c?" "+c:""),a&&("svg"===i.space||r.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!r.settings.tightSelfClosing||"/"===l||l&&'"'!==l&&"'"!==l)&&o.push(" "),o.push("/")),o.push(">")),o.push(h),a||s&&Yf(t,e,n)||o.push("</"+t.tagName+">"),o.join("")},raw:function(t,e,n,r){return r.settings.allowDangerousHtml?t.value:nd(t,0,n,r)},root:function(t,e,n,r){return r.all(t)},text:nd}}),id={},sd={},ad=[];function od(t,e,n){return rd(t,e,n,this)}function ld(t){const e=[],n=t&&t.children||ad;let r=-1;for(;++r<n.length;)e[r]=this.one(n[r],r,t);return e.join("")}function cd(t){const e={...this.data("settings"),...t};this.compiler=function(t){return function(t,e){const n=e||id,r=n.quote||'"',i='"'===r?"'":'"';if('"'!==r&&"'"!==r)throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:od,all:ld,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Fu,characterReferences:n.characterReferences||sd,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:"svg"===n.space?yf:wf,quote:r,alternative:i}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}(t,e)}}var hd=function(t){if(null==t)return fd;if("function"==typeof t)return ud(t);if("object"==typeof t)return Array.isArray(t)?function(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=hd(t[n]);return ud(function(...t){let n=-1;for(;++n<e.length;)if(e[n].apply(this,t))return!0;return!1})}(t):function(t){const e=t;return ud(function(n){const r=n;let i;for(i in t)if(r[i]!==e[i])return!1;return!0})}(t);if("string"==typeof t)return e=t,ud(function(t){return t&&t.type===e});var e;throw new Error("Expected function, string, or object as test")};function ud(t){return function(e,n,r){return Boolean(function(t){return null!==t&&"object"==typeof t&&"type"in t}(e)&&t.call(this,e,"number"==typeof n?n:void 0,r||void 0))}}function fd(){return!0}var dd=[],pd=!1,gd=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,md=/^[a-zA-Z]:\\/,wd=/^https?:/i;function yd(t,e={}){if("string"!=typeof t)throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);if(md.test(t))return!1;if(!gd.test(t))return!1;const{httpOnly:n=!0}=e;return!n||wd.test(t)}var bd=m(require("path"));j();var vd=N("site",{component:"HtmlLinkProcessor"}),Ed={markdownLinkResolution:"shortest",prettyLinks:!0,openLinksInNewTab:!1,lazyLoad:!1,externalLinkIcon:!0},kd=class{constructor(t,e={}){this.graph=t,this.options={...Ed,...e}}options;async processLinks(t,e){if(!e||"string"!=typeof e)return vd.error("[HtmlLinkProcessor] Invalid HTML input: "+typeof e),{html:e||"",outgoingLinks:[]};const n=this.options,r=Ia(t),i=new Set,s=co().use(Mu,{fragment:!0}).use(()=>e=>{!function(t,e,n){let r,i,s;i="element",s=n,r=void 0,function(t,e,n,r){let i;i=e;const s=hd(i),a=r?-1:1;!function t(e,i,o){const l=e&&"object"==typeof e?e:{};if("string"==typeof l.type){const t="string"==typeof l.tagName?l.tagName:"string"==typeof l.name?l.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(c=e.type+(t?"<"+t+">":""),""+c+")")})}var c;return h;function h(){let l,c,h,u=dd;if(s(e,i,o[o.length-1]||void 0)&&(u=function(t){return Array.isArray(t)?t:"number"==typeof t?[!0,t]:null==t?dd:[t]}(n(e,o)),u[0]===pd))return u;if("children"in e&&e.children){const n=e;if(n.children&&"skip"!==u[0])for(c=(r?n.children.length:-1)+a,h=o.concat(n);c>-1&&c<n.children.length;){const e=n.children[c];if(l=t(e,c,h)(),l[0]===pd)return l;c="number"==typeof l[1]?l[1]:c+a}}return u}}(t,void 0,[])()}(t,"element",function(t,e){const n=e[e.length-1],r=n?n.children.indexOf(t):void 0;return s(t,r,n)},undefined)}(e,0,e=>{if("a"===e.tagName&&e.properties){const s=e.properties.dataWikilink||e.properties.dataSlug,a="string"==typeof e.properties.href;if(!a&&!s)return;let o;o=!a&&s?e.properties.dataWikilink||e.properties.dataSlug:e.properties.href;const l=e.properties.className??[],c=yd(o,{httpOnly:!1});l.includes("external")||l.includes("internal")||l.push(c?"external":"internal"),c&&n.externalLinkIcon&&e.children.push({type:"element",tagName:"svg",properties:{"aria-hidden":"true",class:"external-icon",style:"max-width:0.8em;max-height:0.8em",viewBox:"0 0 512 512"},children:[{type:"element",tagName:"path",properties:{d:"M320 0H288V64h32 82.7L201.4 265.4 178.7 288 224 333.3l22.6-22.6L448 109.3V192v32h64V192 32 0H480 320zM32 32H0V64 480v32H32 456h32V480 352 320H424v32 96H64V96h96 32V32H160 32z"},children:[]}]}),1===e.children.length&&"text"===e.children[0].type&&e.children[0].value!==o&&l.push("alias"),e.properties.className=l,c&&n.openLinksInNewTab&&(e.properties.target="_blank");const h=!(yd(o,{httpOnly:!1})||o.startsWith("#"));if(h){const s=$a(t,o,{strategy:n.markdownLinkResolution,allSlugs:this.graph.getAllSlugs()}),a=new URL(s,"https://base.com/"+ja(r,!0)).pathname;let[l,c]=Oa(a);l.endsWith("/")&&(l+="index");const h=decodeURIComponent(ja(l,!0)),u=Ia(h);i.add(u);let f=s;if(f.startsWith("./")&&(f=f.slice(2)),f.startsWith("../")){const e=(f.match(/\.\.\//g)||[]).length,n=t.split("/").filter(t=>t).slice(0,-1),r=f.replace(/\.\.\//g,""),i=n.slice(0,n.length-e);r&&i.push(r),f=i.join("/")}f=n.baseURL?`${n.baseURL}/${f}`:`/${f}`;const[d,p]=Oa(f);let g=d;g.endsWith(".html")||g.endsWith("/")||(g+=".html"),f=g+p,o=e.properties.href=f,e.properties["data-slug"]=h}n.prettyLinks&&h&&1===e.children.length&&"text"===e.children[0].type&&!e.children[0].value.startsWith("#")&&(e.children[0].value=bd.default.basename(e.children[0].value))}if(["img","video","audio","iframe"].includes(e.tagName)&&e.properties&&"string"==typeof e.properties.src&&(n.lazyLoad&&(e.properties.loading="lazy"),!yd(e.properties.src,{httpOnly:!1}))){let r=e.properties.src;r=e.properties.src=$a(t,r,{strategy:n.markdownLinkResolution,allSlugs:this.graph.getAllSlugs()}),e.properties.src=r}})}).use(cd),a=await s.process(e);return{html:String(a),outgoingLinks:Array.from(i)}}},Sd=N("site",{component:"site"}),Td=class{configSvc;contentSvc;translationSvc;languageSvc;sitemap;staticCopySvc;publisher;template=null;author;organization;compiler;url;ref=null;language;navigation=null;title;home=null;pageGraph=null;get Title(){return this.title}get Description(){return this.home?.description()||""}get Compiler(){return this.compiler}get IsGoogleAnalyticsEnabled(){return this.configSvc.isGoogleAnalyticsEnabled()}get GoogleAnalyticsID(){return this.configSvc.googleAnalyticsID()}get IsGoogleAnalyticsRespectDoNotTrack(){return this.configSvc.isGoogleAnalyticsRespectDoNotTrack()}get IsDisqusEnabled(){return this.configSvc.isDisqusEnabled()}get DisqusShortname(){return this.configSvc.disqusShortname()}get IsXRespectDoNotTrack(){return this.configSvc.isXRespectDoNotTrack()}get IsXDisableInlineCSS(){return this.configSvc.isXDisableInlineCSS()}get ConfiguredSocialPlatforms(){return this.configSvc.getConfiguredSocialPlatforms()}GetSocialLink(t){return this.configSvc.getSocialLink(t)}GetSocialTitle(t){return this.configSvc.getSocialTitle(t)}async Pages(){const t=this.languageSvc.getLanguageIndex(this.language.getCurrentLanguage()),e=await this.contentSvc.globalPages(t);return this.sitePages(e)}async RegularPages(){const t=await this.contentSvc.globalRegularPages();return this.sitePages(t)}constructor(t,e,n,r,i,s,a,o,l,c,h,u,f,d,p){this.configSvc=t,this.contentSvc=e,this.translationSvc=n,this.languageSvc=r,this.sitemap=i,this.staticCopySvc=s,this.publisher=a,this.author=o,this.organization=l,this.compiler=c,this.url=h,this.ref=u,this.language=f,this.navigation=d,this.title=p}async build(t){try{this.template=t,await this.setup(),await this.copyStaticFiles();const e=this.languageSvc.languageKeys();for(const t of e)this.language.setCurrentLanguage(t),await this.generateNavigations(),await this.render()}catch(t){const e=t instanceof Error?t.message:String(t);throw Sd.error(`❌ Site build failed: ${e}`),t}}async buildWithProgress(t,e){try{this.template=t,await this.setup(),await this.copyStaticFiles();const n=this.languageSvc.languageKeys();for(const t of n)this.language.setCurrentLanguage(t),await this.generateNavigations(),await this.renderWithProgress(e)}catch(t){const e=t instanceof Error?t.message:String(t);throw Sd.error(`❌ Site build failed: ${e}`),t}}async setup(){try{await this.buildPageGraph()}catch(t){const e=t instanceof Error?t.message:String(t);throw Sd.error(`❌ Setup failed: ${e}`),t}}async renderAllLanguages(){const t=this.languageSvc.languageKeys();for(const e of t)this.language.setCurrentLanguage(e),await this.render()}async render(){try{await this.renderPages()}catch(t){throw t}}async renderWithProgress(t){try{await this.renderPagesWithProgress(t)}catch(t){throw t}}async renderPages(){const t=this.languageSvc.getLanguageIndex(this.language.getCurrentLanguage()),e=[];await this.contentSvc.walkPages(t,async t=>{const n=await this.sitePage(t);e.push(n);const r=await this.contentSvc.getPageSources(t);await n.processResources(r),t.isHome()&&(this.home=n)}),Sd.info(`📊 Processing wikilinks for ${e.length} pages...`);for(const t of e)try{await t.WikilinkContent()}catch(e){const n=e instanceof Error?e.message:String(e);Sd.warn(`⚠️ Failed to process wikilinks for ${t.slug()}: ${n}`)}Sd.info("✅ Wikilink processing complete");for(let t=0;t<e.length;t++){const n=e[t];n.isStale()&&(await n.render(),n.clearStale())}}async renderPagesWithProgress(t){const e=this.languageSvc.getLanguageIndex(this.language.getCurrentLanguage()),n=[];await this.contentSvc.walkPages(e,async t=>{const e=await this.sitePage(t);n.push(e);const r=await this.contentSvc.getPageSources(t);await e.processResources(r),t.isHome()&&(this.home=e)}),Sd.info(`📊 Processing wikilinks for ${n.length} pages...`);for(const t of n)try{await t.WikilinkContent()}catch(e){const n=e instanceof Error?e.message:String(e);Sd.warn(`⚠️ Failed to process wikilinks for ${t.slug()}: ${n}`)}Sd.info("✅ Wikilink processing complete");const r=n.length;for(let e=0;e<n.length;e++){const i=n[e];await i.render(),t?.({currentPage:e+1,totalPages:r})}}async pageOutput(t){return t.output()}clearSiteCache(){}translate(t){return this.translationSvc.translate(this.language.getCurrentLanguage(),t)}get Home(){return this.home}get Params(){return this.configSvc.configParams()}get Taxonomies(){return this.navigation&&this.navigation.getTaxonomies(this.language.getCurrentLanguage())||new U}get Menus(){return this.navigation?this.navigation.getMenus(this.language.getCurrentLanguage()):new Ra}getTitle(){return this.title}setTitle(t){this.title=t}getConfigService(){return this.configSvc}getContentService(){return this.contentSvc}getLanguageService(){return this.languageSvc}baseURL(){return this.url.base}get BaseURL(){return this.baseURL()}getURL(){return this.url}getRef(){return this.ref?this.ref:{}}getLanguage(){return this.language}get Language(){return this.getLanguage()}get LanguageCode(){return this.language.lang()}get Languages(){return this.language.languages()}getNavigation(){return this.navigation?this.navigation:{}}getPublisher(){return this.publisher}getTemplate(){return this.template}get Author(){return this.author.author(this.home?.author())}get Organization(){return this.organization.organization(this.home?.organization())}getCompiler(){return this.compiler}getSitemap(){return this.sitemap}isMultipleLanguage(){return this.language.isMultipleLanguage()}get IsMultilingual(){return this.isMultipleLanguage()}getCurrentLanguage(){return this.language.lang()}languagePrefix(){return this.language.languagePrefix()}async sitePage(t){return new Ca(this.template,this.languageSvc,this.publisher,t,this)}sitePages(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];try{const t=this.sitePageSync(r);e.push(t)}catch(t){Sd.error(`❌ [Site.sitePages] Failed to convert page ${n}:`,t)}}return e}sitePageSync(t){return new Ca(this.template,this.languageSvc,this.publisher,t,this)}async generateNavigations(){const t=this.language.getCurrentLanguage(),e=this.languageSvc.getLanguageIndex(t);this.navigation&&(await this.navigation.generateMenusForLanguage(t,e),await this.navigation.generateTaxonomiesForLanguage(t,e,this))}GetPage(...t){if(t.length>1)throw new Error(`too many arguments to .Site.GetPage: ${t}. Use lookups on the form {{ .Site.GetPage "/posts/mypage-md" }}`);let e=t[0];e=e.replace(/\\/g,"/"),e.startsWith("/")||(e="/"+e);try{const t=this.languageSvc.getLanguageIndex(this.language.getCurrentLanguage()),n=this.contentSvc.getPageFromPathSync(t,e);return n?this.sitePageSync(n):(Sd.warn(`⚠️ GetPage: No page found for key "${e}"`),null)}catch(t){return Sd.error(`❌ Error getting page "${e}": ${t}`),null}}async copyStaticFiles(){try{await this.staticCopySvc.copyStaticFiles(this.staticCopySvc.staticFs(),this.staticCopySvc.publishFs())}catch(t){throw Sd.error("❌ Static file copy failed:",t),t}}async siteWeightedPage(t){const e=await this.sitePage(t.page()),{WeightedPage:n}=await Promise.resolve().then(()=>(G(),H));return new n(e,t)}async buildPageGraph(){try{const t=[],e=this.languageSvc.languageKeys();for(const n of e){const e=this.languageSvc.getLanguageIndex(n);await this.contentSvc.walkPages(e,async e=>{t.push(e)})}const n=t.map(t=>t.slug());Sd.info(`📄 Collected ${n.length} page slugs`);const r=await this.collectResourceSlugs(t);Sd.info(`🖼️ Collected ${r.length} resource slugs`);const i=[...n,...r];this.pageGraph=new za(i),Sd.info(`✅ PageGraph built: ${n.length} pages + ${r.length} resources = ${i.length} total`)}catch(t){const e=t instanceof Error?t.message:String(t);throw Sd.error(`❌ Failed to build PageGraph: ${e}`),t}}async collectResourceSlugs(t){const e=[],n=new Set;try{for(const r of t)try{const t=await this.contentSvc.getPageSources(r);for(const r of t){const t=r.slug();n.has(t)||(n.add(t),e.push(t))}}catch(t){const e=t instanceof Error?t.message:String(t);Sd.debug(`⚠️ Failed to get resources for page ${r.slug()}: ${e}`)}}catch(t){const e=t instanceof Error?t.message:String(t);Sd.warn(`⚠️ Failed to collect resource slugs: ${e}`)}return e}async ProcessWikilinks(t,e){if(!this.pageGraph)return Sd.warn("⚠️ PageGraph not built yet, returning original HTML"),e;try{let r="";if(this.url&&this.url.base){if(r=this.url.base.replace(/\/$/,""),r.startsWith("/"));else if(r)try{r=new Pa(r).pathname.replace(/\/$/,"")}catch(t){Sd.warn(`Failed to parse baseURL as URL: ${r}, treating as path`)}"/"===r&&(r="")}const i=(n=this.pageGraph,new kd(n,{markdownLinkResolution:"shortest",prettyLinks:!0,openLinksInNewTab:!1,lazyLoad:!0,externalLinkIcon:!0,baseURL:r})),s=await i.processLinks(t,e);return this.pageGraph.registerOutgoingLinks(t,s.outgoingLinks),s.html}catch(n){const r=n instanceof Error?n.message:String(n);return Sd.error(`❌ Failed to process wikilinks for ${t}: ${r}`),e}var n}getPageGraph(){return this.pageGraph}GetBacklinks(t){return this.pageGraph?this.pageGraph.getBacklinks(t):(Sd.warn(`⚠️ PageGraph not built yet, cannot get backlinks for ${t}`),[])}async GetContentIndex(){if(!this.pageGraph)return Sd.warn("⚠️ PageGraph not built yet, cannot generate content index"),new Map;const t=new Map,e=await this.RegularPages();for(const n of e){const e=n.slug(),r=this.pageGraph.getOutgoingLinks(e),i=(n.Plain||"").substring(0,1e3);t.set(e,{slug:e,title:n.Title||n.File.OriginalBaseName,links:r,tags:n.Params?.tags||[],content:i})}return Sd.debug(`[Site] Generated contentIndex with ${t.size} entries`),t}},xd=m(require("path"));j(),N("site",{component:"publisher"});var Ad=class{fs;constructor(t){this.fs=t}async publishSource(t,...e){const n=await this.openFilesForWriting(...e);try{const e="string"==typeof t?(new TextEncoder).encode(t):t;await this.copyToWriter(n,e)}finally{await n.close()}}async publishFiles(t,...e){const n=await this.openFilesForWriting(...e);try{await this.copyStreamToWriter(n,t)}finally{await n.close()}}async openFilesForWriting(...t){const e=[];for(const n of t){const t=await Dd(this.fs,n);e.push(t)}return new Cd(e)}async copyToWriter(t,e){await t.write(e)}async copyStreamToWriter(t,e){const n=e.getReader();try{for(;;){const{done:e,value:r}=await n.read();if(e)break;await t.write(r)}}finally{n.releaseLock()}}},Cd=class{files;constructor(t){this.files=t}async write(t){const e=this.files.map(e=>e.write(t));await Promise.all(e)}async close(){const t=this.files.map(t=>t.close());await Promise.all(t)}};async function Dd(t,e){const n=xd.default.normalize(e);try{return await t.create(n)}catch(e){if(!function(t){return t&&("ENOENT"===t.code||"FILE_NOT_FOUND"===t.code||t.message?.includes("not found")||t.message?.includes("no such file"))}(e))throw e;const r=xd.default.dirname(n);return await t.mkdirAll(r,511),await t.create(n)}}j();var Pd=N("site",{component:"ref"}),Ld=class{site;contentSvc;notFoundURL;constructor(t,e,n="#ZgotmplZ"){this.site=t,this.contentSvc=e,this.notFoundURL=n}async relRefFrom(t,e){return this.relRef(t,e)}async relRef(t,e){try{const n=this.decodeRefArgs(t);return n.path?this.refLink(n.path,e,!0,n.outputFormat):""}catch(t){throw new Error(`Invalid arguments to Ref: ${t}`)}}decodeRefArgs(t){return{path:t.path||"",outputFormat:t.outputFormat||""}}async refLink(t,e,n,r){const i=e;if(!i||"function"!=typeof i.unwrapPage)throw new Error("source is not a PageWrapper");const s=i.unwrapPage();let a;const o=t.replace(/\\/g,"/");try{a=new globalThis.URL(o,"http://example.com")}catch(t){return Pd.error(`Failed to parse ref URL: ${t}`),this.notFoundURL}let l=null,c="";if(""!==a.pathname)try{l=await this.contentSvc.getPageRef(s,a.pathname,this.site.home.page);let t=null;if(l||this.isPositioner(e)&&(t=e.position()),!l)return this.logNotFound(a.pathname,"page not found",s,t),this.notFoundURL;const r=await this.site.sitePage(l);c=n?r.relPermalink():r.permalink()}catch(e){return Pd.error(`[${s.pageIdentity().pageLanguage()}] REF_NOT_FOUND: Ref "${t}": ${e}`),this.notFoundURL}return a.hash&&(c=c+"#"+a.hash),c}isPositioner(t){return t&&"function"==typeof t.position}logNotFound(t,e,n,r){const i=n.pageIdentity().pageLanguage();r&&r.isValid()?Pd.error(`[${i}] REF_NOT_FOUND: Ref "${t}": ${r.toString()}: ${e}`):n?Pd.error(`[${i}] REF_NOT_FOUND: Ref "${t}" from page "${n.path()}": ${e}`):Pd.error(`[${i}] REF_NOT_FOUND: Ref "${t}": ${e}`)}};j(),N("site",{component:"language"});var Rd=class{collator;constructor(t){this.collator=t}compare(t,e){return this.collator.compare(t,e)}},Nd=class t{langSvc;currentLocation;currentLanguage;collator=null;constructor(t){this.langSvc=t,this.currentLocation="UTC",this.currentLanguage=""}currentLanguageIndex(){try{return this.langSvc.getLanguageIndex(this.currentLanguage)}catch(t){throw new Error(`language "${this.currentLanguage}" not found`)}}async setup(){this.currentLocation="UTC"}languages(){const e=[];for(const n of this.langSvc.languageKeys()){const r=new t(this.langSvc);r.currentLocation=this.currentLocation,r.currentLanguage=n,r.collator=this.collator,e.push(r)}return e}getCollator(){if(!this.collator)try{const t=new Intl.Collator(this.currentLanguage||"en");this.collator=new Rd({compare:(e,n)=>t.compare(e,n)})}catch(t){const e=new Intl.Collator("en");this.collator=new Rd({compare:(t,n)=>e.compare(t,n)})}return this.collator}location(){return this.currentLocation}isMultipleLanguage(){return this.langSvc.languageKeys().length>1}languagePrefix(){return this.currentLanguage===this.langSvc.defaultLanguage()?"":this.currentLanguage}lang(){return this.currentLanguage}get Lang(){return this.lang()}languageName(){return this.langSvc.getLanguageName(this.currentLanguage)}get LanguageName(){return this.languageName()}defaultLanguageName(){return this.langSvc.getLanguageName(this.langSvc.defaultLanguage())}languageCode(){return this.currentLanguage}get LanguageCode(){return this.languageCode()}get LanguageDirection(){return"ltr"}languageDirection(){return"ltr"}setCurrentLanguage(t){this.currentLanguage=t}getCurrentLanguage(){return this.currentLanguage}setCurrentLocation(t){this.currentLocation=t}},_d=class{u;nr;rr;constructor(t,e){this.u=t,this.nr=e}name(){return this.u}email(){return this.nr}author(t){return this.rr=t,this}get Name(){return this.rr?.name||this.name()}get Description(){return this.rr?.description||""}get Avatar(){return this.rr?.avatar||""}get Twitter(){return this.rr?.social?.twitter||""}get Socials(){const t=[];if(!this.rr?.social)return t;for(const[e,n]of Object.entries(this.rr.social))n&&t.push({ID:e,Link:n});return t}};j(),N("site",{component:"organization"});var Od=class{u;ir;sr;ar;nr;lr;cr;hr;constructor(){this.u="MDFriday",this.ir="Turn markdown to website, in minutes.",this.sr="https://mdfriday.com",this.ar="https://gohugo.net/mdfriday.svg",this.nr="support@mdfriday.com",this.lr="Cang long Street, Wuhan, China",this.cr="Make site generation easy and accessible for everyone."}name(){return this.u}description(){return this.ir}website(){return this.sr}organization(t){return this.hr=t,this}get Name(){return this.hr?.name||this.name()}get Description(){return this.hr?.description||this.description()}get Website(){return this.hr?.website||this.website()}get Vision(){return this.hr?.vision||this.cr}get Logo(){return this.hr?.logo||this.ar}get Address(){return this.hr?.contact?.address||this.lr}get Email(){return this.hr?.contact?.email||this.nr}get Social(){return this.hr?.social}SocialById(t){return this.hr?.social?.[t]||""}get Socials(){const t=[];if(!this.hr?.social)return t;for(const[e,n]of Object.entries(this.hr.social))n&&t.push({ID:e,Link:n});return t}},Id=class{ver;constructor(t){this.ver=t}version(){return this.ver}environment(){return"production"}};j();var Md=N("site",{component:"navigation"}),Fd=class{taxonomies;taxonomiesBuilder=null;taxonomiesCache=new Map;menus;menuBuilder=null;menuCache=new Map;constructor(t){this.taxonomies=new Map,this.menus=new Map;for(const e of t.languageKeys())this.menus.set(e,Na()),this.menuCache.set(e,!1)}setMenuBuilder(t){this.menuBuilder=t}setTaxonomiesBuilder(t){this.taxonomiesBuilder=t}async generateMenusForLanguage(t,e){if(this.menuBuilder){if(!0!==this.menuCache.get(t))try{const n=await this.menuBuilder.buildMenusForLanguage(e);this.menus.set(t,n),this.menuCache.set(t,!0)}catch(e){Md.error(`Failed to generate menus for language ${t}: ${e}`)}}else Md.error("Menu builder not set, cannot generate menus")}async generateTaxonomiesForLanguage(t,e,n){if(this.taxonomiesBuilder){if(!0!==this.taxonomiesCache.get(t))try{const r=await this.taxonomiesBuilder.buildTaxonomiesForLanguage(e,n);this.taxonomies.set(t,r),this.taxonomiesCache.set(t,!0)}catch(e){Md.error(`Failed to generate taxonomies for language ${t}: ${e}`)}}else Md.error("Taxonomies builder not set, cannot generate taxonomies")}getMenus(t){let e=this.menus.get(t);return void 0===e&&(e=Na()),e}getTaxonomies(t){return this.taxonomies.get(t)}};j();var $d=N("site",{component:"menu-builder"}),Ud=class{contentService;site;constructor(t,e){this.contentService=t,this.site=e}async buildMenusForLanguage(t){const e=new Map;return await this.contentService.walkPages(t,async t=>{await this.processPage(t,e)}),this.convertToMenus(e)}async processPage(t,e){try{const n=t.menu();if(!n)return;const r=await this.generatePageUrl(t);for(const[i,s]of Object.entries(n))await this.processMenuSection(i,s,r,t,e)}catch(t){$d.error(`Error processing page for menu: ${t}`)}}async processMenuSection(t,e,n,r,i){if(!(!1===e||Array.isArray(e)&&0===e.length))if(Array.isArray(e))await this.processMenuItems(t,e,n,r,i);else if(e&&"object"==typeof e){let s=0;for(const[a,o]of Object.entries(e))if(!(!1===o||Array.isArray(o)&&0===o.length)&&Array.isArray(o)){const e=`${t}.${a}`;if(await this.processMenuItems(e,o,n,r,i),"footer"===t){const t=`${e}::__subsection__`;i.has(t)||i.set(t,{title:a,url:"",children:new Map,weight:1e3,level:0,menuName:e,order:s})}s++}}}async processMenuItems(t,e,n,r,i){for(let s=0;s<e.length;s++){const a=e[s];if(!a||"object"!=typeof a)continue;if(!a.title||"string"!=typeof a.title)continue;let o=a.url||"";o=""===o?n:await this.processMenuItemUrl(o);const l="number"==typeof a.weight?a.weight:1e3,c=`${t}::${a.title}`;let h=i.get(c);h?l<h.weight&&(h.weight=l,h.url=o):(h={title:a.title,url:o,children:new Map,weight:l,level:0,menuName:t||void 0,order:s},i.set(c,h)),Array.isArray(a.children)&&await this.processChildrenItems(c,a.children,n,r,i,h)}}async processChildrenItems(t,e,n,r,i,s){for(let a=0;a<e.length;a++){const o=e[a];if(!o||"object"!=typeof o)continue;if(!o.title||"string"!=typeof o.title)continue;let l=o.url||"";l=""===l?n:await this.processMenuItemUrl(l);const c="number"==typeof o.weight?o.weight:1e3,h=`${t}::${o.title}`,u={title:o.title,url:l,children:new Map,weight:c,level:s.level+1,menuName:s.menuName||void 0,order:a};i.set(h,u),s.children.set(h,u),Array.isArray(o.children)&&await this.processChildrenItems(h,o.children,n,r,i,u)}}async generatePageUrl(t){try{return(await this.site.sitePage(t)).RelPermalink}catch(e){return $d.error(`Error generating page URL for ${t.path()}: ${e}`),this.fallbackUrlFromPath(t.path())}}async processMenuItemUrl(t){try{return this.site.getURL().relURL(t)}catch(e){return $d.error(`Error processing menu item URL ${t}: ${e}`),t}}fallbackUrlFromPath(t){let e=t.replace(/\.md$/,"");return e.startsWith("/")||(e="/"+e),e.endsWith("/")||e.includes(".")||(e+="/"),e}convertToMenus(t){const e=new Map;for(const[n,r]of t.entries())if(!n.includes("::__subsection__")&&0===r.level){const t=r.menuName||"main";e.has(t)||e.set(t,[]),e.get(t).push(r)}const n=this.buildMenuItems(e.get("nav")||[],t),r=[],i=new Map,s=new Map;for(const[n,r]of e.entries())if(n.startsWith("footer.")){const e=n.substring(7),a=this.buildMenuItems(r,t,!1);i.set(e,a);const o=`${n}::__subsection__`,l=t.get(o);l&&s.set(e,l.order)}const a=Array.from(i.entries()).sort((t,e)=>(s.get(t[0])||0)-(s.get(e[0])||0));for(let t=0;t<a.length;t++){const[e,n]=a[t];if(n.length>0){const i=new La({title:this.capitalizeFirstLetter(e),url:"",children:n,weight:t+1,identifier:`footer-${e}`});r.push(i)}}const o={};return n.length>0&&(o.nav=n),r.length>0&&(o.footer=r),new Ra(o)}capitalizeFirstLetter(t){return t.charAt(0).toUpperCase()+t.slice(1)}buildMenuItems(t,e,n=!0){const r=[];for(const i of t){const t=Array.from(i.children.values()),s=t.length>0?this.buildMenuItems(t,e,n):[],a=new La({title:i.title,url:i.url,children:s,weight:i.weight,identifier:i.url});r.push(a)}return n?r.sort((t,e)=>t.weight()!==e.weight()?t.weight()-e.weight():t.title().localeCompare(e.title())):r.sort((e,n)=>{const r=t.find(t=>t.title===e.title()),i=t.find(t=>t.title===n.title());return(r?.order||0)-(i?.order||0)})}};G(),j();var Bd=N("site",{component:"navigation-factory"}),qd=class{langService;contentService;site;constructor(t,e,n){this.langService=t,this.contentService=e,this.site=n}createNavigation(){try{const e=(t=this.langService,new Fd(t)),n=new Ud(this.contentService,this.site);e.setMenuBuilder(n);const r=new B(this.contentService);return e.setTaxonomiesBuilder(r),e}catch(t){throw Bd.error(`Failed to create Navigation entity: ${t}`),t}var t}};j(),N("site",{component:"factory"}),j();var jd=m(require("path")),Hd=require("crypto"),zd=require("stream"),Wd=require("stream/promises");j();var Gd=N("resources",{component:"publisher"}),Vd=class{value="";size=0;resource=null;async setup(t){if(this.value)return;this.resource=t;const e=await t.readSeekCloser(),n=(0,Hd.createHash)("sha256");let r=0;const i=[];e.on("data",t=>{n.update(t),r+=t.length,i.push(t)}),await new Promise((t,i)=>{e.on("end",()=>{this.value=n.digest("hex"),this.size=r,t()}),e.on("error",i)}),await e.close()}},Yd=class{hasPublished=!1;publishPromise=null;async do(t){if(!this.hasPublished)return this.publishPromise||(this.publishPromise=t().then(()=>{this.hasPublished=!0})),this.publishPromise}},Kd=class t{h;openReadSeekCloser;ur;paths;dr;publisher;publishOnce;constructor(t,e,n,r={},i){this.h=new Vd,this.openReadSeekCloser=t,this.ur=e,this.paths=n,this.dr=r,this.publisher=i,this.publishOnce=new Yd}name(){return this.paths.pathFile()}nameNormalized(){return this.paths.targetPath().replace(/\\/g,"/")}mediaType(){return this.ur}resourceType(){return this.ur.mainType}relPermalink(){return this.publish(),this.paths.targetLink()}permalink(){return this.publish(),this.paths.targetPath()}async publish(){const t=this.targetPath();this.publisher?await this.publishOnce.do(async()=>{let e=null,n=null;try{e=await this.publisher.openPublishFileForWriting(this.paths.targetPath()),n=await this.readSeekCloser(),await this.copyStreamToFile(n,e)}catch(e){throw Gd.errorf("❌ [Resource.publish] Error publishing %s: %s",t,e),e}finally{if(n)try{await n.close()}catch(e){Gd.errorf("❌ [Resource.publish] Failed to close ReadSeekCloser %s: %s",t,e)}if(e)try{await e.file.close()}catch(e){Gd.errorf("❌ [Resource.publish] Failed to close public writer %s: %s",t,e)}}}):Gd.error("⚠️ [Resource.publish] No publisher for: %s",t)}async copyStreamToFile(t,e){const n=this.targetPath();try{await(0,Wd.pipeline)(t,e)}catch(t){throw Gd.errorf("❌ [copyStreamToFile] Error during pipeline for %s: %s",n,t),t}}targetPath(){return this.paths.targetPath()}data(){return this.dr}async readSeekCloser(){const t=await this.openReadSeekCloser();if(t&&"function"==typeof t.read){const e=t.read();if(e){const n=new(0,require("stream").Readable);let r;for(n.push(e);null!==(r=t.read());)r&&n.push(r);return n.push(null),Object.assign(n,{seek:async(t,e)=>0,close:async()=>Promise.resolve()})}}return t}async content(t){const e=await this.readSeekCloser();return new Promise((t,n)=>{let r="";e.on("data",t=>{r+=t.toString()}),e.on("end",()=>{t(r)}),e.on("error",n)})}async hash(){return await this.h.setup(this),this.h.value}async size(){return await this.h.setup(this),this.h.size}cloneTo(t){const e=this.clone();return e.paths=e.paths.fromTargetPath(t),e}clone(){const e=new t(this.openReadSeekCloser,this.ur,this.paths,{...this.dr},this.publisher);return e.h=this.h,e}key(){return this.paths.targetLink()}get RelPermalink(){return this.relPermalink()}get Permalink(){return this.permalink()}get Name(){return this.name()}get MediaType(){return this.mediaType()}get ResourceType(){return this.resourceType()}get TargetPath(){return this.targetPath()}get Data(){return this.data()}get Content(){return this.content()}get Hash(){return()=>this.hash()}get Size(){return()=>this.size()}meta(){return new Ep(this.paths.targetPath(),this.ur.type,this.dr)}mergeData(t){if(t&&0!==Object.keys(t).length)for(const[e,n]of Object.entries(t))e in this.dr||(this.dr[e]=n)}async transform(...t){let e=this;for(let n=0;n<t.length;n++){const r=t[n];try{const t=await e.readSeekCloser(),n=new zd.PassThrough;let i="";const s=[],a={source:{from:t,inPath:e.targetPath(),inMediaType:e.mediaType()},target:{to:n},data:{...e.data()},addOutPathIdentifier:t=>{const n=e.targetPath(),r=si.parseBasic(n);let i=r.dir;i=i.replace(/\/+$/,"");let s="";i&&(s=i+"/"),s+=r.nameWithoutExt+t+r.ext,a.data.targetPath=s},updateBuffer:()=>{},updateSource:()=>{},close:()=>{t.close()}};n.on("data",t=>{s.push(t)});const o=new Promise((t,e)=>{n.on("end",()=>{i=Buffer.concat(s).toString(),t()}),n.on("error",t=>{e(t)})});await r.transform(a),await o;const l=a.data.targetPath||e.targetPath(),c=this.createTransformedResource(i,l,e.mediaType(),a.data);e=c,a.close()}catch(t){throw t}}return e}createTransformedResource(e,n,r,i){const s=this.paths.fromTargetPath(n);return new t(async()=>{const t=new zd.PassThrough;return t.end(e),Object.assign(t,{seek:async(t,e)=>0,close:async()=>Promise.resolve()})},r,s,i,this.publisher)}},Xd=require("terser"),Zd=class{minifiers=new Map;minifyOutput;constructor(t=!1){this.minifyOutput=t,this.setupMinifiers()}setupMinifiers(){this.minifiers.set("text/css",this.minifyCSS.bind(this)),this.minifiers.set("text/javascript",this.minifyJS.bind(this)),this.minifiers.set("application/javascript",this.minifyJS.bind(this)),this.minifiers.set("application/json",this.minifyJSON.bind(this)),this.minifiers.set("text/html",this.minifyHTML.bind(this)),this.minifiers.set("image/svg+xml",this.minifySVG.bind(this)),this.minifiers.set("application/xml",this.minifyXML.bind(this)),this.minifiers.set("text/xml",this.minifyXML.bind(this))}async minify(t){const e=new Jd(this);return t.transform(e)}getMinifier(t){return this.minifiers.get(t)||null}async minifyCSS(t){return t}async minifyJS(t){try{return(await(0,Xd.minify)(t,{compress:{drop_console:!1,drop_debugger:!0,passes:2},mangle:{toplevel:!1},format:{comments:!1}})).code||t}catch(e){return t}}async minifyJSON(t){try{return JSON.stringify(JSON.parse(t))}catch{return t}}async minifyHTML(t){return t}async minifySVG(t){return t}async minifyXML(t){return t}},Jd=class{constructor(t){this.minifierClient=t}key(){return vp.newResourceTransformationKey("minify")}async transform(t){t.addOutPathIdentifier(".min");const e=t.source.inMediaType.type,n=this.minifierClient.getMinifier(e);if(!n)return void t.source.from.pipe(t.target.to);let r="";t.source.from.on("data",t=>{r+=t.toString()}),await new Promise((e,i)=>{t.source.from.on("end",async()=>{try{const i=await n(r);t.target.to.write(i),t.target.to.end(),e()}catch(t){i(t)}}),t.source.from.on("error",i)})}},Qd=require("crypto"),tp=class{async fingerprint(t,e="sha256"){const n=new ep(e);return t.transform(n)}generateIntegrity(t){return`sha256-${(0,Qd.createHash)("sha256").update(t,"utf8").digest("base64")}`}generateSHA384(t){return`sha384-${(0,Qd.createHash)("sha384").update(t,"utf8").digest("base64")}`}generateSHA512(t){return`sha512-${(0,Qd.createHash)("sha512").update(t,"utf8").digest("base64")}`}verifyIntegrity(t,e){const[n,r]=e.split("-",2);let i;switch(n){case"sha256":i=(0,Qd.createHash)("sha256").update(t,"utf8").digest("base64");break;case"sha384":i=(0,Qd.createHash)("sha384").update(t,"utf8").digest("base64");break;case"sha512":i=(0,Qd.createHash)("sha512").update(t,"utf8").digest("base64");break;default:return!1}return i===r}},ep=class{constructor(t){this.algo=t}key(){return vp.newResourceTransformationKey("fingerprint",this.algo)}async transform(t){const e=this.newHash(this.algo);let n="";const r=[];t.source.from.on("data",t=>{e.update(t),r.push(t),n+=t.toString()}),await new Promise((n,i)=>{t.source.from.on("end",()=>{try{const i=e.digest(),s=i.toString("hex");t.data.Integrity=this.integrity(this.algo,i);const a=s.substring(0,12);t.addOutPathIdentifier("."+a);for(const e of r)t.target.to.write(e);t.target.to.end(),n()}catch(t){i(t)}}),t.source.from.on("error",i)})}newHash(t){switch(t){case"md5":return(0,Qd.createHash)("md5");case"sha256":return(0,Qd.createHash)("sha256");case"sha384":return(0,Qd.createHash)("sha384");case"sha512":return(0,Qd.createHash)("sha512");default:throw new Error(`Unsupported hash algorithm: "${t}", use either md5, sha256, sha384 or sha512`)}}integrity(t,e){return`${t}-${e.toString("base64")}`}},np=class{templateExecutor;pr;data;constructor(t,e,n){this.templateExecutor=t,this.pr=e,this.data=n}key(){return vp.newResourceTransformationKey("execute-as-template",this.pr)}async transform(t){try{t.data.targetPath=this.pr;let e="";if("function"==typeof t.source.from.read){let n;const r=[];for(;null!==(n=t.source.from.read());)n&&r.push(n);if(r.length>0)e=Buffer.concat(r).toString();else if(t.source.from.gr&&t.source.from.gr.buffer){const n=t.source.from.gr.buffer,r=[];for(const t of n)t&&t.chunk&&r.push(t.chunk);r.length>0&&(e=Buffer.concat(r).toString())}}if(!e)return new Promise((e,n)=>{const r=[];t.source.from.on("data",t=>{r.push(t)}),t.source.from.on("end",async()=>{try{const i=Buffer.concat(r).toString();await this.executeTemplate(i,t,e,n)}catch(e){n(new Error(`failed to parse Resource "${t.source.inPath}" as Template: ${e}`))}}),t.source.from.on("error",t=>{n(t)}),"function"==typeof t.source.from.resume&&t.source.from.resume()});await this.executeTemplateSync(e,t)}catch(e){throw new Error(`failed to parse Resource "${t.source.inPath}" as Template: ${e}`)}}async executeTemplateSync(t,e){const n=await this.templateExecutor.executeTemplate(e.source.inPath,t,this.data);e.target.to.write(n),e.target.to.end()}async executeTemplate(t,e,n,r){try{await this.executeTemplateSync(t,e),n()}catch(t){r(t instanceof Error?t:new Error(String(t)))}}},rp=class{templateExecutor;constructor(t){this.templateExecutor=t}async executeAsTemplate(t,e,n){try{if(!t)throw new Error("Resource is null or undefined");if("function"!=typeof t.transform)throw new Error("Resource does not implement Transformer interface. Resource type: "+typeof t);const r=new np(this.templateExecutor,e.replace(/\\/g,"/").replace(/^\/+/,""),n);return await t.transform(r)}catch(t){throw t}}},ip=m(require("path"));j();var sp=require("stream"),ap=N("resources",{component:"publisher"}),op=class{pubFs;urlSvc;constructor(t,e){this.pubFs=t,this.urlSvc=e}async openPublishFileForWriting(t){const e=t.replace(/^\/+/,"");try{const t=await this.pubFs.create(e);return new lp(t)}catch(t){if("ENOENT"===t.code||t.message.includes("ENOENT")){const t=ip.dirname(e);await this.pubFs.mkdirAll(t,511);const n=await this.pubFs.create(e),r=n.close.bind(n);return n.close=async()=>{try{await r()}catch(t){throw ap.errorf("❌ [Publisher.File.close] Error closing publish file (retry) %s, $s",e,t),t}},new lp(n)}throw t}}async openFilesForWriting(...t){if(0===t.length)throw new Error("No filenames provided");const e=t[0];return await this.openFileForWriting(e)}async openFileForWriting(t){const e=ip.normalize(t);try{return await this.pubFs.create(e)}catch(t){if(!this.isFileNotFoundError(t))throw t;const n=ip.dirname(e);return await this.pubFs.mkdirAll(n,511),await this.pubFs.create(e)}}isFileNotFoundError(t){return t&&("ENOENT"===t.code||t.message?.includes("no such file or directory")||t.message?.includes("not found"))}},lp=class extends sp.Writable{file;constructor(t){super(),this.file=t}mr(t,e,n){this.file.write(t).then(()=>n()).catch(n)}wr(t){this.file.sync?.().then(()=>this.file.close()).then(()=>t()).catch(t)}};j();var cp=m(require("http")),hp=m(require("https")),up=N("resources",{component:"http-client"}),fp=class{defaultTimeout=3e4;defaultHeaders={"User-Agent":"MDFriday-Resources/1.0.0"};async fromRemote(t,e){return new Promise(n=>{try{const r=new URL(t),i="https:"===r.protocol,s=i?hp:cp,a={...this.defaultHeaders,...e?.headers},o={hostname:r.hostname,port:r.port||(i?443:80),path:r.pathname+r.search,method:"GET",headers:a,timeout:e?.timeout||this.defaultTimeout},l=s.request(o,r=>{if(r.statusCode&&r.statusCode>=300&&r.statusCode<400&&r.headers.location)return up.infof("🔄 [HttpClient.fromRemote] Redirecting from %s to %s",t,r.headers.location),void this.fromRemote(r.headers.location,e).then(n);if(!r.statusCode||r.statusCode<200||r.statusCode>=300)return up.errorf("❌ [HttpClient.fromRemote] HTTP error %d when fetching %s: %s",r.statusCode||0,t,r.statusMessage||"Unknown error"),void n(null);const i=[];r.on("data",t=>{i.push(t)}),r.on("end",()=>{try{const e=Buffer.concat(i).toString("utf8");up.infof("✅ [HttpClient.fromRemote] Successfully fetched %d bytes from %s",e.length,t),n(e)}catch(e){up.errorf("❌ [HttpClient.fromRemote] Error converting response to string from %s: %s",t,e),n(null)}}),r.on("error",e=>{up.errorf("❌ [HttpClient.fromRemote] Response error when fetching %s: %s",t,e.message),n(null)})});l.on("error",e=>{up.errorf("❌ [HttpClient.fromRemote] Request error when fetching %s: %s",t,e.message),n(null)}),l.on("timeout",()=>{l.destroy(),up.errorf("❌ [HttpClient.fromRemote] Request timeout when fetching %s",t),n(null)}),l.end()}catch(e){up.errorf("❌ [HttpClient.fromRemote] Error fetching content from %s: %s",t,e),n(null)}})}},dp=m(require("path")),pp=require("crypto");j();var gp=N("resources",{component:"resources"}),mp=class{cache=new Map;workspace;fsSvc;urlSvc;templateSvc;publisher;minifierClient;integrityClient;templateClient=null;httpClient;constructor(t){this.workspace=t,this.fsSvc=t,this.urlSvc=t,this.templateSvc=t,this.publisher=new op(t.publishFs(),t),this.minifierClient=new Zd,this.integrityClient=new tp,this.templateClient=new rp(this.templateSvc),this.httpClient=new fp}setTemplateSvc(t){this.templateSvc=t,this.templateClient=new rp(t)}async getResource(t){const e=dp.posix.normalize(t),n=`${e}__get`;if(this.cache.has(n))return this.cache.get(n)||null;try{const t=this.workspace.assetsFs();if(!await t.stat(e))return null;const r=async()=>{const n=await t.open(e);return await this.createReadSeekCloser(n)},i=await this.buildResource(e,r);return i&&this.cache.set(n,i),i}catch(t){return gp.errorf("❌ [Resources.getResource] Error getting resource %s, %s",e,t),null}}async getResourceWithOpener(t,e){const n=dp.posix.normalize(t),r=`${n}__get_with_opener`;if(this.cache.has(r))return this.cache.get(r)||null;try{const t=await this.buildResource(n,e);return t&&this.cache.set(r,t),t}catch(t){return gp.errorf("❌ [Resources.getResourceWithOpener] Error getting resource with opener %s, %s",n,t),null}}async executeAsTemplate(t,e,n){if(!this.templateClient)throw new Error("Template client not available. Please set template client first.");const r=t.key()+"-template-"+e,i=this.cacheKey(r);if(this.cache.has(i))return this.cache.get(i);try{const r=await this.templateClient.executeAsTemplate(t,e,n);return r?this.cache.set(i,r):gp.warnf("⚠️ [Resources.executeAsTemplate] Template execution returned null for resource %s",t.key()),r}catch(e){throw gp.errorf("❌ [Resources.executeAsTemplate] Error executing template %s, %s",t.key(),e),e}}async minify(t){if(!this.minifierClient)throw new Error("Minifier client not available. Please set minifier client first.");const e=t.key()+"-minify",n=this.cacheKey(e);if(this.cache.has(n))return this.cache.get(n);try{const e=await this.minifierClient.minify(t);return e?this.cache.set(n,e):gp.warnf("⚠️ [Resources.minify] Minification returned null for resource %s",t.key()),e}catch(e){throw gp.errorf("❌ [Resources.minify] Error minifying resource %s, %s",t.key(),e),e}}async fingerprint(t){const e=t.key()+"-fingerprint",n=this.cacheKey(e);if(this.cache.has(n))return this.cache.get(n);try{const e=await this.integrityClient.fingerprint(t);return e?this.cache.set(n,e):gp.warnf("⚠️ [Resources.fingerprint] Fingerprint operation returned null for resource %s",t.key()),e}catch(e){throw gp.errorf("❌ [Resources.fingerprint] Error fingerprinting resource %s, %s",t.key(),e),e}}async getRemote(t){const e=`${t}__remote`;if(this.cache.has(e))return this.cache.get(e)||null;try{const n=await this.httpClient.fromRemote(t);if(!n)return null;const r=async()=>this.newReadSeekerNoOpCloserFromString(n),i=await this.buildResource(t,r);return i&&this.cache.set(e,i),i}catch(e){return gp.errorf("❌ [Resources.fromRemote] Error getting remote resource %s, %s",t,e),null}}cacheKey(t){return(0,pp.createHash)("sha256").update(t).digest("hex").substring(0,16)}getMinifierClient(){return this.minifierClient}getIntegrityClient(){return this.integrityClient}setTemplateClient(t){this.templateClient=t}async buildResource(t,e){try{const n=dp.extname(t),r=this.getMediaTypeFromExtension(n),i=yp.newResourcePaths(t,this.workspace);return new Kd(e,r,i,{},this.publisher)}catch(e){return gp.errorf("❌ [Resources.buildResource] Error building resource for %s, %s",t,e),null}}getMediaTypeFromExtension(t){const e={".js":{type:"text/javascript",mainType:"text",subType:"javascript"},".css":{type:"text/css",mainType:"text",subType:"css"},".html":{type:"text/html",mainType:"text",subType:"html"},".json":{type:"application/json",mainType:"application",subType:"json"},".svg":{type:"image/svg+xml",mainType:"image",subType:"svg+xml"},".xml":{type:"application/xml",mainType:"application",subType:"xml"},".txt":{type:"text/plain",mainType:"text",subType:"plain"}},n=t?e[t]||e[".txt"]:e[".html"],r=t?t.substring(1):"html",i=t||".html";return new Jn({type:n.type,mainType:n.mainType,subType:n.subType,delimiter:".",firstSuffix:{suffix:r,fullSuffix:i},mimeSuffix:"",suffixesCSV:r})}async createReadSeekCloser(t){try{const e=[];let n=0;try{for(;;){const r=new Uint8Array(8192),i=await t.read(r);if(0===i.bytesRead)break;n+=i.bytesRead,e.push(r.slice(0,i.bytesRead))}}finally{await t.close()}let r="";if(e.length>0){const t=new Uint8Array(n);let i=0;for(const n of e)t.set(n,i),i+=n.length;r=(new TextDecoder).decode(t)}return this.newReadSeekerNoOpCloserFromString(r)}catch(e){try{await t.close()}catch(e){gp.warnf("❌ [Resources.createReadSeekCloser] Error closing file after read error %s, %s",t.path,e)}return this.newReadSeekerNoOpCloserFromString("")}}newReadSeekerNoOpCloserFromString(t){const{Readable:e}=require("stream"),n=new e({read(){}});return n.push(t),n.push(null),Object.assign(n,{seek:async(t,e)=>0,close:async()=>Promise.resolve()})}},wp=m(require("path")),yp=class t{dir;baseDirTarget;baseDirLink;targetBasePaths;file;baseUrl="";constructor(t="",e="",n="",r="",i=[],s=""){this.dir=t,this.file=e,this.baseDirTarget=n,this.baseDirLink=r,this.targetBasePaths=i,this.baseUrl=s}static newResourcePaths(e,n){const r=e.replace(/\\/g,"/"),i=wp.posix.parse(r);let s=i.dir;return"/"===s&&(s=""),new t(s,i.base,n.baseUrl(),n.baseUrl(),[],n.baseUrl())}join(...t){let e="";for(let n=0;n<t.length;n++){const r=t[n];if(r)if(""===e)e=r;else{const t=!e.endsWith("/")&&!r.startsWith("/"),n=e.endsWith("/")&&r.startsWith("/");e+=n?r.substring(1):t?"/"+r:r}}return e.startsWith("/")&&(e=e.substring(1)),e.endsWith("/")&&e.length>1&&(e=e.substring(0,e.length-1)),e}targetLink(){let t=this.join(this.baseDirLink,this.dir,this.file);return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")||(t="/"+t),t}targetPath(){return this.join(this.dir,this.file)}fromTargetPath(e){const n=e.replace(/\\/g,"/"),r=wp.posix.parse(n);let i=r.dir;return"/"===i&&(i=""),new t(i,r.base,this.baseUrl,this.baseUrl,this.targetBasePaths,this.baseUrl)}pathDir(){return this.dir}pathBaseDirTarget(){return this.baseDirTarget}pathBaseDirLink(){return this.baseDirLink}pathTargetBasePaths(){return this.targetBasePaths}pathFile(){return this.file}},bp=require("crypto"),vp=class t{constructor(t,e=[]){this.name=t,this.elements=e}static newResourceTransformationKey(e,...n){return new t(e,n)}value(){if(0===this.elements.length)return this.name;const t=this.hashElements(...this.elements);return`${this.name}_${t}`}hashElements(...t){const e=t.map(t=>String(t)).join("|");return(0,bp.createHash)("sha256").update(e).digest("hex").substring(0,16)}},Ep=class t{constructor(t,e,n){this.target=t,this.mediaType=e,this.metaData=n}marshal(){return JSON.stringify({Target:this.target,MediaType:this.mediaType,Data:this.metaData})}static unmarshal(e){const n=JSON.parse(e);return new t(n.Target,n.MediaType,n.Data||{})}},kp=N("ssg",{component:"application"}),Sp=(t,e,n,r,i,s)=>({site:t,content:e,fs:n,config:r,modules:i,resources:s});async function Tp(t,e){const n=new Ke,r=jd.default.join(t,"config.json");return await async function(t,e,n,r,i={}){const s={workingDir:bt.resolve(n),modulesDir:bt.resolve(r),publishDir:bt.resolve(dt),cacheDir:""};s.cacheDir=await async function(t,e){if(""!==e)return e;const n=process.env.HOME||process.env.USERPROFILE||"",r=bt.join(n,".cache","mdf");try{return await t.mkdirAll(r,493),r}catch{return bt.join("/tmp","hugo-cache")}}(t,s.cacheDir);const a=new wt(function(t,e){return new yt(t,e)}(t,e),s);try{const e=await a.loadConfigByDefault();for(const[t,n]of Object.entries(i))e.set(t,n);const n=bt.resolve(e.get("publishDir")||dt);return await t.mkdirAll(n,511),function(t,e,n,r,i,s,a,o,l,c){return new X(t,e,n,r,i,s,a,o,l,c)}(t,e,function(t,e={}){const n=function(t){return{baseURL:t.baseurl||Z.baseURL,title:t.title||Z.title,theme:t.theme||Z.theme,timeout:t.timeout||Z.timeout,contentDir:t.contentDir||Z.contentDir,dataDir:t.dataDir||Z.dataDir,layoutDir:t.layoutDir||Z.layoutDir,staticDir:t.staticDir||Z.staticDir,archetypeDir:t.archetypeDir||Z.archetypeDir,assetDir:t.assetDir||Z.assetDir,publishDir:t.publishDir||Z.publishDir,buildDrafts:void 0!==t.buildDrafts?t.buildDrafts:Z.buildDrafts,buildExpired:void 0!==t.buildExpired?t.buildExpired:Z.buildExpired,buildFuture:void 0!==t.buildFuture?t.buildFuture:Z.buildFuture,copyright:t.copyright||Z.copyright,defaultContentLanguage:t.defaultContentLanguage||Z.defaultContentLanguage,defaultContentLanguageInSubdir:void 0!==t.defaultContentLanguageInSubdir?t.defaultContentLanguageInSubdir:Z.defaultContentLanguageInSubdir,disableAliases:void 0!==t.disableAliases?t.disableAliases:Z.disableAliases,disablePathToLower:void 0!==t.disablePathToLower?t.disablePathToLower:Z.disablePathToLower,disableKinds:t.disableKinds||Z.disableKinds,disableLanguages:t.disableLanguages||Z.disableLanguages,renderSegments:t.renderSegments||Z.renderSegments,disableHugoGeneratorInject:void 0!==t.disableHugoGeneratorInject?t.disableHugoGeneratorInject:Z.disableHugoGeneratorInject,disableLiveReload:void 0!==t.disableLiveReload?t.disableLiveReload:Z.disableLiveReload,enableEmoji:void 0!==t.enableEmoji?t.enableEmoji:Z.enableEmoji}}(t);return new J(n,e)}(e.get(""),e.getParams("params")),function(t,e,n){return new pt(t,e,n)}(s.workingDir,s.modulesDir,n),function(t){const e=function(t){const e={mounts:[],imports:[]};return t.mounts&&Array.isArray(t.mounts)&&(e.mounts=t.mounts.map(t=>({source:t.source||"",target:t.target||"",lang:t.lang}))),t.imports&&Array.isArray(t.imports)&&(e.imports=t.imports.map(t=>({path:t.path||"",url:t.url,version:t.version,mounts:t.mounts||[]}))),e}(t);return new Q(e)}(e.get("module")||{}),function(t){const e=function(t){const e={disqus:{...tt.disqus},googleAnalytics:{...tt.googleAnalytics},rss:{...tt.rss},x:{...tt.x}};return t&&(t.disqus&&(e.disqus.shortname=t.disqus.shortname||e.disqus.shortname),t.googleAnalytics&&(e.googleAnalytics.id=t.googleAnalytics.id||e.googleAnalytics.id),t.rss&&(e.rss.limit=void 0!==t.rss.limit?t.rss.limit:e.rss.limit)),e}(t);return new et(e)}(e.get("services")),function(t){const e=function(t){const e={userConfig:{},platformTemplates:[...lt]};if(t&&"object"==typeof t)for(const[n,r]of Object.entries(t))if(r&&"object"==typeof r){const t=r;t.link&&(e.userConfig[n]={link:t.link})}return e}(t);return new ct(e)}(e.get("social")),function(t){const e=function(t){const e={};if(!t||0===Object.keys(t).length)return e.en={...nt,title:t?.title||nt.title,params:t?.params||nt.params},e;for(const[n,r]of Object.entries(t)){const i=r,s=k.getNameByCode(n)||n;e[n]={languageCode:n,languageName:s,title:i.title||t.title||"",weight:void 0!==i.weight?i.weight:0,contentDir:i.contentDir||"content",disabled:void 0!==i.disabled&&i.disabled,params:i.params||t.params||{}}}return e}(t);return new rt(e)}(e.get("languages")),e.isSet("taxonomies")?ot(e.get("taxonomies")):ot(e.get("")),function(t){const e=function(t){const e={useInternalRenderer:ht.useInternalRenderer,plugins:{...ht.plugins}};return t&&(void 0!==t.useInternalRenderer&&(e.useInternalRenderer=Boolean(t.useInternalRenderer)),t.plugins&&(void 0!==t.plugins.wikilink&&(e.plugins.wikilink=Boolean(t.plugins.wikilink)),void 0!==t.plugins.tag&&(e.plugins.tag=Boolean(t.plugins.tag)),void 0!==t.plugins.callout&&(e.plugins.callout=Boolean(t.plugins.callout)),void 0!==t.plugins.latex&&(e.plugins.latex=Boolean(t.plugins.latex)),void 0!==t.plugins.mermaid&&(e.plugins.mermaid=Boolean(t.plugins.mermaid)))),e}(t);return new ut(e)}(e.get("markdown")))}finally{a.deleteMergeStrategies()}}(n,r,t,e)}async function xp(t,e){const n={path:t.getDir().getWorkingDir(),publish:t.getDir().getPublishDir(),osFs:t.fs()};return await async function(t,e){const n=function(t){const e=t.osFs,n=t.osFs,r=ye(t.osFs,[t.publish]);return new ae(e,n,r)}(t),r=await async function(t,e){const n=(r=t.getSource(),new He(r));var r;return await n.collect(e),n}(n,e),i=ye(t.osFs,[t.path]);return new Ae(n,r.overlayMountsPrompt,r.overlayMountsWorkflow,r.overlayMountsContent,r.overlayMountsLayouts,r.overlayMountsStatics,r.overlayMountsAssets,r.overlayMountsI18n,i)}(n,e)}async function Ap(t,e,n,r){const i={baseUrl:()=>e.getRoot().baseUrl(),markdown:()=>r,useInternalRenderer:()=>e.getMarkdown().useInternalRenderer(),isWikilinkEnabled:()=>e.getMarkdown().isWikilinkEnabled(),isTagEnabled:()=>e.getMarkdown().isTagEnabled(),isCalloutEnabled:()=>e.getMarkdown().isCalloutEnabled(),isLatexEnabled:()=>e.getMarkdown().isLatexEnabled(),isMermaidEnabled:()=>e.getMarkdown().isMermaidEnabled(),newFileMetaInfo:e=>t.newFileMetaInfo(e),newFileMetaInfoWithContent:e=>t.newFileMetaInfoWithContent(e),contentFs:()=>t.contentFs(),walkContent:(e,n,r,i)=>t.walkContent(e,n,r,i),walkI18n:(e,n,r)=>t.walkI18n(e,n,r),isLanguageValid:t=>e.getLanguage().isLanguageValid(t),getSourceLang:t=>n.getSourceLang(t),getLanguageIndex:t=>e.getLanguage().getLanguageIndex(t),getLanguageByIndex:t=>e.getLanguage().getLanguageByIndex(t),defaultLanguage:()=>e.getLanguage().defaultLanguage(),languageIndexes:()=>e.getLanguage().languageIndexes(),views:()=>e.getTaxonomy().getViews().map(t=>{const e=t.singular,n=t.plural;return{singular:()=>e||"",plural:()=>n||""}})};return async function(t){const e=new vs(function(t,e){const n=new hn({style:"github",lineNos:!1,lineNoStart:1,anchorLineNos:!1,lineAnchors:"",lineNumbersInTable:!0,noClasses:!0,codeFences:!0,guessSyntax:!1,tabWidth:4});return new or(e||!t?new Ur({extensions:{typographer:{disable:!1,leftSingleQuote:"&lsquo;",rightSingleQuote:"&rsquo;",leftDoubleQuote:"&ldquo;",rightDoubleQuote:"&rdquo;",enDash:"&ndash;",emDash:"&mdash;",ellipsis:"&hellip;",leftAngleQuote:"&laquo;",rightAngleQuote:"&raquo;",apostrophe:"&rsquo;"},footnote:!0,definitionList:!0,table:!0,strikethrough:!0,linkify:!0,linkifyProtocol:"https",taskList:!0,cjk:{enable:!1,eastAsianLineBreaks:!1,eastAsianLineBreaksStyle:"simple",escapedSpace:!1},passthrough:{enable:!1,delimiters:{inline:[],block:[]}},highlight:{style:"github",lineNos:!1,lineNoStart:1,anchorLineNos:!1,lineAnchors:"",lineNumbersInTable:!0,noClasses:!0,codeFences:!0,guessSyntax:!1,tabWidth:4},wikilink:{enable:!0,disableBrokenWikilinks:!1,markdownLinkResolution:"shortest",prettyLinks:!0},parseTags:!0,callouts:!0,latex:{enable:!0},mermaid:{enable:!0}},renderer:{unsafe:!0},parser:{autoHeadingID:!0,autoHeadingIDType:"github",wrapStandAloneImageWithinParagraph:!0,attribute:{title:!0,block:!1}},duplicateResourceFiles:!1,renderHooks:{image:{enableDefault:!0},link:{enableDefault:!0}}},void 0):t,n)}(t.markdown(),t.useInternalRenderer())),n=await async function(t){const e=new oi(t.defaultLanguage());try{await e.setupTranslateFuncs(t)}catch(t){li.warn("Failed to setup translator, continuing without i18n support:",t)}return e}(t),r=new ma(t,t,t,null,null,new ba(t.views(),t),new Sa(t),new Ts(t),new As(t),e,null),i=new gs(r);r.pageMapper=i,i.setupReverseIndex();const s=new bs(t,e,i,n);return r.contentHub=s,s}(i)}function Cp(t,e){return new mp({assetsFs:()=>e.assetsFs(),publishFs:()=>e.publishFs(),baseUrl:()=>t.getProvider().getString("baseURL")||"http://localhost",executeTemplate:async(t,e,n)=>{throw new Error("Template execution not initialized. Please call resources.setTemplateSvc() first.")}})}async function Dp(t,e,n,r){const i=function(t,e,n){const r=t.getProvider().getString("baseURL")||"http://localhost";return{relURL:t=>e.getURL().relURL(t),absURL:t=>e.getURL().absURL(t,e.isMultipleLanguage(),e.languagePrefix()),urlize:t=>e.getURL().urlize(t),translate:t=>e.translate(t),relRefFrom:async(t,e)=>[t.path||"",null],title:()=>t.getProvider().getString("title")||"My Site",baseURL:()=>r,params:()=>t.getProvider().getParams("params"),menus:()=>({}),isMultiLanguage:()=>t.getLanguage().languageKeys().length>1,version:()=>"0.1.0",environment:()=>"development",generator:()=>"AuPro Static Site Generator",defaultLanguage:()=>t.getLanguage().defaultLanguage(),languageKeys:()=>t.getLanguage().languageKeys(),Get:async function(t){try{return await n.getResource(t)}catch(e){return kp.warn(`Resource not found: ${t}`,e),Promise.resolve(null)}},GetRemote:async function(t){return await n.getRemote(t)},Minify:async function(t){return await n.minify(t)},Fingerprint:async function(t){return await n.fingerprint(t)},ExecuteAsTemplate:async function(t,e,r){return await n.executeAsTemplate(r,t,e)}}}(e,n,r),s={walk:t.walkLayouts.bind(t)};return await async function(t,e){return(new da).createWithServices(t,e)}(s,i)}async function Pp(t,e){return{async lookupLayout(e){const[n,r,i,s]=await t.findFirst(e);return s?{preparer:null,found:!1}:i&&n&&r?{preparer:{name:()=>r,execute:async t=>{const[e,r]=await n.Execute(t);if(r)throw kp.errorf("template exec error: %s",r),r;return e}},found:!0}:{preparer:null,found:!1}},async executeWithContext(t,e){if(!t)return"<html><body>Default template - no preparer</body></html>";try{return await t.execute(e)}catch(t){return kp.error(`❌ Template execution error: ${t}`),`<html><body>Template execution error: ${t}</body></html>`}}}}async function Lp(t,e,n){return function(t){const e=new Ad(t.publishFs()),n=new Pa(t.baseUrl(),!0),r=new Nd(t),i=new _d("MDFriday","support@mdfriday.com"),s=new Od,a=new Id("0.1.0"),o=new Td(t,t,t,t,t,t,e,i,s,a,n,null,r,null,t.siteTitle()),l=function(t,e,n){return new qd(t,e,n)}(t,t,o);return o.navigation=l.createNavigation(),o.ref=new Ld({home:{page:null},sitePage:async t=>{const e=await o.sitePage(t);return{relPermalink:()=>e.path?e.path():"",permalink:()=>e.path?e.path():""}}},t,"/404.html"),o}({configParams:()=>t.getProvider().getParams("params"),siteTitle:()=>t.getProvider().getString("title")||"My Site",menus:()=>({}),isGoogleAnalyticsEnabled:()=>t.getService().isGoogleAnalyticsEnabled(),googleAnalyticsID:()=>t.getService().googleAnalyticsID(),isGoogleAnalyticsRespectDoNotTrack:()=>t.getService().isGoogleAnalyticsRespectDoNotTrack(),isDisqusEnabled:()=>t.getService().isDisqusEnabled(),disqusShortname:()=>t.getService().disqusShortname(),isXRespectDoNotTrack:()=>t.getService().isXRespectDoNotTrack(),isXDisableInlineCSS:()=>t.getService().isXDisableInlineCSS(),getConfiguredSocialPlatforms:()=>t.getSocial().getConfiguredPlatforms(),getSocialLink:e=>{const n=t.getSocial().getSocialLink(e);return n?n.url:""},getSocialTitle:e=>{const n=t.getSocial().getSocialLink(e);return n?n.title:""},globalPages:async t=>await n.globalPages(t),globalRegularPages:async()=>await n.globalRegularPages(),walkPages:async(t,e)=>{await n.walkPages(t,e)},getPageSources:async t=>n.getPageSources(t),walkTaxonomies:async(t,e)=>{await n.walkTaxonomies(t,e)},searchPage:async(t,e)=>[],getPageFromPath:async(t,e)=>{try{const r=n.getPageFromPath(t,e);return r||kp.error(`⚠️ Application.getPageFromPath: content domain returned null for path: "${e}"`),r}catch(t){return kp.error("❌ Application.getPageFromPath error delegating to content domain:",t),null}},getPageFromPathSync:(t,e)=>{try{const r=n.getPageFromPath(t,e);return r||kp.warn(`⚠️ Application.getPageFromPathSync: content domain returned null for path: ${e}`),r}catch(t){return kp.error("❌ Application.getPageFromPathSync error delegating to content domain:",t),null}},getPageRef:async(t,e,n)=>null,translate:(t,e)=>n.translate(t,e),defaultLanguage:()=>t.getLanguage().defaultLanguage(),languageKeys:()=>t.getLanguage().languageKeys(),getLanguageIndex:e=>t.getLanguage().getLanguageIndex(e),getLanguageName:e=>t.getLanguage().getLanguageName(e),changeFreq:()=>"weekly",priority:()=>.5,generateSitemap:async()=>({urls:[]}),publishFs:()=>e.publishFs(),staticFs:()=>e.staticFs(),copyStaticFiles:(t,n)=>e.copyStatic([t],n),workingDir:()=>t.getProvider().getString("workingDir")||process.cwd(),getResource:async t=>null,getResourceWithOpener:async(t,e)=>({name:()=>t,readSeekCloser:e,targetPath:()=>t}),baseUrl:()=>t.getProvider().getString("baseURL")||"http://localhost"})}async function Rp(t,e,n){try{const r=process.cwd();process.chdir(t);try{await async function(t,e,n){try{const r=await Tp(t,e),i=n,s=await async function(t){const e={osFs:()=>t.fs(),projDir:()=>t.getDir().getWorkingDir(),moduleDir:()=>t.getDir().getThemesDir(),moduleCacheDir:()=>t.getDir().getThemesCacheDir(),importPaths:()=>t.getModule().importPaths(),defaultLanguageKey:()=>t.getLanguage().defaultLanguage(),otherLanguageKeys:()=>t.getLanguage().otherLanguageKeys(),getRelDir:(e,n)=>t.getLanguage().getRelDir(e,n)};return await async function(t){try{const e=t.httpClient?.(),n=Lt(t.osFs(),void 0,void 0,e),r=Mt(t.osFs()),i=Bt(t.osFs(),t.moduleCacheDir()),s=Jt(t,n,r,i);return await s.load(),s}catch(t){const e=t instanceof Error?t.message:String(t);throw Qt.error(`Failed to create modules: ${e}`),new kt(`Failed to create modules: ${e}`,"FACTORY_FAILED")}}(e)}(r),a=await xp(r,s),o=await Ap(a,r,s,i),l=await Lp(r,a,o),c=Cp(r,a),h=await Dp(a,r,l,c);c.setTemplateSvc({executeTemplate:async(t,e,n)=>await h.executeRaw(t,e,n)}),o.setTemplateSvc({execute:async(t,e)=>await h.executeShortcode(t,e)}),await o.collectPages();const u=await Pp(h);await l.build(u)}catch(t){const e=t instanceof Error?t.message:String(t);throw kp.error(`❌ Static site generation failed: ${e}`),new Error(`Failed to generate static site: ${e}`)}}(t,e,n)}finally{process.chdir(r)}}catch(t){const e=t instanceof Error?t.message:String(t);throw kp.error(`❌ SSG processing failed: ${e}`),new Error(`Failed to process SSG: ${e}`)}}async function Np(t,e,n,r,i){try{r?.({stage:"config",message:"Loading configuration...",percentage:5});const s=await Tp(t,e),a=n;r?.({stage:"modules",message:"Creating and downloading modules...",percentage:10});const o=await async function(t,e,n){const r={osFs:()=>t.fs(),projDir:()=>t.getDir().getWorkingDir(),moduleDir:()=>t.getDir().getThemesDir(),moduleCacheDir:()=>t.getDir().getThemesCacheDir(),importPaths:()=>t.getModule().importPaths(),defaultLanguageKey:()=>t.getLanguage().defaultLanguage(),otherLanguageKeys:()=>t.getLanguage().otherLanguageKeys(),getRelDir:(e,n)=>t.getLanguage().getRelDir(e,n),httpClient:n?()=>n:void 0};return await async function(t,e){const n=e?t=>{e({stage:"modules",message:`Downloading module: ${t.modulePath}`,percentage:10+Math.floor(.2*t.downloadPercentage),moduleDownload:{modulePath:t.modulePath,downloadPercentage:t.downloadPercentage}})}:void 0;return await async function(t,e){try{const n=t.httpClient?.(),r=Lt(t.osFs(),void 0,void 0,n),i=Mt(t.osFs()),s=Bt(t.osFs(),t.moduleCacheDir()),a=Jt(t,r,i,s);return await a.load(e),a}catch(t){const e=t instanceof Error?t.message:String(t);throw Qt.error(`Failed to create modules: ${e}`),new kt(`Failed to create modules: ${e}`,"FACTORY_FAILED")}}(t,n)}(r,e)}(s,r,i);r?.({stage:"filesystem",message:"Creating filesystem...",percentage:30});const l=await xp(s,o);r?.({stage:"content",message:"Creating content engine...",percentage:40});const c=await Ap(l,s,o,a);r?.({stage:"site",message:"Creating site...",percentage:50});const h=await Lp(s,l,c),u=Cp(s,l);r?.({stage:"template",message:"Creating template engine...",percentage:60});const f=await Dp(l,s,h,u);u.setTemplateSvc({executeTemplate:async(t,e,n)=>await f.executeRaw(t,e,n)}),c.setTemplateSvc({execute:async(t,e)=>await f.executeShortcode(t,e)}),r?.({stage:"pages",message:"Collecting pages...",percentage:65}),await c.collectPages(),r?.({stage:"build",message:"Building site...",percentage:70});const d=await Pp(f);return await async function(t,e,n){const r=n?t=>{const e=70+Math.floor(t.currentPage/t.totalPages*29);n({stage:"build",message:`Rendering pages (${t.currentPage}/${t.totalPages})...`,percentage:e,pageRender:t})}:void 0;await t.buildWithProgress(e,r)}(h,d,r),r?.({stage:"completion",message:"SSG generation completed",percentage:100}),Sp(h,c,l,s,o,u)}catch(t){const e=t instanceof Error?t.message:String(t);throw kp.error(`❌ Static site generation failed: ${e}`),new Error(`Failed to generate static site: ${e}`)}}async function _p(t,e,n,r,i){try{const s=process.cwd();process.chdir(t);try{await Np(t,e,n,r,i)}finally{process.chdir(s)}}catch(t){const e=t instanceof Error?t.message:String(t);throw kp.error(`❌ SSG processing failed: ${e}`),new Error(`Failed to process SSG: ${e}`)}}j();var Op=m(require("chokidar")),Ip=m(require("path"));j();var Mp=N("web",{component:"content-file-watcher"}),Fp=class{constructor(t){this.config=t,this.batchDelay=t.batchDelay||500}watcher=null;eventQueue=[];batchTimer=null;batchDelay;callbacks=[];async startWatching(){this.watcher&&await this.stopWatching(),this.watcher=Op.watch(this.config.contentDirs,{ignored:[/(^|[\/\\])\../,/\.tmp$/,/\.swp$/,/~$/,/\.DS_Store$/,...this.config.ignorePatterns||[]],persistent:!0,ignoreInitial:!0,followSymlinks:!0,awaitWriteFinish:{stabilityThreshold:100,pollInterval:50}}),this.watcher.on("add",t=>this.queueEvent(t,"created")).on("change",t=>this.queueEvent(t,"modified")).on("unlink",t=>this.queueEvent(t,"deleted")).on("error",t=>{Mp.error("File watcher error:",t)})}onFileChange(t){this.callbacks.push(t)}queueEvent(t,e){let n=t;const{projContentDirs:r,contentDirs:i}=this.config;for(let t=0;t<r.length;t++){const e=r[t];for(let t=0;t<i.length;t++){const r=i[t];if(e!==r&&n.startsWith(r)){n=e+n.slice(r.length);break}}}const s=Ip.normalize(n);if(!this.isRelevantFile(s))return;const a={filePath:s,eventType:e,timestamp:Date.now(),isMarkdown:this.isMarkdownFile(s),isImage:this.isImageFile(s)};this.eventQueue.push(a),this.scheduleBatch()}isRelevantFile(t){return this.isMarkdownFile(t)||this.isImageFile(t)}isMarkdownFile(t){const e=Ip.extname(t).toLowerCase();return".md"===e||".markdown"===e}isImageFile(t){const e=Ip.extname(t).toLowerCase();return[".jpg",".jpeg",".png",".gif",".svg",".webp",".bmp"].includes(e)}scheduleBatch(){this.batchTimer&&clearTimeout(this.batchTimer),this.batchTimer=setTimeout(async()=>{if(this.eventQueue.length>0){const t=this.deduplicateEvents(this.eventQueue);this.eventQueue=[];for(const e of this.callbacks)try{await e(t)}catch(t){Mp.error("Error processing file change events:",t)}}},this.batchDelay)}deduplicateEvents(t){const e=new Map;for(const n of t){const t=e.get(n.filePath);(!t||n.timestamp>t.timestamp)&&e.set(n.filePath,n)}return Array.from(e.values())}async stopWatching(){this.batchTimer&&(clearTimeout(this.batchTimer),this.batchTimer=null),this.watcher&&(await this.watcher.close(),this.watcher=null),this.eventQueue=[],this.callbacks=[]}},$p=m(require("http")),Up=m(require("path")),Bp=m(require("fs/promises")),qp=require("ws");j();var jp=N("web",{component:"livereload-server"}),Hp=class{httpServer=null;wsServer=null;clients=new Set;running=!1;config;constructor(t){this.config={port:t.port||8091,host:t.host||"localhost",livereloadPort:t.livereloadPort||35729,enableLiveReload:!1!==t.enableLiveReload,publicDir:t.publicDir}}async start(){if(this.running)jp.warn("LiveReloadServer already running");else try{await this.startHttpServer(),this.config.enableLiveReload&&await this.startLiveReloadServer(),this.running=!0}catch(t){throw jp.error("Failed to start LiveReloadServer:",t),t}}async stop(){if(this.running)try{for(const t of this.clients)t.close();this.clients.clear(),this.wsServer&&(this.wsServer.close(),this.wsServer=null),this.httpServer&&(await new Promise(t=>{this.httpServer.close(()=>t())}),this.httpServer=null),this.running=!1}catch(t){jp.error("Error stopping LiveReloadServer:",t)}}notifyReload(t){if(!this.config.enableLiveReload||0===this.clients.size)return;const e={command:"reload",liveCSS:this.shouldLiveReloadCSS(t),liveImg:this.shouldLiveReloadImages(t)};if(t&&1===t.length){const n=t[0],r=Up.extname(n).toLowerCase();".css"===r?(e.path=n,e.liveCSS=!0):[".jpg",".jpeg",".png",".gif",".svg",".webp"].includes(r)&&(e.path=n,e.liveImg=!0)}const n=JSON.stringify(e);for(const t of this.clients)t.readyState===qp.WebSocket.OPEN&&t.send(n)}getUrl(){return`http://${this.config.host}:${this.config.port}`}isServerRunning(){return this.running}async startHttpServer(){this.httpServer=$p.createServer(async(t,e)=>{try{await this.handleHttpRequest(t,e)}catch(t){jp.error("HTTP request error:",t),e.statusCode=500,e.end("Internal Server Error")}}),await new Promise((t,e)=>{this.httpServer.listen(this.config.port,this.config.host,()=>{t()}),this.httpServer.on("error",t=>{"EADDRINUSE"===t.code?(this.config.port++,this.config.port<8099?this.httpServer.listen(this.config.port,this.config.host):e(new Error("No available ports"))):e(t)})})}async startLiveReloadServer(){this.wsServer=new qp.WebSocketServer({port:this.config.livereloadPort,host:this.config.host}),this.wsServer.on("connection",t=>{this.clients.add(t),t.send(JSON.stringify({command:"hello",protocols:["http://livereload.com/protocols/official-7"],serverName:"foundry-livereload"})),t.on("close",()=>{this.clients.delete(t)}),t.on("message",t=>{try{JSON.parse(t.toString())}catch(e){jp.error("Invalid LiveReload message:",t.toString())}})}),this.wsServer.on("error",t=>{jp.error("LiveReload WebSocket server error:",t)})}async handleHttpRequest(t,e){const n=t.url||"/";let r=this.resolveFilePath(n);try{if((await Bp.stat(r)).isDirectory()){const t=Up.join(r,"index.html");try{await Bp.stat(t),r=t}catch{return e.statusCode=404,void e.end("Not Found")}}let t=await Bp.readFile(r);const n=this.getContentType(r);if(e.setHeader("Content-Type",n),n.includes("text/html")&&this.config.enableLiveReload){const e=t.toString(),n=this.getLiveReloadScript(),r=e.replace(/<\/body>/i,`${n}\n</body>`);t=Buffer.from(r,"utf8")}e.setHeader("Cache-Control","no-cache, no-store, must-revalidate"),e.setHeader("Pragma","no-cache"),e.setHeader("Expires","0"),e.statusCode=200,e.end(t)}catch(t){if("ENOENT"!==t.code)throw t;e.statusCode=404,e.end("Not Found")}}resolveFilePath(t){const e=t.split("?")[0].split("#")[0];let n;try{n=decodeURIComponent(e)}catch(t){jp.warn("Failed to decode URL:",e,t),n=e}const r=Up.normalize(n).replace(/^(\.\.[\/\\])+/,""),i=r.startsWith("/")?r.slice(1):r,s=Up.join(this.config.publicDir,i);return"win32"===process.platform&&s.length>260&&jp.warn("Path too long for Windows filesystem:",s),"win32"===process.platform&&/[<>:"|?*\x00-\x1f]/.test(i)&&jp.warn("Path contains invalid characters for Windows:",i),s}getContentType(t){return{".html":"text/html; charset=utf-8",".css":"text/css; charset=utf-8",".js":"application/javascript; charset=utf-8",".json":"application/json; charset=utf-8",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".webp":"image/webp",".ico":"image/x-icon",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".eot":"application/vnd.ms-fontobject",".xml":"application/xml; charset=utf-8",".txt":"text/plain; charset=utf-8"}[Up.extname(t).toLowerCase()]||"application/octet-stream"}getLiveReloadScript(){return`\n<script>\n(function() {\n 'use strict';\n \n var protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';\n var address = protocol + '//${this.config.host}:${this.config.livereloadPort}/livereload';\n var socket = new WebSocket(address);\n \n socket.onmessage = function(event) {\n var data = JSON.parse(event.data);\n \n if (data.command === 'reload') {\n if (data.liveCSS) {\n // 热更新 CSS\n reloadCSS();\n } else if (data.liveImg) {\n // 热更新图片\n reloadImages();\n } else {\n // 完整页面刷新\n window.location.reload();\n }\n }\n };\n \n socket.onopen = function() {\n console.log('LiveReload connected');\n };\n \n socket.onclose = function() {\n console.log('LiveReload disconnected');\n // 尝试重连\n setTimeout(function() {\n window.location.reload();\n }, 1000);\n };\n \n function reloadCSS() {\n var links = document.querySelectorAll('link[rel="stylesheet"]');\n for (var i = 0; i < links.length; i++) {\n var link = links[i];\n var href = link.href;\n if (href) {\n var url = new URL(href);\n url.searchParams.set('_t', Date.now().toString());\n link.href = url.toString();\n }\n }\n console.log('CSS reloaded');\n }\n \n function reloadImages() {\n var images = document.querySelectorAll('img');\n for (var i = 0; i < images.length; i++) {\n var img = images[i];\n var src = img.src;\n if (src) {\n var url = new URL(src);\n url.searchParams.set('_t', Date.now().toString());\n img.src = url.toString();\n }\n }\n console.log('Images reloaded');\n }\n})();\n<\/script>`}shouldLiveReloadCSS(t){return!!t&&t.some(t=>".css"===Up.extname(t).toLowerCase())}shouldLiveReloadImages(t){if(!t)return!1;const e=[".jpg",".jpeg",".png",".gif",".svg",".webp"];return t.some(t=>e.includes(Up.extname(t).toLowerCase()))}},zp=m(require("http")),Wp=m(require("path")),Gp=m(require("fs/promises"));j();var Vp=N("web",{component:"electron-livereload-server"}),Yp=class{httpServer=null;running=!1;config;stateFilePath;constructor(t){this.config={port:t.port||8091,host:t.host||"localhost",livereloadPort:t.livereloadPort||35729,enableLiveReload:!1!==t.enableLiveReload,publicDir:t.publicDir},this.stateFilePath=Wp.join(this.config.publicDir,".foundry-livereload-state.json")}async start(){if(this.running)Vp.warn("ElectronLiveReloadServer already running");else try{await this.startHttpServer(),this.config.enableLiveReload&&await this.initStateFile(),this.running=!0,Vp.info(`ElectronLiveReloadServer started at ${this.getUrl()}`)}catch(t){throw Vp.error("Failed to start ElectronLiveReloadServer:",t),t}}async stop(){if(this.running)try{this.httpServer&&(await new Promise(t=>{this.httpServer.close(()=>t())}),this.httpServer=null);try{await Gp.unlink(this.stateFilePath)}catch(t){}this.running=!1,Vp.info("ElectronLiveReloadServer stopped")}catch(t){Vp.error("Error stopping ElectronLiveReloadServer:",t)}}notifyReload(t){if(!this.config.enableLiveReload)return;const e={timestamp:Date.now(),command:"reload",liveCSS:this.shouldLiveReloadCSS(t),liveImg:this.shouldLiveReloadImages(t),...t&&{changedFiles:t}};if(t&&1===t.length){const n=t[0],r=Wp.extname(n).toLowerCase();(".css"===r||[".jpg",".jpeg",".png",".gif",".svg",".webp"].includes(r))&&(e.path=n)}this.writeStateFile(e).catch(t=>{Vp.error("Failed to write state file:",t)})}getUrl(){return`http://${this.config.host}:${this.config.port}`}isServerRunning(){return this.running}async initStateFile(){const t={timestamp:Date.now(),command:"hello"};await this.writeStateFile(t)}async writeStateFile(t){try{await Gp.writeFile(this.stateFilePath,JSON.stringify(t),"utf8")}catch(t){Vp.error("Failed to write LiveReload state file:",t)}}async startHttpServer(){this.httpServer=zp.createServer(async(t,e)=>{try{await this.handleHttpRequest(t,e)}catch(t){Vp.error("HTTP request error:",t),e.statusCode=500,e.end("Internal Server Error")}}),await new Promise((t,e)=>{this.httpServer.listen(this.config.port,this.config.host,()=>{t()}),this.httpServer.on("error",t=>{"EADDRINUSE"===t.code?(this.config.port++,this.config.port<8099?this.httpServer.listen(this.config.port,this.config.host):e(new Error("No available ports"))):e(t)})})}async handleHttpRequest(t,e){const n=t.url||"/";if(n.startsWith("/.foundry-livereload-state.json"))try{const t=await Gp.readFile(this.stateFilePath,"utf8");return e.setHeader("Content-Type","application/json; charset=utf-8"),e.setHeader("Cache-Control","no-cache, no-store, must-revalidate"),e.setHeader("Pragma","no-cache"),e.setHeader("Expires","0"),e.statusCode=200,void e.end(t)}catch(t){return void("ENOENT"===t.code?(e.statusCode=404,e.end("State file not found")):(e.statusCode=500,e.end("Internal Server Error")))}let r=this.resolveFilePath(n);try{if((await Gp.stat(r)).isDirectory()){const t=Wp.join(r,"index.html");try{await Gp.stat(t),r=t}catch{return e.statusCode=404,void e.end("Not Found")}}let t=await Gp.readFile(r);const n=this.getContentType(r);if(e.setHeader("Content-Type",n),n.includes("text/html")&&this.config.enableLiveReload){const e=t.toString(),n=this.getLiveReloadScript(),r=e.replace(/<\/body>/i,`${n}\n</body>`);t=Buffer.from(r,"utf8")}e.setHeader("Cache-Control","no-cache, no-store, must-revalidate"),e.setHeader("Pragma","no-cache"),e.setHeader("Expires","0"),e.statusCode=200,e.end(t)}catch(t){if("ENOENT"!==t.code)throw t;e.statusCode=404,e.end("Not Found")}}resolveFilePath(t){const e=t.split("?")[0].split("#")[0];let n;try{n=decodeURIComponent(e)}catch(t){Vp.warn("Failed to decode URL:",e,t),n=e}const r=Wp.normalize(n).replace(/^(\.\.[\/\\])+/,""),i=r.startsWith("/")?r.slice(1):r;return Wp.join(this.config.publicDir,i)}getContentType(t){return{".html":"text/html; charset=utf-8",".css":"text/css; charset=utf-8",".js":"application/javascript; charset=utf-8",".json":"application/json; charset=utf-8",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".webp":"image/webp",".ico":"image/x-icon",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".eot":"application/vnd.ms-fontobject",".xml":"application/xml; charset=utf-8",".txt":"text/plain; charset=utf-8"}[Wp.extname(t).toLowerCase()]||"application/octet-stream"}getLiveReloadScript(){return"\n<script>\n(function() {\n 'use strict';\n \n var stateFilePath = '/.foundry-livereload-state.json';\n var storageKey = 'foundry-livereload-last-timestamp';\n var lastTimestamp = 0;\n var pollInterval = 500; // 500ms 轮询间隔\n \n // 从 localStorage 恢复上次的时间戳,避免页面刷新后重复触发\n try {\n var stored = localStorage.getItem(storageKey);\n if (stored) {\n lastTimestamp = parseInt(stored, 10) || 0;\n }\n } catch (error) {\n // localStorage 可能不可用,使用默认值\n console.warn('LiveReload: localStorage not available, may cause duplicate reloads');\n }\n \n function checkForReload() {\n fetch(stateFilePath + '?_t=' + Date.now(), { cache: 'no-cache' })\n .then(function(response) {\n if (!response.ok) {\n throw new Error('Failed to fetch state file');\n }\n return response.json();\n })\n .then(function(state) {\n if (state.timestamp > lastTimestamp) {\n // 更新时间戳并保存到 localStorage\n lastTimestamp = state.timestamp;\n try {\n localStorage.setItem(storageKey, lastTimestamp.toString());\n } catch (error) {\n // localStorage 写入失败,忽略\n }\n \n if (state.command === 'reload') {\n if (state.liveCSS) {\n // 热更新 CSS\n reloadCSS();\n } else if (state.liveImg) {\n // 热更新图片\n reloadImages();\n } else {\n // 完整页面刷新\n window.location.reload();\n }\n }\n }\n })\n .catch(function(error) {\n // 静默处理错误,避免控制台噪音\n });\n }\n \n function reloadCSS() {\n var links = document.querySelectorAll('link[rel=\"stylesheet\"]');\n for (var i = 0; i < links.length; i++) {\n var link = links[i];\n var href = link.href;\n if (href) {\n var url = new URL(href);\n url.searchParams.set('_t', Date.now().toString());\n link.href = url.toString();\n }\n }\n console.log('CSS reloaded');\n }\n \n function reloadImages() {\n var images = document.querySelectorAll('img');\n for (var i = 0; i < images.length; i++) {\n var img = images[i];\n var src = img.src;\n if (src) {\n var url = new URL(src);\n url.searchParams.set('_t', Date.now().toString());\n img.src = url.toString();\n }\n }\n console.log('Images reloaded');\n }\n \n // 开始轮询\n setInterval(checkForReload, pollInterval);\n \n // 初始检查\n checkForReload();\n})();\n<\/script>"}shouldLiveReloadCSS(t){return!!t&&t.some(t=>".css"===Wp.extname(t).toLowerCase())}shouldLiveReloadImages(t){if(!t)return!1;const e=[".jpg",".jpeg",".png",".gif",".svg",".webp"];return t.some(t=>e.includes(Wp.extname(t).toLowerCase()))}},Kp=N("build",{component:"incremental-coordinator"}),Xp=class{constructor(t){if(this.config=t,t.enableWatching){const e={contentDirs:t.contentDirs,projContentDirs:t.projContentDirs||t.contentDirs,batchDelay:t.batchDelay||500};this.fileWatcher=new Fp(e),this.fileWatcher.onFileChange(t=>this.handleFileChanges(t))}if(!1!==t.liveReload?.enabled){const e={port:t.liveReload?.port||8091,host:t.liveReload?.host||"localhost",livereloadPort:t.liveReload?.livereloadPort||35729,publicDir:t.publicDir,enableLiveReload:!0};this.liveReloadServer=function(t){return function(){if("undefined"!=typeof globalThis&&globalThis.window&&globalThis.window.process&&globalThis.window.process.type)return!0;try{return require("electron"),!0}catch{}return!!(process.env.ELECTRON_RUN_AS_NODE||process.env.ELECTRON_NO_ATTACH_CONSOLE||process.versions&&process.versions.electron)}()?new Yp(t):new Hp(t)}(e)}}fileWatcher;liveReloadServer;buildInProgress=!1;initialized=!1;domainInstances;async initialize(){this.initialized?Kp.warn("IncrementalBuildCoordinator already initialized"):(await this.performFullBuildAndCacheDomains(),this.initialized=!0)}async performFullBuildAndCacheDomains(){try{this.domainInstances=await async function(t,e,n,r,i){try{return process.chdir(t),await Np(t,e,n,r,i)}catch(t){const e=t instanceof Error?t.message:String(t);throw kp.error(`❌ SSG processing failed: ${e}`),new Error(`Failed to process SSG: ${e}`)}}(this.config.projDir,this.config.modulesDir,this.config.markdown,this.config.progressCallback,this.config.httpClient)}catch(t){throw Kp.error("Failed to perform full build and cache domains:",t),t}}async startWatching(){if(!this.initialized)throw new Error("Must call initialize() before startWatching()");this.config.enableWatching&&this.fileWatcher&&await this.fileWatcher.startWatching(),this.liveReloadServer&&await this.liveReloadServer.start()}async stopWatching(){this.fileWatcher&&await this.fileWatcher.stopWatching(),this.liveReloadServer&&await this.liveReloadServer.stop()}async handleFileChanges(t){if(this.buildInProgress)setTimeout(()=>this.handleFileChanges(t),1e3);else try{if(this.buildInProgress=!0,this.needFullRebuild(t))return void await this.performFullRebuild(t);await this.performIncrementalBuild(t)}finally{this.buildInProgress=!1}}needFullRebuild(t){return t.some(t=>"deleted"===t.eventType||"created"===t.eventType)}async performIncrementalBuild(t){if(!this.domainInstances)return Kp.error("Domain instances not available, falling back to full rebuild"),void await this.performFullRebuild(t);try{const e=await this.domainInstances.fs.getFileMetaInfos(this.getEventsFilePaths(t));if(await this.domainInstances.content.handleChangeFiles(e),await this.domainInstances.site.renderAllLanguages(),this.liveReloadServer){const e=t.map(t=>t.filePath);this.liveReloadServer.notifyReload(e)}}catch(e){Kp.error("Incremental build failed, falling back to full rebuild:",e),await this.performFullRebuild(t)}}getEventsFilePaths(t){return t.map(t=>t.filePath)}async performFullRebuild(t){if(await _p(this.config.projDir,this.config.modulesDir,this.config.markdown,t=>{Kp.info(`Rebuild progress: ${t.stage} - ${t.percentage}%`)},this.config.httpClient),this.liveReloadServer){const e=t.map(t=>t.filePath);this.liveReloadServer.notifyReload(e)}}isInitialized(){return this.initialized}isBuildInProgress(){return this.buildInProgress}getConfig(){return{...this.config}}getServerUrl(){return this.liveReloadServer?this.liveReloadServer.getUrl():""}getLiveReloadStatus(){if(!this.liveReloadServer)return{running:!1};const t=this.liveReloadServer.isServerRunning();return{running:t,...t&&{url:this.liveReloadServer.getUrl()}}}};async function Zp(t){const e=new Xp(t);return await e.initialize(),t.enableWatching&&await e.startWatching(),e}j(),N("build",{component:"incremental-ssg"});
2
+ var t,e,n,r,i,s,a,o=Object.create,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,h=Object.getOwnPropertyNames,u=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty,d=(t,e)=>function(){return t&&(e=(0,t[h(t)[0]])(t=0)),e},p=(t,e)=>{for(var n in e)l(t,n,{get:e[n],enumerable:!0})},g=(t,e,n,r)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let i of h(e))f.call(t,i)||i===n||l(t,i,{get:()=>e[i],enumerable:!(r=c(e,i))||r.enumerable});return t},m=(t,e,n)=>(n=null!=t?o(u(t)):{},g(!e&&t&&t.t?n:l(n,"default",{value:t,enumerable:!0}),t)),w=t=>g(l({},"__esModule",{value:!0}),t),y=d({"pkg/lang/data.ts"(){t=[{code:"en",name:"English",direction:"ltr",englishName:"English"},{code:"zh",name:"中文",direction:"ltr",englishName:"Chinese"},{code:"ja",name:"日本語",direction:"ltr",englishName:"Japanese"},{code:"ko",name:"한국어",direction:"ltr",englishName:"Korean"},{code:"fr",name:"Français",direction:"ltr",englishName:"French"},{code:"de",name:"Deutsch",direction:"ltr",englishName:"German"},{code:"es",name:"Español",direction:"ltr",englishName:"Spanish"},{code:"pt",name:"Português",direction:"ltr",englishName:"Portuguese"},{code:"ru",name:"Русский",direction:"ltr",englishName:"Russian"},{code:"hi",name:"हिंदी",direction:"ltr",englishName:"Hindi"},{code:"it",name:"Italiano",direction:"ltr",englishName:"Italian"},{code:"nl",name:"Nederlands",direction:"ltr",englishName:"Dutch"},{code:"tr",name:"Türkçe",direction:"ltr",englishName:"Turkish"},{code:"vi",name:"Tiếng Việt",direction:"ltr",englishName:"Vietnamese"},{code:"th",name:"ไทย",direction:"ltr",englishName:"Thai"}],e=[],n=[...t,...e],r=n.reduce((t,e)=>(t[e.code]=e,t),{}),i=n.reduce((t,e)=>(t[e.code]=e.name,t),{})}});function b(){return a||(a=new s),a}function v(){return new s}var E,k,S=d({"pkg/lang/service.ts"(){y(),s=class{getAllCodes(){return n.map(t=>t.code)}getAllNames(){return n.map(t=>t.name)}getCodesByDirection(n){return("ltr"===n?t:e).map(t=>t.code)}getNamesByDirection(n){return("ltr"===n?t:e).map(t=>t.name)}getCodeNameMap(){return{...i}}getCodeNameMapByDirection(n){return("ltr"===n?t:e).reduce((t,e)=>(t[e.code]=e.name,t),{})}getNameByCode(t){return r[t]?.name}getLanguageInfo(t){const e=r[t];return e?{...e}:void 0}isSupported(t){return t in r}getDirection(t){return r[t]?.direction}isLTR(t){return"ltr"===r[t]?.direction}isRTL(t){return"rtl"===r[t]?.direction}},a=null}}),T={};p(T,{ALL_LANGUAGES:()=>n,CODE_NAME_MAP:()=>i,DefaultLanguageService:()=>s,LANGUAGE_MAP:()=>r,LTR_LANGUAGES:()=>t,RTL_LANGUAGES:()=>e,createLanguageService:()=>v,getLanguageService:()=>b,lang:()=>E,languages:()=>k});var x,A,C,D=d({"pkg/lang/index.ts"(){y(),S(),S(),E=b(),k={getAllCodes:()=>E.getAllCodes(),getAllNames:()=>E.getAllNames(),getCodesByDirection:t=>E.getCodesByDirection(t),getNamesByDirection:t=>E.getNamesByDirection(t),getCodeNameMap:()=>E.getCodeNameMap(),getCodeNameMapByDirection:t=>E.getCodeNameMapByDirection(t),getNameByCode:t=>E.getNameByCode(t),getLanguageInfo:t=>E.getLanguageInfo(t),isSupported:t=>E.isSupported(t),getDirection:t=>E.getDirection(t),isLTR:t=>E.isLTR(t),isRTL:t=>E.isRTL(t)}}}),P=d({"pkg/log/types.ts"(){}}),L=d({"pkg/log/logger.ts"(){x=m(require("util")),P(),A=class t{config;fields;constructor(t){this.config={enableCaller:!0,jsonFormat:!0,...t},this.fields={}}shouldLog(t){const e=["debug","info","warn","error","fatal"],n=e.indexOf(this.config.level);return e.indexOf(t)>=n}getCaller(){if(!this.config.enableCaller)return;const t=(new Error).stack;if(!t)return;const e=t.split("\n")[4];if(!e)return;const n=e.match(/at .* \((.+):(\d+):(\d+)\)/);if(n){const[,t,e]=n;return`${t.split("/").pop()}:${e}`}const r=e.match(/at (.+):(\d+):(\d+)/);if(r){const[,t,e]=r;return`${t.split("/").pop()}:${e}`}}formatMessage(t,e){return 0===e.length?t:x.format(t,...e)}writeLog(t,e){if(!this.shouldLog(t))return;const n={level:t,timestamp:(new Date).toISOString(),message:e,...this.fields},r=this.getCaller();r&&(n.caller=r);const i=this.config.jsonFormat?JSON.stringify(n):this.formatPlainText(n);console.log("---",i),"error"===t||"fatal"===t?process.stderr.write(i+"\n"):process.stdout.write(i+"\n"),"fatal"===t&&process.exit(1)}formatPlainText(t){const e=[t.timestamp,t.level.toUpperCase()];t.caller&&e.push(`[${t.caller}]`),e.push(t.message);const n=Object.keys(t).filter(t=>!["level","timestamp","message","caller"].includes(t)).map(e=>`${e}=${JSON.stringify(t[e])}`).join(" ");return n&&e.push(n),e.join(" ")}debug(t,...e){this.writeLog("debug",this.formatMessage(t,e))}info(t,...e){this.writeLog("info",this.formatMessage(t,e))}warn(t,...e){this.writeLog("warn",this.formatMessage(t,e))}error(t,...e){this.writeLog("error",this.formatMessage(t,e))}fatal(t,...e){this.writeLog("fatal",this.formatMessage(t,e))}debugf(t,...e){this.writeLog("debug",this.formatMessage(t,e))}infof(t,...e){this.writeLog("info",this.formatMessage(t,e))}warnf(t,...e){this.writeLog("warn",this.formatMessage(t,e))}errorf(t,...e){this.writeLog("error",this.formatMessage(t,e))}fatalf(t,...e){this.writeLog("fatal",this.formatMessage(t,e))}with(e){const n=new t(this.config);return n.fields={...this.fields,...e},n}}}}),R=d({"pkg/log/http.ts"(){}});function N(t,e){return C.getLogger(t,e)}var _,O,I,M,F,$,U,B,q=d({"pkg/log/manager.ts"(){L(),P(),C=class t{static instance;globalConfig;loggers;constructor(){this.globalConfig={level:"debug",enableCaller:!0,jsonFormat:!0},this.loggers=new Map}static getInstance(){return t.instance||(t.instance=new t),t.instance}setGlobalConfig(t){this.globalConfig={...this.globalConfig,...t},this.loggers.clear()}getGlobalConfig(){return{...this.globalConfig}}getLogger(t,e){const n=t+(e?JSON.stringify(e):"");if(!this.loggers.has(n)){const i=(r=this.globalConfig,new A(r)),s={domain:t,...e},a=i.with(s);this.loggers.set(n,a)}var r;return this.loggers.get(n)}getComponentLogger(t,e,n){const r={component:e,...n};return this.getLogger(t,r)}clearCache(){this.loggers.clear()}getCachedDomains(){return Array.from(this.loggers.keys())}setLogLevel(t){this.setGlobalConfig({level:t})}setCallerEnabled(t){this.setGlobalConfig({enableCaller:t})}setJsonFormat(t){this.setGlobalConfig({jsonFormat:t})}}.getInstance()}}),j=d({"pkg/log/index.ts"(){P(),L(),R(),q(),L(),P(),function(t="info"){new A({level:t})}("info")}}),H={};p(H,{OrderedTaxonomy:()=>$,OrderedTaxonomyEntry:()=>F,TaxonomiesBuilder:()=>B,Taxonomy:()=>M,TaxonomyList:()=>U,WeightedPage:()=>O,WeightedPages:()=>I});var z,W,G=d({"internal/domain/site/entity/taxonomies-builder.ts"(){j(),_=N("site",{component:"taxonomies-builder"}),O=class{page;ordinalWeightPage;constructor(t,e){this.page=t,this.ordinalWeightPage=e}get Page(){return this.page}weight(){return this.ordinalWeightPage.weight()}ordinal(){return this.ordinalWeightPage.ordinal()}owner(){return this.ordinalWeightPage.owner()}get Permalink(){return this.page.Permalink}get RelPermalink(){return this.page.RelPermalink}get Title(){return this.page.Title}},I=class extends Array{page(){return 0===this.length?(_.error("Page called on empty WeightedPages"),null):this[0]}get Page(){return this.page()}pages(){return Array.from(this)}sortByWeight(){this.stableSort((t,e)=>t.weight()-e.weight())}count(){return this.length}get Count(){return this.count()}stableSort(t){const e=this.map((t,e)=>({item:t,index:e}));e.sort((e,n)=>{const r=t(e.item,n.item);return 0!==r?r:e.index-n.index}),this.splice(0,this.length,...e.map(t=>t.item))}},M=class{terms=new Map;get(t){return this.terms.get(t)}set(t,e){this.terms.set(t,e)}has(t){return this.terms.has(t)}keys(){return Array.from(this.terms.keys())}values(){return Array.from(this.terms.values())}get Values(){return this.terms}entries(){return Array.from(this.terms.entries())}size(){return this.terms.size}byCount(){const t=this.taxonomyArray();return t.sort((t,e)=>{const n=t.weightedPages.length,r=e.weightedPages.length;return n===r?t.name.localeCompare(e.name):r-n}),new $(t)}taxonomyArray(){const t=[];for(const[e,n]of this.terms.entries())t.push(new F(e,n));return t}},F=class{name;weightedPages;constructor(t,e){this.name=t,this.weightedPages=e}count(){return this.weightedPages.count()}term(){return this.name}},$=class extends Array{constructor(t){super(),t&&this.push(...t)}getOneOPage(){return 0===this.length?null:this[0].weightedPages.page()}},U=class{taxonomies=new Map;get(t){return this.taxonomies.get(t)}set(t,e){this.taxonomies.set(t,e)}has(t){return this.taxonomies.has(t)}keys(){return Array.from(this.taxonomies.keys())}values(){return Array.from(this.taxonomies.values())}get Values(){return this.taxonomies}entries(){return Array.from(this.taxonomies.entries())}size(){return this.taxonomies.size}},B=class{contentService;constructor(t){this.contentService=t}async buildTaxonomiesForLanguage(t,e){const n=new U;try{return await this.contentService.walkTaxonomies(t,async(t,r,i)=>{n.has(t)||n.set(t,new M);const s=n.get(t);s.has(r)||s.set(r,new I);const a=await e.siteWeightedPage(i);s.get(r).push(a)}),n}catch(t){throw _.error(`Failed to create taxonomies: ${t}`),t}}}}}),V=(z={"node_modules/extend/index.js"(t,e){var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===r.call(t)},o=function(t){if(!t||"[object Object]"!==r.call(t))return!1;var e,i=n.call(t,"constructor"),s=t.constructor&&t.constructor.prototype&&n.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!i&&!s)return!1;for(e in t);return void 0===e||n.call(t,e)},l=function(t,e){i&&"__proto__"===e.name?i(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},c=function(t,e){if("__proto__"===e){if(!n.call(t,e))return;if(s)return s(t,e).value}return t[e]};e.exports=function t(){var e,n,r,i,s,h,u=arguments[0],f=1,d=arguments.length,p=!1;for("boolean"==typeof u&&(p=u,u=arguments[1]||{},f=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});f<d;++f)if(null!=(e=arguments[f]))for(n in e)r=c(u,n),u!==(i=c(e,n))&&(p&&i&&(o(i)||(s=a(i)))?(s?(s=!1,h=r&&a(r)?r:[]):h=r&&o(r)?r:{},l(u,{name:n,newValue:t(p,h,i)})):void 0!==i&&l(u,{name:n,newValue:i}));return u}}},function(){return W||(0,z[h(z)[0]])((W={exports:{}}).exports,W),W.exports}),Y={};p(Y,{AutoIDGenerator:()=>ln,IncrementalBuildCoordinator:()=>Xp,processSSG:()=>Rp,processSSGWithProgress:()=>_p,startIncrementalBuild:()=>Zp}),module.exports=w(Y);var K=class extends Error{constructor(t,e){super(t),this.code=e,this.name="ConfigError"}},X=(new K("configuration not found","CONFIG_NOT_FOUND"),new K("invalid configuration","INVALID_CONFIG"),new K("workspace not found","WORKSPACE_NOT_FOUND"),new K("configuration file not found","CONFIG_FILE_NOT_FOUND"),new K("invalid configuration format","INVALID_CONFIG_FORMAT"),class{configSourceFs;provider;root;dir;module;service;social;language;taxonomy;markdown;constructor(t,e,n,r,i,s,a,o,l,c){this.configSourceFs=t,this.provider=e,this.root=n,this.dir=r,this.module=i,this.service=s,this.social=a,this.language=o,this.taxonomy=l,this.markdown=c}fs(){return this.configSourceFs}getProvider(){return this.provider}theme(){return this.root.defaultTheme()}getDir(){return this.dir}getRoot(){return this.root}getModule(){return this.module}getService(){return this.service}getSocial(){return this.social}getLanguage(){return this.language}getTaxonomy(){return this.taxonomy}getMarkdown(){return this.markdown}setLanguage(t){this.language=t}setTaxonomy(t){this.taxonomy=t}setMarkdown(t){this.markdown=t}validate(){let t=!0;return this.language&&(t=t&&this.language.validate()),this.markdown&&(t=t&&this.markdown.validate()),t}}),Z={baseURL:"",title:"",theme:[],timeout:"30s",contentDir:"content",dataDir:"data",layoutDir:"layouts",staticDir:"static",archetypeDir:"archetypes",assetDir:"assets",publishDir:"public",buildDrafts:!1,buildExpired:!1,buildFuture:!1,copyright:"",defaultContentLanguage:"en",defaultContentLanguageInSubdir:!1,disableAliases:!1,disablePathToLower:!1,disableKinds:[],disableLanguages:[],renderSegments:[],disableHugoGeneratorInject:!1,disableLiveReload:!1,enableEmoji:!1},J=class{rootConfig;rootParams;constructor(t,e={}){this.rootConfig=t,this.rootParams=e}defaultTheme(){return this.rootConfig.theme.length>0?this.rootConfig.theme[0]:""}compiledTimeout(){const t=this.rootConfig.timeout;if(/^\d+$/.test(t))return 1e3*parseInt(t,10);const e=t.match(/^(\d+)([smh])$/);if(e){const t=parseInt(e[1],10);switch(e[2]){case"s":return 1e3*t;case"m":return 60*t*1e3;case"h":return 60*t*60*1e3}}return 3e4}baseUrl(){return this.rootConfig.baseURL}configParams(){return this.rootParams}siteTitle(){return this.rootConfig.title}getRootConfig(){return this.rootConfig}getThemes(){return this.rootConfig.theme}getDefaultContentLanguage(){return this.rootConfig.defaultContentLanguage}shouldBuildDrafts(){return this.rootConfig.buildDrafts}shouldBuildFuture(){return this.rootConfig.buildFuture}shouldBuildExpired(){return this.rootConfig.buildExpired}},Q=class{moduleConfig;constructor(t){this.moduleConfig=t}importPaths(){return this.moduleConfig.imports.map(t=>t.path)}getModuleConfig(){return this.moduleConfig}getImports(){return this.moduleConfig.imports}getMounts(){return this.moduleConfig.mounts}importCount(){return this.moduleConfig.imports.length}mountCount(){return this.moduleConfig.mounts.length}hasImports(){return this.moduleConfig.imports.length>0}hasMounts(){return this.moduleConfig.mounts.length>0}findImport(t){return this.moduleConfig.imports.find(e=>e.path===t)}findMount(t){return this.moduleConfig.mounts.find(e=>e.source===t)}},tt={disqus:{disable:!1,shortname:""},googleAnalytics:{disable:!1,respectDoNotTrack:!1,id:""},rss:{limit:0},x:{respectDoNotTrack:!1,disableInlineCSS:!1}},et=class{serviceConfig;constructor(t){this.serviceConfig=t}isGoogleAnalyticsEnabled(){return!this.serviceConfig.googleAnalytics.disable}googleAnalyticsID(){return this.serviceConfig.googleAnalytics.id}isGoogleAnalyticsRespectDoNotTrack(){return this.serviceConfig.googleAnalytics.respectDoNotTrack}isDisqusEnabled(){return!this.serviceConfig.disqus.disable}disqusShortname(){return this.serviceConfig.disqus.shortname}isXRespectDoNotTrack(){return this.serviceConfig.x.respectDoNotTrack}isXDisableInlineCSS(){return this.serviceConfig.x.disableInlineCSS}rssLimit(){return this.serviceConfig.rss.limit}getServiceConfig(){return this.serviceConfig}getGoogleAnalytics(){return this.serviceConfig.googleAnalytics}getDisqus(){return this.serviceConfig.disqus}getRSS(){return this.serviceConfig.rss}hasEnabledServices(){return this.isGoogleAnalyticsEnabled()||this.isDisqusEnabled()}};D();var nt={languageCode:"en",languageName:"English",title:"",weight:0,contentDir:"content",disabled:!1,params:{}},rt=class{defaultLang;configs;indices;constructor(t){this.configs=t,this.defaultLang=this.calculateDefaultLanguage(),this.indices=[],this.setIndices()}calculateDefaultLanguage(){if(0===Object.keys(this.configs).length)return"en";let t="",e=Number.MAX_SAFE_INTEGER;for(const[n,r]of Object.entries(this.configs))r.weight<e&&(e=r.weight,t=n);return t||Object.keys(this.configs)[0]}languages(){return Object.values(this.configs)}defaultLanguage(){return this.defaultLang}isLanguageValid(t){return Object.prototype.hasOwnProperty.call(this.configs,t)}otherLanguageKeys(){return Object.keys(this.configs).filter(t=>t!==this.defaultLang)}getRelDir(t,e){const n=this.configs[e];if(!n)throw new Error(`Language "${e}" not found`);return n.contentDir||"content"}validate(){return t=this.configs,e=this.defaultLang,Object.prototype.hasOwnProperty.call(t,e);var t,e}setIndices(){const t=[];this.configs[this.defaultLang]&&t.push(this.defaultLang);for(const e of Object.keys(this.configs))e!==this.defaultLang&&t.push(e);this.indices=t}languageKeys(){return[...this.indices]}languageIndexes(){return this.indices.map((t,e)=>e)}getLanguageIndex(t){const e=this.indices.indexOf(t);if(-1===e)throw new Error("Language not found in indices");return e}getLanguageByIndex(t){if(t<0||t>=this.indices.length)throw new Error("Language index out of range");return this.indices[t]}getLanguageName(t){const e=this.configs[t];return e?e.languageName:""}getLanguageConfig(t){return this.configs[t]}getConfigs(){return this.configs}},it={tag:"tags",category:"categories"};function st(...t){let e="";return t.length>0&&(e=t[0],t.length>1&&(e=t.join("/"))),e=e.replace(/^[.\s/]+|[.\s/]+$/g,""),e=e.toLowerCase(),e=e.replace(/\\/g,"/"),""===e||"/"===e?"":(e.startsWith("/")||(e="/"+e),e)}var at=class{taxonomies;views;viewsByTreeKey;constructor(t){this.taxonomies=t,this.views=[],this.viewsByTreeKey={},this.setupViews()}getViews(){return[...this.views]}getTaxonomies(){return{...this.taxonomies}}getViewByTreeKey(t){return this.viewsByTreeKey[t]}hasTaxonomy(t){return Object.prototype.hasOwnProperty.call(this.taxonomies,t)}getPluralForm(t){return this.taxonomies[t]}getSingularForm(t){for(const[e,n]of Object.entries(this.taxonomies))if(n===t)return e}getSingularForms(){return Object.keys(this.taxonomies)}getPluralForms(){return Object.values(this.taxonomies)}setupViews(){this.views=function(t){const e=[];for(const[n,r]of Object.entries(t))e.push({singular:n,plural:r,pluralTreeKey:st(r)});return e.sort((t,e)=>t.plural.localeCompare(e.plural)),e}(this.taxonomies),this.viewsByTreeKey={};for(const t of this.views)this.viewsByTreeKey[t.pluralTreeKey]=t}getViewCount(){return this.views.length}isEmpty(){return 0===Object.keys(this.taxonomies).length}};function ot(t){const e=function(t){if(t.taxonomies&&"object"==typeof t.taxonomies){const e={};for(const[n,r]of Object.entries(t.taxonomies))"string"==typeof r&&(e[n]=r);return e}return{...it}}(t);return new at(e)}var lt=[{id:"email",title:"Email me"},{id:"facebook",title:"Facebook"},{id:"github",title:"GitHub"},{id:"gitlab",title:"GitLab"},{id:"bitbucket",title:"Bitbucket"},{id:"twitter",title:"Twitter"},{id:"slack",title:"Slack"},{id:"reddit",title:"Reddit"},{id:"linkedin",title:"LinkedIn"},{id:"xing",title:"Xing"},{id:"stackoverflow",title:"StackOverflow"},{id:"snapchat",title:"Snapchat"},{id:"instagram",title:"Instagram"},{id:"youtube",title:"Youtube"},{id:"soundcloud",title:"SoundCloud"},{id:"spotify",title:"Spotify"},{id:"bandcamp",title:"Bandcamp"},{id:"itchio",title:"Itch.io"},{id:"keybase",title:"Keybase"},{id:"vk",title:"VK"},{id:"paypal",title:"PayPal"},{id:"telegram",title:"Telegram"},{id:"500px",title:"500px"},{id:"codepen",title:"CodePen"},{id:"kaggle",title:"kaggle"},{id:"mastodon",title:"Mastodon"},{id:"weibo",title:"Weibo"},{id:"medium",title:"Medium"},{id:"discord",title:"Discord"},{id:"strava",title:"Strava"},{id:"steam",title:"Steam"},{id:"quora",title:"Quora"},{id:"amazonwishlist",title:"Amazon Wishlist"},{id:"slideshare",title:"Slideshare"},{id:"angellist",title:"AngelList"},{id:"about",title:"About"},{id:"lastfm",title:"Last.fm"},{id:"bluesky",title:"Bluesky"},{id:"goodreads",title:"Goodreads"}],ct=class{socialConfig;constructor(t){this.socialConfig=t}getUserConfig(){return this.socialConfig.userConfig}getPlatformTemplates(){return this.socialConfig.platformTemplates}getPlatformTemplate(t){return e=t,lt.find(t=>t.id===e);var e}isPlatformConfigured(t){return t in this.socialConfig.userConfig}getConfiguredPlatforms(){return Object.keys(this.socialConfig.userConfig)}getProcessedSocialLinks(){const t=[];for(const[e,n]of Object.entries(this.socialConfig.userConfig)){const r=this.getPlatformTemplate(e);r?t.push({id:e,title:r.title,url:n.link}):t.push({id:e,title:e.charAt(0).toUpperCase()+e.slice(1),url:n.link})}return t}getSocialLink(t){const e=this.socialConfig.userConfig[t];if(!e)return;const n=this.getPlatformTemplate(t);return n?{id:t,title:n.title,url:e.link}:{id:t,title:t.charAt(0).toUpperCase()+t.slice(1),url:e.link}}hasSocialLinks(){return Object.keys(this.socialConfig.userConfig).length>0}getSocialLinkCount(){return Object.keys(this.socialConfig.userConfig).length}getAvailablePlatforms(){return this.socialConfig.platformTemplates.map(t=>t.id)}getSocialConfig(){return this.socialConfig}},ht={useInternalRenderer:!1,plugins:{wikilink:!0,tag:!0,callout:!0,latex:!0,mermaid:!0}},ut=class{markdownConfig;constructor(t){this.markdownConfig=t}useInternalRenderer(){return this.markdownConfig.useInternalRenderer}isWikilinkEnabled(){return this.markdownConfig.plugins.wikilink}isTagEnabled(){return this.markdownConfig.plugins.tag}isCalloutEnabled(){return this.markdownConfig.plugins.callout}isLatexEnabled(){return this.markdownConfig.plugins.latex}isMermaidEnabled(){return this.markdownConfig.plugins.mermaid}getMarkdownConfig(){return this.markdownConfig}getPlugins(){return this.markdownConfig.plugins}hasEnabledPlugins(){const t=this.markdownConfig.plugins;return t.wikilink||t.tag||t.callout||t.latex||t.mermaid}validate(){return!this.markdownConfig.useInternalRenderer||this.hasEnabledPlugins()}},ft=m(require("path")),dt="public",pt=class{workingDir;themesDir;publishDir;constructor(t,e,n=dt){this.workingDir=t,this.themesDir=e,this.publishDir=n}getWorkingDir(){return ft.default.resolve(this.workingDir)}getThemesDir(){return ft.default.resolve(this.themesDir)}getThemesCacheDir(){return ft.default.resolve(this.themesDir,".cache")}getPublishDir(){return ft.default.resolve(this.publishDir)}},gt=class{root;keyCache;constructor(t={}){this.root=this.prepareParams(t),this.keyCache=new Map}prepareParams(t){const e={};for(const[n,r]of Object.entries(t))e[n.toLowerCase()]=r;return e}getNestedKeyAndMap(t,e){let n;this.keyCache.has(t)?n=this.keyCache.get(t):(n=t.split("."),this.keyCache.set(t,n));let r=this.root;for(let t=0;t<n.length-1;t++){const i=n[t];if(!(i in r)){if(!e)return["",null];r[i]={}}const s=r[i];if("object"!=typeof s||null===s)return["",null];r=s}return[n[n.length-1],r]}getString(t){const e=this.get(t);return String(e||"")}getInt(t){const e=this.get(t),n=Number(e);return isNaN(n)?0:Math.floor(n)}getBool(t){const e=this.get(t);return"boolean"==typeof e?e:"string"==typeof e?"true"===e.toLowerCase():Boolean(e)}getParams(t){const e=this.get(t);return e&&"object"==typeof e?e:{}}getStringMap(t){const e=this.get(t);return e&&"object"==typeof e?e:{}}getStringMapString(t){const e=this.get(t);if(e&&"object"==typeof e){const t={};for(const[n,r]of Object.entries(e))t[n]=String(r);return t}return{}}getStringSlice(t){const e=this.get(t);return Array.isArray(e)?e.map(t=>String(t)):[]}get(t){if(""===t)return this.root;const[e,n]=this.getNestedKeyAndMap(t.toLowerCase(),!1);return null!==n?n[e]:void 0}set(t,e){const n=t.toLowerCase();if(""===n)return void(e&&"object"==typeof e?Object.assign(this.root,this.prepareParams(e)):this.root[n]=e);const[r,i]=this.getNestedKeyAndMap(n,!0);null!==i&&(r in i&&"object"==typeof i[r]&&"object"==typeof e&&null!==e?Object.assign(i[r],e):i[r]=e)}keys(){return Object.keys(this.root)}merge(t,e){const n=t.toLowerCase();if(""===n)return void(e&&"object"==typeof e&&Object.assign(this.root,this.prepareParams(e)));const[r,i]=this.getNestedKeyAndMap(n,!0);null!==i&&(r in i&&"object"==typeof i[r]&&"object"==typeof e&&null!==e?Object.assign(i[r],e):i[r]=e)}setDefaults(t){const e=this.prepareParams(t);for(const[t,n]of Object.entries(e))t in this.root||(this.root[t]=n)}setDefaultMergeStrategy(){}walkParams(t){const e=n=>{if(n&&"object"==typeof n&&!Array.isArray(n)){if(t(n))return!0;for(const t of Object.values(n))if(e(t))return!0}return!1};e(this.root)}isSet(t){const[e,n]=this.getNestedKeyAndMap(t.toLowerCase(),!1);return null!==n&&e in n}},mt=m(require("path")),wt=class{cfg;sourceDescriptor;baseDirs;constructor(t,e){this.cfg=new gt,this.sourceDescriptor=t,this.baseDirs=e}async loadConfigByDefault(){const t=this.sourceDescriptor.filename();if(await this.loadProvider(t),this.applyDefaultConfig(),this.cfg.setDefaultMergeStrategy(),!this.cfg.isSet("languages")){const t=this.cfg.getString("defaultContentLanguage");this.cfg.set("languages",{[t]:{}})}return this.cfg}deleteMergeStrategies(){this.cfg.walkParams(t=>!1)}async loadProvider(t){const e=this.baseDirs.workingDir;let n;n=mt.isAbsolute(t)?t:mt.join(e,t);let r="";if(""!==mt.extname(t)&&await this.fileExists(n)&&(r=n),""===r)throw new Error("Unable to locate config file or config directory.");const i=await this.loadConfigFromFile(r);this.cfg.set("",i)}applyDefaultConfig(){this.cfg.setDefaults({baseURL:"",cleanDestinationDir:!1,watch:!1,contentDir:"content",resourceDir:"resources",publishDir:"public",publishDirOrig:"public",themesDir:"themes",assetDir:"assets",layoutDir:"layouts",i18nDir:"i18n",dataDir:"data",archetypeDir:"archetypes",configDir:"config",staticDir:"static",buildDrafts:!1,buildFuture:!1,buildExpired:!1,params:{},environment:"production",uglyURLs:!1,verbose:!1,ignoreCache:!1,canonifyURLs:!1,relativeURLs:!1,removePathAccents:!1,titleCaseStyle:"AP",taxonomies:{tag:"tags",category:"categories"},permalinks:{},sitemap:{priority:-1,filename:"sitemap.xml"},menus:{},disableLiveReload:!1,pluralizeListTitles:!0,capitalizeListTitles:!0,forceSyncStatic:!1,footnoteAnchorPrefix:"",footnoteReturnLinkContents:"",newContentEditor:"",paginate:10,paginatePath:"page",summaryLength:70,rssLimit:-1,sectionPagesMenu:"",disablePathToLower:!1,hasCJKLanguage:!1,enableEmoji:!1,defaultContentLanguage:"en",defaultContentLanguageInSubdir:!1,enableMissingTranslationPlaceholders:!1,enableGitInfo:!1,ignoreFiles:[],disableAliases:!1,debug:!1,disableFastRender:!1,timeout:"30s",timeZone:"",enableInlineShortcodes:!1})}async fileExists(t){try{const e=this.sourceDescriptor.fs();return!(await e.stat(t)).isDir()}catch{return!1}}async loadConfigFromFile(t){const e=this.sourceDescriptor.fs(),n=await e.open(t);try{const t=new Uint8Array(1048576),{bytesRead:e}=await n.read(t),r=(new TextDecoder).decode(t.slice(0,e));try{return JSON.parse(r)}catch{return{}}}finally{await n.close()}}},yt=class{fileSystem;configFilename;constructor(t,e){this.fileSystem=t,this.configFilename=e}fs(){return this.fileSystem}filename(){return this.configFilename}},bt=m(require("path"));var vt="content",Et=["workflows","prompts",vt,"layouts","static","assets","i18n"],kt=class extends Error{constructor(t,e){super(t),this.code=e,this.name="ModuleError"}},St=(new kt("module not found","MODULE_NOT_FOUND"),new kt("download failed","DOWNLOAD_FAILED"),new kt("invalid zip file","INVALID_ZIP"),new kt("mount failed","MOUNT_FAILED"),m(require("path"))),Tt=class t{constructor(t,e,n=""){this.sourcePath=t,this.targetPath=e,this.language=n}source(){return this.sourcePath}target(){return this.targetPath}lang(){return this.language}setLanguage(t){this.language=t}component(){return this.targetPath.split(St.sep)[0]||""}componentAndName(){const t=this.targetPath.split(St.sep);return{component:t[0]||"",name:t.slice(1).join(St.sep)}}copy(){return new t(this.sourcePath,this.targetPath,this.language)}equals(t){return this.sourcePath===t.sourcePath&&this.targetPath===t.targetPath&&this.language===t.language}toConfig(){const t={sourcePath:this.sourcePath,targetPath:this.targetPath};return this.language&&(t.language=this.language),t}toString(){return`${this.sourcePath} -> ${this.targetPath} (${this.language})`}},xt=m(require("path")),At=m(require("http")),Ct=m(require("https"));j();var Dt=N("module",{component:"httpclient"}),Pt=class{constructor(t,e=3e4,n={}){this.fs=t,this.timeout=e,this.headers=n}defaultTimeout=3e4;defaultHeaders={"User-Agent":"MDFriday-CLI/1.0.0"};async download(t,e,n){return new Promise((r,i)=>{try{const s=new URL(t),a="https:"===s.protocol,o=a?Ct:At,l={...this.defaultHeaders,...this.headers,...n?.headers},c={hostname:s.hostname,port:s.port||(a?443:80),path:s.pathname+s.search,method:"GET",headers:l,timeout:n?.timeout||this.timeout},h=o.request(c,async t=>{if(!t.statusCode||t.statusCode<200||t.statusCode>=300)return void i(new kt(`HTTP ${t.statusCode}: ${t.statusMessage}`,"HTTP_ERROR"));const s=parseInt(t.headers["content-length"]||"0",10);let a=0,o=Date.now(),l=-1;try{const c=xt.dirname(e);await this.fs.mkdirAll(c,493);const h=await this.fs.create(e),u=[];t.on("data",t=>{if(u.push(t),a+=t.length,n?.onProgress&&s>0){const t=Date.now(),e=Math.round(a/s*100);if(t-o>=100&&e!==l||e-l>=5){const r={loaded:a,total:s,percentage:e};try{n.onProgress(r),l=e}catch(t){Dt.error(`Progress callback error: ${t}`)}o=t}}}),t.on("end",async()=>{try{const t=Buffer.concat(u),e=new Uint8Array(t);if(await h.write(e),await h.sync(),await h.close(),n?.onProgress&&s>0){const t={loaded:s,total:s,percentage:100};try{n.onProgress(t)}catch(t){Dt.warn(`Progress callback error: ${t}`)}}r()}catch(t){const e=t instanceof Error?t.message:String(t);i(new kt(`File write failed: ${e}`,"WRITE_FAILED"))}}),t.on("error",t=>{Dt.error(`Response error: ${t.message}`),i(new kt(`Download failed: ${t.message}`,"DOWNLOAD_FAILED"))})}catch(t){const e=t instanceof Error?t.message:String(t);i(new kt(`File system error: ${e}`,"FS_ERROR"))}});h.on("error",t=>{Dt.error("Request error:",t),i(new kt(`Request failed: ${t.message}`,"REQUEST_FAILED"))}),h.on("timeout",()=>{h.destroy(),Dt.error(`Request timeout for ${t}`),i(new kt("Request timeout","TIMEOUT"))}),h.end()}catch(t){const e=t instanceof Error?t.message:String(t);i(new kt(`Download failed: ${e}`,"DOWNLOAD_FAILED"))}})}async get(t,e){return new Promise((n,r)=>{try{const i=new URL(t),s="https:"===i.protocol,a=s?Ct:At,o={...this.defaultHeaders,...this.headers,...e?.headers},l={hostname:i.hostname,port:i.port||(s?443:80),path:i.pathname+i.search,method:"GET",headers:o,timeout:e?.timeout||this.timeout},c=a.request(l,t=>{const e=[],i={};Object.entries(t.headers).forEach(([t,e])=>{i[t]=Array.isArray(e)?e.join(", "):e||""}),t.on("data",t=>{e.push(t)}),t.on("end",()=>{const r=Buffer.concat(e),s=r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);n({data:s,headers:i,status:t.statusCode||0})}),t.on("error",t=>{r(new kt(`Response error: ${t.message}`,"RESPONSE_ERROR"))})});c.on("error",t=>{r(new kt(`GET request failed: ${t.message}`,"REQUEST_FAILED"))}),c.on("timeout",()=>{c.destroy(),r(new kt("GET request timeout","TIMEOUT"))}),c.end()}catch(t){const e=t instanceof Error?t.message:String(t);r(new kt(`GET request failed: ${e}`,"REQUEST_FAILED"))}})}};function Lt(t,e,n,r){return r||new Pt(t,e,n)}j();var Rt=m(require("jszip")),Nt=m(require("path")),_t=N("module",{component:"zipextractor"}),Ot=class{constructor(t){this.fs=t}async extract(t,e){try{const n=await this.fs.open(t),r=(await n.stat()).size(),i=new Uint8Array(r),s=await n.read(i);await n.close(),await this.extractZipData(s.buffer,e)}catch(e){const n=e instanceof Error?e.message:String(e);throw _t.error(`ZIP extraction failed for ${t}: ${n}`),new kt(`ZIP extraction failed: ${n}`,"EXTRACTION_FAILED")}}async list(t){try{const e=await this.fs.open(t),n=await e.stat(),r=new Uint8Array(n.size()),i=await e.read(r);return await e.close(),await this.listZipContents(i.buffer)}catch(t){const e=t instanceof Error?t.message:String(t);throw new kt(`ZIP listing failed: ${e}`,"LIST_FAILED")}}async extractZipData(t,e){try{await this.fs.mkdirAll(e,493);const n=new Rt.default,r=await n.loadAsync(t),i=[];r.forEach((t,e)=>{e.dir||i.push(t)});const s=[];let a=0;r.forEach((t,n)=>{s.push(this.extractSingleEntry(t,n,e).then(()=>{a++}))}),await Promise.all(s)}catch(t){const e=t instanceof Error?t.message:String(t);throw _t.error(`Failed to extract ZIP data: ${e}`),new kt(`Failed to extract ZIP data: ${e}`,"EXTRACTION_FAILED")}}async extractSingleEntry(t,e,n){const r=Nt.join(n,t);if(e.dir)await this.fs.mkdirAll(r,493);else{const t=Nt.dirname(r);t!==n&&await this.fs.mkdirAll(t,493);const i=await e.async("uint8array"),s=await this.fs.create(r);await s.write(i),await s.close()}}async listZipContents(t){try{const e=new Rt.default,n=await e.loadAsync(t),r=[];return n.forEach(t=>{r.push(t)}),r}catch(t){const e=t instanceof Error?t.message:String(t);throw new kt(`Failed to list ZIP contents: ${e}`,"LIST_FAILED")}}},It=class{constructor(t){this.fs=t}async extract(t,e){try{throw new kt("Web ZIP extraction not implemented","NOT_IMPLEMENTED")}catch(t){const e=t instanceof Error?t.message:String(t);throw new kt(`Web ZIP extraction failed: ${e}`,"WEB_EXTRACTION_FAILED")}}async list(t){try{throw new kt("Web ZIP listing not implemented","NOT_IMPLEMENTED")}catch(t){const e=t instanceof Error?t.message:String(t);throw new kt(`Web ZIP listing failed: ${e}`,"WEB_LIST_FAILED")}}};function Mt(t,e="node"){switch(e){case"node":return new Ot(t);case"browser":return new It(t);default:throw new Error(`Unsupported environment: ${e}`)}}j();var Ft=m(require("path")),$t=N("module",{component:"cache"}),Ut=class{constructor(t,e="./module/cache"){this.fs=t,this.cacheDir=e}cacheDir;async get(t){try{const e=this.getCacheFilePath(t),n=await this.fs.open(e),r=await n.stat(),i=new Uint8Array(r.size());await n.read(i),await n.close();const s=(new TextDecoder).decode(i);return JSON.parse(s)}catch(e){if(e.message?.includes("ENOENT")||e.message?.includes("no such file"))return $t.error(`Cache miss: ${t}`,e),null;const n=e instanceof Error?e.message:String(e);throw $t.error(`Cache read error for ${t}: ${n}`),new kt(`Failed to read cache: ${n}`,"CACHE_READ_FAILED")}}async set(t,e){try{await this.fs.mkdirAll(this.cacheDir,493);const n=this.getCacheFilePath(t),r=JSON.stringify(e,null,2),i=(new TextEncoder).encode(r),s=await this.fs.create(n);await s.write(i),await s.sync(),await s.close()}catch(e){const n=e instanceof Error?e.message:String(e);throw $t.error(`Cache write error for ${t}: ${n}`),new kt(`Failed to write cache: ${n}`,"CACHE_WRITE_FAILED")}}async has(t){try{const e=this.getCacheFilePath(t);return await this.fs.stat(e),!0}catch(t){return!1}}async delete(t){try{const e=this.getCacheFilePath(t);await this.fs.remove(e)}catch(e){if(!e.message?.includes("ENOENT")&&!e.message?.includes("no such file")){const n=e instanceof Error?e.message:String(e);throw $t.error(`Cache delete error for ${t}: ${n}`),new kt(`Failed to delete cache: ${n}`,"CACHE_DELETE_FAILED")}}}async clear(){try{await this.fs.removeAll(this.cacheDir)}catch(t){if(!t.message?.includes("ENOENT")&&!t.message?.includes("no such file")){const e=t instanceof Error?t.message:String(t);throw $t.error(`Cache clear error: ${e}`),new kt(`Failed to clear cache: ${e}`,"CACHE_CLEAR_FAILED")}}}getCacheFilePath(t){const e=t.replace(/[/\\:*?"<>|]/g,"_").replace(/^_+|_+$/g,"")+".json";return Ft.join(this.cacheDir,e)}getCacheDir(){return this.cacheDir}async getStats(){try{const t=await this.listCacheFiles();let e=0;for(const n of t)try{const t=Ft.join(this.cacheDir,n);e+=(await this.fs.stat(t)).size()}catch(t){}return{totalEntries:t.length,totalSize:e}}catch(t){return{totalEntries:0,totalSize:0}}}async listCached(){try{return(await this.listCacheFiles()).map(t=>Ft.basename(t,".json").replace(/_/g,"/"))}catch(t){return[]}}async listCacheFiles(){try{const t=await this.fs.open(this.cacheDir),e=await t.readdirnames(-1);return await t.close(),e.filter(t=>t.endsWith(".json"))}catch(t){return[]}}};function Bt(t,e){return new Ut(t,e)}var qt=m(require("path")),jt=class t{constructor(t,e,n,r=null,i=!1){this.fs=t,this.absoluteDir=e,this.modulePath=n,this.parentModule=r,this.mountDirs=[],this.metadata=null,this.isProject=i}absoluteDir;modulePath;parentModule;mountDirs;metadata;isProject=!1;isProjectModule(){return this.isProject}owner(){return this.parentModule}mounts(){return this.mountDirs.map(t=>t)}dir(){return this.absoluteDir}path(){return this.modulePath}setMetadata(t){this.metadata=t}getMetadata(){return this.metadata}async applyMounts(t){try{let e=t.mounts||[];if(0===e.length)for(const t of Et){const n=qt.join(this.absoluteDir,t);try{(await this.fs.stat(n)).isDir()&&e.push({sourcePath:t,targetPath:t})}catch(t){}}this.mountDirs=e.map(t=>{return e=t.sourcePath,n=t.targetPath,new Tt(e,n);var e,n})}catch(t){const e=t instanceof Error?t.message:String(t);throw new kt(`Failed to apply mounts: ${e}`,"MOUNT_FAILED")}}appendMount(t){this.mountDirs.push(t)}removeMount(t){const e=this.mountDirs.findIndex(e=>e.equals(t));return e>=0&&(this.mountDirs.splice(e,1),!0)}getMountByTarget(t){return this.mountDirs.find(e=>e.target()===t)||null}getMountsByComponent(t){return this.mountDirs.filter(e=>e.component()===t)}isDownloaded(){return"completed"===this.metadata?.downloadStatus}isDownloading(){return"downloading"===this.metadata?.downloadStatus}isDownloadFailed(){return"failed"===this.metadata?.downloadStatus}async exists(){try{return(await this.fs.stat(this.absoluteDir)).isDir()}catch(t){return!1}}copy(){const e=new t(this.fs,this.absoluteDir,this.modulePath,this.parentModule,this.isProject);return e.mountDirs=this.mountDirs.map(t=>t.copy()),e.metadata=this.metadata?{...this.metadata}:null,e}toString(){return`Module{path: ${this.modulePath}, dir: ${this.absoluteDir}, mounts: ${this.mountDirs.length}}`}},Ht=class{constructor(t){this.module=t}getModule(){return this.module}appendMount(t){this.module.appendMount(t)}setDefaultLanguage(t){const e=this.module.mounts();for(const n of e)n instanceof Tt&&n.setLanguage(t)}applyDefaultMounts(){const t=Et.map(t=>new Tt(t,t));for(const e of t)this.module.appendMount(e)}owner(){return this.module.owner()}mounts(){return this.module.mounts()}dir(){return this.module.dir()}path(){return this.module.path()}};function zt(t,e,n,r){return new jt(t,e,n,r||null,!1)}var Wt=m(require("path")),Gt=class{sourceLangMap;constructor(t){this.sourceLangMap=new Map;for(const e of t)for(const t of e.mounts())this.sourceLangMap.set(t.source(),t.lang())}getSourceLang(t){const e=this.sourceLangMap.get(Wt.default.basename(t));return void 0!==e?[e,!0]:["",!1]}},Vt=class t{themes;constructor(t){this.themes=t}static fromJson(e){return new t(e)}findThemeByUrl(t){const e=this.extractBaseUrl(t);for(const t of this.themes)if(e===this.extractBaseUrl(t.download_url))return t;return null}resolveLatestVersion(t){const e=this.findThemeByUrl(t);return e?e.download_url:t}extractBaseUrl(t){try{const e=new URL(t);return e.searchParams.delete("version"),e.toString()}catch(e){const n=t.indexOf("?");if(-1===n)return t;const r=t.substring(0,n),i=new URLSearchParams(t.substring(n+1));i.delete("version");const s=i.toString();return s?`${r}?${s}`:r}}getAllThemes(){return[...this.themes]}getThemeByName(t){return this.themes.find(e=>e.name.toLowerCase()===t.toLowerCase())||null}getThemesByTag(t){return this.themes.filter(e=>e.tags.some(e=>e.toLowerCase()===t.toLowerCase()))}};j();var Yt=require("smol-toml"),Kt=m(require("path")),Xt=N("module",{component:"modules"}),Zt=class{constructor(t,e,n,r){var i;this.info=t,this.httpClient=e,this.zipExtractor=n,this.moduleCache=r,this.projectModule=function(t){const e=t.osFs(),n=t.projDir(),r=t.defaultLanguageKey(),i=new jt(e,n,"project-root",null,!0),s=new Ht(i);s.applyDefaultMounts(),r&&s.setDefaultLanguage(r);const a=t.otherLanguageKeys();for(const e of a)try{const n=t.getRelDir(vt,e);if(n&&""!==n){const t=new Tt(n,vt,e);s.appendMount(t)}}catch(t){console.warn(`Failed to get relative directory for language ${e}:`,t)}return s}(this.info),this.lang=(i=this.all(),new Gt(i))}projectModule;modules=[];downloadedModules=new Set;lang;themesCache=new Map;proj(){return this.projectModule.getModule()}all(){const t=[this.projectModule.getModule()];return t.push(...this.modules),t}isProjMod(t){return t===this.projectModule.getModule()}async load(t){const e=this.info.importPaths();if(0!==e.length)for(let n=0;n<e.length;n++){const r=e[n],{cleanUrl:i,version:s}=this.parseVersionFromImportPath(r);let a=r;"latest"===s&&(a=await this.resolveLatestVersion(r)),this.downloadedModules.has(a)?Xt.info(`Module already downloaded: ${a}`):await this.addModule(this.projectModule.getModule(),a,e=>{t?.({modulePath:a,downloadPercentage:e.percentage})})}else Xt.warn("No import paths configured - no modules will be downloaded")}parseVersionFromImportPath(t){try{const e=new URL(t),n=e.searchParams.get("version")||"latest";return e.searchParams.delete("version"),{cleanUrl:e.toString(),version:n}}catch(e){return Xt.warn(`Failed to parse import path ${t}:`,e),{cleanUrl:t,version:"latest"}}}getThemeRegistryUrl(t){try{const e=new URL(t).hostname;return"sunwei.xyz"===e||"www.sunwei.xyz"===e?"https://sunwei.xyz/mdf/themes-zh.json":"https://gohugo.net/themes.json"}catch(e){return Xt.warn(`Failed to parse import path ${t}, using default theme registry`),"https://gohugo.net/themes.json"}}async resolveLatestVersion(t){const{version:e}=this.parseVersionFromImportPath(t);if("latest"!==e)return t;try{const e=this.getThemeRegistryUrl(t);Xt.info(`Fetching latest theme versions from ${e}...`);let n=this.themesCache.get(e);if(!n){const t=await this.httpClient.get(e),r=(new TextDecoder).decode(t.data),i=JSON.parse(r);n=Vt.fromJson(i),this.themesCache.set(e,n)}const r=n.resolveLatestVersion(t);return r!==t?Xt.info(`Resolved latest version: ${t} -> ${r}`):Xt.warn(`Could not resolve latest version for ${t}, using original path`),r}catch(e){return Xt.error(`Failed to resolve latest version for ${t}:`,e),t}}async downloadModule(t,e){try{let n=t.version;if("latest"===t.version){const e=await this.resolveLatestVersion(t.path),{version:r}=this.parseVersionFromImportPath(e);n=r}const r=await this.moduleCache.get(t.path);if(r&&"completed"===r.downloadStatus&&this.isCacheValidForVersion(r.version,n)){const e=await this.createModuleFromCache(t,r);if(await e.exists())return Xt.info(`Using cached module ${t.path} version ${r.version}`),e}r&&"completed"===r.downloadStatus&&!this.isCacheValidForVersion(r.version,n)&&Xt.info(`Cache version mismatch for ${t.path}: cached=${r.version}, requested=${n||"latest"}`);const i=this.getModuleDir(t.path),s=Kt.join(i,"module.zip"),a={path:t.path,version:t.version||"latest",url:t.url,dir:i,downloadStatus:"downloading",downloadedAt:new Date};await this.moduleCache.set(t.path,a);try{const n=this.addTimestampToUrl(t.url);await this.httpClient.download(n,s,{onProgress:t=>{e?.({percentage:t.percentage})}}),await this.zipExtractor.extract(s,i),a.downloadStatus="completed",a.downloadedAt=new Date;try{const t=await this.info.osFs().stat(s);a.size=t.size()}catch(t){}try{await this.info.osFs().remove(s)}catch(t){}await this.moduleCache.set(t.path,a);const r=zt(this.info.osFs(),i,t.path);return r.setMetadata(a),await r.applyMounts(t),r}catch(e){a.downloadStatus="failed",await this.moduleCache.set(t.path,a);const n=e instanceof Error?e.message:String(e);throw new kt(`Failed to download module ${t.path}: ${n}`,"DOWNLOAD_FAILED")}}catch(t){if(t instanceof kt)throw t;const e=t instanceof Error?t.message:String(t);throw new kt(`Module download failed: ${e}`,"DOWNLOAD_FAILED")}}async addModule(t,e,n){try{if(this.downloadedModules.has(e))return;const{cleanUrl:t,version:r}=this.parseVersionFromImportPath(e),i={path:e,url:this.getDownloadUrl(t),...r&&{version:r}},s=await this.downloadModule(i,n);this.modules.push(s),this.downloadedModules.add(e);try{const t=await this.parseThemeToml(s);for(const e of t){if(this.downloadedModules.has(e)){Xt.info(`Module ${e} already downloaded, skipping`);continue}Xt.info(`Recursively downloading module dependency: ${e}`);const t=e,{cleanUrl:r,version:i}=this.parseVersionFromImportPath(t);let a=t;"latest"===i&&(a=await this.resolveLatestVersion(t)),await this.addModule(s,a,t=>{n?.({percentage:.5*t.percentage})})}}catch(t){const n=t instanceof Error?t.message:String(t);Xt.warn(`Failed to process recursive imports for module ${e}: ${n}`)}}catch(t){const n=t instanceof Error?t.message:String(t);throw new kt(`Failed to add module ${e}: ${n}`,"ADD_MODULE_FAILED")}}async createModuleFromCache(t,e){const n=zt(this.info.osFs(),e.dir,t.path);return n.setMetadata(e),await n.applyMounts(t),n}getModuleDir(t){const e=t.replace(/[/\\:*?"<>|]/g,"_").replace(/^_+|_+$/g,"");return Kt.join(this.info.moduleDir(),e)}getDownloadUrl(t){return t}isCacheValidForVersion(t,e){return!e||t===e}addTimestampToUrl(t){try{const e=new URL(t),n=Date.now().toString();return e.searchParams.set("_t",n),e.toString()}catch(e){const n=t.includes("?")?"&":"?";return`${t}${n}_t=${Date.now()}`}}getModuleByPath(t){return this.modules.find(e=>e.path()===t)||null}isModuleDownloaded(t){return this.downloadedModules.has(t)}async getModuleStatus(t){const e=await this.moduleCache.get(t);return e?.downloadStatus||"pending"}async removeModule(t){try{const e=this.modules.findIndex(e=>e.path()===t);if(e>=0){const n=this.modules[e];try{await this.info.osFs().removeAll(n.dir())}catch(t){}this.modules.splice(e,1),this.downloadedModules.delete(t),await this.moduleCache.delete(t)}}catch(e){const n=e instanceof Error?e.message:String(e);throw new kt(`Failed to remove module ${t}: ${n}`,"REMOVE_MODULE_FAILED")}}async clearAll(){try{for(const t of this.modules)try{await this.info.osFs().removeAll(t.dir())}catch(t){}this.modules=[],this.downloadedModules.clear(),await this.moduleCache.clear()}catch(t){const e=t instanceof Error?t.message:String(t);throw new kt(`Failed to clear modules: ${e}`,"CLEAR_MODULES_FAILED")}}getSourceLang(t){return this.lang.getSourceLang(t)}async parseThemeToml(t){try{const e=Kt.join(t.dir(),"theme.toml");try{if((await this.info.osFs().stat(e)).isDir())return[]}catch(t){return[]}let n;try{const t=await this.info.osFs().open(e);try{const e=[],r=new Uint8Array(4096);for(;;){const n=await t.read(r);if(0===n.bytesRead)break;e.push(r.slice(0,n.bytesRead))}const i=e.reduce((t,e)=>t+e.length,0),s=new Uint8Array(i);let a=0;for(const t of e)s.set(t,a),a+=t.length;n=new TextDecoder("utf-8").decode(s)}finally{await t.close()}}catch(e){const n=e instanceof Error?e.message:String(e);return Xt.warn(`Failed to read theme.toml for module ${t.path()}: ${n}`),[]}const r=(0,Yt.parse)(n);return r.module?.imports?(Xt.info(`Found ${r.module.imports.length} module imports in ${t.path()}/theme.toml`),r.module.imports.map(t=>t.path)):[]}catch(e){const n=e instanceof Error?e.message:String(e);return Xt.warn(`Failed to parse theme.toml for module ${t.path()}: ${n}`),[]}}};function Jt(t,e,n,r){return new Zt(t,e,n,r)}j();var Qt=N("module",{component:"factory"}),te=class extends Error{constructor(t,e){super(t),this.code=e,this.name="FsError"}},ee=new te("File is closed","FILE_CLOSED"),ne=(new te("out of range","OUT_OF_RANGE"),new te("too large","TOO_LARGE"),new te("file not found","FILE_NOT_FOUND")),re=(new te("file exists","FILE_EXISTS"),new te("destination exists","DESTINATION_EXISTS"),new Error("skip directory")),ie=(new te("walkway already walked","ALREADY_WALKED"),class extends te{constructor(t,e){super(t,e),this.name="OverlayFsError"}}),se=new ie("no filesystems to write to","NO_FILESYSTEMS"),ae=(new ie("operation not supported","OPERATION_NOT_SUPPORTED"),class{source;origin;publishDir;constructor(t,e,n){this.source=t,this.origin=e,this.publishDir=n}getSource(){return this.source}getOrigin(){return this.origin}publish(){return this.publishDir}});j(),N("fs",{component:"filemeta"});var oe=class{filename;componentRoot;componentDir;openFunc;constructor(t="",e=null){this.filename=t,this.componentRoot="",this.componentDir="",this.openFunc=e}fileName(){return this.filename}relativeFilename(){if(""===this.componentRoot)return this.filename;const t=this.filename.indexOf(this.componentRoot);if(-1===t)throw new Error(`filename ${this.filename} has no root ${this.componentRoot}`);let e=this.filename.substring(t+this.componentRoot.length);return e.startsWith("/")||(e="/"+e),e}component(){return this.componentDir}root(){return this.componentRoot}async open(){if(null===this.openFunc)throw new Error("OpenFunc not set");return await this.openFunc()}setFileName(t){this.filename=t}setComponentRoot(t){this.componentRoot=t}setComponentDir(t){this.componentDir=t}setOpenFunc(t){this.openFunc=t}merge(t){t&&(t.filename&&!this.filename&&(this.filename=t.filename),t.componentRoot&&!this.componentRoot&&(this.componentRoot=t.componentRoot),t.componentDir&&!this.componentDir&&(this.componentDir=t.componentDir),t.openFunc&&!this.openFunc&&(this.openFunc=t.openFunc))}};function le(t,e){return new oe(t,e)}var ce=class{fileInfo;i;constructor(t,e){this.fileInfo=t,this.i=e}meta(){return this.i}type(){return this.fileInfo.mode()}info(){return this.fileInfo}setMeta(t){this.i=t}name(){return this.fileInfo.name()}size(){return this.fileInfo.size()}mode(){return this.fileInfo.mode()}modTime(){return this.fileInfo.modTime()}isDir(){return this.fileInfo.isDir()}sys(){return this.fileInfo.sys()}fileName(){return this.i.fileName()}relativeFilename(){return this.i.relativeFilename()}component(){return this.i.component()}root(){return this.i.root()}async open(){return await this.i.open()}};function he(t,e){const n=le(e),r=new ce(t,n);return fe(t)&&r.meta().merge(t.meta()),r}function ue(t,e){const n=new ce(t,e);return fe(t)&&n.meta().merge(t.meta()),n}function fe(t){return t&&"function"==typeof t.meta}var de=m(require("path")),pe=class{file;fileMeta;fs;o;constructor(t,e,n,r=!1){this.file=t,this.fileMeta=e,this.fs=n,this.o=r}isNop(){return null===this.file}async close(){if(null!==this.file)return await this.file.close()}async readDir(t){const e=[];if(this.o&&this.file){const n=await this.file.readdir(t);for(const t of n){const n=this.joinPath(this.fileMeta.fileName(),t.name()),r=le(n,async()=>await this.fs.open(n));r.merge(this.fileMeta);const i=he(t,n);i.setMeta(r),e.push(i)}}return e}meta(){return this.fileMeta}joinPath(t,e){return t.endsWith("/")?t+e:t+"/"+e}async read(t){if(null===this.file)throw new Error("File is null");return await this.file.read(t)}async readAt(t,e){if(null===this.file)throw new Error("File is null");return await this.file.readAt(t,e)}async seek(t,e){if(null===this.file)throw new Error("File is null");return await this.file.seek(t,e)}async write(t){if(null===this.file)throw new Error("File is null");return await this.file.write(t)}async writeAt(t,e){if(null===this.file)throw new Error("File is null");return await this.file.writeAt(t,e)}name(){return de.basename(this.fileMeta.fileName())}async readdir(t){if(null===this.file)throw new Error("File is null");return await this.readDir(t)}async readdirnames(t){if(null===this.file)throw new Error("File is null");return await this.file.readdirnames(t)}async stat(){if(null===this.file)throw new Error("File is null");return await this.file.stat()}async sync(){if(null!==this.file)return await this.file.sync()}async truncate(t){if(null===this.file)throw new Error("File is null");return await this.file.truncate(t)}async writeString(t){if(null===this.file)throw new Error("File is null");return await this.file.writeString(t)}},ge=class extends pe{virtualOpener;filter;constructor(t,e=null,n=null){super(t.isNop()?null:t,t.meta(),t.fs,!0),this.virtualOpener=e,this.filter=n}async readDir(t){if(!this.isNop()){let e=await super.readDir(t);return null!==this.filter&&(e=await this.filter(e)),e}return await this.readVirtualDir()}async readVirtualDir(){if(null!==this.virtualOpener)return await this.virtualOpener();throw new Error("virtual dir opener not found")}setFilter(t){this.filter=t}setVirtualOpener(t){this.virtualOpener=t}getFilter(){return this.filter}getVirtualOpener(){return this.virtualOpener}},me=m(require("path"));j(),N("fs",{component:"basefs"});var we=class{fs;roots;constructor(t,e){this.fs=t,this.roots=e}toAbsolutePath(t){if(0===this.roots.length)return t;const e=this.roots[0];return""===t?e:me.isAbsolute(t)?t.startsWith(e)?t:me.join(e,t.substring(1)):me.join(e,t)}isSameRootedPath(t){const e=this.roots[0];return t.startsWith(me.join(e,me.sep))||t===e}async stat(t){const e=this.toAbsolutePath(t);if(!this.isSameRootedPath(e))throw new Error(`path ${t} is outside of the BaseFs root`);try{const n=await this.fs.stat(e);if(n.isDir()){const r=he(n,e);return r.meta().setOpenFunc(async()=>await this.openDir(t)),r}const r=he(n,e),i=this.getRoot(e);return r.meta().setComponentRoot(i),r.meta().setOpenFunc(async()=>await this.openInternal(t)),r}catch(t){throw t}}async open(t){const e=this.toAbsolutePath(t);return(await this.fs.stat(e)).isDir()?await this.openDir(t):await this.openInternal(t)}async openInternal(t,e=!1){const n=this.toAbsolutePath(t),r=await this.fs.open(n),i=this.getRoot(n),s=le(n);return s.setComponentRoot(i),e?function(t,e,n){return new pe(t,e,n,!0)}(r,s,this.fs):function(t,e,n){return new pe(t,e,n)}(r,s,this.fs)}getRoot(t){for(const e of this.roots)if(t.startsWith(e))return e;return""}async openDir(t){const e=await this.openInternal(t,!0),n=this.toAbsolutePath(t),r=this.getRoot(n),i=le(n);return i.setComponentRoot(r),function(t,e,n){const r=new pe(t,e,n,!0);return new ge(r)}(e,i,this.fs)}async create(t){const e=this.toAbsolutePath(t);return await this.fs.create(e)}async mkdir(t,e){const n=this.toAbsolutePath(t);return await this.fs.mkdir(n,e)}async mkdirAll(t,e){const n=this.toAbsolutePath(t);return await this.fs.mkdirAll(n,e)}async openFile(t,e,n){const r=this.toAbsolutePath(t);return await this.fs.openFile(r,e,n)}async remove(t){const e=this.toAbsolutePath(t);return await this.fs.remove(e)}async removeAll(t){const e=this.toAbsolutePath(t);return await this.fs.removeAll(e)}async rename(t,e){const n=this.toAbsolutePath(t),r=this.toAbsolutePath(e);return await this.fs.rename(n,r)}name(){return`BaseFs(${this.fs.name()})`}async chmod(t,e){const n=this.toAbsolutePath(t);return await this.fs.chmod(n,e)}async chown(t,e,n){const r=this.toAbsolutePath(t);return await this.fs.chown(r,e,n)}async chtimes(t,e,n){const r=this.toAbsolutePath(t);return await this.fs.chtimes(r,e,n)}};function ye(t,e){return new we(t,e)}var be=m(require("path"));j();var ve=N("fs",{component:"walkway"}),Ee=class{fs;root;cb;cfg;walked=!1;constructor(t,e){if(!t)throw new Error("fs must be set");if(!e.walkFn)throw new Error("walkFn must be set");this.fs=t,this.cb=e,this.root="",this.cfg={}}async walkWith(t,e){return this.cfg=e,this.root=t,await this.walk()}async walk(){if(this.walked)throw new Error("this walkway is already walked");return this.walked=!0,await this.walkRecursive(this.root,this.cfg.info,this.cfg.dirEntries)}checkErr(t,e){return!(!this.isNotExistError(e)||this.cfg.failOnNotExist||(ve.warn(`File "${t}" not found, skipping.`),0))}isNotExistError(t){return t.message.includes("ENOENT")||t.message.includes("no such file")||"ENOENT"===t.code}async walkRecursive(t,e,n){if(!e)try{const n=await this.fs.stat(t),r=le(t);r.setOpenFunc(async()=>await this.fs.open(t)),e=ue(n,r)}catch(e){if(t===this.root&&this.isNotExistError(e)){if(this.cfg.failOnNotExist)throw new te(`walk: root not found: ${e.message}`,"WALK_ROOT_NOT_FOUND");return}if(this.checkErr(t,e))return;throw new te(`walk: stat: ${e.message}`,"WALK_STAT_FAILED")}try{const n=await this.cb.walkFn(t,e);if(n instanceof Error)throw n}catch(t){if(e.isDir()&&t===re)return;throw t}if(e.isDir()){if(!n)try{const e=await this.fs.open(t),r=await e.readdir(-1);await e.close(),n=r.map(t=>t),this.cfg.sortDirEntries&&n.sort((t,e)=>t.name().localeCompare(e.name()))}catch(e){if(this.checkErr(t,e))return;throw new te(`walk: readdir: ${e.message}`,"WALK_READDIR_FAILED")}if(this.cfg.ignoreFile&&(n=n.filter(t=>!this.cfg.ignoreFile(t.fileName()))),this.cb.hookPre)try{n=await this.cb.hookPre(e,t,n)}catch(t){if(t===re)return;throw t}for(const e of n){const n=be.join(t,e.name());try{await this.walkRecursive(n,e)}catch(t){if(!e.isDir()||t!==re)throw t}}if(this.cb.hookPost)try{await this.cb.hookPost(e,t,n)}catch(t){if(t===re)return;throw t}}}};j();var ke=N("fs",{component:"static-copier"}),Se=class{fromFss;toFs;constructor(t,e){this.fromFss=t,this.toFs=e}async copy(){this.fromFss&&0!==this.fromFss.length?this.toFs?await this.doWithPublishDirs(this.toFs,async t=>{for(const e of this.fromFss)await this.copyStaticTo(e,t)}):ke.error("No publish filesystem found"):ke.error("No static filesystems found")}async doWithPublishDirs(t,e){try{await e("/")}catch(t){throw ke.error("Error in doWithPublishDirs:",t),t}}async copyStaticTo(t,e){try{return await this.walkSourceFiles(t,e)}catch(t){throw ke.error(`Error copying static files to ${e}:`,t),t}}async walkSourceFiles(t,e){let n=0;try{await this.walkFileSystem(t,"/",async(r,i)=>{i||(await this.copyFile(t,r,this.toFs,e),n++)})}catch(t){throw ke.error("Error walking source files:",t),t}return n}async walkFileSystem(t,e,n){try{const r=await t.open(e);if(!(await r.stat()).isDir())return await r.close(),void await n(e,!1);const i=await r.readdir(-1);await r.close();for(const r of i){const i=this.joinPath(e,r.name());r.isDir()?(await n(i,!0),await this.walkFileSystem(t,i,n)):await n(i,!1)}}catch(t){ke.error(`Could not read directory ${e}:`,t)}}async copyFile(t,e,n,r){let i=null,s=null;try{const a=e.startsWith("/")?e.slice(1):e,o=this.joinPath(r,a),l=this.dirname(o);"/"!==l&&await n.mkdirAll(l,493),i=await t.open(e);const c=await i.stat(),h=new Uint8Array(c.size());await i.read(h),s=await n.create(o),await s.write(h)}catch(t){ke.warn(`Failed to copy static file ${e}:`,t)}finally{if(s)try{await s.close()}catch(t){ke.warn(`Failed to close target file: ${t}`)}if(i)try{await i.close()}catch(t){ke.warn(`Failed to close source file: ${t}`)}}}joinPath(...t){return t.map(t=>t.replace(/^\/+|\/+$/g,"")).filter(t=>t.length>0).join("/").replace(/^/,"/")}dirname(t){const e=t.split("/").filter(t=>t.length>0);return e.length<=1?"/":"/"+e.slice(0,-1).join("/")}};j();var Te=N("fs",{component:"incremental-file-collector"});async function xe(t,e){try{const n=await e.stat(t),r=le(t);return r.setOpenFunc(async()=>await e.open(t)),ue(n,r)}catch(e){throw new Error(`Failed to stat file ${t}: ${e.message}`)}}var Ae=class{originFs;prompts;workflows;content;layouts;statics;assets;i18n;work;service;constructor(t,e,n,r,i,s,a,o,l){this.originFs=t,this.prompts=e,this.workflows=n,this.content=r,this.layouts=i,this.statics=s,this.assets=a,this.i18n=o,this.work=l,this.service=new $e}os(){return this.originFs.getOrigin()}workFs(){return this.work}workflowFs(){return this.workflows}promptFs(){return this.prompts}contentFs(){return this.content}layoutsFs(){return this.layouts}staticFs(){return this.statics}assetsFs(){return this.assets}publishFs(){return this.originFs.publish()}copyStatic(t,e){return new Se(t,e).copy()}newFileMetaInfo(t){return this.service.newFileMetaInfo(t)}newFileMetaInfoWithContent(t){return this.service.newFileMetaInfoWithContent(t)}async getFileMetaInfos(t){return async function(t,e){const n=new Map;let r=!1;for(const i of t)for(const t of e)try{const e=await xe(i,t);if(n.set(i,e),r=!0,r)break}catch(e){Te.error(`Failed to create FileMetaInfo for ${i} with fs=${t}:`,e)}return n}(t,this.content)}newBasePathFs(t,e){return ye(t,[e])}async walkPrompts(t,e,n){return await this.walk(this.prompts,t,e,n)}async walkWorkflows(t,e,n){return await this.walk(this.workflows,t,e,n)}async walkLayouts(t,e,n){return await this.walk(this.layouts,t,e,n)}async walkContent(t,e,n,r){await this.walk(t,e,n,r)}async walkStatics(t,e,n){return await this.walk(this.statics,t,e,n)}async walkI18n(t,e,n){return await this.walk(this.i18n,t,e,n)}async walk(t,e,n,r){const i=function(t,e){return new Ee(t,e)}(t,n);return""===e&&(e="/"),await i.walkWith(e,r)}},Ce=(t,e)=>{const n=[...t];for(const r of e){let e=!1;for(const n of t)if(r.name()===n.name()){e=!0;break}e||n.push(r)}return n},De=class t{fss;firstWritable;dirsMerger;constructor(t){this.fss=[...t.fss],this.firstWritable=t.firstWritable??!1,this.dirsMerger=t.dirsMerger??Ce}withFilesystems(...e){return new t({fss:[...this.fss,...e],firstWritable:this.firstWritable,dirsMerger:this.dirsMerger})}withFirstWritable(e){return new t({fss:this.fss,firstWritable:e,dirsMerger:this.dirsMerger})}withDirsMerger(e){return new t({fss:this.fss,firstWritable:this.firstWritable,dirsMerger:e})}getWritableFs(){return this.firstWritable&&0!==this.fss.length?this.fss[0]:null}isValid(){return void 0!==this.dirsMerger}getFilesystemCount(){return this.fss.length}getFilesystem(t){return t<0||t>=this.fss.length?null:this.fss[t]}hasFilesystem(t){return this.fss.includes(t)}getFilesystems(){return this.fss}};function Pe(t,e=!1,n){const r={fss:t,firstWritable:e};return void 0!==n&&(r.dirsMerger=n),new De(r)}function Le(t){return Pe(t,!1,Ce)}var Re=class{u;fss;dirOpeners;info;merge;err;offset;fis;closed;constructor(t={}){this.u=t.name||"",this.fss=t.fss?[...t.fss]:[],this.dirOpeners=t.dirOpeners?[...t.dirOpeners]:[],void 0!==t.info&&(this.info=t.info),this.merge=t.merge||Ce,this.offset=0,this.fis=[],this.closed=!1}name(){return this.u}isClosed(){return this.closed||0===this.fss.length&&0===this.dirOpeners.length}async readdir(t){if(this.isClosed())throw ee;if(this.err)throw this.err;0===this.offset&&await this.loadDirectoryEntries();const e=this.fis.slice(this.offset);if(t<=0){if(this.err=new Error("EOF"),this.offset>0&&0===e.length)throw this.err;return[...e]}if(0===e.length)throw this.err=new Error("EOF"),this.err;const n=e.slice(0,t);return this.offset+=n.length,n}async readdirnames(t){if(this.isClosed())throw ee;return(await this.readdir(t)).map(t=>t.name())}async loadDirectoryEntries(){for(let t=0;t<this.fss.length;t++){const e=this.fss[t];await this.readFromFilesystem(e,null)}for(let t=0;t<this.dirOpeners.length;t++){const e=await this.dirOpeners[t]();await this.readFromFilesystem(null,e)}}async readFromFilesystem(t,e){let n=e;try{if(!n&&t){const e="/"===this.u?"":this.u;n=await t.open(e)}if(!n)return;const e=await n.readdir(-1);this.fis=this.merge(this.fis,e)}catch(t){}finally{n&&!e&&await n.close()}}async stat(){if(this.isClosed())throw ee;if(this.info)return await this.info();if(this.fss.length>0)return await this.fss[0].stat(this.u);throw new ie("no filesystem available for stat","NO_FILESYSTEM")}async close(){this.closed=!0,this.fss=[],this.dirOpeners=[],this.fis=[],delete this.info,this.offset=0,delete this.err}notSupported(t){throw new ie(`operation ${t} not supported on directory "${this.u}"`,"OPERATION_NOT_SUPPORTED")}async read(t){this.notSupported("read")}async readAt(t,e){this.notSupported("readAt")}async seek(t,e){this.notSupported("seek")}async write(t){this.notSupported("write")}async writeAt(t,e){this.notSupported("writeAt")}async sync(){this.notSupported("sync")}async truncate(t){this.notSupported("truncate")}async writeString(t){this.notSupported("writeString")}},Ne=new class{pool=[];get(){return this.pool.length>0?this.pool.pop():new Re}release(t){t.fss=[],t.dirOpeners=[],t.fis=[],delete t.info,t.offset=0,t.u="",delete t.err,t.closed=!1,this.pool.push(t)}};j(),N("fs",{component:"overlayfs"});var _e=class t{fss;mergeDirs;firstWritable;constructor(t){this.fss=[...t.fss],this.mergeDirs=t.dirsMerger,this.firstWritable=t.firstWritable}name(){return"overlayfs"}filesystem(t){return t<0||t>=this.fss.length?null:this.fss[t]}numFilesystems(){return this.fss.length}append(...e){const n=new De({fss:[...this.fss,...e],firstWritable:this.firstWritable,dirsMerger:this.mergeDirs});return new t(n)}withDirsMerger(e){const n=new De({fss:this.fss,firstWritable:this.firstWritable,dirsMerger:e});return new t(n)}writeFs(){if(0===this.fss.length)throw se;return this.fss[0]}async collectDirs(t,e){for(const n of this.fss)await this.collectDirsRecursive(n,t,e)}async collectDirsRecursive(t,e,n){try{(await t.stat(e)).isDir()&&n(t)}catch(t){}const r=t;if(r.filesystem&&r.numFilesystems)for(let t=0;t<r.numFilesystems();t++){const i=r.filesystem(t);i&&await this.collectDirsRecursive(i,e,n)}}async statInternal(t,e){for(let n=0;n<this.fss.length;n++){const r=this.fss[n],[i,s,a,o]=await this.statRecursive(r,t,e);if(null===o||!this.isNotExistError(o))return[i,s,a,o]}return[null,null,!1,ne]}async statRecursive(t,e,n){try{const n=await t.stat(e);return[t,n,!1,null]}catch(e){if(!this.isNotExistError(e))return[t,null,!1,e]}const r=t;if(r.filesystem&&r.numFilesystems)for(let t=0;t<r.numFilesystems();t++){const i=r.filesystem(t);if(i){const[t,r,s,a]=await this.statRecursive(i,e,n);if(null===a||!this.isNotExistError(a))return[t,r,s,a]}}return[null,null,!1,ne]}isNotExistError(t){return t.message.includes("ENOENT")||t.message.includes("no such file")||t===ne}async create(t){if(!this.firstWritable)throw new ie("filesystem is read-only","READ_ONLY");return await this.writeFs().create(t)}async mkdir(t,e){if(!this.firstWritable)throw new ie("filesystem is read-only","READ_ONLY");return await this.writeFs().mkdir(t,e)}async mkdirAll(t,e){if(!this.firstWritable)throw new ie("filesystem is read-only","READ_ONLY");return await this.writeFs().mkdirAll(t,e)}async open(t){if(0===this.fss.length)throw ne;const[e,n,,r]=await this.statInternal(t,!1);if(r)throw r;if(n.isDir()){const e=[];if(await this.collectDirs(t,t=>{e.push(t)}),0===e.length)throw ne;return 1===e.length?await e[0].open(t):await async function(t,e,n,r){if(!n)throw new ie("info function must not be null","INFO_REQUIRED");const i=Ne.get(),s={name:t,fss:[...r],info:n,merge:e||Ce};return Object.assign(i,new Re(s)),i}(t,this.mergeDirs,async()=>n,e)}return await e.open(t)}async openFile(t,e,n){const r=!!(1&e)||!!(2&e);if(r&&!this.firstWritable)throw new ie("filesystem is read-only","READ_ONLY");return r?await this.writeFs().openFile(t,e,n):await this.open(t)}async remove(t){if(!this.firstWritable)throw new ie("filesystem is read-only","READ_ONLY");return await this.writeFs().remove(t)}async removeAll(t){if(!this.firstWritable)throw new ie("filesystem is read-only","READ_ONLY");return await this.writeFs().removeAll(t)}async rename(t,e){if(!this.firstWritable)throw new ie("filesystem is read-only","READ_ONLY");return await this.writeFs().rename(t,e)}async stat(t){const e="/"===t?"":t,[,n,,r]=await this.statInternal(e,!1);if(r)throw r;return n}async chmod(t,e){if(!this.firstWritable)throw new ie("filesystem is read-only","READ_ONLY");return await this.writeFs().chmod(t,e)}async chown(t,e,n){if(!this.firstWritable)throw new ie("filesystem is read-only","READ_ONLY");return await this.writeFs().chown(t,e,n)}async chtimes(t,e,n){if(!this.firstWritable)throw new ie("filesystem is read-only","READ_ONLY");return await this.writeFs().chtimes(t,e,n)}};function Oe(t){return new _e(t)}var Ie=class{u;T;C;constructor(t,e="This is a virtual file."){this.u=t,this.T=e,this.C=new Date}name(){return this.u}size(){return Buffer.byteLength(this.T,"utf8")}mode(){return 420}modTime(){return this.C}isDir(){return!1}sys(){return null}getContent(){return this.T}},Me=class{D;L;R=null;constructor(t,e){this.D=t,this.L=e}fullName(){return this.D}async open(){return{name:()=>this.D,close:async()=>{},read:async t=>{const e=Buffer.from(this.L,"utf8"),n=Math.min(t.length,e.length);return e.copy(t,0,0,n),{bytesRead:n,buffer:t}},readAt:async(t,e)=>{const n=Buffer.from(this.L,"utf8"),r=Math.min(e,n.length),i=Math.min(t.length,n.length-r);return i>0&&n.copy(t,0,r,r+i),{bytesRead:i,buffer:t}},seek:async(t,e)=>t,write:async t=>({bytesWritten:t.length,buffer:t}),writeAt:async(t,e)=>({bytesWritten:t.length,buffer:t}),readdir:async t=>[],readdirnames:async t=>[],stat:async()=>this.getFileInfo(),sync:async()=>{},truncate:async t=>{},writeString:async t=>({bytesWritten:Buffer.byteLength(t,"utf8")})}}getFileInfo(){return this.R||(this.R=new Ie(this.D,this.L)),this.R}},Fe=null,$e=class{newFileMetaInfo(t){return function(t){const e=(Fe||(Fe=new Me("/content/file.txt","This is a virtual file.")),Fe.getFileInfo()),n=le(t);return new ce(e,n)}(t)}newFileMetaInfoWithContent(t){return function(t){const e=function(t){const e=Math.floor(1e6*Math.random()).toString().padStart(6,"0");return new Me(`/content/file_${e}.md`,t)}(t),n=e.getFileInfo(),r=le(e.fullName(),()=>e.open());return r.setComponentRoot("content"),r.setComponentDir("content"),new ce(n,r)}(t)}},Ue=class{create(t){return Oe(Le(t))}createWithOptions(t){return function(t){const e=new De(t);return new _e(e)}(t)}createReadOnly(t){return Oe(Le(t))}createWritable(t){const e=function(t){return Pe(t,!0,void 0)}(t);return Oe(e)}createWithMerger(t,e){return Oe(Le(t).withDirsMerger(e))}};function Be(t){return(new Ue).createReadOnly(t)}var qe=m(require("path"));j(),N("fs",{component:"filesystemscollector"});var je=class{from;to;toBase;constructor(t,e,n=""){this.from=t,this.to=e,this.toBase=n}fs(t){return ye(t,[this.to])}},He=class{sourceProject;overlayMountsPrompt;overlayMountsWorkflow;overlayMountsContent;overlayMountsLayouts;overlayMountsStatics;overlayMountsAssets;overlayMountsI18n;constructor(t){this.sourceProject=t,this.overlayMountsPrompt=Be([]),this.overlayMountsWorkflow=Be([]),this.overlayMountsContent=[],this.overlayMountsLayouts=Be([]),this.overlayMountsStatics=Be([]),this.overlayMountsAssets=Be([]),this.overlayMountsI18n=Be([])}async collect(t){const e=t.all();for(const t of e){const e=[],n=[],r=[],i=[],s=[],a=[],o=[],l=e=>qe.isAbsolute(e)?["",e]:[t.dir(),this.absPathify(t.dir(),e)],c=t.mounts();for(const t of c){const[c,h]=l(t.source()),u=new je(t.target(),h,c).fs(this.sourceProject);this.isPrompts(t.target())?n.push(u):this.isWorkflows(t.target())?e.push(u):this.isContent(t.target())?r.push(u):this.isLayouts(t.target())?i.push(u):this.isStatics(t.target())?s.push(u):this.isAssets(t.target())?a.push(u):this.isI18n(t.target())&&o.push(u)}if(e.length>0&&(this.overlayMountsWorkflow=this.overlayMountsWorkflow.append(...e)),n.length>0&&(this.overlayMountsPrompt=this.overlayMountsPrompt.append(...n)),t.isProjectModule())for(const t of r){let e=Be([]);e=e.append(t),this.overlayMountsContent.push(e)}i.length>0&&(this.overlayMountsLayouts=this.overlayMountsLayouts.append(...i)),s.length>0&&(this.overlayMountsStatics=this.overlayMountsStatics.append(...s)),a.length>0&&(this.overlayMountsAssets=this.overlayMountsAssets.append(...a)),o.length>0&&(this.overlayMountsI18n=this.overlayMountsI18n.append(...o))}}isPrompts(t){return"prompts"===t||t.startsWith("prompts/")||t.startsWith("/prompts/")}isWorkflows(t){return"workflows"===t||t.startsWith("workflows/")||t.startsWith("/workflows/")}isContent(t){return"content"===t||t.startsWith("content/")||t.startsWith("/content/")}isLayouts(t){return"layouts"===t||t.startsWith("layouts/")||t.startsWith("/layouts/")}isStatics(t){return"static"===t||t.startsWith("static/")||t.startsWith("/static/")}isAssets(t){return"assets"===t||t.startsWith("assets/")||t.startsWith("/assets/")}isI18n(t){return"i18n"===t||t.startsWith("i18n/")||t.startsWith("/i18n/")}absPathify(t,e){return qe.resolve(t,e)}},ze=m(require("fs/promises")),We=m(require("path"));j();var Ge=N("fs",{component:"osfs"}),Ve=class{constructor(t,e){this.stats=t,this.u=e}name(){return this.u}size(){return this.stats.size}mode(){return this.stats.mode}modTime(){return this.stats.mtime}isDir(){return this.stats.isDirectory()}sys(){return this.stats}},Ye=class{constructor(t,e="r"){this.filePath=t,this.flags=e}handle=null;closed=!1;position=0;async ensureOpen(){this.handle||this.closed||(this.handle=await ze.open(this.filePath,this.flags))}async close(){if(this.handle){try{await this.handle.close()}catch(t){throw Ge.error(`❌ Error closing file handle for ${this.filePath}:`,t),t}this.handle=null}this.closed=!0}async read(t){if(this.closed)throw new Error("File is closed");if(await this.ensureOpen(),!this.handle)throw new Error("Failed to open file");const e=await this.handle.read(t,0,t.length,this.position);return this.position+=e.bytesRead,{bytesRead:e.bytesRead,buffer:t}}async readAt(t,e){if(this.closed)throw new Error("File is closed");if(await this.ensureOpen(),!this.handle)throw new Error("Failed to open file");return{bytesRead:(await this.handle.read(t,0,t.length,e)).bytesRead,buffer:t}}async seek(t,e){if(this.closed)throw new Error("File is closed");switch(e){case 0:default:this.position=t;break;case 1:this.position+=t;break;case 2:if(await this.ensureOpen(),this.handle){const e=await this.handle.stat();this.position=e.size+t}}return this.position}async write(t){if(this.closed)throw new Error("File is closed");if(await this.ensureOpen(),!this.handle)throw new Error("Failed to open file");const e=await this.handle.write(t,0,t.length,this.position);return this.position+=e.bytesWritten,{bytesWritten:e.bytesWritten,buffer:t}}async writeAt(t,e){if(this.closed)throw new Error("File is closed");if(await this.ensureOpen(),!this.handle)throw new Error("Failed to open file");return{bytesWritten:(await this.handle.write(t,0,t.length,e)).bytesWritten,buffer:t}}name(){return this.filePath}async readdir(t){if(this.closed)throw new Error("File is closed");const e=await ze.readdir(this.filePath,{withFileTypes:!0}),n=[],r=t>0?Math.min(t,e.length):e.length;for(let t=0;t<r;t++){const r=e[t],i=We.join(this.filePath,r.name),s=await ze.stat(i);n.push(new Ve(s,r.name))}return n}async readdirnames(t){if(this.closed)throw new Error("File is closed");const e=await ze.readdir(this.filePath);return t>0?e.slice(0,t):e}async stat(){if(this.closed)throw new Error("File is closed");const t=await ze.stat(this.filePath);return new Ve(t,We.basename(this.filePath))}async sync(){if(this.closed)throw new Error("File is closed");await this.ensureOpen(),this.handle&&await this.handle.sync()}async truncate(t){if(this.closed)throw new Error("File is closed");await this.ensureOpen(),this.handle&&(await this.handle.truncate(t),this.position>t&&(this.position=t))}async writeString(t){const e=Buffer.from(t,"utf8");return{bytesWritten:(await this.write(e)).bytesWritten}}},Ke=class{async create(t){return await ze.writeFile(t,""),new Ye(t,"w+")}async mkdir(t,e){await ze.mkdir(t,{mode:e})}async mkdirAll(t,e){await ze.mkdir(t,{mode:e,recursive:!0})}async open(t){return await ze.access(t),(await ze.stat(t)).isDirectory(),new Ye(t,"r")}async openFile(t,e,n){let r="r";return 1&e&&(r="w"),2&e&&(r="r+"),64&e&&(r="w"),512&e&&(r="w"),1024&e&&(r="a"),new Ye(t,r)}async remove(t){(await ze.stat(t)).isDirectory()?await ze.rmdir(t):await ze.unlink(t)}async removeAll(t){await ze.rm(t,{recursive:!0,force:!0})}async rename(t,e){await ze.rename(t,e)}async stat(t){const e=await ze.stat(t);return new Ve(e,We.basename(t))}name(){return"OsFs"}async chmod(t,e){await ze.chmod(t,e)}async chown(t,e,n){await ze.chown(t,e,n)}async chtimes(t,e,n){await ze.utimes(t,e,n)}};var Xe="page",Ze="home",Je="section",Qe="taxonomy",tn="term",en="sitemap",nn="404",rn=class{buffer;position;capacity;constructor(t=1024){this.capacity=t,this.buffer=new Uint8Array(this.capacity),this.position=0}async write(t){this.ensureCapacity(t.length),this.buffer.set(t,this.position),this.position+=t.length}async writeString(t){const e=(new TextEncoder).encode(t);await this.write(e)}async writeByte(t){this.ensureCapacity(1),this.buffer[this.position]=t,this.position++}bytes(){return this.buffer.slice(0,this.position)}length(){return this.position}truncate(t){if(t<0||t>this.position)throw new Error("Invalid truncate size");this.position=t}ensureCapacity(t){const e=this.position+t;if(e<=this.capacity)return;const n=Math.max(2*this.capacity,e),r=new Uint8Array(n);r.set(this.buffer),this.buffer=r,this.capacity=n}},sn=class{constructor(t=[]){this.fragments=t}toHTML(t,e,n){if(0===this.fragments.length)return"";const r=this.filterByLevel(this.fragments,t,e);if(0===r.length)return"";const i=n?"ol":"ul";return`<${i}>\n${this.renderFragments(r,n)}</${i}>\n`}filterByLevel(t,e,n){return t.filter(t=>t.level>=e&&t.level<=n).map(t=>{const r={id:t.id,text:t.text,level:t.level};return t.children&&(r.children=this.filterByLevel(t.children,e,n)),r})}renderFragments(t,e){const n=e?"ol":"ul";return t.map(t=>{let r=` <li><a href="#${t.id}">${this.escapeHTML(t.text)}</a>`;return t.children&&t.children.length>0&&(r+=`\n <${n}>\n${this.renderFragments(t.children,e)} </${n}>`),r+="</li>",r}).join("\n")}escapeHTML(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}addFragment(t){this.fragments.push(t)}getFragments(){return[...this.fragments]}},an=class{constructor(t,e,n=[],r=[],i=[]){this.u=t,this.N=e,this._=n,this.O=r,this.M=i}name(){return this.u}level(){return this.N}links(){return[...this._]}paragraphs(){return[...this.O]}listParagraphs(){return[...this.M]}addLink(t){this._.push(t)}addParagraph(t){this.O.push(t)}addListParagraph(t){this.M.push(t)}},on=class{fragments=[];stack=[];addHeading(t,e,n){for(;this.stack.length>0&&this.stack[this.stack.length-1].level>=e;)this.stack.pop();const r={id:n,text:t,level:e,children:[]};if(0===this.stack.length)this.fragments.push(r);else{const t=this.stack[this.stack.length-1];t.children||(t.children=[]),t.children.push(r)}this.stack.push(r)}build(){return new sn(this.fragments)}reset(){this.fragments=[],this.stack=[]}},ln=class{usedIds=new Set;generateID(t,e="github"){let n;switch(e){case"github":default:n=this.githubStyle(t);break;case"github-ascii":n=this.githubAsciiStyle(t);break;case"blackfriday":n=this.blackfridayStyle(t)}if(this.usedIds.has(n)){let t=1,e=`${n}-${t}`;for(;this.usedIds.has(e);)t++,e=`${n}-${t}`;n=e}return this.usedIds.add(n),n}githubStyle(t){return t.toLowerCase().replace(/[^\w\u4e00-\u9fff\s-]/g,"").replace(/\s+/g,"-").replace(/^-+|-+$/g,"")}githubAsciiStyle(t){return t.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").replace(/^-+|-+$/g,"")}blackfridayStyle(t){return t.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/^-+|-+$/g,"")}reset(){this.usedIds.clear()}},cn=class{constructor(t,e){this.wrappedContent=t,this.innerContent=e}wrapped(){return this.wrappedContent}inner(){return this.innerContent}},hn=class{constructor(t){this.config=t}async highlight(t,e,n){if(!e||"text"===e||"plain"===e)return this.escapeHTML(t);const r=this.escapeHTML(t),i=`language-${e}`;return this.config.lineNos?this.addLineNumbers(r,i):`<code class="${i}">${r}</code>`}async highlightCodeBlock(t,e){const n=t.type(),r=t.inner(),i=await this.highlight(r,n,e);return new cn(`<pre>${i}</pre>`,i)}async renderCodeblock(t,e,n){const r=await this.highlightCodeBlock(n);await e.writeString(r.wrapped())}isDefaultCodeBlockRenderer(){return!0}escapeHTML(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}addLineNumbers(t,e){const n=t.split("\n").map((t,n)=>{const r=n+this.config.lineNoStart;return this.config.lineNumbersInTable?`<tr><td class="line-number">${r}</td><td class="line-code"><code class="${e}">${t}</code></td></tr>`:`<span class="line-number">${r}</span><code class="${e}">${t}</code>`});return this.config.lineNumbersInTable?`<table class="code-table"><tbody>${n.join("")}</tbody></table>`:n.join("\n")}};j();var un=class{Type;Err;low;high;segments;firstByte;isString;content;bytes;constructor(){this.Type=0,this.Err=null,this.low=0,this.high=0,this.segments=[],this.firstByte=0,this.isString=!1,this.content="",this.bytes=[]}Pos(){return this.segments.length>0?this.segments[0].Low:this.low}Val(t){if(0===this.segments.length)return t.slice(this.low,this.high);if(1===this.segments.length)return t.slice(this.segments[0].Low,this.segments[0].High);const e=[];for(const n of this.segments)e.push(t.slice(n.Low,n.High));const n=e.reduce((t,e)=>t+e.length,0),r=new Uint8Array(n);let i=0;for(const t of e)r.set(t,i),i+=t.length;return r}ValStr(t){return(new TextDecoder).decode(this.Val(t))}ValTyped(t){const e=this.ValStr(t);if(this.isString)return e;if(fn.test(e))return"true"===e;if(dn.test(e)){const t=parseInt(e,10);return isNaN(t)?e:t}if(pn.test(e)){const t=parseFloat(e);return isNaN(t)?e:t}return e}IsText(){return 18===this.Type||17===this.Type}IsIndentation(){return 17===this.Type}IsNonWhitespace(t){return this.ValStr(t).trim().length>0}IsShortcodeName(){return 13===this.Type}IsInlineShortcodeName(){return 14===this.Type}IsLeftShortcodeDelim(){return 10===this.Type||8===this.Type}IsRightShortcodeDelim(){return 11===this.Type||9===this.Type}IsShortcodeClose(){return 12===this.Type}IsShortcodeParam(){return 15===this.Type}IsShortcodeParamVal(){return 16===this.Type}IsShortcodeMarkupDelimiter(){return 10===this.Type||11===this.Type}IsFrontMatter(){return this.Type>=3&&this.Type<=6}IsDone(){return 0===this.Type||1===this.Type}IsEOF(){return 1===this.Type}IsError(){return 0===this.Type}ToString(t){const e=this.Val(t),n=this.ValStr(t),r=function(t){const e=t;return e<0||e>=mn.length-1?`ItemType(${e})`:gn.slice(mn[e],mn[e+1])}(this.Type);switch(!0){case 1===this.Type:return"EOF";case 0===this.Type:return n;case 17===this.Type:return`${r}:[${i=n,i.replace(/ /g,"␣").replace(/\t/g,"→")}]`;case this.Type>19:return`<${n}>`;case e.length>50:return`${r}:${n.substring(0,20)}...`;default:return`${r}:[${n}]`}var i}},fn=/^(true|false)$/,dn=/^[-+]?\d+$/,pn=/^[-+]?\d*\.\d+$/,gn="tErrortEOFTypeLeadSummaryDividerTypeFrontMatterYAMLTypeFrontMatterTOMLTypeFrontMatterJSONTypeFrontMatterORGTypeIgnoretLeftDelimScNoMarkuptRightDelimScNoMarkuptLeftDelimScWithMarkuptRightDelimScWithMarkuptScClosetScNametScNameInlinetScParamtScParamValtIndentationtTexttKeywordMarker",mn=[0,6,10,32,51,70,89,107,117,137,158,180,203,211,218,231,239,250,262,267,281],wn=-1,yn=(new Uint8Array([239,187,191]),(new TextEncoder).encode("\x3c!--more--\x3e")),bn=(new TextEncoder).encode("# more"),vn=(new TextEncoder).encode("+++"),En=(new TextEncoder).encode("---"),kn=(new TextEncoder).encode("#+"),Sn=(new TextEncoder).encode("{{"),Tn=(new TextEncoder).encode("{{<"),xn=(new TextEncoder).encode(">}}"),An=(new TextEncoder).encode("{{%"),Cn=(new TextEncoder).encode("%}}"),Dn=(new TextEncoder).encode("/*"),Pn=(new TextEncoder).encode("*/"),Ln=(new TextEncoder).encode("inline "),Rn=class{l;skipAll;handlers;skipIndexes;constructor(t){this.l=t,this.skipAll=!1,this.handlers=[],this.skipIndexes=[]}skip(){if(this.skipAll)return-1;this.skipIndexes=[];let t=!1;for(const e of this.handlers){if(e.skipAll)continue;const n=e.skip();-1!==n&&(t=!0,this.skipIndexes.push(n))}return t?function(...t){let e=-1;for(const n of t)n<0||(-1===e||n<e)&&(e=n);return e}(...this.skipIndexes):(this.skipAll=!0,-1)}lex(t){if(this.skipAll)return null;this.l.pos>this.l.start&&this.l.emit(18);for(const e of this.handlers){if(e.skipAll)continue;const[n,r]=e.lexFunc(t,e.l);if(null===n||r)return n}return this.l.pos++,t}},Nn=class{l;skipAll;skipFunc;lexFunc;constructor(t,e,n){this.l=t,this.skipAll=!1,this.skipFunc=e,this.lexFunc=n}skip(){if(this.skipAll)return-1;const t=this.skipFunc(this.l);return-1===t&&(this.skipAll=!0),t}};function _n(t){return 32===t||9===t}function On(t){return Mn(t)||45===t}function In(t){return 13===t||10===t}function Mn(t){return 95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57}var Fn=class{items;lastPos;constructor(t){this.items=t,this.lastPos=-1}Next(){return this.lastPos++,this.Current()}Current(){if(this.lastPos>=this.items.length){const t=new un;return t.Type=0,t.Err=new Error("no more tokens"),t}return this.items[this.lastPos]}Backup(){if(this.lastPos<0)throw new Error("need to go forward before going back");this.lastPos--}Pos(){return this.lastPos}IsValueNext(){const t=this.Peek();return 0!==t.Type&&1!==t.Type}Peek(){return this.items[this.lastPos+1]}PeekWalk(t){for(let e=this.lastPos+1;e<this.items.length&&t(this.items[e]);e++);}Consume(t){for(let e=0;e<t;e++){const t=this.Next();if(0===t.Type||1===t.Type){this.Backup();break}}}LineNumber(t){const e=new Uint8Array([10]),n=t.slice(0,this.Current().low);let r=0;for(let t=0;t<n.length;t++)n[t]===e[0]&&r++;return r+1}},$n=class{input;stateStart;state;pos;start;width;sectionHandlers;cfg;summaryDivider;summaryDividerChecked;lexerShortcodeState;items;err;inFrontMatter;parenDepth;constructor(t,e,n){this.input=t,this.stateStart=e,this.state=null,this.pos=0,this.start=0,this.width=0,this.cfg=n,this.summaryDivider=null,this.summaryDividerChecked=!1,this.err=null,this.items=[],this.inFrontMatter=!1,this.parenDepth=0,this.lexerShortcodeState={currLeftDelimItem:8,currRightDelimItem:9,isInline:!1,currShortcodeName:"",closingState:0,elementStepNum:0,paramElements:0,paramState:0,openShortcodes:{}},this.lexSummaryDivider=this.lexSummaryDivider.bind(this),this.lexMainSection=this.lexMainSection.bind(this),this.lexIdentifierInShortcode=this.lexIdentifierInShortcode.bind(this),this.lexEndOfShortcode=this.lexEndOfShortcode.bind(this),this.lexShortcodeLeftDelim=this.lexShortcodeLeftDelim.bind(this),this.lexShortcodeRightDelim=this.lexShortcodeRightDelim.bind(this),this.lexShortcodeParam=this.lexShortcodeParam.bind(this),this.lexShortcodeValue=this.lexShortcodeValue.bind(this),this.lexShortcodeValueQuoted=this.lexShortcodeValueQuoted.bind(this),this.lexShortcodeValueUnquoted=this.lexShortcodeValueUnquoted.bind(this),this.lexInsideShortcode=this.lexInsideShortcode.bind(this),this.lexDone=this.lexDone.bind(this),this.sectionHandlers=function(t){const e=new Rn(t),n=new Nn(t,t=>t.index(Sn),(t,e)=>{if(!e.isShortCodeStart())return[t,!1];if(e.lexerShortcodeState.isInline){const t=e.input.slice(e.pos+3),n=function(t){for(let e=0;e<t.length;e++)if(!_n(t[e])){if(47===t[e])return e;break}return-1}(t);if(n!==e.input.length-1){const r=(new TextDecoder).decode(t.slice(n+1)).trim();if(-1===n||!r.startsWith(e.lexerShortcodeState.currShortcodeName+" "))return[e.errorf("inline shortcodes do not support nesting"),!0]}}return e.hasPrefix(An)?(e.lexerShortcodeState.currLeftDelimItem=10,e.lexerShortcodeState.currRightDelimItem=11):(e.lexerShortcodeState.currLeftDelimItem=8,e.lexerShortcodeState.currRightDelimItem=9),[e.lexShortcodeLeftDelim,!0]}),r=new Nn(t,t=>t.summaryDividerChecked||!t.summaryDivider?-1:t.index(t.summaryDivider),(t,e)=>e.summaryDivider&&e.hasPrefix(e.summaryDivider)?(e.summaryDividerChecked=!0,e.pos+=e.summaryDivider.length,e.consumeSpace(),e.emit(2),[t,!0]):[t,!1]);return e.handlers=[n,r],e.skipIndexes=new Array(e.handlers.length),e}(this)}Iterator(){return t=this.items,new Fn(t);var t}Input(){return this.input}run(){for(this.state=this.stateStart;null!==this.state;)this.state=this.state(this);return this}next(){if(this.pos>=this.input.length)return this.width=0,wn;const t=this.input[this.pos];return this.width=1,this.pos+=this.width,t}peek(){const t=this.next();return this.backup(),t}backup(){this.pos-=this.width}append(t){t.Pos()<this.input.length&&(7===t.Type&&239===this.input[t.Pos()]?t.firstByte=239:t.firstByte=this.input[t.Pos()]),this.items.push(t)}emit(t){const e=()=>{this.start=this.pos};if(18===t)for(let n=this.pos-1;n>=this.start;n--){const r=this.input[n];if(32!==r&&9!==r&&13!==r&&10!==r)break;if(n===this.start&&10!==r){const t=new un;return t.Type=17,t.low=this.start,t.high=this.pos,this.append(t),void e()}if(10===r&&n<this.pos-1){const r=new un;r.Type=t,r.low=this.start,r.high=n+1,this.append(r);const i=new un;return i.Type=17,i.low=n+1,i.high=this.pos,this.append(i),void e()}if(10===r&&n===this.pos-1)break}const n=new un;n.Type=t,n.low=this.start,n.high=this.pos,n.low<this.input.length&&(7===t&&239===this.input[n.low]?n.firstByte=239:n.firstByte=this.input[n.low]),this.append(n),e()}emitString(t){const e=new un;e.Type=t,e.low=this.start,e.high=this.pos,e.isString=!0,this.pos>this.start&&(e.firstByte=this.input[this.start]),this.items.push(e),this.start=this.pos}isEOF(){return this.pos>=this.input.length}ignoreEscapesAndEmit(t,e){let n=this.start,r=n;const i=[];for(;n<this.pos;){const t=1;92===this.input[n]&&(n>r&&i.push({Low:r,High:n}),r=n+t),n+=t}if(r<this.pos&&i.push({Low:r,High:this.pos}),i.length>0){const e=new un;e.Type=t,e.segments=i,i[0].High>i[0].Low&&(e.firstByte=this.input[i[0].Low]),this.items.push(e),this.start=this.pos}this.start=this.pos}current(){return this.input.slice(this.start,this.pos)}ignore(){this.start=this.pos}errorf(t,...e){const n=new Error(t.replace(/%[a-z]/g,()=>String(e.shift()))),r=new un;return r.Type=0,r.Err=n,r.low=this.start,r.high=this.pos,this.append(r),null}consumeCRLF(){let t=!1;const e=this.peek();return 13===e?(this.next(),10===this.peek()&&(this.next(),t=!0)):10===e&&(this.next(),t=!0),t}consumeToSpace(){for(;;){const t=this.next();if(t===wn||_n(t))return void this.backup()}}consumeSpace(){for(;;){const t=this.next();if(t===wn||!this.isUnicodeSpace(t))return void this.backup()}}isUnicodeSpace(t){return 32===t||9===t||10===t||12===t||13===t||133===t||160===t||8192===t||8193===t||8194===t||8195===t||8196===t||8197===t||8198===t||8199===t||8200===t||8201===t||8202===t||8232===t||8233===t||8239===t||8287===t||12288===t}index(t){const e=this.input.slice(this.pos),n=t.length,r=e.length;if(n>r)return-1;t:for(let i=0;i<=r-n;i++){for(let r=0;r<n;r++)if(e[i+r]!==t[r])continue t;return i}return-1}hasPrefix(t){if(this.pos+t.length>this.input.length)return!1;for(let e=0;e<t.length;e++)if(this.input[this.pos+e]!==t[e])return!1;return!0}isShortCodeStart(){return this.hasPrefix(An)||this.hasPrefix(Tn)}lexFrontMatterSection(t,e,n,r){for(let t=0;t<2;t++)if(this.next()!==e)return this.errorf(`invalid ${n} delimiter`);let i,s=this.consumeCRLF();for(this.ignore();;){if(!s&&(i=this.next(),i===wn))return this.errorf(`EOF looking for end ${n} front matter delimiter`);if((s||In(i))&&this.hasPrefix(r)){this.emit(t),this.pos+=3,this.consumeCRLF(),this.ignore();break}s=!1}return()=>this.lexMainSection()}currentLeftShortcodeDelimItem(){return this.lexerShortcodeState.currLeftDelimItem}currentRightShortcodeDelimItem(){return this.lexerShortcodeState.currRightDelimItem}currentLeftShortcodeDelim(){return 10===this.lexerShortcodeState.currLeftDelimItem?An:Tn}currentRightShortcodeDelim(){return 11===this.lexerShortcodeState.currRightDelimItem?Cn:xn}lexIdentifier(){for(;;)if(!On(this.next()))return this.backup(),0===(new TextDecoder).decode(this.input.slice(this.start,this.pos)).length||this.emit(15),null}lexMainSection(){if(this.isEOF())return()=>this.lexDone();const t=this.sectionHandlers.skip();if(-1===t)return this.pos=this.input.length,()=>this.lexDone();t>0&&(this.pos+=t);const e=this.sectionHandlers.lex(this.lexMainSection);return null!==e?e:(this.pos=this.input.length,this.lexDone)}lexInlineShortcodeContent(){for(;;){if(this.pos>=this.input.length)return this.errorf("unclosed inline shortcode");if(this.hasPrefix(An)||this.hasPrefix(Tn))return this.errorf("inline shortcodes do not support nesting");if(this.hasPrefix(this.currentRightShortcodeDelim()))return this.backup(),this.pos>this.start&&this.emit(18),()=>this.lexShortcodeRightDelim();this.next()}}lexIdentifierInShortcode(){let t=!1;for(;;){const e=this.next();switch(!0){case On(e):case 47===e:break;case 46===e:if(this.lexerShortcodeState.isInline=this.hasPrefix(Ln),!this.lexerShortcodeState.isInline)return this.errorf("period in shortcode name only allowed for inline identifiers");break;default:this.backup();const n=(new TextDecoder).decode(this.input.slice(this.start,this.pos));return this.lexerShortcodeState.closingState>0&&!this.lexerShortcodeState.openShortcodes[n]?this.errorf(`closing tag for shortcode '${n}' does not match start tag`):(this.lexerShortcodeState.closingState>0&&(this.lexerShortcodeState.openShortcodes[n]=!1,t=!0),this.lexerShortcodeState.closingState=0,this.lexerShortcodeState.currShortcodeName=n,this.lexerShortcodeState.openShortcodes[n]=!0,this.lexerShortcodeState.elementStepNum++,this.lexerShortcodeState.isInline?this.emit(14):this.emit(13),t?()=>this.lexEndOfShortcode():this.lexInsideShortcode)}}}lexEndOfShortcode(){return this.lexerShortcodeState.isInline=!1,this.hasPrefix(this.currentRightShortcodeDelim())?()=>this.lexShortcodeRightDelim():!0!==_n(this.next())?this.errorf("unclosed shortcode"):(this.ignore(),()=>this.lexEndOfShortcode())}lexShortcodeLeftDelim(){return this.pos+=this.currentLeftShortcodeDelim().length,this.isComment()?()=>this.lexComment():(this.emit(this.lexerShortcodeState.currLeftDelimItem),this.lexerShortcodeState.elementStepNum=0,this.lexerShortcodeState.paramElements=0,this.lexerShortcodeState.paramState=0,this.start=this.pos,this.lexInsideShortcode)}peekString(t){const e=(Uint8Array,t.length);if(this.pos+e>this.input.length)return null;const n=this.input.slice(this.pos,this.pos+e);if(t instanceof Uint8Array){for(let r=0;r<e;r++)if(n[r]!==t[r])return null;return(new TextDecoder).decode(n)}{const e=(new TextDecoder).decode(n);return e===t?e:null}}lexSummaryDivider(){if(!this.hasPrefix(yn))return null;if(this.start<this.pos){const t=new un;t.Type=18,t.low=this.start,t.high=this.pos,t.low<this.input.length&&(t.firstByte=this.input[t.low]),this.append(t)}const t=new un;return t.Type=2,t.low=this.pos,t.high=this.pos+yn.length,t.low<this.input.length&&(t.firstByte=this.input[t.low]),this.append(t),this.pos+=yn.length,this.start=this.pos,()=>this.lexMainSection()}handleBOM(){if(this.pos+3<=this.input.length){const t=this.input.slice(this.pos,this.pos+3);if(239===t[0]&&187===t[1]&&191===t[2]){const t=new un;return t.Type=7,t.low=this.pos,t.high=this.pos+3,t.firstByte=239,this.append(t),this.pos+=3,this.start=this.pos,!0}}return!1}lexIntroSection(){this.summaryDivider=yn,0===this.pos&&this.handleBOM();t:for(;;){const t=this.next();if(t===wn)break;switch(!0){case 43===t:if(this.hasPrefix(vn.slice(1)))return()=>this.lexFrontMatterSection(4,t,"TOML",vn);this.backup();break t;case 45===t:if(this.hasPrefix(En.slice(1)))return()=>this.lexFrontMatterSection(3,t,"YAML",En);this.backup();break t;case 123===t:return Un;case 35===t:return Bn;case 65279===t:this.emit(7);break;case!_n(t)&&!In(t):break t}}return()=>this.lexMainSection()}lexInsideShortcode(){if(this.hasPrefix(this.currentRightShortcodeDelim()))return this.lexShortcodeRightDelim;const t=this.next();if(t===wn)return this.errorf("unclosed shortcode action");if(_n(t)||In(t))this.ignore();else{if(61===t){this.consumeSpace(),this.ignore();const t=this.peek();return 34===t||92===t?this.lexShortcodeQuotedParamVal(92!==t,16):96===t?this.lexShortCodeParamRawStringVal(16):this.lexShortcodeParamVal}if(47===t){if(""===this.lexerShortcodeState.currShortcodeName)return this.errorf("got closing shortcode, but none is open");this.lexerShortcodeState.closingState++,this.lexerShortcodeState.isInline=!1,this.emit(12)}else{if(92!==t)return this.lexerShortcodeState.elementStepNum>0&&(On(t)||34===t||96===t)?(this.backup(),this.lexShortcodeParam(!1)):Mn(t)?(this.backup(),this.lexIdentifierInShortcode):this.errorf(`unrecognized character in shortcode action: U+${t.toString(16).toUpperCase()} '${String.fromCharCode(t)}'. Note: Parameters with non-alphanumeric args must be quoted`);if(this.ignore(),34===this.peek()||96===this.peek())return this.lexShortcodeParam(!0)}}return this.lexInsideShortcode}lexShortcodeParam(t){let e,n=!0,r=!1;for(;;){if(e=this.next(),n){if(34===e||96===e&&!t)return 2===this.lexerShortcodeState.paramElements?this.errorf("got quoted positional parameter. Cannot mix named and positional parameters"):(this.lexerShortcodeState.paramElements=1,this.backup(),34===e?()=>this.lexShortcodeQuotedParamVal(!t,15):()=>this.lexShortCodeParamRawStringVal(15));if(96===e&&t)return this.errorf("unrecognized escape character");n=!1}else if(61===e){this.backup(),r=!0;break}if(!On(e)&&46!==e){this.backup();break}}if(0===this.lexerShortcodeState.paramElements)this.lexerShortcodeState.paramElements++,r&&this.lexerShortcodeState.paramElements++;else{if(r&&1===this.lexerShortcodeState.paramElements)return this.errorf(`got named parameter '${(new TextDecoder).decode(this.current())}'. Cannot mix named and positional parameters`);if(!r&&2===this.lexerShortcodeState.paramElements)return this.errorf(`got positional parameter '${(new TextDecoder).decode(this.current())}'. Cannot mix named and positional parameters`)}return this.emit(15),this.lexInsideShortcode}lexShortcodeParamVal(){const t=this.next();if(_n(t))return this.ignore(),()=>this.lexShortcodeParamVal();switch(this.backup(),t){case 34:return this.next(),this.ignore(),()=>this.lexShortcodeQuotedParamVal(!1,16);case 96:return this.next(),this.ignore(),()=>this.lexShortCodeParamRawStringVal(16);default:return()=>this.lexShortcodeValueUnquoted()}}lexShortcodeValueUnquoted(){for(;;){const t=this.next();if(t===wn||_n(t)||this.isRightShortcodeDelim())return this.backup(),this.pos>this.start&&this.emit(16),this.lexInsideShortcode}}lexShortcodeQuotedParamVal(t,e){let n=!1,r=!1,i=0;t:for(;;){const e=this.next();switch(!0){case 92===e:if(34===this.peek()){if(n&&!t){this.backup();break t}n&&(r=!0,i=1)}else if(96===this.peek())return this.errorf("unrecognized escape character");break;case e===wn:case 10===e:return this.errorf(`unterminated quoted string in shortcode parameter-argument: '${(new TextDecoder).decode(this.current())}'`);case 34===e:if(0===i){if(n){this.backup();break t}n=!0,this.ignore()}else i=0}}r?this.ignoreEscapesAndEmit(e,!0):this.emitString(e);const s=this.next();return 92===s?34===this.peek()&&(this.ignore(),this.next(),this.ignore()):34===s?this.ignore():this.backup(),this.lexInsideShortcode}lexShortCodeParamRawStringVal(t){let e=!1;t:for(;;)switch(this.next()){case 96:if(e){this.backup();break t}e=!0,this.ignore();break;case wn:return this.errorf(`unterminated raw string in shortcode parameter-argument: '${(new TextDecoder).decode(this.input.slice(this.start,this.pos))}'`)}return this.emitString(t),this.next(),this.ignore(),this.lexInsideShortcode}lexDone(){return this.pos>this.start&&this.emit(18),this.emit(1),null}lexShortcodeRightDelim(){return this.pos+=this.currentRightShortcodeDelim().length,this.emit(this.lexerShortcodeState.currRightDelimItem),this.lexerShortcodeState.closingState=0,()=>this.lexMainSection()}lexShortcodeValue(){switch(this.next()){case wn:return this.errorf("unterminated quoted string in shortcode parameter");case 32:case 9:return this.ignore(),()=>this.lexShortcodeValue();case 34:return this.ignore(),()=>this.lexShortcodeValueQuoted();default:return this.backup(),()=>this.lexShortcodeValueUnquoted()}}lexShortcodeValueQuoted(){for(;;)switch(this.next()){case wn:return this.errorf("unterminated quoted string in shortcode parameter");case 92:34===this.peek()&&this.next();break;case 34:return this.backup(),this.emitString(16),this.next(),this.ignore(),this.lexInsideShortcode}}isRightShortcodeDelim(){return this.hasPrefix(this.currentRightShortcodeDelim())}lexComment(){const t=this.index(new Uint8Array([...Pn,...this.currentRightShortcodeDelim()]));return t<=1?this.errorf("comment must be closed"):(this.emit(18),this.pos+=Dn.length,this.ignore(),this.pos+=t-Dn.length,this.emit(18),this.pos+=Pn.length,this.ignore(),this.pos+=this.currentRightShortcodeDelim().length,this.emit(18),this.lexMainSection)}isComment(){return!(this.pos+2>this.input.length)&&47===this.input[this.pos]&&42===this.input[this.pos+1]}};function Un(t){t.backup();let e=!1,n=0;for(;;){const r=t.next();switch(!0){case r===wn:return t.errorf("unexpected EOF parsing JSON front matter");case 123===r:e||n++;break;case 125===r:e||n--;break;case 34===r:e=!e;break;case 92===r:t.next()}if(0===n)break}return t.consumeCRLF(),t.emit(5),()=>t.lexMainSection()}function Bn(t){if(t.summaryDivider=bn,t.backup(),!t.hasPrefix(kn))return()=>t.lexMainSection();t:for(;;){const e=t.next();switch(!0){case 10===e:if(!t.hasPrefix(kn))break t;break;case e===wn:break t}}return t.emit(6),()=>t.lexMainSection()}function qn(t){return t.lexIntroSection()}var jn=N("markdown",{component:"pageparser"});j();var Hn=N("markdown",{component:"parseinfo"}),zn=class{source;posMainContent=-1;itemsStep1=[];handlers;constructor(t,e){this.source=t,this.handlers=e,this.validateHandlers()}validateHandlers(){if(!this.handlers.frontMatterHandler())throw new Error("no front matter handler");if(!this.handlers.summaryHandler())throw new Error("no summary handler");if(!this.handlers.shortcodeHandler())throw new Error("no shortcode handler");if(!this.handlers.bytesHandler())throw new Error("no bytes handler")}isEmpty(){return 0===this.itemsStep1.length}async parse(){const t=function(t,e={}){const[n,r]=function(t,e){const[n,r]=function(t,e){const n=function(t,e,n){return new $n(t,qn,n)}(t,0,e);return n.run(),[n,null]}(t,e);return r?[[],r]:[n.items,n.err]}(t,e);if(r)throw jn.error("Error parsing bytes:",r),r;return n}(this.source,{});this.itemsStep1=t}async handle(){if(this.isEmpty())return;const t=new Fn(this.itemsStep1);for(;;){const e=t.Next();try{if(7===e.Type)Hn.info(`Ignoring item at position ${e.Pos()}: ${e.ValStr(this.source)}`);else if(e.IsFrontMatter()){await this.handlers.frontMatterHandler()(e);const n=t.Peek();n.IsDone()||(this.posMainContent=n.Pos())}else if(2===e.Type)await this.handlers.summaryHandler()(e,t);else if(e.IsLeftShortcodeDelim()){t.Backup();const e=t.Current();await this.handlers.shortcodeHandler()(e,t)}else{if(e.IsEOF())break;if(e.IsError())throw Hn.error(`Error parsing item at position ${e.Pos()}: ${e.Err}`),this.createError(e.Err||new Error("Unknown parsing error"),e);await this.handlers.bytesHandler()(e)}}catch(t){throw this.createError(t,e)}}}getMainContentPosition(){return this.posMainContent}getItems(){return this.itemsStep1}getSource(){return this.source}createError(t,e){const n=function(t,e,n){const r="string"==typeof e?(i=e,(new TextEncoder).encode(i)):e;var i;if(n<0)return{filename:"",line:1,column:1,offset:0};let s=1,a=1;for(let t=0;t<Math.min(n,r.length);t++)10===r[t]?(s++,a=1):a++;return{filename:"",line:s,column:a,offset:n}}(0,this.source,e.Pos()),r=new Error(`${t.message} at line ${n.line}, column ${n.column}`);return r.position=n,r}};j();var Wn=N("markdown",{component:"vo/shortcode"}),Gn=class{name;params;pos;length;rawContent;placeholder;inline;closed;inner;ordinal;indentation;doMarkup;isClosing;info;templs;constructor(t=0,e="",n=null,r=0,i=0,s=!1,a=!1){this.ordinal=t,this.name=e,this.params=n,this.pos=r,this.length=i,this.rawContent="",this.inline=s,this.closed=a,this.doMarkup=!1,this.isClosing=!1,this.placeholder="",this.inner=[]}needsInner(){return!this.inline}},Vn=class{shortcodes=[];nameSet=new Set;source;ordinal=0;pid;openShortcodes=new Map;paramElements=0;constructor(t,e=Date.now()){this.source=t,this.pid=e}parseItem(t,e){const n=this.extractShortcode(this.ordinal,0,e);if(!n)throw new Error("Failed to extract shortcode");n.pos=t.Pos()+t.ValStr(this.source).length,n.length=e.Current().Pos()+e.Current().ValStr(this.source).length-n.pos;const r=this.source.slice(n.pos,n.pos+n.length);return n.rawContent=(new TextDecoder).decode(r),n.name&&this.nameSet.add(n.name),n.params??=[],n.placeholder=Kn("s",this.pid,this.ordinal),this.ordinal++,this.shortcodes.push(n),n}extractShortcode(t,e,n){const r=new Gn(t);if(n.Pos()>0){n.Backup();const t=n.Next();t.IsIndentation()&&(r.indentation=t.ValStr(this.source))}let i=0,s=0;const a=e+1;let o=!1;const l="failed to extract shortcode";let c=0;for(;;){const t=n.Next();if(t.IsLeftShortcodeDelim()){const e=n.Peek();if(e.IsRightShortcodeDelim())throw new Error("shortcode has no name");if(e.IsShortcodeClose())continue;if(i>0){n.Backup();const t=this.extractShortcode(s,a,n);s++,t&&t.name&&(this.nameSet.add(t.name),Array.isArray(r.inner)||(r.inner=[]),r.inner.push(t))}else r.doMarkup=t.IsShortcodeMarkupDelimiter();i++}else if(t.IsRightShortcodeDelim()){if(!r.inline&&!r.needsInner())return this.openShortcodes.set(r.name,!1),r}else{if(t.IsShortcodeClose()){o=!0;const t=n.Peek();if(!r.inline&&!r.needsInner()){if(t.IsError())continue;throw new Error(`${l}: shortcode "${r.name}" does not evaluate .Inner or .InnerDeindent, yet a closing tag was provided`)}return t.IsRightShortcodeDelim()?n.Consume(1):(r.isClosing=!0,n.Consume(2)),r.inline||this.openShortcodes.set(r.name,!1),r}if(t.IsText()){Array.isArray(r.inner)||(r.inner=[]);const e=t.ValStr(this.source);r.inner.push(e)}else if(t.IsShortcodeName()||t.IsInlineShortcodeName()){if(r.name=t.ValStr(this.source).trim(),r.inline=t.IsInlineShortcodeName(),this.openShortcodes.has(r.name)&&this.openShortcodes.get(r.name))throw new Error(`shortcode ${r.name} nested in itself`);if(r.inline||this.openShortcodes.set(r.name,!0),r.inline){const t=this.source.slice(n.Pos()+3),e=Xn(t,"/");if(e!==this.source.length-1){const n=(new TextDecoder).decode(t.slice(e+1));if(-1===e||!n.startsWith(r.name+" "))throw new Error("inline shortcodes do not support nesting")}}}else if(t.IsShortcodeParam()){if(!n.IsValueNext()){Wn.warn(`${l}: shortcode "${r.name}" has a parameter without a value`);continue}if(n.Peek().IsShortcodeParamVal())if(null===r.params||void 0===r.params){const e={},i=t.ValStr(this.source);n.Next(),e[i]=n.Current().ValTyped(this.source),r.params=e}else{if(Array.isArray(r.params))throw new Error(`${l}: invalid state: invalid param type Array for shortcode "${r.name}", expected a map`);{const e=t.ValStr(this.source);n.Next(),r.params[e]=n.Current().ValTyped(this.source)}}else if(null===r.params||void 0===r.params){const e=[];e.push(t.ValTyped(this.source)),r.params=e}else{if(!Array.isArray(r.params))throw new Error(`${l}: invalid state: invalid param type Object for shortcode "${r.name}", expected an array`);r.params.push(t.ValTyped(this.source))}}else if(t.IsShortcodeParamVal()){if(0===c&&(c=1),Array.isArray(r.params))r.params.push(t.ValTyped(this.source));else if(null===r.params||void 0===r.params){const e=[];e.push(t.ValTyped(this.source)),r.params=e}}else if(t.IsDone()){if(!t.IsError()&&!o&&r.needsInner())throw new Error(`${l}: shortcode "${r.name}" must be closed or self-closed`);n.Backup();break}}}return r.inline||this.openShortcodes.set(r.name,!1),r}getShortcodes(){return this.shortcodes}getNames(){return Array.from(this.nameSet)}},Yn=(Kn("TOC",0,0),"HAHAHUGOSHORTCODE");function Kn(t,e,n){return`${Yn}${t}${e}${n}HBHB`}function Xn(t,e){const n=e.charCodeAt(0);for(let e=0;e<t.length;e++)if(!Zn(t[e])&&t[e]===n)return e;return-1}function Zn(t){return 32===t||9===t||13===t||10===t}var Jn=class{type;mainType;subType;delimiter;firstSuffix;mimeSuffix;suffixesCSV;constructor(t){this.type=t.type,this.mainType=t.mainType,this.subType=t.subType,this.delimiter=t.delimiter,this.firstSuffix=t.firstSuffix,this.mimeSuffix=t.mimeSuffix,this.suffixesCSV=t.suffixesCSV}sub(){if(this.subType)return this.subType;const t=this.type.split("/");return 2===t.length?t[1].split("+")[0]:""}getMimeSuffix(){if(this.mimeSuffix)return this.mimeSuffix;const t=this.type.indexOf("+");return-1!==t?this.type.substring(t+1):void 0}getSuffixList(){return this.suffixesCSV?this.suffixesCSV.split(","):[]}};j(),N("markdown",{component:"content"});var Qn="HUGOMORE42",tr=(new TextEncoder).encode(`\n\n${Qn}\n\n`),er=class{hasSummaryDivider=!1;summaryTruncated=!1;rawSource;items=[];renderer;constructor(t,e){this.rawSource=t,this.renderer=e}isEmpty(){return!this.rawSource||0===this.rawSource.length}setSummaryDivider(){this.hasSummaryDivider=!0}getHasSummaryDivider(){return this.hasSummaryDivider}setSummaryTruncated(){this.summaryTruncated=!0}getTruncated(){return this.summaryTruncated}addReplacement(t,e){const n={val:t,source:e};this.items.push(n)}addShortcode(t){this.items.push(t)}addItem(t){this.items.push(t)}addItems(...t){this.items.push(...t)}rawContent(){return(new TextDecoder).decode(this.rawSource)}pureContent(){const t=[],e=new TextDecoder,n=new TextEncoder;for(const e of this.items)if(this.isItem(e)){const n=this.rawSource.slice(e.Pos(),e.Pos()+e.Val(this.rawSource).length);t.push(n)}else this.isContentReplacement(e)?t.push(e.val):this.isShortcode(e)&&t.push(n.encode(e.placeholder));const r=t.reduce((t,e)=>t+e.length,0),i=new Uint8Array(r);let s=0;for(const e of t)i.set(e,s),s+=e.length;return e.decode(i)}pureContentWithoutPlaceholder(){const t=[],e=new TextDecoder;for(const e of this.items)if(this.isItem(e)){const n=this.rawSource.slice(e.Pos(),e.Pos()+e.Val(this.rawSource).length);t.push(n)}else this.isContentReplacement(e)?t.push(e.val):this.isShortcode(e);const n=t.reduce((t,e)=>t+e.length,0),r=new Uint8Array(n);let i=0;for(const e of t)r.set(e,i),i+=e.length;return e.decode(r)}renderedContent(t){let e=this.pureContent();if(t)for(const n of this.items)if(this.isShortcode(n)){const r=t(n);e=e.replace(n.placeholder,r)}return e}async renderedContentAsync(t){let e=await this.renderer.render(this.pureContent());if(t)for(const n of this.items)if(this.isShortcode(n))try{const r=await t(n);e=e.replace(n.placeholder,r)}catch(t){}return e}getItems(){return[...this.items]}getShortcodes(){return this.items.filter(this.isShortcode)}getTextItems(){return this.items.filter(this.isItem)}getReplacements(){return this.items.filter(this.isContentReplacement)}extractSummary(t,e){const n=(new TextDecoder).decode(t),r=this.extractSummaryFromHTML(e,n,70,this.containsCJK(n)),i=r.summaryLowHigh.high>r.summaryLowHigh.low?n.substring(r.summaryLowHigh.low,r.summaryLowHigh.high).trim():"";if(i)return this.summaryTruncated=r.truncated,{summary:i,truncated:r.truncated};const s=this.trimShortHTML(t);return this.summaryTruncated=s.length<t.length,{summary:(new TextDecoder).decode(t),truncated:this.summaryTruncated}}extractSummaryFromHTML(t,e,n,r){const i={source:e,summaryLowHigh:{low:0,high:e.length},truncated:!1};if(n<=0)return i;let s=0;const a=e.split(/\s+/);for(let t=0;t<a.length&&s<n;t++){const o=a[t].trim();if(0!==o.length&&!this.isProbablyHTMLToken(o)){if(r){const t=this.stripHTML(o),e=[...t].length;s+=t.length===t.replace(/[^\u0000-\u007F]/g,"").length?1:e}else s+=1;if(s>=n){const n=a.slice(0,t+1).join(" "),r=e.indexOf(n)+n.length;i.summaryLowHigh={low:0,high:Math.min(r,e.length)},i.truncated=!0;break}}}return i}containsCJK(t){return/[\u4e00-\u9fff\u3400-\u4dbf\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af]/.test(t)}isProbablyHTMLToken(t){return">"===t||/^<\/?[A-Za-z]+>?$/.test(t)||/^[A-Za-z]+=["']/.test(t)}stripHTML(t){return t.replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim()}trimShortHTML(t){const e=new TextDecoder,n=new TextEncoder;let r=e.decode(t);return 1===(r.match(/<p>/g)||[]).length&&(r=r.trim(),r.startsWith("<p>")&&r.endsWith("</p>")&&(r=r.slice(3,-4).trim())),n.encode(r)}cleanDividerPlaceholders(t){return this.hasSummaryDivider?t.replace(new RegExp(Qn,"g"),""):t}getDividedSummary(t){const e=t;if(this.hasSummaryDivider){const t=e.indexOf(Qn);if(-1!==t)return e.substring(0,t).trim()}return""}async getRenderedSummary(t,e){if(this.hasSummaryDivider&&t)return this.getDividedSummary(t);const n=this.pureContentWithoutPlaceholder(),r=(new TextEncoder).encode(n),i=new Jn({type:"text/html",mainType:"text",subType:"html",delimiter:".",firstSuffix:{suffix:"html",fullSuffix:".html"},mimeSuffix:"",suffixesCSV:"html"}),s=this.extractSummary(r,i);let a=s.summary;return s.truncated&&(a+="..."),e&&a.length>e&&(a=a.substring(0,e).trim()+"..."),await this.renderer.render(a)}getWordCount(){return this.pureContent().trim().split(/\s+/).filter(t=>t.length>0).length}getReadingTime(t=200){const e=this.getWordCount();return Math.ceil(e/t)}isItem(t){return"Type"in t&&"firstByte"in t&&"low"in t&&"high"in t}isShortcode(t){return"name"in t&&"placeholder"in t&&"params"in t}isContentReplacement(t){return"val"in t&&"source"in t}},nr=m(require("js-yaml")),rr=require("smol-toml"),ir=class{constructor(t){this.buffer=t}bytes(){return this.buffer.bytes()}toString(){return(new TextDecoder).decode(this.bytes())}},sr=class{constructor(t,e){this.parsingResult=t,this.renderingResult=e}headers(){return this.parsingResult.headers()}tableOfContents(){return this.parsingResult.tableOfContents()}bytes(){return this.renderingResult.bytes()}};j();var ar=N("markdown",{component:"MarkdownImpl"}),or=class{constructor(t,e){this.renderer=t,this.highlighter=e}async render(t,e){const n=await this.parse(t),r=await this.renderToBytes(t,e,n);return new sr(n,r)}async highlight(t,e,n){return this.highlighter.highlight(t,e,n)}async highlightCodeBlock(t,e){return this.highlighter.highlightCodeBlock(t,e)}async renderCodeblock(t,e,n){return this.highlighter.renderCodeblock(t,e,n)}isDefaultCodeBlockRenderer(){return this.highlighter.isDefaultCodeBlockRenderer()}async prepareRender(t){const e=await this.parseContent(t),n=e.frontMatter?.params,r=await this.renderer.parse(e.content.pureContent());return{frontMatter:()=>n||{},toc:()=>r.tableOfContents(),render:async t=>{const r=await e.content.renderedContentAsync(t.shortcodeRenderer),i=await e.content.getRenderedSummary(r,t.maxSummaryLength),s=e.content.getWordCount(),a=e.content.getReadingTime(t.wordsPerMinute),o={renderedContent:e.content.cleanDividerPlaceholders(r),wordCount:s,readingTime:a};return n&&(o.frontMatter=n),i&&(o.summary=i),o}}}async parseAndRenderContent(t,e={}){const n=await this.parseContent(t),r=n.frontMatter?.params;let i;i=e.shortcodeRenderer&&n.shortcodes.length>0?await n.content.renderedContentAsync(e.shortcodeRenderer):n.content.pureContent();const s=await this.renderer.render(i);if(this.hasCollectedTagsSupport()){const t=this.getCollectedTags();if(t.length>0){const e=r||{},i=Array.isArray(e.tags)?e.tags:e.tags?[e.tags]:[],s=[...new Set([...i,...t])];e.tags=s,n.frontMatter&&(n.frontMatter.params=e),ar.debug(`Merged tags: YAML [${i.join(", ")}] + inline [${t.join(", ")}] = [${s.join(", ")}]`)}}const a=n.content.getDividedSummary(s),o={renderedContent:s,wordCount:n.content.getWordCount(),readingTime:n.content.getReadingTime(e.wordsPerMinute)};return r&&(o.frontMatter=r),a&&(o.summary=a),o}hasCollectedTagsSupport(){return"function"==typeof this.renderer.getCollectedTags}getCollectedTags(){return this.hasCollectedTagsSupport()?this.renderer.getCollectedTags():[]}async parseContent(t){let e;const n=new er(t,this.renderer),r=new Vn(t),i=[],s=function(t,e){return new zn(t,e)}(t,{frontMatterHandler:()=>n=>{e=this.parseFrontMatter(n,t)},summaryHandler:()=>(e,r)=>{let i=-1;r.PeekWalk(e=>(-1!==i||e.IsDone()||(i=e.Pos()),!e.IsNonWhitespace(t)||(n.setSummaryTruncated(),!1))),n.setSummaryDivider(),n.addReplacement(tr,e)},shortcodeHandler:()=>(t,e)=>{const s=r.parseItem(t,e);i.push(s),n.addShortcode(s)},bytesHandler:()=>t=>{n.addItem(t)}});return await s.parse(),await s.handle(),{frontMatter:e,content:n,shortcodes:i,summary:await n.getRenderedSummary(),wordCount:n.getWordCount(),readingTime:n.getReadingTime()}}parseFrontMatter(t,e){const n=t.ValStr(e);let r,i={};switch(t.Type){case 3:r="yaml",i=this.parseYAML(n);break;case 4:r="toml",i=this.parseTOML(n);break;case 5:r="json",i=this.parseJSON(n);break;case 6:r="org",i=this.parseOrg(n);break;default:r="yaml"}return{params:i,format:r}}parseYAML(t){try{const e=nr.load(t);return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}catch(t){return{}}}parseTOML(t){try{const e=(0,rr.parse)(t);return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}catch(t){return{}}}parseJSON(t){try{return JSON.parse(t)}catch(t){return{}}}parseOrg(t){const e={},n=t.split("\n");for(const t of n){const n=t.trim();if(!n.startsWith("#+"))continue;const r=n.match(/^#\+([^:]+):\s*(.*)$/);if(r){const t=r[1].trim().toLowerCase(),n=r[2].trim();e[t]=this.parseValue(n)}}return e}parseValue(t){if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);if("true"===t)return!0;if("false"===t)return!1;if(/^-?\d+$/.test(t))return parseInt(t,10);if(/^-?\d*\.\d+$/.test(t))return parseFloat(t);if(t.startsWith("[")&&t.endsWith("]")){const e=t.slice(1,-1).trim();return e?e.split(",").map(t=>this.parseValue(t.trim())):[]}return t}async parse(t){const e=(new TextDecoder).decode(t.src);return await this.renderer.parse(e)}async renderToBytes(t,e,n){const r=(new TextDecoder).decode(t.src),i=await this.renderer.render(r),s=new rn;return await s.writeString(i),new ir(s)}},lr=m(require("markdown-it")),cr=class{F=[];$;tokens;source;idGenerator;constructor(t,e,n){this.tokens=t,this.source=e,this.idGenerator=n||new ln,this.$=this.buildTableOfContents(),this.F=this.extractHeaders()}headers(){return[...this.F]}tableOfContents(){return this.$}getTokens(){return[...this.tokens]}getSource(){return this.source}buildTableOfContents(){const t=new on;for(const e of this.tokens)if("heading_open"===e.type){const n=parseInt(e.tag.substring(1)),r=this.findNextTextToken(e);if(r){const e=r.content,i=this.idGenerator.generateID(e);t.addHeading(e,n,i)}}return t.build()}extractHeaders(){const t=[];for(let e=0;e<this.tokens.length;e++){const n=this.tokens[e];if("heading_open"===n.type){const r=parseInt(n.tag.substring(1)),i=this.findNextTextToken(n,e);if(i){const e=new an(i.content,r);t.push(e)}}}return t}findNextTextToken(t,e){for(let n=void 0!==e?e+1:this.tokens.indexOf(t)+1;n<this.tokens.length;n++){const t=this.tokens[n];if("inline"===t.type)return t;if("heading_close"===t.type)break}return null}};function hr(t,e){t=function(t){return t.startsWith("/")&&(t=t.substring(1)),t.endsWith("/")&&(t=t.slice(0,-1)),t}(t);let n=(r=t,r.match(/\.[A-Za-z0-9]+$/)?.[0]);var r;const i=t.replace(new RegExp(n+"$"),"");(e||[".md",".html",void 0].includes(n))&&(n="");let s=function(t){return t.split("/").map(t=>t.replace(/\s/g,"-").replace(/&/g,"-and-").replace(/%/g,"-percent").replace(/\?/g,"").replace(/#/g,"")).join("/").replace(/\/$/,"")}(i);return function(t,e){return t===e||t.endsWith("/"+e)}(s,"_index")&&(s=s.replace(/_index$/,"index")),s+n}function ur(t){let[e,n]=t.split("#",2);return e.endsWith(".pdf")?[e,void 0===n?"":`#${n}`]:(n=void 0===n?"":"#"+n.toLowerCase().trim().replace(/\s+/g,"-").replace(/[^\w\u4e00-\u9fa5\-]+/g,"").replace(/\-+/g,"-").replace(/^-+|-+$/g,""),[e,n])}var fr=/^https?:\/\//i,dr=new RegExp(/!?\[\[([^\[\]\|\#\\]+)?(#+[^\[\]\|\#\\]+)?(\\?\|[^\[\]\#]*)?\]\]/g),pr=new RegExp(/^\|([^\n])+\|\n(\|)( ?:?-{3,}:? ?\|)+\n(\|([^\n])+\|\n?)+/gm),gr=new RegExp(/(!?\[\[[^\]]*?\]\]|\[\^[^\]]*?\])/g);function mr(t,e){const n=t.pos,r=t.posMax;if(n+5>r)return!1;const i=33===t.src.charCodeAt(n),s=i?1:0;if(91!==t.src.charCodeAt(n+s)||91!==t.src.charCodeAt(n+s+1))return!1;let a=n+s+2,o=!1;for(;a<r-1;){if(93===t.src.charCodeAt(a)&&93===t.src.charCodeAt(a+1)){o=!0;break}a++}if(!o)return!1;const l=t.src.slice(n+s+2,a);if(0===l.trim().length)return!1;const c=l.indexOf("|"),h=l.indexOf("#");let u,f="",d="";if(-1!==c){const t=l.slice(0,c);u=l.slice(c+1).trim();const e=t.indexOf("#");-1!==e?(f=t.slice(0,e).trim(),d=t.slice(e).trim()):f=t.trim()}else-1!==h?(f=l.slice(0,h).trim(),d=l.slice(h).trim()):f=l.trim();if(!e){const e=i?"wikilink_embed":"wikilink_link",n=t.push(e,"",0),r={isEmbed:i,filepath:f,anchor:d,alias:u,url:f+d};n.meta=r,n.content=u||f}return t.pos=a+2,!0}function wr(t,e){const n=t[e].meta,[r,i]=ur(n.url),s=hr(r),a=vr(n.alias??n.filepath);return`<a class="internal" data-slug="${s}" data-wikilink="${vr(n.url)}">${a}</a>`}var yr=new RegExp(/^(?<alt>(?!^\d*x?\d*$).*?)?(\|?\s*?(?<width>\d+)(x(?<height>\d+))?)?$/);function br(t,e){const n=t[e].meta,{filepath:r,anchor:i,alias:s}=n,a=hr(r),o=function(t){const e=t.toLowerCase().match(/\.[a-z0-9]+$/);return e?e[0]:""}(r);if([".png",".jpg",".jpeg",".gif",".bmp",".svg",".webp"].includes(o)){const{alt:t,width:e,height:n}=function(t){if(!t)return{alt:"",width:"auto",height:"auto"};const e=yr.exec(t);return e&&e.groups?{alt:e.groups.alt||"",width:e.groups.width||"auto",height:e.groups.height||"auto"}:{alt:t,width:"auto",height:"auto"}}(s);return`<img src="${a}" alt="${vr(t)}" width="${e}" height="${n}" />`}return[".mp4",".webm",".ogv",".mov",".mkv"].includes(o)?`<video src="${a}" controls></video>`:[".mp3",".webm",".wav",".m4a",".ogg",".3gp",".flac"].includes(o)?`<audio src="${a}" controls></audio>`:[".pdf"].includes(o)?`<iframe src="${a}" class="pdf"></iframe>`:`<blockquote class="transclude" data-url="${a}" data-block="${i}"><a href="${a+i}" class="transclude-inner">Transclude of ${a}</a></blockquote>`}function vr(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function Er(t,e){!1!==e?.enable&&(t.inline.ruler.before("link","wikilink",mr),t.renderer.rules.wikilink_link=wr,t.renderer.rules.wikilink_embed=br)}function kr(t,e){const n=t.pos;if(n+2>t.posMax)return!1;if(35!==t.src.charCodeAt(n))return!1;if(n>0){const e=t.src.charCodeAt(n-1);if(32!==e&&10!==e&&9!==e)return!1}const r=t.src.slice(n),i=/^#((?:[-_\p{L}\p{Emoji}\p{M}\d])+(?:\/[-_\p{L}\p{Emoji}\p{M}\d]+)*)/u.exec(r);if(!i)return!1;const s=i[0],a=i[1];if(/^[\/\d]+$/.test(a))return!1;if(!e){const e=t.push("tag","",0),n=a.split("/").map(t=>t.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^\p{L}\p{Emoji}\p{M}\d\-_]/gu,"")).join("/"),r=t.md.q,i={rawTag:a,slugTag:n,url:`${r?.tagBaseURL||"tags/"}${n}`};e.meta=i,e.content=a,r?.onTagFound&&r.onTagFound(n)}return t.pos=n+s.length,!0}function Sr(t,e){const n=t[e].meta,r=n.rawTag.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;");return`<a href="${n.url}" class="internal tag-link">${r}</a>`}function Tr(t,e){const n={enable:!0,tagBaseURL:"tags/",...e};!1!==n.enable&&(t.q={tagBaseURL:n.tagBaseURL,onTagFound:n.onTagFound},t.inline.ruler.before("emphasis","tag",kr),t.renderer.rules.tag=Sr)}new RegExp(/(?<=^| )#((?:[-_\p{L}\p{Emoji}\p{M}\d])+(?:\/[-_\p{L}\p{Emoji}\p{M}\d]+)*)/gu);var xr=m(require("markdown-it/lib/token.mjs")),Ar={note:"note",abstract:"abstract",summary:"abstract",tldr:"abstract",info:"info",todo:"todo",tip:"tip",hint:"tip",important:"tip",success:"success",check:"success",done:"success",question:"question",help:"question",faq:"question",warning:"warning",caution:"warning",attention:"warning",failure:"failure",fail:"failure",missing:"failure",danger:"danger",error:"danger",bug:"bug",example:"example",quote:"quote",cite:"quote"},Cr=/^\[\!([\w-]+)\|?(.+?)?\]([+-]?)/;function Dr(t,e){if("blockquote_open"!==t[e].type)return null;let n=e+1;for(;n<t.length&&"paragraph_open"!==t[n].type;){if("blockquote_close"===t[n].type)return null;n++}if(n>=t.length)return null;const r=n+1;if("inline"!==t[r].type)return null;const i=t[r].content,s=i.match(Cr);if(!s)return null;const[a,o,l="",c]=s;var h;return{type:function(t){const e=t.toLowerCase();return Ar[e]??t}(o.toLowerCase()),title:i.split("\n")[0].slice(a.length).trim()||(h=o.replace(/-/g," ")).charAt(0).toUpperCase()+h.slice(1),collapse:c,metadata:l,firstLineIdx:r}}function Pr(t,e,n){const r=Dr(t,e);if(!r)return e;const{type:i,title:s,collapse:a,metadata:o,firstLineIdx:l}=r;let c=e+1,h=1;for(;c<t.length&&h>0;)"blockquote_open"===t[c].type&&h++,"blockquote_close"===t[c].type&&h--,c++;c--,t[e].type="callout_open",t[e].tag="div",t[e].attrSet("class",`callout ${i}${a?" is-collapsible":""}${"-"===a?" is-collapsed":""}`),t[e].attrSet("data-callout",i),a&&t[e].attrSet("data-callout-fold",a),o&&t[e].attrSet("data-callout-metadata",o);const u=t[l],f=u.content.split("\n"),d=f[0],p=d.match(Cr);if(p){const e=p[0],n=d.slice(e.length).trim(),r=f.slice(1);if(u.content=n,r.length>0&&r.join("\n").trim()){const e=l+1,n=new xr.default("paragraph_open","p",1),i=new xr.default("inline","",0);i.content=r.join("\n").trim(),i.children=[];const s=new xr.default("paragraph_close","p",-1);t.splice(e+1,0,n,i,s),c+=3}}let g=e+1;for(;g<c&&"paragraph_open"!==t[g].type;)g++;let m=g+1;for(;m<c&&"paragraph_close"!==t[m].type;)m++;const w=[],y=new xr.default("callout_title_open","div",1);y.attrSet("class","callout-title"),w.push(y);const b=new xr.default("callout_icon","div",0);b.attrSet("class","callout-icon"),w.push(b);const v=new xr.default("callout_title_inner_open","div",1);v.attrSet("class","callout-title-inner"),w.push(v);const E=new xr.default("inline","",0);E.content=s,E.children=[],w.push(E);const k=new xr.default("callout_title_inner_close","div",-1);if(w.push(k),a){const t=new xr.default("callout_fold_icon","div",0);t.attrSet("class","fold-callout-icon"),w.push(t)}const S=new xr.default("callout_title_close","div",-1);w.push(S),t.splice(g,m-g+1),c-=m-g+1,t.splice(e+1,0,...w),c+=w.length;const T=e+1+w.length;if(T<c){const e=new xr.default("callout_content_open","div",1);e.attrSet("class","callout-content"),t.splice(T,0,e),c++;const n=new xr.default("callout_content_close","div",-1);t.splice(c,0,n),c++}return t[c].type="callout_close",t[c].tag="div",c}function Lr(t){let e=0,n=0;for(;e<t.tokens.length;)"blockquote_open"===t.tokens[e].type&&Dr(t.tokens,e)?(Pr(t.tokens,e,t.md),n++,e++):e++;return n>0}function Rr(t,e){!1!=={enable:!0,...e}.enable&&(t.core.ruler.after("block","callout",Lr),function(t){t.renderer.rules.callout_open=(t,e)=>{const n=t[e];return`<div${n.attrs?n.attrs.map(t=>{return` ${t[0]}="${e=t[1],e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}"`;var e}).join(""):""}>`},t.renderer.rules.callout_close=()=>"</div>\n",t.renderer.rules.callout_title_open=(t,e)=>'<div class="callout-title">',t.renderer.rules.callout_title_close=()=>"</div>",t.renderer.rules.callout_title_inner_open=()=>'<div class="callout-title-inner">',t.renderer.rules.callout_title_inner_close=()=>"</div>",t.renderer.rules.callout_icon=()=>'<div class="callout-icon"></div>',t.renderer.rules.callout_fold_icon=()=>'<div class="fold-callout-icon"></div>',t.renderer.rules.callout_content_open=()=>'<div class="callout-content">',t.renderer.rules.callout_content_close=()=>"</div>"}(t))}function Nr(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function _r(t,e){const n=t.pos,r=t.posMax;if(36!==t.src.charCodeAt(n))return!1;if(n>0&&92===t.src.charCodeAt(n-1))return!1;if(36===t.src.charCodeAt(n+1))return!1;let i=n+1,s=!1;for(;i<r;){const e=t.src.charCodeAt(i);if(10===e)return!1;if(36===e&&92!==t.src.charCodeAt(i-1)){s=!0;break}i++}if(!s)return!1;const a=t.src.slice(n+1,i);if(0===a.trim().length)return!1;if(!e){const e=t.push("math_inline","math",0);e.content=a,e.markup="$"}return t.pos=i+1,!0}function Or(t,e,n,r){let i=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(i+2>s)return!1;if(36!==t.src.charCodeAt(i)||36!==t.src.charCodeAt(i+1))return!1;if("$$"!==t.src.slice(i,s).trim())return!1;let a=e+1,o=!1;for(;a<n;){if(i=t.bMarks[a]+t.tShift[a],s=t.eMarks[a],"$$"===t.src.slice(i,s).trim()){o=!0;break}a++}if(!o)return!1;const l=[];for(let n=e+1;n<a;n++){const e=t.bMarks[n]+t.tShift[n],r=t.eMarks[n];l.push(t.src.slice(e,r))}const c=l.join("\n");if(!r){const n=t.push("math_block","math",0);n.content=c,n.markup="$$",n.block=!0,n.map=[e,a+1]}return t.line=a+1,!0}function Ir(t,e){return`<span class="math math-inline" data-math="inline">${Nr(t[e].content)}</span>`}function Mr(t,e){return`<div class="math math-display" data-math="block">${Nr(t[e].content)}</div>\n`}function Fr(t,e){!1!==e?.enable&&(t.inline.ruler.before("escape","math_inline",_r),t.block.ruler.before("fence","math_block",Or,{alt:["paragraph","reference","blockquote","list"]}),t.renderer.rules.math_inline=Ir,t.renderer.rules.math_block=Mr)}function $r(t,e){if(!1===e?.enable)return;const n=t.renderer.rules.fence||function(t,e,n,r,i){return i.renderToken(t,e,n)};t.renderer.rules.fence=function(e,r,i,s,a){const o=e[r],l=o.info?t.utils.unescapeAll(o.info).trim():"";if("mermaid"===(l?l.split(/\s+/g)[0]:"")){const e=o.content;return`<pre class="mermaid-wrapper"><code class="language-mermaid mermaid">${t.utils.escapeHtml(e)}</code><button class="expand-button" aria-label="Expand diagram"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"/></svg></button><div id="mermaid-container"><div id="mermaid-space"><div class="mermaid-content"></div></div></div></pre>\n`}return n(e,r,i,s,a)}}var Ur=class{md;config;idGenerator;collectedTags=new Set;constructor(t,e){this.config=t,this.idGenerator=new ln,e?(this.md=e,this.config.extensions.wikilink?.enable&&this.md.use(Er,{enable:!0}),this.config.extensions.parseTags&&this.md.use(Tr,{enable:!0,tagBaseURL:"tags/",onTagFound:t=>this.collectedTags.add(t)}),this.config.extensions.callouts&&this.md.use(Rr,{enable:!0}),this.config.extensions.latex?.enable&&this.md.use(Fr,{enable:!0}),this.config.extensions.mermaid?.enable&&this.md.use($r,{enable:!0})):this.md=this.createMarkdownItInstance(),this.setupRendererRules()}setupRendererRules(){const t=this.idGenerator;this.md.renderer.rules.heading_open=function(e,n){const r=e[n+1].content,i=t.generateID(r);return e[n].attrPush(["id",i]),`<${e[n].tag} id="${i}">`}}async render(t){return this.idGenerator.reset(),this.collectedTags.clear(),this.config.extensions.wikilink?.enable&&(t=t.replace(pr,t=>t.replace(gr,(t,e)=>{let n=e??"";return n=n.replace("#","\\#"),n=n.replace(/((^|[^\\])(\\\\)*)\|/g,"$1\\|"),n})).replace(dr,(t,...e)=>{const[n,r,i]=e,[s,a]=ur(`${n??""}${r??""}`),o=Boolean(r?.startsWith("#^"))?"^":"",l=a?`#${o}${a.trim().replace(/^#+/,"")}`:"",c=i??r?.replace("#","|")??"",h=t.startsWith("!")?"!":"";return n?.match(fr)?`${h}[${c.replace(/^\|/,"")}](${n})`:`${h}[[${s}${l}${c}]]`})),this.md.render(t)}getCollectedTags(){return Array.from(this.collectedTags)}async parse(t){this.idGenerator.reset();const e=await this.j(t);return new cr(e,(new TextEncoder).encode(t),this.idGenerator)}async j(t){return this.md.parse(t,{})}getMarkdownIt(){return this.md}addPlugin(t,e){this.md.use(t,e)}createMarkdownItInstance(){const t=new lr.default({html:this.config.renderer.unsafe,breaks:!1,linkify:this.config.extensions.linkify,typographer:!this.config.extensions.typographer.disable});return this.config.extensions.typographer.disable||(t.options.quotes=[this.config.extensions.typographer.leftDoubleQuote,this.config.extensions.typographer.rightDoubleQuote,this.config.extensions.typographer.leftSingleQuote,this.config.extensions.typographer.rightSingleQuote]),this.configureBasicPlugins(t),this.config.extensions.wikilink?.enable&&t.use(Er,{enable:!0}),this.config.extensions.parseTags&&t.use(Tr,{enable:!0,tagBaseURL:"tags/",onTagFound:t=>this.collectedTags.add(t)}),this.config.extensions.callouts&&t.use(Rr,{enable:!0}),this.config.extensions.latex?.enable&&t.use(Fr,{enable:!0}),this.config.extensions.mermaid?.enable&&t.use($r,{enable:!0}),t}configureBasicPlugins(t){this.config.extensions.table&&t.enable(["table"]),this.config.extensions.strikethrough&&t.enable(["strikethrough"])}};j();var Br=m(require("js-yaml")),qr=(t=>(t[t.File=0]="File",t[t.ContentResource=1]="ContentResource",t[t.ContentSingle=2]="ContentSingle",t[t.Leaf=3]="Leaf",t[t.Branch=4]="Branch",t))(qr||{}),jr={CONTENT_EXTENSIONS:[".md",".markdown",".mdown",".mkd",".mkdn",".html",".htm",".xml"],HTML_EXTENSIONS:[".html",".htm"],INDEX_NAMES:["index","_index"],PATH_SEPARATOR:"/",EXTENSION_SEPARATOR:".",LANGUAGE_SEPARATOR:".",SYSTEM_PATH_SEPARATOR:(()=>{try{return require("path").sep}catch{return"/"}})(),COMPONENT_FOLDER_CONTENT:"content",COMPONENT_FOLDER_STATIC:"static",COMPONENT_FOLDER_LAYOUTS:"layouts",COMPONENT_FOLDER_ARCHETYPES:"archetypes",COMPONENT_FOLDER_DATA:"data",COMPONENT_FOLDER_ASSETS:"assets",COMPONENT_FOLDER_I18N:"i18n",normalizePath:t=>{let e=t.replace(/\\/g,"/");return e.startsWith("//")&&(e=e.substring(1)),e}},Hr=class t{constructor(t,e,n,r,i,s=!1,a){this.original=t,this.normalized=e,this.positions=n,this.identifiers=r,this.bundleType=i,this.disabled=s,this.component=a}withBundleType(e){return new t(this.original,this.normalized,this.positions,this.identifiers,e,this.disabled)}withDisabled(e){return new t(this.original,this.normalized,this.positions,this.identifiers,this.bundleType,e)}hasIdentifiers(){return this.identifiers.length>0}firstIdentifier(){return this.identifiers.length>0?this.identifiers[0]:null}lastIdentifier(){return this.identifiers.length>0?this.identifiers[this.identifiers.length-1]:null}getIdentifier(t){return t>=0&&t<this.identifiers.length?this.identifiers[t]:null}isContentComponent(t){return"content"===t||"archetypes"===t}clone(){return new t(this.original,this.normalized,{...this.positions},[...this.identifiers],this.bundleType,this.disabled,this.component)}toString(){return`PathComponents{original="${this.original}", normalized="${this.normalized}", bundleType=${qr[this.bundleType]}, identifiers=${this.identifiers.length}}`}},zr=class t{constructor(t=-1,e=-1,n=-1,r=-1){this.containerLow=t,this.containerHigh=e,this.sectionHigh=n,this.identifierLanguage=r}reset(){this.containerLow=-1,this.containerHigh=-1,this.sectionHigh=-1,this.identifierLanguage=-1}hasContainer(){return-1!==this.containerLow&&-1!==this.containerHigh}hasSection(){return this.sectionHigh>0}hasLanguageIdentifier(){return-1!==this.identifierLanguage}clone(){return new t(this.containerLow,this.containerHigh,this.sectionHigh,this.identifierLanguage)}},Wr=class{constructor(t,e){if(this.low=t,this.high=e,t>e)throw new Error(`Invalid range: low (${t}) must be <= high (${e})`)}length(){return this.high-this.low}isEmpty(){return this.low===this.high}contains(t){return t>=this.low&&t<this.high}substring(t){return t.substring(this.low,this.high)}toString(){return`[${this.low}, ${this.high})`}},Gr=class{static createEmpty(t="",e=0){return new Hr(t,t,new zr,[],e,!1)}static create(t,e,n=0){return new Hr(t,e||t,new zr,[],n,!1)}static createFull(t,e,n,r,i,s=!1){return new Hr(t,e,n,r,i,s)}},Vr=class t{constructor(t){this.components=t}H;shouldTrimLeadingSlash=!1;component(){if(this.components.component)return this.components.component;const t=this.components.normalized.split("/").filter(t=>t.length>0);return 0===t.length?"content":{static:"static",layouts:"layouts",themes:"themes",archetypes:"archetypes",data:"data",i18n:"i18n",assets:"assets"}[t[0]]||"content"}path(){return this.norm(this.components.normalized)}name(){return this.components.positions.containerHigh>0?this.components.normalized.substring(this.components.positions.containerHigh):this.components.normalized}originalNameNoExt(){const t=this.components.firstIdentifier();return t?this.components.original.substring(this.components.positions.containerHigh,t.low-1):this.components.original.substring(this.components.positions.containerHigh)}nameNoExt(){const t=this.components.firstIdentifier();return t?this.components.normalized.substring(this.components.positions.containerHigh,t.low-1):this.components.normalized.substring(this.components.positions.containerHigh)}nameNoLang(){if(this.components.identifiers.length>=2){const t=this.components.identifiers[this.components.identifiers.length-1],e=this.components.identifiers[this.components.identifiers.length-2],n=this.components.normalized.substring(e.low,e.high);if(["en","fr","es","de","zh","ja","ko","pt","it","ru","ar"].includes(n)){const n=this.components.positions.containerHigh;return this.components.normalized.substring(n,e.low-1)+this.components.normalized.substring(t.low-1)}}return this.name()}dir(){let t="";return this.components.positions.containerHigh>0&&(t=this.components.normalized.substring(0,this.components.positions.containerHigh-1)),""===t&&(t="/"),this.norm(t)}ext(){if(0===this.components.identifiers.length)return"";const t=this.components.identifiers[this.components.identifiers.length-1],e=this.components.normalized.substring(t.low,t.high);return e?"."+e:""}lang(){if(this.components.identifiers.length>=2){const t=this.components.identifiers[this.components.identifiers.length-2],e=this.components.normalized.substring(t.low,t.high);if(["en","fr","es","de","zh","ja","ko","pt","it","ru","ar"].includes(e))return"."+e}return""}section(){if(this.components.positions.sectionHigh<=0)return"";const t=this.components.normalized.substring(1,this.components.positions.sectionHigh);return"_index.md"===t||"index.md"===t||t.endsWith("/_index.md")||t.endsWith("/index.md")?"":this.norm(t)}sections(){const t=this.dir();if("/"===t||""===t)return[];const e=[],n=(t.startsWith("/")?t.substring(1):t).split("/").filter(t=>t.length>0);let r="";for(const t of n)""===r?r=t:r+="/"+t,e.push(this.norm(r));return e}container(){return-1===this.components.positions.containerLow?"":this.norm(this.components.normalized.substring(this.components.positions.containerLow,this.components.positions.containerHigh-1))}containerDir(){return this.isLeafBundle()||this.isBranchBundle(),this.dir()}base(){return this.isBranchBundle()&&"/_index.md"===this.components.normalized?"/":this.isLeafBundle()?this.baseInternal(!1,!0):this.isContent()&&!this.isBundle()?this.pathNoIdentifier():this.isContent()?this.isBundle()?this.baseInternal(!1,!0):this.baseInternal(!this.isContentPage(),this.isBundle()):this.path()}baseNoLeadingSlash(){return this.base().substring(1)}baseNameNoIdentifier(){return this.isBundle()?this.container():this.nameNoIdentifier()}nameNoIdentifier(){if(0===this.components.identifiers.length)return this.name();const t=this.components.identifiers[0],e=this.components.positions.containerHigh;return this.components.normalized.substring(e,t.low-1)}pathNoLang(){return this.baseInternal(!0,!1)}pathNoIdentifier(){if(0===this.components.identifiers.length)return this.path();const t=this.components.identifiers[0],e=this.components.normalized.substring(0,t.low-1);return this.norm(e)}pathRel(t){let e=t.base();return e.endsWith("/")||(e+="/"),this.path().replace(new RegExp("^"+this.escapeRegExp(e)),"")}baseRel(t){let e=t.base();return"/"===e&&(e=""),this.base().substring(e.length+1)}trimLeadingSlash(){const e=this.components.clone(),n=new t(e);return n.setShouldTrimLeadingSlash(!0),n}identifier(t){const e=this.components.identifiers.length;if(0===e||t<0||t>=e)return"";let n;n=1===e?0:0===t?e-1:e-1-t;const r=this.identifierAsString(n);return r?"."+r:""}identifiers(){const t=[],e=this.components.identifiers.length;for(let n=0;n<e;n++){const e=this.identifier(n);e&&t.push(e)}return t}bundleType(){return this.components.bundleType}isContent(){return this.bundleType()>=1}isBundle(){return this.bundleType()>3}isBranchBundle(){return 4===this.bundleType()}isLeafBundle(){return 3===this.bundleType()}isHTML(){const t=this.ext().toLowerCase();return jr.HTML_EXTENSIONS.some(e=>e===t)}disabled(){return this.components.disabled}forBundleType(e){const n=this.components.withBundleType(e);return new t(n)}unnormalized(){if(!this.H)if(this.components.original===this.components.normalized)this.H=this;else{const e=new Hr(this.components.original,this.components.original,this.components.positions,this.components.identifiers,this.components.bundleType,this.components.disabled);this.H=new t(e)}return this.H}setShouldTrimLeadingSlash(t){this.shouldTrimLeadingSlash=t}norm(t){return this.shouldTrimLeadingSlash&&t.startsWith("/")?t.substring(1):t}isContentPage(){return this.bundleType()>=2}baseInternal(t,e){if(0===this.components.identifiers.length)return this.norm(this.components.normalized);if(t&&1===this.components.identifiers.length)return this.norm(this.components.normalized);let n=this.components.identifiers[this.components.identifiers.length-1].low-1;if(e&&(n=this.components.positions.containerHigh-1),0===n&&n++,!t)return this.norm(this.components.normalized.substring(0,n));const r=this.components.identifiers[0];return this.norm(this.components.normalized.substring(0,n)+this.components.normalized.substring(r.low-1,r.high))}identifierAsString(t){const e=this.identifierIndex(t);if(-1===e)return"";const n=this.components.identifiers[e];return this.components.normalized.substring(n.low,n.high)}identifierIndex(t){return t<0||t>=this.components.identifiers.length?-1:t}escapeRegExp(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}toString(){return`Path{path="${this.path()}", component="${this.component()}", bundleType=${qr[this.bundleType()]}}`}equals(t){return this.path()===t.path()&&this.component()===t.component()&&this.bundleType()===t.bundleType()}hashCode(){return`${this.component()}:${this.path()}:${this.bundleType()}`}},Yr=class{static fromString(t,e){const n=new Hr(e,e,{containerLow:-1,containerHigh:-1,sectionHigh:-1,identifierLanguage:-1},[],0,!1);return new Vr(n)}static hasExtension(t,e){const n=t.ext(),r=e.startsWith(".")?e:"."+e;return n.toLowerCase()===r.toLowerCase()}static isUnder(t,e){const n=t.path();let r;r=e.isBranchBundle()?e.dir():e.path();const i="/"===r?"/":r+"/";return n!==r&&n.startsWith(i)}static relativeTo(t,e){return e.pathRel(t)}static compare(t,e){const n=t.path().localeCompare(e.path());if(0!==n)return n;const r=t.component().localeCompare(e.component());return 0!==r?r:t.bundleType()-e.bundleType()}},Kr=class{normalizer;extChecker;constructor(t,e){this.normalizer=t||new Xr,this.extChecker=e||new Jr}parse(t,e){let n=e;n&&""!==n||(n="/");const r=this.normalizer.normalize(n),i=this.createPathComponents(t,r,e);return new Vr(i)}parseIdentity(t,e){const n=this.parse(t,e);return{identifierBase:()=>n.base()}}parseBaseAndBaseNameNoIdentifier(t,e){const n=this.parse(t,e);return[n.base(),n.baseNameNoIdentifier()]}createPathComponents(t,e,n){let r=t,i=e;if(e.startsWith("/")){const n=e.split("/").filter(t=>t.length>0);if(n.length>0){const e=n[0];["static","layouts","themes","archetypes","data","i18n","assets"].includes(e)&&"content"===t&&(r=e),["images","assets","static","css","js","fonts"].includes(e)&&"content"===t&&(r="static")}}const s=i.lastIndexOf("/"),a=s>=0?i.substring(s+1):i;s>=0&&i.substring(0,s);let o=this.detectBundleType(a,r);const l=this.calculatePathPositions(i),c=this.extractIdentifiers(i,a);return new Hr(n,i,l,c,o,!1,r)}detectBundleType(t,e){if("content"!==e&&"archetypes"!==e)return 0;let n=t.split(".")[0];return"index"===n&&this.isContentFile(t)?3:"_index"===n&&this.isContentFile(t)?4:this.isContentFile(t)?2:0}isContentFile(t){const e=this.getFileExtension(t);return["md","html","markdown","mdown","mkd","mkdn","htm"].includes(e.toLowerCase())}getFileExtension(t){const e=t.lastIndexOf(".");return e>0&&e<t.length-1?t.substring(e+1):""}calculatePathPositions(t){let e=-1,n=-1,r=-1;for(let i=t.length-1;i>=0;i--)"/"===t[i]&&(-1===r?r=i+1:-1===n&&(n=i+1),i>0&&(e=i));return new zr(n,r,e,-1)}extractIdentifiers(t,e){const n=[],r=t.substring(0,t.length-e.length).length,i=e.split(".");if(i.length<=1)return n;let s=r+i[0].length;for(let t=1;t<i.length;t++){const e=s+1,r=e+i[t].length;n.push(new Wr(e,r)),s=r}return n}},Xr=class{constructor(t=!0,e=!0){this.toLowerCase=t,this.replaceSpaces=e}normalize(t){let e=t;return e=e.replace(/\\/g,"/"),this.toLowerCase&&(e=e.toLowerCase()),this.replaceSpaces&&(e=e.replace(/\s/g,"-")),e}},Zr=class{constructor(t=!0,e=!0){this.toLowerCase=t,this.replaceSpaces=e}normalize(t){let e=t;return e=e.replace(/\\/g,"/"),this.toLowerCase&&(e=e.toLowerCase()),this.replaceSpaces&&(e=e.replace(/\s+/g,"-")),e}},Jr=class{isContentExt(t){return jr.CONTENT_EXTENSIONS.includes(t.toLowerCase())}isHTML(t){return jr.HTML_EXTENSIONS.includes(t.toLowerCase())}hasExt(t){for(let e=t.length-1;e>=0;e--){if("."===t[e])return!0;if("/"===t[e])return!1}return!1}},Qr=class t{static parseBasic(t){const e=t.lastIndexOf("/"),n=e>=0?t.substring(0,e):"",r=e>=0?t.substring(e+1):t,i=r.lastIndexOf("."),s=i>=0?r.substring(i):"",a=i>=0?r.substring(0,i):r;return{dir:n,name:r,ext:s,nameWithoutExt:a}}static join(...t){return t.filter(t=>t.length>0).map(t=>t.replace(/^\/+|\/+$/g,"")).join("/").replace(/\/+/g,"/")}static normalizeBasic(t){return(new Zr).normalize(t)}static isBundle(e){const n=t.parseBasic(e);return jr.INDEX_NAMES.includes(n.nameWithoutExt)}static extractSection(t){const e=t.startsWith("/")?t.substring(1):t,n=e.indexOf("/");return n>=0?e.substring(0,n):e}static removeExtension(t){const e=t.lastIndexOf(".");return e>t.lastIndexOf("/")?t.substring(0,e):t}static hasExtension(t){return(new Jr).hasExt(t)}},ti=class{processor;pool;constructor(t,e){const n=t?.normalizer?{normalize:t.normalizer}:new Zr(!1!==t?.normalize,!1!==t?.replaceSpaces),r=new Jr;this.processor=new Kr(n,r),e&&(this.pool=e)}create(t,e,n){return this.pool&&this.pool.get(),this.processor.parse(t,e)}createFromComponents(t){return new Vr(t)}createMany(t,e,n){return e.map(e=>this.create(t,e,n))}createWithConfig(t,e,n){const r={};return void 0!==n?.toLowerCase&&(r.normalize=n.toLowerCase),void 0!==n?.replaceSpaces&&(r.replaceSpaces=n.replaceSpaces),void 0!==n?.customNormalizer&&(r.normalizer=n.customNormalizer),this.create(t,e,r)}},ei=class extends ti{constructor(){super({normalize:!0,replaceSpaces:!0})}},ni=class{pool=[];maxSize;constructor(t=100){this.maxSize=t}get(){if(this.pool.length>0)return this.pool.pop();const t=Gr.createEmpty();return new Vr(t)}put(t){this.pool.length<this.maxSize&&this.pool.push(t)}clear(){this.pool=[]}size(){return this.pool.length}},ri=class{component="";path="";config={};factory;constructor(t){this.factory=t||new ei}withComponent(t){return this.component=t,this}withPath(t){return this.path=t,this}withNormalization(t){return this.config.normalize=t,this}withSpaceReplacement(t){return this.config.replaceSpaces=t,this}withNormalizer(t){return this.config.normalizer=t,this}build(){if(!this.component||!this.path)throw new Error("Component and path must be set");return this.factory.create(this.component,this.path,this.config)}reset(){return this.component="",this.path="",this.config={},this}},ii=class t{static defaultFactory=new ei;static createContentPath(e){return t.defaultFactory.create("content",e)}static createStaticPath(e){return t.defaultFactory.create("static",e)}static createLayoutPath(e){return t.defaultFactory.create("layouts",e)}static createArchetypePath(e){return t.defaultFactory.create("archetypes",e)}static createDataPath(e){return t.defaultFactory.create("data",e)}static createThemePath(e){return t.defaultFactory.create("themes",e)}static createFromConfig(t){const e={};void 0!==t.normalize&&(e.normalize=t.normalize),void 0!==t.replaceSpaces&&(e.replaceSpaces=t.replaceSpaces);const n=new ti(e);return t.paths.map(e=>n.create(t.component,e))}static builder(){return new ri}static createWithPool(t,e,n){return new ti(void 0,n).create(t,e)}},si={createContentPath:ii.createContentPath,createStaticPath:ii.createStaticPath,createLayoutPath:ii.createLayoutPath,createArchetypePath:ii.createArchetypePath,createDataPath:ii.createDataPath,createThemePath:ii.createThemePath,builder:ii.builder,parseBasic:Qr.parseBasic,join:Qr.join,normalizeBasic:Qr.normalizeBasic,isBundle:Qr.isBundle,extractSection:Qr.extractSection,removeExtension:Qr.removeExtension,checkExtension:Qr.hasExtension,hasSpecificExtension:Yr.hasExtension,isUnder:Yr.isUnder,relativeTo:Yr.relativeTo,compare:Yr.compare,createProcessor:()=>new Kr,createFactory:()=>new ei,createPool:t=>new ni(t),createNormalizer:t=>new Zr(t?.toLowerCase,t?.replaceSpaces)},ai=N("content",{component:"translator"}),oi=class{contentLanguage;translateFuncs=new Map;constructor(t){this.contentLanguage=t}translate(t,e){const n=t.toLowerCase(),r=this.translateFuncs.get(n);if(r){const t=r(e);if(t)return t}ai.info(`Translation func for language ${t} not found, use default.`);const i=this.translateFuncs.get(this.contentLanguage.toLowerCase());if(i){const t=i(e);if(t)return t}return ai.info("i18n not initialized; if you need string translations, check that you have a bundle in /i18n that matches the site language or the default language."),`[i18n] ${e}`}async setupTranslateFuncs(t){try{await t.walkI18n("",{walkFn:async(t,e)=>{if(t.endsWith(".yaml")||t.endsWith(".yml"))try{const n=(jr.normalizePath(t).split("/").pop()||"").replace(/\.(yaml|yml)$/,"").toLowerCase(),r=await this.readI18nFile(e),i=this.parseI18nContent(r),s=new Map;i.forEach(t=>{s.set(t.id,t.translation)});const a=t=>s.get(t)||(ai.warn(`i18n|MISSING_TRANSLATION|${n}|${t}`),"");this.translateFuncs.set(n,a),ai.info(`✅ Loaded i18n translations for language: ${n} (${i.length} items)`)}catch(e){ai.error(`❌ Failed to load i18n file ${t}:`,e)}}},{}),ai.info(`🌍 Translation setup complete. Loaded ${this.translateFuncs.size} languages: [${Array.from(this.translateFuncs.keys()).join(", ")}]`)}catch(t){throw t}}async readI18nFile(t){let e=null;try{e=await t.open();const n=await e.stat(),r=new Uint8Array(n.size()),i=await e.read(r),s=new TextDecoder("utf-8").decode(i.buffer);return 65279===s.charCodeAt(0)?s.slice(1):s}catch(t){throw ai.error("❌ Failed to read i18n file:",t),t}finally{if(e)try{await e.close()}catch(t){ai.warn(`Failed to close i18n file: ${t}`)}}}parseI18nContent(t){try{const e=Br.load(t);return Array.isArray(e)?e.filter(t=>t&&"object"==typeof t&&t.id&&t.translation).map(t=>({id:String(t.id),translation:String(t.translation)})):(ai.warn("i18n YAML content is not an array"),[])}catch(t){return ai.error("❌ Failed to parse i18n YAML content:",t),[]}}getAvailableLanguages(){return Array.from(this.translateFuncs.keys())}hasLanguage(t){return this.translateFuncs.has(t.toLowerCase())}};j();var li=N("content",{component:"content"});var ci={[Xe]:Xe,[Ze]:Ze,[Je]:Je,[Qe]:Qe,[tn]:tn,[nn]:"404",[en]:en,taxonomyterm:Qe};function hi(t){return ci[t.toLowerCase()]||""}j(),N("content",{component:"identity"});var ui=class{id;lang;langIdx;stale=!0;constructor(t,e="",n=0){this.id=t,this.lang=e,this.langIdx=n}ID(){return this.id}identifierBase(){return`${this.id}-${this.lang}`}pageLanguage(){return this.lang}pageLanguageIndex(){return this.langIdx}pageIdentity(){return this}markStale(){this.stale||(this.stale=!0)}isStale(){return this.stale}clearStale(){this.stale&&(this.stale=!1)}},fi=m(require("crypto")),di=m(require("path"));j(),N("content",{component:"FileInfo"});var pi=new Set([".md"]),gi=class t{fileMetaInfo;pathInfo;bundleType;uniqueIDCache;lazyInitDone=!1;constructor(t,e){this.fileMetaInfo=t;const n=si.createProcessor();this.pathInfo=n.parse(jr.COMPONENT_FOLDER_CONTENT,e),this.bundleType=0,this.determineBundleType()}static newFileInfo(e){const n=jr.normalizePath(e.relativeFilename());return new t(e,n)}pageFile(){return this}shiftToResource(){this.isContent()&&(this.bundleType=1)}relPath(){const t=this.pathInfo.dir(),e=t.startsWith("/")?t.substring(1):t;return di.join(e,this.pathInfo.name())}section(){return this.pathInfo.section()}isZero(){return null==this.fileMetaInfo}filename(){return this.fileMetaInfo.fileName()}dir(){return this.pathToDir(this.pathInfo.dir())}ext(){return this.pathInfo.ext()}logicalName(){return this.pathInfo.name()}originalBaseFileName(){return this.pathInfo.originalNameNoExt()}baseFileName(){return this.pathInfo.nameNoExt()}translationBaseName(){return this.pathInfo.nameNoIdentifier()}contentBaseName(){return this.pathInfo.baseNameNoIdentifier()}baseNameNoIdentifier(){return this.pathInfo.baseNameNoIdentifier()}root(){return this.pathInfo.dir()||"/"}uniqueID(){return this.init(),this.uniqueIDCache}fileInfo(){return this.fileMetaInfo}type(){const t=this.section();return""!==t?t:"page"}async open(){return await this.fileMetaInfo.open()}paths(){return this.pathInfo}path(){return this.pathInfo.path()}toString(){return this.baseFileName()}getBundleType(){return this.bundleType}isBundle(){return this.bundleType>=3}isLeafBundle(){return 3===this.bundleType}isBranchBundle(){return 4===this.bundleType}isContentResource(){return 1===this.bundleType}isContent(){return this.bundleType>=1}init(){if(!this.lazyInitDone){this.lazyInitDone=!0;const t=this.relPath().replace(/\\/g,"/");this.uniqueIDCache=fi.createHash("md5").update(t).digest("hex")}}pathToDir(t){return""===t?t:di.normalize(t.substring(1)+"/")}determineBundleType(){var t;if(t=this.pathInfo.ext(),pi.has(t))switch(this.pathInfo.nameNoIdentifier()){case"index":this.bundleType=3;break;case"_index":this.bundleType=4;break;default:this.bundleType=2}}};function mi(t){return gi.newFileInfo(t)}function wi(t){yi(vi).sort(t)}function yi(t){return new bi(t)}var bi=class{constructor(t){this.by=t}sort(t){!function(t,e){const n=Array.from({length:e.len()},(t,e)=>e);n.sort((t,n)=>e.less(t,n)?-1:e.less(n,t)?1:t-n);const r=[...t];for(let e=0;e<n.length;e++)t[e]=r[n[e]]}(t,new Ti(t,this.by))}},vi=(t,e)=>Si(t=>t.title(),t,e)<0,Ei=(t,e)=>Si(t=>t.pageIdentity().pageLanguage(),t,e)<0,ki=(t,e)=>t.pageWeight()<e.pageWeight(),Si=(t,e,n)=>{const r=t(e),i=t(n);return r<i?-1:r>i?1:0},Ti=class{constructor(t,e){this.pages=t,this.by=e}len(){return this.pages.length}swap(t,e){[this.pages[t],this.pages[e]]=[this.pages[e],this.pages[t]]}less(t,e){return this.by(this.pages[t],this.pages[e])}},xi=class{static toString(t){return null==t?"":"string"==typeof t?t:"number"==typeof t||"boolean"==typeof t?t.toString():String(t)}static toInt(t){if(null==t)return 0;if("number"==typeof t)return Math.floor(t);if("string"==typeof t){const e=parseInt(t,10);return isNaN(e)?0:e}return 0}static toTime(t){if(null==t)return new Date;if(t instanceof Date)return t;if("string"==typeof t){const e=new Date(t);return isNaN(e.getTime())?new Date:e}return"number"==typeof t?new Date(t):new Date}},Ai=class{static sliceToLower(t){return t.map(t=>t.toLowerCase())}},Ci=class{static toStringSlicePreserveString(t){return null==t?null:Array.isArray(t)?t.map(t=>xi.toString(t)):"string"==typeof t?[t]:[xi.toString(t)]}},Di=m(require("path")),Pi=class{params;langSvc;taxonomySvc;constructor(t,e,n){this.params=t,this.langSvc=e,this.taxonomySvc=n}async parse(t){const e={terms:{},params:this.params,path:"",lang:"",kind:"",title:"",description:"",weight:0};try{await this.parseCustomized(e)}catch(t){throw t}try{await this.parseTerms(e)}catch(t){throw t}try{await this.parseTitle(e)}catch(t){throw t}try{await this.parseDescription(e)}catch(t){throw t}try{await this.parseWeight(e)}catch(t){throw t}try{await this.parseDate(e)}catch(t){throw t}try{await this.parseOrganization(e,t)}catch(t){throw t}try{await this.parseAuthor(e,t)}catch(t){throw t}try{await this.parseMenu(e)}catch(t){throw t}return e}async parseDate(t){if(this.params){const e=this.params.date;null!=e&&(t.date=xi.toTime(e))}}async parseWeight(t){if(t.weight=1e4,this.params){const e=this.params.weight;null!=e&&(t.weight=xi.toInt(e))}}async parseTitle(t){if(this.params){const e=this.params.title;null!=e&&(t.title=xi.toString(e))}}async parseDescription(t){if(this.params){const e=this.params.description;null!=e&&(t.description=xi.toString(e))}}async parseCustomized(t){if(!this.params)return;const e=this.params.path;null!=e&&(t.path=this.toSlashPreserveLeading(xi.toString(e)));const n=this.params.lang;if(null!=n){const e=xi.toString(n).toLowerCase();this.langSvc.isLanguageValid(e)&&(t.lang=e)}const r=this.params.kind;if(null!=r){const e=xi.toString(r);if(""!==e){const n=hi(e);if(""===n)throw new Error(`unknown kind "${e}" in front matter`);t.kind=n}}}async parseTerms(t){const e=this.taxonomySvc.views();for(const n of e){const e=Ci.toStringSlicePreserveString(Ri(this.params||{},n.plural(),!1));null!==e&&(t.terms[n.plural()]=e)}}async parseOrganization(t,e){if(!this.params)return;const n=this.params.organization;if(!n||"object"!=typeof n)return;const r={};void 0!==n.name&&null!==n.name&&(r.name=xi.toString(n.name)),void 0!==n.description&&null!==n.description&&(r.description=xi.toString(n.description)),void 0!==n.vision&&null!==n.vision&&(r.vision=xi.toString(n.vision)),void 0!==n.website&&null!==n.website&&(r.website=xi.toString(n.website)),void 0!==n.logo&&null!==n.logo&&(r.logo=Di.default.join(e,xi.toString(n.logo)));const i=this.parseContact(n.contact);i&&(r.contact=i);const s=this.parseSocial(n.social);s&&(r.social=s),Object.keys(r).length>0&&(t.organization=r)}async parseMenu(t){if(!this.params)return;const e=this.params.menu;if(!e||"object"!=typeof e)return;const n={};for(const[t,r]of Object.entries(e))if(!1!==r){if(Array.isArray(r)){const e=this.parseMenuItems(r);e.length>0&&(n[t]=e)}else if(r&&"object"==typeof r){const e={};for(const[t,n]of Object.entries(r))if(!1===n)e[t]=!1;else if(Array.isArray(n)){const r=this.parseMenuItems(n);r.length>0&&(e[t]=r)}Object.keys(e).length>0&&(n[t]=e)}}else n[t]=!1;Object.keys(n).length>0&&(t.menu=n)}parseMenuItems(t){const e=[];for(const n of t){if(!n||"object"!=typeof n)continue;const t={title:"",url:""};if(void 0!==n.title&&null!==n.title&&(t.title=xi.toString(n.title),void 0!==n.url&&null!==n.url)){{const e=xi.toString(n.url);t.url=""===e?"":e}if(void 0!==n.weight&&null!==n.weight&&(t.weight=xi.toInt(n.weight)),Array.isArray(n.children)){const e=this.parseMenuItems(n.children);e.length>0&&(t.children=e)}e.push(t)}}return e}async parseAuthor(t,e){if(!this.params)return;const n=this.params.author;if(!n||"object"!=typeof n)return;const r={};void 0!==n.name&&null!==n.name&&(r.name=xi.toString(n.name)),void 0!==n.description&&null!==n.description&&(r.description=xi.toString(n.description)),void 0!==n.website&&null!==n.website&&(r.website=xi.toString(n.website)),void 0!==n.avatar&&null!==n.avatar&&(r.avatar=Di.default.join(e,xi.toString(n.avatar)));const i=this.parseContact(n.contact);i&&(r.contact=i);const s=this.parseSocial(n.social);s&&(r.social=s),Object.keys(r).length>0&&(t.author=r)}parseContact(t){if(!t||"object"!=typeof t)return null;const e={};return void 0!==t.email&&null!==t.email&&(e.email=xi.toString(t.email)),void 0!==t.address&&null!==t.address&&(e.address=xi.toString(t.address)),void 0!==t.phone&&null!==t.phone&&(e.phone=xi.toString(t.phone)),Object.keys(e).length>0?e:null}parseSocial(t){if(!t||"object"!=typeof t)return null;const e={},n=["github","twitter","linkedin"];for(const r of n)void 0!==t[r]&&null!==t[r]&&(e[r]=xi.toString(t[r]));for(const[r,i]of Object.entries(t))n.includes(r)||null==i||(e[r]=xi.toString(i));return Object.keys(e).length>0?e:null}toSlashPreserveLeading(t){return t.replace(/\\/g,"/")}};function Li(t,e){return Ri(t,e,!0)}function Ri(t,e,n){const r=t[e.toLowerCase()];if(null==r)return null;switch(typeof r){case"boolean":return r;case"string":return n?r.toLowerCase():r;case"number":return Number.isInteger(r)?xi.toInt(r):r;default:return r instanceof Date?r:Array.isArray(r)&&r.every(t=>"string"==typeof t)&&n?Ai.sliceToLower(r):r}}var Ni=t=>{if(0===t)throw new Error("dimension flag not set");return t-1},_i=class{key;val;constructor(t,e){this.key=t,this.val=e}},Oi=class{label;node;constructor(t,e){this.label=t,this.node=e}},Ii=class{leaf=null;prefix="";edges=[];isLeaf(){return null!==this.leaf}addEdge(t){const e=this.edges.length;let n=0;for(;n<e&&this.edges[n].label<t.label;)n++;this.edges.splice(n,0,t)}updateEdge(t,e){const n=this.edges.length;let r=0;for(;r<n&&this.edges[r].label<t;)r++;if(!(r<n&&this.edges[r].label===t))throw new Error("replacing missing edge");this.edges[r].node=e}getEdge(t){const e=this.edges.length;let n=0;for(;n<e&&this.edges[n].label<t;)n++;return n<e&&this.edges[n].label===t?this.edges[n].node:null}delEdge(t){const e=this.edges.length;let n=0;for(;n<e&&this.edges[n].label<t;)n++;n<e&&this.edges[n].label===t&&this.edges.splice(n,1)}mergeChild(){const t=this.edges[0].node;this.prefix=this.prefix+t.prefix,this.leaf=t.leaf,this.edges=t.edges}};function Mi(t,e){const n=Math.min(t.length,e.length);let r=0;for(r=0;r<n&&t[r]===e[r];r++);return r}var Fi=class t{root;size;constructor(){this.root=new Ii,this.size=0}static newFromMap(e){const n=new t;if(e)if(e instanceof Map)e.forEach((t,e)=>{n.insert(e,t)});else for(const[t,r]of Object.entries(e))n.insert(t,r);return n}len(){return this.size}insert(t,e){let n=null,r=this.root,i=t;for(;;){if(0===i.length){if(r.isLeaf()){const t=r.leaf.val;return r.leaf.val=e,[t,!0]}return r.leaf=new _i(t,e),this.size++,[void 0,!1]}if(n=r,r=r.getEdge(i.charCodeAt(0)),null===r){const r=new Oi(i.charCodeAt(0),new Ii);return r.node.leaf=new _i(t,e),r.node.prefix=i,n.addEdge(r),this.size++,[void 0,!1]}const s=Mi(i,r.prefix);if(s===r.prefix.length){i=i.substring(s);continue}this.size++;const a=new Ii;a.prefix=i.substring(0,s),n.updateEdge(i.charCodeAt(0),a),a.addEdge(new Oi(r.prefix.charCodeAt(s),r)),r.prefix=r.prefix.substring(s);const o=new _i(t,e);if(i=i.substring(s),0===i.length)return a.leaf=o,[void 0,!1];const l=new Ii;return l.leaf=o,l.prefix=i,a.addEdge(new Oi(i.charCodeAt(0),l)),[void 0,!1]}}delete(t){let e=null,n=0,r=this.root,i=t;for(;;){if(0===i.length){if(!r.isLeaf())break;const t=r.leaf;return r.leaf=null,this.size--,null!==e&&0===r.edges.length&&e.delEdge(n),r!==this.root&&1===r.edges.length&&r.mergeChild(),null===e||e===this.root||1!==e.edges.length||e.isLeaf()||e.mergeChild(),[t.val,!0]}if(e=r,n=i.charCodeAt(0),r=r.getEdge(n),null===r)break;if(!i.startsWith(r.prefix))break;i=i.substring(r.prefix.length)}return[void 0,!1]}async deletePrefix(t){return await this.W(null,this.root,t)}async W(t,e,n){if(0===n.length){let n=0;return await $i(e,(t,e)=>(n++,Promise.resolve(!1))),e.isLeaf()&&(e.leaf=null),e.edges=[],null===t||t===this.root||1!==t.edges.length||t.isLeaf()||t.mergeChild(),this.size-=n,n}const r=n.charCodeAt(0),i=e.getEdge(r);return null===i||!i.prefix.startsWith(n)&&!n.startsWith(i.prefix)?0:(n=i.prefix.length>n.length?n.substring(n.length):n.substring(i.prefix.length),this.W(e,i,n))}get(t){let e=this.root,n=t;for(;;){if(0===n.length){if(e.isLeaf())return[e.leaf.val,!0];break}if(e=e.getEdge(n.charCodeAt(0)),null===e)break;if(!n.startsWith(e.prefix))break;n=n.substring(e.prefix.length)}return[void 0,!1]}longestPrefix(t){let e=null,n=this.root,r=t;for(;n.isLeaf()&&(e=n.leaf),0!==r.length&&(n=n.getEdge(r.charCodeAt(0)),null!==n)&&r.startsWith(n.prefix);)r=r.substring(n.prefix.length);return null!==e?[e.key,e.val,!0]:["",void 0,!1]}minimum(){let t=this.root;for(;;){if(t.isLeaf())return[t.leaf.key,t.leaf.val,!0];if(!(t.edges.length>0))break;t=t.edges[0].node}return["",void 0,!1]}maximum(){let t=this.root;for(;;){const e=t.edges.length;if(!(e>0)){if(t.isLeaf())return[t.leaf.key,t.leaf.val,!0];break}t=t.edges[e-1].node}return["",void 0,!1]}async walk(t){await $i(this.root,t)}async walkPrefix(t,e){let n=this.root,r=t;for(;;){if(0===r.length)return void await $i(n,e);if(n=n.getEdge(r.charCodeAt(0)),null===n)return;if(!r.startsWith(n.prefix))return void(n.prefix.startsWith(r)&&await $i(n,e));r=r.substring(n.prefix.length)}}async walkPath(t,e){let n=this.root,r=t;for(;;){if(null!==n.leaf&&await e(n.leaf.key,n.leaf.val))return;if(0===r.length)return;if(n=n.getEdge(r.charCodeAt(0)),null===n)return;if(!r.startsWith(n.prefix))break;r=r.substring(n.prefix.length)}}async toMap(){const t={};return await this.walk((e,n)=>(t[e]=n,Promise.resolve(!1))),t}};async function $i(t,e){if(null!==t.leaf&&await e(t.leaf.key,t.leaf.val))return!0;let n=0,r=t.edges.length;for(;n<r;){const i=t.edges[n];if(await $i(i.node,e))return!0;if(0===t.edges.length)return $i(t,e);t.edges.length>=r&&n++,r=t.edges.length}return!1}var Ui=class{trees;constructor(t){this.trees=t}walkPrefixRaw(t,e){for(const n of this.trees)n.walkPrefixRaw(t,e)}},Bi=class{trees;constructor(t){this.trees=t}delete(t){for(const e of this.trees)e.delete(t)}deleteAll(t){for(const e of this.trees)e.deleteAll(t)}async deletePrefix(t){let e=0;for(const n of this.trees)e+=await n.deletePrefix(t);return Promise.resolve(e)}async deletePrefixAll(t){let e=0;for(const n of this.trees)e+=await n.deletePrefixAll(t);return e}lock(t){const e=this.trees.map(e=>e.lock(t));return()=>{for(const t of e)t()}}canLock(){for(const t of this.trees)if(!t.canLock())return!1;return!0}};function qi(t){return"/"===t?"":t}function ji(t){const e=function(t){return""===t?null:t.length<2?new Error(`too short key: "${t}"`):"/"!==t[0]?new Error(`key must start with '/': "${t}"`):"/"===t[t.length-1]?new Error(`key must not end with '/': "${t}"`):null}(t);if(e)throw e;return t}function Hi(){return new zi}var zi=class{mu;tree;zero;constructor(){this.tree=new Fi,this.zero=void 0;let t=!1,e=0;this.mu={lock:()=>{for(;t||e>0;);t=!0},unlock:()=>{t=!1},rLock:()=>{for(;t;);e++},rUnlock:()=>{e--}}}get(t){this.mu.rLock();try{const[e,n]=this.tree.get(t);return n?e:this.zero}finally{this.mu.rUnlock()}}longestPrefix(t){this.mu.rLock();try{const[e,n,r]=this.tree.longestPrefix(t);return r?[e,n]:["",this.zero]}finally{this.mu.rUnlock()}}insert(t,e){this.mu.lock();try{return this.tree.insert(t,e),e}finally{this.mu.unlock()}}async walkPrefix(t,e,n){switch(t){case 0:break;case 1:this.mu.rLock();break;case 2:this.mu.lock()}try{let t=null;return await this.tree.walkPrefix(e,async(e,r)=>{const[i,s]=n(e,r);return s?(t=s,Promise.resolve(!0)):i}),t}finally{switch(t){case 0:break;case 1:this.mu.rUnlock();break;case 2:this.mu.unlock()}}}},Wi=class t{d;v;trees;constructor(t,e){if(e<=0)throw new Error("length must be > 0");this.d=t,this.v=0,this.trees=[];for(let t=0;t<e;t++)this.trees.push(Hi())}static newTreeShiftTree(e,n){return new t(e,n)}shape(e,n){if(e!==this.d)throw new Error("dimension mismatch");if(n>=this.trees.length)throw new Error("value out of range");const r=Object.create(t.prototype);return Object.assign(r,this),r.v=n,r}get(t){return this.trees[this.v].get(t)}longestPrefix(t){return this.trees[this.v].longestPrefix(t)}insert(t,e){return this.trees[this.v].insert(t,e)}async walkPrefix(t,e,n){return await this.trees[this.v].walkPrefix(t,e,n)}delete(t){for(const e of this.trees)e.tree.delete(t)}async deletePrefix(t){let e=0;for(const n of this.trees)e+=await n.tree.deletePrefix(t);return e}lock(t){if(t){for(const t of this.trees)t.mu.lock();return()=>{for(const t of this.trees)t.mu.unlock()}}for(const t of this.trees)t.mu.rLock();return()=>{for(const t of this.trees)t.mu.rUnlock()}}},Gi=class t{tree;dims;shifter;mu;constructor(t){if(!t.shifter)throw new Error("Shifter is required");this.shifter=t.shifter,this.tree=new Fi,this.dims=[0];let e=!1,n=0;this.mu={lock:()=>{for(;e||n>0;);e=!0},unlock:()=>{e=!1},rLock:()=>{for(;e;);n++},rUnlock:()=>{n--},tryLock:()=>!(e||n>0||(e=!0,0))}}static new(e){return new t(e)}delete(t){this.deleteInternal(t)}async deleteAll(t){await this.tree.walkPrefix(t,(t,e)=>{const[n,r]=this.tree.delete(t);return Promise.resolve(!1)})}async deletePrefix(t){let e=0;const n=[];await this.tree.walkPrefix(t,(t,e)=>(n.push(t),Promise.resolve(!1)));for(const t of n)this.deleteInternal(t)&&e++;return e}deleteInternal(t){let e=!1;const[n,r]=this.tree.get(t);if(r){const[r,i]=this.shifter.delete(n,this.dims);e=r,i&&this.tree.delete(t)}return e}async deletePrefixAll(t){let e=0;return await this.tree.walkPrefix(t,(t,n)=>{const[r,i]=this.tree.delete(t);return i&&e++,Promise.resolve(!1)}),e}increment(t){return this.shape(t,this.dims[t]+1)}insertIntoCurrentDimension(t,e){t=ji(qi(t));const[n,r]=this.tree.get(t);return r&&(e=this.shifter.insertInto(n,e,this.dims)),this.tree.insert(t,e),[e,!0]}insertIntoValuesDimension(t,e){t=ji(qi(t));const[n,r]=this.tree.get(t);return r&&(e=this.shifter.insert(n,e)),this.tree.insert(t,e),[e,!0]}insertRawWithLock(t,e){this.mu.lock();try{return this.tree.insert(t,e)}finally{this.mu.unlock()}}insertWithLock(t,e){this.mu.lock();try{return this.insertIntoValuesDimension(t,e)}finally{this.mu.unlock()}}len(){return this.tree.len()}canLock(){const t=this.mu.tryLock();return t&&this.mu.unlock(),t}lock(t){return t?this.mu.lock():this.mu.rLock(),()=>{t?this.mu.unlock():this.mu.rUnlock()}}longestPrefix(t,e,n){let r=t;for(;;){const[t,i,s]=this.tree.longestPrefix(r);if(s){const[r,s]=this.shift(i,e);if(s&&(!n||n(r)))return[t,r]}if(""===r||"/"===r)return["",void 0];const a=r.lastIndexOf("/");if(0===a)r="";else{if(!(a>0))break;r=r.substring(0,a)}}return["",void 0]}longestPrefixAll(t){const[e,,n]=this.tree.longestPrefix(t);return[e,n]}getRaw(t){const[e,n]=this.tree.get(t);return n?[e,!0]:[void 0,!1]}async walkPrefixRaw(t,e){await this.tree.walkPrefix(t,(t,n)=>e(t,n))}shape(t,e){const n=this.clone();return n.dims[t]=e,n}toString(){return`Root{${this.dims}}`}get(t){const[e]=this.getInternal(t);return e}forEachInDimension(t,e,n){t=qi(t);const[r,i]=this.tree.get(t);i&&this.shifter.forEachInDimension(r,e,n)}has(t){const[,e]=this.getInternal(t);return e}clone(){const e=Object.create(t.prototype);return Object.assign(e,this),e.dims=[...this.dims],e}shift(t,e){const[n,r]=this.shifter.shift(t,this.dims,e);return[n,r]}getInternal(t){t=qi(t);const[e,n]=this.tree.get(t);if(!n)return[void 0,!1];const[r,i]=this.shift(e,!0);return[r,i]}},Vi=class t{tree;handle;prefix;lockType;noShift;exact;debug;walkContext;skipPrefixes=[];constructor(t){if(!t.tree)throw new Error("Tree is required");this.tree=t.tree,this.handle=t.handle,this.prefix=t.prefix||"",this.lockType=t.lockType||0,this.noShift=t.noShift||!1,this.exact=t.exact||!1,this.debug=t.debug||!1,this.walkContext=t.walkContext}extend(){const e=new t({tree:this.tree,handle:this.handle,prefix:this.prefix,lockType:this.lockType,noShift:this.noShift,exact:this.exact,debug:this.debug,walkContext:this.walkContext});return e.resetLocalState(),e}skipPrefix(...t){this.skipPrefixes.push(...t)}shouldSkip(t){for(const e of this.skipPrefixes)if(t.startsWith(e))return!0;return!1}async walk(){this.resetLocalState();let t=null;this.lockType>0&&(t=this.tree.lock(2===this.lockType));try{let t=null;const e=async(e,n)=>{if(this.shouldSkip(e))return!1;const[r,i,s]=this.toT(this.tree,n);if(!i)return!1;const[a,o]=await this.handle(e,r,s);return!(!a&&!o||(t=o,0))};return""!==this.prefix?await this.tree.tree.walkPrefix(this.prefix,e):await this.tree.tree.walk(e),t}finally{t&&t()}}resetLocalState(){this.skipPrefixes=[]}toT(t,e){if(this.noShift)return[e,!0,2];{const[n,r,i]=t.shifter.shift(e,t.dims,this.exact);return[n,r,i]}}},Yi=class{delete(t,e){return[t.delete(e[Ni(1)]),t.isEmpty()]}shift(t,e,n){const[r,i]=t.shift(e[Ni(1)],n);return null!==r?i?[r,!0,1]:[r,!0,2]:[new Ji,!1,2]}forEachInDimension(t,e,n){if(e!==Ni(1))throw new Error("only language dimension supported");n(t)}insertInto(t,e,n){return t.mergeWithLang(e,n[Ni(1)])}insert(t,e){return t.merge(e)}},Ki=class extends Yi{shift(t,e,n){const[r,i]=t.shift(e[Ni(1)],n);return null!==r&&i?[r,!0,1]:[new Ji,!1,2]}},Xi=class extends Yi{shift(t,e,n){const[r,i]=t.shift(e[Ni(1)],n);return null!==r?i?[r,!0,1]:[r,!0,2]:[new Ji,!1,2]}},Zi=class{pageTreesNodeInstance;term;constructor(t,e){this.pageTreesNodeInstance=t,this.term=e}getPage(){return this.pageTreesNodeInstance.getPage()}getPages(){return this.pageTreesNodeInstance.getPages()}getResource(){return this.pageTreesNodeInstance.getResource()}isEmpty(){return this.pageTreesNodeInstance.isEmpty()}shift(t,e){return this.pageTreesNodeInstance.shift(t,e)}},Ji=class{nodes;constructor(){this.nodes=new Map}setNode(t,e){this.nodes.set(t,e)}merge(t){const e=new Map;for(const t of this.nodes.keys())e.set(t.pageLanguage(),t);for(const[n,r]of t.nodes.entries()){const t=e.get(n.pageLanguage());t?this.nodes.set(t,r):this.nodes.set(n,r)}return this}mergeWithLang(t,e){const n=new Map;for(const t of this.nodes.keys())n.set(t.pageLanguage(),t);for(const[r,i]of t.nodes.entries()){const t=n.get(r.pageLanguage());if(t){const n=this.nodes.get(t);n&&n.pageIdentity().pageLanguageIndex()===e&&this.remove(t)}this.nodes.set(r,i)}return this}remove(t){const e=this.nodes.get(t);return!!e&&(this.markStale(e),this.nodes.delete(t),!0)}delete(t){for(const[e,n]of this.nodes.entries())if(n.pageIdentity().pageLanguageIndex()===t)return this.remove(e);return!1}isEmpty(){return 0===this.nodes.size}shift(t,e){let n=null;for(const[e,r]of this.nodes.entries())if(null===n&&(n=r),r.pageIdentity().pageLanguageIndex()===t)return[ts(r),!0];return null===n||e?[null,!1]:[ts(n),!1]}getPage(){for(const t of this.nodes.values())if(t&&"function"==typeof t.kind)return[t,!0];return[null,!1]}getPages(){const t=[];for(const e of this.nodes.values())e&&"function"==typeof e.kind&&t.push(e);return t}getResource(){for(const t of this.nodes.values())return[t,!0];return[null,!1]}markStale(t){"staleVersions"in t&&t.staleVersions}},Qi=class{treePages;treeResources;treePagesResources;treeTaxonomyEntries;resourceTrees;constructor(){this.treePages=new Gi({shifter:new Ki}),this.treeResources=new Gi({shifter:new Xi}),this.treeTaxonomyEntries=Wi.newTreeShiftTree(0,10),this.treePagesResources=new Ui([]),this.resourceTrees=new Bi([]),this.treePagesResources=new Ui([this.treePages,this.treeResources]),this.resourceTrees=new Bi([this.treeResources])}createMutableTrees(){this.treePagesResources=new Ui([this.treePages,this.treeResources]),this.resourceTrees=new Bi([this.treeResources])}get TreePages(){return this.treePages}get TreeResources(){return this.treeResources}get TreePagesResources(){return this.treePagesResources}get TreeTaxonomyEntries(){return this.treeTaxonomyEntries}get ResourceTrees(){return this.resourceTrees}};function ts(t){const e=new Ji;return t&&e.setNode(t.pageIdentity(),t),e}j();var es=0,ns=N("content",{component:"pagesource"}),rs=class{id;identity;file;constructor(t){this.id=(++es).toString(),this.identity=new ui(es),this.file=t}sourceKey(){return`${this.identity.lang}/${this.file.filename()}`.replace(/\\/g,"/")}async contentSource(){return await this.readSourceAll()}async readSourceAll(){try{const t=await this.file.open(),e=await t.stat(),n=new Uint8Array(e.size()),r=await t.read(n);return await t.close(),r.buffer}catch(t){const e=t instanceof Error?t.message:String(t);throw new Error(`Failed to read file content: ${e}`)}}async posOffset(t){try{const e=await this.contentSource();return function(t,e,n){if(n<0)return{filename:t,lineNumber:0,columnNumber:0,offset:0};const r=e.slice(0,n);let i=1;for(let t=0;t<r.length;t++)10===r[t]&&i++;let s=-1;for(let t=r.length-1;t>=0;t--)if(10===r[t]){s=t;break}return{filename:t,lineNumber:i,columnNumber:n-s,offset:n}}(this.file.filename(),e,t)}catch(t){throw new Error(`failed to read content source for "${this.file.filename()}": ${t}`)}}pageIdentity(){return this.identity}pageFile(){return this.file}staleVersions(){return[]}section(){return this.file.section()}paths(){return this.file.paths()}path(){return this.file.paths().path()}slug(){return this.pathToSlug(this.path())}pathToSlug(t){let e=t.replace(/^\//,"");return e=e.replace(/\.md$/,""),e.endsWith("/index")&&(e=e.replace(/\/index$/,"")),"index"!==e&&""!==e||(e="index"),e.endsWith("/_index")&&(e=e.replace(/\/_index$/,"")),e}opener(){return()=>this.file.open()}openReader(){return{read:async()=>new Uint8Array(0)}}async content(){try{return ns.error(`Reading content not implemented from: ${this.file.filename()}`),new Uint8Array(0)}catch(t){const e=`failed to read content source for "${this.file.filename()}": ${t}`;throw ns.error(e),new Error(e)}}};function is(t){return new rs(t)}j();var ss=N("content",{component:"pagemap"});function as(t){return t.endsWith("/")||(t+="/"),t}var os=new Ji,ls=class{initOnce=!1;m=new Map;constructor(){}},cs=class{initFn;contentTreeReverseIndexMap;constructor(t){this.initFn=t,this.contentTreeReverseIndexMap=new ls}reset(){this.contentTreeReverseIndexMap=new ls}get(t){return this.contentTreeReverseIndexMap.initOnce||(this.contentTreeReverseIndexMap.m=new Map,this.initFn(this.contentTreeReverseIndexMap.m),this.contentTreeReverseIndexMap.initOnce=!0),this.contentTreeReverseIndexMap.m.get(t)||null}},hs=t=>"page"===t.kind(),us=t=>!t.shouldList||t.shouldList(!1),fs=t=>!t.shouldList||t.shouldList(!0),ds=class{path;keyPart;include;constructor(t,e,n=us){this.path=t,this.keyPart=e,this.include=n}key(){return this.path+"/"+this.keyPart}},ps=class extends ds{recursive;includeSelf;index;constructor(t,e,n,r,i,s){super(t,e,s),this.recursive=n,this.includeSelf=r,this.index=i}key(){return"gagesInSection/"+super.key()+"/"+this.recursive.toString()+"/"+this.index.toString()+"/"+this.includeSelf.toString()}},gs=class extends Qi{pageReverseIndex=null;pageBuilder;constructor(t){super(),this.pageBuilder=t}setupReverseIndex(){this.pageReverseIndex=new cs(async t=>{const e=new Vi({tree:this.treePages,lockType:1,handle:async(e,n,r)=>{if(n){const[e,r]=n.getPage();if(!r)return[!1,null];e.pageFile&&e.pageFile()&&((e,n)=>{const r=t.get(e);r&&r!==os?t.set(e,os):r||t.set(e,n)})(e.paths().baseNameNoIdentifier(),n)}return[!1,null]}});try{await e.walk()}catch(t){ss.error(`setupReverseIndex error: ${t}`)}})}insertResourceNode(t,e){const n=this.treeResources,r=n.lock(!0);try{n.insertIntoValuesDimension(t,e)}finally{r()}}async addFi(t){if(t.fileInfo().isDir())return;const e=is(t),n=e.paths().base();switch(e.file.getBundleType()){case 0:this.insertResourceNode(n,ts(e));break;case 1:const t=await this.pageBuilder.withSource(e).build();if(!t)return;this.insertResourceNode(n,ts(t));break;default:const r=await this.pageBuilder.withSource(e).build();this.treePages.insertWithLock(e.paths().base(),ts(r))}}async assemble(){await this.assembleStructurePages(),await this.applyAggregates(),await this.cleanPages(),await this.assembleTerms()}async assembleTerms(){for(const t of this.pageBuilder.langSvc.languageIndexes()){const e=this.treePages.shape(0,t),n=this.treeTaxonomyEntries.shape(0,t);await this.pageBuilder.term.assemble(e,n,this.pageBuilder,t)}}async cleanPages(){}async applyAggregates(){}async assembleStructurePages(){await this.addMissingTaxonomies();for(const t of this.pageBuilder.langSvc.languageIndexes()){const e=this.treePages.shape(0,t);await this.pageBuilder.section.assemble(e,this.pageBuilder,t)}await this.addMissingStandalone()}async addMissingTaxonomies(){const t=this.treePages.lock(!0);try{for(const t of this.pageBuilder.langSvc.languageIndexes()){const e=this.treePages.shape(0,t);await this.pageBuilder.taxonomy.assemble(e,this.pageBuilder,t)}}finally{t()}}async addMissingStandalone(){const t=this.treePages,e=t.lock(!0);try{await this.pageBuilder.standalone.assemble(t,this.pageBuilder)}finally{e()}}async getResourcesForPage(t){const e=[];return await this.forEachResourceInPage(t,0,!1,(t,n,r)=>{const[i,s]=n.getResource();return s&&e.push(i),[!1,null]}),e}async forEachResourceInPage(t,e,n,r){let i=t.paths().base();"/"===i&&(i="");const s=as(i),a="page"!==t.kind(),o=new Vi({tree:this.treeResources.shape(0,t.pageIdentity().pageLanguageIndex()),prefix:s,lockType:e,exact:n,handle:async(t,e,n)=>{if(a){const[e]=this.treePages.longestPrefixAll(t);if(e!==i&&this.pathDir(e)!==this.pathDir(t))return o.skipPrefix(e+"/"),[!1,null]}return r(t,e,n)}});try{await o.walk()}catch(t){ss.error(`forEachResourceInPage error: ${t}`)}}async getPagesInSection(t,e){const n=e.key(),r=this.treePages.shape(0,t);return this.getOrCreatePagesFromCacheSync(null,n,async t=>{const n=as(e.path),i=[];let s="";const a=e.include,o=new Vi({tree:r,prefix:n,handle:async(t,n,r)=>{if(e.recursive){const[t,e]=n.getPage();return e&&a(t)&&i.push(t),[!1,null]}const[l,c]=n.getPage();if(c&&a(l)&&i.push(l),!l.isPage||!l.isPage()){const e=t+"/";""!==s&&s===e||o.skipPrefix(e),s=e}return[!1,null]}});try{if(await o.walk(),e.includeSelf){const t=r.get(e.path);if(t){const[e,n]=t.getPage();n&&a(e)&&i.push(e)}}const t=i;return function(t){yi(ki).sort(t)}(t),Promise.resolve(t)}catch(t){ss.error(`getPagesInSection error: ${t}`)}return Promise.resolve(i)})}async getOrCreatePagesFromCacheSync(t,e,n){return await n(e)}async getPagesWithTerm(t,e){const n=e.key(),r=this.treeTaxonomyEntries.shape(0,t);return await this.getOrCreatePagesFromCacheSync(null,n,async t=>{const n=[],i=e.include;try{await r.walkPrefix(0,as(e.path),(t,e)=>{const[r,s]=e.getPage();return s&&i(r)&&n.push(r),[!1,null]});const t=n;return wi(t),t}catch(t){ss.error(`getPagesWithTerm error: ${t}`)}return n})}getTermsForPageInTaxonomy(t,e,n){const r=((i=n).startsWith("/")||(i="/"+i),i);var i;const s=this.treeTaxonomyEntries.shape(0,t);return this.getOrCreatePagesFromCacheSync(null,r+e,async t=>{const n=[];try{await s.walkPrefix(0,as(r),(t,r)=>(t.endsWith(e)&&n.push(r.term.page),[!1,null]));const t=n;return wi(t),t}catch(t){ss.error(`getTermsForPageInTaxonomy error: ${t}`)}return n})}async getSections(t,e){const n=[];let r="";const i=this.treePages.shape(0,t),s=new Vi({tree:i,prefix:e,handle:async(t,e,i)=>{const[a,o]=e.getPage();return o?(a.isPage&&a.isPage()||(""!==r&&t.startsWith(r)||(a.isSection&&a.isSection()&&a.shouldList&&a.shouldList(!1)&&a.parent&&a.parent()===a?n.push(a):s.skipPrefix(t+"/")),r=t+"/"),[!1,null]):[!1,null]}});try{await s.walk();const t=n;return wi(t),t}catch(t){ss.error(`getSections error: ${t}`)}return n}pathDir(t){const e=t.lastIndexOf("/");return-1===e?"":t.substring(0,e)}};j();var ms=N("content",{component:"pagecollector"}),ws=class{m;fs;processedPaths=new Set;constructor(t,e){this.m=t,this.fs=e}async collect(){try{const t="",e=this.fs.contentFs();for(const n of e){this.processedPaths.clear();const e=await n.stat(t);await this.collectDir(n,t,e)}}catch(t){ms.error(`Failed to collect directory: ${t}, continuing...`)}}async collectDir(t,e,n){try{await this.fs.walkContent(t,e,{hookPre:async(t,e,n)=>{const r=e;if(this.processedPaths.has(r))return ms.warn("Path already processed!",{path:r,dirName:t.name(),dirIsDir:t.isDir(),readdirLength:n.length}),[];if(this.processedPaths.add(r),0===n.length)return[];for(const t of n){if(t.isDir&&t.isDir())continue;const e=mi(t);await this.m.addFi(e)}return n},walkFn:async(t,e)=>{}},{info:n})}catch(t){throw ms.error(`Failed to collect directory: ${t}`,{path:e,rootName:n.name(),rootIsDir:n.isDir(),stack:t.stack||"No stack trace available"}),new Error(`Failed to collect directory: ${t}`)}}async handleBundleLeaf(t,e,n,r){const i=e.paths(),s=async(t,n)=>{if(n.isDir())return;const r=mi(n);n!==e.fileInfo()&&(r.isLeafBundle()&&r.paths().dir()===i.dir()||r.shiftToResource()),await this.m.addFi(r)},a=this.fs.contentFs();for(const e of a)await this.fs.walkContent(e,n,{walkFn:s},{info:t,dirEntries:r})}};j();var ys=N("content",{component:"content"}),bs=class{fs;converter;pageMap;translator;constructor(t,e,n,r){this.fs=t,this.converter=e,this.pageMap=n,this.translator=r}setTemplateSvc(t){this.pageMap.pageBuilder.templateSvc=t}async renderString(t,...e){if(e.length<1||e.length>2)throw new Error("RenderString want 1 or 2 arguments");let n=1;if(1!==e.length){const t=e[0];if("object"!=typeof t||null===t)throw new Error("first argument must be a map");throw new Error("RenderString not implemented yet")}n=0;const r=e[0],i=String(r);return mi(this.fs.newFileMetaInfoWithContent(i)),i}async collectPages(){try{await this.process(),await this.assemble()}catch(t){throw new Error(`process/assemble: ${t}`)}}async process(){try{const t=new ws(this.pageMap,this.fs);await t.collect()}catch(t){throw t}}async assemble(){try{await this.pageMap.assemble()}catch(t){throw t}}async getPageSources(t){let e=t.paths().base();return"/"===e&&(e=""),await this.pageMap.getResourcesForPage(t)}async globalPages(t){return await this.pageMap.getPagesInSection(t,new ps("","global",!0,!0,0,fs))}async globalRegularPages(){return await this.pageMap.getPagesInSection(0,new ps("","global",!0,!0,0,t=>fs(t)&&hs(t)))}async walkPages(t,e){const n=this.pageMap.treePages.shape(0,t),r=new Vi({tree:n,handle:async(t,n,r)=>{const[i,s]=n.getPage();if(!s)return[!1,null];try{await e(i)}catch(t){return[!1,t instanceof Error?t:new Error(String(t))]}return[!1,null]}});try{await r.walk()}catch(e){throw ys.error(`WalkPages failed for langIndex ${t}:`,e),e}}async walkTaxonomies(t,e){try{const n=this.pageMap.treePages.shape(0,t),r=this.pageMap.pageBuilder.taxonomy;for(const i of r.views){const s=r.pluralTreeKey(i.plural()),a=new Vi({tree:n,prefix:as(s),lockType:1,handle:async(n,r,s)=>{const[a,o]=r.getPage();if(!o)return[!1,null];if("term"===a.kind()){const r=a;if(!r.term)return[!0,new Error("term is empty")];const s=r.term.toLowerCase();try{const a=this.pageMap.treeTaxonomyEntries.shape(0,t);return await a.walkPrefix(1,as(n),(t,n)=>{const[a,o]=n.getPage();return o?(e(i.plural(),s,{weight:()=>n.term.Weight(),ordinal:()=>n.term.Ordinal(),page:()=>a,owner:()=>r}).catch(t=>{ys.error("Error in taxonomy walker:",t)}),[!1,null]):[!1,null]}),[!1,null]}catch(t){return[!0,t]}}return[!1,null]}});await a.walk()}}catch(t){throw t}}getPageFromPath(t,e){try{const n=si.createProcessor().parse(jr.COMPONENT_FOLDER_CONTENT,e);let r=this.pageMap.treePages.shape(0,t).get(n.base());if(r){const[t,e]=r.getPage();if(e)return t}return null}catch(t){return ys.error(`❌ Content.getPageFromPath error for path "${e}":`,t),null}}getPageFromFile(t,e){try{let n=this.pageMap.treePages.shape(0,t).get(e.paths().base());if(n){const[t,e]=n.getPage();if(e)return t}return null}catch(t){return ys.error(`❌ Content.getPageFromPath error for path "${e.path()}":`,t),null}}async handleChangeFiles(t){const e=[];for(const[n,r]of t)try{await this.addOrUpdateFile(r,e)}catch(t){ys.error(`Failed to process file change for ${n}:`,t)}return e}async addOrUpdateFile(t,e){if(!t.isDir())try{const n=mi(t),r=n.paths().base();r&&e.push(r),await this.pageMap.addFi(n);const i=this.getPageFromFile(0,n);i&&i.pageIdentity&&i.pageIdentity().markStale()}catch(e){throw ys.error(`Failed to add/update file in PageMap: ${t.fileName()}`,e),e}}translate(t,e){return this.translator?this.translator.translate(t,e):(ys.warn("Translator not initialized, returning fallback translation"),`[i18n] ${e}`)}getAvailableLanguages(){return this.translator?this.translator.getAvailableLanguages():[]}hasLanguageSupport(t){return!!this.translator&&this.translator.hasLanguage(t)}},vs=class{md;constructor(t){this.md=t}async convert(t,e){return this.md.render(e,t)}async parseContent(t){return this.md.parseContent(t)}async parseAndRenderContent(t,e){return this.md.parseAndRenderContent(t,e)}async prepareRender(t){return this.md.prepareRender(t)}},Es=class{rawSource;frontMatter;renderedContent="";summary="";wordCount=0;readingTime=0;toc;lazyRendered=!0;lazyRender;constructor(t){this.rawSource=t}updateWithContentResult(t){t.frontMatter&&(this.frontMatter=t.frontMatter),this.renderedContent=t.renderedContent||"",this.summary=t.summary,this.wordCount=t.wordCount||0,this.readingTime=t.readingTime||0}getRawSource(){return this.rawSource}async RenderedContent(){return await this.render(),this.renderedContent}async Summary(){return await this.render(),this.summary}async WordCount(){return await this.render(),this.wordCount}async ReadingTime(){return await this.render(),this.readingTime}async render(){return this.lazyRendered&&this.lazyRender&&(await this.lazyRender(),this.lazyRendered=!1),Promise.resolve()}isEmpty(){return!this.rawSource||0===this.rawSource.length}};function ks(t){return new Es(t)}j();var Ss=N("content",{component:"section"}),Ts=class{home;seen;fsSvc;constructor(t){this.home=null,this.seen={},this.fsSvc=t}isHome(t){return""===t}isSectionExist(t){return!(""!==t&&!this.seen[t]&&(this.seen[t]=!0,1))}async assemble(t,e,n){this.seen={};const r=new Vi({tree:t,lockType:2,handle:async(t,i,s)=>{if(!i)throw new Error("n is null");const[a,o]=i.getPage();if(!o)return[!1,null];if(this.isHome(t))return this.home=a,[!1,null];const l=a.kind();if(l!==hi("page")&&l!==hi("section"))return[!1,null];const c=a.paths().sections();for(const t of c)if(!this.isSectionExist(t))try{const i=is(mi(this.fsSvc.newFileMetaInfo("/"+t+"/_index.md"))),s=i.paths().base();if(!r.tree.get(s)){const t=await e.withSource(i).withLangIdx(n).kindBuild();r.tree.insertIntoValuesDimension(s,ts(t))}}catch(t){return[!1,t]}return[!1,null]}});try{await r.walk()}catch(t){throw Ss.error("Error walking pages:",t),t}if(!this.home&&(await this.createHome(e),this.home)){const e=this.home;t.insertWithLock(e.paths().base(),ts(e))}}async createHome(t){const e=is(mi(this.fsSvc.newFileMetaInfo("/_index.md"))),n=await t.withSource(e).kindBuild();this.home=n}},xs="_sitemap",As=class{fsSvc;constructor(t){this.fsSvc=t}async assemble(t,e){const n="/404",r=await this.addStandalone(n,e);t.insertIntoValuesDimension(n,ts(r));const i="/"+xs,s=await this.addStandalone(i,e);t.insertIntoValuesDimension(i,ts(s))}async addStandalone(t,e){const n=is(mi(this.fsSvc.newFileMetaInfo(t+".md")));return await e.withSource(n).kindBuild()}};j();var Cs=class{source;pageKind;baseName;target=null;constructor(t,e){this.source=t,this.pageKind=e,this.baseName="",this.setBasename(),this.buildTarget()}setBasename(){switch(this.pageKind){case hi("404"):this.baseName="404";break;case hi("sitemap"):this.baseName="sitemap";break;default:this.baseName=this.source.paths().baseNameNoIdentifier()||"index"}}buildTarget(){let t="",e="";const n="index";switch(this.pageKind){case hi("home"):t=`${n}.html`,e="";break;case hi("page"):const r=this.source.paths().containerDir();t=r&&"/"!==r?`${r}/${this.baseName}.html`:`/${this.baseName}.html`,e=r||"";break;case hi("section"):case hi("taxonomy"):case hi("term"):const i=this.source.paths().dir();t=i?`${i}/${n}.html`:`${n}.html`,e=i||"";break;case hi("404"):const s=this.source.paths().dir();t=s?`${s}/${this.baseName}.html`:`${this.baseName}.html`,e=s||"";break;case hi("sitemap"):const a=this.source.paths().dir();t=a?`${a}/${this.baseName}.xml`:`${this.baseName}.xml`,e=a||"";break;default:t=`${n}.html`,e=""}this.target={prefix:this.source.identity.pageLanguage(),filePath:t,subResourceBaseTarget:e}}createBasicResult(){return{bytes:()=>new Uint8Array,headers:()=>[],tableOfContents:()=>({toHTML:(t,e,n)=>""})}}output(t){return{targetFileBase:()=>{if(!this.target)return"index.html";const t=this.target.filePath,e=t.lastIndexOf("/");return e>=0?t.substring(e+1):t},targetFilePath:()=>this.target.filePath,targetSubResourceDir:()=>this.target.subResourceBaseTarget,targetPrefix:()=>this.target.prefix,content:async()=>t.content?t.content.RenderedContent():"",summary:async()=>t.content?t.content.Summary():"",tableOfContents:()=>t.content&&t.content.toc?t.content.toc.toHTML(1,6,!1):"",result:()=>this.createBasicResult(),readingTime:async()=>t.content?t.content.ReadingTime():0,wordCount:async()=>t.content?t.content.WordCount():0}}};j(),N("content",{component:"paginator"});var Ds=class{paginatedElements;G;base;total;size;constructor(t,e,n,r){if(this.paginatedElements=t,this.base=r,this.total=e,this.size=n,this.G=[],t.length>0)for(let e=0;e<t.length;e++)this.G.push(new Ps(e+1,this));else this.G.push(new Ps(1,this))}totalPages(){return this.paginatedElements.length}pagers(){return[...this.G]}getElement(t){return 0===this.paginatedElements.length?[]:this.paginatedElements[t-1]||[]}getBase(){return this.base}getPagers(){return this.G}getAllPages(){const t=[];for(const e of this.paginatedElements)t.push(...e);return t}},Ps=class{number;paginator;constructor(t,e){this.number=t,this.paginator=e}pageNumber(){return this.number}totalPages(){return this.paginator.totalPages()}url(){const t=this.pageNumber();if(t>1){const e=`/page/${t}/`;return this.pathJoin(this.paginator.getBase(),e)}return this.paginator.getBase()}pages(){return this.element()}allPages(){return this.paginator.getAllPages()}pagers(){return this.paginator.pagers()}first(){return this.paginator.getPagers()[0]}last(){const t=this.paginator.getPagers();return t[t.length-1]}hasPrev(){return this.pageNumber()>1}prev(){return this.hasPrev()?this.paginator.getPagers()[this.pageNumber()-2]:null}hasNext(){return this.pageNumber()<this.paginator.totalPages()}next(){return this.hasNext()?this.paginator.getPagers()[this.pageNumber()]:null}element(){return this.paginator.getElement(this.pageNumber())}pathJoin(t,e){return t.endsWith("/")&&(t=t.slice(0,-1)),e.startsWith("/")||(e="/"+e),t+e}},Ls=class{currentPager=null;initialized=!1;svc;page;constructor(t,e){this.svc=t,this.page=e}async current(){return this.initialized||await this.initializePaginator(),this.currentPager?this.currentPager:new Ds([],0,10,this.page.paths().base()).pagers()[0]}setCurrent(t){this.currentPager=t}async paginate(t){if(!this.initialized){const e=this.svc.pageSize();let n;n=Array.isArray(t)&&t.length>0&&"key"in t[0]?this.newPaginatorFromPageGroups(t,e,this.page.paths().base()):this.newPaginatorFromPages(t,e,this.page.paths().base()),this.currentPager=n.pagers()[0],this.initialized=!0}return this.currentPager||this.current()}async paginator(){return this.initialized||await this.initializePaginator(),this.currentPager||this.current()}async initializePaginator(){try{const t=this.svc.pageSize();let e=[];switch(this.page.kind()){case"home":e=await this.svc.globalRegularPages();break;case"term":case"taxonomy":const t=await this.page.pages();e=t?.length?Array.from({length:t.length},(e,n)=>t[n]):[];break;default:const n=await this.page.regularPages();e=n&&n.length>0?Array.from({length:n.length},(t,e)=>n[e]):await this.svc.globalRegularPages()}const n=this.page.paths().base(),r=this.newPaginatorFromPages(e,t,n);this.currentPager=r.pagers()[0],this.initialized=!0}catch(t){const e=this.page.paths().base(),n=new Ds([],0,10,e);this.currentPager=n.pagers()[0],this.initialized=!0}}newPaginatorFromPages(t,e,n){if(e<=0)throw new Error("paginator size must be positive");const r=this.splitPages(t,e);return new Ds(r,t.length,e,n)}newPaginatorFromPageGroups(t,e,n){if(e<=0)throw new Error("paginator size must be positive");const r=[];if(t&&t.length>0)for(let e=0;e<t.length;e++){const n=t[e];if(n&&n.pages){const t=n.pages();if(t)for(let e=0;e<t.length;e++)r.push(t[e])}}const i=this.splitPages(r,e);return new Ds(i,r.length,e,n)}splitPages(t,e){const n=[];for(let r=0;r<t.length;r+=e){const i=Math.min(r+e,t.length);n.push(t.slice(r,i))}return n}},Rs=class{values;constructor(){this.values=new Map}add(t,e){const n=this.values.get(t);let r;return r=void 0!==n?Array.isArray(n)?[...n,e]:"number"==typeof n&&"number"==typeof e||"string"==typeof n&&"string"==typeof e?n+e:e:e,this.values.set(t,r),""}Add(t,e){return this.add(t,e)}set(t,e){return this.values.set(t,e),""}Set(t,e){return this.set(t,e)}delete(t){return this.values.delete(t),""}get(t){return this.values.get(t)}Get(t){return this.get(t)}getValues(){return this.values}setInMap(t,e,n){let r=this.values.get(t);return r&&"object"==typeof r||(r={},this.values.set(t,r)),r[e]=n,""}};function Ns(t){const e=t.lastIndexOf("/");if(-1===e)return"";let n=t.slice(0,e+1);return n.length>1&&n.endsWith("/")&&(n=n.slice(0,-1)),n}var _s=m(require("path"));j(),N("content",{component:"page"});var Os=class{source;content;meta;layout;pagerManager;title_;description_="";kind_;pageMap;output_=null;store_=null;constructor(t,e,n,r,i="",s="page",a=null){this.source=t,this.content=e,this.meta=n,this.layout=r,this.title_=i,this.kind_=s,this.pageMap=a,this.pagerManager=new Ls({pageSize:()=>10,globalRegularPages:async()=>[]},this)}rawContent(){if(!this.content)return"";const t=this.content.getRawSource();return(new TextDecoder).decode(t)}pageIdentity(){return this.source.identity}pageFile(){return this.source.file}staleVersions(){return[]}section(){return this.source.file.section()}paths(){return this.source.file.paths()}path(){return this.source.file.paths().path()}slug(){return this.pathToSlug(this.path())}pathToSlug(t){let e=t.replace(/^\//,"");return e=e.replace(/\.md$/,""),e.endsWith("/index")&&(e=e.replace(/\/index$/,"")),"index"!==e&&""!==e||(e="index"),e.endsWith("/_index")&&(e=e.replace(/\/_index$/,"")),e}posOffset(t){return this.source.posOffset(t)}description(){return this.description_}get Description(){return this.description()}StaticURL(t){return/^(https?:)?\/\//.test(t)?t:((t=(t=_s.default.normalize(t)).replace(/\\/g,"/")).startsWith("/")&&(t=t.slice(1)),`${this.meta.pageBaseUrl().replace(/\/+$/,"")}/${t}`)}params(){return this.meta.params()}get Params(){return this.params()}store(){return this.store_||(this.store_=new Rs),this.store_}get Store(){return this.store()}scratch(){return this.store()}get Scratch(){return this.scratch()}pageBaseUrl(){return this.meta.pageBaseUrl()}pageWeight(){return this.meta.pageWeight()}pageDate(){return this.meta.pageDate()}publishDate(){return this.meta.publishDate()}async relatedKeywords(t){return this.meta.relatedKeywords(t)}shouldList(t){return this.meta.shouldList(t)}shouldListAny(){return this.meta.shouldListAny()}noLink(){return this.meta.noLink()}organization(){return this.meta.organization()}author(){return this.meta.author()}menu(){return this.meta.menu()}async current(){return await this.pagerManager.current()}setCurrent(t){this.pagerManager.setCurrent(t)}async paginator(){return await this.pagerManager.paginator()}async paginate(t){return this.pagerManager.paginate(t)}file(){return this.source.file}get Type(){return this.file().type()}name(){return this.source.file.baseFileName()}title(){return this.title_}get Title(){return this.title()}kind(){return this.kind_}isHome(){return this.kind()===hi("home")}isPage(){return this.kind()===hi("page")}isSection(){return this.kind()===hi("section")}isAncestor(t){return t.path()!==this.path()&&t.paths().base().startsWith(this.paths().base())}eq(t){return this.pageIdentity().identifierBase()===t.pageIdentity().identifierBase()}layouts(){switch(this.kind_){case hi("home"):return this.source.file.isBranchBundle()?this.layout.homeList():this.layout.home();case hi("page"):return this.layout.page(this.source.file.section(),this.source.file.baseFileName());case hi("section"):return this.layout.section(this.source.file.section());case hi("taxonomy"):return this.layout.taxonomy();case hi("term"):return this.layout.term();case hi("404"):return this.layout.standalone404();case hi("sitemap"):return this.layout.standaloneSitemap();default:return[]}}output(){return this.output_||(this.output_=new Cs(this.source,this.kind())),this.output_.output(this)}get TargetPath(){return this.output().targetFilePath()}get Summary(){return this.output().summary()}truncated(){return!0}parent(){if(this.isHome())return null;let t=this.paths().containerDir();if(""===t)return null;for(;;){const e=this.pageMap?.treePages.longestPrefix(t,!0);if(!e)return null;const[n,r]=e;if(!r)return null;const[i,s]=r.getPage();if(!i)return null;if(this.isBundled())return s?i:null;if(!i.isPage())return s?i:null;t=Ns(t)}}async Pages(){return await this.pages()}async pages(){const t=this.pageIdentity().pageLanguageIndex();switch(this.kind()){case Xe:case Je:case Ze:return await this.pageMap.getPagesInSection(t,new ps(this.paths().base(),"page-section",!1,!1,t,t=>us(t)&&(hs(t)||(t=>"section"===t.kind())(t))));case tn:return await this.pageMap.getPagesWithTerm(t,new ds(this.paths().base(),"term"));case Qe:return await this.pageMap.getPagesInSection(t,new ps(this.paths().base(),"term",!0,!1,t,t=>us(t)&&(t=>"term"===t.kind())(t)));default:return Promise.resolve([])}}prevInSection(){return null}nextInSection(){return null}sections(t){return[]}async regularPages(){const t=this.pageIdentity().pageLanguageIndex();switch(this.kind()){case Xe:case Je:case Ze:case Qe:return this.pageMap?await this.pageMap.getPagesInSection(t,new ps(this.paths().base(),"",!1,!1,t,t=>us(t)&&hs(t))):[];case tn:return this.pageMap?await this.pageMap.getPagesWithTerm(t,new ds(this.paths().base(),"",t=>us(t)&&hs(t))):[];default:return[]}}regularPagesRecursive(){return[]}async terms(t,e){return this.pageMap?this.pageMap?.getTermsForPageInTaxonomy(t,this.paths().base(),e):null}async isTranslated(){return(await this.translations()).length>0}async translations(){const t=this.path()+"/"+this.pageIdentity().pageLanguage()+"/translations";if(!this.pageMap)return[];try{return await this.pageMap.getOrCreatePagesFromCacheSync(null,t,async t=>{const e=await this.allTranslations(),n=[];for(let t=0;t<e.length;t++){const r=e.at(t);r&&!r.eq(this)&&n.push(r)}return n})}catch(t){throw t}}async allTranslations(){const t=this.path()+"/translations-all";if(!this.pageMap)return[];try{return await this.pageMap.getOrCreatePagesFromCacheSync(null,t,async t=>{const e=[];var n;return this.pageMap.treePages.forEachInDimension(this.paths().base(),Ni(1),t=>{if(null!=t){const n=t.getPages();e.push(...n)}return!1}),n=e,yi(Ei).sort(n),e})}catch(t){throw t}}isBundled(){return this.source.file.isBundle()}},Is=class extends Os{singular;constructor(t,e,n,r,i,s="",a="taxonomy",o=null){super(t,e,n,r,s,a,o),this.singular=i}params(){const t=super.params();return t.Singular=this.singular,t}},Ms=class extends Is{term;constructor(t,e,n,r,i,s,a="",o="term",l=null){super(t,e,n,r,i,a,o,l),this.term=s}params(){const t=super.params();return t.Term=this.term,t}},Fs=class{baseURL;list;parameters;weight;date;org;authorInfo;menuConfig;constructor(t,e="always",n={},r=0,i=new Date,s,a,o){this.baseURL=t,this.list=e,this.parameters=n,this.weight=r,this.date=i,this.org=s,this.authorInfo=a,this.menuConfig=o}description(){return""}params(){return this.parameters}pageBaseUrl(){return this.baseURL}pageWeight(){return this.weight}pageDate(){return this.date}publishDate(){return this.pageDate()}async relatedKeywords(t){return[]}shouldList(t){switch(this.list){case"always":default:return!0;case"never":return!1;case"local":return!t}}shouldListAny(){return this.shouldList(!0)||this.shouldList(!1)}noLink(){return!1}organization(){return this.org}author(){return this.authorInfo}menu(){return this.menuConfig}},$s=class{home(){return["index.html","_default/index.html","_default/single.html"]}homeList(){return["index.html","_default/index.html","_default/list.html"]}section(t){return[`${t}/section.html`,`${t}/list.html`,"_default/section.html","_default/list.html","_default/index.html"]}page(t,e){const n=t?`${t}/${e}`:e,r=t?`${t}/single.html`:"single.html",i=[];return"index"!==n&&i.push(`${n}.html`),i.push(r),"index"!==e&&i.push(`_default/${e}.html`),i.push("_default/single.html"),i.push("index.html"),i.push("_default/index.html"),i}taxonomy(){return["taxonomy/taxonomy.html","taxonomy/list.html","_default/list.html","_default/taxonomy.html"]}term(){return["taxonomy/tag.html","term/term.html","taxonomy/list.html","_default/list.html","_default/term.html"]}standalone404(){return["404.html"]}standaloneSitemap(){return["sitemap.xml","_default/sitemap.xml"]}},Us=class{V;Y;K;X;u;Z;J;tt;et=null;nt;it=null;st=null;constructor(t,e,n,r,i,s,a,o="",l=0){this.V=t,this.Y=e,this.K=n,this.X=r,this.u=i,this.Z=s,this.J=a,this.tt=o,this.nt=l}get params(){return this.V}get Params(){return this.V}get IsNamedParams(){return this.Z}get inner(){return this.Y}get Inner(){return this.Y}get page(){return this.K}get Page(){return this.K}get parent(){return this.X}get Parent(){return this.X}get name(){return this.u}get isNamedParams(){return this.Z}get ordinal(){return this.J}get Ordinal(){return this.J}innerDeindent(){if(""===this.tt)return this.Y;if(null===this.et){const t=this.Y.split("\n");this.et=t.map(t=>t.startsWith(this.tt)?t.substring(this.tt.length):t).join("\n")}return this.et}get InnerDeindent(){return this.innerDeindent()}async position(){return this.it||(this.it=await this.K.posOffset(this.nt)),this.it}scratch(){return this.st||(this.st=new Rs),this.st}get(t){return this.V?Array.isArray(this.V)?"number"==typeof t?t>=this.V.length?"":this.V[t]:null:"object"==typeof this.V&&"string"==typeof t?this.V[t]||"":null:null}Get(t){return this.get(t)}},Bs="partials/",qs=class extends Error{constructor(t,e){super(t),this.code=e,this.name="TemplateError"}},js=(new qs("template not found","TEMPLATE_NOT_FOUND"),new qs("template parse failed","PARSE_FAILED"),new qs("template execute failed","EXECUTE_FAILED"),new qs("invalid template","INVALID_TEMPLATE"),m(require("path"))),Hs=class{baseof=new Map;needsBaseof=new Map;getTemplateSearchOrder(t){const e=[];return e.push("_default/baseof.html"),e}getBaseOf(t){return this.baseof.get(t)||null}getNeedsBaseOf(t){return this.needsBaseof.get(t)||null}addBaseOf(t,e){this.baseof.set(t,e)}addNeedsBaseOf(t,e){this.needsBaseof.set(t,e)}isBaseTemplatePath(t){return js.basename(t).includes("baseof")}needsBaseOf(t,e){return!this.noBaseNeeded(t)&&this.needsBaseTemplate(e)}noBaseNeeded(t){return!!t.startsWith(Bs)}needsBaseTemplate(t){let e=-1,n=!1;for(let r=0;r<t.length;)if(!n&&t.substring(r).startsWith("{{/*"))n=!0,r+=4;else if(!n&&t.substring(r).startsWith("{{- /*"))n=!0,r+=6;else if(n&&t.substring(r).startsWith("*/}}"))n=!1,r+=4;else if(n&&t.substring(r).startsWith("*/ -}}"))n=!1,r+=6;else{const i=t[r];if(!n){if(t.substring(r).startsWith("{{")){e=r;break}if(!/\s/.test(i))break}r++}return-1!==e&&/^{{-?\s*define/.test(t.substring(e))}getAllBaseOf(){return new Map(this.baseof)}getAllNeedsBaseOf(){return new Map(this.needsBaseof)}clear(){this.baseof.clear(),this.needsBaseof.clear()}getStats(){return{baseOfCount:this.baseof.size,needsBaseOfCount:this.needsBaseof.size}}},zs=class t{constructor(t,e,n){this.name=t,this.template=e,this.fi=n}identifierBase(){return this.name}errWithFileContext(t,e){const n=`${t}: ${e.message}`,r=new qs(n,"TEMPLATE_FILE_ERROR");return Object.defineProperty(r,"fileName",{value:this.name,enumerable:!0}),Object.defineProperty(r,"fileContent",{value:this.template,enumerable:!0}),r}isZero(){return""===this.name}copy(){return new t(this.name,this.template,this.fi)}getCleanContent(){return Ws(this.template)}};function Ws(t){for(let e=0;e<t.length;e++){const n=t[e];if(0===e&&"\ufeff"!==n)return t;if(e>0)return t.substring(e)}return t}function Gs(t){return function(t){return t.includes("_shortcodes/")}(t)?1:t.includes("_partials/")?2:0}j(),N("template",{component:"namespace"});var Vs=class{templates=new Map;mutex=new Set;addTemplate(t,e){this.withLock(()=>{this.templates.set(t,e)})}findTemplate(t){return this.withReadLock(()=>{if(this.templates.has(t))return this.templates.get(t)||null;if(!t.endsWith(".html")){const e=t+".html";if(this.templates.has(e))return this.templates.get(e)||null}for(const[e,n]of this.templates.entries())if(e.includes(t))return n;return null})}getTemplates(){return this.withReadLock(()=>new Map(this.templates))}hasTemplate(t){return this.withReadLock(()=>this.templates.has(t))}getTemplateNames(){return this.withReadLock(()=>Array.from(this.templates.keys()))}removeTemplate(t){return this.withLock(()=>this.templates.delete(t))}clear(){this.withLock(()=>{this.templates.clear()})}size(){return this.withReadLock(()=>this.templates.size)}getTemplatesByPattern(t){return this.withReadLock(()=>{const e=[];for(const[n,r]of this.templates)t.test(n)&&e.push(r);return e})}withLock(t){const e="write";for(;this.mutex.has(e););this.mutex.add(e);try{return t()}finally{this.mutex.delete(e)}}withReadLock(t){const e="read";this.mutex.add(e);try{return t()}finally{this.mutex.delete(e)}}},Ys=class extends Vs{lookup(t){const e=this.findTemplate(t);return e?e.template:null}findTemplateWithDependencies(t){return this.findTemplate(t)}getTemplatesNeedingBase(){return this.withReadLock(()=>Array.from(this.templates.values()).filter(t=>t.baseInfo))}},Ks=class extends Vs{lookup(t){const e=this.findTemplate(t);return e?e.template:null}addPartialTemplate(t,e){const n={...e,type:2};this.addTemplate(t,n)}},Xs=class extends Vs{lookup(t){const e=this.findTemplate(t);return e?e.template:null}addShortcodeTemplate(t,e){const n={...e,type:1};this.addTemplate(t,n)}getShortcode(t){return this.lookup("_shortcodes/"+t)}hasShortcode(t){return this.hasTemplate(t)}getShortcodeNames(){return this.getTemplateNames()}},Zs=class{async execute(t,e){try{const[n,r]=await t.Execute(e);if(r)throw new qs(`Template execution failed: ${r.message}`,"EXECUTION_FAILED");return n}catch(t){if(t instanceof qs)throw t;const e=t instanceof Error?t.message:String(t);throw new qs(`Template execution failed: ${e}`,"EXECUTION_FAILED")}}async executeWithTimeout(t,e,n){return new Promise(async(r,i)=>{const s=setTimeout(()=>{i(new qs("Template execution timeout","EXECUTION_TIMEOUT"))},n);await this.execute(t,e).then(t=>{clearTimeout(s),r(t)}).catch(t=>{clearTimeout(s),i(t)})})}async executeSafely(t,e){try{return{result:await this.execute(t,e),error:null}}catch(t){if(t instanceof qs)return{result:null,error:t};const e=t instanceof Error?t.message:String(t);return{result:null,error:new qs(`Execution failed: ${e}`,"EXECUTION_ERROR")}}}async executeBatch(t){return(await Promise.allSettled(t.map(async({name:t,template:e,data:n})=>{try{return{name:t,result:await this.execute(e,n),error:null}}catch(e){return{name:t,result:null,error:e instanceof qs?e:new qs(`Batch execution failed: ${e.message}`,"BATCH_EXECUTION_FAILED")}}}))).map(t=>"fulfilled"===t.status?t.value:{name:"unknown",result:null,error:new qs(`Batch execution failed: ${t.reason}`,"BATCH_EXECUTION_FAILED")})}async executeWithContext(t,e,n){if(n.signal?.aborted)throw new qs("Template execution was cancelled","EXECUTION_CANCELLED");const r=new Promise((t,e)=>{n.signal&&n.signal.addEventListener("abort",()=>{e(new qs("Template execution was cancelled","EXECUTION_CANCELLED"))})}),i=n.timeout?new Promise((t,e)=>{setTimeout(()=>{e(new qs("Template execution timeout","EXECUTION_TIMEOUT"))},n.timeout)}):new Promise(()=>{});try{return await Promise.race([this.execute(t,e),r,i])}catch(t){if(t instanceof qs)throw t;throw new qs(`Context execution failed: ${t.message}`,"CONTEXT_EXECUTION_FAILED")}}},Js=require("@mdfriday/text-template"),Qs=require("@mdfriday/text-template");j(),j();var ta=N("content",{component:"cache"}),ea=class{cache=new Map;pendingPromises=new Map;deletedKeys=new Set;constructor(){}get(t){return this.cache.get(t)}set(t,e){this.deletedKeys.has(t)||this.cache.set(t,e),this.pendingPromises.delete(t),this.deletedKeys.delete(t)}has(t){return this.cache.has(t)}isPending(t){return this.pendingPromises.has(t)}delete(t){return this.deletedKeys.add(t),this.pendingPromises.delete(t),this.cache.delete(t)}clear(){this.cache.clear(),this.pendingPromises.clear(),this.deletedKeys.clear()}size(){return this.cache.size}pendingCount(){return this.pendingPromises.size}async getOrCreate(t,e){const n=this.cache.get(t);if(void 0!==n)return n;const r=this.pendingPromises.get(t);return r?await r:this.createAndCache(t,e)}async createAndCache(t,e){const n=this.executeCreate(t,e);this.pendingPromises.set(t,n);try{const e=await n;return this.deletedKeys.has(t)?(this.deletedKeys.delete(t),this.pendingPromises.delete(t),e):(this.set(t,e),e)}catch(e){throw this.pendingPromises.delete(t),ta.error(`Failed to create value for key ${String(t)} : ${e}`),e}}async executeCreate(t,e){try{return await e(t)}catch(e){const n=e instanceof Error?e.message:String(e),r=new Error(`Cache creation failed for key ${String(t)}: ${n}`);throw e instanceof Error&&e.stack&&(r.stack=e.stack,r.originalError=e),r}}getStats(){return{size:this.cache.size,pendingCount:this.pendingPromises.size,keys:Array.from(this.cache.keys()),pendingKeys:Array.from(this.pendingPromises.keys())}}async preload(t){const e=t.filter(({key:t})=>!this.has(t)&&!this.isPending(t)).map(({key:t,create:e})=>this.getOrCreate(t,e));e.length>0&&await Promise.allSettled(e)}},na=(new ea,N("template",{component:"parser"})),ra=class{prototypeText;prototypeTextClone;readyInit=!1;funcMap;parseOverlapCache;constructor(t=new Map){this.funcMap=t,this.prototypeText=(0,Js.New)(""),this.parseOverlapCache=new ea,this.funcMap.size>0&&this.prototypeText.Funcs(this.funcMap)}async markReady(){this.readyInit||(this.prototypeTextClone=this.prototypeText,this.readyInit=!0)}async parse(t){try{const e=(0,Js.New)(t.name);this.funcMap&&this.funcMap.size>0&&e.Funcs(this.funcMap);const[n,r]=e.Parse(t.template);if(r)throw new qs(`Parse failed: ${r.message}`,"PARSE_FAILED");return{template:n,info:t,type:Gs(t.name)}}catch(t){if(t instanceof qs)throw t;const e=t instanceof Error?t.message:String(t);throw new qs(`Parse failed: ${e}`,"PARSE_FAILED")}}async parseWithLock(t,e){try{this.prototypeTextClone||await this.markReady();const n=(0,Js.New)(t);this.funcMap&&this.funcMap.size>0&&n.Funcs(this.funcMap);const[r,i]=n.Parse(e);if(i)throw new qs(`Parse with lock failed: ${i.message}`,"PARSE_LOCK_FAILED");return r}catch(t){if(t instanceof qs)throw t;const e=t instanceof Error?t.message:String(t);throw new qs(`Parse with lock failed: ${e}`,"PARSE_LOCK_FAILED")}}async parseOverlap(t,e,n){const r=`${t.name}::${e.name||"empty"}`;return this.parseOverlapCache.getOrCreate(r,async()=>{try{const r={template:await this.applyBaseTemplate(t,e,n),info:t,type:Gs(t.name)};return e.isZero&&!e.name||(r.baseInfo=e),[r,!0,null]}catch(t){const e=t instanceof qs?t:new qs(`Parse overlap failed: ${t.message}`,"PARSE_OVERLAP_FAILED");return na.error(`Failed to parse template overlap for key: ${r}: ${e.message}`),[null,!1,e]}})}async applyBaseTemplate(t,e,n){try{const r=(0,Js.New)(t.name);if(this.funcMap&&this.funcMap.size>0&&r.Funcs(this.funcMap),!e.isZero||e.name){const[t,n]=r.Parse(e.template);if(n)throw new qs(`Base template parse failed: ${n.message}`,"BASE_PARSE_FAILED")}const[i,s]=r.Clone();if(s)throw new qs(`Template clone failed: ${s.message}`,"CLONE_FAILED");const[a,o]=i.Parse(t.template);if(o)throw new qs(`Overlay template parse failed: ${o.message}`,"OVERLAY_PARSE_FAILED");const l=await this.getDependencies(a,new Map,n);for(const[e,n]of l)if(e!==t.name)try{if(n.template.Tree){const[,t]=a.AddParseTree(e,n.template.Tree);if(t)throw na.error(`AddParseTree failed: ${t.message} with name ${e}`),new qs(`AddParseTree failed: ${t.message}`,"ADD_PARSE_TREE_FAILED")}}catch(n){throw na.error(`Error adding dependency ${e} to template ${t.name}:`,n),new qs(`Failed to add dependency ${e}: ${n.message}`,"DEPENDENCY_ADD_FAILED")}return a}catch(t){if(t instanceof qs)throw t;const e=t instanceof Error?t.message:String(t);throw new qs(`Apply base template failed: ${e}`,"APPLY_BASE_FAILED")}}async getDependencies(t,e,n){const r=new Map;if(e.has(t.Name()))return r;e.set(t.Name(),t);try{const i=new Set,s=t=>{if(!t)return;const e=t.Type();if(e===Qs.NodeType.NodeTemplate){const e=t.Name;e&&i.add(e)}else if(e===Qs.NodeType.NodeList){const e=t;if(e.Nodes)for(const t of e.Nodes)s(t)}if(e===Qs.NodeType.NodeAction){const e=t;e.Pipe&&s(e.Pipe)}else if(e===Qs.NodeType.NodePipe){const e=t;if(e.Cmds)for(const t of e.Cmds)s(t)}else if(e===Qs.NodeType.NodeCommand){const e=t;if(e.Args)for(const t of e.Args)s(t)}else if(e===Qs.NodeType.NodeIf||e===Qs.NodeType.NodeRange||e===Qs.NodeType.NodeWith){const e=t;e.Pipe&&s(e.Pipe),e.List&&s(e.List),e.ElseList&&s(e.ElseList)}};t.Tree&&t.Tree.Root&&s(t.Tree.Root);for(const t of i){const i=n(t);if(i&&(r.set(t,i),!e.has(i.template.Name()))){const t=await this.getDependencies(i.template,e,n);for(const[e,n]of t)r.has(e)||r.set(e,n)}}}catch(e){na.error(`Error getting dependencies for template ${t.Name()}:`,e)}return r}setFuncMap(t){this.funcMap=new Map([...this.funcMap,...t]),this.funcMap.size>0&&this.prototypeText.Funcs(this.funcMap)}getFuncMap(){return new Map(this.funcMap)}async parseMultiple(t){const e=await Promise.allSettled(t.map(t=>this.parse(t))),n=[],r=[];for(const t of e)"fulfilled"===t.status?n.push(t.value):r.push(t.reason);if(r.length>0)throw new qs(`Failed to parse ${r.length} templates: ${r.map(t=>t.message).join(", ")}`,"MULTIPLE_PARSE_FAILED");return n}clearCache(){this.parseOverlapCache.clear()}getCacheStats(){return this.parseOverlapCache.getStats()}},ia=class{baseOf;funcsv;constructor(t,e){if(this.baseOf=t||new Hs,this.funcsv=new Map,e)for(const[t,n]of e)this.funcsv.set(t,n)}findNoDependence(t,e){try{const n=e.lookup(t);return n?[n,!0,null]:[null,!1,null]}catch(t){return[null,!1,t]}}findTemplate(t,e){try{const n=e.lookup(t);if(n)return[n,!0,null];const r=e.findTemplateWithDependencies(t);return r&&r.baseInfo?[r.template,!0,null]:[null,!1,null]}catch(t){return[null,!1,t]}}findPartial(t,e){try{const n=e.lookup(t);return n?[n,!0,null]:[null,!1,null]}catch(t){return[null,!1,t]}}findShortcode(t,e){try{const n=e.getShortcode(t);return n?[n,!0,null]:[null,!1,null]}catch(t){return[null,!1,t]}}findDependentInfo(t){const e=this.baseOf.getNeedsBaseOf(t);if(!e)return[null,null,!1];let n=null,r=!1;for(const e of this.baseOf.getTemplateSearchOrder(t))if(n=this.baseOf.getBaseOf(e),n){r=!0;break}return[e,n,r]}getFunc(t){return this.funcsv.get(t)}setFunc(t,e){this.funcsv.set(t,e)}setFuncMap(t){this.funcsv.clear();for(const[e,n]of t)this.funcsv.set(e,n)}getFuncMap(){return new Map(this.funcsv)}newTemplateLookup(t){return e=>t.findTemplate(e)}getBaseOf(){return this.baseOf}setBaseOf(t){this.baseOf=t}hasDependencies(t){const[e,n,r]=this.findDependentInfo(t);return r&&(null!==e||null!==n)}getAllFunctions(){return Array.from(this.funcsv.keys())}clearFunctions(){this.funcsv.clear()}getStats(){const t=this.baseOf.getStats();return{functionCount:this.funcsv.size,baseTemplateCount:t.baseOfCount,dependentTemplateCount:t.needsBaseOfCount}}};j();var sa=N("template",{component:"template-engine"}),aa=class{executor;lookup;parser;templateNamespace;partialNamespace;shortcodeNamespace;fs;constructor(t,e,n,r,i,s,a){this.executor=t,this.lookup=e,this.parser=n,this.templateNamespace=r,this.partialNamespace=i,this.shortcodeNamespace=s,this.fs=a}async markReady(){try{await this.parser.markReady()}catch(t){throw new qs(`Failed to mark template engine ready: ${t.message}`,"TEMPLATE_ENGINE_READY_FAILED")}}async getTemplate(t){const[e,n,r]=this.lookup.findTemplate(t,this.templateNamespace);if(r)return[null,!1,r];if(n&&e)return[e,!0,null];const[i,s,a]=this.lookup.findDependentInfo(t);if(a&&i)try{const[t,e,n]=await this.parser.parseOverlap(i,s||i,this.lookup.newTemplateLookup(this.templateNamespace));if(n)return[null,!1,n];if(e&&t)return[t.template,!0,null]}catch(t){return[null,!1,t]}return[null,!1,null]}async getPartial(t){let e=t.startsWith(Bs)?t:`${Bs}${t}`;return e=t.endsWith(".html")?e:`${e}.html`,this.lookup.findPartial(e,this.partialNamespace)}async getShortcode(t){return this.lookup.findShortcode(t,this.shortcodeNamespace)}async get(t){switch(Gs(t)){case 1:return this.getShortcode(t);case 2:return this.getPartial(t);default:return this.getTemplate(t)}}async findFirst(t){if(!t||0===t.length)return[null,null,!1,null];for(const e of t)try{const[t,n,r]=await this.get(e);if(r)continue;if(n&&t)return[t,e,!0,null]}catch(t){sa.error("Error finding template:",t)}return[null,null,!1,null]}hasShortcode(t){return this.shortcodeNamespace.hasShortcode(t)}getShortcodeNames(){return this.shortcodeNamespace.getShortcodeNames()}getShortcodeCount(){return this.getShortcodeNames().length}async loadTemplates(){const t=async(t,e)=>{if(e.isDir())return;const n=t.startsWith(jr.SYSTEM_PATH_SEPARATOR)?t.substring(1):t,r=jr.normalizePath(n);try{await this.addTemplateFileInfo(r,e)}catch(t){sa.error("Error adding template:",new qs(`Failed to add template ${r}: ${t.message}`,"LOAD_TEMPLATE_FAILED"))}};try{await this.fs.walk("",{walkFn:t},{})}catch(t){if(!t.message?.includes("ENOENT")&&!t.message?.includes("no such file"))throw t}}async addTemplateFileInfo(t,e){try{const n=await async function(t,e){let n=null;try{n=await e.open();const r=await n.stat(),i=new Uint8Array(r.size()),s=await n.read(i),a=Ws(new TextDecoder("utf-8").decode(s.buffer));return new zs(t,a,e)}catch(n){throw new zs(t,"",e).errWithFileContext("failed to load template",n)}finally{if(n)try{await n.close()}catch(t){console.warn(`Failed to close template file: ${t}`)}}}(t,e);await this.addTemplate(n.name,n)}catch(e){throw new qs(`Failed to load template info for ${t}: ${e.message}`,"LOAD_TEMPLATE_INFO_FAILED")}}async addTemplate(t,e){try{if(this.lookup.getBaseOf().isBaseTemplatePath(t))return void this.lookup.getBaseOf().addBaseOf(t,e);if(this.lookup.getBaseOf().needsBaseOf(t,e.template))return void this.lookup.getBaseOf().addNeedsBaseOf(t,e);const n=Gs(t),r=await this.parser.parse(e);switch(n){case 1:this.shortcodeNamespace.addShortcodeTemplate(t,r);break;case 2:this.partialNamespace.addPartialTemplate(t,r);break;default:this.templateNamespace.addTemplate(t,r)}}catch(e){throw new qs(`Failed to add template ${t}: ${e.message}`,"ADD_TEMPLATE_FAILED")}}async execute(t,e){const[n,r,i]=await this.get(t);if(i)throw i;if(!r||!n)throw new qs(`Template not found: ${t}`,"TEMPLATE_NOT_FOUND");return await this.executor.execute(n,e)}async executeRaw(t,e,n){const r=await this.parser.parseWithLock(t,e);if(!r)throw new qs(`Raw Template parse error: ${t}`,"TEMPLATE_PARSE_ERROR");return await this.executor.execute(r,n)}async executeShortcode(t,e){const n=this.shortcodeNamespace.getShortcode(t);if(!n)throw new qs(`Shortcode template '${t}' not found`,"SHORTCODE_NOT_FOUND");try{return await this.executor.execute(n,e)}catch(e){throw new qs(`Error executing shortcode template '${t}': ${e.message}`,"SHORTCODE_EXECUTION_FAILED")}}async executeSafely(t,e){try{return{result:await this.execute(t,e),error:null}}catch(t){return t instanceof qs?{result:null,error:t}:{result:null,error:new qs(`Execute safely failed: ${t.message}`,"EXECUTE_SAFELY_FAILED")}}}async executeShortcodeSafely(t,e){try{return{result:await this.executeShortcode(t,e),error:null}}catch(t){return t instanceof qs?{result:null,error:t}:{result:null,error:new qs(`Execute shortcode safely failed: ${t.message}`,"EXECUTE_SHORTCODE_SAFELY_FAILED")}}}async hasTemplate(t){const[,e]=await this.get(t);return e}getTemplateNames(){return this.templateNamespace.getTemplateNames()}getPartialTemplateNames(){return this.partialNamespace.getTemplateNames()}getAllTemplateNames(){return[...this.templateNamespace.getTemplateNames(),...this.partialNamespace.getTemplateNames(),...this.shortcodeNamespace.getTemplateNames()]}getPartialNamespace(){return this.partialNamespace}getShortcodeNamespace(){return this.shortcodeNamespace}getTemplateNamespace(){return this.templateNamespace}clear(){this.templateNamespace.clear(),this.lookup.getBaseOf().clear()}getTemplatesByPattern(t){return this.templateNamespace.getTemplatesByPattern(t).map(t=>t.info.name)}};j();var oa=m(require("crypto")),la=N("template",{component:"registry"}),ca=[],ha=class{engine=null;getFunctionName(){return"partial"}updateEngine(t){this.engine=t}execute=async(t,e)=>{if(!this.engine)return la.error(`Partial function called but engine not set: ${t}`),`\x3c!-- Partial function called but engine not ready: ${t} --\x3e`;try{const n=t.startsWith("partials/")?t:`partials/${t}`;return await this.executePartial(n,e)}catch(e){return la.error(`Partial execution failed for "${t}":`,e),`\x3c!-- Partial execution failed: ${t} - ${e.message} --\x3e`}};async executePartial(t,e){if(!this.engine)return`\x3c!-- Template engine not available: ${t} --\x3e`;try{const[n,r,i]=await this.engine.getPartial(t);if(i)return la.error("Error getting partial template:",i),`\x3c!-- Error getting partial template: ${t} - ${i.message} --\x3e`;if(!r||!n)return la.warn(`Template not found: ${t}`),`\x3c!-- Template not found: ${t} --\x3e`;const[s,a]=await n.Execute(e);return a?(la.error("Template execution error:",a),`\x3c!-- Template execution error: ${t} - ${a.message} --\x3e`):s}catch(e){return la.error("Sync partial execution failed:",e),`\x3c!-- Partial sync execution failed: ${t} - ${e.message} --\x3e`}}},ua=class{registerCoreFunctions(t){this.registerCryptoFunctions(t),this.registerStringFunctions(t),this.registerMathFunctions(t),this.registerTimeFunctions(t),this.registerCollectionFunctions(t),this.registerSafeFunctions(t),this.registerReflectFunctions(t),this.registerFmtFunctions(t),this.registerPathFunctions(t),this.registerTransformFunctions(t)}registerCryptoFunctions(t){t.set("md5",t=>t?oa.createHash("md5").update(t).digest("hex"):""),t.set("encryptAESGCM",(t,e)=>{if(!t||!e)return"";const n=oa.randomBytes(16),r=oa.randomBytes(12),i=oa.pbkdf2Sync(t,n,1e5,32,"sha256"),s=oa.createCipheriv("aes-256-gcm",i,r),a=Buffer.concat([s.update(e,"utf8"),s.final()]),o=s.getAuthTag();return Buffer.concat([n,r,o,a]).toString("base64")})}registerExtendedFunctions(t,e){this.registerURLFunctions(t,e),this.registerSiteFunctions(t,e),this.registerResourcesFunctions(t,e),this.registerHugoFunctions(t,e),this.registerLanguageFunctions(t,e)}registerAllFunctions(t,e){this.registerCoreFunctions(t),this.registerStringFunctions(t),this.registerMathFunctions(t),this.registerTimeFunctions(t),this.registerCollectionFunctions(t),this.registerEngineDependentFunctions(t),e&&(this.registerURLFunctions(t,e),this.registerExtendedFunctions(t,e))}registerEngineDependentFunctions(t){const e=new ha;ca.push(e),t.set(e.getFunctionName(),e.execute)}registerURLFunctions(t,e){t.set("urls",()=>({Parse:t=>{try{return{Host:new URL(t).host}}catch{return{Host:""}}},JoinPath:(...t)=>t.filter(t=>""!==t).map(t=>t.replace(/^\/+|\/+$/g,"")).join("/"),URLize:t=>e.urlize(t),Abs:t=>e.absURL(t),Rel:t=>e.relURL(t),AbsLangURL:t=>e.absURL(t),RelLangURL:t=>e.relURL(t),Sanitize:t=>{try{return new URL(t).toString()}catch{return t.replace(/[<>"'%{}|\\^`]/g,"")}},PathEscape:t=>encodeURIComponent(t).replace(/%2F/g,"/").replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),QueryEscape:t=>encodeURIComponent(t),QueryUnescape:t=>{try{return decodeURIComponent(t)}catch{return t}},IsAbs:t=>{try{return""!==new URL(t).protocol}catch{return!1}},IsRelative:t=>{try{return new URL(t),!1}catch{return!0}}})),t.set("absURL",t=>e.absURL(t)),t.set("relURL",t=>e.relURL(t)),t.set("urlize",t=>e.urlize(t)),t.set("relref",(t,n)=>{if(/^https?:\/\//.test(n))return n;let r="";const i=n.indexOf("#");return-1!==i&&(r=n.slice(i),n=n.slice(0,i)),(n=n.replace(/^\/+|\/+$/g,"")).startsWith("./")||n.startsWith("../")||n.startsWith("/")?e.relURL(n+r):e.relURL("/"+n+r)}),t.set("ref",(t,n)=>{if(/^https?:\/\//.test(n))return n;let r="";const i=n.indexOf("#");return-1!==i&&(r=n.slice(i),n=n.slice(0,i)),(n=n.replace(/^\/+|\/+$/g,"")).startsWith("./")||n.startsWith("../")||n.startsWith("/")?e.absURL(n+r):e.absURL("/"+n+r)}),t.set("absLangURL",t=>e.absURL(t)),t.set("relLangURL",t=>e.relURL(t))}registerSiteFunctions(t,e){t.set("Site",()=>({Title:e.title(),BaseURL:e.baseURL(),Params:e.params(),Menus:e.menus(),IsMultiLingual:e.isMultiLanguage(),LanguageCode:e.defaultLanguage()}))}registerResourcesFunctions(t,e){t.set("resources",()=>({Get:async t=>await e.Get(t),GetRemote:async t=>await e.GetRemote(t),Minify:async t=>await e.Minify(t),Fingerprint:async t=>await e.Fingerprint(t),ExecuteAsTemplate:async(t,n,r)=>await e.ExecuteAsTemplate(t,n,r)}))}registerHugoFunctions(t,e){t.set("hugo",()=>({Version:e.version(),Environment:e.environment(),Generator:e.generator()}))}registerLanguageFunctions(t,e){const{lang:n}=(D(),w(T));t.set("lang",()=>({getAllCodes:()=>n.getAllCodes(),getAllNames:()=>n.getAllNames(),getCodesByDirection:t=>n.getCodesByDirection(t),getNamesByDirection:t=>n.getNamesByDirection(t),getCodeNameMap:()=>n.getCodeNameMap(),getCodeNameMapByDirection:t=>n.getCodeNameMapByDirection(t),getNameByCode:t=>n.getNameByCode(t),getLanguageInfo:t=>n.getLanguageInfo(t),isSupported:t=>n.isSupported(t),getDirection:t=>n.getDirection(t),isLTR:t=>n.isLTR(t),isRTL:t=>n.isRTL(t)})),t.set("langName",t=>n.getNameByCode(t)||t),t.set("langDirection",t=>n.getDirection(t)||"ltr"),t.set("isLTR",t=>n.isLTR(t)),t.set("isRTL",t=>n.isRTL(t)),t.set("i18n",t=>e.translate(t))}registerStringFunctions(t){t.set("humanize",t=>t?(t=(t=(t=(t=t.replace(/([a-z])([A-Z])/g,"$1 $2")).replace(/[_-]+/g," ")).replace(/\.[^/.]+$/,"")).charAt(0).toUpperCase()+t.slice(1).toLowerCase()).trim():""),t.set("upper",t=>t.toUpperCase()),t.set("lower",t=>t.toLowerCase()),t.set("title",t=>t.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase())),t.set("trim",t=>t.trim()),t.set("replace",(...t)=>{if(t.length<3)throw new Error("replace requires at least 3 arguments: string, old, new");const e=String(t[0]),n=String(t[1]),r=String(t[2]);if(t.length>=4){const i=Number(t[3]);if(isNaN(i))throw new Error("replace limit must be a number");let s=e,a=0,o=0;for(;a<i&&o<s.length;){const t=s.indexOf(n,o);if(-1===t)break;s=s.substring(0,t)+r+s.substring(t+n.length),o=t+r.length,a++}return s}return e.split(n).join(r)}),t.set("replaceRE",(...e)=>{if(e.length<3)throw new Error("replaceRE requires at least 3 arguments: pattern, replacement, string");const n=e[0],r=e[1],i=e[2],s=e.length>=4?e[3]:void 0;return t.get("strings")().ReplaceRE(n,r,i,s)}),t.set("split",(t,e)=>null==t?(la.warn("split function: first argument is null or undefined"),[]):"string"!=typeof t?(la.warn("split function: first argument must be a string, got:",typeof t,"value:",t),Array.isArray(t)?t:String(t).split(e)):t.split(e)),t.set("splitRegex",(t,e)=>{if(null==t)return la.warn("splitRegex function: first argument is null or undefined"),[];if("string"!=typeof t){if(la.warn("splitRegex function: first argument must be a string, got:",typeof t,"value:",t),Array.isArray(t))return t;const n=String(t);try{const t=new RegExp(e);return n.split(t)}catch(t){return la.warn("splitRegex function: invalid regex pattern:",e,"error:",t),[n]}}try{const n=new RegExp(e);return t.split(n)}catch(n){return la.warn("splitRegex function: invalid regex pattern:",e,"error:",n),[t]}}),t.set("delimit",(t,e)=>Array.isArray(t)?t.join(e):String(t)),t.set("in",(t,e)=>(Array.isArray(t)||"string"==typeof t&&"string"==typeof e)&&t.includes(e)),t.set("hasPrefix",(t,e)=>t.startsWith(e)),t.set("hasSuffix",(t,e)=>t.endsWith(e)),t.set("strings",()=>({ToLower:t=>String(t).toLowerCase(),ToUpper:t=>String(t).toUpperCase(),Title:t=>String(t).replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),Trim:(t,e)=>String(t).split("").filter(t=>!e.includes(t)).join(""),TrimSpace:t=>String(t).trim(),TrimLeft:(t,e)=>{const n=String(e);let r=0;for(;r<n.length&&t.includes(n[r]);)r++;return n.slice(r)},TrimRight:(t,e)=>{const n=String(e);let r=n.length-1;for(;r>=0&&t.includes(n[r]);)r--;return n.slice(0,r+1)},TrimPrefix:(t,e)=>{const n=String(e);return n.startsWith(t)?n.slice(t.length):n},TrimSuffix:(t,e)=>{const n=String(e);return n.endsWith(t)?n.slice(0,-t.length):n},Contains:(t,e)=>String(t).includes(e),ContainsAny:(t,e)=>{const n=String(t);return e.split("").some(t=>n.includes(t))},HasPrefix:(t,e)=>String(t).startsWith(e),HasSuffix:(t,e)=>String(t).endsWith(e),Replace:(t,e,n,r)=>{const i=String(t);if(void 0===r)return i.split(e).join(n);let s=i,a=0,o=0;for(;a<r&&o<s.length;){const t=s.indexOf(e,o);if(-1===t)break;s=s.substring(0,t)+n+s.substring(t+e.length),o=t+n.length,a++}return s},ReplaceRE:(t,e,n,r)=>{const i=String(t),s=String(e),a=String(n);let o,l=-1;if(void 0!==r){const t=parseInt(String(r),10);if(isNaN(t))throw new Error("limit argument must be integer");l=t}try{o=new RegExp(i,"g")}catch(t){throw new Error(`invalid regular expression: ${i}`)}let c=0;return a.replace(o,t=>l>=0&&c>=l?t:(c++,s))},Split:(t,e)=>String(t).split(e),SliceString:(t,e,n)=>{const r=String(t);return void 0!==n?r.slice(e,n):r.slice(e)},Substr:(t,e,n)=>{const r=String(t);return e<0&&(e=r.length+e),e<0&&(e=0),e>=r.length?"":void 0===n?r.slice(e):n<=0?"":r.slice(e,e+n)},Count:(t,e)=>{const n=String(e);return t?(n.match(new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"))||[]).length:n.length+1},CountWords:t=>{const e=String(t).trim();return e?e.split(/\s+/).length:0},CountRunes:t=>String(t).replace(/\s/g,"").length,RuneCount:t=>String(t).length,Repeat:(t,e)=>{if(t<0)throw new Error("strings: negative Repeat count");return String(e).repeat(t)},FirstUpper:t=>{const e=String(t);return e.charAt(0).toUpperCase()+e.slice(1)}})),t.set("substr",(t,...e)=>{const n=String(t),r=Array.from(n),i=r.length;let s,a;switch(e.length){case 0:throw new Error("too few arguments");case 1:const t=Number(e[0]);if(isNaN(t)||!Number.isInteger(t))throw new Error("start argument must be an integer");s=t,a=i;break;case 2:const n=Number(e[0]),r=Number(e[1]);if(isNaN(n)||!Number.isInteger(n))throw new Error("start argument must be an integer");if(isNaN(r)||!Number.isInteger(r))throw new Error("length argument must be an integer");s=n,a=r;break;default:throw new Error("too many arguments")}if(0===i)return"";if(s<0&&(s+=i),s<0&&(s=0),s>i-1)return"";let o=i;return 0===a?"":(a<0?o+=a:a>0&&(o=s+a),s>=o||o<0?"":(o>i&&(o=i),r.slice(s,o).join("")))}),t.set("truncate",(t,...e)=>{const n=Number(t);if(isNaN(n)||!Number.isInteger(n))throw new Error("truncate length must be an integer");let r,i=" …";switch(e.length){case 0:throw new Error("truncate requires a length and a string");case 1:r=e[0],i=" …";break;case 2:i=String(e[0]),r=e[1];break;default:throw new Error("too many arguments passed to truncate")}const s=String(r),a=/<[^>]+>/.test(s);return Array.from(s).length<=n?a?s:this.escapeHTML(s):a?this.truncateHTML(s,n,i):this.truncateText(s,n,i)})}escapeHTML(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}truncateText(t,e,n){const r=Array.from(t);if(r.length<=e)return this.escapeHTML(t);let i=0,s=0;for(let t=0;t<r.length&&s<e;t++){const e=r[t];s++,/\s/.test(e)&&(i=t),/[\u4e00-\u9fff\u3400-\u4dbf\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af]/.test(e)&&(i=t)}let a=s>=e?i>0?i:e:r.length;const o=r.slice(0,a).join("");return this.escapeHTML(o)+n}truncateHTML(t,e,n){const r=/^<(\/)?([^ ]+?)(?:(\s*\/)| .*?)?>/,i=new Set(["br","col","link","base","img","param","area","hr","input"]),s=[];let a=0,o=0,l=0,c=0,h=0;const u=Array.from(t);for(;h<u.length;){const t=u[h];if("<"===t){const t=u.slice(h).join("").match(r);if(t){const e=t[0],n="/"===t[1],r=t[2].toLowerCase(),l="/"===t[3];h+=e.length,a=o,i.has(r)||l||s.push({name:r,pos:h-e.length,openTag:!n});continue}}if(l++,/\s/.test(t)?a=o:/[\u4e00-\u9fff\u3400-\u4dbf\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af]/.test(t)?a=h:o=h+1,l>e){c=a>0?a:h;break}h++}if(l<=e)return t;let f=u.slice(0,c).join("")+n,d=null;for(let t=s.length-1;t>=0;t--){const e=s[t];e.pos>=c||null!==d?null!==d&&d.name===e.name&&(d=null):e.openTag?f+=`</${e.name}>`:d=e}return f}registerMathFunctions(t){t.set("add",(t,e)=>t+e),t.set("sub",(t,e)=>t-e),t.set("mul",(t,e)=>t*e),t.set("div",(t,e)=>0!==e?t/e:0),t.set("mod",(t,e)=>0!==e?t%e:0),t.set("math",()=>({Abs:t=>{const e=Number(t);if(isNaN(e))throw new Error("the math.Abs function requires a numeric argument");return Math.abs(e)},Add:(...t)=>{if(t.length<2)throw new Error("must provide at least two numbers");return t.reduce((t,e)=>{const n=Number(e);if(isNaN(n))throw new Error("Add operator can't be used with non-numeric values");return t+n},0)},Ceil:t=>{const e=Number(t);if(isNaN(e))throw new Error("Ceil operator can't be used with non-numeric value");return Math.ceil(e)},Div:(...t)=>{if(t.length<2)throw new Error("must provide at least two numbers");return t.reduce((t,e,n)=>{const r=Number(e);if(isNaN(r))throw new Error("Div operator can't be used with non-numeric values");if(0===n)return r;if(0===r)throw new Error("division by zero");return t/r})},Floor:t=>{const e=Number(t);if(isNaN(e))throw new Error("Floor operator can't be used with non-numeric value");return Math.floor(e)},Log:t=>{const e=Number(t);if(isNaN(e))throw new Error("Log operator can't be used with non-numeric value");return Math.log(e)},Max:(...t)=>{if(0===t.length)throw new Error("must provide at least one number");const e=t.flat().map(t=>{const e=Number(t);if(isNaN(e))throw new Error("Max operator can't be used with non-numeric values");return e});return Math.max(...e)},Min:(...t)=>{if(0===t.length)throw new Error("must provide at least one number");const e=t.flat().map(t=>{const e=Number(t);if(isNaN(e))throw new Error("Min operator can't be used with non-numeric values");return e});return Math.min(...e)},Mod:(t,e)=>{const n=Number(t),r=Number(e);if(isNaN(n)||isNaN(r))throw new Error("modulo operator can't be used with non-numeric value");if(0===r)throw new Error("the number can't be divided by zero at modulo operation");return n%r},ModBool:(t,e)=>{const n=Number(t),r=Number(e);if(isNaN(n)||isNaN(r))throw new Error("modulo operator can't be used with non-numeric value");if(0===r)throw new Error("the number can't be divided by zero at modulo operation");return n%r===0},Mul:(...t)=>{if(t.length<2)throw new Error("must provide at least two numbers");return t.reduce((t,e)=>{const n=Number(e);if(isNaN(n))throw new Error("Mul operator can't be used with non-numeric values");return t*n},1)},Pow:(t,e)=>{const n=Number(t),r=Number(e);if(isNaN(n)||isNaN(r))throw new Error("Pow operator can't be used with non-numeric value");return Math.pow(n,r)},Rand:()=>Math.random(),Round:t=>{const e=Number(t);if(isNaN(e))throw new Error("Round operator can't be used with non-numeric value");return Math.round(e)},Sqrt:t=>{const e=Number(t);if(isNaN(e))throw new Error("Sqrt operator can't be used with non-numeric value");return Math.sqrt(e)},Sub:(...t)=>{if(t.length<2)throw new Error("must provide at least two numbers");return t.reduce((t,e,n)=>{const r=Number(e);if(isNaN(r))throw new Error("Sub operator can't be used with non-numeric values");return 0===n?r:t-r})},Sum:(...t)=>{if(0===t.length)throw new Error("must provide at least one number");return t.flat().map(t=>{const e=Number(t);if(isNaN(e))throw new Error("Sum operator can't be used with non-numeric values");return e}).reduce((t,e)=>t+e,0)},Product:(...t)=>{if(0===t.length)throw new Error("must provide at least one number");return t.flat().map(t=>{const e=Number(t);if(isNaN(e))throw new Error("Product operator can't be used with non-numeric values");return e}).reduce((t,e)=>t*e,1)}}))}registerTimeFunctions(t){t.set("time",()=>({AsTime:t=>{if(!t)return null;if(t instanceof Date)return t;if("string"==typeof t){const e=new Date(t);return isNaN(e.getTime())?null:e}if("number"==typeof t){const e=new Date(t<1e10?1e3*t:t);return isNaN(e.getTime())?null:e}return null},Format:(t,e)=>{const n=e instanceof Date?e:new Date(e);if(isNaN(n.getTime()))return"";const r=n.getFullYear(),i=n.getMonth()+1,s=n.getDate(),a=n.getHours(),o=n.getMinutes(),l=n.getSeconds(),c=n.toLocaleString("en-US",{weekday:"short"}),h=n.toLocaleString("en-US",{month:"short"}),u=[{pattern:"2006",placeholder:"{{YEAR_FULL}}",value:r.toString()},{pattern:"January",placeholder:"{{MONTH_FULL}}",value:n.toLocaleString("en-US",{month:"long"})},{pattern:"Monday",placeholder:"{{WEEKDAY_FULL}}",value:n.toLocaleString("en-US",{weekday:"long"})},{pattern:"MST",placeholder:"{{TIMEZONE}}",value:n.toLocaleString("en-US",{timeZoneName:"short"})},{pattern:"Jan",placeholder:"{{MONTH_SHORT}}",value:h},{pattern:"Mon",placeholder:"{{WEEKDAY_SHORT}}",value:c},{pattern:"06",placeholder:"{{YEAR_SHORT}}",value:r.toString().slice(-2)},{pattern:"15",placeholder:"{{HOUR_24}}",value:a.toString().padStart(2,"0")},{pattern:"01",placeholder:"{{MONTH_ZERO}}",value:i.toString().padStart(2,"0")},{pattern:"02",placeholder:"{{DAY_ZERO}}",value:s.toString().padStart(2,"0")},{pattern:"04",placeholder:"{{MINUTE_ZERO}}",value:o.toString().padStart(2,"0")},{pattern:"05",placeholder:"{{SECOND_ZERO}}",value:l.toString().padStart(2,"0")},{pattern:"PM",placeholder:"{{AMPM_UPPER}}",value:a>=12?"PM":"AM"},{pattern:"pm",placeholder:"{{AMPM_LOWER}}",value:a>=12?"pm":"am"},{pattern:"3",placeholder:"{{HOUR_12}}",value:((a+11)%12+1).toString()},{pattern:"1",placeholder:"{{MONTH_NUM}}",value:i.toString()},{pattern:"2",placeholder:"{{DAY_NUM}}",value:s.toString()},{pattern:"4",placeholder:"{{MINUTE_NUM}}",value:o.toString()},{pattern:"5",placeholder:"{{SECOND_NUM}}",value:l.toString()}];let f=t;for(const{pattern:t,placeholder:e}of u){const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");f=f.replace(new RegExp(n,"g"),e)}for(const{placeholder:t,value:e}of u)f=f.replace(new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),e);return f},Now:()=>new Date,Parse:(t,e)=>{try{const t=new Date(e);return isNaN(t.getTime())?null:t}catch{return null}},Unix:t=>{const e=t instanceof Date?t:new Date(t);return Math.floor(e.getTime()/1e3)},UnixNano:t=>1e6*(t instanceof Date?t:new Date(t)).getTime()})),t.set("now",()=>{const t=new Date;return{Format:e=>{const n=t.getFullYear(),r=t.getMonth()+1,i=t.getDate(),s=t.getHours(),a=t.getMinutes(),o=t.getSeconds(),l=[{pattern:"2006",value:n.toString()},{pattern:"06",value:n.toString().slice(-2)},{pattern:"01",value:r.toString().padStart(2,"0")},{pattern:"1",value:r.toString()},{pattern:"02",value:i.toString().padStart(2,"0")},{pattern:"2",value:i.toString()},{pattern:"15",value:s.toString().padStart(2,"0")},{pattern:"3",value:(s%12||12).toString()},{pattern:"04",value:a.toString().padStart(2,"0")},{pattern:"4",value:a.toString()},{pattern:"05",value:o.toString().padStart(2,"0")},{pattern:"5",value:o.toString()}];let c=e;for(const{pattern:t,value:e}of l){const n=new RegExp(`\\b${t}\\b`,"g");c=c.replace(n,e)}return"2006"===e?n.toString():"06"===e?n.toString().slice(-2):"01"===e?r.toString().padStart(2,"0"):"02"===e?i.toString().padStart(2,"0"):"15"===e?s.toString().padStart(2,"0"):"04"===e?a.toString().padStart(2,"0"):"05"===e?o.toString().padStart(2,"0"):c},getTime:()=>t.getTime(),toString:()=>t.toString(),toISOString:()=>t.toISOString()}}),t.set("dateFormat",(t,e)=>e.toLocaleDateString())}registerCollectionFunctions(t){t.set("len",t=>Array.isArray(t)||"string"==typeof t?t.length:t&&"object"==typeof t?Object.keys(t).length:0),t.set("first",(t,e)=>Array.isArray(t)?t.slice(0,1):Array.isArray(e)?e.slice(0,t):[]),t.set("last",(t,e)=>Array.isArray(t)?t.slice(-1):Array.isArray(e)?e.slice(-t):[]),t.set("merge",(...t)=>{const e={};for(const n of t)n&&"object"==typeof n&&!Array.isArray(n)&&Object.assign(e,n);return e}),t.set("index",(t,...e)=>{try{return this.doIndex(t,e)}catch(n){return la.error(`Index of type ${typeof t} with args [${e.join(", ")}] failed:`,n),null}}),t.set("reverse",t=>Array.isArray(t)?[...t].reverse():t),t.set("append",(...t)=>{if(t.length<2)return t[0]||[];const e=Array.isArray(t[0])?[...t[0]]:[t[0]];for(let n=1;n<t.length;n++)Array.isArray(t[n])?e.push(...t[n]):e.push(t[n]);return e}),t.set("prepend",(t,...e)=>Array.isArray(t)?[...e,...t]:[...e,t]),t.set("seq",(...t)=>{if(t.length<1||t.length>3)throw new Error("invalid number of arguments to Seq");const e=t.map(t=>{const e=Number(t);if(isNaN(e))throw new Error("invalid arguments to Seq");return Math.floor(e)});let n,r=1,i=e[0];if(1===e.length){if(n=i,0===n)return[];n>0?i=1:(i=-1,r=-1)}else if(2===e.length)n=e[1],n<i&&(r=-1);else{if(r=e[1],n=e[2],0===r)throw new Error("'increment' must not be 0");if(i<n&&r<0)throw new Error("'increment' must be > 0");if(i>n&&r>0)throw new Error("'increment' must be < 0")}if(n<-1e5)throw new Error("size of result exceeds limit");const s=Math.floor((n-i)/r)+1;if(s<=0||s>2e3)throw new Error("size of result exceeds limit");const a=new Array(s);let o=i;for(let t=0;t<s&&(a[t]=o,o+=r,!(r<0&&o<n||r>0&&o>n));t++);return a}),t.set("sort",(t,...e)=>{if(null==t)throw new Error("sequence must be provided");let n;if(Array.isArray(t))n=[...t];else{if("object"!=typeof t||null===t)throw new Error("can't sort "+typeof t);n=Object.values(t)}if(0===n.length)return n;let r="",i=!0;for(let t=0;t<e.length;t++){const n=e[t];0===t?"string"==typeof n&&(r=n):1===t&&"string"==typeof n&&"desc"===n.toLowerCase()&&(i=!1)}const s=(t,e)=>{if(!e||"value"===e)return t;const n=e.split(".");let r=t;for(const t of n){if(null==r)return;if("object"!=typeof r)return;r=r[t]}return r};return n.sort((t,e)=>{let n=r?s(t,r):t,a=r?s(e,r):e;if(null==n)return null==a?0:i?-1:1;if(null==a)return i?1:-1;if("string"==typeof n&&"string"==typeof a){const t=n.localeCompare(a);return i?t:-t}if("number"==typeof n&&"number"==typeof a){const t=n-a;return i?t:-t}const o=String(n),l=String(a),c=o.localeCompare(l);return i?c:-c})}),t.set("where",(()=>(t,e,...n)=>{if(!t)return[];let r,i="==";if(1===n.length)r=n[0];else{if(2!==n.length)throw new Error("where function requires 2-4 arguments");i=n[0],r=n[1]}const s=[];if(Array.isArray(t))for(let n=0;n<t.length;n++){const a=t[n],o=this.getNestedValue(a,e);this.checkCondition(o,r,i)&&s.push(a)}else if("object"==typeof t)for(const[n,a]of Object.entries(t))if(Array.isArray(a)){const t=a.filter(t=>{const n=this.getNestedValue(t,e);return this.checkCondition(n,r,i)});t.length>0&&s.push({[n]:t})}return s})()),t.set("intersect",(t,e)=>Array.isArray(t)&&Array.isArray(e)?t.filter(t=>e.includes(t)):[]),t.set("querify",(...t)=>{let e=[];if(e=1===t.length&&Array.isArray(t[0])?t[0]:t,e.length%2!=0)throw new Error("querify requires an even number of arguments (key-value pairs)");const n=[];for(let t=0;t<e.length;t+=2){const r=String(e[t]),i=String(e[t+1]);n.push([r,i])}return n.sort((t,e)=>t[0].localeCompare(e[0])),n.map(([t,e])=>`${encodeURIComponent(t).replace(/%20/g,"+")}=${encodeURIComponent(e).replace(/%20/g,"+")}`).join("&")}),t.set("isset",(t,e)=>{if(null==t)return!1;if(Array.isArray(t)){const n=Number(e);return isNaN(n)||!Number.isInteger(n)?(console.warn(`isset unable to use key of type ${typeof e} as index`),!1):t.length>n&&n>=0}if("object"==typeof t)return e in t;if("string"==typeof t){const n=Number(e);return isNaN(n)||!Number.isInteger(n)?(console.warn(`isset unable to use key of type ${typeof e} as index`),!1):t.length>n&&n>=0}return console.warn(`calling isset with unsupported type "${typeof t}" (${t.constructor?.name||typeof t}) will always return false.`),!1})}doIndex(t,e){if(null==t)return null;if(0===e.length)return t;let n=t;for(const t of e){if(null==n)return null;if(Array.isArray(n))n=this.indexArray(n,t);else if("string"==typeof n)n=this.indexString(n,t);else{if("object"!=typeof n)throw new Error("can't index item of type "+typeof n);n=this.indexObject(n,t)}}return n}indexArray(t,e){const n=this.toInteger(e);if(null===n)throw new Error("cannot index slice/array with type "+typeof e);return n<0||n>=t.length?null:t[n]}indexString(t,e){const n=this.toInteger(e);if(null===n)throw new Error("cannot index string with type "+typeof e);return n<0||n>=t.length?null:t.charAt(n)}indexObject(t,e){const n=String(e);if(t.hasOwnProperty(n))return t[n];const r=Object.keys(t).find(t=>t.toLowerCase()===n.toLowerCase());if(r)return t[r];if(t instanceof Map){if(t.has(n))return t.get(n);for(const e of t.keys())if(String(e).toLowerCase()===n.toLowerCase())return t.get(e)}return null}toInteger(t){if("number"==typeof t)return Number.isInteger(t)?t:Math.floor(t);if("string"==typeof t){const e=parseInt(t,10);if(!isNaN(e))return e}return null}checkCondition(t,e,n){const r=n.toLowerCase().trim();if(null==t&&null==e)return["==","=","eq",""].includes(r);if(null==t||null==e)return["!=","<>","ne"].includes(r);if("in"===r)return(Array.isArray(e)||"string"==typeof e&&"string"==typeof t)&&e.includes(t);if("intersect"===r)return!(!Array.isArray(t)||!Array.isArray(e))&&t.some(t=>e.includes(t));const[i,s]=this.normalizeForComparison(t,e);switch(r){case"":case"=":case"==":case"eq":return i===s;case"!=":case"<>":case"ne":return i!==s;case"<":case"lt":return i<s;case"<=":case"le":return i<=s;case">":case"gt":return i>s;case">=":case"ge":return i>=s;default:return!1}}normalizeForComparison(t,e){if("number"==typeof t&&"number"==typeof e)return[t,e];if("number"==typeof t&&"string"==typeof e){const n=parseFloat(e);if(!isNaN(n))return[t,n]}if("string"==typeof t&&"number"==typeof e){const n=parseFloat(t);if(!isNaN(n))return[n,e]}return"string"==typeof t&&"string"==typeof e||"boolean"==typeof t&&"boolean"==typeof e?[t,e]:[String(t),String(e)]}registerSafeFunctions(t){t.set("return",(...t)=>0===t.length?"":1===t.length?t[0]:t),t.set("cond",(...t)=>{if(t.length<2)throw new Error("cond requires at least 2 arguments");const e=t[0],n=t[1],r=t.length>2?t[2]:"";let i=!1;return!0===e||1===e?i=!0:"string"==typeof e?i=e.length>0&&"false"!==e&&"0"!==e:"number"==typeof e?i=0!==e:Array.isArray(e)?i=e.length>0:e&&"object"==typeof e&&(i=Object.keys(e).length>0),i?n:r}),t.set("safeHTML",t=>t),t.set("safeCSS",t=>t),t.set("safeJS",t=>t),t.set("safeURL",t=>t),t.set("dict",(...t)=>{if(t.length%2!=0)throw new Error("dict requires an even number of arguments");const e={};for(let n=0;n<t.length;n+=2)e[String(t[n])]=t[n+1];return e}),t.set("slice",(...t)=>t),t.set("default",(t,e)=>null!=e&&""!==e&&0!==e?e:t),t.set("jsonify",(...t)=>{if(0===t.length)return"";let e,n={};if(1===t.length)e=t[0];else{if(2!==t.length)throw new Error("too many arguments to jsonify");{const r=t[0];e=t[1],r&&"object"==typeof r&&(n.prefix=r.prefix||"",n.indent=r.indent||"",n.noHTMLEscape=r.noHTMLEscape||!1)}}try{let t;return n.indent?(t=JSON.stringify(e,null,n.indent),n.prefix&&(t=t.split("\n").map(t=>n.prefix+t).join("\n"))):t=JSON.stringify(e),n.noHTMLEscape||(t=t.replace(/&/g,"\\u0026").replace(/</g,"\\u003c").replace(/>/g,"\\u003e")),t}catch(t){throw new Error(`failed to jsonify object: ${t.message}`)}})}registerFmtFunctions(t){t.set("printf",(t,...e)=>{let n=t,r=0;return n=n.replace(/%[vsdft%]/g,t=>{if("%%"===t)return"%";if(r>=e.length)return t;const n=e[r++];switch(t){case"%v":case"%s":default:return String(n);case"%d":return String(Math.floor(Number(n)||0));case"%f":return String(Number(n)||0);case"%t":return String(Boolean(n))}}),n}),t.set("print",(...t)=>t.map(t=>String(t)).join(" ")),t.set("println",(...t)=>t.map(t=>String(t)).join(" ")+"\n"),t.set("errorf",(t,...e)=>{let n=t;for(let t=0;t<e.length;t++)n=n.replace(/%[sd%]/,String(e[t]));return la.error("Template Error:",n),""}),t.set("warnf",(t,...e)=>{let n=t;for(let t=0;t<e.length;t++)n=n.replace(/%[sd%]/,String(e[t]));return la.warn("Template Warning:",n),""}),t.set("fmt",()=>({Print:(...t)=>t.map(t=>String(t)).join(" "),Printf:(t,...e)=>{let n=t;for(let t=0;t<e.length;t++)n=n.replace(/%[sd%]/,String(e[t]));return n},Println:(...t)=>t.map(t=>String(t)).join(" ")+"\n",Errorf:(t,...e)=>{let n=t;for(let t=0;t<e.length;t++)n=n.replace(/%[sd%]/,String(e[t]));return la.error("Template Error:",n),""},Erroridf:(t,e,...n)=>{let r=e;for(let t=0;t<n.length;t++)r=r.replace(/%[sd%]/,String(n[t]));return la.error("Template Error:",r),""},Warnf:(t,...e)=>{let n=t;for(let t=0;t<e.length;t++)n=n.replace(/%[sd%]/,String(e[t]));return la.error("Template Warning:",n),""},Warnidf:(t,e,...n)=>{let r=e;for(let t=0;t<n.length;t++)r=r.replace(/%[sd%]/,String(n[t]));return la.error("Template Warning:",r),""}}))}registerReflectFunctions(t){t.set("reflect",()=>({IsMap:t=>{if(null==t)return!1;if("object"!=typeof t||Array.isArray(t))return!1;if(t instanceof Map)return!0;if(t.constructor===Object)return!0;const e=Object.getPrototypeOf(t);return e===Object.prototype||null===e},IsSlice:t=>Array.isArray(t)}))}registerPathFunctions(t){t.set("path",()=>({Base:t=>{if(!t)return".";if(!(t=(t=t.replace(/\\/g,"/")).replace(/\/+$/,"")))return"/";const e=t.split("/");return e[e.length-1]||"/"},Clean:t=>{if(!t)return".";const e=(t=t.replace(/\\/g,"/")).startsWith("/"),n=t.split("/").filter(t=>t&&"."!==t),r=[];for(const t of n)".."===t?r.length>0&&".."!==r[r.length-1]?r.pop():e||r.push(".."):r.push(t);return t=r.join("/"),e&&(t="/"+t),t||(e?"/":".")},Dir:t=>{if(!t)return".";if(!(t=t.replace(/\/+$/,"")))return"/";const e=t.split("/");return e.pop(),e.join("/")||"."},Ext:t=>{const e=t.split("/").pop()||"",n=e.lastIndexOf(".");return-1===n||0===n?"":e.substring(n)},IsAbs:t=>t.startsWith("/"),Join:(...t)=>{if(0===t.length)return".";let e=t.filter(t=>t).map(t=>t.replace(/^\/+|\/+$/g,"")).join("/");return t[0]&&t[0].startsWith("/")&&(e="/"+e),e||"."},Split:t=>{if(!t)return[".",""];const e=t.lastIndexOf("/");return-1===e?["",t]:[t.substring(0,e),t.substring(e+1)]}}))}registerTransformFunctions(t){t.set("transform",()=>({Unmarshal:(...t)=>{if(t.length<1||t.length>2)throw new Error("unmarshal takes 1 or 2 arguments");let e,n,r={};if(1===t.length)e=t[0];else{const n=t[0];if(!n||"object"!=typeof n)throw new Error("first argument must be a map");r=n,e=t[1]}if(e&&"object"==typeof e&&"function"==typeof e.Content)try{const t=e.Content();return this.unmarshalContent(t,r)}catch(t){throw new Error(`failed to get content from resource: ${t.message}`)}if("string"==typeof e)n=e;else{if(!e||"function"!=typeof e.toString)throw new Error(`type ${typeof e} not supported`);n=e.toString()}return n&&""!==n.trim()?this.unmarshalContent(n,r):null},Plainify:t=>{const e=String(t);return this.stripHTML(e)}})),t.set("unmarshal",(...e)=>t.get("transform")().Unmarshal(...e)),t.set("plainify",t=>{const e=String(t);return this.stripHTML(e)})}stripHTML(t){if(!t.includes("<")&&!t.includes(">"))return t;let e=t.replace(/\n/g," ").replace(/<\/p>/gi,"\n").replace(/<br\s*\/?>/gi,"\n").replace(/<\/div>/gi,"\n").replace(/<\/h[1-6]>/gi,"\n").replace(/<\/li>/gi,"\n").replace(/<\/tr>/gi,"\n").replace(/<\/blockquote>/gi,"\n");e=e.replace(/<[^>]*>/g,"");const n=e.split("\n");return e=n.map(t=>t.trim().replace(/\s+/g," ")).filter(t=>t.length>0).join("\n").trim(),e=e.replace(/\n\s*\n/g,"\n"),e}unmarshalContent(t,e={}){const n=t.trim();if(!n)return null;let r=e.format;r||(r=this.detectFormat(n));try{switch(r.toLowerCase()){case"json":return JSON.parse(n);case"yaml":case"yml":return this.parseYAML(n);case"toml":return this.parseTOML(n);case"csv":return this.parseCSV(n);default:throw new Error(`format "${r}" not supported`)}}catch(t){throw new Error(`failed to unmarshal ${r}: ${t.message}`)}}detectFormat(t){const e=t.trim();if(e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]"))try{return JSON.parse(e),"json"}catch{}return e.startsWith("---")||/^[a-zA-Z_][a-zA-Z0-9_]*\s*:\s*.+/m.test(e)?"yaml":/^\[.*\]$/m.test(e)||/^[a-zA-Z_][a-zA-Z0-9_]*\s*=\s*.+/m.test(e)?"toml":/^[^,\n]*,[^,\n]*/.test(e)?"csv":"json"}parseYAML(t){const e=t.split("\n"),n={};for(const t of e){const e=t.trim();if(!e||e.startsWith("#")||"---"===e)continue;const r=e.indexOf(":");if(r>0){const t=e.substring(0,r).trim();let i=e.substring(r+1).trim();(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1)),"true"===i?n[t]=!0:"false"===i?n[t]=!1:/^\d+$/.test(i)?n[t]=parseInt(i,10):/^\d*\.\d+$/.test(i)?n[t]=parseFloat(i):n[t]=i}}return n}parseTOML(t){const e=t.split("\n"),n={};let r="";for(const t of e){const e=t.trim();if(!e||e.startsWith("#"))continue;if(e.startsWith("[")&&e.endsWith("]")){r=e.slice(1,-1),n[r]||(n[r]={});continue}const i=e.indexOf("=");if(i>0){const t=e.substring(0,i).trim();let s,a=e.substring(i+1).trim();(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))&&(a=a.slice(1,-1)),s="true"===a||"false"!==a&&(/^\d+$/.test(a)?parseInt(a,10):/^\d*\.\d+$/.test(a)?parseFloat(a):a),r?n[r][t]=s:n[t]=s}}return n}parseCSV(t){const e=t.trim().split("\n");if(0===e.length)return[];const n=this.parseCSVLine(e[0]),r=[];for(let t=1;t<e.length;t++){const i=this.parseCSVLine(e[t]),s={};for(let t=0;t<n.length;t++){const e=n[t],r=t<i.length?i[t]:"";/^\d+$/.test(r)?s[e]=parseInt(r,10):/^\d*\.\d+$/.test(r)?s[e]=parseFloat(r):s[e]="true"===r||"false"!==r&&r}r.push(s)}return r}parseCSVLine(t){const e=[];let n="",r=!1;for(let i=0;i<t.length;i++){const s=t[i];'"'===s?r&&'"'===t[i+1]?(n+='"',i++):r=!r:","!==s||r?n+=s:(e.push(n.trim()),n="")}return e.push(n.trim()),e}getNestedValue(t,e){if(!t||!e)return;const n=e.replace(/^\\.+/,"").split(".");let r=t;for(let t=0;t<n.length;t++){const e=n[t];if(null==r)return;if("object"==typeof r){if(r.hasOwnProperty(e)){r=r[e];continue}const t=Object.keys(r).find(t=>t.toLowerCase()===e.toLowerCase());if(t){r=r[t];continue}const n=e.toLowerCase();if("function"==typeof r[n])try{r=r[n]();continue}catch(t){return}return}return}return r}};function fa(){return new ua}var da=class{async create(t){return this.createWithConfig(t,{})}async createWithConfig(t,e){try{const n=(new pa).withFs(t).withNamespaces(new Ys,new Ks,new Xs);e.services?n.withServices(e.services):e.funcMap?n.withFuncMap(e.funcMap):n.withFuncMap(function(){const t=new Map;return fa().registerCoreFunctions(t),t}());const r=await n.buildLookup().buildParser().buildExecutor().build();return await r.markReady(),r}catch(t){const e=t instanceof Error?t.message:String(t);throw new qs(`Failed to create template engine: ${e}`,"FACTORY_CREATE_FAILED")}}async createWithServices(t,e){return this.createWithConfig(t,{services:e})}},pa=class{funcMap=new Map;services;fs;templateNamespace;partialNamespace;shortcodeNamespace;lookup;parser;executor;withFs(t){return this.fs=t,this}withNamespaces(t,e,n){return this.templateNamespace=t,this.partialNamespace=e,this.shortcodeNamespace=n,this}withFuncMap(t){return this.funcMap=new Map([...this.funcMap,...t]),this}withServices(t){return this.services=t,this.funcMap=function(t){const e=new Map;return fa().registerAllFunctions(e,t),e}(t),this}buildLookup(){const t=new Hs;return this.lookup=function(t,e){return new ia(t,e)}(t,this.funcMap),this}buildParser(){return this.parser=function(t=new Map){return new ra(t)}(this.funcMap),this}buildExecutor(){return this.executor=new Zs,this}async build(){if(!this.fs)throw new qs("File system is required","BUILDER_FS_REQUIRED");if(!this.templateNamespace)throw new qs("Template namespace is required","BUILDER_TEMPLATE_NAMESPACE_REQUIRED");if(!this.partialNamespace)throw new qs("Partial namespace is required","BUILDER_PARTIAL_NAMESPACE_REQUIRED");if(!this.shortcodeNamespace)throw new qs("Shortcode namespace is required","BUILDER_SHORTCODE_NAMESPACE_REQUIRED");if(!this.lookup)throw new qs("Lookup is required","BUILDER_LOOKUP_REQUIRED");if(!this.parser)throw new qs("Parser is required","BUILDER_PARSER_REQUIRED");if(!this.executor)throw new qs("Executor is required","BUILDER_EXECUTOR_REQUIRED");const t=(e=this.executor,n=this.lookup,r=this.parser,i=this.templateNamespace,s=this.partialNamespace,a=this.shortcodeNamespace,o=this.fs,new aa(e,n,r,i,s,a,o));var e,n,r,i,s,a,o;!function(t){for(const e of ca)try{e.updateEngine(t)}catch(t){la.error(`❌ Failed to update function ${e.getFunctionName()}:`,t)}}(t);try{await t.loadTemplates()}catch(t){const e=t instanceof Error?t.message:String(t);throw new qs(`Failed to load templates: ${e}`,"BUILDER_LOAD_TEMPLATES_FAILED")}return t}},ga=N("content",{component:"pagebuilder"}),ma=class{urlSvc;langSvc;taxonomySvc;templateSvc;pageMapper;taxonomy;term;section;standalone;converter;contentHub;source;sourceByte;kind;singular;term_;langIdx;fm;fmParser;c;renderableDocument=null;constructor(t,e,n,r,i,s,a,o,l,c,h){this.urlSvc=t,this.langSvc=e,this.taxonomySvc=n,this.templateSvc=r,this.pageMapper=null,this.taxonomy=s,this.term=a,this.section=o,this.standalone=l,this.converter=c,this.contentHub=h,this.source=null,this.sourceByte=new Uint8Array,this.kind="",this.singular="",this.term_="",this.langIdx=-1,this.fm=null,this.fmParser=null,this.c=null}withSource(t){const e=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return e.reset(),e.source=t,e}withLangIdx(t){return this.langIdx=t,this}reset(){this.c=null,this.kind="",this.langIdx=-1}async build(){if(!this.source)throw new Error("source for page builder is nil");const t=await this.source.contentSource();this.sourceByte=t,await this.parse(t);const e=await this.buildInternal();return await this.render(e),e}async kindBuild(){if(!this.source)throw new Error("source for page builder is nil");return await this.parseKind(),-1===this.langIdx?await this.parseLanguageByDefault():await this.parseLanguageByIdx(this.langIdx),this.fm={path:"",lang:"",kind:"",title:"",description:"",weight:999,terms:{},params:{}},this.c=ks(new Uint8Array),await this.buildInternal()}async buildInternal(){switch(this.kind){case hi("home"):return await this.buildHome();case hi("section"):return await this.buildSection();case hi("page"):return await this.buildPage();case hi("taxonomy"):return await this.buildTaxonomy();case hi("term"):return await this.buildTerm();case hi("404"):return await this.build404();case hi("sitemap"):return await this.buildSitemap();default:throw new Error(`unknown kind "${this.kind}"`)}}async buildPage(){const t=await this.newPage(this.source,this.c);return await this.applyFrontMatter(t),t.pageMap=this.pageMapper,await this.buildOutput(t),await this.adaptPagination(t),t}async buildPageWithKind(t){const e=await this.newPage(this.source,this.c);if(await this.applyFrontMatter(e),e.pageMap=this.pageMapper,e.kind_=t,t===hi("sitemap")||t===hi("404")){const t=e.meta;t&&(t.list="never")}return await this.buildOutput(e),e}async applyFrontMatter(t){if(this.fm){t.title_=this.fm.title,t.description_=this.fm.description;const e=t.meta;e&&(e.weight=this.fm.weight,e.parameters=this.fm.params||{},this.fm.date&&(e.date=this.fm.date),void 0!==this.fm.organization&&(e.org=this.fm.organization),void 0!==this.fm.author&&(e.authorInfo=this.fm.author),void 0!==this.fm.menu&&(e.menuConfig=this.fm.menu))}}async buildHome(){const t=await this.buildPageWithKind(hi("home"));return await this.buildPagination(t),t}async buildSection(){const t=await this.buildPageWithKind(hi("section"));return await this.buildPagination(t),t}async build404(){const t=await this.buildPageWithKind(hi("404"));return await this.adaptPagination(t),t}async buildSitemap(){const t=await this.buildPageWithKind(hi("sitemap"));return await this.adaptPagination(t),t}async buildTaxonomy(){const t=this.taxonomy.getTaxonomy(this.source.file.paths().path()),e=t?t.singular():"",n=await this.newTaxonomy(this.source,this.c,e);return n.pageMap=this.pageMapper,await this.buildOutput(n),await this.buildPagination(n),n}async buildTerm(){const t=this.source.file.paths(),e=this.taxonomy.getTaxonomy(t.path()),n=e?e.singular():"",r=t.unnormalized().baseNameNoIdentifier(),i=await this.newTerm(this.source,this.c,n,r);return i.pageMap=this.pageMapper,await this.buildOutput(i),await this.buildPagination(i),i}async render(t){if(this.c?.lazyRendered)return void(this.c.lazyRender=async()=>{const e=await(this.renderableDocument?.render({maxSummaryLength:300,wordsPerMinute:200,shortcodeRenderer:this.createShortcodeRenderer(t)}));this.c?.updateWithContentResult(e)});const e=await(this.renderableDocument?.render({maxSummaryLength:300,wordsPerMinute:200,shortcodeRenderer:this.createShortcodeRenderer(t)}));this.c?.updateWithContentResult(e)}async parse(t){this.renderableDocument=await this.converter.prepareRender(t),this.c=ks(t),this.c.toc=this.renderableDocument.toc(),this.fmParser=new Pi(this.renderableDocument.frontMatter(),this.langSvc,this.taxonomySvc),await this.parseFrontMatter(),await this.parseLanguage(),await this.parseKind(),await this.parseTerms()}async parseTerms(){this.fm&&this.fm.terms&&(this.term.terms=this.fm.terms)}async parseKind(){const t=this.source.file.paths();let e="";if(this.fm&&(e=this.fm.kind||""),""===e)switch(e=hi("page"),t.baseNoLeadingSlash()){case"/":case"":e=hi("home");break;case"404":e=hi("404");break;case xs:e=hi("sitemap");break;default:if(this.source.file.isBranchBundle()){e=hi("section");const n=this.taxonomy.getTaxonomy(t.path());this.taxonomy.isZero(n)||(e=this.taxonomy.isTaxonomyPath(t.path())?hi("taxonomy"):hi("term"))}}this.kind=e}async parseLanguageByDefault(){const t=this.langSvc.defaultLanguage(),e=await this.langSvc.getLanguageIndex(t);this.source.identity.lang=t,this.source.identity.langIdx=e}async parseLanguageByIdx(t){const e=this.langSvc.getLanguageByIndex(t);this.source.identity.lang=e,this.source.identity.langIdx=t}async parseLanguage(){const[t,e]=this.langSvc.getSourceLang(this.source.file.fileInfo().root());if(e){const e=this.langSvc.getLanguageIndex(t);return this.source.identity.lang=t,void(this.source.identity.langIdx=e)}await this.parseLanguageByDefault()}async parseFrontMatter(){this.fmParser?this.fm=await this.fmParser.parse(this.urlSvc.baseUrl()):this.fm={path:"",lang:"",kind:"",title:"",description:"",weight:999,terms:{},params:{}}}createShortcodeRenderer(t){return async e=>{if(!this.templateSvc)return ga.warn(`Template service not available for shortcode: ${e.name}`),"";try{return e.name?await this.doRenderShortcode(e,null,0,t):(ga.warn("Shortcode missing name"),"")}catch(t){return ga.error(`Error rendering shortcode "${e.name}":`,t),""}}}async doRenderShortcode(t,e,n,r){if(t.inline)return ga.warn("Inline shortcodes are not supported yet."),"";let i=new Us(t.params||{},"",r,e,t.name,"object"==typeof t.params&&!Array.isArray(t.params),t.ordinal||0,t.indentation||"",t.pos||0);if(t.inner&&t.inner.length>0){let s="";for(const e of t.inner)if("string"==typeof e)s+=e;else{if("object"!=typeof e||!("name"in e))return ga.error(`Illegal state on shortcode rendering of "${t.name}". Illegal type in inner data: ${typeof e}`),"";s+=await this.doRenderShortcode(e,i,n+1,r)}if(t.doMarkup)try{const n=await this.renderShortcodeMarkdown(r,s);i=new Us(t.params||{},n,r,e,t.name,"object"==typeof t.params&&!Array.isArray(t.params),t.ordinal||0,t.indentation||"",t.pos||0)}catch(t){throw new Error(`Failed to process inner content: ${t}`)}else i=new Us(t.params||{},s,r,e,t.name,"object"==typeof t.params&&!Array.isArray(t.params),t.ordinal||0,t.indentation||"",t.pos||0)}try{let e=await(this.templateSvc?.execute(t.name,i));if(!t.inner?.length&&t.indentation){const n=e?.split("\n");e=n?.map((e,n)=>0===n?e:t.indentation+e).join("\n")}return e||""}catch(e){if(e instanceof qs&&"SHORTCODE_NOT_FOUND"===e.code)return t.rawContent;throw new Error(`Failed to process shortcode: ${e instanceof Error?e.message:String(e)}`)}}async renderShortcodeMarkdown(t,e){try{const n={document:t,documentID:t.path(),documentName:t.name(),filename:t.pageFile().filename()},r={ctx:{},src:(new TextEncoder).encode(e),renderTOC:!1,getRenderer:()=>null},i=await this.converter.convert(n,r);let s=(new TextDecoder).decode(i.bytes());return s.includes("\n")||(s=s.replace(/^<p>(.*)<\/p>\n$/,"$1")),s}catch(t){return ga.error("Error rendering shortcode markdown:",t),""}}async buildPagination(t){const e=new Ls({pageSize:()=>10,globalRegularPages:async()=>this.contentHub?await this.contentHub.globalRegularPages():[]},t);t.pagerManager=e}async adaptPagination(t){const e={current:()=>new Ds([],0,10,t.path()).pagers()[0],setCurrent:e=>{throw new Error(`pagination not supported for this page: ${t.path()}`)},paginator:async()=>{throw new Error(`pagination not supported for this page: ${t.path()}`)},paginate:async e=>{throw new Error(`pagination not supported for this page: ${t.path()}`)}};t.pagerManager=e}async buildOutput(t){}async newPage(t,e){const n=new Fs(this.urlSvc.baseUrl(),"always",{},0,t.file.fileInfo().modTime()),r=new $s;return new Os(t,e,n,r,"",hi("page"),this.pageMapper)}async newTaxonomy(t,e,n){const r=new Fs(this.urlSvc.baseUrl(),"always",{},0,t.file.fileInfo().modTime()),i=new $s;return new Is(t,e,r,i,n,n,hi("taxonomy"),this.pageMapper)}async newTerm(t,e,n,r){const i=new Fs(this.urlSvc.baseUrl(),"always",{},0,t.file.fileInfo().modTime()),s=new $s;return new Ms(t,e,i,s,n,r,r,hi("term"),this.pageMapper)}},wa=m(require("path")),ya=m(require("path")),ba=class{views;fsSvc;constructor(t,e){this.views=t,this.fsSvc=e}async assemble(t,e,n){for(const r of this.views){const i=this.pluralTreeKey(r.plural()),s=(t.get(i),is(mi(this.fsSvc.newFileMetaInfo(i+"/_index.md")))),a=await e.withSource(s).withLangIdx(n).kindBuild();t.insertIntoValuesDimension(i,ts(a))}}isTaxonomyPath(t){const e=this.getTaxonomy(t);return!!e&&t===wa.join(this.pluralTreeKey(e.plural()),"_index.md")}pluralTreeKey(t){return function(...t){let e="";return t.length>0&&(e=t[0],t.length>1&&(e=wa.join(...t))),e=e.replace(/^[\.\/ \s]+|[\.\/ \s]+$/g,""),e=ya.posix.normalize(e.toLowerCase().replace(/[^\w\-_\/]/g,"")),""===e||"/"===e?"":("/"!==e[0]&&(e="/"+e),e)}(t)}getTaxonomy(t){for(const e of this.views)if(t.startsWith(this.pluralTreeKey(e.plural())))return e;return null}isZero(t){return!t||""===t.singular()}};j();var va=N("content",{component:"term"});function Ea(t){return t?Array.isArray(t)?t.map(t=>String(t)):"string"==typeof t?[t]:[String(t)]:null}function ka(t){if("number"==typeof t)return Math.floor(t);if("string"==typeof t){const e=parseInt(t,10);if(isNaN(e))throw new Error(`cannot convert "${t}" to int`);return e}throw new Error(`cannot convert ${typeof t} to int`)}var Sa=class{terms;fsSvc;constructor(t){this.terms={},this.fsSvc=t}async assemble(t,e,n,r){const i=new Vi({tree:t,lockType:2,handle:async(i,s,a)=>{const[o,l]=s.getPage();if(!l)return[!1,null];for(const s of n.taxonomy.views){const a=Ea(Ri(o.params(),s.plural(),!1));if(!a)continue;const l=Li(o.params(),s.plural()+"_weight");let c=0;if(null==l||""===l)c=0;else try{c=ka(l)}catch(t){va.warn(`Unable to convert taxonomy weight ${l} to int for "${o.paths().path()}"`)}for(let l=0;l<a.length;l++){const h=a[l];if(""===h)continue;const u="/"+s.plural()+"/"+h;try{const a=mi(this.fsSvc.newFileMetaInfo(u+"/_index.md")),f=a.paths(),d=is(a),p=await n.withSource(d).withLangIdx(r).kindBuild();t.insertIntoValuesDimension(f.base(),ts(p));const g=t.get(f.base());if(g){const[t,e]=g.getPage();if(!e)return[!1,null];const n=t;n.term=h,n.singular=s.singular()}let m=i;""===m&&(m="/");const w=f.base()+m,[y,b]=g.getPage();if(!b)return[!1,null];e.insert(w,new Zi(ts(o),{page:y,ordinal:l,weight:c,Weight:()=>c,Ordinal:()=>l}))}catch(t){return[!1,t]}}}return[!1,null]}});try{return await i.walk(),null}catch(t){return t}}},Ta=m(require("path"));j(),j(),N("site",{component:"pager"});var xa=class t{page;pager;constructor(t,e){this.page=t,this.pager=e}pageNumber(){return this.pager.pageNumber()}totalPages(){return this.pager.totalPages()}url(){return this.pager.url()}pages(){return this.pager.pages()}allPages(){return this.pager.allPages()}pagers(){return this.pager.pagers()}first(){return this.pager.first()}last(){return this.pager.last()}hasPrev(){return this.pager.hasPrev()}prev(){return this.pager.prev()}hasNext(){return this.pager.hasNext()}next(){return this.pager.next()}get PageNumber(){return this.pageNumber()}get TotalPages(){return this.totalPages()}get URL(){let t=this.url();return t.startsWith("/")&&(t=t.slice(1)),this.page.Site.getURL().relURL(t)}get HasPrev(){return this.hasPrev()}get HasNext(){return this.hasNext()}get First(){const e=this.first();return e?new t(this.page,e):null}get Last(){const e=this.last();return e?new t(this.page,e):null}get Prev(){const e=this.prev();return e?new t(this.page,e):null}get Next(){const e=this.next();return e?new t(this.page,e):null}get Pagers(){return this.pagers().map(e=>new t(this.page,e))}get Pages(){const t=this.pages();return this.page.sitePages(t)}get AllPages(){const t=this.pager.allPages();return this.page.sitePages(t)}},Aa=N("site",{component:"page"}),Ca=class t{tmplSvc;langSvc;publisher;contentPage;pageOutput=null;site;resources=[];ot=null;ct=null;constructor(t,e,n,r,i){this.tmplSvc=t,this.langSvc=e,this.publisher=n,this.contentPage=r,this.site=i}async processResources(t){this.resources=t}async render(){try{await this.renderResources(),await this.renderPage()}catch(t){Aa.error(`Failed to render page ${this.paths().path()}: ${t}`)}}getPageOutput(){return this.pageOutput||(this.pageOutput=this.output()),this.pageOutput}async renderPage(){const t=this.layouts(),{preparer:e,found:n}=await this.tmplSvc.lookupLayout(t);if(!n)return void Aa.warn(`Failed to find layout: ${t.join(",")} for page ${this.paths().path()}`);const r=[];let i=this.getPageOutput().targetPrefix();i=this.site.getLanguage().getCurrentLanguage()===i&&i===this.langSvc.defaultLanguage()?"":this.site.getLanguage().getCurrentLanguage(),r.push(Ta.default.join(i,this.getPageOutput().targetFilePath())),await this.renderAndWritePage(e,r);const s=await this.current();if(s){let t=s.next();for(;t;){this.setCurrent(t);const n=[Ta.default.join(i,t.url(),this.getPageOutput().targetFileBase())];await this.renderAndWritePage(e,n),t=t.next()}}}async renderAndWritePage(t,e){try{const n=await this.tmplSvc.executeWithContext(t,this);await this.publisher.publishSource(n,...e)}catch(t){throw this.errorf(t,"failed to publish page")}}async renderResources(){for(const t of this.resources){const e=[];let n=this.getPageOutput().targetPrefix();n=this.site.getLanguage().getCurrentLanguage()===n&&n===this.langSvc.defaultLanguage()?"":this.site.getLanguage().getCurrentLanguage();let r=t.path();e.push(Ta.default.join(n,r));let i=null;try{const n=()=>t.pageFile().open();if(i=await n(),!i)throw new Error("Failed to open resource stream");let r;r="function"==typeof i.read?new ReadableStream({async start(t){try{const e=new Uint8Array(8192);for(;;){const n=await i.read(e);if(0===n.bytesRead)break;t.enqueue(e.slice(0,n.bytesRead))}t.close()}catch(e){t.error(e)}}}):new ReadableStream({start(t){t.close()}}),await this.publisher.publishFiles(r,...e)}catch(t){throw this.errorf(t,"failed to publish page resources")}finally{if(i)try{await i.close()}catch(t){Aa.warn(`Failed to close resource stream: ${t}`)}}}}errorf(t,e,...n){const r=[this.pageIdentity().pageLanguage(),this.paths().path(),...n],i=`[%s] page "%s": ${e}: %s`,s=this.sprintf(i,...r,t.message||t);return new Error(s)}sprintf(t,...e){let n=0;return t.replace(/%s/g,()=>e[n++]||"")}clone(){const e=new t(this.tmplSvc,this.langSvc,this.publisher,this.contentPage,this.site);return e.resources=[...this.resources],e.pageOutput=this.pageOutput,e}pageIdentity(){return this.contentPage.pageIdentity()}pageFile(){return this.contentPage.pageFile()}staleVersions(){return this.contentPage.staleVersions()}section(){return this.contentPage.section()}paths(){return this.contentPage.paths()}path(){return this.contentPage.path()}slug(){return this.contentPage.slug()}file(){return this.contentPage.file()}name(){return this.contentPage.name()}title(){return this.contentPage.title()}kind(){return this.contentPage.kind()}scratch(){return this.contentPage.scratch()}get Scratch(){return this.contentPage.scratch()}IsAncestor(t){return this.contentPage.isAncestor(t.contentPage)}get Title(){return this.title()}get Section(){return this.contentPage.section()}get LinkTitle(){return this.title()}get IsSection(){return this.contentPage.isSection()}get IsPage(){return this.contentPage.isPage()}get Content(){return this.getPageOutput().content()}async WikilinkContent(){if(null!==this.ct)return this.ct;const t=await this.getPageOutput().content();return t?(this.ct=await this.site.ProcessWikilinks(this.slug(),t),this.ct):t}async Summary(){return this.contentPage.output().summary()}async ReadingTime(){return await this.getPageOutput().readingTime()}async WordCount(){return await this.getPageOutput().wordCount()}async Backlinks(){const t=this.site.GetBacklinks(this.slug()),e=[],n=await this.site.RegularPages();for(const r of t){const t=n.find(t=>t.slug()===r);t&&e.push(t)}return e}OutgoingLinks(){const t=this.site.getPageGraph();return t?t.getOutgoingLinks(this.slug()):[]}get Description(){return this.description()}get Date(){return this.pageDate()}get LocalDate(){return this.pageDate().toLocaleDateString()}get RelPermalink(){let t;if(this.pageIdentity().pageLanguage()===this.langSvc.defaultLanguage())t=this.getPageOutput().targetFilePath();else{const e=this.getPageOutput().targetPrefix(),n=this.getPageOutput().targetFilePath();t=this.pathJoin(e,n)}return t.startsWith("/")&&(t=t.slice(1)),this.site.getURL().relURL(t)}get GitInfo(){return{}}get File(){return{BaseFileName:this.contentPage.file().baseFileName(),OriginalBaseName:this.contentPage.file().originalBaseFileName(),Dir:this.contentPage.file().dir()}}isHome(){return this.contentPage.isHome()}get IsHome(){return this.isHome()}isPage(){return this.contentPage.isPage()}isSection(){return this.contentPage.isSection()}isAncestor(t){return this.contentPage.isAncestor(t)}eq(t){return this.contentPage.eq(t)}isBundled(){return this.contentPage.isBundled()}layouts(){return this.contentPage.layouts()}output(){return this.contentPage.output()}pageOutputs(){return[this.contentPage.output()]}truncated(){return this.contentPage.truncated()}get Truncated(){return this.contentPage.truncated()}parent(){return this.contentPage.parent()}pages(){return this.contentPage.pages()}isStale(){return this.contentPage.pageIdentity().isStale()}clearStale(){this.contentPage.pageIdentity().clearStale()}prevInSection(){return this.contentPage.prevInSection()}nextInSection(){return this.contentPage.nextInSection()}sections(t){return this.contentPage.sections(t)}regularPages(){return this.contentPage.regularPages()}regularPagesRecursive(){return this.contentPage.regularPagesRecursive()}terms(t,e){return this.contentPage.terms(t,e)}isTranslated(){return this.contentPage.isTranslated()}translations(){return this.contentPage.translations()}rawContent(){return this.contentPage.rawContent()}description(){return this.contentPage.description?this.contentPage.description():""}params(){return this.contentPage.params?this.contentPage.params():{}}pageBaseUrl(){return this.contentPage.pageBaseUrl()?this.contentPage.pageBaseUrl():""}pageWeight(){return this.contentPage.pageWeight?this.contentPage.pageWeight():0}pageDate(){return this.contentPage.pageDate?this.contentPage.pageDate():new Date}publishDate(){return this.contentPage.publishDate?this.contentPage.publishDate():new Date}get PublishDate(){return this.publishDate()}async relatedKeywords(t){return this.contentPage.relatedKeywords?await this.contentPage.relatedKeywords(t):[]}shouldList(t){return!this.contentPage.shouldList||this.contentPage.shouldList(t)}shouldListAny(){return!this.contentPage.shouldListAny||this.contentPage.shouldListAny()}noLink(){return!!this.contentPage.noLink&&this.contentPage.noLink()}organization(){return this.contentPage.organization?this.contentPage.organization():void 0}author(){return this.contentPage.author?this.contentPage.author():void 0}menu(){return this.contentPage.menu?this.contentPage.menu():void 0}current(){return this.contentPage.current()}setCurrent(t){this.contentPage.setCurrent(t)}posOffset(t){return this.contentPage.posOffset(t)}paginator(){return this.contentPage.paginator()}async paginate(t){return this.contentPage.paginate(t)}get Plain(){return this.rawContent()}get TableOfContents(){return this.getPageOutput().tableOfContents()}get Params(){return this.params()}get Site(){return this.site}get Sites(){return{First:this.site,Default:this.site}}get Lastmod(){return this.contentPage.pageDate?this.contentPage.pageDate():null}get Sitemap(){return{ChangeFreq:"weekly",Priority:.5,Filename:"sitemap.xml"}}get IsTranslated(){return this.isTranslated()}async Paginator(){return this.ot||await this.setupCurrentPaginator(),this.ot}async Paginate(t){try{const e=t.map(t=>t.contentPage),n=await this.contentPage.paginate(e);return n&&(this.ot=new xa(this,n)),this.ot}catch(t){return Aa.error("Error during pagination:",t),null}}async setupCurrentPaginator(){try{const t=await this.contentPage.paginator();this.ot=t?new xa(this,t):null}catch(t){Aa.error("Error initializing Paginator:",t),this.ot=null}}get Language(){return{Lang:this.pageIdentity().pageLanguage(),LanguageName:this.langSvc.getLanguageName(this.pageIdentity().pageLanguage()),Title:this.title(),Weight:this.pageWeight()}}get Permalink(){return this.RelPermalink}sitePages(t){const e=[];for(const n of t){const t=this.sitePage(n);t&&e.push(t)}return e}sitePage(e){try{return null===e?(Aa.warn(`Invalid content page provided: ${e}`),null):new t(this.tmplSvc,this.langSvc,this.publisher,e,this.site)}catch(t){return Aa.error(`Error creating site page: ${t}`),null}}pathJoin(...t){return t.filter(t=>t&&t.length>0).map(t=>t.replace(/^\/+|\/+$/g,"")).filter(t=>t.length>0).join("/")}joinURL(t,e){return t?e?(t.endsWith("/")&&(t=t.slice(0,-1)),e.startsWith("/")||(e="/"+e),t+e):t:e}async Translations(){const t=await this.translations();return Array.isArray(t)?t.map(t=>this.sitePage(t)).filter(t=>null!==t):[]}async GetTerms(t){const e=await this.terms(this.site.getLanguage().currentLanguageIndex(),t);return Array.isArray(e)?e.map(t=>this.sitePage(t)).filter(t=>null!==t):[]}async Pages(){return await this.getSitePages()}get Page(){return this.contentPage}get Kind(){return this.kind()}get Type(){if("home"===this.kind())return"page";if("page"===this.kind()){const t=this.section();if(t&&t.length>0)return t}return"page"}get Parent(){return this.sitePage(this.contentPage.parent())}async getSitePages(){const t=await this.contentPage.pages();return!t||Array.isArray(t)&&0===t.length?[]:this.sitePages(t)}},Da=class t{url;withPath;withPathNoTrailingSlash;withoutPath;basePath;basePathNoTrailingSlash;isRelative;constructor(t,e=!1){if(this.url=t,this.isRelative=e,this.withPath=t.toString(),this.withPathNoTrailingSlash=this.withPath.replace(/\/$/,""),e)this.withoutPath="/";else{const e=new URL(t.toString());e.pathname="",this.withoutPath=e.toString().replace(/\/$/,"")}this.basePath=t.pathname,this.basePathNoTrailingSlash=this.basePath.replace(/\/$/,"")}static fromString(e){try{e&&"/"!==e||(e="/");const n=e.trim();if(n.startsWith("/")&&!n.startsWith("//")){const e=new URL(n,"http://localhost");return e.pathname.endsWith("/")||(e.pathname+="/"),new t(e,!0)}if(n.startsWith("//")){const e=new URL("https:"+n);return e.pathname.endsWith("/")||(e.pathname+="/"),new t(e)}if(n.includes("://")){const e=new URL(n);if(!["http:","https:"].includes(e.protocol))throw new Error(`Unsupported protocol: ${e.protocol}. Only http and https are supported.`);return e.pathname.endsWith("/")||(e.pathname+="/"),new t(e)}if(n.includes(":")&&!n.includes("/")){const t=n.indexOf(":"),e=n.substring(0,t+1);throw new Error(`Unsupported protocol: ${e}. Only http and https are supported.`)}const r=new URL("https://"+n);return r.pathname.endsWith("/")||(r.pathname+="/"),new t(r)}catch(t){throw new Error(`Invalid URL: ${t?.message||"Unknown error"}`)}}getRoot(t){return this.isRelative?this.basePath:t.startsWith("/")?this.withoutPath:this.withPath}toString(){return this.isRelative?this.basePath:this.withPath}path(){return this.url.pathname}port(){return this.url.port?parseInt(this.url.port):0}hostURL(){return this.isRelative?"/":this.toString().replace(this.path(),"")}protocol(){return this.url.protocol}host(){return this.url.host}hostname(){return this.url.hostname}getURL(){return new URL(this.url.toString())}withProtocol(e){if(this.isRelative)throw new Error("Cannot change protocol of relative URL");const n=this.getURL();let r=e;const i=r.endsWith("://"),s=r.endsWith(":");if(i?r=r.slice(0,-3):s&&(r=r.slice(0,-1)),s&&!n.pathname)throw new Error(`cannot determine BaseURL for protocol ${e}`);return n.protocol=r,t.fromString(n.toString())}withPort(e){if(this.isRelative)throw new Error("Cannot set port on relative URL");const n=this.getURL();return n.port=e.toString(),t.fromString(n.toString())}isRelativeURL(){return this.isRelative}isAbsoluteURL(){return!this.isRelative}},Pa=class t{base;canonical;baseURL=null;constructor(t,e=!1){this.base=t,this.canonical=e,this.setup()}setup(){try{this.baseURL=Da.fromString(this.base)}catch(t){throw new Error(t?.message||"Failed to setup URL")}}isAbsURL(t){return t.startsWith("http://")||t.startsWith("https://")?[!0,null]:[/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(t),null]}startWithBaseUrlRoot(t){return!!this.baseURL&&t.startsWith(this.baseURL.getRoot(t))}isProtocolRelPath(t){return t.startsWith("//")}trimBaseUrlRoot(t){if(!this.baseURL)return t;const e=this.baseURL.getRoot(t);return t.endsWith(e)?t.slice(0,-e.length):t}addContextRoot(t){if(!this.baseURL)return t;let e=t;return this.canonical||(r=t,e=!(n=this.baseURL.getRoot(t))||r.startsWith(n)?r:function(...t){return t.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/\/$/,"")}(n,r)),e;var n,r}handleRootSuffix(t,e){return this.baseURL?(""===t&&this.baseURL.getRoot(t).endsWith("/")&&(e+="/"),e):e}handlePrefix(t){return t.startsWith("/")||(t="/"+t),t}relURL(t){if(!t)return this.baseURL?this.baseURL.basePath:"";const[e,n]=this.isAbsURL(t);if(n)return t;if(e||this.isProtocolRelPath(t))return t;if(!this.baseURL)return t;let r=t;if(t.startsWith("/"))return this.baseURL.isRelativeURL()?t:this.baseURL.withoutPath+t;if(r=this.baseURL.isRelativeURL()?(this.baseURL.basePath.endsWith("/")?this.baseURL.basePath:this.baseURL.basePath+"/")+t:(this.baseURL.withPath.endsWith("/")?this.baseURL.withPath:this.baseURL.withPath+"/")+t,r.includes("://")){const t=r.indexOf("://"),e=r.substring(0,t+3),n=r.substring(t+3);r=e+n.replace(/\/+/g,"/")}else r=r.replace(/\/+/g,"/");return r}absURL(t,e=!1,n=""){const[r,i]=this.isAbsURL(t);if(i)return t;if(r||this.isProtocolRelPath(t))return t;if(!this.baseURL)return t;const s=this.baseURL.getRoot(t);if(e&&n){let e=!1,r=t;if(t.startsWith("/")&&(r=t.slice(1)),e=r===n||r.startsWith(n+"/"),!e){const e=""===t||t.endsWith("/");t=this.joinPaths(n,t),e&&(t+="/")}}return function(t,e){const n=`${t.replace(/\/$/,"")}/${e.replace(/^\//,"")}`;try{return new URL(n)}catch{return new URL("http://"+n)}}(s,t).toString()}urlize(t){return this.urlEscape(this.makePathSanitized(t))}makePathSanitized(t){return this.makePath(t).toLowerCase()}urlEscape(e){try{if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e))return new t(e).toString();const n=e.match(/^([^?#]*)(\?[^#]*)?(#.*)?$/);if(!n)return encodeURI(e);const[,r="",i="",s=""]=n;return encodeURI(r)+(i||"")+(s||"")}catch{return encodeURI(e)}}makePath(t){let e=function(t){return t.replace(/[\s\t\n\r]+/g,"-").replace(/[^\w\-_]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}(t);return e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),e}basePathNoSlash(){return this.baseURL?this.baseURL.basePathNoTrailingSlash:""}joinPaths(...t){return t.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/\/$/,"")}};j(),G(),j(),N("site",{component:"menu"});var La=class t{ht;ut;ft;wt;yt;constructor(t){this.ht=t.title,this.ut=t.url,this.ft=t.children||[],this.wt=t.weight||0,this.yt=t.identifier||this.ut}title(){return this.ht}get Title(){return this.title()}url(){return this.ut}get URL(){return this.url()}children(){return[...this.ft]}get Children(){return this.children()}weight(){return this.wt}identifier(){return this.yt}hasChildren(){return this.ft.length>0}get HasChildren(){return this.hasChildren()}addChild(e){const n=[...this.ft,e];return new t({title:this.ht,url:this.ut,children:n,weight:this.wt,identifier:this.yt})}toJSON(){return{title:this.ht,url:this.ut,weight:this.wt,children:this.ft.map(t=>t.toJSON())}}withChildren(e){return new t({title:this.ht,url:this.ut,children:e,weight:this.wt,identifier:this.yt})}},Ra=class{bt;vt;constructor(t={}){this.bt=t.nav?this.sortMenus([...t.nav]):[],this.vt=t.footer?this.sortMenus([...t.footer]):[]}nav(){return[...this.bt]}get Nav(){return this.nav()}footer(){return[...this.vt]}get Footer(){return this.footer()}sortMenus(t){return t.sort((t,e)=>{if(t.weight()!==e.weight())return 0===e.weight()?-1:0===t.weight()?1:t.weight()-e.weight();const n=t.title().localeCompare(e.title());return 0!==n?n:t.identifier().localeCompare(e.identifier())})}toJSON(){return{nav:this.bt.map(t=>t.toJSON()),footer:this.vt.map(t=>t.toJSON())}}};function Na(){return new Ra({})}var _a=require("github-slugger");function Oa(t){let[e,n]=t.split("#",2);return e.endsWith(".pdf")?[e,void 0===n?"":`#${n}`]:(n=void 0===n?"":"#"+(0,_a.slug)(n),[e,n])}function Ia(t){const e=ja((Ba(n=t,"index")&&(n=n.slice(0,-5)),n),!0);var n;return 0===e.length?"/":e}function Ma(t){let e=t.split("/").filter(t=>""!==t).slice(0,-1).map(t=>"..").join("/");return 0===e.length&&(e="."),e}function Fa(...t){if(0===t.length)return"";let e=t.filter(t=>""!==t&&"/"!==t).map(t=>ja(t)).join("/");return t[0].startsWith("/")&&(e="/"+e),t[t.length-1].endsWith("/")&&(e+="/"),e}function $a(t,e,n){let r=function(t){let[e,n]=Oa(decodeURI(t));const r=Ua(e);let i=e.split("/").filter(t=>t.length>0),s=i.filter(qa).join("/");const a=Ia(function(t){let e=(n=t=ja(t),n.match(/\.[A-Za-z0-9]+$/)?.[0]);var n;const r=t.replace(new RegExp(e+"$"),"");[".md",".html",void 0].includes(e)&&(e="");let i=function(t){return t.split("/").map(t=>t.replace(/\s/g,"-").replace(/&/g,"-and-").replace(/%/g,"-percent").replace(/\?/g,"").replace(/#/g,"")).join("/").replace(/\/$/,"")}(r);return Ba(i,"_index")&&(i=i.replace(/_index$/,"index")),i+e}(i.filter(t=>!qa(t)&&""!==t).join("/"))),o=r?"/":"";return""===(l=Fa(ja(s),ja(a)))&&(l="."),l.startsWith(".")||(l=Fa(".",l)),l+o+n;var l}(e);if("relative"===n.strategy)return r;{const e=Ua(r)?"/":"",i=ja(r.slice(1));let[s,a]=Oa(i);if("shortest"===n.strategy){const e=n.allSlugs.filter(t=>{const e=t.split("/").at(-1);return s.toLowerCase()===e?.toLowerCase()});if(1===e.length)return function(t,e){return Fa(Ma(t),Ia(e))}(t,e[0])+a}return Fa(Ma(t),i)+e}}function Ua(t){return t.endsWith("/")||Ba(t,"index")||Ba(t,"index.md")||Ba(t,"index.html")}function Ba(t,e){return t===e||t.endsWith("/"+e)}function qa(t){return/^\.{0,2}$/.test(t)}function ja(t,e){return t.startsWith("/")&&(t=t.substring(1)),!e&&t.endsWith("/")&&(t=t.slice(0,-1)),t}j();var Ha=N("site",{component:"PageGraph"}),za=class{allSlugs;outgoingLinks=new Map;constructor(t){this.allSlugs=[...t],Ha.info(`PageGraph initialized with ${t.length} items (pages + resources)`)}registerOutgoingLinks(t,e){const n=Ia(t);this.outgoingLinks.set(n,e)}getBacklinks(t){const e=Ia(t),n=[];for(const[t,r]of this.outgoingLinks.entries())r.includes(e)&&n.push(t);return n}getAllSlugs(){return[...this.allSlugs]}hasSlug(t){return this.allSlugs.includes(t)}resolveLink(t,e,n){return $a(t,e,{strategy:n,allSlugs:this.allSlugs})}getOutgoingLinks(t){const e=Ia(t);return this.outgoingLinks.get(e)||[]}getAllOutgoingLinks(){return new Map(this.outgoingLinks)}getStats(){return{totalPages:this.allSlugs.length,slugs:[...this.allSlugs]}}};function Wa(t){if(t)throw t}var Ga=m(V(),1);function Va(t){if("object"!=typeof t||null===t)return!1;const e=Object.getPrototypeOf(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)}function Ya(t){return Xa(t&&t.line)+":"+Xa(t&&t.column)}function Ka(t){return Ya(t&&t.start)+"-"+Ya(t&&t.end)}function Xa(t){return t&&"number"==typeof t?t:1}var Za=class extends Error{constructor(t,e,n){super(),"string"==typeof e&&(n=e,e=void 0);let r="",i={},s=!1;if(e&&(i="line"in e&&"column"in e||"start"in e&&"end"in e?{place:e}:"type"in e?{ancestors:[e],place:e.position}:{...e}),"string"==typeof t?r=t:!i.cause&&t&&(s=!0,r=t.message,i.cause=t),!i.ruleId&&!i.source&&"string"==typeof n){const t=n.indexOf(":");-1===t?i.ruleId=n:(i.source=n.slice(0,t),i.ruleId=n.slice(t+1))}if(!i.place&&i.ancestors&&i.ancestors){const t=i.ancestors[i.ancestors.length-1];t&&(i.place=t.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;var o;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=((o=i.place)&&"object"==typeof o?"position"in o||"type"in o?Ka(o.position):"start"in o||"end"in o?Ka(o):"line"in o||"column"in o?Ya(o):"":"")||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Za.prototype.file="",Za.prototype.name="",Za.prototype.reason="",Za.prototype.message="",Za.prototype.stack="",Za.prototype.column=void 0,Za.prototype.line=void 0,Za.prototype.ancestors=void 0,Za.prototype.cause=void 0,Za.prototype.fatal=void 0,Za.prototype.place=void 0,Za.prototype.ruleId=void 0,Za.prototype.source=void 0;var Ja=m(require("path"),1),Qa=m(require("process"),1),to=require("url");function eo(t){return Boolean(null!==t&&"object"==typeof t&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&void 0===t.auth)}var no=["history","path","basename","stem","extname","dirname"],ro=class{constructor(t){let e;e=t?eo(t)?{path:t}:"string"==typeof t||function(t){return Boolean(t&&"object"==typeof t&&"byteLength"in t&&"byteOffset"in t)}(t)?{value:t}:t:{},this.cwd="cwd"in e?"":Qa.default.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,r=-1;for(;++r<no.length;){const t=no[r];t in e&&void 0!==e[t]&&null!==e[t]&&(this[t]="history"===t?[...e[t]]:e[t])}for(n in e)no.includes(n)||(this[n]=e[n])}get basename(){return"string"==typeof this.path?Ja.default.basename(this.path):void 0}set basename(t){so(t,"basename"),io(t,"basename"),this.path=Ja.default.join(this.dirname||"",t)}get dirname(){return"string"==typeof this.path?Ja.default.dirname(this.path):void 0}set dirname(t){ao(this.basename,"dirname"),this.path=Ja.default.join(t||"",this.basename)}get extname(){return"string"==typeof this.path?Ja.default.extname(this.path):void 0}set extname(t){if(io(t,"extname"),ao(this.dirname,"extname"),t){if(46!==t.codePointAt(0))throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ja.default.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){eo(t)&&(t=(0,to.fileURLToPath)(t)),so(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return"string"==typeof this.path?Ja.default.basename(this.path,this.extname):void 0}set stem(t){so(t,"stem"),io(t,"stem"),this.path=Ja.default.join(this.dirname||"",t+(this.extname||""))}fail(t,e,n){const r=this.message(t,e,n);throw r.fatal=!0,r}info(t,e,n){const r=this.message(t,e,n);return r.fatal=void 0,r}message(t,e,n){const r=new Za(t,e,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(t){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(t||void 0).decode(this.value)}};function io(t,e){if(t&&t.includes(Ja.default.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+Ja.default.sep+"`")}function so(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function ao(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}var oo=function(t){const e=this.constructor.prototype,n=e[t],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,e),r},lo={}.hasOwnProperty,co=(new class t extends oo{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){const t=[],e={run:function(...e){let n=-1;const r=e.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function i(s,...a){const o=t[++n];let l=-1;if(s)r(s);else{for(;++l<e.length;)null!==a[l]&&void 0!==a[l]||(a[l]=e[l]);e=a,o?function(t,e){let n;return function(...e){const s=t.length>e.length;let a;s&&e.push(r);try{a=t.apply(this,e)}catch(t){if(s&&n)throw t;return r(t)}s||(a&&a.then&&"function"==typeof a.then?a.then(i,r):a instanceof Error?r(a):i(a))};function r(t,...r){n||(n=!0,e(t,...r))}function i(t){r(null,t)}}(o,i)(...a):r(null,...a)}}(null,...e)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return t.push(n),e}};return e}()}copy(){const e=new t;let n=-1;for(;++n<this.attachers.length;){const t=this.attachers[n];e.use(...t)}return e.data((0,Ga.default)(!0,{},this.namespace)),e}data(t,e){return"string"==typeof t?2===arguments.length?(fo("data",this.frozen),this.namespace[t]=e,this):lo.call(this.namespace,t)&&this.namespace[t]||void 0:t?(fo("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[e,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=e.call(t,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const e=mo(t),n=this.parser||this.Parser;return ho("parse",n),n(String(e),e)}process(t,e){const n=this;return this.freeze(),ho("process",this.parser||this.Parser),uo("process",this.compiler||this.Compiler),e?r(void 0,e):new Promise(r);function r(r,i){const s=mo(t),a=n.parse(s);function o(t,n){t||!n?i(t):r?r(n):e(void 0,n)}n.run(a,s,function(t,e,r){if(t||!e||!r)return o(t);const i=e,s=n.stringify(i,r);var a;"string"==typeof(a=s)||function(t){return Boolean(t&&"object"==typeof t&&"byteLength"in t&&"byteOffset"in t)}(a)?r.value=s:r.result=s,o(t,r)})}}processSync(t){let e,n=!1;return this.freeze(),ho("processSync",this.parser||this.Parser),uo("processSync",this.compiler||this.Compiler),this.process(t,function(t,r){n=!0,Wa(t),e=r}),go("processSync","process",n),e}run(t,e,n){po(t),this.freeze();const r=this.transformers;return n||"function"!=typeof e||(n=e,e=void 0),n?i(void 0,n):new Promise(i);function i(i,s){const a=mo(e);r.run(t,a,function(e,r,a){const o=r||t;e?s(e):i?i(o):n(void 0,o,a)})}}runSync(t,e){let n,r=!1;return this.run(t,e,function(t,e){Wa(t),n=e,r=!0}),go("runSync","run",r),n}stringify(t,e){this.freeze();const n=mo(e),r=this.compiler||this.Compiler;return uo("stringify",r),po(t),r(t,n)}use(t,...e){const n=this.attachers,r=this.namespace;if(fo("use",this.frozen),null==t);else if("function"==typeof t)o(t,e);else{if("object"!=typeof t)throw new TypeError("Expected usable value, not `"+t+"`");Array.isArray(t)?a(t):s(t)}return this;function i(t){if("function"==typeof t)o(t,[]);else{if("object"!=typeof t)throw new TypeError("Expected usable value, not `"+t+"`");if(Array.isArray(t)){const[e,...n]=t;o(e,n)}else s(t)}}function s(t){if(!("plugins"in t)&&!("settings"in t))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(t.plugins),t.settings&&(r.settings=(0,Ga.default)(!0,r.settings,t.settings))}function a(t){let e=-1;if(null==t);else{if(!Array.isArray(t))throw new TypeError("Expected a list of plugins, not `"+t+"`");for(;++e<t.length;)i(t[e])}}function o(t,e){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===t){i=r;break}if(-1===i)n.push([t,...e]);else if(e.length>0){let[r,...s]=e;const a=n[i][1];Va(a)&&Va(r)&&(r=(0,Ga.default)(!0,a,r)),n[i]=[t,r,...s]}}}}).freeze();function ho(t,e){if("function"!=typeof e)throw new TypeError("Cannot `"+t+"` without `parser`")}function uo(t,e){if("function"!=typeof e)throw new TypeError("Cannot `"+t+"` without `compiler`")}function fo(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function po(t){if(!Va(t)||"string"!=typeof t.type)throw new TypeError("Expected node, got `"+t+"`")}function go(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function mo(t){return function(t){return Boolean(t&&"object"==typeof t&&"message"in t&&"messages"in t)}(t)?t:new ro(t)}var wo=class{constructor(t,e,n){this.normal=e,this.property=t,n&&(this.space=n)}};function yo(t,e){const n={},r={};for(const e of t)Object.assign(n,e.property),Object.assign(r,e.normal);return new wo(n,r,e)}function bo(t){return t.toLowerCase()}wo.prototype.normal={},wo.prototype.property={},wo.prototype.space=void 0;var vo=class{constructor(t,e){this.attribute=e,this.property=t}};vo.prototype.attribute="",vo.prototype.booleanish=!1,vo.prototype.boolean=!1,vo.prototype.commaOrSpaceSeparated=!1,vo.prototype.commaSeparated=!1,vo.prototype.defined=!1,vo.prototype.mustUseProperty=!1,vo.prototype.number=!1,vo.prototype.overloadedBoolean=!1,vo.prototype.property="",vo.prototype.spaceSeparated=!1,vo.prototype.space=void 0;var Eo={};p(Eo,{boolean:()=>So,booleanish:()=>To,commaOrSpaceSeparated:()=>Po,commaSeparated:()=>Do,number:()=>Ao,overloadedBoolean:()=>xo,spaceSeparated:()=>Co});var ko=0,So=Lo(),To=Lo(),xo=Lo(),Ao=Lo(),Co=Lo(),Do=Lo(),Po=Lo();function Lo(){return 2**++ko}var Ro=Object.keys(Eo),No=class extends vo{constructor(t,e,n,r){let i=-1;if(super(t,e),_o(this,"space",r),"number"==typeof n)for(;++i<Ro.length;){const t=Ro[i];_o(this,Ro[i],(n&Eo[t])===Eo[t])}}};function _o(t,e,n){n&&(t[e]=n)}function Oo(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const s=new No(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[bo(r)]=r,n[bo(s.attribute)]=r}return new wo(e,n,t.space)}No.prototype.defined=!0;var Io=Oo({properties:{ariaActiveDescendant:null,ariaAtomic:To,ariaAutoComplete:null,ariaBusy:To,ariaChecked:To,ariaColCount:Ao,ariaColIndex:Ao,ariaColSpan:Ao,ariaControls:Co,ariaCurrent:null,ariaDescribedBy:Co,ariaDetails:null,ariaDisabled:To,ariaDropEffect:Co,ariaErrorMessage:null,ariaExpanded:To,ariaFlowTo:Co,ariaGrabbed:To,ariaHasPopup:null,ariaHidden:To,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Co,ariaLevel:Ao,ariaLive:null,ariaModal:To,ariaMultiLine:To,ariaMultiSelectable:To,ariaOrientation:null,ariaOwns:Co,ariaPlaceholder:null,ariaPosInSet:Ao,ariaPressed:To,ariaReadOnly:To,ariaRelevant:null,ariaRequired:To,ariaRoleDescription:Co,ariaRowCount:Ao,ariaRowIndex:Ao,ariaRowSpan:Ao,ariaSelected:To,ariaSetSize:Ao,ariaSort:null,ariaValueMax:Ao,ariaValueMin:Ao,ariaValueNow:Ao,ariaValueText:null,role:null},transform:(t,e)=>"role"===e?e:"aria-"+e.slice(4).toLowerCase()});function Mo(t,e){return e in t?t[e]:e}function Fo(t,e){return Mo(t,e.toLowerCase())}var $o=Oo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Do,acceptCharset:Co,accessKey:Co,action:null,allow:null,allowFullScreen:So,allowPaymentRequest:So,allowUserMedia:So,alt:null,as:null,async:So,autoCapitalize:null,autoComplete:Co,autoFocus:So,autoPlay:So,blocking:Co,capture:null,charSet:null,checked:So,cite:null,className:Co,cols:Ao,colSpan:null,content:null,contentEditable:To,controls:So,controlsList:Co,coords:Ao|Do,crossOrigin:null,data:null,dateTime:null,decoding:null,default:So,defer:So,dir:null,dirName:null,disabled:So,download:xo,draggable:To,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:So,formTarget:null,headers:Co,height:Ao,hidden:xo,high:Ao,href:null,hrefLang:null,htmlFor:Co,httpEquiv:Co,id:null,imageSizes:null,imageSrcSet:null,inert:So,inputMode:null,integrity:null,is:null,isMap:So,itemId:null,itemProp:Co,itemRef:Co,itemScope:So,itemType:Co,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:So,low:Ao,manifest:null,max:null,maxLength:Ao,media:null,method:null,min:null,minLength:Ao,multiple:So,muted:So,name:null,nonce:null,noModule:So,noValidate:So,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:So,optimum:Ao,pattern:null,ping:Co,placeholder:null,playsInline:So,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:So,referrerPolicy:null,rel:Co,required:So,reversed:So,rows:Ao,rowSpan:Ao,sandbox:Co,scope:null,scoped:So,seamless:So,selected:So,shadowRootClonable:So,shadowRootDelegatesFocus:So,shadowRootMode:null,shape:null,size:Ao,sizes:null,slot:null,span:Ao,spellCheck:To,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ao,step:null,style:null,tabIndex:Ao,target:null,title:null,translate:null,type:null,typeMustMatch:So,useMap:null,value:To,width:Ao,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Co,axis:null,background:null,bgColor:null,border:Ao,borderColor:null,bottomMargin:Ao,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:So,declare:So,event:null,face:null,frame:null,frameBorder:null,hSpace:Ao,leftMargin:Ao,link:null,longDesc:null,lowSrc:null,marginHeight:Ao,marginWidth:Ao,noResize:So,noHref:So,noShade:So,noWrap:So,object:null,profile:null,prompt:null,rev:null,rightMargin:Ao,rules:null,scheme:null,scrolling:To,standby:null,summary:null,text:null,topMargin:Ao,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ao,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:So,disableRemotePlayback:So,prefix:null,property:null,results:Ao,security:null,unselectable:null},space:"html",transform:Fo}),Uo=Oo({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Po,accentHeight:Ao,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ao,amplitude:Ao,arabicForm:null,ascent:Ao,attributeName:null,attributeType:null,azimuth:Ao,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ao,by:null,calcMode:null,capHeight:Ao,className:Co,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ao,diffuseConstant:Ao,direction:null,display:null,dur:null,divisor:Ao,dominantBaseline:null,download:So,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ao,enableBackground:null,end:null,event:null,exponent:Ao,externalResourcesRequired:null,fill:null,fillOpacity:Ao,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Do,g2:Do,glyphName:Do,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ao,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ao,horizOriginX:Ao,horizOriginY:Ao,id:null,ideographic:Ao,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ao,k:Ao,k1:Ao,k2:Ao,k3:Ao,k4:Ao,kernelMatrix:Po,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ao,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ao,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ao,overlineThickness:Ao,paintOrder:null,panose1:null,path:null,pathLength:Ao,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Co,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ao,pointsAtY:Ao,pointsAtZ:Ao,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Po,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Po,rev:Po,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Po,requiredFeatures:Po,requiredFonts:Po,requiredFormats:Po,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ao,specularExponent:Ao,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ao,strikethroughThickness:Ao,string:null,stroke:null,strokeDashArray:Po,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ao,strokeOpacity:Ao,strokeWidth:null,style:null,surfaceScale:Ao,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Po,tabIndex:Ao,tableValues:null,target:null,targetX:Ao,targetY:Ao,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Po,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ao,underlineThickness:Ao,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ao,values:null,vAlphabetic:Ao,vMathematical:Ao,vectorEffect:null,vHanging:Ao,vIdeographic:Ao,version:null,vertAdvY:Ao,vertOriginX:Ao,vertOriginY:Ao,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ao,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Mo}),Bo=Oo({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(t,e)=>"xlink:"+e.slice(5).toLowerCase()}),qo=Oo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Fo}),jo=Oo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(t,e)=>"xml:"+e.slice(3).toLowerCase()}),Ho=/[A-Z]/g,zo=/-[a-z]/g,Wo=/^data[-\w.:]+$/i;function Go(t){return"-"+t.toLowerCase()}function Vo(t){return t.charAt(1).toUpperCase()}var Yo=yo([Io,$o,Bo,qo,jo],"html"),Ko=yo([Io,Uo,Bo,qo,jo],"svg");function Xo(t){const e=[],n=String(t||"");let r=n.indexOf(","),i=0,s=!1;for(;!s;){-1===r&&(r=n.length,s=!0);const t=n.slice(i,r).trim();!t&&s||e.push(t),i=r+1,r=n.indexOf(",",i)}return e}function Zo(t,e){const n=e||{};return(""===t[t.length-1]?[...t,""]:t).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}var Jo=/[#.]/g;function Qo(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function tl(t){return t.join(" ").trim()}function el(t,e,n){const r=n?function(t){const e=new Map;for(const n of t)e.set(n.toLowerCase(),n);return e}(n):void 0;return function(n,i,...s){let a;if(null==n){a={type:"root",children:[]};const t=i;s.unshift(t)}else{a=function(t,e){const n=t||"",r={};let i,s,a=0;for(;a<n.length;){Jo.lastIndex=a;const t=Jo.exec(n),e=n.slice(a,t?t.index:n.length);e&&(i?"#"===i?r.id=e:Array.isArray(r.className)?r.className.push(e):r.className=[e]:s=e,a+=e.length),t&&(i=t[0],a++)}return{type:"element",tagName:s||e||"div",properties:r,children:[]}}(n,e);const o=a.tagName.toLowerCase(),l=r?r.get(o):void 0;if(a.tagName=l||o,function(t){if(null===t||"object"!=typeof t||Array.isArray(t))return!0;if("string"!=typeof t.type)return!1;const e=t,n=Object.keys(t);for(const t of n){const n=e[t];if(n&&"object"==typeof n){if(!Array.isArray(n))return!0;const t=n;for(const e of t)if("number"!=typeof e&&"string"!=typeof e)return!0}}return!(!("children"in t)||!Array.isArray(t.children))}(i))s.unshift(i);else for(const[e,n]of Object.entries(i))nl(t,a.properties,e,n)}for(const t of s)rl(a.children,t);return"element"===a.type&&"template"===a.tagName&&(a.content={type:"root",children:a.children},a.children=[]),a}}function nl(t,e,n,r){const i=function(t,e){const n=bo(e);let r=e,i=vo;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&Wo.test(e)){if("-"===e.charAt(4)){const t=e.slice(5).replace(zo,Vo);r="data"+t.charAt(0).toUpperCase()+t.slice(1)}else{const t=e.slice(4);if(!zo.test(t)){let n=t.replace(Ho,Go);"-"!==n.charAt(0)&&(n="-"+n),e="data"+n}}i=No}return new i(r,e)}(t,n);let s;if(null!=r){if("number"==typeof r){if(Number.isNaN(r))return;s=r}else s="boolean"==typeof r?r:"string"==typeof r?i.spaceSeparated?Qo(r):i.commaSeparated?Xo(r):i.commaOrSpaceSeparated?Qo(Xo(r).join(" ")):il(i,i.property,r):Array.isArray(r)?[...r]:"style"===i.property?function(t){const e=[];for(const[n,r]of Object.entries(t))e.push([n,r].join(": "));return e.join("; ")}(r):String(r);if(Array.isArray(s)){const t=[];for(const e of s)t.push(il(i,i.property,e));s=t}"className"===i.property&&Array.isArray(e.className)&&(s=e.className.concat(s)),e[i.property]=s}}function rl(t,e){if(null==e);else if("number"==typeof e||"string"==typeof e)t.push({type:"text",value:String(e)});else if(Array.isArray(e))for(const n of e)rl(t,n);else{if("object"!=typeof e||!("type"in e))throw new Error("Expected node, nodes, or string, got `"+e+"`");"root"===e.type?rl(t,e.children):t.push(e)}}function il(t,e,n){if("string"==typeof n){if(t.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((t.boolean||t.overloadedBoolean)&&(""===n||bo(n)===bo(e)))return!0}return n}var sl=el(Yo,"div"),al=el(Ko,"g",["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","solidColor","textArea","textPath"]),ol=class{constructor(t,e,n){this.normal=e,this.property=t,n&&(this.space=n)}};function ll(t,e){const n={},r={};for(const e of t)Object.assign(n,e.property),Object.assign(r,e.normal);return new ol(n,r,e)}function cl(t){return t.toLowerCase()}ol.prototype.normal={},ol.prototype.property={},ol.prototype.space=void 0;var hl=class{constructor(t,e){this.attribute=e,this.property=t}};hl.prototype.attribute="",hl.prototype.booleanish=!1,hl.prototype.boolean=!1,hl.prototype.commaOrSpaceSeparated=!1,hl.prototype.commaSeparated=!1,hl.prototype.defined=!1,hl.prototype.mustUseProperty=!1,hl.prototype.number=!1,hl.prototype.overloadedBoolean=!1,hl.prototype.property="",hl.prototype.spaceSeparated=!1,hl.prototype.space=void 0;var ul={};p(ul,{boolean:()=>dl,booleanish:()=>pl,commaOrSpaceSeparated:()=>bl,commaSeparated:()=>yl,number:()=>ml,overloadedBoolean:()=>gl,spaceSeparated:()=>wl});var fl=0,dl=vl(),pl=vl(),gl=vl(),ml=vl(),wl=vl(),yl=vl(),bl=vl();function vl(){return 2**++fl}var El=Object.keys(ul),kl=class extends hl{constructor(t,e,n,r){let i=-1;if(super(t,e),Sl(this,"space",r),"number"==typeof n)for(;++i<El.length;){const t=El[i];Sl(this,El[i],(n&ul[t])===ul[t])}}};function Sl(t,e,n){n&&(t[e]=n)}function Tl(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const s=new kl(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[cl(r)]=r,n[cl(s.attribute)]=r}return new ol(e,n,t.space)}kl.prototype.defined=!0;var xl=Tl({properties:{ariaActiveDescendant:null,ariaAtomic:pl,ariaAutoComplete:null,ariaBusy:pl,ariaChecked:pl,ariaColCount:ml,ariaColIndex:ml,ariaColSpan:ml,ariaControls:wl,ariaCurrent:null,ariaDescribedBy:wl,ariaDetails:null,ariaDisabled:pl,ariaDropEffect:wl,ariaErrorMessage:null,ariaExpanded:pl,ariaFlowTo:wl,ariaGrabbed:pl,ariaHasPopup:null,ariaHidden:pl,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:wl,ariaLevel:ml,ariaLive:null,ariaModal:pl,ariaMultiLine:pl,ariaMultiSelectable:pl,ariaOrientation:null,ariaOwns:wl,ariaPlaceholder:null,ariaPosInSet:ml,ariaPressed:pl,ariaReadOnly:pl,ariaRelevant:null,ariaRequired:pl,ariaRoleDescription:wl,ariaRowCount:ml,ariaRowIndex:ml,ariaRowSpan:ml,ariaSelected:pl,ariaSetSize:ml,ariaSort:null,ariaValueMax:ml,ariaValueMin:ml,ariaValueNow:ml,ariaValueText:null,role:null},transform:(t,e)=>"role"===e?e:"aria-"+e.slice(4).toLowerCase()});function Al(t,e){return e in t?t[e]:e}function Cl(t,e){return Al(t,e.toLowerCase())}var Dl=Tl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:yl,acceptCharset:wl,accessKey:wl,action:null,allow:null,allowFullScreen:dl,allowPaymentRequest:dl,allowUserMedia:dl,alt:null,as:null,async:dl,autoCapitalize:null,autoComplete:wl,autoFocus:dl,autoPlay:dl,blocking:wl,capture:null,charSet:null,checked:dl,cite:null,className:wl,cols:ml,colSpan:null,content:null,contentEditable:pl,controls:dl,controlsList:wl,coords:ml|yl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:dl,defer:dl,dir:null,dirName:null,disabled:dl,download:gl,draggable:pl,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:dl,formTarget:null,headers:wl,height:ml,hidden:gl,high:ml,href:null,hrefLang:null,htmlFor:wl,httpEquiv:wl,id:null,imageSizes:null,imageSrcSet:null,inert:dl,inputMode:null,integrity:null,is:null,isMap:dl,itemId:null,itemProp:wl,itemRef:wl,itemScope:dl,itemType:wl,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:dl,low:ml,manifest:null,max:null,maxLength:ml,media:null,method:null,min:null,minLength:ml,multiple:dl,muted:dl,name:null,nonce:null,noModule:dl,noValidate:dl,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:dl,optimum:ml,pattern:null,ping:wl,placeholder:null,playsInline:dl,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:dl,referrerPolicy:null,rel:wl,required:dl,reversed:dl,rows:ml,rowSpan:ml,sandbox:wl,scope:null,scoped:dl,seamless:dl,selected:dl,shadowRootClonable:dl,shadowRootDelegatesFocus:dl,shadowRootMode:null,shape:null,size:ml,sizes:null,slot:null,span:ml,spellCheck:pl,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ml,step:null,style:null,tabIndex:ml,target:null,title:null,translate:null,type:null,typeMustMatch:dl,useMap:null,value:pl,width:ml,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:wl,axis:null,background:null,bgColor:null,border:ml,borderColor:null,bottomMargin:ml,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:dl,declare:dl,event:null,face:null,frame:null,frameBorder:null,hSpace:ml,leftMargin:ml,link:null,longDesc:null,lowSrc:null,marginHeight:ml,marginWidth:ml,noResize:dl,noHref:dl,noShade:dl,noWrap:dl,object:null,profile:null,prompt:null,rev:null,rightMargin:ml,rules:null,scheme:null,scrolling:pl,standby:null,summary:null,text:null,topMargin:ml,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ml,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:dl,disableRemotePlayback:dl,prefix:null,property:null,results:ml,security:null,unselectable:null},space:"html",transform:Cl}),Pl=Tl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:bl,accentHeight:ml,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ml,amplitude:ml,arabicForm:null,ascent:ml,attributeName:null,attributeType:null,azimuth:ml,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ml,by:null,calcMode:null,capHeight:ml,className:wl,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ml,diffuseConstant:ml,direction:null,display:null,dur:null,divisor:ml,dominantBaseline:null,download:dl,dx:null,dy:null,edgeMode:null,editable:null,elevation:ml,enableBackground:null,end:null,event:null,exponent:ml,externalResourcesRequired:null,fill:null,fillOpacity:ml,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:yl,g2:yl,glyphName:yl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ml,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ml,horizOriginX:ml,horizOriginY:ml,id:null,ideographic:ml,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ml,k:ml,k1:ml,k2:ml,k3:ml,k4:ml,kernelMatrix:bl,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ml,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ml,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ml,overlineThickness:ml,paintOrder:null,panose1:null,path:null,pathLength:ml,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:wl,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ml,pointsAtY:ml,pointsAtZ:ml,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bl,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bl,rev:bl,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bl,requiredFeatures:bl,requiredFonts:bl,requiredFormats:bl,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ml,specularExponent:ml,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ml,strikethroughThickness:ml,string:null,stroke:null,strokeDashArray:bl,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ml,strokeOpacity:ml,strokeWidth:null,style:null,surfaceScale:ml,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bl,tabIndex:ml,tableValues:null,target:null,targetX:ml,targetY:ml,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bl,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ml,underlineThickness:ml,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ml,values:null,vAlphabetic:ml,vMathematical:ml,vectorEffect:null,vHanging:ml,vIdeographic:ml,version:null,vertAdvY:ml,vertOriginX:ml,vertOriginY:ml,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ml,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Al}),Ll=Tl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(t,e)=>"xlink:"+e.slice(5).toLowerCase()}),Rl=Tl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Cl}),Nl=Tl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(t,e)=>"xml:"+e.slice(3).toLowerCase()}),_l=/[A-Z]/g,Ol=/-[a-z]/g,Il=/^data[-\w.:]+$/i;function Ml(t,e){const n=cl(e);let r=e,i=hl;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&Il.test(e)){if("-"===e.charAt(4)){const t=e.slice(5).replace(Ol,$l);r="data"+t.charAt(0).toUpperCase()+t.slice(1)}else{const t=e.slice(4);if(!Ol.test(t)){let n=t.replace(_l,Fl);"-"!==n.charAt(0)&&(n="-"+n),e="data"+n}}i=kl}return new i(r,e)}function Fl(t){return"-"+t.toLowerCase()}function $l(t){return t.charAt(1).toUpperCase()}var Ul=ll([xl,Dl,Ll,Rl,Nl],"html"),Bl=ll([xl,Pl,Ll,Rl,Nl],"svg");function ql(t,e){const n=t.indexOf("\r",e),r=t.indexOf("\n",e);return-1===r?n:-1===n||n+1===r?r:n<r?n:r}var jl={}.hasOwnProperty,Hl=Object.prototype;function zl(t,e){let n;switch(e.nodeName){case"#comment":{const r=e;return n={type:"comment",value:r.data},Gl(t,r,n),n}case"#document":case"#document-fragment":{const r=e,i="mode"in r&&("quirks"===r.mode||"limited-quirks"===r.mode);if(n={type:"root",children:Wl(t,e.childNodes),data:{quirksMode:i}},t.file&&t.location){const e=String(t.file),r=function(t){const e=String(t),n=[];return{toOffset:function(t){if(t&&"number"==typeof t.line&&"number"==typeof t.column&&!Number.isNaN(t.line)&&!Number.isNaN(t.column)){for(;n.length<t.line;){const t=n[n.length-1],r=ql(e,t),i=-1===r?e.length+1:r+1;if(t===i)break;n.push(i)}const r=(t.line>1?n[t.line-2]:0)+t.column-1;if(r<n[t.line-1])return r}},toPoint:function(t){if("number"==typeof t&&t>-1&&t<=e.length){let r=0;for(;;){let i=n[r];if(void 0===i){const t=ql(e,n[r-1]);i=-1===t?e.length+1:t+1,n[r]=i}if(i>t)return{line:r+1,column:t-(r>0?n[r-1]:0)+1,offset:t};r++}}}}}(e),i=r.toPoint(0),s=r.toPoint(e.length);n.position={start:i,end:s}}return n}case"#documentType":return n={type:"doctype"},Gl(t,e,n),n;case"#text":{const r=e;return n={type:"text",value:r.value},Gl(t,r,n),n}default:return n=function(t,e){const n=t.schema;t.schema="http://www.w3.org/2000/svg"===e.namespaceURI?Bl:Ul;let r=-1;const i={};for(;++r<e.attrs.length;){const t=e.attrs[r],n=(t.prefix?t.prefix+":":"")+t.name;jl.call(Hl,n)||(i[n]=t.value)}const s=("svg"===t.schema.space?al:sl)(e.tagName,i,Wl(t,e.childNodes));if(Gl(t,e,s),"template"===s.tagName){const n=e,r=n.sourceCodeLocation,i=r&&r.startTag&&Vl(r.startTag),a=r&&r.endTag&&Vl(r.endTag),o=zl(t,n.content);i&&a&&t.file&&(o.position={start:i.end,end:a.start}),s.content=o}return t.schema=n,s}(t,e),n}}function Wl(t,e){let n=-1;const r=[];for(;++n<e.length;){const i=zl(t,e[n]);r.push(i)}return r}function Gl(t,e,n){if("sourceCodeLocation"in e&&e.sourceCodeLocation&&t.file){const r=function(t,e,n){const r=Vl(n);if("element"===e.type){const i=e.children[e.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),t.verbose){const r={};let i;if(n.attrs)for(i in n.attrs)jl.call(n.attrs,i)&&(r[Ml(t.schema,i).property]=Vl(n.attrs[i]));n.startTag;const s=Vl(n.startTag),a=n.endTag?Vl(n.endTag):void 0,o={opening:s};a&&(o.closing=a),o.properties=r,e.data={position:o}}}return r}(t,n,e.sourceCodeLocation);r&&(t.location=!0,n.position=r)}}function Vl(t){const e=Yl({line:t.startLine,column:t.startCol,offset:t.startOffset}),n=Yl({line:t.endLine,column:t.endCol,offset:t.endOffset});return e||n?{start:e,end:n}:void 0}function Yl(t){return t.line&&t.column?t:void 0}var Kl,Xl,Zl=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Jl="�";(Xl=Kl||(Kl={}))[Xl.EOF=-1]="EOF",Xl[Xl.NULL=0]="NULL",Xl[Xl.TABULATION=9]="TABULATION",Xl[Xl.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",Xl[Xl.LINE_FEED=10]="LINE_FEED",Xl[Xl.FORM_FEED=12]="FORM_FEED",Xl[Xl.SPACE=32]="SPACE",Xl[Xl.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",Xl[Xl.QUOTATION_MARK=34]="QUOTATION_MARK",Xl[Xl.AMPERSAND=38]="AMPERSAND",Xl[Xl.APOSTROPHE=39]="APOSTROPHE",Xl[Xl.HYPHEN_MINUS=45]="HYPHEN_MINUS",Xl[Xl.SOLIDUS=47]="SOLIDUS",Xl[Xl.DIGIT_0=48]="DIGIT_0",Xl[Xl.DIGIT_9=57]="DIGIT_9",Xl[Xl.SEMICOLON=59]="SEMICOLON",Xl[Xl.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",Xl[Xl.EQUALS_SIGN=61]="EQUALS_SIGN",Xl[Xl.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",Xl[Xl.QUESTION_MARK=63]="QUESTION_MARK",Xl[Xl.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",Xl[Xl.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",Xl[Xl.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",Xl[Xl.GRAVE_ACCENT=96]="GRAVE_ACCENT",Xl[Xl.LATIN_SMALL_A=97]="LATIN_SMALL_A",Xl[Xl.LATIN_SMALL_Z=122]="LATIN_SMALL_Z";var Ql,tc,ec="script";function nc(t){return t>=55296&&t<=57343}function rc(t){return 32!==t&&10!==t&&13!==t&&9!==t&&12!==t&&t>=1&&t<=31||t>=127&&t<=159}function ic(t){return t>=64976&&t<=65007||Zl.has(t)}(tc=Ql||(Ql={})).controlCharacterInInputStream="control-character-in-input-stream",tc.noncharacterInInputStream="noncharacter-in-input-stream",tc.surrogateInInputStream="surrogate-in-input-stream",tc.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",tc.endTagWithAttributes="end-tag-with-attributes",tc.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",tc.unexpectedSolidusInTag="unexpected-solidus-in-tag",tc.unexpectedNullCharacter="unexpected-null-character",tc.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",tc.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",tc.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",tc.missingEndTagName="missing-end-tag-name",tc.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",tc.unknownNamedCharacterReference="unknown-named-character-reference",tc.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",tc.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",tc.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",tc.eofBeforeTagName="eof-before-tag-name",tc.eofInTag="eof-in-tag",tc.missingAttributeValue="missing-attribute-value",tc.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",tc.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",tc.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",tc.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",tc.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",tc.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",tc.missingDoctypePublicIdentifier="missing-doctype-public-identifier",tc.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",tc.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",tc.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",tc.cdataInHtmlContent="cdata-in-html-content",tc.incorrectlyOpenedComment="incorrectly-opened-comment",tc.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",tc.eofInDoctype="eof-in-doctype",tc.nestedComment="nested-comment",tc.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",tc.eofInComment="eof-in-comment",tc.incorrectlyClosedComment="incorrectly-closed-comment",tc.eofInCdata="eof-in-cdata",tc.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",tc.nullCharacterReference="null-character-reference",tc.surrogateCharacterReference="surrogate-character-reference",tc.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",tc.controlCharacterReference="control-character-reference",tc.noncharacterCharacterReference="noncharacter-character-reference",tc.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",tc.missingDoctypeName="missing-doctype-name",tc.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",tc.duplicateAttribute="duplicate-attribute",tc.nonConformingDoctype="non-conforming-doctype",tc.missingDoctype="missing-doctype",tc.misplacedDoctype="misplaced-doctype",tc.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",tc.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",tc.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",tc.openElementsLeftAfterEof="open-elements-left-after-eof",tc.abandonedHeadElementChild="abandoned-head-element-child",tc.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",tc.nestedNoscriptInHead="nested-noscript-in-head",tc.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text";var sc,ac,oc=class{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=65536,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,e){const{line:n,col:r,offset:i}=this,s=r+e,a=i+e;return{code:t,startLine:n,endLine:n,startCol:s,endCol:s,startOffset:a,endOffset:a}}Et(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}kt(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}St(t){if(this.pos!==this.html.length-1){const e=this.html.charCodeAt(this.pos+1);if(function(t){return t>=56320&&t<=57343}(e))return this.pos++,this.kt(),1024*(t-55296)+9216+e}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,Kl.EOF;return this.Et(Ql.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,e){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=e}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,e){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(e)return this.html.startsWith(t,this.pos);for(let e=0;e<t.length;e++)if((32|this.html.charCodeAt(this.pos+e))!==t.charCodeAt(e))return!1;return!0}peek(t){const e=this.pos+t;if(e>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Kl.EOF;const n=this.html.charCodeAt(e);return n===Kl.CARRIAGE_RETURN?Kl.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,Kl.EOF;let t=this.html.charCodeAt(this.pos);return t===Kl.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,Kl.LINE_FEED):t===Kl.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this.kt(),this.advance()):(this.skipNextNewLine=!1,nc(t)&&(t=this.St(t)),null===this.handler.onParseError||t>31&&t<127||t===Kl.LINE_FEED||t===Kl.CARRIAGE_RETURN||t>159&&t<64976||this.Tt(t),t)}Tt(t){rc(t)?this.Et(Ql.controlCharacterInInputStream):ic(t)&&this.Et(Ql.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}};function lc(t,e){for(let n=t.attrs.length-1;n>=0;n--)if(t.attrs[n].name===e)return t.attrs[n].value;return null}(ac=sc||(sc={}))[ac.CHARACTER=0]="CHARACTER",ac[ac.NULL_CHARACTER=1]="NULL_CHARACTER",ac[ac.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",ac[ac.START_TAG=3]="START_TAG",ac[ac.END_TAG=4]="END_TAG",ac[ac.COMMENT=5]="COMMENT",ac[ac.DOCTYPE=6]="DOCTYPE",ac[ac.EOF=7]="EOF",ac[ac.HIBERNATION=8]="HIBERNATION";var cc,hc,uc,fc,dc,pc,gc,mc,wc=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),yc=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]]);function bc(t){return t>=cc.ZERO&&t<=cc.NINE}function vc(t){return t>=cc.UPPER_A&&t<=cc.UPPER_F||t>=cc.LOWER_A&&t<=cc.LOWER_F}function Ec(t){return t===cc.EQUALS||function(t){return t>=cc.UPPER_A&&t<=cc.UPPER_Z||t>=cc.LOWER_A&&t<=cc.LOWER_Z||bc(t)}(t)}String.fromCodePoint,(hc=cc||(cc={}))[hc.NUM=35]="NUM",hc[hc.SEMI=59]="SEMI",hc[hc.EQUALS=61]="EQUALS",hc[hc.ZERO=48]="ZERO",hc[hc.NINE=57]="NINE",hc[hc.LOWER_A=97]="LOWER_A",hc[hc.LOWER_F=102]="LOWER_F",hc[hc.LOWER_X=120]="LOWER_X",hc[hc.LOWER_Z=122]="LOWER_Z",hc[hc.UPPER_A=65]="UPPER_A",hc[hc.UPPER_F=70]="UPPER_F",hc[hc.UPPER_Z=90]="UPPER_Z",(fc=uc||(uc={}))[fc.VALUE_LENGTH=49152]="VALUE_LENGTH",fc[fc.BRANCH_LENGTH=16256]="BRANCH_LENGTH",fc[fc.JUMP_TABLE=127]="JUMP_TABLE",(pc=dc||(dc={}))[pc.EntityStart=0]="EntityStart",pc[pc.NumericStart=1]="NumericStart",pc[pc.NumericDecimal=2]="NumericDecimal",pc[pc.NumericHex=3]="NumericHex",pc[pc.NamedEntity=4]="NamedEntity",(mc=gc||(gc={}))[mc.Legacy=0]="Legacy",mc[mc.Strict=1]="Strict",mc[mc.Attribute=2]="Attribute";var kc,Sc,Tc,xc,Ac,Cc,Dc,Pc,Lc,Rc,Nc=class{constructor(t,e,n){this.decodeTree=t,this.emitCodePoint=e,this.errors=n,this.state=dc.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=gc.Strict}startEntity(t){this.decodeMode=t,this.state=dc.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,e){switch(this.state){case dc.EntityStart:return t.charCodeAt(e)===cc.NUM?(this.state=dc.NumericStart,this.consumed+=1,this.stateNumericStart(t,e+1)):(this.state=dc.NamedEntity,this.stateNamedEntity(t,e));case dc.NumericStart:return this.stateNumericStart(t,e);case dc.NumericDecimal:return this.stateNumericDecimal(t,e);case dc.NumericHex:return this.stateNumericHex(t,e);case dc.NamedEntity:return this.stateNamedEntity(t,e)}}stateNumericStart(t,e){return e>=t.length?-1:(32|t.charCodeAt(e))===cc.LOWER_X?(this.state=dc.NumericHex,this.consumed+=1,this.stateNumericHex(t,e+1)):(this.state=dc.NumericDecimal,this.stateNumericDecimal(t,e))}addToNumericResult(t,e,n,r){if(e!==n){const i=n-e;this.result=this.result*Math.pow(r,i)+Number.parseInt(t.substr(e,i),r),this.consumed+=i}}stateNumericHex(t,e){const n=e;for(;e<t.length;){const r=t.charCodeAt(e);if(!bc(r)&&!vc(r))return this.addToNumericResult(t,n,e,16),this.emitNumericEntity(r,3);e+=1}return this.addToNumericResult(t,n,e,16),-1}stateNumericDecimal(t,e){const n=e;for(;e<t.length;){const r=t.charCodeAt(e);if(!bc(r))return this.addToNumericResult(t,n,e,10),this.emitNumericEntity(r,2);e+=1}return this.addToNumericResult(t,n,e,10),-1}emitNumericEntity(t,e){var n;if(this.consumed<=e)return null===(n=this.errors)||void 0===n||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===cc.SEMI)this.consumed+=1;else if(this.decodeMode===gc.Strict)return 0;return this.emitCodePoint(function(t){var e;return t>=55296&&t<=57343||t>1114111?65533:null!==(e=yc.get(t))&&void 0!==e?e:t}(this.result),this.consumed),this.errors&&(t!==cc.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,e){const{decodeTree:n}=this;let r=n[this.treeIndex],i=(r&uc.VALUE_LENGTH)>>14;for(;e<t.length;e++,this.excess++){const s=t.charCodeAt(e);if(this.treeIndex=_c(n,r,this.treeIndex+Math.max(1,i),s),this.treeIndex<0)return 0===this.result||this.decodeMode===gc.Attribute&&(0===i||Ec(s))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&uc.VALUE_LENGTH)>>14,0!==i){if(s===cc.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==gc.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:e,decodeTree:n}=this,r=(n[e]&uc.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,r,this.consumed),null===(t=this.errors)||void 0===t||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,e,n){const{decodeTree:r}=this;return this.emitCodePoint(1===e?r[t]&~uc.VALUE_LENGTH:r[t+1],n),3===e&&this.emitCodePoint(r[t+2],n),n}end(){var t;switch(this.state){case dc.NamedEntity:return 0===this.result||this.decodeMode===gc.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case dc.NumericDecimal:return this.emitNumericEntity(0,2);case dc.NumericHex:return this.emitNumericEntity(0,3);case dc.NumericStart:return null===(t=this.errors)||void 0===t||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case dc.EntityStart:return 0}}};function _c(t,e,n,r){const i=(e&uc.BRANCH_LENGTH)>>7,s=e&uc.JUMP_TABLE;if(0===i)return 0!==s&&r===s?n:-1;if(s){const e=r-s;return e<0||e>=i?-1:t[n+e]-1}let a=n,o=a+i-1;for(;a<=o;){const e=a+o>>>1,n=t[e];if(n<r)a=e+1;else{if(!(n>r))return t[e+i];o=e-1}}return-1}(Sc=kc||(kc={})).HTML="http://www.w3.org/1999/xhtml",Sc.MATHML="http://www.w3.org/1998/Math/MathML",Sc.SVG="http://www.w3.org/2000/svg",Sc.XLINK="http://www.w3.org/1999/xlink",Sc.XML="http://www.w3.org/XML/1998/namespace",Sc.XMLNS="http://www.w3.org/2000/xmlns/",(xc=Tc||(Tc={})).TYPE="type",xc.ACTION="action",xc.ENCODING="encoding",xc.PROMPT="prompt",xc.NAME="name",xc.COLOR="color",xc.FACE="face",xc.SIZE="size",(Cc=Ac||(Ac={})).NO_QUIRKS="no-quirks",Cc.QUIRKS="quirks",Cc.LIMITED_QUIRKS="limited-quirks",(Pc=Dc||(Dc={})).A="a",Pc.ADDRESS="address",Pc.ANNOTATION_XML="annotation-xml",Pc.APPLET="applet",Pc.AREA="area",Pc.ARTICLE="article",Pc.ASIDE="aside",Pc.B="b",Pc.BASE="base",Pc.BASEFONT="basefont",Pc.BGSOUND="bgsound",Pc.BIG="big",Pc.BLOCKQUOTE="blockquote",Pc.BODY="body",Pc.BR="br",Pc.BUTTON="button",Pc.CAPTION="caption",Pc.CENTER="center",Pc.CODE="code",Pc.COL="col",Pc.COLGROUP="colgroup",Pc.DD="dd",Pc.DESC="desc",Pc.DETAILS="details",Pc.DIALOG="dialog",Pc.DIR="dir",Pc.DIV="div",Pc.DL="dl",Pc.DT="dt",Pc.EM="em",Pc.EMBED="embed",Pc.FIELDSET="fieldset",Pc.FIGCAPTION="figcaption",Pc.FIGURE="figure",Pc.FONT="font",Pc.FOOTER="footer",Pc.FOREIGN_OBJECT="foreignObject",Pc.FORM="form",Pc.FRAME="frame",Pc.FRAMESET="frameset",Pc.H1="h1",Pc.H2="h2",Pc.H3="h3",Pc.H4="h4",Pc.H5="h5",Pc.H6="h6",Pc.HEAD="head",Pc.HEADER="header",Pc.HGROUP="hgroup",Pc.HR="hr",Pc.HTML="html",Pc.I="i",Pc.IMG="img",Pc.IMAGE="image",Pc.INPUT="input",Pc.IFRAME="iframe",Pc.KEYGEN="keygen",Pc.LABEL="label",Pc.LI="li",Pc.LINK="link",Pc.LISTING="listing",Pc.MAIN="main",Pc.MALIGNMARK="malignmark",Pc.MARQUEE="marquee",Pc.MATH="math",Pc.MENU="menu",Pc.META="meta",Pc.MGLYPH="mglyph",Pc.MI="mi",Pc.MO="mo",Pc.MN="mn",Pc.MS="ms",Pc.MTEXT="mtext",Pc.NAV="nav",Pc.NOBR="nobr",Pc.NOFRAMES="noframes",Pc.NOEMBED="noembed",Pc.NOSCRIPT="noscript",Pc.OBJECT="object",Pc.OL="ol",Pc.OPTGROUP="optgroup",Pc.OPTION="option",Pc.P="p",Pc.PARAM="param",Pc.PLAINTEXT="plaintext",Pc.PRE="pre",Pc.RB="rb",Pc.RP="rp",Pc.RT="rt",Pc.RTC="rtc",Pc.RUBY="ruby",Pc.S="s",Pc.SCRIPT="script",Pc.SEARCH="search",Pc.SECTION="section",Pc.SELECT="select",Pc.SOURCE="source",Pc.SMALL="small",Pc.SPAN="span",Pc.STRIKE="strike",Pc.STRONG="strong",Pc.STYLE="style",Pc.SUB="sub",Pc.SUMMARY="summary",Pc.SUP="sup",Pc.TABLE="table",Pc.TBODY="tbody",Pc.TEMPLATE="template",Pc.TEXTAREA="textarea",Pc.TFOOT="tfoot",Pc.TD="td",Pc.TH="th",Pc.THEAD="thead",Pc.TITLE="title",Pc.TR="tr",Pc.TRACK="track",Pc.TT="tt",Pc.U="u",Pc.UL="ul",Pc.SVG="svg",Pc.VAR="var",Pc.WBR="wbr",Pc.XMP="xmp",(Rc=Lc||(Lc={}))[Rc.UNKNOWN=0]="UNKNOWN",Rc[Rc.A=1]="A",Rc[Rc.ADDRESS=2]="ADDRESS",Rc[Rc.ANNOTATION_XML=3]="ANNOTATION_XML",Rc[Rc.APPLET=4]="APPLET",Rc[Rc.AREA=5]="AREA",Rc[Rc.ARTICLE=6]="ARTICLE",Rc[Rc.ASIDE=7]="ASIDE",Rc[Rc.B=8]="B",Rc[Rc.BASE=9]="BASE",Rc[Rc.BASEFONT=10]="BASEFONT",Rc[Rc.BGSOUND=11]="BGSOUND",Rc[Rc.BIG=12]="BIG",Rc[Rc.BLOCKQUOTE=13]="BLOCKQUOTE",Rc[Rc.BODY=14]="BODY",Rc[Rc.BR=15]="BR",Rc[Rc.BUTTON=16]="BUTTON",Rc[Rc.CAPTION=17]="CAPTION",Rc[Rc.CENTER=18]="CENTER",Rc[Rc.CODE=19]="CODE",Rc[Rc.COL=20]="COL",Rc[Rc.COLGROUP=21]="COLGROUP",Rc[Rc.DD=22]="DD",Rc[Rc.DESC=23]="DESC",Rc[Rc.DETAILS=24]="DETAILS",Rc[Rc.DIALOG=25]="DIALOG",Rc[Rc.DIR=26]="DIR",Rc[Rc.DIV=27]="DIV",Rc[Rc.DL=28]="DL",Rc[Rc.DT=29]="DT",Rc[Rc.EM=30]="EM",Rc[Rc.EMBED=31]="EMBED",Rc[Rc.FIELDSET=32]="FIELDSET",Rc[Rc.FIGCAPTION=33]="FIGCAPTION",Rc[Rc.FIGURE=34]="FIGURE",Rc[Rc.FONT=35]="FONT",Rc[Rc.FOOTER=36]="FOOTER",Rc[Rc.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",Rc[Rc.FORM=38]="FORM",Rc[Rc.FRAME=39]="FRAME",Rc[Rc.FRAMESET=40]="FRAMESET",Rc[Rc.H1=41]="H1",Rc[Rc.H2=42]="H2",Rc[Rc.H3=43]="H3",Rc[Rc.H4=44]="H4",Rc[Rc.H5=45]="H5",Rc[Rc.H6=46]="H6",Rc[Rc.HEAD=47]="HEAD",Rc[Rc.HEADER=48]="HEADER",Rc[Rc.HGROUP=49]="HGROUP",Rc[Rc.HR=50]="HR",Rc[Rc.HTML=51]="HTML",Rc[Rc.I=52]="I",Rc[Rc.IMG=53]="IMG",Rc[Rc.IMAGE=54]="IMAGE",Rc[Rc.INPUT=55]="INPUT",Rc[Rc.IFRAME=56]="IFRAME",Rc[Rc.KEYGEN=57]="KEYGEN",Rc[Rc.LABEL=58]="LABEL",Rc[Rc.LI=59]="LI",Rc[Rc.LINK=60]="LINK",Rc[Rc.LISTING=61]="LISTING",Rc[Rc.MAIN=62]="MAIN",Rc[Rc.MALIGNMARK=63]="MALIGNMARK",Rc[Rc.MARQUEE=64]="MARQUEE",Rc[Rc.MATH=65]="MATH",Rc[Rc.MENU=66]="MENU",Rc[Rc.META=67]="META",Rc[Rc.MGLYPH=68]="MGLYPH",Rc[Rc.MI=69]="MI",Rc[Rc.MO=70]="MO",Rc[Rc.MN=71]="MN",Rc[Rc.MS=72]="MS",Rc[Rc.MTEXT=73]="MTEXT",Rc[Rc.NAV=74]="NAV",Rc[Rc.NOBR=75]="NOBR",Rc[Rc.NOFRAMES=76]="NOFRAMES",Rc[Rc.NOEMBED=77]="NOEMBED",Rc[Rc.NOSCRIPT=78]="NOSCRIPT",Rc[Rc.OBJECT=79]="OBJECT",Rc[Rc.OL=80]="OL",Rc[Rc.OPTGROUP=81]="OPTGROUP",Rc[Rc.OPTION=82]="OPTION",Rc[Rc.P=83]="P",Rc[Rc.PARAM=84]="PARAM",Rc[Rc.PLAINTEXT=85]="PLAINTEXT",Rc[Rc.PRE=86]="PRE",Rc[Rc.RB=87]="RB",Rc[Rc.RP=88]="RP",Rc[Rc.RT=89]="RT",Rc[Rc.RTC=90]="RTC",Rc[Rc.RUBY=91]="RUBY",Rc[Rc.S=92]="S",Rc[Rc.SCRIPT=93]="SCRIPT",Rc[Rc.SEARCH=94]="SEARCH",Rc[Rc.SECTION=95]="SECTION",Rc[Rc.SELECT=96]="SELECT",Rc[Rc.SOURCE=97]="SOURCE",Rc[Rc.SMALL=98]="SMALL",Rc[Rc.SPAN=99]="SPAN",Rc[Rc.STRIKE=100]="STRIKE",Rc[Rc.STRONG=101]="STRONG",Rc[Rc.STYLE=102]="STYLE",Rc[Rc.SUB=103]="SUB",Rc[Rc.SUMMARY=104]="SUMMARY",Rc[Rc.SUP=105]="SUP",Rc[Rc.TABLE=106]="TABLE",Rc[Rc.TBODY=107]="TBODY",Rc[Rc.TEMPLATE=108]="TEMPLATE",Rc[Rc.TEXTAREA=109]="TEXTAREA",Rc[Rc.TFOOT=110]="TFOOT",Rc[Rc.TD=111]="TD",Rc[Rc.TH=112]="TH",Rc[Rc.THEAD=113]="THEAD",Rc[Rc.TITLE=114]="TITLE",Rc[Rc.TR=115]="TR",Rc[Rc.TRACK=116]="TRACK",Rc[Rc.TT=117]="TT",Rc[Rc.U=118]="U",Rc[Rc.UL=119]="UL",Rc[Rc.SVG=120]="SVG",Rc[Rc.VAR=121]="VAR",Rc[Rc.WBR=122]="WBR",Rc[Rc.XMP=123]="XMP";var Oc=new Map([[Dc.A,Lc.A],[Dc.ADDRESS,Lc.ADDRESS],[Dc.ANNOTATION_XML,Lc.ANNOTATION_XML],[Dc.APPLET,Lc.APPLET],[Dc.AREA,Lc.AREA],[Dc.ARTICLE,Lc.ARTICLE],[Dc.ASIDE,Lc.ASIDE],[Dc.B,Lc.B],[Dc.BASE,Lc.BASE],[Dc.BASEFONT,Lc.BASEFONT],[Dc.BGSOUND,Lc.BGSOUND],[Dc.BIG,Lc.BIG],[Dc.BLOCKQUOTE,Lc.BLOCKQUOTE],[Dc.BODY,Lc.BODY],[Dc.BR,Lc.BR],[Dc.BUTTON,Lc.BUTTON],[Dc.CAPTION,Lc.CAPTION],[Dc.CENTER,Lc.CENTER],[Dc.CODE,Lc.CODE],[Dc.COL,Lc.COL],[Dc.COLGROUP,Lc.COLGROUP],[Dc.DD,Lc.DD],[Dc.DESC,Lc.DESC],[Dc.DETAILS,Lc.DETAILS],[Dc.DIALOG,Lc.DIALOG],[Dc.DIR,Lc.DIR],[Dc.DIV,Lc.DIV],[Dc.DL,Lc.DL],[Dc.DT,Lc.DT],[Dc.EM,Lc.EM],[Dc.EMBED,Lc.EMBED],[Dc.FIELDSET,Lc.FIELDSET],[Dc.FIGCAPTION,Lc.FIGCAPTION],[Dc.FIGURE,Lc.FIGURE],[Dc.FONT,Lc.FONT],[Dc.FOOTER,Lc.FOOTER],[Dc.FOREIGN_OBJECT,Lc.FOREIGN_OBJECT],[Dc.FORM,Lc.FORM],[Dc.FRAME,Lc.FRAME],[Dc.FRAMESET,Lc.FRAMESET],[Dc.H1,Lc.H1],[Dc.H2,Lc.H2],[Dc.H3,Lc.H3],[Dc.H4,Lc.H4],[Dc.H5,Lc.H5],[Dc.H6,Lc.H6],[Dc.HEAD,Lc.HEAD],[Dc.HEADER,Lc.HEADER],[Dc.HGROUP,Lc.HGROUP],[Dc.HR,Lc.HR],[Dc.HTML,Lc.HTML],[Dc.I,Lc.I],[Dc.IMG,Lc.IMG],[Dc.IMAGE,Lc.IMAGE],[Dc.INPUT,Lc.INPUT],[Dc.IFRAME,Lc.IFRAME],[Dc.KEYGEN,Lc.KEYGEN],[Dc.LABEL,Lc.LABEL],[Dc.LI,Lc.LI],[Dc.LINK,Lc.LINK],[Dc.LISTING,Lc.LISTING],[Dc.MAIN,Lc.MAIN],[Dc.MALIGNMARK,Lc.MALIGNMARK],[Dc.MARQUEE,Lc.MARQUEE],[Dc.MATH,Lc.MATH],[Dc.MENU,Lc.MENU],[Dc.META,Lc.META],[Dc.MGLYPH,Lc.MGLYPH],[Dc.MI,Lc.MI],[Dc.MO,Lc.MO],[Dc.MN,Lc.MN],[Dc.MS,Lc.MS],[Dc.MTEXT,Lc.MTEXT],[Dc.NAV,Lc.NAV],[Dc.NOBR,Lc.NOBR],[Dc.NOFRAMES,Lc.NOFRAMES],[Dc.NOEMBED,Lc.NOEMBED],[Dc.NOSCRIPT,Lc.NOSCRIPT],[Dc.OBJECT,Lc.OBJECT],[Dc.OL,Lc.OL],[Dc.OPTGROUP,Lc.OPTGROUP],[Dc.OPTION,Lc.OPTION],[Dc.P,Lc.P],[Dc.PARAM,Lc.PARAM],[Dc.PLAINTEXT,Lc.PLAINTEXT],[Dc.PRE,Lc.PRE],[Dc.RB,Lc.RB],[Dc.RP,Lc.RP],[Dc.RT,Lc.RT],[Dc.RTC,Lc.RTC],[Dc.RUBY,Lc.RUBY],[Dc.S,Lc.S],[Dc.SCRIPT,Lc.SCRIPT],[Dc.SEARCH,Lc.SEARCH],[Dc.SECTION,Lc.SECTION],[Dc.SELECT,Lc.SELECT],[Dc.SOURCE,Lc.SOURCE],[Dc.SMALL,Lc.SMALL],[Dc.SPAN,Lc.SPAN],[Dc.STRIKE,Lc.STRIKE],[Dc.STRONG,Lc.STRONG],[Dc.STYLE,Lc.STYLE],[Dc.SUB,Lc.SUB],[Dc.SUMMARY,Lc.SUMMARY],[Dc.SUP,Lc.SUP],[Dc.TABLE,Lc.TABLE],[Dc.TBODY,Lc.TBODY],[Dc.TEMPLATE,Lc.TEMPLATE],[Dc.TEXTAREA,Lc.TEXTAREA],[Dc.TFOOT,Lc.TFOOT],[Dc.TD,Lc.TD],[Dc.TH,Lc.TH],[Dc.THEAD,Lc.THEAD],[Dc.TITLE,Lc.TITLE],[Dc.TR,Lc.TR],[Dc.TRACK,Lc.TRACK],[Dc.TT,Lc.TT],[Dc.U,Lc.U],[Dc.UL,Lc.UL],[Dc.SVG,Lc.SVG],[Dc.VAR,Lc.VAR],[Dc.WBR,Lc.WBR],[Dc.XMP,Lc.XMP]]);function Ic(t){var e;return null!==(e=Oc.get(t))&&void 0!==e?e:Lc.UNKNOWN}var Mc,Fc,$c=Lc,Uc={[kc.HTML]:new Set([$c.ADDRESS,$c.APPLET,$c.AREA,$c.ARTICLE,$c.ASIDE,$c.BASE,$c.BASEFONT,$c.BGSOUND,$c.BLOCKQUOTE,$c.BODY,$c.BR,$c.BUTTON,$c.CAPTION,$c.CENTER,$c.COL,$c.COLGROUP,$c.DD,$c.DETAILS,$c.DIR,$c.DIV,$c.DL,$c.DT,$c.EMBED,$c.FIELDSET,$c.FIGCAPTION,$c.FIGURE,$c.FOOTER,$c.FORM,$c.FRAME,$c.FRAMESET,$c.H1,$c.H2,$c.H3,$c.H4,$c.H5,$c.H6,$c.HEAD,$c.HEADER,$c.HGROUP,$c.HR,$c.HTML,$c.IFRAME,$c.IMG,$c.INPUT,$c.LI,$c.LINK,$c.LISTING,$c.MAIN,$c.MARQUEE,$c.MENU,$c.META,$c.NAV,$c.NOEMBED,$c.NOFRAMES,$c.NOSCRIPT,$c.OBJECT,$c.OL,$c.P,$c.PARAM,$c.PLAINTEXT,$c.PRE,$c.SCRIPT,$c.SECTION,$c.SELECT,$c.SOURCE,$c.STYLE,$c.SUMMARY,$c.TABLE,$c.TBODY,$c.TD,$c.TEMPLATE,$c.TEXTAREA,$c.TFOOT,$c.TH,$c.THEAD,$c.TITLE,$c.TR,$c.TRACK,$c.UL,$c.WBR,$c.XMP]),[kc.MATHML]:new Set([$c.MI,$c.MO,$c.MN,$c.MS,$c.MTEXT,$c.ANNOTATION_XML]),[kc.SVG]:new Set([$c.TITLE,$c.FOREIGN_OBJECT,$c.DESC]),[kc.XLINK]:new Set,[kc.XML]:new Set,[kc.XMLNS]:new Set},Bc=new Set([$c.H1,$c.H2,$c.H3,$c.H4,$c.H5,$c.H6]);Dc.STYLE,Dc.SCRIPT,Dc.XMP,Dc.IFRAME,Dc.NOEMBED,Dc.NOFRAMES,Dc.PLAINTEXT,(Fc=Mc||(Mc={}))[Fc.DATA=0]="DATA",Fc[Fc.RCDATA=1]="RCDATA",Fc[Fc.RAWTEXT=2]="RAWTEXT",Fc[Fc.SCRIPT_DATA=3]="SCRIPT_DATA",Fc[Fc.PLAINTEXT=4]="PLAINTEXT",Fc[Fc.TAG_OPEN=5]="TAG_OPEN",Fc[Fc.END_TAG_OPEN=6]="END_TAG_OPEN",Fc[Fc.TAG_NAME=7]="TAG_NAME",Fc[Fc.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",Fc[Fc.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",Fc[Fc.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",Fc[Fc.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",Fc[Fc.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",Fc[Fc.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",Fc[Fc.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",Fc[Fc.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",Fc[Fc.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",Fc[Fc.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",Fc[Fc.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",Fc[Fc.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",Fc[Fc.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",Fc[Fc.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",Fc[Fc.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",Fc[Fc.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",Fc[Fc.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",Fc[Fc.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",Fc[Fc.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",Fc[Fc.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",Fc[Fc.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",Fc[Fc.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",Fc[Fc.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",Fc[Fc.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",Fc[Fc.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",Fc[Fc.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",Fc[Fc.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",Fc[Fc.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",Fc[Fc.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",Fc[Fc.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",Fc[Fc.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",Fc[Fc.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",Fc[Fc.BOGUS_COMMENT=40]="BOGUS_COMMENT",Fc[Fc.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",Fc[Fc.COMMENT_START=42]="COMMENT_START",Fc[Fc.COMMENT_START_DASH=43]="COMMENT_START_DASH",Fc[Fc.COMMENT=44]="COMMENT",Fc[Fc.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",Fc[Fc.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",Fc[Fc.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",Fc[Fc.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",Fc[Fc.COMMENT_END_DASH=49]="COMMENT_END_DASH",Fc[Fc.COMMENT_END=50]="COMMENT_END",Fc[Fc.COMMENT_END_BANG=51]="COMMENT_END_BANG",Fc[Fc.DOCTYPE=52]="DOCTYPE",Fc[Fc.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",Fc[Fc.DOCTYPE_NAME=54]="DOCTYPE_NAME",Fc[Fc.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",Fc[Fc.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",Fc[Fc.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",Fc[Fc.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",Fc[Fc.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",Fc[Fc.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",Fc[Fc.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",Fc[Fc.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",Fc[Fc.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",Fc[Fc.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",Fc[Fc.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",Fc[Fc.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",Fc[Fc.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",Fc[Fc.CDATA_SECTION=68]="CDATA_SECTION",Fc[Fc.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",Fc[Fc.CDATA_SECTION_END=70]="CDATA_SECTION_END",Fc[Fc.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",Fc[Fc.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND";var qc={DATA:Mc.DATA,RCDATA:Mc.RCDATA,RAWTEXT:Mc.RAWTEXT,SCRIPT_DATA:Mc.SCRIPT_DATA,PLAINTEXT:Mc.PLAINTEXT,CDATA_SECTION:Mc.CDATA_SECTION};function jc(t){return t>=Kl.LATIN_CAPITAL_A&&t<=Kl.LATIN_CAPITAL_Z}function Hc(t){return function(t){return t>=Kl.LATIN_SMALL_A&&t<=Kl.LATIN_SMALL_Z}(t)||jc(t)}function zc(t){return Hc(t)||function(t){return t>=Kl.DIGIT_0&&t<=Kl.DIGIT_9}(t)}function Wc(t){return t+32}function Gc(t){return t===Kl.SPACE||t===Kl.LINE_FEED||t===Kl.TABULATION||t===Kl.FORM_FEED}function Vc(t){return Gc(t)||t===Kl.SOLIDUS||t===Kl.GREATER_THAN_SIGN}var Yc,Kc,Xc=class{constructor(t,e){this.options=t,this.handler=e,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=Mc.DATA,this.returnState=Mc.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new oc(e),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Nc(wc,(t,e)=>{this.preprocessor.pos=this.entityStartPos+e-1,this.xt(t)},e.onParseError?{missingSemicolonAfterCharacterReference:()=>{this.Et(Ql.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:t=>{this.Et(Ql.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+t)},validateNumericCharacterReference:t=>{const e=function(t){return t===Kl.NULL?Ql.nullCharacterReference:t>1114111?Ql.characterReferenceOutsideUnicodeRange:nc(t)?Ql.surrogateCharacterReference:ic(t)?Ql.noncharacterCharacterReference:rc(t)||t===Kl.CARRIAGE_RETURN?Ql.controlCharacterReference:null}(t);e&&this.Et(e,1)}}:void 0)}Et(t,e=0){var n,r;null===(r=(n=this.handler).onParseError)||void 0===r||r.call(n,this.preprocessor.getError(t,e))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}At(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this.Ct();this.Dt()||this.Pt(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,this.inLoop||(this.At(),this.paused||null==t||t())}write(t,e,n){this.active=!0,this.preprocessor.write(t,e),this.At(),this.paused||null==n||n()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this.At()}Dt(){return!!this.preprocessor.endOfChunkHit&&(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0)}Ct(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}Lt(t){this.consumedAfterSnapshot+=t;for(let e=0;e<t;e++)this.preprocessor.advance()}Rt(t,e){return!!this.preprocessor.startsWith(t,e)&&(this.Lt(t.length-1),!0)}Nt(){this.currentToken={type:sc.START_TAG,tagName:"",tagID:Lc.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_t(){this.currentToken={type:sc.END_TAG,tagName:"",tagID:Lc.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}Ot(t){this.currentToken={type:sc.COMMENT,data:"",location:this.getCurrentLocation(t)}}It(t){this.currentToken={type:sc.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}Mt(t,e){this.currentCharacterToken={type:t,chars:e,location:this.currentLocation}}Ft(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}$t(){var t,e;const n=this.currentToken;null===lc(n,this.currentAttr.name)?(n.attrs.push(this.currentAttr),n.location&&this.currentLocation&&((null!==(t=(e=n.location).attrs)&&void 0!==t?t:e.attrs=Object.create(null))[this.currentAttr.name]=this.currentLocation,this.Ut())):this.Et(Ql.duplicateAttribute)}Ut(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this.Bt(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=Ic(t.tagName),t.type===sc.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this.Et(Ql.endTagWithAttributes),t.selfClosing&&this.Et(Ql.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}Bt(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case sc.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case sc.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case sc.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}qt(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this.Bt(t),this.handler.onEof({type:sc.EOF,location:t}),this.active=!1}jt(t,e){if(this.currentCharacterToken){if(this.currentCharacterToken.type===t)return void(this.currentCharacterToken.chars+=e);this.currentLocation=this.getCurrentLocation(0),this.Bt(this.currentLocation),this.preprocessor.dropParsedChunk()}this.Mt(t,e)}Ht(t){const e=Gc(t)?sc.WHITESPACE_CHARACTER:t===Kl.NULL?sc.NULL_CHARACTER:sc.CHARACTER;this.jt(e,String.fromCodePoint(t))}zt(t){this.jt(sc.CHARACTER,t)}Wt(){this.returnState=this.state,this.state=Mc.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this.Gt()?gc.Attribute:gc.Legacy)}Gt(){return this.returnState===Mc.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Mc.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Mc.ATTRIBUTE_VALUE_UNQUOTED}xt(t){this.Gt()?this.currentAttr.value+=String.fromCodePoint(t):this.Ht(t)}Pt(t){switch(this.state){case Mc.DATA:this.Vt(t);break;case Mc.RCDATA:this.Yt(t);break;case Mc.RAWTEXT:this.Kt(t);break;case Mc.SCRIPT_DATA:this.Xt(t);break;case Mc.PLAINTEXT:this.Zt(t);break;case Mc.TAG_OPEN:this.Jt(t);break;case Mc.END_TAG_OPEN:this.Qt(t);break;case Mc.TAG_NAME:this.te(t);break;case Mc.RCDATA_LESS_THAN_SIGN:this.ee(t);break;case Mc.RCDATA_END_TAG_OPEN:this.re(t);break;case Mc.RCDATA_END_TAG_NAME:this.ie(t);break;case Mc.RAWTEXT_LESS_THAN_SIGN:this.se(t);break;case Mc.RAWTEXT_END_TAG_OPEN:this.ae(t);break;case Mc.RAWTEXT_END_TAG_NAME:this.oe(t);break;case Mc.SCRIPT_DATA_LESS_THAN_SIGN:this.ce(t);break;case Mc.SCRIPT_DATA_END_TAG_OPEN:this.he(t);break;case Mc.SCRIPT_DATA_END_TAG_NAME:this.ue(t);break;case Mc.SCRIPT_DATA_ESCAPE_START:this.fe(t);break;case Mc.SCRIPT_DATA_ESCAPE_START_DASH:this.de(t);break;case Mc.SCRIPT_DATA_ESCAPED:this.pe(t);break;case Mc.SCRIPT_DATA_ESCAPED_DASH:this.me(t);break;case Mc.SCRIPT_DATA_ESCAPED_DASH_DASH:this.we(t);break;case Mc.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this.ye(t);break;case Mc.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this.be(t);break;case Mc.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this.ve(t);break;case Mc.SCRIPT_DATA_DOUBLE_ESCAPE_START:this.Ee(t);break;case Mc.SCRIPT_DATA_DOUBLE_ESCAPED:this.ke(t);break;case Mc.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this.Se(t);break;case Mc.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this.Te(t);break;case Mc.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this.xe(t);break;case Mc.SCRIPT_DATA_DOUBLE_ESCAPE_END:this.Ae(t);break;case Mc.BEFORE_ATTRIBUTE_NAME:this.Ce(t);break;case Mc.ATTRIBUTE_NAME:this.De(t);break;case Mc.AFTER_ATTRIBUTE_NAME:this.Pe(t);break;case Mc.BEFORE_ATTRIBUTE_VALUE:this.Le(t);break;case Mc.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this.Re(t);break;case Mc.ATTRIBUTE_VALUE_SINGLE_QUOTED:this.Ne(t);break;case Mc.ATTRIBUTE_VALUE_UNQUOTED:this._e(t);break;case Mc.AFTER_ATTRIBUTE_VALUE_QUOTED:this.Oe(t);break;case Mc.SELF_CLOSING_START_TAG:this.Ie(t);break;case Mc.BOGUS_COMMENT:this.Me(t);break;case Mc.MARKUP_DECLARATION_OPEN:this.Fe(t);break;case Mc.COMMENT_START:this.$e(t);break;case Mc.COMMENT_START_DASH:this.Ue(t);break;case Mc.COMMENT:this.Be(t);break;case Mc.COMMENT_LESS_THAN_SIGN:this.qe(t);break;case Mc.COMMENT_LESS_THAN_SIGN_BANG:this.je(t);break;case Mc.COMMENT_LESS_THAN_SIGN_BANG_DASH:this.He(t);break;case Mc.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this.ze(t);break;case Mc.COMMENT_END_DASH:this.We(t);break;case Mc.COMMENT_END:this.Ge(t);break;case Mc.COMMENT_END_BANG:this.Ve(t);break;case Mc.DOCTYPE:this.Ye(t);break;case Mc.BEFORE_DOCTYPE_NAME:this.Ke(t);break;case Mc.DOCTYPE_NAME:this.Xe(t);break;case Mc.AFTER_DOCTYPE_NAME:this.Ze(t);break;case Mc.AFTER_DOCTYPE_PUBLIC_KEYWORD:this.Je(t);break;case Mc.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this.Qe(t);break;case Mc.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this.tn(t);break;case Mc.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this.nn(t);break;case Mc.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this.rn(t);break;case Mc.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this.sn(t);break;case Mc.AFTER_DOCTYPE_SYSTEM_KEYWORD:this.an(t);break;case Mc.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this.ln(t);break;case Mc.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this.cn(t);break;case Mc.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this.hn(t);break;case Mc.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this.un(t);break;case Mc.BOGUS_DOCTYPE:this.fn(t);break;case Mc.CDATA_SECTION:this.dn(t);break;case Mc.CDATA_SECTION_BRACKET:this.pn(t);break;case Mc.CDATA_SECTION_END:this.gn(t);break;case Mc.CHARACTER_REFERENCE:this.mn();break;case Mc.AMBIGUOUS_AMPERSAND:this.wn(t);break;default:throw new Error("Unknown state")}}Vt(t){switch(t){case Kl.LESS_THAN_SIGN:this.state=Mc.TAG_OPEN;break;case Kl.AMPERSAND:this.Wt();break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.Ht(t);break;case Kl.EOF:this.qt();break;default:this.Ht(t)}}Yt(t){switch(t){case Kl.AMPERSAND:this.Wt();break;case Kl.LESS_THAN_SIGN:this.state=Mc.RCDATA_LESS_THAN_SIGN;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.zt(Jl);break;case Kl.EOF:this.qt();break;default:this.Ht(t)}}Kt(t){switch(t){case Kl.LESS_THAN_SIGN:this.state=Mc.RAWTEXT_LESS_THAN_SIGN;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.zt(Jl);break;case Kl.EOF:this.qt();break;default:this.Ht(t)}}Xt(t){switch(t){case Kl.LESS_THAN_SIGN:this.state=Mc.SCRIPT_DATA_LESS_THAN_SIGN;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.zt(Jl);break;case Kl.EOF:this.qt();break;default:this.Ht(t)}}Zt(t){switch(t){case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.zt(Jl);break;case Kl.EOF:this.qt();break;default:this.Ht(t)}}Jt(t){if(Hc(t))this.Nt(),this.state=Mc.TAG_NAME,this.te(t);else switch(t){case Kl.EXCLAMATION_MARK:this.state=Mc.MARKUP_DECLARATION_OPEN;break;case Kl.SOLIDUS:this.state=Mc.END_TAG_OPEN;break;case Kl.QUESTION_MARK:this.Et(Ql.unexpectedQuestionMarkInsteadOfTagName),this.Ot(1),this.state=Mc.BOGUS_COMMENT,this.Me(t);break;case Kl.EOF:this.Et(Ql.eofBeforeTagName),this.zt("<"),this.qt();break;default:this.Et(Ql.invalidFirstCharacterOfTagName),this.zt("<"),this.state=Mc.DATA,this.Vt(t)}}Qt(t){if(Hc(t))this._t(),this.state=Mc.TAG_NAME,this.te(t);else switch(t){case Kl.GREATER_THAN_SIGN:this.Et(Ql.missingEndTagName),this.state=Mc.DATA;break;case Kl.EOF:this.Et(Ql.eofBeforeTagName),this.zt("</"),this.qt();break;default:this.Et(Ql.invalidFirstCharacterOfTagName),this.Ot(2),this.state=Mc.BOGUS_COMMENT,this.Me(t)}}te(t){const e=this.currentToken;switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:this.state=Mc.BEFORE_ATTRIBUTE_NAME;break;case Kl.SOLIDUS:this.state=Mc.SELF_CLOSING_START_TAG;break;case Kl.GREATER_THAN_SIGN:this.state=Mc.DATA,this.emitCurrentTagToken();break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),e.tagName+=Jl;break;case Kl.EOF:this.Et(Ql.eofInTag),this.qt();break;default:e.tagName+=String.fromCodePoint(jc(t)?Wc(t):t)}}ee(t){t===Kl.SOLIDUS?this.state=Mc.RCDATA_END_TAG_OPEN:(this.zt("<"),this.state=Mc.RCDATA,this.Yt(t))}re(t){Hc(t)?(this.state=Mc.RCDATA_END_TAG_NAME,this.ie(t)):(this.zt("</"),this.state=Mc.RCDATA,this.Yt(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this.Dt();switch(this._t(),this.currentToken.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:return this.Lt(this.lastStartTagName.length),this.state=Mc.BEFORE_ATTRIBUTE_NAME,!1;case Kl.SOLIDUS:return this.Lt(this.lastStartTagName.length),this.state=Mc.SELF_CLOSING_START_TAG,!1;case Kl.GREATER_THAN_SIGN:return this.Lt(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=Mc.DATA,!1;default:return!this.Dt()}}ie(t){this.handleSpecialEndTag(t)&&(this.zt("</"),this.state=Mc.RCDATA,this.Yt(t))}se(t){t===Kl.SOLIDUS?this.state=Mc.RAWTEXT_END_TAG_OPEN:(this.zt("<"),this.state=Mc.RAWTEXT,this.Kt(t))}ae(t){Hc(t)?(this.state=Mc.RAWTEXT_END_TAG_NAME,this.oe(t)):(this.zt("</"),this.state=Mc.RAWTEXT,this.Kt(t))}oe(t){this.handleSpecialEndTag(t)&&(this.zt("</"),this.state=Mc.RAWTEXT,this.Kt(t))}ce(t){switch(t){case Kl.SOLIDUS:this.state=Mc.SCRIPT_DATA_END_TAG_OPEN;break;case Kl.EXCLAMATION_MARK:this.state=Mc.SCRIPT_DATA_ESCAPE_START,this.zt("<!");break;default:this.zt("<"),this.state=Mc.SCRIPT_DATA,this.Xt(t)}}he(t){Hc(t)?(this.state=Mc.SCRIPT_DATA_END_TAG_NAME,this.ue(t)):(this.zt("</"),this.state=Mc.SCRIPT_DATA,this.Xt(t))}ue(t){this.handleSpecialEndTag(t)&&(this.zt("</"),this.state=Mc.SCRIPT_DATA,this.Xt(t))}fe(t){t===Kl.HYPHEN_MINUS?(this.state=Mc.SCRIPT_DATA_ESCAPE_START_DASH,this.zt("-")):(this.state=Mc.SCRIPT_DATA,this.Xt(t))}de(t){t===Kl.HYPHEN_MINUS?(this.state=Mc.SCRIPT_DATA_ESCAPED_DASH_DASH,this.zt("-")):(this.state=Mc.SCRIPT_DATA,this.Xt(t))}pe(t){switch(t){case Kl.HYPHEN_MINUS:this.state=Mc.SCRIPT_DATA_ESCAPED_DASH,this.zt("-");break;case Kl.LESS_THAN_SIGN:this.state=Mc.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.zt(Jl);break;case Kl.EOF:this.Et(Ql.eofInScriptHtmlCommentLikeText),this.qt();break;default:this.Ht(t)}}me(t){switch(t){case Kl.HYPHEN_MINUS:this.state=Mc.SCRIPT_DATA_ESCAPED_DASH_DASH,this.zt("-");break;case Kl.LESS_THAN_SIGN:this.state=Mc.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.state=Mc.SCRIPT_DATA_ESCAPED,this.zt(Jl);break;case Kl.EOF:this.Et(Ql.eofInScriptHtmlCommentLikeText),this.qt();break;default:this.state=Mc.SCRIPT_DATA_ESCAPED,this.Ht(t)}}we(t){switch(t){case Kl.HYPHEN_MINUS:this.zt("-");break;case Kl.LESS_THAN_SIGN:this.state=Mc.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case Kl.GREATER_THAN_SIGN:this.state=Mc.SCRIPT_DATA,this.zt(">");break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.state=Mc.SCRIPT_DATA_ESCAPED,this.zt(Jl);break;case Kl.EOF:this.Et(Ql.eofInScriptHtmlCommentLikeText),this.qt();break;default:this.state=Mc.SCRIPT_DATA_ESCAPED,this.Ht(t)}}ye(t){t===Kl.SOLIDUS?this.state=Mc.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Hc(t)?(this.zt("<"),this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPE_START,this.Ee(t)):(this.zt("<"),this.state=Mc.SCRIPT_DATA_ESCAPED,this.pe(t))}be(t){Hc(t)?(this.state=Mc.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this.ve(t)):(this.zt("</"),this.state=Mc.SCRIPT_DATA_ESCAPED,this.pe(t))}ve(t){this.handleSpecialEndTag(t)&&(this.zt("</"),this.state=Mc.SCRIPT_DATA_ESCAPED,this.pe(t))}Ee(t){if(this.preprocessor.startsWith(ec,!1)&&Vc(this.preprocessor.peek(6))){this.Ht(t);for(let t=0;t<6;t++)this.Ht(this.Ct());this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED}else this.Dt()||(this.state=Mc.SCRIPT_DATA_ESCAPED,this.pe(t))}ke(t){switch(t){case Kl.HYPHEN_MINUS:this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this.zt("-");break;case Kl.LESS_THAN_SIGN:this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this.zt("<");break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.zt(Jl);break;case Kl.EOF:this.Et(Ql.eofInScriptHtmlCommentLikeText),this.qt();break;default:this.Ht(t)}}Se(t){switch(t){case Kl.HYPHEN_MINUS:this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this.zt("-");break;case Kl.LESS_THAN_SIGN:this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this.zt("<");break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED,this.zt(Jl);break;case Kl.EOF:this.Et(Ql.eofInScriptHtmlCommentLikeText),this.qt();break;default:this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED,this.Ht(t)}}Te(t){switch(t){case Kl.HYPHEN_MINUS:this.zt("-");break;case Kl.LESS_THAN_SIGN:this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this.zt("<");break;case Kl.GREATER_THAN_SIGN:this.state=Mc.SCRIPT_DATA,this.zt(">");break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED,this.zt(Jl);break;case Kl.EOF:this.Et(Ql.eofInScriptHtmlCommentLikeText),this.qt();break;default:this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED,this.Ht(t)}}xe(t){t===Kl.SOLIDUS?(this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPE_END,this.zt("/")):(this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED,this.ke(t))}Ae(t){if(this.preprocessor.startsWith(ec,!1)&&Vc(this.preprocessor.peek(6))){this.Ht(t);for(let t=0;t<6;t++)this.Ht(this.Ct());this.state=Mc.SCRIPT_DATA_ESCAPED}else this.Dt()||(this.state=Mc.SCRIPT_DATA_DOUBLE_ESCAPED,this.ke(t))}Ce(t){switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:break;case Kl.SOLIDUS:case Kl.GREATER_THAN_SIGN:case Kl.EOF:this.state=Mc.AFTER_ATTRIBUTE_NAME,this.Pe(t);break;case Kl.EQUALS_SIGN:this.Et(Ql.unexpectedEqualsSignBeforeAttributeName),this.Ft("="),this.state=Mc.ATTRIBUTE_NAME;break;default:this.Ft(""),this.state=Mc.ATTRIBUTE_NAME,this.De(t)}}De(t){switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:case Kl.SOLIDUS:case Kl.GREATER_THAN_SIGN:case Kl.EOF:this.$t(),this.state=Mc.AFTER_ATTRIBUTE_NAME,this.Pe(t);break;case Kl.EQUALS_SIGN:this.$t(),this.state=Mc.BEFORE_ATTRIBUTE_VALUE;break;case Kl.QUOTATION_MARK:case Kl.APOSTROPHE:case Kl.LESS_THAN_SIGN:this.Et(Ql.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.currentAttr.name+=Jl;break;default:this.currentAttr.name+=String.fromCodePoint(jc(t)?Wc(t):t)}}Pe(t){switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:break;case Kl.SOLIDUS:this.state=Mc.SELF_CLOSING_START_TAG;break;case Kl.EQUALS_SIGN:this.state=Mc.BEFORE_ATTRIBUTE_VALUE;break;case Kl.GREATER_THAN_SIGN:this.state=Mc.DATA,this.emitCurrentTagToken();break;case Kl.EOF:this.Et(Ql.eofInTag),this.qt();break;default:this.Ft(""),this.state=Mc.ATTRIBUTE_NAME,this.De(t)}}Le(t){switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:break;case Kl.QUOTATION_MARK:this.state=Mc.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case Kl.APOSTROPHE:this.state=Mc.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.missingAttributeValue),this.state=Mc.DATA,this.emitCurrentTagToken();break;default:this.state=Mc.ATTRIBUTE_VALUE_UNQUOTED,this._e(t)}}Re(t){switch(t){case Kl.QUOTATION_MARK:this.state=Mc.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case Kl.AMPERSAND:this.Wt();break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.currentAttr.value+=Jl;break;case Kl.EOF:this.Et(Ql.eofInTag),this.qt();break;default:this.currentAttr.value+=String.fromCodePoint(t)}}Ne(t){switch(t){case Kl.APOSTROPHE:this.state=Mc.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case Kl.AMPERSAND:this.Wt();break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.currentAttr.value+=Jl;break;case Kl.EOF:this.Et(Ql.eofInTag),this.qt();break;default:this.currentAttr.value+=String.fromCodePoint(t)}}_e(t){switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:this.Ut(),this.state=Mc.BEFORE_ATTRIBUTE_NAME;break;case Kl.AMPERSAND:this.Wt();break;case Kl.GREATER_THAN_SIGN:this.Ut(),this.state=Mc.DATA,this.emitCurrentTagToken();break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.currentAttr.value+=Jl;break;case Kl.QUOTATION_MARK:case Kl.APOSTROPHE:case Kl.LESS_THAN_SIGN:case Kl.EQUALS_SIGN:case Kl.GRAVE_ACCENT:this.Et(Ql.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break;case Kl.EOF:this.Et(Ql.eofInTag),this.qt();break;default:this.currentAttr.value+=String.fromCodePoint(t)}}Oe(t){switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:this.Ut(),this.state=Mc.BEFORE_ATTRIBUTE_NAME;break;case Kl.SOLIDUS:this.Ut(),this.state=Mc.SELF_CLOSING_START_TAG;break;case Kl.GREATER_THAN_SIGN:this.Ut(),this.state=Mc.DATA,this.emitCurrentTagToken();break;case Kl.EOF:this.Et(Ql.eofInTag),this.qt();break;default:this.Et(Ql.missingWhitespaceBetweenAttributes),this.state=Mc.BEFORE_ATTRIBUTE_NAME,this.Ce(t)}}Ie(t){switch(t){case Kl.GREATER_THAN_SIGN:this.currentToken.selfClosing=!0,this.state=Mc.DATA,this.emitCurrentTagToken();break;case Kl.EOF:this.Et(Ql.eofInTag),this.qt();break;default:this.Et(Ql.unexpectedSolidusInTag),this.state=Mc.BEFORE_ATTRIBUTE_NAME,this.Ce(t)}}Me(t){const e=this.currentToken;switch(t){case Kl.GREATER_THAN_SIGN:this.state=Mc.DATA,this.emitCurrentComment(e);break;case Kl.EOF:this.emitCurrentComment(e),this.qt();break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),e.data+=Jl;break;default:e.data+=String.fromCodePoint(t)}}Fe(t){this.Rt("--",!0)?(this.Ot(3),this.state=Mc.COMMENT_START):this.Rt("doctype",!1)?(this.currentLocation=this.getCurrentLocation(8),this.state=Mc.DOCTYPE):this.Rt("[CDATA[",!0)?this.inForeignNode?this.state=Mc.CDATA_SECTION:(this.Et(Ql.cdataInHtmlContent),this.Ot(8),this.currentToken.data="[CDATA[",this.state=Mc.BOGUS_COMMENT):this.Dt()||(this.Et(Ql.incorrectlyOpenedComment),this.Ot(2),this.state=Mc.BOGUS_COMMENT,this.Me(t))}$e(t){switch(t){case Kl.HYPHEN_MINUS:this.state=Mc.COMMENT_START_DASH;break;case Kl.GREATER_THAN_SIGN:{this.Et(Ql.abruptClosingOfEmptyComment),this.state=Mc.DATA;const t=this.currentToken;this.emitCurrentComment(t);break}default:this.state=Mc.COMMENT,this.Be(t)}}Ue(t){const e=this.currentToken;switch(t){case Kl.HYPHEN_MINUS:this.state=Mc.COMMENT_END;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.abruptClosingOfEmptyComment),this.state=Mc.DATA,this.emitCurrentComment(e);break;case Kl.EOF:this.Et(Ql.eofInComment),this.emitCurrentComment(e),this.qt();break;default:e.data+="-",this.state=Mc.COMMENT,this.Be(t)}}Be(t){const e=this.currentToken;switch(t){case Kl.HYPHEN_MINUS:this.state=Mc.COMMENT_END_DASH;break;case Kl.LESS_THAN_SIGN:e.data+="<",this.state=Mc.COMMENT_LESS_THAN_SIGN;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),e.data+=Jl;break;case Kl.EOF:this.Et(Ql.eofInComment),this.emitCurrentComment(e),this.qt();break;default:e.data+=String.fromCodePoint(t)}}qe(t){const e=this.currentToken;switch(t){case Kl.EXCLAMATION_MARK:e.data+="!",this.state=Mc.COMMENT_LESS_THAN_SIGN_BANG;break;case Kl.LESS_THAN_SIGN:e.data+="<";break;default:this.state=Mc.COMMENT,this.Be(t)}}je(t){t===Kl.HYPHEN_MINUS?this.state=Mc.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=Mc.COMMENT,this.Be(t))}He(t){t===Kl.HYPHEN_MINUS?this.state=Mc.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=Mc.COMMENT_END_DASH,this.We(t))}ze(t){t!==Kl.GREATER_THAN_SIGN&&t!==Kl.EOF&&this.Et(Ql.nestedComment),this.state=Mc.COMMENT_END,this.Ge(t)}We(t){const e=this.currentToken;switch(t){case Kl.HYPHEN_MINUS:this.state=Mc.COMMENT_END;break;case Kl.EOF:this.Et(Ql.eofInComment),this.emitCurrentComment(e),this.qt();break;default:e.data+="-",this.state=Mc.COMMENT,this.Be(t)}}Ge(t){const e=this.currentToken;switch(t){case Kl.GREATER_THAN_SIGN:this.state=Mc.DATA,this.emitCurrentComment(e);break;case Kl.EXCLAMATION_MARK:this.state=Mc.COMMENT_END_BANG;break;case Kl.HYPHEN_MINUS:e.data+="-";break;case Kl.EOF:this.Et(Ql.eofInComment),this.emitCurrentComment(e),this.qt();break;default:e.data+="--",this.state=Mc.COMMENT,this.Be(t)}}Ve(t){const e=this.currentToken;switch(t){case Kl.HYPHEN_MINUS:e.data+="--!",this.state=Mc.COMMENT_END_DASH;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.incorrectlyClosedComment),this.state=Mc.DATA,this.emitCurrentComment(e);break;case Kl.EOF:this.Et(Ql.eofInComment),this.emitCurrentComment(e),this.qt();break;default:e.data+="--!",this.state=Mc.COMMENT,this.Be(t)}}Ye(t){switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:this.state=Mc.BEFORE_DOCTYPE_NAME;break;case Kl.GREATER_THAN_SIGN:this.state=Mc.BEFORE_DOCTYPE_NAME,this.Ke(t);break;case Kl.EOF:{this.Et(Ql.eofInDoctype),this.It(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this.qt();break}default:this.Et(Ql.missingWhitespaceBeforeDoctypeName),this.state=Mc.BEFORE_DOCTYPE_NAME,this.Ke(t)}}Ke(t){if(jc(t))this.It(String.fromCharCode(Wc(t))),this.state=Mc.DOCTYPE_NAME;else switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),this.It(Jl),this.state=Mc.DOCTYPE_NAME;break;case Kl.GREATER_THAN_SIGN:{this.Et(Ql.missingDoctypeName),this.It(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Mc.DATA;break}case Kl.EOF:{this.Et(Ql.eofInDoctype),this.It(null);const t=this.currentToken;t.forceQuirks=!0,this.emitCurrentDoctype(t),this.qt();break}default:this.It(String.fromCodePoint(t)),this.state=Mc.DOCTYPE_NAME}}Xe(t){const e=this.currentToken;switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:this.state=Mc.AFTER_DOCTYPE_NAME;break;case Kl.GREATER_THAN_SIGN:this.state=Mc.DATA,this.emitCurrentDoctype(e);break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),e.name+=Jl;break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:e.name+=String.fromCodePoint(jc(t)?Wc(t):t)}}Ze(t){const e=this.currentToken;switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:break;case Kl.GREATER_THAN_SIGN:this.state=Mc.DATA,this.emitCurrentDoctype(e);break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:this.Rt("public",!1)?this.state=Mc.AFTER_DOCTYPE_PUBLIC_KEYWORD:this.Rt("system",!1)?this.state=Mc.AFTER_DOCTYPE_SYSTEM_KEYWORD:this.Dt()||(this.Et(Ql.invalidCharacterSequenceAfterDoctypeName),e.forceQuirks=!0,this.state=Mc.BOGUS_DOCTYPE,this.fn(t))}}Je(t){const e=this.currentToken;switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:this.state=Mc.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case Kl.QUOTATION_MARK:this.Et(Ql.missingWhitespaceAfterDoctypePublicKeyword),e.publicId="",this.state=Mc.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case Kl.APOSTROPHE:this.Et(Ql.missingWhitespaceAfterDoctypePublicKeyword),e.publicId="",this.state=Mc.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.missingDoctypePublicIdentifier),e.forceQuirks=!0,this.state=Mc.DATA,this.emitCurrentDoctype(e);break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:this.Et(Ql.missingQuoteBeforeDoctypePublicIdentifier),e.forceQuirks=!0,this.state=Mc.BOGUS_DOCTYPE,this.fn(t)}}Qe(t){const e=this.currentToken;switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:break;case Kl.QUOTATION_MARK:e.publicId="",this.state=Mc.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case Kl.APOSTROPHE:e.publicId="",this.state=Mc.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.missingDoctypePublicIdentifier),e.forceQuirks=!0,this.state=Mc.DATA,this.emitCurrentDoctype(e);break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:this.Et(Ql.missingQuoteBeforeDoctypePublicIdentifier),e.forceQuirks=!0,this.state=Mc.BOGUS_DOCTYPE,this.fn(t)}}tn(t){const e=this.currentToken;switch(t){case Kl.QUOTATION_MARK:this.state=Mc.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),e.publicId+=Jl;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.abruptDoctypePublicIdentifier),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=Mc.DATA;break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:e.publicId+=String.fromCodePoint(t)}}nn(t){const e=this.currentToken;switch(t){case Kl.APOSTROPHE:this.state=Mc.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),e.publicId+=Jl;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.abruptDoctypePublicIdentifier),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=Mc.DATA;break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:e.publicId+=String.fromCodePoint(t)}}rn(t){const e=this.currentToken;switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:this.state=Mc.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case Kl.GREATER_THAN_SIGN:this.state=Mc.DATA,this.emitCurrentDoctype(e);break;case Kl.QUOTATION_MARK:this.Et(Ql.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),e.systemId="",this.state=Mc.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case Kl.APOSTROPHE:this.Et(Ql.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),e.systemId="",this.state=Mc.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:this.Et(Ql.missingQuoteBeforeDoctypeSystemIdentifier),e.forceQuirks=!0,this.state=Mc.BOGUS_DOCTYPE,this.fn(t)}}sn(t){const e=this.currentToken;switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:break;case Kl.GREATER_THAN_SIGN:this.emitCurrentDoctype(e),this.state=Mc.DATA;break;case Kl.QUOTATION_MARK:e.systemId="",this.state=Mc.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case Kl.APOSTROPHE:e.systemId="",this.state=Mc.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:this.Et(Ql.missingQuoteBeforeDoctypeSystemIdentifier),e.forceQuirks=!0,this.state=Mc.BOGUS_DOCTYPE,this.fn(t)}}an(t){const e=this.currentToken;switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:this.state=Mc.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case Kl.QUOTATION_MARK:this.Et(Ql.missingWhitespaceAfterDoctypeSystemKeyword),e.systemId="",this.state=Mc.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case Kl.APOSTROPHE:this.Et(Ql.missingWhitespaceAfterDoctypeSystemKeyword),e.systemId="",this.state=Mc.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.missingDoctypeSystemIdentifier),e.forceQuirks=!0,this.state=Mc.DATA,this.emitCurrentDoctype(e);break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:this.Et(Ql.missingQuoteBeforeDoctypeSystemIdentifier),e.forceQuirks=!0,this.state=Mc.BOGUS_DOCTYPE,this.fn(t)}}ln(t){const e=this.currentToken;switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:break;case Kl.QUOTATION_MARK:e.systemId="",this.state=Mc.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case Kl.APOSTROPHE:e.systemId="",this.state=Mc.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.missingDoctypeSystemIdentifier),e.forceQuirks=!0,this.state=Mc.DATA,this.emitCurrentDoctype(e);break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:this.Et(Ql.missingQuoteBeforeDoctypeSystemIdentifier),e.forceQuirks=!0,this.state=Mc.BOGUS_DOCTYPE,this.fn(t)}}cn(t){const e=this.currentToken;switch(t){case Kl.QUOTATION_MARK:this.state=Mc.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),e.systemId+=Jl;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.abruptDoctypeSystemIdentifier),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=Mc.DATA;break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:e.systemId+=String.fromCodePoint(t)}}hn(t){const e=this.currentToken;switch(t){case Kl.APOSTROPHE:this.state=Mc.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter),e.systemId+=Jl;break;case Kl.GREATER_THAN_SIGN:this.Et(Ql.abruptDoctypeSystemIdentifier),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=Mc.DATA;break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:e.systemId+=String.fromCodePoint(t)}}un(t){const e=this.currentToken;switch(t){case Kl.SPACE:case Kl.LINE_FEED:case Kl.TABULATION:case Kl.FORM_FEED:break;case Kl.GREATER_THAN_SIGN:this.emitCurrentDoctype(e),this.state=Mc.DATA;break;case Kl.EOF:this.Et(Ql.eofInDoctype),e.forceQuirks=!0,this.emitCurrentDoctype(e),this.qt();break;default:this.Et(Ql.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=Mc.BOGUS_DOCTYPE,this.fn(t)}}fn(t){const e=this.currentToken;switch(t){case Kl.GREATER_THAN_SIGN:this.emitCurrentDoctype(e),this.state=Mc.DATA;break;case Kl.NULL:this.Et(Ql.unexpectedNullCharacter);break;case Kl.EOF:this.emitCurrentDoctype(e),this.qt()}}dn(t){switch(t){case Kl.RIGHT_SQUARE_BRACKET:this.state=Mc.CDATA_SECTION_BRACKET;break;case Kl.EOF:this.Et(Ql.eofInCdata),this.qt();break;default:this.Ht(t)}}pn(t){t===Kl.RIGHT_SQUARE_BRACKET?this.state=Mc.CDATA_SECTION_END:(this.zt("]"),this.state=Mc.CDATA_SECTION,this.dn(t))}gn(t){switch(t){case Kl.GREATER_THAN_SIGN:this.state=Mc.DATA;break;case Kl.RIGHT_SQUARE_BRACKET:this.zt("]");break;default:this.zt("]]"),this.state=Mc.CDATA_SECTION,this.dn(t)}}mn(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0){if(!this.preprocessor.lastChunkWritten)return this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,void(this.preprocessor.endOfChunkHit=!0);t=this.entityDecoder.end()}0===t?(this.preprocessor.pos=this.entityStartPos,this.xt(Kl.AMPERSAND),this.state=!this.Gt()&&zc(this.preprocessor.peek(1))?Mc.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}wn(t){zc(t)?this.xt(t):(t===Kl.SEMICOLON&&this.Et(Ql.unknownNamedCharacterReference),this.state=this.returnState,this.Pt(t))}},Zc=new Set([Lc.DD,Lc.DT,Lc.LI,Lc.OPTGROUP,Lc.OPTION,Lc.P,Lc.RB,Lc.RP,Lc.RT,Lc.RTC]),Jc=new Set([...Zc,Lc.CAPTION,Lc.COLGROUP,Lc.TBODY,Lc.TD,Lc.TFOOT,Lc.TH,Lc.THEAD,Lc.TR]),Qc=new Set([Lc.APPLET,Lc.CAPTION,Lc.HTML,Lc.MARQUEE,Lc.OBJECT,Lc.TABLE,Lc.TD,Lc.TEMPLATE,Lc.TH]),th=new Set([...Qc,Lc.OL,Lc.UL]),eh=new Set([...Qc,Lc.BUTTON]),nh=new Set([Lc.ANNOTATION_XML,Lc.MI,Lc.MN,Lc.MO,Lc.MS,Lc.MTEXT]),rh=new Set([Lc.DESC,Lc.FOREIGN_OBJECT,Lc.TITLE]),ih=new Set([Lc.TR,Lc.TEMPLATE,Lc.HTML]),sh=new Set([Lc.TBODY,Lc.TFOOT,Lc.THEAD,Lc.TEMPLATE,Lc.HTML]),ah=new Set([Lc.TABLE,Lc.TEMPLATE,Lc.HTML]),oh=new Set([Lc.TD,Lc.TH]),lh=class{get currentTmplContentOrNode(){return this.yn()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,e,n){this.treeAdapter=e,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=Lc.UNKNOWN,this.current=t}bn(t){return this.items.lastIndexOf(t,this.stackTop)}yn(){return this.currentTagId===Lc.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===kc.HTML}vn(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,e){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=e,this.currentTagId=e,this.yn()&&this.tmplCount++,this.handler.onItemPush(t,e,!0)}pop(){const t=this.current;this.tmplCount>0&&this.yn()&&this.tmplCount--,this.stackTop--,this.vn(),this.handler.onItemPop(t,!0)}replace(t,e){const n=this.bn(t);this.items[n]=e,n===this.stackTop&&(this.current=e)}insertAfter(t,e,n){const r=this.bn(t)+1;this.items.splice(r,0,e),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this.vn(),this.current&&void 0!==this.currentTagId&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(t){let e=this.stackTop+1;do{e=this.tagIDs.lastIndexOf(t,e-1)}while(e>0&&this.treeAdapter.getNamespaceURI(this.items[e])!==kc.HTML);this.shortenToLength(Math.max(e,0))}shortenToLength(t){for(;this.stackTop>=t;){const e=this.current;this.tmplCount>0&&this.yn()&&(this.tmplCount-=1),this.stackTop--,this.vn(),this.handler.onItemPop(e,this.stackTop<t)}}popUntilElementPopped(t){const e=this.bn(t);this.shortenToLength(Math.max(e,0))}popUntilPopped(t,e){const n=this.En(t,e);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Bc,kc.HTML)}popUntilTableCellPopped(){this.popUntilPopped(oh,kc.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}En(t,e){for(let n=this.stackTop;n>=0;n--)if(t.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===e)return n;return-1}clearBackTo(t,e){const n=this.En(t,e);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(ah,kc.HTML)}clearBackToTableBodyContext(){this.clearBackTo(sh,kc.HTML)}clearBackToTableRowContext(){this.clearBackTo(ih,kc.HTML)}remove(t){const e=this.bn(t);e>=0&&(e===this.stackTop?this.pop():(this.items.splice(e,1),this.tagIDs.splice(e,1),this.stackTop--,this.vn(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===Lc.BODY?this.items[1]:null}contains(t){return this.bn(t)>-1}getCommonAncestor(t){const e=this.bn(t)-1;return e>=0?this.items[e]:null}isRootHtmlElementCurrent(){return 0===this.stackTop&&this.tagIDs[0]===Lc.HTML}hasInDynamicScope(t,e){for(let n=this.stackTop;n>=0;n--){const r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case kc.HTML:if(r===t)return!0;if(e.has(r))return!1;break;case kc.SVG:if(rh.has(r))return!1;break;case kc.MATHML:if(nh.has(r))return!1}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Qc)}hasInListItemScope(t){return this.hasInDynamicScope(t,th)}hasInButtonScope(t){return this.hasInDynamicScope(t,eh)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const e=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case kc.HTML:if(Bc.has(e))return!0;if(Qc.has(e))return!1;break;case kc.SVG:if(rh.has(e))return!1;break;case kc.MATHML:if(nh.has(e))return!1}}return!0}hasInTableScope(t){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===kc.HTML)switch(this.tagIDs[e]){case t:return!0;case Lc.TABLE:case Lc.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===kc.HTML)switch(this.tagIDs[t]){case Lc.TBODY:case Lc.THEAD:case Lc.TFOOT:return!0;case Lc.TABLE:case Lc.HTML:return!1}return!0}hasInSelectScope(t){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===kc.HTML)switch(this.tagIDs[e]){case t:return!0;case Lc.OPTION:case Lc.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;void 0!==this.currentTagId&&Zc.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;void 0!==this.currentTagId&&Jc.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;void 0!==this.currentTagId&&this.currentTagId!==t&&Jc.has(this.currentTagId);)this.pop()}};(Kc=Yc||(Yc={}))[Kc.Marker=0]="Marker",Kc[Kc.Element=1]="Element";var ch={type:Yc.Marker},hh=class{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}kn(t,e){const n=[],r=e.length,i=this.treeAdapter.getTagName(t),s=this.treeAdapter.getNamespaceURI(t);for(let t=0;t<this.entries.length;t++){const e=this.entries[t];if(e.type===Yc.Marker)break;const{element:a}=e;if(this.treeAdapter.getTagName(a)===i&&this.treeAdapter.getNamespaceURI(a)===s){const e=this.treeAdapter.getAttrList(a);e.length===r&&n.push({idx:t,attrs:e})}}return n}Sn(t){if(this.entries.length<3)return;const e=this.treeAdapter.getAttrList(t),n=this.kn(t,e);if(n.length<3)return;const r=new Map(e.map(t=>[t.name,t.value]));let i=0;for(let t=0;t<n.length;t++){const e=n[t];e.attrs.every(t=>r.get(t.name)===t.value)&&(i+=1,i>=3&&this.entries.splice(e.idx,1))}}insertMarker(){this.entries.unshift(ch)}pushElement(t,e){this.Sn(t),this.entries.unshift({type:Yc.Element,element:t,token:e})}insertElementAfterBookmark(t,e){const n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:Yc.Element,element:t,token:e})}removeEntry(t){const e=this.entries.indexOf(t);-1!==e&&this.entries.splice(e,1)}clearToLastMarker(){const t=this.entries.indexOf(ch);-1===t?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const e=this.entries.find(e=>e.type===Yc.Marker||this.treeAdapter.getTagName(e.element)===t);return e&&e.type===Yc.Element?e:null}getElementEntry(t){return this.entries.find(e=>e.type===Yc.Element&&e.element===t)}},uh={createDocument:()=>({nodeName:"#document",mode:Ac.NO_QUIRKS,childNodes:[]}),createDocumentFragment:()=>({nodeName:"#document-fragment",childNodes:[]}),createElement:(t,e,n)=>({nodeName:t,tagName:t,attrs:n,namespaceURI:e,childNodes:[],parentNode:null}),createCommentNode:t=>({nodeName:"#comment",data:t,parentNode:null}),createTextNode:t=>({nodeName:"#text",value:t,parentNode:null}),appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,n){const r=t.childNodes.indexOf(n);t.childNodes.splice(r,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent:t=>t.content,setDocumentType(t,e,n,r){const i=t.childNodes.find(t=>"#documentType"===t.nodeName);if(i)i.name=e,i.publicId=n,i.systemId=r;else{const i={nodeName:"#documentType",name:e,publicId:n,systemId:r,parentNode:null};uh.appendChild(t,i)}},setDocumentMode(t,e){t.mode=e},getDocumentMode:t=>t.mode,detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const n=t.childNodes[t.childNodes.length-1];if(uh.isTextNode(n))return void(n.value+=e)}uh.appendChild(t,uh.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&uh.isTextNode(r)?r.value+=e:uh.insertBefore(t,uh.createTextNode(e),n)},adoptAttributes(t,e){const n=new Set(t.attrs.map(t=>t.name));for(let r=0;r<e.length;r++)n.has(e[r].name)||t.attrs.push(e[r])},getFirstChild:t=>t.childNodes[0],getChildNodes:t=>t.childNodes,getParentNode:t=>t.parentNode,getAttrList:t=>t.attrs,getTagName:t=>t.tagName,getNamespaceURI:t=>t.namespaceURI,getTextNodeContent:t=>t.value,getCommentNodeContent:t=>t.data,getDocumentTypeNodeName:t=>t.name,getDocumentTypeNodePublicId:t=>t.publicId,getDocumentTypeNodeSystemId:t=>t.systemId,isTextNode:t=>"#text"===t.nodeName,isCommentNode:t=>"#comment"===t.nodeName,isDocumentTypeNode:t=>"#documentType"===t.nodeName,isElementNode:t=>Object.prototype.hasOwnProperty.call(t,"tagName"),setNodeSourceCodeLocation(t,e){t.sourceCodeLocation=e},getNodeSourceCodeLocation:t=>t.sourceCodeLocation,updateNodeSourceCodeLocation(t,e){t.sourceCodeLocation={...t.sourceCodeLocation,...e}}},fh="html",dh=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],ph=[...dh,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],gh=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),mh=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],wh=[...mh,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function yh(t,e){return e.some(e=>t.startsWith(e))}var bh,vh,Eh=new Map(["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(t=>[t.toLowerCase(),t])),kh=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:kc.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:kc.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:kc.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:kc.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:kc.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:kc.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:kc.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:kc.XML}],["xml:space",{prefix:"xml",name:"space",namespace:kc.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:kc.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:kc.XMLNS}]]),Sh=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(t=>[t.toLowerCase(),t])),Th=new Set([Lc.B,Lc.BIG,Lc.BLOCKQUOTE,Lc.BODY,Lc.BR,Lc.CENTER,Lc.CODE,Lc.DD,Lc.DIV,Lc.DL,Lc.DT,Lc.EM,Lc.EMBED,Lc.H1,Lc.H2,Lc.H3,Lc.H4,Lc.H5,Lc.H6,Lc.HEAD,Lc.HR,Lc.I,Lc.IMG,Lc.LI,Lc.LISTING,Lc.MENU,Lc.META,Lc.NOBR,Lc.OL,Lc.P,Lc.PRE,Lc.RUBY,Lc.S,Lc.SMALL,Lc.SPAN,Lc.STRONG,Lc.STRIKE,Lc.SUB,Lc.SUP,Lc.TABLE,Lc.TT,Lc.U,Lc.UL,Lc.VAR]);function xh(t){for(let e=0;e<t.attrs.length;e++)if("definitionurl"===t.attrs[e].name){t.attrs[e].name="definitionURL";break}}function Ah(t){for(let e=0;e<t.attrs.length;e++){const n=Eh.get(t.attrs[e].name);null!=n&&(t.attrs[e].name=n)}}function Ch(t){for(let e=0;e<t.attrs.length;e++){const n=kh.get(t.attrs[e].name);n&&(t.attrs[e].prefix=n.prefix,t.attrs[e].name=n.name,t.attrs[e].namespace=n.namespace)}}(vh=bh||(bh={}))[vh.INITIAL=0]="INITIAL",vh[vh.BEFORE_HTML=1]="BEFORE_HTML",vh[vh.BEFORE_HEAD=2]="BEFORE_HEAD",vh[vh.IN_HEAD=3]="IN_HEAD",vh[vh.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",vh[vh.AFTER_HEAD=5]="AFTER_HEAD",vh[vh.IN_BODY=6]="IN_BODY",vh[vh.TEXT=7]="TEXT",vh[vh.IN_TABLE=8]="IN_TABLE",vh[vh.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",vh[vh.IN_CAPTION=10]="IN_CAPTION",vh[vh.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",vh[vh.IN_TABLE_BODY=12]="IN_TABLE_BODY",vh[vh.IN_ROW=13]="IN_ROW",vh[vh.IN_CELL=14]="IN_CELL",vh[vh.IN_SELECT=15]="IN_SELECT",vh[vh.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",vh[vh.IN_TEMPLATE=17]="IN_TEMPLATE",vh[vh.AFTER_BODY=18]="AFTER_BODY",vh[vh.IN_FRAMESET=19]="IN_FRAMESET",vh[vh.AFTER_FRAMESET=20]="AFTER_FRAMESET",vh[vh.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",vh[vh.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET";var Dh={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Ph=new Set([Lc.TABLE,Lc.TBODY,Lc.TFOOT,Lc.THEAD,Lc.TR]),Lh={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:uh,onParseError:null},Rh=class{constructor(t,e,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=bh.INITIAL,this.originalInsertionMode=bh.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Lh,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=null!=e?e:this.treeAdapter.createDocument(),this.tokenizer=new Xc(this.options,this),this.activeFormattingElements=new hh(this.treeAdapter),this.fragmentContextID=n?Ic(this.treeAdapter.getTagName(n)):Lc.UNKNOWN,this.Tn(null!=n?n:this.document,this.fragmentContextID),this.openElements=new lh(this.document,this.treeAdapter,this)}static parse(t,e){const n=new this(e);return n.tokenizer.write(t,!0),n.document}static getFragmentParser(t,e){const n={...Lh,...e};null!=t||(t=n.treeAdapter.createElement(Dc.TEMPLATE,kc.HTML,[]));const r=n.treeAdapter.createElement("documentmock",kc.HTML,[]),i=new this(n,r,t);return i.fragmentContextID===Lc.TEMPLATE&&i.tmplInsertionModeStack.unshift(bh.IN_TEMPLATE),i.xn(),i.An(),i.Cn(),i.Dn(),i}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),e=this.treeAdapter.createDocumentFragment();return this.Pn(t,e),e}Et(t,e,n){var r;if(!this.onParseError)return;const i=null!==(r=t.location)&&void 0!==r?r:Dh,s={code:e,startLine:i.startLine,startCol:i.startCol,startOffset:i.startOffset,endLine:n?i.startLine:i.endLine,endCol:n?i.startCol:i.endCol,endOffset:n?i.startOffset:i.endOffset};this.onParseError(s)}onItemPush(t,e,n){var r,i;null===(i=(r=this.treeAdapter).onItemPush)||void 0===i||i.call(r,t),n&&this.openElements.stackTop>0&&this.Tn(t,e)}onItemPop(t,e){var n,r;if(this.options.sourceCodeLocationInfo&&this.Ln(t,this.currentToken),null===(r=(n=this.treeAdapter).onItemPop)||void 0===r||r.call(n,t,this.openElements.current),e){let t,e;0===this.openElements.stackTop&&this.fragmentContext?(t=this.fragmentContext,e=this.fragmentContextID):({current:t,currentTagId:e}=this.openElements),this.Tn(t,e)}}Tn(t,e){const n=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===kc.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&void 0!==t&&void 0!==e&&!this.Rn(e,t)}Nn(t,e){this._n(t,kc.HTML),this.tokenizer.state=e,this.originalInsertionMode=this.insertionMode,this.insertionMode=bh.TEXT}switchToPlaintextParsing(){this.insertionMode=bh.TEXT,this.originalInsertionMode=bh.IN_BODY,this.tokenizer.state=qc.PLAINTEXT}On(){return 0===this.openElements.stackTop&&this.fragmentContext?this.fragmentContext:this.openElements.current}Dn(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===Dc.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}xn(){if(this.fragmentContext&&this.treeAdapter.getNamespaceURI(this.fragmentContext)===kc.HTML)switch(this.fragmentContextID){case Lc.TITLE:case Lc.TEXTAREA:this.tokenizer.state=qc.RCDATA;break;case Lc.STYLE:case Lc.XMP:case Lc.IFRAME:case Lc.NOEMBED:case Lc.NOFRAMES:case Lc.NOSCRIPT:this.tokenizer.state=qc.RAWTEXT;break;case Lc.SCRIPT:this.tokenizer.state=qc.SCRIPT_DATA;break;case Lc.PLAINTEXT:this.tokenizer.state=qc.PLAINTEXT}}In(t){const e=t.name||"",n=t.publicId||"",r=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,e,n,r),t.location){const e=this.treeAdapter.getChildNodes(this.document).find(t=>this.treeAdapter.isDocumentTypeNode(t));e&&this.treeAdapter.setNodeSourceCodeLocation(e,t.location)}}Mn(t,e){if(this.options.sourceCodeLocationInfo){const n=e&&{...e,startTag:e};this.treeAdapter.setNodeSourceCodeLocation(t,n)}if(this.Fn())this.$n(t);else{const e=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(null!=e?e:this.document,t)}}Un(t,e){const n=this.treeAdapter.createElement(t.tagName,e,t.attrs);this.Mn(n,t.location)}_n(t,e){const n=this.treeAdapter.createElement(t.tagName,e,t.attrs);this.Mn(n,t.location),this.openElements.push(n,t.tagID)}Bn(t,e){const n=this.treeAdapter.createElement(t,kc.HTML,[]);this.Mn(n,null),this.openElements.push(n,e)}qn(t){const e=this.treeAdapter.createElement(t.tagName,kc.HTML,t.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(e,n),this.Mn(e,t.location),this.openElements.push(e,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}An(){const t=this.treeAdapter.createElement(Dc.HTML,kc.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,Lc.HTML)}jn(t,e){const n=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(e,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,t.location)}Hn(t){let e,n;if(this.Fn()?(({parent:e,beforeElement:n}=this.zn()),n?this.treeAdapter.insertTextBefore(e,t.chars,n):this.treeAdapter.insertText(e,t.chars)):(e=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(e,t.chars)),!t.location)return;const r=this.treeAdapter.getChildNodes(e),i=n?r.lastIndexOf(n):r.length,s=r[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:e,endCol:n,endOffset:r}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:e,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}Pn(t,e){for(let n=this.treeAdapter.getFirstChild(t);n;n=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(e,n)}Ln(t,e){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&e.location){const n=e.location,r=this.treeAdapter.getTagName(t),i=e.type===sc.END_TAG&&r===e.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,i)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let e,n;return 0===this.openElements.stackTop&&this.fragmentContext?(e=this.fragmentContext,n=this.fragmentContextID):({current:e,currentTagId:n}=this.openElements),(t.tagID!==Lc.SVG||this.treeAdapter.getTagName(e)!==Dc.ANNOTATION_XML||this.treeAdapter.getNamespaceURI(e)!==kc.MATHML)&&(this.tokenizer.inForeignNode||(t.tagID===Lc.MGLYPH||t.tagID===Lc.MALIGNMARK)&&void 0!==n&&!this.Rn(n,e,kc.HTML))}Wn(t){switch(t.type){case sc.CHARACTER:this.onCharacter(t);break;case sc.NULL_CHARACTER:this.onNullCharacter(t);break;case sc.COMMENT:this.onComment(t);break;case sc.DOCTYPE:this.onDoctype(t);break;case sc.START_TAG:this.Gn(t);break;case sc.END_TAG:this.onEndTag(t);break;case sc.EOF:this.onEof(t);break;case sc.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(t)}}Rn(t,e,n){return function(t,e,n,r){return(!r||r===kc.HTML)&&function(t,e,n){if(e===kc.MATHML&&t===Lc.ANNOTATION_XML)for(let t=0;t<n.length;t++)if(n[t].name===Tc.ENCODING){const e=n[t].value.toLowerCase();return"text/html"===e||"application/xhtml+xml"===e}return e===kc.SVG&&(t===Lc.FOREIGN_OBJECT||t===Lc.DESC||t===Lc.TITLE)}(t,e,n)||(!r||r===kc.MATHML)&&function(t,e){return e===kc.MATHML&&(t===Lc.MI||t===Lc.MO||t===Lc.MN||t===Lc.MS||t===Lc.MTEXT)}(t,e)}(t,this.treeAdapter.getNamespaceURI(e),this.treeAdapter.getAttrList(e),n)}Vn(){const t=this.activeFormattingElements.entries.length;if(t){const e=this.activeFormattingElements.entries.findIndex(t=>t.type===Yc.Marker||this.openElements.contains(t.element));for(let n=-1===e?t-1:e-1;n>=0;n--){const t=this.activeFormattingElements.entries[n];this._n(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}Yn(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=bh.IN_ROW}Kn(){this.openElements.generateImpliedEndTagsWithExclusion(Lc.P),this.openElements.popUntilTagNamePopped(Lc.P)}Cn(){for(let t=this.openElements.stackTop;t>=0;t--)switch(0===t&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case Lc.TR:return void(this.insertionMode=bh.IN_ROW);case Lc.TBODY:case Lc.THEAD:case Lc.TFOOT:return void(this.insertionMode=bh.IN_TABLE_BODY);case Lc.CAPTION:return void(this.insertionMode=bh.IN_CAPTION);case Lc.COLGROUP:return void(this.insertionMode=bh.IN_COLUMN_GROUP);case Lc.TABLE:return void(this.insertionMode=bh.IN_TABLE);case Lc.BODY:return void(this.insertionMode=bh.IN_BODY);case Lc.FRAMESET:return void(this.insertionMode=bh.IN_FRAMESET);case Lc.SELECT:return void this.Xn(t);case Lc.TEMPLATE:return void(this.insertionMode=this.tmplInsertionModeStack[0]);case Lc.HTML:return void(this.insertionMode=this.headElement?bh.AFTER_HEAD:bh.BEFORE_HEAD);case Lc.TD:case Lc.TH:if(t>0)return void(this.insertionMode=bh.IN_CELL);break;case Lc.HEAD:if(t>0)return void(this.insertionMode=bh.IN_HEAD)}this.insertionMode=bh.IN_BODY}Xn(t){if(t>0)for(let e=t-1;e>0;e--){const t=this.openElements.tagIDs[e];if(t===Lc.TEMPLATE)break;if(t===Lc.TABLE)return void(this.insertionMode=bh.IN_SELECT_IN_TABLE)}this.insertionMode=bh.IN_SELECT}Zn(t){return Ph.has(t)}Fn(){return this.fosterParentingEnabled&&void 0!==this.openElements.currentTagId&&this.Zn(this.openElements.currentTagId)}zn(){for(let t=this.openElements.stackTop;t>=0;t--){const e=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case Lc.TEMPLATE:if(this.treeAdapter.getNamespaceURI(e)===kc.HTML)return{parent:this.treeAdapter.getTemplateContent(e),beforeElement:null};break;case Lc.TABLE:{const n=this.treeAdapter.getParentNode(e);return n?{parent:n,beforeElement:e}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}$n(t){const e=this.zn();e.beforeElement?this.treeAdapter.insertBefore(e.parent,t,e.beforeElement):this.treeAdapter.appendChild(e.parent,t)}Jn(t,e){const n=this.treeAdapter.getNamespaceURI(t);return Uc[n].has(e)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)!function(t,e){t.Hn(e),t.framesetOk=!1}(this,t);else switch(this.insertionMode){case bh.INITIAL:qh(this,t);break;case bh.BEFORE_HTML:jh(this,t);break;case bh.BEFORE_HEAD:Hh(this,t);break;case bh.IN_HEAD:Gh(this,t);break;case bh.IN_HEAD_NO_SCRIPT:Vh(this,t);break;case bh.AFTER_HEAD:Yh(this,t);break;case bh.IN_BODY:case bh.IN_CAPTION:case bh.IN_CELL:case bh.IN_TEMPLATE:Zh(this,t);break;case bh.TEXT:case bh.IN_SELECT:case bh.IN_SELECT_IN_TABLE:this.Hn(t);break;case bh.IN_TABLE:case bh.IN_TABLE_BODY:case bh.IN_ROW:au(this,t);break;case bh.IN_TABLE_TEXT:uu(this,t);break;case bh.IN_COLUMN_GROUP:gu(this,t);break;case bh.AFTER_BODY:Tu(this,t);break;case bh.AFTER_AFTER_BODY:xu(this,t)}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)!function(t,e){e.chars=Jl,t.Hn(e)}(this,t);else switch(this.insertionMode){case bh.INITIAL:qh(this,t);break;case bh.BEFORE_HTML:jh(this,t);break;case bh.BEFORE_HEAD:Hh(this,t);break;case bh.IN_HEAD:Gh(this,t);break;case bh.IN_HEAD_NO_SCRIPT:Vh(this,t);break;case bh.AFTER_HEAD:Yh(this,t);break;case bh.TEXT:this.Hn(t);break;case bh.IN_TABLE:case bh.IN_TABLE_BODY:case bh.IN_ROW:au(this,t);break;case bh.IN_COLUMN_GROUP:gu(this,t);break;case bh.AFTER_BODY:Tu(this,t);break;case bh.AFTER_AFTER_BODY:xu(this,t)}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML)Uh(this,t);else switch(this.insertionMode){case bh.INITIAL:case bh.BEFORE_HTML:case bh.BEFORE_HEAD:case bh.IN_HEAD:case bh.IN_HEAD_NO_SCRIPT:case bh.AFTER_HEAD:case bh.IN_BODY:case bh.IN_TABLE:case bh.IN_CAPTION:case bh.IN_COLUMN_GROUP:case bh.IN_TABLE_BODY:case bh.IN_ROW:case bh.IN_CELL:case bh.IN_SELECT:case bh.IN_SELECT_IN_TABLE:case bh.IN_TEMPLATE:case bh.IN_FRAMESET:case bh.AFTER_FRAMESET:Uh(this,t);break;case bh.IN_TABLE_TEXT:fu(this,t);break;case bh.AFTER_BODY:!function(t,e){t.jn(e,t.openElements.items[0])}(this,t);break;case bh.AFTER_AFTER_BODY:case bh.AFTER_AFTER_FRAMESET:!function(t,e){t.jn(e,t.document)}(this,t)}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case bh.INITIAL:!function(t,e){t.In(e);const n=e.forceQuirks?Ac.QUIRKS:function(t){if(t.name!==fh)return Ac.QUIRKS;const{systemId:e}=t;if(e&&"http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"===e.toLowerCase())return Ac.QUIRKS;let{publicId:n}=t;if(null!==n){if(n=n.toLowerCase(),gh.has(n))return Ac.QUIRKS;let t=null===e?ph:dh;if(yh(n,t))return Ac.QUIRKS;if(t=null===e?mh:wh,yh(n,t))return Ac.LIMITED_QUIRKS}return Ac.NO_QUIRKS}(e);(function(t){return t.name===fh&&null===t.publicId&&(null===t.systemId||"about:legacy-compat"===t.systemId)})(e)||t.Et(e,Ql.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=bh.BEFORE_HTML}(this,t);break;case bh.BEFORE_HEAD:case bh.IN_HEAD:case bh.IN_HEAD_NO_SCRIPT:case bh.AFTER_HEAD:this.Et(t,Ql.misplacedDoctype);break;case bh.IN_TABLE_TEXT:fu(this,t)}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.Gn(t),t.selfClosing&&!t.ackSelfClosing&&this.Et(t,Ql.nonVoidHtmlElementStartTagWithTrailingSolidus)}Gn(t){this.shouldProcessStartTagTokenInForeignContent(t)?function(t,e){if(function(t){const e=t.tagID;return e===Lc.FONT&&t.attrs.some(({name:t})=>t===Tc.COLOR||t===Tc.SIZE||t===Tc.FACE)||Th.has(e)}(e))Au(t),t.Qn(e);else{const n=t.On(),r=t.treeAdapter.getNamespaceURI(n);r===kc.MATHML?xh(e):r===kc.SVG&&(function(t){const e=Sh.get(t.tagName);null!=e&&(t.tagName=e,t.tagID=Ic(t.tagName))}(e),Ah(e)),Ch(e),e.selfClosing?t.Un(e,r):t._n(e,r),e.ackSelfClosing=!0}}(this,t):this.Qn(t)}Qn(t){switch(this.insertionMode){case bh.INITIAL:qh(this,t);break;case bh.BEFORE_HTML:!function(t,e){e.tagID===Lc.HTML?(t._n(e,kc.HTML),t.insertionMode=bh.BEFORE_HEAD):jh(t,e)}(this,t);break;case bh.BEFORE_HEAD:!function(t,e){switch(e.tagID){case Lc.HTML:nu(t,e);break;case Lc.HEAD:t._n(e,kc.HTML),t.headElement=t.openElements.current,t.insertionMode=bh.IN_HEAD;break;default:Hh(t,e)}}(this,t);break;case bh.IN_HEAD:zh(this,t);break;case bh.IN_HEAD_NO_SCRIPT:!function(t,e){switch(e.tagID){case Lc.HTML:nu(t,e);break;case Lc.BASEFONT:case Lc.BGSOUND:case Lc.HEAD:case Lc.LINK:case Lc.META:case Lc.NOFRAMES:case Lc.STYLE:zh(t,e);break;case Lc.NOSCRIPT:t.Et(e,Ql.nestedNoscriptInHead);break;default:Vh(t,e)}}(this,t);break;case bh.AFTER_HEAD:!function(t,e){switch(e.tagID){case Lc.HTML:nu(t,e);break;case Lc.BODY:t._n(e,kc.HTML),t.framesetOk=!1,t.insertionMode=bh.IN_BODY;break;case Lc.FRAMESET:t._n(e,kc.HTML),t.insertionMode=bh.IN_FRAMESET;break;case Lc.BASE:case Lc.BASEFONT:case Lc.BGSOUND:case Lc.LINK:case Lc.META:case Lc.NOFRAMES:case Lc.SCRIPT:case Lc.STYLE:case Lc.TEMPLATE:case Lc.TITLE:t.Et(e,Ql.abandonedHeadElementChild),t.openElements.push(t.headElement,Lc.HEAD),zh(t,e),t.openElements.remove(t.headElement);break;case Lc.HEAD:t.Et(e,Ql.misplacedStartTagForHeadElement);break;default:Yh(t,e)}}(this,t);break;case bh.IN_BODY:nu(this,t);break;case bh.IN_TABLE:ou(this,t);break;case bh.IN_TABLE_TEXT:fu(this,t);break;case bh.IN_CAPTION:!function(t,e){const n=e.tagID;du.has(n)?t.openElements.hasInTableScope(Lc.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(Lc.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=bh.IN_TABLE,ou(t,e)):nu(t,e)}(this,t);break;case bh.IN_COLUMN_GROUP:pu(this,t);break;case bh.IN_TABLE_BODY:mu(this,t);break;case bh.IN_ROW:yu(this,t);break;case bh.IN_CELL:!function(t,e){const n=e.tagID;du.has(n)?(t.openElements.hasInTableScope(Lc.TD)||t.openElements.hasInTableScope(Lc.TH))&&(t.Yn(),yu(t,e)):nu(t,e)}(this,t);break;case bh.IN_SELECT:vu(this,t);break;case bh.IN_SELECT_IN_TABLE:!function(t,e){const n=e.tagID;n===Lc.CAPTION||n===Lc.TABLE||n===Lc.TBODY||n===Lc.TFOOT||n===Lc.THEAD||n===Lc.TR||n===Lc.TD||n===Lc.TH?(t.openElements.popUntilTagNamePopped(Lc.SELECT),t.Cn(),t.Gn(e)):vu(t,e)}(this,t);break;case bh.IN_TEMPLATE:!function(t,e){switch(e.tagID){case Lc.BASE:case Lc.BASEFONT:case Lc.BGSOUND:case Lc.LINK:case Lc.META:case Lc.NOFRAMES:case Lc.SCRIPT:case Lc.STYLE:case Lc.TEMPLATE:case Lc.TITLE:zh(t,e);break;case Lc.CAPTION:case Lc.COLGROUP:case Lc.TBODY:case Lc.TFOOT:case Lc.THEAD:t.tmplInsertionModeStack[0]=bh.IN_TABLE,t.insertionMode=bh.IN_TABLE,ou(t,e);break;case Lc.COL:t.tmplInsertionModeStack[0]=bh.IN_COLUMN_GROUP,t.insertionMode=bh.IN_COLUMN_GROUP,pu(t,e);break;case Lc.TR:t.tmplInsertionModeStack[0]=bh.IN_TABLE_BODY,t.insertionMode=bh.IN_TABLE_BODY,mu(t,e);break;case Lc.TD:case Lc.TH:t.tmplInsertionModeStack[0]=bh.IN_ROW,t.insertionMode=bh.IN_ROW,yu(t,e);break;default:t.tmplInsertionModeStack[0]=bh.IN_BODY,t.insertionMode=bh.IN_BODY,nu(t,e)}}(this,t);break;case bh.AFTER_BODY:!function(t,e){e.tagID===Lc.HTML?nu(t,e):Tu(t,e)}(this,t);break;case bh.IN_FRAMESET:!function(t,e){switch(e.tagID){case Lc.HTML:nu(t,e);break;case Lc.FRAMESET:t._n(e,kc.HTML);break;case Lc.FRAME:t.Un(e,kc.HTML),e.ackSelfClosing=!0;break;case Lc.NOFRAMES:zh(t,e)}}(this,t);break;case bh.AFTER_FRAMESET:!function(t,e){switch(e.tagID){case Lc.HTML:nu(t,e);break;case Lc.NOFRAMES:zh(t,e)}}(this,t);break;case bh.AFTER_AFTER_BODY:!function(t,e){e.tagID===Lc.HTML?nu(t,e):xu(t,e)}(this,t);break;case bh.AFTER_AFTER_FRAMESET:!function(t,e){switch(e.tagID){case Lc.HTML:nu(t,e);break;case Lc.NOFRAMES:zh(t,e)}}(this,t)}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?function(t,e){if(e.tagID===Lc.P||e.tagID===Lc.BR)return Au(t),void t.er(e);for(let n=t.openElements.stackTop;n>0;n--){const r=t.openElements.items[n];if(t.treeAdapter.getNamespaceURI(r)===kc.HTML){t.er(e);break}const i=t.treeAdapter.getTagName(r);if(i.toLowerCase()===e.tagName){e.tagName=i,t.openElements.shortenToLength(n);break}}}(this,t):this.er(t)}er(t){switch(this.insertionMode){case bh.INITIAL:qh(this,t);break;case bh.BEFORE_HTML:!function(t,e){const n=e.tagID;n!==Lc.HTML&&n!==Lc.HEAD&&n!==Lc.BODY&&n!==Lc.BR||jh(t,e)}(this,t);break;case bh.BEFORE_HEAD:!function(t,e){const n=e.tagID;n===Lc.HEAD||n===Lc.BODY||n===Lc.HTML||n===Lc.BR?Hh(t,e):t.Et(e,Ql.endTagWithoutMatchingOpenElement)}(this,t);break;case bh.IN_HEAD:!function(t,e){switch(e.tagID){case Lc.HEAD:t.openElements.pop(),t.insertionMode=bh.AFTER_HEAD;break;case Lc.BODY:case Lc.BR:case Lc.HTML:Gh(t,e);break;case Lc.TEMPLATE:Wh(t,e);break;default:t.Et(e,Ql.endTagWithoutMatchingOpenElement)}}(this,t);break;case bh.IN_HEAD_NO_SCRIPT:!function(t,e){switch(e.tagID){case Lc.NOSCRIPT:t.openElements.pop(),t.insertionMode=bh.IN_HEAD;break;case Lc.BR:Vh(t,e);break;default:t.Et(e,Ql.endTagWithoutMatchingOpenElement)}}(this,t);break;case bh.AFTER_HEAD:!function(t,e){switch(e.tagID){case Lc.BODY:case Lc.HTML:case Lc.BR:Yh(t,e);break;case Lc.TEMPLATE:Wh(t,e);break;default:t.Et(e,Ql.endTagWithoutMatchingOpenElement)}}(this,t);break;case bh.IN_BODY:iu(this,t);break;case bh.TEXT:!function(t,e){var n;e.tagID===Lc.SCRIPT&&(null===(n=t.scriptHandler)||void 0===n||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}(this,t);break;case bh.IN_TABLE:lu(this,t);break;case bh.IN_TABLE_TEXT:fu(this,t);break;case bh.IN_CAPTION:!function(t,e){const n=e.tagID;switch(n){case Lc.CAPTION:case Lc.TABLE:t.openElements.hasInTableScope(Lc.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(Lc.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=bh.IN_TABLE,n===Lc.TABLE&&lu(t,e));break;case Lc.BODY:case Lc.COL:case Lc.COLGROUP:case Lc.HTML:case Lc.TBODY:case Lc.TD:case Lc.TFOOT:case Lc.TH:case Lc.THEAD:case Lc.TR:break;default:iu(t,e)}}(this,t);break;case bh.IN_COLUMN_GROUP:!function(t,e){switch(e.tagID){case Lc.COLGROUP:t.openElements.currentTagId===Lc.COLGROUP&&(t.openElements.pop(),t.insertionMode=bh.IN_TABLE);break;case Lc.TEMPLATE:Wh(t,e);break;case Lc.COL:break;default:gu(t,e)}}(this,t);break;case bh.IN_TABLE_BODY:wu(this,t);break;case bh.IN_ROW:bu(this,t);break;case bh.IN_CELL:!function(t,e){const n=e.tagID;switch(n){case Lc.TD:case Lc.TH:t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=bh.IN_ROW);break;case Lc.TABLE:case Lc.TBODY:case Lc.TFOOT:case Lc.THEAD:case Lc.TR:t.openElements.hasInTableScope(n)&&(t.Yn(),bu(t,e));break;case Lc.BODY:case Lc.CAPTION:case Lc.COL:case Lc.COLGROUP:case Lc.HTML:break;default:iu(t,e)}}(this,t);break;case bh.IN_SELECT:Eu(this,t);break;case bh.IN_SELECT_IN_TABLE:!function(t,e){const n=e.tagID;n===Lc.CAPTION||n===Lc.TABLE||n===Lc.TBODY||n===Lc.TFOOT||n===Lc.THEAD||n===Lc.TR||n===Lc.TD||n===Lc.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(Lc.SELECT),t.Cn(),t.onEndTag(e)):Eu(t,e)}(this,t);break;case bh.IN_TEMPLATE:!function(t,e){e.tagID===Lc.TEMPLATE&&Wh(t,e)}(this,t);break;case bh.AFTER_BODY:Su(this,t);break;case bh.IN_FRAMESET:!function(t,e){e.tagID!==Lc.FRAMESET||t.openElements.isRootHtmlElementCurrent()||(t.openElements.pop(),t.fragmentContext||t.openElements.currentTagId===Lc.FRAMESET||(t.insertionMode=bh.AFTER_FRAMESET))}(this,t);break;case bh.AFTER_FRAMESET:!function(t,e){e.tagID===Lc.HTML&&(t.insertionMode=bh.AFTER_AFTER_FRAMESET)}(this,t);break;case bh.AFTER_AFTER_BODY:xu(this,t)}}onEof(t){switch(this.insertionMode){case bh.INITIAL:qh(this,t);break;case bh.BEFORE_HTML:jh(this,t);break;case bh.BEFORE_HEAD:Hh(this,t);break;case bh.IN_HEAD:Gh(this,t);break;case bh.IN_HEAD_NO_SCRIPT:Vh(this,t);break;case bh.AFTER_HEAD:Yh(this,t);break;case bh.IN_BODY:case bh.IN_TABLE:case bh.IN_CAPTION:case bh.IN_COLUMN_GROUP:case bh.IN_TABLE_BODY:case bh.IN_ROW:case bh.IN_CELL:case bh.IN_SELECT:case bh.IN_SELECT_IN_TABLE:su(this,t);break;case bh.TEXT:!function(t,e){t.Et(e,Ql.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}(this,t);break;case bh.IN_TABLE_TEXT:fu(this,t);break;case bh.IN_TEMPLATE:ku(this,t);break;case bh.AFTER_BODY:case bh.IN_FRAMESET:case bh.AFTER_FRAMESET:case bh.AFTER_AFTER_BODY:case bh.AFTER_AFTER_FRAMESET:Bh(this,t)}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===Kl.LINE_FEED)){if(1===t.chars.length)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode)this.Hn(t);else switch(this.insertionMode){case bh.IN_HEAD:case bh.IN_HEAD_NO_SCRIPT:case bh.AFTER_HEAD:case bh.TEXT:case bh.IN_COLUMN_GROUP:case bh.IN_SELECT:case bh.IN_SELECT_IN_TABLE:case bh.IN_FRAMESET:case bh.AFTER_FRAMESET:this.Hn(t);break;case bh.IN_BODY:case bh.IN_CAPTION:case bh.IN_CELL:case bh.IN_TEMPLATE:case bh.AFTER_BODY:case bh.AFTER_AFTER_BODY:case bh.AFTER_AFTER_FRAMESET:Xh(this,t);break;case bh.IN_TABLE:case bh.IN_TABLE_BODY:case bh.IN_ROW:au(this,t);break;case bh.IN_TABLE_TEXT:hu(this,t)}}};function Nh(t,e){let n=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return n?t.openElements.contains(n.element)?t.openElements.hasInScope(e.tagID)||(n=null):(t.activeFormattingElements.removeEntry(n),n=null):ru(t,e),n}function _h(t,e){let n=null,r=t.openElements.stackTop;for(;r>=0;r--){const i=t.openElements.items[r];if(i===e.element)break;t.Jn(i,t.openElements.tagIDs[r])&&(n=i)}return n||(t.openElements.shortenToLength(Math.max(r,0)),t.activeFormattingElements.removeEntry(e)),n}function Oh(t,e,n){let r=e,i=t.openElements.getCommonAncestor(e);for(let s=0,a=i;a!==n;s++,a=i){i=t.openElements.getCommonAncestor(a);const n=t.activeFormattingElements.getElementEntry(a),o=n&&s>=3;!n||o?(o&&t.activeFormattingElements.removeEntry(n),t.openElements.remove(a)):(a=Ih(t,n),r===e&&(t.activeFormattingElements.bookmark=n),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(a,r),r=a)}return r}function Ih(t,e){const n=t.treeAdapter.getNamespaceURI(e.element),r=t.treeAdapter.createElement(e.token.tagName,n,e.token.attrs);return t.openElements.replace(e.element,r),e.element=r,r}function Mh(t,e,n){const r=Ic(t.treeAdapter.getTagName(e));if(t.Zn(r))t.$n(n);else{const i=t.treeAdapter.getNamespaceURI(e);r===Lc.TEMPLATE&&i===kc.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function Fh(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=t.treeAdapter.createElement(i.tagName,r,i.attrs);t.Pn(e,s),t.treeAdapter.appendChild(e,s),t.activeFormattingElements.insertElementAfterBookmark(s,i),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,s,i.tagID)}function $h(t,e){for(let n=0;n<8;n++){const n=Nh(t,e);if(!n)break;const r=_h(t,n);if(!r)break;t.activeFormattingElements.bookmark=n;const i=Oh(t,r,n.element),s=t.openElements.getCommonAncestor(n.element);t.treeAdapter.detachNode(i),s&&Mh(t,s,i),Fh(t,r,n)}}function Uh(t,e){t.jn(e,t.openElements.currentTmplContentOrNode)}function Bh(t,e){if(t.stopped=!0,e.location){const n=t.fragmentContext?0:2;for(let r=t.openElements.stackTop;r>=n;r--)t.Ln(t.openElements.items[r],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const n=t.openElements.items[0],r=t.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(t.Ln(n,e),t.openElements.stackTop>=1)){const n=t.openElements.items[1],r=t.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&t.Ln(n,e)}}}}function qh(t,e){t.Et(e,Ql.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,Ac.QUIRKS),t.insertionMode=bh.BEFORE_HTML,t.Wn(e)}function jh(t,e){t.An(),t.insertionMode=bh.BEFORE_HEAD,t.Wn(e)}function Hh(t,e){t.Bn(Dc.HEAD,Lc.HEAD),t.headElement=t.openElements.current,t.insertionMode=bh.IN_HEAD,t.Wn(e)}function zh(t,e){switch(e.tagID){case Lc.HTML:nu(t,e);break;case Lc.BASE:case Lc.BASEFONT:case Lc.BGSOUND:case Lc.LINK:case Lc.META:t.Un(e,kc.HTML),e.ackSelfClosing=!0;break;case Lc.TITLE:t.Nn(e,qc.RCDATA);break;case Lc.NOSCRIPT:t.options.scriptingEnabled?t.Nn(e,qc.RAWTEXT):(t._n(e,kc.HTML),t.insertionMode=bh.IN_HEAD_NO_SCRIPT);break;case Lc.NOFRAMES:case Lc.STYLE:t.Nn(e,qc.RAWTEXT);break;case Lc.SCRIPT:t.Nn(e,qc.SCRIPT_DATA);break;case Lc.TEMPLATE:t.qn(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=bh.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(bh.IN_TEMPLATE);break;case Lc.HEAD:t.Et(e,Ql.misplacedStartTagForHeadElement);break;default:Gh(t,e)}}function Wh(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==Lc.TEMPLATE&&t.Et(e,Ql.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(Lc.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t.Cn()):t.Et(e,Ql.endTagWithoutMatchingOpenElement)}function Gh(t,e){t.openElements.pop(),t.insertionMode=bh.AFTER_HEAD,t.Wn(e)}function Vh(t,e){const n=e.type===sc.EOF?Ql.openElementsLeftAfterEof:Ql.disallowedContentInNoscriptInHead;t.Et(e,n),t.openElements.pop(),t.insertionMode=bh.IN_HEAD,t.Wn(e)}function Yh(t,e){t.Bn(Dc.BODY,Lc.BODY),t.insertionMode=bh.IN_BODY,Kh(t,e)}function Kh(t,e){switch(e.type){case sc.CHARACTER:Zh(t,e);break;case sc.WHITESPACE_CHARACTER:Xh(t,e);break;case sc.COMMENT:Uh(t,e);break;case sc.START_TAG:nu(t,e);break;case sc.END_TAG:iu(t,e);break;case sc.EOF:su(t,e)}}function Xh(t,e){t.Vn(),t.Hn(e)}function Zh(t,e){t.Vn(),t.Hn(e),t.framesetOk=!1}function Jh(t,e){t.Vn(),t.Un(e,kc.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function Qh(t){const e=lc(t,Tc.TYPE);return null!=e&&"hidden"===e.toLowerCase()}function tu(t,e){t.Nn(e,qc.RAWTEXT)}function eu(t,e){t.Vn(),t._n(e,kc.HTML)}function nu(t,e){switch(e.tagID){case Lc.I:case Lc.S:case Lc.B:case Lc.U:case Lc.EM:case Lc.TT:case Lc.BIG:case Lc.CODE:case Lc.FONT:case Lc.SMALL:case Lc.STRIKE:case Lc.STRONG:!function(t,e){t.Vn(),t._n(e,kc.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}(t,e);break;case Lc.A:!function(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(Dc.A);n&&($h(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t.Vn(),t._n(e,kc.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}(t,e);break;case Lc.H1:case Lc.H2:case Lc.H3:case Lc.H4:case Lc.H5:case Lc.H6:!function(t,e){t.openElements.hasInButtonScope(Lc.P)&&t.Kn(),void 0!==t.openElements.currentTagId&&Bc.has(t.openElements.currentTagId)&&t.openElements.pop(),t._n(e,kc.HTML)}(t,e);break;case Lc.P:case Lc.DL:case Lc.OL:case Lc.UL:case Lc.DIV:case Lc.DIR:case Lc.NAV:case Lc.MAIN:case Lc.MENU:case Lc.ASIDE:case Lc.CENTER:case Lc.FIGURE:case Lc.FOOTER:case Lc.HEADER:case Lc.HGROUP:case Lc.DIALOG:case Lc.DETAILS:case Lc.ADDRESS:case Lc.ARTICLE:case Lc.SEARCH:case Lc.SECTION:case Lc.SUMMARY:case Lc.FIELDSET:case Lc.BLOCKQUOTE:case Lc.FIGCAPTION:!function(t,e){t.openElements.hasInButtonScope(Lc.P)&&t.Kn(),t._n(e,kc.HTML)}(t,e);break;case Lc.LI:case Lc.DD:case Lc.DT:!function(t,e){t.framesetOk=!1;const n=e.tagID;for(let e=t.openElements.stackTop;e>=0;e--){const r=t.openElements.tagIDs[e];if(n===Lc.LI&&r===Lc.LI||(n===Lc.DD||n===Lc.DT)&&(r===Lc.DD||r===Lc.DT)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.popUntilTagNamePopped(r);break}if(r!==Lc.ADDRESS&&r!==Lc.DIV&&r!==Lc.P&&t.Jn(t.openElements.items[e],r))break}t.openElements.hasInButtonScope(Lc.P)&&t.Kn(),t._n(e,kc.HTML)}(t,e);break;case Lc.BR:case Lc.IMG:case Lc.WBR:case Lc.AREA:case Lc.EMBED:case Lc.KEYGEN:Jh(t,e);break;case Lc.HR:!function(t,e){t.openElements.hasInButtonScope(Lc.P)&&t.Kn(),t.Un(e,kc.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}(t,e);break;case Lc.RB:case Lc.RTC:!function(t,e){t.openElements.hasInScope(Lc.RUBY)&&t.openElements.generateImpliedEndTags(),t._n(e,kc.HTML)}(t,e);break;case Lc.RT:case Lc.RP:!function(t,e){t.openElements.hasInScope(Lc.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(Lc.RTC),t._n(e,kc.HTML)}(t,e);break;case Lc.PRE:case Lc.LISTING:!function(t,e){t.openElements.hasInButtonScope(Lc.P)&&t.Kn(),t._n(e,kc.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}(t,e);break;case Lc.XMP:!function(t,e){t.openElements.hasInButtonScope(Lc.P)&&t.Kn(),t.Vn(),t.framesetOk=!1,t.Nn(e,qc.RAWTEXT)}(t,e);break;case Lc.SVG:!function(t,e){t.Vn(),Ah(e),Ch(e),e.selfClosing?t.Un(e,kc.SVG):t._n(e,kc.SVG),e.ackSelfClosing=!0}(t,e);break;case Lc.HTML:!function(t,e){0===t.openElements.tmplCount&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}(t,e);break;case Lc.BASE:case Lc.LINK:case Lc.META:case Lc.STYLE:case Lc.TITLE:case Lc.SCRIPT:case Lc.BGSOUND:case Lc.BASEFONT:case Lc.TEMPLATE:zh(t,e);break;case Lc.BODY:!function(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&0===t.openElements.tmplCount&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}(t,e);break;case Lc.FORM:!function(t,e){const n=t.openElements.tmplCount>0;t.formElement&&!n||(t.openElements.hasInButtonScope(Lc.P)&&t.Kn(),t._n(e,kc.HTML),n||(t.formElement=t.openElements.current))}(t,e);break;case Lc.NOBR:!function(t,e){t.Vn(),t.openElements.hasInScope(Lc.NOBR)&&($h(t,e),t.Vn()),t._n(e,kc.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}(t,e);break;case Lc.MATH:!function(t,e){t.Vn(),xh(e),Ch(e),e.selfClosing?t.Un(e,kc.MATHML):t._n(e,kc.MATHML),e.ackSelfClosing=!0}(t,e);break;case Lc.TABLE:!function(t,e){t.treeAdapter.getDocumentMode(t.document)!==Ac.QUIRKS&&t.openElements.hasInButtonScope(Lc.P)&&t.Kn(),t._n(e,kc.HTML),t.framesetOk=!1,t.insertionMode=bh.IN_TABLE}(t,e);break;case Lc.INPUT:!function(t,e){t.Vn(),t.Un(e,kc.HTML),Qh(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}(t,e);break;case Lc.PARAM:case Lc.TRACK:case Lc.SOURCE:!function(t,e){t.Un(e,kc.HTML),e.ackSelfClosing=!0}(t,e);break;case Lc.IMAGE:!function(t,e){e.tagName=Dc.IMG,e.tagID=Lc.IMG,Jh(t,e)}(t,e);break;case Lc.BUTTON:!function(t,e){t.openElements.hasInScope(Lc.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(Lc.BUTTON)),t.Vn(),t._n(e,kc.HTML),t.framesetOk=!1}(t,e);break;case Lc.APPLET:case Lc.OBJECT:case Lc.MARQUEE:!function(t,e){t.Vn(),t._n(e,kc.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}(t,e);break;case Lc.IFRAME:!function(t,e){t.framesetOk=!1,t.Nn(e,qc.RAWTEXT)}(t,e);break;case Lc.SELECT:!function(t,e){t.Vn(),t._n(e,kc.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===bh.IN_TABLE||t.insertionMode===bh.IN_CAPTION||t.insertionMode===bh.IN_TABLE_BODY||t.insertionMode===bh.IN_ROW||t.insertionMode===bh.IN_CELL?bh.IN_SELECT_IN_TABLE:bh.IN_SELECT}(t,e);break;case Lc.OPTION:case Lc.OPTGROUP:!function(t,e){t.openElements.currentTagId===Lc.OPTION&&t.openElements.pop(),t.Vn(),t._n(e,kc.HTML)}(t,e);break;case Lc.NOEMBED:case Lc.NOFRAMES:tu(t,e);break;case Lc.FRAMESET:!function(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._n(e,kc.HTML),t.insertionMode=bh.IN_FRAMESET)}(t,e);break;case Lc.TEXTAREA:!function(t,e){t._n(e,kc.HTML),t.skipNextNewLine=!0,t.tokenizer.state=qc.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=bh.TEXT}(t,e);break;case Lc.NOSCRIPT:t.options.scriptingEnabled?tu(t,e):eu(t,e);break;case Lc.PLAINTEXT:!function(t,e){t.openElements.hasInButtonScope(Lc.P)&&t.Kn(),t._n(e,kc.HTML),t.tokenizer.state=qc.PLAINTEXT}(t,e);break;case Lc.COL:case Lc.TH:case Lc.TD:case Lc.TR:case Lc.HEAD:case Lc.FRAME:case Lc.TBODY:case Lc.TFOOT:case Lc.THEAD:case Lc.CAPTION:case Lc.COLGROUP:break;default:eu(t,e)}}function ru(t,e){const n=e.tagName,r=e.tagID;for(let e=t.openElements.stackTop;e>0;e--){const i=t.openElements.items[e],s=t.openElements.tagIDs[e];if(r===s&&(r!==Lc.UNKNOWN||t.treeAdapter.getTagName(i)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=e&&t.openElements.shortenToLength(e);break}if(t.Jn(i,s))break}}function iu(t,e){switch(e.tagID){case Lc.A:case Lc.B:case Lc.I:case Lc.S:case Lc.U:case Lc.EM:case Lc.TT:case Lc.BIG:case Lc.CODE:case Lc.FONT:case Lc.NOBR:case Lc.SMALL:case Lc.STRIKE:case Lc.STRONG:$h(t,e);break;case Lc.P:!function(t){t.openElements.hasInButtonScope(Lc.P)||t.Bn(Dc.P,Lc.P),t.Kn()}(t);break;case Lc.DL:case Lc.UL:case Lc.OL:case Lc.DIR:case Lc.DIV:case Lc.NAV:case Lc.PRE:case Lc.MAIN:case Lc.MENU:case Lc.ASIDE:case Lc.BUTTON:case Lc.CENTER:case Lc.FIGURE:case Lc.FOOTER:case Lc.HEADER:case Lc.HGROUP:case Lc.DIALOG:case Lc.ADDRESS:case Lc.ARTICLE:case Lc.DETAILS:case Lc.SEARCH:case Lc.SECTION:case Lc.SUMMARY:case Lc.LISTING:case Lc.FIELDSET:case Lc.BLOCKQUOTE:case Lc.FIGCAPTION:!function(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}(t,e);break;case Lc.LI:!function(t){t.openElements.hasInListItemScope(Lc.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(Lc.LI),t.openElements.popUntilTagNamePopped(Lc.LI))}(t);break;case Lc.DD:case Lc.DT:!function(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}(t,e);break;case Lc.H1:case Lc.H2:case Lc.H3:case Lc.H4:case Lc.H5:case Lc.H6:!function(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}(t);break;case Lc.BR:!function(t){t.Vn(),t.Bn(Dc.BR,Lc.BR),t.openElements.pop(),t.framesetOk=!1}(t);break;case Lc.BODY:!function(t,e){if(t.openElements.hasInScope(Lc.BODY)&&(t.insertionMode=bh.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.Ln(n,e)}}(t,e);break;case Lc.HTML:!function(t,e){t.openElements.hasInScope(Lc.BODY)&&(t.insertionMode=bh.AFTER_BODY,Su(t,e))}(t,e);break;case Lc.FORM:!function(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(Lc.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(Lc.FORM):n&&t.openElements.remove(n))}(t);break;case Lc.APPLET:case Lc.OBJECT:case Lc.MARQUEE:!function(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}(t,e);break;case Lc.TEMPLATE:Wh(t,e);break;default:ru(t,e)}}function su(t,e){t.tmplInsertionModeStack.length>0?ku(t,e):Bh(t,e)}function au(t,e){if(void 0!==t.openElements.currentTagId&&Ph.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=bh.IN_TABLE_TEXT,e.type){case sc.CHARACTER:uu(t,e);break;case sc.WHITESPACE_CHARACTER:hu(t,e)}else cu(t,e)}function ou(t,e){switch(e.tagID){case Lc.TD:case Lc.TH:case Lc.TR:!function(t,e){t.openElements.clearBackToTableContext(),t.Bn(Dc.TBODY,Lc.TBODY),t.insertionMode=bh.IN_TABLE_BODY,mu(t,e)}(t,e);break;case Lc.STYLE:case Lc.SCRIPT:case Lc.TEMPLATE:zh(t,e);break;case Lc.COL:!function(t,e){t.openElements.clearBackToTableContext(),t.Bn(Dc.COLGROUP,Lc.COLGROUP),t.insertionMode=bh.IN_COLUMN_GROUP,pu(t,e)}(t,e);break;case Lc.FORM:!function(t,e){t.formElement||0!==t.openElements.tmplCount||(t._n(e,kc.HTML),t.formElement=t.openElements.current,t.openElements.pop())}(t,e);break;case Lc.TABLE:!function(t,e){t.openElements.hasInTableScope(Lc.TABLE)&&(t.openElements.popUntilTagNamePopped(Lc.TABLE),t.Cn(),t.Gn(e))}(t,e);break;case Lc.TBODY:case Lc.TFOOT:case Lc.THEAD:!function(t,e){t.openElements.clearBackToTableContext(),t._n(e,kc.HTML),t.insertionMode=bh.IN_TABLE_BODY}(t,e);break;case Lc.INPUT:!function(t,e){Qh(e)?t.Un(e,kc.HTML):cu(t,e),e.ackSelfClosing=!0}(t,e);break;case Lc.CAPTION:!function(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._n(e,kc.HTML),t.insertionMode=bh.IN_CAPTION}(t,e);break;case Lc.COLGROUP:!function(t,e){t.openElements.clearBackToTableContext(),t._n(e,kc.HTML),t.insertionMode=bh.IN_COLUMN_GROUP}(t,e);break;default:cu(t,e)}}function lu(t,e){switch(e.tagID){case Lc.TABLE:t.openElements.hasInTableScope(Lc.TABLE)&&(t.openElements.popUntilTagNamePopped(Lc.TABLE),t.Cn());break;case Lc.TEMPLATE:Wh(t,e);break;case Lc.BODY:case Lc.CAPTION:case Lc.COL:case Lc.COLGROUP:case Lc.HTML:case Lc.TBODY:case Lc.TD:case Lc.TFOOT:case Lc.TH:case Lc.THEAD:case Lc.TR:break;default:cu(t,e)}}function cu(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,Kh(t,e),t.fosterParentingEnabled=n}function hu(t,e){t.pendingCharacterTokens.push(e)}function uu(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function fu(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)cu(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t.Hn(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t.Wn(e)}var du=new Set([Lc.CAPTION,Lc.COL,Lc.COLGROUP,Lc.TBODY,Lc.TD,Lc.TFOOT,Lc.TH,Lc.THEAD,Lc.TR]);function pu(t,e){switch(e.tagID){case Lc.HTML:nu(t,e);break;case Lc.COL:t.Un(e,kc.HTML),e.ackSelfClosing=!0;break;case Lc.TEMPLATE:zh(t,e);break;default:gu(t,e)}}function gu(t,e){t.openElements.currentTagId===Lc.COLGROUP&&(t.openElements.pop(),t.insertionMode=bh.IN_TABLE,t.Wn(e))}function mu(t,e){switch(e.tagID){case Lc.TR:t.openElements.clearBackToTableBodyContext(),t._n(e,kc.HTML),t.insertionMode=bh.IN_ROW;break;case Lc.TH:case Lc.TD:t.openElements.clearBackToTableBodyContext(),t.Bn(Dc.TR,Lc.TR),t.insertionMode=bh.IN_ROW,yu(t,e);break;case Lc.CAPTION:case Lc.COL:case Lc.COLGROUP:case Lc.TBODY:case Lc.TFOOT:case Lc.THEAD:t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=bh.IN_TABLE,ou(t,e));break;default:ou(t,e)}}function wu(t,e){const n=e.tagID;switch(e.tagID){case Lc.TBODY:case Lc.TFOOT:case Lc.THEAD:t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=bh.IN_TABLE);break;case Lc.TABLE:t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=bh.IN_TABLE,lu(t,e));break;case Lc.BODY:case Lc.CAPTION:case Lc.COL:case Lc.COLGROUP:case Lc.HTML:case Lc.TD:case Lc.TH:case Lc.TR:break;default:lu(t,e)}}function yu(t,e){switch(e.tagID){case Lc.TH:case Lc.TD:t.openElements.clearBackToTableRowContext(),t._n(e,kc.HTML),t.insertionMode=bh.IN_CELL,t.activeFormattingElements.insertMarker();break;case Lc.CAPTION:case Lc.COL:case Lc.COLGROUP:case Lc.TBODY:case Lc.TFOOT:case Lc.THEAD:case Lc.TR:t.openElements.hasInTableScope(Lc.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=bh.IN_TABLE_BODY,mu(t,e));break;default:ou(t,e)}}function bu(t,e){switch(e.tagID){case Lc.TR:t.openElements.hasInTableScope(Lc.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=bh.IN_TABLE_BODY);break;case Lc.TABLE:t.openElements.hasInTableScope(Lc.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=bh.IN_TABLE_BODY,wu(t,e));break;case Lc.TBODY:case Lc.TFOOT:case Lc.THEAD:(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(Lc.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=bh.IN_TABLE_BODY,wu(t,e));break;case Lc.BODY:case Lc.CAPTION:case Lc.COL:case Lc.COLGROUP:case Lc.HTML:case Lc.TD:case Lc.TH:break;default:lu(t,e)}}function vu(t,e){switch(e.tagID){case Lc.HTML:nu(t,e);break;case Lc.OPTION:t.openElements.currentTagId===Lc.OPTION&&t.openElements.pop(),t._n(e,kc.HTML);break;case Lc.OPTGROUP:t.openElements.currentTagId===Lc.OPTION&&t.openElements.pop(),t.openElements.currentTagId===Lc.OPTGROUP&&t.openElements.pop(),t._n(e,kc.HTML);break;case Lc.HR:t.openElements.currentTagId===Lc.OPTION&&t.openElements.pop(),t.openElements.currentTagId===Lc.OPTGROUP&&t.openElements.pop(),t.Un(e,kc.HTML),e.ackSelfClosing=!0;break;case Lc.INPUT:case Lc.KEYGEN:case Lc.TEXTAREA:case Lc.SELECT:t.openElements.hasInSelectScope(Lc.SELECT)&&(t.openElements.popUntilTagNamePopped(Lc.SELECT),t.Cn(),e.tagID!==Lc.SELECT&&t.Gn(e));break;case Lc.SCRIPT:case Lc.TEMPLATE:zh(t,e)}}function Eu(t,e){switch(e.tagID){case Lc.OPTGROUP:t.openElements.stackTop>0&&t.openElements.currentTagId===Lc.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===Lc.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===Lc.OPTGROUP&&t.openElements.pop();break;case Lc.OPTION:t.openElements.currentTagId===Lc.OPTION&&t.openElements.pop();break;case Lc.SELECT:t.openElements.hasInSelectScope(Lc.SELECT)&&(t.openElements.popUntilTagNamePopped(Lc.SELECT),t.Cn());break;case Lc.TEMPLATE:Wh(t,e)}}function ku(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(Lc.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t.Cn(),t.onEof(e)):Bh(t,e)}function Su(t,e){var n;if(e.tagID===Lc.HTML){if(t.fragmentContext||(t.insertionMode=bh.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===Lc.HTML){t.Ln(t.openElements.items[0],e);const r=t.openElements.items[1];r&&!(null===(n=t.treeAdapter.getNodeSourceCodeLocation(r))||void 0===n?void 0:n.endTag)&&t.Ln(r,e)}}else Tu(t,e)}function Tu(t,e){t.insertionMode=bh.IN_BODY,Kh(t,e)}function xu(t,e){t.insertionMode=bh.IN_BODY,Kh(t,e)}function Au(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==kc.HTML&&void 0!==t.openElements.currentTagId&&!t.Rn(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function Cu(t,e){return Rh.parse(t,e)}function Du(t,e,n){"string"==typeof t&&(n=e,e=t,t=null);const r=Rh.getFragmentParser(t,n);return r.tokenizer.write(e,!0),r.getFragment()}String.prototype.codePointAt,Dc.AREA,Dc.BASE,Dc.BASEFONT,Dc.BGSOUND,Dc.BR,Dc.COL,Dc.EMBED,Dc.FRAME,Dc.HR,Dc.IMG,Dc.INPUT,Dc.KEYGEN,Dc.LINK,Dc.META,Dc.PARAM,Dc.SOURCE,Dc.TRACK,Dc.WBR;var Pu={abandonedHeadElementChild:{reason:"Unexpected metadata element after head",description:"Unexpected element after head. Expected the element before `</head>`",url:!1},abruptClosingOfEmptyComment:{reason:"Unexpected abruptly closed empty comment",description:"Unexpected `>` or `->`. Expected `--\x3e` to close comments"},abruptDoctypePublicIdentifier:{reason:"Unexpected abruptly closed public identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:"Unexpected abruptly closed system identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:"Unexpected non-digit at start of numeric character reference",description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:"Unexpected CDATA section in HTML",description:"Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead"},characterReferenceOutsideUnicodeRange:{reason:"Unexpected too big numeric character reference",description:"Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)"},closingOfElementWithOpenChildElements:{reason:"Unexpected closing tag with open child elements",description:"Unexpectedly closing tag. Expected other tags to be closed first",url:!1},controlCharacterInInputStream:{reason:"Unexpected control character",description:"Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace"},controlCharacterReference:{reason:"Unexpected control character reference",description:"Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace"},disallowedContentInNoscriptInHead:{reason:"Disallowed content inside `<noscript>` in `<head>`",description:"Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`",url:!1},duplicateAttribute:{reason:"Unexpected duplicate attribute",description:"Unexpectedly double attribute. Expected attributes to occur only once"},endTagWithAttributes:{reason:"Unexpected attribute on closing tag",description:"Unexpected attribute. Expected `>` instead"},endTagWithTrailingSolidus:{reason:"Unexpected slash at end of closing tag",description:"Unexpected `%c-1`. Expected `>` instead"},endTagWithoutMatchingOpenElement:{reason:"Unexpected unopened end tag",description:"Unexpected end tag. Expected no end tag or another end tag",url:!1},eofBeforeTagName:{reason:"Unexpected end of file",description:"Unexpected end of file. Expected tag name instead"},eofInCdata:{reason:"Unexpected end of file in CDATA",description:"Unexpected end of file. Expected `]]>` to close the CDATA"},eofInComment:{reason:"Unexpected end of file in comment",description:"Unexpected end of file. Expected `--\x3e` to close the comment"},eofInDoctype:{reason:"Unexpected end of file in doctype",description:"Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)"},eofInElementThatCanContainOnlyText:{reason:"Unexpected end of file in element that can only contain text",description:"Unexpected end of file. Expected text or a closing tag",url:!1},eofInScriptHtmlCommentLikeText:{reason:"Unexpected end of file in comment inside script",description:"Unexpected end of file. Expected `--\x3e` to close the comment"},eofInTag:{reason:"Unexpected end of file in tag",description:"Unexpected end of file. Expected `>` to close the tag"},incorrectlyClosedComment:{reason:"Incorrectly closed comment",description:"Unexpected `%c-1`. Expected `--\x3e` to close the comment"},incorrectlyOpenedComment:{reason:"Incorrectly opened comment",description:"Unexpected `%c`. Expected `\x3c!--` to open the comment"},invalidCharacterSequenceAfterDoctypeName:{reason:"Invalid sequence after doctype name",description:"Unexpected sequence at `%c`. Expected `public` or `system`"},invalidFirstCharacterOfTagName:{reason:"Invalid first character in tag name",description:"Unexpected `%c`. Expected an ASCII letter instead"},misplacedDoctype:{reason:"Misplaced doctype",description:"Unexpected doctype. Expected doctype before head",url:!1},misplacedStartTagForHeadElement:{reason:"Misplaced `<head>` start tag",description:"Unexpected start tag `<head>`. Expected `<head>` directly after doctype",url:!1},missingAttributeValue:{reason:"Missing attribute value",description:"Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead"},missingDoctype:{reason:"Missing doctype before other content",description:"Expected a `<!doctype html>` before anything else",url:!1},missingDoctypeName:{reason:"Missing doctype name",description:"Unexpected doctype end at `%c`. Expected `html` instead"},missingDoctypePublicIdentifier:{reason:"Missing public identifier in doctype",description:"Unexpected `%c`. Expected identifier for `public` instead"},missingDoctypeSystemIdentifier:{reason:"Missing system identifier in doctype",description:'Unexpected `%c`. Expected identifier for `system` instead (suggested: `"about:legacy-compat"`)'},missingEndTagName:{reason:"Missing name in end tag",description:"Unexpected `%c`. Expected an ASCII letter instead"},missingQuoteBeforeDoctypePublicIdentifier:{reason:"Missing quote before public identifier in doctype",description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingQuoteBeforeDoctypeSystemIdentifier:{reason:"Missing quote before system identifier in doctype",description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingSemicolonAfterCharacterReference:{reason:"Missing semicolon after character reference",description:"Unexpected `%c`. Expected `;` instead"},missingWhitespaceAfterDoctypePublicKeyword:{reason:"Missing whitespace after public identifier in doctype",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceAfterDoctypeSystemKeyword:{reason:"Missing whitespace after system identifier in doctype",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBeforeDoctypeName:{reason:"Missing whitespace before doctype name",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenAttributes:{reason:"Missing whitespace between attributes",description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:{reason:"Missing whitespace between public and system identifiers in doctype",description:"Unexpected `%c`. Expected ASCII whitespace instead"},nestedComment:{reason:"Unexpected nested comment",description:"Unexpected `\x3c!--`. Expected `--\x3e`"},nestedNoscriptInHead:{reason:"Unexpected nested `<noscript>` in `<head>`",description:"Unexpected `<noscript>`. Expected a closing tag or a meta element",url:!1},nonConformingDoctype:{reason:"Unexpected non-conforming doctype declaration",description:'Expected `<!doctype html>` or `<!doctype html system "about:legacy-compat">`',url:!1},nonVoidHtmlElementStartTagWithTrailingSolidus:{reason:"Unexpected trailing slash on start tag of non-void element",description:"Unexpected `/`. Expected `>` instead"},noncharacterCharacterReference:{reason:"Unexpected noncharacter code point referenced by character reference",description:"Unexpected code point. Do not use noncharacters in HTML"},noncharacterInInputStream:{reason:"Unexpected noncharacter character",description:"Unexpected code point `%x`. Do not use noncharacters in HTML"},nullCharacterReference:{reason:"Unexpected NULL character referenced by character reference",description:"Unexpected code point. Do not use NULL characters in HTML"},openElementsLeftAfterEof:{reason:"Unexpected end of file",description:"Unexpected end of file. Expected closing tag instead",url:!1},surrogateCharacterReference:{reason:"Unexpected surrogate character referenced by character reference",description:"Unexpected code point. Do not use lone surrogate characters in HTML"},surrogateInInputStream:{reason:"Unexpected surrogate character",description:"Unexpected code point `%x`. Do not use lone surrogate characters in HTML"},unexpectedCharacterAfterDoctypeSystemIdentifier:{reason:"Invalid character after system identifier in doctype",description:"Unexpected character at `%c`. Expected `>`"},unexpectedCharacterInAttributeName:{reason:"Unexpected character in attribute name",description:"Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter"},unexpectedCharacterInUnquotedAttributeValue:{reason:"Unexpected character in unquoted attribute value",description:"Unexpected `%c`. Quote the attribute value to include it"},unexpectedEqualsSignBeforeAttributeName:{reason:"Unexpected equals sign before attribute name",description:"Unexpected `%c`. Add an attribute name before it"},unexpectedNullCharacter:{reason:"Unexpected NULL character",description:"Unexpected code point `%x`. Do not use NULL characters in HTML"},unexpectedQuestionMarkInsteadOfTagName:{reason:"Unexpected question mark instead of tag name",description:"Unexpected `%c`. Expected an ASCII letter instead"},unexpectedSolidusInTag:{reason:"Unexpected slash in tag",description:"Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value"},unknownNamedCharacterReference:{reason:"Unexpected unknown named character reference",description:"Unexpected character reference. Expected known named character references"}},Lu=/-[a-z]/g,Ru=/%c(?:([-+])(\d+))?/g,Nu=/%x/g,_u={2:!0,1:!1,0:null},Ou={};function Iu(t){return t.charAt(1).toUpperCase()}function Mu(t){const{emitParseErrors:e,...n}={...this.data("settings"),...t};this.parser=function(t,r){return function(t,e){const n=e||Ou,r=n.onerror,i=t instanceof ro?t:new ro(t),s=n.fragment?Du:Cu,a=String(i),o=s(a,{sourceCodeLocationInfo:!0,onParseError:n.onerror?function(t){const e=t.code,s=function(t){return t.replace(Lu,Iu)}(e),o=n[s],l=null==o||o,c="number"==typeof l?l:l?1:0;if(c){const n=Pu[s],a=new Za(h(n.reason),{place:{start:{line:t.startLine,column:t.startCol,offset:t.startOffset},end:{line:t.endLine,column:t.endCol,offset:t.endOffset}},ruleId:e,source:"hast-util-from-html"});i.path&&(a.file=i.path,a.name=i.path+":"+a.name),a.fatal=_u[c],a.note=h(n.description),a.url=!1===n.url?void 0:"https://html.spec.whatwg.org/multipage/parsing.html#parse-error-"+e,r(a)}function h(e){return e.replace(Ru,function(e,n,r){const i=(r?Number.parseInt(r,10):0)*("-"===n?-1:1);return"`"===(s=a.charAt(t.startOffset+i))?"` ` `":s;var s}).replace(Nu,function(){return"0x"+a.charCodeAt(t.startOffset).toString(16).toUpperCase()})}}:null,scriptingEnabled:!1});return function(t,e){const n=e||{};return zl({file:n.file||void 0,location:!1,schema:"svg"===n.space?Bl:Ul,verbose:n.verbose||!1},t)}(o,{file:i,space:n.space,verbose:n.verbose})}(t,{...n,onerror:e?function(t){r.path&&(t.name=r.path+":"+t.name,t.file=r.path),r.messages.push(t)}:void 0})}}var Fu=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],$u=class{constructor(t,e,n){this.normal=e,this.property=t,n&&(this.space=n)}};function Uu(t,e){const n={},r={};for(const e of t)Object.assign(n,e.property),Object.assign(r,e.normal);return new $u(n,r,e)}function Bu(t){return t.toLowerCase()}$u.prototype.normal={},$u.prototype.property={},$u.prototype.space=void 0;var qu=class{constructor(t,e){this.attribute=e,this.property=t}};qu.prototype.attribute="",qu.prototype.booleanish=!1,qu.prototype.boolean=!1,qu.prototype.commaOrSpaceSeparated=!1,qu.prototype.commaSeparated=!1,qu.prototype.defined=!1,qu.prototype.mustUseProperty=!1,qu.prototype.number=!1,qu.prototype.overloadedBoolean=!1,qu.prototype.property="",qu.prototype.spaceSeparated=!1,qu.prototype.space=void 0;var ju={};p(ju,{boolean:()=>zu,booleanish:()=>Wu,commaOrSpaceSeparated:()=>Xu,commaSeparated:()=>Ku,number:()=>Vu,overloadedBoolean:()=>Gu,spaceSeparated:()=>Yu});var Hu=0,zu=Zu(),Wu=Zu(),Gu=Zu(),Vu=Zu(),Yu=Zu(),Ku=Zu(),Xu=Zu();function Zu(){return 2**++Hu}var Ju=Object.keys(ju),Qu=class extends qu{constructor(t,e,n,r){let i=-1;if(super(t,e),tf(this,"space",r),"number"==typeof n)for(;++i<Ju.length;){const t=Ju[i];tf(this,Ju[i],(n&ju[t])===ju[t])}}};function tf(t,e,n){n&&(t[e]=n)}function ef(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const s=new Qu(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[Bu(r)]=r,n[Bu(s.attribute)]=r}return new $u(e,n,t.space)}Qu.prototype.defined=!0;var nf=ef({properties:{ariaActiveDescendant:null,ariaAtomic:Wu,ariaAutoComplete:null,ariaBusy:Wu,ariaChecked:Wu,ariaColCount:Vu,ariaColIndex:Vu,ariaColSpan:Vu,ariaControls:Yu,ariaCurrent:null,ariaDescribedBy:Yu,ariaDetails:null,ariaDisabled:Wu,ariaDropEffect:Yu,ariaErrorMessage:null,ariaExpanded:Wu,ariaFlowTo:Yu,ariaGrabbed:Wu,ariaHasPopup:null,ariaHidden:Wu,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Yu,ariaLevel:Vu,ariaLive:null,ariaModal:Wu,ariaMultiLine:Wu,ariaMultiSelectable:Wu,ariaOrientation:null,ariaOwns:Yu,ariaPlaceholder:null,ariaPosInSet:Vu,ariaPressed:Wu,ariaReadOnly:Wu,ariaRelevant:null,ariaRequired:Wu,ariaRoleDescription:Yu,ariaRowCount:Vu,ariaRowIndex:Vu,ariaRowSpan:Vu,ariaSelected:Wu,ariaSetSize:Vu,ariaSort:null,ariaValueMax:Vu,ariaValueMin:Vu,ariaValueNow:Vu,ariaValueText:null,role:null},transform:(t,e)=>"role"===e?e:"aria-"+e.slice(4).toLowerCase()});function rf(t,e){return e in t?t[e]:e}function sf(t,e){return rf(t,e.toLowerCase())}var af=ef({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ku,acceptCharset:Yu,accessKey:Yu,action:null,allow:null,allowFullScreen:zu,allowPaymentRequest:zu,allowUserMedia:zu,alt:null,as:null,async:zu,autoCapitalize:null,autoComplete:Yu,autoFocus:zu,autoPlay:zu,blocking:Yu,capture:null,charSet:null,checked:zu,cite:null,className:Yu,cols:Vu,colSpan:null,content:null,contentEditable:Wu,controls:zu,controlsList:Yu,coords:Vu|Ku,crossOrigin:null,data:null,dateTime:null,decoding:null,default:zu,defer:zu,dir:null,dirName:null,disabled:zu,download:Gu,draggable:Wu,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:zu,formTarget:null,headers:Yu,height:Vu,hidden:Gu,high:Vu,href:null,hrefLang:null,htmlFor:Yu,httpEquiv:Yu,id:null,imageSizes:null,imageSrcSet:null,inert:zu,inputMode:null,integrity:null,is:null,isMap:zu,itemId:null,itemProp:Yu,itemRef:Yu,itemScope:zu,itemType:Yu,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:zu,low:Vu,manifest:null,max:null,maxLength:Vu,media:null,method:null,min:null,minLength:Vu,multiple:zu,muted:zu,name:null,nonce:null,noModule:zu,noValidate:zu,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:zu,optimum:Vu,pattern:null,ping:Yu,placeholder:null,playsInline:zu,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:zu,referrerPolicy:null,rel:Yu,required:zu,reversed:zu,rows:Vu,rowSpan:Vu,sandbox:Yu,scope:null,scoped:zu,seamless:zu,selected:zu,shadowRootClonable:zu,shadowRootDelegatesFocus:zu,shadowRootMode:null,shape:null,size:Vu,sizes:null,slot:null,span:Vu,spellCheck:Wu,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Vu,step:null,style:null,tabIndex:Vu,target:null,title:null,translate:null,type:null,typeMustMatch:zu,useMap:null,value:Wu,width:Vu,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Yu,axis:null,background:null,bgColor:null,border:Vu,borderColor:null,bottomMargin:Vu,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:zu,declare:zu,event:null,face:null,frame:null,frameBorder:null,hSpace:Vu,leftMargin:Vu,link:null,longDesc:null,lowSrc:null,marginHeight:Vu,marginWidth:Vu,noResize:zu,noHref:zu,noShade:zu,noWrap:zu,object:null,profile:null,prompt:null,rev:null,rightMargin:Vu,rules:null,scheme:null,scrolling:Wu,standby:null,summary:null,text:null,topMargin:Vu,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Vu,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:zu,disableRemotePlayback:zu,prefix:null,property:null,results:Vu,security:null,unselectable:null},space:"html",transform:sf}),of=ef({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Xu,accentHeight:Vu,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Vu,amplitude:Vu,arabicForm:null,ascent:Vu,attributeName:null,attributeType:null,azimuth:Vu,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Vu,by:null,calcMode:null,capHeight:Vu,className:Yu,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Vu,diffuseConstant:Vu,direction:null,display:null,dur:null,divisor:Vu,dominantBaseline:null,download:zu,dx:null,dy:null,edgeMode:null,editable:null,elevation:Vu,enableBackground:null,end:null,event:null,exponent:Vu,externalResourcesRequired:null,fill:null,fillOpacity:Vu,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ku,g2:Ku,glyphName:Ku,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Vu,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Vu,horizOriginX:Vu,horizOriginY:Vu,id:null,ideographic:Vu,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Vu,k:Vu,k1:Vu,k2:Vu,k3:Vu,k4:Vu,kernelMatrix:Xu,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Vu,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Vu,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Vu,overlineThickness:Vu,paintOrder:null,panose1:null,path:null,pathLength:Vu,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Yu,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Vu,pointsAtY:Vu,pointsAtZ:Vu,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Xu,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Xu,rev:Xu,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Xu,requiredFeatures:Xu,requiredFonts:Xu,requiredFormats:Xu,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Vu,specularExponent:Vu,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Vu,strikethroughThickness:Vu,string:null,stroke:null,strokeDashArray:Xu,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Vu,strokeOpacity:Vu,strokeWidth:null,style:null,surfaceScale:Vu,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Xu,tabIndex:Vu,tableValues:null,target:null,targetX:Vu,targetY:Vu,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Xu,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Vu,underlineThickness:Vu,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Vu,values:null,vAlphabetic:Vu,vMathematical:Vu,vectorEffect:null,vHanging:Vu,vIdeographic:Vu,version:null,vertAdvY:Vu,vertOriginX:Vu,vertOriginY:Vu,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Vu,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:rf}),lf=ef({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(t,e)=>"xlink:"+e.slice(5).toLowerCase()}),cf=ef({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:sf}),hf=ef({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(t,e)=>"xml:"+e.slice(3).toLowerCase()}),uf=/[A-Z]/g,ff=/-[a-z]/g,df=/^data[-\w.:]+$/i;function pf(t){return"-"+t.toLowerCase()}function gf(t){return t.charAt(1).toUpperCase()}var mf,wf=Uu([nf,af,lf,cf,hf],"html"),yf=Uu([nf,of,lf,cf,hf],"svg"),bf={}.hasOwnProperty,vf=/["&'<>`]/g,Ef=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,kf=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Sf=/[|\\{}()[\]^$+*?.]/g,Tf=new WeakMap,xf=/[\dA-Fa-f]/,Af=/\d/,Cf=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Df={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Pf=["cent","copy","divide","gt","lt","not","para","times"],Lf={}.hasOwnProperty,Rf={};for(mf in Df)Lf.call(Df,mf)&&(Rf[Df[mf]]=mf);var Nf=/[^\dA-Za-z]/;function _f(t,e,n){let r,i=function(t,e,n){const r="&#x"+t.toString(16).toUpperCase();return n&&e&&!xf.test(String.fromCharCode(e))?r:r+";"}(t,e,n.omitOptionalSemicolons);if((n.useNamedReferences||n.useShortestReferences)&&(r=function(t,e,n,r){const i=String.fromCharCode(t);if(Lf.call(Rf,i)){const t=Rf[i],s="&"+t;return n&&Cf.includes(t)&&!Pf.includes(t)&&(!r||e&&61!==e&&Nf.test(String.fromCharCode(e)))?s:s+";"}return""}(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const r=function(t,e,n){const r="&#"+String(t);return n&&e&&!Af.test(String.fromCharCode(e))?r:r+";"}(t,e,n.omitOptionalSemicolons);r.length<i.length&&(i=r)}return r&&(!n.useShortestReferences||r.length<i.length)?r:i}function Of(t,e){return function(t,e){return t=t.replace(e.subset?function(t){let e=Tf.get(t);return e||(e=function(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(Sf,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}(t),Tf.set(t,e)),e}(e.subset):vf,n),e.subset||e.escapeOnly?t:t.replace(Ef,function(t,n,r){return e.format(1024*(t.charCodeAt(0)-55296)+t.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),e)}).replace(kf,n);function n(t,n,r){return e.format(t.charCodeAt(0),r.charCodeAt(n+1),e)}}(t,Object.assign({format:_f},e))}var If=/^>|^->|<!--|-->|--!>|<!-$/g,Mf=[">"],Ff=["<",">"];function $f(t,e){const n=String(t);if("string"!=typeof e)throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;-1!==i;)r++,i=n.indexOf(e,i+e.length);return r}var Uf=/[ \t\n\f\r]/g;function Bf(t){return"object"==typeof t?"text"===t.type&&qf(t.value):qf(t)}function qf(t){return""===t.replace(Uf,"")}var jf=Wf(1),Hf=Wf(-1),zf=[];function Wf(t){return function(e,n,r){const i=e?e.children:zf;let s=(n||0)+t,a=i[s];if(!r)for(;a&&Bf(a);)s+=t,a=i[s];return a}}var Gf={}.hasOwnProperty;function Vf(t){return function(e,n,r){return Gf.call(t,e.tagName)&&t[e.tagName](e,n,r)}}var Yf=Vf({body:function(t,e,n){const r=jf(n,e);return!r||"comment"!==r.type},caption:Kf,colgroup:Kf,dd:function(t,e,n){const r=jf(n,e);return!r||"element"===r.type&&("dt"===r.tagName||"dd"===r.tagName)},dt:function(t,e,n){const r=jf(n,e);return Boolean(r&&"element"===r.type&&("dt"===r.tagName||"dd"===r.tagName))},head:Kf,html:function(t,e,n){const r=jf(n,e);return!r||"comment"!==r.type},li:function(t,e,n){const r=jf(n,e);return!r||"element"===r.type&&"li"===r.tagName},optgroup:function(t,e,n){const r=jf(n,e);return!r||"element"===r.type&&"optgroup"===r.tagName},option:function(t,e,n){const r=jf(n,e);return!r||"element"===r.type&&("option"===r.tagName||"optgroup"===r.tagName)},p:function(t,e,n){const r=jf(n,e);return r?"element"===r.type&&("address"===r.tagName||"article"===r.tagName||"aside"===r.tagName||"blockquote"===r.tagName||"details"===r.tagName||"div"===r.tagName||"dl"===r.tagName||"fieldset"===r.tagName||"figcaption"===r.tagName||"figure"===r.tagName||"footer"===r.tagName||"form"===r.tagName||"h1"===r.tagName||"h2"===r.tagName||"h3"===r.tagName||"h4"===r.tagName||"h5"===r.tagName||"h6"===r.tagName||"header"===r.tagName||"hgroup"===r.tagName||"hr"===r.tagName||"main"===r.tagName||"menu"===r.tagName||"nav"===r.tagName||"ol"===r.tagName||"p"===r.tagName||"pre"===r.tagName||"section"===r.tagName||"table"===r.tagName||"ul"===r.tagName):!n||!("element"===n.type&&("a"===n.tagName||"audio"===n.tagName||"del"===n.tagName||"ins"===n.tagName||"map"===n.tagName||"noscript"===n.tagName||"video"===n.tagName))},rp:Xf,rt:Xf,tbody:function(t,e,n){const r=jf(n,e);return!r||"element"===r.type&&("tbody"===r.tagName||"tfoot"===r.tagName)},td:Zf,tfoot:function(t,e,n){return!jf(n,e)},th:Zf,thead:function(t,e,n){const r=jf(n,e);return Boolean(r&&"element"===r.type&&("tbody"===r.tagName||"tfoot"===r.tagName))},tr:function(t,e,n){const r=jf(n,e);return!r||"element"===r.type&&"tr"===r.tagName}});function Kf(t,e,n){const r=jf(n,e,!0);return!r||"comment"!==r.type&&!("text"===r.type&&Bf(r.value.charAt(0)))}function Xf(t,e,n){const r=jf(n,e);return!r||"element"===r.type&&("rp"===r.tagName||"rt"===r.tagName)}function Zf(t,e,n){const r=jf(n,e);return!r||"element"===r.type&&("td"===r.tagName||"th"===r.tagName)}var Jf=Vf({body:function(t){const e=jf(t,-1,!0);return!(e&&("comment"===e.type||"text"===e.type&&Bf(e.value.charAt(0))||"element"===e.type&&("meta"===e.tagName||"link"===e.tagName||"script"===e.tagName||"style"===e.tagName||"template"===e.tagName)))},colgroup:function(t,e,n){const r=Hf(n,e),i=jf(t,-1,!0);return!(n&&r&&"element"===r.type&&"colgroup"===r.tagName&&Yf(r,n.children.indexOf(r),n))&&Boolean(i&&"element"===i.type&&"col"===i.tagName)},head:function(t){const e=new Set;for(const n of t.children)if("element"===n.type&&("base"===n.tagName||"title"===n.tagName)){if(e.has(n.tagName))return!1;e.add(n.tagName)}const n=t.children[0];return!n||"element"===n.type},html:function(t){const e=jf(t,-1);return!e||"comment"!==e.type},tbody:function(t,e,n){const r=Hf(n,e),i=jf(t,-1);return(!n||!r||"element"!==r.type||"thead"!==r.tagName&&"tbody"!==r.tagName||!Yf(r,n.children.indexOf(r),n))&&Boolean(i&&"element"===i.type&&"tr"===i.tagName)}}),Qf={name:[["\t\n\f\r &/=>".split(""),"\t\n\f\r \"&'/=>`".split("")],["\0\t\n\f\r \"&'/<=>".split(""),"\0\t\n\f\r \"&'/<=>`".split("")]],unquoted:[["\t\n\f\r &>".split(""),"\0\t\n\f\r \"&'<=>`".split("")],["\0\t\n\f\r \"&'<=>`".split(""),"\0\t\n\f\r \"&'<=>`".split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function td(t,e,n){const r=function(t,e){const n=Bu(e);let r=e,i=qu;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&df.test(e)){if("-"===e.charAt(4)){const t=e.slice(5).replace(ff,gf);r="data"+t.charAt(0).toUpperCase()+t.slice(1)}else{const t=e.slice(4);if(!ff.test(t)){let n=t.replace(uf,pf);"-"!==n.charAt(0)&&(n="-"+n),e="data"+n}}i=Qu}return new i(r,e)}(t.schema,e),i=t.settings.allowParseErrors&&"html"===t.schema.space?0:1,s=t.settings.allowDangerousCharacters?0:1;let a,o=t.quote;if(!r.overloadedBoolean||n!==r.attribute&&""!==n?!r.boolean&&!r.overloadedBoolean||"string"==typeof n&&n!==r.attribute&&""!==n||(n=Boolean(n)):n=!0,null==n||!1===n||"number"==typeof n&&Number.isNaN(n))return"";const l=Of(r.attribute,Object.assign({},t.settings.characterReferences,{subset:Qf.name[i][s]}));return!0===n?l:(n=Array.isArray(n)?(r.commaSeparated?Zo:tl)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n?l:(t.settings.preferUnquoted&&(a=Of(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:Qf.unquoted[i][s]}))),a!==n&&(t.settings.quoteSmart&&$f(n,o)>$f(n,t.alternative)&&(o=t.alternative),a=o+Of(n,Object.assign({},t.settings.characterReferences,{subset:("'"===o?Qf.single:Qf.double)[i][s],attribute:!0}))+o),l+(a?"="+a:a)))}var ed=["<","&"];function nd(t,e,n,r){return!n||"element"!==n.type||"script"!==n.tagName&&"style"!==n.tagName?Of(t.value,Object.assign({},r.settings.characterReferences,{subset:ed})):t.value}var rd=function(t,e){const n=e||{};function r(e,...n){let i=r.invalid;const s=r.handlers;if(e&&bf.call(e,t)){const n=String(e[t]);i=bf.call(s,n)?s[n]:r.unknown}if(i)return i.call(this,e,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}("type",{invalid:function(t){throw new Error("Expected node, not `"+t+"`")},unknown:function(t){throw new Error("Cannot compile unknown node `"+t.type+"`")},handlers:{comment:function(t,e,n,r){return r.settings.bogusComments?"<?"+Of(t.value,Object.assign({},r.settings.characterReferences,{subset:Mf}))+">":"\x3c!--"+t.value.replace(If,function(t){return Of(t,Object.assign({},r.settings.characterReferences,{subset:Ff}))})+"--\x3e"},doctype:function(t,e,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"},element:function(t,e,n,r){const i=r.schema,s="svg"!==i.space&&r.settings.omitOptionalTags;let a="svg"===i.space?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const o=[];let l;"html"===i.space&&"svg"===t.tagName&&(r.schema=yf);const c=function(t,e){const n=[];let r,i=-1;if(e)for(r in e)if(null!==e[r]&&void 0!==e[r]){const i=td(t,r,e[r]);i&&n.push(i)}for(;++i<n.length;){const e=t.settings.tightAttributes?n[i].charAt(n[i].length-1):void 0;i!==n.length-1&&'"'!==e&&"'"!==e&&(n[i]+=" ")}return n.join("")}(r,t.properties),h=r.all("html"===i.space&&"template"===t.tagName?t.content:t);return r.schema=i,h&&(a=!1),!c&&s&&Jf(t,e,n)||(o.push("<",t.tagName,c?" "+c:""),a&&("svg"===i.space||r.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!r.settings.tightSelfClosing||"/"===l||l&&'"'!==l&&"'"!==l)&&o.push(" "),o.push("/")),o.push(">")),o.push(h),a||s&&Yf(t,e,n)||o.push("</"+t.tagName+">"),o.join("")},raw:function(t,e,n,r){return r.settings.allowDangerousHtml?t.value:nd(t,0,n,r)},root:function(t,e,n,r){return r.all(t)},text:nd}}),id={},sd={},ad=[];function od(t,e,n){return rd(t,e,n,this)}function ld(t){const e=[],n=t&&t.children||ad;let r=-1;for(;++r<n.length;)e[r]=this.one(n[r],r,t);return e.join("")}function cd(t){const e={...this.data("settings"),...t};this.compiler=function(t){return function(t,e){const n=e||id,r=n.quote||'"',i='"'===r?"'":'"';if('"'!==r&&"'"!==r)throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:od,all:ld,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Fu,characterReferences:n.characterReferences||sd,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:"svg"===n.space?yf:wf,quote:r,alternative:i}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}(t,e)}}var hd=function(t){if(null==t)return fd;if("function"==typeof t)return ud(t);if("object"==typeof t)return Array.isArray(t)?function(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=hd(t[n]);return ud(function(...t){let n=-1;for(;++n<e.length;)if(e[n].apply(this,t))return!0;return!1})}(t):function(t){const e=t;return ud(function(n){const r=n;let i;for(i in t)if(r[i]!==e[i])return!1;return!0})}(t);if("string"==typeof t)return e=t,ud(function(t){return t&&t.type===e});var e;throw new Error("Expected function, string, or object as test")};function ud(t){return function(e,n,r){return Boolean(function(t){return null!==t&&"object"==typeof t&&"type"in t}(e)&&t.call(this,e,"number"==typeof n?n:void 0,r||void 0))}}function fd(){return!0}var dd=[],pd=!1,gd=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,md=/^[a-zA-Z]:\\/,wd=/^https?:/i;function yd(t,e={}){if("string"!=typeof t)throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);if(md.test(t))return!1;if(!gd.test(t))return!1;const{httpOnly:n=!0}=e;return!n||wd.test(t)}var bd=m(require("path"));j();var vd=N("site",{component:"HtmlLinkProcessor"}),Ed={markdownLinkResolution:"shortest",prettyLinks:!0,openLinksInNewTab:!1,lazyLoad:!1,externalLinkIcon:!0},kd=class{constructor(t,e={}){this.graph=t,this.options={...Ed,...e}}options;async processLinks(t,e){if(!e||"string"!=typeof e)return vd.error("[HtmlLinkProcessor] Invalid HTML input: "+typeof e),{html:e||"",outgoingLinks:[]};const n=this.options,r=Ia(t),i=new Set,s=co().use(Mu,{fragment:!0}).use(()=>e=>{!function(t,e,n){let r,i,s;i="element",s=n,r=void 0,function(t,e,n,r){let i;i=e;const s=hd(i),a=r?-1:1;!function t(e,i,o){const l=e&&"object"==typeof e?e:{};if("string"==typeof l.type){const t="string"==typeof l.tagName?l.tagName:"string"==typeof l.name?l.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(c=e.type+(t?"<"+t+">":""),""+c+")")})}var c;return h;function h(){let l,c,h,u=dd;if(s(e,i,o[o.length-1]||void 0)&&(u=function(t){return Array.isArray(t)?t:"number"==typeof t?[!0,t]:null==t?dd:[t]}(n(e,o)),u[0]===pd))return u;if("children"in e&&e.children){const n=e;if(n.children&&"skip"!==u[0])for(c=(r?n.children.length:-1)+a,h=o.concat(n);c>-1&&c<n.children.length;){const e=n.children[c];if(l=t(e,c,h)(),l[0]===pd)return l;c="number"==typeof l[1]?l[1]:c+a}}return u}}(t,void 0,[])()}(t,"element",function(t,e){const n=e[e.length-1],r=n?n.children.indexOf(t):void 0;return s(t,r,n)},undefined)}(e,0,e=>{if("a"===e.tagName&&e.properties){const s=e.properties.dataWikilink||e.properties.dataSlug,a="string"==typeof e.properties.href;if(!a&&!s)return;let o;o=!a&&s?e.properties.dataWikilink||e.properties.dataSlug:e.properties.href;const l=e.properties.className??[],c=yd(o,{httpOnly:!1});l.includes("external")||l.includes("internal")||l.push(c?"external":"internal"),c&&n.externalLinkIcon&&e.children.push({type:"element",tagName:"svg",properties:{"aria-hidden":"true",class:"external-icon",style:"max-width:0.8em;max-height:0.8em",viewBox:"0 0 512 512"},children:[{type:"element",tagName:"path",properties:{d:"M320 0H288V64h32 82.7L201.4 265.4 178.7 288 224 333.3l22.6-22.6L448 109.3V192v32h64V192 32 0H480 320zM32 32H0V64 480v32H32 456h32V480 352 320H424v32 96H64V96h96 32V32H160 32z"},children:[]}]}),1===e.children.length&&"text"===e.children[0].type&&e.children[0].value!==o&&l.push("alias"),e.properties.className=l,c&&n.openLinksInNewTab&&(e.properties.target="_blank");const h=!(yd(o,{httpOnly:!1})||o.startsWith("#"));if(h){const s=$a(t,o,{strategy:n.markdownLinkResolution,allSlugs:this.graph.getAllSlugs()}),a=new URL(s,"https://base.com/"+ja(r,!0)).pathname;let[l,c]=Oa(a);l.endsWith("/")&&(l+="index");const h=decodeURIComponent(ja(l,!0)),u=Ia(h);i.add(u);let f=s;if(f.startsWith("./")&&(f=f.slice(2)),f.startsWith("../")){const e=(f.match(/\.\.\//g)||[]).length,n=t.split("/").filter(t=>t).slice(0,-1),r=f.replace(/\.\.\//g,""),i=n.slice(0,n.length-e);r&&i.push(r),f=i.join("/")}f=n.baseURL?`${n.baseURL}/${f}`:`/${f}`;const[d,p]=Oa(f);let g=d;g.endsWith(".html")||g.endsWith("/")||(g+=".html"),f=g+p,o=e.properties.href=f,e.properties["data-slug"]=h}n.prettyLinks&&h&&1===e.children.length&&"text"===e.children[0].type&&!e.children[0].value.startsWith("#")&&(e.children[0].value=bd.default.basename(e.children[0].value))}if(["img","video","audio","iframe"].includes(e.tagName)&&e.properties&&"string"==typeof e.properties.src&&(n.lazyLoad&&(e.properties.loading="lazy"),!yd(e.properties.src,{httpOnly:!1}))){let r=e.properties.src;r=e.properties.src=$a(t,r,{strategy:n.markdownLinkResolution,allSlugs:this.graph.getAllSlugs()}),e.properties.src=r}})}).use(cd),a=await s.process(e);return{html:String(a),outgoingLinks:Array.from(i)}}},Sd=N("site",{component:"site"}),Td=class{configSvc;contentSvc;translationSvc;languageSvc;sitemap;staticCopySvc;publisher;template=null;author;organization;compiler;url;ref=null;language;navigation=null;title;home=null;pageGraph=null;get Title(){return this.title}get Description(){return this.home?.description()||""}get Compiler(){return this.compiler}get IsGoogleAnalyticsEnabled(){return this.configSvc.isGoogleAnalyticsEnabled()}get GoogleAnalyticsID(){return this.configSvc.googleAnalyticsID()}get IsGoogleAnalyticsRespectDoNotTrack(){return this.configSvc.isGoogleAnalyticsRespectDoNotTrack()}get IsDisqusEnabled(){return this.configSvc.isDisqusEnabled()}get DisqusShortname(){return this.configSvc.disqusShortname()}get IsXRespectDoNotTrack(){return this.configSvc.isXRespectDoNotTrack()}get IsXDisableInlineCSS(){return this.configSvc.isXDisableInlineCSS()}get ConfiguredSocialPlatforms(){return this.configSvc.getConfiguredSocialPlatforms()}GetSocialLink(t){return this.configSvc.getSocialLink(t)}GetSocialTitle(t){return this.configSvc.getSocialTitle(t)}async Pages(){const t=this.languageSvc.getLanguageIndex(this.language.getCurrentLanguage()),e=await this.contentSvc.globalPages(t);return this.sitePages(e)}async RegularPages(){const t=await this.contentSvc.globalRegularPages();return this.sitePages(t)}constructor(t,e,n,r,i,s,a,o,l,c,h,u,f,d,p){this.configSvc=t,this.contentSvc=e,this.translationSvc=n,this.languageSvc=r,this.sitemap=i,this.staticCopySvc=s,this.publisher=a,this.author=o,this.organization=l,this.compiler=c,this.url=h,this.ref=u,this.language=f,this.navigation=d,this.title=p}async build(t){try{this.template=t,await this.setup(),await this.copyStaticFiles();const e=this.languageSvc.languageKeys();for(const t of e)this.language.setCurrentLanguage(t),await this.generateNavigations(),await this.render()}catch(t){const e=t instanceof Error?t.message:String(t);throw Sd.error(`❌ Site build failed: ${e}`),t}}async buildWithProgress(t,e){try{this.template=t,await this.setup(),await this.copyStaticFiles();const n=this.languageSvc.languageKeys();for(const t of n)this.language.setCurrentLanguage(t),await this.generateNavigations(),await this.renderWithProgress(e)}catch(t){const e=t instanceof Error?t.message:String(t);throw Sd.error(`❌ Site build failed: ${e}`),t}}async setup(){try{await this.buildPageGraph()}catch(t){const e=t instanceof Error?t.message:String(t);throw Sd.error(`❌ Setup failed: ${e}`),t}}async renderAllLanguages(){const t=this.languageSvc.languageKeys();for(const e of t)this.language.setCurrentLanguage(e),await this.render()}async render(){try{await this.renderPages()}catch(t){throw t}}async renderWithProgress(t){try{await this.renderPagesWithProgress(t)}catch(t){throw t}}async renderPages(){const t=this.languageSvc.getLanguageIndex(this.language.getCurrentLanguage()),e=[];await this.contentSvc.walkPages(t,async t=>{const n=await this.sitePage(t);e.push(n);const r=await this.contentSvc.getPageSources(t);await n.processResources(r),t.isHome()&&(this.home=n)}),Sd.info(`📊 Processing wikilinks for ${e.length} pages...`);for(const t of e)try{await t.WikilinkContent()}catch(e){const n=e instanceof Error?e.message:String(e);Sd.warn(`⚠️ Failed to process wikilinks for ${t.slug()}: ${n}`)}Sd.info("✅ Wikilink processing complete");for(let t=0;t<e.length;t++){const n=e[t];n.isStale()&&(await n.render(),n.clearStale())}}async renderPagesWithProgress(t){const e=this.languageSvc.getLanguageIndex(this.language.getCurrentLanguage()),n=[];await this.contentSvc.walkPages(e,async t=>{const e=await this.sitePage(t);n.push(e);const r=await this.contentSvc.getPageSources(t);await e.processResources(r),t.isHome()&&(this.home=e)}),Sd.info(`📊 Processing wikilinks for ${n.length} pages...`);for(const t of n)try{await t.WikilinkContent()}catch(e){const n=e instanceof Error?e.message:String(e);Sd.warn(`⚠️ Failed to process wikilinks for ${t.slug()}: ${n}`)}Sd.info("✅ Wikilink processing complete");const r=n.length;for(let e=0;e<n.length;e++){const i=n[e];await i.render(),t?.({currentPage:e+1,totalPages:r})}}async pageOutput(t){return t.output()}clearSiteCache(){}translate(t){return this.translationSvc.translate(this.language.getCurrentLanguage(),t)}get Home(){return this.home}get Params(){return this.configSvc.configParams()}get Taxonomies(){return this.navigation&&this.navigation.getTaxonomies(this.language.getCurrentLanguage())||new U}get Menus(){return this.navigation?this.navigation.getMenus(this.language.getCurrentLanguage()):new Ra}getTitle(){return this.title}setTitle(t){this.title=t}getConfigService(){return this.configSvc}getContentService(){return this.contentSvc}getLanguageService(){return this.languageSvc}baseURL(){return this.url.base}get BaseURL(){return this.baseURL()}getURL(){return this.url}getRef(){return this.ref?this.ref:{}}getLanguage(){return this.language}get Language(){return this.getLanguage()}get LanguageCode(){return this.language.lang()}get Languages(){return this.language.languages()}getNavigation(){return this.navigation?this.navigation:{}}getPublisher(){return this.publisher}getTemplate(){return this.template}get Author(){return this.author.author(this.home?.author())}get Organization(){return this.organization.organization(this.home?.organization())}getCompiler(){return this.compiler}getSitemap(){return this.sitemap}isMultipleLanguage(){return this.language.isMultipleLanguage()}get IsMultilingual(){return this.isMultipleLanguage()}getCurrentLanguage(){return this.language.lang()}languagePrefix(){return this.language.languagePrefix()}async sitePage(t){return new Ca(this.template,this.languageSvc,this.publisher,t,this)}sitePages(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];try{const t=this.sitePageSync(r);e.push(t)}catch(t){Sd.error(`❌ [Site.sitePages] Failed to convert page ${n}:`,t)}}return e}sitePageSync(t){return new Ca(this.template,this.languageSvc,this.publisher,t,this)}async generateNavigations(){const t=this.language.getCurrentLanguage(),e=this.languageSvc.getLanguageIndex(t);this.navigation&&(await this.navigation.generateMenusForLanguage(t,e),await this.navigation.generateTaxonomiesForLanguage(t,e,this))}GetPage(...t){if(t.length>1)throw new Error(`too many arguments to .Site.GetPage: ${t}. Use lookups on the form {{ .Site.GetPage "/posts/mypage-md" }}`);let e=t[0];e=e.replace(/\\/g,"/"),e.startsWith("/")||(e="/"+e);try{const t=this.languageSvc.getLanguageIndex(this.language.getCurrentLanguage()),n=this.contentSvc.getPageFromPathSync(t,e);return n?this.sitePageSync(n):(Sd.warn(`⚠️ GetPage: No page found for key "${e}"`),null)}catch(t){return Sd.error(`❌ Error getting page "${e}": ${t}`),null}}async copyStaticFiles(){try{await this.staticCopySvc.copyStaticFiles(this.staticCopySvc.staticFs(),this.staticCopySvc.publishFs())}catch(t){throw Sd.error("❌ Static file copy failed:",t),t}}async siteWeightedPage(t){const e=await this.sitePage(t.page()),{WeightedPage:n}=await Promise.resolve().then(()=>(G(),H));return new n(e,t)}async buildPageGraph(){try{const t=[],e=this.languageSvc.languageKeys();for(const n of e){const e=this.languageSvc.getLanguageIndex(n);await this.contentSvc.walkPages(e,async e=>{t.push(e)})}const n=t.map(t=>t.slug());Sd.info(`📄 Collected ${n.length} page slugs`);const r=await this.collectResourceSlugs(t);Sd.info(`🖼️ Collected ${r.length} resource slugs`);const i=[...n,...r];this.pageGraph=new za(i),Sd.info(`✅ PageGraph built: ${n.length} pages + ${r.length} resources = ${i.length} total`)}catch(t){const e=t instanceof Error?t.message:String(t);throw Sd.error(`❌ Failed to build PageGraph: ${e}`),t}}async collectResourceSlugs(t){const e=[],n=new Set;try{for(const r of t)try{const t=await this.contentSvc.getPageSources(r);for(const r of t){const t=r.slug();n.has(t)||(n.add(t),e.push(t))}}catch(t){const e=t instanceof Error?t.message:String(t);Sd.debug(`⚠️ Failed to get resources for page ${r.slug()}: ${e}`)}}catch(t){const e=t instanceof Error?t.message:String(t);Sd.warn(`⚠️ Failed to collect resource slugs: ${e}`)}return e}async ProcessWikilinks(t,e){if(!this.pageGraph)return Sd.warn("⚠️ PageGraph not built yet, returning original HTML"),e;try{let r="";if(this.url&&this.url.base){if(r=this.url.base.replace(/\/$/,""),r.startsWith("/"));else if(r)try{r=new Pa(r).pathname.replace(/\/$/,"")}catch(t){Sd.warn(`Failed to parse baseURL as URL: ${r}, treating as path`)}"/"===r&&(r="")}const i=(n=this.pageGraph,new kd(n,{markdownLinkResolution:"shortest",prettyLinks:!0,openLinksInNewTab:!1,lazyLoad:!0,externalLinkIcon:!0,baseURL:r})),s=await i.processLinks(t,e);return this.pageGraph.registerOutgoingLinks(t,s.outgoingLinks),s.html}catch(n){const r=n instanceof Error?n.message:String(n);return Sd.error(`❌ Failed to process wikilinks for ${t}: ${r}`),e}var n}getPageGraph(){return this.pageGraph}GetBacklinks(t){return this.pageGraph?this.pageGraph.getBacklinks(t):(Sd.warn(`⚠️ PageGraph not built yet, cannot get backlinks for ${t}`),[])}async GetContentIndex(){if(!this.pageGraph)return Sd.warn("⚠️ PageGraph not built yet, cannot generate content index"),new Map;const t=new Map,e=await this.RegularPages();for(const n of e){const e=n.slug(),r=this.pageGraph.getOutgoingLinks(e),i=(n.Plain||"").substring(0,1e3);t.set(e,{slug:e,title:n.Title||n.File.OriginalBaseName,links:r,tags:n.Params?.tags||[],content:i})}return Sd.debug(`[Site] Generated contentIndex with ${t.size} entries`),t}},xd=m(require("path"));j(),N("site",{component:"publisher"});var Ad=class{fs;constructor(t){this.fs=t}async publishSource(t,...e){const n=await this.openFilesForWriting(...e);try{const e="string"==typeof t?(new TextEncoder).encode(t):t;await this.copyToWriter(n,e)}finally{await n.close()}}async publishFiles(t,...e){const n=await this.openFilesForWriting(...e);try{await this.copyStreamToWriter(n,t)}finally{await n.close()}}async openFilesForWriting(...t){const e=[];for(const n of t){const t=await Dd(this.fs,n);e.push(t)}return new Cd(e)}async copyToWriter(t,e){await t.write(e)}async copyStreamToWriter(t,e){const n=e.getReader();try{for(;;){const{done:e,value:r}=await n.read();if(e)break;await t.write(r)}}finally{n.releaseLock()}}},Cd=class{files;constructor(t){this.files=t}async write(t){const e=this.files.map(e=>e.write(t));await Promise.all(e)}async close(){const t=this.files.map(t=>t.close());await Promise.all(t)}};async function Dd(t,e){const n=xd.default.normalize(e);try{return await t.create(n)}catch(e){if(!function(t){return t&&("ENOENT"===t.code||"FILE_NOT_FOUND"===t.code||t.message?.includes("not found")||t.message?.includes("no such file"))}(e))throw e;const r=xd.default.dirname(n);return await t.mkdirAll(r,511),await t.create(n)}}j();var Pd=N("site",{component:"ref"}),Ld=class{site;contentSvc;notFoundURL;constructor(t,e,n="#ZgotmplZ"){this.site=t,this.contentSvc=e,this.notFoundURL=n}async relRefFrom(t,e){return this.relRef(t,e)}async relRef(t,e){try{const n=this.decodeRefArgs(t);return n.path?this.refLink(n.path,e,!0,n.outputFormat):""}catch(t){throw new Error(`Invalid arguments to Ref: ${t}`)}}decodeRefArgs(t){return{path:t.path||"",outputFormat:t.outputFormat||""}}async refLink(t,e,n,r){const i=e;if(!i||"function"!=typeof i.unwrapPage)throw new Error("source is not a PageWrapper");const s=i.unwrapPage();let a;const o=t.replace(/\\/g,"/");try{a=new globalThis.URL(o,"http://example.com")}catch(t){return Pd.error(`Failed to parse ref URL: ${t}`),this.notFoundURL}let l=null,c="";if(""!==a.pathname)try{l=await this.contentSvc.getPageRef(s,a.pathname,this.site.home.page);let t=null;if(l||this.isPositioner(e)&&(t=e.position()),!l)return this.logNotFound(a.pathname,"page not found",s,t),this.notFoundURL;const r=await this.site.sitePage(l);c=n?r.relPermalink():r.permalink()}catch(e){return Pd.error(`[${s.pageIdentity().pageLanguage()}] REF_NOT_FOUND: Ref "${t}": ${e}`),this.notFoundURL}return a.hash&&(c=c+"#"+a.hash),c}isPositioner(t){return t&&"function"==typeof t.position}logNotFound(t,e,n,r){const i=n.pageIdentity().pageLanguage();r&&r.isValid()?Pd.error(`[${i}] REF_NOT_FOUND: Ref "${t}": ${r.toString()}: ${e}`):n?Pd.error(`[${i}] REF_NOT_FOUND: Ref "${t}" from page "${n.path()}": ${e}`):Pd.error(`[${i}] REF_NOT_FOUND: Ref "${t}": ${e}`)}};j(),N("site",{component:"language"});var Rd=class{collator;constructor(t){this.collator=t}compare(t,e){return this.collator.compare(t,e)}},Nd=class t{langSvc;currentLocation;currentLanguage;collator=null;constructor(t){this.langSvc=t,this.currentLocation="UTC",this.currentLanguage=""}currentLanguageIndex(){try{return this.langSvc.getLanguageIndex(this.currentLanguage)}catch(t){throw new Error(`language "${this.currentLanguage}" not found`)}}async setup(){this.currentLocation="UTC"}languages(){const e=[];for(const n of this.langSvc.languageKeys()){const r=new t(this.langSvc);r.currentLocation=this.currentLocation,r.currentLanguage=n,r.collator=this.collator,e.push(r)}return e}getCollator(){if(!this.collator)try{const t=new Intl.Collator(this.currentLanguage||"en");this.collator=new Rd({compare:(e,n)=>t.compare(e,n)})}catch(t){const e=new Intl.Collator("en");this.collator=new Rd({compare:(t,n)=>e.compare(t,n)})}return this.collator}location(){return this.currentLocation}isMultipleLanguage(){return this.langSvc.languageKeys().length>1}languagePrefix(){return this.currentLanguage===this.langSvc.defaultLanguage()?"":this.currentLanguage}lang(){return this.currentLanguage}get Lang(){return this.lang()}languageName(){return this.langSvc.getLanguageName(this.currentLanguage)}get LanguageName(){return this.languageName()}defaultLanguageName(){return this.langSvc.getLanguageName(this.langSvc.defaultLanguage())}languageCode(){return this.currentLanguage}get LanguageCode(){return this.languageCode()}get LanguageDirection(){return"ltr"}languageDirection(){return"ltr"}setCurrentLanguage(t){this.currentLanguage=t}getCurrentLanguage(){return this.currentLanguage}setCurrentLocation(t){this.currentLocation=t}},_d=class{u;nr;rr;constructor(t,e){this.u=t,this.nr=e}name(){return this.u}email(){return this.nr}author(t){return this.rr=t,this}get Name(){return this.rr?.name||this.name()}get Description(){return this.rr?.description||""}get Avatar(){return this.rr?.avatar||""}get Twitter(){return this.rr?.social?.twitter||""}get Socials(){const t=[];if(!this.rr?.social)return t;for(const[e,n]of Object.entries(this.rr.social))n&&t.push({ID:e,Link:n});return t}};j(),N("site",{component:"organization"});var Od=class{u;ir;sr;ar;nr;lr;cr;hr;constructor(){this.u="MDFriday",this.ir="Turn markdown to website, in minutes.",this.sr="https://mdfriday.com",this.ar="https://gohugo.net/mdfriday.svg",this.nr="support@mdfriday.com",this.lr="Cang long Street, Wuhan, China",this.cr="Make site generation easy and accessible for everyone."}name(){return this.u}description(){return this.ir}website(){return this.sr}organization(t){return this.hr=t,this}get Name(){return this.hr?.name||this.name()}get Description(){return this.hr?.description||this.description()}get Website(){return this.hr?.website||this.website()}get Vision(){return this.hr?.vision||this.cr}get Logo(){return this.hr?.logo||this.ar}get Address(){return this.hr?.contact?.address||this.lr}get Email(){return this.hr?.contact?.email||this.nr}get Social(){return this.hr?.social}SocialById(t){return this.hr?.social?.[t]||""}get Socials(){const t=[];if(!this.hr?.social)return t;for(const[e,n]of Object.entries(this.hr.social))n&&t.push({ID:e,Link:n});return t}},Id=class{ver;constructor(t){this.ver=t}version(){return this.ver}environment(){return"production"}};j();var Md=N("site",{component:"navigation"}),Fd=class{taxonomies;taxonomiesBuilder=null;taxonomiesCache=new Map;menus;menuBuilder=null;menuCache=new Map;constructor(t){this.taxonomies=new Map,this.menus=new Map;for(const e of t.languageKeys())this.menus.set(e,Na()),this.menuCache.set(e,!1)}setMenuBuilder(t){this.menuBuilder=t}setTaxonomiesBuilder(t){this.taxonomiesBuilder=t}async generateMenusForLanguage(t,e){if(this.menuBuilder){if(!0!==this.menuCache.get(t))try{const n=await this.menuBuilder.buildMenusForLanguage(e);this.menus.set(t,n),this.menuCache.set(t,!0)}catch(e){Md.error(`Failed to generate menus for language ${t}: ${e}`)}}else Md.error("Menu builder not set, cannot generate menus")}async generateTaxonomiesForLanguage(t,e,n){if(this.taxonomiesBuilder){if(!0!==this.taxonomiesCache.get(t))try{const r=await this.taxonomiesBuilder.buildTaxonomiesForLanguage(e,n);this.taxonomies.set(t,r),this.taxonomiesCache.set(t,!0)}catch(e){Md.error(`Failed to generate taxonomies for language ${t}: ${e}`)}}else Md.error("Taxonomies builder not set, cannot generate taxonomies")}getMenus(t){let e=this.menus.get(t);return void 0===e&&(e=Na()),e}getTaxonomies(t){return this.taxonomies.get(t)}};j();var $d=N("site",{component:"menu-builder"}),Ud=class{contentService;site;constructor(t,e){this.contentService=t,this.site=e}async buildMenusForLanguage(t){const e=new Map;return await this.contentService.walkPages(t,async t=>{await this.processPage(t,e)}),this.convertToMenus(e)}async processPage(t,e){try{const n=t.menu();if(!n)return;const r=await this.generatePageUrl(t);for(const[i,s]of Object.entries(n))await this.processMenuSection(i,s,r,t,e)}catch(t){$d.error(`Error processing page for menu: ${t}`)}}async processMenuSection(t,e,n,r,i){if(!(!1===e||Array.isArray(e)&&0===e.length))if(Array.isArray(e))await this.processMenuItems(t,e,n,r,i);else if(e&&"object"==typeof e){let s=0;for(const[a,o]of Object.entries(e))if(!(!1===o||Array.isArray(o)&&0===o.length)&&Array.isArray(o)){const e=`${t}.${a}`;if(await this.processMenuItems(e,o,n,r,i),"footer"===t){const t=`${e}::__subsection__`;i.has(t)||i.set(t,{title:a,url:"",children:new Map,weight:1e3,level:0,menuName:e,order:s})}s++}}}async processMenuItems(t,e,n,r,i){for(let s=0;s<e.length;s++){const a=e[s];if(!a||"object"!=typeof a)continue;if(!a.title||"string"!=typeof a.title)continue;let o=a.url||"";o=""===o?n:await this.processMenuItemUrl(o);const l="number"==typeof a.weight?a.weight:1e3,c=`${t}::${a.title}`;let h=i.get(c);h?l<h.weight&&(h.weight=l,h.url=o):(h={title:a.title,url:o,children:new Map,weight:l,level:0,menuName:t||void 0,order:s},i.set(c,h)),Array.isArray(a.children)&&await this.processChildrenItems(c,a.children,n,r,i,h)}}async processChildrenItems(t,e,n,r,i,s){for(let a=0;a<e.length;a++){const o=e[a];if(!o||"object"!=typeof o)continue;if(!o.title||"string"!=typeof o.title)continue;let l=o.url||"";l=""===l?n:await this.processMenuItemUrl(l);const c="number"==typeof o.weight?o.weight:1e3,h=`${t}::${o.title}`,u={title:o.title,url:l,children:new Map,weight:c,level:s.level+1,menuName:s.menuName||void 0,order:a};i.set(h,u),s.children.set(h,u),Array.isArray(o.children)&&await this.processChildrenItems(h,o.children,n,r,i,u)}}async generatePageUrl(t){try{return(await this.site.sitePage(t)).RelPermalink}catch(e){return $d.error(`Error generating page URL for ${t.path()}: ${e}`),this.fallbackUrlFromPath(t.path())}}async processMenuItemUrl(t){try{return this.site.getURL().relURL(t)}catch(e){return $d.error(`Error processing menu item URL ${t}: ${e}`),t}}fallbackUrlFromPath(t){let e=t.replace(/\.md$/,"");return e.startsWith("/")||(e="/"+e),e.endsWith("/")||e.includes(".")||(e+="/"),e}convertToMenus(t){const e=new Map;for(const[n,r]of t.entries())if(!n.includes("::__subsection__")&&0===r.level){const t=r.menuName||"main";e.has(t)||e.set(t,[]),e.get(t).push(r)}const n=this.buildMenuItems(e.get("nav")||[],t),r=[],i=new Map,s=new Map;for(const[n,r]of e.entries())if(n.startsWith("footer.")){const e=n.substring(7),a=this.buildMenuItems(r,t,!1);i.set(e,a);const o=`${n}::__subsection__`,l=t.get(o);l&&s.set(e,l.order)}const a=Array.from(i.entries()).sort((t,e)=>(s.get(t[0])||0)-(s.get(e[0])||0));for(let t=0;t<a.length;t++){const[e,n]=a[t];if(n.length>0){const i=new La({title:this.capitalizeFirstLetter(e),url:"",children:n,weight:t+1,identifier:`footer-${e}`});r.push(i)}}const o={};return n.length>0&&(o.nav=n),r.length>0&&(o.footer=r),new Ra(o)}capitalizeFirstLetter(t){return t.charAt(0).toUpperCase()+t.slice(1)}buildMenuItems(t,e,n=!0){const r=[];for(const i of t){const t=Array.from(i.children.values()),s=t.length>0?this.buildMenuItems(t,e,n):[],a=new La({title:i.title,url:i.url,children:s,weight:i.weight,identifier:i.url});r.push(a)}return n?r.sort((t,e)=>t.weight()!==e.weight()?t.weight()-e.weight():t.title().localeCompare(e.title())):r.sort((e,n)=>{const r=t.find(t=>t.title===e.title()),i=t.find(t=>t.title===n.title());return(r?.order||0)-(i?.order||0)})}};G(),j();var Bd=N("site",{component:"navigation-factory"}),qd=class{langService;contentService;site;constructor(t,e,n){this.langService=t,this.contentService=e,this.site=n}createNavigation(){try{const e=(t=this.langService,new Fd(t)),n=new Ud(this.contentService,this.site);e.setMenuBuilder(n);const r=new B(this.contentService);return e.setTaxonomiesBuilder(r),e}catch(t){throw Bd.error(`Failed to create Navigation entity: ${t}`),t}var t}};j(),N("site",{component:"factory"}),j();var jd=m(require("path")),Hd=require("crypto"),zd=require("stream"),Wd=require("stream/promises");j();var Gd=N("resources",{component:"publisher"}),Vd=class{value="";size=0;resource=null;async setup(t){if(this.value)return;this.resource=t;const e=await t.readSeekCloser(),n=(0,Hd.createHash)("sha256");let r=0;const i=[];e.on("data",t=>{n.update(t),r+=t.length,i.push(t)}),await new Promise((t,i)=>{e.on("end",()=>{this.value=n.digest("hex"),this.size=r,t()}),e.on("error",i)}),await e.close()}},Yd=class{hasPublished=!1;publishPromise=null;async do(t){if(!this.hasPublished)return this.publishPromise||(this.publishPromise=t().then(()=>{this.hasPublished=!0})),this.publishPromise}},Kd=class t{h;openReadSeekCloser;ur;paths;dr;publisher;publishOnce;constructor(t,e,n,r={},i){this.h=new Vd,this.openReadSeekCloser=t,this.ur=e,this.paths=n,this.dr=r,this.publisher=i,this.publishOnce=new Yd}name(){return this.paths.pathFile()}nameNormalized(){return this.paths.targetPath().replace(/\\/g,"/")}mediaType(){return this.ur}resourceType(){return this.ur.mainType}relPermalink(){return this.publish(),this.paths.targetLink()}permalink(){return this.publish(),this.paths.targetPath()}async publish(){const t=this.targetPath();this.publisher?await this.publishOnce.do(async()=>{let e=null,n=null;try{e=await this.publisher.openPublishFileForWriting(this.paths.targetPath()),n=await this.readSeekCloser(),await this.copyStreamToFile(n,e)}catch(e){throw Gd.errorf("❌ [Resource.publish] Error publishing %s: %s",t,e),e}finally{if(n)try{await n.close()}catch(e){Gd.errorf("❌ [Resource.publish] Failed to close ReadSeekCloser %s: %s",t,e)}if(e)try{await e.file.close()}catch(e){Gd.errorf("❌ [Resource.publish] Failed to close public writer %s: %s",t,e)}}}):Gd.error("⚠️ [Resource.publish] No publisher for: %s",t)}async copyStreamToFile(t,e){const n=this.targetPath();try{await(0,Wd.pipeline)(t,e)}catch(t){throw Gd.errorf("❌ [copyStreamToFile] Error during pipeline for %s: %s",n,t),t}}targetPath(){return this.paths.targetPath()}data(){return this.dr}async readSeekCloser(){const t=await this.openReadSeekCloser();if(t&&"function"==typeof t.read){const e=t.read();if(e){const n=new(0,require("stream").Readable);let r;for(n.push(e);null!==(r=t.read());)r&&n.push(r);return n.push(null),Object.assign(n,{seek:async(t,e)=>0,close:async()=>Promise.resolve()})}}return t}async content(t){const e=await this.readSeekCloser();return new Promise((t,n)=>{let r="";e.on("data",t=>{r+=t.toString()}),e.on("end",()=>{t(r)}),e.on("error",n)})}async hash(){return await this.h.setup(this),this.h.value}async size(){return await this.h.setup(this),this.h.size}cloneTo(t){const e=this.clone();return e.paths=e.paths.fromTargetPath(t),e}clone(){const e=new t(this.openReadSeekCloser,this.ur,this.paths,{...this.dr},this.publisher);return e.h=this.h,e}key(){return this.paths.targetLink()}get RelPermalink(){return this.relPermalink()}get Permalink(){return this.permalink()}get Name(){return this.name()}get MediaType(){return this.mediaType()}get ResourceType(){return this.resourceType()}get TargetPath(){return this.targetPath()}get Data(){return this.data()}get Content(){return this.content()}get Hash(){return()=>this.hash()}get Size(){return()=>this.size()}meta(){return new Ep(this.paths.targetPath(),this.ur.type,this.dr)}mergeData(t){if(t&&0!==Object.keys(t).length)for(const[e,n]of Object.entries(t))e in this.dr||(this.dr[e]=n)}async transform(...t){let e=this;for(let n=0;n<t.length;n++){const r=t[n];try{const t=await e.readSeekCloser(),n=new zd.PassThrough;let i="";const s=[],a={source:{from:t,inPath:e.targetPath(),inMediaType:e.mediaType()},target:{to:n},data:{...e.data()},addOutPathIdentifier:t=>{const n=e.targetPath(),r=si.parseBasic(n);let i=r.dir;i=i.replace(/\/+$/,"");let s="";i&&(s=i+"/"),s+=r.nameWithoutExt+t+r.ext,a.data.targetPath=s},updateBuffer:()=>{},updateSource:()=>{},close:()=>{t.close()}};n.on("data",t=>{s.push(t)});const o=new Promise((t,e)=>{n.on("end",()=>{i=Buffer.concat(s).toString(),t()}),n.on("error",t=>{e(t)})});await r.transform(a),await o;const l=a.data.targetPath||e.targetPath(),c=this.createTransformedResource(i,l,e.mediaType(),a.data);e=c,a.close()}catch(t){throw t}}return e}createTransformedResource(e,n,r,i){const s=this.paths.fromTargetPath(n);return new t(async()=>{const t=new zd.PassThrough;return t.end(e),Object.assign(t,{seek:async(t,e)=>0,close:async()=>Promise.resolve()})},r,s,i,this.publisher)}},Xd=require("terser"),Zd=class{minifiers=new Map;minifyOutput;constructor(t=!1){this.minifyOutput=t,this.setupMinifiers()}setupMinifiers(){this.minifiers.set("text/css",this.minifyCSS.bind(this)),this.minifiers.set("text/javascript",this.minifyJS.bind(this)),this.minifiers.set("application/javascript",this.minifyJS.bind(this)),this.minifiers.set("application/json",this.minifyJSON.bind(this)),this.minifiers.set("text/html",this.minifyHTML.bind(this)),this.minifiers.set("image/svg+xml",this.minifySVG.bind(this)),this.minifiers.set("application/xml",this.minifyXML.bind(this)),this.minifiers.set("text/xml",this.minifyXML.bind(this))}async minify(t){const e=new Jd(this);return t.transform(e)}getMinifier(t){return this.minifiers.get(t)||null}async minifyCSS(t){return t}async minifyJS(t){try{return(await(0,Xd.minify)(t,{compress:{drop_console:!1,drop_debugger:!0,passes:2},mangle:{toplevel:!1},format:{comments:!1}})).code||t}catch(e){return t}}async minifyJSON(t){try{return JSON.stringify(JSON.parse(t))}catch{return t}}async minifyHTML(t){return t}async minifySVG(t){return t}async minifyXML(t){return t}},Jd=class{constructor(t){this.minifierClient=t}key(){return vp.newResourceTransformationKey("minify")}async transform(t){t.addOutPathIdentifier(".min");const e=t.source.inMediaType.type,n=this.minifierClient.getMinifier(e);if(!n)return void t.source.from.pipe(t.target.to);let r="";t.source.from.on("data",t=>{r+=t.toString()}),await new Promise((e,i)=>{t.source.from.on("end",async()=>{try{const i=await n(r);t.target.to.write(i),t.target.to.end(),e()}catch(t){i(t)}}),t.source.from.on("error",i)})}},Qd=require("crypto"),tp=class{async fingerprint(t,e="sha256"){const n=new ep(e);return t.transform(n)}generateIntegrity(t){return`sha256-${(0,Qd.createHash)("sha256").update(t,"utf8").digest("base64")}`}generateSHA384(t){return`sha384-${(0,Qd.createHash)("sha384").update(t,"utf8").digest("base64")}`}generateSHA512(t){return`sha512-${(0,Qd.createHash)("sha512").update(t,"utf8").digest("base64")}`}verifyIntegrity(t,e){const[n,r]=e.split("-",2);let i;switch(n){case"sha256":i=(0,Qd.createHash)("sha256").update(t,"utf8").digest("base64");break;case"sha384":i=(0,Qd.createHash)("sha384").update(t,"utf8").digest("base64");break;case"sha512":i=(0,Qd.createHash)("sha512").update(t,"utf8").digest("base64");break;default:return!1}return i===r}},ep=class{constructor(t){this.algo=t}key(){return vp.newResourceTransformationKey("fingerprint",this.algo)}async transform(t){const e=this.newHash(this.algo);let n="";const r=[];t.source.from.on("data",t=>{e.update(t),r.push(t),n+=t.toString()}),await new Promise((n,i)=>{t.source.from.on("end",()=>{try{const i=e.digest(),s=i.toString("hex");t.data.Integrity=this.integrity(this.algo,i);const a=s.substring(0,12);t.addOutPathIdentifier("."+a);for(const e of r)t.target.to.write(e);t.target.to.end(),n()}catch(t){i(t)}}),t.source.from.on("error",i)})}newHash(t){switch(t){case"md5":return(0,Qd.createHash)("md5");case"sha256":return(0,Qd.createHash)("sha256");case"sha384":return(0,Qd.createHash)("sha384");case"sha512":return(0,Qd.createHash)("sha512");default:throw new Error(`Unsupported hash algorithm: "${t}", use either md5, sha256, sha384 or sha512`)}}integrity(t,e){return`${t}-${e.toString("base64")}`}},np=class{templateExecutor;pr;data;constructor(t,e,n){this.templateExecutor=t,this.pr=e,this.data=n}key(){return vp.newResourceTransformationKey("execute-as-template",this.pr)}async transform(t){try{t.data.targetPath=this.pr;let e="";if("function"==typeof t.source.from.read){let n;const r=[];for(;null!==(n=t.source.from.read());)n&&r.push(n);if(r.length>0)e=Buffer.concat(r).toString();else if(t.source.from.gr&&t.source.from.gr.buffer){const n=t.source.from.gr.buffer,r=[];for(const t of n)t&&t.chunk&&r.push(t.chunk);r.length>0&&(e=Buffer.concat(r).toString())}}if(!e)return new Promise((e,n)=>{const r=[];t.source.from.on("data",t=>{r.push(t)}),t.source.from.on("end",async()=>{try{const i=Buffer.concat(r).toString();await this.executeTemplate(i,t,e,n)}catch(e){n(new Error(`failed to parse Resource "${t.source.inPath}" as Template: ${e}`))}}),t.source.from.on("error",t=>{n(t)}),"function"==typeof t.source.from.resume&&t.source.from.resume()});await this.executeTemplateSync(e,t)}catch(e){throw new Error(`failed to parse Resource "${t.source.inPath}" as Template: ${e}`)}}async executeTemplateSync(t,e){const n=await this.templateExecutor.executeTemplate(e.source.inPath,t,this.data);e.target.to.write(n),e.target.to.end()}async executeTemplate(t,e,n,r){try{await this.executeTemplateSync(t,e),n()}catch(t){r(t instanceof Error?t:new Error(String(t)))}}},rp=class{templateExecutor;constructor(t){this.templateExecutor=t}async executeAsTemplate(t,e,n){try{if(!t)throw new Error("Resource is null or undefined");if("function"!=typeof t.transform)throw new Error("Resource does not implement Transformer interface. Resource type: "+typeof t);const r=new np(this.templateExecutor,e.replace(/\\/g,"/").replace(/^\/+/,""),n);return await t.transform(r)}catch(t){throw t}}},ip=m(require("path"));j();var sp=require("stream"),ap=N("resources",{component:"publisher"}),op=class{pubFs;urlSvc;constructor(t,e){this.pubFs=t,this.urlSvc=e}async openPublishFileForWriting(t){const e=t.replace(/^\/+/,"");try{const t=await this.pubFs.create(e);return new lp(t)}catch(t){if("ENOENT"===t.code||t.message.includes("ENOENT")){const t=ip.dirname(e);await this.pubFs.mkdirAll(t,511);const n=await this.pubFs.create(e),r=n.close.bind(n);return n.close=async()=>{try{await r()}catch(t){throw ap.errorf("❌ [Publisher.File.close] Error closing publish file (retry) %s, $s",e,t),t}},new lp(n)}throw t}}async openFilesForWriting(...t){if(0===t.length)throw new Error("No filenames provided");const e=t[0];return await this.openFileForWriting(e)}async openFileForWriting(t){const e=ip.normalize(t);try{return await this.pubFs.create(e)}catch(t){if(!this.isFileNotFoundError(t))throw t;const n=ip.dirname(e);return await this.pubFs.mkdirAll(n,511),await this.pubFs.create(e)}}isFileNotFoundError(t){return t&&("ENOENT"===t.code||t.message?.includes("no such file or directory")||t.message?.includes("not found"))}},lp=class extends sp.Writable{file;constructor(t){super(),this.file=t}mr(t,e,n){this.file.write(t).then(()=>n()).catch(n)}wr(t){this.file.sync?.().then(()=>this.file.close()).then(()=>t()).catch(t)}};j();var cp=m(require("http")),hp=m(require("https")),up=N("resources",{component:"http-client"}),fp=class{defaultTimeout=3e4;defaultHeaders={"User-Agent":"MDFriday-Resources/1.0.0"};async fromRemote(t,e){return new Promise(n=>{try{const r=new URL(t),i="https:"===r.protocol,s=i?hp:cp,a={...this.defaultHeaders,...e?.headers},o={hostname:r.hostname,port:r.port||(i?443:80),path:r.pathname+r.search,method:"GET",headers:a,timeout:e?.timeout||this.defaultTimeout},l=s.request(o,r=>{if(r.statusCode&&r.statusCode>=300&&r.statusCode<400&&r.headers.location)return up.infof("🔄 [HttpClient.fromRemote] Redirecting from %s to %s",t,r.headers.location),void this.fromRemote(r.headers.location,e).then(n);if(!r.statusCode||r.statusCode<200||r.statusCode>=300)return up.errorf("❌ [HttpClient.fromRemote] HTTP error %d when fetching %s: %s",r.statusCode||0,t,r.statusMessage||"Unknown error"),void n(null);const i=[];r.on("data",t=>{i.push(t)}),r.on("end",()=>{try{const e=Buffer.concat(i).toString("utf8");up.infof("✅ [HttpClient.fromRemote] Successfully fetched %d bytes from %s",e.length,t),n(e)}catch(e){up.errorf("❌ [HttpClient.fromRemote] Error converting response to string from %s: %s",t,e),n(null)}}),r.on("error",e=>{up.errorf("❌ [HttpClient.fromRemote] Response error when fetching %s: %s",t,e.message),n(null)})});l.on("error",e=>{up.errorf("❌ [HttpClient.fromRemote] Request error when fetching %s: %s",t,e.message),n(null)}),l.on("timeout",()=>{l.destroy(),up.errorf("❌ [HttpClient.fromRemote] Request timeout when fetching %s",t),n(null)}),l.end()}catch(e){up.errorf("❌ [HttpClient.fromRemote] Error fetching content from %s: %s",t,e),n(null)}})}},dp=m(require("path")),pp=require("crypto");j();var gp=N("resources",{component:"resources"}),mp=class{cache=new Map;workspace;fsSvc;urlSvc;templateSvc;publisher;minifierClient;integrityClient;templateClient=null;httpClient;constructor(t){this.workspace=t,this.fsSvc=t,this.urlSvc=t,this.templateSvc=t,this.publisher=new op(t.publishFs(),t),this.minifierClient=new Zd,this.integrityClient=new tp,this.templateClient=new rp(this.templateSvc),this.httpClient=new fp}setTemplateSvc(t){this.templateSvc=t,this.templateClient=new rp(t)}async getResource(t){const e=dp.posix.normalize(t),n=`${e}__get`;if(this.cache.has(n))return this.cache.get(n)||null;try{const t=this.workspace.assetsFs();if(!await t.stat(e))return null;const r=async()=>{const n=await t.open(e);return await this.createReadSeekCloser(n)},i=await this.buildResource(e,r);return i&&this.cache.set(n,i),i}catch(t){return gp.errorf("❌ [Resources.getResource] Error getting resource %s, %s",e,t),null}}async getResourceWithOpener(t,e){const n=dp.posix.normalize(t),r=`${n}__get_with_opener`;if(this.cache.has(r))return this.cache.get(r)||null;try{const t=await this.buildResource(n,e);return t&&this.cache.set(r,t),t}catch(t){return gp.errorf("❌ [Resources.getResourceWithOpener] Error getting resource with opener %s, %s",n,t),null}}async executeAsTemplate(t,e,n){if(!this.templateClient)throw new Error("Template client not available. Please set template client first.");const r=t.key()+"-template-"+e,i=this.cacheKey(r);if(this.cache.has(i))return this.cache.get(i);try{const r=await this.templateClient.executeAsTemplate(t,e,n);return r?this.cache.set(i,r):gp.warnf("⚠️ [Resources.executeAsTemplate] Template execution returned null for resource %s",t.key()),r}catch(e){throw gp.errorf("❌ [Resources.executeAsTemplate] Error executing template %s, %s",t.key(),e),e}}async minify(t){if(!this.minifierClient)throw new Error("Minifier client not available. Please set minifier client first.");const e=t.key()+"-minify",n=this.cacheKey(e);if(this.cache.has(n))return this.cache.get(n);try{const e=await this.minifierClient.minify(t);return e?this.cache.set(n,e):gp.warnf("⚠️ [Resources.minify] Minification returned null for resource %s",t.key()),e}catch(e){throw gp.errorf("❌ [Resources.minify] Error minifying resource %s, %s",t.key(),e),e}}async fingerprint(t){const e=t.key()+"-fingerprint",n=this.cacheKey(e);if(this.cache.has(n))return this.cache.get(n);try{const e=await this.integrityClient.fingerprint(t);return e?this.cache.set(n,e):gp.warnf("⚠️ [Resources.fingerprint] Fingerprint operation returned null for resource %s",t.key()),e}catch(e){throw gp.errorf("❌ [Resources.fingerprint] Error fingerprinting resource %s, %s",t.key(),e),e}}async getRemote(t){const e=`${t}__remote`;if(this.cache.has(e))return this.cache.get(e)||null;try{const n=await this.httpClient.fromRemote(t);if(!n)return null;const r=async()=>this.newReadSeekerNoOpCloserFromString(n),i=await this.buildResource(t,r);return i&&this.cache.set(e,i),i}catch(e){return gp.errorf("❌ [Resources.fromRemote] Error getting remote resource %s, %s",t,e),null}}cacheKey(t){return(0,pp.createHash)("sha256").update(t).digest("hex").substring(0,16)}getMinifierClient(){return this.minifierClient}getIntegrityClient(){return this.integrityClient}setTemplateClient(t){this.templateClient=t}async buildResource(t,e){try{const n=dp.extname(t),r=this.getMediaTypeFromExtension(n),i=yp.newResourcePaths(t,this.workspace);return new Kd(e,r,i,{},this.publisher)}catch(e){return gp.errorf("❌ [Resources.buildResource] Error building resource for %s, %s",t,e),null}}getMediaTypeFromExtension(t){const e={".js":{type:"text/javascript",mainType:"text",subType:"javascript"},".css":{type:"text/css",mainType:"text",subType:"css"},".html":{type:"text/html",mainType:"text",subType:"html"},".json":{type:"application/json",mainType:"application",subType:"json"},".svg":{type:"image/svg+xml",mainType:"image",subType:"svg+xml"},".xml":{type:"application/xml",mainType:"application",subType:"xml"},".txt":{type:"text/plain",mainType:"text",subType:"plain"}},n=t?e[t]||e[".txt"]:e[".html"],r=t?t.substring(1):"html",i=t||".html";return new Jn({type:n.type,mainType:n.mainType,subType:n.subType,delimiter:".",firstSuffix:{suffix:r,fullSuffix:i},mimeSuffix:"",suffixesCSV:r})}async createReadSeekCloser(t){try{const e=[];let n=0;try{for(;;){const r=new Uint8Array(8192),i=await t.read(r);if(0===i.bytesRead)break;n+=i.bytesRead,e.push(r.slice(0,i.bytesRead))}}finally{await t.close()}let r="";if(e.length>0){const t=new Uint8Array(n);let i=0;for(const n of e)t.set(n,i),i+=n.length;r=(new TextDecoder).decode(t)}return this.newReadSeekerNoOpCloserFromString(r)}catch(e){try{await t.close()}catch(e){gp.warnf("❌ [Resources.createReadSeekCloser] Error closing file after read error %s, %s",t.path,e)}return this.newReadSeekerNoOpCloserFromString("")}}newReadSeekerNoOpCloserFromString(t){const{Readable:e}=require("stream"),n=new e({read(){}});return n.push(t),n.push(null),Object.assign(n,{seek:async(t,e)=>0,close:async()=>Promise.resolve()})}},wp=m(require("path")),yp=class t{dir;baseDirTarget;baseDirLink;targetBasePaths;file;baseUrl="";constructor(t="",e="",n="",r="",i=[],s=""){this.dir=t,this.file=e,this.baseDirTarget=n,this.baseDirLink=r,this.targetBasePaths=i,this.baseUrl=s}static newResourcePaths(e,n){const r=e.replace(/\\/g,"/"),i=wp.posix.parse(r);let s=i.dir;return"/"===s&&(s=""),new t(s,i.base,n.baseUrl(),n.baseUrl(),[],n.baseUrl())}join(...t){let e="";for(let n=0;n<t.length;n++){const r=t[n];if(r)if(""===e)e=r;else{const t=!e.endsWith("/")&&!r.startsWith("/"),n=e.endsWith("/")&&r.startsWith("/");e+=n?r.substring(1):t?"/"+r:r}}return e.startsWith("/")&&(e=e.substring(1)),e.endsWith("/")&&e.length>1&&(e=e.substring(0,e.length-1)),e}targetLink(){let t=this.join(this.baseDirLink,this.dir,this.file);return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")||(t="/"+t),t}targetPath(){return this.join(this.dir,this.file)}fromTargetPath(e){const n=e.replace(/\\/g,"/"),r=wp.posix.parse(n);let i=r.dir;return"/"===i&&(i=""),new t(i,r.base,this.baseUrl,this.baseUrl,this.targetBasePaths,this.baseUrl)}pathDir(){return this.dir}pathBaseDirTarget(){return this.baseDirTarget}pathBaseDirLink(){return this.baseDirLink}pathTargetBasePaths(){return this.targetBasePaths}pathFile(){return this.file}},bp=require("crypto"),vp=class t{constructor(t,e=[]){this.name=t,this.elements=e}static newResourceTransformationKey(e,...n){return new t(e,n)}value(){if(0===this.elements.length)return this.name;const t=this.hashElements(...this.elements);return`${this.name}_${t}`}hashElements(...t){const e=t.map(t=>String(t)).join("|");return(0,bp.createHash)("sha256").update(e).digest("hex").substring(0,16)}},Ep=class t{constructor(t,e,n){this.target=t,this.mediaType=e,this.metaData=n}marshal(){return JSON.stringify({Target:this.target,MediaType:this.mediaType,Data:this.metaData})}static unmarshal(e){const n=JSON.parse(e);return new t(n.Target,n.MediaType,n.Data||{})}},kp=N("ssg",{component:"application"}),Sp=(t,e,n,r,i,s)=>({site:t,content:e,fs:n,config:r,modules:i,resources:s});async function Tp(t,e){const n=new Ke,r=jd.default.join(t,"config.json");return await async function(t,e,n,r,i={}){const s={workingDir:bt.resolve(n),modulesDir:bt.resolve(r),publishDir:bt.resolve(dt),cacheDir:""};s.cacheDir=await async function(t,e){if(""!==e)return e;const n=process.env.HOME||process.env.USERPROFILE||"",r=bt.join(n,".cache","mdf");try{return await t.mkdirAll(r,493),r}catch{return bt.join("/tmp","hugo-cache")}}(t,s.cacheDir);const a=new wt(function(t,e){return new yt(t,e)}(t,e),s);try{const e=await a.loadConfigByDefault();for(const[t,n]of Object.entries(i))e.set(t,n);const n=bt.resolve(e.get("publishDir")||dt);return await t.mkdirAll(n,511),function(t,e,n,r,i,s,a,o,l,c){return new X(t,e,n,r,i,s,a,o,l,c)}(t,e,function(t,e={}){const n=function(t){return{baseURL:t.baseurl||Z.baseURL,title:t.title||Z.title,theme:t.theme||Z.theme,timeout:t.timeout||Z.timeout,contentDir:t.contentDir||Z.contentDir,dataDir:t.dataDir||Z.dataDir,layoutDir:t.layoutDir||Z.layoutDir,staticDir:t.staticDir||Z.staticDir,archetypeDir:t.archetypeDir||Z.archetypeDir,assetDir:t.assetDir||Z.assetDir,publishDir:t.publishDir||Z.publishDir,buildDrafts:void 0!==t.buildDrafts?t.buildDrafts:Z.buildDrafts,buildExpired:void 0!==t.buildExpired?t.buildExpired:Z.buildExpired,buildFuture:void 0!==t.buildFuture?t.buildFuture:Z.buildFuture,copyright:t.copyright||Z.copyright,defaultContentLanguage:t.defaultContentLanguage||Z.defaultContentLanguage,defaultContentLanguageInSubdir:void 0!==t.defaultContentLanguageInSubdir?t.defaultContentLanguageInSubdir:Z.defaultContentLanguageInSubdir,disableAliases:void 0!==t.disableAliases?t.disableAliases:Z.disableAliases,disablePathToLower:void 0!==t.disablePathToLower?t.disablePathToLower:Z.disablePathToLower,disableKinds:t.disableKinds||Z.disableKinds,disableLanguages:t.disableLanguages||Z.disableLanguages,renderSegments:t.renderSegments||Z.renderSegments,disableHugoGeneratorInject:void 0!==t.disableHugoGeneratorInject?t.disableHugoGeneratorInject:Z.disableHugoGeneratorInject,disableLiveReload:void 0!==t.disableLiveReload?t.disableLiveReload:Z.disableLiveReload,enableEmoji:void 0!==t.enableEmoji?t.enableEmoji:Z.enableEmoji}}(t);return new J(n,e)}(e.get(""),e.getParams("params")),function(t,e,n){return new pt(t,e,n)}(s.workingDir,s.modulesDir,n),function(t){const e=function(t){const e={mounts:[],imports:[]};return t.mounts&&Array.isArray(t.mounts)&&(e.mounts=t.mounts.map(t=>({source:t.source||"",target:t.target||"",lang:t.lang}))),t.imports&&Array.isArray(t.imports)&&(e.imports=t.imports.map(t=>({path:t.path||"",url:t.url,version:t.version,mounts:t.mounts||[]}))),e}(t);return new Q(e)}(e.get("module")||{}),function(t){const e=function(t){const e={disqus:{...tt.disqus},googleAnalytics:{...tt.googleAnalytics},rss:{...tt.rss},x:{...tt.x}};return t&&(t.disqus&&(e.disqus.shortname=t.disqus.shortname||e.disqus.shortname),t.googleAnalytics&&(e.googleAnalytics.id=t.googleAnalytics.id||e.googleAnalytics.id),t.rss&&(e.rss.limit=void 0!==t.rss.limit?t.rss.limit:e.rss.limit)),e}(t);return new et(e)}(e.get("services")),function(t){const e=function(t){const e={userConfig:{},platformTemplates:[...lt]};if(t&&"object"==typeof t)for(const[n,r]of Object.entries(t))if(r&&"object"==typeof r){const t=r;t.link&&(e.userConfig[n]={link:t.link})}return e}(t);return new ct(e)}(e.get("social")),function(t){const e=function(t){const e={};if(!t||0===Object.keys(t).length)return e.en={...nt,title:t?.title||nt.title,params:t?.params||nt.params},e;for(const[n,r]of Object.entries(t)){const i=r,s=k.getNameByCode(n)||n;e[n]={languageCode:n,languageName:s,title:i.title||t.title||"",weight:void 0!==i.weight?i.weight:0,contentDir:i.contentDir||"content",disabled:void 0!==i.disabled&&i.disabled,params:i.params||t.params||{}}}return e}(t);return new rt(e)}(e.get("languages")),e.isSet("taxonomies")?ot(e.get("taxonomies")):ot(e.get("")),function(t){const e=function(t){const e={useInternalRenderer:ht.useInternalRenderer,plugins:{...ht.plugins}};return t&&(void 0!==t.useInternalRenderer&&(e.useInternalRenderer=Boolean(t.useInternalRenderer)),t.plugins&&(void 0!==t.plugins.wikilink&&(e.plugins.wikilink=Boolean(t.plugins.wikilink)),void 0!==t.plugins.tag&&(e.plugins.tag=Boolean(t.plugins.tag)),void 0!==t.plugins.callout&&(e.plugins.callout=Boolean(t.plugins.callout)),void 0!==t.plugins.latex&&(e.plugins.latex=Boolean(t.plugins.latex)),void 0!==t.plugins.mermaid&&(e.plugins.mermaid=Boolean(t.plugins.mermaid)))),e}(t);return new ut(e)}(e.get("markdown")))}finally{a.deleteMergeStrategies()}}(n,r,t,e)}async function xp(t,e){const n={path:t.getDir().getWorkingDir(),publish:t.getDir().getPublishDir(),osFs:t.fs()};return await async function(t,e){const n=function(t){const e=t.osFs,n=t.osFs,r=ye(t.osFs,[t.publish]);return new ae(e,n,r)}(t),r=await async function(t,e){const n=(r=t.getSource(),new He(r));var r;return await n.collect(e),n}(n,e),i=ye(t.osFs,[t.path]);return new Ae(n,r.overlayMountsPrompt,r.overlayMountsWorkflow,r.overlayMountsContent,r.overlayMountsLayouts,r.overlayMountsStatics,r.overlayMountsAssets,r.overlayMountsI18n,i)}(n,e)}async function Ap(t,e,n,r){const i={baseUrl:()=>e.getRoot().baseUrl(),markdown:()=>r,useInternalRenderer:()=>e.getMarkdown().useInternalRenderer(),isWikilinkEnabled:()=>e.getMarkdown().isWikilinkEnabled(),isTagEnabled:()=>e.getMarkdown().isTagEnabled(),isCalloutEnabled:()=>e.getMarkdown().isCalloutEnabled(),isLatexEnabled:()=>e.getMarkdown().isLatexEnabled(),isMermaidEnabled:()=>e.getMarkdown().isMermaidEnabled(),newFileMetaInfo:e=>t.newFileMetaInfo(e),newFileMetaInfoWithContent:e=>t.newFileMetaInfoWithContent(e),contentFs:()=>t.contentFs(),walkContent:(e,n,r,i)=>t.walkContent(e,n,r,i),walkI18n:(e,n,r)=>t.walkI18n(e,n,r),isLanguageValid:t=>e.getLanguage().isLanguageValid(t),getSourceLang:t=>n.getSourceLang(t),getLanguageIndex:t=>e.getLanguage().getLanguageIndex(t),getLanguageByIndex:t=>e.getLanguage().getLanguageByIndex(t),defaultLanguage:()=>e.getLanguage().defaultLanguage(),languageIndexes:()=>e.getLanguage().languageIndexes(),views:()=>e.getTaxonomy().getViews().map(t=>{const e=t.singular,n=t.plural;return{singular:()=>e||"",plural:()=>n||""}})};return async function(t){const e=new vs(function(t,e){const n=new hn({style:"github",lineNos:!1,lineNoStart:1,anchorLineNos:!1,lineAnchors:"",lineNumbersInTable:!0,noClasses:!0,codeFences:!0,guessSyntax:!1,tabWidth:4});return new or(e||!t?new Ur({extensions:{typographer:{disable:!1,leftSingleQuote:"&lsquo;",rightSingleQuote:"&rsquo;",leftDoubleQuote:"&ldquo;",rightDoubleQuote:"&rdquo;",enDash:"&ndash;",emDash:"&mdash;",ellipsis:"&hellip;",leftAngleQuote:"&laquo;",rightAngleQuote:"&raquo;",apostrophe:"&rsquo;"},footnote:!0,definitionList:!0,table:!0,strikethrough:!0,linkify:!0,linkifyProtocol:"https",taskList:!0,cjk:{enable:!1,eastAsianLineBreaks:!1,eastAsianLineBreaksStyle:"simple",escapedSpace:!1},passthrough:{enable:!1,delimiters:{inline:[],block:[]}},highlight:{style:"github",lineNos:!1,lineNoStart:1,anchorLineNos:!1,lineAnchors:"",lineNumbersInTable:!0,noClasses:!0,codeFences:!0,guessSyntax:!1,tabWidth:4},wikilink:{enable:!0,disableBrokenWikilinks:!1,markdownLinkResolution:"shortest",prettyLinks:!0},parseTags:!0,callouts:!0,latex:{enable:!0},mermaid:{enable:!0}},renderer:{unsafe:!0},parser:{autoHeadingID:!0,autoHeadingIDType:"github",wrapStandAloneImageWithinParagraph:!0,attribute:{title:!0,block:!1}},duplicateResourceFiles:!1,renderHooks:{image:{enableDefault:!0},link:{enableDefault:!0}}},void 0):t,n)}(t.markdown(),t.useInternalRenderer())),n=await async function(t){const e=new oi(t.defaultLanguage());try{await e.setupTranslateFuncs(t)}catch(t){li.warn("Failed to setup translator, continuing without i18n support:",t)}return e}(t),r=new ma(t,t,t,null,null,new ba(t.views(),t),new Sa(t),new Ts(t),new As(t),e,null),i=new gs(r);r.pageMapper=i,i.setupReverseIndex();const s=new bs(t,e,i,n);return r.contentHub=s,s}(i)}function Cp(t,e){return new mp({assetsFs:()=>e.assetsFs(),publishFs:()=>e.publishFs(),baseUrl:()=>t.getProvider().getString("baseURL")||"http://localhost",executeTemplate:async(t,e,n)=>{throw new Error("Template execution not initialized. Please call resources.setTemplateSvc() first.")}})}async function Dp(t,e,n,r){const i=function(t,e,n){const r=t.getProvider().getString("baseURL")||"http://localhost";return{relURL:t=>e.getURL().relURL(t),absURL:t=>e.getURL().absURL(t,e.isMultipleLanguage(),e.languagePrefix()),urlize:t=>e.getURL().urlize(t),translate:t=>e.translate(t),relRefFrom:async(t,e)=>[t.path||"",null],title:()=>t.getProvider().getString("title")||"My Site",baseURL:()=>r,params:()=>t.getProvider().getParams("params"),menus:()=>({}),isMultiLanguage:()=>t.getLanguage().languageKeys().length>1,version:()=>"0.1.0",environment:()=>"development",generator:()=>"AuPro Static Site Generator",defaultLanguage:()=>t.getLanguage().defaultLanguage(),languageKeys:()=>t.getLanguage().languageKeys(),Get:async function(t){try{return await n.getResource(t)}catch(e){return kp.warn(`Resource not found: ${t}`,e),Promise.resolve(null)}},GetRemote:async function(t){return await n.getRemote(t)},Minify:async function(t){return await n.minify(t)},Fingerprint:async function(t){return await n.fingerprint(t)},ExecuteAsTemplate:async function(t,e,r){return await n.executeAsTemplate(r,t,e)}}}(e,n,r),s={walk:t.walkLayouts.bind(t)};return await async function(t,e){return(new da).createWithServices(t,e)}(s,i)}async function Pp(t,e){return{async lookupLayout(e){const[n,r,i,s]=await t.findFirst(e);return s?{preparer:null,found:!1}:i&&n&&r?{preparer:{name:()=>r,execute:async t=>{const[e,r]=await n.Execute(t);if(r)throw kp.errorf("template exec error: %s",r),r;return e}},found:!0}:{preparer:null,found:!1}},async executeWithContext(t,e){if(!t)return"<html><body>Default template - no preparer</body></html>";try{return await t.execute(e)}catch(t){return kp.error(`❌ Template execution error: ${t}`),`<html><body>Template execution error: ${t}</body></html>`}}}}async function Lp(t,e,n){return function(t){const e=new Ad(t.publishFs()),n=new Pa(t.baseUrl(),!0),r=new Nd(t),i=new _d("MDFriday","support@mdfriday.com"),s=new Od,a=new Id("0.1.0"),o=new Td(t,t,t,t,t,t,e,i,s,a,n,null,r,null,t.siteTitle()),l=function(t,e,n){return new qd(t,e,n)}(t,t,o);return o.navigation=l.createNavigation(),o.ref=new Ld({home:{page:null},sitePage:async t=>{const e=await o.sitePage(t);return{relPermalink:()=>e.path?e.path():"",permalink:()=>e.path?e.path():""}}},t,"/404.html"),o}({configParams:()=>t.getProvider().getParams("params"),siteTitle:()=>t.getProvider().getString("title")||"My Site",menus:()=>({}),isGoogleAnalyticsEnabled:()=>t.getService().isGoogleAnalyticsEnabled(),googleAnalyticsID:()=>t.getService().googleAnalyticsID(),isGoogleAnalyticsRespectDoNotTrack:()=>t.getService().isGoogleAnalyticsRespectDoNotTrack(),isDisqusEnabled:()=>t.getService().isDisqusEnabled(),disqusShortname:()=>t.getService().disqusShortname(),isXRespectDoNotTrack:()=>t.getService().isXRespectDoNotTrack(),isXDisableInlineCSS:()=>t.getService().isXDisableInlineCSS(),getConfiguredSocialPlatforms:()=>t.getSocial().getConfiguredPlatforms(),getSocialLink:e=>{const n=t.getSocial().getSocialLink(e);return n?n.url:""},getSocialTitle:e=>{const n=t.getSocial().getSocialLink(e);return n?n.title:""},globalPages:async t=>await n.globalPages(t),globalRegularPages:async()=>await n.globalRegularPages(),walkPages:async(t,e)=>{await n.walkPages(t,e)},getPageSources:async t=>n.getPageSources(t),walkTaxonomies:async(t,e)=>{await n.walkTaxonomies(t,e)},searchPage:async(t,e)=>[],getPageFromPath:async(t,e)=>{try{const r=n.getPageFromPath(t,e);return r||kp.error(`⚠️ Application.getPageFromPath: content domain returned null for path: "${e}"`),r}catch(t){return kp.error("❌ Application.getPageFromPath error delegating to content domain:",t),null}},getPageFromPathSync:(t,e)=>{try{const r=n.getPageFromPath(t,e);return r||kp.warn(`⚠️ Application.getPageFromPathSync: content domain returned null for path: ${e}`),r}catch(t){return kp.error("❌ Application.getPageFromPathSync error delegating to content domain:",t),null}},getPageRef:async(t,e,n)=>null,translate:(t,e)=>n.translate(t,e),defaultLanguage:()=>t.getLanguage().defaultLanguage(),languageKeys:()=>t.getLanguage().languageKeys(),getLanguageIndex:e=>t.getLanguage().getLanguageIndex(e),getLanguageName:e=>t.getLanguage().getLanguageName(e),changeFreq:()=>"weekly",priority:()=>.5,generateSitemap:async()=>({urls:[]}),publishFs:()=>e.publishFs(),staticFs:()=>e.staticFs(),copyStaticFiles:(t,n)=>e.copyStatic([t],n),workingDir:()=>t.getProvider().getString("workingDir")||process.cwd(),getResource:async t=>null,getResourceWithOpener:async(t,e)=>({name:()=>t,readSeekCloser:e,targetPath:()=>t}),baseUrl:()=>t.getProvider().getString("baseURL")||"http://localhost"})}async function Rp(t,e,n){try{const r=process.cwd();process.chdir(t);try{await async function(t,e,n){try{const r=await Tp(t,e),i=n,s=await async function(t){const e={osFs:()=>t.fs(),projDir:()=>t.getDir().getWorkingDir(),moduleDir:()=>t.getDir().getThemesDir(),moduleCacheDir:()=>t.getDir().getThemesCacheDir(),importPaths:()=>t.getModule().importPaths(),defaultLanguageKey:()=>t.getLanguage().defaultLanguage(),otherLanguageKeys:()=>t.getLanguage().otherLanguageKeys(),getRelDir:(e,n)=>t.getLanguage().getRelDir(e,n)};return await async function(t){try{const e=t.httpClient?.(),n=Lt(t.osFs(),void 0,void 0,e),r=Mt(t.osFs()),i=Bt(t.osFs(),t.moduleCacheDir()),s=Jt(t,n,r,i);return await s.load(),s}catch(t){const e=t instanceof Error?t.message:String(t);throw Qt.error(`Failed to create modules: ${e}`),new kt(`Failed to create modules: ${e}`,"FACTORY_FAILED")}}(e)}(r),a=await xp(r,s),o=await Ap(a,r,s,i),l=await Lp(r,a,o),c=Cp(r,a),h=await Dp(a,r,l,c);c.setTemplateSvc({executeTemplate:async(t,e,n)=>await h.executeRaw(t,e,n)}),o.setTemplateSvc({execute:async(t,e)=>await h.executeShortcode(t,e)}),await o.collectPages();const u=await Pp(h);await l.build(u)}catch(t){const e=t instanceof Error?t.message:String(t);throw kp.error(`❌ Static site generation failed: ${e}`),new Error(`Failed to generate static site: ${e}`)}}(t,e,n)}finally{process.chdir(r)}}catch(t){const e=t instanceof Error?t.message:String(t);throw kp.error(`❌ SSG processing failed: ${e}`),new Error(`Failed to process SSG: ${e}`)}}async function Np(t,e,n,r,i){try{r?.({stage:"config",message:"Loading configuration...",percentage:5});const s=await Tp(t,e),a=n;r?.({stage:"modules",message:"Creating and downloading modules...",percentage:10});const o=await async function(t,e,n){const r={osFs:()=>t.fs(),projDir:()=>t.getDir().getWorkingDir(),moduleDir:()=>t.getDir().getThemesDir(),moduleCacheDir:()=>t.getDir().getThemesCacheDir(),importPaths:()=>t.getModule().importPaths(),defaultLanguageKey:()=>t.getLanguage().defaultLanguage(),otherLanguageKeys:()=>t.getLanguage().otherLanguageKeys(),getRelDir:(e,n)=>t.getLanguage().getRelDir(e,n),httpClient:n?()=>n:void 0};return await async function(t,e){const n=e?t=>{e({stage:"modules",message:`Downloading module: ${t.modulePath}`,percentage:10+Math.floor(.2*t.downloadPercentage),moduleDownload:{modulePath:t.modulePath,downloadPercentage:t.downloadPercentage}})}:void 0;return await async function(t,e){try{const n=t.httpClient?.(),r=Lt(t.osFs(),void 0,void 0,n),i=Mt(t.osFs()),s=Bt(t.osFs(),t.moduleCacheDir()),a=Jt(t,r,i,s);return await a.load(e),a}catch(t){const e=t instanceof Error?t.message:String(t);throw Qt.error(`Failed to create modules: ${e}`),new kt(`Failed to create modules: ${e}`,"FACTORY_FAILED")}}(t,n)}(r,e)}(s,r,i);r?.({stage:"filesystem",message:"Creating filesystem...",percentage:30});const l=await xp(s,o);r?.({stage:"content",message:"Creating content engine...",percentage:40});const c=await Ap(l,s,o,a);r?.({stage:"site",message:"Creating site...",percentage:50});const h=await Lp(s,l,c),u=Cp(s,l);r?.({stage:"template",message:"Creating template engine...",percentage:60});const f=await Dp(l,s,h,u);u.setTemplateSvc({executeTemplate:async(t,e,n)=>await f.executeRaw(t,e,n)}),c.setTemplateSvc({execute:async(t,e)=>await f.executeShortcode(t,e)}),r?.({stage:"pages",message:"Collecting pages...",percentage:65}),await c.collectPages(),r?.({stage:"build",message:"Building site...",percentage:70});const d=await Pp(f);return await async function(t,e,n){const r=n?t=>{const e=70+Math.floor(t.currentPage/t.totalPages*29);n({stage:"build",message:`Rendering pages (${t.currentPage}/${t.totalPages})...`,percentage:e,pageRender:t})}:void 0;await t.buildWithProgress(e,r)}(h,d,r),r?.({stage:"completion",message:"SSG generation completed",percentage:100}),Sp(h,c,l,s,o,u)}catch(t){const e=t instanceof Error?t.message:String(t);throw kp.error(`❌ Static site generation failed: ${e}`),new Error(`Failed to generate static site: ${e}`)}}async function _p(t,e,n,r,i){try{const s=process.cwd();process.chdir(t);try{await Np(t,e,n,r,i)}finally{process.chdir(s)}}catch(t){const e=t instanceof Error?t.message:String(t);throw kp.error(`❌ SSG processing failed: ${e}`),new Error(`Failed to process SSG: ${e}`)}}j();var Op=m(require("chokidar")),Ip=m(require("path"));j();var Mp=N("web",{component:"content-file-watcher"}),Fp=class{constructor(t){this.config=t,this.batchDelay=t.batchDelay||500}watcher=null;eventQueue=[];batchTimer=null;batchDelay;callbacks=[];async startWatching(){this.watcher&&await this.stopWatching(),this.watcher=Op.watch(this.config.contentDirs,{ignored:[/(^|[\/\\])\../,/\.tmp$/,/\.swp$/,/~$/,/\.DS_Store$/,...this.config.ignorePatterns||[]],persistent:!0,ignoreInitial:!0,followSymlinks:!0,awaitWriteFinish:{stabilityThreshold:100,pollInterval:50}}),this.watcher.on("add",t=>this.queueEvent(t,"created")).on("change",t=>this.queueEvent(t,"modified")).on("unlink",t=>this.queueEvent(t,"deleted")).on("error",t=>{Mp.error("File watcher error:",t)})}onFileChange(t){this.callbacks.push(t)}queueEvent(t,e){let n=t;const{projContentDirs:r,contentDirs:i}=this.config;for(let t=0;t<r.length;t++){const e=r[t];for(let t=0;t<i.length;t++){const r=i[t];if(e!==r&&n.startsWith(r)){n=e+n.slice(r.length);break}}}const s=Ip.normalize(n);if(!this.isRelevantFile(s))return;const a={filePath:s,eventType:e,timestamp:Date.now(),isMarkdown:this.isMarkdownFile(s),isImage:this.isImageFile(s)};this.eventQueue.push(a),this.scheduleBatch()}isRelevantFile(t){return this.isMarkdownFile(t)||this.isImageFile(t)}isMarkdownFile(t){const e=Ip.extname(t).toLowerCase();return".md"===e||".markdown"===e}isImageFile(t){const e=Ip.extname(t).toLowerCase();return[".jpg",".jpeg",".png",".gif",".svg",".webp",".bmp"].includes(e)}scheduleBatch(){this.batchTimer&&clearTimeout(this.batchTimer),this.batchTimer=setTimeout(async()=>{if(this.eventQueue.length>0){const t=this.deduplicateEvents(this.eventQueue);this.eventQueue=[];for(const e of this.callbacks)try{await e(t)}catch(t){Mp.error("Error processing file change events:",t)}}},this.batchDelay)}deduplicateEvents(t){const e=new Map;for(const n of t){const t=e.get(n.filePath);(!t||n.timestamp>t.timestamp)&&e.set(n.filePath,n)}return Array.from(e.values())}async stopWatching(){this.batchTimer&&(clearTimeout(this.batchTimer),this.batchTimer=null),this.watcher&&(await this.watcher.close(),this.watcher=null),this.eventQueue=[],this.callbacks=[]}},$p=m(require("http")),Up=m(require("path")),Bp=m(require("fs/promises")),qp=require("ws");j();var jp=N("web",{component:"livereload-server"}),Hp=class{httpServer=null;wsServer=null;clients=new Set;running=!1;config;constructor(t){this.config={port:t.port||8091,host:t.host||"localhost",livereloadPort:t.livereloadPort||35729,enableLiveReload:!1!==t.enableLiveReload,publicDir:t.publicDir}}async start(){if(this.running)jp.warn("LiveReloadServer already running");else try{await this.startHttpServer(),this.config.enableLiveReload&&await this.startLiveReloadServer(),this.running=!0}catch(t){throw jp.error("Failed to start LiveReloadServer:",t),t}}async stop(){if(this.running)try{for(const t of this.clients)t.close();this.clients.clear(),this.wsServer&&(this.wsServer.close(),this.wsServer=null),this.httpServer&&(await new Promise(t=>{this.httpServer.close(()=>t())}),this.httpServer=null),this.running=!1}catch(t){jp.error("Error stopping LiveReloadServer:",t)}}notifyReload(t){if(!this.config.enableLiveReload||0===this.clients.size)return;const e={command:"reload",liveCSS:this.shouldLiveReloadCSS(t),liveImg:this.shouldLiveReloadImages(t)};if(t&&1===t.length){const n=t[0],r=Up.extname(n).toLowerCase();".css"===r?(e.path=n,e.liveCSS=!0):[".jpg",".jpeg",".png",".gif",".svg",".webp"].includes(r)&&(e.path=n,e.liveImg=!0)}const n=JSON.stringify(e);for(const t of this.clients)t.readyState===qp.WebSocket.OPEN&&t.send(n)}getUrl(){return`http://${this.config.host}:${this.config.port}`}isServerRunning(){return this.running}async startHttpServer(){this.httpServer=$p.createServer(async(t,e)=>{try{await this.handleHttpRequest(t,e)}catch(t){jp.error("HTTP request error:",t),e.statusCode=500,e.end("Internal Server Error")}}),await new Promise((t,e)=>{this.httpServer.listen(this.config.port,this.config.host,()=>{t()}),this.httpServer.on("error",t=>{"EADDRINUSE"===t.code?(this.config.port++,this.config.port<8099?this.httpServer.listen(this.config.port,this.config.host):e(new Error("No available ports"))):e(t)})})}async startLiveReloadServer(){this.wsServer=new qp.WebSocketServer({port:this.config.livereloadPort,host:this.config.host}),this.wsServer.on("connection",t=>{this.clients.add(t),t.send(JSON.stringify({command:"hello",protocols:["http://livereload.com/protocols/official-7"],serverName:"foundry-livereload"})),t.on("close",()=>{this.clients.delete(t)}),t.on("message",t=>{try{JSON.parse(t.toString())}catch(e){jp.error("Invalid LiveReload message:",t.toString())}})}),this.wsServer.on("error",t=>{jp.error("LiveReload WebSocket server error:",t)})}async handleHttpRequest(t,e){const n=t.url||"/";let r=this.resolveFilePath(n);try{if((await Bp.stat(r)).isDirectory()){const t=Up.join(r,"index.html");try{await Bp.stat(t),r=t}catch{return e.statusCode=404,void e.end("Not Found")}}let t=await Bp.readFile(r);const n=this.getContentType(r);if(e.setHeader("Content-Type",n),n.includes("text/html")&&this.config.enableLiveReload){const e=t.toString(),n=this.getLiveReloadScript(),r=e.replace(/<\/body>/i,`${n}\n</body>`);t=Buffer.from(r,"utf8")}e.setHeader("Cache-Control","no-cache, no-store, must-revalidate"),e.setHeader("Pragma","no-cache"),e.setHeader("Expires","0"),e.statusCode=200,e.end(t)}catch(t){if("ENOENT"!==t.code)throw t;e.statusCode=404,e.end("Not Found")}}resolveFilePath(t){const e=t.split("?")[0].split("#")[0];let n;try{n=decodeURIComponent(e)}catch(t){jp.warn("Failed to decode URL:",e,t),n=e}const r=Up.normalize(n).replace(/^(\.\.[\/\\])+/,""),i=r.startsWith("/")?r.slice(1):r,s=Up.join(this.config.publicDir,i);return"win32"===process.platform&&s.length>260&&jp.warn("Path too long for Windows filesystem:",s),"win32"===process.platform&&/[<>:"|?*\x00-\x1f]/.test(i)&&jp.warn("Path contains invalid characters for Windows:",i),s}getContentType(t){return{".html":"text/html; charset=utf-8",".css":"text/css; charset=utf-8",".js":"application/javascript; charset=utf-8",".json":"application/json; charset=utf-8",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".webp":"image/webp",".ico":"image/x-icon",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".eot":"application/vnd.ms-fontobject",".xml":"application/xml; charset=utf-8",".txt":"text/plain; charset=utf-8"}[Up.extname(t).toLowerCase()]||"application/octet-stream"}getLiveReloadScript(){return`\n<script>\n(function() {\n 'use strict';\n \n var protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';\n var address = protocol + '//${this.config.host}:${this.config.livereloadPort}/livereload';\n var socket = new WebSocket(address);\n \n socket.onmessage = function(event) {\n var data = JSON.parse(event.data);\n \n if (data.command === 'reload') {\n if (data.liveCSS) {\n // 热更新 CSS\n reloadCSS();\n } else if (data.liveImg) {\n // 热更新图片\n reloadImages();\n } else {\n // 完整页面刷新\n window.location.reload();\n }\n }\n };\n \n socket.onopen = function() {\n console.log('LiveReload connected');\n };\n \n socket.onclose = function() {\n console.log('LiveReload disconnected');\n // 尝试重连\n setTimeout(function() {\n window.location.reload();\n }, 1000);\n };\n \n function reloadCSS() {\n var links = document.querySelectorAll('link[rel="stylesheet"]');\n for (var i = 0; i < links.length; i++) {\n var link = links[i];\n var href = link.href;\n if (href) {\n var url = new URL(href);\n url.searchParams.set('_t', Date.now().toString());\n link.href = url.toString();\n }\n }\n console.log('CSS reloaded');\n }\n \n function reloadImages() {\n var images = document.querySelectorAll('img');\n for (var i = 0; i < images.length; i++) {\n var img = images[i];\n var src = img.src;\n if (src) {\n var url = new URL(src);\n url.searchParams.set('_t', Date.now().toString());\n img.src = url.toString();\n }\n }\n console.log('Images reloaded');\n }\n})();\n<\/script>`}shouldLiveReloadCSS(t){return!!t&&t.some(t=>".css"===Up.extname(t).toLowerCase())}shouldLiveReloadImages(t){if(!t)return!1;const e=[".jpg",".jpeg",".png",".gif",".svg",".webp"];return t.some(t=>e.includes(Up.extname(t).toLowerCase()))}},zp=m(require("http")),Wp=m(require("path")),Gp=m(require("fs/promises"));j();var Vp=N("web",{component:"electron-livereload-server"}),Yp=class{httpServer=null;running=!1;config;stateFilePath;constructor(t){this.config={port:t.port||8091,host:t.host||"localhost",livereloadPort:t.livereloadPort||35729,enableLiveReload:!1!==t.enableLiveReload,publicDir:t.publicDir},this.stateFilePath=Wp.join(this.config.publicDir,".foundry-livereload-state.json")}async start(){if(this.running)Vp.warn("ElectronLiveReloadServer already running");else try{await this.startHttpServer(),this.config.enableLiveReload&&await this.initStateFile(),this.running=!0,Vp.info(`ElectronLiveReloadServer started at ${this.getUrl()}`)}catch(t){throw Vp.error("Failed to start ElectronLiveReloadServer:",t),t}}async stop(){if(this.running)try{this.httpServer&&(await new Promise(t=>{this.httpServer.close(()=>t())}),this.httpServer=null);try{await Gp.unlink(this.stateFilePath)}catch(t){}this.running=!1,Vp.info("ElectronLiveReloadServer stopped")}catch(t){Vp.error("Error stopping ElectronLiveReloadServer:",t)}}notifyReload(t){if(!this.config.enableLiveReload)return;const e={timestamp:Date.now(),command:"reload",liveCSS:this.shouldLiveReloadCSS(t),liveImg:this.shouldLiveReloadImages(t),...t&&{changedFiles:t}};if(t&&1===t.length){const n=t[0],r=Wp.extname(n).toLowerCase();(".css"===r||[".jpg",".jpeg",".png",".gif",".svg",".webp"].includes(r))&&(e.path=n)}this.writeStateFile(e).catch(t=>{Vp.error("Failed to write state file:",t)})}getUrl(){return`http://${this.config.host}:${this.config.port}`}isServerRunning(){return this.running}async initStateFile(){const t={timestamp:Date.now(),command:"hello"};await this.writeStateFile(t)}async writeStateFile(t){try{await Gp.writeFile(this.stateFilePath,JSON.stringify(t),"utf8")}catch(t){Vp.error("Failed to write LiveReload state file:",t)}}async startHttpServer(){this.httpServer=zp.createServer(async(t,e)=>{try{await this.handleHttpRequest(t,e)}catch(t){Vp.error("HTTP request error:",t),e.statusCode=500,e.end("Internal Server Error")}}),await new Promise((t,e)=>{this.httpServer.listen(this.config.port,this.config.host,()=>{t()}),this.httpServer.on("error",t=>{"EADDRINUSE"===t.code?(this.config.port++,this.config.port<8099?this.httpServer.listen(this.config.port,this.config.host):e(new Error("No available ports"))):e(t)})})}async handleHttpRequest(t,e){const n=t.url||"/";if(n.startsWith("/.foundry-livereload-state.json"))try{const t=await Gp.readFile(this.stateFilePath,"utf8");return e.setHeader("Content-Type","application/json; charset=utf-8"),e.setHeader("Cache-Control","no-cache, no-store, must-revalidate"),e.setHeader("Pragma","no-cache"),e.setHeader("Expires","0"),e.statusCode=200,void e.end(t)}catch(t){return void("ENOENT"===t.code?(e.statusCode=404,e.end("State file not found")):(e.statusCode=500,e.end("Internal Server Error")))}let r=this.resolveFilePath(n);try{if((await Gp.stat(r)).isDirectory()){const t=Wp.join(r,"index.html");try{await Gp.stat(t),r=t}catch{return e.statusCode=404,void e.end("Not Found")}}let t=await Gp.readFile(r);const n=this.getContentType(r);if(e.setHeader("Content-Type",n),n.includes("text/html")&&this.config.enableLiveReload){const e=t.toString(),n=this.getLiveReloadScript(),r=e.replace(/<\/body>/i,`${n}\n</body>`);t=Buffer.from(r,"utf8")}e.setHeader("Cache-Control","no-cache, no-store, must-revalidate"),e.setHeader("Pragma","no-cache"),e.setHeader("Expires","0"),e.statusCode=200,e.end(t)}catch(t){if("ENOENT"!==t.code)throw t;e.statusCode=404,e.end("Not Found")}}resolveFilePath(t){const e=t.split("?")[0].split("#")[0];let n;try{n=decodeURIComponent(e)}catch(t){Vp.warn("Failed to decode URL:",e,t),n=e}const r=Wp.normalize(n).replace(/^(\.\.[\/\\])+/,""),i=r.startsWith("/")?r.slice(1):r;return Wp.join(this.config.publicDir,i)}getContentType(t){return{".html":"text/html; charset=utf-8",".css":"text/css; charset=utf-8",".js":"application/javascript; charset=utf-8",".json":"application/json; charset=utf-8",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".webp":"image/webp",".ico":"image/x-icon",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".eot":"application/vnd.ms-fontobject",".xml":"application/xml; charset=utf-8",".txt":"text/plain; charset=utf-8"}[Wp.extname(t).toLowerCase()]||"application/octet-stream"}getLiveReloadScript(){return"\n<script>\n(function() {\n 'use strict';\n \n var stateFilePath = '/.foundry-livereload-state.json';\n var storageKey = 'foundry-livereload-last-timestamp';\n var lastTimestamp = 0;\n var pollInterval = 500; // 500ms 轮询间隔\n \n // 从 localStorage 恢复上次的时间戳,避免页面刷新后重复触发\n try {\n var stored = localStorage.getItem(storageKey);\n if (stored) {\n lastTimestamp = parseInt(stored, 10) || 0;\n }\n } catch (error) {\n // localStorage 可能不可用,使用默认值\n console.warn('LiveReload: localStorage not available, may cause duplicate reloads');\n }\n \n function checkForReload() {\n fetch(stateFilePath + '?_t=' + Date.now(), { cache: 'no-cache' })\n .then(function(response) {\n if (!response.ok) {\n throw new Error('Failed to fetch state file');\n }\n return response.json();\n })\n .then(function(state) {\n if (state.timestamp > lastTimestamp) {\n // 更新时间戳并保存到 localStorage\n lastTimestamp = state.timestamp;\n try {\n localStorage.setItem(storageKey, lastTimestamp.toString());\n } catch (error) {\n // localStorage 写入失败,忽略\n }\n \n if (state.command === 'reload') {\n if (state.liveCSS) {\n // 热更新 CSS\n reloadCSS();\n } else if (state.liveImg) {\n // 热更新图片\n reloadImages();\n } else {\n // 完整页面刷新\n window.location.reload();\n }\n }\n }\n })\n .catch(function(error) {\n // 静默处理错误,避免控制台噪音\n });\n }\n \n function reloadCSS() {\n var links = document.querySelectorAll('link[rel=\"stylesheet\"]');\n for (var i = 0; i < links.length; i++) {\n var link = links[i];\n var href = link.href;\n if (href) {\n var url = new URL(href);\n url.searchParams.set('_t', Date.now().toString());\n link.href = url.toString();\n }\n }\n console.log('CSS reloaded');\n }\n \n function reloadImages() {\n var images = document.querySelectorAll('img');\n for (var i = 0; i < images.length; i++) {\n var img = images[i];\n var src = img.src;\n if (src) {\n var url = new URL(src);\n url.searchParams.set('_t', Date.now().toString());\n img.src = url.toString();\n }\n }\n console.log('Images reloaded');\n }\n \n // 开始轮询\n setInterval(checkForReload, pollInterval);\n \n // 初始检查\n checkForReload();\n})();\n<\/script>"}shouldLiveReloadCSS(t){return!!t&&t.some(t=>".css"===Wp.extname(t).toLowerCase())}shouldLiveReloadImages(t){if(!t)return!1;const e=[".jpg",".jpeg",".png",".gif",".svg",".webp"];return t.some(t=>e.includes(Wp.extname(t).toLowerCase()))}},Kp=N("build",{component:"incremental-coordinator"}),Xp=class{constructor(t){if(this.config=t,t.enableWatching){const e={contentDirs:t.contentDirs,projContentDirs:t.projContentDirs||t.contentDirs,batchDelay:t.batchDelay||500};this.fileWatcher=new Fp(e),this.fileWatcher.onFileChange(t=>this.handleFileChanges(t))}if(!1!==t.liveReload?.enabled){const e={port:t.liveReload?.port||8091,host:t.liveReload?.host||"localhost",livereloadPort:t.liveReload?.livereloadPort||35729,publicDir:t.publicDir,enableLiveReload:!0};this.liveReloadServer=function(t){return function(){if("undefined"!=typeof globalThis&&globalThis.window&&globalThis.window.process&&globalThis.window.process.type)return!0;try{return require("electron"),!0}catch{}return!!(process.env.ELECTRON_RUN_AS_NODE||process.env.ELECTRON_NO_ATTACH_CONSOLE||process.versions&&process.versions.electron)}()?new Yp(t):new Hp(t)}(e)}}fileWatcher;liveReloadServer;buildInProgress=!1;initialized=!1;domainInstances;async initialize(){this.initialized?Kp.warn("IncrementalBuildCoordinator already initialized"):(await this.performFullBuildAndCacheDomains(),this.initialized=!0)}async performFullBuildAndCacheDomains(){try{this.domainInstances=await async function(t,e,n,r,i){try{return process.chdir(t),await Np(t,e,n,r,i)}catch(t){const e=t instanceof Error?t.message:String(t);throw kp.error(`❌ SSG processing failed: ${e}`),new Error(`Failed to process SSG: ${e}`)}}(this.config.projDir,this.config.modulesDir,this.config.markdown,this.config.progressCallback,this.config.httpClient)}catch(t){throw Kp.error("Failed to perform full build and cache domains:",t),t}}async startWatching(){if(!this.initialized)throw new Error("Must call initialize() before startWatching()");this.config.enableWatching&&this.fileWatcher&&await this.fileWatcher.startWatching(),this.liveReloadServer&&await this.liveReloadServer.start()}async stopWatching(){this.fileWatcher&&await this.fileWatcher.stopWatching(),this.liveReloadServer&&await this.liveReloadServer.stop()}async handleFileChanges(t){if(this.buildInProgress)setTimeout(()=>this.handleFileChanges(t),1e3);else try{if(this.buildInProgress=!0,this.needFullRebuild(t))return void await this.performFullRebuild(t);await this.performIncrementalBuild(t)}finally{this.buildInProgress=!1}}needFullRebuild(t){return t.some(t=>"deleted"===t.eventType||"created"===t.eventType)}async performIncrementalBuild(t){if(!this.domainInstances)return Kp.error("Domain instances not available, falling back to full rebuild"),void await this.performFullRebuild(t);try{const e=await this.domainInstances.fs.getFileMetaInfos(this.getEventsFilePaths(t));if(await this.domainInstances.content.handleChangeFiles(e),await this.domainInstances.site.renderAllLanguages(),this.liveReloadServer){const e=t.map(t=>t.filePath);this.liveReloadServer.notifyReload(e)}}catch(e){Kp.error("Incremental build failed, falling back to full rebuild:",e),await this.performFullRebuild(t)}}getEventsFilePaths(t){return t.map(t=>t.filePath)}async performFullRebuild(t){if(await _p(this.config.projDir,this.config.modulesDir,this.config.markdown,t=>{Kp.info(`Rebuild progress: ${t.stage} - ${t.percentage}%`)},this.config.httpClient),this.liveReloadServer){const e=t.map(t=>t.filePath);this.liveReloadServer.notifyReload(e)}}isInitialized(){return this.initialized}isBuildInProgress(){return this.buildInProgress}getConfig(){return{...this.config}}getServerUrl(){return this.liveReloadServer?this.liveReloadServer.getUrl():""}getLiveReloadStatus(){if(!this.liveReloadServer)return{running:!1};const t=this.liveReloadServer.isServerRunning();return{running:t,...t&&{url:this.liveReloadServer.getUrl()}}}};async function Zp(t){const e=new Xp(t);return await e.initialize(),t.enableWatching&&await e.startWatching(),e}j(),N("build",{component:"incremental-ssg"});