@qaecy/cue-ui 0.0.27 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/112.js +1 -1
- package/360.js +1 -0
- package/368.js +1 -0
- package/376.js +1 -1
- package/393.js +1 -1
- package/418.js +1 -1
- package/446.js +1 -0
- package/499.js +1 -0
- package/571.js +1 -1
- package/611.js +1 -0
- package/{873.js → 629.js} +1 -1
- package/773.js +1 -0
- package/919.js +1 -0
- package/964.js +1 -0
- package/common.js +1 -1
- package/index.js +1 -1
- package/main.js +1 -1
- package/package.json +1 -1
- package/104.js +0 -1
- package/382.js +0 -1
- package/540.js +0 -1
- package/60.js +0 -1
- package/960.js +0 -1
package/376.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[376],{4376(Nn,rt,k){k.d(rt,{MarkdownViewer:()=>Pn});var Ie=k(467),f=k(5802),$=k(7705),S=k(5547),Te=k(4226),Ee=k(2771),se=k(7673),st=k(4572),ot=k(1397),it=k(8141),at=k(9437);const Ce=(0,k(1853).L)(o=>function(){o(this),this.name="EmptyError",this.message="no elements in sequence"});var ct=k(5964),pt=k(6697),Re=k(9974),Oe=k(4360);function ht(o=dt){return(0,Re.N)((r,e)=>{let t=!1;r.subscribe((0,Oe._)(e,n=>{t=!0,e.next(n)},()=>t?e.complete():e.error(o())))})}function dt(){return new Ce}var gt=k(3669);function Be(o,r){const e=arguments.length>=2;return t=>t.pipe(o?(0,ct.p)((n,s)=>o(n,s,t)):gt.D,(0,pt.s)(1),e?function ut(o){return(0,Re.N)((r,e)=>{let t=!1;r.subscribe((0,Oe._)(e,n=>{t=!0,e.next(n)},()=>{t||e.next(o),e.complete()}))})}(r):ht(()=>new Ce))}var ft=k(6354),G=k(177),mt=k(345);const Pe=new f.nKC("All of the settings registered in the whole app."),oe=new f.nKC("The settings collected from all ancestor injectors"),Ne=new f.nKC("The settings for the currently loaded module."),F="__ngx_dynamic_hooks_content",ie="dynamic-component-anchor",I="__ngx_dynamic_hooks_anchor_id",C="__ngx_dynamic_hooks_anchor_parsetoken",kt=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];var ae=function(o){return o[o.All=0]="All",o[o.Linear=1]="Linear",o[o.None=2]="None",o}(ae||{});const b={},$e="[a-zA-Z_$]+[a-zA-Z0-9_$]*",le="[a-zA-Z$\\-_:][a-zA-Z$\\-_:0-9\\.]*";function T(o,r){if(!r.global)throw Error("TypeError: matchAll called with a non-global RegExp argument");const e=[];let t=r.exec(o);for(;null!==t;)e.push(t),t=r.exec(o);return r.lastIndex=0,e}function ce(o){return void 0!==o?.__ngContext__}b.attributeNameNoBracketsRegex="("+le+")",b.attributeNameBracketsRegex="\\[("+le+")\\]",b.attributeNameRoundBracketsRegex="\\(("+le+")\\)",b.attributeNameRegex="(?:"+b.attributeNameNoBracketsRegex+"|"+b.attributeNameBracketsRegex+"|"+b.attributeNameRoundBracketsRegex+")",b.attributeValueDoubleQuotesRegex='"((?:\\\\.|[^"])*?)"',b.attributeValueSingleQuotesRegex="'((?:\\\\.|[^'])*?)'",b.variablePathDotNotation="\\."+$e,b.variableBracketsNotation="\\[[^\\]]*\\]",b.variablePathFunctionCall="\\([^\\)]*\\)",b.variablePathPartRegex="(?:"+b.variablePathDotNotation+"|"+b.variableBracketsNotation+"|"+b.variablePathFunctionCall+")",b.contextVariableRegex="context"+b.variablePathPartRegex+"*",b.placeholderVariablePathDotNotation="\\@@@cxtDot@@@"+$e,b.placeholderVariableBracketsNotation="@@@cxtOpenSquareBracket@@@[^\\]]*@@@cxtCloseSquareBracket@@@",b.placeholderVariablePathFunctionCall="@@@cxtOpenRoundBracket@@@[^\\)]*@@@cxtCloseRoundBracket@@@",b.placeholderVariablePathPartRegex="(?:"+b.placeholderVariablePathDotNotation+"|"+b.placeholderVariableBracketsNotation+"|"+b.placeholderVariablePathFunctionCall+")",b.placeholderContextVariableRegex="__CXT__"+b.placeholderVariablePathPartRegex+"*";class wt{constructor(r,e,t,n){this.configResolver=e,this.tagHookFinder=t,this.bindingsValueManager=n,this.savedBindings={},this.config=this.configResolver.processConfig(r),this.name=this.config.name}findHooks(r,e,t){let n=this.config.enclosing?this.tagHookFinder.findEnclosingTags(r,this.config.selector,this.config.bracketStyle,t):this.tagHookFinder.findSingleTags(r,this.config.selector,this.config.bracketStyle,t);return this.config.allowSelfClosing&&(n=[...n,...this.tagHookFinder.findSelfClosingTags(r,this.config.selector,this.config.bracketStyle,t)],n.sort((s,i)=>s.openingTagStartIndex-i.openingTagStartIndex)),n}loadComponent(r,e,t,n,s){return{component:this.config.component,hostElementTag:this.config.hostElementTag||this.config.selector,injector:this.config.injector,environmentInjector:this.config.environmentInjector}}getBindings(r,e,t,n){let s=this.savedBindings[r];return void 0===s&&(s=this.createBindings(e.openingTag),this.savedBindings[r]=s),this.bindingsValueManager.checkInputBindings(s.inputs,t,this.config,n),this.bindingsValueManager.checkOutputBindings(s.outputs,this.config,n),{inputs:this.getValuesFromSavedBindings(s.inputs),outputs:this.getValuesFromSavedBindings(s.outputs)}}createBindings(r){const e=this.collectRawInputs(r),t={};for(const[i,a]of Object.entries(e))t[i]={raw:a,parsed:!1,value:null,boundContextVariables:{}};const n=this.collectRawOutputs(r),s={};for(const[i,a]of Object.entries(n))s[i]={raw:a,parsed:!1,value:null,boundContextVariables:{}};return{inputs:t,outputs:s}}collectRawInputs(r){const e=this.getBindingsFromOpeningTag(r,"noBracketInputs",this.config.inputsBlacklist||null,this.config.inputsWhitelist||null),t=this.getBindingsFromOpeningTag(r,"bracketInputs",this.config.inputsBlacklist||null,this.config.inputsWhitelist||null);for(const[n,s]of Object.entries(e))e[n]="'"+s+"'";return{...e,...t}}collectRawOutputs(r){return this.getBindingsFromOpeningTag(r,"outputs",this.config.outputsBlacklist||null,this.config.outputsWhitelist||null)}getBindingsFromOpeningTag(r,e,t,n){const s={},i="(?:"+b.attributeValueDoubleQuotesRegex+"|"+b.attributeValueSingleQuotesRegex+")";let a;switch(e){case"noBracketInputs":a=b.attributeNameNoBracketsRegex;break;case"bracketInputs":a=b.attributeNameBracketsRegex;break;case"outputs":a=b.attributeNameRoundBracketsRegex}const p=T(r,new RegExp(a+"="+i,"gim"));for(const u of p){let h=u[2]||u[3];void 0===h&&"noBracketInputs"===e&&(h=""),s[u[1]]=h}const d={};for(const[u,h]of Object.entries(s))t&&t.includes(u)||n&&!n.includes(u)||(d[u]=h);return d}getValuesFromSavedBindings(r){const e={};for(const[t,n]of Object.entries(r))e[t]=n.value;return e}}class St{constructor(r,e,t,n){this.configResolver=e,this.platformService=t,this.bindingsValueManager=n,this.savedBindings={},this.config=this.configResolver.processConfig(r),this.name=this.config.name}findHookElements(r,e,t){return Array.from(this.platformService.querySelectorAll(r,this.config.selector))}loadComponent(r,e,t,n,s){return this.scrubAngularBindingAttrs(e.element),{component:this.config.component,hostElementTag:this.config.hostElementTag,injector:this.config.injector,environmentInjector:this.config.environmentInjector}}getBindings(r,e,t,n){let s=this.savedBindings[r];return void 0===s&&(s=this.createBindings(e.elementSnapshot),this.savedBindings[r]=s),this.bindingsValueManager.checkInputBindings(s.inputs,t,this.config,n),this.bindingsValueManager.checkOutputBindings(s.outputs,this.config,n),{inputs:this.getValuesFromSavedBindings(s.inputs),outputs:this.getValuesFromSavedBindings(s.outputs)}}scrubAngularBindingAttrs(r){const e=Array.from(r.attributes).map(t=>t.name).filter(t=>t.startsWith("[")&&t.endsWith("]")||t.startsWith("(")&&t.endsWith(")"));for(const t of e)this.platformService.removeAttribute(r,t)}createBindings(r){const e=this.collectRawBindings(r,"inputs",this.config.inputsBlacklist||null,this.config.inputsWhitelist||null),t={};for(const[i,a]of Object.entries(e))t[i]={raw:a,parsed:!1,value:null,boundContextVariables:{}};const n=this.collectRawBindings(r,"outputs",this.config.outputsBlacklist||null,this.config.outputsWhitelist||null),s={};for(const[i,a]of Object.entries(n))s[i]={raw:a,parsed:!1,value:null,boundContextVariables:{}};return{inputs:t,outputs:s}}collectRawBindings(r,e,t,n){const s={},i=this.platformService.getAttributeNames(r);for(let l of i)if("inputs"===e&&(!l.startsWith("(")||!l.endsWith(")"))||"outputs"===e&&l.startsWith("(")&&l.endsWith(")")){let c=this.platformService.getAttribute(r,l);"inputs"===e&&l.startsWith("[")&&l.endsWith("]")&&""===c&&(c=void 0),"inputs"===e&&(!l.startsWith("[")||!l.endsWith("]"))&&(c=`'${c}'`),l=l.replace(/^\[|^\(|\]$|\)$/g,""),s[l]=c}const a={};for(const[l,c]of Object.entries(s))t&&t.includes(l)||n&&!n.includes(l)||(a[l]=c);return a}getValuesFromSavedBindings(r){const e={};for(const[t,n]of Object.entries(r))e[t]=n.value;return e}}const It={component:void 0,name:void 0,parseWithRegex:!1,selector:void 0,hostElementTag:void 0,injector:void 0,allowSelfClosing:!0,enclosing:!0,bracketStyle:{opening:"<",closing:">"},parseInputs:!0,unescapeStrings:!0,inputsBlacklist:void 0,inputsWhitelist:void 0,outputsBlacklist:void 0,outputsWhitelist:void 0,allowContextInBindings:!0,allowContextFunctionCalls:!0};let Tt=(()=>{class o{constructor(){}processConfig(e){const t=JSON.parse(JSON.stringify(It));if(!e||!e.hasOwnProperty("component"))throw Error('Missing the required "component" property for the SelectorHookParserConfig. Must be either the component class or a LazyLoadComponentConfig.');if(t.component=e.component,e.component.hasOwnProperty("prototype")){const n=(0,$.HJs)(e.component);t.selector=n.selector}else{if(!e.component.hasOwnProperty("importPromise")||!e.component.hasOwnProperty("importName"))throw Error('The "component" property in the SelectorHookParserConfig must either contain the component class or a LazyLoadComponentConfig.');if(!e.hasOwnProperty("selector"))throw Error('When using lazy-loaded dynamic components, you have to specify the "selector" property in the parser config, as the real selector can\'t be known before the component is loaded.')}if(e.hasOwnProperty("name")){if("string"!=typeof e.name)throw Error('The submitted "name" property in the SelectorHookParserConfig must be of type string, was '+typeof e.name);t.name=e.name}if(e.hasOwnProperty("selector")){if("string"!=typeof e.selector)throw Error('The submitted "selector" property in the SelectorHookParserConfig must be of type string, was '+typeof e.selector);t.selector=e.selector}if(e.hasOwnProperty("hostElementTag")){if("string"!=typeof e.hostElementTag)throw Error('The submitted "hostElementTag" property in the SelectorHookParserConfig must be of type string, was '+typeof e.hostElementTag);t.hostElementTag=e.hostElementTag}if(e.hasOwnProperty("parseWithRegex")){if("boolean"!=typeof e.parseWithRegex)throw Error('The submitted "parseWithRegex" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.parseWithRegex);t.parseWithRegex=e.parseWithRegex}if(e.hasOwnProperty("allowSelfClosing")){if("boolean"!=typeof e.allowSelfClosing)throw Error('The submitted "allowSelfClosing" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.allowSelfClosing);t.allowSelfClosing=e.allowSelfClosing}if(e.hasOwnProperty("enclosing")){if("boolean"!=typeof e.enclosing)throw Error('The submitted "enclosing" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.enclosing);t.enclosing=e.enclosing}if(e.hasOwnProperty("bracketStyle")){if("object"!=typeof e.bracketStyle||"string"!=typeof e.bracketStyle.opening||"string"!=typeof e.bracketStyle.closing)throw Error('The submitted "bracketStyle" property in the SelectorHookParserConfig must have the form {opening: string, closing: string}');t.bracketStyle=e.bracketStyle}if(e.hasOwnProperty("injector")&&(t.injector=e.injector),e.hasOwnProperty("environmentInjector")&&(t.environmentInjector=e.environmentInjector),e.hasOwnProperty("unescapeStrings")){if("boolean"!=typeof e.unescapeStrings)throw Error('The submitted "unescapeStrings" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.unescapeStrings);t.unescapeStrings=e.unescapeStrings}if(e.hasOwnProperty("parseInputs")){if("boolean"!=typeof e.parseInputs)throw Error('The submitted "parseInputs" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.parseInputs);t.parseInputs=e.parseInputs}if(e.hasOwnProperty("inputsBlacklist")){if(!Array.isArray(e.inputsBlacklist))throw Error('The submitted "inputsBlacklist" property in the SelectorHookParserConfig must be an array of strings.');for(const n of e.inputsBlacklist)if("string"!=typeof n)throw Error('All entries of the submitted "inputsBlacklist" property in the SelectorHookParserConfig must be of type string, '+typeof n+" found.");t.inputsBlacklist=e.inputsBlacklist}if(e.hasOwnProperty("inputsWhitelist")){if(!Array.isArray(e.inputsWhitelist))throw Error('The submitted "inputsWhitelist" property in the SelectorHookParserConfig must be an array of strings.');for(const n of e.inputsWhitelist)if("string"!=typeof n)throw Error('All entries of the submitted "inputsWhitelist" property in the SelectorHookParserConfig must be of type string, '+typeof n+" found.");t.inputsWhitelist=e.inputsWhitelist}if(e.hasOwnProperty("outputsBlacklist")){if(!Array.isArray(e.outputsBlacklist))throw Error('The submitted "outputsBlacklist" property in the SelectorHookParserConfig must be an array of strings.');for(const n of e.outputsBlacklist)if("string"!=typeof n)throw Error('All entries of the submitted "outputsBlacklist" property in the SelectorHookParserConfig must be of type string, '+typeof n+" found.");t.outputsBlacklist=e.outputsBlacklist}if(e.hasOwnProperty("outputsWhitelist")){if(!Array.isArray(e.outputsWhitelist))throw Error('The submitted "outputsWhitelist" property in the SelectorHookParserConfig must be an array of strings.');for(const n of e.outputsWhitelist)if("string"!=typeof n)throw Error('All entries of the submitted "outputsWhitelist" property in the SelectorHookParserConfig must be of type string, '+typeof n+" found.");t.outputsWhitelist=e.outputsWhitelist}if(e.hasOwnProperty("allowContextInBindings")){if("boolean"!=typeof e.allowContextInBindings)throw Error('The submitted "allowContextInBindings" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.allowContextInBindings);t.allowContextInBindings=e.allowContextInBindings}if(e.hasOwnProperty("allowContextFunctionCalls")){if("boolean"!=typeof e.allowContextFunctionCalls)throw Error('The submitted "allowContextFunctionCalls" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.allowContextFunctionCalls);t.allowContextFunctionCalls=e.allowContextFunctionCalls}return t}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();const De=new f.nKC("An injection token to retrieve an optionally user-provided PlatformService");let Et=(()=>{class o{constructor(e,t,n){this.document=e,this.rendererFactory=t,this.sanitizer=n,this.renderer=this.rendererFactory.createRenderer(null,null)}getNgVersion(){if(typeof this.document<"u"){const t=this.querySelectorAll(this.document,"[ng-version]")?.[0]?.getAttribute("ng-version");if(t)return parseInt(t,10)}return null}sanitize(e){return this.sanitizer.sanitize(S.WPN.HTML,e)||""}createElement(e){return this.renderer.createElement(e)}sortElements(e,t){return e===t?0:e.compareDocumentPosition?2&e.compareDocumentPosition(t)?1:-1:e.sourceIndex-t.sourceIndex}cloneElement(e){return e.cloneNode(!0)}getTagName(e){return e.tagName}getOpeningTag(e){const n=e.outerHTML.length;return e.outerHTML.slice(0,"/"===e.outerHTML[n-2]?n:n-e.innerHTML.length-e.tagName.length-3)}getClosingTag(e){return e.outerHTML.slice(e.outerHTML.length-e.tagName.length-3)}getAttributeNames(e){return"function"==typeof e.getAttributeNames?e.getAttributeNames():[]}getAttribute(e,t){return"function"==typeof e.getAttribute?e.getAttribute(t):null}setAttribute(e,t,n){this.renderer.setAttribute(e,t,n)}removeAttribute(e,t){this.renderer.removeAttribute(e,t)}getParentNode(e){try{return this.renderer.parentNode(e)}catch{return null}}querySelectorAll(e,t){return Array.from(e.querySelectorAll(t))}getChildNodes(e){return Array.prototype.slice.call(e.childNodes)}appendChild(e,t){this.renderer.appendChild(e,t)}insertBefore(e,t,n){this.renderer.insertBefore(e,t,n)}clearChildNodes(e){if(e)for(;e.firstChild;)this.removeChild(e,e.firstChild)}removeChild(e,t){e.removeChild(t)}getInnerContent(e){return e.innerHTML}setInnerContent(e,t){e&&(e.innerHTML=t)}isTextNode(e){return e.nodeType===Node.TEXT_NODE}createTextNode(e){return document.createTextNode(e)}getTextContent(e){return e.textContent}dispatchEvent(e,t,n){e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0}))}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(f.qQL),f.KVO(S._9s),f.KVO(mt.up))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),V=(()=>{class o{constructor(e,t){this.userPlatformService=e,this.defaultPlatformService=t}getFor(e){return this.userPlatformService&&"function"==typeof this.userPlatformService[e]?this.userPlatformService:this.defaultPlatformService}getNgVersion(){return this.getFor("getNgVersion").getNgVersion()}sanitize(e){return this.getFor("sanitize").sanitize(e)}createElement(e){return this.getFor("createElement").createElement(e)}sortElements(e,t){return this.getFor("sortElements").sortElements(e,t)}cloneElement(e){return this.getFor("cloneElement").cloneElement(e)}getTagName(e){return this.getFor("getTagName").getTagName(e)}getOpeningTag(e){return this.getFor("getOpeningTag").getOpeningTag(e)}getClosingTag(e){return this.getFor("getClosingTag").getClosingTag(e)}getAttributeNames(e){return this.getFor("getAttributeNames").getAttributeNames(e)}getAttribute(e,t){return this.getFor("getAttribute").getAttribute(e,t)}setAttribute(e,t,n){return this.getFor("setAttribute").setAttribute(e,t,n)}removeAttribute(e,t){return this.getFor("removeAttribute").removeAttribute(e,t)}getParentNode(e){return this.getFor("getParentNode").getParentNode(e)}querySelectorAll(e,t){return this.getFor("querySelectorAll").querySelectorAll(e,t)}getChildNodes(e){return this.getFor("getChildNodes").getChildNodes(e)}appendChild(e,t){return this.getFor("appendChild").appendChild(e,t)}insertBefore(e,t,n){return this.getFor("insertBefore").insertBefore(e,t,n)}clearChildNodes(e){return this.getFor("clearChildNodes").clearChildNodes(e)}removeChild(e,t){return this.getFor("removeChild").removeChild(e,t)}getInnerContent(e){return this.getFor("getInnerContent").getInnerContent(e)}setInnerContent(e,t){return this.getFor("setInnerContent").setInnerContent(e,t)}isTextNode(e){return this.getFor("isTextNode").isTextNode(e)}createTextNode(e){return this.getFor("createTextNode").createTextNode(e)}getTextContent(e){return this.getFor("getTextContent").getTextContent(e)}dispatchEvent(e,t,n){return this.getFor("dispatchEvent").dispatchEvent(e,t,n)}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(De,8),f.KVO(Et))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),A=(()=>{class o{constructor(e){this.platformId=e}log(e,t){this.handleLog(e,t,"log")}warn(e,t){this.handleLog(e,t,"warn")}error(e,t){this.handleLog(e,t,"error")}handleLog(e,t,n){(t.logOptions?.dev&&this.isDevMode()&&(0,G.UE)(this.platformId)||t.logOptions?.prod&&!this.isDevMode()&&(0,G.UE)(this.platformId)||t.logOptions?.ssr&&!(0,G.UE)(this.platformId))&&console[n](...e)}isDevMode(){return(0,$.naY)()}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(S.Agw))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Ct=(()=>{class o{constructor(e){this.logger=e}find(e,t,n,s,i={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){return n?this.findEnclosingHooks(e,t,n,s,i):this.findSingletagHooks(e,t)}findSingletagHooks(e,t){const n=[],s=T(e,t);for(const i of s)n.push({openingTagStartIndex:i.index,openingTagEndIndex:i.index+i[0].length,closingTagStartIndex:null,closingTagEndIndex:null});return n}findEnclosingHooks(e,t,n,s,i={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){const a=[],l=[],c=T(e,t);for(const u of c)a.push({isOpening:!0,value:u[0],startIndex:u.index,endIndex:u.index+u[0].length});const p=T(e,n);for(const u of p)a.push({isOpening:!1,value:u[0],startIndex:u.index,endIndex:u.index+u[0].length});a.sort((u,h)=>u.startIndex-h.startIndex);const d=[];for(const[u,h]of a.entries())if(u>0&&h.startIndex<a[u-1].endIndex)this.logger.warn(['Syntax error - New tag "'+h.value+'" started at position '+h.startIndex+' before previous tag "'+a[u-1].value+'" ended at position '+a[u-1].endIndex+". Ignoring."],i);else if(h.isOpening)d.push(h);else{if(0===d.length){this.logger.warn(['Syntax error - Closing tag without preceding opening tag found: "'+h.value+'". Ignoring.'],i);continue}if(!1===s&&d.length>1){d.pop();continue}const g=d[d.length-1];l.push({openingTagStartIndex:g.startIndex,openingTagEndIndex:g.startIndex+g.value.length,closingTagStartIndex:h.startIndex,closingTagEndIndex:h.startIndex+h.value.length}),d.pop()}return d.length>0&&this.logger.warn(["Syntax error - Opening tags without corresponding closing tags found."],i),l}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(A))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Rt=(()=>{class o{constructor(e){this.hookFinder=e}findSingleTags(e,t,n={opening:"<",closing:">"},s){const i=this.generateOpeningTagRegex(t,n);return this.hookFinder.find(e,i,void 0,void 0,s)}findEnclosingTags(e,t,n={opening:"<",closing:">"},s){const i=this.generateOpeningTagRegex(t,n),a=this.generateClosingTagRegex(t,n);return this.hookFinder.find(e,i,a,!0,s)}findSelfClosingTags(e,t,n={opening:"<",closing:">"},s){const i=this.generateOpeningTagRegex(t,n,!0);return this.hookFinder.find(e,i,void 0,void 0,s)}generateOpeningTagRegex(e,t={opening:"<",closing:">"},n=!1){const s=this.escapeRegex(t.opening),i=this.escapeRegex(e),a=(n?"\\/":"")+this.escapeRegex(t.closing);return new RegExp(s+i+"(?:\\s*"+a+"|(?:\\s+"+b.attributeNameRegex+"=(?:"+b.attributeValueDoubleQuotesRegex+"|"+b.attributeValueSingleQuotesRegex+"))+\\s*"+a+")","gim")}generateClosingTagRegex(e,t={opening:"<",closing:">"}){const n=this.escapeRegex(t.opening)+"/",s=this.escapeRegex(e),i=this.escapeRegex(t.closing);return new RegExp(n+s+i,"gim")}escapeRegex(e){return e.replace(new RegExp("[-\\/\\\\^$*+?.()|[\\]{}]","g"),"\\$&")}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(Ct))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Ot=(()=>{class o{encodeSubstrings(e){const i=[...T(e,/'/gm).filter(p=>0===p.index||"\\"!==e[p.index-1]),...T(e,/"/gm).filter(p=>0===p.index||"\\"!==e[p.index-1]),...T(e,/`/gm).filter(p=>0===p.index||"\\"!==e[p.index-1])];i.sort((p,d)=>p.index-d.index);const a=[];let l=null;for(const p of i)l?l[0]===p[0]&&(a.push({startIndex:l.index+1,endIndex:p.index}),l=null):l=p;if(null!==l)throw Error("Input parse error. String was opened, but not closed.");return this.encodeTextSegments(e,a,this.encodeStringSpecialChars)}encodeStringSpecialChars(e){return(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/'/g,"@@@singlequote@@@")).replace(/"/g,"@@@doublequote@@@")).replace(/`/g,"@@@gravequote@@@")).replace(/:/g,"@@@colon@@@")).replace(/;/g,"@@@semicolon@@@")).replace(/\./g,"@@@dot@@@")).replace(/,/g,"@@@comma@@@")).replace(/\\/g,"@@@backslash@@@")).replace(/\(/g,"@@@openRoundBracket@@@")).replace(/\)/g,"@@@closeRoundBracket@@@")).replace(/\[/g,"@@@openSquareBracket@@@")).replace(/\]/g,"@@@closeSquareBracket@@@")).replace(/\{/g,"@@@openCurlyBracket@@@")).replace(/\}/g,"@@@closeCurlyBracket@@@")}decodeStringSpecialChars(e){return(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/@@@singlequote@@@/g,"'")).replace(/@@@doublequote@@@/g,'"')).replace(/@@@gravequote@@@/g,"`")).replace(/@@@colon@@@/g,":")).replace(/@@@semicolon@@@/g,";")).replace(/@@@dot@@@/g,".")).replace(/@@@comma@@@/g,",")).replace(/@@@backslash@@@/g,"\\")).replace(/@@@openRoundBracket@@@/g,"(")).replace(/@@@closeRoundBracket@@@/g,")")).replace(/@@@openSquareBracket@@@/g,"[")).replace(/@@@closeSquareBracket@@@/g,"]")).replace(/@@@openCurlyBracket@@@/g,"{")).replace(/@@@closeCurlyBracket@@@/g,"}")}encodeSubfunctions(e){const s=[...T(e,/\(/gm),...T(e,/\)/gm)];s.sort((c,p)=>c.index-p.index);const i=[],a=[];for(const c of s)if("("===c[0])a.push(c);else{if(0===a.length)throw Error("Input parse error. Closed function bracket without opening it first.");1===a.length&&i.push({startIndex:a[0].index+1,endIndex:c.index}),a.pop()}if(0!==a.length)throw Error("Input parse error. Opened function bracket without closing it.");return this.encodeTextSegments(e,i,this.encodeFunctionBrackets)}encodeFunctionBrackets(e){return(e=e.replace(/\(/g,"@@@fnOpenBracket@@@")).replace(/\)/g,"@@@fnCloseBracket@@@")}decodeFunctionBrackets(e){return(e=e.replace(/@@@fnOpenBracket@@@/g,"(")).replace(/@@@fnCloseBracket@@@/g,")")}encodeVariableSubbrackets(e){const s=T(e,new RegExp("(?:[a-zA-Z_$\\])])(\\[)","gm")),i=[];for(const c of s){const p=e.substring(c.index+2),h=[...T(p,/\[/gm),...T(p,/\]/gm)];h.sort((m,w)=>m.index-w.index);let g=1;for(const m of h)if(g="]"===m[0]?g-1:g+1,0===g){i.push({startIndex:c.index+2,endIndex:c.index+2+m.index});break}if(0!==g)throw Error("Input parse error. Opened bracket without closing it.")}const a=[];for(const c of i)(0===a.length||a[a.length-1].endIndex<c.startIndex)&&a.push(c);return this.encodeTextSegments(e,a,this.encodeVariableBrackets)}encodeVariableBrackets(e){return(e=e.replace(/\[/g,"@@@variableOpeningBracket@@@")).replace(/\]/g,"@@@variableClosingBracket@@@")}decodeVariableBrackets(e){return(e=e.replace(/@@@variableOpeningBracket@@@/g,"[")).replace(/@@@variableClosingBracket@@@/g,"]")}transformContextVarIntoPlacerholder(e){return(e=(e=(e=(e=(e=(e="__CXT__"+e.substring(7)).replace(/\"/g,"@@@cxtDoubleQuote@@@")).replace(/\./g,"@@@cxtDot@@@")).replace(/\[/g,"@@@cxtOpenSquareBracket@@@")).replace(/\]/g,"@@@cxtCloseSquareBracket@@@")).replace(/\(/g,"@@@cxtOpenRoundBracket@@@")).replace(/\)/g,"@@@cxtCloseRoundBracket@@@")}transformPlaceholderIntoContextVar(e){return(e=(e=(e=(e=(e=(e="context"+e.substring(7)).replace(/@@@cxtDoubleQuote@@@/g,'"')).replace(/@@@cxtDot@@@/g,".")).replace(/@@@cxtOpenSquareBracket@@@/g,"[")).replace(/@@@cxtCloseSquareBracket@@@/g,"]")).replace(/@@@cxtOpenRoundBracket@@@/g,"(")).replace(/@@@cxtCloseRoundBracket@@@/g,")")}encodeTextSegments(e,t,n){const s=[];for(const l of t){const c=0===s.length?0:s[s.length-1].endIndex;s.push({type:"text",startIndex:c,endIndex:l.startIndex,string:e.substring(c,l.startIndex)}),s.push({type:"special",startIndex:l.startIndex,endIndex:l.endIndex,string:e.substring(l.startIndex,l.endIndex)})}const i=0===s.length?0:s[s.length-1].endIndex;s.push({type:"text",startIndex:i,endIndex:e.length-1,string:e.substring(i)});for(const l of s)"special"===l.type&&(l.string=n(l.string));let a="";for(const l of s)a+=l.string;return a}stripSlashes(e){return e.replace(/\\(.)/g,"$1")}escapeDoubleQuotes(e){return e.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Bt=(()=>{class o{constructor(e,t){this.dataTypeEncoder=e,this.logger=t}evaluate(e,t={},n,s=!0,i={},a=!0,l={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){if("null"===e)return null;if("undefined"!==e){if("true"===e)return!0;if("false"===e)return!1;if(!isNaN(e))return parseInt(e,10);if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")||e.startsWith("`")&&e.endsWith("`")){let c=e.substring(1,e.length-1);return c=s?this.dataTypeEncoder.stripSlashes(c):c,c}if((e=this.encodeDataTypeString(e)).startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]")){const c=this.parseAsJSON(e,s);return this.loadJSONVariables(c,t,n,s,i,a,l)}if("$event"===e)return n;if(e.match(new RegExp("^\\s*"+b.contextVariableRegex+"\\s*$","gm")))return this.loadContextVariable(e,t,n,s,i,a,l);throw Error('Data type for following input was not recognized and could not be parsed: "'+e+'"')}}encodeDataTypeString(e){return e=this.dataTypeEncoder.encodeSubstrings(e),e=this.dataTypeEncoder.encodeSubfunctions(e),this.dataTypeEncoder.encodeVariableSubbrackets(e)}decodeDataTypeString(e){return e=this.dataTypeEncoder.decodeStringSpecialChars(e),e=this.dataTypeEncoder.decodeFunctionBrackets(e),(e=this.dataTypeEncoder.decodeVariableBrackets(e)).trim()}parseAsJSON(e,t){if((e=(e=(e=e.replace(/\'(\\.|[^\'])*?\'/gm,l=>'"'+l.slice(1,-1)+'"')).replace(/\`(\\.|[^\`])*?\`/gm,l=>'"'+l.slice(1,-1)+'"')).replace(/"?([a-z0-9A-Z_]+)"?\s*:/g,'"$1": ')).match(/"?__proto__"?\s*:/g))throw Error('Setting the "__proto__" property in a hook input object is not allowed.');if(e.match(/"?prototype"?\s*:/g))throw Error('Setting the "prototype" property in a hook input object is not allowed.');if(e.match(/"?constructor"?\s*:/g))throw Error('Setting the "constructor" property in a hook input object is not allowed.');e=this.replaceValuesInJSONString(e,"undefined",l=>"null"),e=this.replaceValuesInJSONString(e,b.contextVariableRegex,l=>'"'+this.dataTypeEncoder.transformContextVarIntoPlacerholder(l)+'"'),e=this.replaceValuesInJSONString(e,"\\$event",l=>'"__EVENT__"');const a=JSON.parse(e);return this.decodeJSONStrings(a,t),a}replaceValuesInJSONString(e,t,n){return e.replace(new RegExp("(?:(:\\s*)("+t+")(?=\\s*[,}])|([\\[,]\\s*)("+t+")(?=\\s*[\\],]))","gm"),(a,l,c,p,d)=>(l||p)+n(c||d))}decodeJSONStrings(e,t){for(const n in e)if("string"==typeof e[n]){if('__EVENT__"'===e[n]||e[n].match(new RegExp("^\\s*"+b.placeholderContextVariableRegex+"\\s*$","gm")))continue;let s=this.decodeDataTypeString(e[n]);s=t?this.dataTypeEncoder.stripSlashes(s):s,e[n]=s}else"object"==typeof e[n]&&this.decodeJSONStrings(e[n],t)}loadJSONVariables(e,t,n,s,i,a,l){for(const c in e)if("string"==typeof e[c]){if("__EVENT__"===e[c])e[c]=n;else if(e[c].match(new RegExp("^\\s*"+b.placeholderContextVariableRegex+"\\s*$","gm"))){const p=this.dataTypeEncoder.transformPlaceholderIntoContextVar(e[c].trim());e[c]=this.loadContextVariable(p,t,n,s,i,a,l)}}else"object"==typeof e[c]&&this.loadJSONVariables(e[c],t,n,s,i,a,l);return e}loadContextVariable(e,t={},n,s=!0,i={},a=!0,l={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){try{const c=e.substring(7);if(""===c.trim())return t;const p=[],d=T(c,new RegExp(b.variablePathPartRegex,"gm"));for(const u of d){if(u[0].startsWith(".")&&p.push({type:"property",value:u[0].substring(1)}),u[0].startsWith("[")&&u[0].endsWith("]")){let h=u[0].substring(1,u[0].length-1);h=this.decodeDataTypeString(h),h=this.evaluate(h,t,n,s,i,a),p.push({type:"property",value:h})}if(u[0].startsWith("(")&&u[0].endsWith(")")){if(!a)throw Error("Tried to call a function in a context variable. This has been disallowed in the current config.");const h=u[0].substring(1,u[0].length-1),g=[];if(""!==h)for(const m of h.split(",")){let w=this.decodeDataTypeString(m);w=this.evaluate(w,t,n,s,i,a),g.push(w)}p.push({type:"function",value:g})}}try{const u=this.fetchContextVariable(t,p);return i[this.decodeDataTypeString(e)]=u,u}catch{throw Error('The required context variable "'+this.decodeDataTypeString(e)+'" could not be found in the context object. Returning undefined instead.')}}catch(c){return this.logger.warn([c],l),void(i[this.decodeDataTypeString(e)]=void 0)}}fetchContextVariable(e,t){if("__proto__"===t[0].value)throw Error("Accessing the __proto__ property through a context variable is not allowed.");if("prototype"===t[0].value)throw Error("Accessing the prototype property through a context variable is not allowed.");if("constructor"===t[0].value)throw Error("Accessing the constructor property through a context variable is not allowed.");if(void 0===e)throw Error("Context variable path could not be resolved. Trying to access "+("property"===t[0].type?'property "'+t[0].value+'" of undefined.':"undefined function."));let n;return"property"===t[0].type?e.hasOwnProperty(t[0].value)?(n=e[t[0].value],"function"==typeof n&&(n=n.bind(e))):e.__proto__.hasOwnProperty(t[0].value)?(n=e.__proto__[t[0].value],"function"==typeof n&&(n=n.bind(e))):n=void 0:"function"===t[0].type&&(n=e(...t[0].value)),t.shift(),t.length>0&&(n=this.fetchContextVariable(n,t)),n}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(Ot),f.KVO(A))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),At=(()=>{class o{constructor(e,t){this.dataTypeParser=e,this.logger=t}checkInputBindings(e,t,n,s){for(const[i,a]of Object.entries(e))if(n.parseInputs)if(a.parsed)this.updateInputBindingIfStale(a,t,n);else try{a.value=this.dataTypeParser.evaluate(a.raw,n.allowContextInBindings?t:{},void 0,n.unescapeStrings,a.boundContextVariables,n.allowContextFunctionCalls,s),a.parsed=!0}catch(l){this.logger.error(["Hook input parsing error\nselector: "+n.selector+"\ninput: "+i+'\nvalue: "'+a.value+'"'],s),this.logger.error([l.stack],s),delete e[i]}else a.value=a.raw}updateInputBindingIfStale(e,t,n){if(Object.keys(e.boundContextVariables).length>0){let s=!1;for(const[i,a]of Object.entries(e.boundContextVariables)){const l=this.dataTypeParser.encodeDataTypeString(i);if(this.dataTypeParser.loadContextVariable(l,t,void 0,n.unescapeStrings,{},n.allowContextFunctionCalls)!==a){s=!0;break}}s&&(e.boundContextVariables={},e.value=this.dataTypeParser.evaluate(e.raw,n.allowContextInBindings?t:{},void 0,n.unescapeStrings,e.boundContextVariables,n.allowContextFunctionCalls))}}checkOutputBindings(e,t,n){for(const[s,i]of Object.entries(e))i.parsed||(i.value=(a,l)=>{try{this.dataTypeParser.evaluate(i.raw,t.allowContextInBindings?l:{},a,t.unescapeStrings,i.boundContextVariables,t.allowContextFunctionCalls)}catch(c){this.logger.error(["Hook output parsing error\nselector: "+t.selector+"\noutput: "+s+'\nvalue: "'+i.value+'"'],n),this.logger.error([c.stack],n)}},i.parsed=!0)}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(Bt),f.KVO(A))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Pt=(()=>{class o{constructor(e,t,n,s,i,a){this.injector=e,this.parserResolver=t,this.platformService=n,this.tagHookFinder=s,this.bindingsValueManager=i,this.logger=a}resolve(e,t,n,s,i){const a=[];for(const p of e){const d=this.resolveEntry(p,t,i);d&&a.push(d)}const l=this.validateParserFunctions(a,i);if(this.checkParserNames(l,i),!n&&!s)return l;this.checkBlackAndWhitelist(l,n,s,i);const c=[];for(const p of l)p.hasOwnProperty("name")&&"string"==typeof p.name&&(n&&n.includes(p.name)||s&&!s.includes(p.name))||c.push(p);return c}resolveEntry(e,t,n){if(e.hasOwnProperty("prototype")){if((0,$.HJs)(e))return this.createSelectorHookParser({component:e});try{return t.get(e)}catch{return new e}}else if("object"==typeof e){if("Object"!==e.constructor.name)return e;try{return this.createSelectorHookParser(e)}catch(s){return this.logger.error(["Invalid parser config - "+s.message,e],n),null}}return this.logger.error(["Invalid parser config - ",e],n),null}createSelectorHookParser(e){return e.hasOwnProperty("parseWithRegex")&&e.parseWithRegex||e.hasOwnProperty("enclosing")&&!e.enclosing||e.hasOwnProperty("bracketStyle")&&e.bracketStyle?new wt(e,this.parserResolver,this.tagHookFinder,this.bindingsValueManager):new St(e,this.parserResolver,this.platformService,this.bindingsValueManager)}validateParserFunctions(e,t){const n=[];for(const s of e)"function"==typeof s.findHooks||"function"==typeof s.findHookElements?"function"==typeof s.loadComponent?"function"==typeof s.getBindings?n.push(s):this.logger.error(['Submitted parser does not implement "getBindings()". Removing from list of active parsers:',s],t):this.logger.error(['Submitted parser does not implement "loadComponent()". Removing from list of active parsers:',s],t):this.logger.error(['Submitted parser neither implements "findHooks()" nor "findHookElements()". One is required. Removing from list of active parsers:',s],t);return n}checkParserNames(e,t){const n=e.map(a=>a.name).filter(a=>void 0!==a),s=[],i=[];for(const a of n)s.includes(a)&&!i.includes(a)&&(this.logger.warn(['Parser name "'+a+'" is not unique and appears multiple times in the list of active parsers.'],t),i.push(a)),s.push(a)}checkBlackAndWhitelist(e,t,n,s){const i=e.map(a=>a.name).filter(a=>void 0!==a);if(t)for(const a of t)i.includes(a)||this.logger.warn(['Blacklisted parser name "'+a+'" does not appear in the list of global parsers names. Make sure both spellings are identical.'],s);if(n)for(const a of n)i.includes(a)||this.logger.warn(['Whitelisted parser name "'+a+'" does not appear in the list of global parsers names. Make sure both spellings are identical.'],s)}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(f.zZn),f.KVO(Tt),f.KVO(V),f.KVO(Rt),f.KVO(At),f.KVO(A))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Nt=(()=>{class o{constructor(e){this.parserEntryResolver=e}resolve(e,t,n,s,i,a=null,l=null,c=null,p=null){let d={};n=n||[],s=s||[];const u={options:{sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}};d=(i=i||{}).hasOwnProperty("inheritance")&&i.inheritance!==ae.Linear?this.mergeSettings(i.inheritance===ae.All?[u,...n,...s,{options:l||void 0}]:[u,i||{},{options:l||void 0}]):this.mergeSettings([u,...s,{parsers:a||void 0,options:l||void 0}]);const h=d.options;t&&"string"!=typeof t&&(h.sanitize=!1);let g=[];return a?g=this.parserEntryResolver.resolve(a,e,null,null,h):d.parsers&&(g=this.parserEntryResolver.resolve(d.parsers,e,c,p,h)),{parsers:g,options:h}}mergeSettings(e){const t={};for(const n of e){if(void 0!==n.parsers){void 0===t.parsers&&(t.parsers=[]);for(const s of n.parsers)t.parsers.includes(s)||t.parsers.push(s)}void 0!==n.options&&(void 0===t.options&&(t.options={}),t.options=this.recursiveAssign(t.options,n.options))}return t}recursiveAssign(e,t){if(Object(t)!==t)return t;Object(e)!==e&&(e={});for(const n in t)e[n]=this.recursiveAssign(e[n],t[n]);return e}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(Pt))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();const He="_ngx_dynamic_hooks_node_placeholder";let $t=(()=>{class o{constructor(e,t){this.platformService=e,this.logger=t}findInElement(e,t,n,s,i,a){for(const l of n)if("function"==typeof l.findHooks){this.checkElement(e,t,n,s,i,a);break}}checkElement(e,t,n,s,i,a,l={counter:0,nodes:{}}){let c=this.platformService.getChildNodes(e),p="";const d={};for(const g of c)if(this.platformService.isTextNode(g))p+=this.platformService.getTextContent(g);else{const m=l.counter++;p+=`${He}__${m}__`,d[m]=g}const u=Object.keys(a).length,h=this.find(p,t,n,s,i,a);if(Object.keys(a).length>u&&(this.platformService.clearChildNodes(e),this.platformService.setInnerContent(e,h.content),c=this.platformService.getChildNodes(e),l.nodes={...l.nodes,...d}),Object.keys(l.nodes).length)for(const g of c)if(this.platformService.isTextNode(g)){let m=this.platformService.getTextContent(g);if(m){const w=T(m,new RegExp(`${He}__(\\d*)__`,"g"));if(w.length){const x=[];let R=0;for(const H of w){const L=m.substring(R,H.index),B=parseInt(H[1]);L&&x.push(this.platformService.createTextNode(L)),B&&l.nodes[B]&&(x.push(l.nodes[B]),delete l.nodes[B]),R=H.index+H[0].length}const Q=m.substring(R);Q&&x.push(this.platformService.createTextNode(Q));const j=this.platformService.getParentNode(g);for(const H of x)this.platformService.insertBefore(j,H,g);this.platformService.removeChild(j,g),c=this.platformService.getChildNodes(j)}}}for(const g of c)g.nodeType!==Node.TEXT_NODE&&this.checkElement(g,t,n,s,i,a,l)}find(e,t,n,s,i,a){if(""===e)return{content:e,hookIndex:a};i.convertHTMLEntities&&(e=this.convertHTMLEntities(e));let l=[];for(const p of n)if("function"==typeof p.findHooks)for(const d of p.findHooks(e,t,i))l.push({parser:p,hookPosition:d});l.sort((p,d)=>p.hookPosition.openingTagStartIndex-d.hookPosition.openingTagStartIndex),l=this.validateHookPositions(l,e,i);const c=[];for(const p of l){const d=Object.keys(a).length+1,u=this.getHookSegments(p.hookPosition,e);if(c.push({startIndex:p.hookPosition.openingTagStartIndex,endIndex:p.hookPosition.openingTagEndIndex,replacement:`<${ie} ${I}="${d}" ${C}="${s}">`}),c.push({startIndex:u.enclosing?p.hookPosition.closingTagStartIndex:p.hookPosition.openingTagEndIndex,endIndex:u.enclosing?p.hookPosition.closingTagEndIndex:p.hookPosition.openingTagEndIndex,replacement:`</${ie}>`}),a[d]={id:d,parser:p.parser,value:{openingTag:u.openingTag,closingTag:u.closingTag,element:null,elementSnapshot:null},data:null,isLazy:!1,bindings:null,previousBindings:null,componentRef:null,dirtyInputs:new Set,outputSubscriptions:{},htmlEventSubscriptions:{}},u.enclosing&&i.fixParagraphTags){const h=this.removeTagArtifacts(u.textBefore,"<p>","</p>",u.innerValue,"</p>","<p>");u.textBefore=h.firstText,u.innerValue=h.secondText;const g=this.removeTagArtifacts(u.innerValue,"<p>","</p>",u.textAfter,"</p>","<p>");u.innerValue=g.firstText,u.textAfter=g.secondText,e=u.textBefore+u.openingTag+u.innerValue+u.closingTag+u.textAfter}}c.sort((p,d)=>{let u=d.startIndex-p.startIndex;return 0===u&&(u=d.endIndex-p.endIndex),u});for(const p of c){const d=e.substring(0,p.startIndex),u=e.substring(p.endIndex);e=d+p.replacement+u}return{content:e,hookIndex:a}}getHookSegments(e,t){const n=Number.isInteger(e.closingTagStartIndex)&&Number.isInteger(e.closingTagEndIndex);return{enclosing:n,textBefore:t.substring(0,e.openingTagStartIndex),openingTag:t.substring(e.openingTagStartIndex,e.openingTagEndIndex),innerValue:n?t.substring(e.openingTagEndIndex,e.closingTagStartIndex):null,closingTag:n?t.substring(e.closingTagStartIndex,e.closingTagEndIndex):null,textAfter:t.substring(n?e.closingTagEndIndex:e.openingTagEndIndex)}}validateHookPositions(e,t,n){const s=[];e:for(const[i,a]of e.entries()){const l=Number.isInteger(a.hookPosition.closingTagStartIndex)&&Number.isInteger(a.hookPosition.closingTagEndIndex),c=a.hookPosition;if(c.openingTagStartIndex>=c.openingTagEndIndex){this.logger.warn(["Text hook error: openingTagEndIndex has to be greater than openingTagStartIndex. Ignoring.",c],n);continue}if(l&&c.openingTagEndIndex>c.closingTagStartIndex){this.logger.warn(["Text hook error: closingTagStartIndex has to be greater than openingTagEndIndex. Ignoring.",c],n);continue}if(l&&c.closingTagStartIndex>=c.closingTagEndIndex){this.logger.warn(["Text hook error: closingTagEndIndex has to be greater than closingTagStartIndex. Ignoring.",c],n);continue}const p=e.slice(0,i);for(const d of p){const u=d.hookPosition,h=Number.isInteger(u.closingTagStartIndex)&&Number.isInteger(u.closingTagEndIndex);if(c.openingTagStartIndex===u.openingTagStartIndex&&c.openingTagEndIndex===u.openingTagEndIndex&&(!l||!h||c.closingTagStartIndex===u.closingTagStartIndex&&c.closingTagEndIndex===u.closingTagEndIndex)){this.generateHookPosWarning("A text hook with the same position as another text hook was found. There may be multiple parsers looking for the same text pattern. Ignoring duplicates.",c,u,t,n);continue e}if(c.openingTagStartIndex<u.openingTagEndIndex){this.generateHookPosWarning("Text hook error: Hook opening tag starts before previous hook opening tag ends. Ignoring.",c,u,t,n);continue e}if(h&&!(c.openingTagEndIndex<=u.closingTagStartIndex||c.openingTagStartIndex>=u.closingTagEndIndex)){this.generateHookPosWarning("Text hook error: Opening tag of hook overlaps with closing tag of previous hook. Ignoring.",c,u,t,n);continue e}if(h&&l&&!(c.closingTagEndIndex<=u.closingTagStartIndex||c.closingTagStartIndex>=u.closingTagEndIndex)){this.generateHookPosWarning("Text hook error: Closing tag of hook overlaps with closing tag of previous hook. Ignoring.",c,u,t,n);continue e}if(l&&h&&c.openingTagEndIndex<=u.closingTagStartIndex&&c.closingTagStartIndex>=u.closingTagEndIndex){this.generateHookPosWarning("Text hook error: The closing tag of a nested hook lies beyond the closing tag of the outer hook. Ignoring.",c,u,t,n);continue e}}s.push(a)}return s}generateHookPosWarning(e,t,n,s,i){const a=this.getHookSegments(n,s),l=this.getHookSegments(t,s);this.logger.warn([e+"\nFirst hook: ",{openingTag:a.openingTag,openingTagStartIndex:n.openingTagStartIndex,openingTagEndIndex:n.openingTagEndIndex,closingTag:a.closingTag,closingTagStartIndex:n.closingTagStartIndex,closingTagEndIndex:n.closingTagEndIndex},"\nSecond hook:",{openingTag:l.openingTag,openingTagStartIndex:t.openingTagStartIndex,openingTagEndIndex:t.openingTagEndIndex,closingTag:l.closingTag,closingTagStartIndex:t.closingTagStartIndex,closingTagEndIndex:t.closingTagEndIndex}],i)}removeTagArtifacts(e,t,n,s,i,a){let l=!1,c=!1;const p=e.lastIndexOf(t),d=e.lastIndexOf(n);(p>=0&&-1===d||p>d)&&(l=!0);const u=s.indexOf(i),h=s.indexOf(a);return(u>=0&&-1===h||u<h)&&(c=!0),l&&c&&(e=e.substring(0,p)+" ".repeat(t.length)+e.substring(p+t.length),s=s.substring(0,u)+" ".repeat(i.length)+s.substring(u+i.length)),{firstText:e,secondText:s}}convertHTMLEntities(e){const t=this.platformService.createElement("div");return e.replace(/&[#A-Za-z0-9]+;/gi,s=>" "===s?" ":(this.platformService.setInnerContent(t,s),this.platformService.getTextContent(t)))}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(V),f.KVO(A))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Dt=(()=>{class o{constructor(e,t){this.platformService=e,this.logger=t}find(e,t,n,s,i,a){let l=[];for(const c of n)if("function"==typeof c.findHookElements)for(const p of c.findHookElements(e,t,i))l.push({parser:c,hookElement:p});l=function xt(o,r,e){return[...o].sort(function(n,s){return"function"==typeof e&&(n=e(n),s=e(s)),r(n,s)})}(l,this.platformService.sortElements.bind(this.platformService),c=>c.hookElement),l=this.validateHookElements(l,e,i);for(const c of l){const p=Object.keys(a).length+1;a[p]={id:p,parser:c.parser,value:{openingTag:this.platformService.getOpeningTag(c.hookElement),closingTag:this.platformService.getClosingTag(c.hookElement),element:c.hookElement,elementSnapshot:this.platformService.cloneElement(c.hookElement)},data:null,isLazy:!1,bindings:null,previousBindings:null,componentRef:null,dirtyInputs:new Set,outputSubscriptions:{},htmlEventSubscriptions:{}},this.platformService.setAttribute(c.hookElement,I,p.toString()),this.platformService.setAttribute(c.hookElement,C,s)}return a}validateHookElements(e,t,n){const s=[];for(const[i,a]of e.entries())s.slice(0,i).findIndex(p=>p.hookElement===a.hookElement)>=0||this.platformService.getAttributeNames(a.hookElement).includes(I)||this.platformService.getAttributeNames(a.hookElement).includes(C)?this.logger.warn(["An element hook tried to use an element that was found by another hook before. There may be multiple parsers looking for the same elements. Ignoring duplicates.",a.hookElement],n):ce(a.hookElement)||s.push(a);return s}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(V),f.KVO(A))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();const pe="dynamic-hooks-sanitization-placeholder",Ht=new RegExp(`</?${pe}.*?>`,"g");let Vt=(()=>{class o{constructor(e){this.platformService=e,this.attrWhitelist=[I,C,"class","href","src"]}sanitize(e,t,n){const s={};for(const c of Object.values(t)){const p=this.platformService.querySelectorAll(e,`[${I}="${c.id}"][${C}="${n}"]`)?.[0];if(p){s[c.id]=p;const d=this.platformService.getParentNode(p),u=this.platformService.getChildNodes(p),h=this.platformService.createElement(pe);this.platformService.setAttribute(h,I,c.id.toString()),this.platformService.setAttribute(h,C,n),this.platformService.insertBefore(d,h,p),this.platformService.removeChild(d,p);for(const g of u)this.platformService.appendChild(h,g)}}let i=this.platformService.getInnerContent(e);i=this.findAndEncodeTags(i,Ht);const a=console.warn;console.warn=()=>{};let l=this.platformService.sanitize(i);console.warn=a,l=this.decodeTagString(l),e.innerHTML=l||"";for(const[c,p]of Object.entries(s)){const d=this.platformService.querySelectorAll(e,`${pe}[${I}="${c}"]`)?.[0];if(d){const u=this.platformService.getParentNode(d),h=this.platformService.getChildNodes(d);this.platformService.insertBefore(u,p,d),this.platformService.removeChild(u,d);for(const g of h)this.platformService.appendChild(p,g);this.sanitizeElementAttrs(p)}}return e}sanitizeElementAttrs(e){const t=this.platformService.getAttributeNames(e),n=this.platformService.createElement("div"),s=this.platformService.createElement("span");this.platformService.appendChild(n,s);for(const l of t){try{this.platformService.setAttribute(s,l,this.platformService.getAttribute(e,l))}catch{}try{l!==I&&l!==C&&this.platformService.removeAttribute(e,l)}catch{}}n.innerHTML=this.platformService.sanitize(this.platformService.getInnerContent(n));const i=this.platformService.querySelectorAll(n,"span")[0],a=this.platformService.getAttributeNames(i);for(const l of a)try{this.platformService.setAttribute(e,l,this.platformService.getAttribute(i,l))}catch{}return e}findAndEncodeTags(e,t){let n=e;const s=T(e,t);s.sort((i,a)=>a.index-i.index);for(const i of s){const a=i.index,l=i.index+i[0].length,c=n.substring(0,a),p=this.encodeTagString(n.substring(a,l)),d=n.substring(l);n=c+p+d}return n}encodeTagString(e){return(e=(e=e.replace(/</g,"@@@hook-lt@@@")).replace(/>/g,"@@@hook-gt@@@")).replace(/"/g,"@@@hook-dq@@@")}decodeTagString(e){return(e=(e=e.replace(/@@@hook-lt@@@/g,"<")).replace(/@@@hook-gt@@@/g,">")).replace(/@@@hook-dq@@@/g,'"')}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(V))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Mt=(()=>{class o{constructor(e){this.logger=e}isEqual(e,t,n,s={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){const i=this.detailedStringify(e,n),a=this.detailedStringify(t,n);return null===i.result||null===a.result?(this.logger.warn(["Objects could not be compared by value as one or both of them could not be stringified. Returning false. \n","Objects:",e,t],s),!1):i.result===a.result}detailedStringify(e,t){try{const n={count:0},s=this.decycle(e,[],t,n);return{result:JSON.stringify(s,(a,l)=>void 0===l?"undefined":"function"==typeof l||"symbol"==typeof l?l.toString():l),depthReachedCount:n.count}}catch{return{result:null,depthReachedCount:0}}}decycle(e,t=[],n=5,s){if(t.length>n)return s.count++,null;if(!e||"object"!=typeof e||e instanceof Date)return e;for(const a of t)if(this.objEqualsProperties(e,a))return null;const i=t.concat([e]);if(Array.isArray(e)){const a=[];for(const l of e)a.push(this.decycle(l,i,n,s));return a}{const a={};for(const l of Object.keys(e))a[l]=this.decycle(e[l],i,n,s);return a}}objEqualsProperties(e,t){const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const i of n)if(e[i]!==t[i])return!1;return!0}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(A))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Ve=(()=>{class o{constructor(e,t){this.deepComparer=e,this.logger=t}refresh(e,t,n,s){for(const[i,a]of Object.entries(e))this.updateBindings(a,t,n);if(s)for(const i of Object.values(e)){if(!i.componentRef)return;"function"==typeof i.componentRef.instance.onDynamicChanges&&i.componentRef.instance.onDynamicChanges({context:t})}}updateBindings(e,t,n){e.componentRef&&(e.bindings=e.parser.getBindings(e.id,e.value,t,n),this.updateComponentWithNewInputs(e,n),this.updateComponentWithNewOutputs(e,t,n),e.previousBindings={inputs:this.savePreviousBindings(e,"inputs",n.compareInputsByValue,n.compareByValueDepth),outputs:this.savePreviousBindings(e,"outputs",n.compareOutputsByValue,n.compareByValueDepth)})}savePreviousBindings(e,t,n,s){const i={};if(e.bindings.hasOwnProperty(t))for(const[a,l]of Object.entries(e.bindings[t]))i[a]={reference:l,stringified:n?this.deepComparer.detailedStringify(l,s):null};return i}updateComponentWithNewInputs(e,t){const n=e.componentRef.instance,s=this.getChangedBindings(e,"inputs",t),i=[],a=(0,$.HJs)(e.componentRef.componentType);for(const[l,c]of Object.entries(s)){const p=t.ignoreInputAliases?"propName":"templateName",d=a.inputs.find(u=>l===u[p])||a.inputs.find(u=>l.toLowerCase()===u[p].toLowerCase())||a.inputs.find(u=>l.replace(/-/g,"")===u[p])||a.inputs.find(u=>l.replace(/-/g,"").toLowerCase()===u[p].toLowerCase());if(d)i.push({propName:d.propName,templateName:d.templateName,value:c});else if(t.acceptInputsForAnyProperty){const h=Object.getOwnPropertyNames(n).find(g=>l===g)||Object.getOwnPropertyNames(n).find(g=>l.toLowerCase()===g.toLowerCase())||l;if(["__proto__","prototype","constructor"].includes(h)){this.logger.error(['Tried to overwrite a __proto__, prototype or constructor property with input "'+h+'" for hook "'+e.componentRef.componentType.name+'". This is not allowed.'],t);continue}i.push({propName:h,templateName:null,value:c})}}for(const{propName:l,templateName:c,value:p}of i)c?e.componentRef?.setInput(c,p):l&&(e.componentRef.instance[l]=p);i.length&&e.componentRef?.changeDetectorRef.detectChanges()}updateComponentWithNewOutputs(e,t,n){const s=e.componentRef.instance,i=this.getChangedBindings(e,"outputs",n),a=[],l=(0,$.HJs)(e.componentRef.componentType);for(const[c,p]of Object.entries(i)){const d=n.ignoreOutputAliases?"propName":"templateName",u=l.outputs.find(h=>c===h[d])||l.outputs.find(h=>c.toLowerCase()===h[d].toLowerCase())||l.outputs.find(h=>c.replace(/-/g,"")===h[d])||l.outputs.find(h=>c.replace(/-/g,"").toLowerCase()===h[d].toLowerCase());if(u)a.push({propName:u.propName,templateName:u.templateName,value:p});else if(n.acceptOutputsForAnyObservable){let h=Object.getOwnPropertyNames(s).find(g=>s[g]instanceof Te.c&&c===g)||Object.getOwnPropertyNames(s).find(g=>s[g]instanceof Te.c&&c.toLowerCase()===g.toLowerCase());h&&a.push({propName:h,templateName:null,value:p})}}for(const{propName:c,value:d}of a)e.outputSubscriptions[c]&&e.outputSubscriptions[c].unsubscribe(),e.outputSubscriptions[c]=e.componentRef.instance[c].subscribe(u=>{d(u,t)})}getChangedBindings(e,t,n){const s={};if(e.bindings.hasOwnProperty(t))for(const[i,a]of Object.entries(e.bindings[t]))if(e.previousBindings&&e.previousBindings[t].hasOwnProperty(i))if("inputs"===t?n.compareInputsByValue:n.compareOutputsByValue){const l=this.deepComparer.detailedStringify(a,n.compareByValueDepth);this.checkDetailedStringifyResultPair(i,e.componentRef.componentType.name,n,e.previousBindings[t][i].stringified,l)?l.result!==e.previousBindings[t][i].stringified.result&&(s[i]=a):a!==e.previousBindings[t][i].reference&&(s[i]=a)}else a!==e.previousBindings[t][i].reference&&(s[i]=a);else s[i]=a;return s}checkDetailedStringifyResultPair(e,t,n,s,i){return null===s.result&&null===i.result?(this.logger.warn(['Could stringify neither new nor old value for hook binding "'+e+'" for component "'+t+'" to compare by value. Defaulting to comparison by reference instead.'],n),!1):null===s.result?(this.logger.warn(['Could not stringify old value for hook binding "'+e+'" for component "'+t+'" to compare by value. Defaulting to comparison by reference instead.'],n),!1):null===i.result?(this.logger.warn(['Could not stringify new value for hook binding "'+e+'" for component "'+t+'" to compare by value. Defaulting to comparison by reference instead.'],n),!1):(s.depthReachedCount>0&&i.depthReachedCount>0?this.logger.warn(["Maximum compareByValueDepth of "+n.compareByValueDepth+" reached "+i.depthReachedCount+" time(s) for new value and "+s.depthReachedCount+' time(s) for old value while comparing binding "'+e+'" for component "'+t+".\n","If this impacts performance, consider simplifying this binding, reducing comparison depth or setting compareInputsByValue/compareOutputsByValue to false."],n):s.depthReachedCount>0?this.logger.warn(["Maximum compareByValueDepth of "+n.compareByValueDepth+" reached "+s.depthReachedCount+' time(s) for old value while comparing binding "'+e+'" for component "'+t+".\n","If this impacts performance, consider simplifying this binding, reducing comparison depth or setting compareInputsByValue/compareOutputsByValue to false."],n):i.depthReachedCount>0&&this.logger.warn(["Maximum compareByValueDepth of "+n.compareByValueDepth+" reached "+i.depthReachedCount+' time(s) for new value while comparing binding "'+e+'" for component "'+t+".\n","If this impacts performance, consider simplifying this binding, reducing comparison depth or setting compareInputsByValue/compareOutputsByValue to false."],n),!0)}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(Mt),f.KVO(A))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),zt=(()=>{class o{constructor(e,t,n,s,i){this.platformId=e,this.appRef=t,this.componentUpdater=n,this.platformService=s,this.logger=i}init(e,t,n,s,i,a,l){const c=new Ee.m(1),p=[],d={};if(0===Object.keys(t).length)return c.next(!0),c;for(let h of this.platformService.querySelectorAll(e,`[${I}][${C}]`)){const g=parseInt(this.platformService.getAttribute(h,I));if(0===this.platformService.querySelectorAll(e,`[${I}="${g}"][${C}="${n}"]`).length){delete t[g];continue}const m=t[g];m.data=m.parser.loadComponent(m.id,m.value,s,this.platformService.getChildNodes(h),i),m.isLazy=m.data.component.hasOwnProperty("importPromise")&&m.data.component.hasOwnProperty("importName"),(0,G.UE)(this.platformId)||!m.isLazy?(!m.data.hostElementTag&&kt.includes(this.platformService.getTagName(h).toLowerCase())&&(m.data.hostElementTag=ie),m.data.hostElementTag&&(h=this.useCustomHostElement(h,m.data.hostElementTag),m.value.element=h),this.createContentSlotElements(h,m,n),d[g]=h):delete t[g]}const u=Object.keys(d).map(h=>parseInt(h));for(const[h,g]of Object.entries(t))u.includes(parseInt(h))||(this.logger.warn(["Error when trying to load components - The anchor element for the following hook was found initially, but could not be found again for loading the component. Ignoring.",g],i),delete t[h]);for(const[h,g]of Object.entries(d)){const m=t[h];p.push((0,se.of)(!0).pipe((0,ot.Z)(()=>this.loadComponentClass(m.data.component))).pipe((0,it.M)(w=>{const x=this.extractContentSlotElements(g,n);this.createComponent(m,s,g,x,i,w,a,l)})).pipe((0,at.W)(w=>(this.logger.error([w.stack],i),delete t[m.id],(0,se.of)(null)))))}return 0===p.length?(c.next(!0),c):((0,st.z)([...p]).pipe(Be()).subscribe(()=>{for(const h of Object.values(t)){const g=[];("function"==typeof h.componentRef.instance.onDynamicMount||"function"==typeof h.componentRef.instance.onDynamicChanges)&&this.findContentChildren(h.componentRef.location.nativeElement,g,t,n),"function"==typeof h.componentRef.instance.onDynamicChanges&&h.componentRef.instance.onDynamicChanges({contentChildren:g}),"function"==typeof h.componentRef.instance.onDynamicMount&&h.componentRef.instance.onDynamicMount({context:s,contentChildren:g})}for(const h of Object.values(d))this.platformService.removeAttribute(h,I),this.platformService.removeAttribute(h,C),this.platformService.removeAttribute(h,"ng-version");c.next(!0)}),c)}useCustomHostElement(e,t){const n=this.platformService.createElement(t);this.platformService.setAttribute(n,I,this.platformService.getAttribute(e,I)),this.platformService.setAttribute(n,C,this.platformService.getAttribute(e,C)),this.platformService.removeAttribute(e,I),this.platformService.removeAttribute(e,C);const s=this.platformService.getChildNodes(e);for(const i of s)this.platformService.appendChild(n,i);return this.platformService.insertBefore(this.platformService.getParentNode(e),n,e),this.platformService.removeChild(this.platformService.getParentNode(e),e),n}createContentSlotElements(e,t,n){let s;s=t.data.hasOwnProperty("content")&&Array.isArray(t.data.content)?t.data.content:[this.platformService.getChildNodes(e)],this.platformService.clearChildNodes(e);for(const[i,a]of s.entries())if(null!=a){const l=this.platformService.createElement("dynamic-component-contentslot");this.platformService.setAttribute(l,"slotIndex",i.toString()),this.platformService.setAttribute(l,"parsetoken",n);for(const c of a)this.platformService.appendChild(l,c);this.platformService.appendChild(e,l)}}extractContentSlotElements(e,t){const n=[],s=this.platformService.getChildNodes(e).filter(i=>"DYNAMIC-COMPONENT-CONTENTSLOT"===this.platformService.getTagName(i)&&this.platformService.getAttribute(i,"parsetoken")===t);for(const i of s){const a=this.platformService.getAttribute(i,"slotIndex");n[parseInt(a)]=this.platformService.getChildNodes(i)}return this.platformService.clearChildNodes(e),n}loadComponentClass(e){const t=new Ee.m(1);if(e.hasOwnProperty("prototype"))t.next(e);else if("function"==typeof e)e().then(n=>{t.next(n)});else{if(!e.hasOwnProperty("importPromise")||!e.hasOwnProperty("importName"))throw Error('The "component" property of a returned HookData object must either contain the component class, a function that returns a promise with the component class or an explicit LazyLoadComponentConfig');if(e.importPromise instanceof Promise)throw Error('When lazy-loading a component, the "importPromise"-field must contain a function returning the import-promise, but it contained the promise itself.');e.importPromise().then(n=>{const s=e.importName,i=Object.prototype.hasOwnProperty.call(n,s)?n[s]:n.default;t.next(i)})}return t}createComponent(e,t,n,s,i,a,l,c){const p=(0,$.a0P)(a,{hostElement:n,environmentInjector:e.data.environmentInjector||l,elementInjector:e.data.injector||c,projectableNodes:s});e.componentRef=p,this.mapOutputsToHTMLEvents(e,i),this.componentUpdater.updateBindings(e,t,i),"function"==typeof e.componentRef.instance.onDynamicChanges&&void 0!==t&&e.componentRef.instance.onDynamicChanges({context:t}),this.appRef.attachView(p.hostView),p.changeDetectorRef.detectChanges()}mapOutputsToHTMLEvents(e,t){const n=(0,$.HJs)(e.componentRef.componentType);for(const s of n.outputs){const i=t.ignoreOutputAliases?s.propName:s.templateName;e.htmlEventSubscriptions[i]=e.componentRef.instance[s.propName].subscribe(a=>{t.triggerDOMEvents&&this.platformService.dispatchEvent(e.componentRef?.location.nativeElement,i,a)})}}findContentChildren(e,t=[],n,s){const i=this.platformService.getChildNodes(e);null!=i&&i.length>0&&i.forEach((a,l)=>{let c=!1;const p=this.platformService.getAttribute(a,C);if(null!==p&&p===s&&this.platformService.getAttribute(a,I)){const u=parseInt(this.platformService.getAttribute(a,I),10);n.hasOwnProperty(u)&&(t.push({componentRef:n[u].componentRef,contentChildren:[],hookValue:n[u].value}),c=!0)}this.findContentChildren(a,c?t[t.length-1].contentChildren:t,n,s)})}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(S.Agw),f.KVO(S.o8S),f.KVO(Ve),f.KVO(V),f.KVO(A))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Me=(()=>{class o{constructor(e,t,n,s,i,a,l,c,p,d,u){this.allSettings=e,this.ancestorSettings=t,this.moduleSettings=n,this.settingsResolver=s,this.textHookFinder=i,this.elementHookFinder=a,this.contentSanitizer=l,this.componentCreator=c,this.platformService=p,this.environmentInjector=d,this.injector=u}parse(e=null,t=null,n=null,s=null,i=null,a=null,l=null,c={},p=null,d=null){const u=p||this.environmentInjector,h=d||this.injector,{parsers:g,options:m}=this.settingsResolver.resolve(h,e,this.allSettings,this.ancestorSettings,this.moduleSettings,t,s,i,a);if(!e)return(0,se.of)({element:l||this.platformService.createElement("div"),hookIndex:c,context:n,usedParsers:g,usedOptions:m,usedInjector:h,usedEnvironmentInjector:u,destroy:()=>this.destroy(c)});const w=Math.random().toString(36).substring(2,12);let x="string"==typeof e?this.platformService.createElement("div"):e;if(this.platformService.setAttribute(x,F,"1"),"string"==typeof e){const R=this.textHookFinder.find(e,n,g,w,m,c);this.platformService.setInnerContent(x,R.content)}else this.textHookFinder.findInElement(x,n,g,w,m,c);if(c=this.elementHookFinder.find(x,n,g,w,m,c),m?.sanitize&&this.contentSanitizer.sanitize(x,c,w),l&&l!==x){this.platformService.removeAttribute(x,F),this.platformService.setAttribute(l,F,"1"),this.platformService.clearChildNodes(l);for(const R of this.platformService.getChildNodes(x))this.platformService.appendChild(l,R);x=l}return this.componentCreator.init(x,c,w,n,m,u,h).pipe(Be()).pipe((0,ft.T)(R=>(this.platformService.removeAttribute(x,F),{element:x,hookIndex:c,context:n,usedParsers:g,usedOptions:m,usedInjector:h,usedEnvironmentInjector:u,destroy:()=>this.destroy(c)})))}destroy(e){if(e){for(const t of Object.values(e))t.componentRef&&t.componentRef.destroy();for(const t of Object.values(e)){for(const n of Object.values(t.outputSubscriptions))n&&n.unsubscribe();for(const n of Object.values(t.htmlEventSubscriptions))n&&n.unsubscribe()}}}static{this.\u0275fac=function(t){return new(t||o)(f.KVO(Pe,8),f.KVO(oe,8),f.KVO(Ne,8),f.KVO(Nt),f.KVO($t),f.KVO(Dt),f.KVO(Vt),f.KVO(zt),f.KVO(V),f.KVO(f.uvJ),f.KVO(f.zZn))}}static{this.\u0275prov=f.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),qt=(()=>{class o{constructor(e,t,n,s,i,a){this.hostElement=e,this.dynamicHooksService=t,this.componentUpdater=n,this.platformService=s,this.environmentInjector=i,this.injector=a,this.content=null,this.context=null,this.globalParsersBlacklist=null,this.globalParsersWhitelist=null,this.parsers=null,this.options=null,this.componentsLoaded=new f.bkB,this.hookIndex={},this.activeOptions={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}},this.activeParsers=[],this.token=Math.random().toString(36).substring(2,12),this.initialized=!1}ngDoCheck(){this.activeOptions.updateOnPushOnly||this.refresh(!1)}ngOnChanges(e){e.hasOwnProperty("content")||e.hasOwnProperty("globalParsersBlacklist")||e.hasOwnProperty("globalParsersWhitelist")||e.hasOwnProperty("parsers")||e.hasOwnProperty("options")?(this.reset(),this.parse(this.content)):e.hasOwnProperty("context")&&this.refresh(!0)}ngAfterViewInit(){}ngAfterViewChecked(){}ngOnDestroy(){this.reset()}reset(){this.dynamicHooksService.destroy(this.hookIndex),this.platformService.setInnerContent(this.hostElement.nativeElement,""),this.hookIndex={},this.activeOptions={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}},this.activeParsers=[],this.initialized=!1}parse(e){this.dynamicHooksService.parse(e,this.parsers,this.context,this.options,this.globalParsersBlacklist,this.globalParsersWhitelist,this.hostElement.nativeElement,this.hookIndex,this.environmentInjector,this.injector).subscribe(t=>{this.activeParsers=t.usedParsers,this.activeOptions=t.usedOptions,this.initialized=!0;const n=Object.values(this.hookIndex).map(s=>({hookId:s.id,hookValue:s.value,hookParser:s.parser,componentRef:s.componentRef}));this.componentsLoaded.emit(n)})}refresh(e){this.initialized&&this.componentUpdater.refresh(this.hookIndex,this.context,this.activeOptions,e)}static{this.\u0275fac=function(t){return new(t||o)(S.rXU(S.aKT),S.rXU(Me),S.rXU(Ve),S.rXU(V),S.rXU(f.uvJ),S.rXU(f.zZn))}}static{this.\u0275cmp=S.VBU({type:o,selectors:[["ngx-dynamic-hooks"]],inputs:{content:"content",context:"context",globalParsersBlacklist:"globalParsersBlacklist",globalParsersWhitelist:"globalParsersWhitelist",parsers:"parsers",options:"options"},outputs:{componentsLoaded:"componentsLoaded"},features:[S.OA$],decls:0,vars:0,template:function(t,n){},encapsulation:2})}}return o})();var M={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function ze(o){M=o}var W={exec:()=>null};function y(o,r=""){let e="string"==typeof o?o:o.source;const t={replace:(n,s)=>{let i="string"==typeof s?s:s.source;return i=i.replace(E.caret,"$1"),e=e.replace(n,i),t},getRegex:()=>new RegExp(e,r)};return t}var E={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:o=>new RegExp(`^( {0,3}${o})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}#`),htmlBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}<(?:[a-z].*>|!--)`,"i")},K=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,de=/(?:[*+-]|\d{1,9}[.)])/,je=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Le=y(je).replace(/bull/g,de).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Xt=y(je).replace(/bull/g,de).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ge=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,fe=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Yt=y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",fe).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),en=y(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,de).getRegex(),J="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",me=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,tn=y("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",me).replace("tag",J).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Fe=y(ge).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",J).getRegex(),be={blockquote:y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Fe).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:Yt,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:K,html:tn,lheading:Le,list:en,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:Fe,table:W,text:/^[^\n]+/},_e=y("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",J).getRegex(),rn={...be,lheading:Xt,table:_e,paragraph:y(ge).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",_e).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",J).getRegex()},sn={...be,html:y("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",me).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:W,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:y(ge).replace("hr",K).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Le).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},We=/^( {2,}|\\)\n(?!\s*$)/,Y=/[\p{P}\p{S}]/u,ye=/[\s\p{P}\p{S}]/u,Ke=/[^\s\p{P}\p{S}]/u,cn=y(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ye).getRegex(),qe=/(?!~)[\p{P}\p{S}]/u,Ze=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,dn=y(Ze,"u").replace(/punct/g,Y).getRegex(),gn=y(Ze,"u").replace(/punct/g,qe).getRegex(),Ue="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",fn=y(Ue,"gu").replace(/notPunctSpace/g,Ke).replace(/punctSpace/g,ye).replace(/punct/g,Y).getRegex(),mn=y(Ue,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,qe).getRegex(),bn=y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ke).replace(/punctSpace/g,ye).replace(/punct/g,Y).getRegex(),yn=y(/\\(punct)/,"gu").replace(/punct/g,Y).getRegex(),vn=y(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),kn=y(me).replace("(?:--\x3e|$)","--\x3e").getRegex(),xn=y("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",kn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ee=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,wn=y(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ee).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Qe=y(/^!?\[(label)\]\[(ref)\]/).replace("label",ee).replace("ref",fe).getRegex(),Ge=y(/^!?\[(ref)\](?:\[\])?/).replace("ref",fe).getRegex(),ve={_backpedal:W,anyPunctuation:yn,autolink:vn,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:We,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:W,emStrongLDelim:dn,emStrongRDelimAst:fn,emStrongRDelimUnd:bn,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:wn,nolink:Ge,punctuation:cn,reflink:Qe,reflinkSearch:y("reflink|nolink(?!\\()","g").replace("reflink",Qe).replace("nolink",Ge).getRegex(),tag:xn,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:W},In={...ve,link:y(/^!?\[(label)\]\((.*?)\)/).replace("label",ee).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ee).getRegex()},ke={...ve,emStrongRDelimAst:mn,emStrongLDelim:gn,url:y(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Tn={...ke,br:y(We).replace("{2,}","*").getRegex(),text:y(ke.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},te={normal:be,gfm:rn,pedantic:sn},q={normal:ve,gfm:ke,breaks:Tn,pedantic:In},En={"&":"&","<":"<",">":">",'"':""","'":"'"},Xe=o=>En[o];function O(o,r){if(r){if(E.escapeTest.test(o))return o.replace(E.escapeReplace,Xe)}else if(E.escapeTestNoEncode.test(o))return o.replace(E.escapeReplaceNoEncode,Xe);return o}function Je(o){try{o=encodeURI(o).replace(E.percentDecode,"%")}catch{return null}return o}function Ye(o,r){const t=o.replace(E.findPipe,(s,i,a)=>{let l=!1,c=i;for(;--c>=0&&"\\"===a[c];)l=!l;return l?"|":" |"}).split(E.splitPipe);let n=0;if(t[0].trim()||t.shift(),t.length>0&&!t.at(-1)?.trim()&&t.pop(),r)if(t.length>r)t.splice(r);else for(;t.length<r;)t.push("");for(;n<t.length;n++)t[n]=t[n].trim().replace(E.slashPipe,"|");return t}function Z(o,r,e){const t=o.length;if(0===t)return"";let n=0;for(;n<t;){const s=o.charAt(t-n-1);if(s!==r||e){if(s===r||!e)break;n++}else n++}return o.slice(0,t-n)}function et(o,r,e,t,n){const s=r.href,i=r.title||null,a=o[1].replace(n.other.outputLinkReplace,"$1");t.state.inLink=!0;const l={type:"!"===o[0].charAt(0)?"image":"link",raw:e,href:s,title:i,text:a,tokens:t.inlineTokens(a)};return t.state.inLink=!1,l}var ne=class{options;rules;lexer;constructor(o){this.options=o||M}space(o){const r=this.rules.block.newline.exec(o);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(o){const r=this.rules.block.code.exec(o);if(r){const e=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Z(e,"\n")}}}fences(o){const r=this.rules.block.fences.exec(o);if(r){const e=r[0],t=function Rn(o,r,e){const t=o.match(e.other.indentCodeCompensation);if(null===t)return r;const n=t[1];return r.split("\n").map(s=>{const i=s.match(e.other.beginningSpace);if(null===i)return s;const[a]=i;return a.length>=n.length?s.slice(n.length):s}).join("\n")}(e,r[3]||"",this.rules);return{type:"code",raw:e,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:t}}}heading(o){const r=this.rules.block.heading.exec(o);if(r){let e=r[2].trim();if(this.rules.other.endingHash.test(e)){const t=Z(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(o){const r=this.rules.block.hr.exec(o);if(r)return{type:"hr",raw:Z(r[0],"\n")}}blockquote(o){const r=this.rules.block.blockquote.exec(o);if(r){let e=Z(r[0],"\n").split("\n"),t="",n="";const s=[];for(;e.length>0;){let i=!1;const a=[];let l;for(l=0;l<e.length;l++)if(this.rules.other.blockquoteStart.test(e[l]))a.push(e[l]),i=!0;else{if(i)break;a.push(e[l])}e=e.slice(l);const c=a.join("\n"),p=c.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");t=t?`${t}\n${c}`:c,n=n?`${n}\n${p}`:p;const d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,s,!0),this.lexer.state.top=d,0===e.length)break;const u=s.at(-1);if("code"===u?.type)break;if("blockquote"===u?.type){const h=u,g=h.raw+"\n"+e.join("\n"),m=this.blockquote(g);s[s.length-1]=m,t=t.substring(0,t.length-h.raw.length)+m.raw,n=n.substring(0,n.length-h.text.length)+m.text;break}if("list"===u?.type){const h=u,g=h.raw+"\n"+e.join("\n"),m=this.list(g);s[s.length-1]=m,t=t.substring(0,t.length-u.raw.length)+m.raw,n=n.substring(0,n.length-h.raw.length)+m.raw,e=g.substring(s.at(-1).raw.length).split("\n");continue}}return{type:"blockquote",raw:t,tokens:s,text:n}}}list(o){let r=this.rules.block.list.exec(o);if(r){let e=r[1].trim();const t=e.length>1,n={type:"list",raw:"",ordered:t,start:t?+e.slice(0,-1):"",loose:!1,items:[]};e=t?`\\d{1,9}\\${e.slice(-1)}`:`\\${e}`,this.options.pedantic&&(e=t?e:"[*+-]");const s=this.rules.other.listItemRegex(e);let i=!1;for(;o;){let l=!1,c="",p="";if(!(r=s.exec(o))||this.rules.block.hr.test(o))break;c=r[0],o=o.substring(c.length);let d=r[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,x=>" ".repeat(3*x.length)),u=o.split("\n",1)[0],h=!d.trim(),g=0;if(this.options.pedantic?(g=2,p=d.trimStart()):h?g=r[1].length+1:(g=r[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,p=d.slice(g),g+=r[1].length),h&&this.rules.other.blankLine.test(u)&&(c+=u+"\n",o=o.substring(u.length+1),l=!0),!l){const x=this.rules.other.nextBulletRegex(g),R=this.rules.other.hrRegex(g),Q=this.rules.other.fencesBeginRegex(g),j=this.rules.other.headingBeginRegex(g),H=this.rules.other.htmlBeginRegex(g);for(;o;){const L=o.split("\n",1)[0];let B;if(u=L,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),B=u):B=u.replace(this.rules.other.tabCharGlobal," "),Q.test(u)||j.test(u)||H.test(u)||x.test(u)||R.test(u))break;if(B.search(this.rules.other.nonSpaceChar)>=g||!u.trim())p+="\n"+B.slice(g);else{if(h||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||Q.test(d)||j.test(d)||R.test(d))break;p+="\n"+u}!h&&!u.trim()&&(h=!0),c+=L+"\n",o=o.substring(L.length+1),d=B.slice(g)}}n.loose||(i?n.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(i=!0));let w,m=null;this.options.gfm&&(m=this.rules.other.listIsTask.exec(p),m&&(w="[ ] "!==m[0],p=p.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:c,task:!!m,checked:w,loose:!1,text:p,tokens:[]}),n.raw+=c}const a=n.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),n.raw=n.raw.trimEnd();for(let l=0;l<n.items.length;l++)if(this.lexer.state.top=!1,n.items[l].tokens=this.lexer.blockTokens(n.items[l].text,[]),!n.loose){const c=n.items[l].tokens.filter(d=>"space"===d.type),p=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.raw));n.loose=p}if(n.loose)for(let l=0;l<n.items.length;l++)n.items[l].loose=!0;return n}}html(o){const r=this.rules.block.html.exec(o);if(r)return{type:"html",block:!0,raw:r[0],pre:"pre"===r[1]||"script"===r[1]||"style"===r[1],text:r[0]}}def(o){const r=this.rules.block.def.exec(o);if(r){const e=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),t=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:e,raw:r[0],href:t,title:n}}}table(o){const r=this.rules.block.table.exec(o);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;const e=Ye(r[1]),t=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],s={type:"table",raw:r[0],header:[],align:[],rows:[]};if(e.length===t.length){for(const i of t)this.rules.other.tableAlignRight.test(i)?s.align.push("right"):this.rules.other.tableAlignCenter.test(i)?s.align.push("center"):this.rules.other.tableAlignLeft.test(i)?s.align.push("left"):s.align.push(null);for(let i=0;i<e.length;i++)s.header.push({text:e[i],tokens:this.lexer.inline(e[i]),header:!0,align:s.align[i]});for(const i of n)s.rows.push(Ye(i,s.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:s.align[l]})));return s}}lheading(o){const r=this.rules.block.lheading.exec(o);if(r)return{type:"heading",raw:r[0],depth:"="===r[2].charAt(0)?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(o){const r=this.rules.block.paragraph.exec(o);if(r){const e="\n"===r[1].charAt(r[1].length-1)?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:e,tokens:this.lexer.inline(e)}}}text(o){const r=this.rules.block.text.exec(o);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(o){const r=this.rules.inline.escape.exec(o);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(o){const r=this.rules.inline.tag.exec(o);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(o){const r=this.rules.inline.link.exec(o);if(r){const e=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;const s=Z(e.slice(0,-1),"\\");if((e.length-s.length)%2==0)return}else{const s=function Cn(o,r){if(-1===o.indexOf(r[1]))return-1;let e=0;for(let t=0;t<o.length;t++)if("\\"===o[t])t++;else if(o[t]===r[0])e++;else if(o[t]===r[1]&&(e--,e<0))return t;return e>0?-2:-1}(r[2],"()");if(-2===s)return;if(s>-1){const a=(0===r[0].indexOf("!")?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,a).trim(),r[3]=""}}let t=r[2],n="";if(this.options.pedantic){const s=this.rules.other.pedanticHrefTitle.exec(t);s&&(t=s[1],n=s[3])}else n=r[3]?r[3].slice(1,-1):"";return t=t.trim(),this.rules.other.startAngleBracket.test(t)&&(t=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?t.slice(1):t.slice(1,-1)),et(r,{href:t&&t.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(o,r){let e;if((e=this.rules.inline.reflink.exec(o))||(e=this.rules.inline.nolink.exec(o))){const n=r[(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!n){const s=e[0].charAt(0);return{type:"text",raw:s,text:s}}return et(e,n,e[0],this.lexer,this.rules)}}emStrong(o,r,e=""){let t=this.rules.inline.emStrongLDelim.exec(o);if(!(!t||t[3]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!t[1]&&!t[2]||!e||this.rules.inline.punctuation.exec(e))){const s=[...t[0]].length-1;let i,a,l=s,c=0;const p="*"===t[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,r=r.slice(-1*o.length+s);null!=(t=p.exec(r));){if(i=t[1]||t[2]||t[3]||t[4]||t[5]||t[6],!i)continue;if(a=[...i].length,t[3]||t[4]){l+=a;continue}if((t[5]||t[6])&&s%3&&!((s+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);const d=[...t[0]][0].length,u=o.slice(0,s+t.index+d+a);if(Math.min(s,a)%2){const g=u.slice(1,-1);return{type:"em",raw:u,text:g,tokens:this.lexer.inlineTokens(g)}}const h=u.slice(2,-2);return{type:"strong",raw:u,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(o){const r=this.rules.inline.code.exec(o);if(r){let e=r[2].replace(this.rules.other.newLineCharGlobal," ");const t=this.rules.other.nonSpaceChar.test(e),n=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return t&&n&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:r[0],text:e}}}br(o){const r=this.rules.inline.br.exec(o);if(r)return{type:"br",raw:r[0]}}del(o){const r=this.rules.inline.del.exec(o);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(o){const r=this.rules.inline.autolink.exec(o);if(r){let e,t;return"@"===r[2]?(e=r[1],t="mailto:"+e):(e=r[1],t=e),{type:"link",raw:r[0],text:e,href:t,tokens:[{type:"text",raw:e,text:e}]}}}url(o){let r;if(r=this.rules.inline.url.exec(o)){let e,t;if("@"===r[2])e=r[0],t="mailto:"+e;else{let n;do{n=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??""}while(n!==r[0]);e=r[0],t="www."===r[1]?"http://"+r[0]:r[0]}return{type:"link",raw:r[0],text:e,href:t,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(o){const r=this.rules.inline.text.exec(o);if(r)return{type:"text",raw:r[0],text:r[0],escaped:this.lexer.state.inRawBlock}}},P=class we{tokens;options;state;tokenizer;inlineQueue;constructor(r){this.tokens=[],this.tokens.links=Object.create(null),this.options=r||M,this.options.tokenizer=this.options.tokenizer||new ne,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const e={other:E,block:te.normal,inline:q.normal};this.options.pedantic?(e.block=te.pedantic,e.inline=q.pedantic):this.options.gfm&&(e.block=te.gfm,e.inline=this.options.breaks?q.breaks:q.gfm),this.tokenizer.rules=e}static get rules(){return{block:te,inline:q}}static lex(r,e){return new we(e).lex(r)}static lexInline(r,e){return new we(e).inlineTokens(r)}lex(r){r=r.replace(E.carriageReturn,"\n"),this.blockTokens(r,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(r,e=[],t=!1){for(this.options.pedantic&&(r=r.replace(E.tabCharGlobal," ").replace(E.spaceLine,""));r;){let n;if(this.options.extensions?.block?.some(i=>!!(n=i.call({lexer:this},r,e))&&(r=r.substring(n.raw.length),e.push(n),!0)))continue;if(n=this.tokenizer.space(r)){r=r.substring(n.raw.length);const i=e.at(-1);1===n.raw.length&&void 0!==i?i.raw+="\n":e.push(n);continue}if(n=this.tokenizer.code(r)){r=r.substring(n.raw.length);const i=e.at(-1);"paragraph"===i?.type||"text"===i?.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.at(-1).src=i.text):e.push(n);continue}if(n=this.tokenizer.fences(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.heading(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.hr(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.blockquote(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.list(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.html(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.def(r)){r=r.substring(n.raw.length);const i=e.at(-1);"paragraph"===i?.type||"text"===i?.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.lheading(r)){r=r.substring(n.raw.length),e.push(n);continue}let s=r;if(this.options.extensions?.startBlock){let i=1/0;const a=r.slice(1);let l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},a),"number"==typeof l&&l>=0&&(i=Math.min(i,l))}),i<1/0&&i>=0&&(s=r.substring(0,i+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s))){const i=e.at(-1);t&&"paragraph"===i?.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):e.push(n),t=s.length!==r.length,r=r.substring(n.raw.length);continue}if(n=this.tokenizer.text(r)){r=r.substring(n.raw.length);const i=e.at(-1);"text"===i?.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):e.push(n);continue}if(r){const i="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(i);break}throw new Error(i)}}return this.state.top=!0,e}inline(r,e=[]){return this.inlineQueue.push({src:r,tokens:e}),e}inlineTokens(r,e=[]){let t=r,n=null;if(this.tokens.links){const a=Object.keys(this.tokens.links);if(a.length>0)for(;null!=(n=this.tokenizer.rules.inline.reflinkSearch.exec(t));)a.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(t=t.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+t.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(n=this.tokenizer.rules.inline.anyPunctuation.exec(t));)t=t.slice(0,n.index)+"++"+t.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(n=this.tokenizer.rules.inline.blockSkip.exec(t));)t=t.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+t.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,i="";for(;r;){let a;if(s||(i=""),s=!1,this.options.extensions?.inline?.some(c=>!!(a=c.call({lexer:this},r,e))&&(r=r.substring(a.raw.length),e.push(a),!0)))continue;if(a=this.tokenizer.escape(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.tag(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.link(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.reflink(r,this.tokens.links)){r=r.substring(a.raw.length);const c=e.at(-1);"text"===a.type&&"text"===c?.type?(c.raw+=a.raw,c.text+=a.text):e.push(a);continue}if(a=this.tokenizer.emStrong(r,t,i)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.codespan(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.br(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.del(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.autolink(r)){r=r.substring(a.raw.length),e.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(r))){r=r.substring(a.raw.length),e.push(a);continue}let l=r;if(this.options.extensions?.startInline){let c=1/0;const p=r.slice(1);let d;this.options.extensions.startInline.forEach(u=>{d=u.call({lexer:this},p),"number"==typeof d&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(l=r.substring(0,c+1))}if(a=this.tokenizer.inlineText(l)){r=r.substring(a.raw.length),"_"!==a.raw.slice(-1)&&(i=a.raw.slice(-1)),s=!0;const c=e.at(-1);"text"===c?.type?(c.raw+=a.raw,c.text+=a.text):e.push(a);continue}if(r){const c="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}return e}},U=class{options;parser;constructor(o){this.options=o||M}space(o){return""}code({text:o,lang:r,escaped:e}){const t=(r||"").match(E.notSpaceStart)?.[0],n=o.replace(E.endingNewline,"")+"\n";return t?'<pre><code class="language-'+O(t)+'">'+(e?n:O(n,!0))+"</code></pre>\n":"<pre><code>"+(e?n:O(n,!0))+"</code></pre>\n"}blockquote({tokens:o}){return`<blockquote>\n${this.parser.parse(o)}</blockquote>\n`}html({text:o}){return o}heading({tokens:o,depth:r}){return`<h${r}>${this.parser.parseInline(o)}</h${r}>\n`}hr(o){return"<hr>\n"}list(o){const r=o.ordered,e=o.start;let t="";for(let i=0;i<o.items.length;i++)t+=this.listitem(o.items[i]);const n=r?"ol":"ul";return"<"+n+(r&&1!==e?' start="'+e+'"':"")+">\n"+t+"</"+n+">\n"}listitem(o){let r="";if(o.task){const e=this.checkbox({checked:!!o.checked});o.loose?"paragraph"===o.tokens[0]?.type?(o.tokens[0].text=e+" "+o.tokens[0].text,o.tokens[0].tokens&&o.tokens[0].tokens.length>0&&"text"===o.tokens[0].tokens[0].type&&(o.tokens[0].tokens[0].text=e+" "+O(o.tokens[0].tokens[0].text),o.tokens[0].tokens[0].escaped=!0)):o.tokens.unshift({type:"text",raw:e+" ",text:e+" ",escaped:!0}):r+=e+" "}return r+=this.parser.parse(o.tokens,!!o.loose),`<li>${r}</li>\n`}checkbox({checked:o}){return"<input "+(o?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:o}){return`<p>${this.parser.parseInline(o)}</p>\n`}table(o){let r="",e="";for(let n=0;n<o.header.length;n++)e+=this.tablecell(o.header[n]);r+=this.tablerow({text:e});let t="";for(let n=0;n<o.rows.length;n++){const s=o.rows[n];e="";for(let i=0;i<s.length;i++)e+=this.tablecell(s[i]);t+=this.tablerow({text:e})}return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+r+"</thead>\n"+t+"</table>\n"}tablerow({text:o}){return`<tr>\n${o}</tr>\n`}tablecell(o){const r=this.parser.parseInline(o.tokens),e=o.header?"th":"td";return(o.align?`<${e} align="${o.align}">`:`<${e}>`)+r+`</${e}>\n`}strong({tokens:o}){return`<strong>${this.parser.parseInline(o)}</strong>`}em({tokens:o}){return`<em>${this.parser.parseInline(o)}</em>`}codespan({text:o}){return`<code>${O(o,!0)}</code>`}br(o){return"<br>"}del({tokens:o}){return`<del>${this.parser.parseInline(o)}</del>`}link({href:o,title:r,tokens:e}){const t=this.parser.parseInline(e),n=Je(o);if(null===n)return t;let s='<a href="'+(o=n)+'"';return r&&(s+=' title="'+O(r)+'"'),s+=">"+t+"</a>",s}image({href:o,title:r,text:e,tokens:t}){t&&(e=this.parser.parseInline(t,this.parser.textRenderer));const n=Je(o);if(null===n)return O(e);let s=`<img src="${o=n}" alt="${e}"`;return r&&(s+=` title="${O(r)}"`),s+=">",s}text(o){return"tokens"in o&&o.tokens?this.parser.parseInline(o.tokens):"escaped"in o&&o.escaped?o.text:O(o.text)}},xe=class{strong({text:o}){return o}em({text:o}){return o}codespan({text:o}){return o}del({text:o}){return o}html({text:o}){return o}text({text:o}){return o}link({text:o}){return""+o}image({text:o}){return""+o}br(){return""}},N=class Se{options;renderer;textRenderer;constructor(r){this.options=r||M,this.options.renderer=this.options.renderer||new U,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new xe}static parse(r,e){return new Se(e).parse(r)}static parseInline(r,e){return new Se(e).parseInline(r)}parse(r,e=!0){let t="";for(let n=0;n<r.length;n++){const s=r[n];if(this.options.extensions?.renderers?.[s.type]){const a=s,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(!1!==l||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){t+=l||"";continue}}const i=s;switch(i.type){case"space":t+=this.renderer.space(i);continue;case"hr":t+=this.renderer.hr(i);continue;case"heading":t+=this.renderer.heading(i);continue;case"code":t+=this.renderer.code(i);continue;case"table":t+=this.renderer.table(i);continue;case"blockquote":t+=this.renderer.blockquote(i);continue;case"list":t+=this.renderer.list(i);continue;case"html":t+=this.renderer.html(i);continue;case"paragraph":t+=this.renderer.paragraph(i);continue;case"text":{let a=i,l=this.renderer.text(a);for(;n+1<r.length&&"text"===r[n+1].type;)a=r[++n],l+="\n"+this.renderer.text(a);t+=e?this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):l;continue}default:{const a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return t}parseInline(r,e=this.renderer){let t="";for(let n=0;n<r.length;n++){const s=r[n];if(this.options.extensions?.renderers?.[s.type]){const a=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==a||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){t+=a||"";continue}}const i=s;switch(i.type){case"escape":case"text":t+=e.text(i);break;case"html":t+=e.html(i);break;case"link":t+=e.link(i);break;case"image":t+=e.image(i);break;case"strong":t+=e.strong(i);break;case"em":t+=e.em(i);break;case"codespan":t+=e.codespan(i);break;case"br":t+=e.br(i);break;case"del":t+=e.del(i);break;default:{const a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return t}},re=class{options;block;constructor(r){this.options=r||M}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}provideLexer(){return this.block?P.lex:P.lexInline}provideParser(){return this.block?N.parse:N.parseInline}},z=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=N;Renderer=U;TextRenderer=xe;Lexer=P;Tokenizer=ne;Hooks=re;constructor(...o){this.use(...o)}walkTokens(o,r){let e=[];for(const t of o)switch(e=e.concat(r.call(this,t)),t.type){case"table":{const n=t;for(const s of n.header)e=e.concat(this.walkTokens(s.tokens,r));for(const s of n.rows)for(const i of s)e=e.concat(this.walkTokens(i.tokens,r));break}case"list":e=e.concat(this.walkTokens(t.items,r));break;default:{const n=t;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(s=>{const i=n[s].flat(1/0);e=e.concat(this.walkTokens(i,r))}):n.tokens&&(e=e.concat(this.walkTokens(n.tokens,r)))}}return e}use(...o){const r=this.defaults.extensions||{renderers:{},childTokens:{}};return o.forEach(e=>{const t={...e};if(t.async=this.defaults.async||t.async||!1,e.extensions&&(e.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){const s=r.renderers[n.name];r.renderers[n.name]=s?function(...i){let a=n.renderer.apply(this,i);return!1===a&&(a=s.apply(this,i)),a}:n.renderer}if("tokenizer"in n){if(!n.level||"block"!==n.level&&"inline"!==n.level)throw new Error("extension level must be 'block' or 'inline'");const s=r[n.level];s?s.unshift(n.tokenizer):r[n.level]=[n.tokenizer],n.start&&("block"===n.level?r.startBlock?r.startBlock.push(n.start):r.startBlock=[n.start]:"inline"===n.level&&(r.startInline?r.startInline.push(n.start):r.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(r.childTokens[n.name]=n.childTokens)}),t.extensions=r),e.renderer){const n=this.defaults.renderer||new U(this.defaults);for(const s in e.renderer){if(!(s in n))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;const a=e.renderer[s],l=n[s];n[s]=(...c)=>{let p=a.apply(n,c);return!1===p&&(p=l.apply(n,c)),p||""}}t.renderer=n}if(e.tokenizer){const n=this.defaults.tokenizer||new ne(this.defaults);for(const s in e.tokenizer){if(!(s in n))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;const a=e.tokenizer[s],l=n[s];n[s]=(...c)=>{let p=a.apply(n,c);return!1===p&&(p=l.apply(n,c)),p}}t.tokenizer=n}if(e.hooks){const n=this.defaults.hooks||new re;for(const s in e.hooks){if(!(s in n))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;const a=e.hooks[s],l=n[s];n[s]=re.passThroughHooks.has(s)?c=>{if(this.defaults.async)return Promise.resolve(a.call(n,c)).then(d=>l.call(n,d));const p=a.call(n,c);return l.call(n,p)}:(...c)=>{let p=a.apply(n,c);return!1===p&&(p=l.apply(n,c)),p}}t.hooks=n}if(e.walkTokens){const n=this.defaults.walkTokens,s=e.walkTokens;t.walkTokens=function(i){let a=[];return a.push(s.call(this,i)),n&&(a=a.concat(n.call(this,i))),a}}this.defaults={...this.defaults,...t}}),this}setOptions(o){return this.defaults={...this.defaults,...o},this}lexer(o,r){return P.lex(o,r??this.defaults)}parser(o,r){return N.parse(o,r??this.defaults)}parseMarkdown(o){return(e,t)=>{const n={...t},s={...this.defaults,...n},i=this.onError(!!s.silent,!!s.async);if(!0===this.defaults.async&&!1===n.async)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||null===e)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof e)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=o);const a=s.hooks?s.hooks.provideLexer():o?P.lex:P.lexInline,l=s.hooks?s.hooks.provideParser():o?N.parse:N.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(e):e).then(c=>a(c,s)).then(c=>s.hooks?s.hooks.processAllTokens(c):c).then(c=>s.walkTokens?Promise.all(this.walkTokens(c,s.walkTokens)).then(()=>c):c).then(c=>l(c,s)).then(c=>s.hooks?s.hooks.postprocess(c):c).catch(i);try{s.hooks&&(e=s.hooks.preprocess(e));let c=a(e,s);s.hooks&&(c=s.hooks.processAllTokens(c)),s.walkTokens&&this.walkTokens(c,s.walkTokens);let p=l(c,s);return s.hooks&&(p=s.hooks.postprocess(p)),p}catch(c){return i(c)}}}onError(o,r){return e=>{if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",o){const t="<p>An error occurred:</p><pre>"+O(e.message+"",!0)+"</pre>";return r?Promise.resolve(t):t}if(r)return Promise.reject(e);throw e}}};function v(o,r){return z.parse(o,r)}v.options=v.setOptions=function(o){return z.setOptions(o),ze(v.defaults=z.defaults),v},v.getDefaults=function he(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},v.defaults=M,v.use=function(...o){return z.use(...o),ze(v.defaults=z.defaults),v},v.walkTokens=function(o,r){return z.walkTokens(o,r)},v.parseInline=z.parseInline,v.Parser=N,v.parser=N.parse,v.Renderer=U,v.TextRenderer=xe,v.Lexer=P,v.lexer=P.lex,v.Tokenizer=ne,v.Hooks=re,v.parse=v;var tt=k(58),nt=k(2306),Bn=k(140);class An extends U{baseSize;documentListHandlers;entityListHandlers;_handlers;context={};counters={};getIndex(r){const e=this.counters[r]||0;return this.counters[r]=e+1,e}constructor(r="m",e){super(),this.baseSize=r,this._handlers=e,this.documentListHandlers=e?.documentList,this.entityListHandlers=e?.entityList,this.setupRenderers()}resetContext(){this.context={},this.counters={}}getContext(){return this.context}scaleSize(r){const e=["xs","s","m","l","xl"],t=e.indexOf(this.baseSize),n=e.indexOf(r);return e[Math.max(0,Math.min(e.length-1,n+(t-2)))]}setupRenderers(){this.heading=({tokens:r,depth:e})=>{const i=this.scaleSize({1:"xl",2:"l",3:"l",4:"m",5:"m",6:"s"}[e]),a={1:"bold",2:"semibold",3:"semibold",4:"semibold",5:"medium",6:"medium"}[e],l=this.parser?.parseInline(r)||"";return`<cue-typography size="${i}" weight="${a}"${this.getIndex("heading")>0?' style="margin-top: 24px; display: block;"':' style="display: block;"'}>${l}</cue-typography>\n`},this.paragraph=({tokens:r})=>{const e=this.scaleSize("m"),t=this.parser?.parseInline(r)||"";return/^(?:\s*,?\s*<cue-href-chip\b[^>]*><\/cue-href-chip>)+\s*$/.test(t)?`<div style="display: flex; gap: 6px; flex-wrap: wrap;">${t.replace(/(<\/cue-href-chip>)\s*,?\s*/g,"$1").trim()}</div>\n`:`<div class="cue-md-p"><cue-typography size="${e}" weight="regular">${t}</cue-typography></div>\n`},this.listitem=({tokens:r})=>{const e=this.scaleSize("m");return`<li class="cue-md-li" style="font-size: var(--cue-font-${e}-size);"><cue-typography size="${e}" weight="regular">${this.parser?.parseInline(r)||""}</cue-typography></li>`},this.tablecell=({tokens:r,header:e,align:t})=>{const n=e?"th":"td",i=e?"semibold":"regular";return`<${n}${t?` style="text-align: ${t}"`:""}><cue-typography size="${this.scaleSize("m")}" weight="${i}">${this.parser?.parseInline(r)||""}</cue-typography></${n}>`},this.blockquote=({text:r,tokens:e})=>/^\[!(NOTE|WARNING|IMPORTANT|TIP|CAUTION)\]/i.test(r.trimStart())?"":`<blockquote class="cue-md-blockquote"><cue-typography size="${this.scaleSize("m")}" weight="regular">${this.parser?.parse(e)||""}</cue-typography></blockquote>`,this.link=({href:r,title:e,tokens:t})=>{const n=this.parser?.parseInline(t)||"";if(!r){const i=this.getIndex("hrefchip"),a=`hrefchip_menuitems_${i}`,l=`hrefchip_id_${i}`,c=`hrefchip_click_${i}`,p=n.replace(/<[^>]*>/g,"");return this.context[l]=p,this.context[a]=()=>this._handlers?.hrefChip?.menuItems?.(p)??[],this.context[c]=()=>{this._handlers?.hrefChip?.clicked?.(p)},`<cue-href-chip [label]="context.${l}" [menuItems]="context.${a}()" (clicked)="context.${c}()"></cue-href-chip>`}return`<a href="${r}"${e?` title="${e}"`:""} target="_blank" rel="noopener noreferrer">${n}</a>`},this.codespan=({text:r})=>`<code class="cue-code-inline">${r}</code>`,this.code=r=>{const e="36px";if("document-list"===r.lang){const t=r.documentRefs;if(!t||0===t.length)return"";const s=`doc_refs_${this.getIndex("doc")}`;return this.context[s]=t,this._handlers?.availableContentCategories&&(this.context.availableContentCategories=this._handlers.availableContentCategories),`<cue-document-list [documentRefs]="context.${s}" [documentdata]="context.documentdata" [handlers]="context.documentlisthandlers" [availableContentCategories]="context.availableContentCategories" (clickedDocument)="context.documentclickedrow($event)" style="margin-bottom: ${e};"></cue-document-list>`}if("entity-list"===r.lang){const t=r.iris;if(!t)return"";const s=`entity_iris_${this.getIndex("entity")}`;return this.context[s]=t,this._handlers?.availableEntityCategories&&(this.context.availableEntityCategories=this._handlers.availableEntityCategories),this._handlers?.availableEntityRelationships&&(this.context.availableEntityRelationships=this._handlers.availableEntityRelationships),`<cue-ent-list [entities]="context.${s}" [entitydata]="context.entitydata" [entityLocations]="context.entitylocations" [handlers]="context.entitylisthandlers" [availableEntityCategories]="context.availableEntityCategories" [availableEntityRelationships]="context.availableEntityRelationships" [mapboxToken]="context.mapboxToken" (rowClicked)="context.entityclickedrow($event)" style="margin-bottom: ${e};"></cue-ent-list>`}if("map"===r.lang){const t=r.mapData;if(!t||!t.layers)return"";const n=this.getIndex("map"),s=`map_layers_${n}`,i=`map_settings_${n}`;return this.context[s]=t.layers,this.context[i]=t.settings,`<cue-card style="height: 300px; display: block; margin-bottom: ${e};" [padded]="false"><cue-map [layers]="context.${s}" [settings]="context.${i}"></cue-map></cue-card>`}return`<div style="margin-bottom: ${e};">${super.code(r)}</div>`}}walkTokens(r){return(0,Ie.A)(function*(){if("code"===r.type&&"document-list"===r.lang){const e=r.text.split("\n").filter(s=>s.trim().length>0),t=new Map,n=[];for(const s of e){const i=s.trim(),a=i.match(/^(.+)\?page=(\d+)$/);if(a){const l=a[1],c=a[2];t.has(l)||(t.set(l,{id:l,pages:[]}),n.push(l));const p=t.get(l);p.pages||(p.pages=[]),p.pages.push({id:i,page:c,relevance:0})}else t.has(i)||(t.set(i,{id:i}),n.push(i))}r.documentRefs=n.map(s=>t.get(s))}if("code"===r.type&&"entity-list"===r.lang){const e=r.text.split("\n").filter(t=>t.trim().length>0);r.iris=e}if("code"===r.type&&"map"===r.lang){const e=r.text.split("\n").filter(l=>l.trim().length>0),t=e[0]?.trim()||"",n=e.slice(1),s={};n.forEach(l=>{const c=l.split(";"),p=c[0]?.trim(),d=c[1]?.trim(),u=c[2]?.trim();if(!p||!d)return;const h=(0,tt.S)(d);if(!h)return;const g=(0,tt.n)(h);let m={};if(u)try{m=JSON.parse(u)}catch{}s[p]||(s[p]=[]),s[p].push({type:"Feature",properties:m,geometry:g})});const i=[];Object.keys(s).forEach(l=>{const c=new nt.ux(l);c.collection=new Bn.o(s[l]),i.push(c)});const a=new nt.yY;a.mapboxToken=t,a.contextMenu.showFlyTo=!1,r.mapData={layers:i,settings:a}}})()}}let Pn=(()=>{class o{envInjector=(0,f.WQX)(f.uvJ);fileURL=$.hFB.required();html=(0,f.vPA)("");hookOptions={sanitize:!1,globalParsersBlueprint:{environmentInjector:this.envInjector}};parsers=[{component:{importPromise:()=>Promise.resolve().then(k.bind(k,2245)),importName:"Typography"},selector:"cue-typography"}];onFile=(0,f.QZP)((()=>{var e=this;return(0,Ie.A)(function*(){const n=yield(yield fetch(e.fileURL())).text(),s=new An("m");s.resetContext();const i=yield v.parse(n,{gfm:!0,breaks:!1,renderer:s,async:!0,walkTokens:s.walkTokens.bind(s)});e.html.set(i)})})());static \u0275fac=function(t){return new(t||o)};static \u0275cmp=S.VBU({type:o,selectors:[["cue-md-viewer"]],inputs:{fileURL:[1,"fileURL"]},decls:2,vars:3,consts:[[1,"page"],[3,"parsers","content","options"]],template:function(t,n){1&t&&(S.j41(0,"div",0),S.nrm(1,"ngx-dynamic-hooks",1),S.k0s()),2&t&&(S.R7$(),S.Y8G("parsers",n.parsers)("content",n.html())("options",n.hookOptions))},dependencies:[qt],styles:[".page[_ngcontent-%COMP%]{overflow-y:auto;height:100%;padding:16px;box-sizing:border-box}[_nghost-%COMP%] cue-typography{display:inline-block}[_nghost-%COMP%] .cue-md-p{margin-bottom:24px;opacity:.9;line-height:1.6;display:block}[_nghost-%COMP%] .cue-md-p:last-child{margin-bottom:0}[_nghost-%COMP%] .cue-md-blockquote{margin-bottom:24px;opacity:.9;border-left:4px solid var(--cue-border-color);padding-left:16px}[_nghost-%COMP%] ul, [_nghost-%COMP%] ol{margin-bottom:24px;padding-left:28px;font-family:var(--cue-font-family);opacity:.9;line-height:1.6}[_nghost-%COMP%] li.cue-md-li{margin-bottom:12px}[_nghost-%COMP%] table{margin-bottom:24px;border-collapse:collapse;width:100%}[_nghost-%COMP%] th, [_nghost-%COMP%] td{padding:8px 12px;border-bottom:1px solid var(--cue-border-color, #eee);text-align:left}[_nghost-%COMP%] th cue-typography{font-weight:var(--cue-font-weight-semibold)}[_nghost-%COMP%] .cue-code-inline{background-color:var(--cue-border-color);padding:0 4px;border-radius:4px;font-family:monospace;font-size:1.1em;font-weight:500;color:var(--cue-main-foreground)}"],changeDetection:0})}return o})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[376],{4376(re,V,k){k.d(V,{MarkdownViewer:()=>Nn});var N=k(467),g=k(5802),T=k(7705),w=k(5547),L=k(4226),j=k(2771),E=k(7673),C=k(4572),z=k(1397),U=k(8141),b=k(9437);const x=(0,k(1853).L)(o=>function(){o(this),this.name="EmptyError",this.message="no elements in sequence"});var B=k(5964),P=k(6697),Z=k(9974),he=k(4360);function dt(o=gt){return(0,Z.N)((r,e)=>{let t=!1;r.subscribe((0,he._)(e,n=>{t=!0,e.next(n)},()=>t?e.complete():e.error(o())))})}function gt(){return new x}var ft=k(3669);function je(o,r){const e=arguments.length>=2;return t=>t.pipe(o?(0,B.p)((n,s)=>o(n,s,t)):ft.D,(0,P.s)(1),e?function G(o){return(0,Z.N)((r,e)=>{let t=!1;r.subscribe((0,he._)(e,n=>{t=!0,e.next(n)},()=>{t||e.next(o),e.complete()}))})}(r):dt(()=>new x))}var mt=k(6354),de=k(177),bt=k(345);const Fe=new g.nKC("All of the settings registered in the whole app."),xe=new g.nKC("The settings collected from all ancestor injectors"),Le=new g.nKC("The settings for the currently loaded module."),se="__ngx_dynamic_hooks_content",we="dynamic-component-anchor",A="__ngx_dynamic_hooks_anchor_id",M="__ngx_dynamic_hooks_anchor_parsetoken",xt=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];var Se=function(o){return o[o.All=0]="All",o[o.Linear=1]="Linear",o[o.None=2]="None",o}(Se||{});const v={},We="[a-zA-Z_$]+[a-zA-Z0-9_$]*",Ie="[a-zA-Z$\\-_:][a-zA-Z$\\-_:0-9\\.]*";function D(o,r){if(!r.global)throw Error("TypeError: matchAll called with a non-global RegExp argument");const e=[];let t=r.exec(o);for(;null!==t;)e.push(t),t=r.exec(o);return r.lastIndex=0,e}function Te(o){return void 0!==o?.__ngContext__}v.attributeNameNoBracketsRegex="("+Ie+")",v.attributeNameBracketsRegex="\\[("+Ie+")\\]",v.attributeNameRoundBracketsRegex="\\(("+Ie+")\\)",v.attributeNameRegex="(?:"+v.attributeNameNoBracketsRegex+"|"+v.attributeNameBracketsRegex+"|"+v.attributeNameRoundBracketsRegex+")",v.attributeValueDoubleQuotesRegex='"((?:\\\\.|[^"])*?)"',v.attributeValueSingleQuotesRegex="'((?:\\\\.|[^'])*?)'",v.variablePathDotNotation="\\."+We,v.variableBracketsNotation="\\[[^\\]]*\\]",v.variablePathFunctionCall="\\([^\\)]*\\)",v.variablePathPartRegex="(?:"+v.variablePathDotNotation+"|"+v.variableBracketsNotation+"|"+v.variablePathFunctionCall+")",v.contextVariableRegex="context"+v.variablePathPartRegex+"*",v.placeholderVariablePathDotNotation="\\@@@cxtDot@@@"+We,v.placeholderVariableBracketsNotation="@@@cxtOpenSquareBracket@@@[^\\]]*@@@cxtCloseSquareBracket@@@",v.placeholderVariablePathFunctionCall="@@@cxtOpenRoundBracket@@@[^\\)]*@@@cxtCloseRoundBracket@@@",v.placeholderVariablePathPartRegex="(?:"+v.placeholderVariablePathDotNotation+"|"+v.placeholderVariableBracketsNotation+"|"+v.placeholderVariablePathFunctionCall+")",v.placeholderContextVariableRegex="__CXT__"+v.placeholderVariablePathPartRegex+"*";class St{constructor(r,e,t,n){this.configResolver=e,this.tagHookFinder=t,this.bindingsValueManager=n,this.savedBindings={},this.config=this.configResolver.processConfig(r),this.name=this.config.name}findHooks(r,e,t){let n=this.config.enclosing?this.tagHookFinder.findEnclosingTags(r,this.config.selector,this.config.bracketStyle,t):this.tagHookFinder.findSingleTags(r,this.config.selector,this.config.bracketStyle,t);return this.config.allowSelfClosing&&(n=[...n,...this.tagHookFinder.findSelfClosingTags(r,this.config.selector,this.config.bracketStyle,t)],n.sort((s,i)=>s.openingTagStartIndex-i.openingTagStartIndex)),n}loadComponent(r,e,t,n,s){return{component:this.config.component,hostElementTag:this.config.hostElementTag||this.config.selector,injector:this.config.injector,environmentInjector:this.config.environmentInjector}}getBindings(r,e,t,n){let s=this.savedBindings[r];return void 0===s&&(s=this.createBindings(e.openingTag),this.savedBindings[r]=s),this.bindingsValueManager.checkInputBindings(s.inputs,t,this.config,n),this.bindingsValueManager.checkOutputBindings(s.outputs,this.config,n),{inputs:this.getValuesFromSavedBindings(s.inputs),outputs:this.getValuesFromSavedBindings(s.outputs)}}createBindings(r){const e=this.collectRawInputs(r),t={};for(const[i,a]of Object.entries(e))t[i]={raw:a,parsed:!1,value:null,boundContextVariables:{}};const n=this.collectRawOutputs(r),s={};for(const[i,a]of Object.entries(n))s[i]={raw:a,parsed:!1,value:null,boundContextVariables:{}};return{inputs:t,outputs:s}}collectRawInputs(r){const e=this.getBindingsFromOpeningTag(r,"noBracketInputs",this.config.inputsBlacklist||null,this.config.inputsWhitelist||null),t=this.getBindingsFromOpeningTag(r,"bracketInputs",this.config.inputsBlacklist||null,this.config.inputsWhitelist||null);for(const[n,s]of Object.entries(e))e[n]="'"+s+"'";return{...e,...t}}collectRawOutputs(r){return this.getBindingsFromOpeningTag(r,"outputs",this.config.outputsBlacklist||null,this.config.outputsWhitelist||null)}getBindingsFromOpeningTag(r,e,t,n){const s={},i="(?:"+v.attributeValueDoubleQuotesRegex+"|"+v.attributeValueSingleQuotesRegex+")";let a;switch(e){case"noBracketInputs":a=v.attributeNameNoBracketsRegex;break;case"bracketInputs":a=v.attributeNameBracketsRegex;break;case"outputs":a=v.attributeNameRoundBracketsRegex}const u=D(r,new RegExp(a+"="+i,"gim"));for(const p of u){let h=p[2]||p[3];void 0===h&&"noBracketInputs"===e&&(h=""),s[p[1]]=h}const d={};for(const[p,h]of Object.entries(s))t&&t.includes(p)||n&&!n.includes(p)||(d[p]=h);return d}getValuesFromSavedBindings(r){const e={};for(const[t,n]of Object.entries(r))e[t]=n.value;return e}}class It{constructor(r,e,t,n){this.configResolver=e,this.platformService=t,this.bindingsValueManager=n,this.savedBindings={},this.config=this.configResolver.processConfig(r),this.name=this.config.name}findHookElements(r,e,t){return Array.from(this.platformService.querySelectorAll(r,this.config.selector))}loadComponent(r,e,t,n,s){return this.scrubAngularBindingAttrs(e.element),{component:this.config.component,hostElementTag:this.config.hostElementTag,injector:this.config.injector,environmentInjector:this.config.environmentInjector}}getBindings(r,e,t,n){let s=this.savedBindings[r];return void 0===s&&(s=this.createBindings(e.elementSnapshot),this.savedBindings[r]=s),this.bindingsValueManager.checkInputBindings(s.inputs,t,this.config,n),this.bindingsValueManager.checkOutputBindings(s.outputs,this.config,n),{inputs:this.getValuesFromSavedBindings(s.inputs),outputs:this.getValuesFromSavedBindings(s.outputs)}}scrubAngularBindingAttrs(r){const e=Array.from(r.attributes).map(t=>t.name).filter(t=>t.startsWith("[")&&t.endsWith("]")||t.startsWith("(")&&t.endsWith(")"));for(const t of e)this.platformService.removeAttribute(r,t)}createBindings(r){const e=this.collectRawBindings(r,"inputs",this.config.inputsBlacklist||null,this.config.inputsWhitelist||null),t={};for(const[i,a]of Object.entries(e))t[i]={raw:a,parsed:!1,value:null,boundContextVariables:{}};const n=this.collectRawBindings(r,"outputs",this.config.outputsBlacklist||null,this.config.outputsWhitelist||null),s={};for(const[i,a]of Object.entries(n))s[i]={raw:a,parsed:!1,value:null,boundContextVariables:{}};return{inputs:t,outputs:s}}collectRawBindings(r,e,t,n){const s={},i=this.platformService.getAttributeNames(r);for(let l of i)if("inputs"===e&&(!l.startsWith("(")||!l.endsWith(")"))||"outputs"===e&&l.startsWith("(")&&l.endsWith(")")){let c=this.platformService.getAttribute(r,l);"inputs"===e&&l.startsWith("[")&&l.endsWith("]")&&""===c&&(c=void 0),"inputs"===e&&(!l.startsWith("[")||!l.endsWith("]"))&&(c=`'${c}'`),l=l.replace(/^\[|^\(|\]$|\)$/g,""),s[l]=c}const a={};for(const[l,c]of Object.entries(s))t&&t.includes(l)||n&&!n.includes(l)||(a[l]=c);return a}getValuesFromSavedBindings(r){const e={};for(const[t,n]of Object.entries(r))e[t]=n.value;return e}}const Tt={component:void 0,name:void 0,parseWithRegex:!1,selector:void 0,hostElementTag:void 0,injector:void 0,allowSelfClosing:!0,enclosing:!0,bracketStyle:{opening:"<",closing:">"},parseInputs:!0,unescapeStrings:!0,inputsBlacklist:void 0,inputsWhitelist:void 0,outputsBlacklist:void 0,outputsWhitelist:void 0,allowContextInBindings:!0,allowContextFunctionCalls:!0};let Et=(()=>{class o{constructor(){}processConfig(e){const t=JSON.parse(JSON.stringify(Tt));if(!e||!e.hasOwnProperty("component"))throw Error('Missing the required "component" property for the SelectorHookParserConfig. Must be either the component class or a LazyLoadComponentConfig.');if(t.component=e.component,e.component.hasOwnProperty("prototype")){const n=(0,T.HJs)(e.component);t.selector=n.selector}else{if(!e.component.hasOwnProperty("importPromise")||!e.component.hasOwnProperty("importName"))throw Error('The "component" property in the SelectorHookParserConfig must either contain the component class or a LazyLoadComponentConfig.');if(!e.hasOwnProperty("selector"))throw Error('When using lazy-loaded dynamic components, you have to specify the "selector" property in the parser config, as the real selector can\'t be known before the component is loaded.')}if(e.hasOwnProperty("name")){if("string"!=typeof e.name)throw Error('The submitted "name" property in the SelectorHookParserConfig must be of type string, was '+typeof e.name);t.name=e.name}if(e.hasOwnProperty("selector")){if("string"!=typeof e.selector)throw Error('The submitted "selector" property in the SelectorHookParserConfig must be of type string, was '+typeof e.selector);t.selector=e.selector}if(e.hasOwnProperty("hostElementTag")){if("string"!=typeof e.hostElementTag)throw Error('The submitted "hostElementTag" property in the SelectorHookParserConfig must be of type string, was '+typeof e.hostElementTag);t.hostElementTag=e.hostElementTag}if(e.hasOwnProperty("parseWithRegex")){if("boolean"!=typeof e.parseWithRegex)throw Error('The submitted "parseWithRegex" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.parseWithRegex);t.parseWithRegex=e.parseWithRegex}if(e.hasOwnProperty("allowSelfClosing")){if("boolean"!=typeof e.allowSelfClosing)throw Error('The submitted "allowSelfClosing" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.allowSelfClosing);t.allowSelfClosing=e.allowSelfClosing}if(e.hasOwnProperty("enclosing")){if("boolean"!=typeof e.enclosing)throw Error('The submitted "enclosing" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.enclosing);t.enclosing=e.enclosing}if(e.hasOwnProperty("bracketStyle")){if("object"!=typeof e.bracketStyle||"string"!=typeof e.bracketStyle.opening||"string"!=typeof e.bracketStyle.closing)throw Error('The submitted "bracketStyle" property in the SelectorHookParserConfig must have the form {opening: string, closing: string}');t.bracketStyle=e.bracketStyle}if(e.hasOwnProperty("injector")&&(t.injector=e.injector),e.hasOwnProperty("environmentInjector")&&(t.environmentInjector=e.environmentInjector),e.hasOwnProperty("unescapeStrings")){if("boolean"!=typeof e.unescapeStrings)throw Error('The submitted "unescapeStrings" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.unescapeStrings);t.unescapeStrings=e.unescapeStrings}if(e.hasOwnProperty("parseInputs")){if("boolean"!=typeof e.parseInputs)throw Error('The submitted "parseInputs" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.parseInputs);t.parseInputs=e.parseInputs}if(e.hasOwnProperty("inputsBlacklist")){if(!Array.isArray(e.inputsBlacklist))throw Error('The submitted "inputsBlacklist" property in the SelectorHookParserConfig must be an array of strings.');for(const n of e.inputsBlacklist)if("string"!=typeof n)throw Error('All entries of the submitted "inputsBlacklist" property in the SelectorHookParserConfig must be of type string, '+typeof n+" found.");t.inputsBlacklist=e.inputsBlacklist}if(e.hasOwnProperty("inputsWhitelist")){if(!Array.isArray(e.inputsWhitelist))throw Error('The submitted "inputsWhitelist" property in the SelectorHookParserConfig must be an array of strings.');for(const n of e.inputsWhitelist)if("string"!=typeof n)throw Error('All entries of the submitted "inputsWhitelist" property in the SelectorHookParserConfig must be of type string, '+typeof n+" found.");t.inputsWhitelist=e.inputsWhitelist}if(e.hasOwnProperty("outputsBlacklist")){if(!Array.isArray(e.outputsBlacklist))throw Error('The submitted "outputsBlacklist" property in the SelectorHookParserConfig must be an array of strings.');for(const n of e.outputsBlacklist)if("string"!=typeof n)throw Error('All entries of the submitted "outputsBlacklist" property in the SelectorHookParserConfig must be of type string, '+typeof n+" found.");t.outputsBlacklist=e.outputsBlacklist}if(e.hasOwnProperty("outputsWhitelist")){if(!Array.isArray(e.outputsWhitelist))throw Error('The submitted "outputsWhitelist" property in the SelectorHookParserConfig must be an array of strings.');for(const n of e.outputsWhitelist)if("string"!=typeof n)throw Error('All entries of the submitted "outputsWhitelist" property in the SelectorHookParserConfig must be of type string, '+typeof n+" found.");t.outputsWhitelist=e.outputsWhitelist}if(e.hasOwnProperty("allowContextInBindings")){if("boolean"!=typeof e.allowContextInBindings)throw Error('The submitted "allowContextInBindings" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.allowContextInBindings);t.allowContextInBindings=e.allowContextInBindings}if(e.hasOwnProperty("allowContextFunctionCalls")){if("boolean"!=typeof e.allowContextFunctionCalls)throw Error('The submitted "allowContextFunctionCalls" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.allowContextFunctionCalls);t.allowContextFunctionCalls=e.allowContextFunctionCalls}return t}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();const Ke=new g.nKC("An injection token to retrieve an optionally user-provided PlatformService");let Ct=(()=>{class o{constructor(e,t,n){this.document=e,this.rendererFactory=t,this.sanitizer=n,this.renderer=this.rendererFactory.createRenderer(null,null)}getNgVersion(){if(typeof this.document<"u"){const t=this.querySelectorAll(this.document,"[ng-version]")?.[0]?.getAttribute("ng-version");if(t)return parseInt(t,10)}return null}sanitize(e){return this.sanitizer.sanitize(w.WPN.HTML,e)||""}createElement(e){return this.renderer.createElement(e)}sortElements(e,t){return e===t?0:e.compareDocumentPosition?2&e.compareDocumentPosition(t)?1:-1:e.sourceIndex-t.sourceIndex}cloneElement(e){return e.cloneNode(!0)}getTagName(e){return e.tagName}getOpeningTag(e){const n=e.outerHTML.length;return e.outerHTML.slice(0,"/"===e.outerHTML[n-2]?n:n-e.innerHTML.length-e.tagName.length-3)}getClosingTag(e){return e.outerHTML.slice(e.outerHTML.length-e.tagName.length-3)}getAttributeNames(e){return"function"==typeof e.getAttributeNames?e.getAttributeNames():[]}getAttribute(e,t){return"function"==typeof e.getAttribute?e.getAttribute(t):null}setAttribute(e,t,n){this.renderer.setAttribute(e,t,n)}removeAttribute(e,t){this.renderer.removeAttribute(e,t)}getParentNode(e){try{return this.renderer.parentNode(e)}catch{return null}}querySelectorAll(e,t){return Array.from(e.querySelectorAll(t))}getChildNodes(e){return Array.prototype.slice.call(e.childNodes)}appendChild(e,t){this.renderer.appendChild(e,t)}insertBefore(e,t,n){this.renderer.insertBefore(e,t,n)}clearChildNodes(e){if(e)for(;e.firstChild;)this.removeChild(e,e.firstChild)}removeChild(e,t){e.removeChild(t)}getInnerContent(e){return e.innerHTML}setInnerContent(e,t){e&&(e.innerHTML=t)}isTextNode(e){return e.nodeType===Node.TEXT_NODE}createTextNode(e){return document.createTextNode(e)}getTextContent(e){return e.textContent}dispatchEvent(e,t,n){e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0}))}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(g.qQL),g.KVO(w._9s),g.KVO(bt.up))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),J=(()=>{class o{constructor(e,t){this.userPlatformService=e,this.defaultPlatformService=t}getFor(e){return this.userPlatformService&&"function"==typeof this.userPlatformService[e]?this.userPlatformService:this.defaultPlatformService}getNgVersion(){return this.getFor("getNgVersion").getNgVersion()}sanitize(e){return this.getFor("sanitize").sanitize(e)}createElement(e){return this.getFor("createElement").createElement(e)}sortElements(e,t){return this.getFor("sortElements").sortElements(e,t)}cloneElement(e){return this.getFor("cloneElement").cloneElement(e)}getTagName(e){return this.getFor("getTagName").getTagName(e)}getOpeningTag(e){return this.getFor("getOpeningTag").getOpeningTag(e)}getClosingTag(e){return this.getFor("getClosingTag").getClosingTag(e)}getAttributeNames(e){return this.getFor("getAttributeNames").getAttributeNames(e)}getAttribute(e,t){return this.getFor("getAttribute").getAttribute(e,t)}setAttribute(e,t,n){return this.getFor("setAttribute").setAttribute(e,t,n)}removeAttribute(e,t){return this.getFor("removeAttribute").removeAttribute(e,t)}getParentNode(e){return this.getFor("getParentNode").getParentNode(e)}querySelectorAll(e,t){return this.getFor("querySelectorAll").querySelectorAll(e,t)}getChildNodes(e){return this.getFor("getChildNodes").getChildNodes(e)}appendChild(e,t){return this.getFor("appendChild").appendChild(e,t)}insertBefore(e,t,n){return this.getFor("insertBefore").insertBefore(e,t,n)}clearChildNodes(e){return this.getFor("clearChildNodes").clearChildNodes(e)}removeChild(e,t){return this.getFor("removeChild").removeChild(e,t)}getInnerContent(e){return this.getFor("getInnerContent").getInnerContent(e)}setInnerContent(e,t){return this.getFor("setInnerContent").setInnerContent(e,t)}isTextNode(e){return this.getFor("isTextNode").isTextNode(e)}createTextNode(e){return this.getFor("createTextNode").createTextNode(e)}getTextContent(e){return this.getFor("getTextContent").getTextContent(e)}dispatchEvent(e,t,n){return this.getFor("dispatchEvent").dispatchEvent(e,t,n)}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(Ke,8),g.KVO(Ct))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),W=(()=>{class o{constructor(e){this.platformId=e}log(e,t){this.handleLog(e,t,"log")}warn(e,t){this.handleLog(e,t,"warn")}error(e,t){this.handleLog(e,t,"error")}handleLog(e,t,n){(t.logOptions?.dev&&this.isDevMode()&&(0,de.UE)(this.platformId)||t.logOptions?.prod&&!this.isDevMode()&&(0,de.UE)(this.platformId)||t.logOptions?.ssr&&!(0,de.UE)(this.platformId))&&console[n](...e)}isDevMode(){return(0,T.naY)()}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(w.Agw))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Rt=(()=>{class o{constructor(e){this.logger=e}find(e,t,n,s,i={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){return n?this.findEnclosingHooks(e,t,n,s,i):this.findSingletagHooks(e,t)}findSingletagHooks(e,t){const n=[],s=D(e,t);for(const i of s)n.push({openingTagStartIndex:i.index,openingTagEndIndex:i.index+i[0].length,closingTagStartIndex:null,closingTagEndIndex:null});return n}findEnclosingHooks(e,t,n,s,i={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){const a=[],l=[],c=D(e,t);for(const p of c)a.push({isOpening:!0,value:p[0],startIndex:p.index,endIndex:p.index+p[0].length});const u=D(e,n);for(const p of u)a.push({isOpening:!1,value:p[0],startIndex:p.index,endIndex:p.index+p[0].length});a.sort((p,h)=>p.startIndex-h.startIndex);const d=[];for(const[p,h]of a.entries())if(p>0&&h.startIndex<a[p-1].endIndex)this.logger.warn(['Syntax error - New tag "'+h.value+'" started at position '+h.startIndex+' before previous tag "'+a[p-1].value+'" ended at position '+a[p-1].endIndex+". Ignoring."],i);else if(h.isOpening)d.push(h);else{if(0===d.length){this.logger.warn(['Syntax error - Closing tag without preceding opening tag found: "'+h.value+'". Ignoring.'],i);continue}if(!1===s&&d.length>1){d.pop();continue}const f=d[d.length-1];l.push({openingTagStartIndex:f.startIndex,openingTagEndIndex:f.startIndex+f.value.length,closingTagStartIndex:h.startIndex,closingTagEndIndex:h.startIndex+h.value.length}),d.pop()}return d.length>0&&this.logger.warn(["Syntax error - Opening tags without corresponding closing tags found."],i),l}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(W))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Ot=(()=>{class o{constructor(e){this.hookFinder=e}findSingleTags(e,t,n={opening:"<",closing:">"},s){const i=this.generateOpeningTagRegex(t,n);return this.hookFinder.find(e,i,void 0,void 0,s)}findEnclosingTags(e,t,n={opening:"<",closing:">"},s){const i=this.generateOpeningTagRegex(t,n),a=this.generateClosingTagRegex(t,n);return this.hookFinder.find(e,i,a,!0,s)}findSelfClosingTags(e,t,n={opening:"<",closing:">"},s){const i=this.generateOpeningTagRegex(t,n,!0);return this.hookFinder.find(e,i,void 0,void 0,s)}generateOpeningTagRegex(e,t={opening:"<",closing:">"},n=!1){const s=this.escapeRegex(t.opening),i=this.escapeRegex(e),a=(n?"\\/":"")+this.escapeRegex(t.closing);return new RegExp(s+i+"(?:\\s*"+a+"|(?:\\s+"+v.attributeNameRegex+"=(?:"+v.attributeValueDoubleQuotesRegex+"|"+v.attributeValueSingleQuotesRegex+"))+\\s*"+a+")","gim")}generateClosingTagRegex(e,t={opening:"<",closing:">"}){const n=this.escapeRegex(t.opening)+"/",s=this.escapeRegex(e),i=this.escapeRegex(t.closing);return new RegExp(n+s+i,"gim")}escapeRegex(e){return e.replace(new RegExp("[-\\/\\\\^$*+?.()|[\\]{}]","g"),"\\$&")}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(Rt))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Bt=(()=>{class o{encodeSubstrings(e){const i=[...D(e,/'/gm).filter(u=>0===u.index||"\\"!==e[u.index-1]),...D(e,/"/gm).filter(u=>0===u.index||"\\"!==e[u.index-1]),...D(e,/`/gm).filter(u=>0===u.index||"\\"!==e[u.index-1])];i.sort((u,d)=>u.index-d.index);const a=[];let l=null;for(const u of i)l?l[0]===u[0]&&(a.push({startIndex:l.index+1,endIndex:u.index}),l=null):l=u;if(null!==l)throw Error("Input parse error. String was opened, but not closed.");return this.encodeTextSegments(e,a,this.encodeStringSpecialChars)}encodeStringSpecialChars(e){return(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/'/g,"@@@singlequote@@@")).replace(/"/g,"@@@doublequote@@@")).replace(/`/g,"@@@gravequote@@@")).replace(/:/g,"@@@colon@@@")).replace(/;/g,"@@@semicolon@@@")).replace(/\./g,"@@@dot@@@")).replace(/,/g,"@@@comma@@@")).replace(/\\/g,"@@@backslash@@@")).replace(/\(/g,"@@@openRoundBracket@@@")).replace(/\)/g,"@@@closeRoundBracket@@@")).replace(/\[/g,"@@@openSquareBracket@@@")).replace(/\]/g,"@@@closeSquareBracket@@@")).replace(/\{/g,"@@@openCurlyBracket@@@")).replace(/\}/g,"@@@closeCurlyBracket@@@")}decodeStringSpecialChars(e){return(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/@@@singlequote@@@/g,"'")).replace(/@@@doublequote@@@/g,'"')).replace(/@@@gravequote@@@/g,"`")).replace(/@@@colon@@@/g,":")).replace(/@@@semicolon@@@/g,";")).replace(/@@@dot@@@/g,".")).replace(/@@@comma@@@/g,",")).replace(/@@@backslash@@@/g,"\\")).replace(/@@@openRoundBracket@@@/g,"(")).replace(/@@@closeRoundBracket@@@/g,")")).replace(/@@@openSquareBracket@@@/g,"[")).replace(/@@@closeSquareBracket@@@/g,"]")).replace(/@@@openCurlyBracket@@@/g,"{")).replace(/@@@closeCurlyBracket@@@/g,"}")}encodeSubfunctions(e){const s=[...D(e,/\(/gm),...D(e,/\)/gm)];s.sort((c,u)=>c.index-u.index);const i=[],a=[];for(const c of s)if("("===c[0])a.push(c);else{if(0===a.length)throw Error("Input parse error. Closed function bracket without opening it first.");1===a.length&&i.push({startIndex:a[0].index+1,endIndex:c.index}),a.pop()}if(0!==a.length)throw Error("Input parse error. Opened function bracket without closing it.");return this.encodeTextSegments(e,i,this.encodeFunctionBrackets)}encodeFunctionBrackets(e){return(e=e.replace(/\(/g,"@@@fnOpenBracket@@@")).replace(/\)/g,"@@@fnCloseBracket@@@")}decodeFunctionBrackets(e){return(e=e.replace(/@@@fnOpenBracket@@@/g,"(")).replace(/@@@fnCloseBracket@@@/g,")")}encodeVariableSubbrackets(e){const s=D(e,new RegExp("(?:[a-zA-Z_$\\])])(\\[)","gm")),i=[];for(const c of s){const u=e.substring(c.index+2),h=[...D(u,/\[/gm),...D(u,/\]/gm)];h.sort((m,O)=>m.index-O.index);let f=1;for(const m of h)if(f="]"===m[0]?f-1:f+1,0===f){i.push({startIndex:c.index+2,endIndex:c.index+2+m.index});break}if(0!==f)throw Error("Input parse error. Opened bracket without closing it.")}const a=[];for(const c of i)(0===a.length||a[a.length-1].endIndex<c.startIndex)&&a.push(c);return this.encodeTextSegments(e,a,this.encodeVariableBrackets)}encodeVariableBrackets(e){return(e=e.replace(/\[/g,"@@@variableOpeningBracket@@@")).replace(/\]/g,"@@@variableClosingBracket@@@")}decodeVariableBrackets(e){return(e=e.replace(/@@@variableOpeningBracket@@@/g,"[")).replace(/@@@variableClosingBracket@@@/g,"]")}transformContextVarIntoPlacerholder(e){return(e=(e=(e=(e=(e=(e="__CXT__"+e.substring(7)).replace(/\"/g,"@@@cxtDoubleQuote@@@")).replace(/\./g,"@@@cxtDot@@@")).replace(/\[/g,"@@@cxtOpenSquareBracket@@@")).replace(/\]/g,"@@@cxtCloseSquareBracket@@@")).replace(/\(/g,"@@@cxtOpenRoundBracket@@@")).replace(/\)/g,"@@@cxtCloseRoundBracket@@@")}transformPlaceholderIntoContextVar(e){return(e=(e=(e=(e=(e=(e="context"+e.substring(7)).replace(/@@@cxtDoubleQuote@@@/g,'"')).replace(/@@@cxtDot@@@/g,".")).replace(/@@@cxtOpenSquareBracket@@@/g,"[")).replace(/@@@cxtCloseSquareBracket@@@/g,"]")).replace(/@@@cxtOpenRoundBracket@@@/g,"(")).replace(/@@@cxtCloseRoundBracket@@@/g,")")}encodeTextSegments(e,t,n){const s=[];for(const l of t){const c=0===s.length?0:s[s.length-1].endIndex;s.push({type:"text",startIndex:c,endIndex:l.startIndex,string:e.substring(c,l.startIndex)}),s.push({type:"special",startIndex:l.startIndex,endIndex:l.endIndex,string:e.substring(l.startIndex,l.endIndex)})}const i=0===s.length?0:s[s.length-1].endIndex;s.push({type:"text",startIndex:i,endIndex:e.length-1,string:e.substring(i)});for(const l of s)"special"===l.type&&(l.string=n(l.string));let a="";for(const l of s)a+=l.string;return a}stripSlashes(e){return e.replace(/\\(.)/g,"$1")}escapeDoubleQuotes(e){return e.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),At=(()=>{class o{constructor(e,t){this.dataTypeEncoder=e,this.logger=t}evaluate(e,t={},n,s=!0,i={},a=!0,l={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){if("null"===e)return null;if("undefined"!==e){if("true"===e)return!0;if("false"===e)return!1;if(!isNaN(e))return parseInt(e,10);if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")||e.startsWith("`")&&e.endsWith("`")){let c=e.substring(1,e.length-1);return c=s?this.dataTypeEncoder.stripSlashes(c):c,c}if((e=this.encodeDataTypeString(e)).startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]")){const c=this.parseAsJSON(e,s);return this.loadJSONVariables(c,t,n,s,i,a,l)}if("$event"===e)return n;if(e.match(new RegExp("^\\s*"+v.contextVariableRegex+"\\s*$","gm")))return this.loadContextVariable(e,t,n,s,i,a,l);throw Error('Data type for following input was not recognized and could not be parsed: "'+e+'"')}}encodeDataTypeString(e){return e=this.dataTypeEncoder.encodeSubstrings(e),e=this.dataTypeEncoder.encodeSubfunctions(e),this.dataTypeEncoder.encodeVariableSubbrackets(e)}decodeDataTypeString(e){return e=this.dataTypeEncoder.decodeStringSpecialChars(e),e=this.dataTypeEncoder.decodeFunctionBrackets(e),(e=this.dataTypeEncoder.decodeVariableBrackets(e)).trim()}parseAsJSON(e,t){if((e=(e=(e=e.replace(/\'(\\.|[^\'])*?\'/gm,l=>'"'+l.slice(1,-1)+'"')).replace(/\`(\\.|[^\`])*?\`/gm,l=>'"'+l.slice(1,-1)+'"')).replace(/"?([a-z0-9A-Z_]+)"?\s*:/g,'"$1": ')).match(/"?__proto__"?\s*:/g))throw Error('Setting the "__proto__" property in a hook input object is not allowed.');if(e.match(/"?prototype"?\s*:/g))throw Error('Setting the "prototype" property in a hook input object is not allowed.');if(e.match(/"?constructor"?\s*:/g))throw Error('Setting the "constructor" property in a hook input object is not allowed.');e=this.replaceValuesInJSONString(e,"undefined",l=>"null"),e=this.replaceValuesInJSONString(e,v.contextVariableRegex,l=>'"'+this.dataTypeEncoder.transformContextVarIntoPlacerholder(l)+'"'),e=this.replaceValuesInJSONString(e,"\\$event",l=>'"__EVENT__"');const a=JSON.parse(e);return this.decodeJSONStrings(a,t),a}replaceValuesInJSONString(e,t,n){return e.replace(new RegExp("(?:(:\\s*)("+t+")(?=\\s*[,}])|([\\[,]\\s*)("+t+")(?=\\s*[\\],]))","gm"),(a,l,c,u,d)=>(l||u)+n(c||d))}decodeJSONStrings(e,t){for(const n in e)if("string"==typeof e[n]){if('__EVENT__"'===e[n]||e[n].match(new RegExp("^\\s*"+v.placeholderContextVariableRegex+"\\s*$","gm")))continue;let s=this.decodeDataTypeString(e[n]);s=t?this.dataTypeEncoder.stripSlashes(s):s,e[n]=s}else"object"==typeof e[n]&&this.decodeJSONStrings(e[n],t)}loadJSONVariables(e,t,n,s,i,a,l){for(const c in e)if("string"==typeof e[c]){if("__EVENT__"===e[c])e[c]=n;else if(e[c].match(new RegExp("^\\s*"+v.placeholderContextVariableRegex+"\\s*$","gm"))){const u=this.dataTypeEncoder.transformPlaceholderIntoContextVar(e[c].trim());e[c]=this.loadContextVariable(u,t,n,s,i,a,l)}}else"object"==typeof e[c]&&this.loadJSONVariables(e[c],t,n,s,i,a,l);return e}loadContextVariable(e,t={},n,s=!0,i={},a=!0,l={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){try{const c=e.substring(7);if(""===c.trim())return t;const u=[],d=D(c,new RegExp(v.variablePathPartRegex,"gm"));for(const p of d){if(p[0].startsWith(".")&&u.push({type:"property",value:p[0].substring(1)}),p[0].startsWith("[")&&p[0].endsWith("]")){let h=p[0].substring(1,p[0].length-1);h=this.decodeDataTypeString(h),h=this.evaluate(h,t,n,s,i,a),u.push({type:"property",value:h})}if(p[0].startsWith("(")&&p[0].endsWith(")")){if(!a)throw Error("Tried to call a function in a context variable. This has been disallowed in the current config.");const h=p[0].substring(1,p[0].length-1),f=[];if(""!==h)for(const m of h.split(",")){let O=this.decodeDataTypeString(m);O=this.evaluate(O,t,n,s,i,a),f.push(O)}u.push({type:"function",value:f})}}try{const p=this.fetchContextVariable(t,u);return i[this.decodeDataTypeString(e)]=p,p}catch{throw Error('The required context variable "'+this.decodeDataTypeString(e)+'" could not be found in the context object. Returning undefined instead.')}}catch(c){return this.logger.warn([c],l),void(i[this.decodeDataTypeString(e)]=void 0)}}fetchContextVariable(e,t){if("__proto__"===t[0].value)throw Error("Accessing the __proto__ property through a context variable is not allowed.");if("prototype"===t[0].value)throw Error("Accessing the prototype property through a context variable is not allowed.");if("constructor"===t[0].value)throw Error("Accessing the constructor property through a context variable is not allowed.");if(void 0===e)throw Error("Context variable path could not be resolved. Trying to access "+("property"===t[0].type?'property "'+t[0].value+'" of undefined.':"undefined function."));let n;return"property"===t[0].type?e.hasOwnProperty(t[0].value)?(n=e[t[0].value],"function"==typeof n&&(n=n.bind(e))):e.__proto__.hasOwnProperty(t[0].value)?(n=e.__proto__[t[0].value],"function"==typeof n&&(n=n.bind(e))):n=void 0:"function"===t[0].type&&(n=e(...t[0].value)),t.shift(),t.length>0&&(n=this.fetchContextVariable(n,t)),n}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(Bt),g.KVO(W))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Pt=(()=>{class o{constructor(e,t){this.dataTypeParser=e,this.logger=t}checkInputBindings(e,t,n,s){for(const[i,a]of Object.entries(e))if(n.parseInputs)if(a.parsed)this.updateInputBindingIfStale(a,t,n);else try{a.value=this.dataTypeParser.evaluate(a.raw,n.allowContextInBindings?t:{},void 0,n.unescapeStrings,a.boundContextVariables,n.allowContextFunctionCalls,s),a.parsed=!0}catch(l){this.logger.error(["Hook input parsing error\nselector: "+n.selector+"\ninput: "+i+'\nvalue: "'+a.value+'"'],s),this.logger.error([l.stack],s),delete e[i]}else a.value=a.raw}updateInputBindingIfStale(e,t,n){if(Object.keys(e.boundContextVariables).length>0){let s=!1;for(const[i,a]of Object.entries(e.boundContextVariables)){const l=this.dataTypeParser.encodeDataTypeString(i);if(this.dataTypeParser.loadContextVariable(l,t,void 0,n.unescapeStrings,{},n.allowContextFunctionCalls)!==a){s=!0;break}}s&&(e.boundContextVariables={},e.value=this.dataTypeParser.evaluate(e.raw,n.allowContextInBindings?t:{},void 0,n.unescapeStrings,e.boundContextVariables,n.allowContextFunctionCalls))}}checkOutputBindings(e,t,n){for(const[s,i]of Object.entries(e))i.parsed||(i.value=(a,l)=>{try{this.dataTypeParser.evaluate(i.raw,t.allowContextInBindings?l:{},a,t.unescapeStrings,i.boundContextVariables,t.allowContextFunctionCalls)}catch(c){this.logger.error(["Hook output parsing error\nselector: "+t.selector+"\noutput: "+s+'\nvalue: "'+i.value+'"'],n),this.logger.error([c.stack],n)}},i.parsed=!0)}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(At),g.KVO(W))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Nt=(()=>{class o{constructor(e,t,n,s,i,a){this.injector=e,this.parserResolver=t,this.platformService=n,this.tagHookFinder=s,this.bindingsValueManager=i,this.logger=a}resolve(e,t,n,s,i){const a=[];for(const u of e){const d=this.resolveEntry(u,t,i);d&&a.push(d)}const l=this.validateParserFunctions(a,i);if(this.checkParserNames(l,i),!n&&!s)return l;this.checkBlackAndWhitelist(l,n,s,i);const c=[];for(const u of l)u.hasOwnProperty("name")&&"string"==typeof u.name&&(n&&n.includes(u.name)||s&&!s.includes(u.name))||c.push(u);return c}resolveEntry(e,t,n){if(e.hasOwnProperty("prototype")){if((0,T.HJs)(e))return this.createSelectorHookParser({component:e});try{return t.get(e)}catch{return new e}}else if("object"==typeof e){if("Object"!==e.constructor.name)return e;try{return this.createSelectorHookParser(e)}catch(s){return this.logger.error(["Invalid parser config - "+s.message,e],n),null}}return this.logger.error(["Invalid parser config - ",e],n),null}createSelectorHookParser(e){return e.hasOwnProperty("parseWithRegex")&&e.parseWithRegex||e.hasOwnProperty("enclosing")&&!e.enclosing||e.hasOwnProperty("bracketStyle")&&e.bracketStyle?new St(e,this.parserResolver,this.tagHookFinder,this.bindingsValueManager):new It(e,this.parserResolver,this.platformService,this.bindingsValueManager)}validateParserFunctions(e,t){const n=[];for(const s of e)"function"==typeof s.findHooks||"function"==typeof s.findHookElements?"function"==typeof s.loadComponent?"function"==typeof s.getBindings?n.push(s):this.logger.error(['Submitted parser does not implement "getBindings()". Removing from list of active parsers:',s],t):this.logger.error(['Submitted parser does not implement "loadComponent()". Removing from list of active parsers:',s],t):this.logger.error(['Submitted parser neither implements "findHooks()" nor "findHookElements()". One is required. Removing from list of active parsers:',s],t);return n}checkParserNames(e,t){const n=e.map(a=>a.name).filter(a=>void 0!==a),s=[],i=[];for(const a of n)s.includes(a)&&!i.includes(a)&&(this.logger.warn(['Parser name "'+a+'" is not unique and appears multiple times in the list of active parsers.'],t),i.push(a)),s.push(a)}checkBlackAndWhitelist(e,t,n,s){const i=e.map(a=>a.name).filter(a=>void 0!==a);if(t)for(const a of t)i.includes(a)||this.logger.warn(['Blacklisted parser name "'+a+'" does not appear in the list of global parsers names. Make sure both spellings are identical.'],s);if(n)for(const a of n)i.includes(a)||this.logger.warn(['Whitelisted parser name "'+a+'" does not appear in the list of global parsers names. Make sure both spellings are identical.'],s)}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(g.zZn),g.KVO(Et),g.KVO(J),g.KVO(Ot),g.KVO(Pt),g.KVO(W))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Dt=(()=>{class o{constructor(e){this.parserEntryResolver=e}resolve(e,t,n,s,i,a=null,l=null,c=null,u=null){let d={};n=n||[],s=s||[];const p={options:{sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}};d=(i=i||{}).hasOwnProperty("inheritance")&&i.inheritance!==Se.Linear?this.mergeSettings(i.inheritance===Se.All?[p,...n,...s,{options:l||void 0}]:[p,i||{},{options:l||void 0}]):this.mergeSettings([p,...s,{parsers:a||void 0,options:l||void 0}]);const h=d.options;t&&"string"!=typeof t&&(h.sanitize=!1);let f=[];return a?f=this.parserEntryResolver.resolve(a,e,null,null,h):d.parsers&&(f=this.parserEntryResolver.resolve(d.parsers,e,c,u,h)),{parsers:f,options:h}}mergeSettings(e){const t={};for(const n of e){if(void 0!==n.parsers){void 0===t.parsers&&(t.parsers=[]);for(const s of n.parsers)t.parsers.includes(s)||t.parsers.push(s)}void 0!==n.options&&(void 0===t.options&&(t.options={}),t.options=this.recursiveAssign(t.options,n.options))}return t}recursiveAssign(e,t){if(Object(t)!==t)return t;Object(e)!==e&&(e={});for(const n in t)e[n]=this.recursiveAssign(e[n],t[n]);return e}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(Nt))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();const qe="_ngx_dynamic_hooks_node_placeholder";let $t=(()=>{class o{constructor(e,t){this.platformService=e,this.logger=t}findInElement(e,t,n,s,i,a){for(const l of n)if("function"==typeof l.findHooks){this.checkElement(e,t,n,s,i,a);break}}checkElement(e,t,n,s,i,a,l={counter:0,nodes:{}}){let c=this.platformService.getChildNodes(e),u="";const d={};for(const f of c)if(this.platformService.isTextNode(f))u+=this.platformService.getTextContent(f);else{const m=l.counter++;u+=`${qe}__${m}__`,d[m]=f}const p=Object.keys(a).length,h=this.find(u,t,n,s,i,a);if(Object.keys(a).length>p&&(this.platformService.clearChildNodes(e),this.platformService.setInnerContent(e,h.content),c=this.platformService.getChildNodes(e),l.nodes={...l.nodes,...d}),Object.keys(l.nodes).length)for(const f of c)if(this.platformService.isTextNode(f)){let m=this.platformService.getTextContent(f);if(m){const O=D(m,new RegExp(`${qe}__(\\d*)__`,"g"));if(O.length){const R=[];let H=0;for(const X of O){const ne=m.substring(H,X.index),F=parseInt(X[1]);ne&&R.push(this.platformService.createTextNode(ne)),F&&l.nodes[F]&&(R.push(l.nodes[F]),delete l.nodes[F]),H=X.index+X[0].length}const pe=m.substring(H);pe&&R.push(this.platformService.createTextNode(pe));const te=this.platformService.getParentNode(f);for(const X of R)this.platformService.insertBefore(te,X,f);this.platformService.removeChild(te,f),c=this.platformService.getChildNodes(te)}}}for(const f of c)f.nodeType!==Node.TEXT_NODE&&this.checkElement(f,t,n,s,i,a,l)}find(e,t,n,s,i,a){if(""===e)return{content:e,hookIndex:a};i.convertHTMLEntities&&(e=this.convertHTMLEntities(e));let l=[];for(const u of n)if("function"==typeof u.findHooks)for(const d of u.findHooks(e,t,i))l.push({parser:u,hookPosition:d});l.sort((u,d)=>u.hookPosition.openingTagStartIndex-d.hookPosition.openingTagStartIndex),l=this.validateHookPositions(l,e,i);const c=[];for(const u of l){const d=Object.keys(a).length+1,p=this.getHookSegments(u.hookPosition,e);if(c.push({startIndex:u.hookPosition.openingTagStartIndex,endIndex:u.hookPosition.openingTagEndIndex,replacement:`<${we} ${A}="${d}" ${M}="${s}">`}),c.push({startIndex:p.enclosing?u.hookPosition.closingTagStartIndex:u.hookPosition.openingTagEndIndex,endIndex:p.enclosing?u.hookPosition.closingTagEndIndex:u.hookPosition.openingTagEndIndex,replacement:`</${we}>`}),a[d]={id:d,parser:u.parser,value:{openingTag:p.openingTag,closingTag:p.closingTag,element:null,elementSnapshot:null},data:null,isLazy:!1,bindings:null,previousBindings:null,componentRef:null,dirtyInputs:new Set,outputSubscriptions:{},htmlEventSubscriptions:{}},p.enclosing&&i.fixParagraphTags){const h=this.removeTagArtifacts(p.textBefore,"<p>","</p>",p.innerValue,"</p>","<p>");p.textBefore=h.firstText,p.innerValue=h.secondText;const f=this.removeTagArtifacts(p.innerValue,"<p>","</p>",p.textAfter,"</p>","<p>");p.innerValue=f.firstText,p.textAfter=f.secondText,e=p.textBefore+p.openingTag+p.innerValue+p.closingTag+p.textAfter}}c.sort((u,d)=>{let p=d.startIndex-u.startIndex;return 0===p&&(p=d.endIndex-u.endIndex),p});for(const u of c){const d=e.substring(0,u.startIndex),p=e.substring(u.endIndex);e=d+u.replacement+p}return{content:e,hookIndex:a}}getHookSegments(e,t){const n=Number.isInteger(e.closingTagStartIndex)&&Number.isInteger(e.closingTagEndIndex);return{enclosing:n,textBefore:t.substring(0,e.openingTagStartIndex),openingTag:t.substring(e.openingTagStartIndex,e.openingTagEndIndex),innerValue:n?t.substring(e.openingTagEndIndex,e.closingTagStartIndex):null,closingTag:n?t.substring(e.closingTagStartIndex,e.closingTagEndIndex):null,textAfter:t.substring(n?e.closingTagEndIndex:e.openingTagEndIndex)}}validateHookPositions(e,t,n){const s=[];e:for(const[i,a]of e.entries()){const l=Number.isInteger(a.hookPosition.closingTagStartIndex)&&Number.isInteger(a.hookPosition.closingTagEndIndex),c=a.hookPosition;if(c.openingTagStartIndex>=c.openingTagEndIndex){this.logger.warn(["Text hook error: openingTagEndIndex has to be greater than openingTagStartIndex. Ignoring.",c],n);continue}if(l&&c.openingTagEndIndex>c.closingTagStartIndex){this.logger.warn(["Text hook error: closingTagStartIndex has to be greater than openingTagEndIndex. Ignoring.",c],n);continue}if(l&&c.closingTagStartIndex>=c.closingTagEndIndex){this.logger.warn(["Text hook error: closingTagEndIndex has to be greater than closingTagStartIndex. Ignoring.",c],n);continue}const u=e.slice(0,i);for(const d of u){const p=d.hookPosition,h=Number.isInteger(p.closingTagStartIndex)&&Number.isInteger(p.closingTagEndIndex);if(c.openingTagStartIndex===p.openingTagStartIndex&&c.openingTagEndIndex===p.openingTagEndIndex&&(!l||!h||c.closingTagStartIndex===p.closingTagStartIndex&&c.closingTagEndIndex===p.closingTagEndIndex)){this.generateHookPosWarning("A text hook with the same position as another text hook was found. There may be multiple parsers looking for the same text pattern. Ignoring duplicates.",c,p,t,n);continue e}if(c.openingTagStartIndex<p.openingTagEndIndex){this.generateHookPosWarning("Text hook error: Hook opening tag starts before previous hook opening tag ends. Ignoring.",c,p,t,n);continue e}if(h&&!(c.openingTagEndIndex<=p.closingTagStartIndex||c.openingTagStartIndex>=p.closingTagEndIndex)){this.generateHookPosWarning("Text hook error: Opening tag of hook overlaps with closing tag of previous hook. Ignoring.",c,p,t,n);continue e}if(h&&l&&!(c.closingTagEndIndex<=p.closingTagStartIndex||c.closingTagStartIndex>=p.closingTagEndIndex)){this.generateHookPosWarning("Text hook error: Closing tag of hook overlaps with closing tag of previous hook. Ignoring.",c,p,t,n);continue e}if(l&&h&&c.openingTagEndIndex<=p.closingTagStartIndex&&c.closingTagStartIndex>=p.closingTagEndIndex){this.generateHookPosWarning("Text hook error: The closing tag of a nested hook lies beyond the closing tag of the outer hook. Ignoring.",c,p,t,n);continue e}}s.push(a)}return s}generateHookPosWarning(e,t,n,s,i){const a=this.getHookSegments(n,s),l=this.getHookSegments(t,s);this.logger.warn([e+"\nFirst hook: ",{openingTag:a.openingTag,openingTagStartIndex:n.openingTagStartIndex,openingTagEndIndex:n.openingTagEndIndex,closingTag:a.closingTag,closingTagStartIndex:n.closingTagStartIndex,closingTagEndIndex:n.closingTagEndIndex},"\nSecond hook:",{openingTag:l.openingTag,openingTagStartIndex:t.openingTagStartIndex,openingTagEndIndex:t.openingTagEndIndex,closingTag:l.closingTag,closingTagStartIndex:t.closingTagStartIndex,closingTagEndIndex:t.closingTagEndIndex}],i)}removeTagArtifacts(e,t,n,s,i,a){let l=!1,c=!1;const u=e.lastIndexOf(t),d=e.lastIndexOf(n);(u>=0&&-1===d||u>d)&&(l=!0);const p=s.indexOf(i),h=s.indexOf(a);return(p>=0&&-1===h||p<h)&&(c=!0),l&&c&&(e=e.substring(0,u)+" ".repeat(t.length)+e.substring(u+t.length),s=s.substring(0,p)+" ".repeat(i.length)+s.substring(p+i.length)),{firstText:e,secondText:s}}convertHTMLEntities(e){const t=this.platformService.createElement("div");return e.replace(/&[#A-Za-z0-9]+;/gi,s=>" "===s?" ":(this.platformService.setInnerContent(t,s),this.platformService.getTextContent(t)))}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(J),g.KVO(W))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Mt=(()=>{class o{constructor(e,t){this.platformService=e,this.logger=t}find(e,t,n,s,i,a){let l=[];for(const c of n)if("function"==typeof c.findHookElements)for(const u of c.findHookElements(e,t,i))l.push({parser:c,hookElement:u});l=function wt(o,r,e){return[...o].sort(function(n,s){return"function"==typeof e&&(n=e(n),s=e(s)),r(n,s)})}(l,this.platformService.sortElements.bind(this.platformService),c=>c.hookElement),l=this.validateHookElements(l,e,i);for(const c of l){const u=Object.keys(a).length+1;a[u]={id:u,parser:c.parser,value:{openingTag:this.platformService.getOpeningTag(c.hookElement),closingTag:this.platformService.getClosingTag(c.hookElement),element:c.hookElement,elementSnapshot:this.platformService.cloneElement(c.hookElement)},data:null,isLazy:!1,bindings:null,previousBindings:null,componentRef:null,dirtyInputs:new Set,outputSubscriptions:{},htmlEventSubscriptions:{}},this.platformService.setAttribute(c.hookElement,A,u.toString()),this.platformService.setAttribute(c.hookElement,M,s)}return a}validateHookElements(e,t,n){const s=[];for(const[i,a]of e.entries())s.slice(0,i).findIndex(u=>u.hookElement===a.hookElement)>=0||this.platformService.getAttributeNames(a.hookElement).includes(A)||this.platformService.getAttributeNames(a.hookElement).includes(M)?this.logger.warn(["An element hook tried to use an element that was found by another hook before. There may be multiple parsers looking for the same elements. Ignoring duplicates.",a.hookElement],n):Te(a.hookElement)||s.push(a);return s}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(J),g.KVO(W))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();const Ee="dynamic-hooks-sanitization-placeholder",zt=new RegExp(`</?${Ee}.*?>`,"g");let Vt=(()=>{class o{constructor(e){this.platformService=e,this.attrWhitelist=[A,M,"class","href","src"]}sanitize(e,t,n){const s={};for(const c of Object.values(t)){const u=this.platformService.querySelectorAll(e,`[${A}="${c.id}"][${M}="${n}"]`)?.[0];if(u){s[c.id]=u;const d=this.platformService.getParentNode(u),p=this.platformService.getChildNodes(u),h=this.platformService.createElement(Ee);this.platformService.setAttribute(h,A,c.id.toString()),this.platformService.setAttribute(h,M,n),this.platformService.insertBefore(d,h,u),this.platformService.removeChild(d,u);for(const f of p)this.platformService.appendChild(h,f)}}let i=this.platformService.getInnerContent(e);i=this.findAndEncodeTags(i,zt);const a=console.warn;console.warn=()=>{};let l=this.platformService.sanitize(i);console.warn=a,l=this.decodeTagString(l),e.innerHTML=l||"";for(const[c,u]of Object.entries(s)){const d=this.platformService.querySelectorAll(e,`${Ee}[${A}="${c}"]`)?.[0];if(d){const p=this.platformService.getParentNode(d),h=this.platformService.getChildNodes(d);this.platformService.insertBefore(p,u,d),this.platformService.removeChild(p,d);for(const f of h)this.platformService.appendChild(u,f);this.sanitizeElementAttrs(u)}}return e}sanitizeElementAttrs(e){const t=this.platformService.getAttributeNames(e),n=this.platformService.createElement("div"),s=this.platformService.createElement("span");this.platformService.appendChild(n,s);for(const l of t){try{this.platformService.setAttribute(s,l,this.platformService.getAttribute(e,l))}catch{}try{l!==A&&l!==M&&this.platformService.removeAttribute(e,l)}catch{}}n.innerHTML=this.platformService.sanitize(this.platformService.getInnerContent(n));const i=this.platformService.querySelectorAll(n,"span")[0],a=this.platformService.getAttributeNames(i);for(const l of a)try{this.platformService.setAttribute(e,l,this.platformService.getAttribute(i,l))}catch{}return e}findAndEncodeTags(e,t){let n=e;const s=D(e,t);s.sort((i,a)=>a.index-i.index);for(const i of s){const a=i.index,l=i.index+i[0].length,c=n.substring(0,a),u=this.encodeTagString(n.substring(a,l)),d=n.substring(l);n=c+u+d}return n}encodeTagString(e){return(e=(e=e.replace(/</g,"@@@hook-lt@@@")).replace(/>/g,"@@@hook-gt@@@")).replace(/"/g,"@@@hook-dq@@@")}decodeTagString(e){return(e=(e=e.replace(/@@@hook-lt@@@/g,"<")).replace(/@@@hook-gt@@@/g,">")).replace(/@@@hook-dq@@@/g,'"')}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(J))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Ht=(()=>{class o{constructor(e){this.logger=e}isEqual(e,t,n,s={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){const i=this.detailedStringify(e,n),a=this.detailedStringify(t,n);return null===i.result||null===a.result?(this.logger.warn(["Objects could not be compared by value as one or both of them could not be stringified. Returning false. \n","Objects:",e,t],s),!1):i.result===a.result}detailedStringify(e,t){try{const n={count:0},s=this.decycle(e,[],t,n);return{result:JSON.stringify(s,(a,l)=>void 0===l?"undefined":"function"==typeof l||"symbol"==typeof l?l.toString():l),depthReachedCount:n.count}}catch{return{result:null,depthReachedCount:0}}}decycle(e,t=[],n=5,s){if(t.length>n)return s.count++,null;if(!e||"object"!=typeof e||e instanceof Date)return e;for(const a of t)if(this.objEqualsProperties(e,a))return null;const i=t.concat([e]);if(Array.isArray(e)){const a=[];for(const l of e)a.push(this.decycle(l,i,n,s));return a}{const a={};for(const l of Object.keys(e))a[l]=this.decycle(e[l],i,n,s);return a}}objEqualsProperties(e,t){const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const i of n)if(e[i]!==t[i])return!1;return!0}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(W))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Ue=(()=>{class o{constructor(e,t){this.deepComparer=e,this.logger=t}refresh(e,t,n,s){for(const[i,a]of Object.entries(e))this.updateBindings(a,t,n);if(s)for(const i of Object.values(e)){if(!i.componentRef)return;"function"==typeof i.componentRef.instance.onDynamicChanges&&i.componentRef.instance.onDynamicChanges({context:t})}}updateBindings(e,t,n){e.componentRef&&(e.bindings=e.parser.getBindings(e.id,e.value,t,n),this.updateComponentWithNewInputs(e,n),this.updateComponentWithNewOutputs(e,t,n),e.previousBindings={inputs:this.savePreviousBindings(e,"inputs",n.compareInputsByValue,n.compareByValueDepth),outputs:this.savePreviousBindings(e,"outputs",n.compareOutputsByValue,n.compareByValueDepth)})}savePreviousBindings(e,t,n,s){const i={};if(e.bindings.hasOwnProperty(t))for(const[a,l]of Object.entries(e.bindings[t]))i[a]={reference:l,stringified:n?this.deepComparer.detailedStringify(l,s):null};return i}updateComponentWithNewInputs(e,t){const n=e.componentRef.instance,s=this.getChangedBindings(e,"inputs",t),i=[],a=(0,T.HJs)(e.componentRef.componentType);for(const[l,c]of Object.entries(s)){const u=t.ignoreInputAliases?"propName":"templateName",d=a.inputs.find(p=>l===p[u])||a.inputs.find(p=>l.toLowerCase()===p[u].toLowerCase())||a.inputs.find(p=>l.replace(/-/g,"")===p[u])||a.inputs.find(p=>l.replace(/-/g,"").toLowerCase()===p[u].toLowerCase());if(d)i.push({propName:d.propName,templateName:d.templateName,value:c});else if(t.acceptInputsForAnyProperty){const h=Object.getOwnPropertyNames(n).find(f=>l===f)||Object.getOwnPropertyNames(n).find(f=>l.toLowerCase()===f.toLowerCase())||l;if(["__proto__","prototype","constructor"].includes(h)){this.logger.error(['Tried to overwrite a __proto__, prototype or constructor property with input "'+h+'" for hook "'+e.componentRef.componentType.name+'". This is not allowed.'],t);continue}i.push({propName:h,templateName:null,value:c})}}for(const{propName:l,templateName:c,value:u}of i)c?e.componentRef?.setInput(c,u):l&&(e.componentRef.instance[l]=u);i.length&&e.componentRef?.changeDetectorRef.detectChanges()}updateComponentWithNewOutputs(e,t,n){const s=e.componentRef.instance,i=this.getChangedBindings(e,"outputs",n),a=[],l=(0,T.HJs)(e.componentRef.componentType);for(const[c,u]of Object.entries(i)){const d=n.ignoreOutputAliases?"propName":"templateName",p=l.outputs.find(h=>c===h[d])||l.outputs.find(h=>c.toLowerCase()===h[d].toLowerCase())||l.outputs.find(h=>c.replace(/-/g,"")===h[d])||l.outputs.find(h=>c.replace(/-/g,"").toLowerCase()===h[d].toLowerCase());if(p)a.push({propName:p.propName,templateName:p.templateName,value:u});else if(n.acceptOutputsForAnyObservable){let h=Object.getOwnPropertyNames(s).find(f=>s[f]instanceof L.c&&c===f)||Object.getOwnPropertyNames(s).find(f=>s[f]instanceof L.c&&c.toLowerCase()===f.toLowerCase());h&&a.push({propName:h,templateName:null,value:u})}}for(const{propName:c,value:d}of a)e.outputSubscriptions[c]&&e.outputSubscriptions[c].unsubscribe(),e.outputSubscriptions[c]=e.componentRef.instance[c].subscribe(p=>{d(p,t)})}getChangedBindings(e,t,n){const s={};if(e.bindings.hasOwnProperty(t))for(const[i,a]of Object.entries(e.bindings[t]))if(e.previousBindings&&e.previousBindings[t].hasOwnProperty(i))if("inputs"===t?n.compareInputsByValue:n.compareOutputsByValue){const l=this.deepComparer.detailedStringify(a,n.compareByValueDepth);this.checkDetailedStringifyResultPair(i,e.componentRef.componentType.name,n,e.previousBindings[t][i].stringified,l)?l.result!==e.previousBindings[t][i].stringified.result&&(s[i]=a):a!==e.previousBindings[t][i].reference&&(s[i]=a)}else a!==e.previousBindings[t][i].reference&&(s[i]=a);else s[i]=a;return s}checkDetailedStringifyResultPair(e,t,n,s,i){return null===s.result&&null===i.result?(this.logger.warn(['Could stringify neither new nor old value for hook binding "'+e+'" for component "'+t+'" to compare by value. Defaulting to comparison by reference instead.'],n),!1):null===s.result?(this.logger.warn(['Could not stringify old value for hook binding "'+e+'" for component "'+t+'" to compare by value. Defaulting to comparison by reference instead.'],n),!1):null===i.result?(this.logger.warn(['Could not stringify new value for hook binding "'+e+'" for component "'+t+'" to compare by value. Defaulting to comparison by reference instead.'],n),!1):(s.depthReachedCount>0&&i.depthReachedCount>0?this.logger.warn(["Maximum compareByValueDepth of "+n.compareByValueDepth+" reached "+i.depthReachedCount+" time(s) for new value and "+s.depthReachedCount+' time(s) for old value while comparing binding "'+e+'" for component "'+t+".\n","If this impacts performance, consider simplifying this binding, reducing comparison depth or setting compareInputsByValue/compareOutputsByValue to false."],n):s.depthReachedCount>0?this.logger.warn(["Maximum compareByValueDepth of "+n.compareByValueDepth+" reached "+s.depthReachedCount+' time(s) for old value while comparing binding "'+e+'" for component "'+t+".\n","If this impacts performance, consider simplifying this binding, reducing comparison depth or setting compareInputsByValue/compareOutputsByValue to false."],n):i.depthReachedCount>0&&this.logger.warn(["Maximum compareByValueDepth of "+n.compareByValueDepth+" reached "+i.depthReachedCount+' time(s) for new value while comparing binding "'+e+'" for component "'+t+".\n","If this impacts performance, consider simplifying this binding, reducing comparison depth or setting compareInputsByValue/compareOutputsByValue to false."],n),!0)}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(Ht),g.KVO(W))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),jt=(()=>{class o{constructor(e,t,n,s,i){this.platformId=e,this.appRef=t,this.componentUpdater=n,this.platformService=s,this.logger=i}init(e,t,n,s,i,a,l){const c=new j.m(1),u=[],d={};if(0===Object.keys(t).length)return c.next(!0),c;for(let h of this.platformService.querySelectorAll(e,`[${A}][${M}]`)){const f=parseInt(this.platformService.getAttribute(h,A));if(0===this.platformService.querySelectorAll(e,`[${A}="${f}"][${M}="${n}"]`).length){delete t[f];continue}const m=t[f];m.data=m.parser.loadComponent(m.id,m.value,s,this.platformService.getChildNodes(h),i),m.isLazy=m.data.component.hasOwnProperty("importPromise")&&m.data.component.hasOwnProperty("importName"),(0,de.UE)(this.platformId)||!m.isLazy?(!m.data.hostElementTag&&xt.includes(this.platformService.getTagName(h).toLowerCase())&&(m.data.hostElementTag=we),m.data.hostElementTag&&(h=this.useCustomHostElement(h,m.data.hostElementTag),m.value.element=h),this.createContentSlotElements(h,m,n),d[f]=h):delete t[f]}const p=Object.keys(d).map(h=>parseInt(h));for(const[h,f]of Object.entries(t))p.includes(parseInt(h))||(this.logger.warn(["Error when trying to load components - The anchor element for the following hook was found initially, but could not be found again for loading the component. Ignoring.",f],i),delete t[h]);for(const[h,f]of Object.entries(d)){const m=t[h];u.push((0,E.of)(!0).pipe((0,z.Z)(()=>this.loadComponentClass(m.data.component))).pipe((0,U.M)(O=>{const R=this.extractContentSlotElements(f,n);this.createComponent(m,s,f,R,i,O,a,l)})).pipe((0,b.W)(O=>(this.logger.error([O.stack],i),delete t[m.id],(0,E.of)(null)))))}return 0===u.length?(c.next(!0),c):((0,C.z)([...u]).pipe(je()).subscribe(()=>{for(const h of Object.values(t)){const f=[];("function"==typeof h.componentRef.instance.onDynamicMount||"function"==typeof h.componentRef.instance.onDynamicChanges)&&this.findContentChildren(h.componentRef.location.nativeElement,f,t,n),"function"==typeof h.componentRef.instance.onDynamicChanges&&h.componentRef.instance.onDynamicChanges({contentChildren:f}),"function"==typeof h.componentRef.instance.onDynamicMount&&h.componentRef.instance.onDynamicMount({context:s,contentChildren:f})}for(const h of Object.values(d))this.platformService.removeAttribute(h,A),this.platformService.removeAttribute(h,M),this.platformService.removeAttribute(h,"ng-version");c.next(!0)}),c)}useCustomHostElement(e,t){const n=this.platformService.createElement(t);this.platformService.setAttribute(n,A,this.platformService.getAttribute(e,A)),this.platformService.setAttribute(n,M,this.platformService.getAttribute(e,M)),this.platformService.removeAttribute(e,A),this.platformService.removeAttribute(e,M);const s=this.platformService.getChildNodes(e);for(const i of s)this.platformService.appendChild(n,i);return this.platformService.insertBefore(this.platformService.getParentNode(e),n,e),this.platformService.removeChild(this.platformService.getParentNode(e),e),n}createContentSlotElements(e,t,n){let s;s=t.data.hasOwnProperty("content")&&Array.isArray(t.data.content)?t.data.content:[this.platformService.getChildNodes(e)],this.platformService.clearChildNodes(e);for(const[i,a]of s.entries())if(null!=a){const l=this.platformService.createElement("dynamic-component-contentslot");this.platformService.setAttribute(l,"slotIndex",i.toString()),this.platformService.setAttribute(l,"parsetoken",n);for(const c of a)this.platformService.appendChild(l,c);this.platformService.appendChild(e,l)}}extractContentSlotElements(e,t){const n=[],s=this.platformService.getChildNodes(e).filter(i=>"DYNAMIC-COMPONENT-CONTENTSLOT"===this.platformService.getTagName(i)&&this.platformService.getAttribute(i,"parsetoken")===t);for(const i of s){const a=this.platformService.getAttribute(i,"slotIndex");n[parseInt(a)]=this.platformService.getChildNodes(i)}return this.platformService.clearChildNodes(e),n}loadComponentClass(e){const t=new j.m(1);if(e.hasOwnProperty("prototype"))t.next(e);else if("function"==typeof e)e().then(n=>{t.next(n)});else{if(!e.hasOwnProperty("importPromise")||!e.hasOwnProperty("importName"))throw Error('The "component" property of a returned HookData object must either contain the component class, a function that returns a promise with the component class or an explicit LazyLoadComponentConfig');if(e.importPromise instanceof Promise)throw Error('When lazy-loading a component, the "importPromise"-field must contain a function returning the import-promise, but it contained the promise itself.');e.importPromise().then(n=>{const s=e.importName,i=Object.prototype.hasOwnProperty.call(n,s)?n[s]:n.default;t.next(i)})}return t}createComponent(e,t,n,s,i,a,l,c){const u=(0,T.a0P)(a,{hostElement:n,environmentInjector:e.data.environmentInjector||l,elementInjector:e.data.injector||c,projectableNodes:s});e.componentRef=u,this.mapOutputsToHTMLEvents(e,i),this.componentUpdater.updateBindings(e,t,i),"function"==typeof e.componentRef.instance.onDynamicChanges&&void 0!==t&&e.componentRef.instance.onDynamicChanges({context:t}),this.appRef.attachView(u.hostView),u.changeDetectorRef.detectChanges()}mapOutputsToHTMLEvents(e,t){const n=(0,T.HJs)(e.componentRef.componentType);for(const s of n.outputs){const i=t.ignoreOutputAliases?s.propName:s.templateName;e.htmlEventSubscriptions[i]=e.componentRef.instance[s.propName].subscribe(a=>{t.triggerDOMEvents&&this.platformService.dispatchEvent(e.componentRef?.location.nativeElement,i,a)})}}findContentChildren(e,t=[],n,s){const i=this.platformService.getChildNodes(e);null!=i&&i.length>0&&i.forEach((a,l)=>{let c=!1;const u=this.platformService.getAttribute(a,M);if(null!==u&&u===s&&this.platformService.getAttribute(a,A)){const p=parseInt(this.platformService.getAttribute(a,A),10);n.hasOwnProperty(p)&&(t.push({componentRef:n[p].componentRef,contentChildren:[],hookValue:n[p].value}),c=!0)}this.findContentChildren(a,c?t[t.length-1].contentChildren:t,n,s)})}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(w.Agw),g.KVO(w.o8S),g.KVO(Ue),g.KVO(J),g.KVO(W))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Ze=(()=>{class o{constructor(e,t,n,s,i,a,l,c,u,d,p){this.allSettings=e,this.ancestorSettings=t,this.moduleSettings=n,this.settingsResolver=s,this.textHookFinder=i,this.elementHookFinder=a,this.contentSanitizer=l,this.componentCreator=c,this.platformService=u,this.environmentInjector=d,this.injector=p}parse(e=null,t=null,n=null,s=null,i=null,a=null,l=null,c={},u=null,d=null){const p=u||this.environmentInjector,h=d||this.injector,{parsers:f,options:m}=this.settingsResolver.resolve(h,e,this.allSettings,this.ancestorSettings,this.moduleSettings,t,s,i,a);if(!e)return(0,E.of)({element:l||this.platformService.createElement("div"),hookIndex:c,context:n,usedParsers:f,usedOptions:m,usedInjector:h,usedEnvironmentInjector:p,destroy:()=>this.destroy(c)});const O=Math.random().toString(36).substring(2,12);let R="string"==typeof e?this.platformService.createElement("div"):e;if(this.platformService.setAttribute(R,se,"1"),"string"==typeof e){const H=this.textHookFinder.find(e,n,f,O,m,c);this.platformService.setInnerContent(R,H.content)}else this.textHookFinder.findInElement(R,n,f,O,m,c);if(c=this.elementHookFinder.find(R,n,f,O,m,c),m?.sanitize&&this.contentSanitizer.sanitize(R,c,O),l&&l!==R){this.platformService.removeAttribute(R,se),this.platformService.setAttribute(l,se,"1"),this.platformService.clearChildNodes(l);for(const H of this.platformService.getChildNodes(R))this.platformService.appendChild(l,H);R=l}return this.componentCreator.init(R,c,O,n,m,p,h).pipe(je()).pipe((0,mt.T)(H=>(this.platformService.removeAttribute(R,se),{element:R,hookIndex:c,context:n,usedParsers:f,usedOptions:m,usedInjector:h,usedEnvironmentInjector:p,destroy:()=>this.destroy(c)})))}destroy(e){if(e){for(const t of Object.values(e))t.componentRef&&t.componentRef.destroy();for(const t of Object.values(e)){for(const n of Object.values(t.outputSubscriptions))n&&n.unsubscribe();for(const n of Object.values(t.htmlEventSubscriptions))n&&n.unsubscribe()}}}static{this.\u0275fac=function(t){return new(t||o)(g.KVO(Fe,8),g.KVO(xe,8),g.KVO(Le,8),g.KVO(Dt),g.KVO($t),g.KVO(Mt),g.KVO(Vt),g.KVO(jt),g.KVO(J),g.KVO(g.uvJ),g.KVO(g.zZn))}}static{this.\u0275prov=g.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})(),Ut=(()=>{class o{constructor(e,t,n,s,i,a){this.hostElement=e,this.dynamicHooksService=t,this.componentUpdater=n,this.platformService=s,this.environmentInjector=i,this.injector=a,this.content=null,this.context=null,this.globalParsersBlacklist=null,this.globalParsersWhitelist=null,this.parsers=null,this.options=null,this.componentsLoaded=new g.bkB,this.hookIndex={},this.activeOptions={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}},this.activeParsers=[],this.token=Math.random().toString(36).substring(2,12),this.initialized=!1}ngDoCheck(){this.activeOptions.updateOnPushOnly||this.refresh(!1)}ngOnChanges(e){e.hasOwnProperty("content")||e.hasOwnProperty("globalParsersBlacklist")||e.hasOwnProperty("globalParsersWhitelist")||e.hasOwnProperty("parsers")||e.hasOwnProperty("options")?(this.reset(),this.parse(this.content)):e.hasOwnProperty("context")&&this.refresh(!0)}ngAfterViewInit(){}ngAfterViewChecked(){}ngOnDestroy(){this.reset()}reset(){this.dynamicHooksService.destroy(this.hookIndex),this.platformService.setInnerContent(this.hostElement.nativeElement,""),this.hookIndex={},this.activeOptions={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}},this.activeParsers=[],this.initialized=!1}parse(e){this.dynamicHooksService.parse(e,this.parsers,this.context,this.options,this.globalParsersBlacklist,this.globalParsersWhitelist,this.hostElement.nativeElement,this.hookIndex,this.environmentInjector,this.injector).subscribe(t=>{this.activeParsers=t.usedParsers,this.activeOptions=t.usedOptions,this.initialized=!0;const n=Object.values(this.hookIndex).map(s=>({hookId:s.id,hookValue:s.value,hookParser:s.parser,componentRef:s.componentRef}));this.componentsLoaded.emit(n)})}refresh(e){this.initialized&&this.componentUpdater.refresh(this.hookIndex,this.context,this.activeOptions,e)}static{this.\u0275fac=function(t){return new(t||o)(w.rXU(w.aKT),w.rXU(Ze),w.rXU(Ue),w.rXU(J),w.rXU(g.uvJ),w.rXU(g.zZn))}}static{this.\u0275cmp=w.VBU({type:o,selectors:[["ngx-dynamic-hooks"]],inputs:{content:"content",context:"context",globalParsersBlacklist:"globalParsersBlacklist",globalParsersWhitelist:"globalParsersWhitelist",parsers:"parsers",options:"options"},outputs:{componentsLoaded:"componentsLoaded"},features:[w.OA$],decls:0,vars:0,template:function(t,n){},encapsulation:2})}}return o})();var Y={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Ge(o){Y=o}var ie={exec:()=>null};function S(o,r=""){let e="string"==typeof o?o:o.source;const t={replace:(n,s)=>{let i="string"==typeof s?s:s.source;return i=i.replace($.caret,"$1"),e=e.replace(n,i),t},getRegex:()=>new RegExp(e,r)};return t}var $={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:o=>new RegExp(`^( {0,3}${o})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}#`),htmlBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}<(?:[a-z].*>|!--)`,"i")},ae=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Oe=/(?:[*+-]|\d{1,9}[.)])/,Qe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Xe=S(Qe).replace(/bull/g,Oe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Jt=S(Qe).replace(/bull/g,Oe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Be=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ae=/(?!\s*\])(?:\\.|[^\[\]\\])+/,en=S(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ae).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),tn=S(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Oe).getRegex(),fe="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Pe=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,nn=S("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",Pe).replace("tag",fe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Je=S(Be).replace("hr",ae).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fe).getRegex(),Ne={blockquote:S(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Je).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:en,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:ae,html:nn,lheading:Xe,list:tn,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:Je,table:ie,text:/^[^\n]+/},Ye=S("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ae).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fe).getRegex(),sn={...Ne,lheading:Jt,table:Ye,paragraph:S(Be).replace("hr",ae).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ye).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fe).getRegex()},on={...Ne,html:S("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Pe).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ie,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:S(Be).replace("hr",ae).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Xe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},et=/^( {2,}|\\)\n(?!\s*$)/,me=/[\p{P}\p{S}]/u,De=/[\s\p{P}\p{S}]/u,tt=/[^\s\p{P}\p{S}]/u,un=S(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,De).getRegex(),nt=/(?!~)[\p{P}\p{S}]/u,rt=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,gn=S(rt,"u").replace(/punct/g,me).getRegex(),fn=S(rt,"u").replace(/punct/g,nt).getRegex(),st="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",mn=S(st,"gu").replace(/notPunctSpace/g,tt).replace(/punctSpace/g,De).replace(/punct/g,me).getRegex(),bn=S(st,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,nt).getRegex(),yn=S("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,tt).replace(/punctSpace/g,De).replace(/punct/g,me).getRegex(),vn=S(/\\(punct)/,"gu").replace(/punct/g,me).getRegex(),kn=S(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),xn=S(Pe).replace("(?:--\x3e|$)","--\x3e").getRegex(),wn=S("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",xn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),be=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Sn=S(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",be).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ot=S(/^!?\[(label)\]\[(ref)\]/).replace("label",be).replace("ref",Ae).getRegex(),it=S(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ae).getRegex(),$e={_backpedal:ie,anyPunctuation:vn,autolink:kn,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:et,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:ie,emStrongLDelim:gn,emStrongRDelimAst:mn,emStrongRDelimUnd:yn,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Sn,nolink:it,punctuation:un,reflink:ot,reflinkSearch:S("reflink|nolink(?!\\()","g").replace("reflink",ot).replace("nolink",it).getRegex(),tag:wn,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:ie},Tn={...$e,link:S(/^!?\[(label)\]\((.*?)\)/).replace("label",be).getRegex(),reflink:S(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",be).getRegex()},Me={...$e,emStrongRDelimAst:bn,emStrongLDelim:fn,url:S(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},En={...Me,br:S(et).replace("{2,}","*").getRegex(),text:S(Me.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ye={normal:Ne,gfm:sn,pedantic:on},le={normal:$e,gfm:Me,breaks:En,pedantic:Tn},Cn={"&":"&","<":"<",">":">",'"':""","'":"'"},at=o=>Cn[o];function _(o,r){if(r){if($.escapeTest.test(o))return o.replace($.escapeReplace,at)}else if($.escapeTestNoEncode.test(o))return o.replace($.escapeReplaceNoEncode,at);return o}function lt(o){try{o=encodeURI(o).replace($.percentDecode,"%")}catch{return null}return o}function ct(o,r){const t=o.replace($.findPipe,(s,i,a)=>{let l=!1,c=i;for(;--c>=0&&"\\"===a[c];)l=!l;return l?"|":" |"}).split($.splitPipe);let n=0;if(t[0].trim()||t.shift(),t.length>0&&!t.at(-1)?.trim()&&t.pop(),r)if(t.length>r)t.splice(r);else for(;t.length<r;)t.push("");for(;n<t.length;n++)t[n]=t[n].trim().replace($.slashPipe,"|");return t}function ce(o,r,e){const t=o.length;if(0===t)return"";let n=0;for(;n<t;){const s=o.charAt(t-n-1);if(s!==r||e){if(s===r||!e)break;n++}else n++}return o.slice(0,t-n)}function ut(o,r,e,t,n){const s=r.href,i=r.title||null,a=o[1].replace(n.other.outputLinkReplace,"$1");t.state.inLink=!0;const l={type:"!"===o[0].charAt(0)?"image":"link",raw:e,href:s,title:i,text:a,tokens:t.inlineTokens(a)};return t.state.inLink=!1,l}var ve=class{options;rules;lexer;constructor(o){this.options=o||Y}space(o){const r=this.rules.block.newline.exec(o);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(o){const r=this.rules.block.code.exec(o);if(r){const e=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ce(e,"\n")}}}fences(o){const r=this.rules.block.fences.exec(o);if(r){const e=r[0],t=function On(o,r,e){const t=o.match(e.other.indentCodeCompensation);if(null===t)return r;const n=t[1];return r.split("\n").map(s=>{const i=s.match(e.other.beginningSpace);if(null===i)return s;const[a]=i;return a.length>=n.length?s.slice(n.length):s}).join("\n")}(e,r[3]||"",this.rules);return{type:"code",raw:e,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:t}}}heading(o){const r=this.rules.block.heading.exec(o);if(r){let e=r[2].trim();if(this.rules.other.endingHash.test(e)){const t=ce(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(o){const r=this.rules.block.hr.exec(o);if(r)return{type:"hr",raw:ce(r[0],"\n")}}blockquote(o){const r=this.rules.block.blockquote.exec(o);if(r){let e=ce(r[0],"\n").split("\n"),t="",n="";const s=[];for(;e.length>0;){let i=!1;const a=[];let l;for(l=0;l<e.length;l++)if(this.rules.other.blockquoteStart.test(e[l]))a.push(e[l]),i=!0;else{if(i)break;a.push(e[l])}e=e.slice(l);const c=a.join("\n"),u=c.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");t=t?`${t}\n${c}`:c,n=n?`${n}\n${u}`:u;const d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,s,!0),this.lexer.state.top=d,0===e.length)break;const p=s.at(-1);if("code"===p?.type)break;if("blockquote"===p?.type){const h=p,f=h.raw+"\n"+e.join("\n"),m=this.blockquote(f);s[s.length-1]=m,t=t.substring(0,t.length-h.raw.length)+m.raw,n=n.substring(0,n.length-h.text.length)+m.text;break}if("list"===p?.type){const h=p,f=h.raw+"\n"+e.join("\n"),m=this.list(f);s[s.length-1]=m,t=t.substring(0,t.length-p.raw.length)+m.raw,n=n.substring(0,n.length-h.raw.length)+m.raw,e=f.substring(s.at(-1).raw.length).split("\n");continue}}return{type:"blockquote",raw:t,tokens:s,text:n}}}list(o){let r=this.rules.block.list.exec(o);if(r){let e=r[1].trim();const t=e.length>1,n={type:"list",raw:"",ordered:t,start:t?+e.slice(0,-1):"",loose:!1,items:[]};e=t?`\\d{1,9}\\${e.slice(-1)}`:`\\${e}`,this.options.pedantic&&(e=t?e:"[*+-]");const s=this.rules.other.listItemRegex(e);let i=!1;for(;o;){let l=!1,c="",u="";if(!(r=s.exec(o))||this.rules.block.hr.test(o))break;c=r[0],o=o.substring(c.length);let d=r[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,R=>" ".repeat(3*R.length)),p=o.split("\n",1)[0],h=!d.trim(),f=0;if(this.options.pedantic?(f=2,u=d.trimStart()):h?f=r[1].length+1:(f=r[2].search(this.rules.other.nonSpaceChar),f=f>4?1:f,u=d.slice(f),f+=r[1].length),h&&this.rules.other.blankLine.test(p)&&(c+=p+"\n",o=o.substring(p.length+1),l=!0),!l){const R=this.rules.other.nextBulletRegex(f),H=this.rules.other.hrRegex(f),pe=this.rules.other.fencesBeginRegex(f),te=this.rules.other.headingBeginRegex(f),X=this.rules.other.htmlBeginRegex(f);for(;o;){const ne=o.split("\n",1)[0];let F;if(p=ne,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),F=p):F=p.replace(this.rules.other.tabCharGlobal," "),pe.test(p)||te.test(p)||X.test(p)||R.test(p)||H.test(p))break;if(F.search(this.rules.other.nonSpaceChar)>=f||!p.trim())u+="\n"+F.slice(f);else{if(h||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||pe.test(d)||te.test(d)||H.test(d))break;u+="\n"+p}!h&&!p.trim()&&(h=!0),c+=ne+"\n",o=o.substring(ne.length+1),d=F.slice(f)}}n.loose||(i?n.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(i=!0));let O,m=null;this.options.gfm&&(m=this.rules.other.listIsTask.exec(u),m&&(O="[ ] "!==m[0],u=u.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:c,task:!!m,checked:O,loose:!1,text:u,tokens:[]}),n.raw+=c}const a=n.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),n.raw=n.raw.trimEnd();for(let l=0;l<n.items.length;l++)if(this.lexer.state.top=!1,n.items[l].tokens=this.lexer.blockTokens(n.items[l].text,[]),!n.loose){const c=n.items[l].tokens.filter(d=>"space"===d.type),u=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.raw));n.loose=u}if(n.loose)for(let l=0;l<n.items.length;l++)n.items[l].loose=!0;return n}}html(o){const r=this.rules.block.html.exec(o);if(r)return{type:"html",block:!0,raw:r[0],pre:"pre"===r[1]||"script"===r[1]||"style"===r[1],text:r[0]}}def(o){const r=this.rules.block.def.exec(o);if(r){const e=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),t=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:e,raw:r[0],href:t,title:n}}}table(o){const r=this.rules.block.table.exec(o);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;const e=ct(r[1]),t=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],s={type:"table",raw:r[0],header:[],align:[],rows:[]};if(e.length===t.length){for(const i of t)this.rules.other.tableAlignRight.test(i)?s.align.push("right"):this.rules.other.tableAlignCenter.test(i)?s.align.push("center"):this.rules.other.tableAlignLeft.test(i)?s.align.push("left"):s.align.push(null);for(let i=0;i<e.length;i++)s.header.push({text:e[i],tokens:this.lexer.inline(e[i]),header:!0,align:s.align[i]});for(const i of n)s.rows.push(ct(i,s.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:s.align[l]})));return s}}lheading(o){const r=this.rules.block.lheading.exec(o);if(r)return{type:"heading",raw:r[0],depth:"="===r[2].charAt(0)?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(o){const r=this.rules.block.paragraph.exec(o);if(r){const e="\n"===r[1].charAt(r[1].length-1)?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:e,tokens:this.lexer.inline(e)}}}text(o){const r=this.rules.block.text.exec(o);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(o){const r=this.rules.inline.escape.exec(o);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(o){const r=this.rules.inline.tag.exec(o);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(o){const r=this.rules.inline.link.exec(o);if(r){const e=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;const s=ce(e.slice(0,-1),"\\");if((e.length-s.length)%2==0)return}else{const s=function Rn(o,r){if(-1===o.indexOf(r[1]))return-1;let e=0;for(let t=0;t<o.length;t++)if("\\"===o[t])t++;else if(o[t]===r[0])e++;else if(o[t]===r[1]&&(e--,e<0))return t;return e>0?-2:-1}(r[2],"()");if(-2===s)return;if(s>-1){const a=(0===r[0].indexOf("!")?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,a).trim(),r[3]=""}}let t=r[2],n="";if(this.options.pedantic){const s=this.rules.other.pedanticHrefTitle.exec(t);s&&(t=s[1],n=s[3])}else n=r[3]?r[3].slice(1,-1):"";return t=t.trim(),this.rules.other.startAngleBracket.test(t)&&(t=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?t.slice(1):t.slice(1,-1)),ut(r,{href:t&&t.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(o,r){let e;if((e=this.rules.inline.reflink.exec(o))||(e=this.rules.inline.nolink.exec(o))){const n=r[(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!n){const s=e[0].charAt(0);return{type:"text",raw:s,text:s}}return ut(e,n,e[0],this.lexer,this.rules)}}emStrong(o,r,e=""){let t=this.rules.inline.emStrongLDelim.exec(o);if(!(!t||t[3]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!t[1]&&!t[2]||!e||this.rules.inline.punctuation.exec(e))){const s=[...t[0]].length-1;let i,a,l=s,c=0;const u="*"===t[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,r=r.slice(-1*o.length+s);null!=(t=u.exec(r));){if(i=t[1]||t[2]||t[3]||t[4]||t[5]||t[6],!i)continue;if(a=[...i].length,t[3]||t[4]){l+=a;continue}if((t[5]||t[6])&&s%3&&!((s+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);const d=[...t[0]][0].length,p=o.slice(0,s+t.index+d+a);if(Math.min(s,a)%2){const f=p.slice(1,-1);return{type:"em",raw:p,text:f,tokens:this.lexer.inlineTokens(f)}}const h=p.slice(2,-2);return{type:"strong",raw:p,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(o){const r=this.rules.inline.code.exec(o);if(r){let e=r[2].replace(this.rules.other.newLineCharGlobal," ");const t=this.rules.other.nonSpaceChar.test(e),n=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return t&&n&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:r[0],text:e}}}br(o){const r=this.rules.inline.br.exec(o);if(r)return{type:"br",raw:r[0]}}del(o){const r=this.rules.inline.del.exec(o);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(o){const r=this.rules.inline.autolink.exec(o);if(r){let e,t;return"@"===r[2]?(e=r[1],t="mailto:"+e):(e=r[1],t=e),{type:"link",raw:r[0],text:e,href:t,tokens:[{type:"text",raw:e,text:e}]}}}url(o){let r;if(r=this.rules.inline.url.exec(o)){let e,t;if("@"===r[2])e=r[0],t="mailto:"+e;else{let n;do{n=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??""}while(n!==r[0]);e=r[0],t="www."===r[1]?"http://"+r[0]:r[0]}return{type:"link",raw:r[0],text:e,href:t,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(o){const r=this.rules.inline.text.exec(o);if(r)return{type:"text",raw:r[0],text:r[0],escaped:this.lexer.state.inRawBlock}}},K=class Ve{tokens;options;state;tokenizer;inlineQueue;constructor(r){this.tokens=[],this.tokens.links=Object.create(null),this.options=r||Y,this.options.tokenizer=this.options.tokenizer||new ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const e={other:$,block:ye.normal,inline:le.normal};this.options.pedantic?(e.block=ye.pedantic,e.inline=le.pedantic):this.options.gfm&&(e.block=ye.gfm,e.inline=this.options.breaks?le.breaks:le.gfm),this.tokenizer.rules=e}static get rules(){return{block:ye,inline:le}}static lex(r,e){return new Ve(e).lex(r)}static lexInline(r,e){return new Ve(e).inlineTokens(r)}lex(r){r=r.replace($.carriageReturn,"\n"),this.blockTokens(r,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(r,e=[],t=!1){for(this.options.pedantic&&(r=r.replace($.tabCharGlobal," ").replace($.spaceLine,""));r;){let n;if(this.options.extensions?.block?.some(i=>!!(n=i.call({lexer:this},r,e))&&(r=r.substring(n.raw.length),e.push(n),!0)))continue;if(n=this.tokenizer.space(r)){r=r.substring(n.raw.length);const i=e.at(-1);1===n.raw.length&&void 0!==i?i.raw+="\n":e.push(n);continue}if(n=this.tokenizer.code(r)){r=r.substring(n.raw.length);const i=e.at(-1);"paragraph"===i?.type||"text"===i?.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.at(-1).src=i.text):e.push(n);continue}if(n=this.tokenizer.fences(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.heading(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.hr(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.blockquote(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.list(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.html(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.def(r)){r=r.substring(n.raw.length);const i=e.at(-1);"paragraph"===i?.type||"text"===i?.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(r)){r=r.substring(n.raw.length),e.push(n);continue}if(n=this.tokenizer.lheading(r)){r=r.substring(n.raw.length),e.push(n);continue}let s=r;if(this.options.extensions?.startBlock){let i=1/0;const a=r.slice(1);let l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},a),"number"==typeof l&&l>=0&&(i=Math.min(i,l))}),i<1/0&&i>=0&&(s=r.substring(0,i+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s))){const i=e.at(-1);t&&"paragraph"===i?.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):e.push(n),t=s.length!==r.length,r=r.substring(n.raw.length);continue}if(n=this.tokenizer.text(r)){r=r.substring(n.raw.length);const i=e.at(-1);"text"===i?.type?(i.raw+="\n"+n.raw,i.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):e.push(n);continue}if(r){const i="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(i);break}throw new Error(i)}}return this.state.top=!0,e}inline(r,e=[]){return this.inlineQueue.push({src:r,tokens:e}),e}inlineTokens(r,e=[]){let t=r,n=null;if(this.tokens.links){const a=Object.keys(this.tokens.links);if(a.length>0)for(;null!=(n=this.tokenizer.rules.inline.reflinkSearch.exec(t));)a.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(t=t.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+t.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(n=this.tokenizer.rules.inline.anyPunctuation.exec(t));)t=t.slice(0,n.index)+"++"+t.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(n=this.tokenizer.rules.inline.blockSkip.exec(t));)t=t.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+t.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,i="";for(;r;){let a;if(s||(i=""),s=!1,this.options.extensions?.inline?.some(c=>!!(a=c.call({lexer:this},r,e))&&(r=r.substring(a.raw.length),e.push(a),!0)))continue;if(a=this.tokenizer.escape(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.tag(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.link(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.reflink(r,this.tokens.links)){r=r.substring(a.raw.length);const c=e.at(-1);"text"===a.type&&"text"===c?.type?(c.raw+=a.raw,c.text+=a.text):e.push(a);continue}if(a=this.tokenizer.emStrong(r,t,i)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.codespan(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.br(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.del(r)){r=r.substring(a.raw.length),e.push(a);continue}if(a=this.tokenizer.autolink(r)){r=r.substring(a.raw.length),e.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(r))){r=r.substring(a.raw.length),e.push(a);continue}let l=r;if(this.options.extensions?.startInline){let c=1/0;const u=r.slice(1);let d;this.options.extensions.startInline.forEach(p=>{d=p.call({lexer:this},u),"number"==typeof d&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(l=r.substring(0,c+1))}if(a=this.tokenizer.inlineText(l)){r=r.substring(a.raw.length),"_"!==a.raw.slice(-1)&&(i=a.raw.slice(-1)),s=!0;const c=e.at(-1);"text"===c?.type?(c.raw+=a.raw,c.text+=a.text):e.push(a);continue}if(r){const c="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}return e}},ue=class{options;parser;constructor(o){this.options=o||Y}space(o){return""}code({text:o,lang:r,escaped:e}){const t=(r||"").match($.notSpaceStart)?.[0],n=o.replace($.endingNewline,"")+"\n";return t?'<pre><code class="language-'+_(t)+'">'+(e?n:_(n,!0))+"</code></pre>\n":"<pre><code>"+(e?n:_(n,!0))+"</code></pre>\n"}blockquote({tokens:o}){return`<blockquote>\n${this.parser.parse(o)}</blockquote>\n`}html({text:o}){return o}heading({tokens:o,depth:r}){return`<h${r}>${this.parser.parseInline(o)}</h${r}>\n`}hr(o){return"<hr>\n"}list(o){const r=o.ordered,e=o.start;let t="";for(let i=0;i<o.items.length;i++)t+=this.listitem(o.items[i]);const n=r?"ol":"ul";return"<"+n+(r&&1!==e?' start="'+e+'"':"")+">\n"+t+"</"+n+">\n"}listitem(o){let r="";if(o.task){const e=this.checkbox({checked:!!o.checked});o.loose?"paragraph"===o.tokens[0]?.type?(o.tokens[0].text=e+" "+o.tokens[0].text,o.tokens[0].tokens&&o.tokens[0].tokens.length>0&&"text"===o.tokens[0].tokens[0].type&&(o.tokens[0].tokens[0].text=e+" "+_(o.tokens[0].tokens[0].text),o.tokens[0].tokens[0].escaped=!0)):o.tokens.unshift({type:"text",raw:e+" ",text:e+" ",escaped:!0}):r+=e+" "}return r+=this.parser.parse(o.tokens,!!o.loose),`<li>${r}</li>\n`}checkbox({checked:o}){return"<input "+(o?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:o}){return`<p>${this.parser.parseInline(o)}</p>\n`}table(o){let r="",e="";for(let n=0;n<o.header.length;n++)e+=this.tablecell(o.header[n]);r+=this.tablerow({text:e});let t="";for(let n=0;n<o.rows.length;n++){const s=o.rows[n];e="";for(let i=0;i<s.length;i++)e+=this.tablecell(s[i]);t+=this.tablerow({text:e})}return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+r+"</thead>\n"+t+"</table>\n"}tablerow({text:o}){return`<tr>\n${o}</tr>\n`}tablecell(o){const r=this.parser.parseInline(o.tokens),e=o.header?"th":"td";return(o.align?`<${e} align="${o.align}">`:`<${e}>`)+r+`</${e}>\n`}strong({tokens:o}){return`<strong>${this.parser.parseInline(o)}</strong>`}em({tokens:o}){return`<em>${this.parser.parseInline(o)}</em>`}codespan({text:o}){return`<code>${_(o,!0)}</code>`}br(o){return"<br>"}del({tokens:o}){return`<del>${this.parser.parseInline(o)}</del>`}link({href:o,title:r,tokens:e}){const t=this.parser.parseInline(e),n=lt(o);if(null===n)return t;let s='<a href="'+(o=n)+'"';return r&&(s+=' title="'+_(r)+'"'),s+=">"+t+"</a>",s}image({href:o,title:r,text:e,tokens:t}){t&&(e=this.parser.parseInline(t,this.parser.textRenderer));const n=lt(o);if(null===n)return _(e);let s=`<img src="${o=n}" alt="${e}"`;return r&&(s+=` title="${_(r)}"`),s+=">",s}text(o){return"tokens"in o&&o.tokens?this.parser.parseInline(o.tokens):"escaped"in o&&o.escaped?o.text:_(o.text)}},ze=class{strong({text:o}){return o}em({text:o}){return o}codespan({text:o}){return o}del({text:o}){return o}html({text:o}){return o}text({text:o}){return o}link({text:o}){return""+o}image({text:o}){return""+o}br(){return""}},q=class He{options;renderer;textRenderer;constructor(r){this.options=r||Y,this.options.renderer=this.options.renderer||new ue,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ze}static parse(r,e){return new He(e).parse(r)}static parseInline(r,e){return new He(e).parseInline(r)}parse(r,e=!0){let t="";for(let n=0;n<r.length;n++){const s=r[n];if(this.options.extensions?.renderers?.[s.type]){const a=s,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(!1!==l||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){t+=l||"";continue}}const i=s;switch(i.type){case"space":t+=this.renderer.space(i);continue;case"hr":t+=this.renderer.hr(i);continue;case"heading":t+=this.renderer.heading(i);continue;case"code":t+=this.renderer.code(i);continue;case"table":t+=this.renderer.table(i);continue;case"blockquote":t+=this.renderer.blockquote(i);continue;case"list":t+=this.renderer.list(i);continue;case"html":t+=this.renderer.html(i);continue;case"paragraph":t+=this.renderer.paragraph(i);continue;case"text":{let a=i,l=this.renderer.text(a);for(;n+1<r.length&&"text"===r[n+1].type;)a=r[++n],l+="\n"+this.renderer.text(a);t+=e?this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):l;continue}default:{const a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return t}parseInline(r,e=this.renderer){let t="";for(let n=0;n<r.length;n++){const s=r[n];if(this.options.extensions?.renderers?.[s.type]){const a=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==a||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){t+=a||"";continue}}const i=s;switch(i.type){case"escape":case"text":t+=e.text(i);break;case"html":t+=e.html(i);break;case"link":t+=e.link(i);break;case"image":t+=e.image(i);break;case"strong":t+=e.strong(i);break;case"em":t+=e.em(i);break;case"codespan":t+=e.codespan(i);break;case"br":t+=e.br(i);break;case"del":t+=e.del(i);break;default:{const a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return t}},ke=class{options;block;constructor(r){this.options=r||Y}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}provideLexer(){return this.block?K.lex:K.lexInline}provideParser(){return this.block?q.parse:q.parseInline}},ee=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=q;Renderer=ue;TextRenderer=ze;Lexer=K;Tokenizer=ve;Hooks=ke;constructor(...o){this.use(...o)}walkTokens(o,r){let e=[];for(const t of o)switch(e=e.concat(r.call(this,t)),t.type){case"table":{const n=t;for(const s of n.header)e=e.concat(this.walkTokens(s.tokens,r));for(const s of n.rows)for(const i of s)e=e.concat(this.walkTokens(i.tokens,r));break}case"list":e=e.concat(this.walkTokens(t.items,r));break;default:{const n=t;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(s=>{const i=n[s].flat(1/0);e=e.concat(this.walkTokens(i,r))}):n.tokens&&(e=e.concat(this.walkTokens(n.tokens,r)))}}return e}use(...o){const r=this.defaults.extensions||{renderers:{},childTokens:{}};return o.forEach(e=>{const t={...e};if(t.async=this.defaults.async||t.async||!1,e.extensions&&(e.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){const s=r.renderers[n.name];r.renderers[n.name]=s?function(...i){let a=n.renderer.apply(this,i);return!1===a&&(a=s.apply(this,i)),a}:n.renderer}if("tokenizer"in n){if(!n.level||"block"!==n.level&&"inline"!==n.level)throw new Error("extension level must be 'block' or 'inline'");const s=r[n.level];s?s.unshift(n.tokenizer):r[n.level]=[n.tokenizer],n.start&&("block"===n.level?r.startBlock?r.startBlock.push(n.start):r.startBlock=[n.start]:"inline"===n.level&&(r.startInline?r.startInline.push(n.start):r.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(r.childTokens[n.name]=n.childTokens)}),t.extensions=r),e.renderer){const n=this.defaults.renderer||new ue(this.defaults);for(const s in e.renderer){if(!(s in n))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;const a=e.renderer[s],l=n[s];n[s]=(...c)=>{let u=a.apply(n,c);return!1===u&&(u=l.apply(n,c)),u||""}}t.renderer=n}if(e.tokenizer){const n=this.defaults.tokenizer||new ve(this.defaults);for(const s in e.tokenizer){if(!(s in n))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;const a=e.tokenizer[s],l=n[s];n[s]=(...c)=>{let u=a.apply(n,c);return!1===u&&(u=l.apply(n,c)),u}}t.tokenizer=n}if(e.hooks){const n=this.defaults.hooks||new ke;for(const s in e.hooks){if(!(s in n))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;const a=e.hooks[s],l=n[s];n[s]=ke.passThroughHooks.has(s)?c=>{if(this.defaults.async)return Promise.resolve(a.call(n,c)).then(d=>l.call(n,d));const u=a.call(n,c);return l.call(n,u)}:(...c)=>{let u=a.apply(n,c);return!1===u&&(u=l.apply(n,c)),u}}t.hooks=n}if(e.walkTokens){const n=this.defaults.walkTokens,s=e.walkTokens;t.walkTokens=function(i){let a=[];return a.push(s.call(this,i)),n&&(a=a.concat(n.call(this,i))),a}}this.defaults={...this.defaults,...t}}),this}setOptions(o){return this.defaults={...this.defaults,...o},this}lexer(o,r){return K.lex(o,r??this.defaults)}parser(o,r){return q.parse(o,r??this.defaults)}parseMarkdown(o){return(e,t)=>{const n={...t},s={...this.defaults,...n},i=this.onError(!!s.silent,!!s.async);if(!0===this.defaults.async&&!1===n.async)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||null===e)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof e)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=o);const a=s.hooks?s.hooks.provideLexer():o?K.lex:K.lexInline,l=s.hooks?s.hooks.provideParser():o?q.parse:q.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(e):e).then(c=>a(c,s)).then(c=>s.hooks?s.hooks.processAllTokens(c):c).then(c=>s.walkTokens?Promise.all(this.walkTokens(c,s.walkTokens)).then(()=>c):c).then(c=>l(c,s)).then(c=>s.hooks?s.hooks.postprocess(c):c).catch(i);try{s.hooks&&(e=s.hooks.preprocess(e));let c=a(e,s);s.hooks&&(c=s.hooks.processAllTokens(c)),s.walkTokens&&this.walkTokens(c,s.walkTokens);let u=l(c,s);return s.hooks&&(u=s.hooks.postprocess(u)),u}catch(c){return i(c)}}}onError(o,r){return e=>{if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",o){const t="<p>An error occurred:</p><pre>"+_(e.message+"",!0)+"</pre>";return r?Promise.resolve(t):t}if(r)return Promise.reject(e);throw e}}};function I(o,r){return ee.parse(o,r)}I.options=I.setOptions=function(o){return ee.setOptions(o),Ge(I.defaults=ee.defaults),I},I.getDefaults=function Re(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},I.defaults=Y,I.use=function(...o){return ee.use(...o),Ge(I.defaults=ee.defaults),I},I.walkTokens=function(o,r){return ee.walkTokens(o,r)},I.parseInline=ee.parseInline,I.Parser=q,I.parser=q.parse,I.Renderer=ue,I.TextRenderer=ze,I.Lexer=K,I.lexer=K.lex,I.Tokenizer=ve,I.Hooks=ke,I.parse=I;var pt=k(58),ht=k(2306),An=k(140);class Pn extends ue{baseSize;documentListHandlers;entityListHandlers;_handlers;context={};counters={};getIndex(r){const e=this.counters[r]||0;return this.counters[r]=e+1,e}constructor(r="m",e){super(),this.baseSize=r,this._handlers=e,this.documentListHandlers=e?.documentList,this.entityListHandlers=e?.entityList,this.setupRenderers()}resetContext(){this.context={},this.counters={}}getContext(){return this.context}scaleSize(r){const e=["xs","s","m","l","xl"],t=e.indexOf(this.baseSize),n=e.indexOf(r);return e[Math.max(0,Math.min(e.length-1,n+(t-2)))]}setupRenderers(){this.heading=({tokens:r,depth:e})=>{const i=this.scaleSize({1:"xl",2:"l",3:"l",4:"m",5:"m",6:"s"}[e]),a={1:"bold",2:"semibold",3:"semibold",4:"semibold",5:"medium",6:"medium"}[e],l=this.parser?.parseInline(r)||"";return`<cue-typography size="${i}" weight="${a}"${this.getIndex("heading")>0?' style="margin-top: 24px; display: block;"':' style="display: block;"'}>${l}</cue-typography>\n`},this.paragraph=({tokens:r})=>{const e=this.scaleSize("m"),t=this.parser?.parseInline(r)||"";return/^(?:\s*,?\s*<cue-href-chip\b[^>]*><\/cue-href-chip>)+\s*$/.test(t)?`<div style="display: flex; gap: 6px; flex-wrap: wrap;">${t.replace(/(<\/cue-href-chip>)\s*,?\s*/g,"$1").trim()}</div>\n`:`<div class="cue-md-p"><cue-typography size="${e}" weight="regular">${t}</cue-typography></div>\n`},this.listitem=({tokens:r})=>{const e=this.scaleSize("m");return`<li class="cue-md-li" style="font-size: var(--cue-font-${e}-size);"><cue-typography size="${e}" weight="regular">${this.parser?.parseInline(r)||""}</cue-typography></li>`},this.tablecell=({tokens:r,header:e,align:t})=>{const n=e?"th":"td",i=e?"semibold":"regular";return`<${n}${t?` style="text-align: ${t}"`:""}><cue-typography size="${this.scaleSize("m")}" weight="${i}">${this.parser?.parseInline(r)||""}</cue-typography></${n}>`},this.blockquote=({text:r,tokens:e})=>/^\[!(NOTE|WARNING|IMPORTANT|TIP|CAUTION)\]/i.test(r.trimStart())?"":`<blockquote class="cue-md-blockquote"><cue-typography size="${this.scaleSize("m")}" weight="regular">${this.parser?.parse(e)||""}</cue-typography></blockquote>`,this.link=({href:r,title:e,tokens:t})=>{const n=this.parser?.parseInline(t)||"";if(!r){const i=this.getIndex("hrefchip"),a=`hrefchip_menuitems_${i}`,l=`hrefchip_id_${i}`,c=`hrefchip_click_${i}`,u=n.replace(/<[^>]*>/g,"");return this.context[l]=u,this.context[a]=()=>this._handlers?.hrefChip?.menuItems?.(u)??[],this.context[c]=()=>{this._handlers?.hrefChip?.clicked?.(u)},`<cue-href-chip [label]="context.${l}" [menuItems]="context.${a}()" (clicked)="context.${c}()"></cue-href-chip>`}return`<a href="${r}"${e?` title="${e}"`:""} target="_blank" rel="noopener noreferrer">${n}</a>`},this.codespan=({text:r})=>`<code class="cue-code-inline">${r}</code>`,this.code=r=>{const e="36px";if("document-list"===r.lang){const t=r.documentRefs;if(!t||0===t.length)return"";const s=`doc_refs_${this.getIndex("doc")}`;return this.context[s]=t,this._handlers?.availableContentCategories&&(this.context.availableContentCategories=this._handlers.availableContentCategories),`<cue-document-list [documentRefs]="context.${s}" [documentdata]="context.documentdata" [handlers]="context.documentlisthandlers" [availableContentCategories]="context.availableContentCategories" (clickedDocument)="context.documentclickedrow($event)" style="margin-bottom: ${e};"></cue-document-list>`}if("entity-list"===r.lang){const t=r.iris;if(!t)return"";const s=`entity_iris_${this.getIndex("entity")}`;return this.context[s]=t,this._handlers?.availableEntityCategories&&(this.context.availableEntityCategories=this._handlers.availableEntityCategories),this._handlers?.availableEntityRelationships&&(this.context.availableEntityRelationships=this._handlers.availableEntityRelationships),`<cue-ent-list [entities]="context.${s}" [entitydata]="context.entitydata" [entityLocations]="context.entitylocations" [handlers]="context.entitylisthandlers" [availableEntityCategories]="context.availableEntityCategories" [availableEntityRelationships]="context.availableEntityRelationships" [mapboxToken]="context.mapboxToken" (rowClicked)="context.entityclickedrow($event)" style="margin-bottom: ${e};"></cue-ent-list>`}if("map"===r.lang){const t=r.mapData;if(!t||!t.layers)return"";const n=this.getIndex("map"),s=`map_layers_${n}`,i=`map_settings_${n}`;return this.context[s]=t.layers,this.context[i]=t.settings,`<cue-card style="height: 300px; display: block; margin-bottom: ${e};" [padded]="false"><cue-map [layers]="context.${s}" [settings]="context.${i}"></cue-map></cue-card>`}return`<div style="margin-bottom: ${e};">${super.code(r)}</div>`}}walkTokens(r){return(0,N.A)(function*(){if("code"===r.type&&"document-list"===r.lang){const e=r.text.split("\n").filter(s=>s.trim().length>0),t=new Map,n=[];for(const s of e){const i=s.trim(),a=i.match(/^(.+)\?page=(\d+)$/);if(a){const l=a[1],c=a[2];t.has(l)||(t.set(l,{id:l,pages:[]}),n.push(l));const u=t.get(l);u.pages||(u.pages=[]),u.pages.push({id:i,page:c,relevance:0})}else t.has(i)||(t.set(i,{id:i}),n.push(i))}r.documentRefs=n.map(s=>t.get(s))}if("code"===r.type&&"entity-list"===r.lang){const e=r.text.split("\n").filter(t=>t.trim().length>0);r.iris=e}if("code"===r.type&&"map"===r.lang){const e=r.text.split("\n").filter(l=>l.trim().length>0),t=e[0]?.trim()||"",n=e.slice(1),s={};n.forEach(l=>{const c=l.split(";"),u=c[0]?.trim(),d=c[1]?.trim(),p=c[2]?.trim();if(!u||!d)return;const h=(0,pt.S)(d);if(!h)return;const f=(0,pt.n)(h);let m={};if(p)try{m=JSON.parse(p)}catch{}s[u]||(s[u]=[]),s[u].push({type:"Feature",properties:m,geometry:f})});const i=[];Object.keys(s).forEach(l=>{const c=new ht.ux(l);c.collection=new An.o(s[l]),i.push(c)});const a=new ht.yY;a.mapboxToken=t,a.contextMenu.showFlyTo=!1,r.mapData={layers:i,settings:a}}})()}}let Nn=(()=>{class o{envInjector=(0,g.WQX)(g.uvJ);fileURL=T.hFB.required();html=(0,g.vPA)("");hookOptions={sanitize:!1,globalParsersBlueprint:{environmentInjector:this.envInjector}};parsers=[{component:{importPromise:()=>Promise.resolve().then(k.bind(k,2245)),importName:"Typography"},selector:"cue-typography"}];onFile=(0,g.QZP)((()=>{var e=this;return(0,N.A)(function*(){const n=yield(yield fetch(e.fileURL())).text(),s=new Pn("m");s.resetContext();const i=yield I.parse(n,{gfm:!0,breaks:!1,renderer:s,async:!0,walkTokens:s.walkTokens.bind(s)});e.html.set(i)})})());static \u0275fac=function(t){return new(t||o)};static \u0275cmp=w.VBU({type:o,selectors:[["cue-md-viewer"]],inputs:{fileURL:[1,"fileURL"]},decls:2,vars:3,consts:[[1,"page"],[3,"parsers","content","options"]],template:function(t,n){1&t&&(w.j41(0,"div",0),w.nrm(1,"ngx-dynamic-hooks",1),w.k0s()),2&t&&(w.R7$(),w.Y8G("parsers",n.parsers)("content",n.html())("options",n.hookOptions))},dependencies:[Ut],styles:[".page[_ngcontent-%COMP%]{overflow-y:auto;height:100%;padding:16px;box-sizing:border-box}[_nghost-%COMP%] cue-typography{display:inline-block}[_nghost-%COMP%] .cue-md-p{margin-bottom:24px;opacity:.9;line-height:1.6;display:block}[_nghost-%COMP%] .cue-md-p:last-child{margin-bottom:0}[_nghost-%COMP%] .cue-md-blockquote{margin-bottom:24px;opacity:.9;border-left:4px solid var(--cue-border-color);padding-left:16px}[_nghost-%COMP%] ul, [_nghost-%COMP%] ol{margin-bottom:24px;padding-left:28px;font-family:var(--cue-font-family);opacity:.9;line-height:1.6}[_nghost-%COMP%] li.cue-md-li{margin-bottom:12px}[_nghost-%COMP%] table{margin-bottom:24px;border-collapse:collapse;width:100%}[_nghost-%COMP%] th, [_nghost-%COMP%] td{padding:8px 12px;border-bottom:1px solid var(--cue-border-color, #eee);text-align:left}[_nghost-%COMP%] th cue-typography{font-weight:var(--cue-font-weight-semibold)}[_nghost-%COMP%] .cue-code-inline{background-color:var(--cue-border-color);padding:0 4px;border-radius:4px;font-family:monospace;font-size:1.1em;font-weight:500;color:var(--cue-main-foreground)}"],changeDetection:0})}return o})()},2306(re,V,k){k.d(V,{AA:()=>w,ux:()=>L,yY:()=>T});var N=k(140),g=k(8402);class T{mapboxToken;contextMenu={showProperties:!0,showFlyTo:!0};toolbar=new w}class w{hidden=!1;position="bottom";margin="20px";displayZoom=!0;displayGeofenceDraw=!1;displayLayerToggle=!0;clearGeofenceAfterDraw=!0}class L{label;id;collection=new N.o;color;visible=!0;cluster=!0;zoomToFit=!0;category;constructor(E,C=(0,g.A)()){this.label=E,this.id=C}}},140(re,V,k){k.d(V,{o:()=>N});class N{type="FeatureCollection";features=[];bbox;id;constructor(T=[]){this.features=T}addFeature(T){this.features.push(T)}removeFeature(T){return this.features.splice(T,1)[0]}getFeatureCount(){return this.features.length}clear(){this.features=[]}}},58(re,V,k){function N(b){let y=0,x=-1,B=-1;for(let P=0;P<b.length;P++)if("("===b[P])y++,1===y&&(x=P+1);else if(")"===b[P]&&(y--,0===y)){B=P;break}return-1!==x&&-1!==B?b.substring(x,B):null}k.d(V,{S:()=>z,n:()=>U});class g{x;y;z;constructor(y,x,B){this.x=y,this.y=x,this.z=B}}class T{points;constructor(y){this.points=y}}class w{lines;constructor(y){this.lines=y}}function z(b){if(b){if((b=b.trim().toUpperCase()).startsWith("POINT"))return function j(b){b=b.trim().toUpperCase();const x=N(b)?.split(" ")??[];return b.includes("POINT Z")?new g(parseFloat(x[0]),parseFloat(x[1]),parseFloat(x[2])):new g(parseFloat(x[0]),parseFloat(x[1]))}(b);if(b.startsWith("LINESTRING"))return function L(b){const y=N(b=b.trim().toUpperCase()),x=[];return y?.split(",").map(B=>B.trim().split(" ").map(P=>parseFloat(P))).map(B=>{x.push(new g(B[0],B[1],B[2]))}),new T(x)}(b);if(b.startsWith("POLYGON"))return function E(b){const y=N(b=b.trim().toUpperCase());if(!y)return new w([]);const x=y.match(/\(([^)]+)\)/g);if(!x)return new w([]);const B=x.map(P=>{const Z=N(P);return Z?Z.split(",").map(he=>{const G=he.trim().split(" ");return G.length>=3?new g(parseFloat(G[0]),parseFloat(G[1]),parseFloat(G[2])):new g(parseFloat(G[0]),parseFloat(G[1]))}):[]});return new w(B)}(b)}}function U(b){if(b instanceof g)return{type:"Point",coordinates:void 0!==b.z?[b.x,b.y,b.z]:[b.x,b.y]};if(b instanceof T)return{type:"LineString",coordinates:b.points.map(y=>void 0!==y.z?[y.x,y.y,y.z]:[y.x,y.y])};if(b instanceof w)return{type:"Polygon",coordinates:b.lines.map(y=>y.map(x=>void 0!==x.z?[x.x,x.y,x.z]:[x.x,x.y]))};throw new Error("Unknown WKT type")}},5332(re,V,k){k.d(V,{k:()=>w});for(var g=[],T=0;T<256;++T)g.push((T+256).toString(16).slice(1));function w(E,C=0){return(g[E[C+0]]+g[E[C+1]]+g[E[C+2]]+g[E[C+3]]+"-"+g[E[C+4]]+g[E[C+5]]+"-"+g[E[C+6]]+g[E[C+7]]+"-"+g[E[C+8]]+g[E[C+9]]+"-"+g[E[C+10]]+g[E[C+11]]+g[E[C+12]]+g[E[C+13]]+g[E[C+14]]+g[E[C+15]]).toLowerCase()}},8402(re,V,k){k.d(V,{A:()=>C});const g={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var T,w=new Uint8Array(16);function L(){if(!T&&!(T=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return T(w)}var j=k(5332);const C=function E(z,U,b){if(g.randomUUID&&!U&&!z)return g.randomUUID();var y=(z=z||{}).random||(z.rng||L)();if(y[6]=15&y[6]|64,y[8]=63&y[8]|128,U){b=b||0;for(var x=0;x<16;++x)U[b+x]=y[x];return U}return(0,j.k)(y)}}}]);
|