@supanadit/morse-web 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server.mjs +79 -15
- package/dist/server.mjs.map +4 -4
- package/dist/ui/index.html +1 -1
- package/dist/ui/main-2MJ7PFGM.js +92 -0
- package/dist/ui/webview.manifest.json +3 -3
- package/package.json +1 -1
- package/dist/ui/main-XJTJFXK3.js +0 -90
package/dist/ui/main-XJTJFXK3.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
var HE=Object.create;var ic=Object.defineProperty,BE=Object.defineProperties,UE=Object.getOwnPropertyDescriptor,zE=Object.getOwnPropertyDescriptors,qE=Object.getOwnPropertyNames,Ih=Object.getOwnPropertySymbols,GE=Object.getPrototypeOf,Nh=Object.prototype.hasOwnProperty,WE=Object.prototype.propertyIsEnumerable;var kh=(t,e,n)=>e in t?ic(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,H=(t,e)=>{for(var n in e||={})Nh.call(e,n)&&kh(t,n,e[n]);if(Ih)for(var n of Ih(e))WE.call(e,n)&&kh(t,n,e[n]);return t},Q=(t,e)=>BE(t,zE(e));var YE=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},Dh=(t,e)=>{for(var n in e)ic(t,n,{get:e[n],enumerable:!0})},ZE=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of qE(e))!Nh.call(t,r)&&r!==n&&ic(t,r,{get:()=>e[r],enumerable:!(o=UE(e,r))||o.enumerable});return t};var KE=(t,e,n)=>(n=t!=null?HE(GE(t)):{},ZE(e||!t||!t.__esModule?ic(n,"default",{value:t,enumerable:!0}):n,t));var hx=YE((cW,mx)=>{function nx(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{let n=t[e],o=typeof n;(o==="object"||o==="function")&&!Object.isFrozen(n)&&nx(n)}),t}var Ad=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function ox(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Tr(t,...e){let n=Object.create(null);for(let o in t)n[o]=t[o];return e.forEach(function(o){for(let r in o)n[r]=o[r]}),n}var gD="</span>",Kb=t=>!!t.scope,yD=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){let n=t.split(".");return[`${e}${n.shift()}`,...n.map((o,r)=>`${o}${"_".repeat(r+1)}`)].join(" ")}return`${e}${t}`},Zm=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=ox(e)}openNode(e){if(!Kb(e))return;let n=yD(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){Kb(e)&&(this.buffer+=gD)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},Qb=(t={})=>{let e={children:[]};return Object.assign(e,t),e},Km=class t{constructor(){this.rootNode=Qb(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n=Qb({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(o=>this._walk(e,o)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{t._collapse(n)}))}},Qm=class extends Km{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){let o=e.root;n&&(o.scope=`language:${n}`),this.add(o)}toHTML(){return new Zm(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Ba(t){return t?typeof t=="string"?t:t.source:null}function rx(t){return vi("(?=",t,")")}function vD(t){return vi("(?:",t,")*")}function _D(t){return vi("(?:",t,")?")}function vi(...t){return t.map(n=>Ba(n)).join("")}function bD(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Ld(...t){return"("+(bD(t).capture?"":"?:")+t.map(o=>Ba(o)).join("|")+")"}function ix(t){return new RegExp(t.toString()+"|").exec("").length-1}function xD(t,e){let n=t&&t.exec(e);return n&&n.index===0}var ED=new RegExp(Ld(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function Jm(t,{joinWith:e}){let n=0;return t.map(o=>{n+=1;let r=n,i=Ba(o),s="";for(;i.length>0;){let a=ED.exec(i);if(!a){s+=i;break}s+=i.substring(0,a.index),i=i.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?s+="\\"+String(Number(a[1])+r):(s+=a[0],(a[0]==="("||/^\(\?[<']/.test(a[0]))&&n++)}return s}).map(o=>`(${o})`).join(e)}var CD=/\b\B/,sx="[a-zA-Z]\\w*",eh="[a-zA-Z_]\\w*",ax="\\b\\d+(\\.\\d+)?",cx="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",lx="\\b(0b[01]+)",wD="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SD=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=vi(e,/.*\b/,t.binary,/\b.*/)),Tr({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,o)=>{n.index!==0&&o.ignoreMatch()}},t)},Ua={begin:"\\\\[\\s\\S]",relevance:0},TD={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ua]},MD={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ua]},ID={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Fd=function(t,e,n={}){let o=Tr({scope:"comment",begin:t,end:e,contains:[]},n);o.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let r=Ld("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return o.contains.push({begin:vi(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),o},kD=Fd("//","$"),ND=Fd("/\\*","\\*/"),DD=Fd("#","$"),OD={scope:"number",begin:ax,relevance:0},PD={scope:"number",begin:cx,relevance:0},AD={scope:"number",begin:lx,relevance:0},RD={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Ua,{begin:/\[/,end:/\]/,relevance:0,contains:[Ua]}]},LD={scope:"title",begin:sx,relevance:0},FD={scope:"title",begin:eh,relevance:0},VD={begin:"\\.\\s*"+eh,relevance:0},jD=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},Pd=Object.freeze({__proto__:null,APOS_STRING_MODE:TD,BACKSLASH_ESCAPE:Ua,BINARY_NUMBER_MODE:AD,BINARY_NUMBER_RE:lx,COMMENT:Fd,C_BLOCK_COMMENT_MODE:ND,C_LINE_COMMENT_MODE:kD,C_NUMBER_MODE:PD,C_NUMBER_RE:cx,END_SAME_AS_BEGIN:jD,HASH_COMMENT_MODE:DD,IDENT_RE:sx,MATCH_NOTHING_RE:CD,METHOD_GUARD:VD,NUMBER_MODE:OD,NUMBER_RE:ax,PHRASAL_WORDS_MODE:ID,QUOTE_STRING_MODE:MD,REGEXP_MODE:RD,RE_STARTERS_RE:wD,SHEBANG:SD,TITLE_MODE:LD,UNDERSCORE_IDENT_RE:eh,UNDERSCORE_TITLE_MODE:FD});function $D(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function HD(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function BD(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=$D,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function UD(t,e){Array.isArray(t.illegal)&&(t.illegal=Ld(...t.illegal))}function zD(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function qD(t,e){t.relevance===void 0&&(t.relevance=1)}var GD=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},t);Object.keys(t).forEach(o=>{delete t[o]}),t.keywords=n.keywords,t.begin=vi(n.beforeMatch,rx(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},WD=["of","and","for","in","not","or","if","then","parent","list","value"],YD="keyword";function dx(t,e,n=YD){let o=Object.create(null);return typeof t=="string"?r(n,t.split(" ")):Array.isArray(t)?r(n,t):Object.keys(t).forEach(function(i){Object.assign(o,dx(t[i],e,i))}),o;function r(i,s){e&&(s=s.map(a=>a.toLowerCase())),s.forEach(function(a){let c=a.split("|");o[c[0]]=[i,ZD(c[0],c[1])]})}}function ZD(t,e){return e?Number(e):KD(t)?0:1}function KD(t){return WD.includes(t.toLowerCase())}var Xb={},yi=t=>{console.error(t)},Jb=(t,...e)=>{console.log(`WARN: ${t}`,...e)},vs=(t,e)=>{Xb[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),Xb[`${t}/${e}`]=!0)},Rd=new Error;function ux(t,e,{key:n}){let o=0,r=t[n],i={},s={};for(let a=1;a<=e.length;a++)s[a+o]=r[a],i[a+o]=!0,o+=ix(e[a-1]);t[n]=s,t[n]._emit=i,t[n]._multi=!0}function QD(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw yi("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Rd;if(typeof t.beginScope!="object"||t.beginScope===null)throw yi("beginScope must be object"),Rd;ux(t,t.begin,{key:"beginScope"}),t.begin=Jm(t.begin,{joinWith:""})}}function XD(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw yi("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Rd;if(typeof t.endScope!="object"||t.endScope===null)throw yi("endScope must be object"),Rd;ux(t,t.end,{key:"endScope"}),t.end=Jm(t.end,{joinWith:""})}}function JD(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function eO(t){JD(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),QD(t),XD(t)}function tO(t){function e(s,a){return new RegExp(Ba(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(a?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,a]),this.matchAt+=ix(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(c=>c[1]);this.matcherRe=e(Jm(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;let c=this.matcherRe.exec(a);if(!c)return null;let l=c.findIndex((f,y)=>y>0&&f!==void 0),d=this.matchIndexes[l];return c.splice(0,l),Object.assign(c,d)}}class o{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let c=new n;return this.rules.slice(a).forEach(([l,d])=>c.addRule(l,d)),c.compile(),this.multiRegexes[a]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,c){this.rules.push([a,c]),c.type==="begin"&&this.count++}exec(a){let c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let l=c.exec(a);if(this.resumingScanAtSamePosition()&&!(l&&l.index===this.lastIndex)){let d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,l=d.exec(a)}return l&&(this.regexIndex+=l.position+1,this.regexIndex===this.count&&this.considerAll()),l}}function r(s){let a=new o;return s.contains.forEach(c=>a.addRule(c.begin,{rule:c,type:"begin"})),s.terminatorEnd&&a.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&a.addRule(s.illegal,{type:"illegal"}),a}function i(s,a){let c=s;if(s.isCompiled)return c;[HD,zD,eO,GD].forEach(d=>d(s,a)),t.compilerExtensions.forEach(d=>d(s,a)),s.__beforeBegin=null,[BD,UD,qD].forEach(d=>d(s,a)),s.isCompiled=!0;let l=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),l=s.keywords.$pattern,delete s.keywords.$pattern),l=l||/\w+/,s.keywords&&(s.keywords=dx(s.keywords,t.case_insensitive)),c.keywordPatternRe=e(l,!0),a&&(s.begin||(s.begin=/\B|\b/),c.beginRe=e(c.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(c.endRe=e(c.end)),c.terminatorEnd=Ba(c.end)||"",s.endsWithParent&&a.terminatorEnd&&(c.terminatorEnd+=(s.end?"|":"")+a.terminatorEnd)),s.illegal&&(c.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(d){return nO(d==="self"?s:d)})),s.contains.forEach(function(d){i(d,c)}),s.starts&&i(s.starts,a),c.matcher=r(c),c}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Tr(t.classNameAliases||{}),i(t)}function px(t){return t?t.endsWithParent||px(t.starts):!1}function nO(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Tr(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:px(t)?Tr(t,{starts:t.starts?Tr(t.starts):null}):Object.isFrozen(t)?Tr(t):t}var oO="11.12.0",Xm=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},Ym=ox,ex=Tr,tx=Symbol("nomatch"),rO=7,fx=function(t){let e=Object.create(null),n=Object.create(null),o=[],r=!0,i="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Qm};function c(O){return a.noHighlightRe.test(O)}function l(O){let Z=O.className+" ";Z+=O.parentNode?O.parentNode.className:"";let U=a.languageDetectRe.exec(Z);if(U){let A=Le(U[1]);return A||(Jb(i.replace("{}",U[1])),Jb("Falling back to no-highlight mode for this block.",O)),A?U[1]:"no-highlight"}return Z.split(/\s+/).find(A=>c(A)||Le(A))}function d(O,Z,U){let A="",J="";typeof Z=="object"?(A=O,U=Z.ignoreIllegals,J=Z.language):(vs("10.7.0","highlight(lang, code, ...args) has been deprecated."),vs("10.7.0",`Please use highlight(code, options) instead.
|
|
2
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),J=O,A=Z),U===void 0&&(U=!0);let Pe={code:A,language:J};Xe("before:highlight",Pe);let Je=Pe.result?Pe.result:f(Pe.language,Pe.code,U);return Je.code=Pe.code,Xe("after:highlight",Je),Je}function f(O,Z,U,A){let J=Object.create(null);function Pe(F,j){return F.keywords[j]}function Je(){if(!W.keywords){Ke.addText(ne);return}let F=0;W.keywordPatternRe.lastIndex=0;let j=W.keywordPatternRe.exec(ne),X="";for(;j;){X+=ne.substring(F,j.index);let re=nt.case_insensitive?j[0].toLowerCase():j[0],ut=Pe(W,re);if(ut){let[Ct,Un]=ut;if(Ke.addText(X),X="",J[re]=(J[re]||0)+1,J[re]<=rO&&(_t+=Un),Ct.startsWith("_"))X+=j[0];else{let pn=nt.classNameAliases[Ct]||Ct;gt(j[0],pn)}}else X+=j[0];F=W.keywordPatternRe.lastIndex,j=W.keywordPatternRe.exec(ne)}X+=ne.substring(F),Ke.addText(X)}function jt(){if(ne==="")return;let F=null;if(typeof W.subLanguage=="string"){if(!e[W.subLanguage]){Ke.addText(ne);return}F=f(W.subLanguage,ne,!0,mt[W.subLanguage]),mt[W.subLanguage]=F._top}else F=v(ne,W.subLanguage.length?W.subLanguage:null);W.relevance>0&&(_t+=F.relevance),Ke.__addSublanguage(F._emitter,F.language)}function fe(){W.subLanguage!=null?jt():Je(),ne=""}function gt(F,j){F!==""&&(Ke.startScope(j),Ke.addText(F),Ke.endScope())}function Be(F,j){let X=1,re=j.length-1;for(;X<=re;){if(!F._emit[X]){X++;continue}let ut=nt.classNameAliases[F[X]]||F[X],Ct=j[X];ut?gt(Ct,ut):(ne=Ct,Je(),ne=""),X++}}function tn(F,j){return F.scope&&typeof F.scope=="string"&&Ke.openNode(nt.classNameAliases[F.scope]||F.scope),F.beginScope&&(F.beginScope._wrap?(gt(ne,nt.classNameAliases[F.beginScope._wrap]||F.beginScope._wrap),ne=""):F.beginScope._multi&&(Be(F.beginScope,j),ne="")),W=Object.create(F,{parent:{value:W}}),W}function $t(F,j,X){let re=xD(F.endRe,X);if(re){if(F["on:end"]){let ut=new Ad(F);F["on:end"](j,ut),ut.isMatchIgnored&&(re=!1)}if(re){for(;F.endsParent&&F.parent;)F=F.parent;return F}}if(F.endsWithParent)return $t(F.parent,j,X)}function Ye(F){return W.matcher.regexIndex===0?(ne+=F[0],1):(Ue=!0,0)}function Ut(F){let j=F[0],X=F.rule,re=new Ad(X),ut=[X.__beforeBegin,X["on:begin"]];for(let Ct of ut)if(Ct&&(Ct(F,re),re.isMatchIgnored))return Ye(j);return X.skip?ne+=j:(X.excludeBegin&&(ne+=j),fe(),!X.returnBegin&&!X.excludeBegin&&(ne=j)),tn(X,F),X.returnBegin?0:j.length}function At(F){let j=F[0],X=Z.substring(F.index),re=$t(W,F,X);if(!re)return tx;let ut=W;W.endScope&&W.endScope._wrap?(fe(),gt(j,W.endScope._wrap)):W.endScope&&W.endScope._multi?(fe(),Be(W.endScope,F)):ut.skip?ne+=j:(ut.returnEnd||ut.excludeEnd||(ne+=j),fe(),ut.excludeEnd&&(ne=j));do W.scope&&Ke.closeNode(),!W.skip&&!W.subLanguage&&(_t+=W.relevance),W=W.parent;while(W!==re.parent);return re.starts&&tn(re.starts,F),ut.returnEnd?0:j.length}function De(){let F=[];for(let j=W;j!==nt;j=j.parent)j.scope&&F.unshift(j.scope);F.forEach(j=>Ke.openNode(j))}let qe={};function Ce(F,j){let X=j&&j[0];if(ne+=F,X==null)return fe(),0;if(qe.type==="begin"&&j.type==="end"&&qe.index===j.index&&X===""){if(ne+=Z.slice(j.index,j.index+1),!r){let re=new Error(`0 width match regex (${O})`);throw re.languageName=O,re.badRule=qe.rule,re}return 1}if(qe=j,j.type==="begin")return Ut(j);if(j.type==="illegal"&&!U){let re=new Error('Illegal lexeme "'+X+'" for mode "'+(W.scope||"<unnamed>")+'"');throw re.mode=W,re}else if(j.type==="end"){let re=At(j);if(re!==tx)return re}if(j.type==="illegal"&&X==="")return j.index===Z.length||(ne+=`
|
|
3
|
-
`),1;if(st>1e5&&st>j.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ne+=X,X.length}let nt=Le(O);if(!nt)throw yi(i.replace("{}",O)),new Error('Unknown language: "'+O+'"');let oe=tO(nt),ct="",W=A||oe,mt={},Ke=new a.__emitter(a);De();let ne="",_t=0,me=0,st=0,Ue=!1;try{if(nt.__emitTokens)nt.__emitTokens(Z,Ke);else{for(W.matcher.considerAll();;){st++,Ue?Ue=!1:W.matcher.considerAll(),W.matcher.lastIndex=me;let F=W.matcher.exec(Z);if(!F)break;let j=Z.substring(me,F.index),X=Ce(j,F);me=F.index+X}Ce(Z.substring(me))}return Ke.finalize(),ct=Ke.toHTML(),{language:O,value:ct,relevance:_t,illegal:!1,_emitter:Ke,_top:W}}catch(F){if(F.message&&F.message.includes("Illegal"))return{language:O,value:Ym(Z),illegal:!0,relevance:0,_illegalBy:{message:F.message,index:me,context:Z.slice(me-100,me+100),mode:F.mode,resultSoFar:ct},_emitter:Ke};if(r)return{language:O,value:Ym(Z),illegal:!1,relevance:0,errorRaised:F,_emitter:Ke,_top:W};throw F}}function y(O){let Z={value:Ym(O),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return Z._emitter.addText(O),Z}function v(O,Z){Z=Z||a.languages||Object.keys(e);let U=y(O),A=Z.filter(Le).filter(dt).map(fe=>f(fe,O,!1));A.unshift(U);let J=A.sort((fe,gt)=>{if(fe.relevance!==gt.relevance)return gt.relevance-fe.relevance;if(fe.language&>.language){if(Le(fe.language).supersetOf===gt.language)return 1;if(Le(gt.language).supersetOf===fe.language)return-1}return 0}),[Pe,Je]=J,jt=Pe;return jt.secondBest=Je,jt}function x(O,Z,U){let A=Z&&n[Z]||U;O.classList.add("hljs"),O.classList.add(`language-${A}`)}function C(O){let Z=null,U=l(O);if(c(U))return;if(Xe("before:highlightElement",{el:O,language:U}),O.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",O);return}if(O.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(O)),a.throwUnescapedHTML))throw new Xm("One of your code blocks includes unescaped HTML.",O.innerHTML);Z=O;let A=Z.textContent,J=U?d(A,{language:U,ignoreIllegals:!0}):v(A);O.innerHTML=J.value,O.dataset.highlighted="yes",x(O,U,J.language),O.result={language:J.language,re:J.relevance,relevance:J.relevance},J.secondBest&&(O.secondBest={language:J.secondBest.language,relevance:J.secondBest.relevance}),Xe("after:highlightElement",{el:O,result:J,text:A})}function P(O){a=ex(a,O)}let Y=()=>{le(),vs("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function G(){le(),vs("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let ve=!1;function le(){function O(){le()}if(document.readyState==="loading"){ve||window.addEventListener("DOMContentLoaded",O,!1),ve=!0;return}document.querySelectorAll(a.cssSelector).forEach(C)}function Ee(O,Z){let U=null;try{U=Z(t)}catch(A){if(yi("Language definition for '{}' could not be registered.".replace("{}",O)),r)yi(A);else throw A;U=s}U.name||(U.name=O),e[O]=U,U.rawDefinition=Z.bind(null,t),U.aliases&&He(U.aliases,{languageName:O})}function ie(O){delete e[O];for(let Z of Object.keys(n))n[Z]===O&&delete n[Z]}function Qe(){return Object.keys(e)}function Le(O){return O=(O||"").toLowerCase(),e[O]||e[n[O]]}function He(O,{languageName:Z}){typeof O=="string"&&(O=[O]),O.forEach(U=>{n[U.toLowerCase()]=Z})}function dt(O){let Z=Le(O);return Z&&!Z.disableAutodetect}function Et(O){O["before:highlightBlock"]&&!O["before:highlightElement"]&&(O["before:highlightElement"]=Z=>{O["before:highlightBlock"](Object.assign({block:Z.el},Z))}),O["after:highlightBlock"]&&!O["after:highlightElement"]&&(O["after:highlightElement"]=Z=>{O["after:highlightBlock"](Object.assign({block:Z.el},Z))})}function Pt(O){Et(O),o.push(O)}function St(O){let Z=o.indexOf(O);Z!==-1&&o.splice(Z,1)}function Xe(O,Z){let U=O;o.forEach(function(A){A[U]&&A[U](Z)})}function ge(O){return vs("10.7.0","highlightBlock will be removed entirely in v12.0"),vs("10.7.0","Please use highlightElement now."),C(O)}Object.assign(t,{highlight:d,highlightAuto:v,highlightAll:le,highlightElement:C,highlightBlock:ge,configure:P,initHighlighting:Y,initHighlightingOnLoad:G,registerLanguage:Ee,unregisterLanguage:ie,listLanguages:Qe,getLanguage:Le,registerAliases:He,autoDetection:dt,inherit:ex,addPlugin:Pt,removePlugin:St}),t.debugMode=function(){r=!1},t.safeMode=function(){r=!0},t.versionString=oO,t.regex={concat:vi,lookahead:rx,either:Ld,optional:_D,anyNumberOfTimes:vD};for(let O in Pd)typeof Pd[O]=="object"&&nx(Pd[O]);return Object.assign(t,Pd),t},_s=fx({});_s.newInstance=()=>fx({});mx.exports=_s;_s.HighlightJS=_s;_s.default=_s});var _n=null,sc=!1,Dr=1,QE=null,cn=Symbol("SIGNAL");function ae(t){let e=_n;return _n=t,e}function dc(){return _n}var Pr={version:0,lastCleanEpoch:0,dirty:!1,producers:void 0,producersTail:void 0,consumers:void 0,consumersTail:void 0,recomputing:!1,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,kind:"unknown",producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function Ar(t){if(sc)throw new Error("");if(_n===null)return;_n.consumerOnSignalRead(t);let e=_n.producersTail;if(e!==void 0&&e.producer===t)return;let n,o=_n.recomputing;if(o&&(n=e!==void 0?e.nextProducer:_n.producers,n!==void 0&&n.producer===t)){_n.producersTail=n,n.lastReadVersion=t.version,n.knownValidAtEpoch=Dr;return}let r=t.consumersTail;if(r!==void 0&&r.consumer===_n&&(!o||r.knownValidAtEpoch===Dr))return;let i=ki(_n),s={producer:t,consumer:_n,nextProducer:n,prevConsumer:void 0,knownValidAtEpoch:Dr,lastReadVersion:t.version,nextConsumer:void 0};_n.producersTail=s,e!==void 0?e.nextProducer=s:_n.producers=s,i&&Rh(t,s)}function Oh(){Dr++}function Ns(t){if(!(ki(t)&&!t.dirty)&&!(!t.dirty&&t.lastCleanEpoch===Dr)){if(!t.producerMustRecompute(t)&&!Ds(t)){lc(t);return}t.producerRecomputeValue(t),lc(t)}}function mu(t){if(t.consumers===void 0)return;let e=sc;sc=!0;try{for(let n=t.consumers;n!==void 0;n=n.nextConsumer){let o=n.consumer;o.dirty||XE(o)}}finally{sc=e}}function hu(){return _n?.consumerAllowSignalWrites!==!1}function XE(t){t.dirty=!0,mu(t),t.consumerMarkedDirty?.(t)}function lc(t){t.dirty=!1,t.lastCleanEpoch=Dr}function Rr(t){return t&&Ph(t),ae(t)}function Ph(t){if(t.producersTail?.knownValidAtEpoch===Dr){let e=t.producers;for(;e!==void 0;)e.knownValidAtEpoch=null,e=e.nextProducer}t.producersTail=void 0,t.recomputing=!0}function Ii(t,e){ae(e),t&&Ah(t)}function Ah(t){t.recomputing=!1;let e=t.producersTail,n=e!==void 0?e.nextProducer:t.producers;if(n!==void 0){if(ki(t))do n=gu(n);while(n!==void 0);e!==void 0?e.nextProducer=void 0:t.producers=void 0}}function Ds(t){for(let e=t.producers;e!==void 0;e=e.nextProducer){let n=e.producer,o=e.lastReadVersion;if(o!==n.version||(Ns(n),o!==n.version))return!0}return!1}function Lr(t){if(ki(t)){let e=t.producers;for(;e!==void 0;)e=gu(e)}t.producers=void 0,t.producersTail=void 0,t.consumers=void 0,t.consumersTail=void 0}function Rh(t,e){let n=t.consumersTail,o=ki(t);if(n!==void 0?(e.nextConsumer=n.nextConsumer,n.nextConsumer=e):(e.nextConsumer=void 0,t.consumers=e),e.prevConsumer=n,t.consumersTail=e,!o)for(let r=t.producers;r!==void 0;r=r.nextProducer)Rh(r.producer,r)}function gu(t){let e=t.producer,n=t.nextProducer,o=t.nextConsumer,r=t.prevConsumer;if(t.nextConsumer=void 0,t.prevConsumer=void 0,o!==void 0?o.prevConsumer=r:e.consumersTail=r,r!==void 0)r.nextConsumer=o;else if(e.consumers=o,!ki(e)){let i=e.producers;for(;i!==void 0;)i=gu(i)}return n}function ki(t){return t.consumerIsAlwaysLive||t.consumers!==void 0}function uc(t){QE?.(t)}function pc(t,e){return Object.is(t,e)}function Os(t,e){let n=Object.create(JE);n.computation=t,e!==void 0&&(n.equal=e);let o=()=>{if(Ns(n),Ar(n),n.value===Or)throw n.error;return n.value};return o[cn]=n,uc(n),o}var ac=Symbol("UNSET"),cc=Symbol("COMPUTING"),Or=Symbol("ERRORED"),JE=Q(H({},Pr),{value:ac,dirty:!0,error:null,equal:pc,kind:"computed",producerMustRecompute(t){return t.value===ac||t.value===cc},producerRecomputeValue(t){if(t.value===cc)throw new Error("");let e=t.value;t.value=cc;let n=Rr(t),o,r=!1;try{o=t.computation(),ae(null),r=e!==ac&&e!==Or&&o!==Or&&t.equal(e,o)}catch(i){o=Or,t.error=i}finally{Ii(t,n)}if(r){t.value=e;return}t.value=o,t.version++}});function eC(){throw new Error}var Lh=eC;function Fh(t){Lh(t)}function yu(t){Lh=t}var tC=null;function vu(t,e){let n=Object.create(Ps);n.value=t,e!==void 0&&(n.equal=e);let o=()=>Vh(n);return o[cn]=n,uc(n),[o,s=>Fr(n,s),s=>_u(n,s)]}function Vh(t){return Ar(t),t.value}function Fr(t,e){hu()||Fh(t),t.equal(t.value,e)||(t.value=e,nC(t))}function _u(t,e){hu()||Fh(t),Fr(t,e(t.value))}var Ps=Q(H({},Pr),{equal:pc,value:void 0,kind:"signal"});function nC(t){t.version++,Oh(),mu(t),tC?.(t)}var bu=Q(H({},Pr),{consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!0,dirty:!0,kind:"effect"});function xu(t){if(t.dirty=!1,t.version>0&&!Ds(t))return;t.version++;let e=Rr(t);try{t.cleanup(),t.fn()}finally{Ii(t,e)}}var Eu;function fc(){return Eu}function So(t){let e=Eu;return Eu=t,e}var jh=Symbol("NotFound");function Ni(t){return t===jh||t?.name==="\u0275NotFound"}function $h(t){let e=ae(null);try{return t()}finally{ae(e)}}function Cn(t){return typeof t=="function"}function mc(t){let n=t(o=>{Error.call(o),o.stack=new Error().stack});return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var hc=mc(t=>function(n){t(this),this.message=n?`${n.length} errors occurred during unsubscription:
|
|
4
|
-
${n.map((o,r)=>`${r+1}) ${o.toString()}`).join(`
|
|
5
|
-
`)}`:"",this.name="UnsubscriptionError",this.errors=n});function As(t,e){if(t){let n=t.indexOf(e);0<=n&&t.splice(n,1)}}var bn=class t{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let e;if(!this.closed){this.closed=!0;let{_parentage:n}=this;if(n)if(this._parentage=null,Array.isArray(n))for(let i of n)i.remove(this);else n.remove(this);let{initialTeardown:o}=this;if(Cn(o))try{o()}catch(i){e=i instanceof hc?i.errors:[i]}let{_finalizers:r}=this;if(r){this._finalizers=null;for(let i of r)try{Hh(i)}catch(s){e=e??[],s instanceof hc?e=[...e,...s.errors]:e.push(s)}}if(e)throw new hc(e)}}add(e){var n;if(e&&e!==this)if(this.closed)Hh(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}}_hasParent(e){let{_parentage:n}=this;return n===e||Array.isArray(n)&&n.includes(e)}_addParent(e){let{_parentage:n}=this;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e}_removeParent(e){let{_parentage:n}=this;n===e?this._parentage=null:Array.isArray(n)&&As(n,e)}remove(e){let{_finalizers:n}=this;n&&As(n,e),e instanceof t&&e._removeParent(this)}};bn.EMPTY=(()=>{let t=new bn;return t.closed=!0,t})();var Cu=bn.EMPTY;function gc(t){return t instanceof bn||t&&"closed"in t&&Cn(t.remove)&&Cn(t.add)&&Cn(t.unsubscribe)}function Hh(t){Cn(t)?t():t.unsubscribe()}var ao={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Di={setTimeout(t,e,...n){let{delegate:o}=Di;return o?.setTimeout?o.setTimeout(t,e,...n):setTimeout(t,e,...n)},clearTimeout(t){let{delegate:e}=Di;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0};function Bh(t){Di.setTimeout(()=>{let{onUnhandledError:e}=ao;if(e)e(t);else throw t})}function wu(){}var Uh=Su("C",void 0,void 0);function zh(t){return Su("E",void 0,t)}function qh(t){return Su("N",t,void 0)}function Su(t,e,n){return{kind:t,value:e,error:n}}var Vr=null;function Oi(t){if(ao.useDeprecatedSynchronousErrorHandling){let e=!Vr;if(e&&(Vr={errorThrown:!1,error:null}),t(),e){let{errorThrown:n,error:o}=Vr;if(Vr=null,n)throw o}}else t()}function Gh(t){ao.useDeprecatedSynchronousErrorHandling&&Vr&&(Vr.errorThrown=!0,Vr.error=t)}var jr=class extends bn{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,gc(e)&&e.add(this)):this.destination=iC}static create(e,n,o){return new Pi(e,n,o)}next(e){this.isStopped?Mu(qh(e),this):this._next(e)}error(e){this.isStopped?Mu(zh(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?Mu(Uh,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}},oC=Function.prototype.bind;function Tu(t,e){return oC.call(t,e)}var Iu=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:n}=this;if(n.next)try{n.next(e)}catch(o){yc(o)}}error(e){let{partialObserver:n}=this;if(n.error)try{n.error(e)}catch(o){yc(o)}else yc(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(n){yc(n)}}},Pi=class extends jr{constructor(e,n,o){super();let r;if(Cn(e)||!e)r={next:e??void 0,error:n??void 0,complete:o??void 0};else{let i;this&&ao.useDeprecatedNextContext?(i=Object.create(e),i.unsubscribe=()=>this.unsubscribe(),r={next:e.next&&Tu(e.next,i),error:e.error&&Tu(e.error,i),complete:e.complete&&Tu(e.complete,i)}):r=e}this.destination=new Iu(r)}};function yc(t){ao.useDeprecatedSynchronousErrorHandling?Gh(t):Bh(t)}function rC(t){throw t}function Mu(t,e){let{onStoppedNotification:n}=ao;n&&Di.setTimeout(()=>n(t,e))}var iC={closed:!0,next:wu,error:rC,complete:wu};var Wh=typeof Symbol=="function"&&Symbol.observable||"@@observable";function Yh(t){return t}function Zh(t){return t.length===0?Yh:t.length===1?t[0]:function(n){return t.reduce((o,r)=>r(o),n)}}var To=class t{constructor(e){e&&(this._subscribe=e)}lift(e){let n=new t;return n.source=this,n.operator=e,n}subscribe(e,n,o){let r=aC(e)?e:new Pi(e,n,o);return Oi(()=>{let{operator:i,source:s}=this;r.add(i?i.call(r,s):s?this._subscribe(r):this._trySubscribe(r))}),r}_trySubscribe(e){try{return this._subscribe(e)}catch(n){e.error(n)}}forEach(e,n){return n=Kh(n),new n((o,r)=>{let i=new Pi({next:s=>{try{e(s)}catch(a){r(a),i.unsubscribe()}},error:r,complete:o});this.subscribe(i)})}_subscribe(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)}[Wh](){return this}pipe(...e){return Zh(e)(this)}toPromise(e){return e=Kh(e),new e((n,o)=>{let r;this.subscribe(i=>r=i,i=>o(i),()=>n(r))})}};To.create=t=>new To(t);function Kh(t){var e;return(e=t??ao.Promise)!==null&&e!==void 0?e:Promise}function sC(t){return t&&Cn(t.next)&&Cn(t.error)&&Cn(t.complete)}function aC(t){return t&&t instanceof jr||sC(t)&&gc(t)}function cC(t){return Cn(t?.lift)}function Qh(t){return e=>{if(cC(e))return e.lift(function(n){try{return t(n,this)}catch(o){this.error(o)}});throw new TypeError("Unable to lift unknown Observable type")}}function Xh(t,e,n,o,r){return new ku(t,e,n,o,r)}var ku=class extends jr{constructor(e,n,o,r,i,s){super(e),this.onFinalize=i,this.shouldUnsubscribe=s,this._next=n?function(a){try{n(a)}catch(c){e.error(c)}}:super._next,this._error=r?function(a){try{r(a)}catch(c){e.error(c)}finally{this.unsubscribe()}}:super._error,this._complete=o?function(){try{o()}catch(a){e.error(a)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:n}=this;super.unsubscribe(),!n&&((e=this.onFinalize)===null||e===void 0||e.call(this))}}};var Jh=mc(t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var qn=class extends To{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(e){let n=new vc(this,this);return n.operator=e,n}_throwIfClosed(){if(this.closed)throw new Jh}next(e){Oi(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let n of this.currentObservers)n.next(e)}})}error(e){Oi(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=e;let{observers:n}=this;for(;n.length;)n.shift().error(e)}})}complete(){Oi(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:e}=this;for(;e.length;)e.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0}_trySubscribe(e){return this._throwIfClosed(),super._trySubscribe(e)}_subscribe(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)}_innerSubscribe(e){let{hasError:n,isStopped:o,observers:r}=this;return n||o?Cu:(this.currentObservers=null,r.push(e),new bn(()=>{this.currentObservers=null,As(r,e)}))}_checkFinalizedStatuses(e){let{hasError:n,thrownError:o,isStopped:r}=this;n?e.error(o):r&&e.complete()}asObservable(){let e=new To;return e.source=this,e}};qn.create=(t,e)=>new vc(t,e);var vc=class extends qn{constructor(e,n){super(),this.destination=e,this.source=n}next(e){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,e)}error(e){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,e)}complete(){var e,n;(n=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||n===void 0||n.call(e)}_subscribe(e){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(e))!==null&&o!==void 0?o:Cu}};var Rs=class extends qn{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){let n=super._subscribe(e);return!n.closed&&e.next(this._value),n}getValue(){let{hasError:e,thrownError:n,_value:o}=this;if(e)throw n;return this._throwIfClosed(),o}next(e){super.next(this._value=e)}};function Nu(t,e){return Qh((n,o)=>{let r=0;n.subscribe(Xh(o,i=>{o.next(t.call(e,i,r++))}))})}var Tc="https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss",Ie=class extends Error{code;constructor(e,n){super(Fi(e,n)),this.code=e}};function lC(t){return`NG0${Math.abs(t)}`}function Fi(t,e){return`${lC(t)}${e?": "+e:""}`}function yt(t){for(let e in t)if(t[e]===yt)return e;throw Error("")}function Mc(t){if(typeof t=="string")return t;if(Array.isArray(t))return`[${t.map(Mc).join(", ")}]`;if(t==null)return""+t;let e=t.overriddenName||t.name;if(e)return`${e}`;let n=t.toString();if(n==null)return""+n;let o=n.indexOf(`
|
|
6
|
-
`);return o>=0?n.slice(0,o):n}function Ic(t,e){return t?e?`${t} ${e}`:t:e||""}var dC=yt({__forward_ref__:yt});function kc(t){return t.__forward_ref__=kc,t}function Pn(t){return ig(t)?t():t}function ig(t){return typeof t=="function"&&Object.hasOwn(t,dC)&&t.__forward_ref__===kc}function Oe(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function Nc(t){return uC(t,Dc)}function uC(t,e){return Object.hasOwn(t,e)&&t[e]||null}function pC(t){let e=t?.[Dc]??null;return e||null}function Ou(t){return t&&Object.hasOwn(t,bc)?t[bc]:null}var Dc=yt({\u0275prov:yt}),bc=yt({\u0275inj:yt}),ze=class{_desc;ngMetadataName="InjectionToken";\u0275prov;constructor(e,n){this._desc=e,this.\u0275prov=void 0,typeof n=="number"?this.__NG_ELEMENT_ID__=n:n!==void 0&&(this.\u0275prov=Oe({token:this,providedIn:n.providedIn||"root",factory:n.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};function Wu(t){return t&&!!t.\u0275providers}var Yu=yt({\u0275cmp:yt}),Zu=yt({\u0275dir:yt}),Ku=yt({\u0275pipe:yt});var Pu=yt({\u0275fac:yt}),zr=yt({__NG_ELEMENT_ID__:yt}),eg=yt({__NG_ENV_ID__:yt});function qr(t){return Qu(t,"@Component"),t[Yu]||null}function Oc(t){return Qu(t,"@Directive"),t[Zu]||null}function sg(t){return Qu(t,"@Pipe"),t[Ku]||null}function Qu(t,e){if(t==null)throw new Ie(-919,!1)}function Gr(t){return typeof t=="string"?t:t==null?"":String(t)}var ag=yt({ngErrorCode:yt}),fC=yt({ngErrorMessage:yt}),mC=yt({ngTokenPath:yt});function Xu(t,e){return cg("",-200,e)}function Pc(t,e){throw new Ie(-201,!1)}function cg(t,e,n){let o=new Ie(e,t);return o[ag]=e,o[fC]=t,n&&(o[mC]=n),o}function hC(t){return t[ag]}var Au;function lg(){return Au}function On(t){let e=Au;return Au=t,e}function Ju(t,e,n){let o=Nc(t);if(o&&o.providedIn=="root")return o.value===void 0?o.value=o.factory():o.value;if(n&8)return null;if(e!==void 0)return e;Pc(t,"")}var lr=globalThis;var gC={},$r=gC,yC="__NG_DI_FLAG__",Ru=class{injector;constructor(e){this.injector=e}retrieve(e,n){let o=Hr(n)||0;try{return this.injector.get(e,o&8?null:$r,o)}catch(r){if(Ni(r))return r;throw r}}};function vC(t,e=0){let n=fc();if(n===void 0)throw new Ie(-203,!1);if(n===null)return Ju(t,void 0,e);{let o=_C(e),r=n.retrieve(t,o);if(Ni(r)){if(o.optional)return null;throw r}return r}}function lt(t,e=0){return(lg()||vC)(Pn(t),e)}function N(t,e){return lt(t,Hr(e))}function Hr(t){return typeof t>"u"||typeof t=="number"?t:0|(t.optional&&8)|(t.host&&1)|(t.self&&2)|(t.skipSelf&&4)}function _C(t){return{optional:!!(t&8),host:!!(t&1),self:!!(t&2),skipSelf:!!(t&4)}}function Lu(t){let e=[];for(let n=0;n<t.length;n++){let o=Pn(t[n]);if(Array.isArray(o)){if(o.length===0)throw new Ie(900,!1);let r,i=0;for(let s=0;s<o.length;s++){let a=o[s],c=bC(a);typeof c=="number"?c===-1?r=a.token:i|=c:r=a}e.push(lt(r,i))}else e.push(lt(o))}return e}function bC(t){return t[yC]}function Ri(t,e){let n=Object.hasOwn(t,Pu);return n?t[Pu]:null}function dg(t,e,n){if(t.length!==e.length)return!1;for(let o=0;o<t.length;o++){let r=t[o],i=e[o];if(n&&(r=n(r),i=n(i)),i!==r)return!1}return!0}function ug(t){return t.flat(Number.POSITIVE_INFINITY)}function Ac(t,e){t.forEach(n=>Array.isArray(n)?Ac(n,e):e(n))}function ep(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function Hs(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}function pg(t,e,n,o){let r=t.length;if(r==e)t.push(n,o);else if(r===1)t.push(o,t[0]),t[0]=n;else{for(r--,t.push(t[r-1],t[r]);r>e;){let i=r-2;t[r]=t[i],r--}t[e]=n,t[e+1]=o}}function Rc(t,e,n){let o=Vi(t,e);return o>=0?t[o|1]=n:(o=~o,pg(t,o,e,n)),o}function Lc(t,e){let n=Vi(t,e);if(n>=0)return t[n|1]}function Vi(t,e){return xC(t,e,1)}function xC(t,e,n){let o=0,r=t.length>>n;for(;r!==o;){let i=o+(r-o>>1),s=t[i<<n];if(e===s)return i<<n;s>e?r=i:o=i+1}return~(r<<n)}var Fc={},co=[],Wr=new ze(""),Vc=new ze("",-1),tp=new ze(""),Li=class{get(e,n=$r){if(n===$r){let r=cg("",-201);throw r.name="\u0275NotFound",r}return n}};function ji(t){return{\u0275providers:t}}function fg(t){return ji([{provide:Wr,multi:!0,useValue:t}])}function mg(...t){return{\u0275providers:np(!0,t),\u0275fromNgModule:!0}}function np(t,...e){let n=[],o=new Set,r,i=s=>{n.push(s)};return Ac(e,s=>{let a=s;xc(a,i,[],o)&&(r||=[],r.push(a))}),r!==void 0&&hg(r,i),n}function hg(t,e){for(let n=0;n<t.length;n++){let{ngModule:o,providers:r}=t[n];op(r,i=>{e(i,o)})}}function xc(t,e,n,o){if(t=Pn(t),!t)return!1;let r=null,i=Ou(t),s=!i&&qr(t);if(!i&&!s){let c=t.ngModule;if(i=Ou(c),i)r=c;else return!1}else{if(s&&!s.standalone)return!1;r=t}let a=o.has(r);if(s){if(a)return!1;if(o.add(r),s.dependencies){let c=typeof s.dependencies=="function"?s.dependencies():s.dependencies;for(let l of c)xc(l,e,n,o)}}else if(i){if(i.imports!=null&&!a){o.add(r);let l;Ac(i.imports,d=>{xc(d,e,n,o)&&(l||=[],l.push(d))}),l!==void 0&&hg(l,e)}if(!a){let l=Ri(r)||(()=>new r);e({provide:r,useFactory:l,deps:co},r),e({provide:tp,useValue:r,multi:!0},r),e({provide:Wr,useValue:()=>lt(r),multi:!0},r)}let c=i.providers;if(c!=null&&!a){let l=t;op(c,d=>{e(d,l)})}}else return!1;return r!==t&&t.providers!==void 0}function op(t,e){for(let n of t)Wu(n)&&(n=n.\u0275providers),Array.isArray(n)?op(n,e):e(n)}var EC=yt({provide:String,useValue:yt});function gg(t){return t!==null&&typeof t=="object"&&EC in t}function CC(t){return!!(t&&t.useExisting)}function wC(t){return!!(t&&t.useFactory)}function Ec(t){return typeof t=="function"}var Bs=new ze(""),_c={},tg={},Du;function Us(){return Du===void 0&&(Du=new Li),Du}var lo=class{},Br=class extends lo{parent;source;scopes;records=new Map;_ngOnDestroyHooks=new Set;_onDestroyHooks=[];get destroyed(){return this._destroyed}_destroyed=!1;injectorDefTypes;constructor(e,n,o,r){super(),this.parent=n,this.source=o,this.scopes=r,Vu(e,s=>this.processProvider(s)),this.records.set(Vc,Ai(void 0,this)),r.has("environment")&&this.records.set(lo,Ai(void 0,this));let i=this.records.get(Bs);i!=null&&typeof i.value=="string"&&this.scopes.add(i.value),this.injectorDefTypes=new Set(this.get(tp,co,{self:!0}))}retrieve(e,n){let o=Hr(n)||0;try{return this.get(e,$r,o)}catch(r){if(Ni(r))return r;throw r}}destroy(){Ls(this),this._destroyed=!0;let e=ae(null);try{for(let o of this._ngOnDestroyHooks)o.ngOnDestroy();let n=this._onDestroyHooks;this._onDestroyHooks=[];for(let o of n)o()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),ae(e)}}onDestroy(e){return Ls(this),this._onDestroyHooks.push(e),()=>this.removeOnDestroy(e)}runInContext(e){Ls(this);let n=So(this),o=On(void 0),r;try{return e()}finally{So(n),On(o)}}get(e,n=$r,o){if(Ls(this),Object.hasOwn(e,eg))return e[eg](this);let r=Hr(o),i,s=So(this),a=On(void 0);try{if(!(r&4)){let l=this.records.get(e);if(l===void 0){let d=kC(e)&&Nc(e);d&&this.injectableDefInScope(d)?l=Ai(Fu(e),_c):l=null,this.records.set(e,l)}if(l!=null)return this.hydrate(e,l,r)}let c=r&2?Us():this.parent;return n=r&8&&n===$r?null:n,c.get(e,n)}catch(c){let l=hC(c);throw l===-200||l===-201?new Ie(l,null):c}finally{On(a),So(s)}}resolveInjectorInitializers(){let e=ae(null),n=So(this),o=On(void 0),r;try{let i=this.get(Wr,co,{self:!0});for(let s of i)s()}finally{So(n),On(o),ae(e)}}toString(){return"R3Injector[...]"}processProvider(e){e=Pn(e);let n=Ec(e)?e:Pn(e&&e.provide),o=TC(e);if(!Ec(e)&&e.multi===!0){let r=this.records.get(n);r||(r=Ai(void 0,_c,!0),r.factory=()=>Lu(r.multi),this.records.set(n,r)),n=e,r.multi.push(e)}this.records.set(n,o)}hydrate(e,n,o){let r=ae(null);try{if(n.value===tg)throw Xu("");return n.value===_c&&(n.value=tg,n.value=n.factory(void 0,o)),typeof n.value=="object"&&n.value&&IC(n.value)&&this._ngOnDestroyHooks.add(n.value),n.value}finally{ae(r)}}injectableDefInScope(e){if(!e.providedIn)return!1;let n=Pn(e.providedIn);return typeof n=="string"?n==="any"||this.scopes.has(n):this.injectorDefTypes.has(n)}removeOnDestroy(e){let n=this._onDestroyHooks.indexOf(e);n!==-1&&this._onDestroyHooks.splice(n,1)}};function Fu(t){let e=Nc(t),n=e!==null?e.factory:Ri(t);if(n!==null)return n;if(t instanceof ze)throw new Ie(-204,!1);if(t instanceof Function)return SC(t);throw new Ie(-204,!1)}function SC(t){if(t.length>0)throw new Ie(-204,!1);let n=pC(t);return n!==null?()=>n.factory(t):()=>new t}function TC(t){if(gg(t))return Ai(void 0,t.useValue);{let e=yg(t);return Ai(e,_c)}}function yg(t,e,n){let o;if(Ec(t)){let r=Pn(t);return Ri(r)||Fu(r)}else if(gg(t))o=()=>Pn(t.useValue);else if(wC(t))o=()=>t.useFactory(...Lu(t.deps||[]));else if(CC(t))o=(r,i)=>lt(Pn(t.useExisting),i!==void 0&&i&8?8:void 0);else{let r=Pn(t&&(t.useClass||t.provide));if(MC(t))o=()=>new r(...Lu(t.deps));else return Ri(r)||Fu(r)}return o}function Ls(t){if(t.destroyed)throw new Ie(-205,!1)}function Ai(t,e,n=!1){return{factory:t,value:e,multi:n?[]:void 0}}function MC(t){return!!t.deps}function IC(t){return t!==null&&typeof t=="object"&&typeof t.ngOnDestroy=="function"}function kC(t){return typeof t=="function"||typeof t=="object"&&t.ngMetadataName==="InjectionToken"}function Vu(t,e){for(let n of t)Array.isArray(n)?Vu(n,e):n&&Wu(n)?Vu(n.\u0275providers,e):e(n)}function jc(t,e){let n;t instanceof Br?(Ls(t),n=t):n=new Ru(t);let o,r=So(n),i=On(void 0);try{return e()}finally{So(r),On(i)}}function vg(){return lg()!==void 0||fc()!=null}var uo=0,de=1,ye=2,Bt=3,Yn=4,Sn=5,$i=6,Hi=7,Ft=8,zo=9,po=10,Dt=11,Bi=12,rp=13,dr=14,An=15,ur=16,Yr=17,Mo=18,zs=19,ip=20,Ho=21,$c=22,Bo=23,Rn=24,Zr=25,_g=26,qs=27,ln=28,bg=1,sp=6,Kr=7,Gs=8,Qr=9,Vt=10;function pr(t){return Array.isArray(t)&&typeof t[bg]=="object"}function Zn(t){return Array.isArray(t)&&t[bg]===!0}function ap(t){return(t.flags&4)!==0}function fr(t){return t.componentOffset>-1}function Hc(t){return(t.flags&1)===1}function Xr(t){return!!t.template}function Ui(t){return(t[ye]&512)!==0}function Jr(t){return(t[ye]&256)===256}var Nt=(function(t){return t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL",t[t.ATTRIBUTE_NO_BINDING=6]="ATTRIBUTE_NO_BINDING",t})(Nt||{}),Fs,Ur="svg",Bc="math",ju="",ng="*",$u=()=>Object.create(null);function NC(){return Fs||(Fs=$u(),ar(Nt.HTML,void 0,[["iframe",["srcdoc"]],["*",["innerHTML","outerHTML"]]]),ar(Nt.STYLE,void 0,[["*",["style"]]]),ar(Nt.URL,void 0,[["*",["formAction"]],["area",["href"]],["a",["href","xlink:href"]],["form",["action"]],["img",["src"]],["video",["src"]]]),ar(Nt.URL,Bc,[["*",["href","xlink:href"]]]),ar(Nt.RESOURCE_URL,void 0,[["base",["href"]],["embed",["src"]],["frame",["src"]],["iframe",["src"]],["link",["href"]],["object",["codebase","data"]]]),ar(Nt.URL,Ur,[["a",["href","xlink:href"]]]),ar(Nt.ATTRIBUTE_NO_BINDING,Ur,[["animate",["attributeName","values","to","from"]],["set",["to","attributeName"]],["animateMotion",["attributeName"]],["animateTransform",["attributeName"]]]),ar(Nt.ATTRIBUTE_NO_BINDING,void 0,[["unknown",["attributeName","values","to","from","sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority","credentialless"]],["iframe",["sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority","credentialless"]]]),Fs)}function ar(t,e,n){let o=e??ju;for(let[r,i]of n){let s=r.toLowerCase();for(let a of i){let c=a.toLowerCase(),l=Fs[c]??=$u(),d=l[o]??=$u();d[s]=t}}}function xg(t,e,n){let r=NC()[e.toLowerCase()];if(!r)return Nt.NONE;let i=t.toLowerCase(),s;if(n){let a=r[n];a&&(s=a[i]??a[ng])}if(s===void 0){let a=r[ju];a&&(s=a[i]??a[ng])}if(s===void 0&&(!n||n===ju)){let a=r[Ur];a&&(s=a[i])}return s??Nt.NONE}function dn(t){for(;Array.isArray(t);)t=t[uo];return t}function cp(t,e){return dn(e[t])}function Kn(t,e){return dn(e[t.index])}function Uc(t,e){return t.data[e]}function Io(t,e){let n=e[t];return pr(n)?n:n[uo]}function zc(t){return(t[ye]&128)===128}function Eg(t){return Zn(t[Bt])}function ko(t,e){return e==null?null:t[e]}function lp(t){t[Yr]=0}function dp(t){t[ye]&1024||(t[ye]|=1024,zc(t)&&ei(t))}function Cg(t,e){for(;t>0;)e=e[dr],t--;return e}function Ws(t){return!!(t[ye]&9216||t[Rn]?.dirty)}function qc(t){t[po].changeDetectionScheduler?.notify(8),t[ye]&64&&(t[ye]|=1024),Ws(t)&&ei(t)}function ei(t){t[po].changeDetectionScheduler?.notify(0);let e=Uo(t);for(;e!==null&&!(e[ye]&8192||(e[ye]|=8192,!zc(e)));)e=Uo(e)}function Gc(t,e){if(Jr(t))throw new Ie(911,!1);t[Ho]===null&&(t[Ho]=[]),t[Ho].push(e)}function wg(t,e){if(t[Ho]===null)return;let n=t[Ho].indexOf(e);n!==-1&&t[Ho].splice(n,1)}function Uo(t){let e=t[Bt];return Zn(e)?e[Bt]:e}function up(t){return t[Hi]??=[]}function pp(t){return t.cleanup??=[]}function Sg(t,e,n,o){let r=up(e);r.push(n),t.firstCreatePass&&pp(t).push(o,r.length-1)}var Fe={lFrame:Hg(null),bindingsEnabled:!0,skipHydrationRootTNode:null};var Hu=!1;function Tg(){return Fe.lFrame.elementDepthCount}function Mg(){Fe.lFrame.elementDepthCount++}function fp(){Fe.lFrame.elementDepthCount--}function Ig(){return Fe.bindingsEnabled}function kg(){return Fe.skipHydrationRootTNode!==null}function mp(t){return Fe.skipHydrationRootTNode===t}function hp(){Fe.skipHydrationRootTNode=null}function Ze(){return Fe.lFrame.lView}function xn(){return Fe.lFrame.tView}function I(t){return Fe.lFrame.contextLView=t,t[Ft]}function k(t){return Fe.lFrame.contextLView=null,t}function Qn(){let t=gp();for(;t!==null&&t.type===64;)t=t.parent;return t}function gp(){return Fe.lFrame.currentTNode}function Ng(){let t=Fe.lFrame,e=t.currentTNode;return t.isParent?e:e.parent}function zi(t,e){let n=Fe.lFrame;n.currentTNode=t,n.isParent=e}function yp(){return Fe.lFrame.isParent}function Dg(){Fe.lFrame.isParent=!1}function vp(){return Hu}function Vs(t){let e=Hu;return Hu=t,e}function Og(){let t=Fe.lFrame,e=t.bindingRootIndex;return e===-1&&(e=t.bindingRootIndex=t.tView.bindingStartIndex),e}function Pg(){return Fe.lFrame.bindingIndex}function Ag(t){return Fe.lFrame.bindingIndex=t}function ti(){return Fe.lFrame.bindingIndex++}function Wc(t){let e=Fe.lFrame,n=e.bindingIndex;return e.bindingIndex=e.bindingIndex+t,n}function Rg(){return Fe.lFrame.inI18n}function Lg(t,e){let n=Fe.lFrame;n.bindingIndex=n.bindingRootIndex=t,Yc(e)}function Fg(){return Fe.lFrame.currentDirectiveIndex}function Yc(t){Fe.lFrame.currentDirectiveIndex=t}function Vg(t){let e=Fe.lFrame.currentDirectiveIndex;return e===-1?null:t[e]}function jg(){return Fe.lFrame.currentQueryIndex}function Zc(t){Fe.lFrame.currentQueryIndex=t}function DC(t){let e=t[de];return e.type===2?e.declTNode:e.type===1?t[Sn]:null}function _p(t,e,n){if(n&4){let r=e,i=t;for(;r=r.parent,r===null&&!(n&1);)if(r=DC(i),r===null||(i=i[dr],r.type&10))break;if(r===null)return!1;e=r,t=i}let o=Fe.lFrame=$g();return o.currentTNode=e,o.lView=t,!0}function Kc(t){let e=$g(),n=t[de];Fe.lFrame=e,e.currentTNode=n.firstChild,e.lView=t,e.tView=n,e.contextLView=t,e.bindingIndex=n.bindingStartIndex,e.inI18n=!1}function $g(){let t=Fe.lFrame,e=t===null?null:t.child;return e===null?Hg(t):e}function Hg(t){let e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:t,child:null,inI18n:!1};return t!==null&&(t.child=e),e}function Bg(){let t=Fe.lFrame;return Fe.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}var bp=Bg;function Qc(){let t=Bg();t.isParent=!0,t.tView=null,t.selectedIndex=-1,t.contextLView=null,t.elementDepthCount=0,t.currentDirectiveIndex=-1,t.currentNamespace=null,t.bindingRootIndex=-1,t.bindingIndex=-1,t.currentQueryIndex=0}function Ug(t){return(Fe.lFrame.contextLView=Cg(t,Fe.lFrame.contextLView))[Ft]}function fo(){return Fe.lFrame.selectedIndex}function mr(t){Fe.lFrame.selectedIndex=t}function Ys(){let t=Fe.lFrame;return Uc(t.tView,t.selectedIndex)}function Tt(){Fe.lFrame.currentNamespace=Ur}function fn(){OC()}function OC(){Fe.lFrame.currentNamespace=null}function xp(){return Fe.lFrame.currentNamespace}var zg=!0;function Xc(){return zg}function Jc(t){zg=t}function Bu(t,e=null,n=null,o){let r=qg(t,e,n,o);return r.resolveInjectorInitializers(),r}function qg(t,e=null,n=null,o,r=new Set){let i=[n||co,mg(t)],s;return new Br(i,e||Us(),s||null,r)}var Gn=class t{static THROW_IF_NOT_FOUND=$r;static NULL=new Li;static create(e,n){if(Array.isArray(e))return Bu({name:""},n,e,"");{let o=e.name??"";return Bu({name:o},e.parent,e.providers,o)}}static \u0275prov=Oe({token:t,providedIn:"any",factory:()=>lt(Vc)});static __NG_ELEMENT_ID__=-1},En=new ze(""),ht=class{static __NG_ELEMENT_ID__=PC;static __NG_ENV_ID__=e=>e},Cc=class extends ht{_lView;constructor(e){super(),this._lView=e}get destroyed(){return Jr(this._lView)}onDestroy(e){let n=this._lView;return Gc(n,e),()=>wg(n,e)}};function PC(){return new Cc(Ze())}var Gg=!1,Wg=new ze(""),qi=(()=>{class t{taskId=0;pendingTasks=new Set;destroyed=!1;pendingTask=new Rs(!1);debugTaskTracker=N(Wg,{optional:!0});get hasPendingTasks(){return this.destroyed?!1:this.pendingTask.value}get hasPendingTasksObservable(){return this.destroyed?new To(n=>{n.next(!1),n.complete()}):this.pendingTask}add(){!this.hasPendingTasks&&!this.destroyed&&this.pendingTask.next(!0);let n=this.taskId++;return this.pendingTasks.add(n),this.debugTaskTracker?.add(n),n}has(n){return this.pendingTasks.has(n)}remove(n){this.pendingTasks.delete(n),this.debugTaskTracker?.remove(n),this.pendingTasks.size===0&&this.hasPendingTasks&&this.pendingTask.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this.hasPendingTasks&&this.pendingTask.next(!1),this.destroyed=!0,this.pendingTask.unsubscribe()}static \u0275prov=Oe({token:t,providedIn:"root",factory:()=>new t})}return t})(),Uu=class extends qn{__isAsync;destroyRef=void 0;pendingTasks=void 0;constructor(e=!1){super(),this.__isAsync=e,vg()&&(this.destroyRef=N(ht,{optional:!0})??void 0,this.pendingTasks=N(qi,{optional:!0})??void 0)}emit(e){let n=ae(null);try{super.next(e)}finally{ae(n)}}subscribe(e,n,o){let r=e,i=n||(()=>null),s=o;if(e&&typeof e=="object"){let c=e;r=c.next?.bind(c),i=c.error?.bind(c),s=c.complete?.bind(c)}this.__isAsync&&(i=this.wrapInTimeout(i),r&&(r=this.wrapInTimeout(r)),s&&(s=this.wrapInTimeout(s)));let a=super.subscribe({next:r,error:i,complete:s});return e instanceof bn&&e.add(a),a}wrapInTimeout(e){return n=>{let o=this.pendingTasks?.add();setTimeout(()=>{try{e(n)}finally{o!==void 0&&this.pendingTasks?.remove(o)}})}}},$o=Uu;function wc(...t){}function Ep(t){let e,n;function o(){t=wc;try{n!==void 0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(n),e!==void 0&&clearTimeout(e)}catch{}}return e=setTimeout(()=>{t(),o()}),typeof requestAnimationFrame=="function"&&(n=requestAnimationFrame(()=>{t(),o()})),()=>o()}function Yg(t){return queueMicrotask(()=>t()),()=>{t=wc}}var Cp="isAngularZone",js=Cp+"_ID",AC=0,wn=class t{hasPendingMacrotasks=!1;hasPendingMicrotasks=!1;isStable=!0;onUnstable=new $o(!1);onMicrotaskEmpty=new $o(!1);onStable=new $o(!1);onError=new $o(!1);constructor(e){let{enableLongStackTrace:n=!1,shouldCoalesceEventChangeDetection:o=!1,shouldCoalesceRunChangeDetection:r=!1,scheduleInRootZone:i=Gg}=e;if(typeof Zone>"u")throw new Ie(908,!1);Zone.assertZonePatched();let s=this;s._nesting=0,s._outer=s._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(s._inner=s._inner.fork(new Zone.TaskTrackingZoneSpec)),n&&Zone.longStackTraceZoneSpec&&(s._inner=s._inner.fork(Zone.longStackTraceZoneSpec)),s.shouldCoalesceEventChangeDetection=!r&&o,s.shouldCoalesceRunChangeDetection=r,s.callbackScheduled=!1,s.scheduleInRootZone=i,FC(s)}static isInAngularZone(){return typeof Zone<"u"&&Zone.current.get(Cp)===!0}static assertInAngularZone(){if(!t.isInAngularZone())throw new Ie(909,!1)}static assertNotInAngularZone(){if(t.isInAngularZone())throw new Ie(909,!1)}run(e,n,o){return this._inner.run(e,n,o)}runTask(e,n,o,r){let i=this._inner,s=i.scheduleEventTask("NgZoneEvent: "+r,e,RC,wc,wc);try{return i.runTask(s,n,o)}finally{i.cancelTask(s)}}runGuarded(e,n,o){return this._inner.runGuarded(e,n,o)}runOutsideAngular(e){return this._outer.run(e)}},RC={};function wp(t){if(t._nesting==0&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(()=>t.onStable.emit(null))}finally{t.isStable=!0}}}function LC(t){if(t.isCheckStableRunning||t.callbackScheduled)return;t.callbackScheduled=!0;function e(){Ep(()=>{t.callbackScheduled=!1,zu(t),t.isCheckStableRunning=!0,wp(t),t.isCheckStableRunning=!1})}t.scheduleInRootZone?Zone.root.run(()=>{e()}):t._outer.run(()=>{e()}),zu(t)}function FC(t){let e=()=>{LC(t)},n=AC++;t._inner=t._inner.fork({name:"angular",properties:{[Cp]:!0,[js]:n,[js+n]:!0},onInvokeTask:(o,r,i,s,a,c)=>{if(VC(c))return o.invokeTask(i,s,a,c);try{return og(t),o.invokeTask(i,s,a,c)}finally{(t.shouldCoalesceEventChangeDetection&&s.type==="eventTask"||t.shouldCoalesceRunChangeDetection)&&e(),rg(t)}},onInvoke:(o,r,i,s,a,c,l)=>{try{return og(t),o.invoke(i,s,a,c,l)}finally{t.shouldCoalesceRunChangeDetection&&!t.callbackScheduled&&!jC(c)&&e(),rg(t)}},onHasTask:(o,r,i,s)=>{o.hasTask(i,s),r===i&&(s.change=="microTask"?(t._hasPendingMicrotasks=s.microTask,zu(t),wp(t)):s.change=="macroTask"&&(t.hasPendingMacrotasks=s.macroTask))},onHandleError:(o,r,i,s)=>(o.handleError(i,s),t.runOutsideAngular(()=>t.onError.emit(s)),!1)})}function zu(t){t._hasPendingMicrotasks||(t.shouldCoalesceEventChangeDetection||t.shouldCoalesceRunChangeDetection)&&t.callbackScheduled===!0?t.hasPendingMicrotasks=!0:t.hasPendingMicrotasks=!1}function og(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function rg(t){t._nesting--,wp(t)}var $s=class{hasPendingMicrotasks=!1;hasPendingMacrotasks=!1;isStable=!0;onUnstable=new $o;onMicrotaskEmpty=new $o;onStable=new $o;onError=new $o;run(e,n,o){return e.apply(n,o)}runGuarded(e,n,o){return e.apply(n,o)}runOutsideAngular(e){return e()}runTask(e,n,o,r){return e.apply(n,o)}};function VC(t){return Zg(t,"__ignore_ng_zone__")}function jC(t){return Zg(t,"__scheduler_tick__")}function Zg(t,e){return!Array.isArray(t)||t.length!==1?!1:t[0]?.data?.[e]===!0}var Wn=class{_console=console;handleError(e){this._console.error("ERROR",e)}};function Kg(t){return Qg(t)?t:new qu(t)}function Qg(t){return t instanceof Error||typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.message=="string"}var qu=class extends Error{constructor(e){super(String(e),{cause:e}),this.name="ErrorBoundaryWrappedError"}},ni=new ze("",{factory:()=>{let t=N(wn),e=N(lo),n;return o=>{t.runOutsideAngular(()=>{e.destroyed&&!n?setTimeout(()=>{throw o}):(n??=e.get(Wn),n.handleError(o))})}}}),Xg={provide:Wr,useValue:()=>{let t=N(Wn,{optional:!0})},multi:!0},$C=new ze("",{factory:()=>{let t=N(En).defaultView;if(!t)return;let e=N(ni),n=i=>{e(i.reason),i.preventDefault()},o=i=>{i.error?e(i.error):e(new Error(i.message,{cause:i})),i.preventDefault()},r=()=>{t.addEventListener("unhandledrejection",n),t.addEventListener("error",o)};typeof Zone<"u"?Zone.root.run(r):r(),N(ht).onDestroy(()=>{t.removeEventListener("error",o),t.removeEventListener("unhandledrejection",n)})}});function Sp(){return ji([fg(()=>{N($C)})])}function R(t,e){let[n,o,r]=vu(t,e?.equal),i=n,s=i[cn];return i.set=o,i.update=r,i.asReadonly=Tp.bind(i),i}function Tp(){let t=this[cn];if(t.readonlyFn===void 0){let e=()=>this();e[cn]=t,t.readonlyFn=e}return t.readonlyFn}var Zs=new ze("",{factory:()=>HC}),HC="ng";var el=new ze(""),Ks=new ze("",{providedIn:"platform",factory:()=>"unknown"});var tl=new ze("",{factory:()=>N(En).body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});var Qs=(()=>{class t{view;node;constructor(n,o){this.view=n,this.node=o}static __NG_ELEMENT_ID__=BC}return t})();function BC(){return new Qs(Ze(),Qn())}var cr=class{},Xs=new ze("",{factory:()=>!0});var Mp=new ze(""),nl=(()=>{class t{static \u0275prov=Oe({token:t,providedIn:"root",factory:()=>new Gu})}return t})(),Gu=class{dirtyEffectCount=0;queues=new Map;add(e){this.enqueue(e),this.schedule(e)}schedule(e){e.dirty&&this.dirtyEffectCount++}remove(e){let n=e.zone,o=this.queues.get(n);o.has(e)&&(o.delete(e),e.dirty&&this.dirtyEffectCount--)}enqueue(e){let n=e.zone;this.queues.has(n)||this.queues.set(n,new Set);let o=this.queues.get(n);o.has(e)||o.add(e)}flush(){for(;this.dirtyEffectCount>0;){let e=!1;for(let[n,o]of this.queues)n===null?e||=this.flushQueue(o):e||=n.run(()=>this.flushQueue(o));e||(this.dirtyEffectCount=0)}}flushQueue(e){let n=!1;for(let o of e)o.dirty&&(this.dirtyEffectCount--,n=!0,o.run());return n}},Sc=class{[cn];constructor(e){this[cn]=e}destroy(){this[cn].destroy()}};function ue(t,e){let n=e?.injector??N(Gn),o=e?.manualCleanup!==!0?n.get(ht):null,r,i=n.get(Qs,null,{optional:!0}),s=n.get(cr);return i!==null?(r=ey(i.view,s,t),o instanceof Cc&&o._lView===i.view&&(o=null)):r=qC(t,n.get(nl),s),r.injector=n,o!==null&&(r.onDestroyFns=[o.onDestroy(()=>r.destroy())]),new Sc(r)}var Jg=Q(H({},bu),{cleanupFns:void 0,zone:null,onDestroyFns:null,run(){let t=Vs(!1);try{xu(this)}finally{Vs(t)}},cleanup(){if(!this.cleanupFns?.length)return;let t=ae(null);try{for(;this.cleanupFns.length;)this.cleanupFns.pop()()}finally{this.cleanupFns=[],ae(t)}}}),UC=Q(H({},Jg),{consumerMarkedDirty(){this.scheduler.schedule(this),this.notifier.notify(12)},destroy(){if(Lr(this),this.onDestroyFns!==null)for(let t of this.onDestroyFns)t();this.cleanup(),this.scheduler.remove(this)}}),zC=Q(H({},Jg),{consumerMarkedDirty(){this.view[ye]|=8192,ei(this.view),this.notifier.notify(13)},destroy(){if(Lr(this),this.onDestroyFns!==null)for(let t of this.onDestroyFns)t();this.cleanup(),this.view[Bo]?.delete(this)}});function ey(t,e,n){let o=Object.create(zC);return o.view=t,o.zone=typeof Zone<"u"?Zone.current:null,o.notifier=e,o.userFn=n,o.fn=ty(o,n),t[Bo]??=new Set,t[Bo].add(o),o.consumerMarkedDirty(o),o}function qC(t,e,n){let o=Object.create(UC);return o.userFn=t,o.fn=ty(o,t),o.scheduler=e,o.notifier=n,o.zone=typeof Zone<"u"?Zone.current:null,o.scheduler.add(o),o.notifier.notify(12),o}function ty(t,e){return()=>{e(n=>(t.cleanupFns??=[]).push(n))}}var yf=Symbol("InputSignalNode#UNSET"),Vy=Q(H({},Ps),{transformFn:void 0,applyValueToInputSignal(t,e){Fr(t,e)}});function vf(t){return{toString:t}.toString()}var ot=(function(t){return t[t.TemplateCreateStart=0]="TemplateCreateStart",t[t.TemplateCreateEnd=1]="TemplateCreateEnd",t[t.TemplateUpdateStart=2]="TemplateUpdateStart",t[t.TemplateUpdateEnd=3]="TemplateUpdateEnd",t[t.LifecycleHookStart=4]="LifecycleHookStart",t[t.LifecycleHookEnd=5]="LifecycleHookEnd",t[t.OutputStart=6]="OutputStart",t[t.OutputEnd=7]="OutputEnd",t[t.BootstrapApplicationStart=8]="BootstrapApplicationStart",t[t.BootstrapApplicationEnd=9]="BootstrapApplicationEnd",t[t.BootstrapComponentStart=10]="BootstrapComponentStart",t[t.BootstrapComponentEnd=11]="BootstrapComponentEnd",t[t.ChangeDetectionStart=12]="ChangeDetectionStart",t[t.ChangeDetectionEnd=13]="ChangeDetectionEnd",t[t.ChangeDetectionSyncStart=14]="ChangeDetectionSyncStart",t[t.ChangeDetectionSyncEnd=15]="ChangeDetectionSyncEnd",t[t.AfterRenderHooksStart=16]="AfterRenderHooksStart",t[t.AfterRenderHooksEnd=17]="AfterRenderHooksEnd",t[t.ComponentStart=18]="ComponentStart",t[t.ComponentEnd=19]="ComponentEnd",t[t.DeferBlockStateStart=20]="DeferBlockStateStart",t[t.DeferBlockStateEnd=21]="DeferBlockStateEnd",t[t.DynamicComponentStart=22]="DynamicComponentStart",t[t.DynamicComponentEnd=23]="DynamicComponentEnd",t[t.HostBindingsUpdateStart=24]="HostBindingsUpdateStart",t[t.HostBindingsUpdateEnd=25]="HostBindingsUpdateEnd",t})(ot||{});function iw(t,e,n,o){e!==null?e.applyValueToInputSignal(e,o):t[n]=o}var sw=null;function aw(){return sw}var ny=[];var pt=function(t,e=null,n){for(let o=0;o<ny.length;o++){let r=ny[o];r(t,e,n)}};function cw(t,e,n){let{ngOnChanges:o,ngOnInit:r,ngDoCheck:i}=e.type.prototype;if(o){let s=aw()(e);(n.preOrderHooks??=[]).push(t,s),(n.preOrderCheckHooks??=[]).push(t,s)}r&&(n.preOrderHooks??=[]).push(0-t,r),i&&((n.preOrderHooks??=[]).push(t,i),(n.preOrderCheckHooks??=[]).push(t,i))}function lw(t,e){for(let n=e.directiveStart,o=e.directiveEnd;n<o;n++){let i=t.data[n].type.prototype,{ngAfterContentInit:s,ngAfterContentChecked:a,ngAfterViewInit:c,ngAfterViewChecked:l,ngOnDestroy:d}=i;s&&(t.contentHooks??=[]).push(-n,s),a&&((t.contentHooks??=[]).push(n,a),(t.contentCheckHooks??=[]).push(n,a)),c&&(t.viewHooks??=[]).push(-n,c),l&&((t.viewHooks??=[]).push(n,l),(t.viewCheckHooks??=[]).push(n,l)),d!=null&&(t.destroyHooks??=[]).push(n,d)}}function al(t,e,n){jy(t,e,3,n)}function cl(t,e,n,o){(t[ye]&3)===n&&jy(t,e,n,o)}function Ip(t,e){let n=t[ye];(n&3)===e&&(n&=16383,n+=1,t[ye]=n)}function jy(t,e,n,o){let r=o!==void 0?t[Yr]&65535:0,i=o??-1,s=e.length-1,a=0;for(let c=r;c<s;c++)if(typeof e[c+1]=="number"){if(a=e[c],o!=null&&a>=o)break}else e[c]<0&&(t[Yr]+=65536),(a<i||i==-1)&&(dw(t,n,e,c),t[Yr]=(t[Yr]&4294901760)+c+2),c++}function oy(t,e){pt(ot.LifecycleHookStart,t,e);let n=ae(null);try{e.call(t)}finally{ae(n),pt(ot.LifecycleHookEnd,t,e)}}function dw(t,e,n,o){let r=n[o]<0,i=n[o+1],s=r?-n[o]:n[o],a=t[s];r?t[ye]>>14<t[Yr]>>16&&(t[ye]&3)===e&&(t[ye]+=16384,oy(a,i)):oy(a,i)}var Yi=-1,ta=class{factory;name;injectImpl;resolving=!1;canSeeViewProviders;multi;componentProviders;index;providerFactory;constructor(e,n,o,r){this.factory=e,this.name=r,this.canSeeViewProviders=n,this.injectImpl=o}};function uw(t){return(t.flags&8)!==0}function pw(t){return(t.flags&16)!==0}function fw(t,e,n){let o=0;for(;o<n.length;){let r=n[o];if(typeof r=="number"){if(r!==0)break;o++;let i=n[o++],s=n[o++],a=n[o++];t.setAttribute(e,s,a,i)}else{let i=r,s=n[++o];hw(i)?t.setProperty(e,i,s):t.setAttribute(e,i,s),o++}}return o}function mw(t){return t===3||t===4||t===6}function hw(t){return t.charCodeAt(0)===64}function Sl(t,e){if(!(e===null||e.length===0))if(t===null||t.length===0)t=e.slice();else{let n=-1;for(let o=0;o<e.length;o++){let r=e[o];typeof r=="number"?n=r:n===0||(n===-1||n===2?ry(t,n,r,null,e[++o]):ry(t,n,r,null,null))}}return t}function ry(t,e,n,o,r){let i=0,s=t.length;if(e===-1)s=-1;else for(;i<t.length;){let a=t[i++];if(typeof a=="number"){if(a===e){s=-1;break}else if(a>e){s=i-1;break}}}for(;i<t.length;){let a=t[i];if(typeof a=="number")break;if(a===n){r!==null&&(t[i+1]=r);return}i++,r!==null&&i++}s!==-1&&(t.splice(s,0,e),i=s+1),t.splice(i++,0,n),r!==null&&t.splice(i++,0,r)}function $y(t){return t!==Yi}function pl(t){return t&32767}function gw(t){return t>>16}function fl(t,e){let n=gw(t),o=e;for(;n>0;)o=o[dr],n--;return o}var Rp=!0;function iy(t){let e=Rp;return Rp=t,e}var yw=256,Hy=yw-1,By=5,vw=0,No={};function _w(t,e,n){let o;typeof n=="string"?o=n.charCodeAt(0)||0:Object.hasOwn(n,zr)&&(o=n[zr]),o==null&&(o=n[zr]=vw++);let r=o&Hy,i=1<<r;e.data[t+(r>>By)]|=i}function Uy(t,e){let n=zy(t,e);if(n!==-1)return n;let o=e[de];o.firstCreatePass&&(t.injectorIndex=e.length,kp(o.data,t),kp(e,null),kp(o.blueprint,null));let r=_f(t,e),i=t.injectorIndex;if($y(r)){let s=pl(r),a=fl(r,e),c=a[de].data;for(let l=0;l<8;l++)e[i+l]=a[s+l]|c[s+l]}return e[i+8]=r,i}function kp(t,e){t.push(0,0,0,0,0,0,0,0,e)}function zy(t,e){return t.injectorIndex===-1||t.parent&&t.parent.injectorIndex===t.injectorIndex||e[t.injectorIndex+8]===null?-1:t.injectorIndex}function _f(t,e){if(t.parent&&t.parent.injectorIndex!==-1)return t.parent.injectorIndex;let n=0,o=null,r=e;for(;r!==null;){if(o=Zy(r),o===null)return Yi;if(n++,r=r[dr],o.injectorIndex!==-1)return o.injectorIndex|n<<16}return Yi}function bw(t,e,n){_w(t,e,n)}function qy(t,e,n){if(n&8||t!==void 0)return t;Pc(e,"NodeInjector")}function Gy(t,e,n,o){if(n&8&&o===void 0&&(o=null),(n&3)===0){let r=t[zo],i=On(void 0);try{return r?r.get(e,o,n&8):Ju(e,o,n&8)}finally{On(i)}}return qy(o,e,n)}function Wy(t,e,n,o=0,r){if(t!==null){if(e[ye]&2048&&!(o&2)){let s=ww(t,e,n,o,No);if(s!==No)return s}let i=Yy(t,e,n,o,No);if(i!==No)return i}return Gy(e,n,o,r)}function Yy(t,e,n,o,r){let i=Ew(n);if(typeof i=="function"){if(!_p(e,t,o))return o&1?qy(r,n,o):Gy(e,n,o,r);try{let s;if(s=i(o),s==null&&!(o&8))Pc(n);else return s}finally{bp()}}else if(typeof i=="number"){let s=null,a=zy(t,e),c=Yi,l=o&1?e[An][Sn]:null;for((a===-1||o&4)&&(c=a===-1?_f(t,e):e[a+8],c===Yi||!ay(o,!1)?a=-1:(s=e[de],a=pl(c),e=fl(c,e)));a!==-1;){let d=e[de];if(sy(i,a,d.data)){let f=xw(a,e,n,s,o,l);if(f!==No)return f}c=e[a+8],c!==Yi&&ay(o,e[de].data[a+8]===l)&&sy(i,a,e)?(s=d,a=pl(c),e=fl(c,e)):a=-1}}return r}function xw(t,e,n,o,r,i){let s=e[de],a=s.data[t+8],c=o==null?fr(a)&&Rp:o!=s&&(a.type&3)!==0,l=r&1&&i===a,d=ll(a,s,n,c,l);return d!==null?ml(e,s,d,a,r):No}function ll(t,e,n,o,r){let i=t.providerIndexes,s=e.data,a=i&1048575,c=t.directiveStart,l=t.directiveEnd,d=i>>20,f=o?a:a+d,y=r?a+d:l;for(let v=f;v<y;v++){let x=s[v];if(v<c&&n===x||v>=c&&x.type===n)return v}if(r){let v=s[c];if(v&&Xr(v)&&v.type===n)return c}return null}function ml(t,e,n,o,r){let i=t[n],s=e.data;if(i instanceof ta){let a=i;if(a.resolving)throw Xu("");let c=iy(a.canSeeViewProviders);a.resolving=!0;let l=s[n].type||s[n],d,f=a.injectImpl?On(a.injectImpl):null,y=_p(t,o,0);try{i=t[n]=a.factory(void 0,r,s,t,o),e.firstCreatePass&&n>=o.directiveStart&&cw(n,s[n],e)}finally{f!==null&&On(f),iy(c),a.resolving=!1,bp()}}return i}function Ew(t){if(typeof t=="string")return t.charCodeAt(0)||0;let e=Object.hasOwn(t,zr)?t[zr]:void 0;return typeof e=="number"?e>=0?e&Hy:Cw:e}function sy(t,e,n){let o=1<<t;return!!(n[e+(t>>By)]&o)}function ay(t,e){return!(t&2)&&!(t&1&&e)}var qo=class{_tNode;_lView;constructor(e,n){this._tNode=e,this._lView=n}get(e,n,o){return Wy(this._tNode,this._lView,e,Hr(o),n)}};function Cw(){return new qo(Qn(),Ze())}function ww(t,e,n,o,r){let i=t,s=e;for(;i!==null&&s!==null&&s[ye]&2048&&!Ui(s);){let a=Yy(i,s,n,o|2,No);if(a!==No)return a;o&=-5;let c=i.parent;if(!c){let l=s[ip];if(l){let d=l.get(n,No,o);if(d!==No)return d}c=Zy(s),s=s[dr]}i=c}return r}function Zy(t){let e=t[de],n=e.type;return n===2?e.declTNode:n===1?t[Sn]:null}function Xi(t){return{token:t.token,providedIn:t.autoProvided===!1?null:"root",factory:t.factory,value:void 0}}function Sw(){return Ji(Qn(),Ze())}function Ji(t,e){return new Zt(Kn(t,e))}var Zt=(()=>{class t{nativeElement;constructor(n){this.nativeElement=n}static __NG_ELEMENT_ID__=Sw}return t})();function Tw(t){return t instanceof Zt?t.nativeElement:t}function Mw(){return this._results[Symbol.iterator]()}var hl=class{_emitDistinctChangesOnly;dirty=!0;_onDirty=void 0;_results=[];_changesDetected=!1;_changes=void 0;length=0;first=void 0;last=void 0;get changes(){return this._changes??=new qn}constructor(e=!1){this._emitDistinctChangesOnly=e}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,n){return this._results.reduce(e,n)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,n){this.dirty=!1;let o=ug(e);(this._changesDetected=!dg(this._results,o,n))&&(this._results=o,this.length=o.length,this.last=o[this.length-1],this.first=o[0])}notifyOnChanges(){this._changes!==void 0&&(this._changesDetected||!this._emitDistinctChangesOnly)&&this._changes.next(this)}onDirty(e){this._onDirty=e}setDirty(){this.dirty=!0,this._onDirty?.()}destroy(){this._changes!==void 0&&(this._changes.complete(),this._changes.unsubscribe())}[Symbol.iterator]=Mw};function Ky(t){return(t.flags&128)===128}var bf=(function(t){return t[t.OnPush=0]="OnPush",t[t.Eager=1]="Eager",t[t.Default=1]="Default",t})(bf||{}),Qy=new Map,Iw=0;function kw(){return Iw++}function Nw(t){Qy.set(t[zs],t)}function Lp(t){Qy.delete(t[zs])}var cy="__ngContext__";function Zi(t,e){pr(e)?(t[cy]=e[zs],Nw(e)):t[cy]=e}function Xy(t){return ev(t[Bi])}function Jy(t){return ev(t[Yn])}function ev(t){for(;t!==null&&!Zn(t);)t=t[Yn];return t}var Fp;function xf(t){Fp=t}function Ef(){if(Fp!==void 0)return Fp;if(typeof document<"u")return document;throw new Ie(210,!1)}var tv="r";var nv="di";var ov=!1,rv=new ze("",{factory:()=>ov});var ly=new WeakMap;function Dw(t,e){if(t==null||typeof t!="object")return;let n=ly.get(t);n||(n=new WeakSet,ly.set(t,n)),n.add(e)}var Ow=(t,e,n,o)=>{};function Pw(t,e,n,o){Ow(t,e,n,o)}function Cf(t){return(t.flags&32)===32}var Aw=()=>null;function iv(t,e,n=!1){return Aw(t,e,n)}function sv(t,e){let n=t.contentQueries;if(n!==null){let o=ae(null);try{for(let r=0;r<n.length;r+=2){let i=n[r],s=n[r+1];if(s!==-1){let a=t.data[s];Zc(i),a.contentQueries(2,e[s],s)}}}finally{ae(o)}}}function Vp(t,e,n){Zc(0);let o=ae(null);try{e(t,n)}finally{ae(o)}}function av(t,e,n){if(ap(e)){let o=ae(null);try{let r=e.directiveStart,i=e.directiveEnd;for(let s=r;s<i;s++){let a=t.data[s];if(a.contentQueries){let c=n[s];a.contentQueries(1,c,s)}}}finally{ae(o)}}}var go=(function(t){return t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t[t.ExperimentalIsolatedShadowDom=4]="ExperimentalIsolatedShadowDom",t})(go||{});var Rw={"http://www.w3.org/2000/svg":Ur,"http://www.w3.org/1998/Math/MathML":Bc},ol;function Lw(){if(ol===void 0&&(ol=null,lr.trustedTypes))try{ol=lr.trustedTypes.createPolicy("angular",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch{}return ol}function Tl(t){return Lw()?.createHTML(t)||t}var rl;function Fw(){if(rl===void 0&&(rl=null,lr.trustedTypes))try{rl=lr.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch{}return rl}function dy(t){return Fw()?.createHTML(t)||t}var Go=class{changingThisBreaksApplicationSecurity;constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${Tc})`}},jp=class extends Go{getTypeName(){return"HTML"}},$p=class extends Go{getTypeName(){return"Style"}},Hp=class extends Go{getTypeName(){return"Script"}},Bp=class extends Go{getTypeName(){return"URL"}},Up=class extends Go{getTypeName(){return"ResourceURL"}};function Xn(t){return t instanceof Go?t.changingThisBreaksApplicationSecurity:t}function Zo(t,e){let n=cv(t);if(n!=null&&n!==e){if(n==="ResourceURL"&&e==="URL")return!0;throw new Error(`Required a safe ${e}, got a ${n} (see ${Tc})`)}return n===e}function cv(t){return t instanceof Go&&t.getTypeName()||null}function wf(t){return new jp(t)}function Sf(t){return new $p(t)}function Tf(t){return new Hp(t)}function Mf(t){return new Bp(t)}function If(t){return new Up(t)}function Vw(t){let e=new qp(t);return jw()?new zp(e):e}var zp=class{inertDocumentHelper;constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e="<body><remove></remove>"+e;try{let n=new window.DOMParser().parseFromString(Tl(e),"text/html").body;return n===null?this.inertDocumentHelper.getInertBodyElement(e):(n.firstChild?.remove(),n)}catch{return null}}},qp=class{defaultDoc;inertDocument;constructor(e){this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert")}getInertBodyElement(e){let n=this.inertDocument.createElement("template");return n.innerHTML=Tl(e),n}};function jw(){try{return!!new window.DOMParser().parseFromString(Tl(""),"text/html")}catch{return!1}}var $w=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function la(t){return t=String(t),t.match($w)?t:"unsafe:"+t}function Ko(t){let e=Object.create(null);for(let n of t.split(","))e[n]=!0;return e}function da(...t){let e=Object.create(null);for(let n of t)for(let o in n)Object.hasOwn(n,o)&&(e[o]=!0);return e}var lv=Ko("area,br,col,hr,img,wbr"),dv=Ko("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),uv=Ko("rp,rt"),Hw=da(uv,dv),Bw=da(dv,Ko("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),Uw=da(uv,Ko("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),uy=da(lv,Bw,Uw,Hw),pv=Ko("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),zw=Ko("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),qw=Ko("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext"),Gw=da(pv,zw,qw),Ww=Ko("script,style,template"),Gp=class{sanitizedSomething=!1;buf=[];sanitizeChildren(e){let n=e.firstChild,o=!0,r=[];for(;n;){if(n.nodeType===Node.ELEMENT_NODE?o=this.startElement(n):n.nodeType===Node.TEXT_NODE?this.chars(n.nodeValue):this.sanitizedSomething=!0,o&&n.firstChild){r.push(n),n=Kw(n);continue}for(;n;){n.nodeType===Node.ELEMENT_NODE&&this.endElement(n);let i=Zw(n);if(i){n=i;break}n=r.pop()}}return this.buf.join("")}startElement(e){let n=py(e).toLowerCase();if(!Object.hasOwn(uy,n))return this.sanitizedSomething=!0,!Object.hasOwn(Ww,n);this.buf.push("<"),this.buf.push(n);let o=e.attributes;for(let r=0;r<o.length;r++){let i=o.item(r),s=i.name,a=s.toLowerCase();if(!Object.hasOwn(Gw,a)){this.sanitizedSomething=!0;continue}let c=i.value;pv[a]&&(c=la(c)),this.buf.push(" ",s,'="',fy(c),'"')}return this.buf.push(">"),!0}endElement(e){let n=py(e).toLowerCase();Object.hasOwn(uy,n)&&!Object.hasOwn(lv,n)&&(this.buf.push("</"),this.buf.push(n),this.buf.push(">"))}chars(e){this.buf.push(fy(e))}};function Yw(t,e){return(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}function Zw(t){let e=t.nextSibling;if(e&&t!==e.previousSibling)throw fv(e);return e}function Kw(t){let e=t.firstChild;if(e&&Yw(t,e))throw fv(e);return e}function py(t){let e=t.nodeName;return typeof e=="string"?e:"FORM"}function fv(t){return new Error(`Failed to sanitize html because the element is clobbered: ${t.outerHTML}`)}var Qw=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Xw=/([^\#-~ |!])/g;function fy(t){return t.replace(/&/g,"&").replace(Qw,function(e){let n=e.charCodeAt(0),o=e.charCodeAt(1);return"&#"+((n-55296)*1024+(o-56320)+65536)+";"}).replace(Xw,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"<").replace(/>/g,">")}var il;function Ml(t,e){let n=null;try{il=il||Vw(t);let o=e?String(e):"";n=il.getInertBodyElement(o);let r=5,i=o;do{if(r===0)throw new Error("Failed to sanitize html because the input is unstable");r--,o=i,i=n.innerHTML,n=il.getInertBodyElement(o)}while(o!==i);let a=new Gp().sanitizeChildren(my(n)||n);return Tl(a)}finally{if(n){let o=my(n)||n;for(;o.firstChild;)o.firstChild.remove()}}}function my(t){return"content"in t&&Jw(t)?t.content:null}function Jw(t){return t.nodeType===Node.ELEMENT_NODE&&t.nodeName==="TEMPLATE"}function eS(t,e){return t.createText(e)}function tS(t,e,n){t.setValue(e,n)}function mv(t,e,n){return t.createElement(e,n)}function oi(t,e,n,o,r){t.insertBefore(e,n,o,r)}function hv(t,e,n){t.appendChild(e,n)}function hy(t,e,n,o,r){o!==null?oi(t,e,n,o,r):hv(t,e,n)}function gv(t,e,n,o){t.removeChild(null,e,n,o)}function nS(t,e,n){t.setAttribute(e,"style",n)}function oS(t,e,n){n===""?t.removeAttribute(e,"class"):t.setAttribute(e,"class",n)}function yv(t,e,n){let{mergedAttrs:o,classes:r,styles:i}=n;o!==null&&fw(t,e,o),r!==null&&oS(t,e,r),i!==null&&nS(t,e,i)}function rS(t,e=!0){if(t[0]!=":")return[null,t];let n=t.indexOf(":",1);if(n===-1){if(e)throw new Error(`Unsupported format "${t}" expecting ":namespace:name"`);return[null,t]}return[t.slice(1,n),t.slice(n+1)]}function kf(t,e,n){if(e!==void 0&&n!==void 0&&iS(e,n)!==Nt.HTML)return t;let o=vv();return o?dy(o.sanitize(Nt.HTML,t)||""):Zo(t,"HTML")?dy(Xn(t)):Ml(Ef(),Gr(t))}function yo(t){let e=vv();return e?e.sanitize(Nt.URL,t)||"":Zo(t,"URL")?Xn(t):la(Gr(t))}function vv(){let t=Ze();return t&&t[po].sanitizer}function iS(t,e){let[n,o]=sS(t);return xg(o,e,n)}function sS(t){t=t.toLowerCase();let e=rS(t,!1);if(e[0])return e;let o=fo()===-1?null:Ys(),r=o?.namespace;if(t==="#host"&&o?.type===2){let i=Kn(o,Ze());if(i.tagName&&(t=i.tagName.toLowerCase()),r==null){let s=i.namespaceURI;r=s&&Rw[s]}}return[r,t]}function Nf(t){return t.ownerDocument.defaultView}function Ot(t){return t.ownerDocument}function aS(t,e,n){let o=t.length;for(;;){let r=t.indexOf(e,n);if(r===-1)return r;if(r===0||t.charCodeAt(r-1)<=32){let i=e.length;if(r+i===o||t.charCodeAt(r+i)<=32)return r}n=r+1}}var _v="ng-template";function cS(t,e,n,o){let r=0;if(o){for(;r<e.length&&typeof e[r]=="string";r+=2)if(e[r]==="class"&&aS(e[r+1].toLowerCase(),n,0)!==-1)return!0}else if(Df(t))return!1;if(r=e.indexOf(1,r),r>-1){let i;for(;++r<e.length&&typeof(i=e[r])=="string";)if(i.toLowerCase()===n)return!0}return!1}function Df(t){return t.type===4&&t.value!==_v}function lS(t,e,n){let o=t.type===4&&!n?_v:t.value;return e===o}function dS(t,e,n){let o=4,r=t.attrs,i=r!==null?fS(r):0,s=!1;for(let a=0;a<e.length;a++){let c=e[a];if(typeof c=="number"){if(!s&&!mo(o)&&!mo(c))return!1;if(s&&mo(c))continue;s=!1,o=c|o&1;continue}if(!s)if(o&4){if(o=2|o&1,c!==""&&!lS(t,c,n)||c===""&&e.length===1){if(mo(o))return!1;s=!0}}else if(o&8){if(r===null||!cS(t,r,c,n)){if(mo(o))return!1;s=!0}}else{let l=e[++a],d=uS(c,r,Df(t),n);if(d===-1){if(mo(o))return!1;s=!0;continue}if(l!==""){let f;if(d>i?f="":f=r[d+1].toLowerCase(),o&2&&l!==f){if(mo(o))return!1;s=!0}}}}return mo(o)||s}function mo(t){return(t&1)===0}function uS(t,e,n,o){if(e===null)return-1;let r=0;if(o||!n){let i=!1;for(;r<e.length;){let s=e[r];if(s===t)return r;if(s===3||s===6)i=!0;else if(s===1||s===2){let a=e[++r];for(;typeof a=="string";)a=e[++r];continue}else{if(s===4)break;if(s===0){r+=4;continue}}r+=i?1:2}return-1}else return mS(e,t)}function pS(t,e,n=!1){for(let o=0;o<e.length;o++)if(dS(t,e[o],n))return!0;return!1}function fS(t){for(let e=0;e<t.length;e++){let n=t[e];if(mw(n))return e}return t.length}function mS(t,e){let n=t.indexOf(4);if(n>-1)for(n++;n<t.length;){let o=t[n];if(typeof o=="number")return-1;if(o===e)return n;n++}return-1}function gy(t,e){return t?":not("+e.trim()+")":e}function hS(t){let e=t[0],n=1,o=2,r="",i=!1;for(;n<t.length;){let s=t[n];if(typeof s=="string")if(o&2){let a=t[++n];r+="["+s+(a.length>0?'="'+a+'"':"")+"]"}else o&8?r+="."+s:o&4&&(r+=" "+s);else r!==""&&!mo(s)&&(e+=gy(i,r),r=""),o=s,i=i||!mo(o);n++}return r!==""&&(e+=gy(i,r)),e}function gS(t){return t.map(hS).join(",")}function yS(t){let e=[],n=[],o=1,r=2;for(;o<t.length;){let i=t[o];if(typeof i=="string")r===2?i!==""&&e.push(i,t[++o]):r===8&&n.push(i);else{if(!mo(r))break;r=i}o++}return n.length&&e.push(1,...n),e}var Tn={},Wo=(function(t){return t[t.Important=1]="Important",t[t.DashCase=2]="DashCase",t})(Wo||{}),vS;function Of(t,e){return vS(t,e)}var Pf=new Set;var oj=typeof document<"u"&&typeof document?.documentElement?.getAnimations=="function";var Wp=new WeakMap;function bv(t){return t?t[dr]??t:null}var Gi=new WeakSet;function _S(t,e,n){let o=Wp.get(t);if(!o||o.length===0)return;let r=e.parentNode,i=e.previousSibling,s=bv(n);for(let a=o.length-1;a>=0;a--){let{el:c,declarationView:l}=o[a],d=c.parentNode;c===e?(o.splice(a,1),Gi.add(c),c.dispatchEvent(new CustomEvent("animationend",{detail:{cancel:!0}}))):i&&c===i?(o.splice(a,1),c.dispatchEvent(new CustomEvent("animationend",{detail:{cancel:!0}})),c.parentNode?.removeChild(c)):d&&r&&d!==r&&(s===null||l===null||s===l)&&(o.splice(a,1),c.dispatchEvent(new CustomEvent("animationend",{detail:{cancel:!0}})),c.parentNode?.removeChild(c))}}function bS(t,e,n){let o=bv(n),r=Wp.get(t);r?r.some(i=>i.el===e)||r.push({el:e,declarationView:o}):Wp.set(t,[{el:e,declarationView:o}])}var Il=(function(t){return t[t.CHANGE_DETECTION=0]="CHANGE_DETECTION",t[t.AFTER_NEXT_RENDER=1]="AFTER_NEXT_RENDER",t})(Il||{}),Qo=new ze(""),yy=new Set;function ii(t){yy.has(t)||(yy.add(t),performance?.mark?.("mark_feature_usage",{detail:{feature:t}}))}var Af=(()=>{class t{impl=null;execute(){this.impl?.execute()}static \u0275prov=Oe({token:t,providedIn:"root",factory:()=>new t})}return t})(),xv=[0,1,2,3],Ev=(()=>{class t{ngZone=N(wn);scheduler=N(cr);errorHandler=N(Wn,{optional:!0});sequences=new Set;deferredRegistrations=new Set;executing=!1;constructor(){N(Qo,{optional:!0})}execute(){let n=this.sequences.size>0;n&&pt(ot.AfterRenderHooksStart),this.executing=!0;for(let o of xv)for(let r of this.sequences)if(!(r.erroredOrDestroyed||!r.hooks[o]))try{r.pipelinedValue=this.ngZone.runOutsideAngular(()=>this.maybeTrace(()=>{let i=r.hooks[o];return i(r.pipelinedValue)},r.snapshot))}catch(i){r.erroredOrDestroyed=!0,this.errorHandler?.handleError(i)}this.executing=!1;for(let o of this.sequences)o.afterRun(),o.once&&(this.sequences.delete(o),o.destroy());for(let o of this.deferredRegistrations)this.sequences.add(o);this.deferredRegistrations.size>0&&this.scheduler.notify(7),this.deferredRegistrations.clear(),n&&pt(ot.AfterRenderHooksEnd)}register(n){let{view:o}=n;o!==void 0?((o[Zr]??=[]).push(n),ei(o),o[ye]|=8192):this.executing?this.deferredRegistrations.add(n):this.addSequence(n)}addSequence(n){this.sequences.add(n),this.scheduler.notify(7)}unregister(n){this.executing&&this.sequences.has(n)?(n.erroredOrDestroyed=!0,n.pipelinedValue=void 0,n.once=!0):(this.sequences.delete(n),this.deferredRegistrations.delete(n))}maybeTrace(n,o){return o?o.run(Il.AFTER_NEXT_RENDER,n):n()}static \u0275prov=Oe({token:t,providedIn:"root",factory:()=>new t})}return t})(),gl=class{impl;hooks;view;once;snapshot;erroredOrDestroyed=!1;pipelinedValue=void 0;unregisterOnDestroy;constructor(e,n,o,r,i,s=null){this.impl=e,this.hooks=n,this.view=o,this.once=r,this.snapshot=s,this.unregisterOnDestroy=i?.onDestroy(()=>this.destroy())}afterRun(){this.erroredOrDestroyed=!1,this.pipelinedValue=void 0,this.snapshot?.dispose(),this.snapshot=null}destroy(){this.impl.unregister(this),this.unregisterOnDestroy?.();let e=this.view?.[Zr];e&&(this.view[Zr]=e.filter(n=>n!==this))}};function si(t,e){let n=e?.injector??N(Gn);return ii("NgAfterNextRender"),ES(t,n,e,!0)}function xS(t){return t instanceof Function?[void 0,void 0,t,void 0]:[t.earlyRead,t.write,t.mixedReadWrite,t.read]}function ES(t,e,n,o){let r=e.get(Af);r.impl??=e.get(Ev);let i=e.get(Qo,null,{optional:!0}),s=n?.manualCleanup!==!0?e.get(ht):null,a=e.get(Qs,null,{optional:!0}),c=new gl(r.impl,xS(t),a?.view,o,s,i?.snapshot(null));return r.impl.register(c),c}var Yp=null,Cv=null;function vy(t,e,n,o){Yp?.maybeQueueEnterAnimation(t,e,n,o)}function _y(t,e,n,o){Yp===null?o(!1):Yp.runLeaveAnimationsWithCallback(t,e,n,o)}function CS(t){Cv?.initViewDetachAnimations(t)}function wS(t){Cv?.clearViewDetachAnimations(t)}function Wi(t,e,n,o,r,i,s,a){if(r!=null){let c,l=!1;Zn(r)?c=r:pr(r)&&(l=!0,r=r[uo]);let d=dn(r);t===0&&o!==null?(vy(a,o,i,n),s==null?hv(e,o,d):oi(e,o,d,s||null,!0)):t===1&&o!==null?(oi(e,o,d,s||null,!0),_S(i,d,a),Gi.has(d)||vy(a,o,i,n)):t===2?(a?.[_g]?.leave?.has(i.index)&&bS(i,d,a),Gi.delete(d),_y(a,i,n,f=>{if(Gi.has(d)){Gi.delete(d);return}gv(e,d,l,f)})):t===3&&(Gi.delete(d),_y(a,i,n,()=>{e.destroyNode(d)})),c!=null&&FS(e,t,n,c,i,o,s)}}function SS(t,e){wv(t,e),e[uo]=null,e[Sn]=null}function TS(t,e,n,o,r,i){o[uo]=r,o[Sn]=e,Nl(t,o,n,1,r,i)}function wv(t,e){e[po].changeDetectionScheduler?.notify(9),Nl(t,e,e[Dt],2,null,null)}function MS(t){let e=t[Bi];if(!e)return Np(t[de],t);for(;e;){let n=null;if(pr(e))n=e[Bi];else{let o=e[Vt];o&&(n=o)}if(!n){for(;e&&!e[Yn]&&e!==t;)pr(e)&&Np(e[de],e),e=e[Bt];e===null&&(e=t),pr(e)&&Np(e[de],e),n=e&&e[Yn]}e=n}}function Rf(t,e){let n=t[Qr],o=n.indexOf(e);n.splice(o,1)}function kl(t,e){if(Jr(e))return;let n=e[Dt];n.destroyNode&&Nl(t,e,n,3,null,null),MS(e)}function Np(t,e){if(Jr(e))return;let n=ae(null);try{e[ye]&=-129,e[ye]|=256,e[Rn]&&Lr(e[Rn]),kS(t,e),IS(t,e),e[de].type===1&&e[Dt].destroy();let o=e[ur];if(o!==null&&Zn(e[Bt])){o!==e[Bt]&&Rf(o,e);let r=e[Mo];r!==null&&r.detachView(t)}Lp(e)}finally{ae(n)}}function IS(t,e){let n=t.cleanup,o=e[Hi];if(n!==null)for(let s=0;s<n.length-1;s+=2)if(typeof n[s]=="string"){let a=n[s+3];a>=0?o[a]():o[-a].unsubscribe(),s+=2}else{let a=o[n[s+1]];n[s].call(a)}o!==null&&(e[Hi]=null);let r=e[Ho];if(r!==null){e[Ho]=null;for(let s=0;s<r.length;s++){let a=r[s];a()}}let i=e[Bo];if(i!==null){e[Bo]=null;for(let s of i)s.destroy()}}function kS(t,e){let n;if(t!=null&&(n=t.destroyHooks)!=null)for(let o=0;o<n.length;o+=2){let r=e[n[o]];if(!(r instanceof ta)){let i=n[o+1];if(Array.isArray(i))for(let s=0;s<i.length;s+=2){let a=r[i[s]],c=i[s+1];pt(ot.LifecycleHookStart,a,c);try{c.call(a)}finally{pt(ot.LifecycleHookEnd,a,c)}}else{pt(ot.LifecycleHookStart,r,i);try{i.call(r)}finally{pt(ot.LifecycleHookEnd,r,i)}}}}}function NS(t,e,n){if(e===null)throw new Ie(510,!1);return DS(t,e.parent,n)}function DS(t,e,n){let o=e;for(;o!==null&&o.type&168;)e=o,o=e.parent;if(o===null)return n[uo];if(fr(o)){let{encapsulation:r}=t.data[o.directiveStart+o.componentOffset];if(r===go.None||r===go.Emulated)return null}return Kn(o,n)}function OS(t,e,n){return AS(t,e,n)}function PS(t,e,n){return t.type&40?Kn(t,n):null}var AS=PS,by;function Lf(t,e,n,o){let r=NS(t,o,e),i=e[Dt],s=o.parent||e[Sn],a=OS(s,o,e);if(r!=null)if(Array.isArray(n))for(let c=0;c<n.length;c++)hy(i,r,n[c],a,!1);else hy(i,r,n,a,!1);by!==void 0&&by(i,o,e,n,r)}function Js(t,e){if(e!==null){let n=e.type;if(n&3)return Kn(e,t);if(n&4)return Zp(-1,t[e.index]);if(n&8){let o=e.child;if(o!==null)return Js(t,o);{let r=t[e.index];return Zn(r)?Zp(-1,r):dn(r)}}else{if(n&128)return Js(t,e.next);if(n&32)return Of(e,t)()||dn(t[e.index]);{let o=Sv(t,e);if(o!==null){if(Array.isArray(o))return o[0];let r=Uo(t[An]);return Js(r,o)}else return Js(t,e.next)}}}return null}function Sv(t,e){if(e!==null){let o=t[An][Sn],r=e.projection;return o.projection[r]}return null}function Zp(t,e){let n=Vt+t+1;if(n<e.length){let o=e[n],r=o[de].firstChild;if(r!==null)return Js(o,r)}return e[Kr]}function Ff(t,e,n,o,r,i,s){for(;n!=null;){let a=o[zo];if(n.type===128){n=n.next;continue}let c=o[n.index],l=n.type;if(s&&e===0&&(c&&Zi(dn(c),o),n.flags|=2),!Cf(n))if(l&8)Ff(t,e,n.child,o,r,i,!1),Wi(e,t,a,r,c,n,i,o);else if(l&32){let d=Of(n,o),f;for(;f=d();)Wi(e,t,a,r,f,n,i,o);Wi(e,t,a,r,c,n,i,o)}else l&16?LS(t,e,o,n,r,i):Wi(e,t,a,r,c,n,i,o);n=s?n.projectionNext:n.next}}function Nl(t,e,n,o,r,i){t.type===3?RS(n,o,e,r,i):Ff(n,o,t.firstChild,e,r,i,!1)}function RS(t,e,n,o,r){let s=n[de].firstChild,a=s.next,c=dn(n[s.index]),l=dn(n[a.index]),d=a.index+1,f=n[d];if(e===1||e===0)o!==null&&(f&&f.hasChildNodes()?oi(t,o,f,r,!0):(oi(t,o,c,r,!0),oi(t,o,l,r,!0)));else if(e===2){if(f||(f=document.createDocumentFragment(),n[d]=f),c&&c.parentNode===f)return;let y=c;for(;y!==null;){let v=y.nextSibling;if(f.appendChild(y),y===l)break;y=v}}}function LS(t,e,n,o,r,i){let s=n[An],c=s[Sn].projection[o.projection];if(Array.isArray(c))for(let l=0;l<c.length;l++){let d=c[l];Wi(e,t,n[zo],r,d,o,i,n)}else{let l=c,d=s[Bt];Ky(o)&&(l.flags|=128),Ff(t,e,l,d,r,i,!0)}}function FS(t,e,n,o,r,i,s){let a=o[Kr],c=dn(o);if(a!==c&&Wi(e,t,n,i,a,r,s),(o[ye]&4)===0)for(let l=Vt;l<o.length;l++){let d=o[l];Nl(d[de],d,t,e,i,a)}}function VS(t,e,n,o,r){if(e)r?t.addClass(n,o):t.removeClass(n,o);else{let i=o.indexOf("-")===-1?void 0:Wo.DashCase;r==null?t.removeStyle(n,o,i):(typeof r=="string"&&r.endsWith("!important")&&(r=r.slice(0,-10),i|=Wo.Important),t.setStyle(n,o,r,i))}}function Vf(t,e,n,o,r,i,s,a,c,l,d){let f=ln+o,y=f+r,v=jS(f,y),x=typeof l=="function"?l():l;return v[de]={type:t,blueprint:v,template:n,queries:null,viewQuery:a,declTNode:e,data:v.slice().fill(null,f),bindingStartIndex:f,expandoStartIndex:y,hostBindingOpCodes:null,firstCreatePass:!0,firstUpdatePass:!0,staticViewQueries:!1,staticContentQueries:!1,preOrderHooks:null,preOrderCheckHooks:null,contentHooks:null,contentCheckHooks:null,viewHooks:null,viewCheckHooks:null,destroyHooks:null,cleanup:null,contentQueries:null,components:null,directiveRegistry:typeof i=="function"?i():i,pipeRegistry:typeof s=="function"?s():s,firstChild:null,schemas:c,consts:x,incompleteFirstPass:!1,ssrId:d}}function jS(t,e){let n=[];for(let o=0;o<e;o++)n.push(o<t?null:Tn);return n}function $S(t){let e=t.tView;return e===null||e.incompleteFirstPass?t.tView=Vf(1,null,t.template,t.decls,t.vars,t.directiveDefs,t.pipeDefs,t.viewQuery,t.schemas,t.consts,t.id):e}function jf(t,e,n,o,r,i,s,a,c,l,d){let f=e.blueprint.slice();return f[uo]=r,f[ye]=o|4|128|8|64|1024,(l!==null||t&&t[ye]&2048)&&(f[ye]|=2048),lp(f),f[Bt]=f[dr]=t,f[Ft]=n,f[po]=s||t&&t[po],f[Dt]=a||t&&t[Dt],f[zo]=c||t&&t[zo]||null,f[Sn]=i,f[zs]=kw(),f[$i]=d,f[ip]=l,f[An]=e.type==2?t[An]:f,f}function HS(t,e,n){let o=Kn(e,t),r=$S(n),i=t[po].rendererFactory,s=$f(t,jf(t,r,null,Tv(n),o,e,null,i.createRenderer(o,n),null,null,null));return t[e.index]=s}function Tv(t){let e=16;return t.signals?e=4096:t.onPush&&(e=64),e}function Mv(t,e,n,o){if(n===0)return-1;let r=e.length;for(let i=0;i<n;i++)e.push(o),t.blueprint.push(o),t.data.push(null);return r}function $f(t,e){return t[Bi]?t[rp][Yn]=e:t[Bi]=e,t[rp]=e,e}function u(t=1){Iv(xn(),Ze(),fo()+t,!1)}function Iv(t,e,n,o){if(!o)if((e[ye]&3)===3){let i=t.preOrderCheckHooks;i!==null&&al(e,i,n)}else{let i=t.preOrderHooks;i!==null&&cl(e,i,0,n)}mr(n)}var Dl=(function(t){return t[t.None=0]="None",t[t.SignalBased=1]="SignalBased",t[t.HasDecoratorInputTransform=2]="HasDecoratorInputTransform",t})(Dl||{});function Kp(t,e,n,o){let r=ae(null);try{let[i,s,a]=t.inputs[n],c=null;(s&Dl.SignalBased)!==0&&(c=e[i][cn]),c!==null&&c.transformFn!==void 0?o=c.transformFn(o):a!==null&&(o=a.call(e,o)),t.setInput!==null?t.setInput(e,c,o,n,i):iw(e,c,i,o)}finally{ae(r)}}function kv(t,e,n,o,r){let i=fo(),s=o&2;try{mr(-1),s&&e.length>ln&&Iv(t,e,ln,!1);let a=s?ot.TemplateUpdateStart:ot.TemplateCreateStart;pt(a,r,n),n(o,r)}finally{mr(i);let a=s?ot.TemplateUpdateEnd:ot.TemplateCreateEnd;pt(a,r,n)}}function Nv(t,e,n){YS(t,e,n),(n.flags&64)===64&&ZS(t,e,n)}function Hf(t,e,n=Kn){let o=e.localNames;if(o!==null){let r=e.index+1;for(let i=0;i<o.length;i+=2){let s=o[i+1],a=s===-1?n(e,t):t[s];t[r++]=a}}}function BS(t,e,n,o){let i=o.get(rv,ov)||n===go.ShadowDom||n===go.ExperimentalIsolatedShadowDom,s=t.selectRootElement(e,i);return US(s),s}function US(t){zS(t)}var zS=()=>null;function qS(t){return t==="class"?"className":t==="for"?"htmlFor":t==="formaction"?"formAction":t==="innerHtml"?"innerHTML":t==="readonly"?"readOnly":t==="tabindex"?"tabIndex":t}function GS(t,e,n,o,r,i){let s=e[de];if(Bf(t,s,e,n,o)){fr(t)&&WS(e,t.index);return}t.type&3&&(n=qS(n)),Dv(t,e,n,o,r,i)}function Dv(t,e,n,o,r,i){if(t.type&3){let s=Kn(t,e);o=i!=null?i(o,t.value||"",n):o,r.setProperty(s,n,o)}else t.type&12}function WS(t,e){let n=Io(e,t);n[ye]&16||(n[ye]|=64)}function YS(t,e,n){let o=n.directiveStart,r=n.directiveEnd;fr(n)&&HS(e,n,t.data[o+n.componentOffset]),t.firstCreatePass||Uy(n,e);let i=n.initialInputs;for(let s=o;s<r;s++){let a=t.data[s],c=ml(e,t,s,n);if(Zi(c,e),i!==null&&eT(e,s-o,c,a,n,i),Xr(a)){let l=Io(n.index,e);l[Ft]=ml(e,t,s,n)}}}function ZS(t,e,n){let o=n.directiveStart,r=n.directiveEnd,i=n.index,s=Fg();try{mr(i);for(let a=o;a<r;a++){let c=t.data[a],l=e[a];Yc(a),(c.hostBindings!==null||c.hostVars!==0||c.hostAttrs!==null)&&KS(c,l)}}finally{mr(-1),Yc(s)}}function KS(t,e){t.hostBindings!==null&&t.hostBindings(1,e)}function QS(t,e){let n=t.directiveRegistry,o=null;if(n)for(let r=0;r<n.length;r++){let i=n[r];pS(e,i.selectors,!1)&&(o??=[],Xr(i)?o.unshift(i):o.push(i))}return o}function XS(t,e,n,o,r,i){let s=Kn(t,e);JS(e[Dt],s,i,t.value,n,o,r)}function JS(t,e,n,o,r,i,s){if(i==null)s?.(i,o||"",r),t.removeAttribute(e,r,n);else{let a=s==null?Gr(i):s(i,o||"",r);t.setAttribute(e,r,a,n)}}function eT(t,e,n,o,r,i){let s=i[e];if(s!==null)for(let a=0;a<s.length;a+=2){let c=s[a],l=s[a+1];Kp(o,n,c,l)}}function Ov(t,e,n,o,r){let i=ln+n,s=e[de],a=r(s,e,t,o,n);e[i]=a,zi(t,!0);let c=t.type===2;return c?(yv(e[Dt],a,t),(Tg()===0||Hc(t))&&Zi(a,e),Mg()):Zi(a,e),Xc()&&(!c||!Cf(t))&&Lf(s,e,a,t),t}function Pv(t){let e=t;return yp()?Dg():(e=e.parent,zi(e,!1)),e}function tT(t,e){let n=t[zo];if(!n)return;let o;try{o=n.get(ni,null)}catch{o=null}o?.(e)}function Bf(t,e,n,o,r){let i=t.inputs?.[o],s=t.hostDirectiveInputs?.[o],a=!1;if(s)for(let c=0;c<s.length;c+=2){let l=s[c],d=s[c+1],f=e.data[l];Kp(f,n[l],d,r),a=!0}if(i)for(let c of i){let l=n[c],d=e.data[c];Kp(d,l,o,r),a=!0}return a}function nT(t,e){let n=Io(e,t),o=n[de];oT(o,n);let r=n[uo];r!==null&&n[$i]===null&&(n[$i]=iv(r,n[zo])),pt(ot.ComponentStart);try{Uf(o,n,n[Ft])}finally{pt(ot.ComponentEnd,n[Ft])}}function oT(t,e){for(let n=e.length;n<t.blueprint.length;n++)e.push(t.blueprint[n])}function Uf(t,e,n){Kc(e);try{let o=t.viewQuery;o!==null&&Vp(1,o,n);let r=t.template;r!==null&&kv(t,e,r,1,n),t.firstCreatePass&&(t.firstCreatePass=!1),e[Mo]?.finishViewCreation(t),t.staticContentQueries&&sv(t,e),t.staticViewQueries&&Vp(2,t.viewQuery,n);let i=t.components;i!==null&&rT(e,i)}catch(o){throw t.firstCreatePass&&(t.incompleteFirstPass=!0,t.firstCreatePass=!1),o}finally{e[ye]&=-5,Qc()}}function rT(t,e){for(let n=0;n<e.length;n++)nT(t,e[n])}function Ol(t,e,n,o){let r=ae(null);try{let i=e.tView,a=t[ye]&4096?4096:16,c=jf(t,i,n,a,null,e,null,null,o?.injector??null,o?.embeddedViewInjector??null,o?.dehydratedView??null),l=t[e.index];c[ur]=l;let d=t[Mo];return d!==null&&(c[Mo]=d.createEmbeddedView(i)),Uf(i,c,n),c}finally{ae(r)}}function na(t,e){return!e||e.firstChild===null||Ky(t)}function oa(t,e,n,o,r=!1){if(t.type===3){let i=t.firstChild,s=i.next,a=dn(e[i.index]),c=dn(e[s.index]),l=a;for(;l!==null&&(o.push(l),l!==c);)l=l.nextSibling;return o}for(;n!==null;){if(n.type===128){n=r?n.projectionNext:n.next;continue}let i=e[n.index];if(i!==null)if(Zn(i)){let a=i[Kr];a!==i[uo]&&o.push(dn(i)),i[ye]&4||Av(i,o),o.push(a)}else o.push(dn(i));let s=n.type;if(s&8)oa(t,e,n.child,o);else if(s&32){let a=Of(n,e),c;for(;c=a();)o.push(c)}else if(s&16){let a=Sv(e,n);if(Array.isArray(a))o.push(...a);else{let c=Uo(e[An]);oa(c[de],c,a,o,!0)}}n=r?n.projectionNext:n.next}return o}function Av(t,e){for(let n=Vt;n<t.length;n++){let o=t[n],r=o[de].firstChild;r!==null&&oa(o[de],o,r,e)}}function Rv(t){if(t[Zr]!==null){for(let e of t[Zr])e.impl.addSequence(e);t[Zr].length=0}}var Lv=[];function iT(t){return t[Rn]??sT(t)}function sT(t){let e=Lv.pop()??Object.create(cT);return e.lView=t,e}function aT(t){t.lView[Rn]!==t&&(t.lView=null,Lv.push(t))}var cT=Q(H({},Pr),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:t=>{ei(t.lView)},consumerOnSignalRead(){this.lView[Rn]=this}});function lT(t){let e=t[Rn]??Object.create(dT);return e.lView=t,e}var dT=Q(H({},Pr),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:t=>{let e=Uo(t.lView);for(;e&&!Fv(e[de]);)e=Uo(e);e&&dp(e)},consumerOnSignalRead(){this.lView[Rn]=this}});function Fv(t){return t.type!==2}function Vv(t){if(t[Bo]===null)return;let e=!0;for(;e;){let n=!1;for(let o of t[Bo])if(o.dirty&&(n=!0,o.zone===null||Zone.current===o.zone?o.run():o.zone.run(()=>o.run()),t[Bo]===null))return;e=n&&!!(t[ye]&8192)}}var uT=100;function jv(t,e=0){let o=t[po].rendererFactory,r=!1;r||o.begin?.();try{pT(t,e)}finally{r||o.end?.()}}function pT(t,e){let n=vp();try{Vs(!0),Qp(t,e);let o=0;for(;Ws(t);){if(o===uT)throw new Ie(103,!1);o++,Qp(t,1)}}finally{Vs(n)}}function fT(t,e,n,o){if(Jr(e))return;let r=e[ye],i=!1,s=!1;Kc(e);let a=!0,c=null,l=null;i||(Fv(t)?(l=iT(e),c=Rr(l)):dc()===null?(a=!1,l=lT(e),c=Rr(l)):e[Rn]&&(Lr(e[Rn]),e[Rn]=null));try{lp(e),Ag(t.bindingStartIndex),n!==null&&kv(t,e,n,2,o);let d=(r&3)===3;if(!i)if(d){let v=t.preOrderCheckHooks;v!==null&&al(e,v,null)}else{let v=t.preOrderHooks;v!==null&&cl(e,v,0,null),Ip(e,0)}if(s||mT(e),Vv(e),$v(e,0),t.contentQueries!==null&&sv(t,e),!i)if(d){let v=t.contentCheckHooks;v!==null&&al(e,v)}else{let v=t.contentHooks;v!==null&&cl(e,v,1),Ip(e,1)}gT(t,e);let f=t.components;f!==null&&Bv(e,f,0);let y=t.viewQuery;if(y!==null&&Vp(2,y,o),!i)if(d){let v=t.viewCheckHooks;v!==null&&al(e,v)}else{let v=t.viewHooks;v!==null&&cl(e,v,2),Ip(e,2)}if(t.firstUpdatePass===!0&&(t.firstUpdatePass=!1),e[$c]){for(let v of e[$c])v();e[$c]=null}i||(Rv(e),e[ye]&=-73)}catch(d){let f=!1,y=d,v=e;for(;v!==null;){if(Zn(v)){v=v[Bt];continue}let x=v[qs];if(x)try{let C=e[An][Ft],P=C?.constructor,Y={declarationInstance:C,declarationType:P,caughtBy:x};x(Kg(y),Y),f=!0;break}catch(C){y=C}v=v[Bt]}if(!f)throw i||ei(e),y}finally{l!==null&&(Ii(l,c),a&&aT(l)),Qc()}}function $v(t,e){for(let n=Xy(t);n!==null;n=Jy(n))for(let o=Vt;o<n.length;o++){let r=n[o];Hv(r,e)}}function mT(t){for(let e=Xy(t);e!==null;e=Jy(e)){if(!(e[ye]&2))continue;let n=e[Qr];for(let o=0;o<n.length;o++){let r=n[o];dp(r)}}}function hT(t,e,n){pt(ot.ComponentStart);let o=Io(e,t);try{Hv(o,n)}finally{pt(ot.ComponentEnd,o[Ft])}}function Hv(t,e){zc(t)&&Qp(t,e)}function Qp(t,e){let o=t[de],r=t[ye],i=t[Rn],s=!!(e===0&&r&16);if(s||=!!(r&64&&e===0),s||=!!(r&1024),s||=!!(i?.dirty&&Ds(i)),s||=!1,i&&(i.dirty=!1),t[ye]&=-9217,s)fT(o,t,o.template,t[Ft]);else if(r&8192){let a=ae(null);try{Vv(t),$v(t,1);let c=o.components;c!==null&&Bv(t,c,1),Rv(t)}finally{ae(a)}}}function Bv(t,e,n){for(let o=0;o<e.length;o++)hT(t,e[o],n)}function gT(t,e){let n=t.hostBindingOpCodes;if(n!==null)try{for(let o=0;o<n.length;o++){let r=n[o];if(r<0)mr(~r);else{let i=r,s=n[++o],a=n[++o];Lg(s,i);let c=e[i];pt(ot.HostBindingsUpdateStart,c);try{a(2,c)}finally{pt(ot.HostBindingsUpdateEnd,c)}}}}finally{mr(-1)}}function zf(t,e){let n=vp()?64:1088;for(t[po].changeDetectionScheduler?.notify(e);t;){t[ye]|=n;let o=Uo(t);if(Ui(t)&&!o)return t;t=o}return null}function Uv(t,e,n,o){return[t,!0,0,e,null,o,null,n,null,null]}function zv(t,e){let n=Vt+e;if(n<t.length)return t[n]}function Pl(t,e,n,o=!0){let r=e[de];if(yT(r,e,t,n),o){let s=Zp(n,t),a=e[Dt],c=a.parentNode(t[Kr]);c!==null&&TS(r,t[Sn],a,e,c,s)}let i=e[$i];i!==null&&i.firstChild!==null&&(i.firstChild=null)}function qv(t,e){let n=ra(t,e);return n!==void 0&&kl(n[de],n),n}function ra(t,e){if(t.length<=Vt)return;let n=Vt+e,o=t[n];if(o){let r=o[ur];r!==null&&r!==t&&Rf(r,o),e>0&&(t[n-1][Yn]=o[Yn]);let i=Hs(t,Vt+e);SS(o[de],o);let s=i[Mo];s!==null&&s.detachView(i[de]),o[Bt]=null,o[Yn]=null,o[ye]&=-129}return o}function yT(t,e,n,o){let r=Vt+o,i=n.length;o>0&&(n[r-1][Yn]=e),o<i-Vt?(e[Yn]=n[r],ep(n,Vt+o,e)):(n.push(e),e[Yn]=null),e[Bt]=n;let s=e[ur];s!==null&&n!==s&&Gv(s,e);let a=e[Mo];a!==null&&a.insertView(t),qc(e),e[ye]|=128}function Gv(t,e){let n=t[Qr],o=e[Bt];if(pr(o))t[ye]|=2;else{let r=o[Bt][An];e[An]!==r&&(t[ye]|=2)}n===null?t[Qr]=[e]:n.push(e)}var Ki=class{_lView;_cdRefInjectingView;_appRef=null;_attachedToViewContainer=!1;exhaustive;get rootNodes(){let e=this._lView,n=e[de];return oa(n,e,n.firstChild,[])}constructor(e,n){this._lView=e,this._cdRefInjectingView=n}get context(){return this._lView[Ft]}set context(e){this._lView[Ft]=e}get destroyed(){return Jr(this._lView)}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){let e=this._lView[Bt];if(Zn(e)){let n=e[Gs],o=n?n.indexOf(this):-1;o>-1&&(ra(e,o),Hs(n,o))}this._attachedToViewContainer=!1}kl(this._lView[de],this._lView)}onDestroy(e){Gc(this._lView,e)}markForCheck(){zf(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[ye]&=-129}reattach(){qc(this._lView),this._lView[ye]|=128}detectChanges(){this._lView[ye]|=1024,jv(this._lView)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new Ie(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;let e=Ui(this._lView),n=this._lView[ur];n!==null&&!e&&Rf(n,this._lView),wv(this._lView[de],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new Ie(902,!1);this._appRef=e;let n=Ui(this._lView),o=this._lView[ur];o!==null&&!n&&Gv(o,this._lView),qc(this._lView)}};var ia=(()=>{class t{_declarationLView;_declarationTContainer;elementRef;static __NG_ELEMENT_ID__=vT;constructor(n,o,r){this._declarationLView=n,this._declarationTContainer=o,this.elementRef=r}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(n,o){return this.createEmbeddedViewImpl(n,o)}createEmbeddedViewImpl(n,o,r){let i=Ol(this._declarationLView,this._declarationTContainer,n,{embeddedViewInjector:o,dehydratedView:r});return new Ki(i)}}return t})();function vT(){return qf(Qn(),Ze())}function qf(t,e){return t.type&4?new ia(e,t,Ji(t,e)):null}function Al(t,e,n,o,r){let i=t.data[e];if(i===null)i=_T(t,e,n,o,r),Rg()&&(i.flags|=32);else if(i.type&64){i.type=n,i.value=o,i.attrs=r;let s=Ng();i.injectorIndex=s===null?-1:s.injectorIndex}return zi(i,!0),i}function _T(t,e,n,o,r){let i=gp(),s=yp(),a=s?i:i&&i.parent,c=t.data[e]=xT(t,a,n,e,o,r);return bT(t,c,i,s),c}function bT(t,e,n,o){t.firstChild===null&&(t.firstChild=e),n!==null&&(o?n.child==null&&e.parent!==null&&(n.child=e):n.next===null&&(n.next=e,e.prev=n))}function xT(t,e,n,o,r,i){let s=e?e.injectorIndex:-1,a=0;return kg()&&(a|=128),{type:n,index:o,insertBeforeIndex:null,injectorIndex:s,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,controlDirectiveIndex:-1,customControlIndex:-1,propertyBindings:null,flags:a,providerIndexes:0,value:r,namespace:xp(),attrs:i,mergedAttrs:null,localNames:null,initialInputs:null,inputs:null,hostDirectiveInputs:null,outputs:null,hostDirectiveOutputs:null,directiveToIndex:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:e,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}function ET(t){let e=t[sp]??[],o=t[Bt][Dt],r=[];for(let i of e)i.data[nv]!==void 0?r.push(i):CT(i,o);t[sp]=r}function CT(t,e){let n=0,o=t.firstChild;if(o){let r=t.data[tv];for(;n<r;){let i=o.nextSibling;gv(e,o,!1),o=i,n++}}}var wT=()=>null,ST=()=>null;function Xp(t,e){return wT(t,e)}function Wv(t,e,n){return ST(t,e,n)}var Yv=class{},Yo=class{};var Zv=(()=>{class t{static \u0275prov=Oe({token:t,providedIn:"root",factory:()=>null})}return t})();function Kv(t){return t.debugInfo?.className||t.type.name||null}var dl={},yl=class{injector;parentInjector;constructor(e,n){this.injector=e,this.parentInjector=n}get(e,n,o){let r=this.injector.get(e,dl,o);return r!==dl||n===dl?r:this.parentInjector.get(e,n,o)}};function TT(t,e,n){return t[e]=n}function MT(t,e){return t[e]}function Do(t,e,n){if(n===Tn)return!1;let o=t[e];return Object.is(o,n)?!1:(t[e]=n,!0)}function IT(t,e,n,o){let r=Do(t,e,n);return Do(t,e+1,o)||r}function ul(t,e,n){return function o(r){let i=o.__ngNativeEl__;i!==void 0&&Dw(r,i);let s=fr(t)?Io(t.index,e):e;zf(s,5);let a=e[Ft],c=xy(e,a,n,r),l=o.__ngNextListenerFn__;for(;l;)c=xy(e,a,l,r)&&c,l=l.__ngNextListenerFn__;return c}}function xy(t,e,n,o){let r=ae(null);try{return pt(ot.OutputStart,e,n),n(o)!==!1}catch(i){return tT(t,i),!1}finally{pt(ot.OutputEnd,e,n),ae(r)}}function Qv(t,e,n,o,r,i,s,a){let c=Hc(t),l=!1,d=null;if(!o&&c&&(d=NT(e,n,i,t.index)),d!==null){let f=d.__ngLastListenerFn__||d;f.__ngNextListenerFn__=s,d.__ngLastListenerFn__=s,l=!0}else{let f=Kn(t,n),y=o?o(f):f;Pw(n,y,i,a),o||(a.__ngNativeEl__=f);let v=r.listen(y,i,a);if(!kT(i)){let x=o?C=>o(dn(C[t.index])):t.index;Xv(x,e,n,i,a,v,!1)}}return l}function kT(t){return t.startsWith("animation")||t.startsWith("transition")}function NT(t,e,n,o){let r=t.cleanup;if(r!=null)for(let i=0;i<r.length-1;i+=2){let s=r[i];if(s===n&&r[i+1]===o){let a=e[Hi],c=r[i+2];return a&&a.length>c?a[c]:null}typeof s=="string"&&(i+=2)}return null}function Xv(t,e,n,o,r,i,s){let a=e.firstCreatePass?pp(e):null,c=up(n),l=c.length;c.push(r,i),a&&a.push(o,t,l,(l+1)*(s?-1:1))}function Ey(t,e,n,o,r,i){let s=e[n],a=e[de],l=a.data[n].outputs[o],f=s[l].subscribe(i);Xv(t.index,a,e,r,i,f,!0)}var Jp=Symbol("BINDING");var ai=new ze("");function vl(t,e,n){let o=n?t.styles:null,r=n?t.classes:null,i=0;if(e!==null)for(let s=0;s<e.length;s++){let a=e[s];if(typeof a=="number")i=a;else if(i==1)r=Ic(r,a);else if(i==2){let c=a,l=e[++s];o=Ic(o,c+": "+l+";")}}n?t.styles=o:t.stylesWithoutHost=o,n?t.classes=r:t.classesWithoutHost=r}function Jv(t,e=0){let n=Ze();if(n===null)return lt(t,e);let o=Qn();return Wy(o,n,Pn(t),e)}function DT(t,e,n,o,r){let i=o===null?null:{"":-1},s=r(t,n);if(s!==null){let a=s,c=null,l=null;for(let d of s)if(d.resolveHostDirectives!==null){[a,c,l]=d.resolveHostDirectives(s);break}AT(t,e,n,a,i,c,l)}i!==null&&o!==null&&OT(n,o,i)}function OT(t,e,n){let o=t.localNames=[];for(let r=0;r<e.length;r+=2){let i=n[e[r+1]];if(i==null)throw new Ie(-301,!1);o.push(e[r],i)}}function PT(t,e,n){e.componentOffset=n,(t.components??=[]).push(e.index)}function AT(t,e,n,o,r,i,s){let a=o.length,c=null;for(let y=0;y<a;y++){let v=o[y];c===null&&Xr(v)&&(c=v,PT(t,n,y)),bw(Uy(n,e),t,v.type)}$T(n,t.data.length,a),c?.viewProvidersResolver&&c.viewProvidersResolver(c);for(let y=0;y<a;y++){let v=o[y];v.providersResolver&&v.providersResolver(v)}let l=!1,d=!1,f=Mv(t,e,a,null);a>0&&(n.directiveToIndex=new Map);for(let y=0;y<a;y++){let v=o[y];if(n.mergedAttrs=Sl(n.mergedAttrs,v.hostAttrs),LT(t,n,e,f,v),jT(f,v,r),s!==null&&s.has(v)){let[C,P]=s.get(v);n.directiveToIndex.set(v.type,[f,C+n.directiveStart,P+n.directiveStart])}else(i===null||!i.has(v))&&n.directiveToIndex.set(v.type,f);v.contentQueries!==null&&(n.flags|=4),(v.hostBindings!==null||v.hostAttrs!==null||v.hostVars!==0)&&(n.flags|=64);let x=v.type.prototype;!l&&(x.ngOnChanges||x.ngOnInit||x.ngDoCheck)&&((t.preOrderHooks??=[]).push(n.index),l=!0),!d&&(x.ngOnChanges||x.ngDoCheck)&&((t.preOrderCheckHooks??=[]).push(n.index),d=!0),f++}RT(t,n,i)}function RT(t,e,n){for(let o=e.directiveStart;o<e.directiveEnd;o++){let r=t.data[o];if(n===null||!n.has(r))Cy(0,e,r,o),Cy(1,e,r,o),Sy(e,o,!1);else{let i=n.get(r);wy(0,e,i,o),wy(1,e,i,o),Sy(e,o,!0)}}}function Cy(t,e,n,o){let r=t===0?n.inputs:n.outputs;for(let i in r)if(Object.hasOwn(r,i)){let s;t===0?s=e.inputs??={}:s=e.outputs??={},s[i]??=[],s[i].push(o),e_(e,i)}}function wy(t,e,n,o){let r=t===0?n.inputs:n.outputs;for(let i in r)if(Object.hasOwn(r,i)){let s=r[i],a;t===0?a=e.hostDirectiveInputs??={}:a=e.hostDirectiveOutputs??={},a[s]??=[],a[s].push(o,i),e_(e,s)}}function e_(t,e){e==="class"?t.flags|=8:e==="style"&&(t.flags|=16)}function Sy(t,e,n){let{attrs:o,inputs:r,hostDirectiveInputs:i}=t;if(o===null||!n&&r===null||n&&i===null||Df(t)){t.initialInputs??=[],t.initialInputs.push(null);return}let s=null,a=0;for(;a<o.length;){let c=o[a];if(c===0){a+=4;continue}else if(c===5){a+=2;continue}else if(typeof c=="number")break;if(!n&&Object.hasOwn(r,c)){let l=r[c];for(let d of l)if(d===e){s??=[],s.push(c,o[a+1]);break}}else if(n&&Object.hasOwn(i,c)){let l=i[c];for(let d=0;d<l.length;d+=2)if(l[d]===e){s??=[],s.push(l[d+1],o[a+1]);break}}a+=2}t.initialInputs??=[],t.initialInputs.push(s)}function LT(t,e,n,o,r){t.data[o]=r;let i=r.factory||(r.factory=Ri(r.type,!0)),s=new ta(i,Xr(r),Jv,null);t.blueprint[o]=s,n[o]=s,FT(t,e,o,Mv(t,n,r.hostVars,Tn),r)}function FT(t,e,n,o,r){let i=r.hostBindings;if(i){let s=t.hostBindingOpCodes;s===null&&(s=t.hostBindingOpCodes=[]);let a=~e.index;VT(s)!=a&&s.push(a),s.push(n,o,i)}}function VT(t){let e=t.length;for(;e>0;){let n=t[--e];if(typeof n=="number"&&n<0)return n}return 0}function jT(t,e,n){if(n){if(e.exportAs)for(let o=0;o<e.exportAs.length;o++)n[e.exportAs[o]]=t;Xr(e)&&(n[""]=t)}}function $T(t,e,n){t.flags|=1,t.directiveStart=e,t.directiveEnd=e+n,t.providerIndexes=e}function t_(t,e,n,o,r,i,s,a){let c=e[de],l=c.consts,d=ko(l,s),f=Al(c,t,n,o,d);return i&&DT(c,e,f,ko(l,a),r),f.mergedAttrs=Sl(f.mergedAttrs,f.attrs),f.attrs!==null&&vl(f,f.attrs,!1),f.mergedAttrs!==null&&vl(f,f.mergedAttrs,!0),c.queries!==null&&c.queries.elementStart(c,f),f}function n_(t,e){lw(t,e),ap(e)&&t.queries.elementEnd(e)}function HT(t,e,n,o,r,i){let s=e.consts,a=ko(s,r),c=Al(e,t,n,o,a);if(c.mergedAttrs=Sl(c.mergedAttrs,c.attrs),i!=null){let l=ko(s,i);c.localNames=[];for(let d=0;d<l.length;d+=2)c.localNames.push(l[d],-1)}return c.attrs!==null&&vl(c,c.attrs,!1),c.mergedAttrs!==null&&vl(c,c.mergedAttrs,!0),e.queries!==null&&e.queries.elementStart(e,c),c}var o_=typeof ShadowRoot<"u",BT=typeof Document<"u";function UT(t){return Object.keys(t).map(e=>{let[n,o,r]=t[e],i={propName:n,templateName:e,isSignal:(o&Dl.SignalBased)!==0};return r&&(i.transform=r),i})}function zT(t){return Object.keys(t).map(e=>({propName:t[e],templateName:e}))}function qT(t,e,n){let o=e instanceof lo?e:e?.injector;return o&&t.getStandaloneInjector!==null&&(o=t.getStandaloneInjector(o)||o),o?new yl(n,o):n}function GT(t){let e=t.get(Yo,null);if(e===null)throw new Ie(407,!1);let n=t.get(Zv,null),o=t.get(cr,null),r=t.get(Qo,null,{optional:!0});return{rendererFactory:e,sanitizer:n,changeDetectionScheduler:o,ngReflect:!1,tracingService:r}}function WT(t,e,n){let o=r_(t);return mv(e,o,o==="svg"?Ur:o==="math"?Bc:n)}function YT(t){if((t&&"localName"in t&&typeof t.localName=="string"?t.localName:t?.tagName)?.toLowerCase()==="script")throw new Ie(905,!1)}function r_(t){return(t.selectors[0][0]||"div").toLowerCase()}var sa=class{componentDef;ngModule;selector;componentType;ngContentSelectors;isBoundToModule;cachedInputs=null;cachedOutputs=null;get inputs(){return this.cachedInputs??=UT(this.componentDef.inputs),this.cachedInputs}get outputs(){return this.cachedOutputs??=zT(this.componentDef.outputs),this.cachedOutputs}constructor(e,n){this.componentDef=e,this.ngModule=n,this.componentType=e.type,this.selector=gS(e.selectors),this.ngContentSelectors=e.ngContentSelectors??[],this.isBoundToModule=!!n}create(e,n,o,r,i,s,a,c){pt(ot.DynamicComponentStart);let l=ae(null);try{let d=this.componentDef,f=qT(d,r||this.ngModule,e),y=GT(f),v=y.tracingService;return v&&v.componentCreate?v.componentCreate(Kv(d),()=>this.createComponentRef(y,f,n,o,i,s,a,c)):this.createComponentRef(y,f,n,o,i,s,a,c)}finally{ae(l)}}createComponentRef(e,n,o,r,i,s,a,c){let l=this.componentDef,d=ZT(r,l,s,i,c),f=e.rendererFactory.createRenderer(null,l),y=r?BS(f,r,l.encapsulation,n):WT(l,f,a??null);YT(y);let v=n.get(ai,null),x=KT(y,()=>n.get(En,null)??Ef());v&&v.addHost(x);let C=s?.some(Ty)||i?.some(G=>typeof G!="function"&&G.bindings.some(Ty)),P=jf(null,d,null,512|Tv(l),null,null,e,f,n,null,iv(y,n,!0));v&&o_&&x instanceof ShadowRoot&&Gc(P,()=>{v.removeHost(x)}),P[ln]=y,Kc(P);let Y=null;try{let G=t_(ln,P,2,"#host",()=>d.directiveRegistry,!0,0);yv(f,y,G),Zi(y,P),Nv(d,P,G),av(d,G,P),n_(d,G),o!==void 0&&XT(G,this.ngContentSelectors,o),Y=Io(G.index,P),P[Ft]=Y[Ft],Uf(d,P,null)}catch(G){throw Y!==null&&Lp(Y),Lp(P),G}finally{pt(ot.DynamicComponentEnd),Qc()}return new _l(this.componentType,P,!!C)}};function ZT(t,e,n,o,r){let i=t?["ng-version","22.2.1"]:yS(e.selectors[0]),s=null,a=null,c=0;if(n)for(let f of n)c+=f[Jp].requiredVars,f.create&&(f.targetIdx=0,(s??=[]).push(f)),f.update&&(f.targetIdx=0,(a??=[]).push(f));if(o)for(let f=0;f<o.length;f++){let y=o[f];if(typeof y!="function")for(let v of y.bindings){c+=v[Jp].requiredVars;let x=f+1;v.create&&(v.targetIdx=x,(s??=[]).push(v)),v.update&&(v.targetIdx=x,(a??=[]).push(v))}}let l=[e];if(o)for(let f of o){let y=typeof f=="function"?f:f.type,v=Oc(y);l.push(v)}return Vf(0,null,QT(s,a),1,c,l,null,null,null,[i],null)}function KT(t,e){let n=t.getRootNode?.();return BT&&n instanceof Document?n.head:n&&o_&&n instanceof ShadowRoot?n:e().head}function QT(t,e){return!t&&!e?null:n=>{if(n&1&&t)for(let o of t)o.create();if(n&2&&e)for(let o of e)o.update()}}function Ty(t){let e=t[Jp].kind;return e==="input"||e==="twoWay"}var _l=class extends Yv{_rootLView;_hasInputBindings;instance;hostView;changeDetectorRef;componentType;location;previousInputValues=null;_tNode;constructor(e,n,o){super(),this._rootLView=n,this._hasInputBindings=o,this._tNode=Uc(n[de],ln),this.location=Ji(this._tNode,n),this.instance=Io(this._tNode.index,n)[Ft],this.hostView=this.changeDetectorRef=new Ki(n,void 0),this.componentType=e}setInput(e,n){this._hasInputBindings;let o=this._tNode;if(this.previousInputValues??=new Map,this.previousInputValues.has(e)&&Object.is(this.previousInputValues.get(e),n))return;let r=this._rootLView,i=Bf(o,r[de],r,e,n);this.previousInputValues.set(e,n);let s=Io(o.index,r);zf(s,1)}get injector(){return new qo(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}};function XT(t,e,n){let o=t.projection=[];for(let r=0;r<e.length;r++){let i=n[r];o.push(i!=null&&i.length?Array.from(i):null)}}var Rl=(()=>{class t{static __NG_ELEMENT_ID__=JT}return t})();function JT(){let t=Qn();return i_(t,Ze())}var ef=class t extends Rl{_lContainer;_hostTNode;_hostLView;constructor(e,n,o){super(),this._lContainer=e,this._hostTNode=n,this._hostLView=o}get element(){return Ji(this._hostTNode,this._hostLView)}get injector(){return new qo(this._hostTNode,this._hostLView)}get parentInjector(){let e=_f(this._hostTNode,this._hostLView);if($y(e)){let n=fl(e,this._hostLView),o=pl(e),r=n[de].data[o+8];return new qo(r,n)}else return new qo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){let n=My(this._lContainer);return n!==null&&n[e]||null}get length(){return this._lContainer.length-Vt}createEmbeddedView(e,n,o){let r,i,s;typeof o=="number"?r=o:o!=null&&(r=o.index,i=o.injector,s=o.onError);let a=Xp(this._lContainer,e.ssrId),c=e.createEmbeddedViewImpl(n||{},i,a);return s&&(c._lView[qs]=s),this.insertImpl(c,r,na(this._hostTNode,a)),c}createComponent(e,n,o,r,i,s,a){let c,l,d=n||{};c=d.index,o=d.injector,r=d.projectableNodes,i=d.environmentInjector||d.ngModuleRef,s=d.directives,a=d.bindings,l=d.onError;let f=new sa(qr(e)),y=o||this.parentInjector;if(!i&&f.ngModule==null){let G=this.parentInjector.get(lo,null);G&&(i=G)}let v=qr(f.componentType??{}),x=Xp(this._lContainer,v?.id??null),C=x?.firstChild??null,P=f.create(y,r,C,i,s,a,this._getHostElementNamespace());return l&&(P.hostView._lView[qs]=l),this.insertImpl(P.hostView,c,na(this._hostTNode,x)),P}_getHostElementNamespace(){if(this._hostTNode.type&2){let e=this._hostTNode.parent??this._hostLView[Sn];return e!==null&&e.type&2&&typeof e.value=="string"&&e.value.toLowerCase()==="foreignobject"?null:e?.namespace??null}return this._hostTNode.namespace}insert(e,n){return this.insertImpl(e,n,!0)}insertImpl(e,n,o){let r=e._lView;if(Eg(r)){let a=this.indexOf(e);if(a!==-1)this.detach(a);else{let c=r[Bt],l=new t(c,c[Sn],c[Bt]);l.detach(l.indexOf(e))}}let i=this._adjustIndex(n),s=this._lContainer;return Pl(s,r,i,o),e.attachToViewContainerRef(),ep(Dp(s),i,e),e}move(e,n){return this.insert(e,n)}indexOf(e){let n=My(this._lContainer);return n!==null?n.indexOf(e):-1}remove(e){let n=this._adjustIndex(e,-1),o=ra(this._lContainer,n);o&&(Hs(Dp(this._lContainer),n),kl(o[de],o))}detach(e){let n=this._adjustIndex(e,-1),o=ra(this._lContainer,n);return o&&Hs(Dp(this._lContainer),n)!=null?new Ki(o):null}_adjustIndex(e,n=0){return e??this.length+n}};function My(t){return t[Gs]}function Dp(t){return t[Gs]||(t[Gs]=[])}function i_(t,e){let n,o=e[t.index];return Zn(o)?n=o:(n=Uv(o,e,null,t),e[t.index]=n,$f(e,n)),t1(n,e,t,o),new ef(n,t,e)}function e1(t,e){let n=t[Dt],o=n.createComment(""),r=Kn(e,t),i=n.parentNode(r);return oi(n,i,o,n.nextSibling(r),!1),o}var t1=r1,n1=()=>!1;function o1(t,e,n){return n1(t,e,n)}function r1(t,e,n,o){if(t[Kr])return;let r;n.type&8?r=dn(o):r=e1(e,n),t[Kr]=r}var tf=class t{queryList;matches=null;constructor(e){this.queryList=e}clone(){return new t(this.queryList)}setDirty(){this.queryList.setDirty()}},nf=class t{queries;constructor(e=[]){this.queries=e}createEmbeddedView(e){let n=e.queries;if(n!==null){let o=e.contentQueries!==null?e.contentQueries[0]:n.length,r=[];for(let i=0;i<o;i++){let s=n.getByIndex(i),a=this.queries[s.indexInDeclarationView];r.push(a.clone())}return new t(r)}return null}insertView(e){this.dirtyQueriesWithMatches(e)}detachView(e){this.dirtyQueriesWithMatches(e)}finishViewCreation(e){this.dirtyQueriesWithMatches(e)}dirtyQueriesWithMatches(e){for(let n=0;n<this.queries.length;n++)c_(e,n).matches!==null&&this.queries[n].setDirty()}},of=class{flags;read;predicate;constructor(e,n,o=null){this.flags=n,this.read=o,typeof e=="string"?this.predicate=u1(e):this.predicate=e}},rf=class t{queries;constructor(e=[]){this.queries=e}elementStart(e,n){for(let o=0;o<this.queries.length;o++)this.queries[o].elementStart(e,n)}elementEnd(e){for(let n=0;n<this.queries.length;n++)this.queries[n].elementEnd(e)}embeddedTView(e){let n=null;for(let o=0;o<this.length;o++){let r=n!==null?n.length:0,i=this.getByIndex(o).embeddedTView(e,r);i&&(i.indexInDeclarationView=o,n!==null?n.push(i):n=[i])}return n!==null?new t(n):null}template(e,n){for(let o=0;o<this.queries.length;o++)this.queries[o].template(e,n)}getByIndex(e){return this.queries[e]}get length(){return this.queries.length}track(e){this.queries.push(e)}},sf=class t{metadata;matches=null;indexInDeclarationView=-1;crossesNgTemplate=!1;_declarationNodeIndex;_appliesToNextNode=!0;constructor(e,n=-1){this.metadata=e,this._declarationNodeIndex=n}elementStart(e,n){this.isApplyingToNode(n)&&this.matchTNode(e,n)}elementEnd(e){this._declarationNodeIndex===e.index&&(this._appliesToNextNode=!1)}template(e,n){this.elementStart(e,n)}embeddedTView(e,n){return this.isApplyingToNode(e)?(this.crossesNgTemplate=!0,this.addMatch(-e.index,n),new t(this.metadata)):null}isApplyingToNode(e){if(this._appliesToNextNode&&(this.metadata.flags&1)!==1){let n=this._declarationNodeIndex,o=e.parent;for(;o!==null&&o.type&8&&o.index!==n;)o=o.parent;return n===(o!==null?o.index:-1)}return this._appliesToNextNode}matchTNode(e,n){let o=this.metadata.predicate;if(Array.isArray(o))for(let r=0;r<o.length;r++){let i=o[r];this.matchTNodeWithReadOption(e,n,i1(n,i)),this.matchTNodeWithReadOption(e,n,ll(n,e,i,!1,!1))}else o===ia?n.type&4&&this.matchTNodeWithReadOption(e,n,-1):this.matchTNodeWithReadOption(e,n,ll(n,e,o,!1,!1))}matchTNodeWithReadOption(e,n,o){if(o!==null){let r=this.metadata.read;if(r!==null)if(r===Zt||r===Rl||r===Gn||r===ia&&n.type&4)this.addMatch(n.index,-2);else{let i=ll(n,e,r,!1,!1);i!==null&&this.addMatch(n.index,i)}else this.addMatch(n.index,o)}}addMatch(e,n){this.matches===null?this.matches=[e,n]:this.matches.push(e,n)}};function i1(t,e){let n=t.localNames;if(n!==null){for(let o=0;o<n.length;o+=2)if(n[o]===e)return n[o+1]}return null}function s1(t,e){return t.type&11?Ji(t,e):t.type&4?qf(t,e):null}function a1(t,e,n,o){return n===-1?s1(e,t):n===-2?c1(t,e,o):ml(t,t[de],n,e)}function c1(t,e,n){if(n===Zt)return Ji(e,t);if(n===ia)return qf(e,t);if(n===Rl)return i_(e,t);if(n===Gn)return new qo(e,t)}function s_(t,e,n,o){let r=e[Mo].queries[o];if(r.matches===null){let i=t.data,s=n.matches,a=[];for(let c=0;s!==null&&c<s.length;c+=2){let l=s[c];if(l<0)a.push(null);else{let d=i[l];a.push(a1(e,d,s[c+1],n.metadata.read))}}r.matches=a}return r.matches}function af(t,e,n,o){let r=t.queries.getByIndex(n),i=r.matches;if(i!==null){let s=s_(t,e,r,n);for(let a=0;a<i.length;a+=2){let c=i[a];if(c>0)o.push(s[a/2]);else{let l=i[a+1],d=e[-c];for(let f=Vt;f<d.length;f++){let y=d[f];y[ur]===y[Bt]&&af(y[de],y,l,o)}if(d[Qr]!==null){let f=d[Qr];for(let y=0;y<f.length;y++){let v=f[y];af(v[de],v,l,o)}}}}}return o}function a_(t,e){return t[Mo].queries[e].queryList}function l1(t,e,n){let o=new hl((n&4)===4);return Sg(t,e,o,o.destroy),(e[Mo]??=new nf).queries.push(new tf(o))-1}function d1(t,e,n){let o=xn();return o.firstCreatePass&&(p1(o,new of(t,e,n),-1),(e&2)===2&&(o.staticViewQueries=!0)),l1(o,Ze(),e)}function u1(t){return t.split(",").map(e=>e.trim())}function p1(t,e,n){t.queries===null&&(t.queries=new rf),t.queries.track(new sf(e,n))}function c_(t,e){return t.queries.getByIndex(e)}function f1(t,e){let n=t[de],o=c_(n,e);return o.crossesNgTemplate?af(n,t,e,[]):s_(n,t,o,e)}function Gf(t,e,n){let o,r=Os(()=>{o._dirtyCounter();let i=h1(o,t);if(e&&i===void 0)throw new Ie(-951,!1);return i});return o=r[cn],o._dirtyCounter=R(0),o._flatValue=void 0,r}function l_(t){return Gf(!0,!1,t)}function d_(t){return Gf(!0,!0,t)}function u_(t){return Gf(!1,!1,t)}function m1(t,e){let n=t[cn];n._lView=Ze(),n._queryIndex=e,n._queryList=a_(n._lView,e),n._queryList.onDirty(()=>n._dirtyCounter.update(o=>o+1))}function h1(t,e){let n=t._lView,o=t._queryIndex;if(n===void 0||o===void 0||n[ye]&4)return e?void 0:co;let r=a_(n,o),i=f1(n,o);return r.reset(i,Tw),e?r.first:r._changesDetected||t._flatValue===void 0?t._flatValue=r.toArray():t._flatValue}function Wf(t){return!!t&&typeof t.then=="function"}function p_(t){return!!t&&typeof t.subscribe=="function"}var bl=class{};var aa=class extends bl{injector;instance=null;constructor(e){super();let n=new Br([...e.providers,{provide:bl,useValue:this}],e.parent||Us(),e.debugName,new Set(["environment"]));this.injector=n,e.runEnvironmentInitializers&&n.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(e){this.injector.onDestroy(e)}};function f_(t,e,n=null){return new aa({providers:t,parent:e,debugName:n,runEnvironmentInitializers:!0}).injector}var g1=(()=>{class t{_injector;cachedInjectors=new Map;constructor(n){this._injector=n}getOrCreateStandaloneInjector(n){if(!n.standalone)return null;if(!this.cachedInjectors.has(n)){let o=np(!1,n.type),r=o.length>0?f_([o],this._injector,""):null;this.cachedInjectors.set(n,r)}return this.cachedInjectors.get(n)}ngOnDestroy(){try{for(let n of this.cachedInjectors.values())n!==null&&n.destroy()}finally{this.cachedInjectors.clear()}}static \u0275prov=Oe({token:t,providedIn:"environment",factory:()=>new t(lt(lo))})}return t})();function he(t){return vf(()=>{let e=m_(t),n=Q(H({},e),{decls:t.decls,vars:t.vars,template:t.template,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,onPush:t.changeDetection!==bf.Eager,directiveDefs:null,pipeDefs:null,dependencies:e.standalone&&t.dependencies||null,getStandaloneInjector:e.standalone?r=>r.get(g1).getOrCreateStandaloneInjector(n):null,getExternalStyles:null,signals:t.signals??!1,data:t.data||{},encapsulation:t.encapsulation||go.Emulated,styles:t.styles||co,_:null,schemas:t.schemas||null,tView:null,id:""});e.standalone&&ii("NgStandalone"),h_(n);let o=t.dependencies;return n.directiveDefs=Iy(o,y1),n.pipeDefs=Iy(o,sg),n.id=b1(n),n})}function y1(t){return qr(t)||Oc(t)}function v1(t,e){if(t==null)return Fc;let n={};for(let o in t)if(Object.hasOwn(t,o)){let r=t[o],i,s,a,c;Array.isArray(r)?(a=r[0],i=r[1],s=r[2]??i,c=r[3]||null):(i=r,s=r,a=Dl.None,c=null),n[i]=[o,a,c],e[i]=s}return n}function _1(t){if(t==null)return Fc;let e={};for(let n in t)Object.hasOwn(t,n)&&(e[t[n]]=n);return e}function ua(t){return vf(()=>{let e=m_(t);return h_(e),e})}function m_(t){let e={};return{type:t.type,providersResolver:null,viewProvidersResolver:null,factory:null,hostBindings:t.hostBindings||null,hostVars:t.hostVars||0,hostAttrs:t.hostAttrs||null,contentQueries:t.contentQueries||null,declaredInputs:e,inputConfig:t.inputs||Fc,exportAs:t.exportAs||null,standalone:t.standalone??!0,signals:t.signals===!0,selectors:t.selectors||co,viewQuery:t.viewQuery||null,features:t.features||null,setInput:null,resolveHostDirectives:null,hostDirectives:null,controlDef:null,signalFormsInputPresence:null,inputs:v1(t.inputs,e),outputs:_1(t.outputs),debugInfo:null}}function h_(t){t.features?.forEach(e=>e(t))}function Iy(t,e){return t?()=>{let n=typeof t=="function"?t():t,o=[];for(let r of n){let i=e(r);i!==null&&o.push(i)}return o}:null}function b1(t){let e=0,n=typeof t.consts=="function"?"":t.consts,o=[t.selectors,t.ngContentSelectors,t.hostVars,t.hostAttrs,n,t.vars,t.decls,t.encapsulation,t.standalone,t.signals,t.exportAs,JSON.stringify(t.inputs),JSON.stringify(t.outputs),Object.getOwnPropertyNames(t.type.prototype),!!t.contentQueries,!!t.viewQuery];for(let i of o.join("|"))e=Math.imul(31,e)+i.charCodeAt(0)<<0;return e+=2147483648,"c"+e}var g_=new ze("");var Yf=(()=>{class t{resolve;reject;initialized=!1;done=!1;donePromise=new Promise((n,o)=>{this.resolve=n,this.reject=o});appInits=N(g_,{optional:!0})??[];injector=N(Gn);constructor(){}runInitializers(){if(this.initialized)return;let n=[];for(let r of this.appInits){let i=jc(this.injector,r);if(Wf(i))n.push(i);else if(p_(i)){let s=new Promise((a,c)=>{i.subscribe({complete:a,error:c})});n.push(s)}}let o=()=>{this.done=!0,this.resolve()};Promise.all(n).then(()=>{o()}).catch(r=>{this.reject(r)}),n.length===0&&o(),this.initialized=!0}static \u0275fac=function(o){return new(o||t)};static \u0275prov=Xi({token:t,factory:t.\u0275fac})}return t})();function x1(t,e,n,o,r,i,s,a){if(n.firstCreatePass){t.mergedAttrs=Sl(t.mergedAttrs,t.attrs);let d=t.tView=Vf(2,t,r,i,s,n.directiveRegistry,n.pipeRegistry,null,n.schemas,n.consts,null);n.queries!==null&&(n.queries.template(n,t),d.queries=n.queries.embeddedTView(t))}a&&(t.flags|=a),zi(t,!1);let c=E1(n,e,t,o);Xc()&&Lf(n,e,c,t),Zi(c,e);let l=Uv(c,e,c,t);e[o+ln]=l,$f(e,l),o1(l,t,e)}function xl(t,e,n,o,r,i,s,a,c,l,d){let f=n+ln,y;if(e.firstCreatePass){if(y=Al(e,f,4,s||null,a||null),l!=null){let v=ko(e.consts,l);y.localNames=[];for(let x=0;x<v.length;x+=2)y.localNames.push(v[x],-1)}}else y=e.data[f];return x1(y,t,e,n,o,r,i,c),l!=null&&Hf(t,y,d),y}var E1=C1;function C1(t,e,n,o){return Jc(!0),e[Dt].createComment("")}var Zf=new ze("");var Kf=new ze("");function y_(){yu(t=>{let e="";throw new Ie(-600,e)})}var w1=10;var pa=(()=>{class t{_runningTick=!1;_destroyed=!1;_destroyListeners=[];_views=[];internalErrorHandler=N(ni);afterRenderManager=N(Af);zonelessEnabled=N(Xs);rootEffectScheduler=N(nl);dirtyFlags=0;tracingSnapshot=null;allTestViews=new Set;autoDetectTestViews=new Set;includeAllTestViews=!1;afterTick=new qn;get allViews(){return[...(this.includeAllTestViews?this.allTestViews:this.autoDetectTestViews).keys(),...this._views]}get destroyed(){return this._destroyed}componentTypes=[];components=[];internalPendingTask=N(qi);get isStable(){return this.internalPendingTask.hasPendingTasksObservable.pipe(Nu(n=>!n))}constructor(){N(Qo,{optional:!0})}whenStable(){let n;return new Promise(o=>{n=this.isStable.subscribe({next:r=>{r&&o()}})}).finally(()=>{n.unsubscribe()})}_injector=N(lo);_rendererFactory=null;get injector(){return this._injector}bootstrap(n,o){return this.bootstrapImpl(n,o)}bootstrapImpl(n,o,r=Gn.NULL){return this._injector.get(wn).run(()=>{if(pt(ot.BootstrapComponentStart),!this._injector.get(Yf).done){let Y="";throw new Ie(405,Y)}let a=qr(n),c=this._injector.get(bl),l=new sa(a,c);this.componentTypes.push(n);let{hostElement:d,directives:f,bindings:y}=S1(o),v=d||l.selector,x=l.create(r,[],v,c.injector,f,y),C=x.location.nativeElement,P=x.injector.get(Zf,null);return P?.registerApplication(C),x.onDestroy(()=>{this.detachView(x.hostView),ea(this.components,x),P?.unregisterApplication(C)}),this._loadComponent(x),pt(ot.BootstrapComponentEnd,x),x})}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick(){pt(ot.ChangeDetectionStart),this.tracingSnapshot!==null?this.tracingSnapshot.run(Il.CHANGE_DETECTION,this.tickImpl):this.tickImpl()}tickImpl=()=>{if(this._runningTick)throw pt(ot.ChangeDetectionEnd),new Ie(101,!1);let n=ae(null);try{this._runningTick=!0,this.synchronize()}finally{this._runningTick=!1,this.tracingSnapshot?.dispose(),this.tracingSnapshot=null,ae(n),this.afterTick.next(),pt(ot.ChangeDetectionEnd)}};synchronize(){this._rendererFactory===null&&!this._injector.destroyed&&(this._rendererFactory=this._injector.get(Yo,null,{optional:!0}));let n=0;for(;this.dirtyFlags!==0&&n++<w1;){pt(ot.ChangeDetectionSyncStart);try{this.synchronizeOnce()}finally{pt(ot.ChangeDetectionSyncEnd)}}}synchronizeOnce(){this.dirtyFlags&16&&(this.dirtyFlags&=-17,this.rootEffectScheduler.flush());let n=!1;if(this.dirtyFlags&7){let o=!!(this.dirtyFlags&1);this.dirtyFlags&=-8,this.dirtyFlags|=8;for(let{_lView:r}of this.allViews){if(!o&&!Ws(r))continue;let i=o&&!this.zonelessEnabled?0:1;jv(r,i),n=!0}if(this.dirtyFlags&=-5,this.syncDirtyFlagsWithViews(),this.dirtyFlags&23)return}n||(this._rendererFactory?.begin?.(),this._rendererFactory?.end?.()),this.dirtyFlags&8&&(this.dirtyFlags&=-9,this.afterRenderManager.execute()),this.syncDirtyFlagsWithViews()}syncDirtyFlagsWithViews(){if(this.allViews.some(({_lView:n})=>Ws(n))){this.dirtyFlags|=2;return}else this.dirtyFlags&=-8}attachView(n){let o=n;this._views.push(o),o.attachToAppRef(this)}detachView(n){let o=n;ea(this._views,o),o.detachFromAppRef()}_loadComponent(n){this.attachView(n.hostView);try{this.tick()}catch(r){this.internalErrorHandler(r)}this.components.push(n),this._injector.get(Kf,[]).forEach(r=>r(n))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(n=>n()),this._views.slice().forEach(n=>n.destroy())}finally{this._destroyed=!0,this._views=[],this._destroyListeners=[]}}onDestroy(n){return this._destroyListeners.push(n),()=>ea(this._destroyListeners,n)}destroy(){if(this._destroyed)throw new Ie(406,!1);let n=this._injector;n.destroy&&!n.destroyed&&n.destroy()}get viewCount(){return this._views.length}static \u0275fac=function(o){return new(o||t)};static \u0275prov=Xi({token:t,factory:t.\u0275fac})}return t})();function S1(t){return t===void 0||typeof t=="string"||t instanceof Element?{hostElement:t}:t}function ea(t,e){let n=t.indexOf(e);n>-1&&t.splice(n,1)}function pe(t,e,n,o){let r=Ze(),i=ti();if(Do(r,i,e)){let s=xn(),a=Ys();XS(a,r,t,e,n,o)}return pe}var cf=class{destroy(e){}updateValue(e,n){}swap(e,n){let o=Math.min(e,n),r=Math.max(e,n),i=this.detach(r);if(r-o>1){let s=this.detach(o);this.attach(o,i),this.attach(r,s)}else this.attach(o,i)}move(e,n){this.attach(n,this.detach(e))}};function Op(t,e,n,o,r){return t===n&&Object.is(e,o)?1:Object.is(r(t,e),r(n,o))?-1:0}function T1(t,e,n,o){let r,i,s=0,a=t.length-1,c=void 0;if(Array.isArray(e)){ae(o);let l=e.length-1;for(ae(null);s<=a&&s<=l;){let d=t.at(s),f=e[s],y=Op(s,d,s,f,n);if(y!==0){y<0&&t.updateValue(s,f),s++;continue}let v=t.at(a),x=e[l],C=Op(a,v,l,x,n);if(C!==0){C<0&&t.updateValue(a,x),a--,l--;continue}let P=n(s,d),Y=n(a,v),G=n(s,f);if(Object.is(G,Y)){let ve=n(l,x);Object.is(ve,P)?(t.swap(s,a),t.updateValue(a,x),l--,a--):t.move(a,s),t.updateValue(s,f),s++;continue}if(r??=new El,i??=Ny(t,s,a,n),lf(t,r,s,G))t.updateValue(s,f),s++,a++;else if(i.has(G))r.set(P,t.detach(s)),a--;else{let ve=t.create(s,e[s]);t.attach(s,ve),s++,a++}}for(;s<=l;)ky(t,r,n,s,e[s]),s++}else if(e!=null){ae(o);let l=e[Symbol.iterator]();ae(null);let d=l.next();for(;!d.done&&s<=a;){let f=t.at(s),y=d.value,v=Op(s,f,s,y,n);if(v!==0)v<0&&t.updateValue(s,y),s++,d=l.next();else{r??=new El,i??=Ny(t,s,a,n);let x=n(s,y);if(lf(t,r,s,x))t.updateValue(s,y),s++,a++,d=l.next();else if(!i.has(x))t.attach(s,t.create(s,y)),s++,a++,d=l.next();else{let C=n(s,f);r.set(C,t.detach(s)),a--}}}for(;!d.done;)ky(t,r,n,t.length,d.value),d=l.next()}for(;s<=a;)t.destroy(t.detach(a--));r?.forEach(l=>{t.destroy(l)})}function lf(t,e,n,o){return e!==void 0&&e.has(o)?(t.attach(n,e.get(o)),e.delete(o),!0):!1}function ky(t,e,n,o,r){if(lf(t,e,o,n(o,r)))t.updateValue(o,r);else{let i=t.create(o,r);t.attach(o,i)}}function Ny(t,e,n,o){let r=new Set;for(let i=e;i<=n;i++)r.add(o(i,t.at(i)));return r}var El=class{kvMap=new Map;_vMap=void 0;has(e){return this.kvMap.has(e)}delete(e){if(!this.has(e))return!1;let n=this.kvMap.get(e);return this._vMap!==void 0&&this._vMap.has(n)?(this.kvMap.set(e,this._vMap.get(n)),this._vMap.delete(n)):this.kvMap.delete(e),!0}get(e){return this.kvMap.get(e)}set(e,n){if(this.kvMap.has(e)){let o=this.kvMap.get(e);this._vMap===void 0&&(this._vMap=new Map);let r=this._vMap;for(;r.has(o);)o=r.get(o);r.set(o,n)}else this.kvMap.set(e,n)}forEach(e){for(let[n,o]of this.kvMap)if(e(o,n),this._vMap!==void 0){let r=this._vMap;for(;r.has(o);)o=r.get(o),e(o,n)}}};function T(t,e,n,o,r,i,s,a){ii("NgControlFlow");let c=Ze(),l=xn(),d=ko(l.consts,i);return xl(c,l,t,e,n,o,r,d,256,s,a),Qf}function Qf(t,e,n,o,r,i,s,a){return ii("NgControlFlow"),M1(t,e,n,o,r,i,s,a),Qf}function M1(t,e,n,o,r,i,s,a){let c=Ze(),l=xn(),d=ko(l.consts,i);xl(c,l,t,e,n,o,r,d,512,s,a)}function M(t,e){ii("NgControlFlow");let n=Ze(),o=ti(),r=n[o]!==Tn?n[o]:-1,i=r!==-1?Cl(n,ln+r):void 0,s=0;if(Do(n,o,t)){let a=ae(null);try{if(i!==void 0&&qv(i,s),t!==-1){let c=ln+t,l=Cl(n,c),d=ff(n[de],c),f=Wv(l,d,n),y=Ol(n,d,e,{dehydratedView:f});Pl(l,y,s,na(d,f))}}finally{ae(a)}}else if(i!==void 0){let a=zv(i,s);a!==void 0&&(a[Ft]=e)}}var df=class{lContainer;$implicit;$index;constructor(e,n,o){this.lContainer=e,this.$implicit=n,this.$index=o}get $count(){return this.lContainer.length-Vt}};function es(t){return t}function ci(t,e){return e}var uf=class{hasEmptyBlock;trackByFn;liveCollection;constructor(e,n,o){this.hasEmptyBlock=e,this.trackByFn=n,this.liveCollection=o}};function _e(t,e,n,o,r,i,s,a,c,l,d,f,y){ii("NgControlFlow");let v=Ze(),x=xn(),C=c!==void 0,P=Ze(),Y=a?s.bind(P[An][Ft]):s,G=new uf(C,Y);P[ln+t]=G,xl(v,x,t+1,e,n,o,r,ko(x.consts,i),256),C&&xl(v,x,t+2,c,l,d,f,ko(x.consts,y),512)}var pf=class extends cf{lContainer;hostLView;templateTNode;operationsCounter=void 0;needsIndexUpdate=!1;constructor(e,n,o){super(),this.lContainer=e,this.hostLView=n,this.templateTNode=o}get length(){return this.lContainer.length-Vt}at(e){return this.getLView(e)[Ft].$implicit}attach(e,n){let o=n[$i];this.needsIndexUpdate||=e!==this.length,Pl(this.lContainer,n,e,na(this.templateTNode,o)),I1(this.lContainer,e)}detach(e){return this.needsIndexUpdate||=e!==this.length-1,k1(this.lContainer,e),N1(this.lContainer,e)}create(e,n){let o=Xp(this.lContainer,this.templateTNode.tView.ssrId);return Ol(this.hostLView,this.templateTNode,new df(this.lContainer,n,e),{dehydratedView:o})}destroy(e){kl(e[de],e)}updateValue(e,n){this.getLView(e)[Ft].$implicit=n}reset(){this.needsIndexUpdate=!1}updateIndexes(){if(this.needsIndexUpdate)for(let e=0;e<this.length;e++)this.getLView(e)[Ft].$index=e}getLView(e){return D1(this.lContainer,e)}};function be(t){let e=ae(null),n=fo();try{let o=Ze(),r=o[de],i=o[n],s=n+1,a=Cl(o,s);if(i.liveCollection===void 0){let l=ff(r,s);i.liveCollection=new pf(a,o,l)}else i.liveCollection.reset();let c=i.liveCollection;if(T1(c,t,i.trackByFn,e),c.updateIndexes(),i.hasEmptyBlock){let l=ti(),d=c.length===0;if(Do(o,l,d)){let f=n+2,y=Cl(o,f);if(d){let v=ff(r,f),x=Wv(y,v,o),C=Ol(o,v,void 0,{dehydratedView:x});Pl(y,C,0,na(v,x))}else r.firstUpdatePass&&ET(y),qv(y,0)}}}finally{ae(e)}}function Cl(t,e){return t[e]}function I1(t,e){if(t.length<=Vt)return;let n=Vt+e,o=t[n];o&&wS(o)}function k1(t,e){if(t.length<=Vt)return;let n=Vt+e,o=t[n];o&&CS(o)}function N1(t,e){return ra(t,e)}function D1(t,e){return zv(t,e)}function ff(t,e){return Uc(t,e)}function K(t,e,n){let o=Ze(),r=ti();if(Do(o,r,e)){let i=xn(),s=Ys();GS(s,o,t,e,o[Dt],n)}return K}function mf(t,e,n,o,r){Bf(e,t,n,r?"class":"style",o)}function g(t,e,n,o){let r=Ze(),i=r[de],s=t+ln,a=i.firstCreatePass?t_(s,r,2,e,QS,Ig(),n,o):i.data[s];if(fr(a)){let c=r[po].tracingService;if(c&&c.componentCreate){let l=i.data[a.directiveStart+a.componentOffset];return c.componentCreate(Kv(l),()=>(Dy(t,e,r,a,o),g))}}return Dy(t,e,r,a,o),g}function Dy(t,e,n,o,r){if(Ov(o,n,t,e,v_),Hc(o)){let i=n[de];Nv(i,n,o),av(i,o,n)}r!=null&&Hf(n,o)}function _(){let t=xn(),e=Qn(),n=Pv(e);return t.firstCreatePass&&n_(t,n),mp(n)&&hp(),fp(),n.classesWithoutHost!=null&&uw(n)&&mf(t,n,Ze(),n.classesWithoutHost,!0),n.stylesWithoutHost!=null&&pw(n)&&mf(t,n,Ze(),n.stylesWithoutHost,!1),_}function we(t,e,n,o){return g(t,e,n,o),_(),we}function b(t,e,n,o){let r=Ze(),i=r[de],s=t+ln,a=i.firstCreatePass?HT(s,i,2,e,n,o):i.data[s];return Ov(a,r,t,e,v_),o!=null&&Hf(r,a),b}function E(){let t=Qn(),e=Pv(t);return mp(e)&&hp(),fp(),E}function $e(t,e,n,o){return b(t,e,n,o),E(),$e}var v_=(t,e,n,o,r)=>(Jc(!0),mv(e[Dt],o,xp()));function z(){return Ze()}function Ae(t,e,n){let o=Ze(),r=ti();if(Do(o,r,e)){let i=xn(),s=Ys();Dv(s,o,t,e,o[Dt],n)}return Ae}var fa="en-US";var O1=fa;function __(t){typeof t=="string"&&(O1=t.toLowerCase().replace(/_/g,"-"))}function L(t,e,n){let o=Ze(),r=xn(),i=Qn();return P1(r,o,o[Dt],i,t,e,n),L}function q(t,e,n){let o=Ze(),r=xn(),i=Qn();return(i.type&3||n)&&Qv(i,r,o,n,o[Dt],t,e,ul(i,o,e)),q}function P1(t,e,n,o,r,i,s){let a=!0,c=null;if((o.type&3||s)&&(c??=ul(o,e,i),Qv(o,t,e,s,n,r,i,c)&&(a=!1)),a){let l=o.outputs?.[r],d=o.hostDirectiveOutputs?.[r];if(d&&d.length)for(let f=0;f<d.length;f+=2){let y=d[f],v=d[f+1];c??=ul(o,e,i),Ey(o,e,y,v,r,c)}if(l&&l.length)for(let f of l)c??=ul(o,e,i),Ey(o,e,f,r,r,c)}}function h(t=1){return Ug(t)}function vt(t,e,n,o){return m1(t,d1(e,n,o)),vt}function bt(t=1){Zc(jg()+t)}function sl(t,e){return t<<17|e<<2}function ri(t){return t>>17&32767}function A1(t){return(t&2)==2}function R1(t,e){return t&131071|e<<17}function hf(t){return t|2}function Qi(t){return(t&131068)>>2}function Pp(t,e){return t&-131069|e<<2}function L1(t){return(t&1)===1}function gf(t){return t|1}function F1(t,e,n,o,r,i){let s=i?e.classBindings:e.styleBindings,a=ri(s),c=Qi(s);t[o]=n;let l=!1,d;if(Array.isArray(n)){let f=n;d=f[1],(d===null||Vi(f,d)>0)&&(l=!0)}else d=n;if(r)if(c!==0){let y=ri(t[a+1]);t[o+1]=sl(y,a),y!==0&&(t[y+1]=Pp(t[y+1],o)),t[a+1]=R1(t[a+1],o)}else t[o+1]=sl(a,0),a!==0&&(t[a+1]=Pp(t[a+1],o)),a=o;else t[o+1]=sl(c,0),a===0?a=o:t[c+1]=Pp(t[c+1],o),c=o;l&&(t[o+1]=hf(t[o+1])),Oy(t,d,o,!0),Oy(t,d,o,!1),V1(e,d,t,o,i),s=sl(a,c),i?e.classBindings=s:e.styleBindings=s}function V1(t,e,n,o,r){let i=r?t.residualClasses:t.residualStyles;i!=null&&typeof e=="string"&&Vi(i,e)>=0&&(n[o+1]=gf(n[o+1]))}function Oy(t,e,n,o){let r=t[n+1],i=e===null,s=o?ri(r):Qi(r),a=!1;for(;s!==0&&(a===!1||i);){let c=t[s],l=t[s+1];j1(c,e)&&(a=!0,t[s+1]=o?gf(l):hf(l)),s=o?ri(l):Qi(l)}a&&(t[n+1]=o?hf(r):gf(r))}function j1(t,e){return t===null||e==null||(Array.isArray(t)?t[1]:t)===e?!0:Array.isArray(t)&&typeof e=="string"?Vi(t,e)>=0:!1}var ho={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function $1(t){return t.substring(ho.key,ho.keyEnd)}function H1(t){return B1(t),b_(t,x_(t,0,ho.textEnd))}function b_(t,e){let n=ho.textEnd;return n===e?-1:(e=ho.keyEnd=U1(t,ho.key=e,n),x_(t,e,n))}function B1(t){ho.key=0,ho.keyEnd=0,ho.value=0,ho.valueEnd=0,ho.textEnd=t.length}function x_(t,e,n){for(;e<n&&t.charCodeAt(e)<=32;)e++;return e}function U1(t,e,n){for(;e<n&&t.charCodeAt(e)>32;)e++;return e}function Oo(t,e,n){return E_(t,e,n,!1),Oo}function Te(t,e){return E_(t,e,null,!0),Te}function vo(t){q1(Q1,z1,t,!0)}function z1(t,e){for(let n=H1(e);n>=0;n=b_(e,n))Rc(t,$1(e),!0)}function E_(t,e,n,o){let r=Ze(),i=xn(),s=Wc(2);if(i.firstUpdatePass&&w_(i,t,s,o),e!==Tn&&Do(r,s,e)){let a=i.data[fo()];S_(i,a,r,r[Dt],t,r[s+1]=J1(e,n),o,s)}}function q1(t,e,n,o){let r=xn(),i=Wc(2);r.firstUpdatePass&&w_(r,null,i,o);let s=Ze();if(n!==Tn&&Do(s,i,n)){let a=r.data[fo()];if(T_(a,o)&&!C_(r,i)){let c=o?a.classesWithoutHost:a.stylesWithoutHost;c!==null&&(n=Ic(c,n||"")),mf(r,a,s,n,o)}else X1(r,a,s,s[Dt],s[i+1],s[i+1]=K1(t,e,n),o,i)}}function C_(t,e){return e>=t.expandoStartIndex}function w_(t,e,n,o){let r=t.data;if(r[n+1]===null){let i=r[fo()],s=C_(t,n);T_(i,o)&&e===null&&!s&&(e=!1),e=G1(r,i,e,o),F1(r,i,e,n,s,o)}}function G1(t,e,n,o){let r=Vg(t),i=o?e.residualClasses:e.residualStyles;if(r===null)(o?e.classBindings:e.styleBindings)===0&&(n=Ap(null,t,e,n,o),n=ca(n,e.attrs,o),i=null);else{let s=e.directiveStylingLast;if(s===-1||t[s]!==r)if(n=Ap(r,t,e,n,o),i===null){let c=W1(t,e,o);c!==void 0&&Array.isArray(c)&&(c=Ap(null,t,e,c[1],o),c=ca(c,e.attrs,o),Y1(t,e,o,c))}else i=Z1(t,e,o)}return i!==void 0&&(o?e.residualClasses=i:e.residualStyles=i),n}function W1(t,e,n){let o=n?e.classBindings:e.styleBindings;if(Qi(o)!==0)return t[ri(o)]}function Y1(t,e,n,o){let r=n?e.classBindings:e.styleBindings;t[ri(r)]=o}function Z1(t,e,n){let o,r=e.directiveEnd;for(let i=1+e.directiveStylingLast;i<r;i++){let s=t[i].hostAttrs;o=ca(o,s,n)}return ca(o,e.attrs,n)}function Ap(t,e,n,o,r){let i=null,s=n.directiveEnd,a=n.directiveStylingLast;for(a===-1?a=n.directiveStart:a++;a<s&&(i=e[a],o=ca(o,i.hostAttrs,r),i!==t);)a++;return t!==null&&(n.directiveStylingLast=a),o}function ca(t,e,n){let o=n?1:2,r=-1;if(e!==null)for(let i=0;i<e.length;i++){let s=e[i];typeof s=="number"?r=s:r===o&&(Array.isArray(t)||(t=t===void 0?[]:["",t]),Rc(t,s,n?!0:e[++i]))}return t===void 0?null:t}function K1(t,e,n){if(n==null||n==="")return co;let o=[],r=Xn(n);if(Array.isArray(r))for(let i=0;i<r.length;i++)t(o,r[i],!0);else if(r instanceof Set)for(let i of r)t(o,i,!0);else if(typeof r=="object")for(let i in r)Object.hasOwn(r,i)&&t(o,i,r[i]);else typeof r=="string"&&e(o,r);return o}function Q1(t,e,n){let o=String(e);o!==""&&!o.includes(" ")&&Rc(t,o,n)}function X1(t,e,n,o,r,i,s,a){r===Tn&&(r=co);let c=0,l=0,d=0<r.length?r[0]:null,f=0<i.length?i[0]:null;for(;d!==null||f!==null;){let y=c<r.length?r[c+1]:void 0,v=l<i.length?i[l+1]:void 0,x=null,C;d===f?(c+=2,l+=2,y!==v&&(x=f,C=v)):f===null||d!==null&&d<f?(c+=2,x=d):(l+=2,x=f,C=v),x!==null&&S_(t,e,n,o,x,C,s,a),d=c<r.length?r[c]:null,f=l<i.length?i[l]:null}}function S_(t,e,n,o,r,i,s,a){if(!(e.type&3))return;let c=t.data,l=c[a+1],d=L1(l)?Py(c,e,n,r,Qi(l),s):void 0;if(!wl(d)){wl(i)||A1(l)&&(i=Py(c,null,n,r,a,s));let f=cp(fo(),n);VS(o,s,f,r,i)}}function Py(t,e,n,o,r,i){let s=e===null,a;for(;r>0;){let c=t[r],l=Array.isArray(c),d=l?c[1]:c,f=d===null,y=n[r+1];y===Tn&&(y=f?co:void 0);let v=f?Lc(y,o):d===o?y:void 0;if(l&&!wl(v)&&(v=Lc(c,o)),wl(v)&&(a=v,s))return a;let x=t[r+1];r=s?ri(x):Qi(x)}if(e!==null){let c=i?e.residualClasses:e.residualStyles;c!=null&&(a=Lc(c,o))}return a}function wl(t){return t!==void 0}function J1(t,e){return t==null||t===""||(typeof e=="string"?t=Xn(t)+e:typeof t=="object"&&(t=Mc(Xn(t)))),t}function T_(t,e){return(t.flags&(e?8:16))!==0}function p(t,e=""){let n=Ze(),o=xn(),r=t+ln,i=o.firstCreatePass?Al(o,r,1,e,null):o.data[r],s=eM(o,n,i,e);n[r]=s,Xc()&&Lf(o,n,s,i),zi(i,!1)}var eM=(t,e,n,o)=>(Jc(!0),eS(e[Dt],o));function tM(t,e,n,o=""){return Do(t,ti(),n)?e+Gr(n)+o:Tn}function nM(t,e,n,o,r,i=""){let s=Pg(),a=IT(t,s,n,r);return Wc(2),a?e+Gr(n)+o+Gr(r)+i:Tn}function D(t){return ce("",t),D}function ce(t,e,n){let o=Ze(),r=tM(o,t,e,n);return r!==Tn&&M_(o,fo(),r),ce}function Ln(t,e,n,o,r){let i=Ze(),s=nM(i,t,e,n,o,r);return s!==Tn&&M_(i,fo(),s),Ln}function M_(t,e,n){let o=cp(e,t);tS(t[Dt],o,n)}function Ll(t,e){let n=Og()+t,o=Ze();return o[n]===Tn?TT(o,n,e()):MT(o,n)}var I_=(()=>{class t{applicationErrorHandler=N(ni);appRef=N(pa);taskService=N(qi);ngZone=N(wn);zonelessEnabled=N(Xs);tracing=N(Qo,{optional:!0});zoneIsDefined=typeof Zone<"u"&&!!Zone.root.run;schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}];subscriptions=new bn;angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(js):null;scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(N(Mp,{optional:!0})??!1);cancelScheduledCallback=null;useMicrotaskScheduler=!1;runningTick=!1;pendingRenderTaskId=null;constructor(){this.subscriptions.add(this.appRef.afterTick.subscribe(()=>{let n=this.taskService.add();if(!this.runningTick&&(this.cleanup(),!this.zonelessEnabled||this.appRef.includeAllTestViews)){this.taskService.remove(n);return}this.switchToMicrotaskScheduler(),this.taskService.remove(n)})),this.subscriptions.add(this.ngZone.onUnstable.subscribe(()=>{this.runningTick||this.cleanup()}))}switchToMicrotaskScheduler(){this.ngZone.runOutsideAngular(()=>{let n=this.taskService.add();this.useMicrotaskScheduler=!0,queueMicrotask(()=>{this.useMicrotaskScheduler=!1,this.taskService.remove(n)})})}notify(n){if(!this.zonelessEnabled&&n===5)return;switch(n){case 0:case 2:{this.appRef.dirtyFlags|=2;break}case 3:case 4:case 5:case 1:{this.appRef.dirtyFlags|=4;break}case 6:{this.appRef.dirtyFlags|=2;break}case 12:{this.appRef.dirtyFlags|=16;break}case 13:{this.appRef.dirtyFlags|=2;break}case 11:break;default:this.appRef.dirtyFlags|=8}if(this.appRef.tracingSnapshot=this.tracing?.snapshot(this.appRef.tracingSnapshot)??null,!this.shouldScheduleTick())return;let o=this.useMicrotaskScheduler?Yg:Ep;this.pendingRenderTaskId=this.taskService.add(),this.scheduleInRootZone?this.cancelScheduledCallback=Zone.root.run(()=>o(()=>this.tick())):this.cancelScheduledCallback=this.ngZone.runOutsideAngular(()=>o(()=>this.tick()))}shouldScheduleTick(){return!(this.appRef.destroyed||this.pendingRenderTaskId!==null||this.runningTick||this.appRef._runningTick||!this.zonelessEnabled&&this.zoneIsDefined&&Zone.current.get(js+this.angularZoneId))}tick(){if(this.runningTick||this.appRef.destroyed)return;if(this.appRef.dirtyFlags===0){this.cleanup();return}!this.zonelessEnabled&&this.appRef.dirtyFlags&7&&(this.appRef.dirtyFlags|=1);let n=this.taskService.add();try{this.ngZone.run(()=>{this.runningTick=!0,this.appRef._tick()},void 0,this.schedulerTickApplyArgs)}catch(o){this.applicationErrorHandler(o)}finally{this.taskService.remove(n),this.cleanup()}}ngOnDestroy(){this.subscriptions.unsubscribe(),this.cleanup()}cleanup(){if(this.runningTick=!1,this.cancelScheduledCallback?.(),this.cancelScheduledCallback=null,this.pendingRenderTaskId!==null){let n=this.pendingRenderTaskId;this.pendingRenderTaskId=null,this.taskService.remove(n)}}static \u0275fac=function(o){return new(o||t)};static \u0275prov=Xi({token:t,factory:t.\u0275fac})}return t})();function k_(){return[{provide:cr,useExisting:I_},{provide:wn,useClass:$s},{provide:Xs,useValue:!0}]}function oM(){return typeof $localize<"u"&&$localize.locale||fa}var Xf=new ze("",{factory:()=>N(Xf,{optional:!0,skipSelf:!0})||oM()});var Fl=class{destroyed=!1;listeners=null;errorHandler=N(Wn,{optional:!0});isEmitting=!1;hasNullListeners=!1;destroyRef=N(ht);constructor(){this.destroyRef.onDestroy(()=>{this.destroyed=!0,this.listeners=null})}subscribe(e){if(this.destroyed)throw new Ie(953,!1);return(this.listeners??=[]).push(e),{unsubscribe:()=>{let n=this.listeners?this.listeners.indexOf(e):-1;n>-1&&(this.isEmitting?(this.hasNullListeners=!0,this.listeners[n]=null):this.listeners.splice(n,1))}}}emit(e){if(this.destroyed){console.warn(Fi(953,!1));return}if(this.listeners===null)return;this.isEmitting=!0;let n=ae(null);try{for(let o of this.listeners)try{o!==null&&o(e)}catch(r){this.errorHandler?.handleError(r)}}finally{this.hasNullListeners&&(this.hasNullListeners=!1,this.listeners&&rM(this.listeners)),ae(n),this.isEmitting=!1}}};function rM(t){let e=t.length-1;for(;e>-1;)t[e]===null&&t.splice(e,1),e--}function S(t,e){return Os(t,e?.equal)}function ma(t){return $h(t)}var N_=class t extends Error{_brand;constructor(e){super(e)}static IDLE=new t("IDLE");static LOADING=new t("LOADING")};function P_(t,e){let n=Object.create(Vy);n.value=t,n.transformFn=e?.transform;function o(){if(Ar(n),n.value===yf){let r=null;throw new Ie(-950,r)}return n.value}return o[cn]=n,o}function rt(t){return new Fl}function D_(t,e){return P_(t,e)}function hM(t){return P_(yf,t)}var ee=(D_.required=hM,D_);function O_(t,e){return l_(e)}function gM(t,e){return d_(e)}var at=(O_.required=gM,O_);function A_(t,e){return u_(e)}var yM=1e4;var X4=yM-1e3;var Jf=new ze(""),vM=new ze("");function ha(t){return!t.moduleRef}function _M(t){let e=ha(t)?t.r3Injector:t.moduleRef.injector,n=e.get(wn);return n.run(()=>{ha(t)?t.r3Injector.resolveInjectorInitializers():t.moduleRef.resolveInjectorInitializers();let o=e.get(ni),r;if(n.runOutsideAngular(()=>{r=n.onError.subscribe({next:o})}),ha(t)){let i=()=>e.destroy(),s=t.platformInjector.get(Jf);s.add(i),e.onDestroy(()=>{r.unsubscribe(),s.delete(i)})}else{let i=()=>t.moduleRef.destroy(),s=t.platformInjector.get(Jf);s.add(i),t.moduleRef.onDestroy(()=>{ea(t.allPlatformModules,t.moduleRef),r.unsubscribe(),s.delete(i)})}return xM(o,n,()=>{let i=e.get(qi),s=i.add(),a=e.get(Yf);return a.runInitializers(),a.donePromise.then(()=>{let c=e.get(Xf,fa);if(__(c||fa),!e.get(vM,!0))return ha(t)?e.get(pa):(t.allPlatformModules.push(t.moduleRef),t.moduleRef);if(ha(t)){let d=e.get(pa);return t.rootComponent!==void 0&&d.bootstrap(t.rootComponent),d}else return bM?.(t.moduleRef,t.allPlatformModules),t.moduleRef}).finally(()=>{i.remove(s)})})})}var bM;function xM(t,e,n){try{let o=n();return Wf(o)?o.catch(r=>{throw e.runOutsideAngular(()=>t(r)),r}):o}catch(o){throw e.runOutsideAngular(()=>t(o)),o}}var Vl=null;function EM(t=[],e){return Gn.create({name:e,providers:[{provide:Bs,useValue:"platform"},{provide:Jf,useValue:new Set([()=>Vl=null])},...t]})}function CM(t=[]){if(Vl)return Vl;let e=EM(t);return Vl=e,y_(),wM(e),e}function wM(t){let e=t.get(el,null);jc(t,()=>{e?.forEach(n=>n())})}function R_(t){let{rootComponent:e,appProviders:n,platformProviders:o,platformRef:r}=t;pt(ot.BootstrapApplicationStart);try{let i=r?.injector??CM(o),s=[k_(),Xg,...n||[]],a=new aa({providers:s,parent:i,debugName:"",runEnvironmentInitializers:!1});return _M({r3Injector:a.injector,platformInjector:i,rootComponent:e})}catch(i){return Promise.reject(i)}finally{pt(ot.BootstrapApplicationEnd)}}var L_=null;function ts(){return L_}function tm(t){L_??=t}var ga=class{};function nm(t,e){e=encodeURIComponent(e);for(let n of t.split(";")){let o=n.indexOf("="),[r,i]=o==-1?[n,""]:[n.slice(0,o),n.slice(o+1)];if(r.trim()!==e)continue;let s=i;try{s=decodeURIComponent(i)}catch{}return s.length>1&&s[0]==='"'&&s[s.length-1]==='"'&&(s=s.slice(1,-1)),s}return null}var F_="browser";var ya=class{_doc;constructor(e){this._doc=e}manager},jl=(()=>{class t extends ya{constructor(n){super(n)}supports(n){return!0}addEventListener(n,o,r,i){return n.addEventListener(o,r,i),()=>this.removeEventListener(n,o,r,i)}removeEventListener(n,o,r,i){return n.removeEventListener(o,r,i)}static \u0275fac=function(o){return new(o||t)(lt(En))};static \u0275prov=Oe({token:t,factory:t.\u0275fac})}return t})(),Bl=new ze(""),sm=(()=>{class t{_zone;_plugins;_eventNameToPlugin=new Map;constructor(n,o){this._zone=o,n.forEach(s=>{s.manager=this});let r=n.filter(s=>!(s instanceof jl));this._plugins=r.slice().reverse();let i=n.find(s=>s instanceof jl);i&&this._plugins.push(i)}addEventListener(n,o,r,i){return this._findPluginFor(o).addEventListener(n,o,r,i)}getZone(){return this._zone}_findPluginFor(n){let o=this._eventNameToPlugin.get(n);if(o)return o;if(o=this._plugins.find(i=>i.supports(n)),!o)throw new Ie(-5101,!1);return this._eventNameToPlugin.set(n,o),o}static \u0275fac=function(o){return new(o||t)(lt(Bl),lt(wn))};static \u0275prov=Oe({token:t,factory:t.\u0275fac})}return t})(),om="ng-app-id";function V_(t){for(let e of t)e.remove()}function j_(t,e){let n=e.createElement("style");return n.textContent=t,n}function SM(t,e,n,o){let r=t.head?.querySelectorAll(`style[${om}="${e}"],link[${om}="${e}"]`);if(!r||r.length===0)return!1;for(let i of r)i.removeAttribute(om),i instanceof HTMLLinkElement?o.set(i.href.slice(i.href.lastIndexOf("/")+1),{usage:0,elements:[i]}):i.textContent&&n.set(i.textContent,{usage:0,elements:[i]});return!0}function im(t,e){let n=e.createElement("link");return n.setAttribute("rel","stylesheet"),n.setAttribute("href",t),n}var am=(()=>{class t{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;constructor(n,o,r,i={}){this.doc=n,this.appId=o,this.nonce=r,SM(n,o,this.inline,this.external)&&this.hosts.add(n.head)}addStyles(n,o){for(let r of n)this.addUsage(r,this.inline,j_);o?.forEach(r=>this.addUsage(r,this.external,im))}removeStyles(n,o){for(let r of n)this.removeUsage(r,this.inline);o?.forEach(r=>this.removeUsage(r,this.external))}addUsage(n,o,r){let i=o.get(n);i?i.usage++:o.set(n,{usage:1,elements:[...this.hosts].map(s=>this.addElement(s,r(n,this.doc)))})}removeUsage(n,o){let r=o.get(n);r&&(r.usage--,r.usage<=0&&(V_(r.elements),o.delete(n)))}ngOnDestroy(){for(let[,{elements:n}]of[...this.inline,...this.external])V_(n);this.hosts.clear()}addHost(n){if(!this.hosts.has(n)){this.hosts.add(n);for(let[o,{elements:r}]of this.inline)r.push(this.addElement(n,j_(o,this.doc)));for(let[o,{elements:r}]of this.external)r.push(this.addElement(n,im(o,this.doc)))}}removeHost(n){this.hosts.delete(n);for(let o of[...this.inline.values(),...this.external.values()]){let r=[];for(let i of o.elements)i.parentNode===n?i.remove():r.push(i);o.elements=r}}addElement(n,o){return this.nonce&&o.setAttribute("nonce",this.nonce),n.appendChild(o)}static \u0275fac=function(o){return new(o||t)(lt(En),lt(Zs),lt(tl,8),lt(Ks))};static \u0275prov=Oe({token:t,factory:t.\u0275fac})}return t})(),rm={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/Math/MathML"},cm=/%COMP%/g;var H_="%COMP%",TM=`_nghost-${H_}`,MM=`_ngcontent-${H_}`,IM=!0,kM=new ze("",{factory:()=>IM}),NM=new ze("");function DM(t){return MM.replace(cm,t)}function OM(t){return TM.replace(cm,t)}function B_(t,e){return e.map(n=>n.replace(cm,t))}var lm=(()=>{class t{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;cssVarNamespace;constructor(n,o,r,i,s,a,c=null,l=null,d=null){this.eventManager=n,this.sharedStylesHost=o,this.appId=r,this.removeStylesOnCompDestroy=i,this.doc=s,this.ngZone=a,this.nonce=c,this.tracingService=l,this.cssVarNamespace=d??"",this.defaultRenderer=new va(n,s,a,this.tracingService,this.cssVarNamespace)}createRenderer(n,o){if(!n||!o)return this.defaultRenderer;let r=this.getOrCreateRenderer(n,o);return r instanceof Hl?r.applyToHost(n):r instanceof _a&&r.applyStyles(),r}getOrCreateRenderer(n,o){let r=this.rendererByCompId,i=r.get(o.id);if(!i){let s=this.doc,a=this.ngZone,c=this.eventManager,l=this.sharedStylesHost,d=this.removeStylesOnCompDestroy,f=this.tracingService;switch(o.encapsulation){case go.Emulated:i=new Hl(c,l,o,this.appId,d,s,a,f,this.cssVarNamespace);break;case go.ShadowDom:return new $l(c,n,o,s,a,this.nonce,f,this.cssVarNamespace,l);case go.ExperimentalIsolatedShadowDom:return new $l(c,n,o,s,a,this.nonce,f,this.cssVarNamespace);default:i=new _a(c,l,o,d,s,a,f,this.cssVarNamespace);break}r.set(o.id,i)}return i}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(n){this.rendererByCompId.delete(n)}static \u0275fac=function(o){return new(o||t)(lt(sm),lt(ai),lt(Zs),lt(kM),lt(En),lt(wn),lt(tl),lt(Qo,8),lt(NM,8))};static \u0275prov=Oe({token:t,factory:t.\u0275fac})}return t})(),va=class{eventManager;doc;ngZone;tracingService;cssVarNamespace;data=Object.create(null);throwOnSyntheticProps=!0;constructor(e,n,o,r,i=""){this.eventManager=e,this.doc=n,this.ngZone=o,this.tracingService=r,this.cssVarNamespace=i}destroy(){}destroyNode=null;createElement(e,n){return n?this.doc.createElementNS(rm[n]||n,e):this.doc.createElement(e)}createComment(e){return this.doc.createComment(e)}createText(e){return this.doc.createTextNode(e)}appendChild(e,n){($_(e)?e.content:e).appendChild(n)}insertBefore(e,n,o){if(e){let r=$_(e)?e.content:e;if(o!=null&&o.parentNode!==r)throw new Ie(-5106,!1);r.insertBefore(n,o)}}removeChild(e,n){n.remove()}selectRootElement(e,n){let o=typeof e=="string"?this.doc.querySelector(e):e;if(!o)throw new Ie(-5104,!1);return n||(o.textContent=""),o}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,n,o,r){if(r){n=r+":"+n;let i=rm[r];i?e.setAttributeNS(i,n,o):e.setAttribute(n,o)}else e.setAttribute(n,o)}removeAttribute(e,n,o){if(o){let r=rm[o];r?e.removeAttributeNS(r,n):e.removeAttribute(`${o}:${n}`)}else e.removeAttribute(n)}addClass(e,n){e.classList.add(n)}removeClass(e,n){e.classList.remove(n)}setStyle(e,n,o,r){let i=n.startsWith("--");i&&(n=n.replace("%NS%",this.cssVarNamespace)),i||r&(Wo.DashCase|Wo.Important)?e.style.setProperty(n,o,r&Wo.Important?"important":""):e.style[n]=o}removeStyle(e,n,o){let r=n.startsWith("--");r&&(n=n.replace("%NS%",this.cssVarNamespace)),r||o&Wo.DashCase?e.style.removeProperty(n):e.style[n]=""}setProperty(e,n,o){e!=null&&(e[n]=o)}setValue(e,n){e.nodeValue=n}listen(e,n,o,r){if(typeof e=="string"&&(e=ts().getGlobalEventTarget(this.doc,e),!e))throw new Ie(-5102,!1);let i=this.decoratePreventDefault(o);return this.tracingService?.wrapEventListener&&(i=this.tracingService.wrapEventListener(e,n,i)),this.eventManager.addEventListener(e,n,i,r)}decoratePreventDefault(e){return n=>{if(n==="__ngUnwrap__")return e;e(n)===!1&&n.preventDefault()}}};function $_(t){return t.tagName==="TEMPLATE"&&t.content!==void 0}var $l=class extends va{hostEl;sharedStylesHost;shadowRoot;constructor(e,n,o,r,i,s,a,c,l){super(e,r,i,a,c),this.hostEl=n,this.sharedStylesHost=l,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost&&this.sharedStylesHost.addHost(this.shadowRoot);let d=o.styles;d=B_(o.id,d).map(y=>y.replace(/%NS%/g,c));for(let y of d){let v=document.createElement("style");s&&v.setAttribute("nonce",s),v.textContent=y,this.shadowRoot.appendChild(v)}let f=o.getExternalStyles?.();if(f)for(let y of f){let v=im(y,r);s&&v.setAttribute("nonce",s),this.shadowRoot.appendChild(v)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}appendChild(e,n){return super.appendChild(this.nodeOrShadowRoot(e),n)}insertBefore(e,n,o){return super.insertBefore(this.nodeOrShadowRoot(e),n,o)}removeChild(e,n){return super.removeChild(null,n)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}destroy(){this.sharedStylesHost&&this.sharedStylesHost.removeHost(this.shadowRoot)}},_a=class extends va{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(e,n,o,r,i,s,a,c,l){super(e,i,s,a,c),this.sharedStylesHost=n,this.removeStylesOnCompDestroy=r;let d=o.styles,f=l?B_(l,d):d;this.styles=f.map(y=>y.replace(/%NS%/g,c)),this.styleUrls=o.getExternalStyles?.(l)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&Pf.size===0&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},Hl=class extends _a{contentAttr;hostAttr;constructor(e,n,o,r,i,s,a,c,l){let d=r+"-"+o.id;super(e,n,o,i,s,a,c,l,d),this.contentAttr=DM(d),this.hostAttr=OM(d)}applyToHost(e){this.applyStyles(),this.setAttribute(e,this.hostAttr,"")}createElement(e,n){let o=super.createElement(e,n);return super.setAttribute(o,this.contentAttr,""),o}};var Ul=class t extends ga{supportsDOMEvents=!0;static makeCurrent(){tm(new t)}onAndCancel(e,n,o,r){return e.addEventListener(n,o,r),()=>{e.removeEventListener(n,o,r)}}dispatchEvent(e,n){e.dispatchEvent(n)}remove(e){e.remove()}createElement(e,n){return n=n||this.getDefaultDocument(),n.createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,n){return n==="window"?window:n==="document"?e:n==="body"?e.body:null}getBaseHref(e){let n=PM();return n==null?null:AM(n)}resetBaseElement(){ba=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return nm(document.cookie,e)}},ba=null;function PM(){return ba=ba||document.head.querySelector("base"),ba?ba.getAttribute("href"):null}function AM(t){return new URL(t,document.baseURI).pathname}var U_=["alt","control","meta","shift"],RM={"\b":"Backspace"," ":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},LM={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey},z_=(()=>{class t extends ya{constructor(n){super(n)}supports(n){return t.parseEventName(n)!=null}addEventListener(n,o,r,i){let s=t.parseEventName(o),a=t.eventCallback(s.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>ts().onAndCancel(n,s.domEventName,a,i))}static parseEventName(n){let o=n.toLowerCase().split("."),r=o.shift();if(o.length===0||!(r==="keydown"||r==="keyup"))return null;let i=t._normalizeKey(o.pop()),s="",a=o.indexOf("code");if(a>-1&&(o.splice(a,1),s="code."),U_.forEach(l=>{let d=o.indexOf(l);d>-1&&(o.splice(d,1),s+=l+".")}),s+=i,o.length!=0||i.length===0)return null;let c={};return c.domEventName=r,c.fullKey=s,c}static matchEventFullKeyCode(n,o){let r=RM[n.key]||n.key,i="";return o.indexOf("code.")>-1&&(r=n.code,i="code."),r==null||!r?!1:(r=r.toLowerCase(),r===" "?r="space":r==="."&&(r="dot"),U_.forEach(s=>{if(s!==r){let a=LM[s];a(n)&&(i+=s+".")}}),i+=r,i===o)}static eventCallback(n,o,r){return i=>{t.matchEventFullKeyCode(i,n)&&r.runGuarded(()=>o(i))}}static _normalizeKey(n){return n==="esc"?"escape":n}static \u0275fac=function(o){return new(o||t)(lt(En))};static \u0275prov=Oe({token:t,factory:t.\u0275fac})}return t})();async function dm(t,e,n){let o=H({rootComponent:t},FM(e,n));return R_(o)}function FM(t,e){return{platformRef:e?.platformRef,appProviders:[...BM,...t?.providers??[]],platformProviders:HM}}function VM(){Ul.makeCurrent()}function jM(){return new Wn}function $M(){return xf(document),document}var HM=[{provide:Ks,useValue:F_},{provide:el,useValue:VM,multi:!0},{provide:En,useFactory:$M}];var BM=[{provide:Bs,useValue:"root"},{provide:Wn,useFactory:jM},{provide:Bl,useClass:jl,multi:!0},{provide:Bl,useClass:z_,multi:!0},lm,{provide:ai,useClass:am},{provide:am,useExisting:ai},sm,{provide:Yo,useExisting:lm},[]];var um=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275prov=Oe({token:t,factory:function(o){let r=null;return o?r=new(o||t):r=lt(UM),r},providedIn:"root"})}return t})(),UM=(()=>{class t extends um{_doc=N(En);sanitize(n,o){if(o==null)return null;switch(n){case Nt.NONE:return o;case Nt.HTML:return Zo(o,"HTML")?Xn(o):Ml(this._doc,String(o)).toString();case Nt.STYLE:return Zo(o,"Style")?Xn(o):o;case Nt.SCRIPT:if(Zo(o,"Script"))return Xn(o);throw new Ie(5200,!1);case Nt.URL:return Zo(o,"URL")?Xn(o):la(String(o));case Nt.RESOURCE_URL:if(Zo(o,"ResourceURL"))return Xn(o);throw new Ie(-5201,!1);default:throw new Ie(5202,!1)}}bypassSecurityTrustHtml(n){return wf(n)}bypassSecurityTrustStyle(n){return Sf(n)}bypassSecurityTrustScript(n){return Tf(n)}bypassSecurityTrustUrl(n){return Mf(n)}bypassSecurityTrustResourceUrl(n){return If(n)}static \u0275fac=function(o){return new(o||t)};static \u0275prov=Xi({token:t,factory:t.\u0275fac})}return t})();var q_={providers:[Sp()]};var Jn=typeof window<"u",zl=Jn?window:null,hr=Jn?document:null,ft={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},ke={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},Kt={NONE:0,AUTO:1,FORCE:2},It={replace:0,none:1,blend:2},pm=Symbol(),Po=Symbol(),ql=Symbol(),gr=Symbol(),Gl=Symbol(),Ne=1e-11,xa=1e12,eo=1e3,Ea=240,to="",G_="var(",Ca=[],Wl=(()=>{let t=new Map;return t.set("x","translateX"),t.set("y","translateY"),t.set("z","translateZ"),t})(),ns=["perspective","translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY"],W_=ns.reduce((t,e)=>Q(H({},t),{[e]:e+"("}),{}),zt=()=>{},Y_=t=>t,Z_=/\)\s*[-.\d]/,K_=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,Q_=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,X_=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,J_=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,e0=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,fm=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,Yl=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,t0=/([a-z])([A-Z])/g,n0=/(\*=|\+=|-=)/,o0=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/;var os={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:Ea,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:eo,delay:0,loopDelay:0,ease:"out(2)",composition:It.replace,modifier:Y_,onBegin:zt,onBeforeUpdate:zt,onUpdate:zt,onLoop:zt,onPause:zt,onComplete:zt,onRender:zt},wa={current:null,root:hr},Se={defaults:os,precision:4,timeScale:1,tickThreshold:200,editor:null},mm={version:"4.5.0",engine:null};Jn&&(zl.AnimeJS||(zl.AnimeJS=[]),zl.AnimeJS.push(mm));var gm=t=>t.replace(t0,"$1-$2").toLowerCase(),Fn=(t,e)=>t.indexOf(e)===0,Xo=Date.now,Vn=Array.isArray,di=t=>t&&t.constructor===Object,Mn=t=>typeof t=="number"&&!isNaN(t),In=t=>typeof t=="string",Qt=t=>typeof t=="function",te=t=>typeof t>"u",Ao=t=>te(t)||t===null,Zl=t=>Jn&&t instanceof SVGElement,ym=t=>K_.test(t),vm=t=>Fn(t,"rgb"),_m=t=>Fn(t,"hsl"),r0=t=>ym(t)||(vm(t)||_m(t))&&(t[t.length-1]===")"||!Z_.test(t)),Sa=t=>!Se.defaults.hasOwnProperty(t),zM=["opacity","rotate","overflow","color"],i0=(t,e)=>{if(zM.includes(e))return!1;if(t.getAttribute(e)||e in t){if(e==="scale"){let n=t.parentNode;return n&&n.tagName==="filter"}return!0}},Kl=t=>In(t)?parseFloat(t):t,ui=Math.pow,yr=Math.sqrt,s0=Math.sin,a0=Math.cos,li=Math.abs;var pi=Math.floor,c0=Math.asin;var Ta=Math.PI,hm=Math.round,mn=(t,e,n)=>t<e?e:t>n?n:t,We=(t,e)=>{if(e<0)return t;if(!e)return hm(t);let n=10**e;return hm(t*n)/n},l0=(t,e)=>Vn(e)?e.reduce((n,o)=>li(o-t)<li(n-t)?o:n):e?hm(t/e)*e:t,Jo=(t,e,n)=>n===1?e:n===0?t:t+(e-t)*n,fi=t=>t===1/0?xa:t===-1/0?-xa:t,er=t=>t<=Ne?Ne:fi(We(t,11)),qt=t=>Vn(t)?[...t]:t,Ql=(t,e)=>{let n=H({},t);for(let o in e){let r=t[o];n[o]=te(r)?e[o]:r}return n},tt=(t,e,n,o="_prev",r="_next")=>{let i=t._head,s=r;for(n&&(i=t._tail,s=o);i;){let a=i[s];e(i),i=a}},jn=(t,e,n="_prev",o="_next")=>{let r=e[n],i=e[o];r?r[o]=i:t._head=i,i?i[n]=r:t._tail=r,e[n]=null,e[o]=null},kn=(t,e,n,o="_prev",r="_next")=>{let i=t._tail;for(;i&&n&&n(i,e);)i=i[o];let s=i?i[r]:t._head;i?i[r]=e:t._head=e,s?s[o]=e:t._tail=e,e[o]=i,e[r]=s};var d0=(t,e,n)=>{let o=t.style.transform;if(o){let r=t[gr],i=0,s=o.length,a;for(;i<s;){for(;i<s&&o.charCodeAt(i)===32;)i++;if(i>=s)break;let l=i;for(;i<s&&o.charCodeAt(i)!==40;)i++;if(i>=s)break;let d=o.substring(l,i),f=1,y=i+1,v=-1,x=-1;for(i++;i<s&&f>0;){let P=o.charCodeAt(i);P===40?f++:P===41?f--:P===44&&f===1&&(v===-1?v=i:x===-1&&(x=i)),i++}let C=i-1;d==="translate"||d==="translate3d"?(v===-1?r.translateX=o.substring(y,C).trim():(r.translateX=o.substring(y,v).trim(),x===-1?r.translateY=o.substring(v+1,C).trim():(r.translateY=o.substring(v+1,x).trim(),r.translateZ=o.substring(x+1,C).trim())),a=o.substring(y,C)):d==="scale"||d==="scale3d"?v===-1?r.scale=o.substring(y,C).trim():(r.scaleX=o.substring(y,v).trim(),x===-1?r.scaleY=o.substring(v+1,C).trim():(r.scaleY=o.substring(v+1,x).trim(),r.scaleZ=o.substring(x+1,C).trim())):r[d]=o.substring(y,C)}if(e==="translate3d"&&a)return n&&(n[e]=a),a;let c=r[e];if(!te(c))return n&&(n[e]=c),c}return e==="translate3d"?"0px, 0px, 0px":e==="rotate3d"?"0, 0, 0, 0deg":Fn(e,"scale")?"1":Fn(e,"rotate")||Fn(e,"skew")?"0deg":"0px"},Xl=t=>{let e=to;for(let n=0,o=ns.length;n<o;n++){let r=ns[n],i=t[r];if(i!==void 0){if(r==="translateX"){let s=t.translateY;if(s!==void 0){let a=t.translateZ;a!==void 0?(e+=`translate3d(${i},${s},${a}) `,n+=2):(e+=`translate(${i},${s}) `,n+=1);continue}}if(r==="scaleX"&&t.scale===void 0){let s=t.scaleY;if(s!==void 0){let a=t.scaleZ;a!==void 0?(e+=`scale3d(${i},${s},${a}) `,n+=2):(e+=`scale(${i},${s}) `,n+=1);continue}}e+=`${W_[r]}${i}) `}r==="rotateZ"&&t.rotate3d!==void 0&&(e+=`rotate3d(${t.rotate3d}) `)}return t.matrix!==void 0&&(e+=`matrix(${t.matrix}) `),t.matrix3d!==void 0&&(e+=`matrix3d(${t.matrix3d}) `),e};var bm=[];function Jl(t,e){if(!t)return null;let n=bm.length;e:for(let o=0;o<n;o++){let r=bm[o];if(r.detect&&!r.detect(t))continue;let i=r.targetAdapters;for(let s=0,a=i.length;s<a;s++){let c=i[s];if(c.detect(t)){let l=c.props[e];if(l&&(!l.gate||l.gate(t)))return l;break e}}}for(let o=0;o<n;o++){let r=bm[o];if(r.detect&&!r.detect(t))continue;let i=r.propertyResolvers;for(let s=0,a=i.length;s<a;s++){let c=i[s](t,e);if(c)return c}}return null}var qM=t=>{let e=Q_.exec(t)||X_.exec(t),n=te(e[4])?1:+e[4];return[+e[1],+e[2],+e[3],n]},GM=t=>{let e=t.length,n=e===4||e===5;return[+("0x"+t[1]+t[n?1:2]),+("0x"+t[n?2:3]+t[n?2:4]),+("0x"+t[n?3:5]+t[n?3:6]),e===5||e===9?+(+("0x"+t[n?4:7]+t[n?4:8])/255).toFixed(3):1]},xm=(t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t),WM=t=>{let e=J_.exec(t)||e0.exec(t),n=+e[1]/360,o=+e[2]/100,r=+e[3]/100,i=te(e[4])?1:+e[4],s,a,c;if(o===0)s=a=c=r;else{let l=r<.5?r*(1+o):r+o-r*o,d=2*r-l;s=We(xm(d,l,n+1/3)*255,0),a=We(xm(d,l,n)*255,0),c=We(xm(d,l,n-1/3)*255,0)}return[s,a,c,i]},u0=t=>vm(t)?qM(t):ym(t)?GM(t):_m(t)?WM(t):[0,0,0,1];var kt=(t,e)=>te(t)?e:t,p0=(t,e)=>{let n=t.match(o0),o=e[Po]?e:document.documentElement,r=getComputedStyle(o)?.getPropertyValue(n[1]);return(!r||r.trim()===to)&&n[2]&&(r=n[2].trim()),r||0},Ro=(t,e,n,o,r,i)=>{if(Qt(t)){if(!r){let a=t(e,n,o,i);return isNaN(+a)?a||0:+a}let s=()=>{let a=t(e,n,o,i);return isNaN(+a)?a||0:+a};return r.func=s,s()}if(In(t)&&Fn(t,G_)){if(!r)return p0(t,e);let s=()=>p0(t,e);return r.func=s,s()}return t},Ma=(t,e)=>t[Po]?t[ql]&&i0(t,e)?ft.ATTRIBUTE:ns.includes(e)||Wl.get(e)?ft.TRANSFORM:Fn(e,"--")?ft.CSS_VAR:e in t.style?ft.CSS:e in t?ft.OBJECT:ft.ATTRIBUTE:ft.OBJECT,f0=(t,e,n)=>{let o=t.style[e];o&&n&&(n[e]=o);let r=o||getComputedStyle(t[Gl]||t).getPropertyValue(e);return r==="auto"?"0":r},Lo=(t,e,n,o)=>{let r=te(n)?Ma(t,e):n,i=Jl(t,e);if(i){let s=i.get(t);return s&&o&&(o[e]=s),s??0}if(r===ft.OBJECT){let s=t[e];return s&&o&&(o[e]=s),s||0}if(r===ft.ATTRIBUTE){let s=t.getAttribute(e);return s&&o&&(o[e]=s),s}return r===ft.TRANSFORM?d0(t,e,o):r===ft.CSS_VAR?f0(t,e,o).trimStart():f0(t,e,o)},rs=(t,e,n)=>n==="-"?t-e:n==="+"?t+e:t*e,ed=()=>({t:ke.NUMBER,n:0,u:null,o:null,d:null,s:null}),hn=(t,e)=>{if(e.t=ke.NUMBER,e.n=0,e.u=null,e.o=null,e.d=null,e.s=null,!t)return e;let n=+t;if(!isNaN(n))return e.n=n,e;let o=t;o[1]==="="&&(e.o=o[0],o=o.slice(2));let r=o.includes(" ")?!1:Yl.exec(o);if(r)return e.t=ke.UNIT,e.n=+r[1],e.u=r[2],e;if(e.o)return e.n=+o,e;if(r0(o))return e.t=ke.COLOR,e.d=u0(o),e;{let i=o.match(fm);return e.t=ke.COMPLEX,e.d=i?i.map(Number):[],e.s=o.split(fm)||[],e}},Em=(t,e)=>(e.t=t._valueType,e.n=t._toNumber,e.u=t._unit,e.o=null,e.d=qt(t._toNumbers),e.s=qt(t._strings),e),Xt=ed(),td=(t,e,n)=>{let o=t._modifier,r=t._fromNumbers,i=t._toNumbers,s=t._strings,a=s[0];for(let c=0,l=i.length;c<l;c++){let d=o(We(Jo(r[c],i[c],e),n)),f=s[c+1];a+=`${f?d+f:d}`,t._numbers[c]=d}return a};var Ia=(t,e,n,o,r)=>{let i=t.parent,s=t.duration,a=t.completed,c=t.iterationDuration,l=t.iterationCount,d=t._currentIteration,f=t._loopDelay,y=t._reversed,v=t._alternate,x=t._hasChildren,C=t._delay,P=t._currentTime,Y=C+c,G=e-C,ve=mn(P,-C,s),le=mn(G,-C,s),Ee=G-P,ie=le>0,Qe=le>=s,Le=s<=Ne,He=r===Kt.FORCE,dt=0,Et=G,Pt=0;if(l>1){let Z=c+(Qe?0:f),U=~~(le/Z);t._currentIteration=mn(U,0,l),Qe&&t._currentIteration--,dt=t._currentIteration%2,Et=le-U*Z||0}let St=y^(v&&dt),Xe=t._ease,ge=Qe?St?0:s:St?c-Et:Et;Xe&&(ge=c*Xe(ge/c)||0);let O=(i?i.backwards:G<P)?!St:!!St;if(t._currentTime=G,t._iterationTime=ge,t.backwards=O,ie&&!t.began?(t.began=!0,!n&&!(i&&(O||!i.began))&&t.onBegin(t)):G<=0&&(t.began=!1),!n&&!x&&ie&&t._currentIteration!==d&&t.onLoop(t),He||r===Kt.AUTO&&(e>=(i&&C>0?0:C)&&e<=Y||e<=C&&ve>C||e>=Y&&ve!==s)||ge>=Y&&ve!==s||ge<=C&&ve>0&&!Qe||e<=ve&&ve===s&&a||Qe&&!a&&Le){if(ie&&(t.computeDeltaTime(ve),n||t.onBeforeUpdate(t)),!x){let Z=He||(O?Ee*-1:Ee)>=Se.tickThreshold,U=We(t._offset+(i?i._offset:0)+C+ge,12),A=t._head,J,Pe,Je,jt,fe=0;for(;A;){let gt=A._composition,Be=A._currentTime,tn=A._changeDuration,$t=A._absoluteStartTime+A._changeDuration,Ye=A._nextRep,Ut=A._prevRep,At=gt!==It.none,De=Ut?Ut._absoluteStartTime+Ut._changeDuration:0,qe=Ut&&Ut.parent!==A.parent,Ce=!Ye||Ye._isOverridden?$t:Ye.parent===A.parent?$t+Ye._delay:Ye._absoluteStartTime<Ye._absoluteUpdateStartTime?Ye._absoluteStartTime:Ye._absoluteUpdateStartTime;if((Z||(Be!==tn||U<=Ce||Ut&&!qe&&(!Ye||Ye.parent!==A.parent))&&(Be!==0||U>=A._absoluteStartTime||qe&&!A._hasFromValue&&!Ut._isOverridden&&U>=De||Ye&&!Ye._isOverridden&&Ye.parent===A.parent&&Ye._currentTime!==0&&ge<Ye._startTime))&&(!Ut||qe||ge>=A._startTime)&&(!At||!A._isOverridden&&(!A._isOverlapped||U<=$t)&&(!Ye||Ye._isOverridden||U<=Ce)&&(!Ut||Ut._isOverridden||(qe?U>=A._absoluteStartTime||!A._hasFromValue&&U>=De:U>=De+A._delay)))){let nt=A._currentTime=mn(ge-A._startTime,0,tn),oe=A._ease(nt/A._updateDuration),ct=A._modifier,W=A._valueType,mt=A._tweenType,Ke=mt===ft.OBJECT,ne=W===ke.NUMBER,_t=ne&&Ke||oe===0||oe===1?-1:Se.precision,me,st;if(ne)me=st=ct(We(Jo(A._fromNumber,A._toNumber,oe),_t));else if(W===ke.UNIT)st=ct(We(Jo(A._fromNumber,A._toNumber,oe),_t)),me=`${st}${A._unit}`;else if(W===ke.COLOR){let Ue=A._numbers,F=A._fromNumbers,j=A._toNumbers,X=1-oe,re=F[0],ut=F[1],Ct=F[2],Un=j[0],pn=j[1],xo=j[2];Ue[0]=ct(Math.sqrt(re*re*X+Un*Un*oe)),Ue[1]=ct(Math.sqrt(ut*ut*X+pn*pn*oe)),Ue[2]=ct(Math.sqrt(Ct*Ct*X+xo*xo*oe)),Ue[3]=ct(Jo(F[3],j[3],oe)),(!A._setter||o)&&(me=`rgba(${We(Ue[0],0)},${We(Ue[1],0)},${We(Ue[2],0)},${Ue[3]})`)}else W===ke.COMPLEX&&(me=td(A,oe,_t));if(At&&(A._number=st),!o&>!==It.blend){let Ue=A.property;J=A.target,A._setter?A._setter(J,st,A):Ke?J[Ue]=me:mt===ft.ATTRIBUTE?J.setAttribute(Ue,me):(Pe=J.style,mt===ft.TRANSFORM?(J!==Je&&(Je=J,jt=J[gr]),jt[Ue]=me,fe=1):mt===ft.CSS?Pe[Ue]=me:mt===ft.CSS_VAR&&Pe.setProperty(Ue,me)),ie&&(Pt=1)}else A._value=me}else Be&&Ut&&!qe&&ge<A._startTime&&(A._currentTime=0);fe&&A._renderTransforms&&(Pe.transform=Xl(jt),fe=0),A=A._next}!n&&Pt&&t.onRender(t)}!n&&ie&&t.onUpdate(t)}return i&&Le?!n&&(i.began&&!O&&G>0&&!a||O&&G<=Ne&&a)&&(t.onComplete(t),t.completed=!O):ie&&Qe?l===1/0?t._startTime+=t.duration:t._currentIteration>=l-1&&(t.paused=!0,!a&&!x&&(t.completed=!0,!n&&!(i&&(O||!i.began))&&(t.onComplete(t),t._resolve(t)))):t.completed=!1,Pt},Fo=(t,e,n,o,r)=>{let i=t._currentIteration;if(Ia(t,e,n,o,r),t._hasChildren){let s=t,a=s.backwards,c=o?e:s._iterationTime,l=Xo(),d=0,f=!0;if(!o&&s._currentIteration!==i){let y=s.iterationDuration;tt(s,v=>{if(!a)!v.completed&&!v.backwards&&v._currentTime<v.iterationDuration&&Ia(v,y,n,1,Kt.FORCE),v.began=!1,v.completed=!1;else{let x=v.duration,C=v._offset+v._delay,P=C+x;!n&&x<=Ne&&(!C||P===y)&&v.onComplete(v)}}),n||s.onLoop(s)}tt(s,y=>{let v=We((c-y._offset)*y._speed,12);if(a&&v>y._delay+y.duration)return;let x=y._fps<s._fps?y.requestTick(l):r;d+=Ia(y,v,n,o,x),!y.completed&&f&&(f=!1)},a),!n&&d&&s.onRender(s),(f||a)&&s._currentTime>=s.duration&&(s.paused=!0,s.completed||(s.completed=!0,n||(s.onComplete(s),s._resolve(s))))}};var m0={},is=(t,e,n)=>{if(n===ft.TRANSFORM){let o=Wl.get(t);return o||t}else if(n===ft.CSS||n===ft.ATTRIBUTE&&Zl(e)&&t in e.style){let o=m0[t];if(o)return o;{let r=t&&gm(t);return m0[t]=r,r}}else return t},ss=(t,e=!1)=>{if(t._hasChildren)tt(t,n=>ss(n,e),!0);else{let n=t;n.pause(),tt(n,o=>{let r=o.property,i=o.target,s=o._tweenType,a=o._inlineValue,c=Ao(a)||a===to;if(o._setter){if(!e&&!c){if(hn(a,Xt),Xt.d){let l=Xt.d,d=o._numbers;for(let f=0,y=l.length;f<y;f++)d[f]=l[f]}else o._number=Xt.n;o._setter(o.target,o._number,o)}}else if(s===ft.OBJECT)!e&&!c&&(i[r]=a);else if(i[Po])if(s===ft.ATTRIBUTE)e||(c?i.removeAttribute(r):i.setAttribute(r,a));else{let l=i.style;if(s===ft.TRANSFORM){let d=i[gr];c?delete d[r]:d[r]=a,o._renderTransforms&&(Object.keys(d).length?l.transform=Xl(d):l.removeProperty("transform"))}else c?l.removeProperty(gm(r)):l[r]=a}i[Po]&&n._tail===o&&n.targets.forEach(l=>{l.getAttribute&&l.getAttribute("style")===to&&l.removeAttribute("style")})})}return t},h0=t=>ss(t,!0);var as=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=eo/Ea,this._fps=Ea,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){let n=+e,o=n<Ne?Ne:n,r=eo/o;o>os.frameRate&&(os.frameRate=o),this._fps=o,this._frameDuration=r}get speed(){return this._speed}set speed(e){let n=+e;this._speed=n<Ne?Ne:n}requestTick(e){let n=this._frameDuration,o=e-this._lastTickTime,r=n*.25,i=r<4?r:4;return o+i<n?Kt.NONE:(this._lastTickTime=o>=n?e-o%n:e,Kt.AUTO)}computeDeltaTime(e){let n=e-this._lastTime;return this.deltaTime=n,this._lastTime=e,n}};var tr={animation:null,update:zt},g0=t=>{let e=tr.animation;return e||(e={duration:Ne,computeDeltaTime:zt,_offset:0,_delay:0,_head:null,_tail:null},tr.animation=e,tr.update=()=>{t.forEach(n=>{for(let o in n){let r=n[o],i=r._head;if(i){let s=i._valueType,a=s===ke.COMPLEX||s===ke.COLOR?qt(i._fromNumbers):null,c=i._fromNumber,l=r._tail;for(;l&&l!==i;){if(a)for(let d=0,f=l._numbers.length;d<f;d++)a[d]+=l._numbers[d];else c+=l._number;l=l._prevAdd}i._toNumber=c,i._toNumbers=a}}}),Ia(e,1,1,0,Kt.FORCE)}),e};var y0=Jn?requestAnimationFrame:setImmediate,YM=Jn?cancelAnimationFrame:clearImmediate,Cm=class extends as{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=os,this.paused=!0,this.reqId=0}update(){let e=this._currentTime=Xo();if(this.requestTick(e)){this.computeDeltaTime(e);let n=this._speed,o=this._fps,r=this._head;for(;r;){let i=r._next;r.paused?(jn(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):Fo(r,(e-r._startTime)*r._speed*n,0,0,r._fps<o?r.requestTick(e):Kt.AUTO),r=i}tr.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(Xo()),this.reqId=y0(v0)),this}pause(){if(this.reqId)return this.paused=!0,ZM()}resume(){if(this.paused)return this.paused=!1,tt(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(Se.timeScale===1?1:eo)}set speed(e){let n=e*Se.timeScale;this._speed!==n&&(this._speed=n,tt(this,o=>o.speed=o._speed))}get timeUnit(){return Se.timeScale===1?"ms":"s"}set timeUnit(e){let o=e==="s",r=o?.001:1;if(Se.timeScale!==r){Se.timeScale=r,Se.tickThreshold=200*r;let i=o?.001:eo;this.defaults.duration*=i,this._speed*=i}}get precision(){return Se.precision}set precision(e){Se.precision=e}},Jt=(()=>{let t=new Cm(Xo());return Jn&&(mm.engine=t,hr.addEventListener("visibilitychange",()=>{t.pauseOnDocumentHidden&&(hr.hidden?t.pause():t.resume())})),t})(),v0=()=>{Jt._head?(Jt.reqId=y0(v0),Jt.update()):Jt.reqId=0},ZM=()=>(YM(Jt.reqId),Jt.reqId=0,Jt);var nd={_rep:new WeakMap,_add:new Map},Na=(t,e,n="_rep")=>{let o=nd[n],r=o.get(t);return r||(r={},o.set(t,r)),r[e]?r[e]:r[e]={_head:null,_tail:null}},KM=(t,e)=>t._isOverridden||t._absoluteStartTime>e._absoluteStartTime,ka=t=>{t._isOverlapped=1,t._isOverridden=1,t._changeDuration=Ne,t._currentTime=Ne},od=(t,e)=>{let n=t._composition;if(n===It.replace){let o=t._absoluteStartTime;kn(e,t,KM,"_prevRep","_nextRep");let r=t._prevRep;if(r){let i=r.parent,s=r._absoluteEndTime;if(t.parent.id!==i.id&&i.iterationCount>1&&s+(i.duration-i.iterationDuration)>o){ka(r);let l=r._prevRep;for(;l&&l.parent.id===i.id;)ka(l),l=l._prevRep}let a=t._absoluteUpdateStartTime;if(s>a){let l=r._startTime,d=s-(l+r._updateDuration),f=We(a-d-l,12);r._changeDuration=f,r._currentTime=f,r._isOverlapped=1,f<Ne&&ka(r)}let c=t.parent.parent;if(!c||c!==i.parent){let l=!0;if(tt(i,d=>{d._isOverlapped||(l=!1)}),l){let d=i.parent;if(d){let f=!0;tt(d,y=>{y!==i&&tt(y,v=>{v._isOverlapped||(f=!1)})}),f&&d.cancel()}else i.cancel()}}}}else if(n===It.blend){let o=Na(t.target,t.property,"_add"),r=g0(nd._add),i=o._head;i||(i=H({},t),i._composition=It.replace,i._updateDuration=Ne,i._startTime=0,i._numbers=qt(t._fromNumbers),i._number=0,i._next=null,i._prev=null,kn(o,i),kn(r,i));let s=t._toNumber;if(t._fromNumber=i._fromNumber-s,t._toNumber=0,t._numbers=qt(t._fromNumbers),t._number=0,i._fromNumber=s,t._toNumbers.length){let a=qt(t._toNumbers);a.forEach((c,l)=>{t._fromNumbers[l]=i._fromNumbers[l]-c,t._toNumbers[l]=0}),i._fromNumbers=a}kn(o,t,null,"_prevAdd","_nextAdd")}return t},wm=t=>{let e=t._composition;if(e!==It.none){let n=t.target,o=t.property,s=nd._rep.get(n)[o];if(jn(s,t,"_prevRep","_nextRep"),e===It.blend){let a=nd._add,c=a.get(n);if(!c)return;let l=c[o],d=tr.animation;jn(l,t,"_prevAdd","_nextAdd");let f=l._head;if(f&&f===l._tail){jn(l,f,"_prevAdd","_nextAdd"),jn(d,f);let y=!0;for(let v in c)if(c[v]._head){y=!1;break}y&&a.delete(n)}}}return t},_0=(t,e,n)=>{let o=!1;return tt(e,r=>{let i=r.target;if(t.includes(i)){let s=r.property,a=r._tweenType,c=is(n,i,a);(!c||c&&c===s)&&(r.parent._tail===r&&r._tweenType===ft.TRANSFORM&&r._prev&&r._prev._tweenType===ft.TRANSFORM&&(r._prev._renderTransforms=1),jn(e,r),wm(r),o=!0)}},!0),o},Da=(t,e,n)=>{let o=e||Jt,r;if(o._hasChildren){let i=0;tt(o,s=>{if(!s._hasChildren)if(r=_0(t,s,n),r&&!s._head)s.cancel(),jn(o,s);else{let c=s._offset+s._delay+s.duration;c>i&&(i=c)}s._head?Da(t,s,n):s._hasChildren=!1},!0),te(o.iterationDuration)||(o.iterationDuration=i)}else r=_0(t,o,n);r&&!o._head&&(o._hasChildren=!1,o.cancel&&o.cancel())};var b0=t=>(t.paused=!0,t.began=!1,t.completed=!1,t),Sm=t=>(t._cancelled&&(t._hasChildren?tt(t,Sm):tt(t,e=>{e._composition!==It.none&&od(e,Na(e.target,e.property))}),t._cancelled=0),t),x0=0,QM=(t,e)=>t._priority>e._priority,nr=class extends as{constructor(e={},n=null,o=0){super(0),++x0;let{id:r,delay:i,duration:s,reversed:a,alternate:c,loop:l,loopDelay:d,autoplay:f,frameRate:y,playbackRate:v,priority:x,onComplete:C,onLoop:P,onPause:Y,onBegin:G,onBeforeUpdate:ve,onUpdate:le}=e;wa.current&&wa.current.register(this);let Ee=n?0:Jt._lastTickTime,ie=n?n.defaults:Se.defaults,Qe=Qt(i)||te(i)?ie.delay:+i,Le=Qt(s)||te(s)?1/0:+s,He=kt(l,ie.loop),dt=kt(d,ie.loopDelay),Et=He===!0||He===1/0||He<0?1/0:He+1,Pt=0;n?Pt=o:(Jt.reqId||Jt.requestTick(Xo()),Pt=(Jt._lastTickTime-Jt._startTime)*Se.timeScale),this.id=te(r)?x0:r,this.parent=n,this.duration=fi((Le+dt)*Et-dt)||Ne,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=G||ie.onBegin,this.onBeforeUpdate=ve||ie.onBeforeUpdate,this.onUpdate=le||ie.onUpdate,this.onLoop=P||ie.onLoop,this.onPause=Y||ie.onPause,this.onComplete=C||ie.onComplete,this.iterationDuration=Le,this.iterationCount=Et,this._autoplay=n?!1:kt(f,ie.autoplay),this._offset=Pt,this._delay=Qe,this._loopDelay=dt,this._iterationTime=0,this._currentIteration=0,this._resolve=zt,this._running=!1,this._reversed=+kt(a,ie.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=kt(c,ie.alternate),this._prev=null,this._next=null,this._lastTickTime=Ee,this._startTime=Ee,this._lastTime=Ee,this._fps=kt(y,ie.frameRate),this._speed=kt(v,ie.playbackRate),this._priority=+kt(x,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return mn(We(this._currentTime,Se.precision),-this._delay,this.duration)}set currentTime(e){let n=this.paused;this.pause().seek(+e),n||this.resume()}get iterationCurrentTime(){return mn(We(this._iterationTime,Se.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return mn(We(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return mn(We(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){let n=this.iterationDuration;this.currentTime=n*this._currentIteration+n*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*mn(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return Sm(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,Fo(this,0,1,~~e,Kt.FORCE),b0(this),this._hasChildren&&tt(this,b0),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&Fo(this,this.duration,1,~~e,Kt.FORCE),this.reset(e);let n=this._autoplay;return n===!0?this.resume():n&&!te(n.linked)&&n.link(this),this}resetTime(){let e=1/(this._speed*Jt._speed);return this._startTime=Xo()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=Ne&&!this._hasChildren?Fo(this,Ne,0,0,Kt.FORCE):(this._running||(kn(Jt,this,QM),Jt._hasChildren=!0,this._running=!0),this.resetTime(),this._startTime-=12,Jt.wake()),this):this}restart(){return this.reset().resume()}seek(e,n=0,o=0){Sm(this),this.completed=!1;let r=this.paused;return this.paused=!0,Fo(this,e+this._delay,~~n,~~o,Kt.AUTO),r?this:this.resume()}alternate(){let e=this._reversed,n=this.iterationCount,o=this.iterationDuration,r=n===1/0?pi(xa/o):n;return this._reversed=+(this._alternate&&!(r%2)?e:!e),n===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(o*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?tt(this,e=>e.cancel(),!0):tt(this,wm),this._cancelled=1,this.pause()}stretch(e){let n=this.duration,o=er(e);if(n===o)return this;let r=e/n,i=e<=Ne;return this.duration=i?Ne:o,this.iterationDuration=i?Ne:er(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){Fo(this,0,1,0,Kt.AUTO);let e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=zt){let n=this.then,o=()=>{this.then=null,e(this),this.then=n,this._resolve=zt};return new Promise(r=>(this._resolve=()=>r(o()),this.completed&&this._resolve(),this))}};function E0(t){let e=In(t)?wa.root.querySelectorAll(t):t;if(e instanceof NodeList||e instanceof HTMLCollection)return e}function vr(t){if(Ao(t))return[];if(!Jn)return Vn(t)&&t.flat(1/0)||[t];if(Vn(t)){let n=t.flat(1/0),o=[];for(let r=0,i=n.length;r<i;r++){let s=n[r];if(!Ao(s)){let a=E0(s);if(a)for(let c=0,l=a.length;c<l;c++){let d=a[c];if(!Ao(d)){let f=!1;for(let y=0,v=o.length;y<v;y++)if(o[y]===d){f=!0;break}f||o.push(d)}}else{let c=!1;for(let l=0,d=o.length;l<d;l++)if(o[l]===s){c=!0;break}c||o.push(s)}}}return o}let e=E0(t);return e?Array.from(e):[t]}function _r(t){let e=vr(t),n=e.length;for(let o=0;o<n;o++){let r=e[o];if(!r[pm]){r[pm]=!0;let i=Zl(r);(r.nodeType||i)&&(r[Po]=!0,r[ql]=i,r[gr]={})}}return e}var Tm={deg:1,rad:180/Ta,turn:360},C0={},Oa=(t,e,n,o=!1)=>{let r=e.u,i=e.n;if(e.t===ke.UNIT&&r===n)return e;let s=i+r+n,a=C0[s];if(!te(a)&&!o)e.n=a;else{let c;if(r in Tm)c=i*Tm[r]/Tm[n];else{let d=t.cloneNode(),f=t.parentNode,y=f&&f!==hr?f:hr.body;y.appendChild(d);let v=d.style;v.width=100+r;let x=d.offsetWidth||100;v.width=100+n;let C=d.offsetWidth||100,P=x/C;y.removeChild(d),c=P*i}e.n=c,C0[s]=c}return e.t,ke.UNIT,e.u=n,e};var or=t=>t;var Pa=(t=1.68)=>e=>ui(e,+t),Im={in:t=>e=>t(e),out:t=>e=>1-t(1-e),inOut:t=>e=>e<.5?t(e*2)/2:1-t(e*-2+2)/2,outIn:t=>e=>e<.5?(1-t(1-e*2))/2:(t(e*2-1)+1)/2},XM=Ta/2,w0=Ta*2,S0={[to]:Pa,Quad:Pa(2),Cubic:Pa(3),Quart:Pa(4),Quint:Pa(5),Sine:t=>1-a0(t*XM),Circ:t=>1-yr(1-t*t),Expo:t=>t?ui(2,10*t-10):0,Bounce:t=>{let e,n=4;for(;t<((e=ui(2,--n))-1)/11;);return 1/ui(4,3-n)-7.5625*ui((e*3-2)/22-t,2)},Back:(t=1.7)=>e=>(+t+1)*e*e*e-+t*e*e,Elastic:(t=1,e=.3)=>{let n=mn(+t,1,10),o=mn(+e,Ne,2),r=o/w0*c0(1/n),i=w0/o;return s=>s===0||s===1?s:-n*ui(2,-10*(1-s))*s0((1-s-r)*i)}},Mm=(()=>{let t={linear:or,none:or};for(let e in Im)for(let n in S0){let o=S0[n],r=Im[e];t[e+n]=n===to||n==="Back"||n==="Elastic"?(i,s)=>r(o(i,s)):r(o)}return t})(),rd={linear:or,none:or},JM=t=>{if(rd[t])return rd[t];if(t.indexOf("(")<=-1){let n=Im[t]||t.includes("Back")||t.includes("Elastic")?Mm[t]():Mm[t];return n?rd[t]=n:or}else{let e=t.slice(0,-1).split("("),n=Mm[e[0]];return n?rd[t]=n(...e[1].split(",")):or}},T0=["steps(","irregular(","linear(","cubicBezier("],mi=t=>{if(In(t)){for(let n=0,o=T0.length;n<o;n++)if(Fn(t,T0[n]))return console.warn(`String syntax for \`ease: "${t}"\` has been removed from the core and replaced by importing and passing the easing function directly: \`ease: ${t}\``),or}return Qt(t)?t:In(t)?JM(t):or};var xe=ed(),je=ed(),cs={},id={func:null},sd={func:null},ad=[null],ls=[null,null],cd={to:null},eI=0,M0=0,br,Vo,tI=(t,e)=>{let n={};if(Vn(t)){let o=[].concat(...t.map(r=>Object.keys(r))).filter(Sa);for(let r=0,i=o.length;r<i;r++){let s=o[r],a=t.map(c=>{let l={};for(let d in c){let f=c[d];Sa(d)?d===s&&(l.to=f):l[d]=f}return l});n[s]=a}}else{let o=kt(e.duration,Se.defaults.duration);Object.keys(t).map(i=>({o:parseFloat(i)/100,p:t[i]})).sort((i,s)=>i.o-s.o).forEach(i=>{let s=i.o,a=i.p;for(let c in a)if(Sa(c)){let l=n[c];l||(l=n[c]=[]);let d=s*o,f=l.length,y=l[f-1],v={to:a[c]},x=0;for(let C=0;C<f;C++)x+=l[C].duration;f===1&&(v.from=y.to),a.ease&&(v.ease=a.ease),v.duration=d-(f?x:0),l.push(v)}return i});for(let i in n){let s=n[i],a;for(let c=0,l=s.length;c<l;c++){let d=s[c],f=d.ease;d.ease=a||void 0,a=f}s[0].duration||s.shift()}}return n},xr=class extends nr{constructor(e,n,o,r,i=!1,s=0,a){super(n,o,r),this._head,this._tail,++M0;let c=_r(e),l=c.length,d=n.keyframes,f=d?Ql(tI(d,n),n):n,{id:y,delay:v,duration:x,ease:C,playbackEase:P,modifier:Y,composition:G,onRender:ve}=f,le=o?o.defaults:Se.defaults,Ee=kt(C,le.ease),ie=kt(P,le.playbackEase),Qe=ie?mi(ie):null,Le=!te(Ee.ease),He=Le?Ee.ease:kt(C,Qe?"linear":le.ease),dt=Le?Ee.settlingDuration:kt(x,le.duration),Et=kt(v,le.delay),Pt=Y||le.modifier,St=te(G)&&l>=eo?It.none:te(G)?le.composition:G,Xe=this._offset+(o?o._offset:0);Le&&(Ee.parent=this);let ge=NaN,O=NaN,Z=0,U=0;for(let A=0;A<l;A++){let J=c[A],Pe=s||A,Je=a||c,jt=NaN,fe=NaN;for(let gt in f)if(Sa(gt)){let Be=Ma(J,gt),tn=Jl(J,gt),$t=is(gt,J,Be),Ye=f[gt],Ut=Vn(Ye);if(i&&!Ut&&(ls[0]=Ye,ls[1]=Ye,Ye=ls),Ut){let oe=Ye.length,ct=!di(Ye[0]);oe===2&&ct?(cd.to=Ye,ad[0]=cd,br=ad):oe>2&&ct?(br=[],Ye.forEach((W,mt)=>{mt?mt===1?(ls[1]=W,br.push(ls)):br.push(W):ls[0]=W})):br=Ye}else ad[0]=Ye,br=ad;let At=null,De=null,qe=NaN,Ce=0,nt=0;for(let oe=br.length;nt<oe;nt++){let ct=br[nt];di(ct)?Vo=ct:(cd.to=ct,Vo=cd),id.func=null,sd.func=null;let W=Ro(kt(Vo.composition,St),J,Pe,Je,null,null),mt=Mn(W)?W:It[W];!At&&mt!==It.none&&(At=Na(J,$t));let Ke=At?At._tail:null,ne=o&&Ke&&Ke.parent.parent===o?Ke:De,_t=Ro(Vo.to,J,Pe,Je,id,ne),me;di(_t)&&!te(_t.to)?(Vo=_t,me=_t.to):me=_t;let st=Ro(Vo.from,J,Pe,Je,sd,ne),Ue=Vo.ease||He,F=Ro(Ue,J,Pe,Je,null,ne),j=Qt(F)||In(F)?F:Ue,X=!te(j)&&!te(j.ease),re=X?j.ease:j,ut=X?j.settlingDuration:Ro(kt(Vo.duration,oe>1?Ro(dt,J,Pe,Je,null,ne)/oe:dt),J,Pe,Je,null,ne),Ct=Ro(kt(Vo.delay,nt?0:Et),J,Pe,Je,null,ne),Un=Vo.modifier||Pt,pn=!te(st),xo=!te(me),Eo=Vn(me),Za=Eo||pn&&xo,Ka=De?Ce:0,Ei=De?Ce+Ct:Ct,Ir=We(Xe+Ei,12),ws=We(Xe+Ka,12);!U&&(pn||Eo)&&(U=1);let Yt=De;if(mt!==It.none){let Me=At._head;for(;Me&&Me._absoluteStartTime<=Ir;)if(Me._isOverridden||(Yt=Me),Me=Me._nextRep,Me&&Me._absoluteStartTime>=Ir)for(;Me;)ka(Me),Me=Me._nextRep}if(Za){hn(Eo?Ro(me[0],J,Pe,Je,sd,ne):st,xe),hn(Eo?Ro(me[1],J,Pe,Je,id,ne):me,je);let Me=Lo(J,$t,Be,cs);xe.t===ke.NUMBER&&(Yt?Yt._valueType===ke.UNIT&&(xe.t=ke.UNIT,xe.u=Yt._unit):(hn(Me,Xt),Xt.t===ke.UNIT&&(xe.t=ke.UNIT,xe.u=Xt.u)))}else xo?hn(me,je):De?Em(De,je):hn(o&&Yt&&Yt.parent.parent===o?Yt._value:Lo(J,$t,Be,cs),je),pn?hn(st,xe):De?Em(De,xe):hn(o&&Yt&&Yt.parent.parent===o?Yt._value:Lo(J,$t,Be,cs),xe);if(xe.o&&(xe.n=rs(Yt?Yt._toNumber:hn(Lo(J,$t,Be,cs),Xt).n,xe.n,xe.o)),je.o&&(je.n=rs(xe.n,je.n,je.o)),xe.t!==je.t){if(xe.t===ke.COMPLEX||je.t===ke.COMPLEX){let Me=xe.t===ke.COMPLEX?xe:je,Rt=xe.t===ke.COMPLEX?je:xe;Rt.t=ke.COMPLEX,Rt.s=qt(Me.s),Rt.d=Me.d.map(()=>Rt.n)}else if(xe.t===ke.UNIT||je.t===ke.UNIT){let Me=xe.t===ke.UNIT?xe:je,Rt=xe.t===ke.UNIT?je:xe;Rt.t=ke.UNIT,Rt.u=Me.u}else if(xe.t===ke.COLOR||je.t===ke.COLOR){let Me=xe.t===ke.COLOR?xe:je,Rt=xe.t===ke.COLOR?je:xe;Rt.t=ke.COLOR,Rt.d=Me.d.map(()=>0)}}if(xe.u!==je.u){let Me=je.u?xe:je;Me=Oa(J,Me,je.u?je.u:xe.u,!1)}if(je.d&&xe.d&&je.d.length!==xe.d.length){let Me=xe.d.length>je.d.length?xe:je,Rt=Me===xe?je:xe;Rt.d=Me.d.map((Xa,Ci)=>te(Rt.d[Ci])?0:Rt.d[Ci]),Rt.s=qt(Me.s)}let Co=We(+ut||Ne,12),Ss=cs[$t];Ao(Ss)||(cs[$t]=null);let Qa=tn?tn.set:null;Ce=We(Ei+Co,12);let kr=xe.d,Ts=je.d,Ms=je.s,nn={parent:this,id:eI++,property:$t,target:J,_value:null,_toFunc:id.func,_fromFunc:sd.func,_ease:mi(re),_fromNumbers:kr?qt(kr):Ca,_toNumbers:Ts?qt(Ts):Ca,_strings:Ms?qt(Ms):Ca,_fromNumber:xe.n,_toNumber:je.n,_numbers:kr?qt(kr):Ca,_number:xe.n,_unit:je.u,_modifier:Un,_currentTime:0,_startTime:Ei,_delay:+Ct,_updateDuration:Co,_changeDuration:Co,_absoluteStartTime:Ir,_absoluteUpdateStartTime:ws,_absoluteEndTime:We(Xe+Ce,12),_hasFromValue:pn||Eo?1:0,_tweenType:Be,_setter:Qa,_valueType:je.t,_composition:mt,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:Ss,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};mt!==It.none&&od(nn,At);let ir=nn._valueType;if(ir===ke.COMPLEX)nn._value=td(nn,1,-1);else if(ir===ke.UNIT)nn._value=`${Un(nn._toNumber)}${nn._unit}`;else if(ir===ke.COLOR){let Me=je.d;nn._value=`rgba(${We(Me[0],0)},${We(Me[1],0)},${We(Me[2],0)},${Me[3]})`}else nn._value=Un(nn._toNumber);isNaN(qe)&&(qe=nn._startTime),De=nn,Z++,kn(this,nn)}(isNaN(O)||qe<O)&&(O=qe),(isNaN(ge)||Ce>ge)&&(ge=Ce),Be===ft.TRANSFORM&&(jt=Z-nt,fe=Z)}if(!isNaN(jt)){let gt=0;tt(this,Be=>{gt>=jt&><fe&&(Be._renderTransforms=1,Be._composition===It.blend&&tt(tr.animation,tn=>{tn.id===Be.id&&(tn._renderTransforms=1)})),gt++})}}l||console.warn("No target found. Make sure the element you're trying to animate is accessible before creating your animation."),O?(tt(this,A=>{A._startTime-A._delay||(A._delay-=O),A._startTime-=O}),ge-=O):O=0,ge||(ge=Ne,this.iterationCount=0),this.targets=c,this.id=te(y)?M0:y,this.duration=ge===Ne?Ne:fi((ge+this._loopDelay)*this.iterationCount-this._loopDelay)||Ne,this.onRender=ve||le.onRender,this._ease=Qe,this._delay=O,this.iterationDuration=ge,!this._autoplay&&U&&this.onRender(this)}stretch(e){let n=this.duration;if(n===er(e))return this;let o=e/n;return tt(this,r=>{r._updateDuration=er(r._updateDuration*o),r._changeDuration=er(r._changeDuration*o),r._currentTime*=o,r._delay*=o,r._startTime*=o,r._absoluteStartTime*=o,r._absoluteUpdateStartTime*=o,r._absoluteEndTime*=o}),super.stretch(e)}refresh(){return tt(this,e=>{let n=e._toFunc,o=e._fromFunc;(n||o)&&(o?(hn(o(),xe),xe.u!==e._unit&&e.target[Po]&&Oa(e.target,xe,e._unit,!0),e._fromNumbers=qt(xe.d),e._fromNumber=xe.n):n&&(hn(Lo(e.target,e.property,e._tweenType),Xt),e._fromNumbers=qt(Xt.d),e._fromNumber=Xt.n),n&&(hn(n(),je),e._toNumbers=qt(je.d),e._strings=qt(je.s),e._toNumber=je.o?rs(e._fromNumber,je.n,je.o):je.n))}),this.duration===Ne&&this.restart(),this}revert(){return super.revert(),ss(this)}then(e){return super.then(e)}},on=(t,e)=>Se.editor?Se.editor.addAnimation(t,e):new xr(t,e,null,0,!1).init();var nI=(t,e)=>{if(Fn(e,"<")){let n=e[1]==="<",o=t._tail,r=o?o._offset+o._delay:0;return n?r:r+o.duration}},hi=(t,e)=>{let n=t.iterationDuration;if(n===Ne&&(n=0),te(e))return n;if(Mn(+e))return+e;let o=e,r=t?t.labels:null,i=!Ao(r),s=nI(t,o),a=!te(s),c=n0.exec(o);if(c){let l=c[0],d=o.split(l),f=i&&d[0]?r[d[0]]:n,y=a?s:i?f:n,v=+d[1];return rs(y,v,l[0])}else return a?s:i?te(r[o])?n:r[o]:n};function oI(t){return fi((t.iterationDuration+t._loopDelay)*t.iterationCount-t._loopDelay)||Ne}function km(t,e,n,o,r,i){let a=Mn(t.duration)&&t.duration<=Ne?n-Ne:n;e.composition&&Fo(e,a,1,1,Kt.AUTO);let c=o?new xr(o,t,e,a,!1,r,i):new nr(t,e,a);return e.composition&&c.init(!0),kn(e,c),tt(e,l=>{let f=l._offset+l._delay+l.duration;f>e.iterationDuration&&(e.iterationDuration=f)}),e.duration=oI(e),e}var I0=0,ld=class extends nr{constructor(e={}){super(e,null,0),++I0,this.id=te(e.id)?I0:e.id,this.duration=0,this.labels={};let n=e.defaults,o=Se.defaults;this.defaults=n?Ql(n,o):o,this.composition=kt(e.composition,!0),this.onRender=e.onRender||o.onRender;let r=kt(e.playbackEase,o.playbackEase);this._ease=r?mi(r):null,this.iterationDuration=0}add(e,n,o){let r=di(n),i=di(e);if(r||i){if(this._hasChildren=!0,r){let s=n,a=Se.editor&&Se.editor.addTimelineChild,c=o&&o.type==="Stagger"&&Se.editor,l=Qt(o)?o:null;if(l||c){let d=vr(e),f=this.duration,y=this.iterationDuration,v=s.id,x=0,C=d.length,P=a?a(e,s,this.id,o,C):null,Y=l||Se.editor.resolveStagger(o.defaultValue);d.forEach(G=>{let ve=H({},P||s);this.duration=f,this.iterationDuration=y,te(v)||(ve.id=v+"-"+x);let le=hi(this,Y(G,x,d,null,this));km(ve,this,le,G,x,d),x++})}else{let d=a?a(e,s,this.id,o):s,f=o&&o.type?o.defaultValue:o;km(d,this,hi(this,f),e)}}else km(e,this,hi(this,n));return this.composition&&this.init(!0),this}}sync(e,n){if(te(e)||e&&te(e.pause))return this;e.pause();let o=+(e.effect?e.effect.getTiming().duration:e.duration);!te(e)&&!te(e.persist)&&(e.persist=!0);let r=Se.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(n=r.addTimelineSync(e,n,this.id),r.addTimelineChild=null);let s=this.add(e,{currentTime:[0,o],duration:o,delay:0,ease:"linear",playbackEase:"linear"},n);return r&&(r.addTimelineChild=i),s}set(e,n,o){return te(n)?this:(n.duration=Ne,n.composition=It.replace,this.add(e,n,o))}call(e,n){return te(e)||e&&!Qt(e)?this:(Se.editor&&Se.editor.addTimelineCall&&(n=Se.editor.addTimelineCall(e,n,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},n))}label(e,n){return te(e)||e&&!In(e)?this:(Se.editor&&Se.editor.addTimelineLabel&&(n=Se.editor.addTimelineLabel(e,n,this.id)),this.labels[e]=hi(this,n),this)}remove(e,n){return Da(vr(e),this,n),this}stretch(e){let n=this.duration;if(n===er(e))return this;let o=e/n,r=this.labels;tt(this,i=>i.stretch(i.duration*o));for(let i in r)r[i]*=o;return super.stretch(e)}refresh(){return tt(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),tt(this,e=>e.revert,!0),ss(this)}then(e){return super.then(e)}},dd=t=>Se.editor?Se.editor.addTimeline(t):new ld(t).init();var Nm={};Dh(Nm,{clamp:()=>mn,damp:()=>uI,degToRad:()=>lI,lerp:()=>Jo,mapRange:()=>cI,padEnd:()=>sI,padStart:()=>iI,radToDeg:()=>dI,round:()=>We,roundPad:()=>rI,snap:()=>l0,wrap:()=>aI});var rI=(t,e)=>(+t).toFixed(e),iI=(t,e,n)=>`${t}`.padStart(e,n),sI=(t,e,n)=>`${t}`.padEnd(e,n),aI=(t,e,n)=>((t-e)%(n-e)+(n-e))%(n-e)+e,cI=(t,e,n,o,r)=>o+(t-e)/(n-e)*(r-o),lI=t=>t*Math.PI/180,dI=t=>t*180/Math.PI,uI=(t,e,n,o)=>o?o===1?e:Jo(t,e,1-Math.exp(-o*n*.1)):t;var k0={_head:null,_tail:null},N0=(t,e,n)=>{let o=k0._head,r;for(;o;){let i=o._next,s=o.$el===t,a=!e||o.property===e,c=!n||o.parent===n;if(s&&a&&c){r=o.animation;try{r.commitStyles()}catch{}r.cancel(),jn(k0,o);let l=o.parent;l&&(l._completed++,l.animations.length===l._completed&&(l.completed=!0,l.paused=!0,l.muteCallbacks||(l.onComplete(l),l._resolve(l))))}o=i}return r};function D0(t,e,n){let o=_r(t);if(!o.length)return;let[r]=o,i=Ma(r,e),s=is(e,r,i),a=Lo(r,s);if(te(n))return a;if(hn(a,Xt),Xt.t===ke.NUMBER||Xt.t===ke.UNIT){if(n===!1)return Xt.n;{let c=Oa(r,Xt,n,!1);return`${We(c.n,Se.precision)}${c.u}`}}}var O0=(t,e)=>{if(!te(e))return Se.editor&&Se.editor.addSet?Se.editor.addSet(t,e):(e.duration=Ne,e.composition=kt(e.composition,It.none),new xr(t,e,null,0,!0).resume())},P0=(t,e,n)=>{let o=vr(t);for(let r=0,i=o.length;r<i;r++)N0(o[r],n,e&&e.controlAnimation&&e);return Da(o,e,n),o};var A0=(t=zt)=>new nr({duration:1*Se.timeScale,onComplete:t},null,0).resume(),R0=t=>{let e;return((...n)=>{let o,r,i,s,a;e&&(o=e.currentIteration,r=e.iterationProgress,i=e.reversed,s=e._alternate,a=e._startTime,e.revert());let c=t(...n);return c&&!Qt(c)&&c.revert&&(e=c),te(r)||(e.currentIteration=o,e.iterationProgress=(s&&o%2?!i:i)?1-r:r,e._startTime=a),c||zt})};var Gt={};Dh(Gt,{$:()=>_r,addChild:()=>kn,clamp:()=>q0,cleanInlineStyles:()=>h0,createSeededRandom:()=>pd,damp:()=>Y0,degToRad:()=>B0,forEachChildren:()=>tt,get:()=>D0,keepTime:()=>R0,lerp:()=>W0,mapRange:()=>H0,padEnd:()=>j0,padStart:()=>V0,radToDeg:()=>U0,random:()=>ds,randomPick:()=>Z0,remove:()=>P0,removeChild:()=>jn,round:()=>G0,roundPad:()=>F0,set:()=>O0,shuffle:()=>fd,snap:()=>z0,stagger:()=>jo,sync:()=>A0,wrap:()=>$0});var no=Nm,ud={},pI=(t,e=0)=>(...n)=>e?o=>t(...n,o):o=>t(o,...n),L0=t=>(...e)=>{let n=t(...e);return new Proxy(zt,{apply:(o,r,[i])=>n(i),get:(o,r)=>{if(ud[r])return L0((...i)=>{let s=ud[r](...i);return a=>s(n(a))})}})},oo=(t,e,n=0)=>{let o=(...r)=>(r.length<e.length?L0(pI(e,n)):e)(...r);return ud[t]||(ud[t]=o),o},F0=oo("roundPad",no.roundPad),V0=oo("padStart",no.padStart),j0=oo("padEnd",no.padEnd),$0=oo("wrap",no.wrap),H0=oo("mapRange",no.mapRange),B0=oo("degToRad",no.degToRad),U0=oo("radToDeg",no.radToDeg),z0=oo("snap",no.snap),q0=oo("clamp",no.clamp),G0=oo("round",no.round),W0=oo("lerp",no.lerp,1),Y0=oo("damp",no.damp,1);var ds=(t=0,e=1,n=0)=>{let o=10**n;return Math.floor((Math.random()*(e-t+1/o)+t)*o)/o},fI=0,pd=(t,e=0,n=1,o=0)=>{let r=t===void 0?fI++:t;return(i=e,s=n,a=o)=>{r+=1831565813,r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61);let c=10**a;return Math.floor((((r^r>>>14)>>>0)/4294967296*(s-i+1/c)+i)*c)/c}},Z0=t=>t[ds(0,t.length-1)],fd=(t,e=ds)=>{let n=t.length,o,r;for(;n;)r=e(0,--n),o=t[n],t[n]=t[r],t[r]=o;return t};var jo=(t,e={})=>{let n=[],o=0,r,i=null,s=e.from,a=e.reversed,c=e.ease,l=!te(c),f=l&&!te(c.ease)?c.ease:l?mi(c):null,y=e.grid,v=y===!0,x=e.axis,C=e.total,P=te(s)||s===0||s==="first",Y=s==="center",G=s==="last",ve=s==="random",le=Vn(s),Ee=Vn(t),ie=e.use,Qe=Ee?Kl(t[0]):Kl(t),Le=Ee?Kl(t[1]):0,He=Yl.exec((Ee?t[1]:t)+to),dt=e.start||0+(Ee?Qe:0),Et=e.seed,St=!te(Et)&&Et!==!1?pd(Et===!0?0:Et):ds,Xe=e.jitter,ge=!te(Xe),O=Vn(Xe),Z=O?Xe[0]:Xe||0,U=O?Xe[1]:Xe||0,A=P?0:Mn(s)?s:0;return(J,Pe,Je,jt,fe)=>{let[gt]=_r(J),Be=te(C)?Je.length:C,tn=te(ie)?!1:Qt(ie)?ie(gt,Pe,Be):Lo(gt,ie),$t=Mn(tn)||In(tn)&&Mn(+tn)?+tn:Pe,Ye=$t>=0&&$t<Be?$t:Pe;if(Y&&(A=(Be-1)/2),G&&(A=Be-1),!n.length){if(v){let De=!0,qe=!1,Ce=1/0,nt=1/0,oe=1/0,ct=-1/0,W=-1/0,mt=-1/0,Ke=[],ne=[],_t=[];for(let me=0;me<Be;me++){let st=Je[me],Ue=0,F=0,j=0,X=!1;if(st&&Qt(st.getBoundingClientRect)){let re=st.getBoundingClientRect();Ue=re.left+re.width/2,F=re.top+re.height/2,X=!0}else{let re=st;re&&Mn(re.x)&&Mn(re.y)&&(Ue=re.x,F=re.y,Mn(re.z)&&(j=re.z,qe=!0),X=!0)}if(!X){De=!1;break}Ke.push(Ue),ne.push(F),_t.push(j),Ue<Ce&&(Ce=Ue),F<nt&&(nt=F),j<oe&&(oe=j),Ue>ct&&(ct=Ue),F>W&&(W=F),j>mt&&(mt=j)}if(De){let me=Ke[0],st=ne[0],Ue=_t[0];le?(me=Ce+s[0]*(ct-Ce),st=nt+s[1]*(W-nt),Ue=qe?oe+(s.length>=3?s[2]:.5)*(mt-oe):0):Y?(me=(Ce+ct)/2,st=(nt+W)/2,Ue=(oe+mt)/2):G?(me=Ke[Be-1],st=ne[Be-1],Ue=_t[Be-1]):Mn(s)&&(me=Ke[s],st=ne[s],Ue=_t[s]);for(let j=0;j<Be;j++){let X=me-Ke[j],re=st-ne[j],ut=Ue-_t[j],Ct=yr(X*X+re*re+(qe?ut*ut:0));x==="x"&&(Ct=-X),x==="y"&&(Ct=-re),x==="z"&&(Ct=-ut),n.push(Ct)}let F=1/0;for(let j=0;j<Be;j++){let X=li(n[j]);X>0&&X<F&&(F=X)}if(F>0&&F<1/0)for(let j=0;j<Be;j++)n[j]=n[j]/F}else for(let me=0;me<Be;me++)n.push(li(A-me))}else for(let De=0;De<Be;De++)if(!y)n.push(li(A-De));else{let qe=y.length,Ce=y[0]*y[1],nt,oe,ct;le?(nt=s[0]*(y[0]-1),oe=s[1]*(y[1]-1),ct=qe===3?(s.length>=3?s[2]:.5)*(y[2]-1):0):Y?(nt=(y[0]-1)/2,oe=(y[1]-1)/2,ct=qe===3?(y[2]-1)/2:0):(nt=A%y[0],oe=pi(A/y[0])%y[1],ct=qe===3?pi(A/Ce):0);let W=De%y[0],mt=pi(De/y[0])%y[1],Ke=qe===3?pi(De/Ce):0,ne=nt-W,_t=oe-mt,me=ct-Ke,st=yr(ne*ne+_t*_t+(qe===3?me*me:0));x==="x"&&(st=-ne),x==="y"&&(st=-_t),x==="z"&&(st=-me),n.push(st)}o=n[0];for(let De=1;De<Be;De++)n[De]>o&&(o=n[De]);if(f||a)for(let De=0;De<Be;De++){let qe=n[De];f&&(qe=f(qe/o)*o),a&&(qe=x?-qe:li(o-qe)),n[De]=qe}if(ge){i=new Array(Be);for(let De=0;De<Be;De++)i[De]=St(-1,1,4)}ve&&(n=fd(n,St))}let Ut=Ee?(Le-Qe)/o:Qe;te(r)&&(r=fe?hi(fe,te(e.start)?fe.iterationDuration:dt):dt);let At=r+(Ut*We(n[Ye],2)||0);if(ge){let De=o?n[Ye]/o:0,qe=Z+(U-Z)*De;At=At+i[Ye]*qe}return e.modifier&&(At=e.modifier(At)),He&&(At=`${At}${He[2]}`),At}};var mI=t=>{let e=1;if(t&&t.getCTM){let n=t.getCTM();if(n){let o=yr(n.a*n.a+n.b*n.b),r=yr(n.c*n.c+n.d*n.d);e=(o+r)/2}}return e},hI=(t,e,n)=>{let o=eo,r=getComputedStyle(t),i=r.strokeLinecap,s=r.vectorEffect==="non-scaling-stroke"?t:null,a=i,c=new Proxy(t,{get(l,d){let f=l[d];return d===Gl?l:d==="setAttribute"?(...y)=>{if(y[0]==="draw"){let x=y[1].split(" "),C=+x[0],P=+x[1],Y=mI(s),G=C*-o*Y,ve=P*o*Y+G,le=o*Y+(C===0&&P===1||C===1&&P===0?0:10*Y)-ve;if(i!=="butt"){let Ee=C===P?"butt":i;a!==Ee&&(l.style.strokeLinecap=`${Ee}`,a=Ee)}l.setAttribute("stroke-dashoffset",`${G}`),l.setAttribute("stroke-dasharray",`${ve} ${le}`)}return Reflect.apply(f,l,y)}:Qt(f)?(...y)=>Reflect.apply(f,l,y):f}});return t.getAttribute("pathLength")!==`${o}`&&(t.setAttribute("pathLength",`${o}`),c.setAttribute("draw",`${e} ${n}`)),c},Dm=(t,e=0,n=0)=>vr(t).map(r=>hI(r,e,n));var gn=class t{enabled=typeof window>"u"||typeof window.matchMedia!="function"||!window.matchMedia("(prefers-reduced-motion: reduce)").matches;get isEnabled(){return this.enabled}settle(e,n,o){setTimeout(()=>Gt.set(e,n),o)}enter(e,n={}){if(!e)return;let{y:o=8,scale:r,duration:i=260,delay:s=0,ease:a="out(3)"}=n,c={opacity:1,translateY:"0px",scale:1};if(!this.enabled){Gt.set(e,c);return}this.settle(e,c,s+i+120),on(e,Q(H({opacity:[0,1],translateY:[`${o}px`,"0px"]},r===void 0?{}:{scale:[r,1]}),{duration:i,delay:s,ease:a}))}enterList(e,n={}){let o=Array.from(e);if(o.length===0)return;let{y:r=8,duration:i=240,delay:s=0,each:a=30,ease:c="out(3)"}=n;if(!this.enabled){for(let l of o)Gt.set(l,{opacity:1,translateY:"0px"});return}o.forEach((l,d)=>{this.settle(l,{opacity:1,translateY:"0px"},s+d*a+i+120)}),on(o,{opacity:[0,1],translateY:[`${r}px`,"0px"],duration:i,delay:jo(a,{start:s}),ease:c})}reveal(e,n,o={}){let{animate:r=!0,after:i}=o;if(!e){i?.();return}let s={opacity:0,height:"0px"},a={opacity:1,height:"auto"},c=Math.max(e.scrollHeight,e.getBoundingClientRect().height);if(!this.enabled||!r||c===0){Gt.set(e,n?a:s),i?.();return}this.settle(e,n?a:s,(n?240:180)+160),on(e,{opacity:n?[0,1]:[1,0],height:n?["0px",`${c}px`]:[`${c}px`,"0px"],duration:n?240:180,ease:n?"out(3)":"in(2)",onComplete:()=>{Gt.set(e,n?a:s),i?.()}})}pulse(e){!this.enabled||!e||(this.settle(e,{opacity:1,scale:1},520),on(e,{opacity:[.4,1],scale:[.99,1],duration:320,ease:"out(2)"}))}pop(e,n={}){if(!e)return;let{scale:o=1.18,duration:r=220,ease:i="out(2)"}=n;this.enabled&&(this.settle(e,{scale:1},r+120),on(e,{scale:[o,1],duration:r,ease:i}))}loop(e,n,o={}){if(!e||!this.enabled)return()=>{};let{duration:r=900,delay:i=0,ease:s="inOut(2)",alternate:a=!0}=o,c=on(e,Q(H({},n),{duration:r,delay:i,ease:s,loop:!0,alternate:a})),l={};for(let[d,f]of Object.entries(n))l[d]=f[0];return()=>{c.pause(),Gt.set(e,l)}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Oe({token:t,factory:t.\u0275fac,providedIn:"root"})};var us=class t{target=null;aim(e){this.target=e}read(){return this.target}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Oe({token:t,factory:t.\u0275fac,providedIn:"root"})};function gI(t,e){if(t&1&&(b(0,"span",22),p(1),E()),t&2){let n=e.$implicit;u(),D(n)}}var K0=1800,yI=520,vI=K0,md=class t{status=ee("Connecting to the host\u2026");ready=ee(!1);dismissed=rt();letters=["M","o","r","s","e"];leaving=R(!1);host=N(Zt);animation=N(gn);handoff=N(us);intro;loops=[];introSettle;holdTimer;outroSettle;startedAt=0;left=!1;viewReady=!1;dismissedOnce=!1;constructor(){ue(()=>{this.ready()&&this.leave()})}ngAfterViewInit(){this.viewReady=!0,this.startedAt=Date.now(),this.play(),this.ready()&&this.leave()}ngOnDestroy(){this.clearTimers(),this.stopLoops(),this.intro?.pause()}play(){if(!this.query(".boot"))return;if(!this.animation.isEnabled){this.dismiss();return}let n=this.query(".ring-a"),o=this.query(".ring-b"),r=this.query(".halo"),i=this.query(".aura"),s=this.query(".grid"),a=this.query(".spark"),c=this.query(".dot-a"),l=this.query(".dot-b"),d=this.query(".dash"),f=this.queryAll(".letter"),y=this.query(".tagline"),v=this.query(".foot"),x=this.query(".pulse");try{let C=[n,o].filter(P=>P!==null).map(P=>Dm(P)[0]);for(let P of C)P.setAttribute("draw","0 0");this.intro=dd(),this.intro.add(this.one(r),{opacity:[0,.72],scale:[.45,1],duration:900,ease:"out(4)"},0).add(this.one(i),{opacity:[0,.85],scale:[.7,1],duration:1100,ease:"out(4)"},0).add(this.one(s),{opacity:[0,.5],duration:900,ease:"out(3)"},90).add(C,{draw:["0 0","0 1"],duration:720,ease:"inOut(3)",delay:jo(110)},120).add(this.one(a),{opacity:[0,1],duration:420,ease:"out(2)"},260).add(this.one(o),{r:[45,8],opacity:[1,.2],duration:460,ease:"in(2)"},720).add(this.one(c),{opacity:[0,1],scale:[0,1],translateY:[10,0],duration:700,ease:"outElastic(1, .55)"},820).add(this.one(l),{opacity:[0,1],scale:[0,1],translateY:[10,0],duration:700,ease:"outElastic(1, .55)"},890).add(this.one(d),{opacity:[0,1],scaleX:[0,1],duration:700,ease:"outElastic(1, .55)"},960).add(this.one(r),{opacity:[.72,1,.6],scale:[1,1.14,1],duration:620,ease:"inOut(2)"},1060).add(f,{opacity:[0,1],translateY:[16,0],scale:[.85,1],duration:500,ease:"out(3)",delay:jo(40)},1100).add(this.one(y),{opacity:[0,1],translateY:[8,0],duration:420,ease:"out(3)"},1480).add(this.one(v),{opacity:[0,1],translateY:[10,0],duration:420,ease:"out(3)"},1580).add(this.one(x),{opacity:[0,1],scale:[.6,1],duration:420,ease:"out(2)"},1580),this.introSettle=setTimeout(()=>this.snap(),K0+300)}catch{this.dismiss();return}this.startAmbient()}snap(){for(let e of this.queryAll(".ring"))e.setAttribute("draw","0 1");this.query(".ring-a")?.setAttribute("r","58"),this.query(".ring-b")?.setAttribute("r","8"),Gt.set(this.queryAll(".boot"),{opacity:1}),Gt.set(this.queryAll(".aura"),{opacity:.85}),Gt.set(this.queryAll(".grid"),{opacity:.5}),Gt.set(this.queryAll(".halo"),{opacity:.62,scale:1}),Gt.set(this.queryAll(".spark"),{opacity:1}),Gt.set(this.queryAll(".dot, .dash"),{opacity:1,scale:1,translateY:"0px"}),Gt.set(this.queryAll(".letter"),{opacity:1,scale:1,translateY:"0px"}),Gt.set(this.queryAll(".tagline, .foot"),{opacity:1,translateY:"0px"}),Gt.set(this.queryAll(".pulse"),{opacity:1,scale:1}),Gt.set(this.queryAll(".ring-b"),{opacity:.2})}startAmbient(){if(this.animation.isEnabled)try{this.startAmbientLoops()}catch{}}startAmbientLoops(){let e=l=>{this.loops.push(l)},n=[[this.query(".wave-a"),1050],[this.query(".wave-b"),1900]];for(let[l,d]of n)l&&e(on(l,{scale:[.4,2.05],opacity:[0,.7,0],duration:2600,delay:d,loop:!0,ease:"out(3)"}));let o=this.one(this.query(".spin-a")),r=this.one(this.query(".spin-b")),i=this.one(this.query(".orbit")),s=this.one(this.query(".spark")),a=this.one(this.query(".halo")),c=this.queryAll(".ellipsis i");e(on(o,{rotate:[0,360],duration:16e3,loop:!0,ease:"linear"})),e(on(r,{rotate:[0,-360],duration:22e3,loop:!0,ease:"linear"})),e(on(i,{rotate:[0,360],duration:5400,delay:340,loop:!0,ease:"linear"})),e(on(s,{scale:[1,1.9,1],opacity:[1,.6,1],duration:1100,delay:340,loop:!0,ease:"inOut(2)"})),e(on(a,{opacity:[.6,.78],scale:[1,1.045],duration:2400,delay:1400,loop:!0,alternate:!0,ease:"inOut(2)"})),c.length>0&&e(on(c,{opacity:[.15,1],translateY:[0,-2],duration:620,delay:jo(150,{start:1600}),loop:!0,alternate:!0,ease:"inOut(2)"}))}leave(){if(this.left||!this.viewReady)return;this.left=!0,this.leaving.set(!0);let e=Math.max(0,vI-(Date.now()-this.startedAt));this.holdTimer=setTimeout(()=>this.beginExit(),e)}beginExit(){this.clearTimers(),this.stopLoops(),this.intro?.pause(),this.snap();let e=this.query(".veil"),n=this.query(".aura"),o=this.query(".grid"),r=this.query(".mark"),i=this.query(".halo"),s=this.queryAll(".letter"),a=this.query(".words"),c=this.query(".foot"),l=this.handoff.read(),d=r?.getBoundingClientRect(),f=l&&d&&d.width>0?{translateX:l.x-(d.left+d.width/2),translateY:l.y-(d.top+d.height/2),scale:l.width/d.width}:null;try{let y=dd({defaults:{ease:"inOut(2)"},onComplete:()=>this.dismiss()}).add(this.one(i),{opacity:0,scale:1.3,duration:320},0).add(this.one(n,o),{opacity:0,duration:320},0).add(this.one(this.query(".rings"),this.query(".wave-a"),this.query(".wave-b")),{opacity:0,duration:300},0).add(s,{translateY:-10,opacity:0,duration:260,delay:jo(20)},0).add(this.one(a,c),{opacity:0,duration:220},40);f&&r?y.add(r,Q(H({},f),{duration:560,ease:"inOut(3)"}),0).add(r,{opacity:0,duration:160,ease:"out(2)"},500).add(this.one(e),{opacity:0,duration:380},520):y.add(this.one(r),{scale:1.16,opacity:0,duration:360,ease:"in(2)"},0).add(this.one(e),{opacity:0,duration:420},140)}catch{this.dismiss();return}this.outroSettle=setTimeout(()=>this.dismiss(),yI+460)}dismiss(){this.dismissedOnce||(this.dismissedOnce=!0,this.clearTimers(),this.dismissed.emit())}query(e){return this.host.nativeElement.querySelector(e)}queryAll(e){return Array.from(this.host.nativeElement.querySelectorAll(e))}one(...e){return e.filter(n=>n!==null)}stopLoops(){for(let e of this.loops)e.pause();this.loops=[]}clearTimers(){this.introSettle!==void 0&&(clearTimeout(this.introSettle),this.introSettle=void 0),this.holdTimer!==void 0&&(clearTimeout(this.holdTimer),this.holdTimer=void 0),this.outroSettle!==void 0&&(clearTimeout(this.outroSettle),this.outroSettle=void 0)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-boot-splash"]],inputs:{status:[1,"status"],ready:[1,"ready"]},outputs:{dismissed:"dismissed"},decls:34,vars:3,consts:[[1,"boot"],["aria-hidden","true",1,"veil"],["aria-hidden","true",1,"aura"],["aria-hidden","true",1,"grid"],[1,"center"],[1,"stage"],["aria-hidden","true",1,"halo"],["aria-hidden","true",1,"wave","wave-a"],["aria-hidden","true",1,"wave","wave-b"],["viewBox","0 0 140 140","aria-hidden","true",1,"rings"],[1,"spin","spin-a"],["cx","70","cy","70","r","58",1,"ring","ring-a"],[1,"spin","spin-b"],["cx","70","cy","70","r","45",1,"ring","ring-b"],[1,"orbit"],["cx","70","cy","12","r","3",1,"spark"],["aria-hidden","true",1,"mark"],[1,"dot","dot-a"],[1,"dot","dot-b"],[1,"dash"],[1,"words"],["aria-label","Morse",1,"wordmark"],["aria-hidden","true",1,"letter"],[1,"tagline"],[1,"foot"],["aria-hidden","true",1,"pulse"],["role","status","aria-live","polite",1,"status"],["aria-hidden","true",1,"ellipsis"]],template:function(n,o){n&1&&(b(0,"div",0),$e(1,"span",1)(2,"span",2)(3,"span",3),b(4,"div",4)(5,"div",5),$e(6,"span",6)(7,"span",7)(8,"span",8),Tt(),b(9,"svg",9)(10,"g",10),$e(11,"circle",11),E(),b(12,"g",12),$e(13,"circle",13),E(),b(14,"g",14),$e(15,"circle",15),E()(),fn(),b(16,"span",16),$e(17,"span",17)(18,"span",18)(19,"span",19),E()(),b(20,"div",20)(21,"div",21),_e(22,gI,2,1,"span",22,es),E(),b(24,"div",23),p(25,"the pi coding agent"),E()()(),b(26,"div",24),$e(27,"span",25),b(28,"span",26),p(29),E(),b(30,"span",27),$e(31,"i")(32,"i")(33,"i"),E()()()),n&2&&(Te("leaving",o.leaving()),u(22),be(o.letters),u(7),D(o.status()))},styles:["[_nghost-%COMP%]{display:contents}.boot[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:100;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:26px;overflow:hidden;color:var(--%NS%morse-fg);opacity:1}.boot.leaving[_ngcontent-%COMP%]{pointer-events:none}.veil[_ngcontent-%COMP%]{position:absolute;inset:0;background:var(--%NS%morse-bg)}.aura[_ngcontent-%COMP%]{position:absolute;width:min(560px,90vh);aspect-ratio:1;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--%NS%morse-accent) 42%,transparent) 0%,transparent 62%);filter:blur(8px);opacity:0;pointer-events:none}.grid[_ngcontent-%COMP%]{position:absolute;inset:0;background-image:radial-gradient(color-mix(in srgb,var(--%NS%morse-fg) 14%,transparent) 1px,transparent 1px);background-size:22px 22px;-webkit-mask-image:radial-gradient(circle at center,#000 0%,transparent 66%);mask-image:radial-gradient(circle at center,#000 0%,transparent 66%);opacity:0;pointer-events:none}.center[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;align-items:center;gap:22px}.stage[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;justify-content:center;width:140px;height:140px}.rings[_ngcontent-%COMP%]{position:absolute;inset:0;width:100%;height:100%;overflow:visible}.ring[_ngcontent-%COMP%]{fill:none;stroke:var(--%NS%morse-fg-muted);stroke-width:1.4;stroke-linecap:round}.ring-b[_ngcontent-%COMP%]{stroke:color-mix(in srgb,var(--%NS%morse-accent) 70%,var(--%NS%morse-fg-muted));stroke-width:1.1}.spin[_ngcontent-%COMP%], .orbit[_ngcontent-%COMP%]{transform-box:fill-box;transform-origin:center;will-change:transform}.spark[_ngcontent-%COMP%]{fill:var(--%NS%morse-fg);opacity:0;filter:drop-shadow(0 0 6px color-mix(in srgb,var(--%NS%morse-accent) 80%,transparent))}.halo[_ngcontent-%COMP%]{position:absolute;width:124px;height:124px;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--%NS%morse-fg) 30%,transparent) 0%,transparent 68%);opacity:0;pointer-events:none}.wave[_ngcontent-%COMP%]{position:absolute;width:124px;height:124px;border-radius:50%;border:1px solid color-mix(in srgb,var(--%NS%morse-fg) 65%,transparent);opacity:0;pointer-events:none}.wave-b[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--%NS%morse-accent) 70%,transparent)}.mark[_ngcontent-%COMP%]{position:relative;display:inline-flex;align-items:center;gap:9px}.dot[_ngcontent-%COMP%]{width:13px;height:13px;border-radius:50%;background:var(--%NS%morse-fg);opacity:0;box-shadow:0 0 14px color-mix(in srgb,var(--%NS%morse-fg) 55%,transparent)}.dash[_ngcontent-%COMP%]{width:38px;height:13px;border-radius:999px;background:var(--%NS%morse-fg);opacity:0;transform-origin:left center;box-shadow:0 0 14px color-mix(in srgb,var(--%NS%morse-fg) 55%,transparent)}.words[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:7px}.wordmark[_ngcontent-%COMP%]{display:flex;font-size:30px;font-weight:650;line-height:1;letter-spacing:.01em}.letter[_ngcontent-%COMP%]{display:inline-block;opacity:0;will-change:transform,opacity}.tagline[_ngcontent-%COMP%]{font-size:10.5px;letter-spacing:.34em;text-transform:uppercase;color:var(--%NS%morse-fg-muted);opacity:0}.foot[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;gap:8px;font-size:11.5px;color:var(--%NS%morse-fg-muted);opacity:0}.pulse[_ngcontent-%COMP%]{width:6px;height:6px;border-radius:50%;background:var(--%NS%morse-accent);box-shadow:0 0 8px color-mix(in srgb,var(--%NS%morse-accent) 70%,transparent);opacity:0}.ellipsis[_ngcontent-%COMP%]{display:inline-flex;gap:3px}.ellipsis[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{width:4px;height:4px;border-radius:50%;background:currentColor;opacity:.15}"]})};function _I(t,e){t&1&&(b(0,"p",19),p(1),E()),t&2&&(u(),D(e))}function bI(t,e){if(t&1){let n=z();b(0,"div",23)(1,"p",24),p(2,"Start a Morse host"),E(),b(3,"div",25)(4,"span",26),p(5,"installed CLI"),E(),b(6,"code"),p(7,"morse start"),E()(),b(8,"div",25)(9,"span",26),p(10,"from the repo"),E(),b(11,"code"),p(12,"npm run dev:server"),E()(),b(13,"p",27),p(14," Not installed? "),b(15,"code"),p(16,"npm install -g @supanadit/morse-web"),E(),p(17,". "),E(),b(18,"p",27),p(19," Stopped it with "),b(20,"code"),p(21,"morse stop"),E(),p(22,"? "),b(23,"code"),p(24,"morse start"),E(),p(25," brings it back \u2014 "),b(26,"code"),p(27,"morse logs"),E(),p(28," says what happened. "),E(),b(29,"p",27),p(30,"or point this window at a host that is already running"),E(),b(31,"form",28),q("submit",function(r){I(n);let i=h();return k(i.submit(r))}),b(32,"input",29),q("input",function(r){I(n);let i=h();return k(i.onInput(r))}),E(),b(33,"button",30),p(34,"Connect"),E()()()}if(t&2){let n=h();u(32),Ae("value",n.server()),u(),Ae("disabled",n.server().trim().length===0)}}var hd=class t{eyebrow=ee("Offline");title=ee("Morse is waiting for a host");body=ee("This window is only the frontend. The pi coding agent runs behind a Morse host \u2014 start one and this screen will clear itself.");detail=ee("");isBrowser=typeof globalThis<"u"&&typeof globalThis.acquireVsCodeApi>"u";server=R("");retry=rt();explore=rt();connect=rt();onInput(e){this.server.set(e.target.value)}submit(e){e.preventDefault();let n=this.server().trim();n.length>0&&this.connect.emit(n)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-connection-screen"]],inputs:{eyebrow:[1,"eyebrow"],title:[1,"title"],body:[1,"body"],detail:[1,"detail"]},outputs:{retry:"retry",explore:"explore",connect:"connect"},decls:30,vars:5,consts:[["role","alertdialog","aria-labelledby","morse-conn-title",1,"screen"],["aria-hidden","true",1,"veil"],["aria-hidden","true",1,"aura"],["aria-hidden","true",1,"grid"],[1,"panel"],["aria-hidden","true",1,"stage"],[1,"halo"],[1,"wave","wave-a"],[1,"wave","wave-b"],["viewBox","0 0 140 140",1,"scanner"],["cx","70","cy","70","r","58",1,"track"],["cx","70","cy","70","r","58",1,"sweep"],[1,"mark"],[1,"glyph","dot"],[1,"glyph","dash"],[1,"eyebrow"],["aria-hidden","true",1,"pip"],["id","morse-conn-title",1,"title"],[1,"body"],[1,"detail"],[1,"actions"],["type","button",1,"primary",3,"click"],["type","button",1,"ghost",3,"click"],[1,"help"],[1,"help-title"],[1,"help-cmd"],[1,"help-label"],[1,"help-or"],[1,"server",3,"submit"],["type","text","name","server","placeholder","ws://host:port","autocomplete","off","spellcheck","false",3,"input","value"],["type","submit",3,"disabled"]],template:function(n,o){if(n&1&&(b(0,"div",0),$e(1,"span",1)(2,"span",2)(3,"span",3),b(4,"div",4)(5,"div",5),$e(6,"span",6)(7,"span",7)(8,"span",8),Tt(),b(9,"svg",9),$e(10,"circle",10)(11,"circle",11),E(),fn(),b(12,"span",12),$e(13,"span",13)(14,"span",13)(15,"span",14),E()(),b(16,"p",15),$e(17,"span",16),p(18),E(),b(19,"h1",17),p(20),E(),b(21,"p",18),p(22),E(),T(23,_I,2,1,"p",19),b(24,"div",20)(25,"button",21),q("click",function(){return o.retry.emit()}),p(26,"Retry now"),E(),b(27,"button",22),q("click",function(){return o.explore.emit()}),p(28,"Explore the app"),E()(),T(29,bI,35,2,"div",23),E()()),n&2){let r;u(18),D(o.eyebrow()),u(2),D(o.title()),u(2),D(o.body()),u(),M((r=o.detail())?23:-1,r),u(6),M(o.isBrowser?29:-1)}},styles:["[_nghost-%COMP%]{display:contents}.screen[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:90;display:flex;align-items:center;justify-content:center;overflow:hidden;color:var(--%NS%morse-fg);animation:_ngcontent-%COMP%_conn-fade .26s ease-out}.veil[_ngcontent-%COMP%]{position:absolute;inset:0;background:var(--%NS%morse-bg)}.aura[_ngcontent-%COMP%]{position:absolute;width:min(620px,92vh);aspect-ratio:1;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--%NS%morse-accent) 30%,transparent) 0%,transparent 62%);filter:blur(10px);opacity:.85}.grid[_ngcontent-%COMP%]{position:absolute;inset:0;background-image:radial-gradient(color-mix(in srgb,var(--%NS%morse-fg) 12%,transparent) 1px,transparent 1px);background-size:22px 22px;-webkit-mask-image:radial-gradient(circle at center,#000 0%,transparent 64%);mask-image:radial-gradient(circle at center,#000 0%,transparent 64%);opacity:.55}.panel[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;align-items:center;gap:10px;max-width:520px;padding:28px 20px;text-align:center}.panel[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_conn-rise .46s cubic-bezier(.22,1,.36,1) backwards}.panel[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:nth-child(2){animation-delay:40ms}.panel[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:nth-child(3){animation-delay:90ms}.panel[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:nth-child(4){animation-delay:.14s}.panel[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:nth-child(5){animation-delay:.19s}.panel[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:nth-child(6){animation-delay:.24s}.panel[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:nth-child(7){animation-delay:.29s}.stage[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;justify-content:center;width:140px;height:140px}.scanner[_ngcontent-%COMP%]{position:absolute;inset:0;width:100%;height:100%;overflow:visible}.track[_ngcontent-%COMP%]{fill:none;stroke:var(--%NS%morse-fg-muted);stroke-width:1;opacity:.35}.sweep[_ngcontent-%COMP%]{fill:none;stroke:var(--%NS%morse-accent);stroke-width:1.6;stroke-linecap:round;stroke-dasharray:10 14;transform-box:fill-box;transform-origin:center;animation:_ngcontent-%COMP%_conn-sweep 9s linear infinite}.halo[_ngcontent-%COMP%]{position:absolute;width:96px;height:96px;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--%NS%morse-accent) 45%,transparent) 0%,transparent 68%);animation:_ngcontent-%COMP%_conn-breathe 3.6s ease-in-out infinite}.wave[_ngcontent-%COMP%]{position:absolute;width:96px;height:96px;border-radius:50%;border:1px solid color-mix(in srgb,var(--%NS%morse-fg) 40%,transparent);animation:_ngcontent-%COMP%_conn-ping 2.8s ease-out infinite}.wave-b[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--%NS%morse-accent) 55%,transparent);animation-delay:1.4s}.mark[_ngcontent-%COMP%]{position:relative;display:inline-flex;align-items:center;gap:8px}.glyph[_ngcontent-%COMP%]{background:var(--%NS%morse-fg);box-shadow:0 0 12px color-mix(in srgb,var(--%NS%morse-fg) 40%,transparent);animation:_ngcontent-%COMP%_conn-search 1.6s ease-in-out infinite}.dot[_ngcontent-%COMP%]{width:12px;height:12px;border-radius:50%}.dash[_ngcontent-%COMP%]{width:34px;height:12px;border-radius:999px;animation-delay:.36s}.glyph[_ngcontent-%COMP%]:nth-child(2){animation-delay:.18s}.eyebrow[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;margin:4px 0 0;font-size:10.5px;letter-spacing:.28em;text-transform:uppercase;color:var(--%NS%morse-fg-muted)}.pip[_ngcontent-%COMP%]{width:6px;height:6px;border-radius:50%;background:var(--%NS%morse-warn);animation:_ngcontent-%COMP%_conn-pip 1.4s ease-in-out infinite}.title[_ngcontent-%COMP%]{margin:0;font-size:19px;font-weight:650;line-height:1.25}.body[_ngcontent-%COMP%]{margin:0;max-width:420px;color:var(--%NS%morse-fg-muted);line-height:1.65}.detail[_ngcontent-%COMP%]{margin:2px 0 0;max-width:460px;font-family:var(--%NS%morse-font-mono);font-size:11px;color:var(--%NS%morse-fg-muted);opacity:.8;word-break:break-word}.actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:8px}.actions[_ngcontent-%COMP%] .primary[_ngcontent-%COMP%], .actions[_ngcontent-%COMP%] .ghost[_ngcontent-%COMP%]{padding:6px 16px;border-radius:999px}.actions[_ngcontent-%COMP%] .ghost[_ngcontent-%COMP%]{background:var(--%NS%morse-button-secondary);color:var(--%NS%morse-button-secondary-fg)}.actions[_ngcontent-%COMP%] .ghost[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover);border-color:var(--%NS%morse-border)}.help[_ngcontent-%COMP%]{margin-top:14px;padding:12px 14px;width:100%;max-width:380px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-hover);display:flex;flex-direction:column;align-items:center;gap:6px}.help-title[_ngcontent-%COMP%]{margin:0;font-size:11px;letter-spacing:.05em;text-transform:uppercase;color:var(--%NS%morse-fg-muted)}.help-cmd[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%}.help-label[_ngcontent-%COMP%]{flex:none;width:86px;text-align:right;font-size:10px;letter-spacing:.04em;text-transform:uppercase;color:var(--%NS%morse-fg-muted)}.help-cmd[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{flex:1;min-width:0;overflow-x:auto;white-space:nowrap;font-family:var(--%NS%morse-font-mono);font-size:12px;padding:3px 10px;border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-code-bg);border:1px solid var(--%NS%morse-border)}.help-or[_ngcontent-%COMP%]{margin:2px 0 0;font-size:11px;line-height:1.5;color:var(--%NS%morse-fg-muted)}.help-or[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:var(--%NS%morse-font-mono);font-size:10.5px;padding:0 3px;border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-code-bg)}.server[_ngcontent-%COMP%]{display:flex;width:100%;gap:6px}.server[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;min-width:0}@keyframes _ngcontent-%COMP%_conn-fade{0%{opacity:0}}@keyframes _ngcontent-%COMP%_conn-rise{0%{opacity:0;transform:translateY(10px)}}@keyframes _ngcontent-%COMP%_conn-sweep{to{transform:rotate(360deg)}}@keyframes _ngcontent-%COMP%_conn-breathe{0%,to{opacity:.6;transform:scale(.94)}50%{opacity:1;transform:scale(1.06)}}@keyframes _ngcontent-%COMP%_conn-ping{0%{opacity:.5;transform:scale(.5)}80%,to{opacity:0;transform:scale(2.05)}}@keyframes _ngcontent-%COMP%_conn-search{0%,to{opacity:.4;transform:translateY(0)}45%{opacity:1;transform:translateY(-4px)}}@keyframes _ngcontent-%COMP%_conn-pip{0%,to{opacity:.35}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.screen[_ngcontent-%COMP%], .panel[_ngcontent-%COMP%] > *[_ngcontent-%COMP%], .sweep[_ngcontent-%COMP%], .halo[_ngcontent-%COMP%], .wave[_ngcontent-%COMP%], .glyph[_ngcontent-%COMP%], .pip[_ngcontent-%COMP%]{animation:none}}"]})};var xI=["host/ready","session/state","project/list","session/activity","transcript/append","transcript/update","transcript/delta","transcript/replace","transcript/prepend","session/list","interaction/request","interaction/dismiss","notice","context/selection","context/selectionLive","composer/seed","host/command/result","error"];function Om(t){return JSON.stringify(t)}function EI(t){return CI(t,xI)}function gd(t){let e=Aa(t);return EI(e)?e:void 0}function Aa(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return}return t instanceof Uint8Array?Aa(new TextDecoder().decode(t)):t instanceof ArrayBuffer?Aa(new TextDecoder().decode(new Uint8Array(t))):t}function CI(t,e){if(typeof t!="object"||t===null)return!1;let n=t.type;return typeof n=="string"&&e.includes(n)}function yd(t={cwd:"",name:"workspace"}){return{protocolVersion:17,connection:"connecting",capabilities:null,state:{workspace:t,thinkingLevel:"off",availableModels:[],availableThinkingLevels:[],availableCommands:[],streaming:!1,busy:!1,agentReady:!1,agentStarting:!1},items:[],sessions:[],activity:[],projects:[],pendingInteraction:null}}function Q0(t,e,n){return Q(H({},t),{connection:e,connectionDetail:n})}function X0(t,e){switch(e.type){case"host/ready":return Q(H({},t),{connection:"ready",protocolVersion:e.payload.protocolVersion,capabilities:e.payload.capabilities,state:e.payload.state,frontend:e.payload.frontend??t.frontend});case"session/state":return Q(H({},t),{state:e.payload});case"transcript/append":return Q(H({},t),{items:[...t.items,e.payload]});case"transcript/update":return Q(H({},t),{items:wI(t.items,e.payload)});case"transcript/delta":return Q(H({},t),{items:SI(t.items,e.payload)});case"transcript/replace":return Q(H({},t),{items:[...e.payload.items]});case"transcript/prepend":return Q(H({},t),{items:[...e.payload.items,...t.items]});case"session/list":return Q(H({},t),{sessions:[...e.payload.sessions]});case"session/activity":return Q(H({},t),{activity:[...e.payload.sessions]});case"project/list":return Q(H({},t),{projects:[...e.payload.projects]});case"interaction/request":return Q(H({},t),{pendingInteraction:e.payload});case"interaction/dismiss":return t.pendingInteraction?.requestId===e.payload.requestId?Q(H({},t),{pendingInteraction:null}):t;case"notice":return Q(H({},t),{lastNotice:H({},e.payload)});case"error":return Q(H({},t),{lastError:H({},e.payload)});default:return t}}function wI(t,e){let n=t.findIndex(r=>r.id===e.id);if(n===-1)return[...t,e];let o=[...t];return o[n]=e,o}function SI(t,e){let n=t.findIndex(i=>i.id===e.id);if(n===-1)return t;let o=t[n];if(o.kind!=="assistant")return t;let r=[...t];return r[n]=Q(H({},o),{text:o.text+(e.text??""),thinking:o.thinking+(e.thinking??""),streaming:!0}),r}var TI=5e3;function J0(t){let e=yd(t.workspace??{cwd:"",name:"workspace"}),n=new Set,o=x=>{e=x;for(let C of[...n])C(e)},r=x=>{t.transport.send(x)},i=new Map,s=0,a=new Set,c=new Set,l=new Set,d=(x,C)=>{s+=1;let P=`host-${s}`;return new Promise(Y=>{let G=setTimeout(()=>{i.delete(P),Y(void 0)},TI);i.set(P,{resolve:Y,timer:G}),r({type:"host/command",payload:{command:x,args:C,requestId:P}})})},f=t.transport.onMessage(x=>{if(x.type==="host/command/result"){let C=i.get(x.payload.requestId);C&&(clearTimeout(C.timer),i.delete(x.payload.requestId),C.resolve(x.payload.ok?x.payload.data:void 0));return}if(x.type==="context/selection"){for(let C of[...a])C(x.payload);return}if(x.type==="context/selectionLive"){for(let C of[...c])C(x.payload);return}if(x.type==="composer/seed"){for(let C of[...l])C(x.payload);return}o(X0(e,x))}),y=t.transport.onStatus((x,C)=>{o(Q0(e,MI(x),x==="open"?"Waiting for the Morse host to answer\u2026":C))}),v={ready:x=>r({type:"client/ready",payload:{protocolVersion:17,frontend:x??t.frontend}}),prompt:(x,C,P,Y)=>r({type:"chat/prompt",payload:{text:x,mode:C,images:P,pins:Y}}),editMessage:(x,C)=>r({type:"chat/edit",payload:{itemId:x,text:C}}),forkMessage:x=>r({type:"chat/fork",payload:{itemId:x}}),hostCommand:(x,C)=>d(x,C),abort:()=>r({type:"chat/abort",payload:{}}),newSession:x=>r({type:"session/new",payload:{cwd:x}}),loadSession:(x,C)=>r({type:"session/load",payload:{sessionId:x,cwd:C}}),activateSession:(x,C)=>r({type:"session/activate",payload:{sessionId:x,cwd:C}}),closeSession:x=>r({type:"session/close",payload:{sessionId:x}}),deleteSession:x=>r({type:"session/delete",payload:{sessionId:x}}),compactSession:x=>r({type:"session/compact",payload:{instructions:x}}),loadOlderHistory:()=>r({type:"history/load",payload:{}}),requestSessions:()=>r({type:"session/list",payload:{}}),requestProjects:()=>r({type:"project/list",payload:{}}),refreshCommands:()=>r({type:"commands/refresh",payload:{}}),openProject:x=>r({type:"project/open",payload:{path:x}}),setModel:(x,C)=>r({type:"model/set",payload:{provider:x,id:C}}),setThinkingLevel:x=>r({type:"thinking/set",payload:{level:x}}),respond:x=>r({type:"interaction/respond",payload:x})};return t.transport.connect(),v.ready(),{getView:()=>e,subscribe:x=>(n.add(x),()=>{n.delete(x)}),onContextSelection:x=>(a.add(x),()=>{a.delete(x)}),onContextSelectionLive:x=>(c.add(x),()=>{c.delete(x)}),onComposerSeed:x=>(l.add(x),()=>{l.delete(x)}),actions:v,dispose:()=>{f(),y(),n.clear(),t.transport.dispose()}}}function MI(t){switch(t){case"open":return"connecting";case"connecting":return"connecting";case"error":return"error";case"closed":return"closed"}}var II=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/,eb=/<([^<>]+)>|\[([^\[\]]+)\]/g,tb=/\$(\d+)|\$\{(\d+):/g,kI=/\$(?:@|ARGUMENTS)|\$\{(?:@|ARGUMENTS)(?::|-)/;function NI(t){let e=[],n="",o=null;for(let r of t)o!==null?r===o?o=null:n+=r:r==='"'||r==="'"?o=r:/\s/.test(r)?n.length>0&&(e.push(n),n=""):n+=r;return n.length>0&&e.push(n),e}function DI(t,e){let n=e.join(" ");return t.replace(/\$\{(\d+|ARGUMENTS|@):-([^}]*)\}|\$\{@:(\d+)(?::(\d+))?\}|\$(ARGUMENTS|@|\d+)/g,(o,r,i,s,a,c)=>{if(r!==void 0){let l=r==="@"||r==="ARGUMENTS"?n:e[Number.parseInt(r,10)-1];return l||i}if(s!==void 0){let l=Number.parseInt(s,10)-1;return l<0&&(l=0),a!==void 0?e.slice(l,l+Number.parseInt(a,10)).join(" "):e.slice(l).join(" ")}return c==="ARGUMENTS"||c==="@"?n:e[Number.parseInt(c,10)-1]??""})}function OI(t){if(t===void 0)return[];let e=[];eb.lastIndex=0;let n,o=0;for(;(n=eb.exec(t))!==null;){o+=1;let r=(n[1]??n[2]??"").trim();e.push({id:`arg${o}`,label:r.length>0?r:`Argument ${o}`,required:n[1]!==void 0,index:o})}return e}function PI(t){let e=0;tb.lastIndex=0;let n;for(;(n=tb.exec(t))!==null;){let r=Number.parseInt(n[1]??n[2]??"0",10);Number.isFinite(r)&&r>e&&(e=r)}let o=[];for(let r=1;r<=e;r+=1)o.push({id:`arg${r}`,label:`Argument ${r}`,required:!1,index:r});return o}function AI(t){let e=/^(['"])([\s\S]*)\1$/.exec(t);return e===null?t:e[2]}function Pm(t){let e=II.exec(t);if(e===null)return{body:t};let n=/^argument-hint:[ \t]*(.*)$/m.exec(e[1]);return{body:t.slice(e[0].length),argumentHint:n===null?void 0:AI(n[1].trim())}}function nb(t){let e=Pm(t),n=OI(e.argumentHint),o=n.length>0?n:PI(e.body);if(o.length>0)return{body:e.body,arguments:o};if(kI.test(e.body))return{body:e.body,arguments:[{id:"arguments",label:"Arguments",required:!1}]}}function ob(t,e,n=""){let o=t.arguments.find(a=>a.index===void 0),r=o!==void 0?NI(e[o.id]??""):t.arguments.map(a=>(e[a.id]??"").trim()),i=DI(t.body,r),s=n.trim();return s.length===0?i:`${i.replace(/\s+$/,"")}
|
|
7
|
-
|
|
8
|
-
${s}`}var Er=class{messageListeners=new Set;statusListeners=new Set;onMessage(e){return this.messageListeners.add(e),()=>{this.messageListeners.delete(e)}}onStatus(e){return this.statusListeners.add(e),()=>{this.statusListeners.delete(e)}}emitMessage(e){for(let n of[...this.messageListeners])n(e)}emitStatus(e,n){for(let o of[...this.statusListeners])o(e,n)}};var rb,ib=!1;function sb(){return typeof globalThis.acquireVsCodeApi=="function"}function RI(){let t=globalThis.acquireVsCodeApi;if(typeof t=="function")return ib||(ib=!0,rb=t()),rb}var vd=class extends Er{kind="vscode";api=RI();listener=e=>{let n=gd(e.data);n&&this.emitMessage(n)};connect(){if(!this.api){this.emitStatus("error","Not running inside a VS Code webview.");return}typeof window<"u"&&window.addEventListener("message",this.listener),this.emitStatus("open")}send(e){this.api?.postMessage(e)}dispose(){typeof window<"u"&&window.removeEventListener("message",this.listener),this.emitStatus("closed")}};var LI=8e3,Ra=class extends Er{options;kind="websocket";socket;attempts=0;timer;disposed=!1;queue=[];constructor(e){super(),this.options=e}connect(){this.disposed=!1,this.open()}send(e){if(this.socket&&this.socket.readyState===1){this.socket.send(Om(e));return}this.queue.push(e)}dispose(){this.disposed=!0,this.timer!==void 0&&(clearTimeout(this.timer),this.timer=void 0),this.socket?.close(),this.socket=void 0,this.emitStatus("closed")}open(){let e=this.options.WebSocketImpl??globalThis.WebSocket;if(!e){this.emitStatus("error","WebSocket is not available in this runtime.");return}this.emitStatus("connecting",this.options.url);let n=new e(this.options.url);this.socket=n,n.onopen=()=>{this.attempts=0,this.emitStatus("open");let o=this.queue.splice(0,this.queue.length);for(let r of o)n.send(Om(r))},n.onmessage=o=>{let r=gd(Aa(o.data));r&&this.emitMessage(r)},n.onerror=()=>{this.emitStatus("error",`Cannot reach the Morse server at ${this.options.url}.`)},n.onclose=()=>{if(this.socket=void 0,this.disposed){this.emitStatus("closed");return}this.emitStatus("closed","Connection lost \u2014 retrying\u2026"),this.scheduleReconnect()}}scheduleReconnect(){if(this.options.reconnect===!1||this.timer!==void 0)return;let e=this.options.maxBackoffMs??LI,n=Math.min(e,500*2**this.attempts);this.attempts+=1,this.timer=setTimeout(()=>{this.timer=void 0,this.disposed||this.open()},n),this.timer.unref?.()}};var fs={cwd:"/mock/workspace",name:"mock-workspace"},FI={hostKind:"server",scope:lb()?"workspace":"global",editorContext:!1,nativeDialogs:!1,insertIntoEditor:!1,revealFile:!1,filePicker:!0,fileUpload:!0,directoryPicker:!0,updateCheck:VI()};function VI(){return typeof location>"u"?!1:new URL(location.href,"http://localhost/").searchParams.get("update")==="1"}var _d=class extends Er{kind="memory";timers=new Set;items=BI()?[]:UI();sessions=db();hot=new Set(this.sessions.slice(0,2).map(e=>e.id));counter=100;disposed=!1;streaming=!1;state={workspace:fs,model:{provider:"mock",id:"mock-1",name:"Mock Model",contextWindow:1e6,maxTokens:32768},thinkingLevel:"low",availableModels:[{provider:"mock",id:"mock-1",name:"Mock Model",contextWindow:128e3},{provider:"mock",id:"mock-2",name:"Mock Model (fast)",contextWindow:262144},{provider:"mock-cloud",id:"mock-1",name:"Mock Model",contextWindow:2e5},{provider:"mock-cloud",id:"mock-3",name:"Mock Model (pro)",contextWindow:1e6}],availableThinkingLevels:["off","low","high"],availableCommands:[{name:"skill:codebase-memory",description:"Query the knowledge graph",source:"skill"},{name:"fix-tests",description:"Fix failing tests",source:"prompt"}],streaming:!1,usage:{inputTokens:56400,outputTokens:35200,totalTokens:91600,cacheReadTokens:28e5,cacheWriteTokens:12e3},lastUsage:{inputTokens:12400,outputTokens:668,totalTokens:13068,cacheReadTokens:5e5,cacheWriteTokens:0,reasoningTokens:1066},costUsd:.42,contextUsage:{tokens:79e3,contextWindow:1e6,percent:7.9},counts:{userMessages:10,assistantMessages:165,toolCalls:42,toolResults:42,totalMessages:200},busy:this.items.some(e=>e.kind==="tool"&&e.status==="running"),agentReady:!0,agentStarting:!1};connect(){this.disposed=!1,this.emitStatus("open","in-memory mock host"),this.finishFixtureRun(),typeof location<"u"&&new URL(location.href).searchParams.get("autorun")&&this.schedule(()=>this.simulateRun("Refactor the sidebar and make it responsive."),1500)}finishFixtureRun(){let e=this.items.find(n=>n.kind==="tool"&&n.status==="running");!e||e.kind!=="tool"||this.schedule(()=>{e.status="ok",e.durationMs=3100,this.emit({type:"transcript/update",payload:H({},e)}),this.state=Q(H({},this.state),{busy:!1}),this.emit({type:"session/state",payload:this.state})},6e3)}send(e){switch(e.type){case"client/ready":this.emit({type:"transcript/replace",payload:{items:this.items}}),this.emit({type:"project/list",payload:{projects:cb()}}),this.emit({type:"session/list",payload:{sessions:this.sessions}}),this.emitActivity(),this.emit({type:"host/ready",payload:H({protocolVersion:17,capabilities:FI,state:this.state},e.payload.frontend?{frontend:e.payload.frontend}:{})});return;case"chat/prompt":this.simulateRun(e.payload.text);return;case"chat/abort":this.abortRun();return;case"session/new":{this.items=[],this.emit({type:"transcript/replace",payload:{items:[]}});let n={id:this.nextId("session"),title:"New session",cwd:fs.cwd,updatedAt:Date.now(),messageCount:0};this.sessions=[n,...this.sessions],this.hot.add(n.id),this.state=Q(H({},this.state),{sessionId:n.id,sessionTitle:n.title,streaming:!1}),this.emit({type:"session/list",payload:{sessions:this.sessions}}),this.emit({type:"session/state",payload:this.state}),this.emitActivity();return}case"session/list":this.emit({type:"session/list",payload:{sessions:this.sessions}});return;case"project/list":this.emit({type:"project/list",payload:{projects:cb()}});return;case"project/open":case"session/activate":case"session/load":this.notify("info","Mock host: switched session.");return;case"session/close":this.notify("warn","Mock host: closing sessions is a no-op.");return;case"session/compact":this.notify("success","Mock host: context compacted.");return;case"model/set":{let n=this.state.availableModels.find(o=>o.provider===e.payload.provider&&o.id===e.payload.id);this.state=Q(H({},this.state),{model:n?H({},n):{provider:e.payload.provider,id:e.payload.id,name:e.payload.id}}),this.emit({type:"session/state",payload:this.state});return}case"thinking/set":this.state=Q(H({},this.state),{thinkingLevel:e.payload.level}),this.emit({type:"session/state",payload:this.state});return;case"interaction/respond":this.emit({type:"interaction/dismiss",payload:{requestId:e.payload.requestId}});return;case"host/command":if(e.payload.command==="listFiles"&&e.payload.requestId){this.emit({type:"host/command/result",payload:{requestId:e.payload.requestId,ok:!0,data:{files:jI}}});return}if(e.payload.command==="uploadFile"&&e.payload.requestId){let n=typeof e.payload.args?.name=="string"?e.payload.args.name:"upload.bin";this.emit({type:"host/command/result",payload:{requestId:e.payload.requestId,ok:!0,data:{path:`.morse/uploads/${n}`,name:n,bytes:0}}});return}if(e.payload.command==="listDirectories"&&e.payload.requestId){this.emit({type:"host/command/result",payload:{requestId:e.payload.requestId,ok:!0,data:HI(e.payload.args?.path)}});return}this.notify("warn",`The mock host does not implement "${e.payload.command}".`);return;default:return}}dispose(){this.disposed=!0,this.abortRun(),this.emitStatus("closed")}simulateRun(e){if(this.streaming){this.notify("warn","A mock run is already streaming.");return}this.streaming=!0,this.appendItem({kind:"user",id:this.nextId("user"),at:Date.now(),text:e}),this.emit({type:"session/state",payload:Q(H({},this.state),{streaming:!0})}),this.emitActivity();let n=0,o=[{thinking:"Let me find where the sidebar is built before I touch anything.",tool:{name:"bash",title:"bash: ls packages/ui-angular/src/app",output:"app.css app.html app.ts chat/ core/ nav/"}},{thinking:"Found it. Now check the navigation component and the styles it relies on.",tool:{name:"read",title:"read: packages/ui-angular/src/app/nav/session-nav.ts",output:`1 import { Component } from "@angular/core";
|
|
9
|
-
2 ... 38 lines`}}];for(let s of o){let a=this.nextId("assistant");this.schedule(()=>{this.appendItem({kind:"assistant",id:a,at:Date.now(),text:"",thinking:"",streaming:!0,model:this.state.model?.name})},n),n+=40;for(let d of ab(s.thinking)){let f=d;this.schedule(()=>{this.emit({type:"transcript/delta",payload:{id:a,thinking:f}})},n),n+=55}let c=this.nextId("tool");this.schedule(()=>{this.updateItem({kind:"assistant",id:a,at:Date.now(),text:"",thinking:s.thinking,streaming:!1,model:this.state.model?.name}),this.appendItem({kind:"tool",id:c,at:Date.now(),name:s.tool.name,title:s.tool.title,status:"running"})},n),n+=900;let l=n;this.schedule(()=>{this.updateItem({kind:"tool",id:c,at:Date.now(),name:s.tool.name,title:s.tool.title,status:"ok",output:s.tool.output,durationMs:l})},n),n+=200}let r=`Mock host received: "${e}".
|
|
10
|
-
|
|
11
|
-
This response is produced in the browser, with no pi process and no server, so you can iterate on the frontend (or a new frontend framework) freely.`,i=this.nextId("assistant");this.schedule(()=>{this.appendItem({kind:"assistant",id:i,at:Date.now(),text:"",thinking:"",streaming:!0,model:this.state.model?.name})},n),n+=40;for(let s of ab(r)){let a=s;this.schedule(()=>{this.emit({type:"transcript/delta",payload:{id:i,text:a}})},n),n+=55}this.schedule(()=>{this.streaming=!1,this.updateItem({kind:"assistant",id:i,at:Date.now(),text:r,thinking:"",streaming:!1,model:this.state.model?.name}),this.emit({type:"session/state",payload:Q(H({},this.state),{streaming:!1})}),this.emitActivity()},n+80)}appendItem(e){this.items=[...this.items,e],this.emit({type:"transcript/append",payload:e})}updateItem(e){this.items=this.items.map(n=>n.id===e.id?e:n),this.emit({type:"transcript/update",payload:e})}abortRun(){for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.streaming&&(this.streaming=!1,this.emitActivity())}notify(e,n){this.emit({type:"notice",payload:{level:e,text:n,at:Date.now()}})}schedule(e,n){let o=setTimeout(()=>{this.timers.delete(o),this.disposed||e()},n);this.timers.add(o)}nextId(e){return this.counter+=1,`mock-${e}-${this.counter}`}emitActivity(){let e=this.sessions.filter(n=>this.hot.has(n.id)).slice(0,4).map(n=>({sessionKey:n.id,streaming:this.streaming,busy:!1,agentReady:!0,agentStarting:!1}));this.emit({type:"session/activity",payload:{sessions:e}})}emit(e){this.emitMessage(e)}},jI=["AGENTS.md","README.md","package.json","packages/core/src/chat/service.ts","packages/core/src/domain.ts","packages/core/src/session/service.ts","packages/host-runtime/src/session-controller.ts","packages/protocol/src/wire.ts","packages/ui-angular/src/app/app.ts","packages/ui-angular/src/app/chat/chat-composer/chat-composer.ts","packages/ui-angular/src/app/core/markdown.ts","packages/ui-runtime/src/client.ts"],$I={"/mock":[{name:"home",path:"/mock/home"},{name:"projects",path:"/mock/projects"},{name:"workspace",path:"/mock/workspace"}],"/mock/home":[{name:"projects",path:"/mock/home/projects"}],"/mock/home/projects":[],"/mock/projects":[{name:"morse",path:"/mock/projects/morse"},{name:"other",path:"/mock/projects/other"}],"/mock/projects/morse":[{name:"packages",path:"/mock/projects/morse/packages"}],"/mock/projects/other":[],"/mock/projects/morse/packages":[],"/mock/workspace":[]};function HI(t){let e=typeof t=="string"&&t.trim().length>0?t.trim():fs.cwd,n=e==="/mock"?void 0:e.slice(0,e.lastIndexOf("/"))||"/";return{path:e,parent:n,directories:$I[e]??[],isGitRepo:e==="/mock/projects/morse",canOpen:!0,roots:[{name:"mock",path:"/mock"},{name:"workspace",path:fs.cwd}]}}function ab(t){return t.match(/.{1,14}/g)??[]}function lb(){return typeof location>"u"?!1:new URL(location.href).searchParams.get("scope")==="workspace"}function BI(){return typeof location>"u"?!1:new URL(location.href).searchParams.get("empty")==="1"}function db(){let t=Date.now(),e=[{id:"/mock/morse/2026-01-01_ui-overhaul.jsonl",title:"Sidebar overhaul: projects, sessions, composer",cwd:fs.cwd,updatedAt:t-6e4,messageCount:12},{id:"/mock/morse/2026-01-01_scrollbar.jsonl",title:"Improve native scrollbar: compact and themed",cwd:fs.cwd,updatedAt:t-7*6e4,messageCount:6}];return lb()?e:[...e,{id:"/mock/morse/2026-01-01_providers.jsonl",title:"Add provider picker with context sizes",cwd:"/mock/morse",updatedAt:t-20*6e4,messageCount:24},{id:"/mock/morse/2026-01-01_greeting.jsonl",title:"Greeting",cwd:"/mock/morse",updatedAt:t-180*6e4,messageCount:2},{id:"/mock/eigen-morph/2026-01-01_manifest.jsonl",title:"Manifest report-worker untuk production",cwd:"/mock/eigen-morph",updatedAt:t-1560*6e4,messageCount:31}]}function cb(){let t=new Map;for(let e of db()){let n=t.get(e.cwd);if(n){n.sessionCount+=1,n.lastUsedAt=Math.max(n.lastUsedAt,e.updatedAt);continue}t.set(e.cwd,{path:e.cwd,name:e.cwd.split("/").filter(Boolean).at(-1)??e.cwd,sessionCount:1,lastUsedAt:e.updatedAt})}return[...t.values()].sort((e,n)=>n.lastUsedAt-e.lastUsedAt)}function UI(){let t=Date.now(),e=["Plan:","","1. **Navigation** \u2014 projects \u2192 sessions, collapsible, with a session search and a project filter.","2. **Header** \u2014 session title, scope, status badge, `Compact`, and the sidebar fold.","3. **Composer** \u2014 model + thinking + send in one control row.","","Two shapes, because the hosts differ: the browser host is *global* (many projects), VS Code is scoped to the folders it has open.","","```ts","export class SessionNav {"," protected readonly scope = computed(() => this.morse.capabilities()?.scope ?? 'global');",""," protected readonly groups = computed(() => {",' return this.scope() === "global"'," ? this.projects().map((project) => ({ ... }))"," : [{ path: this.workspace().cwd, name: this.workspace().name, sessions }];"," });","}","```","","And a small overview of what each scope renders:","","| Host | Scope | Navigation shape |","|---|---|---|","| NestJS browser | `global` | projects \u2192 sessions |","| VS Code | `workspace` | one group (open folders) |","","See `docs/FRONTENDS.md` for the rule that frontends must read capabilities instead of guessing."].join(`
|
|
12
|
-
`);return[{kind:"user",id:"mock-seed-user-1",at:t-15e4,text:"Refactor the sidebar to match the reference, make it responsive, and render markdown properly."},{kind:"tool",id:"mock-seed-tool-1",at:t-14e4,name:"bash",title:"bash: ls packages/ui-angular/src/app",status:"ok",output:"app.css app.html app.ts chat/ core/ nav/",durationMs:12},{kind:"tool",id:"mock-seed-tool-2",at:t-138e3,name:"read",title:"read: packages/ui-angular/src/app/app.css",status:"ok",output:"42 lines, 4 media queries",durationMs:8},{kind:"tool",id:"mock-seed-tool-3",at:t-13e4,name:"edit",title:"edit: packages/ui-angular/src/app/nav/session-nav.ts",status:"ok",output:"+26 -7",durationMs:190},{kind:"tool",id:"mock-seed-tool-4",at:t-128e3,name:"edit",title:"edit: packages/ui-angular/src/app/app.css",status:"ok",output:"+18 -4",durationMs:140},{kind:"tool",id:"mock-seed-tool-5",at:t-1800,name:"bash",title:"bash: npm run build:ui",status:"running",output:"Application bundle generation complete. [1.2 seconds]"},{kind:"assistant",id:"mock-seed-assistant-1",at:t-1e5,text:e,thinking:"The webview is narrow, so the navigation has to become a drawer below ~760px instead of a second column.",streaming:!1,model:"Mock Model"},{kind:"notice",id:"mock-seed-notice-1",at:t-6e4,level:"info",text:"Everything is wired through the same wire protocol \u2014 try ?scope=workspace to see the VS Code shape."}]}function ub(t={}){if(sb())return new vd;let e=t.href??(typeof location<"u"?location.href:"http://localhost/"),n=new URL(e,"http://localhost/");if(t.forceMock===!0||n.searchParams.get("mock")==="1")return new _d;let o=n.searchParams.get("server");if(o)return new Ra({url:o,WebSocketImpl:t.WebSocketImpl});let r=n.protocol==="https:",i=t.websocketPath??"/ws";return new Ra({url:`${r?"wss":"ws"}://${n.host}${i}`,WebSocketImpl:t.WebSocketImpl})}var Cr=class t{attached=R([]);pinned=R([]);live=R(null);pendingMentions=R([]);message=R(null);counter=0;images=this.attached.asReadonly();pins=this.pinned.asReadonly();livePreview=this.live.asReadonly();mentions=this.pendingMentions.asReadonly();notice=this.message.asReadonly();count=S(()=>this.attached().length+this.pinned().length+this.pendingMentions().length);async read(e){let n=[],o=[];for(let r of e){if(!r.type.startsWith("image/")){o.push(r.name);continue}let i=await Am(r);if(!i){o.push(r.name);continue}this.counter+=1,n.push({id:`attachment-${this.counter}`,name:r.name||`image-${this.counter}.png`,mimeType:r.type,data:i,bytes:r.size})}return{images:n,skipped:o}}add(e){e.length!==0&&this.attached.update(n=>[...n,...e])}async accept(e){let{images:n,skipped:o}=await this.read(e);return this.add(n),{attached:n.length,skipped:o}}addMentions(e){let n=e.map(o=>o.trim()).filter(o=>o.length>0);n.length!==0&&this.pendingMentions.update(o=>[...o,...n])}seed(e,n){e.length>0&&this.add(e.map((o,r)=>{this.counter+=1;let s=(o.mimeType.split("/")[1]?.toLowerCase()??"").replace(/[^a-z0-9]/g,"")||"png";return{id:`seed-${this.counter}`,name:r===0?`image.${s}`:`image-${r+1}.${s}`,mimeType:o.mimeType,data:o.data,bytes:Math.floor(o.data.length*3/4)}}));for(let o of n)this.pin({path:o.path,startLine:o.startLine,endLine:o.endLine})}pin(e){if(e.path.length===0||this.pinned().find(r=>r.path===e.path&&r.startLine===e.startLine&&r.endLine===e.endLine))return;this.counter+=1;let o=`pin-${this.counter}`;this.pinned.update(r=>[...r,Q(H({},e),{id:o})])}removePin(e){this.pinned.update(n=>n.filter(o=>o.id!==e))}setLivePreview(e){if(e===null||e.path.length===0||e.startLine===void 0){this.live.set(null);return}let n=this.live();n&&n.path===e.path&&n.startLine===e.startLine&&n.endLine===e.endLine||this.live.set({id:"live-preview",path:e.path,startLine:e.startLine,endLine:e.endLine})}lockLivePreview(){let e=this.live();e&&(this.live.set(null),this.pin({path:e.path,startLine:e.startLine,endLine:e.endLine}))}remove(e){this.attached.update(n=>n.filter(o=>o.id!==e))}takeImages(){let e=this.attached().map(({data:n,mimeType:o})=>({data:n,mimeType:o}));return this.attached.set([]),e}takePins(){let e=this.pinned().map(({path:n,startLine:o,endLine:r})=>{let i={path:n};return o!==void 0&&(i.startLine=o),r!==void 0&&(i.endLine=r),i});return this.pinned.set([]),e}takeMentions(){let e=this.pendingMentions();return this.pendingMentions.set([]),e}clear(){this.attached.set([]),this.pinned.set([]),this.live.set(null),this.pendingMentions.set([])}say(e,n){this.message.set({level:e,text:n,at:Date.now()})}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Oe({token:t,factory:t.\u0275fac,providedIn:"root"})};function Am(t){return new Promise(e=>{if(typeof FileReader>"u"){e(void 0);return}let n=new FileReader;n.onerror=()=>e(void 0),n.onload=()=>{let o=n.result;if(typeof o!="string"){e(void 0);return}let r=o.indexOf(",");e(r===-1?void 0:o.slice(r+1))},n.readAsDataURL(t)})}var pb=new ze("morse.transport",{providedIn:"root",factory:()=>ub()});var fb={name:"@morse/ui-angular",version:"0.5.0"},qI=6e3,wt=class t{transport=N(pb);destroyRef=N(ht);view=R(yd());client;actions;slowConnectionTimer;connection=S(()=>this.view().connection);connectionDetail=S(()=>this.view().connectionDetail);protocolVersion=S(()=>this.view().protocolVersion);frontend=S(()=>this.view().frontend);version=S(()=>this.frontend()?.version??fb.version);slowConnection=R(!1);capabilities=S(()=>this.view().capabilities);state=S(()=>this.view().state);items=S(()=>this.view().items);projects=S(()=>this.view().projects);sessions=S(()=>this.view().sessions);activity=S(()=>this.view().activity);sessionActivity=S(()=>{let e=new Map;for(let n of this.view().activity)e.set(n.sessionKey,n);return e});pendingInteraction=S(()=>this.view().pendingInteraction);lastNotice=S(()=>this.view().lastNotice);lastError=S(()=>this.view().lastError);agentReady=S(()=>this.view().state.agentReady);agentStarting=S(()=>this.view().state.agentStarting);agentError=S(()=>this.view().state.agentError);agentFailure=S(()=>this.view().state.agentFailure);running=S(()=>this.view().state.streaming||this.view().state.busy);workspace=S(()=>this.view().state.workspace);model=S(()=>this.view().state.model);thinkingLevel=S(()=>this.view().state.thinkingLevel);availableModels=S(()=>this.view().state.availableModels);availableThinkingLevels=S(()=>this.view().state.availableThinkingLevels);availableCommands=S(()=>this.view().state.availableCommands);usage=S(()=>this.view().state.usage);hasOlderHistory=S(()=>this.view().state.hasOlderHistory===!0);loadingOlderHistory=S(()=>this.view().state.loadingOlderHistory===!0);constructor(){this.client=J0({transport:this.transport,frontend:fb}),this.actions=this.client.actions;let e=this.client.getView();this.view.set(e),this.trackSlowConnection(e.connection),this.client.subscribe(n=>{this.view.set(n),this.trackSlowConnection(n.connection)}),this.destroyRef.onDestroy(()=>{this.clearSlowConnectionTimer(),this.client.dispose()})}trackSlowConnection(e){if(e!=="connecting"){this.clearSlowConnectionTimer(),this.slowConnection.set(!1);return}this.slowConnectionTimer===void 0&&(this.slowConnectionTimer=setTimeout(()=>{this.slowConnection.set(!0)},qI))}clearSlowConnectionTimer(){this.slowConnectionTimer!==void 0&&(clearTimeout(this.slowConnectionTimer),this.slowConnectionTimer=void 0)}prompt(e,n="new",o,r){this.actions.prompt(e,n,o,r)}editMessage(e,n){this.actions.editMessage(e,n)}forkMessage(e){this.actions.forkMessage(e)}onComposerSeed(e){return this.client.onComposerSeed(e)}onContextSelection(e){return this.client.onContextSelection(e)}onContextSelectionLive(e){return this.client.onContextSelectionLive(e)}ready(){this.actions.ready()}abort(){this.actions.abort()}newSession(e){this.actions.newSession(e)}openProject(e){this.actions.openProject(e)}requestProjects(){this.actions.requestProjects()}activateSession(e,n){this.actions.activateSession(e,n)}closeSession(e){this.actions.closeSession(e)}deleteSession(e){this.actions.deleteSession(e)}compactSession(e){this.actions.compactSession(e)}loadOlderHistory(){this.actions.loadOlderHistory()}loadSession(e){this.actions.loadSession(e)}requestSessions(){this.actions.requestSessions()}refreshCommands(){this.actions.refreshCommands()}setModel(e,n){this.actions.setModel(e,n)}setThinkingLevel(e){this.actions.setThinkingLevel(e)}respond(e){this.actions.respond(e)}hostCommand(e,n){this.actions.hostCommand(e,n)}requestHostCommand(e,n){return this.actions.hostCommand(e,n)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Oe({token:t,factory:t.\u0275fac,providedIn:"root"})};var mb="morse.navigation.collapsed";function GI(){try{return globalThis.localStorage?.getItem(mb)==="1"}catch{return!1}}function WI(t){try{globalThis.localStorage?.setItem(mb,t?"1":"0")}catch{}}var rn=class t{navigationVisible=R(!1);navigationOpen=this.navigationVisible.asReadonly();collapsed=R(GI());navigationCollapsed=this.collapsed.asReadonly();projectPicker=R(!1);projectPickerOpen=this.projectPicker.asReadonly();about=R(!1);aboutOpen=this.about.asReadonly();shortcuts=R(!1);shortcutsOpen=this.shortcuts.asReadonly();projectFilter=R(!1);projectFilterOpen=this.projectFilter.asReadonly();promptTemplate=R(!1);promptTemplateOpen=this.promptTemplate.asReadonly();compactPrompt=R(void 0);compactConfirmOpen=S(()=>this.compactPrompt()!==void 0);compactInstructions=S(()=>this.compactPrompt()?.instructions);modalOpen=S(()=>this.about()||this.shortcuts()||this.projectPicker()||this.projectFilter()||this.promptTemplate()||this.compactPrompt()!==void 0);toggleNavigation(){this.navigationVisible.update(e=>!e)}openNavigation(){this.navigationVisible.set(!0)}closeNavigation(){this.navigationVisible.set(!1)}toggleNavigationCollapsed(){this.setCollapsed(!this.collapsed())}unfoldNavigation(){this.setCollapsed(!1)}setCollapsed(e){this.collapsed.set(e),WI(e)}openAbout(){this.about.set(!0)}closeAbout(){this.about.set(!1)}openShortcuts(){this.shortcuts.set(!0)}closeShortcuts(){this.shortcuts.set(!1)}toggleShortcuts(){this.shortcuts.update(e=>!e)}openProjectFilter(){this.projectFilter.set(!0)}closeProjectFilter(){this.projectFilter.set(!1)}setPromptTemplateOpen(e){this.promptTemplate.set(e)}openProjectPicker(){this.projectPicker.set(!0)}closeProjectPicker(){this.projectPicker.set(!1)}requestCompact(e){this.compactPrompt.set(e?{instructions:e}:{})}closeCompactPrompt(){this.compactPrompt.set(void 0)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Oe({token:t,factory:t.\u0275fac,providedIn:"root"})};var La=[{id:"session.new",group:"Session",label:"New session",detail:"The sidebar button, on the keyboard \u2014 and on a browser host it still asks which folder first.",binding:{key:"n",mod:!0,alt:!0}},{id:"session.search",group:"Session",label:"Focus the session search",detail:"Opens the sidebar when the layout hid it, and puts the caret in the field. In the prompt, `/` opens the command palette instead.",binding:{key:"/"}},{id:"project.filter",group:"Navigate",label:"Change project focus",detail:"Narrows the sidebar to one project. Only a host with several projects has this.",binding:{key:"p",mod:!0,alt:!0},overlay:!0},{id:"model.pick",group:"Model",label:"Change model",detail:"Opens the model chooser above the prompt.",binding:{key:"m",mod:!0,alt:!0},overlay:!0,whileTyping:!0},{id:"thinking.pick",group:"Model",label:"Change thinking level",detail:"Opens the reasoning-level chooser next to the model.",binding:{key:"t",mod:!0,alt:!0},overlay:!0,whileTyping:!0},{id:"context.compact",group:"Context",label:"Compact the conversation",detail:"Asks first: pi replaces what it remembers with a summary.",binding:{key:"c",mod:!0,alt:!0},overlay:!0,whileTyping:!0},{id:"prompt.send",group:"Typing",label:"Send the prompt",detail:"While the prompt has the caret. During a run, the same key steers the agent instead.",keys:"Enter"},{id:"prompt.newline",group:"Typing",label:"New line",detail:"The prompt grows with the text rather than sending it.",keys:"Shift+Enter"},{id:"prompt.mention",group:"Typing",label:"Mention a file",detail:"Opens the picker that inserts an @path mention.",keys:"@"},{id:"prompt.commands",group:"Typing",label:"Command palette",detail:"The slash commands Morse and pi understand, filtered as you type.",keys:"/"},{id:"help.shortcuts",group:"Help",label:"This list",detail:"Opens and closes these rows, outside a text field.",binding:{key:"?"},overlay:!0}];function Fa(t){return"binding"in t}function hb(){let t=globalThis.navigator;return/mac|iphone|ipad/i.test(t?.userAgent??"")}function gb(t,e=hb()){let n=[];return t.mod===!0&&n.push(e?"\u2318":"Ctrl"),t.alt===!0&&n.push(e?"\u2325":"Alt"),n.push(t.key.length===1&&/[a-z]/.test(t.key)?t.key.toUpperCase():t.key),e?n.join(""):n.join("+")}var ro=class t{shell=N(rn);handlers=new Map;revision=R(0);catalog=La;available=S(()=>{this.revision();let e=new Map;for(let n of La){if(!Fa(n))continue;let o=this.handlers.get(n.id);e.set(n.id,o!==void 0&&(o.enabled?.()??!0))}return e});constructor(){let e=globalThis.document;e&&(e.addEventListener("keydown",this.onKeydown,!0),N(ht).onDestroy(()=>e.removeEventListener("keydown",this.onKeydown,!0)))}bind(e,n,o){let r={run:n,enabled:o};return this.handlers.set(e,r),this.bump(),()=>{this.handlers.get(e)===r&&(this.handlers.delete(e),this.bump())}}bump(){this.revision.update(e=>e+1)}onKeydown=e=>{if(e.defaultPrevented||e.isComposing||e.getModifierState?.("AltGraph")===!0)return;let n=La.find(r=>Fa(r)&&YI(r.binding,e));if(n===void 0||n.whileTyping!==!0&&ZI(e.target)||n.overlay===!0&&this.shell.modalOpen()&&!(n.id==="help.shortcuts"&&this.shell.shortcutsOpen()))return;let o=this.handlers.get(n.id);o===void 0||o.enabled!==void 0&&!o.enabled()||(e.preventDefault(),o.run())};static \u0275fac=function(n){return new(n||t)};static \u0275prov=Oe({token:t,factory:t.\u0275fac,providedIn:"root"})};function YI(t,e){return e.key.toLowerCase()!==t.key.toLowerCase()||t.mod===!0!==(hb()?e.metaKey:e.ctrlKey)?!1:t.alt===!0===e.altKey}function ZI(t){let e=t;if(e===null||typeof e.tagName!="string")return!1;let n=e.tagName.toLowerCase();return n==="input"||n==="textarea"||n==="select"||e.isContentEditable===!0}var KI=10*1024*1024,ms=class t{morse=N(wt);available=S(()=>this.morse.capabilities()?.fileUpload===!0);async upload(e){let n=[],o=[];for(let r of e){if(r.size>KI){o.push(r.name);continue}let i=await Am(r);if(!i){o.push(r.name);continue}let s=await this.morse.requestHostCommand("uploadFile",{name:r.name,mimeType:r.type,data:i}),a=typeof s?.path=="string"?s.path:void 0;if(!a){o.push(r.name);continue}n.push({path:a,name:r.name,bytes:typeof s?.bytes=="number"?s.bytes:r.size})}return{added:n,failed:o}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Oe({token:t,factory:t.\u0275fac,providedIn:"root"})};var bd=class t{morse=N(wt);cache=R([]);loading=R(!1);requested=!1;loadedFor;files=this.cache.asReadonly();busy=this.loading.asReadonly();available=S(()=>this.morse.capabilities()?.filePicker===!0);constructor(){ue(()=>{if(!this.available())return;let e=this.morse.workspace().cwd;this.ensureLoaded(this.loadedFor!==void 0&&this.loadedFor!==e)})}ensureLoaded(e=!1){if(this.loading()||this.requested&&!e)return;this.requested=!0;let n=this.morse.workspace().cwd;this.loading.set(!0),this.morse.requestHostCommand("listFiles").then(o=>{if(this.loading.set(!1),this.morse.workspace().cwd!==n){this.ensureLoaded(!0);return}this.loadedFor=n;let r=o?.files;Array.isArray(r)&&this.cache.set(r.filter(i=>typeof i=="string"))})}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Oe({token:t,factory:t.\u0275fac,providedIn:"root"})};function QI(t,e,n=80){let o=Math.floor(t-4-8);return Math.max(n,Math.min(e,o))}var xd=class t{preferred=ee(320,{alias:"morsePopoverFit"});host=N(Zt);renderer=N(Yo).createRenderer(null,null);observer;constructor(){si(()=>{this.fit();let e=this.anchor();e&&typeof ResizeObserver<"u"&&(this.observer=new ResizeObserver(()=>this.fit()),this.observer.observe(e))}),N(ht).onDestroy(()=>this.observer?.disconnect())}onWindowResize(){this.fit()}anchor(){let e=this.host.nativeElement;return e.offsetParent??e.parentElement}fit(){let e=this.anchor()?.getBoundingClientRect().top??0,n=QI(e,this.preferred());this.renderer.setStyle(this.host.nativeElement,"--morse-popover-max-height",`${n}px`)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=ua({type:t,selectors:[["","morsePopoverFit",""]],hostBindings:function(n,o){n&1&&L("resize",function(){return o.onWindowResize()},Nf)},inputs:{preferred:[1,"morsePopoverFit","preferred"]}})};var sn=class t{morseEnter=ee(0);morseEnterY=ee(8);morseEnterDuration=ee(260);morseEnterScale=ee(void 0);element=N(Zt);animation=N(gn);ngAfterViewInit(){let e=Math.max(0,this.morseEnter());this.animation.enter(this.element.nativeElement,{y:this.morseEnterY(),duration:this.morseEnterDuration(),scale:this.morseEnterScale(),delay:Math.min(e,8)*24})}static \u0275fac=function(n){return new(n||t)};static \u0275dir=ua({type:t,selectors:[["","morseEnter",""]],inputs:{morseEnter:[1,"morseEnter"],morseEnterY:[1,"morseEnterY"],morseEnterDuration:[1,"morseEnterDuration"],morseEnterScale:[1,"morseEnterScale"]}})};var XI=["list"];function JI(t,e){t&1&&(g(0,"div",2),p(1,"Reading the workspace\u2026"),_())}function ek(t,e){if(t&1&&(g(0,"div",4),p(1),_()),t&2){let n=h(2);u(),ce("No match for \u201C",n.query(),"\u201D.")}}function tk(t,e){if(t&1){let n=z();g(0,"div",4),p(1," The host returned no workspace files. "),g(2,"button",5),L("click",function(){I(n);let r=h(2);return k(r.reload.emit())}),p(3,"Load again"),_()()}}function nk(t,e){if(t&1&&T(0,ek,2,1,"div",4)(1,tk,4,0,"div",4),t&2){let n=h();M(n.query().length>0?0:1)}}function ok(t,e){if(t&1){let n=z();g(0,"li")(1,"button",6),L("mouseenter",function(){let r=I(n).$index,i=h(2);return k(i.activeChange.emit(r))})("click",function(){let r=I(n).$implicit,i=h(2);return k(i.pick.emit(r))}),g(2,"span",7),p(3),_(),g(4,"span",8)(5,"span",9),p(6),_(),p(7),_()()()}if(t&2){let n=e.$implicit,o=e.$index,r=h(2);u(),Te("active",o===r.active()),u(2),D(r.isDirectory(n)?"\u25B8":"\u25A4"),u(3),D(r.split(n).dir),u(),ce("",r.split(n).base," ")}}function rk(t,e){if(t&1&&(g(0,"ul",null,0),_e(2,ok,8,5,"li",null,ci),_()),t&2){let n=h();u(2),be(n.files())}}var Ed=class t{files=ee.required();busy=ee(!1);query=ee("");active=ee(0);pick=rt();close=rt();reload=rt();activeChange=rt();list=at("list");constructor(){ue(()=>{this.active(),this.files(),setTimeout(()=>this.revealActive(),0)})}revealActive(){let e=this.list()?.nativeElement,n=e?.children.item(this.active());if(!e||!n)return;let o=e.getBoundingClientRect(),r=n.getBoundingClientRect();r.top<o.top?e.scrollTop-=o.top-r.top:r.bottom>o.bottom&&(e.scrollTop+=r.bottom-o.bottom)}split(e){let n=e.lastIndexOf("/");return n===-1?{dir:"",base:e}:{dir:e.slice(0,n+1),base:e.slice(n+1)}}isDirectory(e){return Rm(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-file-picker"]],viewQuery:function(n,o){n&1&&vt(o.list,XI,5),n&2&&bt()},inputs:{files:[1,"files"],busy:[1,"busy"],query:[1,"query"],active:[1,"active"]},outputs:{pick:"pick",close:"close",reload:"reload",activeChange:"activeChange"},decls:16,vars:3,consts:[["list",""],[1,"picker",3,"morseEnter","morseEnterY"],[1,"busy"],[1,"hint"],[1,"empty"],["type","button",1,"reload",3,"click"],["type","button",3,"mouseenter","click"],[1,"icon"],[1,"path"],[1,"dir"]],template:function(n,o){n&1&&(g(0,"div",1),T(1,JI,2,0,"div",2)(2,nk,2,1)(3,rk,4,0,"ul"),g(4,"div",3)(5,"kbd"),p(6,"\u2191"),_(),g(7,"kbd"),p(8,"\u2193"),_(),p(9," move \xB7 "),g(10,"kbd"),p(11,"Enter"),_(),p(12," attach/open \xB7 "),g(13,"kbd"),p(14,"Esc"),_(),p(15," close "),_()()),n&2&&(K("morseEnter",0)("morseEnterY",6),u(),M(o.busy()&&o.files().length===0?1:o.files().length===0?2:3))},dependencies:[sn],styles:["[_nghost-%COMP%]{display:block}.picker[_ngcontent-%COMP%]{display:flex;flex-direction:column;max-height:var(--%NS%morse-popover-max-height, 300px);border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 10px 28px #0000004d;overflow:hidden}ul[_ngcontent-%COMP%]{margin:0;padding:4px 0;list-style:none;overflow-y:auto}li[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;padding:4px 10px;border:0;border-radius:0;background:transparent;color:var(--%NS%morse-fg);font-size:12px;text-align:left;cursor:pointer}li[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{background:var(--%NS%morse-active)}.icon[_ngcontent-%COMP%]{flex:none;color:var(--%NS%morse-fg-muted);font-size:11px}.path[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--%NS%morse-font-mono)}.dir[_ngcontent-%COMP%]{color:var(--%NS%morse-fg-muted)}.empty[_ngcontent-%COMP%], .busy[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px 10px;color:var(--%NS%morse-fg-muted);font-size:12px}.reload[_ngcontent-%COMP%]{padding:1px 8px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg);font-size:11px;cursor:pointer}.reload[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}.hint[_ngcontent-%COMP%]{padding:5px 10px;border-top:1px solid var(--%NS%morse-border);color:var(--%NS%morse-fg-muted);font-size:11px}kbd[_ngcontent-%COMP%]{font-family:var(--%NS%morse-font-mono);font-size:10px;padding:0 3px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm)}"]})};function vb(t,e,n=50){let o=e.trim().toLowerCase();return t.map(r=>({file:r,score:o.length===0?0:ik(r,o)})).filter(r=>r.score<Number.POSITIVE_INFINITY).sort((r,i)=>yb(r.file)-yb(i.file)||r.score-i.score||r.file.length-i.file.length||r.file.localeCompare(i.file)).slice(0,n).map(r=>r.file)}function Rm(t){return t.endsWith("/")}function yb(t){return Rm(t)?0:1}function ik(t,e){let n=(Rm(t)?t.slice(0,-1):t).toLowerCase(),o=n.lastIndexOf("/"),r=o===-1?n:n.slice(o+1);return r.startsWith(e)?0:r.includes(e)?1:n.startsWith(e)?2:n.includes(e)?3:Number.POSITIVE_INFINITY}var sk=["list"],ak=(t,e)=>e.id;function ck(t,e){if(t&1&&(g(0,"div",3),p(1),_()),t&2){let n=h(2);u(),ce("No command matches \u201C",n.query(),"\u201D.")}}function lk(t,e){t&1&&(g(0,"div",3),p(1,"No commands available in this session."),_())}function dk(t,e){if(t&1&&T(0,ck,2,1,"div",3)(1,lk,2,0,"div",3),t&2){let n=h();M(n.query().length>0?0:1)}}function uk(t,e){if(t&1&&(g(0,"span",5),p(1),_()),t&2){let n=h().$implicit;u(),D(n.icon)}}function pk(t,e){if(t&1&&(g(0,"span",8),p(1),_()),t&2){let n=h().$implicit;u(),D(n.description)}}function fk(t,e){if(t&1&&(g(0,"span",9),p(1),_()),t&2){let n=h().$implicit;u(),D(n.badge)}}function mk(t,e){if(t&1){let n=z();g(0,"li")(1,"button",4),L("mouseenter",function(){let r=I(n).$index,i=h(2);return k(i.activeChange.emit(r))})("pointerdown",function(r){return r.preventDefault()})("click",function(){let r=I(n).$implicit,i=h(2);return k(i.pick.emit(r.id))}),T(2,uk,2,1,"span",5),g(3,"span",6)(4,"span",7),p(5),_(),T(6,pk,2,1,"span",8),_(),T(7,fk,2,1,"span",9),_()()}if(t&2){let n=e.$implicit,o=e.$index,r=h(2);u(),Te("active",o===r.active()),u(),M(n.icon?2:-1),u(3),D(n.label),u(),M(n.description?6:-1),u(),M(n.badge?7:-1)}}function hk(t,e){if(t&1&&(g(0,"ul",null,0),_e(2,mk,8,6,"li",null,ak),_()),t&2){let n=h();u(2),be(n.items())}}var Cd=class t{items=ee.required();query=ee("");active=ee(0);pick=rt();close=rt();activeChange=rt();list=at("list");constructor(){ue(()=>{this.active(),this.items(),setTimeout(()=>this.revealActive(),0)})}revealActive(){let e=this.list()?.nativeElement,n=e?.children.item(this.active());if(!e||!n)return;let o=e.getBoundingClientRect(),r=n.getBoundingClientRect();r.top<o.top?e.scrollTop-=o.top-r.top:r.bottom>o.bottom&&(e.scrollTop+=r.bottom-o.bottom)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-command-picker"]],viewQuery:function(n,o){n&1&&vt(o.list,sk,5),n&2&&bt()},inputs:{items:[1,"items"],query:[1,"query"],active:[1,"active"]},outputs:{pick:"pick",close:"close",activeChange:"activeChange"},decls:18,vars:3,consts:[["list",""],[1,"picker",3,"morseEnter","morseEnterY"],[1,"hint"],[1,"empty"],["type","button",3,"mouseenter","pointerdown","click"],[1,"icon"],[1,"text"],[1,"label"],[1,"description"],[1,"badge"]],template:function(n,o){n&1&&(g(0,"div",1),T(1,dk,2,1)(2,hk,4,0,"ul"),g(3,"div",2)(4,"kbd"),p(5,"\u2191"),_(),g(6,"kbd"),p(7,"\u2193"),_(),p(8," move \xB7 "),g(9,"kbd"),p(10,"Enter"),_(),p(11," run \xB7 "),g(12,"kbd"),p(13,"Tab"),_(),p(14," insert \xB7 "),g(15,"kbd"),p(16,"Esc"),_(),p(17," close "),_()()),n&2&&(K("morseEnter",0)("morseEnterY",6),u(),M(o.items().length===0?1:2))},dependencies:[sn],styles:["[_nghost-%COMP%]{display:block}.picker[_ngcontent-%COMP%]{display:flex;flex-direction:column;max-height:var(--%NS%morse-popover-max-height, 320px);border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 10px 28px #0000004d;overflow:hidden}ul[_ngcontent-%COMP%]{margin:0;padding:4px 0;list-style:none;overflow-y:auto}li[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;padding:5px 10px;border:0;border-radius:0;background:transparent;color:var(--%NS%morse-fg);font-size:12px;text-align:left;cursor:pointer}li[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{background:var(--%NS%morse-active)}.icon[_ngcontent-%COMP%]{flex:none;width:14px;color:var(--%NS%morse-fg-muted);text-align:center}.text[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.label[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--%NS%morse-font-mono)}.description[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--%NS%morse-fg-muted);font-size:11px}.badge[_ngcontent-%COMP%]{flex:none;padding:1px 6px;border-radius:999px;background:var(--%NS%morse-badge-bg);color:var(--%NS%morse-badge-fg);font-size:10px}.empty[_ngcontent-%COMP%]{padding:8px 10px;color:var(--%NS%morse-fg-muted);font-size:12px}.hint[_ngcontent-%COMP%]{padding:5px 10px;border-top:1px solid var(--%NS%morse-border);color:var(--%NS%morse-fg-muted);font-size:11px}kbd[_ngcontent-%COMP%]{font-family:var(--%NS%morse-font-mono);font-size:10px;padding:0 3px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm)}"]})};function _b(t,e,n=50){let o=e.trim().toLowerCase();return o.length===0?t.slice(0,n):t.map(r=>({item:r,score:gk(r,o)})).filter(r=>r.score<Number.POSITIVE_INFINITY).sort((r,i)=>r.score-i.score||r.item.label.length-i.item.label.length).slice(0,n).map(r=>r.item)}function gk(t,e){let n=t.label.toLowerCase();return n.startsWith(e)?0:n.includes(e)?1:t.description?.toLowerCase().includes(e)?2:Number.POSITIVE_INFINITY}var yk=["card"],vk=(t,e)=>e.id;function _k(t,e){t&1&&(b(0,"p",5),p(1),E()),t&2&&(u(),D(e))}function bk(t,e){t&1&&(b(0,"span",16),p(1,"required"),E())}function xk(t,e){if(t&1){let n=z();b(0,"textarea",19),q("input",function(r){I(n);let i=h().$implicit,s=h();return k(s.setValue(i.id,r))})("keydown",function(r){I(n);let i=h(2);return k(i.onSubmitKey(r))}),E()}if(t&2){let n=h().$implicit,o=h();Ae("value",o.value(n.id)),pe("aria-label",n.label)}}function Ek(t,e){if(t&1){let n=z();b(0,"input",20),q("input",function(r){I(n);let i=h().$implicit,s=h();return k(s.setValue(i.id,r))})("keydown.enter",function(r){I(n);let i=h(2);return k(i.submit(r))}),E()}if(t&2){let n=h().$implicit,o=h();Ae("value",o.value(n.id)),pe("aria-label",n.label)}}function Ck(t,e){if(t&1&&(b(0,"label",7)(1,"span",8),p(2),T(3,bk,2,0,"span",16),E(),T(4,xk,1,2,"textarea",17)(5,Ek,1,2,"input",18),E()),t&2){let n=e.$implicit;u(2),ce(" ",n.label," "),u(),M(n.required?3:-1),u(),M(n.index===void 0?4:5)}}var wd=class t{request=ee.required();submitted=rt();cancelled=rt();card=at("card");values=R({});extra=R("");preview=S(()=>ob(this.request().form,this.values(),this.extra()));ready=S(()=>this.request().form.arguments.every(e=>!e.required||(this.values()[e.id]??"").trim().length>0));constructor(){ue(()=>{this.request(),this.values.set({}),this.extra.set(""),setTimeout(()=>{this.card()?.nativeElement.querySelector("input, textarea")?.focus()},0)})}value(e){return this.values()[e]??""}setValue(e,n){let o=n.target.value;this.values.update(r=>Q(H({},r),{[e]:o}))}setExtra(e){this.extra.set(e.target.value)}submit(e){e?.preventDefault(),this.ready()&&this.submitted.emit(this.preview())}onSubmitKey(e){e.key==="Enter"&&(e.ctrlKey||e.metaKey)&&this.submit(e)}onEscape(){this.cancelled.emit()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-prompt-template-dialog"]],viewQuery:function(n,o){n&1&&vt(o.card,yk,5),n&2&&bt()},hostBindings:function(n,o){n&1&&L("keydown.escape",function(){return o.onEscape()},Ot)},inputs:{request:[1,"request"]},outputs:{submitted:"submitted",cancelled:"cancelled"},decls:26,vars:5,consts:[["card",""],[1,"modal-layer",3,"click"],["role","dialog","aria-modal","true","aria-labelledby","template-title",1,"modal-card",3,"click"],[1,"head"],["id","template-title"],[1,"description"],[1,"fields"],[1,"field"],[1,"field-label"],[1,"optional"],["rows","3","aria-label","Additional instructions","placeholder","Anything the template does not cover",3,"input","keydown","value"],[1,"preview"],["aria-label","Prompt preview"],[1,"actions"],["type","button",1,"secondary",3,"click"],["type","button",3,"click","disabled"],[1,"required"],["rows","2","placeholder",'Shell-quoted arguments, e.g. "api tests" lint',3,"value"],["type","text",3,"value"],["rows","2","placeholder",'Shell-quoted arguments, e.g. "api tests" lint',3,"input","keydown","value"],["type","text",3,"input","keydown.enter","value"]],template:function(n,o){if(n&1&&(b(0,"div",1),q("click",function(){return o.cancelled.emit()}),b(1,"div",2,0),q("click",function(i){return i.stopPropagation()}),b(3,"header",3)(4,"h2",4),p(5),E(),T(6,_k,2,1,"p",5),E(),b(7,"div",6),_e(8,Ck,6,3,"label",7,vk),b(10,"label",7)(11,"span",8),p(12," Additional instructions "),b(13,"span",9),p(14,"optional \xB7 appended below the template"),E()(),b(15,"textarea",10),q("input",function(i){return o.setExtra(i)})("keydown",function(i){return o.onSubmitKey(i)}),E()(),b(16,"div",11)(17,"span",8),p(18,"Preview"),E(),b(19,"pre",12),p(20),E()(),b(21,"div",13)(22,"button",14),q("click",function(){return o.cancelled.emit()}),p(23,"Cancel"),E(),b(24,"button",15),q("click",function(){return o.submit()}),p(25,"Send"),E()()()()()),n&2){let r;u(5),ce("/",o.request().name),u(),M((r=o.request().description)?6:-1,r),u(2),be(o.request().form.arguments),u(7),Ae("value",o.extra()),u(5),D(o.preview()),u(4),Ae("disabled",!o.ready())}},styles:["[_nghost-%COMP%]{display:contents}.modal-layer[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:75;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000073}.modal-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;width:min(560px,100%);max-height:min(84vh,760px);overflow:auto;padding:16px 18px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-lg);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 18px 48px #0006;animation:_ngcontent-%COMP%_template-in .14s ease-out}.head[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:3px}h2[_ngcontent-%COMP%]{margin:0;font-family:var(--%NS%morse-font-mono);font-size:14px;font-weight:600}.description[_ngcontent-%COMP%]{margin:0;font-size:12px;color:var(--%NS%morse-fg-muted)}form[_ngcontent-%COMP%], .fields[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px}.field-label[_ngcontent-%COMP%]{font-size:11.5px;font-weight:600;color:var(--%NS%morse-fg-muted)}.required[_ngcontent-%COMP%], .optional[_ngcontent-%COMP%]{margin-left:4px;font-weight:400;font-size:10.5px}.required[_ngcontent-%COMP%]{color:var(--%NS%morse-warn)}.optional[_ngcontent-%COMP%]{color:var(--%NS%morse-fg-muted)}input[_ngcontent-%COMP%], textarea[_ngcontent-%COMP%]{width:100%;padding:6px 8px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-input-bg, transparent);color:var(--%NS%morse-fg);font-family:inherit;font-size:12.5px;resize:vertical}input[_ngcontent-%COMP%]:focus, textarea[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--%NS%morse-accent)}.preview[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px}pre[_ngcontent-%COMP%]{margin:0;max-height:180px;overflow:auto;padding:8px 10px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-code-bg, rgb(0 0 0 / 18%));color:var(--%NS%morse-fg);font-family:var(--%NS%morse-font-mono);font-size:11.5px;line-height:1.55;white-space:pre-wrap;word-break:break-word}.actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:6px}@keyframes _ngcontent-%COMP%_template-in{0%{opacity:0;transform:translateY(6px)}}@media(prefers-reduced-motion:reduce){.modal-card[_ngcontent-%COMP%]{animation:none}}"]})};function io(t){return t<1e3?t.toString():t<1e4?`${(t/1e3).toFixed(1)}k`:t<1e6?`${Math.round(t/1e3)}k`:t<1e7?`${(t/1e6).toFixed(1)}M`:`${Math.round(t/1e6)}M`}function bb(t,e){let n=t?.[e];return typeof n=="number"?io(n):"\u2014"}function Lm(t){if(!t)return;let e=t.cacheReadTokens??0,n=t.cacheWriteTokens??0,o=t.inputTokens+e+n;if(!(o<=0||e===0&&n===0))return e/o*100}function Fm(t){if(!(t===void 0||t<=0))return`$${t.toFixed(3)}`}function Vm(t){let e=[],n=t.usage;if(n){n.inputTokens>0&&e.push(`\u2191${io(n.inputTokens)}`),n.outputTokens>0&&e.push(`\u2193${io(n.outputTokens)}`),n.cacheReadTokens&&e.push(`R${io(n.cacheReadTokens)}`),n.cacheWriteTokens&&e.push(`W${io(n.cacheWriteTokens)}`);let i=Lm(n);i!==void 0&&e.push(`CH${i.toFixed(1)}%`)}let o=Fm(t.costUsd);o&&e.push(o);let r=t.contextUsage;if(r){let i=r.percent!==null?`${r.percent.toFixed(1)}%`:"?";e.push(`${i}/${io(r.contextWindow)}`)}return e.join(" ")}var wk=["search"],Sk=["list"],Tk=(t,e)=>e.provider,Mk=(t,e)=>e.index;function Ik(t,e){if(t&1&&(g(0,"div",10),p(1),_()),t&2){let n=h();u(),ce("No model matches \u201C",n.filter(),"\u201D.")}}function kk(t,e){t&1&&(g(0,"span",15),p(1),_()),t&2&&(u(),D(e))}function Nk(t,e){t&1&&(g(0,"span",16),p(1,"\u2713"),_())}function Dk(t,e){if(t&1){let n=z();g(0,"button",13),L("mouseenter",function(){let r=I(n).$implicit,i=h(4);return k(i.active.set(r.index))})("click",function(){let r=I(n).$implicit,i=h(4);return k(i.pick.emit(r.model))}),g(1,"span",14),p(2),_(),T(3,kk,2,1,"span",15),T(4,Nk,2,0,"span",16),_()}if(t&2){let n,o=e.$implicit,r=h(4);Te("active",o.index===r.active())("selected",r.keyOf(o.model)===r.current()),K("title",r.keyOf(o.model)),pe("aria-current",r.keyOf(o.model)===r.current()?"true":null),u(2),D(o.model.name),u(),M((n=r.context(o.model))?3:-1,n),u(),M(r.keyOf(o.model)===r.current()?4:-1)}}function Ok(t,e){if(t&1&&(g(0,"div",11),p(1),_(),_e(2,Dk,5,9,"button",12,Mk)),t&2){let n=h().$implicit;u(),D(n.provider),u(),be(n.rows)}}function Pk(t,e){if(t&1&&T(0,Ok,4,1),t&2){let n=e.$implicit;M(n.rows.length>0?0:-1)}}function Ak(t,e){if(t&1&&_e(0,Pk,1,1,null,null,Tk),t&2){let n=h();be(n.groups())}}function Rk(t,e){let n=e.trim().toLowerCase(),o=new Map;for(let r of t){if(n.length>0&&!`${r.provider} ${r.id} ${r.name}`.toLowerCase().includes(n))continue;let i=o.get(r.provider);i?i.push(r):o.set(r.provider,[r])}return[...o].map(([r,i])=>({provider:r,models:i}))}var Sd=class t{models=ee.required();current=ee("");pick=rt();close=rt();host=N(Zt);search=at("search");list=at("list");filter=R("");active=R(0);groups=S(()=>{let e=0;return Rk(this.models(),this.filter()).map(n=>({provider:n.provider,rows:n.models.map(o=>({model:o,index:e++}))}))});visible=S(()=>this.groups().flatMap(e=>e.rows.map(n=>n.model)));constructor(){si(()=>this.search()?.nativeElement.focus()),ue(()=>{if(this.groups(),this.filter().trim().length>0)return;let e=this.visible().findIndex(n=>this.keyOf(n)===this.current());e>=0&&this.active.set(e)}),ue(()=>{this.active(),this.groups(),setTimeout(()=>this.revealActive(),0)})}revealActive(){let e=this.list()?.nativeElement,n=e?.querySelectorAll(".row")[this.active()];if(!e||!n)return;let o=e.getBoundingClientRect(),r=n.getBoundingClientRect(),i=e.querySelector(".group")?.offsetHeight??0,s=o.top+i;r.top<s?e.scrollTop-=s-r.top:r.bottom>o.bottom&&(e.scrollTop+=r.bottom-o.bottom)}keyOf(e){return`${e.provider}/${e.id}`}context(e){return e.contextWindow?io(e.contextWindow):""}onFilter(e){this.filter.set(e.target.value),this.active.set(0)}onKeydown(e){let n=this.visible();switch(e.key){case"Escape":e.preventDefault(),this.close.emit();return;case"ArrowDown":e.preventDefault(),this.active.update(o=>Math.min(o+1,Math.max(0,n.length-1)));return;case"ArrowUp":e.preventDefault(),this.active.update(o=>Math.max(0,o-1));return;case"Enter":{let o=n[this.active()];o&&(e.preventDefault(),this.pick.emit(o));return}default:return}}onDocumentPointerdown(e){let n=e.target;n&&!this.host.nativeElement.contains(n)&&this.close.emit()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-model-picker"]],viewQuery:function(n,o){n&1&&vt(o.search,wk,5)(o.list,Sk,5),n&2&&bt(2)},hostBindings:function(n,o){n&1&&L("pointerdown",function(i){return o.onDocumentPointerdown(i)},Ot)},inputs:{models:[1,"models"],current:[1,"current"]},outputs:{pick:"pick",close:"close"},decls:12,vars:4,consts:[["search",""],["list",""],[1,"panel",3,"morseEnter","morseEnterY"],[1,"search"],["aria-hidden","true",1,"search-icon"],["viewBox","0 0 16 16"],["cx","7","cy","7","r","4.2"],["d","M10.2 10.2 14 14"],["type","text","placeholder","Search models","aria-label","Search models",3,"input","keydown","value"],[1,"list"],[1,"empty"],[1,"group"],["type","button",1,"row",3,"active","selected","title"],["type","button",1,"row",3,"mouseenter","click","title"],[1,"name"],[1,"meta"],[1,"check"]],template:function(n,o){n&1&&(g(0,"div",2)(1,"div",3)(2,"span",4),Tt(),g(3,"svg",5),we(4,"circle",6)(5,"path",7),_()(),fn(),g(6,"input",8,0),L("input",function(i){return o.onFilter(i)})("keydown",function(i){return o.onKeydown(i)}),_()(),g(8,"div",9,1),T(10,Ik,2,1,"div",10)(11,Ak,2,0),_()()),n&2&&(K("morseEnter",0)("morseEnterY",6),u(6),K("value",o.filter()),u(4),M(o.visible().length===0?10:11))},dependencies:[sn],styles:["[_nghost-%COMP%]{display:block}.panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;max-height:var(--%NS%morse-popover-max-height, 340px);border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 12px 32px #00000059;overflow:hidden}.search[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;padding:8px 10px;border-bottom:1px solid var(--%NS%morse-border)}.search-icon[_ngcontent-%COMP%]{position:absolute;left:19px;display:inline-flex;color:var(--%NS%morse-fg-muted);pointer-events:none}.search-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round}.search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;min-width:0;padding-left:28px;font-size:12.5px}.search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus-visible{outline:none}.list[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;padding-bottom:4px}.group[_ngcontent-%COMP%]{position:sticky;top:0;padding:8px 10px 4px;background:var(--%NS%morse-panel, var(--%NS%morse-bg));color:var(--%NS%morse-fg-muted);font-size:10px;font-weight:600;letter-spacing:.06em;text-transform:uppercase}.row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;padding:5px 10px;border:0;border-radius:0;background:transparent;color:var(--%NS%morse-fg);font:inherit;font-size:12.5px;text-align:left;cursor:pointer}.row.active[_ngcontent-%COMP%], .row[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}.row.selected[_ngcontent-%COMP%]{background:var(--%NS%morse-active)}.name[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.meta[_ngcontent-%COMP%]{flex:none;color:var(--%NS%morse-fg-muted);font-size:11px}.check[_ngcontent-%COMP%]{flex:none;color:var(--%NS%morse-accent);font-size:12px}.empty[_ngcontent-%COMP%]{padding:12px 10px;color:var(--%NS%morse-fg-muted);font-size:12px}"]})};var Lk=["brain"],Fk=["halo"];function Vk(t,e){if(t&1&&(Tt(),$e(0,"path")),t&2){let n=e.$implicit;pe("d",n)}}function jk(t,e){t&1&&$e(0,"span",3,1)}function $k(t,e){t&1&&$e(0,"span",4,1)}var Hk=["M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z","M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z","M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4","M17.599 6.5a3 3 0 0 0 .399-1.375","M6.003 5.125A3 3 0 0 0 6.401 6.5","M3.477 10.896a4 4 0 0 1 .585-.396","M19.938 10.5a4 4 0 0 1 .585.396","M6 18a4 4 0 0 1-1.967-.516","M19.967 17.484A4 4 0 0 1 18 18"],Bk={off:0,minimal:1,low:2,medium:3,high:4,xhigh:5,max:6};function Uk(t){return Bk[t]??2}function zk(t){switch(t){case"off":return{params:{opacity:[.35,.6]},duration:5200,ease:"inOut(1)"};case"minimal":return{params:{opacity:[.6,1]},duration:2200};case"low":return{params:{rotate:["-7deg","7deg"]},duration:1500};case"medium":return{params:{scale:[1,1.14]},duration:950,halo:{duration:1300}};case"high":return{params:{scale:[1,1.18]},duration:560,halo:{duration:800}};case"xhigh":return{params:{scale:[1,1.16],rotate:["-8deg","8deg"]},duration:440,halo:{duration:620}};case"max":return{params:{scale:[1,1.22],rotate:["-12deg","12deg"]},duration:320,ease:"linear",halo:{duration:480}}}}var Td=class t{level=ee.required();bumped=ee(!1);host=N(Zt);animation=N(gn);brain=at("brain");halos=A_("halo");stoppers=[];paths=Hk;intensity=S(()=>Uk(this.level()));constructor(){ue(()=>{let e=this.level(),n=this.brain()?.nativeElement,o=this.halos().map(i=>i.nativeElement);if(this.stopLoops(),!n||!this.animation.isEnabled)return;let r=zk(e);this.stoppers.push(this.animation.loop(n,r.params,{duration:r.duration,delay:r.delay??0,ease:r.ease??"inOut(2)"})),r.halo&&o.forEach((i,s)=>{this.stoppers.push(this.animation.loop(i,{scale:[.72,1.9],opacity:[.55,0]},{duration:r.halo.duration,delay:(r.halo.delay??0)+s*r.halo.duration*.5,ease:"out(2)",alternate:!1}))})}),ue(()=>{this.bumped()&&this.animation.pop(this.host.nativeElement,{scale:1.3,duration:420})}),N(ht).onDestroy(()=>this.stopLoops())}stopLoops(){for(let e of this.stoppers)e();this.stoppers=[]}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-brain"]],viewQuery:function(n,o){n&1&&vt(o.brain,Lk,5)(o.halos,Fk,5),n&2&&bt(2)},hostVars:3,hostBindings:function(n,o){n&2&&(pe("data-level",o.level()),Te("bumped",o.bumped()))},inputs:{level:[1,"level"],bumped:[1,"bumped"]},decls:6,vars:2,consts:[["brain",""],["halo",""],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","1.7","stroke-linecap","round","stroke-linejoin","round","aria-hidden","true",1,"brain"],["aria-hidden","true",1,"wave","wave-a"],["aria-hidden","true",1,"wave","wave-b"]],template:function(n,o){n&1&&(Tt(),b(0,"svg",2,0),_e(2,Vk,1,1,":svg:path",null,ci),E(),T(4,jk,2,0,"span",3),T(5,$k,2,0,"span",4)),n&2&&(u(2),be(o.paths),u(2),M(o.intensity()>=3?4:-1),u(),M(o.intensity()>=4?5:-1))},styles:['[_nghost-%COMP%]{position:relative;display:inline-flex;width:16px;height:16px;color:var(--%NS%morse-accent)}.brain[_ngcontent-%COMP%]{width:100%;height:100%;transform-box:fill-box;transform-origin:center}.wave[_ngcontent-%COMP%]{position:absolute;inset:-1px;border-radius:50%;border:1px solid currentColor;opacity:0;pointer-events:none}[data-level="off"][_nghost-%COMP%]{color:var(--%NS%morse-fg-muted)}[data-level="minimal"][_nghost-%COMP%]{color:var(--%NS%morse-info)}[data-level="low"][_nghost-%COMP%]{color:var(--%NS%morse-success)}[data-level="medium"][_nghost-%COMP%]{color:var(--%NS%morse-warn)}[data-level="high"][_nghost-%COMP%]{color:var(--%NS%morse-error)}[data-level="xhigh"][_nghost-%COMP%]{color:var(--%NS%morse-error);color:color-mix(in srgb,var(--%NS%morse-error) 55%,var(--%NS%morse-typename))}[data-level="max"][_nghost-%COMP%]{color:var(--%NS%morse-typename)}']})};var qk=["panel"];function Gk(t,e){t&1&&(g(0,"span",10),p(1,"\u2713"),_())}function Wk(t,e){if(t&1){let n=z();g(0,"button",8),L("mouseenter",function(){let r=I(n).$index,i=h(2);return k(i.active.set(r))})("click",function(){let r=I(n).$implicit,i=h(2);return k(i.choose(r))}),we(1,"morse-brain",2),g(2,"span",9),p(3),_(),T(4,Gk,2,0,"span",10),_()}if(t&2){let n=e.$implicit,o=e.$index,r=h(2);Te("active",o===r.active())("selected",n===r.current()),pe("aria-selected",n===r.current()),u(),K("level",n),u(2),D(n),u(),M(n===r.current()?4:-1)}}function Yk(t,e){if(t&1){let n=z();g(0,"div",6,0),L("keydown",function(r){I(n);let i=h();return k(i.onKeydown(r))}),_e(2,Wk,5,8,"button",7,ci),_()}if(t&2){let n=h();K("morseEnter",0)("morseEnterY",6),u(2),be(n.levels())}}var Md=class t{levels=ee.required();current=ee.required();pick=rt();host=N(Zt);shortcuts=N(ro);destroyRef=N(ht);panel=at("panel");open=R(!1);active=R(0);bumped=R(!1);constructor(){let e=this.shortcuts.bind("thinking.pick",()=>this.toggle(),()=>this.levels().length>0);this.destroyRef.onDestroy(e),ue(()=>{this.open()&&setTimeout(()=>this.panel()?.nativeElement.focus(),0)})}toggle(){if(this.open()){this.close();return}this.bump();let e=this.levels().indexOf(this.current());this.active.set(e>=0?e:0),this.open.set(!0)}choose(e){this.pick.emit(e),this.close()}onKeydown(e){let n=this.levels();switch(e.key){case"Escape":e.preventDefault(),this.close();return;case"ArrowDown":e.preventDefault(),this.active.update(o=>Math.min(o+1,Math.max(0,n.length-1)));return;case"ArrowUp":e.preventDefault(),this.active.update(o=>Math.max(0,o-1));return;case"Enter":{let o=n[this.active()];o&&(e.preventDefault(),this.choose(o));return}default:return}}onDocumentPointerdown(e){let n=e.target;this.open()&&n&&!this.host.nativeElement.contains(n)&&this.close()}close(){this.open.set(!1),this.bumped.set(!1)}bump(){this.bumped.set(!1),setTimeout(()=>this.bumped.set(!0),0),setTimeout(()=>this.bumped.set(!1),520)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-thinking-picker"]],viewQuery:function(n,o){n&1&&vt(o.panel,qk,5),n&2&&bt()},hostBindings:function(n,o){n&1&&L("pointerdown",function(i){return o.onDocumentPointerdown(i)},Ot)},inputs:{levels:[1,"levels"],current:[1,"current"]},outputs:{pick:"pick"},decls:7,vars:5,consts:[["panel",""],["type","button","aria-haspopup","listbox",1,"trigger",3,"click","title"],[3,"level"],[1,"level"],["aria-hidden","true",1,"caret"],["role","listbox","aria-label","Thinking level","tabindex","-1",1,"panel",3,"morseEnter","morseEnterY"],["role","listbox","aria-label","Thinking level","tabindex","-1",1,"panel",3,"keydown","morseEnter","morseEnterY"],["type","button","role","option",1,"row",3,"active","selected"],["type","button","role","option",1,"row",3,"mouseenter","click"],[1,"name"],["aria-hidden","true",1,"check"]],template:function(n,o){n&1&&(g(0,"button",1),L("click",function(){return o.toggle()}),we(1,"morse-brain",2),g(2,"span",3),p(3),_(),g(4,"span",4),p(5,"\u25BE"),_()(),T(6,Yk,4,2,"div",5)),n&2&&(K("title","Thinking level: "+o.current()),pe("aria-expanded",o.open()),u(),K("level",o.current()),u(2),D(o.current()),u(3),M(o.open()?6:-1))},dependencies:[sn,Td],styles:["[_nghost-%COMP%]{position:relative;display:inline-block}.trigger[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border:1px solid var(--%NS%morse-input-border);border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-input-bg);color:var(--%NS%morse-input-fg);font-size:12px;cursor:pointer}.trigger[_ngcontent-%COMP%]:hover{border-color:var(--%NS%morse-fg-muted)}.trigger[aria-expanded=true][_ngcontent-%COMP%]{border-color:var(--%NS%morse-focus)}.trigger[_ngcontent-%COMP%] .level[_ngcontent-%COMP%]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-transform:capitalize}.trigger[_ngcontent-%COMP%] .caret[_ngcontent-%COMP%]{flex:none;color:var(--%NS%morse-fg-muted);font-size:10px}.panel[_ngcontent-%COMP%]{position:absolute;left:0;bottom:calc(100% + 6px);z-index:30;display:flex;flex-direction:column;min-width:180px;padding:4px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 10px 28px #0000004d}.panel[_ngcontent-%COMP%]:focus-visible{outline:none}.row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;padding:5px 8px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg);font:inherit;font-size:12px;text-align:left;cursor:pointer}.row.active[_ngcontent-%COMP%]{background:var(--%NS%morse-hover)}.row[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-transform:capitalize}.row.selected[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{color:var(--%NS%morse-accent)}.row[_ngcontent-%COMP%] .check[_ngcontent-%COMP%]{flex:none;color:var(--%NS%morse-accent);font-size:12px}"]})};function Zk(t,e){t&1&&(b(0,"span"),p(1),E()),t&2&&(u(),ce(" \xB7 ",e))}function Kk(t,e){if(t&1&&(b(0,"section")(1,"h4"),p(2,"Last assistant message"),E(),b(3,"div",13)(4,"div",14)(5,"span",15),p(6,"Input"),E(),b(7,"span",16),p(8),E()(),b(9,"div",14)(10,"span",15),p(11,"Output"),E(),b(12,"span",16),p(13),E()(),b(14,"div",14)(15,"span",15),p(16,"Reasoning"),E(),b(17,"span",16),p(18),E()(),b(19,"div",14)(20,"span",15),p(21,"Cache read"),E(),b(22,"span",16),p(23),E()(),b(24,"div",14)(25,"span",15),p(26,"Cache write"),E(),b(27,"span",16),p(28),E()(),b(29,"div",14)(30,"span",15),p(31,"Cache hit"),E(),b(32,"span",16),p(33),E()()()()),t&2){let n=h(2);u(8),D(n.lastValue("inputTokens")),u(5),D(n.lastValue("outputTokens")),u(5),D(n.lastValue("reasoningTokens")),u(5),D(n.lastValue("cacheReadTokens")),u(5),D(n.lastValue("cacheWriteTokens")),u(5),D(n.cacheHitLabel())}}function Qk(t,e){if(t&1){let n=z();b(0,"button",5),q("click",function(){I(n);let r=h();return k(r.close())}),E(),b(1,"div",6)(2,"header")(3,"h3"),p(4,"Context"),E(),b(5,"button",7),q("click",function(){I(n);let r=h();return k(r.close())}),p(6,"\xD7"),E()(),b(7,"div",8),p(8),T(9,Zk,2,1,"span"),E(),b(10,"div",9)(11,"span"),p(12,"Context"),E(),b(13,"span"),p(14),E()(),b(15,"div",10),$e(16,"span",11),E(),b(17,"div",12)(18,"span"),p(19),E()(),b(20,"div",13)(21,"div",14)(22,"span",15),p(23,"Messages"),E(),b(24,"span",16),p(25),E()(),b(26,"div",14)(27,"span",15),p(28,"User"),E(),b(29,"span",16),p(30),E()(),b(31,"div",14)(32,"span",15),p(33,"Assistant"),E(),b(34,"span",16),p(35),E()(),b(36,"div",14)(37,"span",15),p(38,"Tool calls"),E(),b(39,"span",16),p(40),E()(),b(41,"div",14)(42,"span",15),p(43,"Cost"),E(),b(44,"span",16),p(45),E()(),b(46,"div",14)(47,"span",15),p(48,"Output limit"),E(),b(49,"span",16),p(50),E()()(),T(51,Kk,34,6,"section"),b(52,"section")(53,"h4"),p(54,"Session totals"),E(),b(55,"div",17),p(56),E()()()}if(t&2){let n,o=h();u(8),ce(" ",o.modelLabel()),u(),M((n=o.sessionTitle())?9:-1,n),u(5),Ln("",o.usedLabel()," / ",o.limitLabel()),u(2),Oo("width",o.fillPercent(),"%"),Te("warn",o.level()==="warn")("danger",o.level()==="danger"),u(3),ce("",o.percentLabel()," used"),u(6),D(o.counts()?.totalMessages??"\u2014"),u(5),D(o.counts()?.userMessages??"\u2014"),u(5),D(o.counts()?.assistantMessages??"\u2014"),u(5),D(o.counts()?.toolCalls??"\u2014"),u(5),D(o.costLabel()),u(5),D(o.outputLimitLabel()),u(),M(o.lastUsage()?51:-1),u(5),D(o.sessionLine()||"No usage yet.")}}var Xk=15.5,xb=2*Math.PI*Xk,Id=class t{usage=ee();lastUsage=ee();costUsd=ee();contextUsage=ee();counts=ee();model=ee();sessionTitle=ee();open=R(!1);circumference=xb;percent=S(()=>this.contextUsage()?.percent??void 0);percentLabel=S(()=>{let e=this.contextUsage()?.percent;return e==null?"\u2013":`${e.toFixed(1)}%`});level=S(()=>{let e=this.percent()??0;return e>90?"danger":e>70?"warn":"ok"});fillPercent=S(()=>Math.min(100,Math.max(0,this.percent()??0)));dashOffset=S(()=>xb*(1-this.fillPercent()/100));usedLabel=S(()=>{let e=this.contextUsage()?.tokens;return e==null?"\u2014":io(e)});limitLabel=S(()=>{let e=this.contextUsage()?.contextWindow;return e===void 0?"\u2014":io(e)});costLabel=S(()=>Fm(this.costUsd())??"\u2014");outputLimitLabel=S(()=>{let e=this.model()?.maxTokens;return e===void 0?"\u2014":io(e)});modelLabel=S(()=>this.model()?.name??this.model()?.id??"no model");tooltip=S(()=>{let e=[`Context ${this.percentLabel()} \xB7 ${this.usedLabel()} / ${this.limitLabel()}`],n=Vm({usage:this.usage(),costUsd:this.costUsd(),contextUsage:this.contextUsage()});return n.length>0&&e.push(n),e.join(`
|
|
13
|
-
`)});sessionLine=S(()=>Vm({usage:this.usage(),costUsd:this.costUsd(),contextUsage:this.contextUsage()}));cacheHitLabel=S(()=>{let e=Lm(this.lastUsage());return e===void 0?"\u2014":`${e.toFixed(1)}%`});lastValue(e){return bb(this.lastUsage(),e)}toggle(){this.open.update(e=>!e)}close(){this.open.set(!1)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-usage-indicator"]],hostBindings:function(n,o){n&1&&L("keydown.escape",function(){return o.close()},Ot)},inputs:{usage:[1,"usage"],lastUsage:[1,"lastUsage"],costUsd:[1,"costUsd"],contextUsage:[1,"contextUsage"],counts:[1,"counts"],model:[1,"model"],sessionTitle:[1,"sessionTitle"]},decls:7,vars:10,consts:[["type","button","aria-label","Context usage",1,"mini",3,"click","title"],["viewBox","0 0 36 36","aria-hidden","true",1,"ring"],["cx","18","cy","18","r","15.5",1,"track"],["cx","18","cy","18","r","15.5",1,"value"],[1,"pct"],["type","button","aria-label","Close usage",1,"scrim",3,"click"],["role","dialog","aria-label","Context usage",1,"panel"],["type","button","aria-label","Close",1,"close",3,"click"],[1,"subtitle"],[1,"bar-head"],[1,"bar"],[1,"fill"],[1,"bar-foot"],[1,"grid"],[1,"cell"],[1,"k"],[1,"v"],[1,"totals"]],template:function(n,o){n&1&&(b(0,"button",0),q("click",function(){return o.toggle()}),Tt(),b(1,"svg",1),$e(2,"circle",2)(3,"circle",3),E(),fn(),b(4,"span",4),p(5),E()(),T(6,Qk,57,19)),n&2&&(Ae("title",o.tooltip()),pe("aria-expanded",o.open()),u(),Te("warn",o.level()==="warn")("danger",o.level()==="danger"),u(2),pe("stroke-dasharray",o.circumference)("stroke-dashoffset",o.dashOffset()),u(2),D(o.percentLabel()),u(),M(o.open()?6:-1))},styles:["[_nghost-%COMP%]{position:relative;display:inline-flex;vertical-align:middle}.mini[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:2px 7px 2px 3px;border:1px solid transparent;border-radius:999px;background:transparent;color:var(--%NS%morse-fg-muted);font-size:11px;line-height:1;cursor:pointer}.mini[_ngcontent-%COMP%]:hover, .mini[aria-expanded=true][_ngcontent-%COMP%]{border-color:var(--%NS%morse-border);background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.ring[_ngcontent-%COMP%]{width:20px;height:20px;transform:rotate(-90deg)}.track[_ngcontent-%COMP%]{fill:none;stroke:var(--%NS%morse-border);stroke-width:3.4}.value[_ngcontent-%COMP%]{fill:none;stroke:var(--%NS%morse-success);stroke-width:3.4;stroke-linecap:round;transition:stroke-dashoffset .3s ease}.ring.warn[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{stroke:var(--%NS%morse-warn)}.ring.danger[_ngcontent-%COMP%] .value[_ngcontent-%COMP%]{stroke:var(--%NS%morse-error)}.pct[_ngcontent-%COMP%]{font-family:var(--%NS%morse-font-mono);font-size:10.5px;font-variant-numeric:tabular-nums}.scrim[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:30;padding:0;border:0;background:transparent;cursor:default}.scrim[_ngcontent-%COMP%]:hover, .scrim[_ngcontent-%COMP%]:active{background:transparent}.panel[_ngcontent-%COMP%]{position:absolute;z-index:31;right:0;bottom:calc(100% + 8px);width:320px;max-height:70vh;overflow-y:auto;padding:12px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 16px 40px #00000059;color:var(--%NS%morse-fg);text-align:left}.panel[_ngcontent-%COMP%] header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:2px}.panel[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:13px;font-weight:600}.close[_ngcontent-%COMP%]{padding:0 6px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);font-size:15px;line-height:1.4;cursor:pointer}.close[_ngcontent-%COMP%]:hover{color:var(--%NS%morse-fg);background:var(--%NS%morse-active)}.subtitle[_ngcontent-%COMP%]{margin-bottom:10px;color:var(--%NS%morse-fg-muted);font-size:11px}.bar-head[_ngcontent-%COMP%], .bar-foot[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;color:var(--%NS%morse-fg-muted);font-size:11px}.bar[_ngcontent-%COMP%]{height:7px;margin:5px 0;border-radius:999px;background:var(--%NS%morse-border);overflow:hidden}.bar[_ngcontent-%COMP%] .fill[_ngcontent-%COMP%]{display:block;height:100%;border-radius:999px;background:var(--%NS%morse-success);transition:width .3s ease}.bar[_ngcontent-%COMP%] .fill.warn[_ngcontent-%COMP%]{background:var(--%NS%morse-warn)}.bar[_ngcontent-%COMP%] .fill.danger[_ngcontent-%COMP%]{background:var(--%NS%morse-error)}.grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:10px}.cell[_ngcontent-%COMP%]{padding:6px 8px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-input-bg, transparent)}.cell[_ngcontent-%COMP%] .k[_ngcontent-%COMP%]{display:block;color:var(--%NS%morse-fg-muted);font-size:10px;text-transform:uppercase;letter-spacing:.03em}.cell[_ngcontent-%COMP%] .v[_ngcontent-%COMP%]{display:block;margin-top:2px;font-family:var(--%NS%morse-font-mono);font-size:12px;font-variant-numeric:tabular-nums}section[_ngcontent-%COMP%]{margin-top:12px}section[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0 0 4px;color:var(--%NS%morse-fg-muted);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.03em}.totals[_ngcontent-%COMP%]{padding:7px 9px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);color:var(--%NS%morse-fg-muted);font-family:var(--%NS%morse-font-mono);font-size:11.5px;font-variant-numeric:tabular-nums}"]})};var Jk=["promptInput"],eN=["fileInput"],Eb=(t,e)=>e.id;function tN(t,e){if(t&1){let n=z();g(0,"button",25),L("click",function(){I(n);let r=h();return k(r.attachSelection())}),p(1," \u29C9 "),_()}}function nN(t,e){t&1&&p(0," add files \xB7 @ to mention \xB7 / for commands ")}function oN(t,e){t&1&&p(0," upload or drop files \xB7 / for commands ")}function rN(t,e){t&1&&p(0," drop files here \xB7 / for commands ")}function iN(t,e){if(t&1){let n=z();g(0,"morse-file-picker",26),L("activeChange",function(r){I(n);let i=h();return k(i.mentionActive.set(r))})("pick",function(r){I(n);let i=h();return k(i.onPickFile(r))})("reload",function(){I(n);let r=h();return k(r.reloadFiles())})("close",function(){I(n);let r=h();return k(r.onPickerClose())}),_()}if(t&2){let n=h();K("morsePopoverFit",300)("files",n.pickerMatches())("busy",n.loadingFiles())("query",n.pickerFilter())("active",n.mentionActive())}}function sN(t,e){if(t&1){let n=z();g(0,"morse-command-picker",27),L("activeChange",function(r){I(n);let i=h();return k(i.paletteActive.set(r))})("pick",function(r){I(n);let i=h();return k(i.activatePalette(r,"run"))})("close",function(){I(n);let r=h();return k(r.onPaletteClose())}),_()}if(t&2){let n=h();K("morsePopoverFit",320)("items",n.paletteItems())("query",n.paletteFilter())("active",n.paletteActive())}}function aN(t,e){if(t&1){let n=z();g(0,"li",28)(1,"button",30),L("click",function(){I(n);let r=h(2);return k(r.lockLive())}),g(2,"span",31),p(3,"\u29C9"),_(),g(4,"span",32),p(5),_(),g(6,"span",33),p(7),_()(),g(8,"button",34),L("click",function(){I(n);let r=h(2);return k(r.dismissLive())}),p(9," \xD7 "),_()()}if(t&2){let n=e,o=h(2);K("morseEnter",0)("morseEnterY",6)("morseEnterScale",.55)("morseEnterDuration",320),u(),K("title",o.lockLiveLabel()),pe("aria-label","Lock the "+n.path+" selection as a pin"),u(3),K("title",n.path),u(),D(n.path),u(2),Ln("L",n.startLine,"-",n.endLine),u(),pe("aria-label","Dismiss the "+n.path+" selection preview")}}function cN(t,e){if(t&1){let n=z();g(0,"li",29),we(1,"img",35),g(2,"span",32),p(3),_(),g(4,"button",36),L("click",function(){let r=I(n).$implicit,i=h(2);return k(i.removeImage(r.id))}),p(5," \xD7 "),_()()}if(t&2){let n=e.$implicit,o=e.$index,r=h(2);K("morseEnter",r.chipOffset()+o)("morseEnterY",6)("morseEnterScale",.55)("morseEnterDuration",320),u(),K("src",r.preview(n),yo)("alt",n.name),u(),K("title",n.name),u(),D(n.name),u(),pe("aria-label","Remove "+n.name)}}function lN(t,e){if(t&1&&(g(0,"span",33),p(1),_()),t&2){let n=h().$implicit;u(),Ln("L",n.startLine,"-",n.endLine)}}function dN(t,e){if(t&1){let n=z();g(0,"li",29)(1,"span",31),p(2,"\u29C9"),_(),g(3,"span",32),p(4),_(),T(5,lN,2,2,"span",33),g(6,"button",36),L("click",function(){let r=I(n).$implicit,i=h(2);return k(i.removePin(r.id))}),p(7," \xD7 "),_()()}if(t&2){let n=e.$implicit,o=e.$index,r=h(2);K("morseEnter",r.chipOffset()+r.images().length+o)("morseEnterY",6)("morseEnterScale",.55)("morseEnterDuration",320),u(3),K("title",n.path),u(),D(n.path),u(),M(n.startLine!==void 0?5:-1),u(),pe("aria-label","Unpin "+n.path)}}function uN(t,e){if(t&1&&(g(0,"ul",11),T(1,aN,10,11,"li",28),_e(2,cN,6,9,"li",29,Eb),_e(4,dN,8,8,"li",29,Eb),_()),t&2){let n,o=h();u(),M((n=o.livePreview())?1:-1,n),u(),be(o.images()),u(2),be(o.pins())}}function pN(t,e){if(t&1&&(g(0,"span",38),p(1),_()),t&2){let n=h(2);u(),Ln(" \u2193",n.streamedTokens()," \xB7 ",n.tokensPerSecond()??0," t/s ")}}function fN(t,e){if(t&1&&(g(0,"span",40),we(1,"span",42),g(2,"span"),p(3),_(),g(4,"span",43),we(5,"i")(6,"i")(7,"i"),_()()),t&2){let n=h(2);u(3),ce("Working ",n.elapsed())}}function mN(t,e){if(t&1&&we(0,"morse-usage-indicator",41),t&2){let n=h(2);K("usage",n.usageState().usage)("lastUsage",n.usageState().lastUsage)("costUsd",n.usageState().costUsd)("contextUsage",n.usageState().contextUsage)("counts",n.usageState().counts)("model",n.usageState().model)("sessionTitle",n.usageState().sessionTitle)}}function hN(t,e){if(t&1&&(g(0,"div",13)(1,"div",37),T(2,pN,2,2,"span",38),_(),g(3,"div",39),T(4,fN,8,1,"span",40),T(5,mN,1,7,"morse-usage-indicator",41),_()()),t&2){let n=h();u(2),M(n.running()?2:-1),u(2),M(n.running()?4:-1),u(),M(n.showUsage()?5:-1)}}function gN(t,e){if(t&1&&(g(0,"span",17),p(1),_()),t&2){let n=e;K("title",n),u(),D(n)}}function yN(t,e){if(t&1){let n=z();g(0,"morse-model-picker",44),L("pick",function(r){I(n);let i=h();return k(i.onModelPick(r))})("close",function(){I(n);let r=h();return k(r.closeModelPicker())}),_()}if(t&2){let n=h();K("morsePopoverFit",340)("models",n.models())("current",n.modelKey())}}function vN(t,e){if(t&1){let n=z();g(0,"button",45),L("click",function(){I(n);let r=h();return k(r.sendWith("steer"))}),p(1,"Steer"),_(),g(2,"button",45),L("click",function(){I(n);let r=h();return k(r.sendWith("followUp"))}),p(3,"Follow up"),_(),g(4,"button",46),L("click",function(){I(n);let r=h();return k(r.abort())}),p(5,"\u25A0"),_()}}function _N(t,e){if(t&1){let n=z();g(0,"button",47),L("click",function(){I(n);let r=h();return k(r.sendWith("new"))}),p(1," \u2191 "),_()}if(t&2){let n=h();K("disabled",!n.canSend())}}function bN(t,e){if(t&1){let n=z();g(0,"morse-prompt-template-dialog",48),L("submitted",function(r){I(n);let i=h();return k(i.onTemplateSubmit(r))})("cancelled",function(){I(n);let r=h();return k(r.closeTemplate())}),_()}t&2&&K("request",e)}var kd=class t{morse=N(wt);shell=N(rn);shortcuts=N(ro);destroyRef=N(ht);attachments=N(Cr);workspace=N(bd);uploads=N(ms);promptInput=at("promptInput");fileInput=at("fileInput");text=R("");connected=S(()=>this.morse.connection()==="ready");agentReady=this.morse.agentReady;agentStarting=this.morse.agentStarting;agentError=this.morse.agentError;streaming=S(()=>this.morse.state().streaming);canSend=S(()=>this.connected()&&!this.agentStarting()&&this.agentError()===void 0);canAttachSelection=S(()=>this.morse.capabilities()?.editorContext===!0);thinkingLevel=S(()=>this.morse.state().thinkingLevel);models=this.morse.availableModels;levels=this.morse.availableThinkingLevels;modelKey=S(()=>{let e=this.morse.state().model;return e?`${e.provider}/${e.id}`:""});usageState=this.morse.state;showUsage=S(()=>{let e=this.morse.state();return e.usage!==void 0||e.contextUsage!==void 0});showStatusRow=S(()=>this.running()||this.showUsage());streamedTokens=S(()=>Math.round(Math.max(0,jm(this.morse.items())-this.baseline())/4));tokensPerSecond=R(void 0);baseline=R(0);throughput=[];images=this.attachments.images;pins=this.attachments.pins;livePreview=this.attachments.livePreview;chipOffset=S(()=>this.livePreview()?1:0);lockLiveLabel=S(()=>this.livePreview()?"Lock this selection \u2014 it stops following the editor; a new selection makes a new chip.":"");pickerOpen=R(!1);workspaceFiles=this.workspace.files;loadingFiles=this.workspace.busy;mentionMode=R(!1);pickerFilter=R("");pickerMatches=S(()=>vb(this.workspaceFiles(),this.pickerFilter()));mentionActive=R(0);canPickFiles=this.workspace.available;canUpload=this.uploads.available;paletteOpen=R(!1);paletteFilter=R("");paletteActive=R(0);templateRequest=R(void 0);availableCommands=this.morse.availableCommands;paletteItems=S(()=>{let e=[...Cb.map(n=>({id:`builtin:${n.name}`,label:`/${n.name}`,description:n.description,badge:"built-in",icon:"\u203A"})),...this.availableCommands().map(n=>({id:`command:${n.name}`,label:`/${n.name}`,description:n.description,badge:n.source,icon:"\u2044"}))];return _b(e,this.paletteFilter())});modelPickerOpen=R(!1);currentModel=this.morse.model;currentProvider=S(()=>this.morse.model()?.provider??"");modelLabel=S(()=>{let e=this.morse.model();return e?`${e.provider} \xB7 ${e.name}`:"no model"});canAddFiles=S(()=>this.canPickFiles()||this.canUpload()||this.canAttachSelection());addFilesLabel=S(()=>this.canPickFiles()?"Add files to the prompt":this.canUpload()?"Upload files to the prompt":"Attach the active editor selection");running=S(()=>this.morse.state().streaming||this.morse.state().busy);elapsed=S(()=>{this.tick();let e=this.startedAt(),n=e===null?0:Date.now()-e;return n<1e3?"":CN(n)});startedAt=R(null);tick=R(0);constructor(){let e=this.shortcuts.bind("model.pick",()=>this.toggleModelPicker(),()=>this.models().length>0);this.destroyRef.onDestroy(e),ue(()=>{if(this.attachments.mentions().length===0)return;let r=this.attachments.takeMentions().map(s=>s.startsWith("@")?s:`@${s}`).join(`
|
|
14
|
-
`);this.text.update(s=>s.trim().length===0?r:`${s.trimEnd()}
|
|
15
|
-
${r}`),this.promptInput()?.nativeElement?.focus()}),this.morse.onContextSelection(n=>{this.attachments.pin(n),this.attachments.say("info","Selection pinned to this message.")}),this.morse.onContextSelectionLive(n=>this.attachments.setLivePreview(n)),this.morse.onComposerSeed(n=>{this.text.set(n.text),this.syncInputValue(),this.attachments.seed(n.images??[],n.pins??[])}),ue(n=>{if(!this.running()){this.startedAt.set(null),this.tokensPerSecond.set(void 0),this.throughput.length=0;return}this.startedAt.update(r=>r??Date.now()),this.baseline.set(ma(()=>jm(this.morse.items())));let o=setInterval(()=>{this.tick.update(r=>r+1),this.sampleThroughput()},500);n(()=>clearInterval(o))})}onInput(e){let n=e.target;this.text.set(n.value),this.refreshMentionQuery(n.value,n.selectionStart),this.refreshPaletteQuery(n.value,n.selectionStart)}onKeydown(e){if(this.paletteOpen()){let n=this.paletteItems();switch(e.key){case"Escape":e.preventDefault(),this.onPaletteClose();return;case"ArrowDown":e.preventDefault(),this.paletteActive.update(o=>Math.min(o+1,Math.max(0,n.length-1)));return;case"ArrowUp":e.preventDefault(),this.paletteActive.update(o=>Math.max(0,o-1));return;case"Tab":{let o=n[this.paletteActive()];e.preventDefault(),o&&this.activatePalette(o.id,"insert");return}case"Enter":{if(e.isComposing)return;let o=n[this.paletteActive()];if(o){e.preventDefault(),this.activatePalette(o.id,e.shiftKey?"insert":"run");return}break}default:return}}if(this.pickerOpen()){let n=this.pickerMatches();switch(e.key){case"Escape":e.preventDefault(),this.onPickerClose();return;case"ArrowDown":e.preventDefault(),this.mentionActive.update(o=>Math.min(o+1,Math.max(0,n.length-1)));return;case"ArrowUp":e.preventDefault(),this.mentionActive.update(o=>Math.max(0,o-1));return;case"Tab":case"Enter":{let o=n[this.mentionActive()];if(o){e.preventDefault(),this.onPickFile(o);return}e.key==="Tab"&&e.preventDefault();return}default:return}}e.key==="Enter"&&!e.shiftKey&&!e.isComposing&&(e.preventDefault(),this.sendWith(this.streaming()?"steer":"new"))}sendWith(e){let n=this.text().trim(),o=EN(n);if(o!==void 0){this.text.set(""),this.shell.requestCompact(o);return}let r=xN(n);if(r){this.text.set(""),this.runBuiltin(r);return}let i=this.attachments.images(),s=this.attachments.pins();if(n.length===0&&i.length===0&&s.length===0){this.promptInput()?.nativeElement.focus();return}this.morse.prompt(n,e,this.attachments.takeImages(),this.attachments.takePins()),this.attachments.setLivePreview(null),this.text.set("")}lockLive(){this.attachments.lockLivePreview(),this.attachments.say("info","Selection locked to this message.")}dismissLive(){this.attachments.setLivePreview(null)}onPaste(e){let n=Array.from(e.clipboardData?.files??[]).filter(o=>o.type.startsWith("image/"));n.length!==0&&(e.preventDefault(),this.attachments.accept(n).then(o=>{o.attached>0&&this.attachments.say("info",`${o.attached} pasted image${o.attached===1?"":"s"} attached`)}))}removeImage(e){this.attachments.remove(e)}removePin(e){this.attachments.removePin(e)}preview(e){return`data:${e.mimeType};base64,${e.data}`}abort(){this.morse.abort()}attachSelection(){if(this.livePreview()){this.lockLive();return}this.requestSelectionSnapshot().then(e=>{if(!e||e.selection===void 0){this.attachments.say("warn","Select some text in the editor first.");return}let n=e.selection;this.attachments.pin({path:e.path??"",startLine:n.startLine,endLine:n.endLine}),this.attachments.say("info","Selection pinned to this message.")})}onAddFiles(){if(this.canPickFiles()){this.openMentionPicker();return}if(this.canUpload()){this.fileInput()?.nativeElement.click();return}this.attachSelection()}openMentionPicker(){if(this.pickerOpen()){this.onPickerClose();return}let e=this.text(),n=e.length>0&&!/\s$/.test(e)?" ":"";this.text.set(`${e}${n}@`);let o=this.promptInput()?.nativeElement;if(o){let r=this.text();o.value=r,o.focus(),o.setSelectionRange(r.length,r.length)}this.mentionMode.set(!0),this.pickerFilter.set(""),this.mentionActive.set(0),this.pickerOpen.set(!0),this.workspace.ensureLoaded()}onFilesChosen(e){let n=e.target,o=Array.from(n?.files??[]);n&&(n.value=""),o.length!==0&&this.importFiles(o.filter(r=>r.type.startsWith("image/")),o.filter(r=>!r.type.startsWith("image/")))}async importFiles(e,n){let o=await this.attachments.accept(e),r=n.length>0?await this.uploads.upload(n):{added:[],failed:[]};this.attachments.addMentions(r.added.map(a=>a.path));let i=[];o.attached>0&&i.push(`${o.attached} image${o.attached===1?"":"s"} attached`),r.added.length>0&&i.push(`${r.added.length} file${r.added.length===1?"":"s"} uploaded`);let s=[...o.skipped,...r.failed];if(s.length>0&&i.push(`could not attach ${s.join(", ")}`),i.length>0){let a=o.attached===0&&r.added.length===0;this.attachments.say(a?"warn":"info",i.join(" \xB7 "))}}refreshMentionQuery(e,n){if(!this.canPickFiles())return;let o=e.slice(0,n??e.length),r=/(?:^|\s)@([\w./-]*)$/.exec(o);if(!r){this.mentionMode()&&(this.pickerOpen.set(!1),this.mentionMode.set(!1));return}r[1]!==this.pickerFilter()&&this.mentionActive.set(0),this.mentionMode.set(!0),this.pickerFilter.set(r[1]??""),this.pickerOpen.set(!0),this.workspace.ensureLoaded()}refreshPaletteQuery(e,n){let o=e.slice(0,n??e.length),r=/(?:^|\n)\s*\/([\w:-]*)$/.exec(o);if(!r){this.paletteOpen()&&this.paletteOpen.set(!1);return}r[1]!==this.paletteFilter()&&this.paletteActive.set(0),this.paletteFilter.set(r[1]??""),this.paletteOpen()||this.morse.refreshCommands(),this.paletteOpen.set(!0)}activatePalette(e,n){if(e.startsWith("builtin:")){let o=e.slice(8);if(o==="model"){this.stripSlashToken(),this.closePalette(),this.openModelPicker();return}this.stripSlashToken(),this.closePalette(),this.runBuiltin(o);return}if(e.startsWith("command:")){let o=e.slice(8);if(n==="run"){let r=this.availableCommands().find(i=>i.name===o);if(r?.template!==void 0){let i=nb(r.template);if(i!==void 0){this.stripSlashToken(),this.text.set(""),this.closePalette(),this.openTemplate({name:o,description:r.description,form:i});return}this.stripSlashToken(),this.text.set(""),this.closePalette(),this.sendTemplate(Pm(r.template).body);return}this.stripSlashToken(),this.text.set(""),this.closePalette(),this.morse.prompt(`/${o}`,this.streaming()?"steer":"new");return}this.replaceSlashToken(`/${o} `),this.closePalette()}}openTemplate(e){this.templateRequest.set(e),this.shell.setPromptTemplateOpen(!0)}closeTemplate(){this.templateRequest.set(void 0),this.shell.setPromptTemplateOpen(!1),this.promptInput()?.nativeElement.focus()}sendTemplate(e){this.morse.prompt(e,this.streaming()?"steer":"new",this.attachments.takeImages(),this.attachments.takePins()),this.attachments.setLivePreview(null)}onTemplateSubmit(e){this.templateRequest.set(void 0),this.shell.setPromptTemplateOpen(!1),this.sendTemplate(e)}onPaletteClose(){this.closePalette()}closePalette(){this.paletteOpen.set(!1),this.paletteFilter.set(""),this.paletteActive.set(0),this.promptInput()?.nativeElement.focus()}openModelPicker(){this.modelPickerOpen.set(!0)}toggleModelPicker(){this.modelPickerOpen.update(e=>!e)}onModelPick(e){this.morse.setModel(e.provider,e.id),this.closeModelPicker()}closeModelPicker(){this.modelPickerOpen.set(!1),this.promptInput()?.nativeElement.focus()}runBuiltin(e){switch(e){case"new":this.morse.newSession(this.morse.workspace().cwd);break;case"compact":this.shell.requestCompact();break;case"settings":this.morse.hostCommand("openSettings");break;case"model":this.openModelPicker();break;case"about":this.shell.openAbout();break;case"keys":this.shell.openShortcuts();break}}stripSlashToken(){this.text.update(e=>e.replace(/(?:^|\n)(\s*)\/[\w:-]*$/,"$1")),this.syncInputValue()}replaceSlashToken(e){this.text.update(n=>n.replace(/(?:^|\n)(\s*)\/[\w:-]*$/,`$1${e}`)),this.syncInputValue()}syncInputValue(){let e=this.promptInput()?.nativeElement;if(!e)return;let n=this.text();e.value=n,e.focus(),e.setSelectionRange(n.length,n.length)}reloadFiles(){this.workspace.ensureLoaded(!0)}async requestSelectionSnapshot(){return this.morse.requestHostCommand("getEditorContext")}onPickerClose(){this.pickerOpen.set(!1),this.mentionMode.set(!1),this.promptInput()?.nativeElement.focus()}onPickFile(e){let n=e.endsWith("/");this.mentionMode()?this.text.update(o=>o.replace(/@[\w./-]*$/,`@${e}${n?"":" "}`)):n||(this.attachments.addMentions([e]),this.attachments.say("info",`Pinned ${e} to this message.`)),n?(this.mentionMode.set(!0),this.pickerFilter.set(e),this.mentionActive.set(0),this.pickerOpen.set(!0),this.workspace.ensureLoaded()):(this.mentionMode.set(!1),this.pickerOpen.set(!1)),this.syncInputValue()}onThinkingPick(e){this.morse.setThinkingLevel(e)}sampleThroughput(){let e=jm(this.morse.items()),n=Date.now();for(this.throughput.push({at:n,chars:e});this.throughput.length>2&&n-this.throughput[0].at>2e3;)this.throughput.shift();let o=this.throughput[0];if(!o)return;let r=n-o.at;if(r<500)return;let i=(e-o.chars)/4;this.tokensPerSecond.set(Math.max(0,Math.round(i/r*1e4)/10))}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-chat-composer"]],viewQuery:function(n,o){n&1&&vt(o.promptInput,Jk,5)(o.fileInput,eN,5),n&2&&bt(2)},decls:32,vars:23,consts:[["fileInput",""],["promptInput",""],[1,"host"],[1,"box"],[1,"toolbar"],["type","button",1,"icon",3,"click","disabled","title"],["type","file","multiple","","hidden","",3,"change"],["type","button","title","Pin the editor selection to this message","aria-label","Pin the editor selection to this message",1,"icon","pin-selection"],[1,"hint","muted"],[1,"picker-host",3,"morsePopoverFit","files","busy","query","active"],[1,"palette-host",3,"morsePopoverFit","items","query","active"],[1,"attachments"],["rows","2","aria-label","Prompt",3,"input","keydown","paste","value","disabled","placeholder"],[1,"status-row"],[1,"controls"],[1,"controls-metrics"],["type","button",1,"model-button",3,"pointerdown","click","disabled","title"],[1,"provider",3,"title"],[1,"label"],["aria-hidden","true",1,"caret"],[1,"model-picker-host",3,"morsePopoverFit","models","current"],[1,"thinking-host",3,"pick","levels","current"],[1,"controls-actions"],["type","button","title","Send (Enter)","aria-label","Send",1,"icon","send",3,"disabled"],[3,"request"],["type","button","title","Pin the editor selection to this message","aria-label","Pin the editor selection to this message",1,"icon","pin-selection",3,"click"],[1,"picker-host",3,"activeChange","pick","reload","close","morsePopoverFit","files","busy","query","active"],[1,"palette-host",3,"activeChange","pick","close","morsePopoverFit","items","query","active"],[1,"chip","live",3,"morseEnter","morseEnterY","morseEnterScale","morseEnterDuration"],[1,"chip",3,"morseEnter","morseEnterY","morseEnterScale","morseEnterDuration"],["type","button",1,"chip-body",3,"click","title"],["aria-hidden","true",1,"pin-icon"],[1,"chip-name",3,"title"],[1,"chip-lines"],["type","button","title","Dismiss this preview (locked chips stay)",1,"chip-remove",3,"click"],[3,"src","alt"],["type","button",1,"chip-remove",3,"click"],[1,"status-live"],["title","Live output rate: text and thinking, estimated from the character stream",1,"hint","throughput"],[1,"status-end"],["role","status",1,"working"],[1,"usage-host",3,"usage","lastUsage","costUsd","contextUsage","counts","model","sessionTitle"],[1,"spinner"],[1,"dots"],[1,"model-picker-host",3,"pick","close","morsePopoverFit","models","current"],["type","button",1,"secondary",3,"click"],["type","button","title","Stop","aria-label","Stop",1,"icon","stop",3,"click"],["type","button","title","Send (Enter)","aria-label","Send",1,"icon","send",3,"click","disabled"],[3,"submitted","cancelled","request"]],template:function(n,o){if(n&1&&(g(0,"footer",2)(1,"div",3)(2,"div",4)(3,"button",5),L("click",function(){return o.onAddFiles()}),p(4," + "),_(),g(5,"input",6,0),L("change",function(i){return o.onFilesChosen(i)}),_(),T(7,tN,2,0,"button",7),g(8,"span",8),T(9,nN,1,0)(10,oN,1,0)(11,rN,1,0),_()(),T(12,iN,1,5,"morse-file-picker",9),T(13,sN,1,4,"morse-command-picker",10),T(14,uN,6,1,"ul",11),g(15,"textarea",12,1),L("input",function(i){return o.onInput(i)})("keydown",function(i){return o.onKeydown(i)})("paste",function(i){return o.onPaste(i)}),_(),T(17,hN,6,3,"div",13),g(18,"div",14)(19,"div",15)(20,"button",16),L("pointerdown",function(i){return i.stopPropagation()})("click",function(){return o.toggleModelPicker()}),T(21,gN,2,2,"span",17),g(22,"span",18),p(23),_(),g(24,"span",19),p(25,"\u25BE"),_()(),T(26,yN,1,3,"morse-model-picker",20),g(27,"morse-thinking-picker",21),L("pick",function(i){return o.onThinkingPick(i)}),_()(),g(28,"div",22),T(29,vN,6,0)(30,_N,2,1,"button",23),_()()(),T(31,bN,1,1,"morse-prompt-template-dialog",24),_()),n&2){let r,i;u(3),K("disabled",!o.canAddFiles())("title",o.addFilesLabel()),pe("aria-label",o.addFilesLabel())("aria-expanded",o.pickerOpen()),u(4),M(o.canAttachSelection()?7:-1),u(2),M(o.canPickFiles()?9:o.canUpload()?10:11),u(3),M(o.pickerOpen()?12:-1),u(),M(o.paletteOpen()?13:-1),u(),M(o.images().length>0||o.pins().length>0||o.livePreview()!==null?14:-1),u(),K("value",o.text())("disabled",!o.canSend())("placeholder",o.connected()?o.agentStarting()?"Starting the Pi agent\u2026":o.agentError()?"The pi agent is unavailable.":o.agentReady()?"Ask Morse\u2026 (Enter to send, Shift+Enter for a new line)":"Type to start a session\u2026 (Enter to send, Shift+Enter for a new line)":"Waiting for a Morse host\u2026"),u(2),M(o.showStatusRow()?17:-1),u(3),K("disabled",o.models().length===0)("title",o.modelLabel()),pe("aria-expanded",o.modelPickerOpen()),u(),M((r=o.currentProvider())?21:-1,r),u(2),D(o.currentModel()?.name||"no model"),u(3),M(o.modelPickerOpen()?26:-1),u(),K("levels",o.levels())("current",o.thinkingLevel()),u(2),M(o.streaming()?29:30),u(2),M((i=o.templateRequest())?31:-1,i)}},dependencies:[sn,Ed,Id,Cd,Sd,Md,wd,xd],styles:["[_nghost-%COMP%]{display:block;position:relative;padding:10px}.box[_ngcontent-%COMP%]{position:relative;container-type:inline-size;max-width:780px;margin:0 auto;border:1px solid var(--%NS%morse-input-border);border-radius:var(--%NS%morse-radius-lg);background:var(--%NS%morse-input-bg);padding:8px;transition:border-color .12s ease}.toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:0 2px 4px}.toolbar[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{font-size:11.5px;color:var(--%NS%morse-fg-muted)}.icon[_ngcontent-%COMP%]{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg);font-size:13px;line-height:1;cursor:pointer}.icon[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--%NS%morse-hover)}.icon[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:default}.icon.send[_ngcontent-%COMP%]{background:var(--%NS%morse-accent);border-color:var(--%NS%morse-accent);color:#fff;font-size:15px}.icon.stop[_ngcontent-%COMP%]{color:var(--%NS%morse-error);border-color:var(--%NS%morse-error)}.working[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:0 4px;font-size:11.5px;color:var(--%NS%morse-fg-muted);white-space:nowrap}.working[_ngcontent-%COMP%] .spinner[_ngcontent-%COMP%]{width:11px;height:11px;border-radius:50%;border:1.5px solid var(--%NS%morse-border);border-top-color:var(--%NS%morse-accent);animation:_ngcontent-%COMP%_spin .8s linear infinite}.working[_ngcontent-%COMP%] .dots[_ngcontent-%COMP%]{display:inline-flex;gap:2px}.working[_ngcontent-%COMP%] .dots[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{width:3px;height:3px;border-radius:50%;background:currentColor;animation:_ngcontent-%COMP%_dot 1.2s ease-in-out infinite}.working[_ngcontent-%COMP%] .dots[_ngcontent-%COMP%] i[_ngcontent-%COMP%]:nth-child(2){animation-delay:.15s}.working[_ngcontent-%COMP%] .dots[_ngcontent-%COMP%] i[_ngcontent-%COMP%]:nth-child(3){animation-delay:.3s}.picker-host[_ngcontent-%COMP%], .palette-host[_ngcontent-%COMP%]{position:absolute;left:0;right:0;bottom:calc(100% + 4px);z-index:20}.attachments[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px;margin:0 2px 6px;padding:0;list-style:none}.chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;max-width:220px;padding:3px 4px 3px 3px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-hover);font-size:11.5px}.chip[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:22px;height:22px;object-fit:cover;border-radius:var(--%NS%morse-radius-sm)}.chip-name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:rtl;text-align:left}.pin-icon[_ngcontent-%COMP%]{font-size:12px;color:var(--%NS%morse-accent);line-height:1}.chip-lines[_ngcontent-%COMP%]{padding:1px 5px;border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-hover);color:var(--%NS%morse-fg-muted);font-size:10.5px;font-family:var(--%NS%morse-font-mono);white-space:nowrap}.chip-remove[_ngcontent-%COMP%]{padding:0 5px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);line-height:1.4;cursor:pointer}.chip-remove[_ngcontent-%COMP%]:hover{color:var(--%NS%morse-fg);background:var(--%NS%morse-active)}.chip.live[_ngcontent-%COMP%]{background:transparent;border:1px dashed color-mix(in srgb,var(--%NS%morse-accent) 55%,transparent)}button.chip-body[_ngcontent-%COMP%]{display:inline-flex;align-items:center;align-self:stretch;gap:6px;flex:1 1 auto;min-width:0;overflow:hidden;border:0;padding:0;background:transparent;color:inherit;font:inherit;line-height:inherit;text-align:left;cursor:pointer}button.chip-body[_ngcontent-%COMP%]:hover, button.chip-body[_ngcontent-%COMP%]:active{background:color-mix(in srgb,var(--%NS%morse-accent) 12%,transparent)}button.chip-body[_ngcontent-%COMP%]:focus-visible{outline:1px solid var(--%NS%morse-focus);outline-offset:-1px}.chip.live[_ngcontent-%COMP%] .chip-lines[_ngcontent-%COMP%]{padding:0;background:transparent;color:color-mix(in srgb,var(--%NS%morse-accent) 70%,var(--%NS%morse-fg))}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}@keyframes _ngcontent-%COMP%_dot{0%,60%,to{opacity:.25}30%{opacity:1}}.box[_ngcontent-%COMP%]:focus-within{border-color:var(--%NS%morse-focus)}textarea[_ngcontent-%COMP%]{width:100%;border:0;background:transparent;resize:none;min-height:44px;max-height:220px;padding:4px 6px;line-height:1.5}textarea[_ngcontent-%COMP%]:focus-visible{outline:none}.controls[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;flex-wrap:nowrap;margin-top:6px}.controls-metrics[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;min-width:0;flex:1 1 auto;flex-wrap:nowrap}.controls-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;flex:0 0 auto;margin-left:auto;white-space:nowrap}.status-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;margin-top:6px}.status-live[_ngcontent-%COMP%], .status-end[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;min-width:0}.status-live[_ngcontent-%COMP%]{flex:0 1 auto}.status-end[_ngcontent-%COMP%]{flex:0 0 auto}.model-button[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;flex:0 1 auto;min-width:0;max-width:240px;padding:4px 8px;border:1px solid var(--%NS%morse-input-border);border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-input-bg);color:var(--%NS%morse-input-fg);font-size:12px;cursor:pointer}.model-button[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--%NS%morse-fg-muted)}.model-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:default}.model-button[_ngcontent-%COMP%] .provider[_ngcontent-%COMP%]{flex:none;max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:1px 5px;border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-hover);color:var(--%NS%morse-fg-muted);font-size:9.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase}.model-button[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.model-button[_ngcontent-%COMP%] .caret[_ngcontent-%COMP%]{flex:none;color:var(--%NS%morse-fg-muted);font-size:10px}.model-picker-host[_ngcontent-%COMP%]{position:absolute;left:0;bottom:calc(100% + 4px);z-index:20;width:min(360px,100%)}.hint[_ngcontent-%COMP%]{font-size:11px;white-space:nowrap}.throughput[_ngcontent-%COMP%]{color:var(--%NS%morse-accent);font-family:var(--%NS%morse-font-mono);font-variant-numeric:tabular-nums}@container (max-width: 380px){.usage-host[_ngcontent-%COMP%]{display:none}}@container (max-width: 460px){.controls[_ngcontent-%COMP%]{flex-wrap:wrap}.controls-actions[_ngcontent-%COMP%]{flex:1 1 100%;justify-content:flex-end}}@container (max-width: 360px){.thinking-host[_ngcontent-%COMP%]{display:none}}"]})},Cb=[{name:"model",description:"Select a model"},{name:"new",description:"Start a new session"},{name:"compact",description:"Compact the current context (asks first)"},{name:"settings",description:"Open Morse settings"},{name:"about",description:"Credits and licences"},{name:"keys",description:"Keyboard shortcuts"}];function xN(t){let e=/^\/([\w-]+)$/.exec(t);if(e)return Cb.some(n=>n.name===e[1])?e[1]:void 0}function EN(t){return/^\/compact\s+([\s\S]+)$/.exec(t)?.[1]?.trim()||void 0}function CN(t){let e=t/1e3;return e<60?`${e<10?e.toFixed(1):Math.round(e)}s`:`${Math.floor(e/60)}m ${Math.round(e%60)}s`}function jm(t){let e=0;for(let n of t)n.kind==="assistant"&&(e+=(n.text??"").length+(n.thinking??"").length);return e}var wb="morse.chat.toolDisplay";function wN(t){return t==="timeline"||t==="compact"}function SN(){try{let t=globalThis.localStorage?.getItem(wb);return wN(t)?t:"compact"}catch{return"compact"}}function TN(t){try{globalThis.localStorage?.setItem(wb,t)}catch{}}var hs=class t{toolDisplaySignal=R(SN());toolDisplay=this.toolDisplaySignal.asReadonly();setToolDisplay(e){this.toolDisplaySignal.set(e),TN(e)}toggleToolDisplay(){this.setToolDisplay(this.toolDisplaySignal()==="compact"?"timeline":"compact")}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Oe({token:t,factory:t.\u0275fac,providedIn:"root"})};function MN(t,e){if(t&1&&(b(0,"div",8),p(1),E()),t&2){let n=h();Ae("title",n.workspace().cwd),u(),D(e)}}function IN(t,e){if(t&1&&(b(0,"span",12),p(1),E()),t&2){let n=h();u(),D(n.statusLabel())}}function kN(t,e){t&1&&(Tt(),b(0,"svg",3),$e(1,"path",17),E())}function NN(t,e){t&1&&(Tt(),b(0,"svg",3),$e(1,"path",18),E())}var Nd=class t{morse=N(wt);shell=N(rn);display=N(hs);state=this.morse.state;connection=this.morse.connection;connectionDetail=this.morse.connectionDetail;workspace=this.morse.workspace;navigationOpen=this.shell.navigationOpen;collapsed=this.shell.navigationCollapsed;compactTools=S(()=>this.display.toolDisplay()==="compact");status=S(()=>{let e=this.connection();return e!=="ready"?e:this.state().agentStarting?"starting":!this.state().agentReady&&this.state().agentError===void 0||this.state().agentReady?"ready":"error"});statusLabel=S(()=>{switch(this.status()){case"ready":return"Ready";case"starting":return"Starting\u2026";case"connecting":return"Connecting\u2026";case"closed":return"Disconnected";case"error":return"Error";default:return this.status()}});statusTitle=S(()=>{let e=this.connectionDetail();return e?`${this.statusLabel()} \xB7 ${e}`:this.statusLabel()});title=S(()=>this.state().sessionTitle||this.workspace().name||"Morse");meta=S(()=>{let e=[],n=this.workspace().name;n&&n!==this.title()&&e.push(n);let o=this.state().model;return o&&e.push(o.name),e.join(" \xB7 ")});toggleNavigation(){this.shell.toggleNavigation()}toggleSidebar(){this.shell.toggleNavigationCollapsed()}compact(){this.shell.requestCompact()}toggleToolDisplay(){this.display.toggleToolDisplay()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-chat-header"]],decls:22,vars:20,consts:[[1,"head"],["type","button","title","Sessions and projects","aria-label","Toggle navigation",1,"icon","menu",3,"click"],["type","button",1,"icon","collapse",3,"click","title"],["viewBox","0 0 16 16","aria-hidden","true",1,"glyph"],["x","2","y","3.5","width","12","height","9","rx","1.5"],["d","M6.5 3.5v9"],[1,"titles"],[1,"title",3,"title"],[1,"meta",3,"title"],[1,"actions"],[1,"status",3,"title"],["aria-hidden","true",1,"dot"],[1,"status-text"],["type","button",1,"icon",3,"click","title"],["type","button","title","Compact the conversation (asks first)","aria-label","Compact the conversation",1,"icon",3,"click","disabled"],["d","M4 3 8 6.6l4-3.6"],["d","M4 13 8 9.4l4 3.6"],["d","M3 6h10M3 10h6"],["d","M3 4.5h10M3 8h10M3 11.5h10"]],template:function(n,o){if(n&1&&(b(0,"header",0)(1,"button",1),q("click",function(){return o.toggleNavigation()}),p(2," \u2630 "),E(),b(3,"button",2),q("click",function(){return o.toggleSidebar()}),Tt(),b(4,"svg",3),$e(5,"rect",4)(6,"path",5),E()(),fn(),b(7,"div",6)(8,"div",7),p(9),E(),T(10,MN,2,2,"div",8),E(),b(11,"div",9)(12,"span",10),$e(13,"span",11),T(14,IN,2,1,"span",12),E(),b(15,"button",13),q("click",function(){return o.toggleToolDisplay()}),T(16,kN,2,0,":svg:svg",3)(17,NN,2,0,":svg:svg",3),E(),b(18,"button",14),q("click",function(){return o.compact()}),Tt(),b(19,"svg",3),$e(20,"path",15)(21,"path",16),E()()()()),n&2){let r;u(),pe("aria-expanded",o.navigationOpen()),u(2),Ae("title",o.collapsed()?"Show the sidebar":"Hide the sidebar"),pe("aria-label",o.collapsed()?"Show the sidebar":"Hide the sidebar")("aria-expanded",!o.collapsed()),u(5),Ae("title",o.state().sessionId??o.workspace().cwd),u(),D(o.title()),u(),M((r=o.meta())?10:-1,r),u(2),Te("online",o.status()==="ready")("busy",o.status()==="starting")("failed",o.status()==="error"||o.status()==="closed"),Ae("title",o.statusTitle()),u(2),M(o.status()!=="ready"?14:-1),u(),Ae("title",o.compactTools()?"Tool calls: compact \u2014 click for the legacy timeline":"Tool calls: legacy timeline \u2014 click for the compact tree"),pe("aria-label","Tool call display: "+(o.compactTools()?"compact":"timeline"))("aria-pressed",o.compactTools()),u(),M(o.compactTools()?16:17),u(2),Ae("disabled",!o.state().agentReady)}},styles:["[_nghost-%COMP%]{display:block;flex:none;background:var(--%NS%morse-bg)}.head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;min-height:var(--%NS%morse-head-height);padding:0 8px;border-bottom:1px solid var(--%NS%morse-border)}.icon[_ngcontent-%COMP%]{flex:none;width:26px;height:26px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:1px solid transparent;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg);font-size:13px;line-height:1;cursor:pointer}.icon[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--%NS%morse-hover)}.icon[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:default}.icon[_ngcontent-%COMP%] .glyph[_ngcontent-%COMP%]{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}.menu[_ngcontent-%COMP%], .collapse[_ngcontent-%COMP%]{display:none}@media(max-width:759px){.menu[_ngcontent-%COMP%]{display:inline-flex}}@media(min-width:760px){.collapse[_ngcontent-%COMP%]{display:inline-flex}}.titles[_ngcontent-%COMP%]{flex:1;min-width:0;line-height:1.3}.title[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;font-weight:600}.meta[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:var(--%NS%morse-fg-muted)}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:2px;flex:none}.status[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:2px 6px;font-size:11px;color:var(--%NS%morse-fg-muted);white-space:nowrap}.dot[_ngcontent-%COMP%]{flex:none;width:7px;height:7px;border-radius:50%;background:var(--%NS%morse-fg-muted)}.status.online[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{background:var(--%NS%morse-success)}.status.busy[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{background:var(--%NS%morse-warn);animation:_ngcontent-%COMP%_status-pulse 1.1s ease-in-out infinite}.status.failed[_ngcontent-%COMP%]{color:var(--%NS%morse-error)}.status.failed[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{background:var(--%NS%morse-error)}@keyframes _ngcontent-%COMP%_status-pulse{50%{opacity:.35}}"]})};function Mb(t){let e=[],n=[],o=()=>{n.length!==0&&(e.push({kind:"process",key:`process-${n[0]?.key??e.length}`,steps:n}),n=[])};for(let r of t){if(r.kind==="tool"){n.push({kind:"tool",key:r.id,item:r});continue}if(r.kind==="assistant"){let i=r.thinking.trim();i.length>0&&n.push({kind:"thinking",key:`${r.id}:thinking`,item:r}),r.text.trim().length>0||r.streaming?(o(),e.push({kind:"assistant",key:r.id,item:r})):i.length===0&&o();continue}o(),r.kind==="user"?e.push({kind:"user",key:r.id,item:r}):r.kind==="notice"?e.push({kind:"notice",key:r.id,item:r}):r.kind==="compaction"&&e.push({kind:"compaction",key:r.id,item:r})}return o(),e}function Ib(t){for(let e=t.length-1;e>=0;e-=1){let n=t[e];if(n?.kind==="process")return n.key}return null}var DN=/(^|\s)@([^\s:]+(?::\d+(?:-\d+)?)?)(?=$|\s)/g;function ON(t){if(t.length===0)return;let e=t.indexOf(":");if(e===-1)return{path:t};let n=t.slice(0,e),o=t.slice(e+1),r=/^(\d+)(?:-(\d+))?$/.exec(o);if(n.length===0||!r)return;let i=Number(r[1]),s=r[2]===void 0?i:Number(r[2]);return{path:n,startLine:i,endLine:s}}function kb(t){let e;return t.split(`
|
|
16
|
-
`).map(n=>{let o=/^\s*(`{3,}|~{3,})/.exec(n);if(o){let r=o[1]?.charAt(0)??"";return e===void 0?e=r:r===e&&(e=void 0),n}return e===void 0?PN(n):n}).join(`
|
|
17
|
-
`)}function PN(t){let e="",n=0;for(;n<t.length;){let o=t.indexOf("`",n);if(o===-1){e+=Sb(t.slice(n));break}e+=Sb(t.slice(n,o));let r=t.indexOf("`",o+1);if(r===-1){e+=t.slice(o);break}e+=t.slice(o,r+1),n=r+1}return e}function Sb(t){return t.replace(DN,(e,n,o)=>{let r=ON(o);if(!r)return e;let i=AN(r.path),s=r.startLine===void 0?`@${i}`:`@${i}:${r.startLine}-${r.endLine}`,a=Tb(r.path),c=r.startLine===void 0?"":` data-mention-start="${r.startLine}" data-mention-end="${r.endLine}"`;return`${n}<span class="mention" data-mention-path="${a}" title="${a}"${c}><span class="mention-label">${Tb(s)}</span></span>`})}function AN(t){let e=t.replace(/[\\/]+$/,""),n=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return n===-1?e:e.slice(n+1)}function Tb(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function RN(t,e){this.v=t,this.k=e}function Nb(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function LN(t){if(Array.isArray(t))return t}function FN(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var o,r,i,s,a=[],c=!0,l=!1;try{if(i=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=i.call(n)).done)&&(a.push(o.value),a.length!==e);c=!0);}catch(d){l=!0,r=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw r}}return a}}function VN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
18
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jN(t,e){return LN(t)||FN(t,e)||$N(t,e)||VN()}function $N(t,e){if(t){if(typeof t=="string")return Nb(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nb(t,e):void 0}}function Dd(t){var e,n;function o(i,s){try{var a=t[i](s),c=a.value,l=c instanceof RN;Promise.resolve(l?c.v:c).then(function(d){if(l){var f=i==="return"&&c.k?i:"next";if(!c.k||d.done)return o(f,d);d=t[f](d).value}r(!!a.done,d)},function(d){o("throw",d)})}catch(d){r(2,d)}}function r(i,s){i===2?e.reject(s):e.resolve({value:s,done:i}),(e=e.next)?o(e.key,e.arg):n=null}this._invoke=function(i,s){return new Promise(function(a,c){var l={key:i,arg:s,resolve:a,reject:c,next:null};n?n=n.next=l:(e=n=l,o(i,s))})},typeof t.return!="function"&&(this.return=void 0)}Dd.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Dd.prototype.next=function(t){return this._invoke("next",t)},Dd.prototype.throw=function(t){return this._invoke("throw",t)},Dd.prototype.return=function(t){return this._invoke("return",t)};var qb=Object.entries,Db=Object.setPrototypeOf,HN=Object.isFrozen,BN=Object.getPrototypeOf,UN=Object.getOwnPropertyDescriptor,en=Object.freeze,an=Object.seal,gs=Object.create,Gb=typeof Reflect<"u"&&Reflect,Gm=Gb.apply,Wm=Gb.construct;en||(en=function(e){return e});an||(an=function(e){return e});Gm||(Gm=function(e,n){for(var o=arguments.length,r=new Array(o>2?o-2:0),i=2;i<o;i++)r[i-2]=arguments[i];return e.apply(n,r)});Wm||(Wm=function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return new e(...o)});var gi=Wt(Array.prototype.forEach);Array.prototype.indexOf;var zN=Wt(Array.prototype.lastIndexOf),Ob=Wt(Array.prototype.pop),Va=Wt(Array.prototype.push);Array.prototype.slice;var qN=Wt(Array.prototype.splice),ys=Array.isArray,Ha=Wt(String.prototype.toLowerCase),$m=Wt(String.prototype.toString),Pb=Wt(String.prototype.match),ja=Wt(String.prototype.replace),Ab=Wt(String.prototype.indexOf),GN=Wt(String.prototype.trim),WN=Wt(Number.prototype.toString),YN=Wt(Boolean.prototype.toString),Rb=typeof BigInt>"u"?null:Wt(BigInt.prototype.toString),Lb=typeof Symbol>"u"?null:Wt(Symbol.prototype.toString),Nn=Wt(Object.prototype.hasOwnProperty),$a=Wt(Object.prototype.toString),yn=Wt(RegExp.prototype.test),wr=ZN(TypeError);function Wt(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return Gm(t,e,o)}}function ZN(t){return function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return Wm(t,n)}}function it(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ha;if(Db&&Db(t,null),!ys(e))return t;let o=e.length;for(;o--;){let r=e[o];if(typeof r=="string"){let i=n(r);i!==r&&(HN(e)||(e[o]=i),r=i)}t[r]=!0}return t}function KN(t){for(let e=0;e<t.length;e++)Nn(t,e)||(t[e]=null);return t}function Hn(t){let e=gs(null);for(let o of qb(t)){var n=jN(o,2);let r=n[0],i=n[1];Nn(t,r)&&(ys(i)?e[r]=KN(i):i&&typeof i=="object"&&i.constructor===Object?e[r]=Hn(i):e[r]=i)}return e}function QN(t){switch(typeof t){case"string":return t;case"number":return WN(t);case"boolean":return YN(t);case"bigint":return Rb?Rb(t):"0";case"symbol":return Lb?Lb(t):"Symbol()";case"undefined":return $a(t);case"function":case"object":{if(t===null)return $a(t);let e=t,n=so(e,"toString");if(typeof n=="function"){let o=n(e);return typeof o=="string"?o:$a(o)}return $a(t)}default:return $a(t)}}function so(t,e){for(;t!==null;){let o=UN(t,e);if(o){if(o.get)return Wt(o.get);if(typeof o.value=="function")return Wt(o.value)}t=BN(t)}function n(){return null}return n}function XN(t){try{return yn(t,""),!0}catch{return!1}}var Fb=en(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Hm=en(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Bm=en(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),JN=en(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Um=en(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),eD=en(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Vb=en(["#text"]),jb=en(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),zm=en(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$b=en(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Od=en(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),tD=an(/{{[\w\W]*|^[\w\W]*}}/g),nD=an(/<%[\w\W]*|^[\w\W]*%>/g),oD=an(/\${[\w\W]*/g),rD=an(/^data-[\-\w.\u00B7-\uFFFF]+$/),iD=an(/^aria-[\-\w]+$/),Hb=an(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),sD=an(/^(?:\w+script|data):/i),aD=an(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),cD=an(/^html$/i),lD=an(/^[a-z][.\w]*(-[.\w]+)+$/i),Bb=an(/<[/\w!]/g),Ub=an(/<[/\w]/g),dD=an(/<\/no(script|embed|frames)/i),uD=an(/\/>/i),$n={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Wb=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],pD=en(it({},Wb)),fD=(function(){let t={};return gi(Wb,e=>{t[e]=an(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),en(t)})(),mD=function(){return typeof window>"u"?null:window},hD=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let o=null,r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(o=n.getAttribute(r));let i="dompurify"+(o?"#"+o:"");try{return e.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},zb=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Sr=function(e,n,o,r){return Nn(e,n)&&ys(e[n])?it(r.base?Hn(r.base):{},e[n],r.transform):o},qm=function(e,n,o){let r=Nn(e,n)?e[n]:void 0;return r&&typeof r=="object"?Hn(r):o()};function Yb(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mD(),e=$=>Yb($);if(e.version="3.4.16",e.removed=[],!t||!t.document||t.document.nodeType!==$n.document||!t.Element)return e.isSupported=!1,e;let n=t.document,o=n,r=o.currentScript;t.DocumentFragment;let i=t.HTMLTemplateElement,s=t.Node,a=t.Element,c=t.NodeFilter;t.NamedNodeMap===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;let l=t.DOMParser,d=t.trustedTypes,f=a.prototype,y=so(f,"cloneNode"),v=so(f,"remove"),x=so(f,"removeAttributeNode"),C=so(f,"nextSibling"),P=so(f,"childNodes"),Y=so(f,"parentNode"),G=so(f,"shadowRoot"),ve=so(f,"attributes"),le=s&&s.prototype?so(s.prototype,"nodeType"):null,Ee=s&&s.prototype?so(s.prototype,"nodeName"):null,ie=s&&s.prototype?so(s.prototype,"ownerDocument"):null,Qe=function(m){return le?le(m):m.nodeType},Le=function(m){return Ee?Ee(m):m.nodeName};if(typeof i=="function"){let $=n.createElement("template");$.content&&$.content.ownerDocument&&(n=$.content.ownerDocument)}let He,dt="",Et,Pt=!1,St=0,Xe=function(){if(St>0)throw wr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ge=function(m){Xe(),St++;try{return He.createHTML(m)}finally{St--}},O=function(m){Xe(),St++;try{return He.createScriptURL(m)}finally{St--}},Z=function(){return Pt||(Et=hD(d,r),Pt=!0),Et},U=n,A=U.implementation,J=U.createNodeIterator,Pe=U.createDocumentFragment,Je=U.getElementsByTagName,jt=o.importNode,fe=zb();e.isSupported=typeof qb=="function"&&typeof Y=="function"&&A&&A.createHTMLDocument!==void 0;let gt=tD,Be=nD,tn=oD,$t=rD,Ye=iD,Ut=sD,At=aD,De=lD,qe=Hb,Ce=null,nt=it({},[...Fb,...Hm,...Bm,...Um,...Vb]),oe=null,ct=it({},[...jb,...zm,...$b,...Od]),W=Object.seal(gs(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),mt=null,Ke=null,ne=Object.seal(gs(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),_t=!0,me=!0,st=!1,Ue=!0,F=!1,j=!0,X=!1,re=!1,ut=null,Ct=null,Un=!1,pn=!1,xo=!1,Eo=!1,Za=!0,Ka=!1,Ei="user-content-",Ir=!0,ws=!1,Yt={},Co=null,Ss=it({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),Qa=null,kr=it({},["audio","video","img","source","image","track"]),Ts=null,Ms=it({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nn="http://www.w3.org/1998/Math/MathML",ir="http://www.w3.org/2000/svg",Me="http://www.w3.org/1999/xhtml",Rt=Me,Xa=!1,Ci=null,SE=it({},[nn,ir,Me],$m),fh=en(["mi","mo","mn","ms","mtext"]),cu=it({},fh),mh=en(["annotation-xml"]),lu=it({},mh),TE=it({},["title","style","font","a","script"]),Is=null,ME=["application/xhtml+xml","text/html"],IE="text/html",Ht=null,wi=null,kE=n.createElement("form"),hh=function(m){return m instanceof RegExp||m instanceof Function},du=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(wi&&wi===m)return;(!m||typeof m!="object")&&(m={}),m=Hn(m),Is=ME.indexOf(m.PARSER_MEDIA_TYPE)===-1?IE:m.PARSER_MEDIA_TYPE,Ht=Is==="application/xhtml+xml"?$m:Ha,Ce=Sr(m,"ALLOWED_TAGS",nt,{transform:Ht}),oe=Sr(m,"ALLOWED_ATTR",ct,{transform:Ht}),Ci=Sr(m,"ALLOWED_NAMESPACES",SE,{transform:$m}),Ts=Sr(m,"ADD_URI_SAFE_ATTR",Ms,{transform:Ht,base:Ms}),Qa=Sr(m,"ADD_DATA_URI_TAGS",kr,{transform:Ht,base:kr}),Co=Sr(m,"FORBID_CONTENTS",Ss,{transform:Ht}),mt=Sr(m,"FORBID_TAGS",Hn({}),{transform:Ht}),Ke=Sr(m,"FORBID_ATTR",Hn({}),{transform:Ht}),Yt=Nn(m,"USE_PROFILES")?m.USE_PROFILES&&typeof m.USE_PROFILES=="object"?Hn(m.USE_PROFILES):m.USE_PROFILES:!1,_t=m.ALLOW_ARIA_ATTR!==!1,me=m.ALLOW_DATA_ATTR!==!1,st=m.ALLOW_UNKNOWN_PROTOCOLS||!1,Ue=m.ALLOW_SELF_CLOSE_IN_ATTR!==!1,F=m.SAFE_FOR_TEMPLATES||!1,j=m.SAFE_FOR_XML!==!1,X=m.WHOLE_DOCUMENT||!1,pn=m.RETURN_DOM||!1,xo=m.RETURN_DOM_FRAGMENT||!1,Eo=m.RETURN_TRUSTED_TYPE||!1,Un=m.FORCE_BODY||!1,Za=m.SANITIZE_DOM!==!1,Ka=m.SANITIZE_NAMED_PROPS||!1,Ir=m.KEEP_CONTENT!==!1,ws=m.IN_PLACE||!1,qe=XN(m.ALLOWED_URI_REGEXP)?m.ALLOWED_URI_REGEXP:Hb,Rt=typeof m.NAMESPACE=="string"?m.NAMESPACE:Me,cu=qm(m,"MATHML_TEXT_INTEGRATION_POINTS",()=>it({},fh)),lu=qm(m,"HTML_INTEGRATION_POINTS",()=>it({},mh));let w=qm(m,"CUSTOM_ELEMENT_HANDLING",()=>gs(null));if(W=gs(null),Nn(w,"tagNameCheck")&&hh(w.tagNameCheck)&&(W.tagNameCheck=w.tagNameCheck),Nn(w,"attributeNameCheck")&&hh(w.attributeNameCheck)&&(W.attributeNameCheck=w.attributeNameCheck),Nn(w,"allowCustomizedBuiltInElements")&&typeof w.allowCustomizedBuiltInElements=="boolean"&&(W.allowCustomizedBuiltInElements=w.allowCustomizedBuiltInElements),an(W),F&&(me=!1),xo&&(pn=!0),Yt&&(Ce=it({},Vb),oe=gs(null),Yt.html===!0&&(it(Ce,Fb),it(oe,jb)),Yt.svg===!0&&(it(Ce,Hm),it(oe,zm),it(oe,Od)),Yt.svgFilters===!0&&(it(Ce,Bm),it(oe,zm),it(oe,Od)),Yt.mathMl===!0&&(it(Ce,Um),it(oe,$b),it(oe,Od))),ne.tagCheck=null,ne.attributeCheck=null,Nn(m,"ADD_TAGS")&&(typeof m.ADD_TAGS=="function"?ne.tagCheck=m.ADD_TAGS:ys(m.ADD_TAGS)&&(Ce===nt&&(Ce=Hn(Ce)),it(Ce,m.ADD_TAGS,Ht))),Nn(m,"ADD_ATTR")&&(typeof m.ADD_ATTR=="function"?ne.attributeCheck=m.ADD_ATTR:ys(m.ADD_ATTR)&&(oe===ct&&(oe=Hn(oe)),it(oe,m.ADD_ATTR,Ht))),Nn(m,"ADD_FORBID_CONTENTS")&&ys(m.ADD_FORBID_CONTENTS)&&(Co===Ss&&(Co=Hn(Co)),it(Co,m.ADD_FORBID_CONTENTS,Ht)),Ir&&(Ce["#text"]=!0),X&&it(Ce,["html","head","body"]),Ce.table&&(it(Ce,["tbody"]),delete mt.tbody),m.TRUSTED_TYPES_POLICY){if(typeof m.TRUSTED_TYPES_POLICY.createHTML!="function")throw wr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof m.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw wr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let V=He;He=m.TRUSTED_TYPES_POLICY;try{dt=ge("")}catch(B){throw He=V,B}}else m.TRUSTED_TYPES_POLICY===null?(He=void 0,dt=""):(He===void 0&&(He=Z()),He&&typeof dt=="string"&&(dt=ge("")));en&&en(m),wi=m},gh=it({},[...Hm,...Bm,...JN]),yh=it({},[...Um,...eD]),NE=function(m,w,V){return w.namespaceURI===Me?m==="svg":w.namespaceURI===nn?m==="svg"&&(V==="annotation-xml"||cu[V]):!!gh[m]},DE=function(m,w,V){return w.namespaceURI===Me?m==="math":w.namespaceURI===ir?m==="math"&&lu[V]:!!yh[m]},OE=function(m,w,V){return w.namespaceURI===ir&&!lu[V]||w.namespaceURI===nn&&!cu[V]?!1:!yh[m]&&(TE[m]||!gh[m])},PE=function(m){let w=Y(m);(!w||!w.tagName)&&(w={namespaceURI:Rt,tagName:"template"});let V=Ha(m.tagName),B=Ha(w.tagName);return Ci[m.namespaceURI]?m.namespaceURI===ir?NE(V,w,B):m.namespaceURI===nn?DE(V,w,B):m.namespaceURI===Me?OE(V,w,B):!!(Is==="application/xhtml+xml"&&Ci[m.namespaceURI]):!1},sr=function(m){Va(e.removed,{element:m});try{Y(m).removeChild(m)}catch{if(v(m),!Y(m))throw wr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},vh=function(m,w,V){try{x(m,w)}catch{try{m.removeAttribute(V)}catch{}}},Ja=function(m){ec(m);let w=P(m);if(w){let B=[];gi(w,se=>{Va(B,se)}),gi(B,se=>{try{v(se)}catch{}})}let V=ve(m);if(V)for(let B=V.length-1;B>=0;--B){let se=V[B],Ge=se&&se.name;typeof Ge=="string"&&vh(m,se,Ge)}},Nr=function(m,w,V){if(!V)try{V=w.getAttributeNode(m)}catch{V=null}Va(e.removed,{attribute:V||null,from:w});try{V?x(w,V):w.removeAttribute(m)}catch{try{w.removeAttribute(m)}catch{}}if(m==="is")if(pn||xo)try{sr(w)}catch{}else try{w.setAttribute(m,"")}catch{}},AE=function(m){let w=ve(m);if(w)for(let V=w.length-1;V>=0;--V){let B=w[V],se=B&&B.name;typeof se!="string"||oe[Ht(se)]||vh(m,B,se)}},ec=function(m){let w=[m];for(;w.length>0;){let V=w.pop();Qe(V)===$n.element&&AE(V);let B=P(V);if(B)for(let se=B.length-1;se>=0;--se)w.push(B[se])}},_h=function(m,w){return j?m==="patchsrc"?!0:m==="for"&&w!=="label"&&w!=="output":!1},RE=function(m){if(!j)return;let w=[m];for(;w.length>0;){let V=w.pop(),B=Qe(V);if(B===$n.processingInstruction||B===$n.comment&&yn(Ub,V.data)){try{v(V)}catch{}continue}if(B===$n.element){let Ge=V,et=Ht(Le(V));try{Ge.hasAttribute&&Ge.hasAttribute("patchsrc")&&Ge.removeAttribute("patchsrc"),Ge.hasAttribute&&Ge.hasAttribute("for")&&_h("for",et)&&Ge.removeAttribute("for")}catch{}}let se=P(V);if(se)for(let Ge=se.length-1;Ge>=0;--Ge)w.push(se[Ge])}},bh=function(m){let w=null,V=null;if(Un)m="<remove></remove>"+m;else{let Ge=Pb(m,/^[\r\n\t ]+/);V=Ge&&Ge[0]}Is==="application/xhtml+xml"&&Rt===Me&&(m='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+m+"</body></html>");let B=He?ge(m):m;if(Rt===Me)try{w=new l().parseFromString(B,Is)}catch{}if(!w||!w.documentElement){w=A.createDocument(Rt,"template",null);try{w.documentElement.innerHTML=Xa?dt:B}catch{}}let se=w.body||w.documentElement;return m&&V&&se.insertBefore(n.createTextNode(V),se.childNodes[0]||null),Rt===Me?Je.call(w,X?"html":"body")[0]:X?w.documentElement:se},xh=function(m){let w=ie?ie(m):m.ownerDocument;return J.call(w||m,m,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},tc=function(m){return m=ja(m,gt," "),m=ja(m,Be," "),m=ja(m,tn," "),m},uu=function(m){var w;m.normalize();let V=ie?ie(m):m.ownerDocument,B=J.call(V||m,m,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),se=B.nextNode();for(;se;)se.data=tc(se.data),se=B.nextNode();let Ge=(w=m.querySelectorAll)===null||w===void 0?void 0:w.call(m,"template");Ge&&gi(Ge,et=>{Si(et.content)&&uu(et.content)})},nc=function(m){let w=Ee?Ee(m):null;return typeof w!="string"||Ht(w)!=="form"?!1:typeof m.nodeName!="string"||typeof m.textContent!="string"||typeof m.removeChild!="function"||m.attributes!==ve(m)||typeof m.removeAttribute!="function"||typeof m.removeAttributeNode!="function"||typeof m.getAttributeNode!="function"||typeof m.setAttribute!="function"||typeof m.namespaceURI!="string"||typeof m.insertBefore!="function"||typeof m.hasChildNodes!="function"||m.nodeType!==le(m)||m.childNodes!==P(m)},Si=function(m){if(!le||typeof m!="object"||m===null)return!1;try{return le(m)===$n.documentFragment}catch{return!1}},ks=function(m){if(!le||typeof m!="object"||m===null)return!1;try{return typeof le(m)=="number"}catch{return!1}};function wo($,m,w){$.length!==0&&gi($,V=>{V.call(e,m,w,wi)})}let LE=function(m,w){return!!(j&&m.hasChildNodes()&&!ks(m.firstElementChild)&&yn(Bb,m.textContent)&&yn(Bb,m.innerHTML)||j&&m.namespaceURI===Me&&pD[w]&&(ks(m.firstElementChild)||typeof m.textContent=="string"&&yn(fD[w],m.textContent))||m.nodeType===$n.processingInstruction||j&&m.nodeType===$n.comment&&yn(Ub,m.data))},oc=function(m,w){if(m instanceof RegExp)return yn(m,w);if(m instanceof Function){for(var V=arguments.length,B=new Array(V>2?V-2:0),se=2;se<V;se++)B[se-2]=arguments[se];return!!m(w,...B)}return!1},FE=function(m,w,V){if(!mt[w]&&Sh(w)&&oc(W.tagNameCheck,w))return!1;if(Ir&&!Co[w]){let B=Y(m),se=P(m);if(se&&B){let Ge=se.length;for(let et=Ge-1;et>=0;--et){let Lt=m===V?y(se[et],!0):se[et];B.insertBefore(Lt,C(m))}}}return sr(m),!0},Eh=function(m,w,V,B){return m.length===0?w:w===V||w===B?Hn(w):w},Ti=function(m,w){return m===w||Y(m)!==null?!1:(ws&&ec(m),!0)},Ch=function(m,w){if(wo(fe.beforeSanitizeElements,m,null),Ti(m,w))return!0;if(nc(m))return sr(m),!0;let V=Ht(Le(m));if(Ce=Eh(fe.uponSanitizeElement,Ce,nt,ut),wo(fe.uponSanitizeElement,m,{tagName:V,allowedTags:Ce}),Ti(m,w))return!0;if(LE(m,V))return sr(m),!0;if(mt[V]||!(ne.tagCheck instanceof Function&&ne.tagCheck(V))&&!Ce[V]){let B=FE(m,V,w);return B===!1&&(wo(fe.afterSanitizeElements,m,null),Ti(m,w))?!0:B}if(Qe(m)===$n.element&&!PE(m)||(V==="noscript"||V==="noembed"||V==="noframes")&&yn(dD,m.innerHTML))return sr(m),!0;if(F&&m.nodeType===$n.text){let B=tc(m.textContent);m.textContent!==B&&(Va(e.removed,{element:m.cloneNode()}),m.textContent=B)}return wo(fe.afterSanitizeElements,m,null),Ti(m,w)},wh=function(m,w,V){if(Ke[w]||_h(w,m)||Za&&(w==="id"||w==="name")&&(V in n||V in kE))return!1;let B=oe[w]||ne.attributeCheck instanceof Function&&ne.attributeCheck(w,m);return me&&yn($t,w)||_t&&yn(Ye,w)?!0:B?Ts[w]||yn(qe,ja(V,At,""))||(w==="src"||w==="xlink:href"||w==="href")&&m!=="script"&&Ab(V,"data:")===0&&Qa[m]||st&&!yn(Ut,ja(V,At,""))?!0:!V:Sh(m)&&oc(W.tagNameCheck,m)&&oc(W.attributeNameCheck,w,m)||w==="is"&&W.allowCustomizedBuiltInElements&&oc(W.tagNameCheck,V)},VE=it({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Sh=function(m){return!VE[Ha(m)]&&yn(De,m)},jE=function(m,w,V,B){if(He&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!V)switch(d.getAttributeType(m,w)){case"TrustedHTML":return ge(B);case"TrustedScriptURL":return O(B)}return B},$E=function(m,w,V,B){try{return V?m.setAttributeNS(V,w,B):m.setAttribute(w,B),nc(m)?(sr(m),!1):!0}catch{return Nr(w,m),!1}},Th=function(m,w){if(wo(fe.beforeSanitizeAttributes,m,null),Ti(m,w))return;let V=m.attributes;if(!V||nc(m))return;oe=Eh(fe.uponSanitizeAttribute,oe,ct,Ct);let B={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:oe,forceKeepAttr:void 0},se=V.length,Ge=Ht(m.nodeName);for(;se--;){let et=V[se],Lt=et.name,zn=et.namespaceURI,Dn=et.value,Mi=Ht(Lt),fu=Dn,vn=Lt==="value"?fu:GN(fu),Mh=!1;if(B.attrName=Mi,B.attrValue=vn,B.keepAttr=!0,B.forceKeepAttr=void 0,wo(fe.uponSanitizeAttribute,m,B),vn=B.attrValue,Ka&&(Mi==="id"||Mi==="name")&&Ab(vn,Ei)!==0&&(Nr(Lt,m,et),vn=Ei+vn,Mh=!0),j&&yn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,vn)){Nr(Lt,m,et);continue}if(Mi==="attributename"&&Pb(vn,"href")){Nr(Lt,m,et);continue}if(!B.forceKeepAttr){if(!B.keepAttr){Nr(Lt,m,et);continue}if(!Ue&&yn(uD,vn)){Nr(Lt,m,et);continue}if(F&&(vn=tc(vn)),!wh(Ge,Mi,vn)){Nr(Lt,m,et);continue}vn=jE(Ge,Mi,zn,vn),vn!==fu&&$E(m,Lt,zn,vn)&&Mh&&Ob(e.removed)}}wo(fe.afterSanitizeAttributes,m,null),Ti(m,w)},rc=function(m){let w=null,V=xh(m);for(wo(fe.beforeSanitizeShadowDOM,m,null);w=V.nextNode();)if(wo(fe.uponSanitizeShadowNode,w,null),Ch(w,m),Th(w,m),Si(w.content)&&rc(w.content),Qe(w)===$n.element){let B=G(w);Si(B)&&(pu(B),rc(B))}wo(fe.afterSanitizeShadowDOM,m,null)},pu=function(m){let w=[{node:m,shadow:null}];for(;w.length>0;){let V=w.pop();if(V.shadow){rc(V.shadow);continue}let B=V.node,se=Qe(B)===$n.element,Ge=P(B);if(Ge)for(let et=Ge.length-1;et>=0;--et)w.push({node:Ge[et],shadow:null});if(se){let et=Ee?Ee(B):null;if(typeof et=="string"&&Ht(et)==="template"){let Lt=B.content;Si(Lt)&&w.push({node:Lt,shadow:null})}}if(se){let et=G(B);Si(et)&&w.push({node:null,shadow:et},{node:et,shadow:null})}}};return e.sanitize=function($){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},w=null,V=null,B=null,se=null;if(Xa=!$,Xa&&($="<!-->"),typeof $!="string"&&!ks($)&&($=QN($),typeof $!="string"))throw wr("dirty is not a string, aborting");if(!e.isSupported)return $;re?(Ce=ut,oe=Ct):du(m),(fe.uponSanitizeElement.length>0||fe.uponSanitizeAttribute.length>0)&&(Ce=Hn(Ce)),fe.uponSanitizeAttribute.length>0&&(oe=Hn(oe)),e.removed=[];let Ge=ws&&typeof $!="string"&&ks($);if(Ge){RE($);let zn=Le($);if(typeof zn=="string"){let Dn=Ht(zn);if(!Ce[Dn]||mt[Dn])throw Ja($),wr("root node is forbidden and cannot be sanitized in-place")}if(nc($))throw Ja($),wr("root node is clobbered and cannot be sanitized in-place");try{pu($)}catch(Dn){throw Ja($),Dn}}else if(ks($))w=bh("<!---->"),V=w.ownerDocument.importNode($,!0),V.nodeType===$n.element&&V.nodeName==="BODY"||V.nodeName==="HTML"?w=V:w.appendChild(V),pu(w);else{if(!pn&&!F&&!X&&$.indexOf("<")===-1)return He&&Eo?ge($):$;if(w=bh($),!w)return pn?null:Eo?dt:""}w&&Un&&sr(w.firstChild);let et=Ge?$:w;try{let zn=xh(et);for(;B=zn.nextNode();)Ch(B,et),Th(B,et),Si(B.content)&&rc(B.content)}catch(zn){throw Ge&&(Ja($),gi(e.removed,Dn=>{Dn.element&&ec(Dn.element)})),zn}if(Ge){let zn=!1;if(gi(e.removed,Dn=>{Dn.element&&(Dn.element===$&&(zn=!0),ec(Dn.element))}),zn)throw wr("a node selected for removal could not be safely returned; refusing to sanitize in place");return F&&uu($),$}if(pn){if(F&&uu(w),xo)for(se=Pe.call(w.ownerDocument);w.firstChild;)se.appendChild(w.firstChild);else se=w;return(oe.shadowroot||oe.shadowrootmode)&&(se=jt.call(o,se,!0)),se}let Lt=X?w.outerHTML:w.innerHTML;return X&&Ce["!doctype"]&&w.ownerDocument&&w.ownerDocument.doctype&&w.ownerDocument.doctype.name&&yn(cD,w.ownerDocument.doctype.name)&&(Lt="<!DOCTYPE "+w.ownerDocument.doctype.name+`>
|
|
19
|
-
`+Lt),F&&(Lt=tc(Lt)),He&&Eo?ge(Lt):Lt},e.setConfig=function(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};du($),re=!0,ut=Ce,Ct=oe},e.clearConfig=function(){wi=null,re=!1,ut=null,Ct=null,He=Et,dt=""},e.isValidAttribute=function($,m,w){wi||du({});let V=Ht($),B=Ht(m);return wh(V,B,w)},e.addHook=function($,m){typeof m=="function"&&Nn(fe,$)&&Va(fe[$],m)},e.removeHook=function($,m){if(Nn(fe,$)){if(m!==void 0){let w=zN(fe[$],m);return w===-1?void 0:qN(fe[$],w,1)[0]}return Ob(fe[$])}},e.removeHooks=function($){Nn(fe,$)&&(fe[$]=[])},e.removeAllHooks=function(){fe=zb()},e}var Zb=Yb();var gx=KE(hx(),1);var Vd=gx.default;function yx(t){let e=t.regex,n={},o={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},o]});let r={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},i=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,r]};r.contains.push(a);let c={match:/\\"/},l={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],v=t.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),x={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},C=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],P=["true","false"],Y={match:/(\/[a-z._-]+)+/},G=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],ve=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],le=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],Ee=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:C,literal:P,built_in:[...G,...ve,"set","shopt",...le,...Ee]},contains:[v,t.SHEBANG(),x,f,i,s,Y,a,c,l,d,n]}}var iO=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),sO=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],aO=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],cO=[...sO,...aO],lO=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),dO=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),uO=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),pO=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","corner-bottom-left-shape","corner-bottom-right-shape","corner-shape","corner-top-left-shape","corner-top-right-shape","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function vx(t){let e=t.regex,n=iO(t),o={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",i=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",a=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,o,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+dO.join("|")+")"},{begin:":(:)?("+uO.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+pO.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,n.UNICODE_RANGE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:lO.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+cO.join("|")+")\\b"}]}}function _x(t){let e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function bx(t){let i={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:i,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\b0[bB](_?[01])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:i,illegal:/["']/}]}]}}var xx="[A-Za-z$_][0-9A-Za-z$_]*",fO=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],mO=["true","false","null","undefined","NaN","Infinity"],Ex=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Cx=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],wx=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],hO=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],gO=[].concat(wx,Ex,Cx);function Sx(t){let e=t.regex,n=(U,{after:A})=>{let J="</"+U[0].slice(1);return U.input.indexOf(J,A)!==-1},o=xx,r={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,A)=>{let J=U[0].length+U.index,Pe=U.input[J];if(Pe==="<"||Pe===","){A.ignoreMatch();return}Pe===">"&&(n(U,{after:J})||A.ignoreMatch());let Je,jt=U.input.substring(J);if(Je=jt.match(/^\s*=/)){A.ignoreMatch();return}if((Je=jt.match(/^\s+extends\s+/))&&Je.index===0){A.ignoreMatch();return}}},a={$pattern:xx,keyword:fO,literal:mO,built_in:gO,"variable.language":hO},c="[0-9](_?[0-9])*",l=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},x={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},C={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},P={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,y]},G={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:o+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},ve=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,x,C,P,{match:/\$\d+/},f];y.contains=ve.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(ve)});let le=[].concat(G,y.contains),Ee=le.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(le)}]),ie={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:Ee},Qe={variants:[{match:[/class/,/\s+/,o,/\s+/,/extends/,/\s+/,e.concat(o,"(",e.concat(/\./,o),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,o],scope:{1:"keyword",3:"title.class"}}]},Le={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Ex,...Cx]}},He={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},dt={variants:[{match:[/function/,/\s+/,o,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[ie],illegal:/%/},Et={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Pt(U){return e.concat("(?!",U.join("|"),")")}let St={match:e.concat(/\b/,Pt([...wx,"super","import","await"].map(U=>`${U}\\s*\\(`)),o,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},Xe={begin:e.concat(/\./,e.lookahead(e.concat(o,/(?![0-9A-Za-z$_(])/))),end:o,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ge={match:[/get|set/,/\s+/,o,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},ie]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",Z={match:[/const|var|let/,/\s+/,o,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[ie]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:Ee,CLASS_REFERENCE:Le},illegal:/#(?![$_A-Za-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),He,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,x,C,P,G,{match:/\$\d+/},f,Le,{scope:"attr",match:o+e.lookahead(":"),relevance:0},Z,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[G,t.REGEXP_MODE,{className:"function",begin:O,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:Ee}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:i},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},dt,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[ie,t.inherit(t.TITLE_MODE,{begin:o,className:"title.function"})]},{match:/\.\.\./,relevance:0},Xe,{match:"\\$"+o,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[ie]},St,Et,Qe,ge,{match:/\$[(.]/}]}}var yO="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",vO={scope:"number",match:yO,relevance:0};function Tx(t){let e={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},o=["true","false","null"],r={scope:"literal",beginKeywords:o.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:o},contains:[e,n,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,r,vO,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Mx(t){let e=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},o={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},l={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=t.inherit(l,{contains:[]}),y=t.inherit(d,{contains:[]});l.contains.push(y),d.contains.push(f);let v=[n,c];return[l,d,f,y].forEach(Y=>{Y.contains=Y.contains.concat(v)}),v=v.concat(l,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:v},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:v}]}]},n,i,o,l,d,{className:"quote",begin:"^>\\s+",contains:v,end:"$"},r,c,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Ix(t){let e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,o=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),r=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),i=e.concat(/[A-Z]+/,n),s={scope:"variable",match:"\\$+"+o},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=t.inherit(t.APOS_STRING_MODE,{illegal:null}),d=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(c)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(Xe,ge)=>{ge.data._beginMatch=Xe[1]||Xe[2]},"on:end":(Xe,ge)=>{ge.data._beginMatch!==Xe[1]&&ge.ignoreMatch()}},y=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),v=`[
|
|
20
|
-
]`,x={scope:"string",variants:[d,l,f,y]},C={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},P=["false","null","true"],Y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],G=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],le={keyword:Y,literal:(Xe=>{let ge=[];return Xe.forEach(O=>{ge.push(O),O.toLowerCase()===O?ge.push(O.toUpperCase()):ge.push(O.toLowerCase())}),ge})(P),built_in:G},Ee=Xe=>Xe.map(ge=>ge.replace(/\|\d+$/,"")),ie={variants:[{match:[/new/,e.concat(v,"+"),e.concat("(?!",Ee(G).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},Qe=e.concat(o,"\\b(?!\\()"),Le={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),Qe],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,e.concat(/::/,e.lookahead(/(?!class\b)/)),Qe],scope:{1:"title.class",3:"variable.constant"}},{match:[r,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},He={scope:"attr",match:e.concat(o,e.lookahead(":"),e.lookahead(/(?!::)/))},dt={relevance:0,begin:/\(/,end:/\)/,keywords:le,contains:[He,s,Le,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,x,C,ie]},Et={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",Ee(Y).join("\\b|"),"|",Ee(G).join("\\b|"),"\\b)"),o,e.concat(v,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[dt]};dt.contains.push(Et);let Pt=[He,Le,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,x,C,ie],St={begin:e.concat(/#\[\s*\\?/,e.either(r,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:P,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:P,keyword:["new","array"]},contains:["self",...Pt]},...Pt,{scope:"meta",variants:[{match:r},{match:i}]}]};return{case_insensitive:!1,keywords:le,contains:[St,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},s,Et,Le,{match:[/const/,/\s/,o],scope:{1:"keyword",3:"variable.constant"}},ie,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:le,contains:["self",St,s,Le,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,x,C]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},x,C]}}function kx(t){let e=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),o=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","lazy","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:o,built_in:["__import__","abs","aiter","all","anext","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozendict","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","sentinel","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},l={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,c,d,l]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,c,d,l]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,d,l]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,d,l]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",v=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,x=`\\b|${o.join("|")}`,C={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${v}))[eE][+-]?(${y})[jJ]?(?=${x})`},{begin:`(${v})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${x})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${x})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${x})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${x})`},{begin:`\\b(${y})[jJ](?=${x})`}]},P={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},Y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",c,C,f,t.HASH_COMMENT_MODE]}]};return l.contains=[f,C,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[c,C,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,P,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[Y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[C,Y,f]}]}}var jd="[A-Za-z$_][0-9A-Za-z$_]*",Nx=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Dx=["true","false","null","undefined","NaN","Infinity"],Ox=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Px=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ax=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Rx=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],Lx=[].concat(Ax,Ox,Px);function _O(t){let e=t.regex,n=(U,{after:A})=>{let J="</"+U[0].slice(1);return U.input.indexOf(J,A)!==-1},o=jd,r={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,A)=>{let J=U[0].length+U.index,Pe=U.input[J];if(Pe==="<"||Pe===","){A.ignoreMatch();return}Pe===">"&&(n(U,{after:J})||A.ignoreMatch());let Je,jt=U.input.substring(J);if(Je=jt.match(/^\s*=/)){A.ignoreMatch();return}if((Je=jt.match(/^\s+extends\s+/))&&Je.index===0){A.ignoreMatch();return}}},a={$pattern:jd,keyword:Nx,literal:Dx,built_in:Lx,"variable.language":Rx},c="[0-9](_?[0-9])*",l=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},x={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},C={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},P={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,y]},G={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:o+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},ve=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,x,C,P,{match:/\$\d+/},f];y.contains=ve.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(ve)});let le=[].concat(G,y.contains),Ee=le.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(le)}]),ie={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:Ee},Qe={variants:[{match:[/class/,/\s+/,o,/\s+/,/extends/,/\s+/,e.concat(o,"(",e.concat(/\./,o),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,o],scope:{1:"keyword",3:"title.class"}}]},Le={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Ox,...Px]}},He={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},dt={variants:[{match:[/function/,/\s+/,o,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[ie],illegal:/%/},Et={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Pt(U){return e.concat("(?!",U.join("|"),")")}let St={match:e.concat(/\b/,Pt([...Ax,"super","import","await"].map(U=>`${U}\\s*\\(`)),o,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},Xe={begin:e.concat(/\./,e.lookahead(e.concat(o,/(?![0-9A-Za-z$_(])/))),end:o,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ge={match:[/get|set/,/\s+/,o,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},ie]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",Z={match:[/const|var|let/,/\s+/,o,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[ie]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:Ee,CLASS_REFERENCE:Le},illegal:/#(?![$_A-Za-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),He,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,x,C,P,G,{match:/\$\d+/},f,Le,{scope:"attr",match:o+e.lookahead(":"),relevance:0},Z,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[G,t.REGEXP_MODE,{className:"function",begin:O,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:Ee}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:i},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},dt,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[ie,t.inherit(t.TITLE_MODE,{begin:o,className:"title.function"})]},{match:/\.\.\./,relevance:0},Xe,{match:"\\$"+o,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[ie]},St,Et,Qe,ge,{match:/\$[(.]/}]}}function Fx(t){let e=t.regex,n=_O(t),o=jd,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],l={$pattern:jd,keyword:Nx.concat(c),literal:Dx,built_in:Lx.concat(r),"variable.language":Rx},d={className:"meta",begin:"@"+o},f=(C,P,Y)=>{let G=C.contains.findIndex(ve=>ve.label===P);if(G===-1)throw new Error("can not find mode to replace");C.contains.splice(G,1,Y)};Object.assign(n.keywords,l),n.exports.PARAMS_CONTAINS.push(d);let y=n.contains.find(C=>C.scope==="attr"),v=Object.assign({},y,{match:e.concat(o,e.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,y,v]),n.contains=n.contains.concat([d,i,s,v]),f(n,"shebang",t.SHEBANG()),f(n,"use_strict",a);let x=n.contains.find(C=>C.label==="func.def");return x.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Vx(t){let e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),o=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(i,{begin:/\(/,end:/\)/}),a=t.inherit(t.APOS_STRING_MODE,{className:"string"}),c=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:o,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,c,a,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,s,c,a]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:"css"}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:"javascript"}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(n,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function jx(t){let e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",o={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,r]},a=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},v={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},x={begin:/\{/,end:/\}/,contains:[v],illegal:"\\n",relevance:0},C={begin:"\\[",end:"\\]",contains:[v],illegal:"\\n",relevance:0},P=[o,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},y,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},x,C,i,s],Y=[...P];return Y.pop(),Y.push(a),v.contains=Y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:P}}function rh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var xi=rh();function Kx(t){xi=t}var _i={exec:()=>null};function bs(t){let e=[];return n=>{let o=Math.max(0,Math.min(3,n-1)),r=e[o];return r||(r=t(o),e[o]=r),r}}function Re(t,e=""){let n=typeof t=="string"?t:t.source,o={replace:(r,i)=>{let s=typeof i=="string"?i:i.source;return s=s.replace(un.caret,"$1"),n=n.replace(r,s),o},getRegex:()=>new RegExp(n,e)};return o}var bO=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),un={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ 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,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,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,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:bs(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:bs(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:bs(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:bs(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:bs(t=>new RegExp(`^ {0,${t}}(?:</?(?:${Wa})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:bs(t=>new RegExp(`^ {0,${t}}>`))},xO=/^(?:[ \t]*(?:\n|$))+/,EO=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,CO=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ga=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,wO=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ih=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Qx=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Xx=Re(Qx).replace(/bull/g,ih).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}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),SO=Re(Qx).replace(/bull/g,ih).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}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),sh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,TO=/^[^\n]+/,ah=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,MO=Re(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ah).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),IO=Re(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,ih).getRegex(),Wa="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",ch=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,kO=Re("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ch).replace("tag",Wa).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Jx=t=>Re(sh).replace("hr",Ga).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wa).getRegex(),NO=Jx(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),DO=Jx(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),OO=Re(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",DO).getRegex(),lh={blockquote:OO,code:EO,def:MO,fences:CO,heading:wO,hr:Ga,html:kO,lheading:Xx,list:IO,newline:xO,paragraph:NO,table:_i,text:TO},$x=Re("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ga).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wa).getRegex(),PO=Q(H({},lh),{lheading:SO,table:$x,paragraph:Re(sh).replace("hr",Ga).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",$x).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wa).getRegex()}),AO=Q(H({},lh),{html:Re(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ch).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:_i,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Re(sh).replace("hr",Ga).replace("heading",` *#{1,6} *[^
|
|
21
|
-
]`).replace("lheading",Xx).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),RO=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,LO=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,eE=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,FO=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,rr=/[\p{P}\p{S}]/u,xs=/[\s\p{P}\p{S}]/u,Ya=/[^\s\p{P}\p{S}]/u,VO=Re(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,xs).getRegex(),jO=/[\p{Pi}\p{Ps}"']/u,tE=/(?!~)[\p{P}\p{S}]/u,$O=/(?!~)[\s\p{P}\p{S}]/u,HO=/(?:[^\s\p{P}\p{S}]|~)/u,BO=Re(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",bO?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),nE=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,UO=Re(nE,"u").replace(/punct/g,rr).getRegex(),zO=Re(nE,"u").replace(/punct/g,tE).getRegex(),qO=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,GO=Re(qO,"u").replace(/openQuote/g,jO).replace(/punct/g,rr).getRegex(),oE="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",WO=Re(oE,"gu").replace(/notPunctSpace/g,Ya).replace(/punctSpace/g,xs).replace(/punct/g,rr).getRegex(),YO=Re(oE,"gu").replace(/notPunctSpace/g,HO).replace(/punctSpace/g,$O).replace(/punct/g,tE).getRegex(),ZO="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",KO=Re(ZO,"gu").replace(/notPunctSpace/g,Ya).replace(/punctSpace/g,xs).replace(/punct/g,rr).getRegex(),QO=Re("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ya).replace(/punctSpace/g,xs).replace(/punct/g,rr).getRegex(),XO="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",JO=Re(XO,"gu").replace(/notPunctSpace/g,Ya).replace(/punctSpace/g,xs).replace(/punct/g,rr).getRegex(),eP=Re(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,rr).getRegex(),tP="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",nP=Re(tP,"gu").replace(/notPunctSpace/g,Ya).replace(/punctSpace/g,xs).replace(/punct/g,rr).getRegex(),oP=Re(/\\(punct)/,"gu").replace(/punct/g,rr).getRegex(),rP=Re(/^<(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(),iP=Re(ch).replace("(?:-->|$)","-->").getRegex(),sP=Re("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",iP).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),rE=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Hd=Re(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",rE).getRegex(),aP=Re(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Hd).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),cP=Re(/^!?\[(label)\]\[(ref)\]/).replace("label",Hd).replace("ref",ah).getRegex(),lP=Re(/^!?\[(ref)\](?:\[\])?/).replace("ref",ah).getRegex(),Hx=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,dP=Re(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",rE).getRegex(),uP=Re("reflink|nolink(?!\\()","g").replace("reflink",Re(/^!?\[(label)\]\[(ref)\]/).replace("label",dP).replace("ref",Hx).getRegex()).replace("nolink",Re(/^!?\[(ref)\](?:\[\])?/).replace("ref",Hx).getRegex()).getRegex(),Bx=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,pP=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,fP=Re(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,pP).getRegex(),dh={_backpedal:_i,anyPunctuation:oP,autolink:rP,blockSkip:BO,br:eE,code:LO,del:_i,delLDelim:_i,delRDelim:_i,emStrongLDelim:UO,emStrongRDelimAst:WO,emStrongRDelimUnd:QO,escape:RO,link:aP,nolink:lP,punctuation:VO,reflink:cP,reflinkSearch:uP,tag:sP,text:FO,url:_i},mP=Q(H({},dh),{emStrongLDelim:GO,emStrongRDelimAst:KO,emStrongRDelimUnd:JO,link:Re(/^!?\[(label)\]\((.*?)\)/).replace("label",Hd).getRegex(),reflink:Re(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Hd).getRegex()}),th=Q(H({},dh),{emStrongRDelimAst:YO,emStrongLDelim:zO,delLDelim:eP,delRDelim:nP,url:Re(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",fP).replace("protocol",Bx).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Re(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",Bx).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()}),hP=Q(H({},th),{br:Re(eE).replace("{2,}","*").getRegex(),text:Re(th.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),$d={normal:lh,gfm:PO,pedantic:AO},za={normal:dh,gfm:th,breaks:hP,pedantic:mP},gP={"&":"&","<":"<",">":">",'"':""","'":"'"},Ux=t=>gP[t];function Bn(t,e){if(e){if(un.escapeTest.test(t))return t.replace(un.escapeReplace,Ux)}else if(un.escapeTestNoEncode.test(t))return t.replace(un.escapeReplaceNoEncode,Ux);return t}function yP(t){return t.replace(un.numericCharacterReference,(e,n,o)=>{let r=n===void 0?Number.parseInt(o,16):Number.parseInt(n,10);return r===0||r>1114111||r>=55296&&r<=57343?"\uFFFD":String.fromCodePoint(r)})}function zx(t){try{t=encodeURI(t).replace(un.percentDecode,"%")}catch{return null}return t}function qx(t,e){let n=t.replace(un.findPipe,(i,s,a)=>{let c=!1,l=s;for(;--l>=0&&a[l]==="\\";)c=!c;return c?"|":" |"}),o=n.split(un.splitPipe),r=0;if(o[0].trim()||o.shift(),o.length>0&&!o.at(-1)?.trim()&&o.pop(),e)if(o.length>e)o.splice(e);else for(;o.length<e;)o.push("");for(;r<o.length;r++)o[r]=o[r].trim().replace(un.slashPipe,"|");return o}function Mr(t,e,n){let o=t.length;if(o===0)return"";let r=0;for(;r<o;){let i=t.charAt(o-r-1);if(i===e&&!n)r++;else if(i!==e&&n)r++;else break}return t.slice(0,o-r)}function Gx(t){let e=t.split(`
|
|
22
|
-
`),n=e.length-1;for(;n>=0&&un.blankLine.test(e[n]);)n--;return e.length-n<=2?t:e.slice(0,n+1).join(`
|
|
23
|
-
`)}function Bd(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function vP(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let o=0;o<t.length;o++)if(t[o]==="\\")o++;else if(t[o]===e[0])n++;else if(t[o]===e[1]&&(n--,n<0))return o;return n>0?-2:-1}function Wx(t,e=0){let n=e,o="";for(let r of t)if(r===" "){let i=4-n%4;o+=" ".repeat(i),n+=i}else o+=r,n++;return o}function Yx(t,e,n,o,r){let i=e.href,s=e.title||null,a=t[1].replace(r.other.outputLinkReplace,"$1"),c=t[0].charAt(0)==="!";o.state.inLink=!0;let l=o.state.linkEmitted,d=o.state.inRawBlock;o.state.linkEmitted=!1;let f=o.inlineTokens(a),y=o.state.linkEmitted;if(o.state.linkEmitted=l,o.state.inLink=!1,!c){if(y){o.state.inRawBlock=d;return}o.state.linkEmitted=!0}return{type:c?"image":"link",raw:n,href:i,title:s,text:a,tokens:f}}function _P(t,e,n){let o=t.match(n.other.indentCodeCompensation);if(o===null)return e;let r=o[1];return e.split(`
|
|
24
|
-
`).map(i=>{let s=i.match(n.other.beginningSpace);if(s===null)return i;let[a]=s;return i.slice(Math.min(a.length,r.length))}).join(`
|
|
25
|
-
`)}function Zx(t,e,n,o){if(!e.includes("<"))return!1;for(let r=0;r<e.length;r++){if(e[r]==="\\"){r++;continue}if(e[r]==="`"){let a=o.inline.code.exec(e.slice(r));if(a){r+=a[0].length-1;continue}}if(e[r]!=="<")continue;let i=t.slice(n+r),s=o.inline.tag.exec(i)||o.inline.autolink.exec(i);if(s){if(s[0].length>e.length-r)return!0;r+=s[0].length-1}}return!1}var Ud=class{options;rules;lexer;constructor(t){this.options=t||xi}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=this.options.pedantic?e[0]:Gx(e[0]),o=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:o}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],o=_P(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:o}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let o=Mr(n,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceTabChar.test(o))&&(n=o.trim())}return{type:"heading",raw:Mr(e[0],`
|
|
26
|
-
`),depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Mr(e[0],`
|
|
27
|
-
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=Mr(e[0],`
|
|
28
|
-
`).split(`
|
|
29
|
-
`),o="",r="",i=[];for(;n.length>0;){let s=!1,a=[],c;for(c=0;c<n.length;c++)if(this.rules.other.blockquoteStart.test(n[c]))a.push(n[c]),s=!0;else if(!s)a.push(n[c]);else break;n=n.slice(c);let l=a.join(`
|
|
30
|
-
`),d=l.replace(this.rules.other.blockquoteSetextReplace,`
|
|
31
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
|
|
32
|
-
${l}`:l,r=r?`${r}
|
|
33
|
-
${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,i,!0),this.lexer.state.top=f,n.length===0)break;let y=i.at(-1);if(y?.type==="code")break;if(y?.type==="blockquote"){let v=y,x=n.join(`
|
|
34
|
-
`),C=v.raw+`
|
|
35
|
-
`+x.replace(this.rules.other.blockquoteSetextReplace2,""),P=this.blockquote(C);i[i.length-1]=P;let Y=C.substring(P.raw.length).replace(/^\n/,""),G=Y?Y.split(`
|
|
36
|
-
`).length:0,ve=G?n.slice(0,-G):n;ve.length>0&&(o=`${o}
|
|
37
|
-
${ve.join(`
|
|
38
|
-
`)}`),r=r.substring(0,r.length-v.text.length)+P.text;break}else if(y?.type==="list"){let v=y,x=v.raw+`
|
|
39
|
-
`+n.join(`
|
|
40
|
-
`),C=this.list(x);i[i.length-1]=C,o=o.substring(0,o.length-y.raw.length)+C.raw,r=r.substring(0,r.length-v.raw.length)+C.raw,n=x.substring(i.at(-1).raw.length).split(`
|
|
41
|
-
`);continue}}return{type:"blockquote",raw:o,tokens:i,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),o=n.length>1,r={type:"list",raw:"",ordered:o,start:o?+n.slice(0,-1):"",loose:!1,items:[]};n=o?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=o?n:"[*+-]");let i=this.rules.other.listItemRegex(n),s=!1;for(;t;){let c=!1,l="",d="";if(!(e=i.exec(t))||this.rules.block.hr.test(t))break;l=e[0],t=t.substring(l.length);let f=e[2].split(`
|
|
42
|
-
`,1)[0],y=e[1].length,v=this.options.pedantic?Wx(f,y):f.replace(this.rules.other.leadingSpaceTab,Y=>Wx(Y,y)),x=t.split(`
|
|
43
|
-
`,1)[0],C=!v.trim(),P=0;if(this.options.pedantic?(P=2,d=v.trimStart()):C?P=y+1:(P=v.search(this.rules.other.nonSpaceChar),P=P>4?1:P,d=v.slice(P),P+=y),C&&this.rules.other.blankLine.test(x)&&(l+=x+`
|
|
44
|
-
`,t=t.substring(x.length+1),c=!0),!c){let Y=this.rules.other.nextBulletRegex(P),G=this.rules.other.hrRegex(P),ve=this.rules.other.fencesBeginRegex(P),le=this.rules.other.headingBeginRegex(P),Ee=this.rules.other.htmlBeginRegex(P),ie=this.rules.other.blockquoteBeginRegex(P);for(;t;){let Qe=t.split(`
|
|
45
|
-
`,1)[0],Le;if(x=Qe,this.options.pedantic?(x=x.replace(this.rules.other.listReplaceNesting," "),Le=x):Le=x.replace(this.rules.other.leadingSpaceTab,He=>He.replace(this.rules.other.tabCharGlobal," ")),ve.test(x)||le.test(x)||Ee.test(x)||ie.test(x)||Y.test(x)||G.test(x))break;if(Le.search(this.rules.other.nonSpaceChar)>=P||!x.trim())d+=`
|
|
46
|
-
`+Le.slice(P);else{if(C||v.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ve.test(v)||le.test(v)||G.test(v))break;d+=`
|
|
47
|
-
`+x}C=!x.trim(),l+=Qe+`
|
|
48
|
-
`,t=t.substring(Qe.length+1),v=Le.slice(P)}}r.loose||(s?r.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(s=!0)),r.items.push({type:"list_item",raw:l,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),r.raw+=l}let a=r.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let c of r.items)if(this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]),!r.loose){let l=c.tokens.filter(f=>f.type==="space"),d=l.length>0&&l.some(f=>this.rules.other.anyLine.test(f.raw));r.loose=d}for(let c of r.items){let l=c.tokens[0];if(c.task&&(l?.type==="text"||l?.type==="paragraph")){c.text=c.text.replace(this.rules.other.listReplaceTask,""),l.raw=l.raw.replace(this.rules.other.listReplaceTask,""),l.text=l.text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}let d=this.rules.other.listTaskCheckbox.exec(c.raw);if(d){let f={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};c.checked=f.checked,r.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=f.raw+c.tokens[0].raw,c.tokens[0].text=f.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(f)):c.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):c.tokens.unshift(f)}}else c.task&&(c.task=!1)}if(r.loose)for(let c of r.items){c.loose=!0;for(let l of c.tokens)l.type==="text"&&(l.type="paragraph")}return r}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=Gx(e[0]);return{type:"html",block:!0,raw:n,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:n}}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=Bd(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:Mr(e[0],`
|
|
49
|
-
`),href:o,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=qx(e[1]),o=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
50
|
-
`):[],i={type:"table",raw:Mr(e[0],`
|
|
51
|
-
`),header:[],align:[],rows:[]};if(n.length===o.length){for(let s of o)this.rules.other.tableAlignRight.test(s)?i.align.push("right"):this.rules.other.tableAlignCenter.test(s)?i.align.push("center"):this.rules.other.tableAlignLeft.test(s)?i.align.push("left"):i.align.push(null);for(let s=0;s<n.length;s++)i.header.push({text:n[s],tokens:this.lexer.inline(n[s]),header:!0,align:i.align[s]});for(let s of r)i.rows.push(qx(s,i.header.length).map((a,c)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:i.align[c]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:Mr(e[0],`
|
|
52
|
-
`),depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
|
|
53
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Zx(t,e[1],n,this.rules))return;let o=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(o)){if(!this.rules.other.endAngleBracket.test(o))return;let s=Mr(o.slice(0,-1),"\\");if((o.length-s.length)%2===0)return}else{let s=vP(e[2],"()");if(s===-2)return;if(s>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(o)?r=r.slice(1):r=r.slice(1,-1)),Yx(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let o=n[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Zx(t,n[1],o,this.rules))return;let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[Bd(r)];if(!i){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return Yx(n,i,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let o=this.rules.inline.emStrongLDelim.exec(t);if(!(!o||!o[1]&&!o[2]&&!o[3]&&!o[4]||o[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[3])||!n||this.rules.inline.punctuation.exec(n))){let r=[...o[0]].length-1,i,s,a=r,c=0,l=o[0][0],d=n===l,f=l==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,e=e.slice(-1*t.length+r);(o=f.exec(e))!==null;){if(i=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!i)continue;if(s=[...i].length,o[3]||o[4]){a+=s;continue}else if(o[5]||o[6]){if(r%3&&!((r+s)%3)){c+=s;continue}if(d)break}if(a-=s,a>0)continue;s=Math.min(s,s+a+c);let y=[...o[0]][0].length,v=t.slice(0,r+o.index+y+s);if(Math.min(r,s)%2){let C=v.slice(1,-1);return{type:"em",raw:v,text:C,tokens:this.lexer.inlineTokens(C)}}let x=v.slice(2,-2);return{type:"strong",raw:v,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return o&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let o=this.rules.inline.delLDelim.exec(t);if(o&&(!o[1]||!n||this.rules.inline.punctuation.exec(n))){let r=[...o[0]].length-1,i,s,a=r,c=this.rules.inline.delRDelim;for(c.lastIndex=0,e=e.slice(-1*t.length+r);(o=c.exec(e))!==null;){if(i=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!i||(s=[...i].length,s!==r))continue;if(o[3]||o[4]){a+=s;continue}if(a-=s,a>0)continue;s=Math.min(s,s+a);let l=[...o[0]][0].length,d=t.slice(0,r+o.index+l+s),f=d.slice(r,-r);return{type:"del",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,o;return e[2]==="@"?(n=e[1],o="mailto:"+n):(n=e[1],o=n),{type:"link",raw:e[0],text:n,href:o,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,o;if(e[2]==="@")n=e[0],o="mailto:"+n;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);n=e[0],e[1]==="www."?o="http://"+e[0]:o=e[0]}return{type:"link",raw:e[0],text:n,href:o,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:n?e[0]:yP(e[0]),escaped:n}}}},_o=class nh{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||xi,this.options.tokenizer=this.options.tokenizer||new Ud,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let n={other:un,block:$d.normal,inline:za.normal};this.options.pedantic?(n.block=$d.pedantic,n.inline=za.pedantic):this.options.gfm&&(n.block=$d.gfm,this.options.breaks?n.inline=za.breaks:n.inline=za.gfm),this.tokenizer.rules=n}static get rules(){return{block:$d,inline:za}}static lex(e,n){return new nh(n).lex(e)}static lexInline(e,n){return new nh(n).inlineTokens(e)}lex(e){e=e.replace(un.carriageReturn,`
|
|
54
|
-
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let o=this.inlineQueue[n];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],o=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(un.tabCharGlobal," ").replace(un.spaceLine,""));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(a=>(i=a.call({lexer:this},e,n))?(e=e.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let a=n.at(-1);i.raw.length===1&&a!==void 0?a.raw+=`
|
|
55
|
-
`:n.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
56
|
-
`)?"":`
|
|
57
|
-
`)+i.raw,a.text+=`
|
|
58
|
-
`+i.text,this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
59
|
-
`)?"":`
|
|
60
|
-
`)+i.raw,a.text+=`
|
|
61
|
-
`+i.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},n.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),n.push(i);continue}let s=e;if(this.options.extensions?.startBlock){let a=1/0,c=e.slice(1),l;this.options.extensions.startBlock.forEach(d=>{l=d.call({lexer:this},c),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(s=e.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s))){let a=n.at(-1);o&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
|
|
62
|
-
`)?"":`
|
|
63
|
-
`)+i.raw,a.text+=`
|
|
64
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i),o=s.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let a=n.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
65
|
-
`)?"":`
|
|
66
|
-
`)+i.raw,a.text+=`
|
|
67
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}linkInText(e){if(!e.includes("["))return!1;let n=this.tokenizer.rules.inline.link;for(let o of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(n.test(o[0])&&e.charAt(o.index-1)!=="!")return!0;for(let o of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let r=o[0],i=r.lastIndexOf("[");if(!(r.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,Bd(r.slice(i+1,-1))))&&!(i>1&&this.linkInText(r.slice(1,i-1))))return!0}return!1}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let o=e;if(this.tokens.links&&e.includes("[")){let a=this.tokenizer.rules.inline.reflinkSearch,c=l=>{let d=l.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,Bd(l.slice(d+1,-1))))return l;if(d>1&&l.charAt(0)!=="!"){let f=l.slice(1,d-1);if(this.linkInText(f))return"["+f.replace(a,c)+"]["+"a".repeat(l.length-d-2)+"]"}return"["+"a".repeat(l.length-2)+"]"};o=o.replace(a,c)}o=o.replace(this.tokenizer.rules.inline.anyPunctuation,a=>"+".repeat(a.length)),o=o.replace(this.tokenizer.rules.inline.blockSkip,(a,c,l)=>{let d=l?l.length:0;return a.slice(0,d)+"["+"a".repeat(a.length-d-2)+"]"}),o=this.options.hooks?.emStrongMask?.call({lexer:this},o)??o;let r=!1,i="",s=1/0;for(;e;){if(e.length<s)s=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=""),r=!1;let a;if(this.options.extensions?.inline?.some(l=>(a=l.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let l=n.at(-1);a.type==="text"&&l?.type==="text"?(l.raw+=a.raw,l.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,o,i)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(e,o,i)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),n.push(a);continue}let c=e;if(this.options.extensions?.startInline){let l=1/0,d=e.slice(1),f;this.options.extensions.startInline.forEach(y=>{f=y.call({lexer:this},d),typeof f=="number"&&f>=0&&(l=Math.min(l,f))}),l<1/0&&l>=0&&(c=e.substring(0,l+1))}if(a=this.tokenizer.inlineText(c)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(i=a.raw.slice(-1)),r=!0;let l=n.at(-1);l?.type==="text"?(l.raw+=a.raw,l.text+=a.text):n.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}infiniteLoopError(e){let n="Infinite loop on byte: "+e;if(this.options.silent)console.error(n);else throw new Error(n)}},zd=class{options;parser;constructor(t){this.options=t||xi}space(t){return""}code({text:t,lang:e,escaped:n}){let o=(e||"").match(un.notSpaceStart)?.[0],r=t?t.replace(un.endingNewline,"")+`
|
|
68
|
-
`:"";return o?'<pre><code class="language-'+Bn(o)+'">'+(n?r:Bn(r,!0))+`</code></pre>
|
|
69
|
-
`:"<pre><code>"+(n?r:Bn(r,!0))+`</code></pre>
|
|
70
|
-
`}blockquote({tokens:t}){return`<blockquote>
|
|
71
|
-
${this.parser.parse(t)}</blockquote>
|
|
72
|
-
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
73
|
-
`}hr(t){return`<hr>
|
|
74
|
-
`}list(t){let e=t.ordered,n=t.start,o="";for(let s=0;s<t.items.length;s++){let a=t.items[s];o+=this.listitem(a)}let r=e?"ol":"ul",i=e&&n!==1?' start="'+n+'"':"";return"<"+r+i+`>
|
|
75
|
-
`+o+"</"+r+`>
|
|
76
|
-
`}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
|
|
77
|
-
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
78
|
-
`}table(t){let e="",n="";for(let r=0;r<t.header.length;r++)n+=this.tablecell(t.header[r]);e+=this.tablerow({text:n});let o="";for(let r=0;r<t.rows.length;r++){let i=t.rows[r];n="";for(let s=0;s<i.length;s++)n+=this.tablecell(i[s]);o+=this.tablerow({text:n})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
|
|
79
|
-
<thead>
|
|
80
|
-
`+e+`</thead>
|
|
81
|
-
`+o+`</table>
|
|
82
|
-
`}tablerow({text:t}){return`<tr>
|
|
83
|
-
${t}</tr>
|
|
84
|
-
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
85
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Bn(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,text:n,tokens:o,autolink:r}){let i=r?Bn(n,!0):this.parser.parseInline(o),s=zx(t);if(s===null)return i;t=Bn(s,r);let a='<a href="'+t+'"';return e&&(a+=' title="'+Bn(e)+'"'),a+=">"+i+"</a>",a}image({href:t,title:e,text:n,tokens:o}){o&&(n=this.parser.parseInline(o,this.parser.textRenderer));let r=zx(t);if(r===null)return Bn(n);t=r;let i=`<img src="${Bn(t)}" alt="${Bn(n)}"`;return e&&(i+=` title="${Bn(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Bn(t.text)}},uh=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},bo=class oh{options;renderer;textRenderer;constructor(e){this.options=e||xi,this.options.renderer=this.options.renderer||new zd,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new uh}static parse(e,n){return new oh(n).parse(e)}static parseInline(e,n){return new oh(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let o=0;o<e.length;o++){let r=e[o];if(this.options.extensions?.renderers?.[r.type]){let s=r,a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(s.type)){n+=a||"";continue}}let i=r;switch(i.type){case"space":{n+=this.renderer.space(i);break}case"hr":{n+=this.renderer.hr(i);break}case"heading":{n+=this.renderer.heading(i);break}case"code":{n+=this.renderer.code(i);break}case"table":{n+=this.renderer.table(i);break}case"blockquote":{n+=this.renderer.blockquote(i);break}case"list":{n+=this.renderer.list(i);break}case"checkbox":{n+=this.renderer.checkbox(i);break}case"html":{n+=this.renderer.html(i);break}case"def":{n+=this.renderer.def(i);break}case"paragraph":{n+=this.renderer.paragraph(i);break}case"text":{n+=this.renderer.text(i);break}default:{let s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let o="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(i.type)){o+=a||"";continue}}let s=i;switch(s.type){case"escape":{o+=n.text(s);break}case"html":{o+=n.html(s);break}case"link":{o+=n.link(s);break}case"image":{o+=n.image(s);break}case"checkbox":{o+=n.checkbox(s);break}case"strong":{o+=n.strong(s);break}case"em":{o+=n.em(s);break}case"codespan":{o+=n.codespan(s);break}case"br":{o+=n.br(s);break}case"del":{o+=n.del(s);break}case"text":{o+=n.text(s);break}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return o}},qa=class{options;block;constructor(t){this.options=t||xi}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?_o.lex:_o.lexInline}provideParser(t=this.block){return t?bo.parse:bo.parseInline}},qd=class{defaults=rh();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=bo;Renderer=zd;TextRenderer=uh;Lexer=_o;Tokenizer=Ud;Hooks=qa;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let o of t)switch(n=n.concat(e.call(this,o)),o.type){case"table":{let r=o;for(let i of r.header)n=n.concat(this.walkTokens(i.tokens,e));for(let i of r.rows)for(let s of i)n=n.concat(this.walkTokens(s.tokens,e));break}case"list":{let r=o;n=n.concat(this.walkTokens(r.items,e));break}default:{let r=o;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(i=>{let s=r[i].flat(1/0);n=n.concat(this.walkTokens(s,e))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let o=H({},n);if(o.async=this.defaults.async||o.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let i=e.renderers[r.name];i?e.renderers[r.name]=function(...s){let a=r.renderer.apply(this,s);return a===!1&&(a=i.apply(this,s)),a}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[r.level];i?i.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),o.extensions=e),n.renderer){let r=this.defaults.renderer||new zd(this.defaults);for(let i in n.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let s=i,a=n.renderer[s],c=r[s];r[s]=(...l)=>{let d=a.apply(r,l);return d===!1&&(d=c.apply(r,l)),d||""}}o.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new Ud(this.defaults);for(let i in n.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let s=i,a=n.tokenizer[s],c=r[s];r[s]=(...l)=>{let d=a.apply(r,l);return d===!1&&(d=c.apply(r,l)),d}}o.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new qa;for(let i in n.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let s=i,a=n.hooks[s],c=r[s];qa.passThroughHooks.has(i)?r[s]=l=>{if(this.defaults.async&&qa.passThroughHooksRespectAsync.has(i))return(async()=>{let f=await a.call(r,l);return c.call(r,f)})();let d=a.call(r,l);return c.call(r,d)}:r[s]=(...l)=>{if(this.defaults.async)return(async()=>{let f=await a.apply(r,l);return f===!1&&(f=await c.apply(r,l)),f})();let d=a.apply(r,l);return d===!1&&(d=c.apply(r,l)),d}}o.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,i=n.walkTokens;o.walkTokens=function(s){let a=[];return a.push(i.call(this,s)),r&&(a=a.concat(r.call(this,s))),a}}this.defaults=H(H({},this.defaults),o)}),this}setOptions(t){return this.defaults=H(H({},this.defaults),t),this}lexer(t,e){return _o.lex(t,e??this.defaults)}parser(t,e){return bo.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let o=H({},n),r=H(H({},this.defaults),o),i=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&o.async===!1)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"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let s=r.hooks?await r.hooks.preprocess(e):e,a=await(r.hooks?await r.hooks.provideLexer(t):t?_o.lex:_o.lexInline)(s,r),c=r.hooks?await r.hooks.processAllTokens(a):a;r.walkTokens&&await Promise.all(this.walkTokens(c,r.walkTokens));let l=await(r.hooks?await r.hooks.provideParser(t):t?bo.parse:bo.parseInline)(c,r);return r.hooks?await r.hooks.postprocess(l):l})().catch(i);try{r.hooks&&(e=r.hooks.preprocess(e));let s=(r.hooks?r.hooks.provideLexer(t):t?_o.lex:_o.lexInline)(e,r);r.hooks&&(s=r.hooks.processAllTokens(s)),r.walkTokens&&this.walkTokens(s,r.walkTokens);let a=(r.hooks?r.hooks.provideParser(t):t?bo.parse:bo.parseInline)(s,r);return r.hooks&&(a=r.hooks.postprocess(a)),a}catch(s){return i(s)}}}onError(t,e){return n=>{if(n.message+=`
|
|
86
|
-
Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+Bn(n.message+"",!0)+"</pre>";return e?Promise.resolve(o):o}if(e)return Promise.reject(n);throw n}}},bi=new qd;function xt(t,e){return bi.parse(t,e)}xt.options=xt.setOptions=function(t){return bi.setOptions(t),xt.defaults=bi.defaults,Kx(xt.defaults),xt};xt.getDefaults=rh;xt.defaults=xi;function bP(...t){return bi.use(...t),xt.defaults=bi.defaults,Kx(xt.defaults),xt}xt.use=bP;xt.walkTokens=function(t,e){return bi.walkTokens(t,e)};xt.parseInline=bi.parseInline;xt.Parser=bo;xt.parser=bo.parse;xt.Renderer=zd;xt.TextRenderer=uh;xt.Lexer=_o;xt.lexer=_o.lex;xt.Tokenizer=Ud;xt.Hooks=qa;xt.parse=xt;var EW=xt.options,CW=xt.setOptions,wW=xt.walkTokens,SW=xt.parseInline;var TW=bo.parse,MW=_o.lex;for(let[t,e]of Object.entries({bash:yx,css:vx,diff:_x,go:bx,javascript:Sx,json:Tx,markdown:Mx,php:Ix,python:kx,typescript:Fx,xml:Vx,yaml:jx}))Vd.registerLanguage(t,e);var xP={sh:"bash",shell:"bash",zsh:"bash",js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",html:"xml",svg:"xml",md:"markdown",yml:"yaml"};function iE(){return{code({text:t,lang:e}){let n=(e??"").trim().toLowerCase(),o=xP[n]??n,i=o.length>0&&Vd.getLanguage(o)!==void 0?Vd.highlight(t,{language:o,ignoreIllegals:!0}).value:TP(t);return`<div class="code"><div class="code-head"><span class="code-lang">${o.length>0?o:"text"}</span><button type="button" class="copy" data-copy>Copy</button></div><pre><code class="hljs">${i}</code></pre></div>`},link({href:t,title:e,tokens:n}){let o=this.parser.parseInline(n),r=t.replace(/"/g,"""),i=e?` title="${e.replace(/"/g,""")}"`:"";return`<a href="${r}"${i} target="_blank" rel="noreferrer noopener">${o}</a>`}}}var sE=new qd({gfm:!0,breaks:!1});sE.use({renderer:iE()});var aE=new qd({gfm:!0,breaks:!0});aE.use({renderer:iE()});var EP=new Map,CP=new Map,wP=200;function SP(t){return Zb.sanitize(t,{USE_PROFILES:{html:!0},FORBID_TAGS:["style","form","input","iframe"],ADD_ATTR:["target","rel","data-copy","data-mention-path","data-mention-start","data-mention-end"]})}function cE(t,e,n){let o=t.get(n);if(o!==void 0)return o;let r=SP(e.parse(n,{async:!1}));if(t.size>=wP){let i=t.keys().next().value;i!==void 0&&t.delete(i)}return t.set(n,r),r}function lE(t){return cE(EP,sE,t)}function dE(t){return cE(CP,aE,t)}function TP(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}var MP=90,Gd=class t{text=ee.required();variant=ee("assistant");mention=rt();sanitizer=N(um);painted=R(null);pending;timer;html=S(()=>{let e=this.painted()??this.text();return this.sanitizer.bypassSecurityTrustHtml(this.variant()==="user"?dE(e):lE(e))});constructor(){ue(()=>{let e=this.text(),n=ma(()=>this.painted());if(n===null){this.painted.set(e);return}n===e||this.pending===e||(this.pending=e,this.schedule())}),N(ht).onDestroy(()=>this.cancel())}schedule(){this.timer??=setTimeout(()=>{this.timer=void 0;let e=this.pending;this.pending=void 0,e!==void 0&&this.painted.set(e)},MP)}cancel(){clearTimeout(this.timer),this.timer=void 0}onClick(e){let n=e.target,o=n?.closest("[data-mention-path]")?.getAttribute("data-mention-path");if(o){this.mention.emit(o);return}let r=n?.closest("button[data-copy]");if(!(r instanceof HTMLButtonElement))return;let s=r.closest(".code")?.querySelector("code")?.textContent??"";navigator.clipboard?.writeText(s);let a=r.textContent;r.textContent="Copied",setTimeout(()=>{r.textContent=a??"Copy"},1200)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-markdown"]],inputs:{text:[1,"text"],variant:[1,"variant"]},outputs:{mention:"mention"},decls:1,vars:1,consts:[[1,"md",3,"click","innerHTML"]],template:function(n,o){n&1&&(b(0,"div",0),q("click",function(i){return o.onClick(i)}),E()),n&2&&Ae("innerHTML",o.html(),kf)},styles:["[_nghost-%COMP%]{display:block}"]})};var IP=["list"],uE=(t,e)=>e.key;function kP(t,e){t&1&&we(0,"span",4)}function NP(t,e){if(t&1&&p(0),t&2){let n=h();ce(" ",n.state()==="error"?"\u2717":"\u2713"," ")}}function DP(t,e){t&1&&(g(0,"span",5),we(1,"i")(2,"i")(3,"i"),_())}function OP(t,e){t&1&&we(0,"span",4)}function PP(t,e){t&1&&(g(0,"span",12),p(1,"\u2717"),_())}function AP(t,e){t&1&&(g(0,"span",13),p(1,"\u2713"),_())}function RP(t,e){if(t&1&&(g(0,"span",22),p(1),_()),t&2){let n=h();u(),ce("+",n.added)}}function LP(t,e){if(t&1&&(g(0,"span",23),p(1),_()),t&2){let n=h();u(),ce("\u2212",n.removed)}}function FP(t,e){if(t&1&&(g(0,"span",17),T(1,RP,2,1,"span",22),T(2,LP,2,1,"span",23),_()),t&2){let n=e;u(),M(n.added>0?1:-1),u(),M(n.removed>0?2:-1)}}function VP(t,e){t&1&&(g(0,"span",5),we(1,"i")(2,"i")(3,"i"),_())}function jP(t,e){t&1&&(g(0,"span",19),p(1),_()),t&2&&(u(),D(e))}function $P(t,e){if(t&1&&(g(0,"ul",20)(1,"li",24),Tt(),g(2,"svg",25),we(3,"path",26)(4,"path",27),_(),fn(),g(5,"span",28),p(6),_()()()),t&2){let n=e,o=h(4);u(5),K("title",n),u(),D(o.basename(n))}}function HP(t,e){if(t&1&&(g(0,"span",29),p(1,"input"),_(),g(2,"pre"),p(3),_()),t&2){let n=h(3).$implicit;u(3),D(n.item.input)}}function BP(t,e){if(t&1&&(g(0,"span",29),p(1,"output"),_(),g(2,"pre"),p(3),_()),t&2){let n=h(3).$implicit;u(3),D(n.item.output)}}function UP(t,e){t&1&&(g(0,"span",29),p(1,"no details reported"),_())}function zP(t,e){if(t&1&&(g(0,"div",21),T(1,HP,4,1),T(2,BP,4,1),T(3,UP,2,0,"span",29),_()),t&2){let n=h(2).$implicit;pe("data-body",n.key),u(),M(n.item.input?1:-1),u(),M(n.item.output?2:-1),u(),M(!n.item.input&&!n.item.output?3:-1)}}function qP(t,e){if(t&1){let n=z();g(0,"button",10),L("click",function(){I(n);let r=h().$implicit,i=h(2);return k(i.toggleStep(r.key))}),g(1,"span",11),T(2,OP,1,0,"span",4)(3,PP,2,0,"span",12)(4,AP,2,0,"span",13),_(),g(5,"span",14),p(6),_(),g(7,"span",15),p(8),_(),g(9,"span",16),p(10),_(),T(11,FP,3,2,"span",17),we(12,"span",18),T(13,VP,4,0,"span",5),T(14,jP,2,1,"span",19),g(15,"span",6),p(16,"\u203A"),_()(),T(17,$P,7,2,"ul",20),T(18,zP,4,4,"div",21)}if(t&2){let n,o,r,i=h().$implicit,s=h(2);pe("aria-expanded",s.isStepOpen(i.key)),u(),vo(i.item.status),u(),M(i.item.status==="running"?2:i.item.status==="error"?3:4),u(3),vo(s.glyphClass(i.item)),u(),D(s.glyph(i.item)),u(2),D(s.verb(i.item)),u(),K("title",i.item.title),u(),D(s.compactTarget(i.item)),u(),M((n=s.diff(i.item))?11:-1,n),u(2),M(i.item.status==="running"?13:-1),u(),M((o=s.elapsed(i.item))?14:-1,o),u(),Te("open",s.isStepOpen(i.key)),u(2),M((r=s.fileOf(i.item))?17:-1,r),u(),M(s.isStepOpen(i.key)?18:-1)}}function GP(t,e){if(t&1&&(g(0,"div",21)(1,"pre"),p(2),_()()),t&2){let n=h(2).$implicit;pe("data-body",n.key),u(2),D(n.item.thinking)}}function WP(t,e){if(t&1){let n=z();g(0,"button",10),L("click",function(){I(n);let r=h().$implicit,i=h(2);return k(i.toggleStep(r.key))}),g(1,"span",30),p(2,"\u273B"),_(),g(3,"span",15),p(4,"Thinking"),_(),g(5,"span",31),p(6),_(),we(7,"span",18),g(8,"span",6),p(9,"\u203A"),_()(),T(10,GP,3,2,"div",21)}if(t&2){let n=h().$implicit,o=h(2);pe("aria-expanded",o.isStepOpen(n.key)),u(6),D(o.preview(n.item.thinking)),u(2),Te("open",o.isStepOpen(n.key)),u(2),M(o.isStepOpen(n.key)?10:-1)}}function YP(t,e){if(t&1&&(g(0,"li",9),T(1,qP,19,17)(2,WP,11,5),_()),t&2){let n=e.$implicit;u(),M(n.kind==="tool"?1:2)}}function ZP(t,e){if(t&1&&(g(0,"ul",7),_e(1,YP,3,1,"li",9,uE),_()),t&2){let n=h();u(),be(n.compactSteps())}}function KP(t,e){t&1&&we(0,"span",4)}function QP(t,e){t&1&&(g(0,"span",12),p(1,"\u2717"),_())}function XP(t,e){t&1&&(g(0,"span",13),p(1,"\u2713"),_())}function JP(t,e){if(t&1&&(g(0,"span",22),p(1),_()),t&2){let n=h();u(),ce("+",n.added)}}function eA(t,e){if(t&1&&(g(0,"span",23),p(1),_()),t&2){let n=h();u(),ce("\u2212",n.removed)}}function tA(t,e){if(t&1&&(g(0,"span",17),T(1,JP,2,1,"span",22),T(2,eA,2,1,"span",23),_()),t&2){let n=e;u(),M(n.added>0?1:-1),u(),M(n.removed>0?2:-1)}}function nA(t,e){t&1&&(g(0,"span",5),we(1,"i")(2,"i")(3,"i"),_())}function oA(t,e){t&1&&(g(0,"span",19),p(1),_()),t&2&&(u(),D(e))}function rA(t,e){if(t&1&&(g(0,"span",29),p(1,"input"),_(),g(2,"pre"),p(3),_()),t&2){let n=h(3).$implicit;u(3),D(n.item.input)}}function iA(t,e){if(t&1&&(g(0,"span",29),p(1,"output"),_(),g(2,"pre"),p(3),_()),t&2){let n=h(3).$implicit;u(3),D(n.item.output)}}function sA(t,e){t&1&&(g(0,"span",29),p(1,"no details reported"),_())}function aA(t,e){if(t&1&&(g(0,"div",21),T(1,rA,4,1),T(2,iA,4,1),T(3,sA,2,0,"span",29),_()),t&2){let n=h(2).$implicit;pe("data-body",n.key),u(),M(n.item.input?1:-1),u(),M(n.item.output?2:-1),u(),M(!n.item.input&&!n.item.output?3:-1)}}function cA(t,e){if(t&1){let n=z();g(0,"div",35)(1,"button",36),L("click",function(){I(n);let r=h().$implicit,i=h(2);return k(i.toggleStep(r.key))}),g(2,"span",11),T(3,KP,1,0,"span",4)(4,QP,2,0,"span",12)(5,XP,2,0,"span",13),_(),g(6,"span",14),p(7),_(),g(8,"span",37),p(9),_(),g(10,"span",38)(11,"span",39),p(12),_(),g(13,"span",40),p(14),_()(),T(15,tA,3,2,"span",17),we(16,"span",18),T(17,nA,4,0,"span",5),T(18,oA,2,1,"span",19),g(19,"span",6),p(20,"\u203A"),_()(),T(21,aA,4,4,"div",21),_()}if(t&2){let n,o,r=h().$implicit,i=h(2);Te("running",r.item.status==="running")("failed",r.item.status==="error"),u(),pe("aria-expanded",i.isStepOpen(r.key)),u(),vo(r.item.status),u(),M(r.item.status==="running"?3:r.item.status==="error"?4:5),u(3),vo(i.glyphClass(r.item)),u(),D(i.glyph(r.item)),u(2),D(r.item.name),u(),K("title",r.item.title),u(2),D(i.target(r.item).dir),u(2),D(i.target(r.item).base),u(),M((n=i.diff(r.item))?15:-1,n),u(2),M(r.item.status==="running"?17:-1),u(),M((o=i.elapsed(r.item))?18:-1,o),u(),Te("open",i.isStepOpen(r.key)),u(2),M(i.isStepOpen(r.key)?21:-1)}}function lA(t,e){if(t&1&&(g(0,"div",21)(1,"pre"),p(2),_()()),t&2){let n=h(2).$implicit;pe("data-body",n.key),u(2),D(n.item.thinking)}}function dA(t,e){if(t&1){let n=z();g(0,"div",34)(1,"button",36),L("click",function(){I(n);let r=h().$implicit,i=h(2);return k(i.toggleStep(r.key))}),g(2,"span",11)(3,"span",41),p(4,"\u273B"),_()(),g(5,"span",42),p(6,"thinking"),_(),g(7,"span",43),p(8),_(),g(9,"span",6),p(10,"\u203A"),_()(),T(11,lA,3,2,"div",21),_()}if(t&2){let n=h().$implicit,o=h(2);u(),pe("aria-expanded",o.isStepOpen(n.key)),u(7),D(o.preview(n.item.thinking)),u(),Te("open",o.isStepOpen(n.key)),u(2),M(o.isStepOpen(n.key)?11:-1)}}function uA(t,e){if(t&1&&(g(0,"li",32),T(1,cA,22,21,"div",33)(2,dA,12,5,"div",34),_()),t&2){let n,o=e.$implicit,r=e.$index;K("morseEnter",r)("morseEnterY",6),u(),M((n=o.kind)==="tool"?1:n==="thinking"?2:-1)}}function pA(t,e){if(t&1&&(g(0,"ul",8,0),_e(2,uA,3,3,"li",32,uE),_()),t&2){let n=h();u(2),be(n.steps())}}var Yd=class t{steps=ee.required();working=ee(!1);animation=N(gn);display=N(hs);host=N(Zt);list=at("list");openSteps=R({});override=R(null);tick=R(0);tools=S(()=>this.steps().filter(e=>e.kind==="tool"));thoughts=S(()=>this.steps().filter(e=>e.kind==="thinking").length);running=S(()=>this.tools().some(e=>e.item.status==="running"));failed=S(()=>this.tools().some(e=>e.item.status==="error"));compact=S(()=>this.display.toolDisplay()==="compact");compactSteps=S(()=>{let e=this.steps();if(this.isOpen())return e;let n=e.at(-1);return n===void 0?[]:[n]});autoOpen=S(()=>this.compact()?!1:this.working()||this.running());isOpen=S(()=>this.override()??this.autoOpen());state=S(()=>this.running()?"running":this.failed()?"error":"ok");summary=S(()=>{let e=this.tools().length,n=this.thoughts(),o=e===1?"action":"actions",r=n>0?` \xB7 ${n} ${n===1?"thought":"thoughts"}`:"",i=this.totalMs();return this.running()?i>0?`Working for ${Wd(i)} \xB7 ${e} ${o}${r}`:`Working\u2026 \xB7 ${e} ${o}${r}`:i>0?`Worked for ${Wd(i)} \xB7 ${e} ${o}${r}`:`${e} ${o}${r}`});constructor(){ue(n=>{if(!this.running())return;let o=setInterval(()=>this.tick.update(r=>r+1),500);n(()=>clearInterval(o))}),ue(()=>{this.autoOpen(),this.override.set(null)});let e=!1;ue(n=>{let o=this.isOpen(),r=e;e=!0;let i=setTimeout(()=>{this.animation.reveal(this.list()?.nativeElement??null,o,{animate:r})},0);n(()=>clearTimeout(i))})}toggle(){this.override.set(!this.isOpen())}toggleStep(e){let n=!this.isStepOpen(e);this.openSteps.update(o=>Q(H({},o),{[e]:n})),setTimeout(()=>{let o=this.host.nativeElement.querySelector(`[data-body="${CSS.escape(e)}"]`);o&&this.animation.reveal(o,n,{animate:!0})},0)}isStepOpen(e){return this.openSteps()[e]===!0}preview(e){let n=e.replace(/\s+/g," ").trim();return n.length>160?`${n.slice(0,160)}\u2026`:n}elapsed(e){if(e.status==="running"){this.tick();let n=Date.now()-e.at;return n>0?Wd(n):""}return e.durationMs===void 0?"":Wd(e.durationMs)}target(e){let n=ph(e),o=n.lastIndexOf("/");return o===-1?{dir:"",base:n}:{dir:n.slice(0,o+1),base:n.slice(o+1)}}diff(e){let n=`${e.title}
|
|
87
|
-
${e.output??""}`,o=/\+(\d+)\s*[-−](\d+)/.exec(n);if(o)return{added:Number(o[1]),removed:Number(o[2])};let r=/(\d+)\s+insertions?\(\+\)/.exec(n)?.[1],i=/(\d+)\s+deletions?\([-−]\)/.exec(n)?.[1];return r===void 0&&i===void 0?null:{added:Number(r??0),removed:Number(i??0)}}glyphClass(e){let n=e.name.toLowerCase();return n.includes("edit")||n.includes("write")||n.includes("patch")?"edit":n.includes("bash")||n.includes("shell")||n.includes("exec")?"shell":n.includes("search")||n.includes("grep")||n.includes("find")?"search":"read"}verb(e){let n=e.name.toLowerCase();return n.includes("edit")||n.includes("write")||n.includes("patch")?"Edit":n.includes("read")?"Read":n.includes("search")||n.includes("grep")||n.includes("find")?"Search":n.includes("bash")||n.includes("shell")||n.includes("exec")?"Run":e.name}compactTarget(e){if(this.glyphClass(e)!=="shell")return this.target(e).base;let n=ph(e).replace(/\s+/g," ").trim();return n.length>80?`${n.slice(0,80)}\u2026`:n}fileOf(e){let n=e.name.toLowerCase();if(!(n.includes("edit")||n.includes("write")||n.includes("patch")))return null;let r=ph(e);return r.length>0&&r!==e.name?r:null}basename(e){let n=e.replace(/[\\/]+$/,""),o=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\"));return o===-1?n:n.slice(o+1)}glyph(e){switch(this.glyphClass(e)){case"edit":return"\u270E";case"shell":return"\u276F";case"search":return"\u2315";default:return"\u2630"}}totalMs(){return this.tools().reduce((e,n)=>n.item.status==="running"?(this.tick(),e+Math.max(0,Date.now()-n.item.at)):e+(n.item.durationMs??0),0)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-tool-group"]],viewQuery:function(n,o){n&1&&vt(o.list,IP,5),n&2&&bt()},inputs:{steps:[1,"steps"],working:[1,"working"]},decls:12,vars:11,consts:[["list",""],[1,"group"],["type","button",1,"summary",3,"click"],[1,"state"],[1,"spinner"],[1,"dots"],[1,"chev"],[1,"tree"],[1,"rows"],[1,"node"],["type","button",1,"node-row",3,"click"],[1,"status"],[1,"fail"],[1,"ok"],[1,"glyph"],[1,"verb"],[1,"target",3,"title"],[1,"diff"],[1,"grow"],[1,"meta"],[1,"children"],[1,"body"],[1,"add"],[1,"del"],[1,"child"],["viewBox","0 0 16 16","aria-hidden","true",1,"file-icon"],["d","M4 2.5h5L12.5 6v7.5H4z"],["d","M9 2.5V6h3.5"],[1,"file-name",3,"title"],[1,"label-small"],[1,"glyph","thinking"],[1,"target","thought"],[3,"morseEnter","morseEnterY"],[1,"card",3,"running","failed"],[1,"card","thought"],[1,"card"],["type","button",1,"head",3,"click"],[1,"chip"],[1,"args",3,"title"],[1,"dir"],[1,"base"],[1,"bulb"],[1,"chip","thought-chip"],[1,"preview"]],template:function(n,o){n&1&&(g(0,"div",1)(1,"button",2),L("click",function(){return o.toggle()}),g(2,"span",3),T(3,kP,1,0,"span",4)(4,NP,1,1),_(),g(5,"span"),p(6),_(),T(7,DP,4,0,"span",5),g(8,"span",6),p(9,"\u203A"),_()(),T(10,ZP,3,0,"ul",7)(11,pA,4,0,"ul",8),_()),n&2&&(Te("compact",o.compact()),u(),pe("aria-expanded",o.isOpen()),u(),vo(o.state()),u(),M(o.state()==="running"?3:4),u(3),D(o.summary()),u(),M(o.running()?7:-1),u(),Te("open",o.isOpen()),u(2),M(o.compact()?10:11))},dependencies:[sn],styles:['[_nghost-%COMP%]{display:block}.summary[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;max-width:100%;padding:2px 8px 2px 4px;margin-left:-4px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);font-size:12.5px;cursor:pointer}.summary[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.state[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:14px}.state.ok[_ngcontent-%COMP%]{color:var(--%NS%morse-success)}.state.error[_ngcontent-%COMP%]{color:var(--%NS%morse-error)}.spinner[_ngcontent-%COMP%]{width:11px;height:11px;border-radius:50%;border:1.5px solid var(--%NS%morse-border);border-top-color:var(--%NS%morse-accent);animation:_ngcontent-%COMP%_spin .8s linear infinite}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}.chev[_ngcontent-%COMP%]{display:inline-block;transition:transform .17s cubic-bezier(.2,.7,.3,1)}.chev.open[_ngcontent-%COMP%]{transform:rotate(90deg)}.dots[_ngcontent-%COMP%]{display:inline-flex;gap:2px;color:currentColor}.dots[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{width:3px;height:3px;border-radius:50%;background:currentColor;animation:_ngcontent-%COMP%_dot 1.2s ease-in-out infinite}.dots[_ngcontent-%COMP%] i[_ngcontent-%COMP%]:nth-child(2){animation-delay:.15s}.dots[_ngcontent-%COMP%] i[_ngcontent-%COMP%]:nth-child(3){animation-delay:.3s}@keyframes _ngcontent-%COMP%_dot{0%,60%,to{opacity:.25}30%{opacity:1}}.rows[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px;margin:6px 0 0;padding:0;list-style:none;overflow:hidden}.tree[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;margin:6px 0 2px 6px;padding:0 0 0 14px;border-left:1px solid var(--%NS%morse-guide);list-style:none}.node[_ngcontent-%COMP%]{position:relative;min-width:0}.node[_ngcontent-%COMP%]:before{content:"";position:absolute;left:-14px;top:11px;width:8px;height:1px;background:var(--%NS%morse-guide)}.node-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:7px;width:100%;min-width:0;padding:2px 6px 2px 0;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);font-size:12px;text-align:left;cursor:pointer}.node-row[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.node[_ngcontent-%COMP%] .body[_ngcontent-%COMP%]{margin:2px 0;padding:2px 6px 6px 14px;border-left:1px solid var(--%NS%morse-guide)}.node-row[_ngcontent-%COMP%] .verb[_ngcontent-%COMP%]{flex:none;color:var(--%NS%morse-fg)}.node-row[_ngcontent-%COMP%] .target[_ngcontent-%COMP%]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--%NS%morse-font-mono);font-size:11.5px}.node-row[_ngcontent-%COMP%] .target.thought[_ngcontent-%COMP%]{font-family:var(--%NS%morse-font);font-size:12px}.glyph.thinking[_ngcontent-%COMP%]{color:var(--%NS%morse-typename)}.children[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;margin:2px 0;padding:0 0 0 14px;border-left:1px solid var(--%NS%morse-guide);list-style:none}.child[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;gap:6px;min-width:0;padding:1px 0 1px 6px;color:var(--%NS%morse-fg-muted);font-size:11.5px}.child[_ngcontent-%COMP%]:before{content:"";position:absolute;left:-14px;top:50%;width:14px;height:1px;background:var(--%NS%morse-guide)}.child[_ngcontent-%COMP%] .file-icon[_ngcontent-%COMP%]{flex:none;width:11px;height:11px;fill:none;stroke:var(--%NS%morse-number);stroke-width:1.2;stroke-linejoin:round}.child[_ngcontent-%COMP%] .file-name[_ngcontent-%COMP%]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--%NS%morse-font-mono)}.card[_ngcontent-%COMP%]{border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:color-mix(in srgb,var(--%NS%morse-panel) 55%,transparent);overflow:hidden}.card.running[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--%NS%morse-accent) 55%,var(--%NS%morse-border))}.card.failed[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--%NS%morse-error) 55%,var(--%NS%morse-border))}.head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;padding:5px 8px;border:0;background:transparent;color:var(--%NS%morse-fg);font-size:12.5px;text-align:left;cursor:pointer}.head[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}.status[_ngcontent-%COMP%]{flex:none;display:inline-flex;align-items:center;justify-content:center;width:13px;height:13px}.status[_ngcontent-%COMP%] .ok[_ngcontent-%COMP%]{color:var(--%NS%morse-success);font-size:10px}.status[_ngcontent-%COMP%] .fail[_ngcontent-%COMP%]{color:var(--%NS%morse-error);font-size:11px}.status[_ngcontent-%COMP%] .bulb[_ngcontent-%COMP%]{color:var(--%NS%morse-typename);font-size:11px}.glyph[_ngcontent-%COMP%]{flex:none;width:13px;text-align:center;font-size:12px}.glyph.edit[_ngcontent-%COMP%]{color:var(--%NS%morse-keyword)}.glyph.read[_ngcontent-%COMP%]{color:var(--%NS%morse-number)}.glyph.search[_ngcontent-%COMP%]{color:var(--%NS%morse-typename)}.glyph.shell[_ngcontent-%COMP%]{color:var(--%NS%morse-success)}.chip[_ngcontent-%COMP%]{flex:none;padding:0 5px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);color:var(--%NS%morse-fg-muted);font-family:var(--%NS%morse-font-mono);font-size:11px}.args[_ngcontent-%COMP%]{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--%NS%morse-font-mono);font-size:11.5px}.args[_ngcontent-%COMP%] .dir[_ngcontent-%COMP%]{color:var(--%NS%morse-fg-muted)}.preview[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--%NS%morse-fg-muted);font-size:12px}.diff[_ngcontent-%COMP%]{flex:none;display:inline-flex;gap:4px;font-family:var(--%NS%morse-font-mono);font-size:11.5px}.diff[_ngcontent-%COMP%] .add[_ngcontent-%COMP%]{color:var(--%NS%morse-success)}.diff[_ngcontent-%COMP%] .del[_ngcontent-%COMP%]{color:var(--%NS%morse-error)}.meta[_ngcontent-%COMP%]{flex:none;color:var(--%NS%morse-fg-muted);font-variant-numeric:tabular-nums}.grow[_ngcontent-%COMP%]{flex:1}.body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;padding:0 10px 8px 30px;overflow:hidden}.body[_ngcontent-%COMP%] .label-small[_ngcontent-%COMP%]{font-size:10px;letter-spacing:.06em;text-transform:uppercase;color:var(--%NS%morse-fg-muted)}.body[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{margin:0;max-height:260px;overflow:auto;padding:8px 10px;border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-panel);font-family:var(--%NS%morse-font-mono);font-size:12px;line-height:1.5;white-space:pre-wrap;word-break:break-word}']})};function ph(t){return t.title.startsWith(`${t.name}: `)?t.title.slice(t.name.length+2):t.title}function Wd(t){if(t<1e3)return`${Math.max(1,Math.round(t))}ms`;let e=t/1e3;return e<60?`${e<10?e.toFixed(1):Math.round(e)}s`:`${Math.floor(e/60)}m ${Math.round(e%60)}s`}var fA=["track"],mA=["previewList"],hE=(t,e)=>e.id;function hA(t,e){if(t&1&&$e(0,"span",10),t&2){let n=e.$implicit,o=e.$index,r=h(2);Oo("top",o*r.tickPitch,"px")("width",r.tickWidth(o),"px"),Te("active",n.id===r.activeId()),pe("aria-selected",o===r.hovered())("aria-label",n.preview||"Prompt")}}function gA(t,e){if(t&1){let n=z();b(0,"button",14),q("mouseenter",function(){let r=I(n).$index,i=h(3);return k(i.hovered.set(r))})("click",function(){let r=I(n).$index,i=h(3);return k(i.choose(r))}),b(1,"span",15),p(2),E()()}if(t&2){let n=e.$implicit,o=e.$index,r=h(3);Te("active",n.id===r.activeId())("hovered",o===r.hovered()),u(2),D(n.preview||"No text")}}function yA(t,e){if(t&1){let n=z();b(0,"div",11),q("mouseenter",function(){I(n);let r=h(2);return k(r.onEnter())})("mouseleave",function(){I(n);let r=h(2);return k(r.onLeave())}),b(1,"div",12,1),_e(3,gA,3,5,"button",13,hE),E()()}if(t&2){let n=h(2);u(3),be(n.prompts())}}function vA(t,e){if(t&1){let n=z();b(0,"nav",3),q("mouseenter",function(){I(n);let r=h();return k(r.onEnter())}),b(1,"button",4),q("click",function(){I(n);let r=h();return k(r.stepWindow(-1))}),p(2," \u2303 "),E(),b(3,"div",5,0),q("mousemove",function(r){I(n);let i=h();return k(i.onMove(r))})("mouseleave",function(){I(n);let r=h();return k(r.onLeave())})("click",function(r){I(n);let i=h();return k(i.onTrackClick(r))})("keydown",function(r){I(n);let i=h();return k(i.onKeydown(r))}),b(5,"div",6),_e(6,hA,1,8,"span",7,hE),E()(),b(8,"button",8),q("click",function(){I(n);let r=h();return k(r.stepWindow(1))}),p(9," \u2304 "),E(),T(10,yA,5,0,"div",9),E()}if(t&2){let n=h();u(),Ae("disabled",!n.hasMoreAbove()),u(2),Oo("height",n.visibleCount()*n.tickPitch,"px")("mask-image",n.mask()),u(2),Oo("transform","translateY(-"+n.clampedWindowStart()*n.tickPitch+"px)"),u(),be(n.prompts()),u(2),Ae("disabled",!n.hasMoreBelow()),u(2),M(n.hovered()!==null?10:-1)}}var pE=12,fE=30,mE=18,_A=80,bA=10,xA=14,EA=20,CA=[1,.6,.35,.15],wA=160,Zd=class t{prompts=ee.required();activeId=ee(null);pick=rt();tickPitch=pE;hovered=R(null);windowStart=R(0);track=at("track");previewList=at("previewList");pointerY=null;direction=0;carouselTimer=null;hideTimer=null;visibleCount=S(()=>Math.min(this.prompts().length,fE));maxWindowStart=S(()=>Math.max(0,this.prompts().length-this.visibleCount()));clampedWindowStart=S(()=>Math.min(this.windowStart(),this.maxWindowStart()));hasMoreAbove=S(()=>this.clampedWindowStart()>0);hasMoreBelow=S(()=>this.clampedWindowStart()+this.visibleCount()<this.prompts().length);activeIndex=S(()=>{let e=this.activeId();return e===null?-1:this.prompts().findIndex(n=>n.id===e)});mask=S(()=>{let e=this.hasMoreAbove(),n=this.hasMoreBelow();return!e&&!n?void 0:`linear-gradient(to bottom, ${e?"transparent, black 14%":"black"}, ${n?"black 86%, transparent":"black"})`});constructor(){ue(()=>{if(this.hovered()!==null)return;let e=this.prompts().length,n=Math.min(e,fE),o=Math.max(0,e-n),r=this.activeIndex()>=0?this.activeIndex():e-1;this.windowStart.set(Math.max(0,Math.min(o,r-Math.floor(n/2))))}),ue(()=>{let e=this.hovered();this.previewList(),e!==null&&setTimeout(()=>this.revealRow(e),0)})}ngOnDestroy(){this.stopCarousel(),this.cancelHide()}tickWidth(e){let n=this.prompts()[e]?.id===this.activeId()?xA:bA,o=this.hovered();if(o===null)return n;let r=CA[Math.abs(e-o)]??0;return Math.round(n+(EA-n)*r)}onEnter(){this.cancelHide()}onMove(e){this.cancelHide(),this.pointerY=e.clientY;let n=this.indexFromPointer(e.clientY);n!==null&&this.hovered.set(n),this.updateCarousel(e.clientY)}onLeave(){this.pointerY=null,this.stopCarousel(),this.scheduleHide()}onTrackClick(e){let n=this.indexFromPointer(e.clientY);n!==null&&this.choose(n)}stepWindow(e){let n=Math.max(1,Math.floor(this.visibleCount()/2)),o=Math.max(0,Math.min(this.maxWindowStart(),this.clampedWindowStart()+e*n));this.windowStart.set(o)}choose(e){let n=this.prompts()[e];n&&(this.pick.emit(n.id),this.stopCarousel(),this.hovered.set(null))}onKeydown(e){let n=this.prompts().length;if(n===0)return;let o=this.hovered()??(this.activeIndex()>=0?this.activeIndex():n-1),r=i=>{let s=Math.max(0,Math.min(n-1,i));this.ensureWindowContains(s),this.hovered.set(s)};switch(e.key){case"ArrowUp":e.preventDefault(),r(o-1);return;case"ArrowDown":e.preventDefault(),r(o+1);return;case"Home":e.preventDefault(),r(0);return;case"End":e.preventDefault(),r(n-1);return;case"Enter":case" ":e.preventDefault(),this.choose(o);return;case"Escape":e.preventDefault(),this.hovered.set(null);return;default:return}}indexFromPointer(e){let n=this.track()?.nativeElement,o=this.visibleCount();if(!n||o===0)return null;let r=n.getBoundingClientRect(),i=Math.floor((e-r.top)/pE),s=Math.max(0,Math.min(o-1,i));return Math.min(this.prompts().length-1,this.clampedWindowStart()+s)}updateCarousel(e){let n=this.track()?.nativeElement;if(!n)return;let o=n.getBoundingClientRect(),r=e-o.top,i=0;if(r<=mE&&this.hasMoreAbove()?i=-1:r>=o.height-mE&&this.hasMoreBelow()&&(i=1),this.direction=i,i===0){this.stopCarousel();return}this.carouselTimer===null&&(this.carouselTimer=setInterval(()=>this.carouselStep(),_A))}carouselStep(){if(this.direction===0){this.stopCarousel();return}let e=this.clampedWindowStart(),n=Math.max(0,Math.min(this.maxWindowStart(),e+this.direction));if(n===e){this.stopCarousel();return}if(this.windowStart.set(n),this.pointerY!==null){let o=this.indexFromPointer(this.pointerY);o!==null&&this.hovered.set(o)}}stopCarousel(){this.direction=0,this.carouselTimer!==null&&(clearInterval(this.carouselTimer),this.carouselTimer=null)}ensureWindowContains(e){let n=this.visibleCount(),o=this.maxWindowStart(),r=Math.min(this.clampedWindowStart(),o);e<r?this.windowStart.set(e):e>=r+n&&this.windowStart.set(Math.min(o,e-n+1))}scheduleHide(){this.cancelHide(),this.hideTimer=setTimeout(()=>{this.hideTimer=null,this.hovered.set(null)},wA)}cancelHide(){this.hideTimer!==null&&(clearTimeout(this.hideTimer),this.hideTimer=null)}revealRow(e){let n=this.previewList()?.nativeElement,o=n?.children.item(e);if(!n||!o)return;let r=n.getBoundingClientRect(),i=o.getBoundingClientRect();i.top<r.top?n.scrollTop-=r.top-i.top:i.bottom>r.bottom&&(n.scrollTop+=i.bottom-r.bottom)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-prompt-rail"]],viewQuery:function(n,o){n&1&&vt(o.track,fA,5)(o.previewList,mA,5),n&2&&bt(2)},inputs:{prompts:[1,"prompts"],activeId:[1,"activeId"]},outputs:{pick:"pick"},decls:1,vars:1,consts:[["track",""],["previewList",""],["aria-label","Prompt navigator",1,"rail"],["aria-label","Prompt navigator",1,"rail",3,"mouseenter"],["type","button","title","Earlier prompts","aria-label","Earlier prompts",1,"step",3,"click","disabled"],["role","listbox","tabindex","0","aria-label","Prompts in this conversation",1,"track",3,"mousemove","mouseleave","click","keydown"],[1,"ticks"],["role","option",1,"tick",3,"active","top","width"],["type","button","title","Later prompts","aria-label","Later prompts",1,"step",3,"click","disabled"],[1,"panel"],["role","option",1,"tick"],[1,"panel",3,"mouseenter","mouseleave"],[1,"panel-list"],["type","button",1,"row",3,"active","hovered"],["type","button",1,"row",3,"mouseenter","click"],[1,"row-text"]],template:function(n,o){n&1&&T(0,vA,11,9,"nav",2),n&2&&M(o.prompts().length>=2?0:-1)},styles:["[_nghost-%COMP%]{display:contents}.rail[_ngcontent-%COMP%]{position:absolute;right:12px;top:50%;z-index:6;display:flex;flex-direction:column;align-items:flex-end;transform:translateY(-50%)}.step[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:18px;height:16px;padding:0;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);font-size:10px;line-height:1;cursor:pointer}.step[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.step[_ngcontent-%COMP%]:disabled{opacity:.25;cursor:default}.track[_ngcontent-%COMP%]{position:relative;width:24px;cursor:pointer;outline:none;overflow:hidden}.track[_ngcontent-%COMP%]:focus-visible{outline:1px solid var(--%NS%morse-focus);outline-offset:1px;border-radius:var(--%NS%morse-radius-sm)}.ticks[_ngcontent-%COMP%]{position:absolute;inset:0;transition:transform .26s ease-out}.tick[_ngcontent-%COMP%]{position:absolute;right:3px;height:2px;border-radius:999px;background:color-mix(in srgb,var(--%NS%morse-fg) 30%,transparent);transition:width .18s ease-out,background .18s ease-out}.track[_ngcontent-%COMP%]:hover .tick[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--%NS%morse-fg) 55%,transparent)}.tick.active[_ngcontent-%COMP%], .track[_ngcontent-%COMP%]:hover .tick.active[_ngcontent-%COMP%]{background:var(--%NS%morse-fg)}.panel[_ngcontent-%COMP%]{position:absolute;right:100%;top:50%;margin-right:10px;transform:translateY(-50%);width:min(20rem,calc(100vw - 4.5rem));border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 10px 28px #00000047;overflow:hidden}.panel-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;max-height:368px;padding:4px;overflow-y:auto}.row[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;min-height:44px;padding:6px 8px;border:1px solid transparent;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);font:inherit;font-size:11.5px;line-height:1.35;text-align:left;cursor:pointer}.row.hovered[_ngcontent-%COMP%]{border-color:var(--%NS%morse-border);background:var(--%NS%morse-hover)}.row.active[_ngcontent-%COMP%]{background:var(--%NS%morse-active);color:var(--%NS%morse-fg)}.row-text[_ngcontent-%COMP%]{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}"]})};var SA=["scroll"],TA=["inner"],MA=["heroMark"],gE=()=>[],IA=(t,e)=>e.key,kA=(t,e)=>e.path+(e.startLine??"");function NA(t,e){t&1&&(g(0,"span",11),p(1,"Loading older messages\u2026"),_())}function DA(t,e){if(t&1){let n=z();g(0,"button",13),L("click",function(){I(n);let r=h(2);return k(r.loadOlder())}),p(1," Load older messages "),_()}}function OA(t,e){if(t&1&&(g(0,"div",5),T(1,NA,2,0,"span",11)(2,DA,2,0,"button",12),_()),t&2){let n=h();u(),M(n.loadingOlderHistory()?1:2)}}function PA(t,e){t&1&&(g(0,"div",6)(1,"span"),p(2,"Start of conversation"),_()())}function AA(t,e){if(t&1&&(g(0,"span",31),p(1),_()),t&2){let n=h().$implicit;u(),Ln("L",n.startLine,"-",n.endLine)}}function RA(t,e){if(t&1&&(g(0,"li",27)(1,"span",29),p(2,"\u29C9"),_(),g(3,"span",30),p(4),_(),T(5,AA,2,2,"span",31),_()),t&2){let n=e.$implicit,o=h(4);K("title",n.path),u(4),D(o.basename(n.path)),u(),M(n.startLine!==void 0?5:-1)}}function LA(t,e){if(t&1){let n=z();g(0,"li",28)(1,"button",32),L("click",function(){let r=I(n),i=r.$implicit,s=r.$index,a=h(4);return k(a.openImage(i,s))}),we(2,"img",33),_()()}if(t&2){let n=e.$implicit,o=e.$index,r=h(4);u(),K("title",r.imageName(n,o)),pe("aria-label","View "+r.imageName(n,o)),u(),K("src",r.thumb(n),yo)("alt",r.imageName(n,o))}}function FA(t,e){if(t&1&&(g(0,"ul",19),_e(1,RA,6,3,"li",27,kA),_e(3,LA,3,4,"li",28,es),_()),t&2){let n=h(2).$implicit;u(),be(n.item.pins??Ll(0,gE)),u(2),be(n.item.images??Ll(1,gE))}}function VA(t,e){if(t&1){let n=z();g(0,"div",20)(1,"textarea",34),L("input",function(r){I(n);let i=h(3);return k(i.onEditInput(r))})("keydown",function(r){I(n);let i=h(2).$implicit,s=h();return k(s.onEditKeydown(r,i.item))}),_(),g(2,"div",35)(3,"span",36),p(4,"Enter sends \xB7 Shift+Enter for a new line"),_(),g(5,"button",37),L("click",function(){I(n);let r=h(3);return k(r.cancelEdit())}),p(6,"Cancel"),_(),g(7,"button",38),L("click",function(){I(n);let r=h(2).$implicit,i=h();return k(i.submitEdit(r.item))}),p(8," Send "),_()()()}if(t&2){let n=h(3);u(),K("value",n.editingText()),u(6),K("disabled",n.editingText().trim().length===0)}}function jA(t,e){if(t&1){let n=z();g(0,"div",21)(1,"morse-markdown",39),L("mention",function(r){I(n);let i=h(3);return k(i.openMention(r))}),_()()}if(t&2){let n=h(2).$implicit,o=h();u(),K("text",o.userMarkdown(n.item))}}function $A(t,e){if(t&1){let n=z();g(0,"button",40),L("click",function(){I(n);let r=h(2).$implicit,i=h();return k(i.startEdit(r.item))}),p(1," \u270E "),_()}}function HA(t,e){if(t&1){let n=z();g(0,"button",41),L("click",function(){I(n);let r=h(2).$implicit,i=h();return k(i.fork(r.item))}),Tt(),g(1,"svg",42),we(2,"path",43),_()()}}function BA(t,e){if(t&1){let n=z();g(0,"div",14),T(1,FA,5,2,"ul",19),T(2,VA,9,2,"div",20)(3,jA,2,1,"div",21),g(4,"div",22)(5,"span",23),p(6),_(),T(7,$A,2,0,"button",24),T(8,HA,3,0,"button",25),g(9,"button",26),L("click",function(){I(n);let r=h().$implicit,i=h();return k(i.copy(r.item))}),p(10),_()()()}if(t&2){let n=h().$implicit,o=h();K("morseEnter",0),pe("data-prompt-id",n.item.id),u(),M(o.pinsOf(n.item)!==void 0||n.item.images!==void 0?1:-1),u(),M(o.editingId()===n.item.id?2:3),u(4),D(o.stamp(n.item.at)),u(),M(o.canEdit()?7:-1),u(),M(o.canFork()?8:-1),u(),K("title",o.copiedId()===n.item.id?"Copied":"Copy message"),u(),ce(" ",o.copiedId()===n.item.id?"\u2713":"\u29C9"," ")}}function UA(t,e){if(t&1){let n=z();we(0,"morse-markdown",45),g(1,"div",46)(2,"button",26),L("click",function(){I(n);let r=h(2).$implicit,i=h();return k(i.copyAssistant(r.item))}),p(3),_()()}if(t&2){let n=h(2).$implicit,o=h();K("text",n.item.text),u(2),Te("revealed",o.copiedId()===n.item.id),K("title",o.copiedId()===n.item.id?"Copied":"Copy response"),u(),ce(" ",o.copiedId()===n.item.id?"\u2713 Copied":"\u29C9 Copy"," ")}}function zA(t,e){t&1&&(g(0,"span",44),p(1,"\xA0"),_())}function qA(t,e){if(t&1&&(g(0,"div",15),T(1,UA,4,5)(2,zA,2,0,"span",44),_()),t&2){let n=h().$implicit;K("morseEnter",0),u(),M(n.item.text?1:n.item.streaming?2:-1)}}function GA(t,e){if(t&1&&we(0,"morse-tool-group",16),t&2){let n=h().$implicit,o=h();K("morseEnter",0)("steps",n.steps)("working",o.working()&&n.key===o.activeProcess())}}function WA(t,e){if(t&1&&(g(0,"div",47)(1,"pre"),p(2),_()()),t&2){let n=h().$implicit;vo(n.item.level),K("morseEnter",0),u(2),D(n.item.text)}}function YA(t,e){if(t&1&&(g(0,"span",51),p(1),_()),t&2){let n=h(2).$implicit,o=h();u(),ce("~",o.formatTokens(n.item.tokensBefore)," tokens folded")}}function ZA(t,e){if(t&1&&(g(0,"div",52),we(1,"morse-markdown",45),_()),t&2){let n=h(2).$implicit;K("morseEnter",0),u(),K("text",n.item.summary)}}function KA(t,e){if(t&1){let n=z();g(0,"div",18)(1,"button",48),L("click",function(){I(n);let r=h().$implicit,i=h();return k(i.toggleCompaction(r.key))}),we(2,"span",49),g(3,"span",50),p(4,"\u26A1 Compacted"),_(),T(5,YA,2,1,"span",51),we(6,"span",49),_(),T(7,ZA,2,2,"div",52),_()}if(t&2){let n=h().$implicit,o=h();K("morseEnter",0),u(),K("title",n.item.summary?o.expandedCompaction()===n.key?"Hide the summary":"Show the summary":"Everything before this point was summarized into the running context"),u(4),M(n.item.tokensBefore?5:-1),u(2),M(o.expandedCompaction()===n.key&&n.item.summary?7:-1)}}function QA(t,e){if(t&1&&T(0,BA,11,9,"div",14)(1,qA,3,2,"div",15)(2,GA,1,3,"morse-tool-group",16)(3,WA,3,4,"div",17)(4,KA,8,4,"div",18),t&2){let n,o=e.$implicit;M((n=o.kind)==="user"?0:n==="assistant"?1:n==="process"?2:n==="notice"?3:n==="compaction"?4:-1)}}function XA(t,e){if(t&1&&(g(0,"span",59),p(1),_()),t&2){let n=e.$implicit;u(),D(n)}}function JA(t,e){t&1&&(p(0,", or select code and pin it with the "),g(1,"span",63),p(2,"\u29C9"),_(),p(3," button under the chat"))}function eR(t,e){if(t&1&&(g(0,"div",7)(1,"div",53),we(2,"span",54),g(3,"span",55,2),we(5,"span",56)(6,"span",56)(7,"span",57),_()(),g(8,"div",58),_e(9,XA,2,1,"span",59,es),_(),g(11,"div",60),p(12,"the pi coding agent"),_(),g(13,"p",61),p(14," It runs the same pi coding agent you use in the terminal, with your models, tools, skills and sessions. "),_(),g(15,"p",62),p(16," Try "),g(17,"em"),p(18,"\u201Cexplain this repository\u201D"),_(),p(19," or "),g(20,"em"),p(21,"\u201Cwhy is this failing?\u201D"),_(),T(22,JA,4,0),p(23,". "),_()()),t&2){let n=h();u(9),be(n.heroLetters),u(13),M(n.canPinSelection()?22:-1)}}function tR(t,e){if(t&1){let n=z();g(0,"button",64),L("click",function(){I(n);let r=h();return k(r.jumpToLatest())}),p(1,"\u2193 Latest"),_()}}function nR(t,e){if(t&1){let n=z();g(0,"div",65),L("click",function(){I(n);let r=h();return k(r.closeImage())}),g(1,"button",66),L("click",function(){I(n);let r=h();return k(r.closeImage())}),p(2," \xD7 "),_(),g(3,"figure",67),L("click",function(r){return r.stopPropagation()}),we(4,"img",33),g(5,"figcaption"),p(6),_()()()}if(t&2){let n=e;u(4),K("src",n.src,yo)("alt",n.label),u(2),D(n.label)}}var oR={png:"png",jpeg:"jpg",jpg:"jpg",webp:"webp",gif:"gif","svg+xml":"svg",bmp:"bmp",avif:"avif"},yE=160;function rR(t){let e=t.replace(/\s+/g," ").trim();return e.length>yE?`${e.slice(0,yE)}\u2026`:e}var Kd=class t{morse=N(wt);animation=N(gn);handoff=N(us);scrollHost=at.required("scroll");inner=at("inner");heroMark=at("heroMark");heroLetters=["M","o","r","s","e"];canPinSelection=S(()=>this.morse.capabilities()?.editorContext===!0);copiedId=R(null);preview=R(null);editingId=R(null);editingText=R("");pinned=R(!0);working=S(()=>this.morse.state().streaming);rows=S(()=>Mb(this.morse.items()));activeProcess=S(()=>Ib(this.rows()));railPrompts=S(()=>this.rows().filter(e=>e.kind==="user").map(e=>({id:e.item.id,preview:rR(e.item.text)})));activePromptId=R(null);expandedCompaction=R(null);toggleCompaction(e){this.expandedCompaction.update(n=>n===e?null:e)}formatTokens(e){return new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(e)}hasOlderHistory=S(()=>this.morse.hasOlderHistory());loadingOlderHistory=S(()=>this.morse.loadingOlderHistory());activePending=!1;bottomDistance=0;anchorScroll=!1;previousFirstId;previousSessionId;previousLength=0;constructor(){ue(e=>{let n=this.inner()?.nativeElement;if(!n||typeof ResizeObserver>"u")return;let o=new ResizeObserver(()=>{this.pinned()&&this.afterRender(()=>this.scrollToBottom())});o.observe(n),e(()=>o.disconnect())}),ue(()=>{this.rows(),this.pinned()&&this.afterRender(()=>this.scrollToBottom())}),ue(()=>{this.rows().at(-1)?.kind==="user"&&this.animation.pulse(this.inner()?.nativeElement??null)}),ue(()=>{let e=this.rows().length===0;this.afterRender(()=>{let n=this.heroMark()?.nativeElement;if(!e||!n){this.handoff.aim(null);return}let o=n.getBoundingClientRect();this.handoff.aim({x:o.left+o.width/2,y:o.top+o.height/2,width:o.width,height:o.height})})}),ue(()=>{this.railPrompts(),this.afterRender(()=>this.updateActivePrompt())}),ue(()=>{let e=this.morse.state().sessionId,n=this.morse.items(),o=n[0]?.id,r=e===this.previousSessionId&&this.previousFirstId!==void 0&&o!==this.previousFirstId&&n.length>this.previousLength;this.previousSessionId=e,this.previousFirstId=o,this.previousLength=n.length,r&&this.afterRender(()=>this.restoreBottomDistance())})}afterRender(e){setTimeout(e,0)}onScroll(e){let n=e.target,o=n.scrollHeight-n.scrollTop-n.clientHeight;this.pinned.set(o<48),this.bottomDistance=o,this.anchorScroll=o>0,n.scrollTop<80&&this.hasOlderHistory()&&!this.loadingOlderHistory()&&this.morse.loadOlderHistory(),this.updateActivePrompt()}loadOlder(){let e=this.scrollHost().nativeElement;this.bottomDistance=e.scrollHeight-e.scrollTop-e.clientHeight,this.anchorScroll=this.bottomDistance>0,this.morse.loadOlderHistory()}restoreBottomDistance(){if(!this.anchorScroll)return;let e=this.scrollHost().nativeElement,n=Math.max(0,e.scrollHeight-e.clientHeight),o=e.scrollHeight-e.clientHeight-this.bottomDistance;e.scrollTop=Math.max(0,Math.min(n,o))}updateActivePrompt(){this.activePending||(this.activePending=!0,this.afterRender(()=>{this.activePending=!1,this.computeActivePrompt()}))}computeActivePrompt(){let e=this.scrollHost().nativeElement,n=e.querySelectorAll("[data-prompt-id]");if(n.length===0){this.activePromptId.set(null);return}let o=e.getBoundingClientRect().top+100,r=n[0]?.dataset.promptId??null;for(let s of Array.from(n))if(s.getBoundingClientRect().top<=o)r=s.dataset.promptId??r;else break;e.scrollHeight-e.scrollTop-e.clientHeight<=Math.max(48,e.clientHeight*.1)&&(r=n[n.length-1]?.dataset.promptId??r),this.activePromptId.set(r)}scrollToPrompt(e){let n=this.scrollHost().nativeElement,o=n.querySelector(`[data-prompt-id="${e}"]`);if(!o)return;let r=o.getBoundingClientRect().top-n.getBoundingClientRect().top+n.scrollTop-12;this.pinned.set(!1),this.animation.isEnabled&&typeof n.scrollTo=="function"?n.scrollTo({top:r,behavior:"smooth"}):n.scrollTop=r,this.activePromptId.set(e)}jumpToLatest(){this.pinned.set(!0),this.scrollToBottom(!0)}scrollToBottom(e=!1){let n=this.scrollHost().nativeElement;e&&this.animation.isEnabled&&typeof n.scrollTo=="function"&&(typeof document>"u"||document.visibilityState==="visible")?n.scrollTo({top:n.scrollHeight,behavior:"smooth"}):n.scrollTop=n.scrollHeight}stamp(e){return e<=0?"":new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}userMarkdown(e){return kb(e.text)}pinsOf(e){return e.pins}basename(e){let n=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return n===-1?e:e.slice(n+1)}thumb(e){return`data:${e.mimeType};base64,${e.data}`}imageName(e,n){let o=e.mimeType.split("/")[1]?.toLowerCase()??"",r=oR[o]??(o.replace(/[^a-z0-9]/g,"")||"png");return n===0?`image.${r}`:`image-${n+1}.${r}`}openImage(e,n){this.preview.set({src:this.thumb(e),label:this.imageName(e,n)})}closeImage(){this.preview.set(null)}onEscape(){if(this.preview()!==null){this.closeImage();return}this.editingId()!==null&&this.cancelEdit()}canEdit(){return this.morse.capabilities()?.editMessage===!0&&this.morse.state().streaming!==!0}canFork(){return this.morse.capabilities()?.forkMessage===!0&&this.morse.state().streaming!==!0}fork(e){this.morse.forkMessage(e.id)}startEdit(e){this.editingId.set(e.id),this.editingText.set(e.text),this.afterRender(()=>{let n=this.scrollHost().nativeElement.querySelector(".edit-input");n?.focus();let o=n?.value.length??0;n?.setSelectionRange(o,o)})}cancelEdit(){this.editingId.set(null),this.editingText.set("")}onEditInput(e){this.editingText.set(e.target.value)}onEditKeydown(e,n){if(e.key==="Enter"&&!e.shiftKey){e.preventDefault(),this.submitEdit(n);return}e.key==="Escape"&&(e.preventDefault(),this.cancelEdit())}submitEdit(e){let n=this.editingText().trim();n.length!==0&&(this.morse.editMessage(e.id,n),this.cancelEdit())}openMention(e){this.morse.capabilities()?.revealFile===!0&&this.morse.requestHostCommand("revealFile",{path:e}).catch(()=>{})}copyText(e){let n=e.pins??[];if(n.length===0)return e.text;let o=n.map(r=>`${r.path}${r.startLine!==void 0?`:${r.startLine}-${r.endLine??r.startLine}`:""}`).map(r=>`@${r}`).join(`
|
|
88
|
-
`);return e.text.trim().length>0?`${e.text}
|
|
89
|
-
|
|
90
|
-
${o}`:o}copy(e){this.copyRaw(e.id,this.copyText(e))}copyAssistant(e){this.copyRaw(e.id,e.text)}copyRaw(e,n){navigator.clipboard?.writeText(n),this.copiedId.set(e),setTimeout(()=>{this.copiedId()===e&&this.copiedId.set(null)},1200)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-chat-transcript"]],viewQuery:function(n,o){n&1&&vt(o.scrollHost,SA,5)(o.inner,TA,5)(o.heroMark,MA,5),n&2&&bt(3)},hostBindings:function(n,o){n&1&&L("keydown.escape",function(){return o.onEscape()},Ot)},decls:12,vars:8,consts:[["scroll",""],["inner",""],["heroMark",""],[1,"transcript",3,"scroll"],[1,"inner"],[1,"older"],[1,"start"],[1,"hero"],[3,"pick","prompts","activeId"],["type","button",1,"latest"],[1,"image-overlay"],[1,"older-label"],["type","button",1,"older-button"],["type","button",1,"older-button",3,"click"],[1,"user",3,"morseEnter"],[1,"assistant",3,"morseEnter"],[3,"morseEnter","steps","working"],[1,"notice",3,"class","morseEnter"],[1,"compaction",3,"morseEnter"],[1,"user-attachments"],[1,"user-edit"],[1,"user-text"],[1,"user-head"],[1,"stamp"],["type","button","title","Edit message",1,"copy-msg"],["type","button","title","Fork from here",1,"copy-msg"],["type","button",1,"copy-msg",3,"click","title"],[1,"mention-pin",3,"title"],[1,"image-chip"],["aria-hidden","true",1,"pin-icon"],[1,"name"],[1,"lines"],["type","button",1,"image-chip-button",3,"click","title"],[3,"src","alt"],["rows","3",1,"edit-input",3,"input","keydown","value"],[1,"edit-actions"],[1,"edit-hint"],["type","button",1,"edit-cancel",3,"click"],["type","button",1,"edit-send",3,"click","disabled"],["variant","user",3,"mention","text"],["type","button","title","Edit message",1,"copy-msg",3,"click"],["type","button","title","Fork from here",1,"copy-msg",3,"click"],["viewBox","0 0 16 16","width","11","height","11","aria-hidden","true"],["fill","currentColor","d","M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z"],[1,"cursor"],[3,"text"],[1,"assistant-actions"],[1,"notice",3,"morseEnter"],["type","button",1,"compaction-sep",3,"click","title"],["aria-hidden","true",1,"sep-line"],[1,"sep-label"],[1,"sep-tokens"],[1,"compaction-summary",3,"morseEnter"],[1,"hero-stage"],["aria-hidden","true",1,"hero-glow"],["aria-hidden","true",1,"hero-mark"],[1,"hero-dot"],[1,"hero-dash"],["aria-label","Morse",1,"hero-wordmark"],["aria-hidden","true",1,"hero-letter"],[1,"hero-tagline"],[1,"hero-hint"],[1,"hero-tips"],[1,"hero-key"],["type","button",1,"latest",3,"click"],[1,"image-overlay",3,"click"],["type","button","aria-label","Close image",1,"image-close",3,"click"],[1,"image-frame",3,"click"]],template:function(n,o){if(n&1&&(g(0,"div",3,0),L("scroll",function(i){return o.onScroll(i)}),g(2,"div",4,1),T(4,OA,3,1,"div",5)(5,PA,3,0,"div",6),_e(6,QA,5,1,null,null,IA,!1,eR,24,1,"div",7),_()(),g(9,"morse-prompt-rail",8),L("pick",function(i){return o.scrollToPrompt(i)}),_(),T(10,tR,2,0,"button",9),T(11,nR,7,3,"div",10)),n&2){let r;u(2),Te("blank",o.rows().length===0),u(2),M(o.hasOlderHistory()||o.loadingOlderHistory()?4:o.rows().length>0?5:-1),u(2),be(o.rows()),u(3),K("prompts",o.railPrompts())("activeId",o.activePromptId()),u(),M(!o.pinned()&&o.rows().length>0?10:-1),u(),M((r=o.preview())?11:-1,r)}},dependencies:[Gd,Yd,sn,Zd],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;position:relative}.transcript[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;padding:18px 16px 6px;scrollbar-gutter:stable}.latest[_ngcontent-%COMP%]{position:absolute;right:18px;bottom:10px;padding:3px 12px;border:1px solid var(--%NS%morse-border);border-radius:999px;background:var(--%NS%morse-badge-bg, var(--%NS%morse-hover));color:var(--%NS%morse-badge-fg, var(--%NS%morse-fg));font-size:11.5px;box-shadow:0 4px 12px #00000040;cursor:pointer}.latest[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-active)}.inner[_ngcontent-%COMP%]{width:100%;max-width:780px;margin:0 auto;display:flex;flex-direction:column;gap:14px}.inner.blank[_ngcontent-%COMP%]{min-height:100%;justify-content:center}.user[_ngcontent-%COMP%]{align-self:flex-end;max-width:88%;padding:8px 12px;border-radius:var(--%NS%morse-radius-lg);border-bottom-right-radius:4px;background:var(--%NS%morse-bubble);border:1px solid var(--%NS%morse-border)}.user-head[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:0;min-height:14px;margin-top:4px}.user[_ngcontent-%COMP%] .user-head[_ngcontent-%COMP%] .copy-msg[_ngcontent-%COMP%]{width:0;margin:0;padding:0;overflow:hidden;opacity:0}.user[_ngcontent-%COMP%]:hover .user-head[_ngcontent-%COMP%] .copy-msg[_ngcontent-%COMP%], .user[_ngcontent-%COMP%] .user-head[_ngcontent-%COMP%] .copy-msg[_ngcontent-%COMP%]:focus-visible{width:auto;padding:0 4px;margin-left:6px;overflow:visible;opacity:1}.user[_ngcontent-%COMP%] .stamp[_ngcontent-%COMP%]{font-size:11px;color:var(--%NS%morse-fg-muted)}.assistant-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;min-height:16px;margin-top:-2px}.assistant[_ngcontent-%COMP%] .copy-msg[_ngcontent-%COMP%]{padding:1px 7px;border:1px solid transparent}.assistant[_ngcontent-%COMP%]:hover .copy-msg[_ngcontent-%COMP%], .assistant[_ngcontent-%COMP%] .copy-msg[_ngcontent-%COMP%]:focus-visible, .assistant[_ngcontent-%COMP%] .copy-msg.revealed[_ngcontent-%COMP%]{opacity:1}.copy-msg[_ngcontent-%COMP%]{padding:0 4px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);font-size:11px;line-height:1.2;cursor:pointer;opacity:0;transition:opacity .14s ease}.user[_ngcontent-%COMP%]:hover .copy-msg[_ngcontent-%COMP%], .copy-msg[_ngcontent-%COMP%]:focus-visible{opacity:1}.copy-msg[_ngcontent-%COMP%]:hover{color:var(--%NS%morse-fg);background:var(--%NS%morse-hover)}.copy-msg[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{display:block}.older[_ngcontent-%COMP%]{display:flex;justify-content:center;padding:2px 0 8px}.older-label[_ngcontent-%COMP%]{color:var(--%NS%morse-fg-muted);font-size:11px}.older-button[_ngcontent-%COMP%]{padding:3px 12px;border:1px solid var(--%NS%morse-border);border-radius:999px;background:var(--%NS%morse-panel, var(--%NS%morse-bg));color:var(--%NS%morse-fg);font-size:11px;cursor:pointer}.older-button[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}.start[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;color:var(--%NS%morse-fg-muted);font-size:11px}.start[_ngcontent-%COMP%]:before, .start[_ngcontent-%COMP%]:after{content:"";flex:1;height:1px;background:var(--%NS%morse-border)}.start[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{white-space:nowrap}.compaction[_ngcontent-%COMP%]{margin:10px 0 14px}.compaction-sep[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;padding:3px 0;border:none;background:none;color:var(--%NS%morse-fg-muted);font-size:11px;cursor:pointer}.compaction-sep[_ngcontent-%COMP%] .sep-line[_ngcontent-%COMP%]{flex:1;height:1px;background:var(--%NS%morse-border)}.compaction-sep[_ngcontent-%COMP%] .sep-label[_ngcontent-%COMP%]{white-space:nowrap;padding:1px 10px;border:1px solid var(--%NS%morse-border);border-radius:999px;background:var(--%NS%morse-hover);font-family:var(--%NS%morse-font-mono, monospace);font-size:10.5px}.compaction-sep[_ngcontent-%COMP%] .sep-tokens[_ngcontent-%COMP%]{white-space:nowrap;font-size:10.5px;color:var(--%NS%morse-fg-dim, var(--%NS%morse-fg-muted))}.compaction-sep[_ngcontent-%COMP%]:hover .sep-label[_ngcontent-%COMP%]{color:var(--%NS%morse-fg);background:var(--%NS%morse-active)}.compaction-summary[_ngcontent-%COMP%]{margin-top:8px;padding:10px 12px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-panel, var(--%NS%morse-bg));font-size:13px}.user[_ngcontent-%COMP%] .user-text[_ngcontent-%COMP%]{margin:0;word-break:break-word;font-family:var(--%NS%morse-font);line-height:1.55}.user[_ngcontent-%COMP%] .user-text[_ngcontent-%COMP%] .md[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 .5em}.user-edit[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;min-width:min(420px,60vw)}.user[_ngcontent-%COMP%] .edit-input[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;resize:vertical;min-height:60px;padding:7px 9px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-panel, var(--%NS%morse-bg));color:var(--%NS%morse-fg);font-family:var(--%NS%morse-font);font-size:inherit;line-height:1.55}.user[_ngcontent-%COMP%] .edit-input[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--%NS%morse-accent)}.user-edit[_ngcontent-%COMP%] .edit-actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:6px}.user-edit[_ngcontent-%COMP%] .edit-hint[_ngcontent-%COMP%]{margin-right:auto;font-size:10.5px;color:var(--%NS%morse-fg-muted)}.user-edit[_ngcontent-%COMP%] .edit-cancel[_ngcontent-%COMP%], .user-edit[_ngcontent-%COMP%] .edit-send[_ngcontent-%COMP%]{padding:3px 10px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg);font-size:11.5px;cursor:pointer}.user-edit[_ngcontent-%COMP%] .edit-send[_ngcontent-%COMP%]{border-color:var(--%NS%morse-accent);background:var(--%NS%morse-accent);color:#fff}.user-edit[_ngcontent-%COMP%] .edit-send[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:default}.user-edit[_ngcontent-%COMP%] .edit-cancel[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}.user-attachments[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:2px 0 6px;padding:0;list-style:none}.user-attachments[_ngcontent-%COMP%] .mention-pin[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:2px 7px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-hover);font-size:11.5px;width:220px;max-width:100%}.user-attachments[_ngcontent-%COMP%] .mention-pin[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-attachments[_ngcontent-%COMP%] .mention-pin[_ngcontent-%COMP%] .lines[_ngcontent-%COMP%]{flex:none;padding:0 5px;border-radius:999px;background:var(--%NS%morse-active);color:var(--%NS%morse-fg-muted);font-size:10.5px;font-family:var(--%NS%morse-font-mono);white-space:nowrap}.user-attachments[_ngcontent-%COMP%] .mention-pin[_ngcontent-%COMP%] .pin-icon[_ngcontent-%COMP%]{flex:none;font-size:11px;color:var(--%NS%morse-accent)}.user-attachments[_ngcontent-%COMP%] .image-chip[_ngcontent-%COMP%]{display:inline-flex;min-width:0}.user-attachments[_ngcontent-%COMP%] .image-chip-button[_ngcontent-%COMP%]{display:inline-flex;width:30px;height:30px;padding:0;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-hover);overflow:hidden;cursor:pointer}.user-attachments[_ngcontent-%COMP%] .image-chip-button[_ngcontent-%COMP%]:hover{border-color:color-mix(in srgb,var(--%NS%morse-accent) 45%,var(--%NS%morse-border));background:var(--%NS%morse-active)}.user-attachments[_ngcontent-%COMP%] .image-chip-button[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:100%;display:block;object-fit:cover;border-radius:calc(var(--%NS%morse-radius-sm) - 1px)}.image-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;padding:32px;background:#0000009e}.image-frame[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;margin:0;max-width:min(880px,92vw);max-height:92vh}.image-frame[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:100%;max-height:calc(92vh - 40px);object-fit:contain;border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-panel)}.image-frame[_ngcontent-%COMP%] figcaption[_ngcontent-%COMP%]{color:var(--%NS%morse-badge-fg, #fff);font-size:11.5px;text-align:center}.image-close[_ngcontent-%COMP%]{position:absolute;top:14px;right:18px;width:28px;height:28px;border:0;border-radius:50%;background:#00000073;color:#fff;font-size:18px;line-height:1;cursor:pointer}.image-close[_ngcontent-%COMP%]:hover{background:#000000b3}.user[_ngcontent-%COMP%] .user-text[_ngcontent-%COMP%] .mention[_ngcontent-%COMP%]{display:inline-flex;align-items:baseline;max-width:100%;vertical-align:baseline;padding:0;border:1px solid color-mix(in srgb,var(--%NS%morse-accent) 30%,transparent);border-radius:var(--%NS%morse-radius-sm);background:color-mix(in srgb,var(--%NS%morse-accent) 12%,transparent);color:color-mix(in srgb,var(--%NS%morse-accent) 75%,var(--%NS%morse-fg));cursor:pointer}.user[_ngcontent-%COMP%] .user-text[_ngcontent-%COMP%] .mention[_ngcontent-%COMP%] .mention-label[_ngcontent-%COMP%]{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 6px 1px;font-family:var(--%NS%morse-font-mono);font-size:11px}.user[_ngcontent-%COMP%] .user-text[_ngcontent-%COMP%] .mention[_ngcontent-%COMP%]:hover{border-color:color-mix(in srgb,var(--%NS%morse-accent) 60%,transparent);background:color-mix(in srgb,var(--%NS%morse-accent) 20%,transparent)}.assistant[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px}.assistant[_ngcontent-%COMP%] .who[_ngcontent-%COMP%]{font-size:11px;font-weight:600;letter-spacing:.02em;color:var(--%NS%morse-fg-muted)}.assistant[_ngcontent-%COMP%] morse-markdown[_ngcontent-%COMP%] .md{line-height:1.6}.notice[_ngcontent-%COMP%]{padding:8px 10px;border-left:2px solid var(--%NS%morse-info);border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-hover);font-size:12px;color:var(--%NS%morse-fg-muted)}.notice.warn[_ngcontent-%COMP%]{border-color:var(--%NS%morse-warn)}.notice[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{margin:0;font-family:inherit;white-space:pre-wrap;word-break:break-word}.notice.error[_ngcontent-%COMP%]{border-color:var(--%NS%morse-error);color:var(--%NS%morse-fg)}.notice.success[_ngcontent-%COMP%]{border-color:var(--%NS%morse-success)}.hero[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:8px;max-width:460px;margin:0 auto;padding:28px 14px;text-align:center}.hero-stage[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;justify-content:center;width:104px;height:104px;margin-bottom:2px}.hero-glow[_ngcontent-%COMP%]{position:absolute;width:104px;height:104px;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--%NS%morse-accent) 38%,transparent) 0%,transparent 66%);filter:blur(3px);animation:_ngcontent-%COMP%_hero-breathe 3.6s ease-in-out infinite}.hero-mark[_ngcontent-%COMP%]{position:relative;display:inline-flex;align-items:center;gap:8px}.hero-dot[_ngcontent-%COMP%]{width:12px;height:12px;border-radius:50%;background:var(--%NS%morse-fg);box-shadow:0 0 13px color-mix(in srgb,var(--%NS%morse-fg) 45%,transparent);animation:_ngcontent-%COMP%_hero-hop 3.6s ease-in-out infinite}.hero-dot[_ngcontent-%COMP%]:nth-child(2){animation-delay:.14s}.hero-dash[_ngcontent-%COMP%]{width:34px;height:12px;border-radius:999px;background:var(--%NS%morse-fg);box-shadow:0 0 13px color-mix(in srgb,var(--%NS%morse-fg) 45%,transparent);animation:_ngcontent-%COMP%_hero-hop-dash 3.6s ease-in-out infinite;animation-delay:.3s}.hero-wordmark[_ngcontent-%COMP%]{display:flex;font-size:26px;font-weight:650;line-height:1;background-image:linear-gradient(100deg,transparent 38%,color-mix(in srgb,var(--%NS%morse-fg) 45%,#fff) 50%,transparent 62%),linear-gradient(var(--%NS%morse-fg),var(--%NS%morse-fg));background-size:260% 100%,100% 100%;background-repeat:no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;animation:_ngcontent-%COMP%_hero-shimmer 3.6s ease-in-out infinite}.hero-letter[_ngcontent-%COMP%]{display:inline-block}.hero-tagline[_ngcontent-%COMP%]{font-size:10px;letter-spacing:.34em;text-transform:uppercase;color:var(--%NS%morse-fg-muted)}.hero-hint[_ngcontent-%COMP%], .hero-tips[_ngcontent-%COMP%]{margin:0;color:var(--%NS%morse-fg-muted);line-height:1.65}.hero-hint[_ngcontent-%COMP%]{margin-top:12px}.hero-tips[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{font-style:normal;color:var(--%NS%morse-fg);background:var(--%NS%morse-hover);border:1px solid var(--%NS%morse-border);border-radius:999px;padding:1px 8px;white-space:nowrap}.hero-key[_ngcontent-%COMP%]{font-family:var(--%NS%morse-font-mono);color:var(--%NS%morse-fg)}@keyframes _ngcontent-%COMP%_hero-breathe{0%,to{opacity:.75;transform:scale(.96)}50%{opacity:1;transform:scale(1.04)}}@keyframes _ngcontent-%COMP%_hero-hop{0%,14%,to{transform:translateY(0)}7%{transform:translateY(-8px)}}@keyframes _ngcontent-%COMP%_hero-hop-dash{0%,16%,to{transform:translateY(0) scale(1)}8%{transform:translateY(-6px) scale(1.08,.88)}}@keyframes _ngcontent-%COMP%_hero-shimmer{0%,38%{background-position:140% 0,0 0}62%,to{background-position:-45% 0,0 0}}@media(prefers-reduced-motion:reduce){.hero-glow[_ngcontent-%COMP%], .hero-dot[_ngcontent-%COMP%], .hero-dash[_ngcontent-%COMP%], .hero-wordmark[_ngcontent-%COMP%]{animation:none}.hero-wordmark[_ngcontent-%COMP%]{background-image:none;color:var(--%NS%morse-fg)}}.cursor[_ngcontent-%COMP%]{display:inline-block;width:7px;height:14px;vertical-align:text-bottom;background:var(--%NS%morse-accent);animation:_ngcontent-%COMP%_blink 1s step-start infinite}@keyframes _ngcontent-%COMP%_blink{50%{opacity:0}}']})};var iR=(t,e)=>e.value;function sR(t,e){t&1&&(b(0,"p",1),p(1),E()),t&2&&(u(),D(e))}function aR(t,e){if(t&1){let n=z();b(0,"button",4),q("click",function(){let r=I(n).$implicit,i=h(3);return k(i.choose(r.value))}),p(1),E()}if(t&2){let n=e.$implicit;u(),ce(" ",n.label," ")}}function cR(t,e){if(t&1&&(T(0,sR,2,1,"p",1),b(1,"div",2),_e(2,aR,2,1,"button",3,iR),E()),t&2){let n,o=h(),r=h();M((n=r.messageOf(o))?0:-1,n),u(2),be(r.optionsOf(o))}}function lR(t,e){if(t&1){let n=z();b(0,"p"),p(1),E(),b(2,"div",2)(3,"button",5),q("click",function(){I(n);let r=h(2);return k(r.decide(!0))}),p(4,"Yes"),E(),b(5,"button",4),q("click",function(){I(n);let r=h(2);return k(r.decide(!1))}),p(6,"No"),E()()}if(t&2){let n=h(),o=h();u(),D(o.messageOf(n))}}function dR(t,e){if(t&1){let n=z();b(0,"input",6),q("input",function(r){I(n);let i=h(2);return k(i.onInput(r))}),E(),b(1,"div",2)(2,"button",5),q("click",function(){I(n);let r=h(2);return k(r.submit())}),p(3,"Submit"),E(),b(4,"button",4),q("click",function(){I(n);let r=h(2);return k(r.cancel())}),p(5,"Cancel"),E()()}if(t&2){let n=h(),o=h();Ae("value",o.value()||o.prefillOf(n))("placeholder",o.placeholderOf(n))}}function uR(t,e){if(t&1){let n=z();b(0,"textarea",7),q("input",function(r){I(n);let i=h(2);return k(i.onInput(r))}),E(),b(1,"div",2)(2,"button",5),q("click",function(){I(n);let r=h(2);return k(r.submit())}),p(3,"Submit"),E(),b(4,"button",4),q("click",function(){I(n);let r=h(2);return k(r.cancel())}),p(5,"Cancel"),E()()}if(t&2){let n=h(),o=h();Ae("value",o.value()||o.prefillOf(n))}}function pR(t,e){if(t&1&&(b(0,"section",0)(1,"header"),p(2),E(),T(3,cR,4,1)(4,lR,7,1)(5,dR,6,2)(6,uR,6,1),E()),t&2){let n,o=e;u(2),D(o.title),u(),M((n=o.kind)==="select"?3:n==="confirm"?4:n==="input"?5:n==="editor"?6:-1)}}var Qd=class t{morse=N(wt);request=this.morse.pendingInteraction;value=R("");visible=S(()=>this.request()!==null&&this.morse.capabilities()?.nativeDialogs!==!0);onInput(e){this.value.set(e.target.value)}choose(e){this.respond({value:e})}decide(e){this.respond({confirmed:e})}submit(){this.respond({value:this.value()}),this.value.set("")}cancel(){this.respond({cancelled:!0}),this.value.set("")}messageOf(e){return e.kind==="select"||e.kind==="confirm"?e.message??"":""}optionsOf(e){return e.kind==="select"?e.options:[]}placeholderOf(e){return e.kind==="input"?e.placeholder??"":""}prefillOf(e){return e.kind==="editor"||e.kind==="input"?e.value??"":""}respond(e){let n=this.request();n&&this.morse.respond(H({requestId:n.requestId},e))}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-interaction-panel"]],decls:1,vars:1,consts:[["role","dialog","aria-live","polite",1,"dialog"],[1,"muted"],[1,"options"],["type","button",1,"secondary"],["type","button",1,"secondary",3,"click"],["type","button",3,"click"],["type","text",3,"input","value","placeholder"],["rows","5",3,"input","value"]],template:function(n,o){if(n&1&&T(0,pR,7,2,"section",0),n&2){let r;M((r=o.visible()&&o.request())?0:-1,r)}},styles:[".dialog[_ngcontent-%COMP%]{margin:8px;padding:8px 10px;border:1px solid var(--%NS%morse-focus);border-radius:4px;background:var(--%NS%morse-blockquote);display:flex;flex-direction:column;gap:8px}header[_ngcontent-%COMP%]{font-weight:600}p[_ngcontent-%COMP%]{margin:0;white-space:pre-wrap}.options[_ngcontent-%COMP%]{display:flex;gap:6px;flex-wrap:wrap}"]})};var Es=520,vE=70,Xd=class t{animation=N(gn);async play(e,n){let o=this.resolveTarget();if(!this.animation.isEnabled||!n||!o||e.length===0||typeof document>"u")return;let r=Es+(e.length-1)*vE;e.forEach((i,s)=>{this.launch(i,n,o,s*vE)}),await fR(r)}resolveTarget(){let e=document.querySelector("morse-chat-composer .box");if(!e)return;let n=e.getBoundingClientRect();return{x:n.left+26,y:n.top+18}}launch(e,n,o,r){let i=this.createGhost(e,n);document.body.appendChild(i);let s=Math.min(n.y,o.y)-Math.max(60,Math.abs(n.y-o.y)*.35);on(i,{translateX:[n.x,o.x],translateY:[{to:n.y,duration:Es*.18},{to:s,duration:Es*.42},{to:o.y,duration:Es*.4}],rotate:[0,-8,6,0],scale:[1,1.04,.86,.42],opacity:[1,1,.9,0],duration:Es,delay:r,ease:"inOut(2)",onComplete:()=>i.remove()}),setTimeout(()=>i.remove(),r+Es+400)}createGhost(e,n){let o=document.createElement("div");if(o.className="drop-ghost",e.thumbnail){let i=document.createElement("img");i.src=e.thumbnail,i.alt="",o.appendChild(i)}else{let i=document.createElement("span");i.className="drop-ghost-glyph",i.textContent="\u25A4",o.appendChild(i)}let r=document.createElement("span");return r.className="drop-ghost-name",r.textContent=e.name,o.appendChild(r),o}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Oe({token:t,factory:t.\u0275fac,providedIn:"root"})};function fR(t){return new Promise(e=>setTimeout(e,t))}var Jd=class t{attachments=N(Cr);flight=N(Xd);uploads=N(ms);depth=R(0);internalDrag=!1;constructor(){if(typeof document>"u")return;let e=()=>{this.internalDrag=!0},n=()=>{this.internalDrag=!1};document.addEventListener("dragstart",e,!0),document.addEventListener("dragend",n,!0),document.addEventListener("drop",n,!0)}active=S(()=>this.depth()>0);carriesFiles(e){if(this.internalDrag)return!1;let n=e.dataTransfer?.types;return n!==void 0&&n.length>0}onDragEnter(e){this.carriesFiles(e)&&(e.preventDefault(),this.depth.update(n=>n+1))}onDragOver(e){this.carriesFiles(e)&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy"))}onDragLeave(){this.depth.update(e=>Math.max(0,e-1))}async onDrop(e,n){if(this.depth.set(0),!this.carriesFiles(e))return;e.preventDefault();let o=e.dataTransfer;if(!o)return;let r=Array.from(o.files??[]),{images:i}=await this.attachments.read(r.filter(C=>C.type.startsWith("image/"))),s=gR(o),a=r.filter(C=>!C.type.startsWith("image/")),c=this.uploads.available()&&a.length>0?this.uploads.upload(a):Promise.resolve({added:[],failed:a.map(C=>C.name)}),l=[...s.paths.map(C=>_E(C,n)),...s.names,...a.map(C=>C.name)],d=e.clientX>0||e.clientY>0?{x:e.clientX,y:e.clientY}:mR();await this.flight.play([...i.map(C=>({name:C.name,thumbnail:`data:${C.mimeType};base64,${C.data}`})),...l.map(C=>({name:C}))],d);let f=await c,y=[...s.paths.map(C=>_E(C,n)),...s.names,...f.added.map(C=>C.path),...f.failed];this.attachments.add(i),this.attachments.addMentions(y);let v=[];if(i.length>0&&v.push(`${i.length} image${i.length===1?"":"s"} attached`),y.length>0&&v.push(`${y.length} file${y.length===1?"":"s"} added to the prompt`),v.length>0){this.attachments.say("info",v.join(" \xB7 "));return}let x=Array.from(o.types??[]).join(", ")||"none";this.attachments.say("warn",`That drop carried no file (types: ${x}).`)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Oe({token:t,factory:t.\u0275fac,providedIn:"root"})};function mR(){let t=document.querySelector("main.chat");if(!t)return{x:0,y:0};let e=t.getBoundingClientRect();return{x:e.left+e.width/2,y:e.top+e.height*.35}}var hR=["application/vnd.code.uri-list","ResourceURLs","text/uri-list"];function gR(t){let e=[];for(let r of[...hR,"text/plain"])for(let i of yR(t.getData(r)))e.push(i);let n=[],o=[];for(let r of e){if(r.startsWith("file://")){let s=xR(r);s&&n.push(s);continue}if(/^[a-z]+:\/\//i.test(r))continue;if(bR(r)){n.push(r);continue}let i=_R(r);i&&o.push(i)}return{paths:Array.from(new Set(n)),names:Array.from(new Set(o))}}function yR(t){let e=t.trim();if(e.length===0)return[];if(e.startsWith("["))try{let n=JSON.parse(e);if(Array.isArray(n))return n.map(o=>{if(typeof o=="string")return o;let r=o,i=r.fsPath??r.uri??r.path;return typeof i=="string"?i:""}).filter(o=>o.length>0)}catch{}return vR(e)}function vR(t){return t.split(/\r?\n/).flatMap(e=>e.split(/(?<=\S)\s+(?=[/\\]|[A-Za-z]:[\\/])/)).map(e=>e.trim()).filter(e=>e.length>0&&!e.startsWith("#"))}function _R(t){let e=t.replace(/\s*\([^)]*\)\s*$/,"").trim();if(!(e.length===0||e.length>200)&&!(/\s/.test(e)||e.includes(":")))return/[^/\\]+\.[A-Za-z0-9]{1,8}$/.test(e)?e:void 0}function bR(t){return!!(t.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t))}function xR(t){try{let e=new URL(t);return decodeURIComponent(e.pathname)}catch{return}}function _E(t,e){if(!e)return t;let n=e.endsWith("/")?e:`${e}/`;return t.startsWith(n)?t.slice(n.length):t}var ER="https://registry.npmjs.org/@supanadit/morse-web/latest";function CR(t){return`https://github.com/supanadit/morse/releases/tag/v${t}`}var wR=new ze("morse.update.loader",{providedIn:"root",factory:()=>{let t=globalThis.fetch;if(t===void 0)return;let e=t.bind(globalThis);return async n=>(await e(n,{headers:{accept:"application/json"}})).json()}});function SR(t){let e=t;return typeof e?.version=="string"?e.version:void 0}function TR(t,e){let n=xE(t),o=xE(e);if(n===void 0||o===void 0)return!1;for(let r=0;r<n.numbers.length;r+=1)if(n.numbers[r]!==o.numbers[r])return n.numbers[r]>o.numbers[r];return n.prerelease===o.prerelease?!1:n.prerelease===void 0?!0:o.prerelease===void 0?!1:n.prerelease>o.prerelease}function MR(t,e){return t==="vscode"?`Update the Morse extension \u2014 VS Code does that on its own for a Marketplace install \u2014 or install the ${e} VSIX and reload the window.`:`Run npm install -g @supanadit/morse-web@${e}, then start the host again.`}function bE(){if(typeof location>"u")return;let t=new URL(location.href,"http://localhost/").searchParams.get("newer");return t!==null&&t.length>0?t:void 0}function xE(t){let e=/^(\d+)\.(\d+)\.(\d+)(?:-([\w.-]+))?(?:\+[\w.-]+)?$/.exec(t.trim());if(e!==null)return{numbers:[Number(e[1]),Number(e[2]),Number(e[3])],prerelease:e[4]}}var Cs=class t{morse=N(wt);loader=N(wR);notice=R(void 0);started=!1;available=this.notice.asReadonly();constructor(){ue(()=>{let e=this.morse.capabilities();this.started||bE()===void 0&&e?.updateCheck!==!0||(this.started=!0,this.check(this.morse.version(),e?.hostKind??"server"))})}async check(e,n,o=this.loader){try{let r=bE()??(o===void 0?void 0:SR(await o(ER)));if(r===void 0||!TR(r,e))return;this.notice.set({current:e,latest:r,hint:MR(n,r),url:CR(r)})}catch{}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Oe({token:t,factory:t.\u0275fac,providedIn:"root"})};var IR=["search"],kR=["list"],NR=(t,e)=>e.path||"all";function DR(t,e){if(t&1&&(b(0,"span",17),p(1),E()),t&2){let n=h().$implicit;u(),D(n.path)}}function OR(t,e){t&1&&(b(0,"span",19),p(1,"\u2713"),E())}function PR(t,e){if(t&1){let n=z();b(0,"button",15),q("mouseenter",function(){let r=I(n).$index,i=h();return k(i.active.set(r))})("click",function(){let r=I(n).$implicit,i=h();return k(i.pick(r))}),b(1,"span",16),p(2),E(),T(3,DR,2,1,"span",17),b(4,"span",18),p(5),E(),T(6,OR,2,0,"span",19),E()}if(t&2){let n=e.$implicit,o=h();Te("all",n.all)("active",n.path===o.rows()[o.active()].path)("selected",n.path===o.selected()),Ae("title",n.path||"Every project pi knows about"),pe("aria-selected",n.path===o.selected()),u(2),D(n.name),u(),M(n.all?-1:3),u(2),D(n.sessionCount),u(),M(n.path===o.selected()?6:-1)}}var AR="All projects";function RR(t,e,n){let o={path:"",name:AR,sessionCount:n,all:!0},r=e.trim().toLowerCase(),i=t.filter(s=>r.length===0||`${s.name} ${s.path}`.toLowerCase().includes(r)).map(s=>Q(H({},s),{all:!1}));return[o,...i]}var eu=class t{projects=ee.required();selected=ee("");totalSessions=ee(0);select=rt();close=rt();search=at("search");list=at("list");query=R("");active=R(0);rows=S(()=>RR(this.projects(),this.query(),this.totalSessions()));constructor(){si(()=>this.search()?.nativeElement.focus()),ue(()=>{if(this.query().trim().length>0)return;let e=this.rows().findIndex(n=>n.path===this.selected());e>=0&&this.active.set(e)}),ue(()=>{this.active(),this.rows(),setTimeout(()=>this.revealActive(),0)})}revealActive(){let e=this.list()?.nativeElement,n=e?.querySelectorAll(".row")[this.active()];if(!e||!n)return;let o=e.getBoundingClientRect(),r=n.getBoundingClientRect();r.top<o.top?e.scrollTop-=o.top-r.top:r.bottom>o.bottom&&(e.scrollTop+=r.bottom-o.bottom)}onQuery(e){this.query.set(e.target.value),this.active.set(0)}pick(e){this.select.emit(e.path)}onKeydown(e){let n=this.rows();switch(e.key){case"Escape":e.preventDefault(),this.close.emit();return;case"ArrowDown":e.preventDefault(),this.active.update(o=>Math.min(o+1,Math.max(0,n.length-1)));return;case"ArrowUp":e.preventDefault(),this.active.update(o=>Math.max(0,o-1));return;case"Enter":{let o=n[this.active()];o&&(e.preventDefault(),this.pick(o));return}default:return}}onEscape(){this.close.emit()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-project-filter"]],viewQuery:function(n,o){n&1&&vt(o.search,IR,5)(o.list,kR,5),n&2&&bt(2)},hostBindings:function(n,o){n&1&&L("keydown.escape",function(){return o.onEscape()},Ot)},inputs:{projects:[1,"projects"],selected:[1,"selected"],totalSessions:[1,"totalSessions"]},outputs:{select:"select",close:"close"},decls:18,vars:1,consts:[["search",""],["list",""],[1,"modal-layer",3,"click"],["role","dialog","aria-modal","true","aria-labelledby","project-filter-title",1,"modal-card",3,"click"],[1,"modal-head"],["id","project-filter-title"],["type","button","aria-label","Close",1,"close",3,"click"],[1,"search"],["aria-hidden","true",1,"search-icon"],["viewBox","0 0 16 16"],["cx","7","cy","7","r","4.2"],["d","M10.2 10.2 14 14"],["type","text","placeholder","Search projects","aria-label","Search projects",3,"input","keydown","value"],["role","listbox",1,"list"],["type","button","role","option",1,"row",3,"all","active","selected","title"],["type","button","role","option",1,"row",3,"mouseenter","click","title"],[1,"name"],[1,"path"],[1,"count"],["aria-hidden","true",1,"check"]],template:function(n,o){n&1&&(b(0,"div",2),q("click",function(){return o.close.emit()}),b(1,"div",3),q("click",function(i){return i.stopPropagation()}),b(2,"div",4)(3,"strong",5),p(4,"Filter by project"),E(),b(5,"button",6),q("click",function(){return o.close.emit()}),p(6,"\xD7"),E()(),b(7,"div",7)(8,"span",8),Tt(),b(9,"svg",9),$e(10,"circle",10)(11,"path",11),E()(),fn(),b(12,"input",12,0),q("input",function(i){return o.onQuery(i)})("keydown",function(i){return o.onKeydown(i)}),E()(),b(14,"div",13,1),_e(16,PR,7,12,"button",14,NR),E()()()),n&2&&(u(12),Ae("value",o.query()),u(4),be(o.rows()))},styles:["[_nghost-%COMP%]{display:contents}.modal-layer[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:65;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000073}.modal-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:min(520px,100%);max-height:min(640px,90vh);border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-lg);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 18px 48px #0006;overflow:hidden}.modal-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:12px 14px;border-bottom:1px solid var(--%NS%morse-border)}.modal-head[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{flex:1;min-width:0;font-size:13px}.modal-head[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{padding:2px 8px;border:0;background:transparent;color:var(--%NS%morse-fg-muted);font-size:16px;line-height:1;cursor:pointer}.modal-head[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]:hover{color:var(--%NS%morse-fg)}.search[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;padding:10px 14px;border-bottom:1px solid var(--%NS%morse-border)}.search-icon[_ngcontent-%COMP%]{position:absolute;left:23px;display:inline-flex;color:var(--%NS%morse-fg-muted);pointer-events:none}.search-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round}.search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;min-width:0;padding-left:30px;font-size:12.5px}.list[_ngcontent-%COMP%]{flex:1;min-height:120px;overflow-y:auto;padding:4px 6px}.row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;padding:6px 8px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg);font:inherit;font-size:12.5px;text-align:left;cursor:pointer}.row.active[_ngcontent-%COMP%], .row[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}.row.selected[_ngcontent-%COMP%]{background:var(--%NS%morse-active)}.row.all[_ngcontent-%COMP%]{margin-bottom:4px;border-bottom:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm) var(--%NS%morse-radius-sm) 0 0}.name[_ngcontent-%COMP%]{flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.path[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--%NS%morse-fg-muted);font-size:11px}.count[_ngcontent-%COMP%]{flex:none;color:var(--%NS%morse-fg-muted);font-size:11px}.check[_ngcontent-%COMP%]{flex:none;color:var(--%NS%morse-accent);font-size:12px}.empty[_ngcontent-%COMP%]{padding:12px 8px;color:var(--%NS%morse-fg-muted);font-size:12px}"]})};var LR=["search"],EE=(t,e)=>e.path,FR=(t,e)=>e.id;function VR(t,e){if(t&1){let n=z();g(0,"button",15),L("click",function(){I(n);let r=h();return k(r.openFilter())}),g(1,"span",16),p(2,"\u25A4"),_(),g(3,"span",17),p(4),_()()}if(t&2){let n=h();Te("filtered",n.selectedProject()!==void 0),K("title",n.selectedProject()?.path??"Every project pi knows about"),pe("aria-expanded",n.filterOpen()),u(4),D(n.selectedProject()?.name??"All projects")}}function jR(t,e){if(t&1){let n=z();g(0,"morse-project-filter",18),L("select",function(r){I(n);let i=h();return k(i.onProjectSelect(r))})("close",function(){I(n);let r=h();return k(r.closeFilter())}),_()}if(t&2){let n=h();K("projects",n.projectOptions())("selected",n.projectFilter())("totalSessions",n.totalSessions())}}function $R(t,e){if(t&1&&(g(0,"span",25),p(1,"\u203A"),_()),t&2){let n=h(2).$implicit,o=h();Te("open",!o.isCollapsed(n.path))}}function HR(t,e){if(t&1){let n=z();g(0,"div",19)(1,"button",20),L("click",function(){I(n);let r=h().$implicit,i=h();return k(i.toggleGroup(r.path))}),g(2,"span",21),p(3),_(),g(4,"span",22),p(5),_(),T(6,$R,2,2,"span",23),_(),g(7,"button",24),L("click",function(r){I(n);let i=h().$implicit,s=h();return k(s.newSession(r,i.path))}),p(8," + "),_()()}if(t&2){let n=h().$implicit,o=h();u(),K("title",n.path),pe("aria-expanded",!o.isCollapsed(n.path)),u(2),D(n.name),u(2),D(n.sessions.length),u(),M(o.projectFilter()!==n.path?6:-1),u(),pe("aria-label","New session in "+n.name)}}function BR(t,e){t&1&&we(0,"span",28)}function UR(t,e){if(t&1){let n=z();g(0,"li")(1,"button",27),L("click",function(){let r=I(n).$implicit,i=h(3);return k(i.activate(r))})("contextmenu",function(r){let i=I(n).$implicit,s=h(3);return k(s.openMenu(r,i))}),T(2,BR,1,0,"span",28),g(3,"span",29),p(4),_(),g(5,"span",30),p(6),_()()()}if(t&2){let n=e.$implicit,o=h(3);u(),Te("active",n.id===o.activeSessionId())("running",o.isRunning(n)),K("title",n.id),u(),M(o.isRunning(n)?2:-1),u(2),D(n.title),u(2),Ln("",n.messageCount," \xB7 ",o.age(n.updatedAt))}}function zR(t,e){if(t&1&&p(0),t&2){let n=h(4);ce(" No session matches \u201C",n.query(),"\u201D. ")}}function qR(t,e){t&1&&p(0," No sessions yet. ")}function GR(t,e){if(t&1&&(g(0,"li",26),T(1,zR,1,1)(2,qR,1,0),_()),t&2){let n=h(3);u(),M(n.query().length>0?1:2)}}function WR(t,e){if(t&1&&(g(0,"ul"),_e(1,UR,7,9,"li",null,FR,!1,GR,3,1,"li",26),_()),t&2){let n=h().$implicit;u(),be(n.sessions)}}function YR(t,e){if(t&1&&(g(0,"section",9),T(1,HR,9,6,"div",19),T(2,WR,4,1,"ul"),_()),t&2){let n=e.$implicit,o=h();u(),M(o.scope()==="global"?1:-1),u(),M(o.scope()==="workspace"||!o.isCollapsed(n.path)?2:-1)}}function ZR(t,e){t&1&&p(0," Looking for a project? ")}function KR(t,e){if(t&1&&(p(0),T(1,ZR,1,0)),t&2){let n=h(2);ce(" No session matches \u201C",n.query(),"\u201D. "),u(),M(n.projectMatches().length>0?1:-1)}}function QR(t,e){t&1&&p(0," Nothing found. ")}function XR(t,e){if(t&1){let n=z();g(0,"button",32),L("click",function(){let r=I(n).$implicit,i=h(2);return k(i.filterToProject(r))}),p(1),_()}if(t&2){let n=e.$implicit;u(),Ln(" Show all ",n.sessionCount," sessions in ",n.name," ")}}function JR(t,e){if(t&1&&(g(0,"p",26),T(1,KR,2,2)(2,QR,1,0),_(),_e(3,XR,2,2,"button",31,EE)),t&2){let n=h();u(),M(n.query().length>0?1:2),u(2),be(n.projectMatches())}}function eL(t,e){if(t&1&&(g(0,"a",11)(1,"span",33),p(2,"\u2191"),_(),g(3,"span"),p(4,"Update available"),_(),g(5,"span",13),p(6),_()()),t&2){let n=e;K("href",n.url,yo)("title",n.hint+" You are on v"+n.current+"."),u(6),ce("v",n.latest)}}function tL(t,e){t&1&&(g(0,"span",13),p(1),_()),t&2&&(u(),ce("v",e))}function nL(t,e){if(t&1){let n=z();g(0,"p",36),p(1,"Delete this session?"),_(),g(2,"p",37),p(3),_(),g(4,"button",38),L("click",function(){I(n);let r=h(2);return k(r.closeMenu())}),p(5,"Cancel"),_(),g(6,"button",39),L("click",function(){I(n);let r=h(),i=h();return k(i.deleteNow(r.session))}),p(7," Delete "),_()}if(t&2){let n=h();u(3),D(n.session.title)}}function oL(t,e){if(t&1){let n=z();g(0,"button",38),L("click",function(){I(n);let r=h(),i=h();return k(i.closeNow(r.session))}),p(1," Close session "),_(),g(2,"button",39),L("click",function(){I(n);let r=h(),i=h();return k(i.askDelete(r))}),p(3," Delete session\u2026 "),_()}}function rL(t,e){if(t&1){let n=z();g(0,"div",34),L("click",function(){I(n);let r=h();return k(r.closeMenu())})("contextmenu",function(r){I(n);let i=h();return r.preventDefault(),k(i.closeMenu())}),_(),g(1,"div",35),T(2,nL,8,1)(3,oL,4,0),_()}if(t&2){let n=e;u(),Oo("left",n.x,"px")("top",n.y,"px"),u(),M(n.confirming?2:3)}}var tu=class t{morse=N(wt);shell=N(rn);shortcuts=N(ro);update=N(Cs);destroyRef=N(ht);searchInput=at("search");query=R("");collapsed=R({});menu=R(void 0);projectFilter=R("");filterOpen=this.shell.projectFilterOpen;nativeDialogs=S(()=>this.morse.capabilities()?.nativeDialogs===!0);activeSessionId=S(()=>this.morse.state().sessionId);version=this.morse.version;updateNotice=this.update.available;sessionActivity=this.morse.sessionActivity;scope=S(()=>this.morse.capabilities()?.scope??"global");directoryPicker=S(()=>this.morse.capabilities()?.directoryPicker===!0);isRunning(e){let n=this.sessionActivity().get(e.id);return n!==void 0?n.streaming||n.busy:e.id===this.activeSessionId()&&this.morse.running()}groups=S(()=>{let e=this.morse.sessions();if(this.scope()==="workspace"){let n=this.morse.workspace(),o=this.morse.projects()[0];return[{path:o?.path??n.cwd,name:n.name||o?.name||"workspace",sessions:e}]}return this.morse.projects().map(n=>({path:n.path,name:n.name,sessions:e.filter(o=>o.cwd===n.path)}))});visibleGroups=S(()=>{let e=this.query().trim().toLowerCase(),n=this.projectFilter();return(n.length===0?this.groups():this.groups().filter(r=>r.path===n)).map(r=>Q(H({},r),{sessions:e.length===0?r.sessions:r.sessions.filter(i=>i.title.toLowerCase().includes(e))})).filter(r=>n.length>0||e.length===0||r.sessions.length>0)});filterable=S(()=>this.scope()==="global");projectOptions=S(()=>this.groups().map(e=>({path:e.path,name:e.name,sessionCount:e.sessions.length})));selectedProject=S(()=>this.projectOptions().find(e=>e.path===this.projectFilter()));totalSessions=S(()=>this.morse.sessions().length);projectMatches=S(()=>{let e=this.query().trim().toLowerCase();return e.length===0||this.projectFilter().length>0?[]:this.projectOptions().filter(n=>`${n.name} ${n.path}`.toLowerCase().includes(e))});constructor(){let e=[this.shortcuts.bind("session.new",()=>this.startSession()),this.shortcuts.bind("session.search",()=>this.focusSearch()),this.shortcuts.bind("project.filter",()=>this.openFilterFromKeyboard(),()=>this.filterable())];this.destroyRef.onDestroy(()=>{for(let n of e)n()})}isCollapsed(e){return this.projectFilter()===e?!1:this.collapsed()[e]===!0}toggleGroup(e){this.projectFilter()!==e&&this.collapsed.update(n=>Q(H({},n),{[e]:n[e]!==!0}))}activate(e){this.morse.activateSession(e.id,e.cwd),this.shell.closeNavigation()}openMenu(e,n){e.preventDefault(),e.stopPropagation(),this.menu.set({x:Math.max(0,Math.min(e.clientX,window.innerWidth-200)),y:Math.max(0,Math.min(e.clientY,window.innerHeight-104)),session:n,confirming:!1})}closeMenu(){this.menu.set(void 0)}closeNow(e){this.closeMenu(),this.morse.closeSession(e.id)}askDelete(e){if(this.nativeDialogs()){this.confirmOnHost(e);return}this.menu.set(Q(H({},e),{confirming:!0}))}async confirmOnHost(e){let n=await this.morse.requestHostCommand("confirmDeleteSession",{sessionId:e.session.id,title:e.session.title});if(n===void 0){this.menu.set(Q(H({},e),{confirming:!0}));return}this.closeMenu(),n.confirmed===!0&&this.morse.deleteSession(e.session.id)}deleteNow(e){this.closeMenu(),this.morse.deleteSession(e.id)}onEscape(){if(this.filterOpen()){this.closeFilter();return}this.menu()!==void 0&&this.closeMenu()}openFilter(){this.shell.openProjectFilter()}closeFilter(){this.shell.closeProjectFilter()}onProjectSelect(e){this.projectFilter.set(e),this.closeFilter()}filterToProject(e){this.projectFilter.set(e.path),this.query.set(""),this.closeFilter()}openAbout(){this.shell.openAbout()}openShortcuts(){this.shell.openShortcuts()}newSession(e,n){e.stopPropagation(),this.startSession(n)}startSession(e){if(e===void 0&&this.directoryPicker()){this.shell.openProjectPicker(),this.shell.closeNavigation();return}this.morse.newSession(e??this.morse.workspace().cwd),this.shell.closeNavigation()}revealNavigation(){this.shell.unfoldNavigation();let e=this.searchInput()?.nativeElement.getBoundingClientRect();(e===void 0||e.width===0||e.right<=0)&&this.shell.openNavigation()}focusSearch(){this.revealNavigation(),setTimeout(()=>{let e=this.searchInput()?.nativeElement;e?.focus(),e?.select()},0)}openFilterFromKeyboard(){this.revealNavigation(),this.shell.openProjectFilter()}refresh(){this.morse.requestProjects(),this.morse.requestSessions()}onQuery(e){this.query.set(e.target.value)}age(e){if(e<=0)return"";let n=Math.max(0,Math.round((Date.now()-e)/1e3));if(n<60)return`${n}s`;let o=Math.round(n/60);if(o<60)return`${o}m`;let r=Math.round(o/60);return r<24?`${r}h`:`${Math.round(r/24)}d`}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-session-nav"]],viewQuery:function(n,o){n&1&&vt(o.searchInput,LR,5),n&2&&bt()},hostBindings:function(n,o){n&1&&L("keydown.escape",function(){return o.onEscape()},Ot)},decls:24,vars:7,consts:[["search",""],[1,"head"],["type","button",1,"primary",3,"click"],["type","button","title","Refresh",1,"secondary","icon",3,"click"],[1,"filters"],["type","button","aria-haspopup","dialog",1,"secondary","scope",3,"filtered","title"],["type","search","placeholder","Search sessions\u2026","aria-label","Search sessions",3,"input","value"],[3,"projects","selected","totalSessions"],[1,"list"],[1,"group"],[1,"foot"],["target","_blank","rel","noreferrer noopener",1,"notice",3,"href","title"],["type","button","title","Every key Morse understands",3,"click"],[1,"stamp"],["type","button","title","About Morse and the technologies it uses",3,"click"],["type","button","aria-haspopup","dialog",1,"secondary","scope",3,"click","title"],["aria-hidden","true",1,"scope-glyph"],[1,"scope-name"],[3,"select","close","projects","selected","totalSessions"],[1,"group-head"],["type","button",1,"group-title",3,"click","title"],[1,"name"],[1,"count"],[1,"chevron",3,"open"],["type","button","title","New session in this project",1,"group-new",3,"click"],[1,"chevron"],[1,"empty"],["type","button",1,"session",3,"click","contextmenu","title"],["aria-hidden","true",1,"pulse"],[1,"title"],[1,"meta"],["type","button",1,"empty-action"],["type","button",1,"empty-action",3,"click"],["aria-hidden","true",1,"notice-glyph"],[1,"context-menu-layer",3,"click","contextmenu"],["role","menu",1,"context-menu"],[1,"context-menu-question"],[1,"context-menu-title"],["type","button",1,"context-menu-item",3,"click"],["type","button",1,"context-menu-item","danger",3,"click"]],template:function(n,o){if(n&1&&(g(0,"div",1)(1,"button",2),L("click",function(i){return o.newSession(i)}),p(2," New session "),_(),g(3,"button",3),L("click",function(){return o.refresh()}),p(4,"\u27F3"),_()(),g(5,"div",4),T(6,VR,5,5,"button",5),g(7,"input",6,0),L("input",function(i){return o.onQuery(i)}),_()(),T(9,jR,1,3,"morse-project-filter",7),g(10,"div",8),_e(11,YR,3,2,"section",9,EE,!1,JR,5,1),_(),g(14,"div",10),T(15,eL,7,3,"a",11),g(16,"button",12),L("click",function(){return o.openShortcuts()}),p(17," Keyboard shortcuts "),g(18,"span",13),p(19,"?"),_()(),g(20,"button",14),L("click",function(){return o.openAbout()}),p(21," About Morse "),T(22,tL,2,1,"span",13),_()(),T(23,rL,4,5)),n&2){let r,i,s;u(6),M(o.filterable()?6:-1),u(),K("value",o.query()),u(2),M(o.filterOpen()?9:-1),u(2),be(o.visibleGroups()),u(4),M((r=o.updateNotice())?15:-1,r),u(7),M((i=o.version())?22:-1,i),u(),M((s=o.menu())?23:-1,s)}},dependencies:[eu],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;min-height:0;height:100%;background:var(--%NS%morse-nav-bg);border-right:1px solid var(--%NS%morse-border)}.head[_ngcontent-%COMP%]{flex:none;display:flex;align-items:center;gap:6px;min-height:var(--%NS%morse-head-height);padding:0 10px;border-bottom:1px solid var(--%NS%morse-border)}.head[_ngcontent-%COMP%] button.primary[_ngcontent-%COMP%]{flex:1;padding:5px 10px}.filters[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;padding:8px 10px 4px}.scope[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;justify-content:flex-start;width:100%}.scope.filtered[_ngcontent-%COMP%]{border-color:var(--%NS%morse-accent)}.scope-glyph[_ngcontent-%COMP%]{flex:none;color:var(--%NS%morse-fg-muted);font-size:11px}.scope-name[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}.empty-action[_ngcontent-%COMP%]{display:block;width:calc(100% - 16px);margin:0 8px 6px;padding:4px 8px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-link);font-size:11.5px;text-align:left;cursor:pointer}.empty-action[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}input[_ngcontent-%COMP%]{width:100%}.list[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;padding:4px 6px 10px}.group[_ngcontent-%COMP%] + .group[_ngcontent-%COMP%]{margin-top:6px}.group-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:2px}.group-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;flex:1;min-width:0;padding:5px 6px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);font-size:11px;font-weight:600;letter-spacing:.03em;text-transform:uppercase;cursor:pointer}.group-title[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}.group-title[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}.group-title[_ngcontent-%COMP%] .count[_ngcontent-%COMP%]{flex:none}.group-new[_ngcontent-%COMP%]{flex:none;padding:1px 6px 2px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);font-size:15px;line-height:1.2;cursor:pointer}.group-new[_ngcontent-%COMP%]:hover, .group-new[_ngcontent-%COMP%]:focus-visible{background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.group-title[_ngcontent-%COMP%] .path[_ngcontent-%COMP%]{max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:rtl;font-weight:400;text-transform:none}.chevron[_ngcontent-%COMP%]{transition:transform .12s ease}.chevron.open[_ngcontent-%COMP%]{transform:rotate(90deg)}ul[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0}.session[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;width:100%;padding:5px 8px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg);text-align:left;cursor:pointer}.session[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}.session.active[_ngcontent-%COMP%]{background:var(--%NS%morse-active);font-weight:500;box-shadow:inset 2px 0 0 var(--%NS%morse-accent)}.session[_ngcontent-%COMP%] .pulse[_ngcontent-%COMP%]{flex:none;position:relative;width:7px;height:7px;border-radius:50%;background:var(--%NS%morse-accent)}.session[_ngcontent-%COMP%] .pulse[_ngcontent-%COMP%]:after{content:"";position:absolute;inset:0;border-radius:50%;background:var(--%NS%morse-accent);animation:_ngcontent-%COMP%_morse-pulse 1.5s ease-out infinite}@keyframes _ngcontent-%COMP%_morse-pulse{0%{transform:scale(1);opacity:.6}to{transform:scale(2.6);opacity:0}}.session[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%]{font-size:11px;white-space:nowrap;opacity:.8}.context-menu-layer[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:40}.context-menu[_ngcontent-%COMP%]{position:fixed;z-index:41;width:220px;max-width:min(280px,90vw);padding:4px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 8px 24px #00000059}.context-menu-question[_ngcontent-%COMP%]{margin:3px 7px 0;font-size:11.5px;color:var(--%NS%morse-fg)}.context-menu-title[_ngcontent-%COMP%]{margin:2px 7px 6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:var(--%NS%morse-fg-muted)}.context-menu-item[_ngcontent-%COMP%]{display:block;width:100%;padding:5px 8px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg);font-size:12px;text-align:left;cursor:pointer}.context-menu-item[_ngcontent-%COMP%]:hover, .context-menu-item[_ngcontent-%COMP%]:focus-visible{background:var(--%NS%morse-hover)}.context-menu-item.danger[_ngcontent-%COMP%]{color:var(--%NS%morse-error)}.empty[_ngcontent-%COMP%]{padding:8px;font-size:12px;color:var(--%NS%morse-fg-muted)}.foot[_ngcontent-%COMP%]{flex:none;padding:4px 6px 6px;border-top:1px solid var(--%NS%morse-border)}.foot[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .foot[_ngcontent-%COMP%] .notice[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;width:100%;padding:5px 8px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);font-size:11px;text-align:left;cursor:pointer}.foot[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.foot[_ngcontent-%COMP%] .notice[_ngcontent-%COMP%]{color:var(--%NS%morse-accent);text-decoration:none}.foot[_ngcontent-%COMP%] .notice[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover);color:var(--%NS%morse-accent)}.foot[_ngcontent-%COMP%] .notice[_ngcontent-%COMP%] .notice-glyph[_ngcontent-%COMP%]{flex:none;font-size:11px}.foot[_ngcontent-%COMP%] .stamp[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right;font-family:var(--%NS%morse-font-mono);font-size:10px}']})};var CE=(t,e)=>e.path;function iL(t,e){if(t&1){let n=z();b(0,"button",20),q("click",function(){let r=I(n).$implicit,i=h(2);return k(i.go(r.path))}),p(1),E()}if(t&2){let n=e.$implicit;Ae("title",n.path),u(),ce(" ",n.name," ")}}function sL(t,e){if(t&1&&(b(0,"div",9),_e(1,iL,2,2,"button",19,CE),E()),t&2){let n=h();u(),be(n.roots())}}function aL(t,e){t&1&&(b(0,"p",11),p(1,"Reading folder\u2026"),E())}function cL(t,e){t&1&&(b(0,"p",12),p(1),E()),t&2&&(u(),D(e))}function lL(t,e){if(t&1){let n=z();b(0,"button",22),q("click",function(){let r=I(n),i=h(2);return k(i.go(r))}),b(1,"span",23),p(2,"\u21B0"),E(),b(3,"span",24),p(4,".."),E()()}t&2&&Ae("title",e)}function dL(t,e){if(t&1){let n=z();b(0,"button",22),q("click",function(){let r=I(n).$implicit,i=h(2);return k(i.go(r.path))}),b(1,"span",23),p(2,"\u25B8"),E(),b(3,"span",24),p(4),E()()}if(t&2){let n=e.$implicit;Ae("title",n.path),u(4),D(n.name)}}function uL(t,e){t&1&&(b(0,"p",11),p(1,"No subfolders here."),E())}function pL(t,e){if(t&1&&T(0,uL,2,0,"p",11),t&2){let n=h(2);M(n.parent()===void 0&&n.directories().length===0?0:-1)}}function fL(t,e){if(t&1&&(T(0,lL,5,1,"button",21),_e(1,dL,5,2,"button",21,CE,!1,pL,1,1)),t&2){let n,o=h();M((n=o.parent())?0:-1,n),u(),be(o.directories())}}function mL(t,e){t&1&&(b(0,"em"),p(1," \xB7 not in MORSE_PROJECTS"),E())}function hL(t,e){t&1&&(b(0,"em",15),p(1," \xB7 git"),E())}var nu=class t{morse=N(wt);shell=N(rn);loading=R(!1);error=R(void 0);path=R("");draftPath=R("");parent=R(void 0);directories=R([]);roots=R([]);isGitRepo=R(!1);canOpen=R(!1);constructor(){this.load()}go(e){let n=e?.trim();this.load(n&&n.length>0?n:void 0)}onPathInput(e){this.draftPath.set(e.target.value)}close(){this.shell.closeProjectPicker()}confirm(){let e=this.path();e.length===0||!this.canOpen()||(this.morse.newSession(e),this.shell.closeNavigation(),this.close())}onEscape(){this.close()}load(e){this.loading.set(!0),this.error.set(void 0),this.morse.requestHostCommand("listDirectories",e?{path:e}:void 0).then(n=>{this.loading.set(!1);let o=n;if(!o||typeof o.path!="string"){this.error.set("That folder could not be read.");return}this.path.set(o.path),this.draftPath.set(o.path),this.parent.set(o.parent),this.directories.set(o.directories??[]),this.roots.set(o.roots??[]),this.isGitRepo.set(o.isGitRepo===!0),this.canOpen.set(o.canOpen===!0)})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-project-picker"]],hostBindings:function(n,o){n&1&&L("keydown.escape",function(){return o.onEscape()},Ot)},decls:30,vars:10,consts:[[1,"modal-layer",3,"click"],["role","dialog","aria-modal","true","aria-label","Choose the folder for a new session",1,"modal-card",3,"click"],[1,"modal-head"],["type","button","title","Close","aria-label","Close",1,"close",3,"click"],[1,"modal-sub"],[1,"path-row"],["type","button","title","Parent folder","aria-label","Parent folder",3,"click","disabled"],["type","text","spellcheck","false","autocomplete","off","aria-label","Folder path",3,"input","keydown.enter","value"],["type","button",3,"click","disabled"],[1,"roots"],[1,"listing"],[1,"state"],[1,"state","error"],[1,"modal-foot"],[1,"selected",3,"title"],[1,"ok"],[1,"actions"],["type","button",1,"secondary",3,"click"],["type","button",1,"primary",3,"click","disabled"],["type","button",1,"chip",3,"title"],["type","button",1,"chip",3,"click","title"],["type","button",1,"row",3,"title"],["type","button",1,"row",3,"click","title"],["aria-hidden","true",1,"folder"],[1,"name"]],template:function(n,o){if(n&1&&(b(0,"div",0),q("click",function(){return o.close()}),b(1,"div",1),q("click",function(i){return i.stopPropagation()}),b(2,"header",2)(3,"strong"),p(4,"New session"),E(),b(5,"button",3),q("click",function(){return o.close()}),p(6," \xD7 "),E()(),b(7,"p",4),p(8," Choose the project folder the agent should run in. It starts only after your first prompt. "),E(),b(9,"div",5)(10,"button",6),q("click",function(){return o.go(o.parent())}),p(11," \u2191 "),E(),b(12,"input",7),q("input",function(i){return o.onPathInput(i)})("keydown.enter",function(){return o.go(o.draftPath())}),E(),b(13,"button",8),q("click",function(){return o.go(o.draftPath())}),p(14," Go "),E()(),T(15,sL,3,0,"div",9),b(16,"div",10),T(17,aL,2,0,"p",11)(18,cL,2,1,"p",12)(19,fL,4,2),E(),b(20,"footer",13)(21,"span",14),p(22),T(23,mL,2,0,"em"),T(24,hL,2,0,"em",15),E(),b(25,"div",16)(26,"button",17),q("click",function(){return o.close()}),p(27,"Cancel"),E(),b(28,"button",18),q("click",function(){return o.confirm()}),p(29," New session here "),E()()()()()),n&2){let r;u(10),Ae("disabled",o.parent()===void 0),u(2),Ae("value",o.draftPath()),u(),Ae("disabled",o.draftPath().trim().length===0),u(2),M(o.roots().length>0?15:-1),u(2),M(o.loading()?17:(r=o.error())?18:19,r),u(4),Ae("title",o.path()),u(),ce(" ",o.path()," "),u(),M(o.canOpen()?-1:23),u(),M(o.isGitRepo()?24:-1),u(4),Ae("disabled",!o.canOpen()||o.loading())}},styles:["[_nghost-%COMP%]{display:contents}.modal-layer[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000073}.modal-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:min(560px,100%);max-height:min(640px,90vh);border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-lg);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 18px 48px #0006;overflow:hidden}.modal-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:12px 14px;border-bottom:1px solid var(--%NS%morse-border)}.modal-head[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{flex:1;font-size:13px}.modal-head[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{padding:2px 8px;border:0;background:transparent;color:var(--%NS%morse-fg-muted);font-size:16px;line-height:1;cursor:pointer}.modal-head[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]:hover{color:var(--%NS%morse-fg)}.modal-sub[_ngcontent-%COMP%]{margin:0;padding:8px 14px 0;color:var(--%NS%morse-fg-muted);font-size:11.5px}.path-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:10px 14px}.path-row[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;min-width:0;font-family:var(--%NS%morse-font-mono);font-size:12px}.path-row[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{flex:none;padding:4px 10px}.roots[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px;padding:0 14px 8px}.chip[_ngcontent-%COMP%]{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:2px 9px;border:1px solid var(--%NS%morse-border);border-radius:999px;background:transparent;color:var(--%NS%morse-fg-muted);font-size:11px;cursor:pointer}.chip[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.listing[_ngcontent-%COMP%]{flex:1;min-height:160px;overflow-y:auto;border-top:1px solid var(--%NS%morse-border);padding:4px 6px}.row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;padding:6px 8px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg);text-align:left;cursor:pointer}.row[_ngcontent-%COMP%]:hover, .row[_ngcontent-%COMP%]:focus-visible{background:var(--%NS%morse-hover)}.row[_ngcontent-%COMP%] .folder[_ngcontent-%COMP%]{flex:none;width:14px;color:var(--%NS%morse-fg-muted);text-align:center}.row[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row[_ngcontent-%COMP%] .mark[_ngcontent-%COMP%]{flex:none;padding:0 6px;border-radius:999px;background:var(--%NS%morse-badge-bg);color:var(--%NS%morse-badge-fg);font-size:10px}.state[_ngcontent-%COMP%]{margin:8px;color:var(--%NS%morse-fg-muted);font-size:12px}.state.error[_ngcontent-%COMP%]{color:var(--%NS%morse-error)}.modal-foot[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:12px 14px;border-top:1px solid var(--%NS%morse-border)}.selected[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:rtl;text-align:left;color:var(--%NS%morse-fg-muted);font-family:var(--%NS%morse-font-mono);font-size:11px}.selected[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{color:var(--%NS%morse-warn, var(--%NS%morse-error));font-style:normal}.actions[_ngcontent-%COMP%]{display:flex;flex:none;gap:6px}"]})};var wE=[{title:"The agent",blurb:"Morse never imports pi \u2014 it spawns `pi --mode rpc` and speaks its protocol.",entries:[{name:"pi coding agent",by:"Mario Zechner",license:"MIT",url:"https://github.com/earendil-works/pi",role:"Reads, runs, edits and thinks: every reply in this window is pi talking."}]},{title:"Interface",entries:[{name:"Angular",packages:["@angular/common","@angular/compiler","@angular/core","@angular/forms","@angular/platform-browser","@angular/router"],license:"MIT",url:"https://angular.dev",role:"Components, signals and the shell both hosts render.",by:"Google"},{name:"RxJS",packages:["rxjs"],license:"Apache-2.0",url:"https://rxjs.dev",role:"The streams Angular is built on."},{name:"marked",packages:["marked"],license:"MIT",url:"https://marked.js.org",role:"Turns the agent\u2019s markdown into HTML."},{name:"DOMPurify",packages:["dompurify"],license:"(MPL-2.0 OR Apache-2.0)",url:"https://github.com/cure53/DOMPurify",role:"Sanitises that HTML before it reaches the DOM.",by:"Cure53"},{name:"highlight.js",packages:["highlight.js"],license:"BSD-3-Clause",url:"https://highlightjs.org",role:"Syntax colours in code blocks."},{name:"anime.js",packages:["animejs"],license:"MIT",url:"https://animejs.com",role:"The cold-start intro and the drop-zone pulse.",by:"Julian Garnier"},{name:"tslib",packages:["tslib"],license:"0BSD",url:"https://github.com/microsoft/tslib",role:"TypeScript\u2019s own runtime helpers.",by:"Microsoft"}]},{title:"Hosts",entries:[{name:"NestJS",packages:["@nestjs/common","@nestjs/core","@nestjs/platform-express","@nestjs/platform-ws","@nestjs/websockets"],license:"MIT",url:"https://nestjs.com",role:"The browser host: static frontend plus one WebSocket gateway.",by:"Kamil My\u015Bliwiec"},{name:"ws",packages:["ws"],license:"MIT",url:"https://github.com/websockets/ws",role:"The WebSocket server NestJS sits on."},{name:"reflect-metadata",packages:["reflect-metadata"],license:"Apache-2.0",url:"https://github.com/rbuckton/reflect-metadata",role:"Decorator metadata for NestJS\u2019s dependency injection.",by:"Ron Buckton"},{name:"Node.js",by:"OpenJS Foundation",license:"MIT",url:"https://nodejs.org",role:"Runtime for the host and for pi itself."},{name:"Visual Studio Code",by:"Microsoft",license:"MIT",url:"https://code.visualstudio.com/api",role:"The editor Morse docks into, and the API it builds against."}]},{title:"Typeface",blurb:"The browser host bundles JetBrains Mono; VS Code keeps the editor\u2019s own font and downloads nothing.",entries:[{name:"JetBrains Mono",by:"JetBrains",license:"OFL-1.1",url:"https://www.jetbrains.com/lp/mono/",role:"The interface typeface, subset to latin and latin-ext. Licence text ships beside it."},{name:"Nerd Fonts",by:"Ryan L. McIntyre",license:"MIT",url:"https://www.nerdfonts.com",role:"Where the UI\u2019s icon glyphs come from \u2014 Morse bundles none, they follow the editor font."}]},{title:"Build & test",blurb:"Not shipped with the app \u2014 but nothing here would exist without them.",entries:[{name:"TypeScript",packages:["typescript"],license:"Apache-2.0",url:"https://www.typescriptlang.org",role:"Every line of Morse, typed.",by:"Microsoft"},{name:"Angular CLI & build",packages:["@angular/cli","@angular/build","@angular/compiler-cli"],license:"MIT",url:"https://angular.dev/tools/cli",role:"Builds, bundles and serves the frontend."},{name:"esbuild",packages:["esbuild"],license:"MIT",url:"https://esbuild.github.io",role:"Bundles the libraries, the server, the CLI and the extension.",by:"Evan Wallace"},{name:"Vitest",packages:["vitest"],license:"MIT",url:"https://vitest.dev",role:"The unit suites."},{name:"jsdom",packages:["jsdom"],license:"MIT",url:"https://github.com/jsdom/jsdom",role:"A DOM for those suites."},{name:"ESLint",packages:["eslint"],license:"MIT",url:"https://eslint.org",role:"Lints the extension."},{name:"typescript-eslint",packages:["typescript-eslint"],license:"MIT",url:"https://typescript-eslint.io",role:"The type-aware lint rules."},{name:"Prettier",packages:["prettier"],license:"MIT",url:"https://prettier.io",role:"Formatting, so no diff is about whitespace."},{name:"DefinitelyTyped",packages:["@types/node","@types/ws","@types/mocha","@types/vscode"],license:"MIT",url:"https://github.com/DefinitelyTyped/DefinitelyTyped",role:"Type definitions for Node, ws, mocha and the VS Code API."},{name:"VS Code test tools",packages:["@vscode/test-cli","@vscode/test-electron"],license:"MIT",url:"https://code.visualstudio.com/api/working-with-extensions/testing-extension",role:"Runs the integration suite in a real VS Code.",by:"Microsoft"},{name:"VSCE",packages:["@vscode/vsce"],license:"MIT",url:"https://github.com/microsoft/vscode-vsce",role:"Packages the extension into a .vsix.",by:"Microsoft"},{name:"npm-run-all",packages:["npm-run-all"],license:"MIT",url:"https://github.com/mysticatea/npm-run-all",role:"Runs the dev and watch scripts side by side.",by:"Toru Nagashima"}]}];var gL=(t,e)=>e.title,yL=(t,e)=>e.name;function vL(t,e){if(t&1&&(b(0,"div")(1,"dt"),p(2,"update"),E(),b(3,"dd")(4,"a",14),p(5),E()()()),t&2){let n=e;u(4),Ae("href",n.url,yo)("title",n.hint),u(),ce(" v",n.latest," available ")}}function _L(t,e){t&1&&(b(0,"p",15),p(1),E()),t&2&&(u(),D(e))}function bL(t,e){t&1&&(b(0,"span",17),p(1),E()),t&2&&(u(),ce("by ",e))}function xL(t,e){if(t&1&&(b(0,"li")(1,"a",16),p(2),T(3,bL,2,1,"span",17),E(),b(4,"span",18),p(5),E(),b(6,"p",19),p(7),E()()),t&2){let n,o=e.$implicit;u(),Ae("href",o.url,yo),u(),ce(" ",o.name," "),u(),M((n=o.by)?3:-1,n),u(2),D(o.license),u(2),D(o.role)}}function EL(t,e){if(t&1&&(b(0,"section",9)(1,"h3"),p(2),E(),T(3,_L,2,1,"p",15),b(4,"ul"),_e(5,xL,8,5,"li",null,yL),E()()),t&2){let n,o=e.$implicit;u(2),D(o.title),u(),M((n=o.blurb)?3:-1,n),u(2),be(o.entries)}}var ou=class t{morse=N(wt);shell=N(rn);update=N(Cs);groups=wE;protocolVersion=this.morse.protocolVersion;updateNotice=this.update.available;frontend=S(()=>{let e=this.morse.frontend();return e?`${e.name} ${e.version}`:"not reported by this host"});host=S(()=>{let e=this.morse.capabilities();return e?`${e.hostKind} \xB7 ${e.scope}`:"not connected"});close(){this.shell.closeAbout()}onEscape(){this.close()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-about-dialog"]],hostBindings:function(n,o){n&1&&L("keydown.escape",function(){return o.onEscape()},Ot)},decls:42,vars:4,consts:[[1,"modal-layer",3,"click"],["role","dialog","aria-modal","true","aria-labelledby","about-title",1,"modal-card",3,"click"],[1,"modal-head"],["id","about-title"],[1,"stamp"],["type","button","aria-label","Close",1,"close",3,"click"],[1,"intro"],[1,"identity"],[1,"scroll"],[1,"group"],[1,"modal-foot"],[1,"spacer"],["href","https://github.com/supanadit/morse","target","_blank","rel","noreferrer noopener"],["type","button",1,"secondary",3,"click"],["target","_blank","rel","noreferrer noopener",3,"href","title"],[1,"blurb"],["target","_blank","rel","noreferrer noopener",1,"name",3,"href"],[1,"by"],[1,"license"],[1,"role"]],template:function(n,o){if(n&1&&(b(0,"div",0),q("click",function(){return o.close()}),b(1,"div",1),q("click",function(i){return i.stopPropagation()}),b(2,"div",2)(3,"strong",3),p(4,"About Morse"),E(),b(5,"span",4),p(6,"a comfortable Pi interface \xB7 MIT"),E(),b(7,"button",5),q("click",function(){return o.close()}),p(8,"\xD7"),E()(),b(9,"p",6),p(10," One chat frontend for the pi coding agent: a VS Code panel, or a browser served by the Morse host. Morse never imports pi \u2014 it drives "),b(11,"code"),p(12,"pi --mode rpc"),E(),p(13," \u2014 and never talks to a model provider itself. Below is what it stands on, and the licence each piece asks for. "),E(),b(14,"dl",7)(15,"div")(16,"dt"),p(17,"frontend"),E(),b(18,"dd"),p(19),E()(),b(20,"div")(21,"dt"),p(22,"protocol"),E(),b(23,"dd"),p(24),E()(),b(25,"div")(26,"dt"),p(27,"host"),E(),b(28,"dd"),p(29),E()(),T(30,vL,6,3,"div"),E(),b(31,"div",8),_e(32,EL,7,2,"section",9,gL),E(),b(34,"div",10)(35,"span"),p(36,"Licence texts ship with this build. Morse is MIT \xB7 \xA9 2026 Supan Adit Pratama."),E(),$e(37,"span",11),b(38,"a",12),p(39," Source "),E(),b(40,"button",13),q("click",function(){return o.close()}),p(41,"Close"),E()()()()),n&2){let r;u(19),D(o.frontend()),u(5),D(o.protocolVersion()),u(5),D(o.host()),u(),M((r=o.updateNotice())?30:-1,r),u(2),be(o.groups)}},styles:["[_nghost-%COMP%]{display:contents}.modal-layer[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000073}.modal-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:min(620px,100%);max-height:min(680px,90vh);border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-lg);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 18px 48px #0006;overflow:hidden}.modal-head[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:8px;padding:12px 14px;border-bottom:1px solid var(--%NS%morse-border)}.modal-head[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:13px}.modal-head[_ngcontent-%COMP%] .stamp[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--%NS%morse-fg-muted);font-size:11px}.modal-head[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{padding:2px 8px;border:0;background:transparent;color:var(--%NS%morse-fg-muted);font-size:16px;line-height:1;cursor:pointer}.modal-head[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]:hover{color:var(--%NS%morse-fg)}.intro[_ngcontent-%COMP%]{margin:0;padding:10px 14px 0;color:var(--%NS%morse-fg-muted);font-size:11.5px;line-height:1.55}.intro[_ngcontent-%COMP%] code[_ngcontent-%COMP%], .role[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:var(--%NS%morse-font-mono);font-size:11px;padding:0 3px;border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-hover)}dl.identity[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px 18px;margin:10px 14px 0;padding:8px 10px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-hover);font-size:11px}dl.identity[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:flex;gap:6px;min-width:0}dt[_ngcontent-%COMP%]{color:var(--%NS%morse-fg-muted);text-transform:uppercase;letter-spacing:.04em}dd[_ngcontent-%COMP%]{margin:0;font-family:var(--%NS%morse-font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}dl.identity[_ngcontent-%COMP%] dd[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--%NS%morse-link)}dl.identity[_ngcontent-%COMP%] dd[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scroll[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;padding:6px 14px 12px}.group[_ngcontent-%COMP%]{margin-top:12px}.group[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 2px;color:var(--%NS%morse-fg-muted);font-size:11px;font-weight:600;letter-spacing:.03em;text-transform:uppercase}.blurb[_ngcontent-%COMP%]{margin:0 0 6px;color:var(--%NS%morse-fg-muted);font-size:11px}ul[_ngcontent-%COMP%]{margin:0;padding:0;list-style:none}li[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:0 8px;padding:6px 8px;border-radius:var(--%NS%morse-radius-sm)}li[_ngcontent-%COMP%] + li[_ngcontent-%COMP%]{border-top:1px solid var(--%NS%morse-hover)}li[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}.name[_ngcontent-%COMP%]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--%NS%morse-fg);font-size:12px;font-weight:600;text-decoration:none}.name[_ngcontent-%COMP%]:hover{color:var(--%NS%morse-link);text-decoration:underline}.by[_ngcontent-%COMP%]{margin-left:6px;color:var(--%NS%morse-fg-muted);font-size:11px;font-weight:400}.license[_ngcontent-%COMP%]{justify-self:end;padding:1px 7px;border-radius:999px;background:var(--%NS%morse-badge-bg);color:var(--%NS%morse-badge-fg);font-family:var(--%NS%morse-font-mono);font-size:10px}.role[_ngcontent-%COMP%]{grid-column:1 / -1;margin:2px 0 0;color:var(--%NS%morse-fg-muted);font-size:11px;line-height:1.5}.modal-foot[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:10px 14px;border-top:1px solid var(--%NS%morse-border);color:var(--%NS%morse-fg-muted);font-size:11px}.modal-foot[_ngcontent-%COMP%] .spacer[_ngcontent-%COMP%]{flex:1;min-width:0}"]})};var CL=(t,e)=>e.name,wL=(t,e)=>e.id;function SL(t,e){t&1&&(b(0,"span",15),p(1,"not in this host"),E())}function TL(t,e){if(t&1&&(b(0,"li")(1,"div",13)(2,"span",14),p(3),T(4,SL,2,0,"span",15),E(),b(5,"span",16),p(6),E()(),b(7,"kbd"),p(8),E()()),t&2){let n=e.$implicit;Te("unavailable",n.available===!1),u(3),ce(" ",n.label," "),u(),M(n.available===!1?4:-1),u(2),D(n.detail),u(2),D(n.keys)}}function ML(t,e){if(t&1&&(b(0,"section",8)(1,"h3"),p(2),E(),b(3,"ul"),_e(4,TL,9,6,"li",12,wL),E()()),t&2){let n=e.$implicit;u(2),D(n.name),u(2),be(n.rows)}}var ru=class t{shell=N(rn);shortcuts=N(ro);groups=S(()=>{let e=this.shortcuts.available(),n=new Map;for(let o of La){let r=n.get(o.group)??[];r.push({id:o.id,label:o.label,detail:o.detail,keys:Fa(o)?gb(o.binding):o.keys,available:Fa(o)?e.get(o.id)===!0:void 0}),n.set(o.group,r)}return[...n].map(([o,r])=>({name:o,rows:r}))});close(){this.shell.closeShortcuts()}onEscape(){this.close()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-shortcuts-dialog"]],hostBindings:function(n,o){n&1&&L("keydown.escape",function(){return o.onEscape()},Ot)},decls:20,vars:0,consts:[[1,"modal-layer",3,"click"],["role","dialog","aria-modal","true","aria-labelledby","shortcuts-title",1,"modal-card",3,"click"],[1,"modal-head"],["id","shortcuts-title"],[1,"stamp"],["type","button","aria-label","Close",1,"close",3,"click"],[1,"intro"],[1,"scroll"],[1,"group"],[1,"modal-foot"],[1,"spacer"],["type","button",1,"secondary",3,"click"],[3,"unavailable"],[1,"what"],[1,"label"],[1,"why"],[1,"detail"]],template:function(n,o){n&1&&(b(0,"div",0),q("click",function(){return o.close()}),b(1,"div",1),q("click",function(i){return i.stopPropagation()}),b(2,"div",2)(3,"strong",3),p(4,"Keyboard shortcuts"),E(),b(5,"span",4),p(6,"the same keys in the browser and in the VS Code panel"),E(),b(7,"button",5),q("click",function(){return o.close()}),p(8,"\xD7"),E()(),b(9,"p",6),p(10," Every key Morse understands, whether or not it is a shortcut you can see in the interface. They apply while the Morse panel has focus \u2014 and a row marked \u201Cnot in this host\u201D is a key this host has nothing to do. "),E(),b(11,"div",7),_e(12,ML,6,1,"section",8,CL),E(),b(14,"div",9)(15,"span"),p(16,"Esc closes this list, and the panel in front of it."),E(),$e(17,"span",10),b(18,"button",11),q("click",function(){return o.close()}),p(19,"Close"),E()()()()),n&2&&(u(12),be(o.groups()))},styles:["[_nghost-%COMP%]{display:contents}.modal-layer[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:66;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000073}.modal-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:min(560px,100%);max-height:min(620px,90vh);border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-lg);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 18px 48px #0006;overflow:hidden}.modal-head[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:8px;padding:12px 14px;border-bottom:1px solid var(--%NS%morse-border)}.modal-head[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:13px}.modal-head[_ngcontent-%COMP%] .stamp[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--%NS%morse-fg-muted);font-size:11px}.modal-head[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{padding:2px 8px;border:0;background:transparent;color:var(--%NS%morse-fg-muted);font-size:16px;line-height:1;cursor:pointer}.modal-head[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]:hover{color:var(--%NS%morse-fg)}.intro[_ngcontent-%COMP%]{margin:0;padding:10px 14px 0;color:var(--%NS%morse-fg-muted);font-size:11.5px;line-height:1.55}.scroll[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;padding:4px 14px 12px}.group[_ngcontent-%COMP%]{margin-top:12px}.group[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 4px;color:var(--%NS%morse-fg-muted);font-size:11px;font-weight:600;letter-spacing:.03em;text-transform:uppercase}ul[_ngcontent-%COMP%]{margin:0;padding:0;list-style:none}li[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:8px;padding:6px 8px;border-radius:var(--%NS%morse-radius-sm)}li[_ngcontent-%COMP%] + li[_ngcontent-%COMP%]{border-top:1px solid var(--%NS%morse-hover)}li[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}li.unavailable[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], li.unavailable[_ngcontent-%COMP%] kbd[_ngcontent-%COMP%]{opacity:.55}.what[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1px;min-width:0}.label[_ngcontent-%COMP%]{font-size:12px;font-weight:600}.why[_ngcontent-%COMP%]{margin-left:6px;padding:1px 6px;border-radius:999px;background:var(--%NS%morse-badge-bg);color:var(--%NS%morse-badge-fg);font-size:10px;font-weight:400}.detail[_ngcontent-%COMP%]{color:var(--%NS%morse-fg-muted);font-size:11px;line-height:1.5}kbd[_ngcontent-%COMP%]{justify-self:end;padding:2px 7px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-bg);color:var(--%NS%morse-fg);font-family:var(--%NS%morse-font-mono);font-size:11px;white-space:nowrap}.modal-foot[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:10px 14px;border-top:1px solid var(--%NS%morse-border);color:var(--%NS%morse-fg-muted);font-size:11px}.modal-foot[_ngcontent-%COMP%] .spacer[_ngcontent-%COMP%]{flex:1;min-width:0}"]})};var IL=["cancel"];function kL(t,e){t&1&&(b(0,"p",4),p(1),E()),t&2&&(u(),D(e))}function NL(t,e){t&1&&(b(0,"p",5),p(1),E()),t&2&&(u(),D(e))}var iu=class t{title=ee.required();body=ee("");note=ee("");confirmLabel=ee("Confirm");cancelLabel=ee("Cancel");confirmed=rt();cancelled=rt();cancelButton=at("cancel");constructor(){ue(()=>{let e=this.cancelButton()?.nativeElement;e&&setTimeout(()=>e.focus(),0)})}onEscape(){this.cancelled.emit()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-confirm-dialog"]],viewQuery:function(n,o){n&1&&vt(o.cancelButton,IL,5),n&2&&bt()},hostBindings:function(n,o){n&1&&L("keydown.escape",function(){return o.onEscape()},Ot)},inputs:{title:[1,"title"],body:[1,"body"],note:[1,"note"],confirmLabel:[1,"confirmLabel"],cancelLabel:[1,"cancelLabel"]},outputs:{confirmed:"confirmed",cancelled:"cancelled"},decls:12,vars:6,consts:[["cancel",""],[1,"modal-layer",3,"click"],["role","alertdialog","aria-modal","true","aria-labelledby","confirm-title",1,"modal-card",3,"click"],["id","confirm-title"],["id","confirm-body",1,"body"],[1,"note"],[1,"actions"],["type","button",1,"secondary",3,"click"],["type","button",3,"click"]],template:function(n,o){if(n&1&&(b(0,"div",1),q("click",function(){return o.cancelled.emit()}),b(1,"div",2),q("click",function(i){return i.stopPropagation()}),b(2,"h2",3),p(3),E(),T(4,kL,2,1,"p",4),T(5,NL,2,1,"p",5),b(6,"div",6)(7,"button",7,0),q("click",function(){return o.cancelled.emit()}),p(9),E(),b(10,"button",8),q("click",function(){return o.confirmed.emit()}),p(11),E()()()()),n&2){let r,i;u(),pe("aria-describedby",o.body().length>0?"confirm-body":null),u(2),D(o.title()),u(),M((r=o.body())?4:-1,r),u(),M((i=o.note())?5:-1,i),u(4),ce(" ",o.cancelLabel()," "),u(2),D(o.confirmLabel())}},styles:["[_nghost-%COMP%]{display:contents}.modal-layer[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:70;display:flex;align-items:center;justify-content:center;padding:24px;background:#00000073}.modal-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;width:min(420px,100%);padding:16px 18px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-lg);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 18px 48px #0006;animation:_ngcontent-%COMP%_confirm-in .14s ease-out}h2[_ngcontent-%COMP%]{margin:0;font-size:14px;font-weight:600}.body[_ngcontent-%COMP%]{margin:0;font-size:12.5px;line-height:1.6}.note[_ngcontent-%COMP%]{margin:0;color:var(--%NS%morse-warn);font-size:11.5px;line-height:1.55}.actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:6px;margin-top:2px}@keyframes _ngcontent-%COMP%_confirm-in{0%{opacity:0;transform:translateY(6px)}}@media(prefers-reduced-motion:reduce){.modal-card[_ngcontent-%COMP%]{animation:none}}"]})};function DL(t,e){t&1&&p(0," Install it once and this panel is ready. ")}function OL(t,e){if(t&1){let n=z();b(0,"div",5)(1,"code"),p(2),E(),b(3,"button",10),q("click",function(){I(n);let r=h();return k(r.copyInstall())}),p(4),E()()}if(t&2){let n=h();u(2),D(e),u(2),ce(" ",n.copied()?"Copied":"Copy"," ")}}function PL(t,e){t&1&&(b(0,"p",6),p(1),E()),t&2&&(u(),D(e))}function AL(t,e){if(t&1){let n=z();b(0,"button",10),q("click",function(){I(n);let r=h();return k(r.openSettings())}),p(1,"Open settings"),E(),b(2,"button",10),q("click",function(){I(n);let r=h();return k(r.showLog())}),p(3,"Show log"),E()}}function RL(t,e){t&1&&(b(0,"p",9),p(1," Changed \u201Cmorse.pi.path\u201D? Reload the window \u2014 Morse picks the pi path when it starts. To use a pi that is already installed, point the setting at it instead of installing a second copy. "),E())}function LL(t,e){t&1&&(b(0,"p",9),p(1," The host reads "),b(2,"code"),p(3,"MORSE_PI_PATH"),E(),p(4," at startup, so restart it after changing that (or install pi) \u2014 "),b(5,"code"),p(6,"morse restart"),E(),p(7," for the daemon. "),E())}function FL(t,e){t&1&&(b(0,"details")(1,"summary"),p(2,"What the host reported"),E(),b(3,"pre"),p(4),E()()),t&2&&(u(4),D(e))}var su=class t{morse=N(wt);message=this.morse.agentError;failure=this.morse.agentFailure;missing=S(()=>this.failure()?.code==="agent-unavailable");install=S(()=>this.failure()?.install??"");hint=S(()=>this.failure()?.hint??"");hasEditor=S(()=>this.morse.capabilities()?.hostKind==="vscode");copied=R(!1);copyInstall(){let e=this.install();e.length!==0&&(navigator.clipboard?.writeText(e),this.copied.set(!0),setTimeout(()=>this.copied.set(!1),1600))}retry(){this.morse.newSession()}openSettings(){this.morse.hostCommand("openSettings")}showLog(){this.morse.hostCommand("showOutput")}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["morse-agent-screen"]],decls:18,vars:8,consts:[["role","alert","aria-labelledby","agent-title",1,"card"],[1,"eyebrow"],["aria-hidden","true",1,"pip"],["id","agent-title"],[1,"body"],[1,"command"],[1,"hint"],[1,"actions"],["type","button",3,"click"],[1,"foot"],["type","button",1,"secondary",3,"click"]],template:function(n,o){if(n&1&&(b(0,"section",0)(1,"p",1),$e(2,"span",2),p(3),E(),b(4,"h1",3),p(5),E(),b(6,"p",4),p(7," Morse is only the interface \u2014 every answer comes from the pi CLI on this machine, with your own models, tools and sessions. "),T(8,DL,1,0),E(),T(9,OL,5,2,"div",5),T(10,PL,2,1,"p",6),b(11,"div",7)(12,"button",8),q("click",function(){return o.retry()}),p(13,"Retry"),E(),T(14,AL,4,0),E(),T(15,RL,2,0,"p",9)(16,LL,8,0,"p",9),T(17,FL,5,1,"details"),E()),n&2){let r,i,s;u(3),ce(" ",o.missing()?"Setup":"Agent unavailable"," "),u(2),ce(" ",o.missing()?"The pi coding agent is not installed":"The pi coding agent could not start"," "),u(3),M(o.missing()?8:-1),u(),M((r=o.install())?9:-1,r),u(),M((i=o.hint())?10:-1,i),u(4),M(o.hasEditor()?14:-1),u(),M(o.hasEditor()?15:16),u(2),M((s=o.message())?17:-1,s)}},styles:["[_nghost-%COMP%]{display:flex;flex:1;min-height:0;overflow-y:auto;padding:18px}.card[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;width:100%;max-width:520px;margin:auto;padding:20px 22px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-lg);background:var(--%NS%morse-panel, var(--%NS%morse-bg));box-shadow:0 10px 30px #0000002e;color:var(--%NS%morse-fg);animation:_ngcontent-%COMP%_agent-in .2s ease-out}.eyebrow[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;margin:0;color:var(--%NS%morse-fg-muted);font-size:11px;text-transform:uppercase;letter-spacing:.06em}.pip[_ngcontent-%COMP%]{width:7px;height:7px;border-radius:50%;background:var(--%NS%morse-warn);box-shadow:0 0 0 3px color-mix(in srgb,var(--%NS%morse-warn) 22%,transparent)}h1[_ngcontent-%COMP%]{margin:0;font-size:17px;line-height:1.35;font-weight:600}.body[_ngcontent-%COMP%]{margin:0;color:var(--%NS%morse-fg-muted);font-size:12.5px;line-height:1.6}.command[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px 8px 8px 10px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-code-bg)}.command[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{flex:1;min-width:0;overflow-x:auto;white-space:nowrap;font-size:12px;color:var(--%NS%morse-fg)}.command[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{flex:none;padding:3px 9px;font-size:11px}.hint[_ngcontent-%COMP%]{margin:0;color:var(--%NS%morse-fg-muted);font-size:11.5px;line-height:1.55}.actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}.foot[_ngcontent-%COMP%]{margin:0;color:var(--%NS%morse-fg-muted);font-size:11px;line-height:1.5}details[_ngcontent-%COMP%]{border-top:1px solid var(--%NS%morse-border);padding-top:8px}summary[_ngcontent-%COMP%]{color:var(--%NS%morse-fg-muted);font-size:11px;cursor:pointer}details[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{margin:6px 0 0;padding:8px;border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-hover);color:var(--%NS%morse-fg-muted);font-family:var(--%NS%morse-font-mono);font-size:11px;line-height:1.5;white-space:pre-wrap;word-break:break-word}@keyframes _ngcontent-%COMP%_agent-in{0%{opacity:0;transform:translateY(6px)}}@media(prefers-reduced-motion:reduce){.card[_ngcontent-%COMP%]{animation:none}}"]})};function VL(t,e){if(t&1){let n=z();g(0,"morse-boot-splash",11),L("dismissed",function(){I(n);let r=h();return k(r.onBootDismissed())}),_()}if(t&2){let n=h();K("ready",n.bootReady())("status",n.bootStatus())}}function jL(t,e){if(t&1){let n=z();g(0,"morse-connection-screen",12),L("retry",function(){I(n);let r=h();return k(r.retryConnection())})("explore",function(){I(n);let r=h();return k(r.onConnectionExplore())})("connect",function(r){I(n);let i=h();return k(i.onConnectionConnect(r))}),_()}if(t&2){let n=e;K("eyebrow",n.eyebrow)("title",n.title)("body",n.body)("detail",n.detail)}}function $L(t,e){t&1&&we(0,"morse-project-picker")}function HL(t,e){t&1&&we(0,"morse-about-dialog")}function BL(t,e){t&1&&we(0,"morse-shortcuts-dialog")}function UL(t,e){if(t&1){let n=z();g(0,"morse-confirm-dialog",13),L("confirmed",function(){I(n);let r=h();return k(r.confirmCompact())})("cancelled",function(){I(n);let r=h();return k(r.cancelCompact())}),_()}if(t&2){let n=h();K("body",n.compactBody())}}function zL(t,e){if(t&1){let n=z();g(0,"button",14),L("click",function(){I(n);let r=h();return k(r.closeNavigation())}),_()}}function qL(t,e){t&1&&(g(0,"div",7),we(1,"span",15),g(2,"div",16)(3,"span",17),p(4,"\u2913"),_(),g(5,"strong"),p(6,"Drop to attach"),_(),g(7,"span"),p(8,"Images ride with the prompt \xB7 other files become "),g(9,"code"),p(10,"@mentions"),_()()()()),t&2&&(u(2),K("morseEnter",0)("morseEnterY",-6))}function GL(t,e){if(t&1){let n=z();g(0,"section",8)(1,"strong"),p(2,"Offline \u2014 the host wouldn't take this frontend"),_(),g(3,"p"),p(4),we(5,"br"),p(6),_(),g(7,"div",18)(8,"button",19),L("click",function(){I(n);let r=h();return k(r.reload())}),p(9,"Reload"),_(),g(10,"button",20),L("click",function(){I(n);let r=h();return k(r.retryConnection())}),p(11,"Retry"),_(),g(12,"button",20),L("click",function(){I(n);let r=h();return k(r.showLog())}),p(13,"Show log"),_()()()}if(t&2){let n=e;u(4),D(n.message),u(2),D(n.detail)}}function WL(t,e){if(t&1){let n=z();g(0,"section",8)(1,"strong"),p(2,"Offline \u2014 reconnecting"),_(),g(3,"p"),p(4," Morse keeps retrying in the background; the rest of the interface stays available while it does. "),_(),g(5,"div",18)(6,"button",19),L("click",function(){I(n);let r=h();return k(r.retryConnection())}),p(7,"Retry now"),_(),g(8,"button",20),L("click",function(){I(n);let r=h();return k(r.showConnectionHelp())}),p(9," Connection help "),_()()()}}function YL(t,e){if(t&1){let n=z();g(0,"section",9)(1,"strong"),p(2,"Pi agent unavailable"),_(),g(3,"p"),p(4),_(),g(5,"div",18)(6,"button",19),L("click",function(){I(n);let r=h();return k(r.retryAgent())}),p(7,"Retry"),_(),g(8,"button",20),L("click",function(){I(n);let r=h();return k(r.openSettings())}),p(9,"Open settings"),_(),g(10,"button",20),L("click",function(){I(n);let r=h();return k(r.showLog())}),p(11,"Show log"),_()()()}if(t&2){let n=h();u(4),D(n.agentError()||"Morse could not start the pi coding agent.")}}function ZL(t,e){t&1&&we(0,"morse-agent-screen")}function KL(t,e){t&1&&we(0,"morse-chat-transcript")(1,"morse-interaction-panel")(2,"morse-chat-composer")}function QL(t,e){if(t&1){let n=z();g(0,"div",21)(1,"span",22),p(2),_(),g(3,"button",23),L("click",function(){I(n);let r=h();return k(r.dismissToast())}),p(4," \xD7 "),_()()}if(t&2){let n=e;vo(n.level),u(2),D(n.text)}}function XL(){return typeof location>"u"?!1:new URL(location.href,"http://localhost/").searchParams.get("boot")==="1"}var au=class t{morse=N(wt);shell=N(rn);shortcuts=N(ro);dropZone=N(Jd);animation=N(gn);attachments=N(Cr);destroyRef=N(ht);dismissedNoticeAt=R(null);noticeTimer;bootPreview=XL();bootPending=this.animation.isEnabled&&(this.bootPreview||this.morse.connection()==="connecting");bootForceTimer;bootVisible=R(this.bootPending);bootForced=R(!1);connectionDismissed=R(!1);offline=R(!1);navigationOpen=this.shell.navigationOpen;projectPickerOpen=this.shell.projectPickerOpen;aboutOpen=this.shell.aboutOpen;shortcutsOpen=this.shell.shortcutsOpen;navigationCollapsed=this.shell.navigationCollapsed;compactConfirmOpen=this.shell.compactConfirmOpen;compactBody=S(()=>{let e="pi replaces the conversation it is holding with a summary, so the next turn starts from less context. The transcript in this window is untouched.",n=this.shell.compactInstructions();return n?`${e} Your instructions: \u201C${n}\u201D.`:e});connection=this.morse.connection;agentReady=this.morse.agentReady;agentStarting=this.morse.agentStarting;agentError=this.morse.agentError;agentBlocked=S(()=>this.connection()==="ready"&&!this.agentReady()&&!this.agentStarting()&&this.agentError()!==void 0);agentScreen=S(()=>this.agentBlocked()&&this.morse.items().length===0);agentBanner=S(()=>this.agentBlocked()&&!this.agentScreen());lastError=this.morse.lastError;dragging=this.dropZone.active;toast=S(()=>{let e=this.morse.lastNotice(),n=this.attachments.notice(),o=n&&(!e||n.at>=e.at)?n:e;return!o||o.at===this.dismissedNoticeAt()?null:o});autoDismiss=ue(()=>{let e=this.toast();if(this.clearNoticeTimer(),!e)return;let n=e.level==="warn"||e.level==="error"?6e3:3200;this.noticeTimer=setTimeout(()=>this.dismissedNoticeAt.set(e.at),n)});constructor(){let e=[this.shortcuts.bind("context.compact",()=>this.shell.requestCompact(),()=>this.morse.state().agentReady),this.shortcuts.bind("help.shortcuts",()=>this.shell.toggleShortcuts())];this.destroyRef.onDestroy(()=>{for(let n of e)n()}),this.bootPending&&(this.bootForceTimer=setTimeout(()=>this.bootForced.set(!0),7e3)),ue(()=>{let n=this.morse.connection();if(n==="ready"){this.offline.set(!1),this.connectionDismissed.set(!1);return}(n==="error"||n==="closed"||this.morse.slowConnection())&&this.offline.set(!0)}),this.destroyRef.onDestroy(()=>{this.clearNoticeTimer(),this.clearBootTimer()})}onBootDismissed(){this.bootVisible.set(!1),this.clearBootTimer()}onConnectionExplore(){this.connectionDismissed.set(!0)}showConnectionHelp(){this.connectionDismissed.set(!1)}onConnectionConnect(e){if(typeof location>"u")return;let n=new URL(location.href);n.searchParams.set("server",e),location.href=n.toString()}clearBootTimer(){this.bootForceTimer!==void 0&&(clearTimeout(this.bootForceTimer),this.bootForceTimer=void 0)}clearNoticeTimer(){this.noticeTimer!==void 0&&(clearTimeout(this.noticeTimer),this.noticeTimer=void 0)}bootReady=S(()=>{if(this.bootForced())return!0;let e=this.morse.connection();return e==="error"||e==="closed"||this.morse.slowConnection()?!0:e==="ready"});bootStatus=S(()=>this.morse.connection()!=="ready"?"Connecting to the host\u2026":this.morse.agentStarting()?"Starting the pi agent\u2026":this.morse.agentError()!==void 0?"The agent could not start":"Ready");connectionScreen=S(()=>{if(this.bootVisible()||this.connectionDismissed()||!this.offline())return null;let e=this.lastError();return e?{eyebrow:"Handshake refused",title:"The host turned this frontend away",body:"The socket is up, but the handshake was rejected. That usually means the frontend and the host disagree on the wire protocol \u2014 rebuild both together.",detail:e.detail?`${e.message} \u2014 ${e.detail}`:e.message}:this.morse.slowConnection()&&this.morse.connection()==="connecting"?{eyebrow:"No answer yet",title:"The host is not answering",body:"A socket opened but the handshake never came back. The host may still be starting, or this address is not a Morse host.",detail:this.morse.connectionDetail()??""}:{eyebrow:"Offline \xB7 reconnecting",title:"Morse is waiting for a host",body:"This window is only the frontend, and it keeps working while the host is away. Nothing is lost \u2014 your sessions live with the host and in pi\u2019s session files \u2014 so start the host again and this screen will clear itself.",detail:this.morse.connectionDetail()??""}});confirmCompact(){let e=this.shell.compactInstructions();this.shell.closeCompactPrompt(),this.morse.compactSession(e)}cancelCompact(){this.shell.closeCompactPrompt()}closeNavigation(){this.shell.closeNavigation()}retryConnection(){this.morse.ready()}reload(){typeof location<"u"&&location.reload()}retryAgent(){this.morse.newSession()}openSettings(){this.morse.hostCommand("openSettings")}showLog(){this.morse.hostCommand("showOutput")}dismissToast(){this.dismissedNoticeAt.set(this.toast()?.at??this.morse.lastNotice()?.at??null)}liveDropzone=ue(()=>{let e=this.dragging();this.stopDropzoneLoops(),e&&setTimeout(()=>{if(!this.dragging())return;let n=globalThis.document?.querySelector(".dropzone")??void 0;if(!n)return;let o=n.querySelector(".dropzone-card"),r=n.querySelector(".dropzone-icon"),i=n.querySelector(".dropzone-ring");this.dropzoneStops=[this.animation.loop(i,{scale:[1,1.035],opacity:[.9,.25]},{duration:1100}),this.animation.loop(o,{scale:[1,1.03]},{duration:700}),this.animation.loop(r,{translateY:[1.5,-3]},{duration:520})]},0)});dropzoneStops=[];stopDropzoneLoops(){for(let e of this.dropzoneStops)e();this.dropzoneStops=[]}onDragEnter(e){this.dropZone.onDragEnter(e)}onDragOver(e){this.dropZone.onDragOver(e)}onDragLeave(){this.dropZone.onDragLeave()}onDrop(e){this.dropZone.onDrop(e,this.morse.state().workspace.cwd)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=he({type:t,selectors:[["app-root"]],decls:18,vars:17,consts:[[1,"shell"],[3,"ready","status"],[3,"eyebrow","title","body","detail"],[1,"nav"],["title","Compact the conversation?","note","It costs a model call, and the summary is what pi remembers from then on \u2014 this cannot be undone.","confirmLabel","Compact context",3,"body"],["type","button","aria-label","Close navigation",1,"scrim"],[1,"chat",3,"dragenter","dragover","dragleave","drop"],["aria-hidden","true",1,"dropzone"],["role","status",1,"alert","offline"],["role","alert",1,"alert"],["role","status",1,"toast",3,"class"],[3,"dismissed","ready","status"],[3,"retry","explore","connect","eyebrow","title","body","detail"],["title","Compact the conversation?","note","It costs a model call, and the summary is what pi remembers from then on \u2014 this cannot be undone.","confirmLabel","Compact context",3,"confirmed","cancelled","body"],["type","button","aria-label","Close navigation",1,"scrim",3,"click"],[1,"dropzone-ring"],[1,"dropzone-card",3,"morseEnter","morseEnterY"],[1,"dropzone-icon"],[1,"actions"],["type","button",3,"click"],["type","button",1,"secondary",3,"click"],["role","status",1,"toast"],[1,"toast-text"],["type","button","aria-label","Dismiss",1,"toast-close",3,"click"]],template:function(n,o){if(n&1&&(g(0,"div",0),T(1,VL,1,2,"morse-boot-splash",1),T(2,jL,1,4,"morse-connection-screen",2),we(3,"morse-session-nav",3),T(4,$L,1,0,"morse-project-picker"),T(5,HL,1,0,"morse-about-dialog"),T(6,BL,1,0,"morse-shortcuts-dialog"),T(7,UL,1,1,"morse-confirm-dialog",4),T(8,zL,1,0,"button",5),g(9,"main",6),L("dragenter",function(i){return o.onDragEnter(i)})("dragover",function(i){return o.onDragOver(i)})("dragleave",function(){return o.onDragLeave()})("drop",function(i){return o.onDrop(i)}),T(10,qL,11,2,"div",7),we(11,"morse-chat-header"),T(12,GL,14,2,"section",8)(13,WL,10,0,"section",8)(14,YL,12,1,"section",9),T(15,ZL,1,0,"morse-agent-screen")(16,KL,3,0),T(17,QL,5,3,"div",10),_()()),n&2){let r,i,s;Te("collapsed",o.navigationCollapsed()),u(),M(o.bootVisible()?1:-1),u(),M((r=o.connectionScreen())?2:-1,r),u(),Te("open",o.navigationOpen()),u(),M(o.projectPickerOpen()?4:-1),u(),M(o.aboutOpen()?5:-1),u(),M(o.shortcutsOpen()?6:-1),u(),M(o.compactConfirmOpen()?7:-1),u(),M(o.navigationOpen()?8:-1),u(),Te("dropping",o.dragging()),u(),M(o.dragging()?10:-1),u(2),M((i=o.lastError())?12:o.offline()?13:o.agentBanner()?14:-1,i),u(3),M(o.agentScreen()?15:16),u(2),M((s=o.toast())?17:-1,s)}},dependencies:[tu,nu,ou,ru,su,iu,Nd,Kd,Qd,kd,sn,md,hd],styles:["[_nghost-%COMP%]{display:block;height:100%}.shell[_ngcontent-%COMP%]{position:relative;display:grid;grid-template-columns:var(--%NS%morse-nav-width) minmax(0,1fr);height:100%;min-height:0;overflow:hidden;background:var(--%NS%morse-bg)}.nav[_ngcontent-%COMP%]{min-width:0}@media(min-width:760px){.nav[_ngcontent-%COMP%]{width:var(--%NS%morse-nav-width)}.shell[_ngcontent-%COMP%]{transition:grid-template-columns .16s ease}.shell.collapsed[_ngcontent-%COMP%]{grid-template-columns:0 minmax(0,1fr)}.shell.collapsed[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%]{visibility:hidden}}@media(prefers-reduced-motion:reduce){.shell[_ngcontent-%COMP%]{transition:none}}.chat[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0;min-height:0;position:relative}.dropzone[_ngcontent-%COMP%]{position:absolute;inset:0;z-index:15;display:flex;align-items:center;justify-content:center;padding:16px;pointer-events:none;background:color-mix(in srgb,var(--%NS%morse-accent) 12%,transparent);border:2px dashed color-mix(in srgb,var(--%NS%morse-accent) 70%,transparent);border-radius:var(--%NS%morse-radius-md);animation:_ngcontent-%COMP%_dropzone-in .14s ease-out}.dropzone-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:4px;max-width:320px;padding:14px 18px;border:1px solid var(--%NS%morse-accent);border-radius:var(--%NS%morse-radius-lg);background:var(--%NS%morse-panel, var(--%NS%morse-bg));color:var(--%NS%morse-fg);box-shadow:0 8px 24px #0000004d;text-align:center;font-size:12px}.dropzone-card[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:13px}.dropzone-card[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:var(--%NS%morse-font-mono);font-size:11px;padding:0 4px;border-radius:var(--%NS%morse-radius-sm);background:var(--%NS%morse-hover)}.dropzone-icon[_ngcontent-%COMP%]{font-size:18px;color:var(--%NS%morse-accent)}.dropzone-ring[_ngcontent-%COMP%]{position:absolute;inset:6px;border:2px dashed color-mix(in srgb,var(--%NS%morse-accent) 45%,transparent);border-radius:var(--%NS%morse-radius-md);pointer-events:none}@keyframes _ngcontent-%COMP%_dropzone-in{0%{opacity:0}}.scrim[_ngcontent-%COMP%]{display:none}.alert[_ngcontent-%COMP%]{margin:10px;padding:10px 12px;border:1px solid var(--%NS%morse-error);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-hover);display:flex;flex-direction:column;gap:8px}.alert[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;white-space:pre-wrap;color:var(--%NS%morse-fg-muted)}.alert.offline[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--%NS%morse-warn) 55%,var(--%NS%morse-border))}.actions[_ngcontent-%COMP%]{display:flex;gap:6px;flex-wrap:wrap}.toast[_ngcontent-%COMP%]{position:absolute;z-index:30;top:10px;right:10px;max-width:min(420px,calc(100% - 20px));display:flex;align-items:flex-start;gap:6px;padding:8px 8px 8px 10px;border-radius:var(--%NS%morse-radius-md);border-left:3px solid var(--%NS%morse-info);background:var(--%NS%morse-panel, var(--%NS%morse-badge-bg));color:var(--%NS%morse-fg);box-shadow:0 8px 24px #0000004d;animation:_ngcontent-%COMP%_toast-in .16s ease-out}.toast-text[_ngcontent-%COMP%]{flex:1;min-width:0;white-space:pre-wrap;font-size:12px;line-height:1.45}.toast-close[_ngcontent-%COMP%]{flex:none;width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);font-size:14px;line-height:1;cursor:pointer}.toast-close[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.toast.warn[_ngcontent-%COMP%]{border-color:var(--%NS%morse-warn)}.toast.error[_ngcontent-%COMP%]{border-color:var(--%NS%morse-error)}.toast.success[_ngcontent-%COMP%]{border-color:var(--%NS%morse-success)}@keyframes _ngcontent-%COMP%_toast-in{0%{opacity:0;transform:translateY(-6px)}}@media(max-width:759px){.shell[_ngcontent-%COMP%]{grid-template-columns:minmax(0,1fr)}.nav[_ngcontent-%COMP%]{position:absolute;z-index:20;top:0;bottom:0;left:0;width:min(86%,320px);transform:translate(-102%);transition:transform .16s ease;box-shadow:0 0 24px #00000059}.nav.open[_ngcontent-%COMP%]{transform:none}.scrim[_ngcontent-%COMP%]{display:block;position:absolute;z-index:10;inset:0;border:0;padding:0;background:#00000059}.scrim[_ngcontent-%COMP%]:hover, .scrim[_ngcontent-%COMP%]:active{background:#00000059}}"]})};dm(au,q_).catch(t=>console.error(t));
|