@supanadit/morse-web 0.6.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.
@@ -0,0 +1,92 @@
1
+ var NE=Object.create;var _c=Object.defineProperty,OE=Object.defineProperties,AE=Object.getOwnPropertyDescriptor,PE=Object.getOwnPropertyDescriptors,RE=Object.getOwnPropertyNames,cg=Object.getOwnPropertySymbols,LE=Object.getPrototypeOf,dg=Object.prototype.hasOwnProperty,FE=Object.prototype.propertyIsEnumerable;var lg=(t,e,n)=>e in t?_c(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,j=(t,e)=>{for(var n in e||={})dg.call(e,n)&&lg(t,n,e[n]);if(cg)for(var n of cg(e))FE.call(e,n)&&lg(t,n,e[n]);return t},Q=(t,e)=>OE(t,PE(e));var VE=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},ug=(t,e)=>{for(var n in e)_c(t,n,{get:e[n],enumerable:!0})},jE=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of RE(e))!dg.call(t,i)&&i!==n&&_c(t,i,{get:()=>e[i],enumerable:!(o=AE(e,i))||o.enumerable});return t};var BE=(t,e,n)=>(n=t!=null?NE(LE(t)):{},jE(e||!t||!t.__esModule?_c(n,"default",{value:t,enumerable:!0}):n,t));var yx=VE((AW,gx)=>{function ix(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)&&ix(n)}),t}var $d=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function rx(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function ki(t,...e){let n=Object.create(null);for(let o in t)n[o]=t[o];return e.forEach(function(o){for(let i in o)n[i]=o[i]}),n}var sk="</span>",Xb=t=>!!t.scope,ak=(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,i)=>`${o}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`},gh=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=rx(e)}openNode(e){if(!Xb(e))return;let n=ak(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){Xb(e)&&(this.buffer+=sk)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},Jb=(t={})=>{let e={children:[]};return Object.assign(e,t),e},yh=class t{constructor(){this.rootNode=Jb(),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=Jb({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)}))}},vh=class extends yh{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 gh(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Xa(t){return t?typeof t=="string"?t:t.source:null}function sx(t){return wr("(?=",t,")")}function ck(t){return wr("(?:",t,")*")}function lk(t){return wr("(?:",t,")?")}function wr(...t){return t.map(n=>Xa(n)).join("")}function dk(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Ud(...t){return"("+(dk(t).capture?"":"?:")+t.map(o=>Xa(o)).join("|")+")"}function ax(t){return new RegExp(t.toString()+"|").exec("").length-1}function uk(t,e){let n=t&&t.exec(e);return n&&n.index===0}var pk=new RegExp(Ud(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function bh(t,{joinWith:e}){let n=0;return t.map(o=>{n+=1;let i=n,r=Xa(o),s="";for(;r.length>0;){let a=pk.exec(r);if(!a){s+=r;break}s+=r.substring(0,a.index),r=r.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?s+="\\"+String(Number(a[1])+i):(s+=a[0],(a[0]==="("||/^\(\?[<']/.test(a[0]))&&n++)}return s}).map(o=>`(${o})`).join(e)}var fk=/\b\B/,cx="[a-zA-Z]\\w*",xh="[a-zA-Z_]\\w*",lx="\\b\\d+(\\.\\d+)?",dx="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ux="\\b(0b[01]+)",mk="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",hk=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=wr(e,/.*\b/,t.binary,/\b.*/)),ki({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,o)=>{n.index!==0&&o.ignoreMatch()}},t)},Ja={begin:"\\\\[\\s\\S]",relevance:0},gk={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ja]},yk={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ja]},vk={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/},zd=function(t,e,n={}){let o=ki({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 i=Ud("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:wr(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),o},_k=zd("//","$"),bk=zd("/\\*","\\*/"),xk=zd("#","$"),Ck={scope:"number",begin:lx,relevance:0},Ek={scope:"number",begin:dx,relevance:0},wk={scope:"number",begin:ux,relevance:0},Sk={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Ja,{begin:/\[/,end:/\]/,relevance:0,contains:[Ja]}]},Tk={scope:"title",begin:cx,relevance:0},Dk={scope:"title",begin:xh,relevance:0},Mk={begin:"\\.\\s*"+xh,relevance:0},Ik=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()}})},Bd=Object.freeze({__proto__:null,APOS_STRING_MODE:gk,BACKSLASH_ESCAPE:Ja,BINARY_NUMBER_MODE:wk,BINARY_NUMBER_RE:ux,COMMENT:zd,C_BLOCK_COMMENT_MODE:bk,C_LINE_COMMENT_MODE:_k,C_NUMBER_MODE:Ek,C_NUMBER_RE:dx,END_SAME_AS_BEGIN:Ik,HASH_COMMENT_MODE:xk,IDENT_RE:cx,MATCH_NOTHING_RE:fk,METHOD_GUARD:Mk,NUMBER_MODE:Ck,NUMBER_RE:lx,PHRASAL_WORDS_MODE:vk,QUOTE_STRING_MODE:yk,REGEXP_MODE:Sk,RE_STARTERS_RE:mk,SHEBANG:hk,TITLE_MODE:Tk,UNDERSCORE_IDENT_RE:xh,UNDERSCORE_TITLE_MODE:Dk});function kk(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function Nk(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function Ok(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=kk,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Ak(t,e){Array.isArray(t.illegal)&&(t.illegal=Ud(...t.illegal))}function Pk(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 Rk(t,e){t.relevance===void 0&&(t.relevance=1)}var Lk=(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=wr(n.beforeMatch,sx(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},Fk=["of","and","for","in","not","or","if","then","parent","list","value"],Vk="keyword";function px(t,e,n=Vk){let o=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(r){Object.assign(o,px(t[r],e,r))}),o;function i(r,s){e&&(s=s.map(a=>a.toLowerCase())),s.forEach(function(a){let c=a.split("|");o[c[0]]=[r,jk(c[0],c[1])]})}}function jk(t,e){return e?Number(e):Bk(t)?0:1}function Bk(t){return Fk.includes(t.toLowerCase())}var ex={},Er=t=>{console.error(t)},tx=(t,...e)=>{console.log(`WARN: ${t}`,...e)},ws=(t,e)=>{ex[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),ex[`${t}/${e}`]=!0)},Hd=new Error;function fx(t,e,{key:n}){let o=0,i=t[n],r={},s={};for(let a=1;a<=e.length;a++)s[a+o]=i[a],r[a+o]=!0,o+=ax(e[a-1]);t[n]=s,t[n]._emit=r,t[n]._multi=!0}function $k(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Er("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Hd;if(typeof t.beginScope!="object"||t.beginScope===null)throw Er("beginScope must be object"),Hd;fx(t,t.begin,{key:"beginScope"}),t.begin=bh(t.begin,{joinWith:""})}}function Hk(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Er("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Hd;if(typeof t.endScope!="object"||t.endScope===null)throw Er("endScope must be object"),Hd;fx(t,t.end,{key:"endScope"}),t.end=bh(t.end,{joinWith:""})}}function Uk(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function zk(t){Uk(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),$k(t),Hk(t)}function Gk(t){function e(s,a){return new RegExp(Xa(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+=ax(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(c=>c[1]);this.matcherRe=e(bh(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 i(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 r(s,a){let c=s;if(s.isCompiled)return c;[Nk,Pk,zk,Lk].forEach(d=>d(s,a)),t.compilerExtensions.forEach(d=>d(s,a)),s.__beforeBegin=null,[Ok,Ak,Rk].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=px(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=Xa(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 qk(d==="self"?s:d)})),s.contains.forEach(function(d){r(d,c)}),s.starts&&r(s.starts,a),c.matcher=i(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=ki(t.classNameAliases||{}),r(t)}function mx(t){return t?t.endsWithParent||mx(t.starts):!1}function qk(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return ki(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:mx(t)?ki(t,{starts:t.starts?ki(t.starts):null}):Object.isFrozen(t)?ki(t):t}var Wk="11.12.0",_h=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},hh=rx,nx=ki,ox=Symbol("nomatch"),Yk=7,hx=function(t){let e=Object.create(null),n=Object.create(null),o=[],i=!0,r="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:vh};function c(P){return a.noHighlightRe.test(P)}function l(P){let K=P.className+" ";K+=P.parentNode?P.parentNode.className:"";let G=a.languageDetectRe.exec(K);if(G){let L=je(G[1]);return L||(tx(r.replace("{}",G[1])),tx("Falling back to no-highlight mode for this block.",P)),L?G[1]:"no-highlight"}return K.split(/\s+/).find(L=>c(L)||je(L))}function d(P,K,G){let L="",J="";typeof K=="object"?(L=P,G=K.ignoreIllegals,J=K.language):(ws("10.7.0","highlight(lang, code, ...args) has been deprecated."),ws("10.7.0",`Please use highlight(code, options) instead.
2
+ https://github.com/highlightjs/highlight.js/issues/2277`),J=P,L=K),G===void 0&&(G=!0);let Re={code:L,language:J};Je("before:highlight",Re);let et=Re.result?Re.result:f(Re.language,Re.code,G);return et.code=Re.code,Je("after:highlight",et),et}function f(P,K,G,L){let J=Object.create(null);function Re(F,B){return F.keywords[B]}function et(){if(!Z.keywords){Ke.addText(ne);return}let F=0;Z.keywordPatternRe.lastIndex=0;let B=Z.keywordPatternRe.exec(ne),X="";for(;B;){X+=ne.substring(F,B.index);let re=ot.case_insensitive?B[0].toLowerCase():B[0],ut=Re(Z,re);if(ut){let[St,qn]=ut;if(Ke.addText(X),X="",J[re]=(J[re]||0)+1,J[re]<=Yk&&(xt+=qn),St.startsWith("_"))X+=B[0];else{let hn=ot.classNameAliases[St]||St;_t(B[0],hn)}}else X+=B[0];F=Z.keywordPatternRe.lastIndex,B=Z.keywordPatternRe.exec(ne)}X+=ne.substring(F),Ke.addText(X)}function $t(){if(ne==="")return;let F=null;if(typeof Z.subLanguage=="string"){if(!e[Z.subLanguage]){Ke.addText(ne);return}F=f(Z.subLanguage,ne,!0,gt[Z.subLanguage]),gt[Z.subLanguage]=F._top}else F=_(ne,Z.subLanguage.length?Z.subLanguage:null);Z.relevance>0&&(xt+=F.relevance),Ke.__addSublanguage(F._emitter,F.language)}function _e(){Z.subLanguage!=null?$t():et(),ne=""}function _t(F,B){F!==""&&(Ke.startScope(B),Ke.addText(F),Ke.endScope())}function ze(F,B){let X=1,re=B.length-1;for(;X<=re;){if(!F._emit[X]){X++;continue}let ut=ot.classNameAliases[F[X]]||F[X],St=B[X];ut?_t(St,ut):(ne=St,et(),ne=""),X++}}function rn(F,B){return F.scope&&typeof F.scope=="string"&&Ke.openNode(ot.classNameAliases[F.scope]||F.scope),F.beginScope&&(F.beginScope._wrap?(_t(ne,ot.classNameAliases[F.beginScope._wrap]||F.beginScope._wrap),ne=""):F.beginScope._multi&&(ze(F.beginScope,B),ne="")),Z=Object.create(F,{parent:{value:Z}}),Z}function Ht(F,B,X){let re=uk(F.endRe,X);if(re){if(F["on:end"]){let ut=new $d(F);F["on:end"](B,ut),ut.isMatchIgnored&&(re=!1)}if(re){for(;F.endsParent&&F.parent;)F=F.parent;return F}}if(F.endsWithParent)return Ht(F.parent,B,X)}function Ze(F){return Z.matcher.regexIndex===0?(ne+=F[0],1):(Ge=!0,0)}function Gt(F){let B=F[0],X=F.rule,re=new $d(X),ut=[X.__beforeBegin,X["on:begin"]];for(let St of ut)if(St&&(St(F,re),re.isMatchIgnored))return Ze(B);return X.skip?ne+=B:(X.excludeBegin&&(ne+=B),_e(),!X.returnBegin&&!X.excludeBegin&&(ne=B)),rn(X,F),X.returnBegin?0:B.length}function Rt(F){let B=F[0],X=K.substring(F.index),re=Ht(Z,F,X);if(!re)return ox;let ut=Z;Z.endScope&&Z.endScope._wrap?(_e(),_t(B,Z.endScope._wrap)):Z.endScope&&Z.endScope._multi?(_e(),ze(Z.endScope,F)):ut.skip?ne+=B:(ut.returnEnd||ut.excludeEnd||(ne+=B),_e(),ut.excludeEnd&&(ne=B));do Z.scope&&Ke.closeNode(),!Z.skip&&!Z.subLanguage&&(xt+=Z.relevance),Z=Z.parent;while(Z!==re.parent);return re.starts&&rn(re.starts,F),ut.returnEnd?0:B.length}function Pe(){let F=[];for(let B=Z;B!==ot;B=B.parent)B.scope&&F.unshift(B.scope);F.forEach(B=>Ke.openNode(B))}let qe={};function Te(F,B){let X=B&&B[0];if(ne+=F,X==null)return _e(),0;if(qe.type==="begin"&&B.type==="end"&&qe.index===B.index&&X===""){if(ne+=K.slice(B.index,B.index+1),!i){let re=new Error(`0 width match regex (${P})`);throw re.languageName=P,re.badRule=qe.rule,re}return 1}if(qe=B,B.type==="begin")return Gt(B);if(B.type==="illegal"&&!G){let re=new Error('Illegal lexeme "'+X+'" for mode "'+(Z.scope||"<unnamed>")+'"');throw re.mode=Z,re}else if(B.type==="end"){let re=Rt(B);if(re!==ox)return re}if(B.type==="illegal"&&X==="")return B.index===K.length||(ne+=`
3
+ `),1;if(at>1e5&&at>B.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ne+=X,X.length}let ot=je(P);if(!ot)throw Er(r.replace("{}",P)),new Error('Unknown language: "'+P+'"');let ie=Gk(ot),lt="",Z=L||ie,gt={},Ke=new a.__emitter(a);Pe();let ne="",xt=0,be=0,at=0,Ge=!1;try{if(ot.__emitTokens)ot.__emitTokens(K,Ke);else{for(Z.matcher.considerAll();;){at++,Ge?Ge=!1:Z.matcher.considerAll(),Z.matcher.lastIndex=be;let F=Z.matcher.exec(K);if(!F)break;let B=K.substring(be,F.index),X=Te(B,F);be=F.index+X}Te(K.substring(be))}return Ke.finalize(),lt=Ke.toHTML(),{language:P,value:lt,relevance:xt,illegal:!1,_emitter:Ke,_top:Z}}catch(F){if(F.message&&F.message.includes("Illegal"))return{language:P,value:hh(K),illegal:!0,relevance:0,_illegalBy:{message:F.message,index:be,context:K.slice(be-100,be+100),mode:F.mode,resultSoFar:lt},_emitter:Ke};if(i)return{language:P,value:hh(K),illegal:!1,relevance:0,errorRaised:F,_emitter:Ke,_top:Z};throw F}}function y(P){let K={value:hh(P),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return K._emitter.addText(P),K}function _(P,K){K=K||a.languages||Object.keys(e);let G=y(P),L=K.filter(je).filter(dt).map(_e=>f(_e,P,!1));L.unshift(G);let J=L.sort((_e,_t)=>{if(_e.relevance!==_t.relevance)return _t.relevance-_e.relevance;if(_e.language&&_t.language){if(je(_e.language).supersetOf===_t.language)return 1;if(je(_t.language).supersetOf===_e.language)return-1}return 0}),[Re,et]=J,$t=Re;return $t.secondBest=et,$t}function C(P,K,G){let L=K&&n[K]||G;P.classList.add("hljs"),P.classList.add(`language-${L}`)}function w(P){let K=null,G=l(P);if(c(G))return;if(Je("before:highlightElement",{el:P,language:G}),P.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",P);return}if(P.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(P)),a.throwUnescapedHTML))throw new _h("One of your code blocks includes unescaped HTML.",P.innerHTML);K=P;let L=K.textContent,J=G?d(L,{language:G,ignoreIllegals:!0}):_(L);P.innerHTML=J.value,P.dataset.highlighted="yes",C(P,G,J.language),P.result={language:J.language,re:J.relevance,relevance:J.relevance},J.secondBest&&(P.secondBest={language:J.secondBest.language,relevance:J.secondBest.relevance}),Je("after:highlightElement",{el:P,result:J,text:L})}function A(P){a=nx(a,P)}let Y=()=>{he(),ws("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function q(){he(),ws("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let ye=!1;function he(){function P(){he()}if(document.readyState==="loading"){ye||window.addEventListener("DOMContentLoaded",P,!1),ye=!0;return}document.querySelectorAll(a.cssSelector).forEach(w)}function Se(P,K){let G=null;try{G=K(t)}catch(L){if(Er("Language definition for '{}' could not be registered.".replace("{}",P)),i)Er(L);else throw L;G=s}G.name||(G.name=P),e[P]=G,G.rawDefinition=K.bind(null,t),G.aliases&&$e(G.aliases,{languageName:P})}function pe(P){delete e[P];for(let K of Object.keys(n))n[K]===P&&delete n[K]}function Xe(){return Object.keys(e)}function je(P){return P=(P||"").toLowerCase(),e[P]||e[n[P]]}function $e(P,{languageName:K}){typeof P=="string"&&(P=[P]),P.forEach(G=>{n[G.toLowerCase()]=K})}function dt(P){let K=je(P);return K&&!K.disableAutodetect}function wt(P){P["before:highlightBlock"]&&!P["before:highlightElement"]&&(P["before:highlightElement"]=K=>{P["before:highlightBlock"](Object.assign({block:K.el},K))}),P["after:highlightBlock"]&&!P["after:highlightElement"]&&(P["after:highlightElement"]=K=>{P["after:highlightBlock"](Object.assign({block:K.el},K))})}function Pt(P){wt(P),o.push(P)}function Mt(P){let K=o.indexOf(P);K!==-1&&o.splice(K,1)}function Je(P,K){let G=P;o.forEach(function(L){L[G]&&L[G](K)})}function Ce(P){return ws("10.7.0","highlightBlock will be removed entirely in v12.0"),ws("10.7.0","Please use highlightElement now."),w(P)}Object.assign(t,{highlight:d,highlightAuto:_,highlightAll:he,highlightElement:w,highlightBlock:Ce,configure:A,initHighlighting:Y,initHighlightingOnLoad:q,registerLanguage:Se,unregisterLanguage:pe,listLanguages:Xe,getLanguage:je,registerAliases:$e,autoDetection:dt,inherit:nx,addPlugin:Pt,removePlugin:Mt}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=Wk,t.regex={concat:wr,lookahead:sx,either:Ud,optional:lk,anyNumberOfTimes:ck};for(let P in Bd)typeof Bd[P]=="object"&&ix(Bd[P]);return Object.assign(t,Bd),t},Ss=hx({});Ss.newInstance=()=>hx({});gx.exports=Ss;Ss.HighlightJS=Ss;Ss.default=Ss});var Cn=null,bc=!1,Fi=1,$E=null,dn=Symbol("SIGNAL");function me(t){let e=Cn;return Cn=t,e}function wc(){return Cn}var ji={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 Bi(t){if(bc)throw new Error("");if(Cn===null)return;Cn.consumerOnSignalRead(t);let e=Cn.producersTail;if(e!==void 0&&e.producer===t)return;let n,o=Cn.recomputing;if(o&&(n=e!==void 0?e.nextProducer:Cn.producers,n!==void 0&&n.producer===t)){Cn.producersTail=n,n.lastReadVersion=t.version,n.knownValidAtEpoch=Fi;return}let i=t.consumersTail;if(i!==void 0&&i.consumer===Cn&&(!o||i.knownValidAtEpoch===Fi))return;let r=Fr(Cn),s={producer:t,consumer:Cn,nextProducer:n,prevConsumer:void 0,knownValidAtEpoch:Fi,lastReadVersion:t.version,nextConsumer:void 0};Cn.producersTail=s,e!==void 0?e.nextProducer=s:Cn.producers=s,r&&hg(t,s)}function pg(){Fi++}function Bs(t){if(!(Fr(t)&&!t.dirty)&&!(!t.dirty&&t.lastCleanEpoch===Fi)){if(!t.producerMustRecompute(t)&&!$s(t)){Ec(t);return}t.producerRecomputeValue(t),Ec(t)}}function ju(t){if(t.consumers===void 0)return;let e=bc;bc=!0;try{for(let n=t.consumers;n!==void 0;n=n.nextConsumer){let o=n.consumer;o.dirty||HE(o)}}finally{bc=e}}function Bu(){return Cn?.consumerAllowSignalWrites!==!1}function HE(t){t.dirty=!0,ju(t),t.consumerMarkedDirty?.(t)}function Ec(t){t.dirty=!1,t.lastCleanEpoch=Fi}function $i(t){return t&&fg(t),me(t)}function fg(t){if(t.producersTail?.knownValidAtEpoch===Fi){let e=t.producers;for(;e!==void 0;)e.knownValidAtEpoch=null,e=e.nextProducer}t.producersTail=void 0,t.recomputing=!0}function Lr(t,e){me(e),t&&mg(t)}function mg(t){t.recomputing=!1;let e=t.producersTail,n=e!==void 0?e.nextProducer:t.producers;if(n!==void 0){if(Fr(t))do n=$u(n);while(n!==void 0);e!==void 0?e.nextProducer=void 0:t.producers=void 0}}function $s(t){for(let e=t.producers;e!==void 0;e=e.nextProducer){let n=e.producer,o=e.lastReadVersion;if(o!==n.version||(Bs(n),o!==n.version))return!0}return!1}function Hi(t){if(Fr(t)){let e=t.producers;for(;e!==void 0;)e=$u(e)}t.producers=void 0,t.producersTail=void 0,t.consumers=void 0,t.consumersTail=void 0}function hg(t,e){let n=t.consumersTail,o=Fr(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 i=t.producers;i!==void 0;i=i.nextProducer)hg(i.producer,i)}function $u(t){let e=t.producer,n=t.nextProducer,o=t.nextConsumer,i=t.prevConsumer;if(t.nextConsumer=void 0,t.prevConsumer=void 0,o!==void 0?o.prevConsumer=i:e.consumersTail=i,i!==void 0)i.nextConsumer=o;else if(e.consumers=o,!Fr(e)){let r=e.producers;for(;r!==void 0;)r=$u(r)}return n}function Fr(t){return t.consumerIsAlwaysLive||t.consumers!==void 0}function Sc(t){$E?.(t)}function Tc(t,e){return Object.is(t,e)}function Hs(t,e){let n=Object.create(UE);n.computation=t,e!==void 0&&(n.equal=e);let o=()=>{if(Bs(n),Bi(n),n.value===Vi)throw n.error;return n.value};return o[dn]=n,Sc(n),o}var xc=Symbol("UNSET"),Cc=Symbol("COMPUTING"),Vi=Symbol("ERRORED"),UE=Q(j({},ji),{value:xc,dirty:!0,error:null,equal:Tc,kind:"computed",producerMustRecompute(t){return t.value===xc||t.value===Cc},producerRecomputeValue(t){if(t.value===Cc)throw new Error("");let e=t.value;t.value=Cc;let n=$i(t),o,i=!1;try{o=t.computation(),me(null),i=e!==xc&&e!==Vi&&o!==Vi&&t.equal(e,o)}catch(r){o=Vi,t.error=r}finally{Lr(t,n)}if(i){t.value=e;return}t.value=o,t.version++}});function zE(){throw new Error}var gg=zE;function yg(t){gg(t)}function Hu(t){gg=t}var GE=null;function Uu(t,e){let n=Object.create(Us);n.value=t,e!==void 0&&(n.equal=e);let o=()=>vg(n);return o[dn]=n,Sc(n),[o,s=>Ui(n,s),s=>zu(n,s)]}function vg(t){return Bi(t),t.value}function Ui(t,e){Bu()||yg(t),t.equal(t.value,e)||(t.value=e,qE(t))}function zu(t,e){Bu()||yg(t),Ui(t,e(t.value))}var Us=Q(j({},ji),{equal:Tc,value:void 0,kind:"signal"});function qE(t){t.version++,pg(),ju(t),GE?.(t)}var Gu=Q(j({},ji),{consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!0,dirty:!0,kind:"effect"});function qu(t){if(t.dirty=!1,t.version>0&&!$s(t))return;t.version++;let e=$i(t);try{t.cleanup(),t.fn()}finally{Lr(t,e)}}var Wu;function Dc(){return Wu}function Mo(t){let e=Wu;return Wu=t,e}var _g=Symbol("NotFound");function Vr(t){return t===_g||t?.name==="\u0275NotFound"}function bg(t){let e=me(null);try{return t()}finally{me(e)}}function Tn(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 Ic=Mc(t=>function(n){t(this),this.message=n?`${n.length} errors occurred during unsubscription:
4
+ ${n.map((o,i)=>`${i+1}) ${o.toString()}`).join(`
5
+ `)}`:"",this.name="UnsubscriptionError",this.errors=n});function zs(t,e){if(t){let n=t.indexOf(e);0<=n&&t.splice(n,1)}}var En=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 r of n)r.remove(this);else n.remove(this);let{initialTeardown:o}=this;if(Tn(o))try{o()}catch(r){e=r instanceof Ic?r.errors:[r]}let{_finalizers:i}=this;if(i){this._finalizers=null;for(let r of i)try{xg(r)}catch(s){e=e??[],s instanceof Ic?e=[...e,...s.errors]:e.push(s)}}if(e)throw new Ic(e)}}add(e){var n;if(e&&e!==this)if(this.closed)xg(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)&&zs(n,e)}remove(e){let{_finalizers:n}=this;n&&zs(n,e),e instanceof t&&e._removeParent(this)}};En.EMPTY=(()=>{let t=new En;return t.closed=!0,t})();var Yu=En.EMPTY;function kc(t){return t instanceof En||t&&"closed"in t&&Tn(t.remove)&&Tn(t.add)&&Tn(t.unsubscribe)}function xg(t){Tn(t)?t():t.unsubscribe()}var lo={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var jr={setTimeout(t,e,...n){let{delegate:o}=jr;return o?.setTimeout?o.setTimeout(t,e,...n):setTimeout(t,e,...n)},clearTimeout(t){let{delegate:e}=jr;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0};function Cg(t){jr.setTimeout(()=>{let{onUnhandledError:e}=lo;if(e)e(t);else throw t})}function Zu(){}var Eg=Ku("C",void 0,void 0);function wg(t){return Ku("E",void 0,t)}function Sg(t){return Ku("N",t,void 0)}function Ku(t,e,n){return{kind:t,value:e,error:n}}var zi=null;function Br(t){if(lo.useDeprecatedSynchronousErrorHandling){let e=!zi;if(e&&(zi={errorThrown:!1,error:null}),t(),e){let{errorThrown:n,error:o}=zi;if(zi=null,n)throw o}}else t()}function Tg(t){lo.useDeprecatedSynchronousErrorHandling&&zi&&(zi.errorThrown=!0,zi.error=t)}var Gi=class extends En{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,kc(e)&&e.add(this)):this.destination=ZE}static create(e,n,o){return new $r(e,n,o)}next(e){this.isStopped?Xu(Sg(e),this):this._next(e)}error(e){this.isStopped?Xu(wg(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?Xu(Eg,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()}}},WE=Function.prototype.bind;function Qu(t,e){return WE.call(t,e)}var Ju=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:n}=this;if(n.next)try{n.next(e)}catch(o){Nc(o)}}error(e){let{partialObserver:n}=this;if(n.error)try{n.error(e)}catch(o){Nc(o)}else Nc(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(n){Nc(n)}}},$r=class extends Gi{constructor(e,n,o){super();let i;if(Tn(e)||!e)i={next:e??void 0,error:n??void 0,complete:o??void 0};else{let r;this&&lo.useDeprecatedNextContext?(r=Object.create(e),r.unsubscribe=()=>this.unsubscribe(),i={next:e.next&&Qu(e.next,r),error:e.error&&Qu(e.error,r),complete:e.complete&&Qu(e.complete,r)}):i=e}this.destination=new Ju(i)}};function Nc(t){lo.useDeprecatedSynchronousErrorHandling?Tg(t):Cg(t)}function YE(t){throw t}function Xu(t,e){let{onStoppedNotification:n}=lo;n&&jr.setTimeout(()=>n(t,e))}var ZE={closed:!0,next:Zu,error:YE,complete:Zu};var Dg=typeof Symbol=="function"&&Symbol.observable||"@@observable";function Mg(t){return t}function Ig(t){return t.length===0?Mg:t.length===1?t[0]:function(n){return t.reduce((o,i)=>i(o),n)}}var Io=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 i=QE(e)?e:new $r(e,n,o);return Br(()=>{let{operator:r,source:s}=this;i.add(r?r.call(i,s):s?this._subscribe(i):this._trySubscribe(i))}),i}_trySubscribe(e){try{return this._subscribe(e)}catch(n){e.error(n)}}forEach(e,n){return n=kg(n),new n((o,i)=>{let r=new $r({next:s=>{try{e(s)}catch(a){i(a),r.unsubscribe()}},error:i,complete:o});this.subscribe(r)})}_subscribe(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)}[Dg](){return this}pipe(...e){return Ig(e)(this)}toPromise(e){return e=kg(e),new e((n,o)=>{let i;this.subscribe(r=>i=r,r=>o(r),()=>n(i))})}};Io.create=t=>new Io(t);function kg(t){var e;return(e=t??lo.Promise)!==null&&e!==void 0?e:Promise}function KE(t){return t&&Tn(t.next)&&Tn(t.error)&&Tn(t.complete)}function QE(t){return t&&t instanceof Gi||KE(t)&&kc(t)}function XE(t){return Tn(t?.lift)}function Ng(t){return e=>{if(XE(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 Og(t,e,n,o,i){return new ep(t,e,n,o,i)}var ep=class extends Gi{constructor(e,n,o,i,r,s){super(e),this.onFinalize=r,this.shouldUnsubscribe=s,this._next=n?function(a){try{n(a)}catch(c){e.error(c)}}:super._next,this._error=i?function(a){try{i(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 Ag=Mc(t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var Yn=class extends Io{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(e){let n=new Oc(this,this);return n.operator=e,n}_throwIfClosed(){if(this.closed)throw new Ag}next(e){Br(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let n of this.currentObservers)n.next(e)}})}error(e){Br(()=>{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(){Br(()=>{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:i}=this;return n||o?Yu:(this.currentObservers=null,i.push(e),new En(()=>{this.currentObservers=null,zs(i,e)}))}_checkFinalizedStatuses(e){let{hasError:n,thrownError:o,isStopped:i}=this;n?e.error(o):i&&e.complete()}asObservable(){let e=new Io;return e.source=this,e}};Yn.create=(t,e)=>new Oc(t,e);var Oc=class extends Yn{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:Yu}};var Gs=class extends Yn{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 tp(t,e){return Ng((n,o)=>{let i=0;n.subscribe(Og(o,r=>{o.next(t.call(e,r,i++))}))})}var Bc="https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss",ke=class extends Error{code;constructor(e,n){super(Ki(e,n)),this.code=e}};function JE(t){return`NG0${Math.abs(t)}`}function Ki(t,e){return`${JE(t)}${e?": "+e:""}`}function bt(t){for(let e in t)if(t[e]===bt)return e;throw Error("")}function $c(t){if(typeof t=="string")return t;if(Array.isArray(t))return`[${t.map($c).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 Hc(t,e){return t?e?`${t} ${e}`:t:e||""}var ew=bt({__forward_ref__:bt});function Uc(t){return t.__forward_ref__=Uc,t}function Ln(t){return jg(t)?t():t}function jg(t){return typeof t=="function"&&Object.hasOwn(t,ew)&&t.__forward_ref__===Uc}function De(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function zc(t){return tw(t,Gc)}function tw(t,e){return Object.hasOwn(t,e)&&t[e]||null}function nw(t){let e=t?.[Gc]??null;return e||null}function op(t){return t&&Object.hasOwn(t,Pc)?t[Pc]:null}var Gc=bt({\u0275prov:bt}),Pc=bt({\u0275inj:bt}),He=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=De({token:this,providedIn:n.providedIn||"root",factory:n.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};function vp(t){return t&&!!t.\u0275providers}var _p=bt({\u0275cmp:bt}),bp=bt({\u0275dir:bt}),xp=bt({\u0275pipe:bt});var ip=bt({\u0275fac:bt}),Qi=bt({__NG_ELEMENT_ID__:bt}),Pg=bt({__NG_ENV_ID__:bt});function Xi(t){return Cp(t,"@Component"),t[_p]||null}function qc(t){return Cp(t,"@Directive"),t[bp]||null}function Bg(t){return Cp(t,"@Pipe"),t[xp]||null}function Cp(t,e){if(t==null)throw new ke(-919,!1)}function Ji(t){return typeof t=="string"?t:t==null?"":String(t)}var $g=bt({ngErrorCode:bt}),ow=bt({ngErrorMessage:bt}),iw=bt({ngTokenPath:bt});function Ep(t,e){return Hg("",-200,e)}function Wc(t,e){throw new ke(-201,!1)}function Hg(t,e,n){let o=new ke(e,t);return o[$g]=e,o[ow]=t,n&&(o[iw]=n),o}function rw(t){return t[$g]}var rp;function Ug(){return rp}function Rn(t){let e=rp;return rp=t,e}function wp(t,e,n){let o=zc(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;Wc(t,"")}var mi=globalThis;var sw={},qi=sw,aw="__NG_DI_FLAG__",sp=class{injector;constructor(e){this.injector=e}retrieve(e,n){let o=Wi(n)||0;try{return this.injector.get(e,o&8?null:qi,o)}catch(i){if(Vr(i))return i;throw i}}};function cw(t,e=0){let n=Dc();if(n===void 0)throw new ke(-203,!1);if(n===null)return wp(t,void 0,e);{let o=lw(e),i=n.retrieve(t,o);if(Vr(i)){if(o.optional)return null;throw i}return i}}function ct(t,e=0){return(Ug()||cw)(Ln(t),e)}function k(t,e){return ct(t,Wi(e))}function Wi(t){return typeof t>"u"||typeof t=="number"?t:0|(t.optional&&8)|(t.host&&1)|(t.self&&2)|(t.skipSelf&&4)}function lw(t){return{optional:!!(t&8),host:!!(t&1),self:!!(t&2),skipSelf:!!(t&4)}}function ap(t){let e=[];for(let n=0;n<t.length;n++){let o=Ln(t[n]);if(Array.isArray(o)){if(o.length===0)throw new ke(900,!1);let i,r=0;for(let s=0;s<o.length;s++){let a=o[s],c=dw(a);typeof c=="number"?c===-1?i=a.token:r|=c:i=a}e.push(ct(i,r))}else e.push(ct(o))}return e}function dw(t){return t[aw]}function Ur(t,e){let n=Object.hasOwn(t,ip);return n?t[ip]:null}function zg(t,e,n){if(t.length!==e.length)return!1;for(let o=0;o<t.length;o++){let i=t[o],r=e[o];if(n&&(i=n(i),r=n(r)),r!==i)return!1}return!0}function Gg(t){return t.flat(Number.POSITIVE_INFINITY)}function Yc(t,e){t.forEach(n=>Array.isArray(n)?Yc(n,e):e(n))}function Sp(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function Qs(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}function qg(t,e,n,o){let i=t.length;if(i==e)t.push(n,o);else if(i===1)t.push(o,t[0]),t[0]=n;else{for(i--,t.push(t[i-1],t[i]);i>e;){let r=i-2;t[i]=t[r],i--}t[e]=n,t[e+1]=o}}function Zc(t,e,n){let o=Gr(t,e);return o>=0?t[o|1]=n:(o=~o,qg(t,o,e,n)),o}function Kc(t,e){let n=Gr(t,e);if(n>=0)return t[n|1]}function Gr(t,e){return uw(t,e,1)}function uw(t,e,n){let o=0,i=t.length>>n;for(;i!==o;){let r=o+(i-o>>1),s=t[r<<n];if(e===s)return r<<n;s>e?i=r:o=r+1}return~(i<<n)}var er={},uo=[],tr=new He(""),Qc=new He("",-1),Tp=new He(""),zr=class{get(e,n=qi){if(n===qi){let i=Hg("",-201);throw i.name="\u0275NotFound",i}return n}};function qr(t){return{\u0275providers:t}}function Wg(t){return qr([{provide:tr,multi:!0,useValue:t}])}function Yg(...t){return{\u0275providers:Dp(!0,t),\u0275fromNgModule:!0}}function Dp(t,...e){let n=[],o=new Set,i,r=s=>{n.push(s)};return Yc(e,s=>{let a=s;Rc(a,r,[],o)&&(i||=[],i.push(a))}),i!==void 0&&Zg(i,r),n}function Zg(t,e){for(let n=0;n<t.length;n++){let{ngModule:o,providers:i}=t[n];Mp(i,r=>{e(r,o)})}}function Rc(t,e,n,o){if(t=Ln(t),!t)return!1;let i=null,r=op(t),s=!r&&Xi(t);if(!r&&!s){let c=t.ngModule;if(r=op(c),r)i=c;else return!1}else{if(s&&!s.standalone)return!1;i=t}let a=o.has(i);if(s){if(a)return!1;if(o.add(i),s.dependencies){let c=typeof s.dependencies=="function"?s.dependencies():s.dependencies;for(let l of c)Rc(l,e,n,o)}}else if(r){if(r.imports!=null&&!a){o.add(i);let l;Yc(r.imports,d=>{Rc(d,e,n,o)&&(l||=[],l.push(d))}),l!==void 0&&Zg(l,e)}if(!a){let l=Ur(i)||(()=>new i);e({provide:i,useFactory:l,deps:uo},i),e({provide:Tp,useValue:i,multi:!0},i),e({provide:tr,useValue:()=>ct(i),multi:!0},i)}let c=r.providers;if(c!=null&&!a){let l=t;Mp(c,d=>{e(d,l)})}}else return!1;return i!==t&&t.providers!==void 0}function Mp(t,e){for(let n of t)vp(n)&&(n=n.\u0275providers),Array.isArray(n)?Mp(n,e):e(n)}var pw=bt({provide:String,useValue:bt});function Kg(t){return t!==null&&typeof t=="object"&&pw in t}function fw(t){return!!(t&&t.useExisting)}function mw(t){return!!(t&&t.useFactory)}function Lc(t){return typeof t=="function"}var Xs=new He(""),Ac={},Rg={},np;function Js(){return np===void 0&&(np=new zr),np}var po=class{},Yi=class extends po{parent;source;scopes;records=new Map;_ngOnDestroyHooks=new Set;_onDestroyHooks=[];get destroyed(){return this._destroyed}_destroyed=!1;injectorDefTypes;constructor(e,n,o,i){super(),this.parent=n,this.source=o,this.scopes=i,lp(e,s=>this.processProvider(s)),this.records.set(Qc,Hr(void 0,this)),i.has("environment")&&this.records.set(po,Hr(void 0,this));let r=this.records.get(Xs);r!=null&&typeof r.value=="string"&&this.scopes.add(r.value),this.injectorDefTypes=new Set(this.get(Tp,uo,{self:!0}))}retrieve(e,n){let o=Wi(n)||0;try{return this.get(e,qi,o)}catch(i){if(Vr(i))return i;throw i}}destroy(){qs(this),this._destroyed=!0;let e=me(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(),me(e)}}onDestroy(e){return qs(this),this._onDestroyHooks.push(e),()=>this.removeOnDestroy(e)}runInContext(e){qs(this);let n=Mo(this),o=Rn(void 0),i;try{return e()}finally{Mo(n),Rn(o)}}get(e,n=qi,o){if(qs(this),Object.hasOwn(e,Pg))return e[Pg](this);let i=Wi(o),r,s=Mo(this),a=Rn(void 0);try{if(!(i&4)){let l=this.records.get(e);if(l===void 0){let d=_w(e)&&zc(e);d&&this.injectableDefInScope(d)?l=Hr(cp(e),Ac):l=null,this.records.set(e,l)}if(l!=null)return this.hydrate(e,l,i)}let c=i&2?Js():this.parent;return n=i&8&&n===qi?null:n,c.get(e,n)}catch(c){let l=rw(c);throw l===-200||l===-201?new ke(l,null):c}finally{Rn(a),Mo(s)}}resolveInjectorInitializers(){let e=me(null),n=Mo(this),o=Rn(void 0),i;try{let r=this.get(tr,uo,{self:!0});for(let s of r)s()}finally{Mo(n),Rn(o),me(e)}}toString(){return"R3Injector[...]"}processProvider(e){e=Ln(e);let n=Lc(e)?e:Ln(e&&e.provide),o=gw(e);if(!Lc(e)&&e.multi===!0){let i=this.records.get(n);i||(i=Hr(void 0,Ac,!0),i.factory=()=>ap(i.multi),this.records.set(n,i)),n=e,i.multi.push(e)}this.records.set(n,o)}hydrate(e,n,o){let i=me(null);try{if(n.value===Rg)throw Ep("");return n.value===Ac&&(n.value=Rg,n.value=n.factory(void 0,o)),typeof n.value=="object"&&n.value&&vw(n.value)&&this._ngOnDestroyHooks.add(n.value),n.value}finally{me(i)}}injectableDefInScope(e){if(!e.providedIn)return!1;let n=Ln(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 cp(t){let e=zc(t),n=e!==null?e.factory:Ur(t);if(n!==null)return n;if(t instanceof He)throw new ke(-204,!1);if(t instanceof Function)return hw(t);throw new ke(-204,!1)}function hw(t){if(t.length>0)throw new ke(-204,!1);let n=nw(t);return n!==null?()=>n.factory(t):()=>new t}function gw(t){if(Kg(t))return Hr(void 0,t.useValue);{let e=Qg(t);return Hr(e,Ac)}}function Qg(t,e,n){let o;if(Lc(t)){let i=Ln(t);return Ur(i)||cp(i)}else if(Kg(t))o=()=>Ln(t.useValue);else if(mw(t))o=()=>t.useFactory(...ap(t.deps||[]));else if(fw(t))o=(i,r)=>ct(Ln(t.useExisting),r!==void 0&&r&8?8:void 0);else{let i=Ln(t&&(t.useClass||t.provide));if(yw(t))o=()=>new i(...ap(t.deps));else return Ur(i)||cp(i)}return o}function qs(t){if(t.destroyed)throw new ke(-205,!1)}function Hr(t,e,n=!1){return{factory:t,value:e,multi:n?[]:void 0}}function yw(t){return!!t.deps}function vw(t){return t!==null&&typeof t=="object"&&typeof t.ngOnDestroy=="function"}function _w(t){return typeof t=="function"||typeof t=="object"&&t.ngMetadataName==="InjectionToken"}function lp(t,e){for(let n of t)Array.isArray(n)?lp(n,e):n&&vp(n)?lp(n.\u0275providers,e):e(n)}function Xc(t,e){let n;t instanceof Yi?(qs(t),n=t):n=new sp(t);let o,i=Mo(n),r=Rn(void 0);try{return e()}finally{Mo(i),Rn(r)}}function Xg(){return Ug()!==void 0||Dc()!=null}var fo=0,ge=1,Ee=2,zt=3,Kn=4,In=5,Wr=6,Yr=7,Vt=8,Wo=9,mo=10,It=11,Zr=12,Ip=13,hi=14,Fn=15,gi=16,nr=17,ko=18,ea=19,kp=20,zo=21,Jc=22,Go=23,Vn=24,or=25,Jg=26,ta=27,qt=28,ey=1,Np=6,ir=7,na=8,rr=9,jt=10;function yi(t){return Array.isArray(t)&&typeof t[ey]=="object"}function Qn(t){return Array.isArray(t)&&t[ey]===!0}function Op(t){return(t.flags&4)!==0}function vi(t){return t.componentOffset>-1}function Kr(t){return(t.flags&1)===1}function sr(t){return!!t.template}function Qr(t){return(t[Ee]&512)!==0}function ar(t){return(t[Ee]&256)===256}var At=(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})(At||{}),Ws,Zi="svg",el="math",dp="",Lg="*",up=()=>Object.create(null);function bw(){return Ws||(Ws=up(),pi(At.HTML,void 0,[["iframe",["srcdoc"]],["*",["innerHTML","outerHTML"]]]),pi(At.STYLE,void 0,[["*",["style"]]]),pi(At.URL,void 0,[["*",["formAction"]],["area",["href"]],["a",["href","xlink:href"]],["form",["action"]],["img",["src"]],["video",["src"]]]),pi(At.URL,el,[["*",["href","xlink:href"]]]),pi(At.RESOURCE_URL,void 0,[["base",["href"]],["embed",["src"]],["frame",["src"]],["iframe",["src"]],["link",["href"]],["object",["codebase","data"]]]),pi(At.URL,Zi,[["a",["href","xlink:href"]]]),pi(At.ATTRIBUTE_NO_BINDING,Zi,[["animate",["attributeName","values","to","from"]],["set",["to","attributeName"]],["animateMotion",["attributeName"]],["animateTransform",["attributeName"]]]),pi(At.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"]]]),Ws)}function pi(t,e,n){let o=e??dp;for(let[i,r]of n){let s=i.toLowerCase();for(let a of r){let c=a.toLowerCase(),l=Ws[c]??=up(),d=l[o]??=up();d[s]=t}}}function ty(t,e,n){let i=bw()[e.toLowerCase()];if(!i)return At.NONE;let r=t.toLowerCase(),s;if(n){let a=i[n];a&&(s=a[r]??a[Lg])}if(s===void 0){let a=i[dp];a&&(s=a[r]??a[Lg])}if(s===void 0&&(!n||n===dp)){let a=i[Zi];a&&(s=a[r])}return s??At.NONE}function un(t){for(;Array.isArray(t);)t=t[fo];return t}function Ap(t,e){return un(e[t])}function Xn(t,e){return un(e[t.index])}function tl(t,e){return t.data[e]}function ny(t,e){return t[e]}function No(t,e){let n=e[t];return yi(n)?n:n[fo]}function nl(t){return(t[Ee]&128)===128}function oy(t){return Qn(t[zt])}function Jn(t,e){return e==null?null:t[e]}function Pp(t){t[nr]=0}function Rp(t){t[Ee]&1024||(t[Ee]|=1024,nl(t)&&cr(t))}function iy(t,e){for(;t>0;)e=e[hi],t--;return e}function oa(t){return!!(t[Ee]&9216||t[Vn]?.dirty)}function ol(t){t[mo].changeDetectionScheduler?.notify(8),t[Ee]&64&&(t[Ee]|=1024),oa(t)&&cr(t)}function cr(t){t[mo].changeDetectionScheduler?.notify(0);let e=qo(t);for(;e!==null&&!(e[Ee]&8192||(e[Ee]|=8192,!nl(e)));)e=qo(e)}function il(t,e){if(ar(t))throw new ke(911,!1);t[zo]===null&&(t[zo]=[]),t[zo].push(e)}function ry(t,e){if(t[zo]===null)return;let n=t[zo].indexOf(e);n!==-1&&t[zo].splice(n,1)}function qo(t){let e=t[zt];return Qn(e)?e[zt]:e}function Lp(t){return t[Yr]??=[]}function Fp(t){return t.cleanup??=[]}function sy(t,e,n,o){let i=Lp(e);i.push(n),t.firstCreatePass&&Fp(t).push(o,i.length-1)}var Le={lFrame:xy(null),bindingsEnabled:!0,skipHydrationRootTNode:null};var pp=!1;function ay(){return Le.lFrame.elementDepthCount}function cy(){Le.lFrame.elementDepthCount++}function Vp(){Le.lFrame.elementDepthCount--}function rl(){return Le.bindingsEnabled}function ly(){return Le.skipHydrationRootTNode!==null}function jp(t){return Le.skipHydrationRootTNode===t}function Bp(){Le.skipHydrationRootTNode=null}function Ue(){return Le.lFrame.lView}function pn(){return Le.lFrame.tView}function M(t){return Le.lFrame.contextLView=t,t[Vt]}function I(t){return Le.lFrame.contextLView=null,t}function jn(){let t=$p();for(;t!==null&&t.type===64;)t=t.parent;return t}function $p(){return Le.lFrame.currentTNode}function dy(){let t=Le.lFrame,e=t.currentTNode;return t.isParent?e:e.parent}function Xr(t,e){let n=Le.lFrame;n.currentTNode=t,n.isParent=e}function Hp(){return Le.lFrame.isParent}function uy(){Le.lFrame.isParent=!1}function py(){return Le.lFrame.contextLView}function Up(){return pp}function Ys(t){let e=pp;return pp=t,e}function zp(){let t=Le.lFrame,e=t.bindingRootIndex;return e===-1&&(e=t.bindingRootIndex=t.tView.bindingStartIndex),e}function fy(){return Le.lFrame.bindingIndex}function my(t){return Le.lFrame.bindingIndex=t}function lr(){return Le.lFrame.bindingIndex++}function sl(t){let e=Le.lFrame,n=e.bindingIndex;return e.bindingIndex=e.bindingIndex+t,n}function hy(){return Le.lFrame.inI18n}function gy(t,e){let n=Le.lFrame;n.bindingIndex=n.bindingRootIndex=t,al(e)}function yy(){return Le.lFrame.currentDirectiveIndex}function al(t){Le.lFrame.currentDirectiveIndex=t}function vy(t){let e=Le.lFrame.currentDirectiveIndex;return e===-1?null:t[e]}function _y(){return Le.lFrame.currentQueryIndex}function cl(t){Le.lFrame.currentQueryIndex=t}function xw(t){let e=t[ge];return e.type===2?e.declTNode:e.type===1?t[In]:null}function Gp(t,e,n){if(n&4){let i=e,r=t;for(;i=i.parent,i===null&&!(n&1);)if(i=xw(r),i===null||(r=r[hi],i.type&10))break;if(i===null)return!1;e=i,t=r}let o=Le.lFrame=by();return o.currentTNode=e,o.lView=t,!0}function ll(t){let e=by(),n=t[ge];Le.lFrame=e,e.currentTNode=n.firstChild,e.lView=t,e.tView=n,e.contextLView=t,e.bindingIndex=n.bindingStartIndex,e.inI18n=!1}function by(){let t=Le.lFrame,e=t===null?null:t.child;return e===null?xy(t):e}function xy(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 Cy(){let t=Le.lFrame;return Le.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}var qp=Cy;function dl(){let t=Cy();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 Ey(t){return(Le.lFrame.contextLView=iy(t,Le.lFrame.contextLView))[Vt]}function ho(){return Le.lFrame.selectedIndex}function _i(t){Le.lFrame.selectedIndex=t}function ia(){let t=Le.lFrame;return tl(t.tView,t.selectedIndex)}function kt(){Le.lFrame.currentNamespace=Zi}function gn(){Cw()}function Cw(){Le.lFrame.currentNamespace=null}function Wp(){return Le.lFrame.currentNamespace}var wy=!0;function ul(){return wy}function ra(t){wy=t}function fp(t,e=null,n=null,o){let i=Sy(t,e,n,o);return i.resolveInjectorInitializers(),i}function Sy(t,e=null,n=null,o,i=new Set){let r=[n||uo,Yg(t)],s;return new Yi(r,e||Js(),s||null,i)}var Dn=class t{static THROW_IF_NOT_FOUND=qi;static NULL=new zr;static create(e,n){if(Array.isArray(e))return fp({name:""},n,e,"");{let o=e.name??"";return fp({name:o},e.parent,e.providers,o)}}static \u0275prov=De({token:t,providedIn:"any",factory:()=>ct(Qc)});static __NG_ELEMENT_ID__=-1},wn=new He(""),yt=class{static __NG_ELEMENT_ID__=Ew;static __NG_ENV_ID__=e=>e},Fc=class extends yt{_lView;constructor(e){super(),this._lView=e}get destroyed(){return ar(this._lView)}onDestroy(e){let n=this._lView;return il(n,e),()=>ry(n,e)}};function Ew(){return new Fc(Ue())}var Ty=!1,Dy=new He(""),Jr=(()=>{class t{taskId=0;pendingTasks=new Set;destroyed=!1;pendingTask=new Gs(!1);debugTaskTracker=k(Dy,{optional:!0});get hasPendingTasks(){return this.destroyed?!1:this.pendingTask.value}get hasPendingTasksObservable(){return this.destroyed?new Io(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=De({token:t,providedIn:"root",factory:()=>new t})}return t})(),mp=class extends Yn{__isAsync;destroyRef=void 0;pendingTasks=void 0;constructor(e=!1){super(),this.__isAsync=e,Xg()&&(this.destroyRef=k(yt,{optional:!0})??void 0,this.pendingTasks=k(Jr,{optional:!0})??void 0)}emit(e){let n=me(null);try{super.next(e)}finally{me(n)}}subscribe(e,n,o){let i=e,r=n||(()=>null),s=o;if(e&&typeof e=="object"){let c=e;i=c.next?.bind(c),r=c.error?.bind(c),s=c.complete?.bind(c)}this.__isAsync&&(r=this.wrapInTimeout(r),i&&(i=this.wrapInTimeout(i)),s&&(s=this.wrapInTimeout(s)));let a=super.subscribe({next:i,error:r,complete:s});return e instanceof En&&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)}})}}},Uo=mp;function Vc(...t){}function Yp(t){let e,n;function o(){t=Vc;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 My(t){return queueMicrotask(()=>t()),()=>{t=Vc}}var Zp="isAngularZone",Zs=Zp+"_ID",ww=0,Mn=class t{hasPendingMacrotasks=!1;hasPendingMicrotasks=!1;isStable=!0;onUnstable=new Uo(!1);onMicrotaskEmpty=new Uo(!1);onStable=new Uo(!1);onError=new Uo(!1);constructor(e){let{enableLongStackTrace:n=!1,shouldCoalesceEventChangeDetection:o=!1,shouldCoalesceRunChangeDetection:i=!1,scheduleInRootZone:r=Ty}=e;if(typeof Zone>"u")throw new ke(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=!i&&o,s.shouldCoalesceRunChangeDetection=i,s.callbackScheduled=!1,s.scheduleInRootZone=r,Dw(s)}static isInAngularZone(){return typeof Zone<"u"&&Zone.current.get(Zp)===!0}static assertInAngularZone(){if(!t.isInAngularZone())throw new ke(909,!1)}static assertNotInAngularZone(){if(t.isInAngularZone())throw new ke(909,!1)}run(e,n,o){return this._inner.run(e,n,o)}runTask(e,n,o,i){let r=this._inner,s=r.scheduleEventTask("NgZoneEvent: "+i,e,Sw,Vc,Vc);try{return r.runTask(s,n,o)}finally{r.cancelTask(s)}}runGuarded(e,n,o){return this._inner.runGuarded(e,n,o)}runOutsideAngular(e){return this._outer.run(e)}},Sw={};function Kp(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 Tw(t){if(t.isCheckStableRunning||t.callbackScheduled)return;t.callbackScheduled=!0;function e(){Yp(()=>{t.callbackScheduled=!1,hp(t),t.isCheckStableRunning=!0,Kp(t),t.isCheckStableRunning=!1})}t.scheduleInRootZone?Zone.root.run(()=>{e()}):t._outer.run(()=>{e()}),hp(t)}function Dw(t){let e=()=>{Tw(t)},n=ww++;t._inner=t._inner.fork({name:"angular",properties:{[Zp]:!0,[Zs]:n,[Zs+n]:!0},onInvokeTask:(o,i,r,s,a,c)=>{if(Mw(c))return o.invokeTask(r,s,a,c);try{return Fg(t),o.invokeTask(r,s,a,c)}finally{(t.shouldCoalesceEventChangeDetection&&s.type==="eventTask"||t.shouldCoalesceRunChangeDetection)&&e(),Vg(t)}},onInvoke:(o,i,r,s,a,c,l)=>{try{return Fg(t),o.invoke(r,s,a,c,l)}finally{t.shouldCoalesceRunChangeDetection&&!t.callbackScheduled&&!Iw(c)&&e(),Vg(t)}},onHasTask:(o,i,r,s)=>{o.hasTask(r,s),i===r&&(s.change=="microTask"?(t._hasPendingMicrotasks=s.microTask,hp(t),Kp(t)):s.change=="macroTask"&&(t.hasPendingMacrotasks=s.macroTask))},onHandleError:(o,i,r,s)=>(o.handleError(r,s),t.runOutsideAngular(()=>t.onError.emit(s)),!1)})}function hp(t){t._hasPendingMicrotasks||(t.shouldCoalesceEventChangeDetection||t.shouldCoalesceRunChangeDetection)&&t.callbackScheduled===!0?t.hasPendingMicrotasks=!0:t.hasPendingMicrotasks=!1}function Fg(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function Vg(t){t._nesting--,Kp(t)}var Ks=class{hasPendingMicrotasks=!1;hasPendingMacrotasks=!1;isStable=!0;onUnstable=new Uo;onMicrotaskEmpty=new Uo;onStable=new Uo;onError=new Uo;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,i){return e.apply(n,o)}};function Mw(t){return Iy(t,"__ignore_ng_zone__")}function Iw(t){return Iy(t,"__scheduler_tick__")}function Iy(t,e){return!Array.isArray(t)||t.length!==1?!1:t[0]?.data?.[e]===!0}var Zn=class{_console=console;handleError(e){this._console.error("ERROR",e)}};function ky(t){return Ny(t)?t:new gp(t)}function Ny(t){return t instanceof Error||typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.message=="string"}var gp=class extends Error{constructor(e){super(String(e),{cause:e}),this.name="ErrorBoundaryWrappedError"}},bi=new He("",{factory:()=>{let t=k(Mn),e=k(po),n;return o=>{t.runOutsideAngular(()=>{e.destroyed&&!n?setTimeout(()=>{throw o}):(n??=e.get(Zn),n.handleError(o))})}}}),Oy={provide:tr,useValue:()=>{let t=k(Zn,{optional:!0})},multi:!0},kw=new He("",{factory:()=>{let t=k(wn).defaultView;if(!t)return;let e=k(bi),n=r=>{e(r.reason),r.preventDefault()},o=r=>{r.error?e(r.error):e(new Error(r.message,{cause:r})),r.preventDefault()},i=()=>{t.addEventListener("unhandledrejection",n),t.addEventListener("error",o)};typeof Zone<"u"?Zone.root.run(i):i(),k(yt).onDestroy(()=>{t.removeEventListener("error",o),t.removeEventListener("unhandledrejection",n)})}});function Qp(){return qr([Wg(()=>{k(kw)})])}function O(t,e){let[n,o,i]=Uu(t,e?.equal),r=n,s=r[dn];return r.set=o,r.update=i,r.asReadonly=Xp.bind(r),r}function Xp(){let t=this[dn];if(t.readonlyFn===void 0){let e=()=>this();e[dn]=t,t.readonlyFn=e}return t.readonlyFn}var sa=new He("",{factory:()=>Nw}),Nw="ng";var pl=new He(""),aa=new He("",{providedIn:"platform",factory:()=>"unknown"});var fl=new He("",{factory:()=>k(wn).body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});var ca=(()=>{class t{view;node;constructor(n,o){this.view=n,this.node=o}static __NG_ELEMENT_ID__=Ow}return t})();function Ow(){return new ca(Ue(),jn())}var fi=class{},la=new He("",{factory:()=>!0});var Jp=new He(""),ml=(()=>{class t{static \u0275prov=De({token:t,providedIn:"root",factory:()=>new yp})}return t})(),yp=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}},jc=class{[dn];constructor(e){this[dn]=e}destroy(){this[dn].destroy()}};function se(t,e){let n=e?.injector??k(Dn),o=e?.manualCleanup!==!0?n.get(yt):null,i,r=n.get(ca,null,{optional:!0}),s=n.get(fi);return r!==null?(i=Py(r.view,s,t),o instanceof Fc&&o._lView===r.view&&(o=null)):i=Rw(t,n.get(ml),s),i.injector=n,o!==null&&(i.onDestroyFns=[o.onDestroy(()=>i.destroy())]),new jc(i)}var Ay=Q(j({},Gu),{cleanupFns:void 0,zone:null,onDestroyFns:null,run(){let t=Ys(!1);try{qu(this)}finally{Ys(t)}},cleanup(){if(!this.cleanupFns?.length)return;let t=me(null);try{for(;this.cleanupFns.length;)this.cleanupFns.pop()()}finally{this.cleanupFns=[],me(t)}}}),Aw=Q(j({},Ay),{consumerMarkedDirty(){this.scheduler.schedule(this),this.notifier.notify(12)},destroy(){if(Hi(this),this.onDestroyFns!==null)for(let t of this.onDestroyFns)t();this.cleanup(),this.scheduler.remove(this)}}),Pw=Q(j({},Ay),{consumerMarkedDirty(){this.view[Ee]|=8192,cr(this.view),this.notifier.notify(13)},destroy(){if(Hi(this),this.onDestroyFns!==null)for(let t of this.onDestroyFns)t();this.cleanup(),this.view[Go]?.delete(this)}});function Py(t,e,n){let o=Object.create(Pw);return o.view=t,o.zone=typeof Zone<"u"?Zone.current:null,o.notifier=e,o.userFn=n,o.fn=Ry(o,n),t[Go]??=new Set,t[Go].add(o),o.consumerMarkedDirty(o),o}function Rw(t,e,n){let o=Object.create(Aw);return o.userFn=t,o.fn=Ry(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 Ry(t,e){return()=>{e(n=>(t.cleanupFns??=[]).push(n))}}var qf=Symbol("InputSignalNode#UNSET"),y0=Q(j({},Us),{transformFn:void 0,applyValueToInputSignal(t,e){Ui(t,e)}});function Wf(t){return{toString:t}.toString()}var it=(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})(it||{}),wl=class{previousValue;currentValue;firstChange;constructor(e,n,o){this.previousValue=e,this.currentValue=n,this.firstChange=o}isFirstChange(){return this.firstChange}};function v0(t,e,n,o){e!==null?e.applyValueToInputSignal(e,o):t[n]=o}var _0=null,Yf=(()=>{_0=Ly;let t=()=>Ly;return t.ngInherit=!0,t})();function Zw(){return _0}function Ly(t){return t.type.prototype.ngOnChanges&&(t.setInput=Qw),Kw}function Kw(){let t=b0(this),e=t?.current;if(e){let n=t.previous;if(n===er)t.previous=e;else for(let o in e)n[o]=e[o];t.current=null,this.ngOnChanges(e)}}function Qw(t,e,n,o,i){let r=this.declaredInputs[o],s=b0(t)||Xw(t,{previous:er,current:null}),a=s.current||(s.current={}),c=s.previous,l=c[r];a[r]=new wl(l&&l.currentValue,n,c===er),v0(t,e,i,n)}var cf="__ngSimpleChanges__";function b0(t){return Object.hasOwn(t,cf)&&t[cf]||null}function Xw(t,e){return t[cf]=e}var Fy=[];var pt=function(t,e=null,n){for(let o=0;o<Fy.length;o++){let i=Fy[o];i(t,e,n)}};function Jw(t,e,n){let{ngOnChanges:o,ngOnInit:i,ngDoCheck:r}=e.type.prototype;if(o){let s=Zw()(e);(n.preOrderHooks??=[]).push(t,s),(n.preOrderCheckHooks??=[]).push(t,s)}i&&(n.preOrderHooks??=[]).push(0-t,i),r&&((n.preOrderHooks??=[]).push(t,r),(n.preOrderCheckHooks??=[]).push(t,r))}function x0(t,e){for(let n=e.directiveStart,o=e.directiveEnd;n<o;n++){let r=t.data[n].type.prototype,{ngAfterContentInit:s,ngAfterContentChecked:a,ngAfterViewInit:c,ngAfterViewChecked:l,ngOnDestroy:d}=r;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 _l(t,e,n){C0(t,e,3,n)}function bl(t,e,n,o){(t[Ee]&3)===n&&C0(t,e,n,o)}function ef(t,e){let n=t[Ee];(n&3)===e&&(n&=16383,n+=1,t[Ee]=n)}function C0(t,e,n,o){let i=o!==void 0?t[nr]&65535:0,r=o??-1,s=e.length-1,a=0;for(let c=i;c<s;c++)if(typeof e[c+1]=="number"){if(a=e[c],o!=null&&a>=o)break}else e[c]<0&&(t[nr]+=65536),(a<r||r==-1)&&(e1(t,n,e,c),t[nr]=(t[nr]&4294901760)+c+2),c++}function Vy(t,e){pt(it.LifecycleHookStart,t,e);let n=me(null);try{e.call(t)}finally{me(n),pt(it.LifecycleHookEnd,t,e)}}function e1(t,e,n,o){let i=n[o]<0,r=n[o+1],s=i?-n[o]:n[o],a=t[s];i?t[Ee]>>14<t[nr]>>16&&(t[Ee]&3)===e&&(t[Ee]+=16384,Vy(a,r)):Vy(a,r)}var ns=-1,pa=class{factory;name;injectImpl;resolving=!1;canSeeViewProviders;multi;componentProviders;index;providerFactory;constructor(e,n,o,i){this.factory=e,this.name=i,this.canSeeViewProviders=n,this.injectImpl=o}};function t1(t){return(t.flags&8)!==0}function n1(t){return(t.flags&16)!==0}function o1(t,e,n){let o=0;for(;o<n.length;){let i=n[o];if(typeof i=="number"){if(i!==0)break;o++;let r=n[o++],s=n[o++],a=n[o++];t.setAttribute(e,s,a,r)}else{let r=i,s=n[++o];r1(r)?t.setProperty(e,r,s):t.setAttribute(e,r,s),o++}}return o}function i1(t){return t===3||t===4||t===6}function r1(t){return t.charCodeAt(0)===64}function Fl(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 i=e[o];typeof i=="number"?n=i:n===0||(n===-1||n===2?jy(t,n,i,null,e[++o]):jy(t,n,i,null,null))}}return t}function jy(t,e,n,o,i){let r=0,s=t.length;if(e===-1)s=-1;else for(;r<t.length;){let a=t[r++];if(typeof a=="number"){if(a===e){s=-1;break}else if(a>e){s=r-1;break}}}for(;r<t.length;){let a=t[r];if(typeof a=="number")break;if(a===n){i!==null&&(t[r+1]=i);return}r++,i!==null&&r++}s!==-1&&(t.splice(s,0,e),r=s+1),t.splice(r++,0,n),i!==null&&t.splice(r++,0,i)}function E0(t){return t!==ns}function Sl(t){return t&32767}function s1(t){return t>>16}function Tl(t,e){let n=s1(t),o=e;for(;n>0;)o=o[hi],n--;return o}var lf=!0;function By(t){let e=lf;return lf=t,e}var a1=256,w0=a1-1,S0=5,c1=0,Oo={};function l1(t,e,n){let o;typeof n=="string"?o=n.charCodeAt(0)||0:Object.hasOwn(n,Qi)&&(o=n[Qi]),o==null&&(o=n[Qi]=c1++);let i=o&w0,r=1<<i;e.data[t+(i>>S0)]|=r}function T0(t,e){let n=D0(t,e);if(n!==-1)return n;let o=e[ge];o.firstCreatePass&&(t.injectorIndex=e.length,tf(o.data,t),tf(e,null),tf(o.blueprint,null));let i=Zf(t,e),r=t.injectorIndex;if(E0(i)){let s=Sl(i),a=Tl(i,e),c=a[ge].data;for(let l=0;l<8;l++)e[r+l]=a[s+l]|c[s+l]}return e[r+8]=i,r}function tf(t,e){t.push(0,0,0,0,0,0,0,0,e)}function D0(t,e){return t.injectorIndex===-1||t.parent&&t.parent.injectorIndex===t.injectorIndex||e[t.injectorIndex+8]===null?-1:t.injectorIndex}function Zf(t,e){if(t.parent&&t.parent.injectorIndex!==-1)return t.parent.injectorIndex;let n=0,o=null,i=e;for(;i!==null;){if(o=O0(i),o===null)return ns;if(n++,i=i[hi],o.injectorIndex!==-1)return o.injectorIndex|n<<16}return ns}function d1(t,e,n){l1(t,e,n)}function M0(t,e,n){if(n&8||t!==void 0)return t;Wc(e,"NodeInjector")}function I0(t,e,n,o){if(n&8&&o===void 0&&(o=null),(n&3)===0){let i=t[Wo],r=Rn(void 0);try{return i?i.get(e,o,n&8):wp(e,o,n&8)}finally{Rn(r)}}return M0(o,e,n)}function k0(t,e,n,o=0,i){if(t!==null){if(e[Ee]&2048&&!(o&2)){let s=m1(t,e,n,o,Oo);if(s!==Oo)return s}let r=N0(t,e,n,o,Oo);if(r!==Oo)return r}return I0(e,n,o,i)}function N0(t,e,n,o,i){let r=p1(n);if(typeof r=="function"){if(!Gp(e,t,o))return o&1?M0(i,n,o):I0(e,n,o,i);try{let s;if(s=r(o),s==null&&!(o&8))Wc(n);else return s}finally{qp()}}else if(typeof r=="number"){let s=null,a=D0(t,e),c=ns,l=o&1?e[Fn][In]:null;for((a===-1||o&4)&&(c=a===-1?Zf(t,e):e[a+8],c===ns||!Hy(o,!1)?a=-1:(s=e[ge],a=Sl(c),e=Tl(c,e)));a!==-1;){let d=e[ge];if($y(r,a,d.data)){let f=u1(a,e,n,s,o,l);if(f!==Oo)return f}c=e[a+8],c!==ns&&Hy(o,e[ge].data[a+8]===l)&&$y(r,a,e)?(s=d,a=Sl(c),e=Tl(c,e)):a=-1}}return i}function u1(t,e,n,o,i,r){let s=e[ge],a=s.data[t+8],c=o==null?vi(a)&&lf:o!=s&&(a.type&3)!==0,l=i&1&&r===a,d=xl(a,s,n,c,l);return d!==null?Dl(e,s,d,a,i):Oo}function xl(t,e,n,o,i){let r=t.providerIndexes,s=e.data,a=r&1048575,c=t.directiveStart,l=t.directiveEnd,d=r>>20,f=o?a:a+d,y=i?a+d:l;for(let _=f;_<y;_++){let C=s[_];if(_<c&&n===C||_>=c&&C.type===n)return _}if(i){let _=s[c];if(_&&sr(_)&&_.type===n)return c}return null}function Dl(t,e,n,o,i){let r=t[n],s=e.data;if(r instanceof pa){let a=r;if(a.resolving)throw Ep("");let c=By(a.canSeeViewProviders);a.resolving=!0;let l=s[n].type||s[n],d,f=a.injectImpl?Rn(a.injectImpl):null,y=Gp(t,o,0);try{r=t[n]=a.factory(void 0,i,s,t,o),e.firstCreatePass&&n>=o.directiveStart&&Jw(n,s[n],e)}finally{f!==null&&Rn(f),By(c),a.resolving=!1,qp()}}return r}function p1(t){if(typeof t=="string")return t.charCodeAt(0)||0;let e=Object.hasOwn(t,Qi)?t[Qi]:void 0;return typeof e=="number"?e>=0?e&w0:f1:e}function $y(t,e,n){let o=1<<t;return!!(n[e+(t>>S0)]&o)}function Hy(t,e){return!(t&2)&&!(t&1&&e)}var Yo=class{_tNode;_lView;constructor(e,n){this._tNode=e,this._lView=n}get(e,n,o){return k0(this._tNode,this._lView,e,Wi(o),n)}};function f1(){return new Yo(jn(),Ue())}function m1(t,e,n,o,i){let r=t,s=e;for(;r!==null&&s!==null&&s[Ee]&2048&&!Qr(s);){let a=N0(r,s,n,o|2,Oo);if(a!==Oo)return a;o&=-5;let c=r.parent;if(!c){let l=s[kp];if(l){let d=l.get(n,Oo,o);if(d!==Oo)return d}c=O0(s),s=s[hi]}r=c}return i}function O0(t){let e=t[ge],n=e.type;return n===2?e.declTNode:n===1?t[In]:null}function pr(t){return{token:t.token,providedIn:t.autoProvided===!1?null:"root",factory:t.factory,value:void 0}}function h1(){return as(jn(),Ue())}function as(t,e){return new Bt(Xn(t,e))}var Bt=(()=>{class t{nativeElement;constructor(n){this.nativeElement=n}static __NG_ELEMENT_ID__=h1}return t})();function g1(t){return t instanceof Bt?t.nativeElement:t}function y1(){return this._results[Symbol.iterator]()}var Ml=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 Yn}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=Gg(e);(this._changesDetected=!zg(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]=y1};function A0(t){return(t.flags&128)===128}var Kf=(function(t){return t[t.OnPush=0]="OnPush",t[t.Eager=1]="Eager",t[t.Default=1]="Default",t})(Kf||{}),P0=new Map,v1=0;function _1(){return v1++}function b1(t){P0.set(t[ea],t)}function df(t){P0.delete(t[ea])}var Uy="__ngContext__";function os(t,e){yi(e)?(t[Uy]=e[ea],b1(e)):t[Uy]=e}function R0(t){return F0(t[Zr])}function L0(t){return F0(t[Kn])}function F0(t){for(;t!==null&&!Qn(t);)t=t[Kn];return t}var uf;function Qf(t){uf=t}function Xf(){if(uf!==void 0)return uf;if(typeof document<"u")return document;throw new ke(210,!1)}var V0="r";var j0="di";var B0=!1,$0=new He("",{factory:()=>B0});var zy=new WeakMap;function x1(t,e){if(t==null||typeof t!="object")return;let n=zy.get(t);n||(n=new WeakSet,zy.set(t,n)),n.add(e)}var C1=(t,e,n,o)=>{};function E1(t,e,n,o){C1(t,e,n,o)}function Jf(t){return(t.flags&32)===32}var w1=()=>null;function H0(t,e,n=!1){return w1(t,e,n)}function U0(t,e){let n=t.contentQueries;if(n!==null){let o=me(null);try{for(let i=0;i<n.length;i+=2){let r=n[i],s=n[i+1];if(s!==-1){let a=t.data[s];cl(r),a.contentQueries(2,e[s],s)}}}finally{me(o)}}}function pf(t,e,n){cl(0);let o=me(null);try{e(t,n)}finally{me(o)}}function em(t,e,n){if(Op(e)){let o=me(null);try{let i=e.directiveStart,r=e.directiveEnd;for(let s=i;s<r;s++){let a=t.data[s];if(a.contentQueries){let c=n[s];a.contentQueries(1,c,s)}}}finally{me(o)}}}var vo=(function(t){return t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t[t.ExperimentalIsolatedShadowDom=4]="ExperimentalIsolatedShadowDom",t})(vo||{});var S1={"http://www.w3.org/2000/svg":Zi,"http://www.w3.org/1998/Math/MathML":el},hl;function T1(){if(hl===void 0&&(hl=null,mi.trustedTypes))try{hl=mi.trustedTypes.createPolicy("angular",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch{}return hl}function Vl(t){return T1()?.createHTML(t)||t}var gl;function D1(){if(gl===void 0&&(gl=null,mi.trustedTypes))try{gl=mi.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch{}return gl}function Gy(t){return D1()?.createHTML(t)||t}var Zo=class{changingThisBreaksApplicationSecurity;constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${Bc})`}},ff=class extends Zo{getTypeName(){return"HTML"}},mf=class extends Zo{getTypeName(){return"Style"}},hf=class extends Zo{getTypeName(){return"Script"}},gf=class extends Zo{getTypeName(){return"URL"}},yf=class extends Zo{getTypeName(){return"ResourceURL"}};function eo(t){return t instanceof Zo?t.changingThisBreaksApplicationSecurity:t}function Qo(t,e){let n=z0(t);if(n!=null&&n!==e){if(n==="ResourceURL"&&e==="URL")return!0;throw new Error(`Required a safe ${e}, got a ${n} (see ${Bc})`)}return n===e}function z0(t){return t instanceof Zo&&t.getTypeName()||null}function tm(t){return new ff(t)}function nm(t){return new mf(t)}function om(t){return new hf(t)}function im(t){return new gf(t)}function rm(t){return new yf(t)}function M1(t){let e=new _f(t);return I1()?new vf(e):e}var vf=class{inertDocumentHelper;constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e="<body><remove></remove>"+e;try{let n=new window.DOMParser().parseFromString(Vl(e),"text/html").body;return n===null?this.inertDocumentHelper.getInertBodyElement(e):(n.firstChild?.remove(),n)}catch{return null}}},_f=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=Vl(e),n}};function I1(){try{return!!new window.DOMParser().parseFromString(Vl(""),"text/html")}catch{return!1}}var k1=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function ba(t){return t=String(t),t.match(k1)?t:"unsafe:"+t}function Xo(t){let e=Object.create(null);for(let n of t.split(","))e[n]=!0;return e}function xa(...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 G0=Xo("area,br,col,hr,img,wbr"),q0=Xo("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),W0=Xo("rp,rt"),N1=xa(W0,q0),O1=xa(q0,Xo("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")),A1=xa(W0,Xo("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")),qy=xa(G0,O1,A1,N1),Y0=Xo("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),P1=Xo("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"),R1=Xo("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"),L1=xa(Y0,P1,R1),F1=Xo("script,style,template"),bf=class{sanitizedSomething=!1;buf=[];sanitizeChildren(e){let n=e.firstChild,o=!0,i=[];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){i.push(n),n=B1(n);continue}for(;n;){n.nodeType===Node.ELEMENT_NODE&&this.endElement(n);let r=j1(n);if(r){n=r;break}n=i.pop()}}return this.buf.join("")}startElement(e){let n=Wy(e).toLowerCase();if(!Object.hasOwn(qy,n))return this.sanitizedSomething=!0,!Object.hasOwn(F1,n);this.buf.push("<"),this.buf.push(n);let o=e.attributes;for(let i=0;i<o.length;i++){let r=o.item(i),s=r.name,a=s.toLowerCase();if(!Object.hasOwn(L1,a)){this.sanitizedSomething=!0;continue}let c=r.value;Y0[a]&&(c=ba(c)),this.buf.push(" ",s,'="',Yy(c),'"')}return this.buf.push(">"),!0}endElement(e){let n=Wy(e).toLowerCase();Object.hasOwn(qy,n)&&!Object.hasOwn(G0,n)&&(this.buf.push("</"),this.buf.push(n),this.buf.push(">"))}chars(e){this.buf.push(Yy(e))}};function V1(t,e){return(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}function j1(t){let e=t.nextSibling;if(e&&t!==e.previousSibling)throw Z0(e);return e}function B1(t){let e=t.firstChild;if(e&&V1(t,e))throw Z0(e);return e}function Wy(t){let e=t.nodeName;return typeof e=="string"?e:"FORM"}function Z0(t){return new Error(`Failed to sanitize html because the element is clobbered: ${t.outerHTML}`)}var $1=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,H1=/([^\#-~ |!])/g;function Yy(t){return t.replace(/&/g,"&amp;").replace($1,function(e){let n=e.charCodeAt(0),o=e.charCodeAt(1);return"&#"+((n-55296)*1024+(o-56320)+65536)+";"}).replace(H1,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}var yl;function jl(t,e){let n=null;try{yl=yl||M1(t);let o=e?String(e):"";n=yl.getInertBodyElement(o);let i=5,r=o;do{if(i===0)throw new Error("Failed to sanitize html because the input is unstable");i--,o=r,r=n.innerHTML,n=yl.getInertBodyElement(o)}while(o!==r);let a=new bf().sanitizeChildren(Zy(n)||n);return Vl(a)}finally{if(n){let o=Zy(n)||n;for(;o.firstChild;)o.firstChild.remove()}}}function Zy(t){return"content"in t&&U1(t)?t.content:null}function U1(t){return t.nodeType===Node.ELEMENT_NODE&&t.nodeName==="TEMPLATE"}var z1=/^>|^->|<!--|-->|--!>|<!-$/g,G1=/(<|>)/g,q1="\u200B$1\u200B";function W1(t){return t.replace(z1,e=>e.replace(G1,q1))}function Y1(t,e){return t.createText(e)}function Z1(t,e,n){t.setValue(e,n)}function K1(t,e){return t.createComment(W1(e))}function K0(t,e,n){return t.createElement(e,n)}function dr(t,e,n,o,i){t.insertBefore(e,n,o,i)}function Q0(t,e,n){t.appendChild(e,n)}function Ky(t,e,n,o,i){o!==null?dr(t,e,n,o,i):Q0(t,e,n)}function X0(t,e,n,o){t.removeChild(null,e,n,o)}function Q1(t,e,n){t.setAttribute(e,"style",n)}function X1(t,e,n){n===""?t.removeAttribute(e,"class"):t.setAttribute(e,"class",n)}function J0(t,e,n){let{mergedAttrs:o,classes:i,styles:r}=n;o!==null&&o1(t,e,o),i!==null&&X1(t,e,i),r!==null&&Q1(t,e,r)}function J1(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 Ca(t,e,n){if(e!==void 0&&n!==void 0&&eS(e,n)!==At.HTML)return t;let o=ev();return o?Gy(o.sanitize(At.HTML,t)||""):Qo(t,"HTML")?Gy(eo(t)):jl(Xf(),Ji(t))}function bo(t){let e=ev();return e?e.sanitize(At.URL,t)||"":Qo(t,"URL")?eo(t):ba(Ji(t))}function ev(){let t=Ue();return t&&t[mo].sanitizer}function eS(t,e){let[n,o]=tS(t);return ty(o,e,n)}function tS(t){t=t.toLowerCase();let e=J1(t,!1);if(e[0])return e;let o=ho()===-1?null:ia(),i=o?.namespace;if(t==="#host"&&o?.type===2){let r=Xn(o,Ue());if(r.tagName&&(t=r.tagName.toLowerCase()),i==null){let s=r.namespaceURI;i=s&&S1[s]}}return[i,t]}function sm(t){return t.ownerDocument.defaultView}function Dt(t){return t.ownerDocument}function nS(t,e,n){let o=t.length;for(;;){let i=t.indexOf(e,n);if(i===-1)return i;if(i===0||t.charCodeAt(i-1)<=32){let r=e.length;if(i+r===o||t.charCodeAt(i+r)<=32)return i}n=i+1}}var tv="ng-template";function oS(t,e,n,o){let i=0;if(o){for(;i<e.length&&typeof e[i]=="string";i+=2)if(e[i]==="class"&&nS(e[i+1].toLowerCase(),n,0)!==-1)return!0}else if(am(t))return!1;if(i=e.indexOf(1,i),i>-1){let r;for(;++i<e.length&&typeof(r=e[i])=="string";)if(r.toLowerCase()===n)return!0}return!1}function am(t){return t.type===4&&t.value!==tv}function iS(t,e,n){let o=t.type===4&&!n?tv:t.value;return e===o}function rS(t,e,n){let o=4,i=t.attrs,r=i!==null?cS(i):0,s=!1;for(let a=0;a<e.length;a++){let c=e[a];if(typeof c=="number"){if(!s&&!go(o)&&!go(c))return!1;if(s&&go(c))continue;s=!1,o=c|o&1;continue}if(!s)if(o&4){if(o=2|o&1,c!==""&&!iS(t,c,n)||c===""&&e.length===1){if(go(o))return!1;s=!0}}else if(o&8){if(i===null||!oS(t,i,c,n)){if(go(o))return!1;s=!0}}else{let l=e[++a],d=sS(c,i,am(t),n);if(d===-1){if(go(o))return!1;s=!0;continue}if(l!==""){let f;if(d>r?f="":f=i[d+1].toLowerCase(),o&2&&l!==f){if(go(o))return!1;s=!0}}}}return go(o)||s}function go(t){return(t&1)===0}function sS(t,e,n,o){if(e===null)return-1;let i=0;if(o||!n){let r=!1;for(;i<e.length;){let s=e[i];if(s===t)return i;if(s===3||s===6)r=!0;else if(s===1||s===2){let a=e[++i];for(;typeof a=="string";)a=e[++i];continue}else{if(s===4)break;if(s===0){i+=4;continue}}i+=r?1:2}return-1}else return lS(e,t)}function aS(t,e,n=!1){for(let o=0;o<e.length;o++)if(rS(t,e[o],n))return!0;return!1}function cS(t){for(let e=0;e<t.length;e++){let n=t[e];if(i1(n))return e}return t.length}function lS(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 Qy(t,e){return t?":not("+e.trim()+")":e}function dS(t){let e=t[0],n=1,o=2,i="",r=!1;for(;n<t.length;){let s=t[n];if(typeof s=="string")if(o&2){let a=t[++n];i+="["+s+(a.length>0?'="'+a+'"':"")+"]"}else o&8?i+="."+s:o&4&&(i+=" "+s);else i!==""&&!go(s)&&(e+=Qy(r,i),i=""),o=s,r=r||!go(o);n++}return i!==""&&(e+=Qy(r,i)),e}function uS(t){return t.map(dS).join(",")}function pS(t){let e=[],n=[],o=1,i=2;for(;o<t.length;){let r=t[o];if(typeof r=="string")i===2?r!==""&&e.push(r,t[++o]):i===8&&n.push(r);else{if(!go(i))break;i=r}o++}return n.length&&e.push(1,...n),e}var Sn={},Ao=(function(t){return t[t.Important=1]="Important",t[t.DashCase=2]="DashCase",t})(Ao||{}),fS;function cm(t,e){return fS(t,e)}var lm=new Set;var oB=typeof document<"u"&&typeof document?.documentElement?.getAnimations=="function";var xf=new WeakMap;function nv(t){return t?t[hi]??t:null}var es=new WeakSet;function mS(t,e,n){let o=xf.get(t);if(!o||o.length===0)return;let i=e.parentNode,r=e.previousSibling,s=nv(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),es.add(c),c.dispatchEvent(new CustomEvent("animationend",{detail:{cancel:!0}}))):r&&c===r?(o.splice(a,1),c.dispatchEvent(new CustomEvent("animationend",{detail:{cancel:!0}})),c.parentNode?.removeChild(c)):d&&i&&d!==i&&(s===null||l===null||s===l)&&(o.splice(a,1),c.dispatchEvent(new CustomEvent("animationend",{detail:{cancel:!0}})),c.parentNode?.removeChild(c))}}function hS(t,e,n){let o=nv(n),i=xf.get(t);i?i.some(r=>r.el===e)||i.push({el:e,declarationView:o}):xf.set(t,[{el:e,declarationView:o}])}var Bl=(function(t){return t[t.CHANGE_DETECTION=0]="CHANGE_DETECTION",t[t.AFTER_NEXT_RENDER=1]="AFTER_NEXT_RENDER",t})(Bl||{}),Jo=new He(""),Xy=new Set;function fr(t){Xy.has(t)||(Xy.add(t),performance?.mark?.("mark_feature_usage",{detail:{feature:t}}))}var dm=(()=>{class t{impl=null;execute(){this.impl?.execute()}static \u0275prov=De({token:t,providedIn:"root",factory:()=>new t})}return t})(),ov=[0,1,2,3],iv=(()=>{class t{ngZone=k(Mn);scheduler=k(fi);errorHandler=k(Zn,{optional:!0});sequences=new Set;deferredRegistrations=new Set;executing=!1;constructor(){k(Jo,{optional:!0})}execute(){let n=this.sequences.size>0;n&&pt(it.AfterRenderHooksStart),this.executing=!0;for(let o of ov)for(let i of this.sequences)if(!(i.erroredOrDestroyed||!i.hooks[o]))try{i.pipelinedValue=this.ngZone.runOutsideAngular(()=>this.maybeTrace(()=>{let r=i.hooks[o];return r(i.pipelinedValue)},i.snapshot))}catch(r){i.erroredOrDestroyed=!0,this.errorHandler?.handleError(r)}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(it.AfterRenderHooksEnd)}register(n){let{view:o}=n;o!==void 0?((o[or]??=[]).push(n),cr(o),o[Ee]|=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(Bl.AFTER_NEXT_RENDER,n):n()}static \u0275prov=De({token:t,providedIn:"root",factory:()=>new t})}return t})(),Il=class{impl;hooks;view;once;snapshot;erroredOrDestroyed=!1;pipelinedValue=void 0;unregisterOnDestroy;constructor(e,n,o,i,r,s=null){this.impl=e,this.hooks=n,this.view=o,this.once=i,this.snapshot=s,this.unregisterOnDestroy=r?.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?.[or];e&&(this.view[or]=e.filter(n=>n!==this))}};function ei(t,e){let n=e?.injector??k(Dn);return fr("NgAfterNextRender"),yS(t,n,e,!0)}function gS(t){return t instanceof Function?[void 0,void 0,t,void 0]:[t.earlyRead,t.write,t.mixedReadWrite,t.read]}function yS(t,e,n,o){let i=e.get(dm);i.impl??=e.get(iv);let r=e.get(Jo,null,{optional:!0}),s=n?.manualCleanup!==!0?e.get(yt):null,a=e.get(ca,null,{optional:!0}),c=new Il(i.impl,gS(t),a?.view,o,s,r?.snapshot(null));return i.impl.register(c),c}var Cf=null,rv=null;function Jy(t,e,n,o){Cf?.maybeQueueEnterAnimation(t,e,n,o)}function e0(t,e,n,o){Cf===null?o(!1):Cf.runLeaveAnimationsWithCallback(t,e,n,o)}function vS(t){rv?.initViewDetachAnimations(t)}function _S(t){rv?.clearViewDetachAnimations(t)}function ts(t,e,n,o,i,r,s,a){if(i!=null){let c,l=!1;Qn(i)?c=i:yi(i)&&(l=!0,i=i[fo]);let d=un(i);t===0&&o!==null?(Jy(a,o,r,n),s==null?Q0(e,o,d):dr(e,o,d,s||null,!0)):t===1&&o!==null?(dr(e,o,d,s||null,!0),mS(r,d,a),es.has(d)||Jy(a,o,r,n)):t===2?(a?.[Jg]?.leave?.has(r.index)&&hS(r,d,a),es.delete(d),e0(a,r,n,f=>{if(es.has(d)){es.delete(d);return}X0(e,d,l,f)})):t===3&&(es.delete(d),e0(a,r,n,()=>{e.destroyNode(d)})),c!=null&&OS(e,t,n,c,r,o,s)}}function bS(t,e){sv(t,e),e[fo]=null,e[In]=null}function xS(t,e,n,o,i,r){o[fo]=i,o[In]=e,Hl(t,o,n,1,i,r)}function sv(t,e){e[mo].changeDetectionScheduler?.notify(9),Hl(t,e,e[It],2,null,null)}function CS(t){let e=t[Zr];if(!e)return nf(t[ge],t);for(;e;){let n=null;if(yi(e))n=e[Zr];else{let o=e[jt];o&&(n=o)}if(!n){for(;e&&!e[Kn]&&e!==t;)yi(e)&&nf(e[ge],e),e=e[zt];e===null&&(e=t),yi(e)&&nf(e[ge],e),n=e&&e[Kn]}e=n}}function um(t,e){let n=t[rr],o=n.indexOf(e);n.splice(o,1)}function $l(t,e){if(ar(e))return;let n=e[It];n.destroyNode&&Hl(t,e,n,3,null,null),CS(e)}function nf(t,e){if(ar(e))return;let n=me(null);try{e[Ee]&=-129,e[Ee]|=256,e[Vn]&&Hi(e[Vn]),wS(t,e),ES(t,e),e[ge].type===1&&e[It].destroy();let o=e[gi];if(o!==null&&Qn(e[zt])){o!==e[zt]&&um(o,e);let i=e[ko];i!==null&&i.detachView(t)}df(e)}finally{me(n)}}function ES(t,e){let n=t.cleanup,o=e[Yr];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[Yr]=null);let i=e[zo];if(i!==null){e[zo]=null;for(let s=0;s<i.length;s++){let a=i[s];a()}}let r=e[Go];if(r!==null){e[Go]=null;for(let s of r)s.destroy()}}function wS(t,e){let n;if(t!=null&&(n=t.destroyHooks)!=null)for(let o=0;o<n.length;o+=2){let i=e[n[o]];if(!(i instanceof pa)){let r=n[o+1];if(Array.isArray(r))for(let s=0;s<r.length;s+=2){let a=i[r[s]],c=r[s+1];pt(it.LifecycleHookStart,a,c);try{c.call(a)}finally{pt(it.LifecycleHookEnd,a,c)}}else{pt(it.LifecycleHookStart,i,r);try{r.call(i)}finally{pt(it.LifecycleHookEnd,i,r)}}}}}function SS(t,e,n){if(e===null)throw new ke(510,!1);return TS(t,e.parent,n)}function TS(t,e,n){let o=e;for(;o!==null&&o.type&168;)e=o,o=e.parent;if(o===null)return n[fo];if(vi(o)){let{encapsulation:i}=t.data[o.directiveStart+o.componentOffset];if(i===vo.None||i===vo.Emulated)return null}return Xn(o,n)}function DS(t,e,n){return IS(t,e,n)}function MS(t,e,n){return t.type&40?Xn(t,n):null}var IS=MS,t0;function pm(t,e,n,o){let i=SS(t,o,e),r=e[It],s=o.parent||e[In],a=DS(s,o,e);if(i!=null)if(Array.isArray(n))for(let c=0;c<n.length;c++)Ky(r,i,n[c],a,!1);else Ky(r,i,n,a,!1);t0!==void 0&&t0(r,o,e,n,i)}function da(t,e){if(e!==null){let n=e.type;if(n&3)return Xn(e,t);if(n&4)return Ef(-1,t[e.index]);if(n&8){let o=e.child;if(o!==null)return da(t,o);{let i=t[e.index];return Qn(i)?Ef(-1,i):un(i)}}else{if(n&128)return da(t,e.next);if(n&32)return cm(e,t)()||un(t[e.index]);{let o=av(t,e);if(o!==null){if(Array.isArray(o))return o[0];let i=qo(t[Fn]);return da(i,o)}else return da(t,e.next)}}}return null}function av(t,e){if(e!==null){let o=t[Fn][In],i=e.projection;return o.projection[i]}return null}function Ef(t,e){let n=jt+t+1;if(n<e.length){let o=e[n],i=o[ge].firstChild;if(i!==null)return da(o,i)}return e[ir]}function fm(t,e,n,o,i,r,s){for(;n!=null;){let a=o[Wo];if(n.type===128){n=n.next;continue}let c=o[n.index],l=n.type;if(s&&e===0&&(c&&os(un(c),o),n.flags|=2),!Jf(n))if(l&8)fm(t,e,n.child,o,i,r,!1),ts(e,t,a,i,c,n,r,o);else if(l&32){let d=cm(n,o),f;for(;f=d();)ts(e,t,a,i,f,n,r,o);ts(e,t,a,i,c,n,r,o)}else l&16?NS(t,e,o,n,i,r):ts(e,t,a,i,c,n,r,o);n=s?n.projectionNext:n.next}}function Hl(t,e,n,o,i,r){t.type===3?kS(n,o,e,i,r):fm(n,o,t.firstChild,e,i,r,!1)}function kS(t,e,n,o,i){let s=n[ge].firstChild,a=s.next,c=un(n[s.index]),l=un(n[a.index]),d=a.index+1,f=n[d];if(e===1||e===0)o!==null&&(f&&f.hasChildNodes()?dr(t,o,f,i,!0):(dr(t,o,c,i,!0),dr(t,o,l,i,!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 _=y.nextSibling;if(f.appendChild(y),y===l)break;y=_}}}function NS(t,e,n,o,i,r){let s=n[Fn],c=s[In].projection[o.projection];if(Array.isArray(c))for(let l=0;l<c.length;l++){let d=c[l];ts(e,t,n[Wo],i,d,o,r,n)}else{let l=c,d=s[zt];A0(o)&&(l.flags|=128),fm(t,e,l,d,i,r,!0)}}function OS(t,e,n,o,i,r,s){let a=o[ir],c=un(o);if(a!==c&&ts(e,t,n,r,a,i,s),(o[Ee]&4)===0)for(let l=jt;l<o.length;l++){let d=o[l];Hl(d[ge],d,t,e,r,a)}}function AS(t,e,n,o,i){if(e)i?t.addClass(n,o):t.removeClass(n,o);else{let r=o.indexOf("-")===-1?void 0:Ao.DashCase;i==null?t.removeStyle(n,o,r):(typeof i=="string"&&i.endsWith("!important")&&(i=i.slice(0,-10),r|=Ao.Important),t.setStyle(n,o,i,r))}}function mm(t,e,n,o,i,r,s,a,c,l,d){let f=qt+o,y=f+i,_=PS(f,y),C=typeof l=="function"?l():l;return _[ge]={type:t,blueprint:_,template:n,queries:null,viewQuery:a,declTNode:e,data:_.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 r=="function"?r():r,pipeRegistry:typeof s=="function"?s():s,firstChild:null,schemas:c,consts:C,incompleteFirstPass:!1,ssrId:d}}function PS(t,e){let n=[];for(let o=0;o<e;o++)n.push(o<t?null:Sn);return n}function RS(t){let e=t.tView;return e===null||e.incompleteFirstPass?t.tView=mm(1,null,t.template,t.decls,t.vars,t.directiveDefs,t.pipeDefs,t.viewQuery,t.schemas,t.consts,t.id):e}function hm(t,e,n,o,i,r,s,a,c,l,d){let f=e.blueprint.slice();return f[fo]=i,f[Ee]=o|4|128|8|64|1024,(l!==null||t&&t[Ee]&2048)&&(f[Ee]|=2048),Pp(f),f[zt]=f[hi]=t,f[Vt]=n,f[mo]=s||t&&t[mo],f[It]=a||t&&t[It],f[Wo]=c||t&&t[Wo]||null,f[In]=r,f[ea]=_1(),f[Wr]=d,f[kp]=l,f[Fn]=e.type==2?t[Fn]:f,f}function LS(t,e,n){let o=Xn(e,t),i=RS(n),r=t[mo].rendererFactory,s=gm(t,hm(t,i,null,cv(n),o,e,null,r.createRenderer(o,n),null,null,null));return t[e.index]=s}function cv(t){let e=16;return t.signals?e=4096:t.onPush&&(e=64),e}function lv(t,e,n,o){if(n===0)return-1;let i=e.length;for(let r=0;r<n;r++)e.push(o),t.blueprint.push(o),t.data.push(null);return i}function gm(t,e){return t[Zr]?t[Ip][Kn]=e:t[Zr]=e,t[Ip]=e,e}function u(t=1){dv(pn(),Ue(),ho()+t,!1)}function dv(t,e,n,o){if(!o)if((e[Ee]&3)===3){let r=t.preOrderCheckHooks;r!==null&&_l(e,r,n)}else{let r=t.preOrderHooks;r!==null&&bl(e,r,0,n)}_i(n)}var Ul=(function(t){return t[t.None=0]="None",t[t.SignalBased=1]="SignalBased",t[t.HasDecoratorInputTransform=2]="HasDecoratorInputTransform",t})(Ul||{});function wf(t,e,n,o){let i=me(null);try{let[r,s,a]=t.inputs[n],c=null;(s&Ul.SignalBased)!==0&&(c=e[r][dn]),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,r):v0(e,c,r,o)}finally{me(i)}}function uv(t,e,n,o,i){let r=ho(),s=o&2;try{_i(-1),s&&e.length>qt&&dv(t,e,qt,!1);let a=s?it.TemplateUpdateStart:it.TemplateCreateStart;pt(a,i,n),n(o,i)}finally{_i(r);let a=s?it.TemplateUpdateEnd:it.TemplateCreateEnd;pt(a,i,n)}}function zl(t,e,n){US(t,e,n),(n.flags&64)===64&&zS(t,e,n)}function Ea(t,e,n=Xn){let o=e.localNames;if(o!==null){let i=e.index+1;for(let r=0;r<o.length;r+=2){let s=o[r+1],a=s===-1?n(e,t):t[s];t[i++]=a}}}function FS(t,e,n,o){let r=o.get($0,B0)||n===vo.ShadowDom||n===vo.ExperimentalIsolatedShadowDom,s=t.selectRootElement(e,r);return VS(s),s}function VS(t){jS(t)}var jS=()=>null;function BS(t){return t==="class"?"className":t==="for"?"htmlFor":t==="formaction"?"formAction":t==="innerHtml"?"innerHTML":t==="readonly"?"readOnly":t==="tabindex"?"tabIndex":t}function $S(t,e,n,o,i,r){let s=e[ge];if(bm(t,s,e,n,o)){vi(t)&&HS(e,t.index);return}t.type&3&&(n=BS(n)),pv(t,e,n,o,i,r)}function pv(t,e,n,o,i,r){if(t.type&3){let s=Xn(t,e);o=r!=null?r(o,t.value||"",n):o,i.setProperty(s,n,o)}else t.type&12}function HS(t,e){let n=No(e,t);n[Ee]&16||(n[Ee]|=64)}function US(t,e,n){let o=n.directiveStart,i=n.directiveEnd;vi(n)&&LS(e,n,t.data[o+n.componentOffset]),t.firstCreatePass||T0(n,e);let r=n.initialInputs;for(let s=o;s<i;s++){let a=t.data[s],c=Dl(e,t,s,n);if(os(c,e),r!==null&&YS(e,s-o,c,a,n,r),sr(a)){let l=No(n.index,e);l[Vt]=Dl(e,t,s,n)}}}function zS(t,e,n){let o=n.directiveStart,i=n.directiveEnd,r=n.index,s=yy();try{_i(r);for(let a=o;a<i;a++){let c=t.data[a],l=e[a];al(a),(c.hostBindings!==null||c.hostVars!==0||c.hostAttrs!==null)&&GS(c,l)}}finally{_i(-1),al(s)}}function GS(t,e){t.hostBindings!==null&&t.hostBindings(1,e)}function ym(t,e){let n=t.directiveRegistry,o=null;if(n)for(let i=0;i<n.length;i++){let r=n[i];aS(e,r.selectors,!1)&&(o??=[],sr(r)?o.unshift(r):o.push(r))}return o}function qS(t,e,n,o,i,r){let s=Xn(t,e);WS(e[It],s,r,t.value,n,o,i)}function WS(t,e,n,o,i,r,s){if(r==null)s?.(r,o||"",i),t.removeAttribute(e,i,n);else{let a=s==null?Ji(r):s(r,o||"",i);t.setAttribute(e,i,a,n)}}function YS(t,e,n,o,i,r){let s=r[e];if(s!==null)for(let a=0;a<s.length;a+=2){let c=s[a],l=s[a+1];wf(o,n,c,l)}}function vm(t,e,n,o,i){let r=qt+n,s=e[ge],a=i(s,e,t,o,n);e[r]=a,Xr(t,!0);let c=t.type===2;return c?(J0(e[It],a,t),(ay()===0||Kr(t))&&os(a,e),cy()):os(a,e),ul()&&(!c||!Jf(t))&&pm(s,e,a,t),t}function _m(t){let e=t;return Hp()?uy():(e=e.parent,Xr(e,!1)),e}function ZS(t,e){let n=t[Wo];if(!n)return;let o;try{o=n.get(bi,null)}catch{o=null}o?.(e)}function bm(t,e,n,o,i){let r=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];wf(f,n[l],d,i),a=!0}if(r)for(let c of r){let l=n[c],d=e.data[c];wf(d,l,o,i),a=!0}return a}function KS(t,e){let n=No(e,t),o=n[ge];QS(o,n);let i=n[fo];i!==null&&n[Wr]===null&&(n[Wr]=H0(i,n[Wo])),pt(it.ComponentStart);try{xm(o,n,n[Vt])}finally{pt(it.ComponentEnd,n[Vt])}}function QS(t,e){for(let n=e.length;n<t.blueprint.length;n++)e.push(t.blueprint[n])}function xm(t,e,n){ll(e);try{let o=t.viewQuery;o!==null&&pf(1,o,n);let i=t.template;i!==null&&uv(t,e,i,1,n),t.firstCreatePass&&(t.firstCreatePass=!1),e[ko]?.finishViewCreation(t),t.staticContentQueries&&U0(t,e),t.staticViewQueries&&pf(2,t.viewQuery,n);let r=t.components;r!==null&&XS(e,r)}catch(o){throw t.firstCreatePass&&(t.incompleteFirstPass=!0,t.firstCreatePass=!1),o}finally{e[Ee]&=-5,dl()}}function XS(t,e){for(let n=0;n<e.length;n++)KS(t,e[n])}function Gl(t,e,n,o){let i=me(null);try{let r=e.tView,a=t[Ee]&4096?4096:16,c=hm(t,r,n,a,null,e,null,null,o?.injector??null,o?.embeddedViewInjector??null,o?.dehydratedView??null),l=t[e.index];c[gi]=l;let d=t[ko];return d!==null&&(c[ko]=d.createEmbeddedView(r)),xm(r,c,n),c}finally{me(i)}}function fa(t,e){return!e||e.firstChild===null||A0(t)}function ma(t,e,n,o,i=!1){if(t.type===3){let r=t.firstChild,s=r.next,a=un(e[r.index]),c=un(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=i?n.projectionNext:n.next;continue}let r=e[n.index];if(r!==null)if(Qn(r)){let a=r[ir];a!==r[fo]&&o.push(un(r)),r[Ee]&4||fv(r,o),o.push(a)}else o.push(un(r));let s=n.type;if(s&8)ma(t,e,n.child,o);else if(s&32){let a=cm(n,e),c;for(;c=a();)o.push(c)}else if(s&16){let a=av(e,n);if(Array.isArray(a))o.push(...a);else{let c=qo(e[Fn]);ma(c[ge],c,a,o,!0)}}n=i?n.projectionNext:n.next}return o}function fv(t,e){for(let n=jt;n<t.length;n++){let o=t[n],i=o[ge].firstChild;i!==null&&ma(o[ge],o,i,e)}}function mv(t){if(t[or]!==null){for(let e of t[or])e.impl.addSequence(e);t[or].length=0}}var hv=[];function JS(t){return t[Vn]??eT(t)}function eT(t){let e=hv.pop()??Object.create(nT);return e.lView=t,e}function tT(t){t.lView[Vn]!==t&&(t.lView=null,hv.push(t))}var nT=Q(j({},ji),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:t=>{cr(t.lView)},consumerOnSignalRead(){this.lView[Vn]=this}});function oT(t){let e=t[Vn]??Object.create(iT);return e.lView=t,e}var iT=Q(j({},ji),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:t=>{let e=qo(t.lView);for(;e&&!gv(e[ge]);)e=qo(e);e&&Rp(e)},consumerOnSignalRead(){this.lView[Vn]=this}});function gv(t){return t.type!==2}function yv(t){if(t[Go]===null)return;let e=!0;for(;e;){let n=!1;for(let o of t[Go])if(o.dirty&&(n=!0,o.zone===null||Zone.current===o.zone?o.run():o.zone.run(()=>o.run()),t[Go]===null))return;e=n&&!!(t[Ee]&8192)}}var rT=100;function vv(t,e=0){let o=t[mo].rendererFactory,i=!1;i||o.begin?.();try{sT(t,e)}finally{i||o.end?.()}}function sT(t,e){let n=Up();try{Ys(!0),Sf(t,e);let o=0;for(;oa(t);){if(o===rT)throw new ke(103,!1);o++,Sf(t,1)}}finally{Ys(n)}}function aT(t,e,n,o){if(ar(e))return;let i=e[Ee],r=!1,s=!1;ll(e);let a=!0,c=null,l=null;r||(gv(t)?(l=JS(e),c=$i(l)):wc()===null?(a=!1,l=oT(e),c=$i(l)):e[Vn]&&(Hi(e[Vn]),e[Vn]=null));try{Pp(e),my(t.bindingStartIndex),n!==null&&uv(t,e,n,2,o);let d=(i&3)===3;if(!r)if(d){let _=t.preOrderCheckHooks;_!==null&&_l(e,_,null)}else{let _=t.preOrderHooks;_!==null&&bl(e,_,0,null),ef(e,0)}if(s||cT(e),yv(e),_v(e,0),t.contentQueries!==null&&U0(t,e),!r)if(d){let _=t.contentCheckHooks;_!==null&&_l(e,_)}else{let _=t.contentHooks;_!==null&&bl(e,_,1),ef(e,1)}dT(t,e);let f=t.components;f!==null&&xv(e,f,0);let y=t.viewQuery;if(y!==null&&pf(2,y,o),!r)if(d){let _=t.viewCheckHooks;_!==null&&_l(e,_)}else{let _=t.viewHooks;_!==null&&bl(e,_,2),ef(e,2)}if(t.firstUpdatePass===!0&&(t.firstUpdatePass=!1),e[Jc]){for(let _ of e[Jc])_();e[Jc]=null}r||(mv(e),e[Ee]&=-73)}catch(d){let f=!1,y=d,_=e;for(;_!==null;){if(Qn(_)){_=_[zt];continue}let C=_[ta];if(C)try{let w=e[Fn][Vt],A=w?.constructor,Y={declarationInstance:w,declarationType:A,caughtBy:C};C(ky(y),Y),f=!0;break}catch(w){y=w}_=_[zt]}if(!f)throw r||cr(e),y}finally{l!==null&&(Lr(l,c),a&&tT(l)),dl()}}function _v(t,e){for(let n=R0(t);n!==null;n=L0(n))for(let o=jt;o<n.length;o++){let i=n[o];bv(i,e)}}function cT(t){for(let e=R0(t);e!==null;e=L0(e)){if(!(e[Ee]&2))continue;let n=e[rr];for(let o=0;o<n.length;o++){let i=n[o];Rp(i)}}}function lT(t,e,n){pt(it.ComponentStart);let o=No(e,t);try{bv(o,n)}finally{pt(it.ComponentEnd,o[Vt])}}function bv(t,e){nl(t)&&Sf(t,e)}function Sf(t,e){let o=t[ge],i=t[Ee],r=t[Vn],s=!!(e===0&&i&16);if(s||=!!(i&64&&e===0),s||=!!(i&1024),s||=!!(r?.dirty&&$s(r)),s||=!1,r&&(r.dirty=!1),t[Ee]&=-9217,s)aT(o,t,o.template,t[Vt]);else if(i&8192){let a=me(null);try{yv(t),_v(t,1);let c=o.components;c!==null&&xv(t,c,1),mv(t)}finally{me(a)}}}function xv(t,e,n){for(let o=0;o<e.length;o++)lT(t,e[o],n)}function dT(t,e){let n=t.hostBindingOpCodes;if(n!==null)try{for(let o=0;o<n.length;o++){let i=n[o];if(i<0)_i(~i);else{let r=i,s=n[++o],a=n[++o];gy(s,r);let c=e[r];pt(it.HostBindingsUpdateStart,c);try{a(2,c)}finally{pt(it.HostBindingsUpdateEnd,c)}}}}finally{_i(-1)}}function Cm(t,e){let n=Up()?64:1088;for(t[mo].changeDetectionScheduler?.notify(e);t;){t[Ee]|=n;let o=qo(t);if(Qr(t)&&!o)return t;t=o}return null}function Cv(t,e,n,o){return[t,!0,0,e,null,o,null,n,null,null]}function Ev(t,e){let n=jt+e;if(n<t.length)return t[n]}function ql(t,e,n,o=!0){let i=e[ge];if(uT(i,e,t,n),o){let s=Ef(n,t),a=e[It],c=a.parentNode(t[ir]);c!==null&&xS(i,t[In],a,e,c,s)}let r=e[Wr];r!==null&&r.firstChild!==null&&(r.firstChild=null)}function wv(t,e){let n=ha(t,e);return n!==void 0&&$l(n[ge],n),n}function ha(t,e){if(t.length<=jt)return;let n=jt+e,o=t[n];if(o){let i=o[gi];i!==null&&i!==t&&um(i,o),e>0&&(t[n-1][Kn]=o[Kn]);let r=Qs(t,jt+e);bS(o[ge],o);let s=r[ko];s!==null&&s.detachView(r[ge]),o[zt]=null,o[Kn]=null,o[Ee]&=-129}return o}function uT(t,e,n,o){let i=jt+o,r=n.length;o>0&&(n[i-1][Kn]=e),o<r-jt?(e[Kn]=n[i],Sp(n,jt+o,e)):(n.push(e),e[Kn]=null),e[zt]=n;let s=e[gi];s!==null&&n!==s&&Sv(s,e);let a=e[ko];a!==null&&a.insertView(t),ol(e),e[Ee]|=128}function Sv(t,e){let n=t[rr],o=e[zt];if(yi(o))t[Ee]|=2;else{let i=o[zt][Fn];e[Fn]!==i&&(t[Ee]|=2)}n===null?t[rr]=[e]:n.push(e)}var is=class{_lView;_cdRefInjectingView;_appRef=null;_attachedToViewContainer=!1;exhaustive;get rootNodes(){let e=this._lView,n=e[ge];return ma(n,e,n.firstChild,[])}constructor(e,n){this._lView=e,this._cdRefInjectingView=n}get context(){return this._lView[Vt]}set context(e){this._lView[Vt]=e}get destroyed(){return ar(this._lView)}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){let e=this._lView[zt];if(Qn(e)){let n=e[na],o=n?n.indexOf(this):-1;o>-1&&(ha(e,o),Qs(n,o))}this._attachedToViewContainer=!1}$l(this._lView[ge],this._lView)}onDestroy(e){il(this._lView,e)}markForCheck(){Cm(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[Ee]&=-129}reattach(){ol(this._lView),this._lView[Ee]|=128}detectChanges(){this._lView[Ee]|=1024,vv(this._lView)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new ke(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;let e=Qr(this._lView),n=this._lView[gi];n!==null&&!e&&um(n,this._lView),sv(this._lView[ge],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new ke(902,!1);this._appRef=e;let n=Qr(this._lView),o=this._lView[gi];o!==null&&!n&&Sv(o,this._lView),ol(this._lView)}};var rs=(()=>{class t{_declarationLView;_declarationTContainer;elementRef;static __NG_ELEMENT_ID__=pT;constructor(n,o,i){this._declarationLView=n,this._declarationTContainer=o,this.elementRef=i}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(n,o){return this.createEmbeddedViewImpl(n,o)}createEmbeddedViewImpl(n,o,i){let r=Gl(this._declarationLView,this._declarationTContainer,n,{embeddedViewInjector:o,dehydratedView:i});return new is(r)}}return t})();function pT(){return Wl(jn(),Ue())}function Wl(t,e){return t.type&4?new rs(e,t,as(t,e)):null}function wa(t,e,n,o,i){let r=t.data[e];if(r===null)r=fT(t,e,n,o,i),hy()&&(r.flags|=32);else if(r.type&64){r.type=n,r.value=o,r.attrs=i;let s=dy();r.injectorIndex=s===null?-1:s.injectorIndex}return Xr(r,!0),r}function fT(t,e,n,o,i){let r=$p(),s=Hp(),a=s?r:r&&r.parent,c=t.data[e]=hT(t,a,n,e,o,i);return mT(t,c,r,s),c}function mT(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 hT(t,e,n,o,i,r){let s=e?e.injectorIndex:-1,a=0;return ly()&&(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:i,namespace:Wp(),attrs:r,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 gT(t){let e=t[Np]??[],o=t[zt][It],i=[];for(let r of e)r.data[j0]!==void 0?i.push(r):yT(r,o);t[Np]=i}function yT(t,e){let n=0,o=t.firstChild;if(o){let i=t.data[V0];for(;n<i;){let r=o.nextSibling;X0(e,o,!1),o=r,n++}}}var vT=()=>null,_T=()=>null;function Tf(t,e){return vT(t,e)}function Tv(t,e,n){return _T(t,e,n)}var Dv=class{},Ko=class{};var Mv=(()=>{class t{static \u0275prov=De({token:t,providedIn:"root",factory:()=>null})}return t})();function Iv(t){return t.debugInfo?.className||t.type.name||null}var Cl={},kl=class{injector;parentInjector;constructor(e,n){this.injector=e,this.parentInjector=n}get(e,n,o){let i=this.injector.get(e,Cl,o);return i!==Cl||n===Cl?i:this.parentInjector.get(e,n,o)}};function kv(t,e,n){return t[e]=n}function bT(t,e){return t[e]}function _o(t,e,n){if(n===Sn)return!1;let o=t[e];return Object.is(o,n)?!1:(t[e]=n,!0)}function xT(t,e,n,o){let i=_o(t,e,n);return _o(t,e+1,o)||i}function El(t,e,n){return function o(i){let r=o.__ngNativeEl__;r!==void 0&&x1(i,r);let s=vi(t)?No(t.index,e):e;Cm(s,5);let a=e[Vt],c=n0(e,a,n,i),l=o.__ngNextListenerFn__;for(;l;)c=n0(e,a,l,i)&&c,l=l.__ngNextListenerFn__;return c}}function n0(t,e,n,o){let i=me(null);try{return pt(it.OutputStart,e,n),n(o)!==!1}catch(r){return ZS(t,r),!1}finally{pt(it.OutputEnd,e,n),me(i)}}function Nv(t,e,n,o,i,r,s,a){let c=Kr(t),l=!1,d=null;if(!o&&c&&(d=ET(e,n,r,t.index)),d!==null){let f=d.__ngLastListenerFn__||d;f.__ngNextListenerFn__=s,d.__ngLastListenerFn__=s,l=!0}else{let f=Xn(t,n),y=o?o(f):f;E1(n,y,r,a),o||(a.__ngNativeEl__=f);let _=i.listen(y,r,a);if(!CT(r)){let C=o?w=>o(un(w[t.index])):t.index;Ov(C,e,n,r,a,_,!1)}}return l}function CT(t){return t.startsWith("animation")||t.startsWith("transition")}function ET(t,e,n,o){let i=t.cleanup;if(i!=null)for(let r=0;r<i.length-1;r+=2){let s=i[r];if(s===n&&i[r+1]===o){let a=e[Yr],c=i[r+2];return a&&a.length>c?a[c]:null}typeof s=="string"&&(r+=2)}return null}function Ov(t,e,n,o,i,r,s){let a=e.firstCreatePass?Fp(e):null,c=Lp(n),l=c.length;c.push(i,r),a&&a.push(o,t,l,(l+1)*(s?-1:1))}function o0(t,e,n,o,i,r){let s=e[n],a=e[ge],l=a.data[n].outputs[o],f=s[l].subscribe(r);Ov(t.index,a,e,i,r,f,!0)}var Df=Symbol("BINDING");var mr=new He("");function Nl(t,e,n){let o=n?t.styles:null,i=n?t.classes:null,r=0;if(e!==null)for(let s=0;s<e.length;s++){let a=e[s];if(typeof a=="number")r=a;else if(r==1)i=Hc(i,a);else if(r==2){let c=a,l=e[++s];o=Hc(o,c+": "+l+";")}}n?t.styles=o:t.stylesWithoutHost=o,n?t.classes=i:t.classesWithoutHost=i}function Yl(t,e=0){let n=Ue();if(n===null)return ct(t,e);let o=jn();return k0(o,n,Ln(t),e)}function Av(t,e,n,o,i){let r=o===null?null:{"":-1},s=i(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}TT(t,e,n,a,r,c,l)}r!==null&&o!==null&&wT(n,o,r)}function wT(t,e,n){let o=t.localNames=[];for(let i=0;i<e.length;i+=2){let r=n[e[i+1]];if(r==null)throw new ke(-301,!1);o.push(e[i],r)}}function ST(t,e,n){e.componentOffset=n,(t.components??=[]).push(e.index)}function TT(t,e,n,o,i,r,s){let a=o.length,c=null;for(let y=0;y<a;y++){let _=o[y];c===null&&sr(_)&&(c=_,ST(t,n,y)),d1(T0(n,e),t,_.type)}OT(n,t.data.length,a),c?.viewProvidersResolver&&c.viewProvidersResolver(c);for(let y=0;y<a;y++){let _=o[y];_.providersResolver&&_.providersResolver(_)}let l=!1,d=!1,f=lv(t,e,a,null);a>0&&(n.directiveToIndex=new Map);for(let y=0;y<a;y++){let _=o[y];if(n.mergedAttrs=Fl(n.mergedAttrs,_.hostAttrs),MT(t,n,e,f,_),NT(f,_,i),s!==null&&s.has(_)){let[w,A]=s.get(_);n.directiveToIndex.set(_.type,[f,w+n.directiveStart,A+n.directiveStart])}else(r===null||!r.has(_))&&n.directiveToIndex.set(_.type,f);_.contentQueries!==null&&(n.flags|=4),(_.hostBindings!==null||_.hostAttrs!==null||_.hostVars!==0)&&(n.flags|=64);let C=_.type.prototype;!l&&(C.ngOnChanges||C.ngOnInit||C.ngDoCheck)&&((t.preOrderHooks??=[]).push(n.index),l=!0),!d&&(C.ngOnChanges||C.ngDoCheck)&&((t.preOrderCheckHooks??=[]).push(n.index),d=!0),f++}DT(t,n,r)}function DT(t,e,n){for(let o=e.directiveStart;o<e.directiveEnd;o++){let i=t.data[o];if(n===null||!n.has(i))i0(0,e,i,o),i0(1,e,i,o),s0(e,o,!1);else{let r=n.get(i);r0(0,e,r,o),r0(1,e,r,o),s0(e,o,!0)}}}function i0(t,e,n,o){let i=t===0?n.inputs:n.outputs;for(let r in i)if(Object.hasOwn(i,r)){let s;t===0?s=e.inputs??={}:s=e.outputs??={},s[r]??=[],s[r].push(o),Pv(e,r)}}function r0(t,e,n,o){let i=t===0?n.inputs:n.outputs;for(let r in i)if(Object.hasOwn(i,r)){let s=i[r],a;t===0?a=e.hostDirectiveInputs??={}:a=e.hostDirectiveOutputs??={},a[s]??=[],a[s].push(o,r),Pv(e,s)}}function Pv(t,e){e==="class"?t.flags|=8:e==="style"&&(t.flags|=16)}function s0(t,e,n){let{attrs:o,inputs:i,hostDirectiveInputs:r}=t;if(o===null||!n&&i===null||n&&r===null||am(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(i,c)){let l=i[c];for(let d of l)if(d===e){s??=[],s.push(c,o[a+1]);break}}else if(n&&Object.hasOwn(r,c)){let l=r[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 MT(t,e,n,o,i){t.data[o]=i;let r=i.factory||(i.factory=Ur(i.type,!0)),s=new pa(r,sr(i),Yl,null);t.blueprint[o]=s,n[o]=s,IT(t,e,o,lv(t,n,i.hostVars,Sn),i)}function IT(t,e,n,o,i){let r=i.hostBindings;if(r){let s=t.hostBindingOpCodes;s===null&&(s=t.hostBindingOpCodes=[]);let a=~e.index;kT(s)!=a&&s.push(a),s.push(n,o,r)}}function kT(t){let e=t.length;for(;e>0;){let n=t[--e];if(typeof n=="number"&&n<0)return n}return 0}function NT(t,e,n){if(n){if(e.exportAs)for(let o=0;o<e.exportAs.length;o++)n[e.exportAs[o]]=t;sr(e)&&(n[""]=t)}}function OT(t,e,n){t.flags|=1,t.directiveStart=e,t.directiveEnd=e+n,t.providerIndexes=e}function Em(t,e,n,o,i,r,s,a){let c=e[ge],l=c.consts,d=Jn(l,s),f=wa(c,t,n,o,d);return r&&Av(c,e,f,Jn(l,a),i),f.mergedAttrs=Fl(f.mergedAttrs,f.attrs),f.attrs!==null&&Nl(f,f.attrs,!1),f.mergedAttrs!==null&&Nl(f,f.mergedAttrs,!0),c.queries!==null&&c.queries.elementStart(c,f),f}function wm(t,e){x0(t,e),Op(e)&&t.queries.elementEnd(e)}function AT(t,e,n,o,i,r){let s=e.consts,a=Jn(s,i),c=wa(e,t,n,o,a);if(c.mergedAttrs=Fl(c.mergedAttrs,c.attrs),r!=null){let l=Jn(s,r);c.localNames=[];for(let d=0;d<l.length;d+=2)c.localNames.push(l[d],-1)}return c.attrs!==null&&Nl(c,c.attrs,!1),c.mergedAttrs!==null&&Nl(c,c.mergedAttrs,!0),e.queries!==null&&e.queries.elementStart(e,c),c}var Rv=typeof ShadowRoot<"u",PT=typeof Document<"u";function RT(t){return Object.keys(t).map(e=>{let[n,o,i]=t[e],r={propName:n,templateName:e,isSignal:(o&Ul.SignalBased)!==0};return i&&(r.transform=i),r})}function LT(t){return Object.keys(t).map(e=>({propName:t[e],templateName:e}))}function FT(t,e,n){let o=e instanceof po?e:e?.injector;return o&&t.getStandaloneInjector!==null&&(o=t.getStandaloneInjector(o)||o),o?new kl(n,o):n}function VT(t){let e=t.get(Ko,null);if(e===null)throw new ke(407,!1);let n=t.get(Mv,null),o=t.get(fi,null),i=t.get(Jo,null,{optional:!0});return{rendererFactory:e,sanitizer:n,changeDetectionScheduler:o,ngReflect:!1,tracingService:i}}function jT(t,e,n){let o=Lv(t);return K0(e,o,o==="svg"?Zi:o==="math"?el:n)}function BT(t){if((t&&"localName"in t&&typeof t.localName=="string"?t.localName:t?.tagName)?.toLowerCase()==="script")throw new ke(905,!1)}function Lv(t){return(t.selectors[0][0]||"div").toLowerCase()}var ga=class{componentDef;ngModule;selector;componentType;ngContentSelectors;isBoundToModule;cachedInputs=null;cachedOutputs=null;get inputs(){return this.cachedInputs??=RT(this.componentDef.inputs),this.cachedInputs}get outputs(){return this.cachedOutputs??=LT(this.componentDef.outputs),this.cachedOutputs}constructor(e,n){this.componentDef=e,this.ngModule=n,this.componentType=e.type,this.selector=uS(e.selectors),this.ngContentSelectors=e.ngContentSelectors??[],this.isBoundToModule=!!n}create(e,n,o,i,r,s,a,c){pt(it.DynamicComponentStart);let l=me(null);try{let d=this.componentDef,f=FT(d,i||this.ngModule,e),y=VT(f),_=y.tracingService;return _&&_.componentCreate?_.componentCreate(Iv(d),()=>this.createComponentRef(y,f,n,o,r,s,a,c)):this.createComponentRef(y,f,n,o,r,s,a,c)}finally{me(l)}}createComponentRef(e,n,o,i,r,s,a,c){let l=this.componentDef,d=$T(i,l,s,r,c),f=e.rendererFactory.createRenderer(null,l),y=i?FS(f,i,l.encapsulation,n):jT(l,f,a??null);BT(y);let _=n.get(mr,null),C=HT(y,()=>n.get(wn,null)??Xf());_&&_.addHost(C);let w=s?.some(a0)||r?.some(q=>typeof q!="function"&&q.bindings.some(a0)),A=hm(null,d,null,512|cv(l),null,null,e,f,n,null,H0(y,n,!0));_&&Rv&&C instanceof ShadowRoot&&il(A,()=>{_.removeHost(C)}),A[qt]=y,ll(A);let Y=null;try{let q=Em(qt,A,2,"#host",()=>d.directiveRegistry,!0,0);J0(f,y,q),os(y,A),zl(d,A,q),em(d,q,A),wm(d,q),o!==void 0&&zT(q,this.ngContentSelectors,o),Y=No(q.index,A),A[Vt]=Y[Vt],xm(d,A,null)}catch(q){throw Y!==null&&df(Y),df(A),q}finally{pt(it.DynamicComponentEnd),dl()}return new Ol(this.componentType,A,!!w)}};function $T(t,e,n,o,i){let r=t?["ng-version","22.2.1"]:pS(e.selectors[0]),s=null,a=null,c=0;if(n)for(let f of n)c+=f[Df].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 _ of y.bindings){c+=_[Df].requiredVars;let C=f+1;_.create&&(_.targetIdx=C,(s??=[]).push(_)),_.update&&(_.targetIdx=C,(a??=[]).push(_))}}let l=[e];if(o)for(let f of o){let y=typeof f=="function"?f:f.type,_=qc(y);l.push(_)}return mm(0,null,UT(s,a),1,c,l,null,null,null,[r],null)}function HT(t,e){let n=t.getRootNode?.();return PT&&n instanceof Document?n.head:n&&Rv&&n instanceof ShadowRoot?n:e().head}function UT(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 a0(t){let e=t[Df].kind;return e==="input"||e==="twoWay"}var Ol=class extends Dv{_rootLView;_hasInputBindings;instance;hostView;changeDetectorRef;componentType;location;previousInputValues=null;_tNode;constructor(e,n,o){super(),this._rootLView=n,this._hasInputBindings=o,this._tNode=tl(n[ge],qt),this.location=as(this._tNode,n),this.instance=No(this._tNode.index,n)[Vt],this.hostView=this.changeDetectorRef=new is(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 i=this._rootLView,r=bm(o,i[ge],i,e,n);this.previousInputValues.set(e,n);let s=No(o.index,i);Cm(s,1)}get injector(){return new Yo(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}};function zT(t,e,n){let o=t.projection=[];for(let i=0;i<e.length;i++){let r=n[i];o.push(r!=null&&r.length?Array.from(r):null)}}var cs=(()=>{class t{static __NG_ELEMENT_ID__=GT}return t})();function GT(){let t=jn();return Fv(t,Ue())}var Mf=class t extends cs{_lContainer;_hostTNode;_hostLView;constructor(e,n,o){super(),this._lContainer=e,this._hostTNode=n,this._hostLView=o}get element(){return as(this._hostTNode,this._hostLView)}get injector(){return new Yo(this._hostTNode,this._hostLView)}get parentInjector(){let e=Zf(this._hostTNode,this._hostLView);if(E0(e)){let n=Tl(e,this._hostLView),o=Sl(e),i=n[ge].data[o+8];return new Yo(i,n)}else return new Yo(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){let n=c0(this._lContainer);return n!==null&&n[e]||null}get length(){return this._lContainer.length-jt}createEmbeddedView(e,n,o){let i,r,s;typeof o=="number"?i=o:o!=null&&(i=o.index,r=o.injector,s=o.onError);let a=Tf(this._lContainer,e.ssrId),c=e.createEmbeddedViewImpl(n||{},r,a);return s&&(c._lView[ta]=s),this.insertImpl(c,i,fa(this._hostTNode,a)),c}createComponent(e,n,o,i,r,s,a){let c,l,d=n||{};c=d.index,o=d.injector,i=d.projectableNodes,r=d.environmentInjector||d.ngModuleRef,s=d.directives,a=d.bindings,l=d.onError;let f=new ga(Xi(e)),y=o||this.parentInjector;if(!r&&f.ngModule==null){let q=this.parentInjector.get(po,null);q&&(r=q)}let _=Xi(f.componentType??{}),C=Tf(this._lContainer,_?.id??null),w=C?.firstChild??null,A=f.create(y,i,w,r,s,a,this._getHostElementNamespace());return l&&(A.hostView._lView[ta]=l),this.insertImpl(A.hostView,c,fa(this._hostTNode,C)),A}_getHostElementNamespace(){if(this._hostTNode.type&2){let e=this._hostTNode.parent??this._hostLView[In];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 i=e._lView;if(oy(i)){let a=this.indexOf(e);if(a!==-1)this.detach(a);else{let c=i[zt],l=new t(c,c[In],c[zt]);l.detach(l.indexOf(e))}}let r=this._adjustIndex(n),s=this._lContainer;return ql(s,i,r,o),e.attachToViewContainerRef(),Sp(of(s),r,e),e}move(e,n){return this.insert(e,n)}indexOf(e){let n=c0(this._lContainer);return n!==null?n.indexOf(e):-1}remove(e){let n=this._adjustIndex(e,-1),o=ha(this._lContainer,n);o&&(Qs(of(this._lContainer),n),$l(o[ge],o))}detach(e){let n=this._adjustIndex(e,-1),o=ha(this._lContainer,n);return o&&Qs(of(this._lContainer),n)!=null?new is(o):null}_adjustIndex(e,n=0){return e??this.length+n}};function c0(t){return t[na]}function of(t){return t[na]||(t[na]=[])}function Fv(t,e){let n,o=e[t.index];return Qn(o)?n=o:(n=Cv(o,e,null,t),e[t.index]=n,gm(e,n)),WT(n,e,t,o),new Mf(n,t,e)}function qT(t,e){let n=t[It],o=n.createComment(""),i=Xn(e,t),r=n.parentNode(i);return dr(n,r,o,n.nextSibling(i),!1),o}var WT=KT,YT=()=>!1;function ZT(t,e,n){return YT(t,e,n)}function KT(t,e,n,o){if(t[ir])return;let i;n.type&8?i=un(o):i=qT(e,n),t[ir]=i}var If=class t{queryList;matches=null;constructor(e){this.queryList=e}clone(){return new t(this.queryList)}setDirty(){this.queryList.setDirty()}},kf=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,i=[];for(let r=0;r<o;r++){let s=n.getByIndex(r),a=this.queries[s.indexInDeclarationView];i.push(a.clone())}return new t(i)}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++)Bv(e,n).matches!==null&&this.queries[n].setDirty()}},Nf=class{flags;read;predicate;constructor(e,n,o=null){this.flags=n,this.read=o,typeof e=="string"?this.predicate=oD(e):this.predicate=e}},Of=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 i=n!==null?n.length:0,r=this.getByIndex(o).embeddedTView(e,i);r&&(r.indexInDeclarationView=o,n!==null?n.push(r):n=[r])}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)}},Af=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 i=0;i<o.length;i++){let r=o[i];this.matchTNodeWithReadOption(e,n,QT(n,r)),this.matchTNodeWithReadOption(e,n,xl(n,e,r,!1,!1))}else o===rs?n.type&4&&this.matchTNodeWithReadOption(e,n,-1):this.matchTNodeWithReadOption(e,n,xl(n,e,o,!1,!1))}matchTNodeWithReadOption(e,n,o){if(o!==null){let i=this.metadata.read;if(i!==null)if(i===Bt||i===cs||i===Dn||i===rs&&n.type&4)this.addMatch(n.index,-2);else{let r=xl(n,e,i,!1,!1);r!==null&&this.addMatch(n.index,r)}else this.addMatch(n.index,o)}}addMatch(e,n){this.matches===null?this.matches=[e,n]:this.matches.push(e,n)}};function QT(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 XT(t,e){return t.type&11?as(t,e):t.type&4?Wl(t,e):null}function JT(t,e,n,o){return n===-1?XT(e,t):n===-2?eD(t,e,o):Dl(t,t[ge],n,e)}function eD(t,e,n){if(n===Bt)return as(e,t);if(n===rs)return Wl(e,t);if(n===cs)return Fv(e,t);if(n===Dn)return new Yo(e,t)}function Vv(t,e,n,o){let i=e[ko].queries[o];if(i.matches===null){let r=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=r[l];a.push(JT(e,d,s[c+1],n.metadata.read))}}i.matches=a}return i.matches}function Pf(t,e,n,o){let i=t.queries.getByIndex(n),r=i.matches;if(r!==null){let s=Vv(t,e,i,n);for(let a=0;a<r.length;a+=2){let c=r[a];if(c>0)o.push(s[a/2]);else{let l=r[a+1],d=e[-c];for(let f=jt;f<d.length;f++){let y=d[f];y[gi]===y[zt]&&Pf(y[ge],y,l,o)}if(d[rr]!==null){let f=d[rr];for(let y=0;y<f.length;y++){let _=f[y];Pf(_[ge],_,l,o)}}}}}return o}function jv(t,e){return t[ko].queries[e].queryList}function tD(t,e,n){let o=new Ml((n&4)===4);return sy(t,e,o,o.destroy),(e[ko]??=new kf).queries.push(new If(o))-1}function nD(t,e,n){let o=pn();return o.firstCreatePass&&(iD(o,new Nf(t,e,n),-1),(e&2)===2&&(o.staticViewQueries=!0)),tD(o,Ue(),e)}function oD(t){return t.split(",").map(e=>e.trim())}function iD(t,e,n){t.queries===null&&(t.queries=new Of),t.queries.track(new Af(e,n))}function Bv(t,e){return t.queries.getByIndex(e)}function rD(t,e){let n=t[ge],o=Bv(n,e);return o.crossesNgTemplate?Pf(n,t,e,[]):Vv(n,t,o,e)}function Sm(t,e,n){let o,i=Hs(()=>{o._dirtyCounter();let r=aD(o,t);if(e&&r===void 0)throw new ke(-951,!1);return r});return o=i[dn],o._dirtyCounter=O(0),o._flatValue=void 0,i}function $v(t){return Sm(!0,!1,t)}function Hv(t){return Sm(!0,!0,t)}function Uv(t){return Sm(!1,!1,t)}function sD(t,e){let n=t[dn];n._lView=Ue(),n._queryIndex=e,n._queryList=jv(n._lView,e),n._queryList.onDirty(()=>n._dirtyCounter.update(o=>o+1))}function aD(t,e){let n=t._lView,o=t._queryIndex;if(n===void 0||o===void 0||n[Ee]&4)return e?void 0:uo;let i=jv(n,o),r=rD(n,o);return i.reset(r,g1),e?i.first:i._changesDetected||t._flatValue===void 0?t._flatValue=i.toArray():t._flatValue}function Zl(t){return!!t&&typeof t.then=="function"}function Tm(t){return!!t&&typeof t.subscribe=="function"}var ya=class{};var va=class extends ya{injector;instance=null;constructor(e){super();let n=new Yi([...e.providers,{provide:ya,useValue:this}],e.parent||Js(),e.debugName,new Set(["environment"]));this.injector=n,e.runEnvironmentInitializers&&n.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(e){this.injector.onDestroy(e)}};function zv(t,e,n=null){return new va({providers:t,parent:e,debugName:n,runEnvironmentInitializers:!0}).injector}var cD=(()=>{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=Dp(!1,n.type),i=o.length>0?zv([o],this._injector,""):null;this.cachedInjectors.set(n,i)}return this.cachedInjectors.get(n)}ngOnDestroy(){try{for(let n of this.cachedInjectors.values())n!==null&&n.destroy()}finally{this.cachedInjectors.clear()}}static \u0275prov=De({token:t,providedIn:"environment",factory:()=>new t(ct(po))})}return t})();function ae(t){return Wf(()=>{let e=Gv(t),n=Q(j({},e),{decls:t.decls,vars:t.vars,template:t.template,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,onPush:t.changeDetection!==Kf.Eager,directiveDefs:null,pipeDefs:null,dependencies:e.standalone&&t.dependencies||null,getStandaloneInjector:e.standalone?i=>i.get(cD).getOrCreateStandaloneInjector(n):null,getExternalStyles:null,signals:t.signals??!1,data:t.data||{},encapsulation:t.encapsulation||vo.Emulated,styles:t.styles||uo,_:null,schemas:t.schemas||null,tView:null,id:""});e.standalone&&fr("NgStandalone"),qv(n);let o=t.dependencies;return n.directiveDefs=l0(o,lD),n.pipeDefs=l0(o,Bg),n.id=pD(n),n})}function lD(t){return Xi(t)||qc(t)}function dD(t,e){if(t==null)return er;let n={};for(let o in t)if(Object.hasOwn(t,o)){let i=t[o],r,s,a,c;Array.isArray(i)?(a=i[0],r=i[1],s=i[2]??r,c=i[3]||null):(r=i,s=i,a=Ul.None,c=null),n[r]=[o,a,c],e[r]=s}return n}function uD(t){if(t==null)return er;let e={};for(let n in t)Object.hasOwn(t,n)&&(e[t[n]]=n);return e}function hr(t){return Wf(()=>{let e=Gv(t);return qv(e),e})}function Gv(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||er,exportAs:t.exportAs||null,standalone:t.standalone??!0,signals:t.signals===!0,selectors:t.selectors||uo,viewQuery:t.viewQuery||null,features:t.features||null,setInput:null,resolveHostDirectives:null,hostDirectives:null,controlDef:null,signalFormsInputPresence:null,inputs:dD(t.inputs,e),outputs:uD(t.outputs),debugInfo:null}}function qv(t){t.features?.forEach(e=>e(t))}function l0(t,e){return t?()=>{let n=typeof t=="function"?t():t,o=[];for(let i of n){let r=e(i);r!==null&&o.push(r)}return o}:null}function pD(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 r of o.join("|"))e=Math.imul(31,e)+r.charCodeAt(0)<<0;return e+=2147483648,"c"+e}var Wv=new He("");var Dm=(()=>{class t{resolve;reject;initialized=!1;done=!1;donePromise=new Promise((n,o)=>{this.resolve=n,this.reject=o});appInits=k(Wv,{optional:!0})??[];injector=k(Dn);constructor(){}runInitializers(){if(this.initialized)return;let n=[];for(let i of this.appInits){let r=Xc(this.injector,i);if(Zl(r))n.push(r);else if(Tm(r)){let s=new Promise((a,c)=>{r.subscribe({complete:a,error:c})});n.push(s)}}let o=()=>{this.done=!0,this.resolve()};Promise.all(n).then(()=>{o()}).catch(i=>{this.reject(i)}),n.length===0&&o(),this.initialized=!0}static \u0275fac=function(o){return new(o||t)};static \u0275prov=pr({token:t,factory:t.\u0275fac})}return t})();function Yv(t,e,n,o,i,r,s,a){if(n.firstCreatePass){t.mergedAttrs=Fl(t.mergedAttrs,t.attrs);let d=t.tView=mm(2,t,i,r,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),Xr(t,!1);let c=mD(n,e,t,o);ul()&&pm(n,e,c,t),os(c,e);let l=Cv(c,e,c,t);e[o+qt]=l,gm(e,l),ZT(l,t,e)}function fD(t,e,n,o,i,r,s,a,c,l,d){let f=n+qt,y;return e.firstCreatePass?(y=wa(e,f,4,s||null,a||null),rl()&&Av(e,t,y,Jn(e.consts,l),ym),x0(e,y)):y=e.data[f],Yv(y,t,e,n,o,i,r,c),Kr(y)&&zl(e,t,y),l!=null&&Ea(t,y,d),y}function Al(t,e,n,o,i,r,s,a,c,l,d){let f=n+qt,y;if(e.firstCreatePass){if(y=wa(e,f,4,s||null,a||null),l!=null){let _=Jn(e.consts,l);y.localNames=[];for(let C=0;C<_.length;C+=2)y.localNames.push(_[C],-1)}}else y=e.data[f];return Yv(y,t,e,n,o,i,r,c),l!=null&&Ea(t,y,d),y}function Kl(t,e,n,o,i,r,s,a){let c=Ue(),l=pn(),d=Jn(l.consts,r);return fD(c,l,t,e,n,o,i,d,void 0,s,a),Kl}var mD=hD;function hD(t,e,n,o){return ra(!0),e[It].createComment("")}var Mm=new He("");var Im=new He("");function Zv(){Hu(t=>{let e="";throw new ke(-600,e)})}var gD=10;var Sa=(()=>{class t{_runningTick=!1;_destroyed=!1;_destroyListeners=[];_views=[];internalErrorHandler=k(bi);afterRenderManager=k(dm);zonelessEnabled=k(la);rootEffectScheduler=k(ml);dirtyFlags=0;tracingSnapshot=null;allTestViews=new Set;autoDetectTestViews=new Set;includeAllTestViews=!1;afterTick=new Yn;get allViews(){return[...(this.includeAllTestViews?this.allTestViews:this.autoDetectTestViews).keys(),...this._views]}get destroyed(){return this._destroyed}componentTypes=[];components=[];internalPendingTask=k(Jr);get isStable(){return this.internalPendingTask.hasPendingTasksObservable.pipe(tp(n=>!n))}constructor(){k(Jo,{optional:!0})}whenStable(){let n;return new Promise(o=>{n=this.isStable.subscribe({next:i=>{i&&o()}})}).finally(()=>{n.unsubscribe()})}_injector=k(po);_rendererFactory=null;get injector(){return this._injector}bootstrap(n,o){return this.bootstrapImpl(n,o)}bootstrapImpl(n,o,i=Dn.NULL){return this._injector.get(Mn).run(()=>{if(pt(it.BootstrapComponentStart),!this._injector.get(Dm).done){let Y="";throw new ke(405,Y)}let a=Xi(n),c=this._injector.get(ya),l=new ga(a,c);this.componentTypes.push(n);let{hostElement:d,directives:f,bindings:y}=yD(o),_=d||l.selector,C=l.create(i,[],_,c.injector,f,y),w=C.location.nativeElement,A=C.injector.get(Mm,null);return A?.registerApplication(w),C.onDestroy(()=>{this.detachView(C.hostView),ua(this.components,C),A?.unregisterApplication(w)}),this._loadComponent(C),pt(it.BootstrapComponentEnd,C),C})}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick(){pt(it.ChangeDetectionStart),this.tracingSnapshot!==null?this.tracingSnapshot.run(Bl.CHANGE_DETECTION,this.tickImpl):this.tickImpl()}tickImpl=()=>{if(this._runningTick)throw pt(it.ChangeDetectionEnd),new ke(101,!1);let n=me(null);try{this._runningTick=!0,this.synchronize()}finally{this._runningTick=!1,this.tracingSnapshot?.dispose(),this.tracingSnapshot=null,me(n),this.afterTick.next(),pt(it.ChangeDetectionEnd)}};synchronize(){this._rendererFactory===null&&!this._injector.destroyed&&(this._rendererFactory=this._injector.get(Ko,null,{optional:!0}));let n=0;for(;this.dirtyFlags!==0&&n++<gD;){pt(it.ChangeDetectionSyncStart);try{this.synchronizeOnce()}finally{pt(it.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:i}of this.allViews){if(!o&&!oa(i))continue;let r=o&&!this.zonelessEnabled?0:1;vv(i,r),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})=>oa(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;ua(this._views,o),o.detachFromAppRef()}_loadComponent(n){this.attachView(n.hostView);try{this.tick()}catch(i){this.internalErrorHandler(i)}this.components.push(n),this._injector.get(Im,[]).forEach(i=>i(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),()=>ua(this._destroyListeners,n)}destroy(){if(this._destroyed)throw new ke(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=pr({token:t,factory:t.\u0275fac})}return t})();function yD(t){return t===void 0||typeof t=="string"||t instanceof Element?{hostElement:t}:t}function ua(t,e){let n=t.indexOf(e);n>-1&&t.splice(n,1)}function oe(t,e,n,o){let i=Ue(),r=lr();if(_o(i,r,e)){let s=pn(),a=ia();qS(a,i,t,e,n,o)}return oe}var Rf=class{destroy(e){}updateValue(e,n){}swap(e,n){let o=Math.min(e,n),i=Math.max(e,n),r=this.detach(i);if(i-o>1){let s=this.detach(o);this.attach(o,r),this.attach(i,s)}else this.attach(o,r)}move(e,n){this.attach(n,this.detach(e))}};function rf(t,e,n,o,i){return t===n&&Object.is(e,o)?1:Object.is(i(t,e),i(n,o))?-1:0}function vD(t,e,n,o){let i,r,s=0,a=t.length-1,c=void 0;if(Array.isArray(e)){me(o);let l=e.length-1;for(me(null);s<=a&&s<=l;){let d=t.at(s),f=e[s],y=rf(s,d,s,f,n);if(y!==0){y<0&&t.updateValue(s,f),s++;continue}let _=t.at(a),C=e[l],w=rf(a,_,l,C,n);if(w!==0){w<0&&t.updateValue(a,C),a--,l--;continue}let A=n(s,d),Y=n(a,_),q=n(s,f);if(Object.is(q,Y)){let ye=n(l,C);Object.is(ye,A)?(t.swap(s,a),t.updateValue(a,C),l--,a--):t.move(a,s),t.updateValue(s,f),s++;continue}if(i??=new Pl,r??=u0(t,s,a,n),Lf(t,i,s,q))t.updateValue(s,f),s++,a++;else if(r.has(q))i.set(A,t.detach(s)),a--;else{let ye=t.create(s,e[s]);t.attach(s,ye),s++,a++}}for(;s<=l;)d0(t,i,n,s,e[s]),s++}else if(e!=null){me(o);let l=e[Symbol.iterator]();me(null);let d=l.next();for(;!d.done&&s<=a;){let f=t.at(s),y=d.value,_=rf(s,f,s,y,n);if(_!==0)_<0&&t.updateValue(s,y),s++,d=l.next();else{i??=new Pl,r??=u0(t,s,a,n);let C=n(s,y);if(Lf(t,i,s,C))t.updateValue(s,y),s++,a++,d=l.next();else if(!r.has(C))t.attach(s,t.create(s,y)),s++,a++,d=l.next();else{let w=n(s,f);i.set(w,t.detach(s)),a--}}}for(;!d.done;)d0(t,i,n,t.length,d.value),d=l.next()}for(;s<=a;)t.destroy(t.detach(a--));i?.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 d0(t,e,n,o,i){if(Lf(t,e,o,n(o,i)))t.updateValue(o,i);else{let r=t.create(o,i);t.attach(o,r)}}function u0(t,e,n,o){let i=new Set;for(let r=e;r<=n;r++)i.add(o(r,t.at(r)));return i}var Pl=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 i=this._vMap;for(;i.has(o);)o=i.get(o);i.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 i=this._vMap;for(;i.has(o);)o=i.get(o),e(o,n)}}};function T(t,e,n,o,i,r,s,a){fr("NgControlFlow");let c=Ue(),l=pn(),d=Jn(l.consts,r);return Al(c,l,t,e,n,o,i,d,256,s,a),km}function km(t,e,n,o,i,r,s,a){return fr("NgControlFlow"),_D(t,e,n,o,i,r,s,a),km}function _D(t,e,n,o,i,r,s,a){let c=Ue(),l=pn(),d=Jn(l.consts,r);Al(c,l,t,e,n,o,i,d,512,s,a)}function D(t,e){fr("NgControlFlow");let n=Ue(),o=lr(),i=n[o]!==Sn?n[o]:-1,r=i!==-1?Rl(n,qt+i):void 0,s=0;if(_o(n,o,t)){let a=me(null);try{if(r!==void 0&&wv(r,s),t!==-1){let c=qt+t,l=Rl(n,c),d=Bf(n[ge],c),f=Tv(l,d,n),y=Gl(n,d,e,{dehydratedView:f});ql(l,y,s,fa(d,f))}}finally{me(a)}}else if(r!==void 0){let a=Ev(r,s);a!==void 0&&(a[Vt]=e)}}var Ff=class{lContainer;$implicit;$index;constructor(e,n,o){this.lContainer=e,this.$implicit=n,this.$index=o}get $count(){return this.lContainer.length-jt}};function ls(t){return t}function ti(t,e){return e}var Vf=class{hasEmptyBlock;trackByFn;liveCollection;constructor(e,n,o){this.hasEmptyBlock=e,this.trackByFn=n,this.liveCollection=o}};function ce(t,e,n,o,i,r,s,a,c,l,d,f,y){fr("NgControlFlow");let _=Ue(),C=pn(),w=c!==void 0,A=Ue(),Y=a?s.bind(A[Fn][Vt]):s,q=new Vf(w,Y);A[qt+t]=q,Al(_,C,t+1,e,n,o,i,Jn(C.consts,r),256),w&&Al(_,C,t+2,c,l,d,f,Jn(C.consts,y),512)}var jf=class extends Rf{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-jt}at(e){return this.getLView(e)[Vt].$implicit}attach(e,n){let o=n[Wr];this.needsIndexUpdate||=e!==this.length,ql(this.lContainer,n,e,fa(this.templateTNode,o)),bD(this.lContainer,e)}detach(e){return this.needsIndexUpdate||=e!==this.length-1,xD(this.lContainer,e),CD(this.lContainer,e)}create(e,n){let o=Tf(this.lContainer,this.templateTNode.tView.ssrId);return Gl(this.hostLView,this.templateTNode,new Ff(this.lContainer,n,e),{dehydratedView:o})}destroy(e){$l(e[ge],e)}updateValue(e,n){this.getLView(e)[Vt].$implicit=n}reset(){this.needsIndexUpdate=!1}updateIndexes(){if(this.needsIndexUpdate)for(let e=0;e<this.length;e++)this.getLView(e)[Vt].$index=e}getLView(e){return ED(this.lContainer,e)}};function le(t){let e=me(null),n=ho();try{let o=Ue(),i=o[ge],r=o[n],s=n+1,a=Rl(o,s);if(r.liveCollection===void 0){let l=Bf(i,s);r.liveCollection=new jf(a,o,l)}else r.liveCollection.reset();let c=r.liveCollection;if(vD(c,t,r.trackByFn,e),c.updateIndexes(),r.hasEmptyBlock){let l=lr(),d=c.length===0;if(_o(o,l,d)){let f=n+2,y=Rl(o,f);if(d){let _=Bf(i,f),C=Tv(y,_,o),w=Gl(o,_,void 0,{dehydratedView:C});ql(y,w,0,fa(_,C))}else i.firstUpdatePass&&gT(y),wv(y,0)}}}finally{me(e)}}function Rl(t,e){return t[e]}function bD(t,e){if(t.length<=jt)return;let n=jt+e,o=t[n];o&&_S(o)}function xD(t,e){if(t.length<=jt)return;let n=jt+e,o=t[n];o&&vS(o)}function CD(t,e){return ha(t,e)}function ED(t,e){return Ev(t,e)}function Bf(t,e){return tl(t,e)}function W(t,e,n){let o=Ue(),i=lr();if(_o(o,i,e)){let r=pn(),s=ia();$S(s,o,t,e,o[It],n)}return W}function $f(t,e,n,o,i){bm(e,t,n,i?"class":"style",o)}function g(t,e,n,o){let i=Ue(),r=i[ge],s=t+qt,a=r.firstCreatePass?Em(s,i,2,e,ym,rl(),n,o):r.data[s];if(vi(a)){let c=i[mo].tracingService;if(c&&c.componentCreate){let l=r.data[a.directiveStart+a.componentOffset];return c.componentCreate(Iv(l),()=>(p0(t,e,i,a,o),g))}}return p0(t,e,i,a,o),g}function p0(t,e,n,o,i){if(vm(o,n,t,e,Kv),Kr(o)){let r=n[ge];zl(r,n,o),em(r,o,n)}i!=null&&Ea(n,o)}function b(){let t=pn(),e=jn(),n=_m(e);return t.firstCreatePass&&wm(t,n),jp(n)&&Bp(),Vp(),n.classesWithoutHost!=null&&t1(n)&&$f(t,n,Ue(),n.classesWithoutHost,!0),n.stylesWithoutHost!=null&&n1(n)&&$f(t,n,Ue(),n.stylesWithoutHost,!1),b}function xe(t,e,n,o){return g(t,e,n,o),b(),xe}function v(t,e,n,o){let i=Ue(),r=i[ge],s=t+qt,a=r.firstCreatePass?AT(s,r,2,e,n,o):r.data[s];return vm(a,i,t,e,Kv),o!=null&&Ea(i,a),v}function x(){let t=jn(),e=_m(t);return jp(e)&&Bp(),Vp(),x}function Fe(t,e,n,o){return v(t,e,n,o),x(),Fe}var Kv=(t,e,n,o,i)=>(ra(!0),K0(e[It],o,Wp()));function Nm(t,e,n){let o=Ue(),i=o[ge],r=t+qt,s=i.firstCreatePass?Em(r,o,8,"ng-container",ym,rl(),e,n):i.data[r];if(vm(s,o,t,"ng-container",wD),Kr(s)){let a=o[ge];zl(a,o,s),em(a,s,o)}return n!=null&&Ea(o,s),Nm}function Om(){let t=pn(),e=jn(),n=_m(e);return t.firstCreatePass&&wm(t,n),Om}function Ta(t,e,n){return Nm(t,e,n),Om(),Ta}var wD=(t,e,n,o,i)=>(ra(!0),K1(e[It],""));function H(){return Ue()}function ve(t,e,n){let o=Ue(),i=lr();if(_o(o,i,e)){let r=pn(),s=ia();pv(s,o,t,e,o[It],n)}return ve}var Da="en-US";var SD=Da;function Qv(t){typeof t=="string"&&(SD=t.toLowerCase().replace(/_/g,"-"))}function R(t,e,n){let o=Ue(),i=pn(),r=jn();return TD(i,o,o[It],r,t,e,n),R}function U(t,e,n){let o=Ue(),i=pn(),r=jn();return(r.type&3||n)&&Nv(r,i,o,n,o[It],t,e,El(r,o,e)),U}function TD(t,e,n,o,i,r,s){let a=!0,c=null;if((o.type&3||s)&&(c??=El(o,e,r),Nv(o,t,e,s,n,i,r,c)&&(a=!1)),a){let l=o.outputs?.[i],d=o.hostDirectiveOutputs?.[i];if(d&&d.length)for(let f=0;f<d.length;f+=2){let y=d[f],_=d[f+1];c??=El(o,e,r),o0(o,e,y,_,i,c)}if(l&&l.length)for(let f of l)c??=El(o,e,r),o0(o,e,f,i,i,c)}}function m(t=1){return Ey(t)}function ft(t,e,n,o){return sD(t,nD(e,n,o)),ft}function vt(t=1){cl(_y()+t)}function Ql(t){let e=py();return ny(e,qt+t)}function vl(t,e){return t<<17|e<<2}function ur(t){return t>>17&32767}function DD(t){return(t&2)==2}function MD(t,e){return t&131071|e<<17}function Hf(t){return t|2}function ss(t){return(t&131068)>>2}function sf(t,e){return t&-131069|e<<2}function ID(t){return(t&1)===1}function Uf(t){return t|1}function kD(t,e,n,o,i,r){let s=r?e.classBindings:e.styleBindings,a=ur(s),c=ss(s);t[o]=n;let l=!1,d;if(Array.isArray(n)){let f=n;d=f[1],(d===null||Gr(f,d)>0)&&(l=!0)}else d=n;if(i)if(c!==0){let y=ur(t[a+1]);t[o+1]=vl(y,a),y!==0&&(t[y+1]=sf(t[y+1],o)),t[a+1]=MD(t[a+1],o)}else t[o+1]=vl(a,0),a!==0&&(t[a+1]=sf(t[a+1],o)),a=o;else t[o+1]=vl(c,0),a===0?a=o:t[c+1]=sf(t[c+1],o),c=o;l&&(t[o+1]=Hf(t[o+1])),f0(t,d,o,!0),f0(t,d,o,!1),ND(e,d,t,o,r),s=vl(a,c),r?e.classBindings=s:e.styleBindings=s}function ND(t,e,n,o,i){let r=i?t.residualClasses:t.residualStyles;r!=null&&typeof e=="string"&&Gr(r,e)>=0&&(n[o+1]=Uf(n[o+1]))}function f0(t,e,n,o){let i=t[n+1],r=e===null,s=o?ur(i):ss(i),a=!1;for(;s!==0&&(a===!1||r);){let c=t[s],l=t[s+1];OD(c,e)&&(a=!0,t[s+1]=o?Uf(l):Hf(l)),s=o?ur(l):ss(l)}a&&(t[n+1]=o?Hf(i):Uf(i))}function OD(t,e){return t===null||e==null||(Array.isArray(t)?t[1]:t)===e?!0:Array.isArray(t)&&typeof e=="string"?Gr(t,e)>=0:!1}var yo={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function AD(t){return t.substring(yo.key,yo.keyEnd)}function PD(t){return RD(t),Xv(t,Jv(t,0,yo.textEnd))}function Xv(t,e){let n=yo.textEnd;return n===e?-1:(e=yo.keyEnd=LD(t,yo.key=e,n),Jv(t,e,n))}function RD(t){yo.key=0,yo.keyEnd=0,yo.value=0,yo.valueEnd=0,yo.textEnd=t.length}function Jv(t,e,n){for(;e<n&&t.charCodeAt(e)<=32;)e++;return e}function LD(t,e,n){for(;e<n&&t.charCodeAt(e)>32;)e++;return e}function fn(t,e,n){return e_(t,e,n,!1),fn}function de(t,e){return e_(t,e,null,!0),de}function xo(t){VD(zD,FD,t,!0)}function FD(t,e){for(let n=PD(e);n>=0;n=Xv(e,n))Zc(t,AD(e),!0)}function e_(t,e,n,o){let i=Ue(),r=pn(),s=sl(2);if(r.firstUpdatePass&&n_(r,t,s,o),e!==Sn&&_o(i,s,e)){let a=r.data[ho()];o_(r,a,i,i[It],t,i[s+1]=qD(e,n),o,s)}}function VD(t,e,n,o){let i=pn(),r=sl(2);i.firstUpdatePass&&n_(i,null,r,o);let s=Ue();if(n!==Sn&&_o(s,r,n)){let a=i.data[ho()];if(i_(a,o)&&!t_(i,r)){let c=o?a.classesWithoutHost:a.stylesWithoutHost;c!==null&&(n=Hc(c,n||"")),$f(i,a,s,n,o)}else GD(i,a,s,s[It],s[r+1],s[r+1]=UD(t,e,n),o,r)}}function t_(t,e){return e>=t.expandoStartIndex}function n_(t,e,n,o){let i=t.data;if(i[n+1]===null){let r=i[ho()],s=t_(t,n);i_(r,o)&&e===null&&!s&&(e=!1),e=jD(i,r,e,o),kD(i,r,e,n,s,o)}}function jD(t,e,n,o){let i=vy(t),r=o?e.residualClasses:e.residualStyles;if(i===null)(o?e.classBindings:e.styleBindings)===0&&(n=af(null,t,e,n,o),n=_a(n,e.attrs,o),r=null);else{let s=e.directiveStylingLast;if(s===-1||t[s]!==i)if(n=af(i,t,e,n,o),r===null){let c=BD(t,e,o);c!==void 0&&Array.isArray(c)&&(c=af(null,t,e,c[1],o),c=_a(c,e.attrs,o),$D(t,e,o,c))}else r=HD(t,e,o)}return r!==void 0&&(o?e.residualClasses=r:e.residualStyles=r),n}function BD(t,e,n){let o=n?e.classBindings:e.styleBindings;if(ss(o)!==0)return t[ur(o)]}function $D(t,e,n,o){let i=n?e.classBindings:e.styleBindings;t[ur(i)]=o}function HD(t,e,n){let o,i=e.directiveEnd;for(let r=1+e.directiveStylingLast;r<i;r++){let s=t[r].hostAttrs;o=_a(o,s,n)}return _a(o,e.attrs,n)}function af(t,e,n,o,i){let r=null,s=n.directiveEnd,a=n.directiveStylingLast;for(a===-1?a=n.directiveStart:a++;a<s&&(r=e[a],o=_a(o,r.hostAttrs,i),r!==t);)a++;return t!==null&&(n.directiveStylingLast=a),o}function _a(t,e,n){let o=n?1:2,i=-1;if(e!==null)for(let r=0;r<e.length;r++){let s=e[r];typeof s=="number"?i=s:i===o&&(Array.isArray(t)||(t=t===void 0?[]:["",t]),Zc(t,s,n?!0:e[++r]))}return t===void 0?null:t}function UD(t,e,n){if(n==null||n==="")return uo;let o=[],i=eo(n);if(Array.isArray(i))for(let r=0;r<i.length;r++)t(o,i[r],!0);else if(i instanceof Set)for(let r of i)t(o,r,!0);else if(typeof i=="object")for(let r in i)Object.hasOwn(i,r)&&t(o,r,i[r]);else typeof i=="string"&&e(o,i);return o}function zD(t,e,n){let o=String(e);o!==""&&!o.includes(" ")&&Zc(t,o,n)}function GD(t,e,n,o,i,r,s,a){i===Sn&&(i=uo);let c=0,l=0,d=0<i.length?i[0]:null,f=0<r.length?r[0]:null;for(;d!==null||f!==null;){let y=c<i.length?i[c+1]:void 0,_=l<r.length?r[l+1]:void 0,C=null,w;d===f?(c+=2,l+=2,y!==_&&(C=f,w=_)):f===null||d!==null&&d<f?(c+=2,C=d):(l+=2,C=f,w=_),C!==null&&o_(t,e,n,o,C,w,s,a),d=c<i.length?i[c]:null,f=l<r.length?r[l]:null}}function o_(t,e,n,o,i,r,s,a){if(!(e.type&3))return;let c=t.data,l=c[a+1],d=ID(l)?m0(c,e,n,i,ss(l),s):void 0;if(!Ll(d)){Ll(r)||DD(l)&&(r=m0(c,null,n,i,a,s));let f=Ap(ho(),n);AS(o,s,f,i,r)}}function m0(t,e,n,o,i,r){let s=e===null,a;for(;i>0;){let c=t[i],l=Array.isArray(c),d=l?c[1]:c,f=d===null,y=n[i+1];y===Sn&&(y=f?uo:void 0);let _=f?Kc(y,o):d===o?y:void 0;if(l&&!Ll(_)&&(_=Kc(c,o)),Ll(_)&&(a=_,s))return a;let C=t[i+1];i=s?ur(C):ss(C)}if(e!==null){let c=r?e.residualClasses:e.residualStyles;c!=null&&(a=Kc(c,o))}return a}function Ll(t){return t!==void 0}function qD(t,e){return t==null||t===""||(typeof e=="string"?t=eo(t)+e:typeof t=="object"&&(t=$c(eo(t)))),t}function i_(t,e){return(t.flags&(e?8:16))!==0}function p(t,e=""){let n=Ue(),o=pn(),i=t+qt,r=o.firstCreatePass?wa(o,i,1,e,null):o.data[i],s=WD(o,n,r,e);n[i]=s,ul()&&pm(o,n,s,r),Xr(r,!1)}var WD=(t,e,n,o)=>(ra(!0),Y1(e[It],o));function YD(t,e,n,o=""){return _o(t,lr(),n)?e+Ji(n)+o:Sn}function ZD(t,e,n,o,i,r=""){let s=fy(),a=xT(t,s,n,i);return sl(2),a?e+Ji(n)+o+Ji(i)+r:Sn}function N(t){return ue("",t),N}function ue(t,e,n){let o=Ue(),i=YD(o,t,e,n);return i!==Sn&&r_(o,ho(),i),ue}function xi(t,e,n,o,i){let r=Ue(),s=ZD(r,t,e,n,o,i);return s!==Sn&&r_(r,ho(),s),xi}function r_(t,e,n){let o=Ap(e,t);Z1(t[It],o,n)}function Xl(t,e){let n=zp()+t,o=Ue();return o[n]===Sn?kv(o,n,e()):bT(o,n)}function Jl(t,e,n){return QD(Ue(),zp(),t,e,n)}function KD(t,e){let n=t[e];return n===Sn?void 0:n}function QD(t,e,n,o,i,r){let s=e+n;return _o(t,s,i)?kv(t,s+1,r?o.call(r,i):o(i)):KD(t,s+1)}function Am(t,e){return Wl(t,e)}var s_=(()=>{class t{applicationErrorHandler=k(bi);appRef=k(Sa);taskService=k(Jr);ngZone=k(Mn);zonelessEnabled=k(la);tracing=k(Jo,{optional:!0});zoneIsDefined=typeof Zone<"u"&&!!Zone.root.run;schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}];subscriptions=new En;angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(Zs):null;scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(k(Jp,{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?My:Yp;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(Zs+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=pr({token:t,factory:t.\u0275fac})}return t})();function a_(){return[{provide:fi,useExisting:s_},{provide:Mn,useClass:Ks},{provide:la,useValue:!0}]}function XD(){return typeof $localize<"u"&&$localize.locale||Da}var ed=new He("",{factory:()=>k(ed,{optional:!0,skipSelf:!0})||XD()});var td=class{destroyed=!1;listeners=null;errorHandler=k(Zn,{optional:!0});isEmitting=!1;hasNullListeners=!1;destroyRef=k(yt);constructor(){this.destroyRef.onDestroy(()=>{this.destroyed=!0,this.listeners=null})}subscribe(e){if(this.destroyed)throw new ke(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(Ki(953,!1));return}if(this.listeners===null)return;this.isEmitting=!0;let n=me(null);try{for(let o of this.listeners)try{o!==null&&o(e)}catch(i){this.errorHandler?.handleError(i)}}finally{this.hasNullListeners&&(this.hasNullListeners=!1,this.listeners&&JD(this.listeners)),me(n),this.isEmitting=!1}}};function JD(t){let e=t.length-1;for(;e>-1;)t[e]===null&&t.splice(e,1),e--}function E(t,e){return Hs(t,e?.equal)}function Po(t){return bg(t)}var c_=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(y0);n.value=t,n.transformFn=e?.transform;function o(){if(Bi(n),n.value===qf){let i=null;throw new ke(-950,i)}return n.value}return o[dn]=n,o}function rt(t){return new td}function l_(t,e){return p_(t,e)}function vM(t){return p_(qf,t)}var ee=(l_.required=vM,l_);function d_(t,e){return $v(e)}function _M(t,e){return Hv(e)}var Qe=(d_.required=_M,d_);function f_(t,e){return Uv(e)}var bM=1e4;var Pz=bM-1e3;var Pm=new He(""),xM=new He("");function Ma(t){return!t.moduleRef}function CM(t){let e=Ma(t)?t.r3Injector:t.moduleRef.injector,n=e.get(Mn);return n.run(()=>{Ma(t)?t.r3Injector.resolveInjectorInitializers():t.moduleRef.resolveInjectorInitializers();let o=e.get(bi),i;if(n.runOutsideAngular(()=>{i=n.onError.subscribe({next:o})}),Ma(t)){let r=()=>e.destroy(),s=t.platformInjector.get(Pm);s.add(r),e.onDestroy(()=>{i.unsubscribe(),s.delete(r)})}else{let r=()=>t.moduleRef.destroy(),s=t.platformInjector.get(Pm);s.add(r),t.moduleRef.onDestroy(()=>{ua(t.allPlatformModules,t.moduleRef),i.unsubscribe(),s.delete(r)})}return wM(o,n,()=>{let r=e.get(Jr),s=r.add(),a=e.get(Dm);return a.runInitializers(),a.donePromise.then(()=>{let c=e.get(ed,Da);if(Qv(c||Da),!e.get(xM,!0))return Ma(t)?e.get(Sa):(t.allPlatformModules.push(t.moduleRef),t.moduleRef);if(Ma(t)){let d=e.get(Sa);return t.rootComponent!==void 0&&d.bootstrap(t.rootComponent),d}else return EM?.(t.moduleRef,t.allPlatformModules),t.moduleRef}).finally(()=>{r.remove(s)})})})}var EM;function wM(t,e,n){try{let o=n();return Zl(o)?o.catch(i=>{throw e.runOutsideAngular(()=>t(i)),i}):o}catch(o){throw e.runOutsideAngular(()=>t(o)),o}}var nd=null;function SM(t=[],e){return Dn.create({name:e,providers:[{provide:Xs,useValue:"platform"},{provide:Pm,useValue:new Set([()=>nd=null])},...t]})}function TM(t=[]){if(nd)return nd;let e=SM(t);return nd=e,Zv(),DM(e),e}function DM(t){let e=t.get(pl,null);Xc(t,()=>{e?.forEach(n=>n())})}function m_(t){let{rootComponent:e,appProviders:n,platformProviders:o,platformRef:i}=t;pt(it.BootstrapApplicationStart);try{let r=i?.injector??TM(o),s=[a_(),Oy,...n||[]],a=new va({providers:s,parent:r,debugName:"",runEnvironmentInitializers:!1});return CM({r3Injector:a.injector,platformInjector:r,rootComponent:e})}catch(r){return Promise.reject(r)}finally{pt(it.BootstrapApplicationEnd)}}var h_=null;function ds(){return h_}function Rm(t){h_??=t}var Ia=class{};var Lm=(()=>{class t{_viewContainerRef;_viewRef=null;ngTemplateOutletContext=null;ngTemplateOutlet=null;ngTemplateOutletInjector=null;injector=k(Dn);constructor(n){this._viewContainerRef=n}ngOnChanges(n){if(this._shouldRecreateView(n)){let o=this._viewContainerRef;if(this._viewRef&&o.remove(o.indexOf(this._viewRef)),!this.ngTemplateOutlet){this._viewRef=null;return}let i=this._createContextForwardProxy();this._viewRef=o.createEmbeddedView(this.ngTemplateOutlet,i,{injector:this._getInjector()})}}_getInjector(){return this.ngTemplateOutletInjector==="outlet"?this.injector:this.ngTemplateOutletInjector??void 0}_shouldRecreateView(n){return!!n.ngTemplateOutlet||!!n.ngTemplateOutletInjector}_createContextForwardProxy(){return new Proxy({},{set:(n,o,i)=>this.ngTemplateOutletContext?Reflect.set(this.ngTemplateOutletContext,o,i):!1,get:(n,o,i)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,o,i)}})}static \u0275fac=function(o){return new(o||t)(Yl(cs))};static \u0275dir=hr({type:t,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},features:[Yf]})}return t})();function Fm(t,e){e=encodeURIComponent(e);for(let n of t.split(";")){let o=n.indexOf("="),[i,r]=o==-1?[n,""]:[n.slice(0,o),n.slice(o+1)];if(i.trim()!==e)continue;let s=r;try{s=decodeURIComponent(r)}catch{}return s.length>1&&s[0]==='"'&&s[s.length-1]==='"'&&(s=s.slice(1,-1)),s}return null}var g_="browser";var ka=class{_doc;constructor(e){this._doc=e}manager},id=(()=>{class t extends ka{constructor(n){super(n)}supports(n){return!0}addEventListener(n,o,i,r){return n.addEventListener(o,i,r),()=>this.removeEventListener(n,o,i,r)}removeEventListener(n,o,i,r){return n.removeEventListener(o,i,r)}static \u0275fac=function(o){return new(o||t)(ct(wn))};static \u0275prov=De({token:t,factory:t.\u0275fac})}return t})(),ad=new He(""),$m=(()=>{class t{_zone;_plugins;_eventNameToPlugin=new Map;constructor(n,o){this._zone=o,n.forEach(s=>{s.manager=this});let i=n.filter(s=>!(s instanceof id));this._plugins=i.slice().reverse();let r=n.find(s=>s instanceof id);r&&this._plugins.push(r)}addEventListener(n,o,i,r){return this._findPluginFor(o).addEventListener(n,o,i,r)}getZone(){return this._zone}_findPluginFor(n){let o=this._eventNameToPlugin.get(n);if(o)return o;if(o=this._plugins.find(r=>r.supports(n)),!o)throw new ke(-5101,!1);return this._eventNameToPlugin.set(n,o),o}static \u0275fac=function(o){return new(o||t)(ct(ad),ct(Mn))};static \u0275prov=De({token:t,factory:t.\u0275fac})}return t})(),Vm="ng-app-id";function y_(t){for(let e of t)e.remove()}function v_(t,e){let n=e.createElement("style");return n.textContent=t,n}function kM(t,e,n,o){let i=t.head?.querySelectorAll(`style[${Vm}="${e}"],link[${Vm}="${e}"]`);if(!i||i.length===0)return!1;for(let r of i)r.removeAttribute(Vm),r instanceof HTMLLinkElement?o.set(r.href.slice(r.href.lastIndexOf("/")+1),{usage:0,elements:[r]}):r.textContent&&n.set(r.textContent,{usage:0,elements:[r]});return!0}function Bm(t,e){let n=e.createElement("link");return n.setAttribute("rel","stylesheet"),n.setAttribute("href",t),n}var Hm=(()=>{class t{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;constructor(n,o,i,r={}){this.doc=n,this.appId=o,this.nonce=i,kM(n,o,this.inline,this.external)&&this.hosts.add(n.head)}addStyles(n,o){for(let i of n)this.addUsage(i,this.inline,v_);o?.forEach(i=>this.addUsage(i,this.external,Bm))}removeStyles(n,o){for(let i of n)this.removeUsage(i,this.inline);o?.forEach(i=>this.removeUsage(i,this.external))}addUsage(n,o,i){let r=o.get(n);r?r.usage++:o.set(n,{usage:1,elements:[...this.hosts].map(s=>this.addElement(s,i(n,this.doc)))})}removeUsage(n,o){let i=o.get(n);i&&(i.usage--,i.usage<=0&&(y_(i.elements),o.delete(n)))}ngOnDestroy(){for(let[,{elements:n}]of[...this.inline,...this.external])y_(n);this.hosts.clear()}addHost(n){if(!this.hosts.has(n)){this.hosts.add(n);for(let[o,{elements:i}]of this.inline)i.push(this.addElement(n,v_(o,this.doc)));for(let[o,{elements:i}]of this.external)i.push(this.addElement(n,Bm(o,this.doc)))}}removeHost(n){this.hosts.delete(n);for(let o of[...this.inline.values(),...this.external.values()]){let i=[];for(let r of o.elements)r.parentNode===n?r.remove():i.push(r);o.elements=i}}addElement(n,o){return this.nonce&&o.setAttribute("nonce",this.nonce),n.appendChild(o)}static \u0275fac=function(o){return new(o||t)(ct(wn),ct(sa),ct(fl,8),ct(aa))};static \u0275prov=De({token:t,factory:t.\u0275fac})}return t})(),jm={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"},Um=/%COMP%/g;var b_="%COMP%",NM=`_nghost-${b_}`,OM=`_ngcontent-${b_}`,AM=!0,PM=new He("",{factory:()=>AM}),RM=new He("");function LM(t){return OM.replace(Um,t)}function FM(t){return NM.replace(Um,t)}function x_(t,e){return e.map(n=>n.replace(Um,t))}var zm=(()=>{class t{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;cssVarNamespace;constructor(n,o,i,r,s,a,c=null,l=null,d=null){this.eventManager=n,this.sharedStylesHost=o,this.appId=i,this.removeStylesOnCompDestroy=r,this.doc=s,this.ngZone=a,this.nonce=c,this.tracingService=l,this.cssVarNamespace=d??"",this.defaultRenderer=new Na(n,s,a,this.tracingService,this.cssVarNamespace)}createRenderer(n,o){if(!n||!o)return this.defaultRenderer;let i=this.getOrCreateRenderer(n,o);return i instanceof sd?i.applyToHost(n):i instanceof Oa&&i.applyStyles(),i}getOrCreateRenderer(n,o){let i=this.rendererByCompId,r=i.get(o.id);if(!r){let s=this.doc,a=this.ngZone,c=this.eventManager,l=this.sharedStylesHost,d=this.removeStylesOnCompDestroy,f=this.tracingService;switch(o.encapsulation){case vo.Emulated:r=new sd(c,l,o,this.appId,d,s,a,f,this.cssVarNamespace);break;case vo.ShadowDom:return new rd(c,n,o,s,a,this.nonce,f,this.cssVarNamespace,l);case vo.ExperimentalIsolatedShadowDom:return new rd(c,n,o,s,a,this.nonce,f,this.cssVarNamespace);default:r=new Oa(c,l,o,d,s,a,f,this.cssVarNamespace);break}i.set(o.id,r)}return r}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(n){this.rendererByCompId.delete(n)}static \u0275fac=function(o){return new(o||t)(ct($m),ct(mr),ct(sa),ct(PM),ct(wn),ct(Mn),ct(fl),ct(Jo,8),ct(RM,8))};static \u0275prov=De({token:t,factory:t.\u0275fac})}return t})(),Na=class{eventManager;doc;ngZone;tracingService;cssVarNamespace;data=Object.create(null);throwOnSyntheticProps=!0;constructor(e,n,o,i,r=""){this.eventManager=e,this.doc=n,this.ngZone=o,this.tracingService=i,this.cssVarNamespace=r}destroy(){}destroyNode=null;createElement(e,n){return n?this.doc.createElementNS(jm[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 i=__(e)?e.content:e;if(o!=null&&o.parentNode!==i)throw new ke(-5106,!1);i.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 ke(-5104,!1);return n||(o.textContent=""),o}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,n,o,i){if(i){n=i+":"+n;let r=jm[i];r?e.setAttributeNS(r,n,o):e.setAttribute(n,o)}else e.setAttribute(n,o)}removeAttribute(e,n,o){if(o){let i=jm[o];i?e.removeAttributeNS(i,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,i){let r=n.startsWith("--");r&&(n=n.replace("%NS%",this.cssVarNamespace)),r||i&(Ao.DashCase|Ao.Important)?e.style.setProperty(n,o,i&Ao.Important?"important":""):e.style[n]=o}removeStyle(e,n,o){let i=n.startsWith("--");i&&(n=n.replace("%NS%",this.cssVarNamespace)),i||o&Ao.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,i){if(typeof e=="string"&&(e=ds().getGlobalEventTarget(this.doc,e),!e))throw new ke(-5102,!1);let r=this.decoratePreventDefault(o);return this.tracingService?.wrapEventListener&&(r=this.tracingService.wrapEventListener(e,n,r)),this.eventManager.addEventListener(e,n,r,i)}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 rd=class extends Na{hostEl;sharedStylesHost;shadowRoot;constructor(e,n,o,i,r,s,a,c,l){super(e,i,r,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=x_(o.id,d).map(y=>y.replace(/%NS%/g,c));for(let y of d){let _=document.createElement("style");s&&_.setAttribute("nonce",s),_.textContent=y,this.shadowRoot.appendChild(_)}let f=o.getExternalStyles?.();if(f)for(let y of f){let _=Bm(y,i);s&&_.setAttribute("nonce",s),this.shadowRoot.appendChild(_)}}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)}},Oa=class extends Na{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(e,n,o,i,r,s,a,c,l){super(e,r,s,a,c),this.sharedStylesHost=n,this.removeStylesOnCompDestroy=i;let d=o.styles,f=l?x_(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&&lm.size===0&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},sd=class extends Oa{contentAttr;hostAttr;constructor(e,n,o,i,r,s,a,c,l){let d=i+"-"+o.id;super(e,n,o,r,s,a,c,l,d),this.contentAttr=LM(d),this.hostAttr=FM(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 cd=class t extends Ia{supportsDOMEvents=!0;static makeCurrent(){Rm(new t)}onAndCancel(e,n,o,i){return e.addEventListener(n,o,i),()=>{e.removeEventListener(n,o,i)}}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=VM();return n==null?null:jM(n)}resetBaseElement(){Aa=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return Fm(document.cookie,e)}},Aa=null;function VM(){return Aa=Aa||document.head.querySelector("base"),Aa?Aa.getAttribute("href"):null}function jM(t){return new URL(t,document.baseURI).pathname}var C_=["alt","control","meta","shift"],BM={"\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"},$M={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey},E_=(()=>{class t extends ka{constructor(n){super(n)}supports(n){return t.parseEventName(n)!=null}addEventListener(n,o,i,r){let s=t.parseEventName(o),a=t.eventCallback(s.fullKey,i,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>ds().onAndCancel(n,s.domEventName,a,r))}static parseEventName(n){let o=n.toLowerCase().split("."),i=o.shift();if(o.length===0||!(i==="keydown"||i==="keyup"))return null;let r=t._normalizeKey(o.pop()),s="",a=o.indexOf("code");if(a>-1&&(o.splice(a,1),s="code."),C_.forEach(l=>{let d=o.indexOf(l);d>-1&&(o.splice(d,1),s+=l+".")}),s+=r,o.length!=0||r.length===0)return null;let c={};return c.domEventName=i,c.fullKey=s,c}static matchEventFullKeyCode(n,o){let i=BM[n.key]||n.key,r="";return o.indexOf("code.")>-1&&(i=n.code,r="code."),i==null||!i?!1:(i=i.toLowerCase(),i===" "?i="space":i==="."&&(i="dot"),C_.forEach(s=>{if(s!==i){let a=$M[s];a(n)&&(r+=s+".")}}),r+=i,r===o)}static eventCallback(n,o,i){return r=>{t.matchEventFullKeyCode(r,n)&&i.runGuarded(()=>o(r))}}static _normalizeKey(n){return n==="esc"?"escape":n}static \u0275fac=function(o){return new(o||t)(ct(wn))};static \u0275prov=De({token:t,factory:t.\u0275fac})}return t})();async function Gm(t,e,n){let o=j({rootComponent:t},HM(e,n));return m_(o)}function HM(t,e){return{platformRef:e?.platformRef,appProviders:[...WM,...t?.providers??[]],platformProviders:qM}}function UM(){cd.makeCurrent()}function zM(){return new Zn}function GM(){return Qf(document),document}var qM=[{provide:aa,useValue:g_},{provide:pl,useValue:UM,multi:!0},{provide:wn,useFactory:GM}];var WM=[{provide:Xs,useValue:"root"},{provide:Zn,useFactory:zM},{provide:ad,useClass:id,multi:!0},{provide:ad,useClass:E_,multi:!0},zm,{provide:mr,useClass:Hm},{provide:Hm,useExisting:mr},$m,{provide:Ko,useExisting:zm},[]];var Pa=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275prov=De({token:t,factory:function(o){let i=null;return o?i=new(o||t):i=ct(YM),i},providedIn:"root"})}return t})(),YM=(()=>{class t extends Pa{_doc=k(wn);sanitize(n,o){if(o==null)return null;switch(n){case At.NONE:return o;case At.HTML:return Qo(o,"HTML")?eo(o):jl(this._doc,String(o)).toString();case At.STYLE:return Qo(o,"Style")?eo(o):o;case At.SCRIPT:if(Qo(o,"Script"))return eo(o);throw new ke(5200,!1);case At.URL:return Qo(o,"URL")?eo(o):ba(String(o));case At.RESOURCE_URL:if(Qo(o,"ResourceURL"))return eo(o);throw new ke(-5201,!1);default:throw new ke(5202,!1)}}bypassSecurityTrustHtml(n){return tm(n)}bypassSecurityTrustStyle(n){return nm(n)}bypassSecurityTrustScript(n){return om(n)}bypassSecurityTrustUrl(n){return im(n)}bypassSecurityTrustResourceUrl(n){return rm(n)}static \u0275fac=function(o){return new(o||t)};static \u0275prov=pr({token:t,factory:t.\u0275fac})}return t})();var w_={providers:[Qp()]};var to=typeof window<"u",ld=to?window:null,Ci=to?document:null,mt={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},Oe={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},Xt={NONE:0,AUTO:1,FORCE:2},Nt={replace:0,none:1,blend:2},qm=Symbol(),Ro=Symbol(),dd=Symbol(),Ei=Symbol(),ud=Symbol(),Ae=1e-11,Ra=1e12,no=1e3,La=240,oo="",S_="var(",Fa=[],pd=(()=>{let t=new Map;return t.set("x","translateX"),t.set("y","translateY"),t.set("z","translateZ"),t})(),us=["perspective","translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY"],T_=us.reduce((t,e)=>Q(j({},t),{[e]:e+"("}),{}),Wt=()=>{},D_=t=>t,M_=/\)\s*[-.\d]/,I_=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,k_=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,N_=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,O_=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,A_=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,Wm=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,fd=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,P_=/([a-z])([A-Z])/g,R_=/(\*=|\+=|-=)/,L_=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/;var ps={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:La,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:no,delay:0,loopDelay:0,ease:"out(2)",composition:Nt.replace,modifier:D_,onBegin:Wt,onBeforeUpdate:Wt,onUpdate:Wt,onLoop:Wt,onPause:Wt,onComplete:Wt,onRender:Wt},Va={current:null,root:Ci},Ie={defaults:ps,precision:4,timeScale:1,tickThreshold:200,editor:null},Ym={version:"4.5.0",engine:null};to&&(ld.AnimeJS||(ld.AnimeJS=[]),ld.AnimeJS.push(Ym));var Km=t=>t.replace(P_,"$1-$2").toLowerCase(),Bn=(t,e)=>t.indexOf(e)===0,ni=Date.now,$n=Array.isArray,yr=t=>t&&t.constructor===Object,kn=t=>typeof t=="number"&&!isNaN(t),Nn=t=>typeof t=="string",Jt=t=>typeof t=="function",te=t=>typeof t>"u",Lo=t=>te(t)||t===null,md=t=>to&&t instanceof SVGElement,Qm=t=>I_.test(t),Xm=t=>Bn(t,"rgb"),Jm=t=>Bn(t,"hsl"),F_=t=>Qm(t)||(Xm(t)||Jm(t))&&(t[t.length-1]===")"||!M_.test(t)),ja=t=>!Ie.defaults.hasOwnProperty(t),ZM=["opacity","rotate","overflow","color"],V_=(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}},hd=t=>Nn(t)?parseFloat(t):t,vr=Math.pow,wi=Math.sqrt,j_=Math.sin,B_=Math.cos,gr=Math.abs;var _r=Math.floor,$_=Math.asin;var Ba=Math.PI,Zm=Math.round,yn=(t,e,n)=>t<e?e:t>n?n:t,Ye=(t,e)=>{if(e<0)return t;if(!e)return Zm(t);let n=10**e;return Zm(t*n)/n},H_=(t,e)=>$n(e)?e.reduce((n,o)=>gr(o-t)<gr(n-t)?o:n):e?Zm(t/e)*e:t,oi=(t,e,n)=>n===1?e:n===0?t:t+(e-t)*n,br=t=>t===1/0?Ra:t===-1/0?-Ra:t,ii=t=>t<=Ae?Ae:br(Ye(t,11)),Yt=t=>$n(t)?[...t]:t,gd=(t,e)=>{let n=j({},t);for(let o in e){let i=t[o];n[o]=te(i)?e[o]:i}return n},nt=(t,e,n,o="_prev",i="_next")=>{let r=t._head,s=i;for(n&&(r=t._tail,s=o);r;){let a=r[s];e(r),r=a}},Hn=(t,e,n="_prev",o="_next")=>{let i=e[n],r=e[o];i?i[o]=r:t._head=r,r?r[n]=i:t._tail=i,e[n]=null,e[o]=null},On=(t,e,n,o="_prev",i="_next")=>{let r=t._tail;for(;r&&n&&n(r,e);)r=r[o];let s=r?r[i]:t._head;r?r[i]=e:t._head=e,s?s[o]=e:t._tail=e,e[o]=r,e[i]=s};var U_=(t,e,n)=>{let o=t.style.transform;if(o){let i=t[Ei],r=0,s=o.length,a;for(;r<s;){for(;r<s&&o.charCodeAt(r)===32;)r++;if(r>=s)break;let l=r;for(;r<s&&o.charCodeAt(r)!==40;)r++;if(r>=s)break;let d=o.substring(l,r),f=1,y=r+1,_=-1,C=-1;for(r++;r<s&&f>0;){let A=o.charCodeAt(r);A===40?f++:A===41?f--:A===44&&f===1&&(_===-1?_=r:C===-1&&(C=r)),r++}let w=r-1;d==="translate"||d==="translate3d"?(_===-1?i.translateX=o.substring(y,w).trim():(i.translateX=o.substring(y,_).trim(),C===-1?i.translateY=o.substring(_+1,w).trim():(i.translateY=o.substring(_+1,C).trim(),i.translateZ=o.substring(C+1,w).trim())),a=o.substring(y,w)):d==="scale"||d==="scale3d"?_===-1?i.scale=o.substring(y,w).trim():(i.scaleX=o.substring(y,_).trim(),C===-1?i.scaleY=o.substring(_+1,w).trim():(i.scaleY=o.substring(_+1,C).trim(),i.scaleZ=o.substring(C+1,w).trim())):i[d]=o.substring(y,w)}if(e==="translate3d"&&a)return n&&(n[e]=a),a;let c=i[e];if(!te(c))return n&&(n[e]=c),c}return e==="translate3d"?"0px, 0px, 0px":e==="rotate3d"?"0, 0, 0, 0deg":Bn(e,"scale")?"1":Bn(e,"rotate")||Bn(e,"skew")?"0deg":"0px"},yd=t=>{let e=oo;for(let n=0,o=us.length;n<o;n++){let i=us[n],r=t[i];if(r!==void 0){if(i==="translateX"){let s=t.translateY;if(s!==void 0){let a=t.translateZ;a!==void 0?(e+=`translate3d(${r},${s},${a}) `,n+=2):(e+=`translate(${r},${s}) `,n+=1);continue}}if(i==="scaleX"&&t.scale===void 0){let s=t.scaleY;if(s!==void 0){let a=t.scaleZ;a!==void 0?(e+=`scale3d(${r},${s},${a}) `,n+=2):(e+=`scale(${r},${s}) `,n+=1);continue}}e+=`${T_[i]}${r}) `}i==="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 eh=[];function vd(t,e){if(!t)return null;let n=eh.length;e:for(let o=0;o<n;o++){let i=eh[o];if(i.detect&&!i.detect(t))continue;let r=i.targetAdapters;for(let s=0,a=r.length;s<a;s++){let c=r[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 i=eh[o];if(i.detect&&!i.detect(t))continue;let r=i.propertyResolvers;for(let s=0,a=r.length;s<a;s++){let c=r[s](t,e);if(c)return c}}return null}var KM=t=>{let e=k_.exec(t)||N_.exec(t),n=te(e[4])?1:+e[4];return[+e[1],+e[2],+e[3],n]},QM=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]},th=(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),XM=t=>{let e=O_.exec(t)||A_.exec(t),n=+e[1]/360,o=+e[2]/100,i=+e[3]/100,r=te(e[4])?1:+e[4],s,a,c;if(o===0)s=a=c=i;else{let l=i<.5?i*(1+o):i+o-i*o,d=2*i-l;s=Ye(th(d,l,n+1/3)*255,0),a=Ye(th(d,l,n)*255,0),c=Ye(th(d,l,n-1/3)*255,0)}return[s,a,c,r]},z_=t=>Xm(t)?KM(t):Qm(t)?QM(t):Jm(t)?XM(t):[0,0,0,1];var Ot=(t,e)=>te(t)?e:t,G_=(t,e)=>{let n=t.match(L_),o=e[Ro]?e:document.documentElement,i=getComputedStyle(o)?.getPropertyValue(n[1]);return(!i||i.trim()===oo)&&n[2]&&(i=n[2].trim()),i||0},Fo=(t,e,n,o,i,r)=>{if(Jt(t)){if(!i){let a=t(e,n,o,r);return isNaN(+a)?a||0:+a}let s=()=>{let a=t(e,n,o,r);return isNaN(+a)?a||0:+a};return i.func=s,s()}if(Nn(t)&&Bn(t,S_)){if(!i)return G_(t,e);let s=()=>G_(t,e);return i.func=s,s()}return t},$a=(t,e)=>t[Ro]?t[dd]&&V_(t,e)?mt.ATTRIBUTE:us.includes(e)||pd.get(e)?mt.TRANSFORM:Bn(e,"--")?mt.CSS_VAR:e in t.style?mt.CSS:e in t?mt.OBJECT:mt.ATTRIBUTE:mt.OBJECT,q_=(t,e,n)=>{let o=t.style[e];o&&n&&(n[e]=o);let i=o||getComputedStyle(t[ud]||t).getPropertyValue(e);return i==="auto"?"0":i},Vo=(t,e,n,o)=>{let i=te(n)?$a(t,e):n,r=vd(t,e);if(r){let s=r.get(t);return s&&o&&(o[e]=s),s??0}if(i===mt.OBJECT){let s=t[e];return s&&o&&(o[e]=s),s||0}if(i===mt.ATTRIBUTE){let s=t.getAttribute(e);return s&&o&&(o[e]=s),s}return i===mt.TRANSFORM?U_(t,e,o):i===mt.CSS_VAR?q_(t,e,o).trimStart():q_(t,e,o)},fs=(t,e,n)=>n==="-"?t-e:n==="+"?t+e:t*e,_d=()=>({t:Oe.NUMBER,n:0,u:null,o:null,d:null,s:null}),vn=(t,e)=>{if(e.t=Oe.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 i=o.includes(" ")?!1:fd.exec(o);if(i)return e.t=Oe.UNIT,e.n=+i[1],e.u=i[2],e;if(e.o)return e.n=+o,e;if(F_(o))return e.t=Oe.COLOR,e.d=z_(o),e;{let r=o.match(Wm);return e.t=Oe.COMPLEX,e.d=r?r.map(Number):[],e.s=o.split(Wm)||[],e}},nh=(t,e)=>(e.t=t._valueType,e.n=t._toNumber,e.u=t._unit,e.o=null,e.d=Yt(t._toNumbers),e.s=Yt(t._strings),e),en=_d(),bd=(t,e,n)=>{let o=t._modifier,i=t._fromNumbers,r=t._toNumbers,s=t._strings,a=s[0];for(let c=0,l=r.length;c<l;c++){let d=o(Ye(oi(i[c],r[c],e),n)),f=s[c+1];a+=`${f?d+f:d}`,t._numbers[c]=d}return a};var Ha=(t,e,n,o,i)=>{let r=t.parent,s=t.duration,a=t.completed,c=t.iterationDuration,l=t.iterationCount,d=t._currentIteration,f=t._loopDelay,y=t._reversed,_=t._alternate,C=t._hasChildren,w=t._delay,A=t._currentTime,Y=w+c,q=e-w,ye=yn(A,-w,s),he=yn(q,-w,s),Se=q-A,pe=he>0,Xe=he>=s,je=s<=Ae,$e=i===Xt.FORCE,dt=0,wt=q,Pt=0;if(l>1){let K=c+(Xe?0:f),G=~~(he/K);t._currentIteration=yn(G,0,l),Xe&&t._currentIteration--,dt=t._currentIteration%2,wt=he-G*K||0}let Mt=y^(_&&dt),Je=t._ease,Ce=Xe?Mt?0:s:Mt?c-wt:wt;Je&&(Ce=c*Je(Ce/c)||0);let P=(r?r.backwards:q<A)?!Mt:!!Mt;if(t._currentTime=q,t._iterationTime=Ce,t.backwards=P,pe&&!t.began?(t.began=!0,!n&&!(r&&(P||!r.began))&&t.onBegin(t)):q<=0&&(t.began=!1),!n&&!C&&pe&&t._currentIteration!==d&&t.onLoop(t),$e||i===Xt.AUTO&&(e>=(r&&w>0?0:w)&&e<=Y||e<=w&&ye>w||e>=Y&&ye!==s)||Ce>=Y&&ye!==s||Ce<=w&&ye>0&&!Xe||e<=ye&&ye===s&&a||Xe&&!a&&je){if(pe&&(t.computeDeltaTime(ye),n||t.onBeforeUpdate(t)),!C){let K=$e||(P?Se*-1:Se)>=Ie.tickThreshold,G=Ye(t._offset+(r?r._offset:0)+w+Ce,12),L=t._head,J,Re,et,$t,_e=0;for(;L;){let _t=L._composition,ze=L._currentTime,rn=L._changeDuration,Ht=L._absoluteStartTime+L._changeDuration,Ze=L._nextRep,Gt=L._prevRep,Rt=_t!==Nt.none,Pe=Gt?Gt._absoluteStartTime+Gt._changeDuration:0,qe=Gt&&Gt.parent!==L.parent,Te=!Ze||Ze._isOverridden?Ht:Ze.parent===L.parent?Ht+Ze._delay:Ze._absoluteStartTime<Ze._absoluteUpdateStartTime?Ze._absoluteStartTime:Ze._absoluteUpdateStartTime;if((K||(ze!==rn||G<=Te||Gt&&!qe&&(!Ze||Ze.parent!==L.parent))&&(ze!==0||G>=L._absoluteStartTime||qe&&!L._hasFromValue&&!Gt._isOverridden&&G>=Pe||Ze&&!Ze._isOverridden&&Ze.parent===L.parent&&Ze._currentTime!==0&&Ce<Ze._startTime))&&(!Gt||qe||Ce>=L._startTime)&&(!Rt||!L._isOverridden&&(!L._isOverlapped||G<=Ht)&&(!Ze||Ze._isOverridden||G<=Te)&&(!Gt||Gt._isOverridden||(qe?G>=L._absoluteStartTime||!L._hasFromValue&&G>=Pe:G>=Pe+L._delay)))){let ot=L._currentTime=yn(Ce-L._startTime,0,rn),ie=L._ease(ot/L._updateDuration),lt=L._modifier,Z=L._valueType,gt=L._tweenType,Ke=gt===mt.OBJECT,ne=Z===Oe.NUMBER,xt=ne&&Ke||ie===0||ie===1?-1:Ie.precision,be,at;if(ne)be=at=lt(Ye(oi(L._fromNumber,L._toNumber,ie),xt));else if(Z===Oe.UNIT)at=lt(Ye(oi(L._fromNumber,L._toNumber,ie),xt)),be=`${at}${L._unit}`;else if(Z===Oe.COLOR){let Ge=L._numbers,F=L._fromNumbers,B=L._toNumbers,X=1-ie,re=F[0],ut=F[1],St=F[2],qn=B[0],hn=B[1],wo=B[2];Ge[0]=lt(Math.sqrt(re*re*X+qn*qn*ie)),Ge[1]=lt(Math.sqrt(ut*ut*X+hn*hn*ie)),Ge[2]=lt(Math.sqrt(St*St*X+wo*wo*ie)),Ge[3]=lt(oi(F[3],B[3],ie)),(!L._setter||o)&&(be=`rgba(${Ye(Ge[0],0)},${Ye(Ge[1],0)},${Ye(Ge[2],0)},${Ge[3]})`)}else Z===Oe.COMPLEX&&(be=bd(L,ie,xt));if(Rt&&(L._number=at),!o&&_t!==Nt.blend){let Ge=L.property;J=L.target,L._setter?L._setter(J,at,L):Ke?J[Ge]=be:gt===mt.ATTRIBUTE?J.setAttribute(Ge,be):(Re=J.style,gt===mt.TRANSFORM?(J!==et&&(et=J,$t=J[Ei]),$t[Ge]=be,_e=1):gt===mt.CSS?Re[Ge]=be:gt===mt.CSS_VAR&&Re.setProperty(Ge,be)),pe&&(Pt=1)}else L._value=be}else ze&&Gt&&!qe&&Ce<L._startTime&&(L._currentTime=0);_e&&L._renderTransforms&&(Re.transform=yd($t),_e=0),L=L._next}!n&&Pt&&t.onRender(t)}!n&&pe&&t.onUpdate(t)}return r&&je?!n&&(r.began&&!P&&q>0&&!a||P&&q<=Ae&&a)&&(t.onComplete(t),t.completed=!P):pe&&Xe?l===1/0?t._startTime+=t.duration:t._currentIteration>=l-1&&(t.paused=!0,!a&&!C&&(t.completed=!0,!n&&!(r&&(P||!r.began))&&(t.onComplete(t),t._resolve(t)))):t.completed=!1,Pt},jo=(t,e,n,o,i)=>{let r=t._currentIteration;if(Ha(t,e,n,o,i),t._hasChildren){let s=t,a=s.backwards,c=o?e:s._iterationTime,l=ni(),d=0,f=!0;if(!o&&s._currentIteration!==r){let y=s.iterationDuration;nt(s,_=>{if(!a)!_.completed&&!_.backwards&&_._currentTime<_.iterationDuration&&Ha(_,y,n,1,Xt.FORCE),_.began=!1,_.completed=!1;else{let C=_.duration,w=_._offset+_._delay,A=w+C;!n&&C<=Ae&&(!w||A===y)&&_.onComplete(_)}}),n||s.onLoop(s)}nt(s,y=>{let _=Ye((c-y._offset)*y._speed,12);if(a&&_>y._delay+y.duration)return;let C=y._fps<s._fps?y.requestTick(l):i;d+=Ha(y,_,n,o,C),!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 W_={},ms=(t,e,n)=>{if(n===mt.TRANSFORM){let o=pd.get(t);return o||t}else if(n===mt.CSS||n===mt.ATTRIBUTE&&md(e)&&t in e.style){let o=W_[t];if(o)return o;{let i=t&&Km(t);return W_[t]=i,i}}else return t},hs=(t,e=!1)=>{if(t._hasChildren)nt(t,n=>hs(n,e),!0);else{let n=t;n.pause(),nt(n,o=>{let i=o.property,r=o.target,s=o._tweenType,a=o._inlineValue,c=Lo(a)||a===oo;if(o._setter){if(!e&&!c){if(vn(a,en),en.d){let l=en.d,d=o._numbers;for(let f=0,y=l.length;f<y;f++)d[f]=l[f]}else o._number=en.n;o._setter(o.target,o._number,o)}}else if(s===mt.OBJECT)!e&&!c&&(r[i]=a);else if(r[Ro])if(s===mt.ATTRIBUTE)e||(c?r.removeAttribute(i):r.setAttribute(i,a));else{let l=r.style;if(s===mt.TRANSFORM){let d=r[Ei];c?delete d[i]:d[i]=a,o._renderTransforms&&(Object.keys(d).length?l.transform=yd(d):l.removeProperty("transform"))}else c?l.removeProperty(Km(i)):l[i]=a}r[Ro]&&n._tail===o&&n.targets.forEach(l=>{l.getAttribute&&l.getAttribute("style")===oo&&l.removeAttribute("style")})})}return t},Y_=t=>hs(t,!0);var gs=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=no/La,this._fps=La,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<Ae?Ae:n,i=no/o;o>ps.frameRate&&(ps.frameRate=o),this._fps=o,this._frameDuration=i}get speed(){return this._speed}set speed(e){let n=+e;this._speed=n<Ae?Ae:n}requestTick(e){let n=this._frameDuration,o=e-this._lastTickTime,i=n*.25,r=i<4?i:4;return o+r<n?Xt.NONE:(this._lastTickTime=o>=n?e-o%n:e,Xt.AUTO)}computeDeltaTime(e){let n=e-this._lastTime;return this.deltaTime=n,this._lastTime=e,n}};var ri={animation:null,update:Wt},Z_=t=>{let e=ri.animation;return e||(e={duration:Ae,computeDeltaTime:Wt,_offset:0,_delay:0,_head:null,_tail:null},ri.animation=e,ri.update=()=>{t.forEach(n=>{for(let o in n){let i=n[o],r=i._head;if(r){let s=r._valueType,a=s===Oe.COMPLEX||s===Oe.COLOR?Yt(r._fromNumbers):null,c=r._fromNumber,l=i._tail;for(;l&&l!==r;){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}r._toNumber=c,r._toNumbers=a}}}),Ha(e,1,1,0,Xt.FORCE)}),e};var K_=to?requestAnimationFrame:setImmediate,JM=to?cancelAnimationFrame:clearImmediate,oh=class extends gs{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=ps,this.paused=!0,this.reqId=0}update(){let e=this._currentTime=ni();if(this.requestTick(e)){this.computeDeltaTime(e);let n=this._speed,o=this._fps,i=this._head;for(;i;){let r=i._next;i.paused?(Hn(this,i),this._hasChildren=!!this._tail,i._running=!1,i.completed&&!i._cancelled&&i.cancel()):jo(i,(e-i._startTime)*i._speed*n,0,0,i._fps<o?i.requestTick(e):Xt.AUTO),i=r}ri.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(ni()),this.reqId=K_(Q_)),this}pause(){if(this.reqId)return this.paused=!0,eI()}resume(){if(this.paused)return this.paused=!1,nt(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(Ie.timeScale===1?1:no)}set speed(e){let n=e*Ie.timeScale;this._speed!==n&&(this._speed=n,nt(this,o=>o.speed=o._speed))}get timeUnit(){return Ie.timeScale===1?"ms":"s"}set timeUnit(e){let o=e==="s",i=o?.001:1;if(Ie.timeScale!==i){Ie.timeScale=i,Ie.tickThreshold=200*i;let r=o?.001:no;this.defaults.duration*=r,this._speed*=r}}get precision(){return Ie.precision}set precision(e){Ie.precision=e}},tn=(()=>{let t=new oh(ni());return to&&(Ym.engine=t,Ci.addEventListener("visibilitychange",()=>{t.pauseOnDocumentHidden&&(Ci.hidden?t.pause():t.resume())})),t})(),Q_=()=>{tn._head?(tn.reqId=K_(Q_),tn.update()):tn.reqId=0},eI=()=>(JM(tn.reqId),tn.reqId=0,tn);var xd={_rep:new WeakMap,_add:new Map},za=(t,e,n="_rep")=>{let o=xd[n],i=o.get(t);return i||(i={},o.set(t,i)),i[e]?i[e]:i[e]={_head:null,_tail:null}},tI=(t,e)=>t._isOverridden||t._absoluteStartTime>e._absoluteStartTime,Ua=t=>{t._isOverlapped=1,t._isOverridden=1,t._changeDuration=Ae,t._currentTime=Ae},Cd=(t,e)=>{let n=t._composition;if(n===Nt.replace){let o=t._absoluteStartTime;On(e,t,tI,"_prevRep","_nextRep");let i=t._prevRep;if(i){let r=i.parent,s=i._absoluteEndTime;if(t.parent.id!==r.id&&r.iterationCount>1&&s+(r.duration-r.iterationDuration)>o){Ua(i);let l=i._prevRep;for(;l&&l.parent.id===r.id;)Ua(l),l=l._prevRep}let a=t._absoluteUpdateStartTime;if(s>a){let l=i._startTime,d=s-(l+i._updateDuration),f=Ye(a-d-l,12);i._changeDuration=f,i._currentTime=f,i._isOverlapped=1,f<Ae&&Ua(i)}let c=t.parent.parent;if(!c||c!==r.parent){let l=!0;if(nt(r,d=>{d._isOverlapped||(l=!1)}),l){let d=r.parent;if(d){let f=!0;nt(d,y=>{y!==r&&nt(y,_=>{_._isOverlapped||(f=!1)})}),f&&d.cancel()}else r.cancel()}}}}else if(n===Nt.blend){let o=za(t.target,t.property,"_add"),i=Z_(xd._add),r=o._head;r||(r=j({},t),r._composition=Nt.replace,r._updateDuration=Ae,r._startTime=0,r._numbers=Yt(t._fromNumbers),r._number=0,r._next=null,r._prev=null,On(o,r),On(i,r));let s=t._toNumber;if(t._fromNumber=r._fromNumber-s,t._toNumber=0,t._numbers=Yt(t._fromNumbers),t._number=0,r._fromNumber=s,t._toNumbers.length){let a=Yt(t._toNumbers);a.forEach((c,l)=>{t._fromNumbers[l]=r._fromNumbers[l]-c,t._toNumbers[l]=0}),r._fromNumbers=a}On(o,t,null,"_prevAdd","_nextAdd")}return t},ih=t=>{let e=t._composition;if(e!==Nt.none){let n=t.target,o=t.property,s=xd._rep.get(n)[o];if(Hn(s,t,"_prevRep","_nextRep"),e===Nt.blend){let a=xd._add,c=a.get(n);if(!c)return;let l=c[o],d=ri.animation;Hn(l,t,"_prevAdd","_nextAdd");let f=l._head;if(f&&f===l._tail){Hn(l,f,"_prevAdd","_nextAdd"),Hn(d,f);let y=!0;for(let _ in c)if(c[_]._head){y=!1;break}y&&a.delete(n)}}}return t},X_=(t,e,n)=>{let o=!1;return nt(e,i=>{let r=i.target;if(t.includes(r)){let s=i.property,a=i._tweenType,c=ms(n,r,a);(!c||c&&c===s)&&(i.parent._tail===i&&i._tweenType===mt.TRANSFORM&&i._prev&&i._prev._tweenType===mt.TRANSFORM&&(i._prev._renderTransforms=1),Hn(e,i),ih(i),o=!0)}},!0),o},Ga=(t,e,n)=>{let o=e||tn,i;if(o._hasChildren){let r=0;nt(o,s=>{if(!s._hasChildren)if(i=X_(t,s,n),i&&!s._head)s.cancel(),Hn(o,s);else{let c=s._offset+s._delay+s.duration;c>r&&(r=c)}s._head?Ga(t,s,n):s._hasChildren=!1},!0),te(o.iterationDuration)||(o.iterationDuration=r)}else i=X_(t,o,n);i&&!o._head&&(o._hasChildren=!1,o.cancel&&o.cancel())};var J_=t=>(t.paused=!0,t.began=!1,t.completed=!1,t),rh=t=>(t._cancelled&&(t._hasChildren?nt(t,rh):nt(t,e=>{e._composition!==Nt.none&&Cd(e,za(e.target,e.property))}),t._cancelled=0),t),eb=0,nI=(t,e)=>t._priority>e._priority,si=class extends gs{constructor(e={},n=null,o=0){super(0),++eb;let{id:i,delay:r,duration:s,reversed:a,alternate:c,loop:l,loopDelay:d,autoplay:f,frameRate:y,playbackRate:_,priority:C,onComplete:w,onLoop:A,onPause:Y,onBegin:q,onBeforeUpdate:ye,onUpdate:he}=e;Va.current&&Va.current.register(this);let Se=n?0:tn._lastTickTime,pe=n?n.defaults:Ie.defaults,Xe=Jt(r)||te(r)?pe.delay:+r,je=Jt(s)||te(s)?1/0:+s,$e=Ot(l,pe.loop),dt=Ot(d,pe.loopDelay),wt=$e===!0||$e===1/0||$e<0?1/0:$e+1,Pt=0;n?Pt=o:(tn.reqId||tn.requestTick(ni()),Pt=(tn._lastTickTime-tn._startTime)*Ie.timeScale),this.id=te(i)?eb:i,this.parent=n,this.duration=br((je+dt)*wt-dt)||Ae,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=q||pe.onBegin,this.onBeforeUpdate=ye||pe.onBeforeUpdate,this.onUpdate=he||pe.onUpdate,this.onLoop=A||pe.onLoop,this.onPause=Y||pe.onPause,this.onComplete=w||pe.onComplete,this.iterationDuration=je,this.iterationCount=wt,this._autoplay=n?!1:Ot(f,pe.autoplay),this._offset=Pt,this._delay=Xe,this._loopDelay=dt,this._iterationTime=0,this._currentIteration=0,this._resolve=Wt,this._running=!1,this._reversed=+Ot(a,pe.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=Ot(c,pe.alternate),this._prev=null,this._next=null,this._lastTickTime=Se,this._startTime=Se,this._lastTime=Se,this._fps=Ot(y,pe.frameRate),this._speed=Ot(_,pe.playbackRate),this._priority=+Ot(C,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return yn(Ye(this._currentTime,Ie.precision),-this._delay,this.duration)}set currentTime(e){let n=this.paused;this.pause().seek(+e),n||this.resume()}get iterationCurrentTime(){return yn(Ye(this._iterationTime,Ie.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return yn(Ye(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return yn(Ye(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*yn(+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 rh(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,jo(this,0,1,~~e,Xt.FORCE),J_(this),this._hasChildren&&nt(this,J_),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&jo(this,this.duration,1,~~e,Xt.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*tn._speed);return this._startTime=ni()-(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<=Ae&&!this._hasChildren?jo(this,Ae,0,0,Xt.FORCE):(this._running||(On(tn,this,nI),tn._hasChildren=!0,this._running=!0),this.resetTime(),this._startTime-=12,tn.wake()),this):this}restart(){return this.reset().resume()}seek(e,n=0,o=0){rh(this),this.completed=!1;let i=this.paused;return this.paused=!0,jo(this,e+this._delay,~~n,~~o,Xt.AUTO),i?this:this.resume()}alternate(){let e=this._reversed,n=this.iterationCount,o=this.iterationDuration,i=n===1/0?_r(Ra/o):n;return this._reversed=+(this._alternate&&!(i%2)?e:!e),n===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(o*i-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?nt(this,e=>e.cancel(),!0):nt(this,ih),this._cancelled=1,this.pause()}stretch(e){let n=this.duration,o=ii(e);if(n===o)return this;let i=e/n,r=e<=Ae;return this.duration=r?Ae:o,this.iterationDuration=r?Ae:ii(this.iterationDuration*i),this._offset*=i,this._delay*=i,this._loopDelay*=i,this}revert(){jo(this,0,1,0,Xt.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=Wt){let n=this.then,o=()=>{this.then=null,e(this),this.then=n,this._resolve=Wt};return new Promise(i=>(this._resolve=()=>i(o()),this.completed&&this._resolve(),this))}};function tb(t){let e=Nn(t)?Va.root.querySelectorAll(t):t;if(e instanceof NodeList||e instanceof HTMLCollection)return e}function Si(t){if(Lo(t))return[];if(!to)return $n(t)&&t.flat(1/0)||[t];if($n(t)){let n=t.flat(1/0),o=[];for(let i=0,r=n.length;i<r;i++){let s=n[i];if(!Lo(s)){let a=tb(s);if(a)for(let c=0,l=a.length;c<l;c++){let d=a[c];if(!Lo(d)){let f=!1;for(let y=0,_=o.length;y<_;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=tb(t);return e?Array.from(e):[t]}function Ti(t){let e=Si(t),n=e.length;for(let o=0;o<n;o++){let i=e[o];if(!i[qm]){i[qm]=!0;let r=md(i);(i.nodeType||r)&&(i[Ro]=!0,i[dd]=r,i[Ei]={})}}return e}var sh={deg:1,rad:180/Ba,turn:360},nb={},qa=(t,e,n,o=!1)=>{let i=e.u,r=e.n;if(e.t===Oe.UNIT&&i===n)return e;let s=r+i+n,a=nb[s];if(!te(a)&&!o)e.n=a;else{let c;if(i in sh)c=r*sh[i]/sh[n];else{let d=t.cloneNode(),f=t.parentNode,y=f&&f!==Ci?f:Ci.body;y.appendChild(d);let _=d.style;_.width=100+i;let C=d.offsetWidth||100;_.width=100+n;let w=d.offsetWidth||100,A=C/w;y.removeChild(d),c=A*r}e.n=c,nb[s]=c}return e.t,Oe.UNIT,e.u=n,e};var ai=t=>t;var Wa=(t=1.68)=>e=>vr(e,+t),ch={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},oI=Ba/2,ob=Ba*2,ib={[oo]:Wa,Quad:Wa(2),Cubic:Wa(3),Quart:Wa(4),Quint:Wa(5),Sine:t=>1-B_(t*oI),Circ:t=>1-wi(1-t*t),Expo:t=>t?vr(2,10*t-10):0,Bounce:t=>{let e,n=4;for(;t<((e=vr(2,--n))-1)/11;);return 1/vr(4,3-n)-7.5625*vr((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=yn(+t,1,10),o=yn(+e,Ae,2),i=o/ob*$_(1/n),r=ob/o;return s=>s===0||s===1?s:-n*vr(2,-10*(1-s))*j_((1-s-i)*r)}},ah=(()=>{let t={linear:ai,none:ai};for(let e in ch)for(let n in ib){let o=ib[n],i=ch[e];t[e+n]=n===oo||n==="Back"||n==="Elastic"?(r,s)=>i(o(r,s)):i(o)}return t})(),Ed={linear:ai,none:ai},iI=t=>{if(Ed[t])return Ed[t];if(t.indexOf("(")<=-1){let n=ch[t]||t.includes("Back")||t.includes("Elastic")?ah[t]():ah[t];return n?Ed[t]=n:ai}else{let e=t.slice(0,-1).split("("),n=ah[e[0]];return n?Ed[t]=n(...e[1].split(",")):ai}},rb=["steps(","irregular(","linear(","cubicBezier("],xr=t=>{if(Nn(t)){for(let n=0,o=rb.length;n<o;n++)if(Bn(t,rb[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}\``),ai}return Jt(t)?t:Nn(t)?iI(t):ai};var we=_d(),Be=_d(),ys={},wd={func:null},Sd={func:null},Td=[null],vs=[null,null],Dd={to:null},rI=0,sb=0,Di,Bo,sI=(t,e)=>{let n={};if($n(t)){let o=[].concat(...t.map(i=>Object.keys(i))).filter(ja);for(let i=0,r=o.length;i<r;i++){let s=o[i],a=t.map(c=>{let l={};for(let d in c){let f=c[d];ja(d)?d===s&&(l.to=f):l[d]=f}return l});n[s]=a}}else{let o=Ot(e.duration,Ie.defaults.duration);Object.keys(t).map(r=>({o:parseFloat(r)/100,p:t[r]})).sort((r,s)=>r.o-s.o).forEach(r=>{let s=r.o,a=r.p;for(let c in a)if(ja(c)){let l=n[c];l||(l=n[c]=[]);let d=s*o,f=l.length,y=l[f-1],_={to:a[c]},C=0;for(let w=0;w<f;w++)C+=l[w].duration;f===1&&(_.from=y.to),a.ease&&(_.ease=a.ease),_.duration=d-(f?C:0),l.push(_)}return r});for(let r in n){let s=n[r],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},Mi=class extends si{constructor(e,n,o,i,r=!1,s=0,a){super(n,o,i),this._head,this._tail,++sb;let c=Ti(e),l=c.length,d=n.keyframes,f=d?gd(sI(d,n),n):n,{id:y,delay:_,duration:C,ease:w,playbackEase:A,modifier:Y,composition:q,onRender:ye}=f,he=o?o.defaults:Ie.defaults,Se=Ot(w,he.ease),pe=Ot(A,he.playbackEase),Xe=pe?xr(pe):null,je=!te(Se.ease),$e=je?Se.ease:Ot(w,Xe?"linear":he.ease),dt=je?Se.settlingDuration:Ot(C,he.duration),wt=Ot(_,he.delay),Pt=Y||he.modifier,Mt=te(q)&&l>=no?Nt.none:te(q)?he.composition:q,Je=this._offset+(o?o._offset:0);je&&(Se.parent=this);let Ce=NaN,P=NaN,K=0,G=0;for(let L=0;L<l;L++){let J=c[L],Re=s||L,et=a||c,$t=NaN,_e=NaN;for(let _t in f)if(ja(_t)){let ze=$a(J,_t),rn=vd(J,_t),Ht=ms(_t,J,ze),Ze=f[_t],Gt=$n(Ze);if(r&&!Gt&&(vs[0]=Ze,vs[1]=Ze,Ze=vs),Gt){let ie=Ze.length,lt=!yr(Ze[0]);ie===2&&lt?(Dd.to=Ze,Td[0]=Dd,Di=Td):ie>2&&lt?(Di=[],Ze.forEach((Z,gt)=>{gt?gt===1?(vs[1]=Z,Di.push(vs)):Di.push(Z):vs[0]=Z})):Di=Ze}else Td[0]=Ze,Di=Td;let Rt=null,Pe=null,qe=NaN,Te=0,ot=0;for(let ie=Di.length;ot<ie;ot++){let lt=Di[ot];yr(lt)?Bo=lt:(Dd.to=lt,Bo=Dd),wd.func=null,Sd.func=null;let Z=Fo(Ot(Bo.composition,Mt),J,Re,et,null,null),gt=kn(Z)?Z:Nt[Z];!Rt&&gt!==Nt.none&&(Rt=za(J,Ht));let Ke=Rt?Rt._tail:null,ne=o&&Ke&&Ke.parent.parent===o?Ke:Pe,xt=Fo(Bo.to,J,Re,et,wd,ne),be;yr(xt)&&!te(xt.to)?(Bo=xt,be=xt.to):be=xt;let at=Fo(Bo.from,J,Re,et,Sd,ne),Ge=Bo.ease||$e,F=Fo(Ge,J,Re,et,null,ne),B=Jt(F)||Nn(F)?F:Ge,X=!te(B)&&!te(B.ease),re=X?B.ease:B,ut=X?B.settlingDuration:Fo(Ot(Bo.duration,ie>1?Fo(dt,J,Re,et,null,ne)/ie:dt),J,Re,et,null,ne),St=Fo(Ot(Bo.delay,ot?0:wt),J,Re,et,null,ne),qn=Bo.modifier||Pt,hn=!te(at),wo=!te(be),So=$n(be),lc=So||hn&&wo,dc=Pe?Te:0,kr=Pe?Te+St:St,Pi=Ye(Je+kr,12),Ps=Ye(Je+dc,12);!G&&(hn||So)&&(G=1);let Qt=Pe;if(gt!==Nt.none){let Ne=Rt._head;for(;Ne&&Ne._absoluteStartTime<=Pi;)if(Ne._isOverridden||(Qt=Ne),Ne=Ne._nextRep,Ne&&Ne._absoluteStartTime>=Pi)for(;Ne;)Ua(Ne),Ne=Ne._nextRep}if(lc){vn(So?Fo(be[0],J,Re,et,Sd,ne):at,we),vn(So?Fo(be[1],J,Re,et,wd,ne):be,Be);let Ne=Vo(J,Ht,ze,ys);we.t===Oe.NUMBER&&(Qt?Qt._valueType===Oe.UNIT&&(we.t=Oe.UNIT,we.u=Qt._unit):(vn(Ne,en),en.t===Oe.UNIT&&(we.t=Oe.UNIT,we.u=en.u)))}else wo?vn(be,Be):Pe?nh(Pe,Be):vn(o&&Qt&&Qt.parent.parent===o?Qt._value:Vo(J,Ht,ze,ys),Be),hn?vn(at,we):Pe?nh(Pe,we):vn(o&&Qt&&Qt.parent.parent===o?Qt._value:Vo(J,Ht,ze,ys),we);if(we.o&&(we.n=fs(Qt?Qt._toNumber:vn(Vo(J,Ht,ze,ys),en).n,we.n,we.o)),Be.o&&(Be.n=fs(we.n,Be.n,Be.o)),we.t!==Be.t){if(we.t===Oe.COMPLEX||Be.t===Oe.COMPLEX){let Ne=we.t===Oe.COMPLEX?we:Be,Lt=we.t===Oe.COMPLEX?Be:we;Lt.t=Oe.COMPLEX,Lt.s=Yt(Ne.s),Lt.d=Ne.d.map(()=>Lt.n)}else if(we.t===Oe.UNIT||Be.t===Oe.UNIT){let Ne=we.t===Oe.UNIT?we:Be,Lt=we.t===Oe.UNIT?Be:we;Lt.t=Oe.UNIT,Lt.u=Ne.u}else if(we.t===Oe.COLOR||Be.t===Oe.COLOR){let Ne=we.t===Oe.COLOR?we:Be,Lt=we.t===Oe.COLOR?Be:we;Lt.t=Oe.COLOR,Lt.d=Ne.d.map(()=>0)}}if(we.u!==Be.u){let Ne=Be.u?we:Be;Ne=qa(J,Ne,Be.u?Be.u:we.u,!1)}if(Be.d&&we.d&&Be.d.length!==we.d.length){let Ne=we.d.length>Be.d.length?we:Be,Lt=Ne===we?Be:we;Lt.d=Ne.d.map((pc,Nr)=>te(Lt.d[Nr])?0:Lt.d[Nr]),Lt.s=Yt(Ne.s)}let To=Ye(+ut||Ae,12),Rs=ys[Ht];Lo(Rs)||(ys[Ht]=null);let uc=rn?rn.set:null;Te=Ye(kr+To,12);let Ri=we.d,Ls=Be.d,Fs=Be.s,sn={parent:this,id:rI++,property:Ht,target:J,_value:null,_toFunc:wd.func,_fromFunc:Sd.func,_ease:xr(re),_fromNumbers:Ri?Yt(Ri):Fa,_toNumbers:Ls?Yt(Ls):Fa,_strings:Fs?Yt(Fs):Fa,_fromNumber:we.n,_toNumber:Be.n,_numbers:Ri?Yt(Ri):Fa,_number:we.n,_unit:Be.u,_modifier:qn,_currentTime:0,_startTime:kr,_delay:+St,_updateDuration:To,_changeDuration:To,_absoluteStartTime:Pi,_absoluteUpdateStartTime:Ps,_absoluteEndTime:Ye(Je+Te,12),_hasFromValue:hn||So?1:0,_tweenType:ze,_setter:uc,_valueType:Be.t,_composition:gt,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:Rs,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};gt!==Nt.none&&Cd(sn,Rt);let di=sn._valueType;if(di===Oe.COMPLEX)sn._value=bd(sn,1,-1);else if(di===Oe.UNIT)sn._value=`${qn(sn._toNumber)}${sn._unit}`;else if(di===Oe.COLOR){let Ne=Be.d;sn._value=`rgba(${Ye(Ne[0],0)},${Ye(Ne[1],0)},${Ye(Ne[2],0)},${Ne[3]})`}else sn._value=qn(sn._toNumber);isNaN(qe)&&(qe=sn._startTime),Pe=sn,K++,On(this,sn)}(isNaN(P)||qe<P)&&(P=qe),(isNaN(Ce)||Te>Ce)&&(Ce=Te),ze===mt.TRANSFORM&&($t=K-ot,_e=K)}if(!isNaN($t)){let _t=0;nt(this,ze=>{_t>=$t&&_t<_e&&(ze._renderTransforms=1,ze._composition===Nt.blend&&nt(ri.animation,rn=>{rn.id===ze.id&&(rn._renderTransforms=1)})),_t++})}}l||console.warn("No target found. Make sure the element you're trying to animate is accessible before creating your animation."),P?(nt(this,L=>{L._startTime-L._delay||(L._delay-=P),L._startTime-=P}),Ce-=P):P=0,Ce||(Ce=Ae,this.iterationCount=0),this.targets=c,this.id=te(y)?sb:y,this.duration=Ce===Ae?Ae:br((Ce+this._loopDelay)*this.iterationCount-this._loopDelay)||Ae,this.onRender=ye||he.onRender,this._ease=Xe,this._delay=P,this.iterationDuration=Ce,!this._autoplay&&G&&this.onRender(this)}stretch(e){let n=this.duration;if(n===ii(e))return this;let o=e/n;return nt(this,i=>{i._updateDuration=ii(i._updateDuration*o),i._changeDuration=ii(i._changeDuration*o),i._currentTime*=o,i._delay*=o,i._startTime*=o,i._absoluteStartTime*=o,i._absoluteUpdateStartTime*=o,i._absoluteEndTime*=o}),super.stretch(e)}refresh(){return nt(this,e=>{let n=e._toFunc,o=e._fromFunc;(n||o)&&(o?(vn(o(),we),we.u!==e._unit&&e.target[Ro]&&qa(e.target,we,e._unit,!0),e._fromNumbers=Yt(we.d),e._fromNumber=we.n):n&&(vn(Vo(e.target,e.property,e._tweenType),en),e._fromNumbers=Yt(en.d),e._fromNumber=en.n),n&&(vn(n(),Be),e._toNumbers=Yt(Be.d),e._strings=Yt(Be.s),e._toNumber=Be.o?fs(e._fromNumber,Be.n,Be.o):Be.n))}),this.duration===Ae&&this.restart(),this}revert(){return super.revert(),hs(this)}then(e){return super.then(e)}},nn=(t,e)=>Ie.editor?Ie.editor.addAnimation(t,e):new Mi(t,e,null,0,!1).init();var aI=(t,e)=>{if(Bn(e,"<")){let n=e[1]==="<",o=t._tail,i=o?o._offset+o._delay:0;return n?i:i+o.duration}},Cr=(t,e)=>{let n=t.iterationDuration;if(n===Ae&&(n=0),te(e))return n;if(kn(+e))return+e;let o=e,i=t?t.labels:null,r=!Lo(i),s=aI(t,o),a=!te(s),c=R_.exec(o);if(c){let l=c[0],d=o.split(l),f=r&&d[0]?i[d[0]]:n,y=a?s:r?f:n,_=+d[1];return fs(y,_,l[0])}else return a?s:r?te(i[o])?n:i[o]:n};function cI(t){return br((t.iterationDuration+t._loopDelay)*t.iterationCount-t._loopDelay)||Ae}function lh(t,e,n,o,i,r){let a=kn(t.duration)&&t.duration<=Ae?n-Ae:n;e.composition&&jo(e,a,1,1,Xt.AUTO);let c=o?new Mi(o,t,e,a,!1,i,r):new si(t,e,a);return e.composition&&c.init(!0),On(e,c),nt(e,l=>{let f=l._offset+l._delay+l.duration;f>e.iterationDuration&&(e.iterationDuration=f)}),e.duration=cI(e),e}var ab=0,Md=class extends si{constructor(e={}){super(e,null,0),++ab,this.id=te(e.id)?ab:e.id,this.duration=0,this.labels={};let n=e.defaults,o=Ie.defaults;this.defaults=n?gd(n,o):o,this.composition=Ot(e.composition,!0),this.onRender=e.onRender||o.onRender;let i=Ot(e.playbackEase,o.playbackEase);this._ease=i?xr(i):null,this.iterationDuration=0}add(e,n,o){let i=yr(n),r=yr(e);if(i||r){if(this._hasChildren=!0,i){let s=n,a=Ie.editor&&Ie.editor.addTimelineChild,c=o&&o.type==="Stagger"&&Ie.editor,l=Jt(o)?o:null;if(l||c){let d=Si(e),f=this.duration,y=this.iterationDuration,_=s.id,C=0,w=d.length,A=a?a(e,s,this.id,o,w):null,Y=l||Ie.editor.resolveStagger(o.defaultValue);d.forEach(q=>{let ye=j({},A||s);this.duration=f,this.iterationDuration=y,te(_)||(ye.id=_+"-"+C);let he=Cr(this,Y(q,C,d,null,this));lh(ye,this,he,q,C,d),C++})}else{let d=a?a(e,s,this.id,o):s,f=o&&o.type?o.defaultValue:o;lh(d,this,Cr(this,f),e)}}else lh(e,this,Cr(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 i=Ie.editor,r=i&&i.addTimelineChild;i&&i.addTimelineSync&&(n=i.addTimelineSync(e,n,this.id),i.addTimelineChild=null);let s=this.add(e,{currentTime:[0,o],duration:o,delay:0,ease:"linear",playbackEase:"linear"},n);return i&&(i.addTimelineChild=r),s}set(e,n,o){return te(n)?this:(n.duration=Ae,n.composition=Nt.replace,this.add(e,n,o))}call(e,n){return te(e)||e&&!Jt(e)?this:(Ie.editor&&Ie.editor.addTimelineCall&&(n=Ie.editor.addTimelineCall(e,n,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},n))}label(e,n){return te(e)||e&&!Nn(e)?this:(Ie.editor&&Ie.editor.addTimelineLabel&&(n=Ie.editor.addTimelineLabel(e,n,this.id)),this.labels[e]=Cr(this,n),this)}remove(e,n){return Ga(Si(e),this,n),this}stretch(e){let n=this.duration;if(n===ii(e))return this;let o=e/n,i=this.labels;nt(this,r=>r.stretch(r.duration*o));for(let r in i)i[r]*=o;return super.stretch(e)}refresh(){return nt(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),nt(this,e=>e.revert,!0),hs(this)}then(e){return super.then(e)}},Id=t=>Ie.editor?Ie.editor.addTimeline(t):new Md(t).init();var dh={};ug(dh,{clamp:()=>yn,damp:()=>gI,degToRad:()=>mI,lerp:()=>oi,mapRange:()=>fI,padEnd:()=>uI,padStart:()=>dI,radToDeg:()=>hI,round:()=>Ye,roundPad:()=>lI,snap:()=>H_,wrap:()=>pI});var lI=(t,e)=>(+t).toFixed(e),dI=(t,e,n)=>`${t}`.padStart(e,n),uI=(t,e,n)=>`${t}`.padEnd(e,n),pI=(t,e,n)=>((t-e)%(n-e)+(n-e))%(n-e)+e,fI=(t,e,n,o,i)=>o+(t-e)/(n-e)*(i-o),mI=t=>t*Math.PI/180,hI=t=>t*180/Math.PI,gI=(t,e,n,o)=>o?o===1?e:oi(t,e,1-Math.exp(-o*n*.1)):t;var cb={_head:null,_tail:null},lb=(t,e,n)=>{let o=cb._head,i;for(;o;){let r=o._next,s=o.$el===t,a=!e||o.property===e,c=!n||o.parent===n;if(s&&a&&c){i=o.animation;try{i.commitStyles()}catch{}i.cancel(),Hn(cb,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=r}return i};function db(t,e,n){let o=Ti(t);if(!o.length)return;let[i]=o,r=$a(i,e),s=ms(e,i,r),a=Vo(i,s);if(te(n))return a;if(vn(a,en),en.t===Oe.NUMBER||en.t===Oe.UNIT){if(n===!1)return en.n;{let c=qa(i,en,n,!1);return`${Ye(c.n,Ie.precision)}${c.u}`}}}var ub=(t,e)=>{if(!te(e))return Ie.editor&&Ie.editor.addSet?Ie.editor.addSet(t,e):(e.duration=Ae,e.composition=Ot(e.composition,Nt.none),new Mi(t,e,null,0,!0).resume())},pb=(t,e,n)=>{let o=Si(t);for(let i=0,r=o.length;i<r;i++)lb(o[i],n,e&&e.controlAnimation&&e);return Ga(o,e,n),o};var fb=(t=Wt)=>new si({duration:1*Ie.timeScale,onComplete:t},null,0).resume(),mb=t=>{let e;return((...n)=>{let o,i,r,s,a;e&&(o=e.currentIteration,i=e.iterationProgress,r=e.reversed,s=e._alternate,a=e._startTime,e.revert());let c=t(...n);return c&&!Jt(c)&&c.revert&&(e=c),te(i)||(e.currentIteration=o,e.iterationProgress=(s&&o%2?!r:r)?1-i:i,e._startTime=a),c||Wt})};var Tt={};ug(Tt,{$:()=>Ti,addChild:()=>On,clamp:()=>wb,cleanInlineStyles:()=>Y_,createSeededRandom:()=>Nd,damp:()=>Db,degToRad:()=>xb,forEachChildren:()=>nt,get:()=>db,keepTime:()=>mb,lerp:()=>Tb,mapRange:()=>bb,padEnd:()=>vb,padStart:()=>yb,radToDeg:()=>Cb,random:()=>_s,randomPick:()=>Mb,remove:()=>pb,removeChild:()=>Hn,round:()=>Sb,roundPad:()=>gb,set:()=>ub,shuffle:()=>Od,snap:()=>Eb,stagger:()=>$o,sync:()=>fb,wrap:()=>_b});var io=dh,kd={},yI=(t,e=0)=>(...n)=>e?o=>t(...n,o):o=>t(o,...n),hb=t=>(...e)=>{let n=t(...e);return new Proxy(Wt,{apply:(o,i,[r])=>n(r),get:(o,i)=>{if(kd[i])return hb((...r)=>{let s=kd[i](...r);return a=>s(n(a))})}})},ro=(t,e,n=0)=>{let o=(...i)=>(i.length<e.length?hb(yI(e,n)):e)(...i);return kd[t]||(kd[t]=o),o},gb=ro("roundPad",io.roundPad),yb=ro("padStart",io.padStart),vb=ro("padEnd",io.padEnd),_b=ro("wrap",io.wrap),bb=ro("mapRange",io.mapRange),xb=ro("degToRad",io.degToRad),Cb=ro("radToDeg",io.radToDeg),Eb=ro("snap",io.snap),wb=ro("clamp",io.clamp),Sb=ro("round",io.round),Tb=ro("lerp",io.lerp,1),Db=ro("damp",io.damp,1);var _s=(t=0,e=1,n=0)=>{let o=10**n;return Math.floor((Math.random()*(e-t+1/o)+t)*o)/o},vI=0,Nd=(t,e=0,n=1,o=0)=>{let i=t===void 0?vI++:t;return(r=e,s=n,a=o)=>{i+=1831565813,i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61);let c=10**a;return Math.floor((((i^i>>>14)>>>0)/4294967296*(s-r+1/c)+r)*c)/c}},Mb=t=>t[_s(0,t.length-1)],Od=(t,e=_s)=>{let n=t.length,o,i;for(;n;)i=e(0,--n),o=t[n],t[n]=t[i],t[i]=o;return t};var $o=(t,e={})=>{let n=[],o=0,i,r=null,s=e.from,a=e.reversed,c=e.ease,l=!te(c),f=l&&!te(c.ease)?c.ease:l?xr(c):null,y=e.grid,_=y===!0,C=e.axis,w=e.total,A=te(s)||s===0||s==="first",Y=s==="center",q=s==="last",ye=s==="random",he=$n(s),Se=$n(t),pe=e.use,Xe=Se?hd(t[0]):hd(t),je=Se?hd(t[1]):0,$e=fd.exec((Se?t[1]:t)+oo),dt=e.start||0+(Se?Xe:0),wt=e.seed,Mt=!te(wt)&&wt!==!1?Nd(wt===!0?0:wt):_s,Je=e.jitter,Ce=!te(Je),P=$n(Je),K=P?Je[0]:Je||0,G=P?Je[1]:Je||0,L=A?0:kn(s)?s:0;return(J,Re,et,$t,_e)=>{let[_t]=Ti(J),ze=te(w)?et.length:w,rn=te(pe)?!1:Jt(pe)?pe(_t,Re,ze):Vo(_t,pe),Ht=kn(rn)||Nn(rn)&&kn(+rn)?+rn:Re,Ze=Ht>=0&&Ht<ze?Ht:Re;if(Y&&(L=(ze-1)/2),q&&(L=ze-1),!n.length){if(_){let Pe=!0,qe=!1,Te=1/0,ot=1/0,ie=1/0,lt=-1/0,Z=-1/0,gt=-1/0,Ke=[],ne=[],xt=[];for(let be=0;be<ze;be++){let at=et[be],Ge=0,F=0,B=0,X=!1;if(at&&Jt(at.getBoundingClientRect)){let re=at.getBoundingClientRect();Ge=re.left+re.width/2,F=re.top+re.height/2,X=!0}else{let re=at;re&&kn(re.x)&&kn(re.y)&&(Ge=re.x,F=re.y,kn(re.z)&&(B=re.z,qe=!0),X=!0)}if(!X){Pe=!1;break}Ke.push(Ge),ne.push(F),xt.push(B),Ge<Te&&(Te=Ge),F<ot&&(ot=F),B<ie&&(ie=B),Ge>lt&&(lt=Ge),F>Z&&(Z=F),B>gt&&(gt=B)}if(Pe){let be=Ke[0],at=ne[0],Ge=xt[0];he?(be=Te+s[0]*(lt-Te),at=ot+s[1]*(Z-ot),Ge=qe?ie+(s.length>=3?s[2]:.5)*(gt-ie):0):Y?(be=(Te+lt)/2,at=(ot+Z)/2,Ge=(ie+gt)/2):q?(be=Ke[ze-1],at=ne[ze-1],Ge=xt[ze-1]):kn(s)&&(be=Ke[s],at=ne[s],Ge=xt[s]);for(let B=0;B<ze;B++){let X=be-Ke[B],re=at-ne[B],ut=Ge-xt[B],St=wi(X*X+re*re+(qe?ut*ut:0));C==="x"&&(St=-X),C==="y"&&(St=-re),C==="z"&&(St=-ut),n.push(St)}let F=1/0;for(let B=0;B<ze;B++){let X=gr(n[B]);X>0&&X<F&&(F=X)}if(F>0&&F<1/0)for(let B=0;B<ze;B++)n[B]=n[B]/F}else for(let be=0;be<ze;be++)n.push(gr(L-be))}else for(let Pe=0;Pe<ze;Pe++)if(!y)n.push(gr(L-Pe));else{let qe=y.length,Te=y[0]*y[1],ot,ie,lt;he?(ot=s[0]*(y[0]-1),ie=s[1]*(y[1]-1),lt=qe===3?(s.length>=3?s[2]:.5)*(y[2]-1):0):Y?(ot=(y[0]-1)/2,ie=(y[1]-1)/2,lt=qe===3?(y[2]-1)/2:0):(ot=L%y[0],ie=_r(L/y[0])%y[1],lt=qe===3?_r(L/Te):0);let Z=Pe%y[0],gt=_r(Pe/y[0])%y[1],Ke=qe===3?_r(Pe/Te):0,ne=ot-Z,xt=ie-gt,be=lt-Ke,at=wi(ne*ne+xt*xt+(qe===3?be*be:0));C==="x"&&(at=-ne),C==="y"&&(at=-xt),C==="z"&&(at=-be),n.push(at)}o=n[0];for(let Pe=1;Pe<ze;Pe++)n[Pe]>o&&(o=n[Pe]);if(f||a)for(let Pe=0;Pe<ze;Pe++){let qe=n[Pe];f&&(qe=f(qe/o)*o),a&&(qe=C?-qe:gr(o-qe)),n[Pe]=qe}if(Ce){r=new Array(ze);for(let Pe=0;Pe<ze;Pe++)r[Pe]=Mt(-1,1,4)}ye&&(n=Od(n,Mt))}let Gt=Se?(je-Xe)/o:Xe;te(i)&&(i=_e?Cr(_e,te(e.start)?_e.iterationDuration:dt):dt);let Rt=i+(Gt*Ye(n[Ze],2)||0);if(Ce){let Pe=o?n[Ze]/o:0,qe=K+(G-K)*Pe;Rt=Rt+r[Ze]*qe}return e.modifier&&(Rt=e.modifier(Rt)),$e&&(Rt=`${Rt}${$e[2]}`),Rt}};var _I=t=>{let e=1;if(t&&t.getCTM){let n=t.getCTM();if(n){let o=wi(n.a*n.a+n.b*n.b),i=wi(n.c*n.c+n.d*n.d);e=(o+i)/2}}return e},bI=(t,e,n)=>{let o=no,i=getComputedStyle(t),r=i.strokeLinecap,s=i.vectorEffect==="non-scaling-stroke"?t:null,a=r,c=new Proxy(t,{get(l,d){let f=l[d];return d===ud?l:d==="setAttribute"?(...y)=>{if(y[0]==="draw"){let C=y[1].split(" "),w=+C[0],A=+C[1],Y=_I(s),q=w*-o*Y,ye=A*o*Y+q,he=o*Y+(w===0&&A===1||w===1&&A===0?0:10*Y)-ye;if(r!=="butt"){let Se=w===A?"butt":r;a!==Se&&(l.style.strokeLinecap=`${Se}`,a=Se)}l.setAttribute("stroke-dashoffset",`${q}`),l.setAttribute("stroke-dasharray",`${ye} ${he}`)}return Reflect.apply(f,l,y)}:Jt(f)?(...y)=>Reflect.apply(f,l,y):f}});return t.getAttribute("pathLength")!==`${o}`&&(t.setAttribute("pathLength",`${o}`),c.setAttribute("draw",`${e} ${n}`)),c},uh=(t,e=0,n=0)=>Si(t).map(i=>bI(i,e,n));var an=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(()=>Tt.set(e,n),o)}enter(e,n={}){if(!e)return;let{y:o=8,scale:i,duration:r=260,delay:s=0,ease:a="out(3)"}=n,c={opacity:1,translateY:"0px",scale:1};if(!this.enabled){Tt.set(e,c);return}this.settle(e,c,s+r+120),nn(e,Q(j({opacity:[0,1],translateY:[`${o}px`,"0px"]},i===void 0?{}:{scale:[i,1]}),{duration:r,delay:s,ease:a}))}enterList(e,n={}){let o=Array.from(e);if(o.length===0)return;let{y:i=8,duration:r=240,delay:s=0,each:a=30,ease:c="out(3)"}=n;if(!this.enabled){for(let l of o)Tt.set(l,{opacity:1,translateY:"0px"});return}o.forEach((l,d)=>{this.settle(l,{opacity:1,translateY:"0px"},s+d*a+r+120)}),nn(o,{opacity:[0,1],translateY:[`${i}px`,"0px"],duration:r,delay:$o(a,{start:s}),ease:c})}reveal(e,n,o={}){let{animate:i=!0,after:r}=o;if(!e){r?.();return}let s={opacity:0,height:"0px"},a={opacity:1,height:"auto"},c=Math.max(e.scrollHeight,e.getBoundingClientRect().height);if(!this.enabled||!i||c===0){Tt.set(e,n?a:s),r?.();return}this.settle(e,n?a:s,(n?240:180)+160),nn(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:()=>{Tt.set(e,n?a:s),r?.()}})}pulse(e){!this.enabled||!e||(this.settle(e,{opacity:1,scale:1},520),nn(e,{opacity:[.4,1],scale:[.99,1],duration:320,ease:"out(2)"}))}pop(e,n={}){if(!e)return;let{scale:o=1.18,duration:i=220,ease:r="out(2)"}=n;this.enabled&&(this.settle(e,{scale:1},i+120),nn(e,{scale:[o,1],duration:i,ease:r}))}static CONFETTI_COLORS=["#f43f5e","#fb923c","#facc15","#4ade80","#38bdf8","#a78bfa","#f472b6"];confetti(e,n){if(!e||!this.enabled)return;let{x:o,y:i,count:r=30,duration:s=900}=n,a=e.ownerDocument,c=e.getBoundingClientRect(),l=c.left+o,d=c.top+i,f=[],y=[];for(let w=0;w<r;w+=1){let A=Tt.random(-Math.PI*.85,-Math.PI*.15),Y=Tt.random(55,140);y.push({dx:Math.cos(A)*Y,dy:Math.sin(A)*Y,fall:Tt.random(90,180),rotate:Tt.random(-420,420)});let q=a.createElement("span");q.setAttribute("aria-hidden","true");let ye=t.CONFETTI_COLORS[w%t.CONFETTI_COLORS.length];q.style.cssText=`position:fixed;left:${l}px;top:${d}px;width:${Tt.random(5,8)}px;height:${Tt.random(8,13)}px;margin:-5px 0 0 -3px;border-radius:1.5px;background:${ye};pointer-events:none;z-index:60;opacity:0;`,a.body.appendChild(q),f.push(q)}let _=!1;setTimeout(()=>{if(!_){_=!0;for(let w of f)w.remove()}},s+420),f.forEach((w,A)=>{let{dx:Y,dy:q,fall:ye,rotate:he}=y[A];nn(w,{translateX:[0,Y],translateY:[0,q,q+ye],rotate:[0,he],opacity:[0,1,1,0],duration:s,ease:"out(2)",onComplete:()=>w.remove()})})}loop(e,n,o={}){if(!e||!this.enabled)return()=>{};let{duration:i=900,delay:r=0,ease:s="inOut(2)",alternate:a=!0}=o,c=nn(e,Q(j({},n),{duration:i,delay:r,ease:s,loop:!0,alternate:a})),l={};for(let[d,f]of Object.entries(n))l[d]=f[0];return()=>{c.pause(),Tt.set(e,l)}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=De({token:t,factory:t.\u0275fac,providedIn:"root"})};var bs=class t{target=null;aim(e){this.target=e}read(){return this.target}static \u0275fac=function(n){return new(n||t)};static \u0275prov=De({token:t,factory:t.\u0275fac,providedIn:"root"})};function xI(t,e){if(t&1&&(v(0,"span",22),p(1),x()),t&2){let n=e.$implicit;u(),N(n)}}var Ib=1800,CI=520,EI=Ib,Ad=class t{status=ee("Connecting to the host\u2026");ready=ee(!1);dismissed=rt();letters=["M","o","r","s","e"];leaving=O(!1);host=k(Bt);animation=k(an);handoff=k(bs);intro;loops=[];introSettle;holdTimer;outroSettle;startedAt=0;left=!1;viewReady=!1;dismissedOnce=!1;constructor(){se(()=>{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"),i=this.query(".halo"),r=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"),_=this.query(".foot"),C=this.query(".pulse");try{let w=[n,o].filter(A=>A!==null).map(A=>uh(A)[0]);for(let A of w)A.setAttribute("draw","0 0");this.intro=Id(),this.intro.add(this.one(i),{opacity:[0,.72],scale:[.45,1],duration:900,ease:"out(4)"},0).add(this.one(r),{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(w,{draw:["0 0","0 1"],duration:720,ease:"inOut(3)",delay:$o(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(i),{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:$o(40)},1100).add(this.one(y),{opacity:[0,1],translateY:[8,0],duration:420,ease:"out(3)"},1480).add(this.one(_),{opacity:[0,1],translateY:[10,0],duration:420,ease:"out(3)"},1580).add(this.one(C),{opacity:[0,1],scale:[.6,1],duration:420,ease:"out(2)"},1580),this.introSettle=setTimeout(()=>this.snap(),Ib+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"),Tt.set(this.queryAll(".boot"),{opacity:1}),Tt.set(this.queryAll(".aura"),{opacity:.85}),Tt.set(this.queryAll(".grid"),{opacity:.5}),Tt.set(this.queryAll(".halo"),{opacity:.62,scale:1}),Tt.set(this.queryAll(".spark"),{opacity:1}),Tt.set(this.queryAll(".dot, .dash"),{opacity:1,scale:1,translateY:"0px"}),Tt.set(this.queryAll(".letter"),{opacity:1,scale:1,translateY:"0px"}),Tt.set(this.queryAll(".tagline, .foot"),{opacity:1,translateY:"0px"}),Tt.set(this.queryAll(".pulse"),{opacity:1,scale:1}),Tt.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(nn(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")),i=this.one(this.query(".spin-b")),r=this.one(this.query(".orbit")),s=this.one(this.query(".spark")),a=this.one(this.query(".halo")),c=this.queryAll(".ellipsis i");e(nn(o,{rotate:[0,360],duration:16e3,loop:!0,ease:"linear"})),e(nn(i,{rotate:[0,-360],duration:22e3,loop:!0,ease:"linear"})),e(nn(r,{rotate:[0,360],duration:5400,delay:340,loop:!0,ease:"linear"})),e(nn(s,{scale:[1,1.9,1],opacity:[1,.6,1],duration:1100,delay:340,loop:!0,ease:"inOut(2)"})),e(nn(a,{opacity:[.6,.78],scale:[1,1.045],duration:2400,delay:1400,loop:!0,alternate:!0,ease:"inOut(2)"})),c.length>0&&e(nn(c,{opacity:[.15,1],translateY:[0,-2],duration:620,delay:$o(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,EI-(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"),i=this.query(".mark"),r=this.query(".halo"),s=this.queryAll(".letter"),a=this.query(".words"),c=this.query(".foot"),l=this.handoff.read(),d=i?.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=Id({defaults:{ease:"inOut(2)"},onComplete:()=>this.dismiss()}).add(this.one(r),{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:$o(20)},0).add(this.one(a,c),{opacity:0,duration:220},40);f&&i?y.add(i,Q(j({},f),{duration:560,ease:"inOut(3)"}),0).add(i,{opacity:0,duration:160,ease:"out(2)"},500).add(this.one(e),{opacity:0,duration:380},520):y.add(this.one(i),{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(),CI+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=ae({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&&(v(0,"div",0),Fe(1,"span",1)(2,"span",2)(3,"span",3),v(4,"div",4)(5,"div",5),Fe(6,"span",6)(7,"span",7)(8,"span",8),kt(),v(9,"svg",9)(10,"g",10),Fe(11,"circle",11),x(),v(12,"g",12),Fe(13,"circle",13),x(),v(14,"g",14),Fe(15,"circle",15),x()(),gn(),v(16,"span",16),Fe(17,"span",17)(18,"span",18)(19,"span",19),x()(),v(20,"div",20)(21,"div",21),ce(22,xI,2,1,"span",22,ls),x(),v(24,"div",23),p(25,"the pi coding agent"),x()()(),v(26,"div",24),Fe(27,"span",25),v(28,"span",26),p(29),x(),v(30,"span",27),Fe(31,"i")(32,"i")(33,"i"),x()()()),n&2&&(de("leaving",o.leaving()),u(22),le(o.letters),u(7),N(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 wI(t,e){t&1&&(v(0,"p",19),p(1),x()),t&2&&(u(),N(e))}function SI(t,e){if(t&1){let n=H();v(0,"div",23)(1,"p",24),p(2,"Start a Morse host"),x(),v(3,"div",25)(4,"span",26),p(5,"installed CLI"),x(),v(6,"code"),p(7,"morse start"),x()(),v(8,"div",25)(9,"span",26),p(10,"from the repo"),x(),v(11,"code"),p(12,"npm run dev:server"),x()(),v(13,"p",27),p(14," Not installed? "),v(15,"code"),p(16,"npm install -g @supanadit/morse-web"),x(),p(17,". "),x(),v(18,"p",27),p(19," Stopped it with "),v(20,"code"),p(21,"morse stop"),x(),p(22,"? "),v(23,"code"),p(24,"morse start"),x(),p(25," brings it back \u2014 "),v(26,"code"),p(27,"morse logs"),x(),p(28," says what happened. "),x(),v(29,"p",27),p(30,"or point this window at a host that is already running"),x(),v(31,"form",28),U("submit",function(i){M(n);let r=m();return I(r.submit(i))}),v(32,"input",29),U("input",function(i){M(n);let r=m();return I(r.onInput(i))}),x(),v(33,"button",30),p(34,"Connect"),x()()()}if(t&2){let n=m();u(32),ve("value",n.server()),u(),ve("disabled",n.server().trim().length===0)}}var Pd=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=O("");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=ae({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&&(v(0,"div",0),Fe(1,"span",1)(2,"span",2)(3,"span",3),v(4,"div",4)(5,"div",5),Fe(6,"span",6)(7,"span",7)(8,"span",8),kt(),v(9,"svg",9),Fe(10,"circle",10)(11,"circle",11),x(),gn(),v(12,"span",12),Fe(13,"span",13)(14,"span",13)(15,"span",14),x()(),v(16,"p",15),Fe(17,"span",16),p(18),x(),v(19,"h1",17),p(20),x(),v(21,"p",18),p(22),x(),T(23,wI,2,1,"p",19),v(24,"div",20)(25,"button",21),U("click",function(){return o.retry.emit()}),p(26,"Retry now"),x(),v(27,"button",22),U("click",function(){return o.explore.emit()}),p(28,"Explore the app"),x()(),T(29,SI,35,2,"div",23),x()()),n&2){let i;u(18),N(o.eyebrow()),u(2),N(o.title()),u(2),N(o.body()),u(),D((i=o.detail())?23:-1,i),u(6),D(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 TI=["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 ph(t){return JSON.stringify(t)}function DI(t){return MI(t,TI)}function Rd(t){let e=Ya(t);return DI(e)?e:void 0}function Ya(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return}return t instanceof Uint8Array?Ya(new TextDecoder().decode(t)):t instanceof ArrayBuffer?Ya(new TextDecoder().decode(new Uint8Array(t))):t}function MI(t,e){if(typeof t!="object"||t===null)return!1;let n=t.type;return typeof n=="string"&&e.includes(n)}function Ld(t={cwd:"",name:"workspace"}){return{protocolVersion:18,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 kb(t,e,n){return Q(j({},t),{connection:e,connectionDetail:n})}function Nb(t,e){switch(e.type){case"host/ready":return Q(j({},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(j({},t),{state:e.payload});case"transcript/append":return Q(j({},t),{items:[...t.items,e.payload]});case"transcript/update":return Q(j({},t),{items:II(t.items,e.payload)});case"transcript/delta":return Q(j({},t),{items:kI(t.items,e.payload)});case"transcript/replace":return Q(j({},t),{items:[...e.payload.items]});case"transcript/prepend":return Q(j({},t),{items:[...e.payload.items,...t.items]});case"session/list":return Q(j({},t),{sessions:[...e.payload.sessions]});case"session/activity":return Q(j({},t),{activity:[...e.payload.sessions]});case"project/list":return Q(j({},t),{projects:[...e.payload.projects]});case"interaction/request":return Q(j({},t),{pendingInteraction:e.payload});case"interaction/dismiss":return t.pendingInteraction?.requestId===e.payload.requestId?Q(j({},t),{pendingInteraction:null}):t;case"notice":return Q(j({},t),{lastNotice:j({},e.payload)});case"error":return Q(j({},t),{lastError:j({},e.payload)});default:return t}}function II(t,e){let n=t.findIndex(i=>i.id===e.id);if(n===-1)return[...t,e];let o=[...t];return o[n]=e,o}function kI(t,e){let n=t.findIndex(r=>r.id===e.id);if(n===-1)return t;let o=t[n];if(o.kind!=="assistant")return t;let i=[...t];return i[n]=Q(j({},o),{text:o.text+(e.text??""),thinking:o.thinking+(e.thinking??""),streaming:!0}),i}var NI=5e3;function Ob(t){let e=Ld(t.workspace??{cwd:"",name:"workspace"}),n=new Set,o=C=>{e=C;for(let w of[...n])w(e)},i=C=>{t.transport.send(C)},r=new Map,s=0,a=new Set,c=new Set,l=new Set,d=(C,w)=>{s+=1;let A=`host-${s}`;return new Promise(Y=>{let q=setTimeout(()=>{r.delete(A),Y(void 0)},NI);r.set(A,{resolve:Y,timer:q}),i({type:"host/command",payload:{command:C,args:w,requestId:A}})})},f=t.transport.onMessage(C=>{if(C.type==="host/command/result"){let w=r.get(C.payload.requestId);w&&(clearTimeout(w.timer),r.delete(C.payload.requestId),w.resolve(C.payload.ok?C.payload.data:void 0));return}if(C.type==="context/selection"){for(let w of[...a])w(C.payload);return}if(C.type==="context/selectionLive"){for(let w of[...c])w(C.payload);return}if(C.type==="composer/seed"){for(let w of[...l])w(C.payload);return}o(Nb(e,C))}),y=t.transport.onStatus((C,w)=>{o(kb(e,OI(C),C==="open"?"Waiting for the Morse host to answer\u2026":w))}),_={ready:C=>i({type:"client/ready",payload:{protocolVersion:18,frontend:C??t.frontend}}),prompt:(C,w,A,Y)=>i({type:"chat/prompt",payload:{text:C,mode:w,images:A,pins:Y}}),editMessage:(C,w)=>i({type:"chat/edit",payload:{itemId:C,text:w}}),forkMessage:C=>i({type:"chat/fork",payload:{itemId:C}}),hostCommand:(C,w)=>d(C,w),abort:()=>i({type:"chat/abort",payload:{}}),newSession:C=>i({type:"session/new",payload:{cwd:C}}),loadSession:(C,w)=>i({type:"session/load",payload:{sessionId:C,cwd:w}}),activateSession:(C,w)=>i({type:"session/activate",payload:{sessionId:C,cwd:w}}),closeSession:C=>i({type:"session/close",payload:{sessionId:C}}),deleteSession:C=>i({type:"session/delete",payload:{sessionId:C}}),compactSession:C=>i({type:"session/compact",payload:{instructions:C}}),loadOlderHistory:()=>i({type:"history/load",payload:{}}),requestSessions:()=>i({type:"session/list",payload:{}}),requestProjects:()=>i({type:"project/list",payload:{}}),refreshCommands:()=>i({type:"commands/refresh",payload:{}}),openProject:C=>i({type:"project/open",payload:{path:C}}),setModel:(C,w)=>i({type:"model/set",payload:{provider:C,id:w}}),setThinkingLevel:C=>i({type:"thinking/set",payload:{level:C}}),respond:C=>i({type:"interaction/respond",payload:C})};return t.transport.connect(),_.ready(),{getView:()=>e,subscribe:C=>(n.add(C),()=>{n.delete(C)}),onContextSelection:C=>(a.add(C),()=>{a.delete(C)}),onContextSelectionLive:C=>(c.add(C),()=>{c.delete(C)}),onComposerSeed:C=>(l.add(C),()=>{l.delete(C)}),actions:_,dispose:()=>{f(),y(),n.clear(),t.transport.dispose()}}}function OI(t){switch(t){case"open":return"connecting";case"connecting":return"connecting";case"error":return"error";case"closed":return"closed"}}var AI=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/,Ab=/<([^<>]+)>|\[([^\[\]]+)\]/g,Pb=/\$(\d+)|\$\{(\d+):/g,PI=/\$(?:@|ARGUMENTS)|\$\{(?:@|ARGUMENTS)(?::|-)/;function RI(t){let e=[],n="",o=null;for(let i of t)o!==null?i===o?o=null:n+=i:i==='"'||i==="'"?o=i:/\s/.test(i)?n.length>0&&(e.push(n),n=""):n+=i;return n.length>0&&e.push(n),e}function LI(t,e){let n=e.join(" ");return t.replace(/\$\{(\d+|ARGUMENTS|@):-([^}]*)\}|\$\{@:(\d+)(?::(\d+))?\}|\$(ARGUMENTS|@|\d+)/g,(o,i,r,s,a,c)=>{if(i!==void 0){let l=i==="@"||i==="ARGUMENTS"?n:e[Number.parseInt(i,10)-1];return l||r}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 FI(t){if(t===void 0)return[];let e=[];Ab.lastIndex=0;let n,o=0;for(;(n=Ab.exec(t))!==null;){o+=1;let i=(n[1]??n[2]??"").trim();e.push({id:`arg${o}`,label:i.length>0?i:`Argument ${o}`,required:n[1]!==void 0,index:o})}return e}function VI(t){let e=0;Pb.lastIndex=0;let n;for(;(n=Pb.exec(t))!==null;){let i=Number.parseInt(n[1]??n[2]??"0",10);Number.isFinite(i)&&i>e&&(e=i)}let o=[];for(let i=1;i<=e;i+=1)o.push({id:`arg${i}`,label:`Argument ${i}`,required:!1,index:i});return o}function jI(t){let e=/^(['"])([\s\S]*)\1$/.exec(t);return e===null?t:e[2]}function fh(t){let e=AI.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:jI(n[1].trim())}}function Rb(t){let e=fh(t),n=FI(e.argumentHint),o=n.length>0?n:VI(e.body);if(o.length>0)return{body:e.body,arguments:o};if(PI.test(e.body))return{body:e.body,arguments:[{id:"arguments",label:"Arguments",required:!1}]}}function Lb(t,e,n=""){let o=t.arguments.find(a=>a.index===void 0),i=o!==void 0?RI(e[o.id]??""):t.arguments.map(a=>(e[a.id]??"").trim()),r=LI(t.body,i),s=n.trim();return s.length===0?r:`${r.replace(/\s+$/,"")}
7
+
8
+ ${s}`}var Ii=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 Fb,Vb=!1;function jb(){return typeof globalThis.acquireVsCodeApi=="function"}function BI(){let t=globalThis.acquireVsCodeApi;if(typeof t=="function")return Vb||(Vb=!0,Fb=t()),Fb}var Fd=class extends Ii{kind="vscode";api=BI();listener=e=>{let n=Rd(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 $I=8e3,Za=class extends Ii{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(ph(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 i of o)n.send(ph(i))},n.onmessage=o=>{let i=Rd(Ya(o.data));i&&this.emitMessage(i)},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??$I,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 Cs={cwd:"/mock/workspace",name:"mock-workspace"},HI={hostKind:"server",scope:Hb()?"workspace":"global",editorContext:!1,nativeDialogs:!1,insertIntoEditor:!1,revealFile:!1,filePicker:!0,fileUpload:!0,directoryPicker:!0,updateCheck:UI()};function UI(){return typeof location>"u"?!1:new URL(location.href,"http://localhost/").searchParams.get("update")==="1"}var Vd=class extends Ii{kind="memory";timers=new Set;items=WI()?[]:YI();sessions=Ub();hot=new Set(this.sessions.slice(0,2).map(e=>e.id));counter=100;disposed=!1;streaming=!1;state={workspace:Cs,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:j({},e)}),this.state=Q(j({},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:$b()}}),this.emit({type:"session/list",payload:{sessions:this.sessions}}),this.emitActivity(),this.emit({type:"host/ready",payload:j({protocolVersion:18,capabilities:HI,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:Cs.cwd,updatedAt:Date.now(),messageCount:0};this.sessions=[n,...this.sessions],this.hot.add(n.id),this.state=Q(j({},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:$b()}});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(j({},this.state),{model:n?j({},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(j({},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:zI}}});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:qI(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(j({},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 Bb(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 i=`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.`,r=this.nextId("assistant");this.schedule(()=>{this.appendItem({kind:"assistant",id:r,at:Date.now(),text:"",thinking:"",streaming:!0,model:this.state.model?.name})},n),n+=40;for(let s of Bb(i)){let a=s;this.schedule(()=>{this.emit({type:"transcript/delta",payload:{id:r,text:a}})},n),n+=55}this.schedule(()=>{this.streaming=!1,this.updateItem({kind:"assistant",id:r,at:Date.now(),text:i,thinking:"",streaming:!1,model:this.state.model?.name}),this.emit({type:"session/state",payload:Q(j({},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)}},zI=["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"],GI={"/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 qI(t){let e=typeof t=="string"&&t.trim().length>0?t.trim():Cs.cwd,n=e==="/mock"?void 0:e.slice(0,e.lastIndexOf("/"))||"/";return{path:e,parent:n,directories:GI[e]??[],isGitRepo:e==="/mock/projects/morse",canOpen:!0,roots:[{name:"mock",path:"/mock"},{name:"workspace",path:Cs.cwd}]}}function Bb(t){return t.match(/.{1,14}/g)??[]}function Hb(){return typeof location>"u"?!1:new URL(location.href).searchParams.get("scope")==="workspace"}function WI(){return typeof location>"u"?!1:new URL(location.href).searchParams.get("empty")==="1"}function Ub(){let t=Date.now(),e=[{id:"/mock/morse/2026-01-01_ui-overhaul.jsonl",title:"Sidebar overhaul: projects, sessions, composer",cwd:Cs.cwd,updatedAt:t-6e4,messageCount:12},{id:"/mock/morse/2026-01-01_scrollbar.jsonl",title:"Improve native scrollbar: compact and themed",cwd:Cs.cwd,updatedAt:t-7*6e4,messageCount:6}];return Hb()?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 $b(){let t=new Map;for(let e of Ub()){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 YI(){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 zb(t={}){if(jb())return new Fd;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 Vd;let o=n.searchParams.get("server");if(o)return new Za({url:o,WebSocketImpl:t.WebSocketImpl});let i=n.protocol==="https:",r=t.websocketPath??"/ws";return new Za({url:`${i?"wss":"ws"}://${n.host}${r}`,WebSocketImpl:t.WebSocketImpl})}var Ho=class t{attached=O([]);pinned=O([]);live=O(null);pendingMentions=O([]);message=O(null);counter=0;images=this.attached.asReadonly();pins=this.pinned.asReadonly();livePreview=this.live.asReadonly();mentions=this.pendingMentions.asReadonly();notice=this.message.asReadonly();count=E(()=>this.attached().length+this.pinned().length+this.pendingMentions().length);async read(e){let n=[],o=[];for(let i of e){if(!i.type.startsWith("image/")){o.push(i.name);continue}let r=await mh(i);if(!r){o.push(i.name);continue}this.counter+=1,n.push({id:`attachment-${this.counter}`,name:i.name||`image-${this.counter}.png`,mimeType:i.type,data:r,bytes:i.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,i)=>{this.counter+=1;let s=(o.mimeType.split("/")[1]?.toLowerCase()??"").replace(/[^a-z0-9]/g,"")||"png";return{id:`seed-${this.counter}`,name:i===0?`image.${s}`:`image-${i+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})}setPinRange(e,n){this.pinned.update(o=>o.map(i=>i.id===e?Q(j({},i),{startLine:n.startLine,endLine:n.endLine}):i))}pin(e,n){if(e.path.length===0)return"";if(e.startLine===void 0){let y=this.pinned().find(C=>C.path===e.path&&C.startLine===void 0);if(y!==void 0)return y.id;this.counter+=1;let _=`pin-${this.counter}`;return this.pinned.update(C=>[...C,Q(j({},e),{id:_})]),_}let o=this.pinned(),i=e.startLine,r=e.endLine??e.startLine,s=new Set(n===void 0?[]:[n]),a,c=!0;for(;c;){c=!1;for(let y of o){if(s.has(y.id)||y.path!==e.path||y.startLine===void 0)continue;let _=y.startLine,C=y.endLine??_;_<=r+1&&C+1>=i&&(i=Math.min(i,_),r=Math.max(r,C),s.add(y.id),a??=y.id,c=!0)}}this.counter+=1;let l={id:n??a??`pin-${this.counter}`,path:e.path,startLine:i,endLine:r>i?r:void 0},d=[],f=!1;for(let y of o){if(s.has(y.id)){f||(d.push(l),f=!0);continue}d.push(y)}return f||d.push(l),this.pinned.set(d),l.id}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:i})=>{let r={path:n};return o!==void 0&&(r.startLine=o),i!==void 0&&(r.endLine=i),r});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=De({token:t,factory:t.\u0275fac,providedIn:"root"})};function mh(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 i=o.indexOf(",");e(i===-1?void 0:o.slice(i+1))},n.readAsDataURL(t)})}var Gb=new He("morse.transport",{providedIn:"root",factory:()=>zb()});var qb={name:"@morse/ui-angular",version:"0.7.0"},KI=6e3,ht=class t{transport=k(Gb);destroyRef=k(yt);view=O(Ld());client;actions;slowConnectionTimer;connection=E(()=>this.view().connection);connectionDetail=E(()=>this.view().connectionDetail);protocolVersion=E(()=>this.view().protocolVersion);frontend=E(()=>this.view().frontend);version=E(()=>this.frontend()?.version??qb.version);slowConnection=O(!1);capabilities=E(()=>this.view().capabilities);state=E(()=>this.view().state);items=E(()=>this.view().items);projects=E(()=>this.view().projects);sessions=E(()=>this.view().sessions);activity=E(()=>this.view().activity);sessionActivity=E(()=>{let e=new Map;for(let n of this.view().activity)e.set(n.sessionKey,n);return e});pendingInteraction=E(()=>this.view().pendingInteraction);lastNotice=E(()=>this.view().lastNotice);lastError=E(()=>this.view().lastError);agentReady=E(()=>this.view().state.agentReady);agentStarting=E(()=>this.view().state.agentStarting);agentError=E(()=>this.view().state.agentError);agentFailure=E(()=>this.view().state.agentFailure);running=E(()=>this.view().state.streaming||this.view().state.busy);workspace=E(()=>this.view().state.workspace);model=E(()=>this.view().state.model);thinkingLevel=E(()=>this.view().state.thinkingLevel);availableModels=E(()=>this.view().state.availableModels);availableThinkingLevels=E(()=>this.view().state.availableThinkingLevels);availableCommands=E(()=>this.view().state.availableCommands);usage=E(()=>this.view().state.usage);hasOlderHistory=E(()=>this.view().state.hasOlderHistory===!0);loadingOlderHistory=E(()=>this.view().state.loadingOlderHistory===!0);constructor(){this.client=Ob({transport:this.transport,frontend:qb}),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)},KI))}clearSlowConnectionTimer(){this.slowConnectionTimer!==void 0&&(clearTimeout(this.slowConnectionTimer),this.slowConnectionTimer=void 0)}prompt(e,n="new",o,i){this.actions.prompt(e,n,o,i)}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=De({token:t,factory:t.\u0275fac,providedIn:"root"})};var Wb="morse.navigation.collapsed",Yb="morse.explorer.height",QI=140,XI=720;function JI(){try{return globalThis.localStorage?.getItem(Wb)==="1"}catch{return!1}}function ek(t){try{globalThis.localStorage?.setItem(Wb,t?"1":"0")}catch{}}function Zb(t){return Math.round(Math.min(XI,Math.max(QI,t)))}function tk(){try{let t=globalThis.localStorage?.getItem(Yb);if(t==null)return;let e=Number.parseInt(t,10);return Number.isFinite(e)?Zb(e):void 0}catch{return}}function nk(t){try{globalThis.localStorage?.setItem(Yb,String(t))}catch{}}var Zt=class t{navigationVisible=O(!1);navigationOpen=this.navigationVisible.asReadonly();collapsed=O(JI());navigationCollapsed=this.collapsed.asReadonly();explorer=O(tk());explorerHeight=this.explorer.asReadonly();projectPicker=O(!1);projectPickerOpen=this.projectPicker.asReadonly();about=O(!1);aboutOpen=this.about.asReadonly();shortcuts=O(!1);shortcutsOpen=this.shortcuts.asReadonly();projectFilter=O(!1);projectFilterOpen=this.projectFilter.asReadonly();promptTemplate=O(!1);promptTemplateOpen=this.promptTemplate.asReadonly();compactPrompt=O(void 0);compactConfirmOpen=E(()=>this.compactPrompt()!==void 0);compactInstructions=E(()=>this.compactPrompt()?.instructions);modalOpen=E(()=>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),ek(e)}setExplorerHeight(e){let n=Zb(e);this.explorer.set(n),nk(n)}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=De({token:t,factory:t.\u0275fac,providedIn:"root"})};var Ka=[{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 Qa(t){return"binding"in t}function Kb(){let t=globalThis.navigator;return/mac|iphone|ipad/i.test(t?.userAgent??"")}function Qb(t,e=Kb()){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 so=class t{shell=k(Zt);handlers=new Map;revision=O(0);catalog=Ka;available=E(()=>{this.revision();let e=new Map;for(let n of Ka){if(!Qa(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),k(yt).onDestroy(()=>e.removeEventListener("keydown",this.onKeydown,!0)))}bind(e,n,o){let i={run:n,enabled:o};return this.handlers.set(e,i),this.bump(),()=>{this.handlers.get(e)===i&&(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=Ka.find(i=>Qa(i)&&ok(i.binding,e));if(n===void 0||n.whileTyping!==!0&&ik(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=De({token:t,factory:t.\u0275fac,providedIn:"root"})};function ok(t,e){return e.key.toLowerCase()!==t.key.toLowerCase()||t.mod===!0!==(Kb()?e.metaKey:e.ctrlKey)?!1:t.alt===!0===e.altKey}function ik(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 rk=10*1024*1024,Es=class t{morse=k(ht);available=E(()=>this.morse.capabilities()?.fileUpload===!0);async upload(e){let n=[],o=[];for(let i of e){if(i.size>rk){o.push(i.name);continue}let r=await mh(i);if(!r){o.push(i.name);continue}let s=await this.morse.requestHostCommand("uploadFile",{name:i.name,mimeType:i.type,data:r}),a=typeof s?.path=="string"?s.path:void 0;if(!a){o.push(i.name);continue}n.push({path:a,name:i.name,bytes:typeof s?.bytes=="number"?s.bytes:i.size})}return{added:n,failed:o}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=De({token:t,factory:t.\u0275fac,providedIn:"root"})};var jd=class t{morse=k(ht);cache=O([]);loading=O(!1);requested=!1;loadedFor;files=this.cache.asReadonly();busy=this.loading.asReadonly();available=E(()=>this.morse.capabilities()?.filePicker===!0);constructor(){se(()=>{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 i=o?.files;Array.isArray(i)&&this.cache.set(i.filter(r=>typeof r=="string"))})}static \u0275fac=function(n){return new(n||t)};static \u0275prov=De({token:t,factory:t.\u0275fac,providedIn:"root"})};var vx=BE(yx(),1);var Gd=vx.default;function _x(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 i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},r=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,i]};i.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"],_=t.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),C={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},w=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],A=["true","false"],Y={match:/(\/[a-z._-]+)+/},q=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],ye=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],he=["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"],Se=["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:w,literal:A,built_in:[...q,...ye,"set","shopt",...he,...Se]},contains:[_,t.SHEBANG(),C,f,r,s,Y,a,c,l,d,n]}}var Zk=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_-]*/}}),Kk=["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"],Qk=["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"],Xk=[...Kk,...Qk],Jk=["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(),eN=["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(),tN=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),nN=["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 bx(t){let e=t.regex,n=Zk(t),o={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",r=/@-?\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:":("+eN.join("|")+")"},{begin:":(:)?("+tN.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+nN.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:r},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:Jk.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Xk.join("|")+")\\b"}]}}function xx(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 Cx(t){let r={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:r,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:r,illegal:/["']/}]}]}}var Ex="[A-Za-z$_][0-9A-Za-z$_]*",oN=["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"],iN=["true","false","null","undefined","NaN","Infinity"],wx=["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"],Sx=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Tx=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],rN=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],sN=[].concat(Tx,wx,Sx);function Dx(t){let e=t.regex,n=(G,{after:L})=>{let J="</"+G[0].slice(1);return G.input.indexOf(J,L)!==-1},o=Ex,i={begin:"<>",end:"</>"},r=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(G,L)=>{let J=G[0].length+G.index,Re=G.input[J];if(Re==="<"||Re===","){L.ignoreMatch();return}Re===">"&&(n(G,{after:J})||L.ignoreMatch());let et,$t=G.input.substring(J);if(et=$t.match(/^\s*=/)){L.ignoreMatch();return}if((et=$t.match(/^\s+extends\s+/))&&et.index===0){L.ignoreMatch();return}}},a={$pattern:Ex,keyword:oN,literal:iN,built_in:sN,"variable.language":rN},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:[]},_={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},C={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},w={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},A={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,y]},q={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]},ye=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,_,C,w,A,{match:/\$\d+/},f];y.contains=ye.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(ye)});let he=[].concat(q,y.contains),Se=he.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(he)}]),pe={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:Se},Xe={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"}}]},je={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:{_:[...wx,...Sx]}},$e={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:[pe],illegal:/%/},wt={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Pt(G){return e.concat("(?!",G.join("|"),")")}let Mt={match:e.concat(/\b/,Pt([...Tx,"super","import","await"].map(G=>`${G}\\s*\\(`)),o,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},Je={begin:e.concat(/\./,e.lookahead(e.concat(o,/(?![0-9A-Za-z$_(])/))),end:o,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Ce={match:[/get|set/,/\s+/,o,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},pe]},P="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",K={match:[/const|var|let/,/\s+/,o,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(P)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[pe]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:Se,CLASS_REFERENCE:je},illegal:/#(?![$_A-Za-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),$e,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,_,C,w,A,q,{match:/\$\d+/},f,je,{scope:"attr",match:o+e.lookahead(":"),relevance:0},K,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[q,t.REGEXP_MODE,{className:"function",begin:P,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:Se}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:r},{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:[pe,t.inherit(t.TITLE_MODE,{begin:o,className:"title.function"})]},{match:/\.\.\./,relevance:0},Je,{match:"\\$"+o,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[pe]},Mt,wt,Xe,Ce,{match:/\$[(.]/}]}}var aN="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",cN={scope:"number",match:aN,relevance:0};function Mx(t){let e={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},o=["true","false","null"],i={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,i,cN,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Ix(t){let e=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},o={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},i={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}]},r={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 _=[n,c];return[l,d,f,y].forEach(Y=>{Y.contains=Y.contains.concat(_)}),_=_.concat(l,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:_},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:_}]}]},n,r,o,l,d,{className:"quote",begin:"^>\\s+",contains:_,end:"$"},i,c,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function kx(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),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),r=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":(Je,Ce)=>{Ce.data._beginMatch=Je[1]||Je[2]},"on:end":(Je,Ce)=>{Ce.data._beginMatch!==Je[1]&&Ce.ignoreMatch()}},y=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),_=`[
13
+ ]`,C={scope:"string",variants:[d,l,f,y]},w={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},A=["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"],q=["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"],he={keyword:Y,literal:(Je=>{let Ce=[];return Je.forEach(P=>{Ce.push(P),P.toLowerCase()===P?Ce.push(P.toUpperCase()):Ce.push(P.toLowerCase())}),Ce})(A),built_in:q},Se=Je=>Je.map(Ce=>Ce.replace(/\|\d+$/,"")),pe={variants:[{match:[/new/,e.concat(_,"+"),e.concat("(?!",Se(q).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},Xe=e.concat(o,"\\b(?!\\()"),je={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),Xe],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),Xe],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},$e={scope:"attr",match:e.concat(o,e.lookahead(":"),e.lookahead(/(?!::)/))},dt={relevance:0,begin:/\(/,end:/\)/,keywords:he,contains:[$e,s,je,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,C,w,pe]},wt={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",Se(Y).join("\\b|"),"|",Se(q).join("\\b|"),"\\b)"),o,e.concat(_,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[dt]};dt.contains.push(wt);let Pt=[$e,je,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,C,w,pe],Mt={begin:e.concat(/#\[\s*\\?/,e.either(i,r)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:A,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:A,keyword:["new","array"]},contains:["self",...Pt]},...Pt,{scope:"meta",variants:[{match:i},{match:r}]}]};return{case_insensitive:!1,keywords:he,contains:[Mt,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,wt,je,{match:[/const/,/\s/,o],scope:{1:"keyword",3:"variable.constant"}},pe,{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:he,contains:["self",Mt,s,je,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,C,w]}]},{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]},C,w]}}function Nx(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])*",_=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,C=`\\b|${o.join("|")}`,w={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${_}))[eE][+-]?(${y})[jJ]?(?=${C})`},{begin:`(${_})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${C})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${C})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${C})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${C})`},{begin:`\\b(${y})[jJ](?=${C})`}]},A={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,w,f,t.HASH_COMMENT_MODE]}]};return l.contains=[f,w,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[c,w,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,A,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:[w,Y,f]}]}}var qd="[A-Za-z$_][0-9A-Za-z$_]*",Ox=["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"],Ax=["true","false","null","undefined","NaN","Infinity"],Px=["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"],Rx=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Lx=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Fx=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],Vx=[].concat(Lx,Px,Rx);function lN(t){let e=t.regex,n=(G,{after:L})=>{let J="</"+G[0].slice(1);return G.input.indexOf(J,L)!==-1},o=qd,i={begin:"<>",end:"</>"},r=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(G,L)=>{let J=G[0].length+G.index,Re=G.input[J];if(Re==="<"||Re===","){L.ignoreMatch();return}Re===">"&&(n(G,{after:J})||L.ignoreMatch());let et,$t=G.input.substring(J);if(et=$t.match(/^\s*=/)){L.ignoreMatch();return}if((et=$t.match(/^\s+extends\s+/))&&et.index===0){L.ignoreMatch();return}}},a={$pattern:qd,keyword:Ox,literal:Ax,built_in:Vx,"variable.language":Fx},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:[]},_={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},C={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},w={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},A={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,y]},q={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]},ye=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,_,C,w,A,{match:/\$\d+/},f];y.contains=ye.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(ye)});let he=[].concat(q,y.contains),Se=he.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(he)}]),pe={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:Se},Xe={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"}}]},je={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:{_:[...Px,...Rx]}},$e={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:[pe],illegal:/%/},wt={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Pt(G){return e.concat("(?!",G.join("|"),")")}let Mt={match:e.concat(/\b/,Pt([...Lx,"super","import","await"].map(G=>`${G}\\s*\\(`)),o,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},Je={begin:e.concat(/\./,e.lookahead(e.concat(o,/(?![0-9A-Za-z$_(])/))),end:o,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Ce={match:[/get|set/,/\s+/,o,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},pe]},P="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",K={match:[/const|var|let/,/\s+/,o,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(P)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[pe]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:Se,CLASS_REFERENCE:je},illegal:/#(?![$_A-Za-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),$e,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,_,C,w,A,q,{match:/\$\d+/},f,je,{scope:"attr",match:o+e.lookahead(":"),relevance:0},K,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[q,t.REGEXP_MODE,{className:"function",begin:P,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:Se}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:r},{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:[pe,t.inherit(t.TITLE_MODE,{begin:o,className:"title.function"})]},{match:/\.\.\./,relevance:0},Je,{match:"\\$"+o,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[pe]},Mt,wt,Xe,Ce,{match:/\$[(.]/}]}}function jx(t){let e=t.regex,n=lN(t),o=qd,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],r={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},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:qd,keyword:Ox.concat(c),literal:Ax,built_in:Vx.concat(i),"variable.language":Fx},d={className:"meta",begin:"@"+o},f=(w,A,Y)=>{let q=w.contains.findIndex(ye=>ye.label===A);if(q===-1)throw new Error("can not find mode to replace");w.contains.splice(q,1,Y)};Object.assign(n.keywords,l),n.exports.PARAMS_CONTAINS.push(d);let y=n.contains.find(w=>w.scope==="attr"),_=Object.assign({},y,{match:e.concat(o,e.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,y,_]),n.contains=n.contains.concat([d,r,s,_]),f(n,"shebang",t.SHEBANG()),f(n,"use_strict",a);let C=n.contains.find(w=>w.label==="func.def");return C.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Bx(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,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},r={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(r,{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:[i]},{begin:/'/,end:/'/,contains:[i]},{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:[r,c,a,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[r,s,c,a]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{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 $x(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]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},r={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,i]},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"},_={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},C={begin:/\{/,end:/\}/,contains:[_],illegal:"\\n",relevance:0},w={begin:"\\[",end:"\\]",contains:[_],illegal:"\\n",relevance:0},A=[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},C,w,r,s],Y=[...A];return Y.pop(),Y.push(a),_.contains=Y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:A}}for(let[t,e]of Object.entries({bash:_x,css:bx,diff:xx,go:Cx,javascript:Dx,json:Mx,markdown:Ix,php:kx,python:Nx,typescript:jx,xml:Bx,yaml:$x}))Gd.registerLanguage(t,e);var dN={sh:"bash",shell:"bash",zsh:"bash",js:"javascript",mjs:"javascript",cjs:"javascript",jsx:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",tsx:"typescript",html:"xml",svg:"xml",md:"markdown",yml:"yaml"},uN={bash:"bash",cjs:"javascript",css:"css",diff:"diff",go:"go",html:"xml",js:"javascript",json:"json",jsx:"javascript",md:"markdown",mjs:"javascript",patch:"diff",php:"php",py:"python",sh:"bash",svg:"xml",ts:"typescript",tsx:"typescript",xml:"xml",yaml:"yaml",yml:"yaml",zsh:"bash"};function Ch(t){let e=t.split("/").pop()??"",n=e.lastIndexOf(".");if(!(n<=0))return uN[e.slice(n+1).toLowerCase()]}function Wd(t,e){let n=(e??"").trim().toLowerCase(),o=dN[n]??n;return o.length>0&&Gd.getLanguage(o)!==void 0?{html:Gd.highlight(t,{language:o,ignoreIllegals:!0}).value,language:o}:{html:pN(t),language:"text"}}function pN(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var fN="file:",mN="mention:",Sr="draft",_n=class t{morse=k(ht);items=O([]);active=O(void 0);tabs=this.items.asReadonly();activeId=this.active.asReadonly();mainTabs=E(()=>this.items().filter(e=>e.kind==="session"||e.mention!==!0));mentionTabs=E(()=>this.items().filter(e=>e.kind==="file"&&e.mention===!0));activeTab=E(()=>this.items().find(e=>e.id===this.active()));openSessionIds=E(()=>new Set(this.items().filter(e=>e.kind==="session").map(e=>e.id)));ensureSession(e){if(this.findSession(e.id)===void 0){this.items.update(o=>[...o,j({kind:"session"},e)]),this.active()===void 0&&this.active.set(e.id);return}this.refreshSession(e)}refreshSession(e){let n=this.findSession(e.id);n===void 0||n.title===e.title&&n.cwd===e.cwd||this.items.update(o=>o.map(i=>i.kind==="session"&&i.id===e.id?j(j({},i),e):i))}startDraft(e){this.openDraft(e),this.morse.newSession(e)}openDraft(e){this.items().find(o=>o.kind==="session"&&o.id===Sr)===void 0&&this.items.update(o=>[...o,{kind:"session",id:Sr,title:"New session",cwd:e,draft:!0}]),this.active.set(Sr)}focusSession(e){this.discardDraft(),this.showSession(e),this.morse.activateSession(e.id,e.cwd)}showSession(e){this.promoteDraft(e),this.ensureSession(e),this.active.set(e.id)}openFile(e){this.openFileTab(e,!1)}openMentionFile(e){this.openFileTab(e,!0)}openFileTab(e,n){let o=`${n?mN:fN}${e}`,i=this.items().find(r=>r.id===o);i===void 0&&this.items.update(r=>[...r,{kind:"file",id:o,path:e,title:gN(e),language:Ch(e),loading:!0,mention:n}]),this.active.set(o),(i===void 0||this.needsLoad(i))&&this.load(o)}select(e){let n=this.items().find(o=>o.id===e);if(n!==void 0){if(this.active.set(e),n.kind==="session"){this.morse.activateSession(n.id,n.cwd);return}this.needsLoad(n)&&this.load(e)}}close(e){let n=this.items().findIndex(a=>a.id===e);if(n===-1)return;let o=this.items()[n],i=this.active()===e,r=o.kind==="session"&&o.draft!==!0,s=o.kind==="session"?o.cwd:void 0;if(this.items.update(a=>a.filter(c=>c.id!==e)),i){let a=this.items(),c=a[Math.min(n,a.length-1)];c===void 0?this.active.set(void 0):this.select(c.id)}r&&this.fallBackToEmptySession(s)}forget(e){let n=this.items().findIndex(s=>s.id===e);if(n===-1)return;let o=this.active()===e;if(this.items.update(s=>s.filter(a=>a.id!==e)),!o)return;let i=this.items(),r=i[Math.min(n,i.length-1)];if(r===void 0){this.active.set(void 0);return}this.select(r.id)}clearActiveSession(){let e=this.items().find(n=>n.id===this.active());e!==void 0&&e.kind==="session"&&e.draft!==!0&&this.active.set(void 0)}closeOthers(e){let n=this.items().find(s=>s.id===e);if(n===void 0)return;let o=this.items().filter(s=>s.id!==e),i=o.some(s=>s.kind==="session"&&s.draft!==!0),r=o.find(s=>s.kind==="session")?.cwd;this.items.update(s=>s.filter(a=>a.id===e)),this.active.set(e),n.kind==="session"&&this.morse.activateSession(n.id,n.cwd),i&&this.fallBackToEmptySession(r)}closeToTheRight(e){let n=this.items().findIndex(c=>c.id===e);if(n===-1)return;let o=this.items().slice(n+1);if(o.length===0)return;let i=new Set(o.map(c=>c.id)),r=o.some(c=>c.kind==="session"&&c.draft!==!0),s=o.find(c=>c.kind==="session")?.cwd,a=this.active();this.items.update(c=>c.filter(l=>!i.has(l.id))),a!==void 0&&i.has(a)&&this.select(e),r&&this.fallBackToEmptySession(s)}closeAll(){let e=this.items().some(o=>o.kind==="session"&&o.draft!==!0),n=this.items().find(o=>o.kind==="session")?.cwd;this.items.set([]),this.active.set(void 0),e&&this.fallBackToEmptySession(n)}fallBackToEmptySession(e){this.items().some(n=>n.kind==="session")||this.morse.state().sessionId!==void 0&&this.morse.newSession(e??this.morse.state().workspace.cwd)}reload(e){this.load(e)}findSession(e){return this.items().find(n=>n.kind==="session"&&n.id===e)}promoteDraft(e){this.items().some(o=>o.kind==="session"&&o.id===Sr)&&this.items.update(o=>o.map(i=>i.kind==="session"&&i.id===Sr?j({kind:"session"},e):i))}discardDraft(){this.items().some(n=>n.kind==="session"&&n.id===Sr)&&this.items.update(n=>n.filter(o=>!(o.kind==="session"&&o.id===Sr)))}needsLoad(e){return e.kind==="file"&&!e.loading&&e.content===void 0&&e.error===void 0}async load(e){let n=this.items().find(r=>r.id===e);if(n===void 0||n.kind!=="file")return;this.patch(e,{loading:!0,error:void 0});let o=await this.morse.requestHostCommand("readFile",{path:n.path}),i=hN(o);if(i===void 0){this.patch(e,{loading:!1,error:"Could not read this file."});return}this.patch(e,{loading:!1,content:i.content,size:i.size,truncated:i.truncated,binary:i.binary,language:Ch(i.path)})}patch(e,n){this.items.update(o=>o.map(i=>i.id===e&&i.kind==="file"?j(j({},i),n):i))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=De({token:t,factory:t.\u0275fac,providedIn:"root"})};function hN(t){if(typeof t!="object"||t===null)return;let e=t,n=e.content,o=e.path;if(typeof n!="string"||typeof o!="string")return;let i=e.size;return{path:o,content:n,size:typeof i=="number"?i:n.length,truncated:e.truncated===!0,binary:e.binary===!0}}function gN(t){let e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function yN(t,e,n=80){let o=Math.floor(t-4-8);return Math.max(n,Math.min(e,o))}var Yd=class t{preferred=ee(320,{alias:"morsePopoverFit"});host=k(Bt);renderer=k(Ko).createRenderer(null,null);observer;constructor(){ei(()=>{this.fit();let e=this.anchor();e&&typeof ResizeObserver<"u"&&(this.observer=new ResizeObserver(()=>this.fit()),this.observer.observe(e))}),k(yt).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=yN(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=hr({type:t,selectors:[["","morsePopoverFit",""]],hostBindings:function(n,o){n&1&&R("resize",function(){return o.onWindowResize()},sm)},inputs:{preferred:[1,"morsePopoverFit","preferred"]}})};var cn=class t{morseEnter=ee(0);morseEnterY=ee(8);morseEnterDuration=ee(260);morseEnterScale=ee(void 0);element=k(Bt);animation=k(an);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=hr({type:t,selectors:[["","morseEnter",""]],inputs:{morseEnter:[1,"morseEnter"],morseEnterY:[1,"morseEnterY"],morseEnterDuration:[1,"morseEnterDuration"],morseEnterScale:[1,"morseEnterScale"]}})};var vN=["list"];function _N(t,e){t&1&&(g(0,"div",2),p(1,"Reading the workspace\u2026"),b())}function bN(t,e){if(t&1&&(g(0,"div",4),p(1),b()),t&2){let n=m(2);u(),ue("No match for \u201C",n.query(),"\u201D.")}}function xN(t,e){if(t&1){let n=H();g(0,"div",4),p(1," The host returned no workspace files. "),g(2,"button",5),R("click",function(){M(n);let i=m(2);return I(i.reload.emit())}),p(3,"Load again"),b()()}}function CN(t,e){if(t&1&&T(0,bN,2,1,"div",4)(1,xN,4,0,"div",4),t&2){let n=m();D(n.query().length>0?0:1)}}function EN(t,e){if(t&1){let n=H();g(0,"li")(1,"button",6),R("mouseenter",function(){let i=M(n).$index,r=m(2);return I(r.activeChange.emit(i))})("click",function(){let i=M(n).$implicit,r=m(2);return I(r.pick.emit(i))}),g(2,"span",7),p(3),b(),g(4,"span",8)(5,"span",9),p(6),b(),p(7),b()()()}if(t&2){let n=e.$implicit,o=e.$index,i=m(2);u(),de("active",o===i.active()),u(2),N(i.isDirectory(n)?"\u25B8":"\u25A4"),u(3),N(i.split(n).dir),u(),ue("",i.split(n).base," ")}}function wN(t,e){if(t&1&&(g(0,"ul",null,0),ce(2,EN,8,5,"li",null,ti),b()),t&2){let n=m();u(2),le(n.files())}}var Zd=class t{files=ee.required();busy=ee(!1);query=ee("");active=ee(0);pick=rt();close=rt();reload=rt();activeChange=rt();list=Qe("list");constructor(){se(()=>{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(),i=n.getBoundingClientRect();i.top<o.top?e.scrollTop-=o.top-i.top:i.bottom>o.bottom&&(e.scrollTop+=i.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 Eh(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ae({type:t,selectors:[["morse-file-picker"]],viewQuery:function(n,o){n&1&&ft(o.list,vN,5),n&2&&vt()},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,_N,2,0,"div",2)(2,CN,2,1)(3,wN,4,0,"ul"),g(4,"div",3)(5,"kbd"),p(6,"\u2191"),b(),g(7,"kbd"),p(8,"\u2193"),b(),p(9," move \xB7 "),g(10,"kbd"),p(11,"Enter"),b(),p(12," attach/open \xB7 "),g(13,"kbd"),p(14,"Esc"),b(),p(15," close "),b()()),n&2&&(W("morseEnter",0)("morseEnterY",6),u(),D(o.busy()&&o.files().length===0?1:o.files().length===0?2:3))},dependencies:[cn],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 Ux(t,e,n=50){let o=e.trim().toLowerCase();return t.map(i=>({file:i,score:o.length===0?0:SN(i,o)})).filter(i=>i.score<Number.POSITIVE_INFINITY).sort((i,r)=>Hx(i.file)-Hx(r.file)||i.score-r.score||i.file.length-r.file.length||i.file.localeCompare(r.file)).slice(0,n).map(i=>i.file)}function Eh(t){return t.endsWith("/")}function Hx(t){return Eh(t)?0:1}function SN(t,e){let n=(Eh(t)?t.slice(0,-1):t).toLowerCase(),o=n.lastIndexOf("/"),i=o===-1?n:n.slice(o+1);return i.startsWith(e)?0:i.includes(e)?1:n.startsWith(e)?2:n.includes(e)?3:Number.POSITIVE_INFINITY}var TN=["list"],DN=(t,e)=>e.id;function MN(t,e){if(t&1&&(g(0,"div",3),p(1),b()),t&2){let n=m(2);u(),ue("No command matches \u201C",n.query(),"\u201D.")}}function IN(t,e){t&1&&(g(0,"div",3),p(1,"No commands available in this session."),b())}function kN(t,e){if(t&1&&T(0,MN,2,1,"div",3)(1,IN,2,0,"div",3),t&2){let n=m();D(n.query().length>0?0:1)}}function NN(t,e){if(t&1&&(g(0,"span",5),p(1),b()),t&2){let n=m().$implicit;u(),N(n.icon)}}function ON(t,e){if(t&1&&(g(0,"span",8),p(1),b()),t&2){let n=m().$implicit;u(),N(n.description)}}function AN(t,e){if(t&1&&(g(0,"span",9),p(1),b()),t&2){let n=m().$implicit;u(),N(n.badge)}}function PN(t,e){if(t&1){let n=H();g(0,"li")(1,"button",4),R("mouseenter",function(){let i=M(n).$index,r=m(2);return I(r.activeChange.emit(i))})("pointerdown",function(i){return i.preventDefault()})("click",function(){let i=M(n).$implicit,r=m(2);return I(r.pick.emit(i.id))}),T(2,NN,2,1,"span",5),g(3,"span",6)(4,"span",7),p(5),b(),T(6,ON,2,1,"span",8),b(),T(7,AN,2,1,"span",9),b()()}if(t&2){let n=e.$implicit,o=e.$index,i=m(2);u(),de("active",o===i.active()),u(),D(n.icon?2:-1),u(3),N(n.label),u(),D(n.description?6:-1),u(),D(n.badge?7:-1)}}function RN(t,e){if(t&1&&(g(0,"ul",null,0),ce(2,PN,8,6,"li",null,DN),b()),t&2){let n=m();u(2),le(n.items())}}var Kd=class t{items=ee.required();query=ee("");active=ee(0);pick=rt();close=rt();activeChange=rt();list=Qe("list");constructor(){se(()=>{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(),i=n.getBoundingClientRect();i.top<o.top?e.scrollTop-=o.top-i.top:i.bottom>o.bottom&&(e.scrollTop+=i.bottom-o.bottom)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ae({type:t,selectors:[["morse-command-picker"]],viewQuery:function(n,o){n&1&&ft(o.list,TN,5),n&2&&vt()},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,kN,2,1)(2,RN,4,0,"ul"),g(3,"div",2)(4,"kbd"),p(5,"\u2191"),b(),g(6,"kbd"),p(7,"\u2193"),b(),p(8," move \xB7 "),g(9,"kbd"),p(10,"Enter"),b(),p(11," run \xB7 "),g(12,"kbd"),p(13,"Tab"),b(),p(14," insert \xB7 "),g(15,"kbd"),p(16,"Esc"),b(),p(17," close "),b()()),n&2&&(W("morseEnter",0)("morseEnterY",6),u(),D(o.items().length===0?1:2))},dependencies:[cn],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 zx(t,e,n=50){let o=e.trim().toLowerCase();return o.length===0?t.slice(0,n):t.map(i=>({item:i,score:LN(i,o)})).filter(i=>i.score<Number.POSITIVE_INFINITY).sort((i,r)=>i.score-r.score||i.item.label.length-r.item.label.length).slice(0,n).map(i=>i.item)}function LN(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 FN=["card"],VN=(t,e)=>e.id;function jN(t,e){t&1&&(v(0,"p",5),p(1),x()),t&2&&(u(),N(e))}function BN(t,e){t&1&&(v(0,"span",16),p(1,"required"),x())}function $N(t,e){if(t&1){let n=H();v(0,"textarea",19),U("input",function(i){M(n);let r=m().$implicit,s=m();return I(s.setValue(r.id,i))})("keydown",function(i){M(n);let r=m(2);return I(r.onSubmitKey(i))}),x()}if(t&2){let n=m().$implicit,o=m();ve("value",o.value(n.id)),oe("aria-label",n.label)}}function HN(t,e){if(t&1){let n=H();v(0,"input",20),U("input",function(i){M(n);let r=m().$implicit,s=m();return I(s.setValue(r.id,i))})("keydown.enter",function(i){M(n);let r=m(2);return I(r.submit(i))}),x()}if(t&2){let n=m().$implicit,o=m();ve("value",o.value(n.id)),oe("aria-label",n.label)}}function UN(t,e){if(t&1&&(v(0,"label",7)(1,"span",8),p(2),T(3,BN,2,0,"span",16),x(),T(4,$N,1,2,"textarea",17)(5,HN,1,2,"input",18),x()),t&2){let n=e.$implicit;u(2),ue(" ",n.label," "),u(),D(n.required?3:-1),u(),D(n.index===void 0?4:5)}}var Qd=class t{request=ee.required();submitted=rt();cancelled=rt();card=Qe("card");values=O({});extra=O("");preview=E(()=>Lb(this.request().form,this.values(),this.extra()));ready=E(()=>this.request().form.arguments.every(e=>!e.required||(this.values()[e.id]??"").trim().length>0));constructor(){se(()=>{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(i=>Q(j({},i),{[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=ae({type:t,selectors:[["morse-prompt-template-dialog"]],viewQuery:function(n,o){n&1&&ft(o.card,FN,5),n&2&&vt()},hostBindings:function(n,o){n&1&&R("keydown.escape",function(){return o.onEscape()},Dt)},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&&(v(0,"div",1),U("click",function(){return o.cancelled.emit()}),v(1,"div",2,0),U("click",function(r){return r.stopPropagation()}),v(3,"header",3)(4,"h2",4),p(5),x(),T(6,jN,2,1,"p",5),x(),v(7,"div",6),ce(8,UN,6,3,"label",7,VN),v(10,"label",7)(11,"span",8),p(12," Additional instructions "),v(13,"span",9),p(14,"optional \xB7 appended below the template"),x()(),v(15,"textarea",10),U("input",function(r){return o.setExtra(r)})("keydown",function(r){return o.onSubmitKey(r)}),x()(),v(16,"div",11)(17,"span",8),p(18,"Preview"),x(),v(19,"pre",12),p(20),x()(),v(21,"div",13)(22,"button",14),U("click",function(){return o.cancelled.emit()}),p(23,"Cancel"),x(),v(24,"button",15),U("click",function(){return o.submit()}),p(25,"Send"),x()()()()()),n&2){let i;u(5),ue("/",o.request().name),u(),D((i=o.request().description)?6:-1,i),u(2),le(o.request().form.arguments),u(7),ve("value",o.extra()),u(5),N(o.preview()),u(4),ve("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 ao(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 Gx(t,e){let n=t?.[e];return typeof n=="number"?ao(n):"\u2014"}function wh(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 Sh(t){if(!(t===void 0||t<=0))return`$${t.toFixed(3)}`}function Th(t){let e=[],n=t.usage;if(n){n.inputTokens>0&&e.push(`\u2191${ao(n.inputTokens)}`),n.outputTokens>0&&e.push(`\u2193${ao(n.outputTokens)}`),n.cacheReadTokens&&e.push(`R${ao(n.cacheReadTokens)}`),n.cacheWriteTokens&&e.push(`W${ao(n.cacheWriteTokens)}`);let r=wh(n);r!==void 0&&e.push(`CH${r.toFixed(1)}%`)}let o=Sh(t.costUsd);o&&e.push(o);let i=t.contextUsage;if(i){let r=i.percent!==null?`${i.percent.toFixed(1)}%`:"?";e.push(`${r}/${ao(i.contextWindow)}`)}return e.join(" ")}var zN=["search"],GN=["list"],qN=(t,e)=>e.provider,WN=(t,e)=>e.index;function YN(t,e){if(t&1&&(g(0,"div",10),p(1),b()),t&2){let n=m();u(),ue("No model matches \u201C",n.filter(),"\u201D.")}}function ZN(t,e){t&1&&(g(0,"span",15),p(1),b()),t&2&&(u(),N(e))}function KN(t,e){t&1&&(g(0,"span",16),p(1,"\u2713"),b())}function QN(t,e){if(t&1){let n=H();g(0,"button",13),R("mouseenter",function(){let i=M(n).$implicit,r=m(4);return I(r.active.set(i.index))})("click",function(){let i=M(n).$implicit,r=m(4);return I(r.pick.emit(i.model))}),g(1,"span",14),p(2),b(),T(3,ZN,2,1,"span",15),T(4,KN,2,0,"span",16),b()}if(t&2){let n,o=e.$implicit,i=m(4);de("active",o.index===i.active())("selected",i.keyOf(o.model)===i.current()),W("title",i.keyOf(o.model)),oe("aria-current",i.keyOf(o.model)===i.current()?"true":null),u(2),N(o.model.name),u(),D((n=i.context(o.model))?3:-1,n),u(),D(i.keyOf(o.model)===i.current()?4:-1)}}function XN(t,e){if(t&1&&(g(0,"div",11),p(1),b(),ce(2,QN,5,9,"button",12,WN)),t&2){let n=m().$implicit;u(),N(n.provider),u(),le(n.rows)}}function JN(t,e){if(t&1&&T(0,XN,4,1),t&2){let n=e.$implicit;D(n.rows.length>0?0:-1)}}function eO(t,e){if(t&1&&ce(0,JN,1,1,null,null,qN),t&2){let n=m();le(n.groups())}}function tO(t,e){let n=e.trim().toLowerCase(),o=new Map;for(let i of t){if(n.length>0&&!`${i.provider} ${i.id} ${i.name}`.toLowerCase().includes(n))continue;let r=o.get(i.provider);r?r.push(i):o.set(i.provider,[i])}return[...o].map(([i,r])=>({provider:i,models:r}))}var Xd=class t{models=ee.required();current=ee("");pick=rt();close=rt();host=k(Bt);search=Qe("search");list=Qe("list");filter=O("");active=O(0);groups=E(()=>{let e=0;return tO(this.models(),this.filter()).map(n=>({provider:n.provider,rows:n.models.map(o=>({model:o,index:e++}))}))});visible=E(()=>this.groups().flatMap(e=>e.rows.map(n=>n.model)));constructor(){ei(()=>this.search()?.nativeElement.focus()),se(()=>{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)}),se(()=>{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(),i=n.getBoundingClientRect(),r=e.querySelector(".group")?.offsetHeight??0,s=o.top+r;i.top<s?e.scrollTop-=s-i.top:i.bottom>o.bottom&&(e.scrollTop+=i.bottom-o.bottom)}keyOf(e){return`${e.provider}/${e.id}`}context(e){return e.contextWindow?ao(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=ae({type:t,selectors:[["morse-model-picker"]],viewQuery:function(n,o){n&1&&ft(o.search,zN,5)(o.list,GN,5),n&2&&vt(2)},hostBindings:function(n,o){n&1&&R("pointerdown",function(r){return o.onDocumentPointerdown(r)},Dt)},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),kt(),g(3,"svg",5),xe(4,"circle",6)(5,"path",7),b()(),gn(),g(6,"input",8,0),R("input",function(r){return o.onFilter(r)})("keydown",function(r){return o.onKeydown(r)}),b()(),g(8,"div",9,1),T(10,YN,2,1,"div",10)(11,eO,2,0),b()()),n&2&&(W("morseEnter",0)("morseEnterY",6),u(6),W("value",o.filter()),u(4),D(o.visible().length===0?10:11))},dependencies:[cn],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 nO=["brain"],oO=["halo"];function iO(t,e){if(t&1&&(kt(),Fe(0,"path")),t&2){let n=e.$implicit;oe("d",n)}}function rO(t,e){t&1&&Fe(0,"span",3,1)}function sO(t,e){t&1&&Fe(0,"span",4,1)}var aO=["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"],cO={off:0,minimal:1,low:2,medium:3,high:4,xhigh:5,max:6};function lO(t){return cO[t]??2}function dO(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 Jd=class t{level=ee.required();bumped=ee(!1);host=k(Bt);animation=k(an);brain=Qe("brain");halos=f_("halo");stoppers=[];paths=aO;intensity=E(()=>lO(this.level()));constructor(){se(()=>{let e=this.level(),n=this.brain()?.nativeElement,o=this.halos().map(r=>r.nativeElement);if(this.stopLoops(),!n||!this.animation.isEnabled)return;let i=dO(e);this.stoppers.push(this.animation.loop(n,i.params,{duration:i.duration,delay:i.delay??0,ease:i.ease??"inOut(2)"})),i.halo&&o.forEach((r,s)=>{this.stoppers.push(this.animation.loop(r,{scale:[.72,1.9],opacity:[.55,0]},{duration:i.halo.duration,delay:(i.halo.delay??0)+s*i.halo.duration*.5,ease:"out(2)",alternate:!1}))})}),se(()=>{this.bumped()&&this.animation.pop(this.host.nativeElement,{scale:1.3,duration:420})}),k(yt).onDestroy(()=>this.stopLoops())}stopLoops(){for(let e of this.stoppers)e();this.stoppers=[]}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ae({type:t,selectors:[["morse-brain"]],viewQuery:function(n,o){n&1&&ft(o.brain,nO,5)(o.halos,oO,5),n&2&&vt(2)},hostVars:3,hostBindings:function(n,o){n&2&&(oe("data-level",o.level()),de("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&&(kt(),v(0,"svg",2,0),ce(2,iO,1,1,":svg:path",null,ti),x(),T(4,rO,2,0,"span",3),T(5,sO,2,0,"span",4)),n&2&&(u(2),le(o.paths),u(2),D(o.intensity()>=3?4:-1),u(),D(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 uO=["panel"];function pO(t,e){t&1&&(g(0,"span",10),p(1,"\u2713"),b())}function fO(t,e){if(t&1){let n=H();g(0,"button",8),R("mouseenter",function(){let i=M(n).$index,r=m(2);return I(r.active.set(i))})("click",function(){let i=M(n).$implicit,r=m(2);return I(r.choose(i))}),xe(1,"morse-brain",2),g(2,"span",9),p(3),b(),T(4,pO,2,0,"span",10),b()}if(t&2){let n=e.$implicit,o=e.$index,i=m(2);de("active",o===i.active())("selected",n===i.current()),oe("aria-selected",n===i.current()),u(),W("level",n),u(2),N(n),u(),D(n===i.current()?4:-1)}}function mO(t,e){if(t&1){let n=H();g(0,"div",6,0),R("keydown",function(i){M(n);let r=m();return I(r.onKeydown(i))}),ce(2,fO,5,8,"button",7,ti),b()}if(t&2){let n=m();W("morseEnter",0)("morseEnterY",6),u(2),le(n.levels())}}var eu=class t{levels=ee.required();current=ee.required();pick=rt();host=k(Bt);shortcuts=k(so);destroyRef=k(yt);panel=Qe("panel");open=O(!1);active=O(0);bumped=O(!1);constructor(){let e=this.shortcuts.bind("thinking.pick",()=>this.toggle(),()=>this.levels().length>0);this.destroyRef.onDestroy(e),se(()=>{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=ae({type:t,selectors:[["morse-thinking-picker"]],viewQuery:function(n,o){n&1&&ft(o.panel,uO,5),n&2&&vt()},hostBindings:function(n,o){n&1&&R("pointerdown",function(r){return o.onDocumentPointerdown(r)},Dt)},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),R("click",function(){return o.toggle()}),xe(1,"morse-brain",2),g(2,"span",3),p(3),b(),g(4,"span",4),p(5,"\u25BE"),b()(),T(6,mO,4,2,"div",5)),n&2&&(W("title","Thinking level: "+o.current()),oe("aria-expanded",o.open()),u(),W("level",o.current()),u(2),N(o.current()),u(3),D(o.open()?6:-1))},dependencies:[cn,Jd],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 hO(t,e){t&1&&(v(0,"span"),p(1),x()),t&2&&(u(),ue(" \xB7 ",e))}function gO(t,e){if(t&1&&(v(0,"section")(1,"h4"),p(2,"Last assistant message"),x(),v(3,"div",13)(4,"div",14)(5,"span",15),p(6,"Input"),x(),v(7,"span",16),p(8),x()(),v(9,"div",14)(10,"span",15),p(11,"Output"),x(),v(12,"span",16),p(13),x()(),v(14,"div",14)(15,"span",15),p(16,"Reasoning"),x(),v(17,"span",16),p(18),x()(),v(19,"div",14)(20,"span",15),p(21,"Cache read"),x(),v(22,"span",16),p(23),x()(),v(24,"div",14)(25,"span",15),p(26,"Cache write"),x(),v(27,"span",16),p(28),x()(),v(29,"div",14)(30,"span",15),p(31,"Cache hit"),x(),v(32,"span",16),p(33),x()()()()),t&2){let n=m(2);u(8),N(n.lastValue("inputTokens")),u(5),N(n.lastValue("outputTokens")),u(5),N(n.lastValue("reasoningTokens")),u(5),N(n.lastValue("cacheReadTokens")),u(5),N(n.lastValue("cacheWriteTokens")),u(5),N(n.cacheHitLabel())}}function yO(t,e){if(t&1){let n=H();v(0,"button",5),U("click",function(){M(n);let i=m();return I(i.close())}),x(),v(1,"div",6)(2,"header")(3,"h3"),p(4,"Context"),x(),v(5,"button",7),U("click",function(){M(n);let i=m();return I(i.close())}),p(6,"\xD7"),x()(),v(7,"div",8),p(8),T(9,hO,2,1,"span"),x(),v(10,"div",9)(11,"span"),p(12,"Context"),x(),v(13,"span"),p(14),x()(),v(15,"div",10),Fe(16,"span",11),x(),v(17,"div",12)(18,"span"),p(19),x()(),v(20,"div",13)(21,"div",14)(22,"span",15),p(23,"Messages"),x(),v(24,"span",16),p(25),x()(),v(26,"div",14)(27,"span",15),p(28,"User"),x(),v(29,"span",16),p(30),x()(),v(31,"div",14)(32,"span",15),p(33,"Assistant"),x(),v(34,"span",16),p(35),x()(),v(36,"div",14)(37,"span",15),p(38,"Tool calls"),x(),v(39,"span",16),p(40),x()(),v(41,"div",14)(42,"span",15),p(43,"Cost"),x(),v(44,"span",16),p(45),x()(),v(46,"div",14)(47,"span",15),p(48,"Output limit"),x(),v(49,"span",16),p(50),x()()(),T(51,gO,34,6,"section"),v(52,"section")(53,"h4"),p(54,"Session totals"),x(),v(55,"div",17),p(56),x()()()}if(t&2){let n,o=m();u(8),ue(" ",o.modelLabel()),u(),D((n=o.sessionTitle())?9:-1,n),u(5),xi("",o.usedLabel()," / ",o.limitLabel()),u(2),fn("width",o.fillPercent(),"%"),de("warn",o.level()==="warn")("danger",o.level()==="danger"),u(3),ue("",o.percentLabel()," used"),u(6),N(o.counts()?.totalMessages??"\u2014"),u(5),N(o.counts()?.userMessages??"\u2014"),u(5),N(o.counts()?.assistantMessages??"\u2014"),u(5),N(o.counts()?.toolCalls??"\u2014"),u(5),N(o.costLabel()),u(5),N(o.outputLimitLabel()),u(),D(o.lastUsage()?51:-1),u(5),N(o.sessionLine()||"No usage yet.")}}var vO=15.5,qx=2*Math.PI*vO,tu=class t{usage=ee();lastUsage=ee();costUsd=ee();contextUsage=ee();counts=ee();model=ee();sessionTitle=ee();open=O(!1);circumference=qx;percent=E(()=>this.contextUsage()?.percent??void 0);percentLabel=E(()=>{let e=this.contextUsage()?.percent;return e==null?"\u2013":`${e.toFixed(1)}%`});level=E(()=>{let e=this.percent()??0;return e>90?"danger":e>70?"warn":"ok"});fillPercent=E(()=>Math.min(100,Math.max(0,this.percent()??0)));dashOffset=E(()=>qx*(1-this.fillPercent()/100));usedLabel=E(()=>{let e=this.contextUsage()?.tokens;return e==null?"\u2014":ao(e)});limitLabel=E(()=>{let e=this.contextUsage()?.contextWindow;return e===void 0?"\u2014":ao(e)});costLabel=E(()=>Sh(this.costUsd())??"\u2014");outputLimitLabel=E(()=>{let e=this.model()?.maxTokens;return e===void 0?"\u2014":ao(e)});modelLabel=E(()=>this.model()?.name??this.model()?.id??"no model");tooltip=E(()=>{let e=[`Context ${this.percentLabel()} \xB7 ${this.usedLabel()} / ${this.limitLabel()}`],n=Th({usage:this.usage(),costUsd:this.costUsd(),contextUsage:this.contextUsage()});return n.length>0&&e.push(n),e.join(`
14
+ `)});sessionLine=E(()=>Th({usage:this.usage(),costUsd:this.costUsd(),contextUsage:this.contextUsage()}));cacheHitLabel=E(()=>{let e=wh(this.lastUsage());return e===void 0?"\u2014":`${e.toFixed(1)}%`});lastValue(e){return Gx(this.lastUsage(),e)}toggle(){this.open.update(e=>!e)}close(){this.open.set(!1)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ae({type:t,selectors:[["morse-usage-indicator"]],hostBindings:function(n,o){n&1&&R("keydown.escape",function(){return o.close()},Dt)},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&&(v(0,"button",0),U("click",function(){return o.toggle()}),kt(),v(1,"svg",1),Fe(2,"circle",2)(3,"circle",3),x(),gn(),v(4,"span",4),p(5),x()(),T(6,yO,57,19)),n&2&&(ve("title",o.tooltip()),oe("aria-expanded",o.open()),u(),de("warn",o.level()==="warn")("danger",o.level()==="danger"),u(2),oe("stroke-dasharray",o.circumference)("stroke-dashoffset",o.dashOffset()),u(2),N(o.percentLabel()),u(),D(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 _O=["promptInput"],bO=["fileInput"],Wx=(t,e)=>e.id;function xO(t,e){if(t&1){let n=H();g(0,"button",25),R("click",function(){M(n);let i=m();return I(i.attachSelection())}),p(1," \u29C9 "),b()}}function CO(t,e){t&1&&p(0," add files \xB7 @ to mention \xB7 / for commands ")}function EO(t,e){t&1&&p(0," upload or drop files \xB7 / for commands ")}function wO(t,e){t&1&&p(0," drop files here \xB7 / for commands ")}function SO(t,e){if(t&1){let n=H();g(0,"morse-file-picker",26),R("activeChange",function(i){M(n);let r=m();return I(r.mentionActive.set(i))})("pick",function(i){M(n);let r=m();return I(r.onPickFile(i))})("reload",function(){M(n);let i=m();return I(i.reloadFiles())})("close",function(){M(n);let i=m();return I(i.onPickerClose())}),b()}if(t&2){let n=m();W("morsePopoverFit",300)("files",n.pickerMatches())("busy",n.loadingFiles())("query",n.pickerFilter())("active",n.mentionActive())}}function TO(t,e){if(t&1){let n=H();g(0,"morse-command-picker",27),R("activeChange",function(i){M(n);let r=m();return I(r.paletteActive.set(i))})("pick",function(i){M(n);let r=m();return I(r.activatePalette(i,"run"))})("close",function(){M(n);let i=m();return I(i.onPaletteClose())}),b()}if(t&2){let n=m();W("morsePopoverFit",320)("items",n.paletteItems())("query",n.paletteFilter())("active",n.paletteActive())}}function DO(t,e){if(t&1){let n=H();g(0,"li",28)(1,"button",30),R("click",function(){M(n);let i=m(2);return I(i.lockLive())}),g(2,"span",31),p(3,"\u29C9"),b(),g(4,"span",32),p(5),b(),g(6,"span",33),p(7),b()(),g(8,"button",34),R("click",function(){M(n);let i=m(2);return I(i.dismissLive())}),p(9," \xD7 "),b()()}if(t&2){let n=e,o=m(2);W("morseEnter",0)("morseEnterY",6)("morseEnterScale",.55)("morseEnterDuration",320),u(),W("title",o.lockLiveLabel()),oe("aria-label","Lock the "+n.path+" selection as a pin"),u(3),W("title",n.path),u(),N(n.path),u(2),N(o.pinRange(n)),u(),oe("aria-label","Dismiss the "+n.path+" selection preview")}}function MO(t,e){if(t&1){let n=H();g(0,"li",29),xe(1,"img",35),g(2,"span",32),p(3),b(),g(4,"button",36),R("click",function(){let i=M(n).$implicit,r=m(2);return I(r.removeImage(i.id))}),p(5," \xD7 "),b()()}if(t&2){let n=e.$implicit,o=e.$index,i=m(2);W("morseEnter",i.chipOffset()+o)("morseEnterY",6)("morseEnterScale",.55)("morseEnterDuration",320),u(),W("src",i.preview(n),bo)("alt",n.name),u(),W("title",n.name),u(),N(n.name),u(),oe("aria-label","Remove "+n.name)}}function IO(t,e){if(t&1&&(g(0,"span",33),p(1),b()),t&2){let n=m().$implicit,o=m(2);u(),N(o.pinRange(n))}}function kO(t,e){if(t&1){let n=H();g(0,"li",29)(1,"button",30),R("click",function(){let i=M(n).$implicit,r=m(2);return I(r.openPinPreview(i))}),g(2,"span",31),p(3,"\u29C9"),b(),g(4,"span",37),p(5),b(),T(6,IO,2,1,"span",33),b(),g(7,"button",36),R("click",function(){let i=M(n).$implicit,r=m(2);return I(r.removePin(i.id))}),p(8," \xD7 "),b()()}if(t&2){let n=e.$implicit,o=e.$index,i=m(2);W("morseEnter",i.chipOffset()+i.images().length+o)("morseEnterY",6)("morseEnterScale",.55)("morseEnterDuration",320),u(),W("title","Open "+n.path+" in the preview"),u(4),N(n.path),u(),D(n.startLine!==void 0?6:-1),u(),oe("aria-label","Unpin "+n.path)}}function NO(t,e){if(t&1&&(g(0,"ul",11),T(1,DO,10,10,"li",28),ce(2,MO,6,9,"li",29,Wx),ce(4,kO,9,8,"li",29,Wx),b()),t&2){let n,o=m();u(),D((n=o.livePreview())?1:-1,n),u(),le(o.images()),u(2),le(o.pins())}}function OO(t,e){if(t&1&&(g(0,"span",39),p(1),b()),t&2){let n=m(2);u(),xi(" \u2193",n.streamedTokens()," \xB7 ",n.tokensPerSecond()??0," t/s ")}}function AO(t,e){if(t&1&&(g(0,"span",41),xe(1,"span",43),g(2,"span"),p(3),b(),g(4,"span",44),xe(5,"i")(6,"i")(7,"i"),b()()),t&2){let n=m(2);u(3),ue("Working ",n.elapsed())}}function PO(t,e){if(t&1&&xe(0,"morse-usage-indicator",42),t&2){let n=m(2);W("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 RO(t,e){if(t&1&&(g(0,"div",13)(1,"div",38),T(2,OO,2,2,"span",39),b(),g(3,"div",40),T(4,AO,8,1,"span",41),T(5,PO,1,7,"morse-usage-indicator",42),b()()),t&2){let n=m();u(2),D(n.running()?2:-1),u(2),D(n.running()?4:-1),u(),D(n.showUsage()?5:-1)}}function LO(t,e){if(t&1&&(g(0,"span",17),p(1),b()),t&2){let n=e;W("title",n),u(),N(n)}}function FO(t,e){if(t&1){let n=H();g(0,"morse-model-picker",45),R("pick",function(i){M(n);let r=m();return I(r.onModelPick(i))})("close",function(){M(n);let i=m();return I(i.closeModelPicker())}),b()}if(t&2){let n=m();W("morsePopoverFit",340)("models",n.models())("current",n.modelKey())}}function VO(t,e){if(t&1){let n=H();g(0,"button",46),R("click",function(){M(n);let i=m();return I(i.sendWith("steer"))}),p(1,"Steer"),b(),g(2,"button",46),R("click",function(){M(n);let i=m();return I(i.sendWith("followUp"))}),p(3,"Follow up"),b(),g(4,"button",47),R("click",function(){M(n);let i=m();return I(i.abort())}),p(5,"\u25A0"),b()}}function jO(t,e){if(t&1){let n=H();g(0,"button",48),R("click",function(){M(n);let i=m();return I(i.sendWith("new"))}),p(1," \u2191 "),b()}if(t&2){let n=m();W("disabled",!n.canSend())}}function BO(t,e){if(t&1){let n=H();g(0,"morse-prompt-template-dialog",49),R("submitted",function(i){M(n);let r=m();return I(r.onTemplateSubmit(i))})("cancelled",function(){M(n);let i=m();return I(i.closeTemplate())}),b()}t&2&&W("request",e)}var nu=class t{morse=k(ht);shell=k(Zt);shortcuts=k(so);destroyRef=k(yt);attachments=k(Ho);workspace=k(jd);tabs=k(_n);uploads=k(Es);promptInput=Qe("promptInput");fileInput=Qe("fileInput");text=O("");connected=E(()=>this.morse.connection()==="ready");agentReady=this.morse.agentReady;agentStarting=this.morse.agentStarting;agentError=this.morse.agentError;streaming=E(()=>this.morse.state().streaming);canSend=E(()=>this.connected()&&!this.agentStarting()&&this.agentError()===void 0);canAttachSelection=E(()=>this.morse.capabilities()?.editorContext===!0);thinkingLevel=E(()=>this.morse.state().thinkingLevel);models=this.morse.availableModels;levels=this.morse.availableThinkingLevels;modelKey=E(()=>{let e=this.morse.state().model;return e?`${e.provider}/${e.id}`:""});usageState=this.morse.state;showUsage=E(()=>{let e=this.morse.state();return e.usage!==void 0||e.contextUsage!==void 0});showStatusRow=E(()=>this.running()||this.showUsage());streamedTokens=E(()=>Math.round(Math.max(0,Dh(this.morse.items())-this.baseline())/4));tokensPerSecond=O(void 0);baseline=O(0);throughput=[];images=this.attachments.images;pins=this.attachments.pins;openPinPreview(e){this.morse.capabilities()?.filePreview&&this.tabs.openMentionFile(e.path)}livePreview=this.attachments.livePreview;chipOffset=E(()=>this.livePreview()?1:0);lockLiveLabel=E(()=>this.livePreview()?"Lock this selection \u2014 it stops following the editor; a new selection makes a new chip.":"");pickerOpen=O(!1);workspaceFiles=this.workspace.files;loadingFiles=this.workspace.busy;mentionMode=O(!1);pickerFilter=O("");pickerMatches=E(()=>Ux(this.workspaceFiles(),this.pickerFilter()));mentionActive=O(0);canPickFiles=this.workspace.available;canUpload=this.uploads.available;paletteOpen=O(!1);paletteFilter=O("");paletteActive=O(0);templateRequest=O(void 0);availableCommands=this.morse.availableCommands;paletteItems=E(()=>{let e=[...Yx.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 zx(e,this.paletteFilter())});modelPickerOpen=O(!1);currentModel=this.morse.model;currentProvider=E(()=>this.morse.model()?.provider??"");modelLabel=E(()=>{let e=this.morse.model();return e?`${e.provider} \xB7 ${e.name}`:"no model"});canAddFiles=E(()=>this.canPickFiles()||this.canUpload()||this.canAttachSelection());addFilesLabel=E(()=>this.canPickFiles()?"Add files to the prompt":this.canUpload()?"Upload files to the prompt":"Attach the active editor selection");running=E(()=>this.morse.state().streaming||this.morse.state().busy);elapsed=E(()=>{this.tick();let e=this.startedAt(),n=e===null?0:Date.now()-e;return n<1e3?"":UO(n)});startedAt=O(null);tick=O(0);constructor(){let e=this.shortcuts.bind("model.pick",()=>this.toggleModelPicker(),()=>this.models().length>0);this.destroyRef.onDestroy(e),se(()=>{if(this.attachments.mentions().length===0)return;let i=this.attachments.takeMentions().map(s=>s.startsWith("@")?s:`@${s}`).join(`
15
+ `);this.text.update(s=>s.trim().length===0?i:`${s.trimEnd()}
16
+ ${i}`),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??[])}),se(n=>{if(!this.running()){this.startedAt.set(null),this.tokensPerSecond.set(void 0),this.throughput.length=0;return}this.startedAt.update(i=>i??Date.now()),this.baseline.set(Po(()=>Dh(this.morse.items())));let o=setInterval(()=>{this.tick.update(i=>i+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=HO(n);if(o!==void 0){this.text.set(""),this.shell.requestCompact(o);return}let i=$O(n);if(i){this.text.set(""),this.runBuiltin(i);return}let r=this.attachments.images(),s=this.attachments.pins();if(n.length===0&&r.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 i=this.text();o.value=i,o.focus(),o.setSelectionRange(i.length,i.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(i=>i.type.startsWith("image/")),o.filter(i=>!i.type.startsWith("image/")))}async importFiles(e,n){let o=await this.attachments.accept(e),i=n.length>0?await this.uploads.upload(n):{added:[],failed:[]};this.attachments.addMentions(i.added.map(a=>a.path));let r=[];o.attached>0&&r.push(`${o.attached} image${o.attached===1?"":"s"} attached`),i.added.length>0&&r.push(`${i.added.length} file${i.added.length===1?"":"s"} uploaded`);let s=[...o.skipped,...i.failed];if(s.length>0&&r.push(`could not attach ${s.join(", ")}`),r.length>0){let a=o.attached===0&&i.added.length===0;this.attachments.say(a?"warn":"info",r.join(" \xB7 "))}}refreshMentionQuery(e,n){if(!this.canPickFiles())return;let o=e.slice(0,n??e.length),i=/(?:^|\s)@([\w./-]*)$/.exec(o);if(!i){this.mentionMode()&&(this.pickerOpen.set(!1),this.mentionMode.set(!1));return}i[1]!==this.pickerFilter()&&this.mentionActive.set(0),this.mentionMode.set(!0),this.pickerFilter.set(i[1]??""),this.pickerOpen.set(!0),this.workspace.ensureLoaded()}refreshPaletteQuery(e,n){let o=e.slice(0,n??e.length),i=/(?:^|\n)\s*\/([\w:-]*)$/.exec(o);if(!i){this.paletteOpen()&&this.paletteOpen.set(!1);return}i[1]!==this.paletteFilter()&&this.paletteActive.set(0),this.paletteFilter.set(i[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 i=this.availableCommands().find(r=>r.name===o);if(i?.template!==void 0){let r=Rb(i.template);if(r!==void 0){this.stripSlashToken(),this.text.set(""),this.closePalette(),this.openTemplate({name:o,description:i.description,form:r});return}this.stripSlashToken(),this.text.set(""),this.closePalette(),this.sendTemplate(fh(i.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.tabs.startDraft(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")}pinRange(e){return e.startLine===void 0?"":e.endLine!==void 0&&e.endLine!==e.startLine?`L${e.startLine}-${e.endLine}`:`L${e.startLine}`}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.morse.capabilities()?.filePreview&&this.tabs.openMentionFile(e),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=Dh(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 i=n-o.at;if(i<500)return;let r=(e-o.chars)/4;this.tokensPerSecond.set(Math.max(0,Math.round(r/i*1e4)/10))}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ae({type:t,selectors:[["morse-chat-composer"]],viewQuery:function(n,o){n&1&&ft(o.promptInput,_O,5)(o.fileInput,bO,5),n&2&&vt(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,"chip-name"],[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),R("click",function(){return o.onAddFiles()}),p(4," + "),b(),g(5,"input",6,0),R("change",function(r){return o.onFilesChosen(r)}),b(),T(7,xO,2,0,"button",7),g(8,"span",8),T(9,CO,1,0)(10,EO,1,0)(11,wO,1,0),b()(),T(12,SO,1,5,"morse-file-picker",9),T(13,TO,1,4,"morse-command-picker",10),T(14,NO,6,1,"ul",11),g(15,"textarea",12,1),R("input",function(r){return o.onInput(r)})("keydown",function(r){return o.onKeydown(r)})("paste",function(r){return o.onPaste(r)}),b(),T(17,RO,6,3,"div",13),g(18,"div",14)(19,"div",15)(20,"button",16),R("pointerdown",function(r){return r.stopPropagation()})("click",function(){return o.toggleModelPicker()}),T(21,LO,2,2,"span",17),g(22,"span",18),p(23),b(),g(24,"span",19),p(25,"\u25BE"),b()(),T(26,FO,1,3,"morse-model-picker",20),g(27,"morse-thinking-picker",21),R("pick",function(r){return o.onThinkingPick(r)}),b()(),g(28,"div",22),T(29,VO,6,0)(30,jO,2,1,"button",23),b()()(),T(31,BO,1,1,"morse-prompt-template-dialog",24),b()),n&2){let i,r;u(3),W("disabled",!o.canAddFiles())("title",o.addFilesLabel()),oe("aria-label",o.addFilesLabel())("aria-expanded",o.pickerOpen()),u(4),D(o.canAttachSelection()?7:-1),u(2),D(o.canPickFiles()?9:o.canUpload()?10:11),u(3),D(o.pickerOpen()?12:-1),u(),D(o.paletteOpen()?13:-1),u(),D(o.images().length>0||o.pins().length>0||o.livePreview()!==null?14:-1),u(),W("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),D(o.showStatusRow()?17:-1),u(3),W("disabled",o.models().length===0)("title",o.modelLabel()),oe("aria-expanded",o.modelPickerOpen()),u(),D((i=o.currentProvider())?21:-1,i),u(2),N(o.currentModel()?.name||"no model"),u(3),D(o.modelPickerOpen()?26:-1),u(),W("levels",o.levels())("current",o.thinkingLevel()),u(2),D(o.streaming()?29:30),u(2),D((r=o.templateRequest())?31:-1,r)}},dependencies:[cn,Zd,tu,Kd,Xd,eu,Qd,Yd],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}}"]})},Yx=[{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 $O(t){let e=/^\/([\w-]+)$/.exec(t);if(e)return Yx.some(n=>n.name===e[1])?e[1]:void 0}function HO(t){return/^\/compact\s+([\s\S]+)$/.exec(t)?.[1]?.trim()||void 0}function UO(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 Dh(t){let e=0;for(let n of t)n.kind==="assistant"&&(e+=(n.text??"").length+(n.thinking??"").length);return e}var Zx="morse.chat.toolDisplay";function zO(t){return t==="timeline"||t==="compact"}function GO(){try{let t=globalThis.localStorage?.getItem(Zx);return zO(t)?t:"compact"}catch{return"compact"}}function qO(t){try{globalThis.localStorage?.setItem(Zx,t)}catch{}}var Ts=class t{toolDisplaySignal=O(GO());toolDisplay=this.toolDisplaySignal.asReadonly();setToolDisplay(e){this.toolDisplaySignal.set(e),qO(e)}toggleToolDisplay(){this.setToolDisplay(this.toolDisplaySignal()==="compact"?"timeline":"compact")}static \u0275fac=function(n){return new(n||t)};static \u0275prov=De({token:t,factory:t.\u0275fac,providedIn:"root"})};function WO(t,e){if(t&1&&(v(0,"div",8),p(1),x()),t&2){let n=m();ve("title",n.workspace().cwd),u(),N(e)}}function YO(t,e){if(t&1&&(v(0,"span",12),p(1),x()),t&2){let n=m();u(),N(n.statusLabel())}}function ZO(t,e){t&1&&(kt(),v(0,"svg",3),Fe(1,"path",17),x())}function KO(t,e){t&1&&(kt(),v(0,"svg",3),Fe(1,"path",18),x())}var ou=class t{morse=k(ht);shell=k(Zt);display=k(Ts);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=E(()=>this.display.toolDisplay()==="compact");status=E(()=>{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=E(()=>{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=E(()=>{let e=this.connectionDetail();return e?`${this.statusLabel()} \xB7 ${e}`:this.statusLabel()});title=E(()=>this.state().sessionTitle||this.workspace().name||"Morse");meta=E(()=>{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=ae({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&&(v(0,"header",0)(1,"button",1),U("click",function(){return o.toggleNavigation()}),p(2," \u2630 "),x(),v(3,"button",2),U("click",function(){return o.toggleSidebar()}),kt(),v(4,"svg",3),Fe(5,"rect",4)(6,"path",5),x()(),gn(),v(7,"div",6)(8,"div",7),p(9),x(),T(10,WO,2,2,"div",8),x(),v(11,"div",9)(12,"span",10),Fe(13,"span",11),T(14,YO,2,1,"span",12),x(),v(15,"button",13),U("click",function(){return o.toggleToolDisplay()}),T(16,ZO,2,0,":svg:svg",3)(17,KO,2,0,":svg:svg",3),x(),v(18,"button",14),U("click",function(){return o.compact()}),kt(),v(19,"svg",3),Fe(20,"path",15)(21,"path",16),x()()()()),n&2){let i;u(),oe("aria-expanded",o.navigationOpen()),u(2),ve("title",o.collapsed()?"Show the sidebar":"Hide the sidebar"),oe("aria-label",o.collapsed()?"Show the sidebar":"Hide the sidebar")("aria-expanded",!o.collapsed()),u(5),ve("title",o.state().sessionId??o.workspace().cwd),u(),N(o.title()),u(),D((i=o.meta())?10:-1,i),u(2),de("online",o.status()==="ready")("busy",o.status()==="starting")("failed",o.status()==="error"||o.status()==="closed"),ve("title",o.statusTitle()),u(2),D(o.status()!=="ready"?14:-1),u(),ve("title",o.compactTools()?"Tool calls: compact \u2014 click for the legacy timeline":"Tool calls: legacy timeline \u2014 click for the compact tree"),oe("aria-label","Tool call display: "+(o.compactTools()?"compact":"timeline"))("aria-pressed",o.compactTools()),u(),D(o.compactTools()?16:17),u(2),ve("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 Xx(t){let e=[],n=[],o=()=>{n.length!==0&&(e.push({kind:"process",key:`process-${n[0]?.key??e.length}`,steps:n}),n=[])};for(let i of t){if(i.kind==="tool"){n.push({kind:"tool",key:i.id,item:i});continue}if(i.kind==="assistant"){let r=i.thinking.trim();r.length>0&&n.push({kind:"thinking",key:`${i.id}:thinking`,item:i}),i.text.trim().length>0||i.streaming?(o(),e.push({kind:"assistant",key:i.id,item:i})):r.length===0&&o();continue}o(),i.kind==="user"?e.push({kind:"user",key:i.id,item:i}):i.kind==="notice"?e.push({kind:"notice",key:i.id,item:i}):i.kind==="compaction"&&e.push({kind:"compaction",key:i.id,item:i})}return o(),e}function Jx(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 QO=/(^|\s)@([^\s:]+(?::\d+(?:-\d+)?)?)(?=$|\s)/g;function XO(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),i=/^(\d+)(?:-(\d+))?$/.exec(o);if(n.length===0||!i)return;let r=Number(i[1]),s=i[2]===void 0?r:Number(i[2]);return{path:n,startLine:r,endLine:s}}function eC(t){let e;return t.split(`
17
+ `).map(n=>{let o=/^\s*(`{3,}|~{3,})/.exec(n);if(o){let i=o[1]?.charAt(0)??"";return e===void 0?e=i:i===e&&(e=void 0),n}return e===void 0?JO(n):n}).join(`
18
+ `)}function JO(t){let e="",n=0;for(;n<t.length;){let o=t.indexOf("`",n);if(o===-1){e+=Kx(t.slice(n));break}e+=Kx(t.slice(n,o));let i=t.indexOf("`",o+1);if(i===-1){e+=t.slice(o);break}e+=t.slice(o,i+1),n=i+1}return e}function Kx(t){return t.replace(QO,(e,n,o)=>{let i=XO(o);if(!i)return e;let r=eA(i.path),s=i.startLine===void 0?`@${r}`:`@${r}:${i.startLine}-${i.endLine}`,a=Qx(i.path),c=i.startLine===void 0?"":` data-mention-start="${i.startLine}" data-mention-end="${i.endLine}"`;return`${n}<span class="mention" data-mention-path="${a}" title="${a}"${c}><span class="mention-label">${Qx(s)}</span></span>`})}function eA(t){let e=t.replace(/[\\/]+$/,""),n=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return n===-1?e:e.slice(n+1)}function Qx(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function tA(t,e){this.v=t,this.k=e}function tC(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 nA(t){if(Array.isArray(t))return t}function oA(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var o,i,r,s,a=[],c=!0,l=!1;try{if(r=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=r.call(n)).done)&&(a.push(o.value),a.length!==e);c=!0);}catch(d){l=!0,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}function iA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
19
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rA(t,e){return nA(t)||oA(t,e)||sA(t,e)||iA()}function sA(t,e){if(t){if(typeof t=="string")return tC(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)?tC(t,e):void 0}}function iu(t){var e,n;function o(r,s){try{var a=t[r](s),c=a.value,l=c instanceof tA;Promise.resolve(l?c.v:c).then(function(d){if(l){var f=r==="return"&&c.k?r:"next";if(!c.k||d.done)return o(f,d);d=t[f](d).value}i(!!a.done,d)},function(d){o("throw",d)})}catch(d){i(2,d)}}function i(r,s){r===2?e.reject(s):e.resolve({value:s,done:r}),(e=e.next)?o(e.key,e.arg):n=null}this._invoke=function(r,s){return new Promise(function(a,c){var l={key:r,arg:s,resolve:a,reject:c,next:null};n?n=n.next=l:(e=n=l,o(r,s))})},typeof t.return!="function"&&(this.return=void 0)}iu.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},iu.prototype.next=function(t){return this._invoke("next",t)},iu.prototype.throw=function(t){return this._invoke("throw",t)},iu.prototype.return=function(t){return this._invoke("return",t)};var gC=Object.entries,nC=Object.setPrototypeOf,aA=Object.isFrozen,cA=Object.getPrototypeOf,lA=Object.getOwnPropertyDescriptor,on=Object.freeze,ln=Object.seal,Ds=Object.create,yC=typeof Reflect<"u"&&Reflect,Ph=yC.apply,Rh=yC.construct;on||(on=function(e){return e});ln||(ln=function(e){return e});Ph||(Ph=function(e,n){for(var o=arguments.length,i=new Array(o>2?o-2:0),r=2;r<o;r++)i[r-2]=arguments[r];return e.apply(n,i)});Rh||(Rh=function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return new e(...o)});var Tr=Kt(Array.prototype.forEach);Array.prototype.indexOf;var dA=Kt(Array.prototype.lastIndexOf),oC=Kt(Array.prototype.pop),ec=Kt(Array.prototype.push);Array.prototype.slice;var uA=Kt(Array.prototype.splice),Ms=Array.isArray,oc=Kt(String.prototype.toLowerCase),Mh=Kt(String.prototype.toString),iC=Kt(String.prototype.match),tc=Kt(String.prototype.replace),rC=Kt(String.prototype.indexOf),pA=Kt(String.prototype.trim),fA=Kt(Number.prototype.toString),mA=Kt(Boolean.prototype.toString),sC=typeof BigInt>"u"?null:Kt(BigInt.prototype.toString),aC=typeof Symbol>"u"?null:Kt(Symbol.prototype.toString),An=Kt(Object.prototype.hasOwnProperty),nc=Kt(Object.prototype.toString),bn=Kt(RegExp.prototype.test),Ni=hA(TypeError);function Kt(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return Ph(t,e,o)}}function hA(t){return function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return Rh(t,n)}}function st(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:oc;if(nC&&nC(t,null),!Ms(e))return t;let o=e.length;for(;o--;){let i=e[o];if(typeof i=="string"){let r=n(i);r!==i&&(aA(e)||(e[o]=r),i=r)}t[i]=!0}return t}function gA(t){for(let e=0;e<t.length;e++)An(t,e)||(t[e]=null);return t}function zn(t){let e=Ds(null);for(let o of gC(t)){var n=rA(o,2);let i=n[0],r=n[1];An(t,i)&&(Ms(r)?e[i]=gA(r):r&&typeof r=="object"&&r.constructor===Object?e[i]=zn(r):e[i]=r)}return e}function yA(t){switch(typeof t){case"string":return t;case"number":return fA(t);case"boolean":return mA(t);case"bigint":return sC?sC(t):"0";case"symbol":return aC?aC(t):"Symbol()";case"undefined":return nc(t);case"function":case"object":{if(t===null)return nc(t);let e=t,n=co(e,"toString");if(typeof n=="function"){let o=n(e);return typeof o=="string"?o:nc(o)}return nc(t)}default:return nc(t)}}function co(t,e){for(;t!==null;){let o=lA(t,e);if(o){if(o.get)return Kt(o.get);if(typeof o.value=="function")return Kt(o.value)}t=cA(t)}function n(){return null}return n}function vA(t){try{return bn(t,""),!0}catch{return!1}}var cC=on(["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"]),Ih=on(["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"]),kh=on(["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"]),_A=on(["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"]),Nh=on(["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"]),bA=on(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),lC=on(["#text"]),dC=on(["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"]),Oh=on(["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"]),uC=on(["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"]),ru=on(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),xA=ln(/{{[\w\W]*|^[\w\W]*}}/g),CA=ln(/<%[\w\W]*|^[\w\W]*%>/g),EA=ln(/\${[\w\W]*/g),wA=ln(/^data-[\-\w.\u00B7-\uFFFF]+$/),SA=ln(/^aria-[\-\w]+$/),pC=ln(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),TA=ln(/^(?:\w+script|data):/i),DA=ln(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),MA=ln(/^html$/i),IA=ln(/^[a-z][.\w]*(-[.\w]+)+$/i),fC=ln(/<[/\w!]/g),mC=ln(/<[/\w]/g),kA=ln(/<\/no(script|embed|frames)/i),NA=ln(/\/>/i),Un={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},vC=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],OA=on(st({},vC)),AA=(function(){let t={};return Tr(vC,e=>{t[e]=ln(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),on(t)})(),PA=function(){return typeof window>"u"?null:window},RA=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let o=null,i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(o=n.getAttribute(i));let r="dompurify"+(o?"#"+o:"");try{return e.createPolicy(r,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},hC=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Oi=function(e,n,o,i){return An(e,n)&&Ms(e[n])?st(i.base?zn(i.base):{},e[n],i.transform):o},Ah=function(e,n,o){let i=An(e,n)?e[n]:void 0;return i&&typeof i=="object"?zn(i):o()};function _C(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:PA(),e=$=>_C($);if(e.version="3.4.16",e.removed=[],!t||!t.document||t.document.nodeType!==Un.document||!t.Element)return e.isSupported=!1,e;let n=t.document,o=n,i=o.currentScript;t.DocumentFragment;let r=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=co(f,"cloneNode"),_=co(f,"remove"),C=co(f,"removeAttributeNode"),w=co(f,"nextSibling"),A=co(f,"childNodes"),Y=co(f,"parentNode"),q=co(f,"shadowRoot"),ye=co(f,"attributes"),he=s&&s.prototype?co(s.prototype,"nodeType"):null,Se=s&&s.prototype?co(s.prototype,"nodeName"):null,pe=s&&s.prototype?co(s.prototype,"ownerDocument"):null,Xe=function(h){return he?he(h):h.nodeType},je=function(h){return Se?Se(h):h.nodeName};if(typeof r=="function"){let $=n.createElement("template");$.content&&$.content.ownerDocument&&(n=$.content.ownerDocument)}let $e,dt="",wt,Pt=!1,Mt=0,Je=function(){if(Mt>0)throw Ni('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.')},Ce=function(h){Je(),Mt++;try{return $e.createHTML(h)}finally{Mt--}},P=function(h){Je(),Mt++;try{return $e.createScriptURL(h)}finally{Mt--}},K=function(){return Pt||(wt=RA(d,i),Pt=!0),wt},G=n,L=G.implementation,J=G.createNodeIterator,Re=G.createDocumentFragment,et=G.getElementsByTagName,$t=o.importNode,_e=hC();e.isSupported=typeof gC=="function"&&typeof Y=="function"&&L&&L.createHTMLDocument!==void 0;let _t=xA,ze=CA,rn=EA,Ht=wA,Ze=SA,Gt=TA,Rt=DA,Pe=IA,qe=pC,Te=null,ot=st({},[...cC,...Ih,...kh,...Nh,...lC]),ie=null,lt=st({},[...dC,...Oh,...uC,...ru]),Z=Object.seal(Ds(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}})),gt=null,Ke=null,ne=Object.seal(Ds(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),xt=!0,be=!0,at=!1,Ge=!0,F=!1,B=!0,X=!1,re=!1,ut=null,St=null,qn=!1,hn=!1,wo=!1,So=!1,lc=!0,dc=!1,kr="user-content-",Pi=!0,Ps=!1,Qt={},To=null,Rs=st({},["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"]),uc=null,Ri=st({},["audio","video","img","source","image","track"]),Ls=null,Fs=st({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),sn="http://www.w3.org/1998/Math/MathML",di="http://www.w3.org/2000/svg",Ne="http://www.w3.org/1999/xhtml",Lt=Ne,pc=!1,Nr=null,hE=st({},[sn,di,Ne],Mh),Wh=on(["mi","mo","mn","ms","mtext"]),Au=st({},Wh),Yh=on(["annotation-xml"]),Pu=st({},Yh),gE=st({},["title","style","font","a","script"]),Vs=null,yE=["application/xhtml+xml","text/html"],vE="text/html",Ut=null,Or=null,_E=n.createElement("form"),Zh=function(h){return h instanceof RegExp||h instanceof Function},Ru=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Or&&Or===h)return;(!h||typeof h!="object")&&(h={}),h=zn(h),Vs=yE.indexOf(h.PARSER_MEDIA_TYPE)===-1?vE:h.PARSER_MEDIA_TYPE,Ut=Vs==="application/xhtml+xml"?Mh:oc,Te=Oi(h,"ALLOWED_TAGS",ot,{transform:Ut}),ie=Oi(h,"ALLOWED_ATTR",lt,{transform:Ut}),Nr=Oi(h,"ALLOWED_NAMESPACES",hE,{transform:Mh}),Ls=Oi(h,"ADD_URI_SAFE_ATTR",Fs,{transform:Ut,base:Fs}),uc=Oi(h,"ADD_DATA_URI_TAGS",Ri,{transform:Ut,base:Ri}),To=Oi(h,"FORBID_CONTENTS",Rs,{transform:Ut}),gt=Oi(h,"FORBID_TAGS",zn({}),{transform:Ut}),Ke=Oi(h,"FORBID_ATTR",zn({}),{transform:Ut}),Qt=An(h,"USE_PROFILES")?h.USE_PROFILES&&typeof h.USE_PROFILES=="object"?zn(h.USE_PROFILES):h.USE_PROFILES:!1,xt=h.ALLOW_ARIA_ATTR!==!1,be=h.ALLOW_DATA_ATTR!==!1,at=h.ALLOW_UNKNOWN_PROTOCOLS||!1,Ge=h.ALLOW_SELF_CLOSE_IN_ATTR!==!1,F=h.SAFE_FOR_TEMPLATES||!1,B=h.SAFE_FOR_XML!==!1,X=h.WHOLE_DOCUMENT||!1,hn=h.RETURN_DOM||!1,wo=h.RETURN_DOM_FRAGMENT||!1,So=h.RETURN_TRUSTED_TYPE||!1,qn=h.FORCE_BODY||!1,lc=h.SANITIZE_DOM!==!1,dc=h.SANITIZE_NAMED_PROPS||!1,Pi=h.KEEP_CONTENT!==!1,Ps=h.IN_PLACE||!1,qe=vA(h.ALLOWED_URI_REGEXP)?h.ALLOWED_URI_REGEXP:pC,Lt=typeof h.NAMESPACE=="string"?h.NAMESPACE:Ne,Au=Ah(h,"MATHML_TEXT_INTEGRATION_POINTS",()=>st({},Wh)),Pu=Ah(h,"HTML_INTEGRATION_POINTS",()=>st({},Yh));let S=Ah(h,"CUSTOM_ELEMENT_HANDLING",()=>Ds(null));if(Z=Ds(null),An(S,"tagNameCheck")&&Zh(S.tagNameCheck)&&(Z.tagNameCheck=S.tagNameCheck),An(S,"attributeNameCheck")&&Zh(S.attributeNameCheck)&&(Z.attributeNameCheck=S.attributeNameCheck),An(S,"allowCustomizedBuiltInElements")&&typeof S.allowCustomizedBuiltInElements=="boolean"&&(Z.allowCustomizedBuiltInElements=S.allowCustomizedBuiltInElements),ln(Z),F&&(be=!1),wo&&(hn=!0),Qt&&(Te=st({},lC),ie=Ds(null),Qt.html===!0&&(st(Te,cC),st(ie,dC)),Qt.svg===!0&&(st(Te,Ih),st(ie,Oh),st(ie,ru)),Qt.svgFilters===!0&&(st(Te,kh),st(ie,Oh),st(ie,ru)),Qt.mathMl===!0&&(st(Te,Nh),st(ie,uC),st(ie,ru))),ne.tagCheck=null,ne.attributeCheck=null,An(h,"ADD_TAGS")&&(typeof h.ADD_TAGS=="function"?ne.tagCheck=h.ADD_TAGS:Ms(h.ADD_TAGS)&&(Te===ot&&(Te=zn(Te)),st(Te,h.ADD_TAGS,Ut))),An(h,"ADD_ATTR")&&(typeof h.ADD_ATTR=="function"?ne.attributeCheck=h.ADD_ATTR:Ms(h.ADD_ATTR)&&(ie===lt&&(ie=zn(ie)),st(ie,h.ADD_ATTR,Ut))),An(h,"ADD_FORBID_CONTENTS")&&Ms(h.ADD_FORBID_CONTENTS)&&(To===Rs&&(To=zn(To)),st(To,h.ADD_FORBID_CONTENTS,Ut)),Pi&&(Te["#text"]=!0),X&&st(Te,["html","head","body"]),Te.table&&(st(Te,["tbody"]),delete gt.tbody),h.TRUSTED_TYPES_POLICY){if(typeof h.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ni('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof h.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ni('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let V=$e;$e=h.TRUSTED_TYPES_POLICY;try{dt=Ce("")}catch(z){throw $e=V,z}}else h.TRUSTED_TYPES_POLICY===null?($e=void 0,dt=""):($e===void 0&&($e=K()),$e&&typeof dt=="string"&&(dt=Ce("")));on&&on(h),Or=h},Kh=st({},[...Ih,...kh,..._A]),Qh=st({},[...Nh,...bA]),bE=function(h,S,V){return S.namespaceURI===Ne?h==="svg":S.namespaceURI===sn?h==="svg"&&(V==="annotation-xml"||Au[V]):!!Kh[h]},xE=function(h,S,V){return S.namespaceURI===Ne?h==="math":S.namespaceURI===di?h==="math"&&Pu[V]:!!Qh[h]},CE=function(h,S,V){return S.namespaceURI===di&&!Pu[V]||S.namespaceURI===sn&&!Au[V]?!1:!Qh[h]&&(gE[h]||!Kh[h])},EE=function(h){let S=Y(h);(!S||!S.tagName)&&(S={namespaceURI:Lt,tagName:"template"});let V=oc(h.tagName),z=oc(S.tagName);return Nr[h.namespaceURI]?h.namespaceURI===di?bE(V,S,z):h.namespaceURI===sn?xE(V,S,z):h.namespaceURI===Ne?CE(V,S,z):!!(Vs==="application/xhtml+xml"&&Nr[h.namespaceURI]):!1},ui=function(h){ec(e.removed,{element:h});try{Y(h).removeChild(h)}catch{if(_(h),!Y(h))throw Ni("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Xh=function(h,S,V){try{C(h,S)}catch{try{h.removeAttribute(V)}catch{}}},fc=function(h){mc(h);let S=A(h);if(S){let z=[];Tr(S,fe=>{ec(z,fe)}),Tr(z,fe=>{try{_(fe)}catch{}})}let V=ye(h);if(V)for(let z=V.length-1;z>=0;--z){let fe=V[z],We=fe&&fe.name;typeof We=="string"&&Xh(h,fe,We)}},Li=function(h,S,V){if(!V)try{V=S.getAttributeNode(h)}catch{V=null}ec(e.removed,{attribute:V||null,from:S});try{V?C(S,V):S.removeAttribute(h)}catch{try{S.removeAttribute(h)}catch{}}if(h==="is")if(hn||wo)try{ui(S)}catch{}else try{S.setAttribute(h,"")}catch{}},wE=function(h){let S=ye(h);if(S)for(let V=S.length-1;V>=0;--V){let z=S[V],fe=z&&z.name;typeof fe!="string"||ie[Ut(fe)]||Xh(h,z,fe)}},mc=function(h){let S=[h];for(;S.length>0;){let V=S.pop();Xe(V)===Un.element&&wE(V);let z=A(V);if(z)for(let fe=z.length-1;fe>=0;--fe)S.push(z[fe])}},Jh=function(h,S){return B?h==="patchsrc"?!0:h==="for"&&S!=="label"&&S!=="output":!1},SE=function(h){if(!B)return;let S=[h];for(;S.length>0;){let V=S.pop(),z=Xe(V);if(z===Un.processingInstruction||z===Un.comment&&bn(mC,V.data)){try{_(V)}catch{}continue}if(z===Un.element){let We=V,tt=Ut(je(V));try{We.hasAttribute&&We.hasAttribute("patchsrc")&&We.removeAttribute("patchsrc"),We.hasAttribute&&We.hasAttribute("for")&&Jh("for",tt)&&We.removeAttribute("for")}catch{}}let fe=A(V);if(fe)for(let We=fe.length-1;We>=0;--We)S.push(fe[We])}},eg=function(h){let S=null,V=null;if(qn)h="<remove></remove>"+h;else{let We=iC(h,/^[\r\n\t ]+/);V=We&&We[0]}Vs==="application/xhtml+xml"&&Lt===Ne&&(h='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+h+"</body></html>");let z=$e?Ce(h):h;if(Lt===Ne)try{S=new l().parseFromString(z,Vs)}catch{}if(!S||!S.documentElement){S=L.createDocument(Lt,"template",null);try{S.documentElement.innerHTML=pc?dt:z}catch{}}let fe=S.body||S.documentElement;return h&&V&&fe.insertBefore(n.createTextNode(V),fe.childNodes[0]||null),Lt===Ne?et.call(S,X?"html":"body")[0]:X?S.documentElement:fe},tg=function(h){let S=pe?pe(h):h.ownerDocument;return J.call(S||h,h,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},hc=function(h){return h=tc(h,_t," "),h=tc(h,ze," "),h=tc(h,rn," "),h},Lu=function(h){var S;h.normalize();let V=pe?pe(h):h.ownerDocument,z=J.call(V||h,h,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),fe=z.nextNode();for(;fe;)fe.data=hc(fe.data),fe=z.nextNode();let We=(S=h.querySelectorAll)===null||S===void 0?void 0:S.call(h,"template");We&&Tr(We,tt=>{Ar(tt.content)&&Lu(tt.content)})},gc=function(h){let S=Se?Se(h):null;return typeof S!="string"||Ut(S)!=="form"?!1:typeof h.nodeName!="string"||typeof h.textContent!="string"||typeof h.removeChild!="function"||h.attributes!==ye(h)||typeof h.removeAttribute!="function"||typeof h.removeAttributeNode!="function"||typeof h.getAttributeNode!="function"||typeof h.setAttribute!="function"||typeof h.namespaceURI!="string"||typeof h.insertBefore!="function"||typeof h.hasChildNodes!="function"||h.nodeType!==he(h)||h.childNodes!==A(h)},Ar=function(h){if(!he||typeof h!="object"||h===null)return!1;try{return he(h)===Un.documentFragment}catch{return!1}},js=function(h){if(!he||typeof h!="object"||h===null)return!1;try{return typeof he(h)=="number"}catch{return!1}};function Do($,h,S){$.length!==0&&Tr($,V=>{V.call(e,h,S,Or)})}let TE=function(h,S){return!!(B&&h.hasChildNodes()&&!js(h.firstElementChild)&&bn(fC,h.textContent)&&bn(fC,h.innerHTML)||B&&h.namespaceURI===Ne&&OA[S]&&(js(h.firstElementChild)||typeof h.textContent=="string"&&bn(AA[S],h.textContent))||h.nodeType===Un.processingInstruction||B&&h.nodeType===Un.comment&&bn(mC,h.data))},yc=function(h,S){if(h instanceof RegExp)return bn(h,S);if(h instanceof Function){for(var V=arguments.length,z=new Array(V>2?V-2:0),fe=2;fe<V;fe++)z[fe-2]=arguments[fe];return!!h(S,...z)}return!1},DE=function(h,S,V){if(!gt[S]&&rg(S)&&yc(Z.tagNameCheck,S))return!1;if(Pi&&!To[S]){let z=Y(h),fe=A(h);if(fe&&z){let We=fe.length;for(let tt=We-1;tt>=0;--tt){let Ft=h===V?y(fe[tt],!0):fe[tt];z.insertBefore(Ft,w(h))}}}return ui(h),!0},ng=function(h,S,V,z){return h.length===0?S:S===V||S===z?zn(S):S},Pr=function(h,S){return h===S||Y(h)!==null?!1:(Ps&&mc(h),!0)},og=function(h,S){if(Do(_e.beforeSanitizeElements,h,null),Pr(h,S))return!0;if(gc(h))return ui(h),!0;let V=Ut(je(h));if(Te=ng(_e.uponSanitizeElement,Te,ot,ut),Do(_e.uponSanitizeElement,h,{tagName:V,allowedTags:Te}),Pr(h,S))return!0;if(TE(h,V))return ui(h),!0;if(gt[V]||!(ne.tagCheck instanceof Function&&ne.tagCheck(V))&&!Te[V]){let z=DE(h,V,S);return z===!1&&(Do(_e.afterSanitizeElements,h,null),Pr(h,S))?!0:z}if(Xe(h)===Un.element&&!EE(h)||(V==="noscript"||V==="noembed"||V==="noframes")&&bn(kA,h.innerHTML))return ui(h),!0;if(F&&h.nodeType===Un.text){let z=hc(h.textContent);h.textContent!==z&&(ec(e.removed,{element:h.cloneNode()}),h.textContent=z)}return Do(_e.afterSanitizeElements,h,null),Pr(h,S)},ig=function(h,S,V){if(Ke[S]||Jh(S,h)||lc&&(S==="id"||S==="name")&&(V in n||V in _E))return!1;let z=ie[S]||ne.attributeCheck instanceof Function&&ne.attributeCheck(S,h);return be&&bn(Ht,S)||xt&&bn(Ze,S)?!0:z?Ls[S]||bn(qe,tc(V,Rt,""))||(S==="src"||S==="xlink:href"||S==="href")&&h!=="script"&&rC(V,"data:")===0&&uc[h]||at&&!bn(Gt,tc(V,Rt,""))?!0:!V:rg(h)&&yc(Z.tagNameCheck,h)&&yc(Z.attributeNameCheck,S,h)||S==="is"&&Z.allowCustomizedBuiltInElements&&yc(Z.tagNameCheck,V)},ME=st({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),rg=function(h){return!ME[oc(h)]&&bn(Pe,h)},IE=function(h,S,V,z){if($e&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!V)switch(d.getAttributeType(h,S)){case"TrustedHTML":return Ce(z);case"TrustedScriptURL":return P(z)}return z},kE=function(h,S,V,z){try{return V?h.setAttributeNS(V,S,z):h.setAttribute(S,z),gc(h)?(ui(h),!1):!0}catch{return Li(S,h),!1}},sg=function(h,S){if(Do(_e.beforeSanitizeAttributes,h,null),Pr(h,S))return;let V=h.attributes;if(!V||gc(h))return;ie=ng(_e.uponSanitizeAttribute,ie,lt,St);let z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ie,forceKeepAttr:void 0},fe=V.length,We=Ut(h.nodeName);for(;fe--;){let tt=V[fe],Ft=tt.name,Wn=tt.namespaceURI,Pn=tt.value,Rr=Ut(Ft),Vu=Pn,xn=Ft==="value"?Vu:pA(Vu),ag=!1;if(z.attrName=Rr,z.attrValue=xn,z.keepAttr=!0,z.forceKeepAttr=void 0,Do(_e.uponSanitizeAttribute,h,z),xn=z.attrValue,dc&&(Rr==="id"||Rr==="name")&&rC(xn,kr)!==0&&(Li(Ft,h,tt),xn=kr+xn,ag=!0),B&&bn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,xn)){Li(Ft,h,tt);continue}if(Rr==="attributename"&&iC(xn,"href")){Li(Ft,h,tt);continue}if(!z.forceKeepAttr){if(!z.keepAttr){Li(Ft,h,tt);continue}if(!Ge&&bn(NA,xn)){Li(Ft,h,tt);continue}if(F&&(xn=hc(xn)),!ig(We,Rr,xn)){Li(Ft,h,tt);continue}xn=IE(We,Rr,Wn,xn),xn!==Vu&&kE(h,Ft,Wn,xn)&&ag&&oC(e.removed)}}Do(_e.afterSanitizeAttributes,h,null),Pr(h,S)},vc=function(h){let S=null,V=tg(h);for(Do(_e.beforeSanitizeShadowDOM,h,null);S=V.nextNode();)if(Do(_e.uponSanitizeShadowNode,S,null),og(S,h),sg(S,h),Ar(S.content)&&vc(S.content),Xe(S)===Un.element){let z=q(S);Ar(z)&&(Fu(z),vc(z))}Do(_e.afterSanitizeShadowDOM,h,null)},Fu=function(h){let S=[{node:h,shadow:null}];for(;S.length>0;){let V=S.pop();if(V.shadow){vc(V.shadow);continue}let z=V.node,fe=Xe(z)===Un.element,We=A(z);if(We)for(let tt=We.length-1;tt>=0;--tt)S.push({node:We[tt],shadow:null});if(fe){let tt=Se?Se(z):null;if(typeof tt=="string"&&Ut(tt)==="template"){let Ft=z.content;Ar(Ft)&&S.push({node:Ft,shadow:null})}}if(fe){let tt=q(z);Ar(tt)&&S.push({node:null,shadow:tt},{node:tt,shadow:null})}}};return e.sanitize=function($){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=null,V=null,z=null,fe=null;if(pc=!$,pc&&($="<!-->"),typeof $!="string"&&!js($)&&($=yA($),typeof $!="string"))throw Ni("dirty is not a string, aborting");if(!e.isSupported)return $;re?(Te=ut,ie=St):Ru(h),(_e.uponSanitizeElement.length>0||_e.uponSanitizeAttribute.length>0)&&(Te=zn(Te)),_e.uponSanitizeAttribute.length>0&&(ie=zn(ie)),e.removed=[];let We=Ps&&typeof $!="string"&&js($);if(We){SE($);let Wn=je($);if(typeof Wn=="string"){let Pn=Ut(Wn);if(!Te[Pn]||gt[Pn])throw fc($),Ni("root node is forbidden and cannot be sanitized in-place")}if(gc($))throw fc($),Ni("root node is clobbered and cannot be sanitized in-place");try{Fu($)}catch(Pn){throw fc($),Pn}}else if(js($))S=eg("<!---->"),V=S.ownerDocument.importNode($,!0),V.nodeType===Un.element&&V.nodeName==="BODY"||V.nodeName==="HTML"?S=V:S.appendChild(V),Fu(S);else{if(!hn&&!F&&!X&&$.indexOf("<")===-1)return $e&&So?Ce($):$;if(S=eg($),!S)return hn?null:So?dt:""}S&&qn&&ui(S.firstChild);let tt=We?$:S;try{let Wn=tg(tt);for(;z=Wn.nextNode();)og(z,tt),sg(z,tt),Ar(z.content)&&vc(z.content)}catch(Wn){throw We&&(fc($),Tr(e.removed,Pn=>{Pn.element&&mc(Pn.element)})),Wn}if(We){let Wn=!1;if(Tr(e.removed,Pn=>{Pn.element&&(Pn.element===$&&(Wn=!0),mc(Pn.element))}),Wn)throw Ni("a node selected for removal could not be safely returned; refusing to sanitize in place");return F&&Lu($),$}if(hn){if(F&&Lu(S),wo)for(fe=Re.call(S.ownerDocument);S.firstChild;)fe.appendChild(S.firstChild);else fe=S;return(ie.shadowroot||ie.shadowrootmode)&&(fe=$t.call(o,fe,!0)),fe}let Ft=X?S.outerHTML:S.innerHTML;return X&&Te["!doctype"]&&S.ownerDocument&&S.ownerDocument.doctype&&S.ownerDocument.doctype.name&&bn(MA,S.ownerDocument.doctype.name)&&(Ft="<!DOCTYPE "+S.ownerDocument.doctype.name+`>
20
+ `+Ft),F&&(Ft=hc(Ft)),$e&&So?Ce(Ft):Ft},e.setConfig=function(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ru($),re=!0,ut=Te,St=ie},e.clearConfig=function(){Or=null,re=!1,ut=null,St=null,$e=wt,dt=""},e.isValidAttribute=function($,h,S){Or||Ru({});let V=Ut($),z=Ut(h);return ig(V,z,S)},e.addHook=function($,h){typeof h=="function"&&An(_e,$)&&ec(_e[$],h)},e.removeHook=function($,h){if(An(_e,$)){if(h!==void 0){let S=dA(_e[$],h);return S===-1?void 0:uA(_e[$],S,1)[0]}return oC(_e[$])}},e.removeHooks=function($){An(_e,$)&&(_e[$]=[])},e.removeAllHooks=function(){_e=hC()},e}var bC=_C();function jh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ir=jh();function NC(t){Ir=t}var Dr={exec:()=>null};function Is(t){let e=[];return n=>{let o=Math.max(0,Math.min(3,n-1)),i=e[o];return i||(i=t(o),e[o]=i),i}}function Ve(t,e=""){let n=typeof t=="string"?t:t.source,o={replace:(i,r)=>{let s=typeof r=="string"?r:r.source;return s=s.replace(mn.caret,"$1"),n=n.replace(i,s),o},getRegex:()=>new RegExp(n,e)};return o}var LA=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),mn={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:Is(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Is(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:Is(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Is(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Is(t=>new RegExp(`^ {0,${t}}(?:</?(?:${ac})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:Is(t=>new RegExp(`^ {0,${t}}>`))},FA=/^(?:[ \t]*(?:\n|$))+/,VA=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,jA=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,sc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,BA=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Bh=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,OC=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,AC=Ve(OC).replace(/bull/g,Bh).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(),$A=Ve(OC).replace(/bull/g,Bh).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(),$h=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,HA=/^[^\n]+/,Hh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,UA=Ve(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Hh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),zA=Ve(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Bh).getRegex(),ac="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",Uh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,GA=Ve("^ {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",Uh).replace("tag",ac).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),PC=t=>Ve($h).replace("hr",sc).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",ac).getRegex(),qA=PC(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),WA=PC(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),YA=Ve(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",WA).getRegex(),zh={blockquote:YA,code:VA,def:UA,fences:jA,heading:BA,hr:sc,html:GA,lheading:AC,list:zA,newline:FA,paragraph:qA,table:Dr,text:HA},xC=Ve("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",sc).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",ac).getRegex(),ZA=Q(j({},zh),{lheading:$A,table:xC,paragraph:Ve($h).replace("hr",sc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",xC).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",ac).getRegex()}),KA=Q(j({},zh),{html:Ve(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Uh).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:Dr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ve($h).replace("hr",sc).replace("heading",` *#{1,6} *[^
21
+ ]`).replace("lheading",AC).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),QA=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,XA=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,RC=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,JA=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ci=/[\p{P}\p{S}]/u,ks=/[\s\p{P}\p{S}]/u,cc=/[^\s\p{P}\p{S}]/u,eP=Ve(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ks).getRegex(),tP=/[\p{Pi}\p{Ps}"']/u,LC=/(?!~)[\p{P}\p{S}]/u,nP=/(?!~)[\s\p{P}\p{S}]/u,oP=/(?:[^\s\p{P}\p{S}]|~)/u,iP=Ve(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",LA?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),FC=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,rP=Ve(FC,"u").replace(/punct/g,ci).getRegex(),sP=Ve(FC,"u").replace(/punct/g,LC).getRegex(),aP=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,cP=Ve(aP,"u").replace(/openQuote/g,tP).replace(/punct/g,ci).getRegex(),VC="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",lP=Ve(VC,"gu").replace(/notPunctSpace/g,cc).replace(/punctSpace/g,ks).replace(/punct/g,ci).getRegex(),dP=Ve(VC,"gu").replace(/notPunctSpace/g,oP).replace(/punctSpace/g,nP).replace(/punct/g,LC).getRegex(),uP="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",pP=Ve(uP,"gu").replace(/notPunctSpace/g,cc).replace(/punctSpace/g,ks).replace(/punct/g,ci).getRegex(),fP=Ve("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,cc).replace(/punctSpace/g,ks).replace(/punct/g,ci).getRegex(),mP="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",hP=Ve(mP,"gu").replace(/notPunctSpace/g,cc).replace(/punctSpace/g,ks).replace(/punct/g,ci).getRegex(),gP=Ve(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ci).getRegex(),yP="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",vP=Ve(yP,"gu").replace(/notPunctSpace/g,cc).replace(/punctSpace/g,ks).replace(/punct/g,ci).getRegex(),_P=Ve(/\\(punct)/,"gu").replace(/punct/g,ci).getRegex(),bP=Ve(/^<(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(),xP=Ve(Uh).replace("(?:-->|$)","-->").getRegex(),CP=Ve("^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",xP).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),jC=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,au=Ve(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",jC).getRegex(),EP=Ve(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",au).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),wP=Ve(/^!?\[(label)\]\[(ref)\]/).replace("label",au).replace("ref",Hh).getRegex(),SP=Ve(/^!?\[(ref)\](?:\[\])?/).replace("ref",Hh).getRegex(),CC=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,TP=Ve(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",jC).getRegex(),DP=Ve("reflink|nolink(?!\\()","g").replace("reflink",Ve(/^!?\[(label)\]\[(ref)\]/).replace("label",TP).replace("ref",CC).getRegex()).replace("nolink",Ve(/^!?\[(ref)\](?:\[\])?/).replace("ref",CC).getRegex()).getRegex(),EC=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,MP=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,IP=Ve(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,MP).getRegex(),Gh={_backpedal:Dr,anyPunctuation:_P,autolink:bP,blockSkip:iP,br:RC,code:XA,del:Dr,delLDelim:Dr,delRDelim:Dr,emStrongLDelim:rP,emStrongRDelimAst:lP,emStrongRDelimUnd:fP,escape:QA,link:EP,nolink:SP,punctuation:eP,reflink:wP,reflinkSearch:DP,tag:CP,text:JA,url:Dr},kP=Q(j({},Gh),{emStrongLDelim:cP,emStrongRDelimAst:pP,emStrongRDelimUnd:hP,link:Ve(/^!?\[(label)\]\((.*?)\)/).replace("label",au).getRegex(),reflink:Ve(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",au).getRegex()}),Lh=Q(j({},Gh),{emStrongRDelimAst:dP,emStrongLDelim:sP,delLDelim:gP,delRDelim:vP,url:Ve(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",IP).replace("protocol",EC).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:Ve(/^(?:[^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",EC).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()}),NP=Q(j({},Lh),{br:Ve(RC).replace("{2,}","*").getRegex(),text:Ve(Lh.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),su={normal:zh,gfm:ZA,pedantic:KA},ic={normal:Gh,gfm:Lh,breaks:NP,pedantic:kP},OP={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},wC=t=>OP[t];function Gn(t,e){if(e){if(mn.escapeTest.test(t))return t.replace(mn.escapeReplace,wC)}else if(mn.escapeTestNoEncode.test(t))return t.replace(mn.escapeReplaceNoEncode,wC);return t}function AP(t){return t.replace(mn.numericCharacterReference,(e,n,o)=>{let i=n===void 0?Number.parseInt(o,16):Number.parseInt(n,10);return i===0||i>1114111||i>=55296&&i<=57343?"\uFFFD":String.fromCodePoint(i)})}function SC(t){try{t=encodeURI(t).replace(mn.percentDecode,"%")}catch{return null}return t}function TC(t,e){let n=t.replace(mn.findPipe,(r,s,a)=>{let c=!1,l=s;for(;--l>=0&&a[l]==="\\";)c=!c;return c?"|":" |"}),o=n.split(mn.splitPipe),i=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(;i<o.length;i++)o[i]=o[i].trim().replace(mn.slashPipe,"|");return o}function Ai(t,e,n){let o=t.length;if(o===0)return"";let i=0;for(;i<o;){let r=t.charAt(o-i-1);if(r===e&&!n)i++;else if(r!==e&&n)i++;else break}return t.slice(0,o-i)}function DC(t){let e=t.split(`
22
+ `),n=e.length-1;for(;n>=0&&mn.blankLine.test(e[n]);)n--;return e.length-n<=2?t:e.slice(0,n+1).join(`
23
+ `)}function cu(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function PP(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 MC(t,e=0){let n=e,o="";for(let i of t)if(i===" "){let r=4-n%4;o+=" ".repeat(r),n+=r}else o+=i,n++;return o}function IC(t,e,n,o,i){let r=e.href,s=e.title||null,a=t[1].replace(i.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:r,title:s,text:a,tokens:f}}function RP(t,e,n){let o=t.match(n.other.indentCodeCompensation);if(o===null)return e;let i=o[1];return e.split(`
24
+ `).map(r=>{let s=r.match(n.other.beginningSpace);if(s===null)return r;let[a]=s;return r.slice(Math.min(a.length,i.length))}).join(`
25
+ `)}function kC(t,e,n,o){if(!e.includes("<"))return!1;for(let i=0;i<e.length;i++){if(e[i]==="\\"){i++;continue}if(e[i]==="`"){let a=o.inline.code.exec(e.slice(i));if(a){i+=a[0].length-1;continue}}if(e[i]!=="<")continue;let r=t.slice(n+i),s=o.inline.tag.exec(r)||o.inline.autolink.exec(r);if(s){if(s[0].length>e.length-i)return!0;i+=s[0].length-1}}return!1}var lu=class{options;rules;lexer;constructor(t){this.options=t||Ir}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]:DC(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=RP(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=Ai(n,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceTabChar.test(o))&&(n=o.trim())}return{type:"heading",raw:Ai(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:Ai(e[0],`
27
+ `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=Ai(e[0],`
28
+ `).split(`
29
+ `),o="",i="",r=[];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,i=i?`${i}
33
+ ${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,r,!0),this.lexer.state.top=f,n.length===0)break;let y=r.at(-1);if(y?.type==="code")break;if(y?.type==="blockquote"){let _=y,C=n.join(`
34
+ `),w=_.raw+`
35
+ `+C.replace(this.rules.other.blockquoteSetextReplace2,""),A=this.blockquote(w);r[r.length-1]=A;let Y=w.substring(A.raw.length).replace(/^\n/,""),q=Y?Y.split(`
36
+ `).length:0,ye=q?n.slice(0,-q):n;ye.length>0&&(o=`${o}
37
+ ${ye.join(`
38
+ `)}`),i=i.substring(0,i.length-_.text.length)+A.text;break}else if(y?.type==="list"){let _=y,C=_.raw+`
39
+ `+n.join(`
40
+ `),w=this.list(C);r[r.length-1]=w,o=o.substring(0,o.length-y.raw.length)+w.raw,i=i.substring(0,i.length-_.raw.length)+w.raw,n=C.substring(r.at(-1).raw.length).split(`
41
+ `);continue}}return{type:"blockquote",raw:o,tokens:r,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),o=n.length>1,i={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 r=this.rules.other.listItemRegex(n),s=!1;for(;t;){let c=!1,l="",d="";if(!(e=r.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,_=this.options.pedantic?MC(f,y):f.replace(this.rules.other.leadingSpaceTab,Y=>MC(Y,y)),C=t.split(`
43
+ `,1)[0],w=!_.trim(),A=0;if(this.options.pedantic?(A=2,d=_.trimStart()):w?A=y+1:(A=_.search(this.rules.other.nonSpaceChar),A=A>4?1:A,d=_.slice(A),A+=y),w&&this.rules.other.blankLine.test(C)&&(l+=C+`
44
+ `,t=t.substring(C.length+1),c=!0),!c){let Y=this.rules.other.nextBulletRegex(A),q=this.rules.other.hrRegex(A),ye=this.rules.other.fencesBeginRegex(A),he=this.rules.other.headingBeginRegex(A),Se=this.rules.other.htmlBeginRegex(A),pe=this.rules.other.blockquoteBeginRegex(A);for(;t;){let Xe=t.split(`
45
+ `,1)[0],je;if(C=Xe,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),je=C):je=C.replace(this.rules.other.leadingSpaceTab,$e=>$e.replace(this.rules.other.tabCharGlobal," ")),ye.test(C)||he.test(C)||Se.test(C)||pe.test(C)||Y.test(C)||q.test(C))break;if(je.search(this.rules.other.nonSpaceChar)>=A||!C.trim())d+=`
46
+ `+je.slice(A);else{if(w||_.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ye.test(_)||he.test(_)||q.test(_))break;d+=`
47
+ `+C}w=!C.trim(),l+=Xe+`
48
+ `,t=t.substring(Xe.length+1),_=je.slice(A)}}i.loose||(s?i.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(s=!0)),i.items.push({type:"list_item",raw:l,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),i.raw+=l}let a=i.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let c of i.items)if(this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]),!i.loose){let l=c.tokens.filter(f=>f.type==="space"),d=l.length>0&&l.some(f=>this.rules.other.anyLine.test(f.raw));i.loose=d}for(let c of i.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,i.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(i.loose)for(let c of i.items){c.loose=!0;for(let l of c.tokens)l.type==="text"&&(l.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=DC(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=cu(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:Ai(e[0],`
49
+ `),href:o,title:i}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=TC(e[1]),o=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
50
+ `):[],r={type:"table",raw:Ai(e[0],`
51
+ `),header:[],align:[],rows:[]};if(n.length===o.length){for(let s of o)this.rules.other.tableAlignRight.test(s)?r.align.push("right"):this.rules.other.tableAlignCenter.test(s)?r.align.push("center"):this.rules.other.tableAlignLeft.test(s)?r.align.push("left"):r.align.push(null);for(let s=0;s<n.length;s++)r.header.push({text:n[s],tokens:this.lexer.inline(n[s]),header:!0,align:r.align[s]});for(let s of i)r.rows.push(TC(s,r.header.length).map((a,c)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:r.align[c]})));return r}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:Ai(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&&kC(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=Ai(o.slice(0,-1),"\\");if((o.length-s.length)%2===0)return}else{let s=PP(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 i=e[2],r="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],r=s[3])}else r=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(o)?i=i.slice(1):i=i.slice(1,-1)),IC(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.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&&kC(t,n[1],o,this.rules))return;let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[cu(i)];if(!r){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return IC(n,r,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 i=[...o[0]].length-1,r,s,a=i,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+i);(o=f.exec(e))!==null;){if(r=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!r)continue;if(s=[...r].length,o[3]||o[4]){a+=s;continue}else if(o[5]||o[6]){if(i%3&&!((i+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,_=t.slice(0,i+o.index+y+s);if(Math.min(i,s)%2){let w=_.slice(1,-1);return{type:"em",raw:_,text:w,tokens:this.lexer.inlineTokens(w)}}let C=_.slice(2,-2);return{type:"strong",raw:_,text:C,tokens:this.lexer.inlineTokens(C)}}}}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),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return o&&i&&(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 i=[...o[0]].length-1,r,s,a=i,c=this.rules.inline.delRDelim;for(c.lastIndex=0,e=e.slice(-1*t.length+i);(o=c.exec(e))!==null;){if(r=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!r||(s=[...r].length,s!==i))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,i+o.index+l+s),f=d.slice(i,-i);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 i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==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]:AP(e[0]),escaped:n}}}},Co=class Fh{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ir,this.options.tokenizer=this.options.tokenizer||new lu,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:mn,block:su.normal,inline:ic.normal};this.options.pedantic?(n.block=su.pedantic,n.inline=ic.pedantic):this.options.gfm&&(n.block=su.gfm,this.options.breaks?n.inline=ic.breaks:n.inline=ic.gfm),this.tokenizer.rules=n}static get rules(){return{block:su,inline:ic}}static lex(e,n){return new Fh(n).lex(e)}static lexInline(e,n){return new Fh(n).inlineTokens(e)}lex(e){e=e.replace(mn.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(mn.tabCharGlobal," ").replace(mn.spaceLine,""));let i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let r;if(this.options.extensions?.block?.some(a=>(r=a.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let a=n.at(-1);r.raw.length===1&&a!==void 0?a.raw+=`
55
+ `:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
56
+ `)?"":`
57
+ `)+r.raw,a.text+=`
58
+ `+r.text,this.inlineQueue.at(-1).src=a.text):n.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
59
+ `)?"":`
60
+ `)+r.raw,a.text+=`
61
+ `+r.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},n.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);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&&(r=this.tokenizer.paragraph(s))){let a=n.at(-1);o&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
62
+ `)?"":`
63
+ `)+r.raw,a.text+=`
64
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r),o=s.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let a=n.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
65
+ `)?"":`
66
+ `)+r.raw,a.text+=`
67
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r);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 i=o[0],r=i.lastIndexOf("[");if(!(i.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,cu(i.slice(r+1,-1))))&&!(r>1&&this.linkInText(i.slice(1,r-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,cu(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 i=!1,r="",s=1/0;for(;e;){if(e.length<s)s=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}i||(r=""),i=!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,r)){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,r)){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)!=="_"&&(r=a.raw.slice(-1)),i=!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)}},du=class{options;parser;constructor(t){this.options=t||Ir}space(t){return""}code({text:t,lang:e,escaped:n}){let o=(e||"").match(mn.notSpaceStart)?.[0],i=t?t.replace(mn.endingNewline,"")+`
68
+ `:"";return o?'<pre><code class="language-'+Gn(o)+'">'+(n?i:Gn(i,!0))+`</code></pre>
69
+ `:"<pre><code>"+(n?i:Gn(i,!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 i=e?"ol":"ul",r=e&&n!==1?' start="'+n+'"':"";return"<"+i+r+`>
75
+ `+o+"</"+i+`>
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 i=0;i<t.header.length;i++)n+=this.tablecell(t.header[i]);e+=this.tablerow({text:n});let o="";for(let i=0;i<t.rows.length;i++){let r=t.rows[i];n="";for(let s=0;s<r.length;s++)n+=this.tablecell(r[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>${Gn(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:i}){let r=i?Gn(n,!0):this.parser.parseInline(o),s=SC(t);if(s===null)return r;t=Gn(s,i);let a='<a href="'+t+'"';return e&&(a+=' title="'+Gn(e)+'"'),a+=">"+r+"</a>",a}image({href:t,title:e,text:n,tokens:o}){o&&(n=this.parser.parseInline(o,this.parser.textRenderer));let i=SC(t);if(i===null)return Gn(n);t=i;let r=`<img src="${Gn(t)}" alt="${Gn(n)}"`;return e&&(r+=` title="${Gn(e)}"`),r+=">",r}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Gn(t.text)}},qh=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}},Eo=class Vh{options;renderer;textRenderer;constructor(e){this.options=e||Ir,this.options.renderer=this.options.renderer||new du,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new qh}static parse(e,n){return new Vh(n).parse(e)}static parseInline(e,n){return new Vh(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let o=0;o<e.length;o++){let i=e[o];if(this.options.extensions?.renderers?.[i.type]){let s=i,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 r=i;switch(r.type){case"space":{n+=this.renderer.space(r);break}case"hr":{n+=this.renderer.hr(r);break}case"heading":{n+=this.renderer.heading(r);break}case"code":{n+=this.renderer.code(r);break}case"table":{n+=this.renderer.table(r);break}case"blockquote":{n+=this.renderer.blockquote(r);break}case"list":{n+=this.renderer.list(r);break}case"checkbox":{n+=this.renderer.checkbox(r);break}case"html":{n+=this.renderer.html(r);break}case"def":{n+=this.renderer.def(r);break}case"paragraph":{n+=this.renderer.paragraph(r);break}case"text":{n+=this.renderer.text(r);break}default:{let s='Token with "'+r.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 i=0;i<e.length;i++){let r=e[i];if(this.options.extensions?.renderers?.[r.type]){let a=this.options.extensions.renderers[r.type].call({parser:this},r);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(r.type)){o+=a||"";continue}}let s=r;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}},rc=class{options;block;constructor(t){this.options=t||Ir}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?Co.lex:Co.lexInline}provideParser(t=this.block){return t?Eo.parse:Eo.parseInline}},uu=class{defaults=jh();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Eo;Renderer=du;TextRenderer=qh;Lexer=Co;Tokenizer=lu;Hooks=rc;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 i=o;for(let r of i.header)n=n.concat(this.walkTokens(r.tokens,e));for(let r of i.rows)for(let s of r)n=n.concat(this.walkTokens(s.tokens,e));break}case"list":{let i=o;n=n.concat(this.walkTokens(i.items,e));break}default:{let i=o;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(r=>{let s=i[r].flat(1/0);n=n.concat(this.walkTokens(s,e))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let o=j({},n);if(o.async=this.defaults.async||o.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let r=e.renderers[i.name];r?e.renderers[i.name]=function(...s){let a=i.renderer.apply(this,s);return a===!1&&(a=r.apply(this,s)),a}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=e[i.level];r?r.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),o.extensions=e),n.renderer){let i=this.defaults.renderer||new du(this.defaults);for(let r in n.renderer){if(!(r in i))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let s=r,a=n.renderer[s],c=i[s];i[s]=(...l)=>{let d=a.apply(i,l);return d===!1&&(d=c.apply(i,l)),d||""}}o.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new lu(this.defaults);for(let r in n.tokenizer){if(!(r in i))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let s=r,a=n.tokenizer[s],c=i[s];i[s]=(...l)=>{let d=a.apply(i,l);return d===!1&&(d=c.apply(i,l)),d}}o.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new rc;for(let r in n.hooks){if(!(r in i))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let s=r,a=n.hooks[s],c=i[s];rc.passThroughHooks.has(r)?i[s]=l=>{if(this.defaults.async&&rc.passThroughHooksRespectAsync.has(r))return(async()=>{let f=await a.call(i,l);return c.call(i,f)})();let d=a.call(i,l);return c.call(i,d)}:i[s]=(...l)=>{if(this.defaults.async)return(async()=>{let f=await a.apply(i,l);return f===!1&&(f=await c.apply(i,l)),f})();let d=a.apply(i,l);return d===!1&&(d=c.apply(i,l)),d}}o.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,r=n.walkTokens;o.walkTokens=function(s){let a=[];return a.push(r.call(this,s)),i&&(a=a.concat(i.call(this,s))),a}}this.defaults=j(j({},this.defaults),o)}),this}setOptions(t){return this.defaults=j(j({},this.defaults),t),this}lexer(t,e){return Co.lex(t,e??this.defaults)}parser(t,e){return Eo.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let o=j({},n),i=j(j({},this.defaults),o),r=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&o.async===!1)return r(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 r(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let s=i.hooks?await i.hooks.preprocess(e):e,a=await(i.hooks?await i.hooks.provideLexer(t):t?Co.lex:Co.lexInline)(s,i),c=i.hooks?await i.hooks.processAllTokens(a):a;i.walkTokens&&await Promise.all(this.walkTokens(c,i.walkTokens));let l=await(i.hooks?await i.hooks.provideParser(t):t?Eo.parse:Eo.parseInline)(c,i);return i.hooks?await i.hooks.postprocess(l):l})().catch(r);try{i.hooks&&(e=i.hooks.preprocess(e));let s=(i.hooks?i.hooks.provideLexer(t):t?Co.lex:Co.lexInline)(e,i);i.hooks&&(s=i.hooks.processAllTokens(s)),i.walkTokens&&this.walkTokens(s,i.walkTokens);let a=(i.hooks?i.hooks.provideParser(t):t?Eo.parse:Eo.parseInline)(s,i);return i.hooks&&(a=i.hooks.postprocess(a)),a}catch(s){return r(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>"+Gn(n.message+"",!0)+"</pre>";return e?Promise.resolve(o):o}if(e)return Promise.reject(n);throw n}}},Mr=new uu;function Et(t,e){return Mr.parse(t,e)}Et.options=Et.setOptions=function(t){return Mr.setOptions(t),Et.defaults=Mr.defaults,NC(Et.defaults),Et};Et.getDefaults=jh;Et.defaults=Ir;function LP(...t){return Mr.use(...t),Et.defaults=Mr.defaults,NC(Et.defaults),Et}Et.use=LP;Et.walkTokens=function(t,e){return Mr.walkTokens(t,e)};Et.parseInline=Mr.parseInline;Et.Parser=Eo;Et.parser=Eo.parse;Et.Renderer=du;Et.TextRenderer=qh;Et.Lexer=Co;Et.lexer=Co.lex;Et.Tokenizer=lu;Et.Hooks=rc;Et.parse=Et;var YZ=Et.options,ZZ=Et.setOptions,KZ=Et.walkTokens,QZ=Et.parseInline;var XZ=Eo.parse,JZ=Co.lex;function BC(){return{code({text:t,lang:e}){let{html:n,language:o}=Wd(t,e??void 0);return`<div class="code"><div class="code-head"><span class="code-lang">${o}</span><button type="button" class="copy" data-copy>Copy</button></div><pre><code class="hljs">${n}</code></pre></div>`},link({href:t,title:e,tokens:n}){let o=this.parser.parseInline(n),i=t.replace(/"/g,"&quot;"),r=e?` title="${e.replace(/"/g,"&quot;")}"`:"";return`<a href="${i}"${r} target="_blank" rel="noreferrer noopener">${o}</a>`}}}var $C=new uu({gfm:!0,breaks:!1});$C.use({renderer:BC()});var HC=new uu({gfm:!0,breaks:!0});HC.use({renderer:BC()});var FP=new Map,VP=new Map,jP=200;function BP(t){return bC.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 UC(t,e,n){let o=t.get(n);if(o!==void 0)return o;let i=BP(e.parse(n,{async:!1}));if(t.size>=jP){let r=t.keys().next().value;r!==void 0&&t.delete(r)}return t.set(n,i),i}function zC(t){return UC(FP,$C,t)}function GC(t){return UC(VP,HC,t)}var $P=90,pu=class t{text=ee.required();variant=ee("assistant");mention=rt();sanitizer=k(Pa);painted=O(null);pending;timer;html=E(()=>{let e=this.painted()??this.text();return this.sanitizer.bypassSecurityTrustHtml(this.variant()==="user"?GC(e):zC(e))});constructor(){se(()=>{let e=this.text(),n=Po(()=>this.painted());if(n===null){this.painted.set(e);return}n===e||this.pending===e||(this.pending=e,this.schedule())}),k(yt).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)},$P)}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 i=n?.closest("button[data-copy]");if(!(i instanceof HTMLButtonElement))return;let s=i.closest(".code")?.querySelector("code")?.textContent??"";navigator.clipboard?.writeText(s);let a=i.textContent;i.textContent="Copied",setTimeout(()=>{i.textContent=a??"Copy"},1200)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ae({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&&(v(0,"div",0),U("click",function(r){return o.onClick(r)}),x()),n&2&&ve("innerHTML",o.html(),Ca)},styles:["[_nghost-%COMP%]{display:block}"]})};function li(t){let e=t.toLowerCase();return e.includes("edit")||e.includes("write")||e.includes("patch")?"edit":e.includes("read")?"read":e.includes("search")||e.includes("grep")||e.includes("find")?"search":e.includes("bash")||e.includes("shell")||e.includes("exec")?"shell":"other"}function qC(t){switch(li(t.name)){case"edit":return"Edit";case"read":return"Read";case"search":return"Search";case"shell":return"Run";default:return t.name}}function WC(t){switch(li(t.name)){case"edit":return"Editing";case"read":return"Reading";case"search":return"Searching";case"shell":return"Running";default:return t.name}}function YC(t){switch(li(t.name)){case"edit":return"\u270E";case"search":return"\u2315";case"shell":return"\u276F";default:return"\u2630"}}function Ns(t){return t.title.startsWith(`${t.name}: `)?t.title.slice(t.name.length+2):t.title}function fu(t){let e=t.replace(/[\\/]+$/,""),n=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return n===-1?e:e.slice(n+1)}function ZC(t){if(li(t.name)!=="edit")return null;let e=Ns(t);return e.length>0&&e!==t.name?e:null}var HP=["list"],KC=(t,e)=>e.key;function UP(t,e){t&1&&xe(0,"span",4)}function zP(t,e){if(t&1&&p(0),t&2){let n=m();ue(" ",n.state()==="error"?"\u2717":"\u2713"," ")}}function GP(t,e){t&1&&(g(0,"span",5),xe(1,"i")(2,"i")(3,"i"),b())}function qP(t,e){t&1&&xe(0,"span",4)}function WP(t,e){t&1&&(g(0,"span",12),p(1,"\u2717"),b())}function YP(t,e){t&1&&(g(0,"span",13),p(1,"\u2713"),b())}function ZP(t,e){if(t&1&&(g(0,"span",22),p(1),b()),t&2){let n=m();u(),ue("+",n.added)}}function KP(t,e){if(t&1&&(g(0,"span",23),p(1),b()),t&2){let n=m();u(),ue("\u2212",n.removed)}}function QP(t,e){if(t&1&&(g(0,"span",17),T(1,ZP,2,1,"span",22),T(2,KP,2,1,"span",23),b()),t&2){let n=e;u(),D(n.added>0?1:-1),u(),D(n.removed>0?2:-1)}}function XP(t,e){t&1&&(g(0,"span",5),xe(1,"i")(2,"i")(3,"i"),b())}function JP(t,e){t&1&&(g(0,"span",19),p(1),b()),t&2&&(u(),N(e))}function eR(t,e){if(t&1&&(g(0,"ul",20)(1,"li",24),kt(),g(2,"svg",25),xe(3,"path",26)(4,"path",27),b(),gn(),g(5,"span",28),p(6),b()()()),t&2){let n=e,o=m(4);u(5),W("title",n),u(),N(o.basename(n))}}function tR(t,e){if(t&1&&(g(0,"span",29),p(1,"input"),b(),g(2,"pre"),p(3),b()),t&2){let n=m(3).$implicit;u(3),N(n.item.input)}}function nR(t,e){if(t&1&&(g(0,"span",29),p(1,"output"),b(),g(2,"pre"),p(3),b()),t&2){let n=m(3).$implicit;u(3),N(n.item.output)}}function oR(t,e){t&1&&(g(0,"span",29),p(1,"no details reported"),b())}function iR(t,e){if(t&1&&(g(0,"div",21),T(1,tR,4,1),T(2,nR,4,1),T(3,oR,2,0,"span",29),b()),t&2){let n=m(2).$implicit;oe("data-body",n.key),u(),D(n.item.input?1:-1),u(),D(n.item.output?2:-1),u(),D(!n.item.input&&!n.item.output?3:-1)}}function rR(t,e){if(t&1){let n=H();g(0,"button",10),R("click",function(){M(n);let i=m().$implicit,r=m(2);return I(r.toggleStep(i.key))}),g(1,"span",11),T(2,qP,1,0,"span",4)(3,WP,2,0,"span",12)(4,YP,2,0,"span",13),b(),g(5,"span",14),p(6),b(),g(7,"span",15),p(8),b(),g(9,"span",16),p(10),b(),T(11,QP,3,2,"span",17),xe(12,"span",18),T(13,XP,4,0,"span",5),T(14,JP,2,1,"span",19),g(15,"span",6),p(16,"\u203A"),b()(),T(17,eR,7,2,"ul",20),T(18,iR,4,4,"div",21)}if(t&2){let n,o,i,r=m().$implicit,s=m(2);oe("aria-expanded",s.isStepOpen(r.key)),u(),xo(r.item.status),u(),D(r.item.status==="running"?2:r.item.status==="error"?3:4),u(3),xo(s.glyphClass(r.item)),u(),N(s.glyph(r.item)),u(2),N(s.verb(r.item)),u(),W("title",r.item.title),u(),N(s.compactTarget(r.item)),u(),D((n=s.diff(r.item))?11:-1,n),u(2),D(r.item.status==="running"?13:-1),u(),D((o=s.elapsed(r.item))?14:-1,o),u(),de("open",s.isStepOpen(r.key)),u(2),D((i=s.fileOf(r.item))?17:-1,i),u(),D(s.isStepOpen(r.key)?18:-1)}}function sR(t,e){if(t&1&&(g(0,"div",21)(1,"pre"),p(2),b()()),t&2){let n=m(2).$implicit;oe("data-body",n.key),u(2),N(n.item.thinking)}}function aR(t,e){if(t&1){let n=H();g(0,"button",10),R("click",function(){M(n);let i=m().$implicit,r=m(2);return I(r.toggleStep(i.key))}),g(1,"span",30),p(2,"\u273B"),b(),g(3,"span",15),p(4,"Thinking"),b(),g(5,"span",31),p(6),b(),xe(7,"span",18),g(8,"span",6),p(9,"\u203A"),b()(),T(10,sR,3,2,"div",21)}if(t&2){let n=m().$implicit,o=m(2);oe("aria-expanded",o.isStepOpen(n.key)),u(6),N(o.preview(n.item.thinking)),u(2),de("open",o.isStepOpen(n.key)),u(2),D(o.isStepOpen(n.key)?10:-1)}}function cR(t,e){if(t&1&&(g(0,"li",9),T(1,rR,19,17)(2,aR,11,5),b()),t&2){let n=e.$implicit;u(),D(n.kind==="tool"?1:2)}}function lR(t,e){if(t&1&&(g(0,"ul",7),ce(1,cR,3,1,"li",9,KC),b()),t&2){let n=m();u(),le(n.compactSteps())}}function dR(t,e){t&1&&xe(0,"span",4)}function uR(t,e){t&1&&(g(0,"span",12),p(1,"\u2717"),b())}function pR(t,e){t&1&&(g(0,"span",13),p(1,"\u2713"),b())}function fR(t,e){if(t&1&&(g(0,"span",22),p(1),b()),t&2){let n=m();u(),ue("+",n.added)}}function mR(t,e){if(t&1&&(g(0,"span",23),p(1),b()),t&2){let n=m();u(),ue("\u2212",n.removed)}}function hR(t,e){if(t&1&&(g(0,"span",17),T(1,fR,2,1,"span",22),T(2,mR,2,1,"span",23),b()),t&2){let n=e;u(),D(n.added>0?1:-1),u(),D(n.removed>0?2:-1)}}function gR(t,e){t&1&&(g(0,"span",5),xe(1,"i")(2,"i")(3,"i"),b())}function yR(t,e){t&1&&(g(0,"span",19),p(1),b()),t&2&&(u(),N(e))}function vR(t,e){if(t&1&&(g(0,"span",29),p(1,"input"),b(),g(2,"pre"),p(3),b()),t&2){let n=m(3).$implicit;u(3),N(n.item.input)}}function _R(t,e){if(t&1&&(g(0,"span",29),p(1,"output"),b(),g(2,"pre"),p(3),b()),t&2){let n=m(3).$implicit;u(3),N(n.item.output)}}function bR(t,e){t&1&&(g(0,"span",29),p(1,"no details reported"),b())}function xR(t,e){if(t&1&&(g(0,"div",21),T(1,vR,4,1),T(2,_R,4,1),T(3,bR,2,0,"span",29),b()),t&2){let n=m(2).$implicit;oe("data-body",n.key),u(),D(n.item.input?1:-1),u(),D(n.item.output?2:-1),u(),D(!n.item.input&&!n.item.output?3:-1)}}function CR(t,e){if(t&1){let n=H();g(0,"div",35)(1,"button",36),R("click",function(){M(n);let i=m().$implicit,r=m(2);return I(r.toggleStep(i.key))}),g(2,"span",11),T(3,dR,1,0,"span",4)(4,uR,2,0,"span",12)(5,pR,2,0,"span",13),b(),g(6,"span",14),p(7),b(),g(8,"span",37),p(9),b(),g(10,"span",38)(11,"span",39),p(12),b(),g(13,"span",40),p(14),b()(),T(15,hR,3,2,"span",17),xe(16,"span",18),T(17,gR,4,0,"span",5),T(18,yR,2,1,"span",19),g(19,"span",6),p(20,"\u203A"),b()(),T(21,xR,4,4,"div",21),b()}if(t&2){let n,o,i=m().$implicit,r=m(2);de("running",i.item.status==="running")("failed",i.item.status==="error"),u(),oe("aria-expanded",r.isStepOpen(i.key)),u(),xo(i.item.status),u(),D(i.item.status==="running"?3:i.item.status==="error"?4:5),u(3),xo(r.glyphClass(i.item)),u(),N(r.glyph(i.item)),u(2),N(i.item.name),u(),W("title",i.item.title),u(2),N(r.target(i.item).dir),u(2),N(r.target(i.item).base),u(),D((n=r.diff(i.item))?15:-1,n),u(2),D(i.item.status==="running"?17:-1),u(),D((o=r.elapsed(i.item))?18:-1,o),u(),de("open",r.isStepOpen(i.key)),u(2),D(r.isStepOpen(i.key)?21:-1)}}function ER(t,e){if(t&1&&(g(0,"div",21)(1,"pre"),p(2),b()()),t&2){let n=m(2).$implicit;oe("data-body",n.key),u(2),N(n.item.thinking)}}function wR(t,e){if(t&1){let n=H();g(0,"div",34)(1,"button",36),R("click",function(){M(n);let i=m().$implicit,r=m(2);return I(r.toggleStep(i.key))}),g(2,"span",11)(3,"span",41),p(4,"\u273B"),b()(),g(5,"span",42),p(6,"thinking"),b(),g(7,"span",43),p(8),b(),g(9,"span",6),p(10,"\u203A"),b()(),T(11,ER,3,2,"div",21),b()}if(t&2){let n=m().$implicit,o=m(2);u(),oe("aria-expanded",o.isStepOpen(n.key)),u(7),N(o.preview(n.item.thinking)),u(),de("open",o.isStepOpen(n.key)),u(2),D(o.isStepOpen(n.key)?11:-1)}}function SR(t,e){if(t&1&&(g(0,"li",32),T(1,CR,22,21,"div",33)(2,wR,12,5,"div",34),b()),t&2){let n,o=e.$implicit,i=e.$index;W("morseEnter",i)("morseEnterY",6),u(),D((n=o.kind)==="tool"?1:n==="thinking"?2:-1)}}function TR(t,e){if(t&1&&(g(0,"ul",8,0),ce(2,SR,3,3,"li",32,KC),b()),t&2){let n=m();u(2),le(n.steps())}}var hu=class t{steps=ee.required();working=ee(!1);animation=k(an);display=k(Ts);host=k(Bt);list=Qe("list");openSteps=O({});override=O(null);tick=O(0);tools=E(()=>this.steps().filter(e=>e.kind==="tool"));thoughts=E(()=>this.steps().filter(e=>e.kind==="thinking").length);running=E(()=>this.tools().some(e=>e.item.status==="running"));failed=E(()=>this.tools().some(e=>e.item.status==="error"));compact=E(()=>this.display.toolDisplay()==="compact");compactSteps=E(()=>{let e=this.steps();if(this.isOpen())return e;let n=e.at(-1);return n===void 0?[]:[n]});autoOpen=E(()=>this.compact()?!1:this.working()||this.running());isOpen=E(()=>this.override()??this.autoOpen());state=E(()=>this.running()?"running":this.failed()?"error":"ok");summary=E(()=>{let e=this.tools().length,n=this.thoughts(),o=e===1?"action":"actions",i=n>0?` \xB7 ${n} ${n===1?"thought":"thoughts"}`:"",r=this.totalMs();return this.running()?r>0?`Working for ${mu(r)} \xB7 ${e} ${o}${i}`:`Working\u2026 \xB7 ${e} ${o}${i}`:r>0?`Worked for ${mu(r)} \xB7 ${e} ${o}${i}`:`${e} ${o}${i}`});constructor(){se(n=>{if(!this.running())return;let o=setInterval(()=>this.tick.update(i=>i+1),500);n(()=>clearInterval(o))}),se(()=>{this.autoOpen(),this.override.set(null)});let e=!1;se(n=>{let o=this.isOpen(),i=e;e=!0;let r=setTimeout(()=>{this.animation.reveal(this.list()?.nativeElement??null,o,{animate:i})},0);n(()=>clearTimeout(r))})}toggle(){this.override.set(!this.isOpen())}toggleStep(e){let n=!this.isStepOpen(e);this.openSteps.update(o=>Q(j({},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?mu(n):""}return e.durationMs===void 0?"":mu(e.durationMs)}target(e){let n=Ns(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 i=/(\d+)\s+insertions?\(\+\)/.exec(n)?.[1],r=/(\d+)\s+deletions?\([-−]\)/.exec(n)?.[1];return i===void 0&&r===void 0?null:{added:Number(i??0),removed:Number(r??0)}}glyphClass(e){let n=li(e.name);return n==="other"?"read":n}verb(e){return qC(e)}compactTarget(e){if(li(e.name)!=="shell")return this.target(e).base;let n=Ns(e).replace(/\s+/g," ").trim();return n.length>80?`${n.slice(0,80)}\u2026`:n}fileOf(e){return ZC(e)}basename(e){return fu(e)}glyph(e){return YC(e)}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=ae({type:t,selectors:[["morse-tool-group"]],viewQuery:function(n,o){n&1&&ft(o.list,HP,5),n&2&&vt()},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),R("click",function(){return o.toggle()}),g(2,"span",3),T(3,UP,1,0,"span",4)(4,zP,1,1),b(),g(5,"span"),p(6),b(),T(7,GP,4,0,"span",5),g(8,"span",6),p(9,"\u203A"),b()(),T(10,lR,3,0,"ul",7)(11,TR,4,0,"ul",8),b()),n&2&&(de("compact",o.compact()),u(),oe("aria-expanded",o.isOpen()),u(),xo(o.state()),u(),D(o.state()==="running"?3:4),u(3),N(o.summary()),u(),D(o.running()?7:-1),u(),de("open",o.isOpen()),u(2),D(o.compact()?10:11))},dependencies:[cn],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 mu(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 DR=["track"],MR=["previewList"],eE=(t,e)=>e.id;function IR(t,e){if(t&1&&Fe(0,"span",10),t&2){let n=e.$implicit,o=e.$index,i=m(2);fn("top",o*i.tickPitch,"px")("width",i.tickWidth(o),"px"),de("active",n.id===i.activeId()),oe("aria-selected",o===i.hovered())("aria-label",n.preview||"Prompt")}}function kR(t,e){if(t&1){let n=H();v(0,"button",14),U("mouseenter",function(){let i=M(n).$index,r=m(3);return I(r.hovered.set(i))})("click",function(){let i=M(n).$index,r=m(3);return I(r.choose(i))}),v(1,"span",15),p(2),x()()}if(t&2){let n=e.$implicit,o=e.$index,i=m(3);de("active",n.id===i.activeId())("hovered",o===i.hovered()),u(2),N(n.preview||"No text")}}function NR(t,e){if(t&1){let n=H();v(0,"div",11),U("mouseenter",function(){M(n);let i=m(2);return I(i.onEnter())})("mouseleave",function(){M(n);let i=m(2);return I(i.onLeave())}),v(1,"div",12,1),ce(3,kR,3,5,"button",13,eE),x()()}if(t&2){let n=m(2);u(3),le(n.prompts())}}function OR(t,e){if(t&1){let n=H();v(0,"nav",3),U("mouseenter",function(){M(n);let i=m();return I(i.onEnter())}),v(1,"button",4),U("click",function(){M(n);let i=m();return I(i.stepWindow(-1))}),p(2," \u2303 "),x(),v(3,"div",5,0),U("mousemove",function(i){M(n);let r=m();return I(r.onMove(i))})("mouseleave",function(){M(n);let i=m();return I(i.onLeave())})("click",function(i){M(n);let r=m();return I(r.onTrackClick(i))})("keydown",function(i){M(n);let r=m();return I(r.onKeydown(i))}),v(5,"div",6),ce(6,IR,1,8,"span",7,eE),x()(),v(8,"button",8),U("click",function(){M(n);let i=m();return I(i.stepWindow(1))}),p(9," \u2304 "),x(),T(10,NR,5,0,"div",9),x()}if(t&2){let n=m();u(),ve("disabled",!n.hasMoreAbove()),u(2),fn("height",n.visibleCount()*n.tickPitch,"px")("mask-image",n.mask()),u(2),fn("transform","translateY(-"+n.clampedWindowStart()*n.tickPitch+"px)"),u(),le(n.prompts()),u(2),ve("disabled",!n.hasMoreBelow()),u(2),D(n.hovered()!==null?10:-1)}}var QC=12,XC=30,JC=18,AR=80,PR=10,RR=14,LR=20,FR=[1,.6,.35,.15],VR=160,gu=class t{prompts=ee.required();activeId=ee(null);pick=rt();tickPitch=QC;hovered=O(null);windowStart=O(0);track=Qe("track");previewList=Qe("previewList");pointerY=null;direction=0;carouselTimer=null;hideTimer=null;visibleCount=E(()=>Math.min(this.prompts().length,XC));maxWindowStart=E(()=>Math.max(0,this.prompts().length-this.visibleCount()));clampedWindowStart=E(()=>Math.min(this.windowStart(),this.maxWindowStart()));hasMoreAbove=E(()=>this.clampedWindowStart()>0);hasMoreBelow=E(()=>this.clampedWindowStart()+this.visibleCount()<this.prompts().length);activeIndex=E(()=>{let e=this.activeId();return e===null?-1:this.prompts().findIndex(n=>n.id===e)});mask=E(()=>{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(){se(()=>{if(this.hovered()!==null)return;let e=this.prompts().length,n=Math.min(e,XC),o=Math.max(0,e-n),i=this.activeIndex()>=0?this.activeIndex():e-1;this.windowStart.set(Math.max(0,Math.min(o,i-Math.floor(n/2))))}),se(()=>{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()?RR:PR,o=this.hovered();if(o===null)return n;let i=FR[Math.abs(e-o)]??0;return Math.round(n+(LR-n)*i)}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),i=r=>{let s=Math.max(0,Math.min(n-1,r));this.ensureWindowContains(s),this.hovered.set(s)};switch(e.key){case"ArrowUp":e.preventDefault(),i(o-1);return;case"ArrowDown":e.preventDefault(),i(o+1);return;case"Home":e.preventDefault(),i(0);return;case"End":e.preventDefault(),i(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 i=n.getBoundingClientRect(),r=Math.floor((e-i.top)/QC),s=Math.max(0,Math.min(o-1,r));return Math.min(this.prompts().length-1,this.clampedWindowStart()+s)}updateCarousel(e){let n=this.track()?.nativeElement;if(!n)return;let o=n.getBoundingClientRect(),i=e-o.top,r=0;if(i<=JC&&this.hasMoreAbove()?r=-1:i>=o.height-JC&&this.hasMoreBelow()&&(r=1),this.direction=r,r===0){this.stopCarousel();return}this.carouselTimer===null&&(this.carouselTimer=setInterval(()=>this.carouselStep(),AR))}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(),i=Math.min(this.clampedWindowStart(),o);e<i?this.windowStart.set(e):e>=i+n&&this.windowStart.set(Math.min(o,e-n+1))}scheduleHide(){this.cancelHide(),this.hideTimer=setTimeout(()=>{this.hideTimer=null,this.hovered.set(null)},VR)}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 i=n.getBoundingClientRect(),r=o.getBoundingClientRect();r.top<i.top?n.scrollTop-=i.top-r.top:r.bottom>i.bottom&&(n.scrollTop+=r.bottom-i.bottom)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ae({type:t,selectors:[["morse-prompt-rail"]],viewQuery:function(n,o){n&1&&ft(o.track,DR,5)(o.previewList,MR,5),n&2&&vt(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,OR,11,9,"nav",2),n&2&&D(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 jR=["scroll"],BR=["inner"],$R=["heroMark"],tE=()=>[],HR=(t,e)=>e.key,UR=(t,e)=>e.path+(e.startLine??"");function zR(t,e){t&1&&(g(0,"span",11),p(1,"Loading older messages\u2026"),b())}function GR(t,e){if(t&1){let n=H();g(0,"button",13),R("click",function(){M(n);let i=m(2);return I(i.loadOlder())}),p(1," Load older messages "),b()}}function qR(t,e){if(t&1&&(g(0,"div",5),T(1,zR,2,0,"span",11)(2,GR,2,0,"button",12),b()),t&2){let n=m();u(),D(n.loadingOlderHistory()?1:2)}}function WR(t,e){t&1&&(g(0,"div",6)(1,"span"),p(2,"Start of conversation"),b()())}function YR(t,e){if(t&1&&(g(0,"span",31),p(1),b()),t&2){let n=m().$implicit,o=m(4);u(),N(o.pinRange(n))}}function ZR(t,e){if(t&1&&(g(0,"li",27)(1,"span",29),p(2,"\u29C9"),b(),g(3,"span",30),p(4),b(),T(5,YR,2,1,"span",31),b()),t&2){let n=e.$implicit,o=m(4);W("title",n.path),u(4),N(o.basename(n.path)),u(),D(n.startLine!==void 0?5:-1)}}function KR(t,e){if(t&1){let n=H();g(0,"li",28)(1,"button",32),R("click",function(){let i=M(n),r=i.$implicit,s=i.$index,a=m(4);return I(a.openImage(r,s))}),xe(2,"img",33),b()()}if(t&2){let n=e.$implicit,o=e.$index,i=m(4);u(),W("title",i.imageName(n,o)),oe("aria-label","View "+i.imageName(n,o)),u(),W("src",i.thumb(n),bo)("alt",i.imageName(n,o))}}function QR(t,e){if(t&1&&(g(0,"ul",19),ce(1,ZR,6,3,"li",27,UR),ce(3,KR,3,4,"li",28,ls),b()),t&2){let n=m(2).$implicit;u(),le(n.item.pins??Xl(0,tE)),u(2),le(n.item.images??Xl(1,tE))}}function XR(t,e){if(t&1){let n=H();g(0,"div",20)(1,"textarea",34),R("input",function(i){M(n);let r=m(3);return I(r.onEditInput(i))})("keydown",function(i){M(n);let r=m(2).$implicit,s=m();return I(s.onEditKeydown(i,r.item))}),b(),g(2,"div",35)(3,"span",36),p(4,"Enter sends \xB7 Shift+Enter for a new line"),b(),g(5,"button",37),R("click",function(){M(n);let i=m(3);return I(i.cancelEdit())}),p(6,"Cancel"),b(),g(7,"button",38),R("click",function(){M(n);let i=m(2).$implicit,r=m();return I(r.submitEdit(i.item))}),p(8," Send "),b()()()}if(t&2){let n=m(3);u(),W("value",n.editingText()),u(6),W("disabled",n.editingText().trim().length===0)}}function JR(t,e){if(t&1){let n=H();g(0,"div",21)(1,"morse-markdown",39),R("mention",function(i){M(n);let r=m(3);return I(r.openMention(i))}),b()()}if(t&2){let n=m(2).$implicit,o=m();u(),W("text",o.userMarkdown(n.item))}}function e2(t,e){if(t&1){let n=H();g(0,"button",40),R("click",function(){M(n);let i=m(2).$implicit,r=m();return I(r.startEdit(i.item))}),p(1," \u270E "),b()}}function t2(t,e){if(t&1){let n=H();g(0,"button",41),R("click",function(){M(n);let i=m(2).$implicit,r=m();return I(r.fork(i.item))}),kt(),g(1,"svg",42),xe(2,"path",43),b()()}}function n2(t,e){if(t&1){let n=H();g(0,"div",14),T(1,QR,5,2,"ul",19),T(2,XR,9,2,"div",20)(3,JR,2,1,"div",21),g(4,"div",22)(5,"span",23),p(6),b(),T(7,e2,2,0,"button",24),T(8,t2,3,0,"button",25),g(9,"button",26),R("click",function(){M(n);let i=m().$implicit,r=m();return I(r.copy(i.item))}),p(10),b()()()}if(t&2){let n=m().$implicit,o=m();W("morseEnter",0),oe("data-prompt-id",n.item.id),u(),D(o.pinsOf(n.item)!==void 0||n.item.images!==void 0?1:-1),u(),D(o.editingId()===n.item.id?2:3),u(4),N(o.stamp(n.item.at)),u(),D(o.canEdit()?7:-1),u(),D(o.canFork()?8:-1),u(),W("title",o.copiedId()===n.item.id?"Copied":"Copy message"),u(),ue(" ",o.copiedId()===n.item.id?"\u2713":"\u29C9"," ")}}function o2(t,e){if(t&1){let n=H();xe(0,"morse-markdown",45),g(1,"div",46)(2,"button",26),R("click",function(){M(n);let i=m(2).$implicit,r=m();return I(r.copyAssistant(i.item))}),p(3),b()()}if(t&2){let n=m(2).$implicit,o=m();W("text",n.item.text),u(2),de("revealed",o.copiedId()===n.item.id),W("title",o.copiedId()===n.item.id?"Copied":"Copy response"),u(),ue(" ",o.copiedId()===n.item.id?"\u2713 Copied":"\u29C9 Copy"," ")}}function i2(t,e){t&1&&(g(0,"span",44),p(1,"\xA0"),b())}function r2(t,e){if(t&1&&(g(0,"div",15),T(1,o2,4,5)(2,i2,2,0,"span",44),b()),t&2){let n=m().$implicit;W("morseEnter",0),u(),D(n.item.text?1:n.item.streaming?2:-1)}}function s2(t,e){if(t&1&&xe(0,"morse-tool-group",16),t&2){let n=m().$implicit,o=m();W("morseEnter",0)("steps",n.steps)("working",o.working()&&n.key===o.activeProcess())}}function a2(t,e){if(t&1&&(g(0,"div",47)(1,"pre"),p(2),b()()),t&2){let n=m().$implicit;xo(n.item.level),W("morseEnter",0),u(2),N(n.item.text)}}function c2(t,e){if(t&1&&(g(0,"span",51),p(1),b()),t&2){let n=m(2).$implicit,o=m();u(),ue("~",o.formatTokens(n.item.tokensBefore)," tokens folded")}}function l2(t,e){if(t&1&&(g(0,"div",52),xe(1,"morse-markdown",45),b()),t&2){let n=m(2).$implicit;W("morseEnter",0),u(),W("text",n.item.summary)}}function d2(t,e){if(t&1){let n=H();g(0,"div",18)(1,"button",48),R("click",function(){M(n);let i=m().$implicit,r=m();return I(r.toggleCompaction(i.key))}),xe(2,"span",49),g(3,"span",50),p(4,"\u26A1 Compacted"),b(),T(5,c2,2,1,"span",51),xe(6,"span",49),b(),T(7,l2,2,2,"div",52),b()}if(t&2){let n=m().$implicit,o=m();W("morseEnter",0),u(),W("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),D(n.item.tokensBefore?5:-1),u(2),D(o.expandedCompaction()===n.key&&n.item.summary?7:-1)}}function u2(t,e){if(t&1&&T(0,n2,11,9,"div",14)(1,r2,3,2,"div",15)(2,s2,1,3,"morse-tool-group",16)(3,a2,3,4,"div",17)(4,d2,8,4,"div",18),t&2){let n,o=e.$implicit;D((n=o.kind)==="user"?0:n==="assistant"?1:n==="process"?2:n==="notice"?3:n==="compaction"?4:-1)}}function p2(t,e){if(t&1&&(g(0,"span",59),p(1),b()),t&2){let n=e.$implicit;u(),N(n)}}function f2(t,e){t&1&&(p(0,", or select code and pin it with the "),g(1,"span",63),p(2,"\u29C9"),b(),p(3," button under the chat"))}function m2(t,e){if(t&1&&(g(0,"div",7)(1,"div",53),xe(2,"span",54),g(3,"span",55,2),xe(5,"span",56)(6,"span",56)(7,"span",57),b()(),g(8,"div",58),ce(9,p2,2,1,"span",59,ls),b(),g(11,"div",60),p(12,"the pi coding agent"),b(),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. "),b(),g(15,"p",62),p(16," Try "),g(17,"em"),p(18,"\u201Cexplain this repository\u201D"),b(),p(19," or "),g(20,"em"),p(21,"\u201Cwhy is this failing?\u201D"),b(),T(22,f2,4,0),p(23,". "),b()()),t&2){let n=m();u(9),le(n.heroLetters),u(13),D(n.canPinSelection()?22:-1)}}function h2(t,e){if(t&1){let n=H();g(0,"button",64),R("click",function(){M(n);let i=m();return I(i.jumpToLatest())}),p(1,"\u2193 Latest"),b()}}function g2(t,e){if(t&1){let n=H();g(0,"div",65),R("click",function(){M(n);let i=m();return I(i.closeImage())}),g(1,"button",66),R("click",function(){M(n);let i=m();return I(i.closeImage())}),p(2," \xD7 "),b(),g(3,"figure",67),R("click",function(i){return i.stopPropagation()}),xe(4,"img",33),g(5,"figcaption"),p(6),b()()()}if(t&2){let n=e;u(4),W("src",n.src,bo)("alt",n.label),u(2),N(n.label)}}var y2={png:"png",jpeg:"jpg",jpg:"jpg",webp:"webp",gif:"gif","svg+xml":"svg",bmp:"bmp",avif:"avif"},nE=160;function v2(t){let e=t.replace(/\s+/g," ").trim();return e.length>nE?`${e.slice(0,nE)}\u2026`:e}var yu=class t{morse=k(ht);animation=k(an);handoff=k(bs);scrollHost=Qe.required("scroll");inner=Qe("inner");heroMark=Qe("heroMark");heroLetters=["M","o","r","s","e"];canPinSelection=E(()=>this.morse.capabilities()?.editorContext===!0);copiedId=O(null);preview=O(null);editingId=O(null);editingText=O("");pinned=O(!0);working=E(()=>this.morse.state().streaming);rows=E(()=>Xx(this.morse.items()));activeProcess=E(()=>Jx(this.rows()));railPrompts=E(()=>this.rows().filter(e=>e.kind==="user").map(e=>({id:e.item.id,preview:v2(e.item.text)})));activePromptId=O(null);expandedCompaction=O(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=E(()=>this.morse.hasOlderHistory());loadingOlderHistory=E(()=>this.morse.loadingOlderHistory());activePending=!1;bottomDistance=0;anchorScroll=!1;previousFirstId;previousSessionId;previousLength=0;constructor(){se(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())}),se(()=>{this.rows(),this.pinned()&&this.afterRender(()=>this.scrollToBottom())}),se(()=>{this.rows().at(-1)?.kind==="user"&&this.animation.pulse(this.inner()?.nativeElement??null)}),se(()=>{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})})}),se(()=>{this.railPrompts(),this.afterRender(()=>this.updateActivePrompt())}),se(()=>{let e=this.morse.state().sessionId,n=this.morse.items(),o=n[0]?.id,i=e===this.previousSessionId&&this.previousFirstId!==void 0&&o!==this.previousFirstId&&n.length>this.previousLength;this.previousSessionId=e,this.previousFirstId=o,this.previousLength=n.length,i&&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,i=n[0]?.dataset.promptId??null;for(let s of Array.from(n))if(s.getBoundingClientRect().top<=o)i=s.dataset.promptId??i;else break;e.scrollHeight-e.scrollTop-e.clientHeight<=Math.max(48,e.clientHeight*.1)&&(i=n[n.length-1]?.dataset.promptId??i),this.activePromptId.set(i)}scrollToPrompt(e){let n=this.scrollHost().nativeElement,o=n.querySelector(`[data-prompt-id="${e}"]`);if(!o)return;let i=o.getBoundingClientRect().top-n.getBoundingClientRect().top+n.scrollTop-12;this.pinned.set(!1),this.animation.isEnabled&&typeof n.scrollTo=="function"?n.scrollTo({top:i,behavior:"smooth"}):n.scrollTop=i,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 eC(e.text)}pinsOf(e){return e.pins}pinRange(e){return e.startLine===void 0?"":e.endLine!==void 0&&e.endLine!==e.startLine?`L${e.startLine}-${e.endLine}`:`L${e.startLine}`}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()??"",i=y2[o]??(o.replace(/[^a-z0-9]/g,"")||"png");return n===0?`image.${i}`:`image-${n+1}.${i}`}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(i=>`${i.path}${i.startLine!==void 0?`:${i.startLine}-${i.endLine??i.startLine}`:""}`).map(i=>`@${i}`).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=ae({type:t,selectors:[["morse-chat-transcript"]],viewQuery:function(n,o){n&1&&ft(o.scrollHost,jR,5)(o.inner,BR,5)(o.heroMark,$R,5),n&2&&vt(3)},hostBindings:function(n,o){n&1&&R("keydown.escape",function(){return o.onEscape()},Dt)},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),R("scroll",function(r){return o.onScroll(r)}),g(2,"div",4,1),T(4,qR,3,1,"div",5)(5,WR,3,0,"div",6),ce(6,u2,5,1,null,null,HR,!1,m2,24,1,"div",7),b()(),g(9,"morse-prompt-rail",8),R("pick",function(r){return o.scrollToPrompt(r)}),b(),T(10,h2,2,0,"button",9),T(11,g2,7,3,"div",10)),n&2){let i;u(2),de("blank",o.rows().length===0),u(2),D(o.hasOlderHistory()||o.loadingOlderHistory()?4:o.rows().length>0?5:-1),u(2),le(o.rows()),u(3),W("prompts",o.railPrompts())("activeId",o.activePromptId()),u(),D(!o.pinned()&&o.rows().length>0?10:-1),u(),D((i=o.preview())?11:-1,i)}},dependencies:[pu,hu,cn,gu],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 _2=["source"],b2=["gutter"],x2=(t,e)=>e.id;function C2(t,e){t&1&&(v(0,"span",5),p(1),x()),t&2&&(ve("title","Pinned to the next prompt"),u(),N(e))}function E2(t,e){if(t&1&&(v(0,"span",5),p(1),x()),t&2){let n=m();ve("title","Pinned to the next prompt"),u(),N(n.pinnedCount()===1?"1 range":n.pinnedCount()+" ranges")}}function w2(t,e){if(t&1&&(v(0,"p",9),p(1),x()),t&2){let n=m();u(),ue("Reading ",n.tab().title,"\u2026")}}function S2(t,e){t&1&&(v(0,"p",10),p(1),x()),t&2&&(u(),N(e))}function T2(t,e){if(t&1&&(v(0,"p",9),p(1),x()),t&2){let n=m();u(),ue("Binary file \xB7 ",n.size()," \xB7 no text preview.")}}function D2(t,e){if(t&1){let n=H();v(0,"span",18),U("pointerdown",function(i){let r=M(n).$implicit,s=m(2);return I(s.startSelection(i,r))}),p(1),x()}if(t&2){let n=e.$implicit,o=m(2);de("selected",o.isSelected(n)),oe("data-line",n),u(),N(n)}}function M2(t,e){if(t&1){let n=H();v(0,"span",19)(1,"span",20),U("pointerdown",function(i){let r=M(n).$implicit,s=m(2);return I(s.startResizeEdge(i,r,"start"))}),x(),v(2,"span",21),U("pointerdown",function(i){let r=M(n).$implicit,s=m(2);return I(s.startResizeEdge(i,r,"end"))}),x()()}if(t&2){let n=e.$implicit,o=m(2);fn("top",o.topOf(n),"px")("height",o.heightOf(n),"px"),de("merged",n.id===o.mergedId())}}function I2(t,e){if(t&1&&(v(0,"p",9),p(1),x()),t&2){let n=m(2);u(),ue("Showing the first 512 KB of ",n.size(),".")}}function k2(t,e){if(t&1&&(v(0,"div",11)(1,"div",12,0),ce(3,D2,2,4,"span",13,ti),x(),v(5,"div",14)(6,"pre",15,1),Fe(8,"code",16),x(),ce(9,M2,3,6,"span",17,x2),x()(),T(11,I2,2,1,"p",9)),t&2){let n=m();u(3),le(n.lines()),u(5),ve("innerHTML",n.highlighted(),Ca),u(),le(n.highlights()),u(2),D(n.tab().truncated?11:-1)}}function N2(t){return t===void 0?"":t.start===t.end?`L${t.start}`:`L${t.start}\u2013${t.end}`}var O2=19.2,vu=class t{tab=ee.required();tabs=k(_n);attachments=k(Ho);animation=k(an);sanitizer=k(Pa);sourceElement=Qe("source");gutterElement=Qe("gutter");source=E(()=>{let e=this.tab().content??"";return e.endsWith(`
91
+ `)?e.slice(0,-1):e});lines=E(()=>{let e=this.source(),n=e.length===0?1:e.split(`
92
+ `).length;return Array.from({length:n},(o,i)=>i+1)});highlighted=E(()=>{let e=this.tab();return e.content===void 0||e.binary?this.sanitizer.bypassSecurityTrustHtml(""):this.sanitizer.bypassSecurityTrustHtml(Wd(this.source(),e.language).html)});language=E(()=>this.tab().language??"text");size=E(()=>A2(this.tab().size??0));lineHeight=O(O2);selected=O(void 0);editingId=O(void 0);mergedId=O(void 0);anchor=1;rangeLabel=E(()=>N2(this.selected()));highlights=E(()=>{let e=this.tab().path,n=this.editingId(),o=this.attachments.pins().filter(r=>r.path===e&&r.startLine!==void 0&&r.id!==n).map(r=>({id:r.id,start:r.startLine,end:r.endLine??r.startLine})),i=this.selected();return i===void 0?o:[...o,{id:"live",start:i.start,end:i.end}]});pinnedCount=E(()=>this.highlights().filter(e=>e.id!=="live").length);topOf(e){return(e.start-1)*this.lineHeight()}heightOf(e){return(e.end-e.start+1)*this.lineHeight()}constructor(){ei(()=>this.measureLineHeight()),se(()=>{this.tab(),Po(()=>this.selected.set(void 0))})}isSelected(e){return this.highlights().some(n=>e>=n.start&&e<=n.end)}startSelection(e,n){if(e.button!==0)return;e.preventDefault(),this.anchor=n,this.editingId.set(this.highlights().find(s=>s.id!=="live"&&n>=s.start&&n<=s.end)?.id),this.selected.set({start:n,end:n});let o=e.currentTarget;try{o.setPointerCapture(e.pointerId)}catch{}let i=s=>{let a=this.lineAt(s.clientY);a!==void 0&&this.selected.set({start:Math.min(this.anchor,a),end:Math.max(this.anchor,a)})},r=()=>{o.removeEventListener("pointermove",i),o.removeEventListener("pointerup",r),o.removeEventListener("pointercancel",r),this.pinSelection()};o.addEventListener("pointermove",i),o.addEventListener("pointerup",r),o.addEventListener("pointercancel",r)}clearSelection(){this.selected.set(void 0),this.editingId.set(void 0)}reload(){this.tabs.reload(this.tab().id)}startResizeEdge(e,n,o){if(e.button!==0)return;e.preventDefault(),e.stopPropagation();let i=e.currentTarget;try{i.setPointerCapture(e.pointerId)}catch{}let r=a=>{let c=this.lineAt(a.clientY);if(c===void 0)return;let l=this.attachments.pins().find(C=>C.id===n.id),d=l?.startLine??n.start,f=l?.endLine??d,y=o==="start"?Math.min(c,f):d,_=o==="end"?Math.max(c,d):f;this.attachments.setPinRange(n.id,{startLine:y,endLine:_>y?_:void 0})},s=()=>{i.removeEventListener("pointermove",r),i.removeEventListener("pointerup",s),i.removeEventListener("pointercancel",s);let a=this.attachments.pins().find(c=>c.id===n.id);if(a?.startLine!==void 0){let c=this.attachments.pins().length,l=this.attachments.pin({path:this.tab().path,startLine:a.startLine,endLine:a.endLine},n.id);this.attachments.pins().length<c&&this.celebrate(l,{start:a.startLine,end:a.endLine??a.startLine})}};i.addEventListener("pointermove",r),i.addEventListener("pointerup",s),i.addEventListener("pointercancel",s)}measureLineHeight(){let e=this.sourceElement()?.nativeElement;if(e===void 0)return;let n=Number.parseFloat(getComputedStyle(e).lineHeight);Number.isFinite(n)&&n>0&&this.lineHeight.set(n)}lineAt(e){let n=this.gutterElement()?.nativeElement;if(n===void 0)return;let o=n.getBoundingClientRect().top,i=Math.floor((e-o)/this.lineHeight())+1;return Math.min(this.lines().length,Math.max(1,i))}pinSelection(){let e=this.selected();if(e===void 0)return;let n=e.end>e.start?e.end:void 0,o=this.attachments.pins().length,i=this.attachments.pin({path:this.tab().path,startLine:e.start,endLine:n},this.editingId());this.attachments.pins().length<o&&this.celebrate(i,{start:e.start,end:e.end}),this.attachments.say("info",`Pinned ${this.tab().title} ${this.rangeLabel()} to this message.`),this.selected.set(void 0),this.editingId.set(void 0)}celebrate(e,n){if(e.length===0)return;this.mergedId.set(e),setTimeout(()=>{this.mergedId()===e&&this.mergedId.set(void 0)},720);let o=this.attachments.pins().find(l=>l.id===e),i=this.sourceElement()?.nativeElement.closest(".source-wrap");if(o?.startLine===void 0||!(i instanceof HTMLElement))return;let r=o.startLine,s=o.endLine??r,a=this.lineHeight(),c=s>n.end?n.end*a:r<n.start?(n.start-1)*a:((n.start+n.end)/2-.5)*a;this.animation.confetti(i,{x:i.clientWidth/2,y:c})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ae({type:t,selectors:[["morse-file-preview"]],viewQuery:function(n,o){n&1&&ft(o.sourceElement,_2,5)(o.gutterElement,b2,5),n&2&&vt(2)},inputs:{tab:[1,"tab"]},decls:16,vars:6,consts:[["gutter",""],["source",""],[1,"head"],[1,"path",3,"title"],[1,"meta"],[1,"range",3,"title"],[1,"badge"],[1,"stat"],["type","button","title","Reload from disk","aria-label","Reload from disk",1,"icon",3,"click"],[1,"hint"],[1,"hint","error"],[1,"code"],["title","Drag line numbers to pin a range to your next message",1,"gutter"],[1,"num",3,"selected"],[1,"source-wrap"],[1,"source"],[1,"hljs",3,"innerHTML"],[1,"selection",3,"merged","top","height"],[1,"num",3,"pointerdown"],[1,"selection"],["title","Drag to resize","aria-hidden","true",1,"edge","top",3,"pointerdown"],["title","Drag to resize","aria-hidden","true",1,"edge","bottom",3,"pointerdown"]],template:function(n,o){if(n&1&&(v(0,"header",2)(1,"span",3),p(2),x(),v(3,"div",4),T(4,C2,2,2,"span",5)(5,E2,2,2,"span",5),v(6,"span",6),p(7),x(),v(8,"span",7),p(9),x(),v(10,"button",8),U("click",function(){return o.reload()}),p(11," \u27F3 "),x()()(),T(12,w2,2,1,"p",9)(13,S2,2,1,"p",10)(14,T2,2,1,"p",9)(15,k2,12,2)),n&2){let i,r;u(),ve("title",o.tab().path),u(),N(o.tab().path),u(2),D((i=o.rangeLabel())?4:o.pinnedCount()>0?5:-1,i),u(3),N(o.language()),u(2),N(o.size()),u(3),D(o.tab().loading?12:(r=o.tab().error)?13:o.tab().binary?14:15,r)}},styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0}.head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex:none;min-height:var(--%NS%morse-head-height);padding:0 10px 0 14px;border-bottom:1px solid var(--%NS%morse-border)}.path[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--%NS%morse-font-mono);font-size:12px;color:var(--%NS%morse-fg)}.meta[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex:none}.badge[_ngcontent-%COMP%]{padding:1px 6px;border-radius:999px;background:var(--%NS%morse-badge-bg, var(--%NS%morse-hover));color:var(--%NS%morse-fg-muted);font-size:10.5px;text-transform:uppercase;letter-spacing:.05em}.stat[_ngcontent-%COMP%]{color:var(--%NS%morse-fg-muted);font-size:11px}.range[_ngcontent-%COMP%]{padding:1px 7px;border-radius:999px;background:color-mix(in srgb,var(--%NS%morse-accent) 22%,transparent);color:var(--%NS%morse-fg);font-size:11px;font-variant-numeric:tabular-nums}.icon[_ngcontent-%COMP%]{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:var(--%NS%morse-radius-sm);background:none;color:var(--%NS%morse-fg-muted);cursor:pointer}.icon[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.code[_ngcontent-%COMP%]{display:flex;flex:1;min-height:0;overflow:auto;padding:8px 0;background:var(--%NS%morse-code-bg, var(--%NS%morse-bg))}pre[_ngcontent-%COMP%], .gutter[_ngcontent-%COMP%]{margin:0;font-family:var(--%NS%morse-font-mono);font-size:12px;line-height:1.6}.gutter[_ngcontent-%COMP%]{flex:none;position:sticky;left:0;z-index:2;padding:0 10px 0 14px;color:var(--%NS%morse-fg-muted);text-align:right;-webkit-user-select:none;user-select:none;background:var(--%NS%morse-code-bg, var(--%NS%morse-bg));opacity:.7}.gutter[_ngcontent-%COMP%] .num[_ngcontent-%COMP%]{display:block;height:1.6em;cursor:pointer;font-variant-numeric:tabular-nums}.gutter[_ngcontent-%COMP%] .num.selected[_ngcontent-%COMP%]{color:var(--%NS%morse-fg);background:color-mix(in srgb,var(--%NS%morse-accent) 34%,transparent);opacity:1}.source-wrap[_ngcontent-%COMP%]{position:relative;flex:1;min-width:0}.source[_ngcontent-%COMP%]{position:relative;z-index:1;padding:0 16px 0 4px;white-space:pre}.selection[_ngcontent-%COMP%]{position:absolute;left:0;right:0;z-index:2;pointer-events:none;background:color-mix(in srgb,var(--%NS%morse-accent) 16%,transparent);border-left:2px solid color-mix(in srgb,var(--%NS%morse-accent) 70%,transparent)}.selection.merged[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_selection-merged .62s ease-out}@keyframes _ngcontent-%COMP%_selection-merged{0%{background:color-mix(in srgb,var(--%NS%morse-accent) 60%,transparent);box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--%NS%morse-accent) 80%,transparent)}to{background:color-mix(in srgb,var(--%NS%morse-accent) 16%,transparent);box-shadow:inset 0 0 0 0 transparent}}@property --%NS%morse-rainbow{syntax: "<angle>"; initial-value: 0deg; inherits: false;}.selection.merged[_ngcontent-%COMP%]:after{content:"";position:absolute;inset:0;border-radius:3px;padding:2px;background:conic-gradient(from var(--%NS%morse-rainbow),#f43f5e,#fb923c,#facc15,#4ade80,#38bdf8,#a78bfa,#f43f5e);-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);mask-composite:exclude;pointer-events:none;animation:_ngcontent-%COMP%_morse-rainbow-spin .7s linear}@keyframes _ngcontent-%COMP%_morse-rainbow-spin{0%{--%NS%morse-rainbow: 0deg}to{--%NS%morse-rainbow: 360deg}}.edge[_ngcontent-%COMP%]{position:absolute;left:0;right:0;height:6px;pointer-events:auto;cursor:ns-resize}.edge.top[_ngcontent-%COMP%]{top:-3px}.edge.bottom[_ngcontent-%COMP%]{bottom:-3px}.edge[_ngcontent-%COMP%]:hover{background:color-mix(in srgb,var(--%NS%morse-accent) 70%,transparent)}.hint[_ngcontent-%COMP%]{margin:0;padding:12px 16px;color:var(--%NS%morse-fg-muted);font-size:12px}.hint.error[_ngcontent-%COMP%]{color:var(--%NS%morse-warn)}']})};function A2(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(t<10*1024?1:0)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}var P2=(t,e)=>e.value;function R2(t,e){t&1&&(v(0,"p",1),p(1),x()),t&2&&(u(),N(e))}function L2(t,e){if(t&1){let n=H();v(0,"button",4),U("click",function(){let i=M(n).$implicit,r=m(3);return I(r.choose(i.value))}),p(1),x()}if(t&2){let n=e.$implicit;u(),ue(" ",n.label," ")}}function F2(t,e){if(t&1&&(T(0,R2,2,1,"p",1),v(1,"div",2),ce(2,L2,2,1,"button",3,P2),x()),t&2){let n,o=m(),i=m();D((n=i.messageOf(o))?0:-1,n),u(2),le(i.optionsOf(o))}}function V2(t,e){if(t&1){let n=H();v(0,"p"),p(1),x(),v(2,"div",2)(3,"button",5),U("click",function(){M(n);let i=m(2);return I(i.decide(!0))}),p(4,"Yes"),x(),v(5,"button",4),U("click",function(){M(n);let i=m(2);return I(i.decide(!1))}),p(6,"No"),x()()}if(t&2){let n=m(),o=m();u(),N(o.messageOf(n))}}function j2(t,e){if(t&1){let n=H();v(0,"input",6),U("input",function(i){M(n);let r=m(2);return I(r.onInput(i))}),x(),v(1,"div",2)(2,"button",5),U("click",function(){M(n);let i=m(2);return I(i.submit())}),p(3,"Submit"),x(),v(4,"button",4),U("click",function(){M(n);let i=m(2);return I(i.cancel())}),p(5,"Cancel"),x()()}if(t&2){let n=m(),o=m();ve("value",o.value()||o.prefillOf(n))("placeholder",o.placeholderOf(n))}}function B2(t,e){if(t&1){let n=H();v(0,"textarea",7),U("input",function(i){M(n);let r=m(2);return I(r.onInput(i))}),x(),v(1,"div",2)(2,"button",5),U("click",function(){M(n);let i=m(2);return I(i.submit())}),p(3,"Submit"),x(),v(4,"button",4),U("click",function(){M(n);let i=m(2);return I(i.cancel())}),p(5,"Cancel"),x()()}if(t&2){let n=m(),o=m();ve("value",o.value()||o.prefillOf(n))}}function $2(t,e){if(t&1&&(v(0,"section",0)(1,"header"),p(2),x(),T(3,F2,4,1)(4,V2,7,1)(5,j2,6,2)(6,B2,6,1),x()),t&2){let n,o=e;u(2),N(o.title),u(),D((n=o.kind)==="select"?3:n==="confirm"?4:n==="input"?5:n==="editor"?6:-1)}}var _u=class t{morse=k(ht);request=this.morse.pendingInteraction;value=O("");visible=E(()=>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(j({requestId:n.requestId},e))}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ae({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,$2,7,2,"section",0),n&2){let i;D((i=o.visible()&&o.request())?0:-1,i)}},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}"]})};function oE(t){let e={name:"",path:"",kind:"dir",children:[]},n=new Map([["",e]]),o=i=>{let r=n.get(i);if(r!==void 0)return r;let s=i.lastIndexOf("/"),a=o(s===-1?"":i.slice(0,s)),c={name:i.slice(s+1),path:i,kind:"dir",children:[]};return a.children.push(c),n.set(i,c),c};for(let i of t){let r=i.endsWith("/"),s=r?i.slice(0,-1):i;if(s.length===0)continue;if(r){o(s);continue}let a=s.lastIndexOf("/"),c=o(a===-1?"":s.slice(0,a));c.children.some(l=>l.kind==="file"&&l.path===s)||c.children.push({name:s.slice(a+1),path:s,kind:"file",children:[]})}return iE(e.children),e.children}function iE(t){t.sort((e,n)=>e.kind!==n.kind?e.kind==="dir"?-1:1:e.name.localeCompare(n.name,void 0,{sensitivity:"base"}));for(let e of t)iE(e.children)}function bu(t){let e=t.lastIndexOf("."),n=e<=0?"":t.slice(e+1).toLowerCase();return["ts","tsx","js","jsx","mjs","cjs","py","go","php","rb","rs","java"].includes(n)?"\u25C6":["md","txt","rst"].includes(n)?"\xB6":["json","yaml","yml","toml","ini"].includes(n)?"\u2699":["css","scss","less","html","xml","svg"].includes(n)?"\u25C8":["sh","bash","zsh"].includes(n)?"\u276F":"\xB7"}var H2=t=>({items:t,label:"Open tabs"}),U2=t=>({items:t,label:"Mentioned files"}),z2=(t,e)=>e.id;function G2(t,e){if(t&1){let n=H();g(0,"div",5),R("click",function(){let i=M(n).$implicit,r=m(2);return I(r.select(i.id))})("keydown.enter",function(){let i=M(n).$implicit,r=m(2);return I(r.select(i.id))})("keydown.space",function(){let i=M(n).$implicit,r=m(2);return I(r.select(i.id))})("contextmenu",function(i){let r=M(n).$implicit,s=m(2);return I(s.openMenu(i,r.id))})("auxclick",function(i){let r=M(n).$implicit,s=m(2);return I(s.onAuxClick(r.id,i))}),g(1,"span",6),p(2),b(),g(3,"span",7),p(4),b(),g(5,"button",8),R("click",function(i){let r=M(n).$implicit,s=m(2);return I(s.close(r.id,i))}),p(6," \xD7 "),b()()}if(t&2){let n=e.$implicit,o=m(2);de("active",n.id===o.activeId()),W("title",o.title(n)),oe("aria-selected",n.id===o.activeId()),u(2),N(o.glyph(n)),u(2),N(n.title),u(),W("title","Close "+n.title)}}function q2(t,e){t&1&&(g(0,"span",4),p(1,"No open tabs"),b())}function W2(t,e){if(t&1&&(g(0,"div",2),ce(1,G2,7,7,"div",3,z2,!1,q2,2,0,"span",4),b()),t&2){let n=e.items,o=e.label;oe("aria-label",o),u(),le(n)}}function Y2(t,e){if(t&1&&Ta(0,1),t&2){let n=m(),o=Ql(1);W("ngTemplateOutlet",o)("ngTemplateOutletContext",Jl(2,U2,n.mentionTabs()))}}function Z2(t,e){if(t&1){let n=H();g(0,"div",9),R("click",function(){M(n);let i=m();return I(i.closeMenu())})("contextmenu",function(i){M(n);let r=m();return i.preventDefault(),I(r.closeMenu())}),b(),g(1,"div",10)(2,"button",11),R("click",function(){M(n);let i=m();return I(i.menuClose())}),p(3,"Close"),b(),g(4,"button",12),R("click",function(){M(n);let i=m();return I(i.menuCloseOthers())}),p(5," Close Others "),b(),g(6,"button",12),R("click",function(){M(n);let i=m();return I(i.menuCloseToTheRight())}),p(7," Close to the Right "),b(),g(8,"button",11),R("click",function(){M(n);let i=m();return I(i.menuCloseAll())}),p(9,"Close All"),b()()}if(t&2){let n=e,o=m();u(),fn("left",n.x,"px")("top",n.y,"px"),u(3),W("disabled",!o.closableOthers()),u(2),W("disabled",!o.canCloseToTheRight(n.id))}}var xu=class t{tabs=k(_n);items=this.tabs.tabs;activeId=this.tabs.activeId;mainTabs=this.tabs.mainTabs;mentionTabs=this.tabs.mentionTabs;menuState=O(void 0);menu=this.menuState.asReadonly();closableOthers=E(()=>this.items().length>1);glyph(e){return e.kind==="session"?"\u2726":bu(e.title)}title(e){return e.kind==="file"?e.path:e.title}select(e){this.tabs.select(e)}close(e,n){n.stopPropagation(),this.tabs.close(e)}onAuxClick(e,n){n.button===1&&(n.preventDefault(),this.tabs.close(e))}openMenu(e,n){e.preventDefault(),e.stopPropagation(),this.menuState.set({x:Math.max(0,Math.min(e.clientX,window.innerWidth-190)),y:Math.max(0,Math.min(e.clientY,window.innerHeight-150)),id:n})}closeMenu(){this.menuState.set(void 0)}onEscape(){this.closeMenu()}canCloseToTheRight(e){let n=this.items().findIndex(o=>o.id===e);return n!==-1&&n<this.items().length-1}withMenu(e){let n=this.menuState();this.closeMenu(),n!==void 0&&e(n.id)}menuClose(){this.withMenu(e=>this.tabs.close(e))}menuCloseOthers(){this.withMenu(e=>this.tabs.closeOthers(e))}menuCloseToTheRight(){this.withMenu(e=>this.tabs.closeToTheRight(e))}menuCloseAll(){this.closeMenu(),this.tabs.closeAll()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ae({type:t,selectors:[["morse-tab-strip"]],hostBindings:function(n,o){n&1&&R("keydown.escape",function(){return o.onEscape()},Dt)},decls:5,vars:6,consts:[["row",""],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["role","tablist",1,"strip"],["role","tab","tabindex","0",1,"tab",3,"active","title"],[1,"empty"],["role","tab","tabindex","0",1,"tab",3,"click","keydown.enter","keydown.space","contextmenu","auxclick","title"],["aria-hidden","true",1,"glyph"],[1,"label"],["type","button","aria-label","Close tab",1,"close",3,"click","title"],[1,"context-menu-layer",3,"click","contextmenu"],["role","menu",1,"context-menu"],["type","button",1,"context-menu-item",3,"click"],["type","button",1,"context-menu-item",3,"click","disabled"]],template:function(n,o){if(n&1&&(Kl(0,W2,4,2,"ng-template",null,0,Am),Ta(2,1),T(3,Y2,1,4,"ng-container",1),T(4,Z2,10,6)),n&2){let i,r=Ql(1);u(2),W("ngTemplateOutlet",r)("ngTemplateOutletContext",Jl(4,H2,o.mainTabs())),u(),D(o.mentionTabs().length>0?3:-1),u(),D((i=o.menu())?4:-1,i)}},dependencies:[Lm],styles:["[_nghost-%COMP%]{display:block;flex:none;min-height:30px;border-bottom:1px solid var(--%NS%morse-border);background:var(--%NS%morse-nav-bg)}.strip[_ngcontent-%COMP%]{display:flex;align-items:stretch;gap:0;height:30px;padding:0;overflow-x:auto;scrollbar-width:none}.strip[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.strip[_ngcontent-%COMP%] + .strip[_ngcontent-%COMP%]{border-top:1px solid var(--%NS%morse-border)}.tab[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;flex:none;max-width:170px;padding:0 8px 0 10px;margin:0;border:0;border-right:1px solid var(--%NS%morse-border);border-radius:0;background:none;color:var(--%NS%morse-fg-muted);font:inherit;font-size:12px;cursor:pointer}.tab[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.tab.active[_ngcontent-%COMP%]{background:var(--%NS%morse-panel, var(--%NS%morse-badge-bg));color:var(--%NS%morse-fg);box-shadow:inset 0 -2px 0 var(--%NS%morse-accent)}.glyph[_ngcontent-%COMP%]{flex:none;font-size:11px;color:var(--%NS%morse-fg-muted)}.tab.active[_ngcontent-%COMP%] .glyph[_ngcontent-%COMP%]{color:var(--%NS%morse-accent)}.label[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.close[_ngcontent-%COMP%]{flex:none;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:4px;background:none;color:var(--%NS%morse-fg-muted);font-size:13px;line-height:1;cursor:pointer;opacity:0}.tab[_ngcontent-%COMP%]:hover .close[_ngcontent-%COMP%], .tab.active[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{opacity:1}.close[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.empty[_ngcontent-%COMP%]{align-self:center;padding:0 10px;font-size:11.5px;color:var(--%NS%morse-fg-muted)}.context-menu-layer[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:40}.context-menu[_ngcontent-%COMP%]{position:fixed;z-index:41;width:190px;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-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:not(:disabled), .context-menu-item[_ngcontent-%COMP%]:focus-visible:not(:disabled){background:var(--%NS%morse-hover)}.context-menu-item[_ngcontent-%COMP%]:disabled{color:var(--%NS%morse-fg-muted);cursor:default}.context-menu-item[_ngcontent-%COMP%]:disabled:hover{background:transparent}"]})};var Os=520,rE=70,Cu=class t{animation=k(an);async play(e,n){let o=this.resolveTarget();if(!this.animation.isEnabled||!n||!o||e.length===0||typeof document>"u")return;let i=Os+(e.length-1)*rE;e.forEach((r,s)=>{this.launch(r,n,o,s*rE)}),await K2(i)}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,i){let r=this.createGhost(e,n);document.body.appendChild(r);let s=Math.min(n.y,o.y)-Math.max(60,Math.abs(n.y-o.y)*.35);nn(r,{translateX:[n.x,o.x],translateY:[{to:n.y,duration:Os*.18},{to:s,duration:Os*.42},{to:o.y,duration:Os*.4}],rotate:[0,-8,6,0],scale:[1,1.04,.86,.42],opacity:[1,1,.9,0],duration:Os,delay:i,ease:"inOut(2)",onComplete:()=>r.remove()}),setTimeout(()=>r.remove(),i+Os+400)}createGhost(e,n){let o=document.createElement("div");if(o.className="drop-ghost",e.thumbnail){let r=document.createElement("img");r.src=e.thumbnail,r.alt="",o.appendChild(r)}else{let r=document.createElement("span");r.className="drop-ghost-glyph",r.textContent="\u25A4",o.appendChild(r)}let i=document.createElement("span");return i.className="drop-ghost-name",i.textContent=e.name,o.appendChild(i),o}static \u0275fac=function(n){return new(n||t)};static \u0275prov=De({token:t,factory:t.\u0275fac,providedIn:"root"})};function K2(t){return new Promise(e=>setTimeout(e,t))}var Eu=class t{attachments=k(Ho);flight=k(Cu);uploads=k(Es);depth=O(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=E(()=>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 i=Array.from(o.files??[]),{images:r}=await this.attachments.read(i.filter(w=>w.type.startsWith("image/"))),s=J2(o),a=i.filter(w=>!w.type.startsWith("image/")),c=this.uploads.available()&&a.length>0?this.uploads.upload(a):Promise.resolve({added:[],failed:a.map(w=>w.name)}),l=[...s.paths.map(w=>sE(w,n)),...s.names,...a.map(w=>w.name)],d=e.clientX>0||e.clientY>0?{x:e.clientX,y:e.clientY}:Q2();await this.flight.play([...r.map(w=>({name:w.name,thumbnail:`data:${w.mimeType};base64,${w.data}`})),...l.map(w=>({name:w}))],d);let f=await c,y=[...s.paths.map(w=>sE(w,n)),...s.names,...f.added.map(w=>w.path),...f.failed];this.attachments.add(r),this.attachments.addMentions(y);let _=[];if(r.length>0&&_.push(`${r.length} image${r.length===1?"":"s"} attached`),y.length>0&&_.push(`${y.length} file${y.length===1?"":"s"} added to the prompt`),_.length>0){this.attachments.say("info",_.join(" \xB7 "));return}let C=Array.from(o.types??[]).join(", ")||"none";this.attachments.say("warn",`That drop carried no file (types: ${C}).`)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=De({token:t,factory:t.\u0275fac,providedIn:"root"})};function Q2(){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 X2=["application/vnd.code.uri-list","ResourceURLs","text/uri-list"];function J2(t){let e=[];for(let i of[...X2,"text/plain"])for(let r of eL(t.getData(i)))e.push(r);let n=[],o=[];for(let i of e){if(i.startsWith("file://")){let s=iL(i);s&&n.push(s);continue}if(/^[a-z]+:\/\//i.test(i))continue;if(oL(i)){n.push(i);continue}let r=nL(i);r&&o.push(r)}return{paths:Array.from(new Set(n)),names:Array.from(new Set(o))}}function eL(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 i=o,r=i.fsPath??i.uri??i.path;return typeof r=="string"?r:""}).filter(o=>o.length>0)}catch{}return tL(e)}function tL(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 nL(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 oL(t){return!!(t.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t))}function iL(t){try{let e=new URL(t);return decodeURIComponent(e.pathname)}catch{return}}function sE(t,e){if(!e)return t;let n=e.endsWith("/")?e:`${e}/`;return t.startsWith(n)?t.slice(n.length):t}var rL="https://registry.npmjs.org/@supanadit/morse-web/latest";function sL(t){return`https://github.com/supanadit/morse/releases/tag/v${t}`}var aL=new He("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 cL(t){let e=t;return typeof e?.version=="string"?e.version:void 0}function lL(t,e){let n=cE(t),o=cE(e);if(n===void 0||o===void 0)return!1;for(let i=0;i<n.numbers.length;i+=1)if(n.numbers[i]!==o.numbers[i])return n.numbers[i]>o.numbers[i];return n.prerelease===o.prerelease?!1:n.prerelease===void 0?!0:o.prerelease===void 0?!1:n.prerelease>o.prerelease}function dL(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 aE(){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 cE(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 As=class t{morse=k(ht);loader=k(aL);notice=O(void 0);started=!1;available=this.notice.asReadonly();constructor(){se(()=>{let e=this.morse.capabilities();this.started||aE()===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 i=aE()??(o===void 0?void 0:cL(await o(rL)));if(i===void 0||!lL(i,e))return;this.notice.set({current:e,latest:i,hint:dL(n,i),url:sL(i)})}catch{}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=De({token:t,factory:t.\u0275fac,providedIn:"root"})};var uL=(t,e)=>e.node.path;function pL(t,e){if(t&1){let n=H();v(0,"div",7),U("pointerdown",function(i){M(n);let r=m();return I(r.startResize(i))}),x()}}function fL(t,e){t&1&&(v(0,"p",10),p(1,"Loading files\u2026"),x())}function mL(t,e){t&1&&(v(0,"p",11),p(1),x()),t&2&&(u(),N(e))}function hL(t,e){t&1&&(v(0,"p",10),p(1,"No files found."),x())}function gL(t,e){if(t&1){let n=H();v(0,"button",13),U("click",function(){let i=M(n).$implicit,r=m(3);return I(r.onRow(i.node))}),v(1,"span",14),p(2),x(),v(3,"span",15),p(4),x()()}if(t&2){let n=e.$implicit,o=m(3);fn("padding-left",6+n.depth*12,"px"),de("dir",n.node.kind==="dir"),ve("title",n.node.path),u(2),N(o.glyph(n.node)),u(2),N(n.node.name)}}function yL(t,e){if(t&1&&ce(0,gL,5,7,"button",12,uL),t&2){let n=m(2);le(n.rows())}}function vL(t,e){if(t&1&&(v(0,"div",8),p(1),x(),v(2,"div",9),T(3,fL,2,0,"p",10)(4,mL,2,1,"p",11)(5,hL,2,0,"p",10)(6,yL,2,0),x()),t&2){let n,o=m();ve("title",o.root().cwd),u(),N(o.root().name),u(2),D(o.isLoading()&&o.rows().length===0?3:(n=o.errorMessage())?4:o.rows().length===0?5:6,n)}}var _L=140,wu=class t{morse=k(ht);tabs=k(_n);shell=k(Zt);host=k(Bt);height=this.shell.explorerHeight;entries=O([]);expanded=O(new Set);loading=O(!1);error=O(void 0);folded=O(!1);requestedCwd="";expandedFor="";root=E(()=>{let e=this.morse.state().workspace;return{cwd:e.cwd,name:e.name||CL(e.cwd)}});tree=E(()=>oE(this.entries()));rows=E(()=>bL(this.tree(),this.expanded()));fileCount=E(()=>lE(this.tree()));collapsed=this.folded.asReadonly();isLoading=this.loading.asReadonly();errorMessage=this.error.asReadonly();constructor(){se(()=>{let e=this.morse.state().workspace.cwd;Po(()=>{e.length>0&&e!==this.requestedCwd&&this.load(e)})})}glyph(e){return e.kind==="dir"?this.expanded().has(e.path)?"\u25BE":"\u25B8":bu(e.name)}isExpanded(e){return this.expanded().has(e)}toggleFold(){this.folded.update(e=>!e)}refresh(){this.load(this.root().cwd)}onRow(e){if(e.kind==="dir"){this.expanded.update(n=>{let o=new Set(n);return o.has(e.path)?o.delete(e.path):o.add(e.path),o});return}this.tabs.openFile(e.path)}startResize(e){e.preventDefault();let n=this.host.nativeElement,o=n.getBoundingClientRect().bottom,i=n.parentElement?.getBoundingClientRect().top??0,r=Math.max(_L,o-i-120),s=e.currentTarget;s.setPointerCapture(e.pointerId);let a=l=>{this.shell.setExplorerHeight(Math.min(r,o-l.clientY))},c=()=>{s.removeEventListener("pointermove",a),s.removeEventListener("pointerup",c),s.removeEventListener("pointercancel",c)};s.addEventListener("pointermove",a),s.addEventListener("pointerup",c),s.addEventListener("pointercancel",c)}async load(e){this.requestedCwd=e,this.loading.set(!0),this.error.set(void 0);try{let n=await this.morse.requestHostCommand("listFiles");if(this.root().cwd!==e)return;let o=xL(n);if(o===void 0){this.entries.set([]),this.error.set("Could not list this project.");return}this.expandedFor!==e&&(this.expanded.set(new Set),this.expandedFor=e),this.entries.set(o)}finally{this.root().cwd===e&&this.loading.set(!1)}}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ae({type:t,selectors:[["morse-file-explorer"]],hostVars:4,hostBindings:function(n,o){n&2&&(fn("height",o.collapsed()?null:o.height(),"px"),de("sized",o.height()!==void 0&&!o.collapsed()))},decls:12,vars:6,consts:[[1,"pane-head"],["role","separator","aria-orientation","horizontal","aria-label","Resize the file explorer","title","Drag to resize",1,"resize"],["type","button",1,"pane-toggle",3,"click"],[1,"chevron"],[1,"pane-title"],[1,"pane-count"],["type","button","title","Refresh files","aria-label","Refresh files",1,"icon",3,"click"],["role","separator","aria-orientation","horizontal","aria-label","Resize the file explorer","title","Drag to resize",1,"resize",3,"pointerdown"],[1,"root",3,"title"],[1,"rows"],[1,"hint"],[1,"hint","error"],["type","button",1,"row",3,"dir","paddingLeft","title"],["type","button",1,"row",3,"click","title"],["aria-hidden","true",1,"glyph"],[1,"name"]],template:function(n,o){n&1&&(v(0,"div",0),T(1,pL,1,0,"div",1),v(2,"button",2),U("click",function(){return o.toggleFold()}),v(3,"span",3),p(4,"\u203A"),x(),v(5,"span",4),p(6,"Explorer"),x(),v(7,"span",5),p(8),x()(),v(9,"button",6),U("click",function(){return o.refresh()}),p(10," \u27F3 "),x()(),T(11,vL,7,3)),n&2&&(u(),D(o.collapsed()?-1:1),u(),oe("aria-expanded",!o.collapsed()),u(),de("open",!o.collapsed()),u(5),N(o.fileCount()),u(3),D(o.collapsed()?-1:11))},styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;flex:none;position:relative;min-height:0;max-height:42vh;border-top:1px solid var(--%NS%morse-border)}.sized[_nghost-%COMP%]{max-height:none}.resize[_ngcontent-%COMP%]{position:absolute;top:-3px;left:0;right:0;height:7px;z-index:2;cursor:ns-resize}.resize[_ngcontent-%COMP%]:hover{background:color-mix(in srgb,var(--%NS%morse-accent) 60%,transparent)}.pane-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;flex:none;padding:8px 10px 6px}.pane-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:5px;flex:1;min-width:0;padding:0;border:0;background:none;color:inherit;cursor:pointer}.pane-toggle[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--%NS%morse-hover);border-radius:var(--%NS%morse-radius-sm)}.pane-title[_ngcontent-%COMP%]{font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--%NS%morse-fg-muted)}.pane-count[_ngcontent-%COMP%]{font-size:10.5px;color:var(--%NS%morse-fg-muted)}.chevron[_ngcontent-%COMP%]{flex:none;display:inline-block;color:var(--%NS%morse-fg-muted);transition:transform .12s ease}.chevron.open[_ngcontent-%COMP%]{transform:rotate(90deg)}.icon[_ngcontent-%COMP%]{flex:none;width:22px;height:22px;padding:0;border:0;border-radius:6px;background:none;color:var(--%NS%morse-fg-muted);cursor:pointer}.icon[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.root[_ngcontent-%COMP%]{flex:none;padding:0 10px 4px 12px;font-size:11px;font-weight:600;color:var(--%NS%morse-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rows[_ngcontent-%COMP%]{flex:1;min-height:0;overflow:auto;padding:0 6px 8px}.row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;width:100%;padding:2px 6px;border:0;border-radius:6px;background:none;color:var(--%NS%morse-fg);font:inherit;text-align:left;cursor:pointer}.row[_ngcontent-%COMP%]:hover:not(:disabled), .row[_ngcontent-%COMP%]:focus-visible:not(:disabled){background:var(--%NS%morse-hover)}.glyph[_ngcontent-%COMP%]{flex:none;width:13px;text-align:center;color:var(--%NS%morse-fg-muted);font-size:11px}.name[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.row.dir[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{font-weight:600}.hint[_ngcontent-%COMP%]{padding:4px 12px 10px;font-size:11.5px;color:var(--%NS%morse-fg-muted)}.hint.error[_ngcontent-%COMP%]{color:var(--%NS%morse-warn)}"]})};function bL(t,e){let n=[],o=(i,r)=>{for(let s of i)n.push({node:s,depth:r}),s.kind==="dir"&&e.has(s.path)&&o(s.children,r+1)};return o(t,0),n}function lE(t){let e=0;for(let n of t)e+=n.kind==="file"?1:lE(n.children);return e}function xL(t){if(typeof t!="object"||t===null)return;let e=t.files;if(Array.isArray(e))return e.filter(n=>typeof n=="string")}function CL(t){let e=t.replace(/[/\\]+$/,""),n=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return n===-1?e:e.slice(n+1)}var EL=["search"],wL=["list"],SL=(t,e)=>e.path||"all";function TL(t,e){if(t&1&&(v(0,"span",17),p(1),x()),t&2){let n=m().$implicit;u(),N(n.path)}}function DL(t,e){t&1&&(v(0,"span",19),p(1,"\u2713"),x())}function ML(t,e){if(t&1){let n=H();v(0,"button",15),U("mouseenter",function(){let i=M(n).$index,r=m();return I(r.active.set(i))})("click",function(){let i=M(n).$implicit,r=m();return I(r.pick(i))}),v(1,"span",16),p(2),x(),T(3,TL,2,1,"span",17),v(4,"span",18),p(5),x(),T(6,DL,2,0,"span",19),x()}if(t&2){let n=e.$implicit,o=m();de("all",n.all)("active",n.path===o.rows()[o.active()].path)("selected",n.path===o.selected()),ve("title",n.path||"Every project pi knows about"),oe("aria-selected",n.path===o.selected()),u(2),N(n.name),u(),D(n.all?-1:3),u(2),N(n.sessionCount),u(),D(n.path===o.selected()?6:-1)}}var IL="All projects";function kL(t,e,n){let o={path:"",name:IL,sessionCount:n,all:!0},i=e.trim().toLowerCase(),r=t.filter(s=>i.length===0||`${s.name} ${s.path}`.toLowerCase().includes(i)).map(s=>Q(j({},s),{all:!1}));return[o,...r]}var Su=class t{projects=ee.required();selected=ee("");totalSessions=ee(0);select=rt();close=rt();search=Qe("search");list=Qe("list");query=O("");active=O(0);rows=E(()=>kL(this.projects(),this.query(),this.totalSessions()));constructor(){ei(()=>this.search()?.nativeElement.focus()),se(()=>{if(this.query().trim().length>0)return;let e=this.rows().findIndex(n=>n.path===this.selected());e>=0&&this.active.set(e)}),se(()=>{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(),i=n.getBoundingClientRect();i.top<o.top?e.scrollTop-=o.top-i.top:i.bottom>o.bottom&&(e.scrollTop+=i.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=ae({type:t,selectors:[["morse-project-filter"]],viewQuery:function(n,o){n&1&&ft(o.search,EL,5)(o.list,wL,5),n&2&&vt(2)},hostBindings:function(n,o){n&1&&R("keydown.escape",function(){return o.onEscape()},Dt)},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&&(v(0,"div",2),U("click",function(){return o.close.emit()}),v(1,"div",3),U("click",function(r){return r.stopPropagation()}),v(2,"div",4)(3,"strong",5),p(4,"Filter by project"),x(),v(5,"button",6),U("click",function(){return o.close.emit()}),p(6,"\xD7"),x()(),v(7,"div",7)(8,"span",8),kt(),v(9,"svg",9),Fe(10,"circle",10)(11,"path",11),x()(),gn(),v(12,"input",12,0),U("input",function(r){return o.onQuery(r)})("keydown",function(r){return o.onKeydown(r)}),x()(),v(14,"div",13,1),ce(16,ML,7,12,"button",14,SL),x()()()),n&2&&(u(12),ve("value",o.query()),u(4),le(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 NL=["search"],uE=(t,e)=>e.path,pE=(t,e)=>e.id;function OL(t,e){if(t&1){let n=H();g(0,"button",15),R("click",function(){M(n);let i=m();return I(i.openFilter())}),g(1,"span",16),p(2,"\u25A4"),b(),g(3,"span",17),p(4),b()()}if(t&2){let n=m();de("filtered",n.selectedProject()!==void 0),W("title",n.selectedProject()?.path??"Every project pi knows about"),oe("aria-expanded",n.filterOpen()),u(4),N(n.selectedProject()?.name??"All projects")}}function AL(t,e){if(t&1){let n=H();g(0,"morse-project-filter",18),R("select",function(i){M(n);let r=m();return I(r.onProjectSelect(i))})("close",function(){M(n);let i=m();return I(i.closeFilter())}),b()}if(t&2){let n=m();W("projects",n.projectOptions())("selected",n.projectFilter())("totalSessions",n.totalSessions())}}function PL(t,e){if(t&1){let n=H();g(0,"li")(1,"button",22),R("click",function(){let i=M(n).$implicit,r=m(2);return I(r.activate(i))})("contextmenu",function(i){let r=M(n).$implicit,s=m(2);return I(s.openMenu(i,r))}),xe(2,"span",23),g(3,"span",24)(4,"span",25),p(5),b(),g(6,"span",26),p(7),b()()()()}if(t&2){let n=e.$implicit,o=m(2);u(),de("active",n.id===o.activeSessionId()),W("title",n.id),u(4),N(n.title),u(2),N(o.activityLabel(n))}}function RL(t,e){if(t&1&&(g(0,"section",9)(1,"div",19)(2,"span",20),p(3,"In progress"),b(),g(4,"span",21),p(5),b()(),g(6,"ul"),ce(7,PL,8,5,"li",null,pE),b()()),t&2){let n=m();u(5),N(n.inProgress().length),u(2),le(n.inProgress())}}function LL(t,e){if(t&1&&(g(0,"span",33),p(1,"\u203A"),b()),t&2){let n=m(2).$implicit,o=m();de("open",!o.isCollapsed(n.path))}}function FL(t,e){if(t&1){let n=H();g(0,"div",27)(1,"button",28),R("click",function(){M(n);let i=m().$implicit,r=m();return I(r.toggleGroup(i.path))}),g(2,"span",29),p(3),b(),g(4,"span",30),p(5),b(),T(6,LL,2,2,"span",31),b(),g(7,"button",32),R("click",function(i){M(n);let r=m().$implicit,s=m();return I(s.newSession(i,r.path))}),p(8," + "),b()()}if(t&2){let n=m().$implicit,o=m();u(),W("title",n.path),oe("aria-expanded",!o.isCollapsed(n.path)),u(2),N(n.name),u(2),N(n.sessions.length),u(),D(o.projectFilter()!==n.path?6:-1),u(),oe("aria-label","New session in "+n.name)}}function VL(t,e){if(t&1&&(g(0,"div",19)(1,"span",20),p(2,"Sessions"),b(),g(3,"span",21),p(4),b()()),t&2){let n=m().$implicit;u(4),N(n.sessions.length)}}function jL(t,e){if(t&1){let n=H();g(0,"li")(1,"button",34),R("click",function(){let i=M(n).$implicit,r=m(3);return I(r.activate(i))})("contextmenu",function(i){let r=M(n).$implicit,s=m(3);return I(s.openMenu(i,r))}),g(2,"span",24)(3,"span",25),p(4),b()(),g(5,"span",35),p(6),b()()()}if(t&2){let n=e.$implicit,o=m(3);u(),de("active",n.id===o.activeSessionId()),W("title",n.id),u(3),N(n.title),u(2),N(o.age(n.updatedAt))}}function BL(t,e){if(t&1&&p(0),t&2){let n=m(5);ue(" No session matches \u201C",n.query(),"\u201D. ")}}function $L(t,e){t&1&&p(0," No sessions yet. ")}function HL(t,e){if(t&1&&(g(0,"li",36),T(1,BL,1,1)(2,$L,1,0),b()),t&2){let n=m(4);u(),D(n.query().length>0?1:2)}}function UL(t,e){if(t&1&&T(0,HL,3,1,"li",36),t&2){let n=m(2).$implicit;D(n.hiddenRunning===0?0:-1)}}function zL(t,e){if(t&1&&(g(0,"ul"),ce(1,jL,7,5,"li",null,pE,!1,UL,1,1),b()),t&2){let n=m().$implicit;u(),le(n.sessions)}}function GL(t,e){if(t&1&&(g(0,"section",9),T(1,FL,9,6,"div",27)(2,VL,5,1,"div",19),T(3,zL,4,1,"ul"),b()),t&2){let n=e.$implicit,o=m();u(),D(o.scope()==="global"?1:n.sessions.length>0?2:-1),u(2),D(o.scope()==="workspace"||!o.isCollapsed(n.path)?3:-1)}}function qL(t,e){t&1&&p(0," Looking for a project? ")}function WL(t,e){if(t&1&&(p(0),T(1,qL,1,0)),t&2){let n=m(2);ue(" No session matches \u201C",n.query(),"\u201D. "),u(),D(n.projectMatches().length>0?1:-1)}}function YL(t,e){t&1&&p(0," Nothing found. ")}function ZL(t,e){if(t&1){let n=H();g(0,"button",38),R("click",function(){let i=M(n).$implicit,r=m(2);return I(r.filterToProject(i))}),p(1),b()}if(t&2){let n=e.$implicit;u(),xi(" Show all ",n.sessionCount," sessions in ",n.name," ")}}function KL(t,e){if(t&1&&(g(0,"p",36),T(1,WL,2,2)(2,YL,1,0),b(),ce(3,ZL,2,2,"button",37,uE)),t&2){let n=m();u(),D(n.query().length>0?1:2),u(2),le(n.projectMatches())}}function QL(t,e){t&1&&xe(0,"morse-file-explorer")}function XL(t,e){if(t&1&&(g(0,"a",11)(1,"span",39),p(2,"\u2191"),b(),g(3,"span"),p(4,"Update available"),b(),g(5,"span",13),p(6),b()()),t&2){let n=e;W("href",n.url,bo)("title",n.hint+" You are on v"+n.current+"."),u(6),ue("v",n.latest)}}function JL(t,e){t&1&&(g(0,"span",13),p(1),b()),t&2&&(u(),ue("v",e))}function eF(t,e){if(t&1){let n=H();g(0,"p",42),p(1,"Delete this session?"),b(),g(2,"p",43),p(3),b(),g(4,"button",44),R("click",function(){M(n);let i=m(2);return I(i.closeMenu())}),p(5,"Cancel"),b(),g(6,"button",45),R("click",function(){M(n);let i=m(),r=m();return I(r.deleteNow(i.session))}),p(7," Delete "),b()}if(t&2){let n=m();u(3),N(n.session.title)}}function tF(t,e){if(t&1){let n=H();g(0,"button",44),R("click",function(){M(n);let i=m(),r=m();return I(r.closeNow(i.session))}),p(1," Close session "),b(),g(2,"button",45),R("click",function(){M(n);let i=m(),r=m();return I(r.askDelete(i))}),p(3," Delete session\u2026 "),b()}}function nF(t,e){if(t&1){let n=H();g(0,"div",40),R("click",function(){M(n);let i=m();return I(i.closeMenu())})("contextmenu",function(i){M(n);let r=m();return i.preventDefault(),I(r.closeMenu())}),b(),g(1,"div",41),T(2,eF,8,1)(3,tF,4,0),b()}if(t&2){let n=e;u(),fn("left",n.x,"px")("top",n.y,"px"),u(),D(n.confirming?2:3)}}var Tu=class t{morse=k(ht);shell=k(Zt);shortcuts=k(so);update=k(As);tabs=k(_n);destroyRef=k(yt);searchInput=Qe("search");query=O("");collapsed=O({});menu=O(void 0);projectFilter=O("");filterOpen=this.shell.projectFilterOpen;nativeDialogs=E(()=>this.morse.capabilities()?.nativeDialogs===!0);activeSessionId=E(()=>this.morse.state().sessionId);version=this.morse.version;updateNotice=this.update.available;sessionActivity=this.morse.sessionActivity;scope=E(()=>this.morse.capabilities()?.scope??"global");filePreview=E(()=>this.morse.capabilities()?.filePreview===!0);directoryPicker=E(()=>this.morse.capabilities()?.directoryPicker===!0);isRunning(e){let n=this.sessionActivity().get(e.id);return n!==void 0?n.streaming:e.id===this.activeSessionId()&&this.morse.state().streaming}activityLabel(e){return e.id===this.activeSessionId()?this.activeStep()??"Working\u2026":"Working\u2026"}activeStep=E(()=>{let n=this.morse.items().at(-1);return n===void 0?void 0:oF(n)});inProgress=E(()=>{let e=this.projectFilter();return this.morse.sessions().filter(n=>(e.length===0||n.cwd===e)&&this.isRunning(n)).sort((n,o)=>o.updatedAt-n.updatedAt)});groups=E(()=>{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,hiddenRunning:0}]}return this.morse.projects().map(n=>({path:n.path,name:n.name,sessions:e.filter(o=>o.cwd===n.path),hiddenRunning:0}))});visibleGroups=E(()=>{let e=this.query().trim().toLowerCase(),n=this.projectFilter(),o=new Set(this.inProgress().map(r=>r.id));return(n.length===0?this.groups():this.groups().filter(r=>r.path===n)).map(r=>{let s=e.length===0?r.sessions:r.sessions.filter(c=>c.title.toLowerCase().includes(e)),a=s.filter(c=>!o.has(c.id));return Q(j({},r),{sessions:a,hiddenRunning:s.length-a.length})}).filter(r=>n.length>0||e.length===0||r.sessions.length>0)});filterable=E(()=>this.scope()==="global");projectOptions=E(()=>this.groups().map(e=>({path:e.path,name:e.name,sessionCount:e.sessions.length})));selectedProject=E(()=>this.projectOptions().find(e=>e.path===this.projectFilter()));totalSessions=E(()=>this.morse.sessions().length);projectMatches=E(()=>{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(j({},n),{[e]:n[e]!==!0}))}activate(e){this.tabs.focusSession({id:e.id,title:e.title,cwd: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.tabs.forget(e.id),this.morse.closeSession(e.id)}askDelete(e){if(this.nativeDialogs()){this.confirmOnHost(e);return}this.menu.set(Q(j({},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(j({},e),{confirming:!0}));return}this.closeMenu(),n.confirmed===!0&&this.morse.deleteSession(e.session.id)}deleteNow(e){this.closeMenu(),this.tabs.forget(e.id),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.tabs.startDraft(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 i=Math.round(o/60);return i<24?`${i}h`:`${Math.round(i/24)}d`}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ae({type:t,selectors:[["morse-session-nav"]],viewQuery:function(n,o){n&1&&ft(o.searchInput,NL,5),n&2&&vt()},hostBindings:function(n,o){n&1&&R("keydown.escape",function(){return o.onEscape()},Dt)},decls:26,vars:9,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,"pane"],[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,"pane-head"],[1,"pane-title"],[1,"pane-count"],["type","button",1,"session","live",3,"click","contextmenu","title"],["aria-hidden","true",1,"mark","running"],[1,"body"],[1,"title"],[1,"subtitle"],[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"],["type","button",1,"session",3,"click","contextmenu","title"],[1,"meta"],[1,"empty"],["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),R("click",function(r){return o.newSession(r)}),p(2," New session "),b(),g(3,"button",3),R("click",function(){return o.refresh()}),p(4,"\u27F3"),b()(),g(5,"div",4),T(6,OL,5,5,"button",5),g(7,"input",6,0),R("input",function(r){return o.onQuery(r)}),b()(),T(9,AL,1,3,"morse-project-filter",7),g(10,"div",8),T(11,RL,9,1,"section",9),ce(12,GL,4,2,"section",9,uE,!1,KL,5,1),b(),T(15,QL,1,0,"morse-file-explorer"),g(16,"div",10),T(17,XL,7,3,"a",11),g(18,"button",12),R("click",function(){return o.openShortcuts()}),p(19," Keyboard shortcuts "),g(20,"span",13),p(21,"?"),b()(),g(22,"button",14),R("click",function(){return o.openAbout()}),p(23," About Morse "),T(24,JL,2,1,"span",13),b()(),T(25,nF,4,5)),n&2){let i,r,s;u(6),D(o.filterable()?6:-1),u(),W("value",o.query()),u(2),D(o.filterOpen()?9:-1),u(2),D(o.inProgress().length>0?11:-1),u(),le(o.visibleGroups()),u(3),D(o.filePreview()?15:-1),u(2),D((i=o.updateNotice())?17:-1,i),u(7),D((r=o.version())?24:-1,r),u(),D((s=o.menu())?25:-1,s)}},dependencies:[Su,wu],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:6px 10px}.filters[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;padding:10px 10px 6px}.filters[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding:6px 9px}.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:6px 8px 12px}.pane[_ngcontent-%COMP%] + .pane[_ngcontent-%COMP%]{margin-top:12px}.pane-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:4px 7px 5px}.pane-title[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--%NS%morse-fg-muted);font-size:10.5px;font-weight:600;letter-spacing:.07em;text-transform:uppercase}.pane-count[_ngcontent-%COMP%]{flex:none;color:var(--%NS%morse-fg-muted);font-size:10.5px;font-variant-numeric:tabular-nums}.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:not(:disabled){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:not(:disabled), .group-new[_ngcontent-%COMP%]:focus-visible:not(:disabled){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:8px;width:100%;padding:6px 8px;border:0;border-radius:var(--%NS%morse-radius-md);background:transparent;color:var(--%NS%morse-fg);text-align:left;cursor:pointer;transition:background .12s ease}.session[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}.session.active[_ngcontent-%COMP%]{background:var(--%NS%morse-active);box-shadow:inset 2px 0 0 var(--%NS%morse-accent)}.session[_ngcontent-%COMP%] .body[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.session[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;font-weight:500}.session.active[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-weight:600}.session[_ngcontent-%COMP%] .subtitle[_ngcontent-%COMP%]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--%NS%morse-fg-muted);font-size:11px}.session[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%]{flex:none;font-size:10.5px;white-space:nowrap;color:var(--%NS%morse-fg-muted);font-variant-numeric:tabular-nums}.session[_ngcontent-%COMP%] .mark[_ngcontent-%COMP%]{flex:none;width:10px;height:10px;border-radius:50%;background:var(--%NS%morse-fg-muted)}.session[_ngcontent-%COMP%] .mark.running[_ngcontent-%COMP%]{background:transparent;border:1.6px solid color-mix(in srgb,var(--%NS%morse-accent) 30%,transparent);border-top-color:var(--%NS%morse-accent);animation:_ngcontent-%COMP%_nav-spin .8s linear infinite}@keyframes _ngcontent-%COMP%_nav-spin{to{transform:rotate(360deg)}}.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:not(:disabled), .context-menu-item[_ngcontent-%COMP%]:focus-visible:not(:disabled){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}"]})};function oF(t){if(t.kind==="tool"){let e=li(t.name),n=WC(t),o=Ns(t);return e==="shell"?`${n} ${dE(o.replace(/\s+/g," ").trim(),40)}`:e==="search"?`${n} ${dE(o,40)}`:`${n} ${fu(o)}`}if(t.kind==="assistant"){if(t.thinking.trim().length>0&&t.text.trim().length===0)return"Thinking\u2026";if(t.text.trim().length>0||t.streaming)return"Writing\u2026"}}function dE(t,e){return t.length>e?`${t.slice(0,e)}\u2026`:t}var fE=(t,e)=>e.path;function iF(t,e){if(t&1){let n=H();v(0,"button",20),U("click",function(){let i=M(n).$implicit,r=m(2);return I(r.go(i.path))}),p(1),x()}if(t&2){let n=e.$implicit;ve("title",n.path),u(),ue(" ",n.name," ")}}function rF(t,e){if(t&1&&(v(0,"div",9),ce(1,iF,2,2,"button",19,fE),x()),t&2){let n=m();u(),le(n.roots())}}function sF(t,e){t&1&&(v(0,"p",11),p(1,"Reading folder\u2026"),x())}function aF(t,e){t&1&&(v(0,"p",12),p(1),x()),t&2&&(u(),N(e))}function cF(t,e){if(t&1){let n=H();v(0,"button",22),U("click",function(){let i=M(n),r=m(2);return I(r.go(i))}),v(1,"span",23),p(2,"\u21B0"),x(),v(3,"span",24),p(4,".."),x()()}t&2&&ve("title",e)}function lF(t,e){if(t&1){let n=H();v(0,"button",22),U("click",function(){let i=M(n).$implicit,r=m(2);return I(r.go(i.path))}),v(1,"span",23),p(2,"\u25B8"),x(),v(3,"span",24),p(4),x()()}if(t&2){let n=e.$implicit;ve("title",n.path),u(4),N(n.name)}}function dF(t,e){t&1&&(v(0,"p",11),p(1,"No subfolders here."),x())}function uF(t,e){if(t&1&&T(0,dF,2,0,"p",11),t&2){let n=m(2);D(n.parent()===void 0&&n.directories().length===0?0:-1)}}function pF(t,e){if(t&1&&(T(0,cF,5,1,"button",21),ce(1,lF,5,2,"button",21,fE,!1,uF,1,1)),t&2){let n,o=m();D((n=o.parent())?0:-1,n),u(),le(o.directories())}}function fF(t,e){t&1&&(v(0,"em"),p(1," \xB7 not in MORSE_PROJECTS"),x())}function mF(t,e){t&1&&(v(0,"em",15),p(1," \xB7 git"),x())}var Du=class t{morse=k(ht);shell=k(Zt);tabs=k(_n);loading=O(!1);error=O(void 0);path=O("");draftPath=O("");parent=O(void 0);directories=O([]);roots=O([]);isGitRepo=O(!1);canOpen=O(!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.tabs.startDraft(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=ae({type:t,selectors:[["morse-project-picker"]],hostBindings:function(n,o){n&1&&R("keydown.escape",function(){return o.onEscape()},Dt)},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&&(v(0,"div",0),U("click",function(){return o.close()}),v(1,"div",1),U("click",function(r){return r.stopPropagation()}),v(2,"header",2)(3,"strong"),p(4,"New session"),x(),v(5,"button",3),U("click",function(){return o.close()}),p(6," \xD7 "),x()(),v(7,"p",4),p(8," Choose the project folder the agent should run in. It starts only after your first prompt. "),x(),v(9,"div",5)(10,"button",6),U("click",function(){return o.go(o.parent())}),p(11," \u2191 "),x(),v(12,"input",7),U("input",function(r){return o.onPathInput(r)})("keydown.enter",function(){return o.go(o.draftPath())}),x(),v(13,"button",8),U("click",function(){return o.go(o.draftPath())}),p(14," Go "),x()(),T(15,rF,3,0,"div",9),v(16,"div",10),T(17,sF,2,0,"p",11)(18,aF,2,1,"p",12)(19,pF,4,2),x(),v(20,"footer",13)(21,"span",14),p(22),T(23,fF,2,0,"em"),T(24,mF,2,0,"em",15),x(),v(25,"div",16)(26,"button",17),U("click",function(){return o.close()}),p(27,"Cancel"),x(),v(28,"button",18),U("click",function(){return o.confirm()}),p(29," New session here "),x()()()()()),n&2){let i;u(10),ve("disabled",o.parent()===void 0),u(2),ve("value",o.draftPath()),u(),ve("disabled",o.draftPath().trim().length===0),u(2),D(o.roots().length>0?15:-1),u(2),D(o.loading()?17:(i=o.error())?18:19,i),u(4),ve("title",o.path()),u(),ue(" ",o.path()," "),u(),D(o.canOpen()?-1:23),u(),D(o.isGitRepo()?24:-1),u(4),ve("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 mE=[{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 hF=(t,e)=>e.title,gF=(t,e)=>e.name;function yF(t,e){if(t&1&&(v(0,"div")(1,"dt"),p(2,"update"),x(),v(3,"dd")(4,"a",14),p(5),x()()()),t&2){let n=e;u(4),ve("href",n.url,bo)("title",n.hint),u(),ue(" v",n.latest," available ")}}function vF(t,e){t&1&&(v(0,"p",15),p(1),x()),t&2&&(u(),N(e))}function _F(t,e){t&1&&(v(0,"span",17),p(1),x()),t&2&&(u(),ue("by ",e))}function bF(t,e){if(t&1&&(v(0,"li")(1,"a",16),p(2),T(3,_F,2,1,"span",17),x(),v(4,"span",18),p(5),x(),v(6,"p",19),p(7),x()()),t&2){let n,o=e.$implicit;u(),ve("href",o.url,bo),u(),ue(" ",o.name," "),u(),D((n=o.by)?3:-1,n),u(2),N(o.license),u(2),N(o.role)}}function xF(t,e){if(t&1&&(v(0,"section",9)(1,"h3"),p(2),x(),T(3,vF,2,1,"p",15),v(4,"ul"),ce(5,bF,8,5,"li",null,gF),x()()),t&2){let n,o=e.$implicit;u(2),N(o.title),u(),D((n=o.blurb)?3:-1,n),u(2),le(o.entries)}}var Mu=class t{morse=k(ht);shell=k(Zt);update=k(As);groups=mE;protocolVersion=this.morse.protocolVersion;updateNotice=this.update.available;frontend=E(()=>{let e=this.morse.frontend();return e?`${e.name} ${e.version}`:"not reported by this host"});host=E(()=>{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=ae({type:t,selectors:[["morse-about-dialog"]],hostBindings:function(n,o){n&1&&R("keydown.escape",function(){return o.onEscape()},Dt)},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&&(v(0,"div",0),U("click",function(){return o.close()}),v(1,"div",1),U("click",function(r){return r.stopPropagation()}),v(2,"div",2)(3,"strong",3),p(4,"About Morse"),x(),v(5,"span",4),p(6,"a comfortable Pi interface \xB7 MIT"),x(),v(7,"button",5),U("click",function(){return o.close()}),p(8,"\xD7"),x()(),v(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 "),v(11,"code"),p(12,"pi --mode rpc"),x(),p(13," \u2014 and never talks to a model provider itself. Below is what it stands on, and the licence each piece asks for. "),x(),v(14,"dl",7)(15,"div")(16,"dt"),p(17,"frontend"),x(),v(18,"dd"),p(19),x()(),v(20,"div")(21,"dt"),p(22,"protocol"),x(),v(23,"dd"),p(24),x()(),v(25,"div")(26,"dt"),p(27,"host"),x(),v(28,"dd"),p(29),x()(),T(30,yF,6,3,"div"),x(),v(31,"div",8),ce(32,xF,7,2,"section",9,hF),x(),v(34,"div",10)(35,"span"),p(36,"Licence texts ship with this build. Morse is MIT \xB7 \xA9 2026 Supan Adit Pratama."),x(),Fe(37,"span",11),v(38,"a",12),p(39," Source "),x(),v(40,"button",13),U("click",function(){return o.close()}),p(41,"Close"),x()()()()),n&2){let i;u(19),N(o.frontend()),u(5),N(o.protocolVersion()),u(5),N(o.host()),u(),D((i=o.updateNotice())?30:-1,i),u(2),le(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 CF=(t,e)=>e.name,EF=(t,e)=>e.id;function wF(t,e){t&1&&(v(0,"span",15),p(1,"not in this host"),x())}function SF(t,e){if(t&1&&(v(0,"li")(1,"div",13)(2,"span",14),p(3),T(4,wF,2,0,"span",15),x(),v(5,"span",16),p(6),x()(),v(7,"kbd"),p(8),x()()),t&2){let n=e.$implicit;de("unavailable",n.available===!1),u(3),ue(" ",n.label," "),u(),D(n.available===!1?4:-1),u(2),N(n.detail),u(2),N(n.keys)}}function TF(t,e){if(t&1&&(v(0,"section",8)(1,"h3"),p(2),x(),v(3,"ul"),ce(4,SF,9,6,"li",12,EF),x()()),t&2){let n=e.$implicit;u(2),N(n.name),u(2),le(n.rows)}}var Iu=class t{shell=k(Zt);shortcuts=k(so);groups=E(()=>{let e=this.shortcuts.available(),n=new Map;for(let o of Ka){let i=n.get(o.group)??[];i.push({id:o.id,label:o.label,detail:o.detail,keys:Qa(o)?Qb(o.binding):o.keys,available:Qa(o)?e.get(o.id)===!0:void 0}),n.set(o.group,i)}return[...n].map(([o,i])=>({name:o,rows:i}))});close(){this.shell.closeShortcuts()}onEscape(){this.close()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ae({type:t,selectors:[["morse-shortcuts-dialog"]],hostBindings:function(n,o){n&1&&R("keydown.escape",function(){return o.onEscape()},Dt)},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&&(v(0,"div",0),U("click",function(){return o.close()}),v(1,"div",1),U("click",function(r){return r.stopPropagation()}),v(2,"div",2)(3,"strong",3),p(4,"Keyboard shortcuts"),x(),v(5,"span",4),p(6,"the same keys in the browser and in the VS Code panel"),x(),v(7,"button",5),U("click",function(){return o.close()}),p(8,"\xD7"),x()(),v(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. "),x(),v(11,"div",7),ce(12,TF,6,1,"section",8,CF),x(),v(14,"div",9)(15,"span"),p(16,"Esc closes this list, and the panel in front of it."),x(),Fe(17,"span",10),v(18,"button",11),U("click",function(){return o.close()}),p(19,"Close"),x()()()()),n&2&&(u(12),le(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 DF=["cancel"];function MF(t,e){t&1&&(v(0,"p",4),p(1),x()),t&2&&(u(),N(e))}function IF(t,e){t&1&&(v(0,"p",5),p(1),x()),t&2&&(u(),N(e))}var ku=class t{title=ee.required();body=ee("");note=ee("");confirmLabel=ee("Confirm");cancelLabel=ee("Cancel");confirmed=rt();cancelled=rt();cancelButton=Qe("cancel");constructor(){se(()=>{let e=this.cancelButton()?.nativeElement;e&&setTimeout(()=>e.focus(),0)})}onEscape(){this.cancelled.emit()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ae({type:t,selectors:[["morse-confirm-dialog"]],viewQuery:function(n,o){n&1&&ft(o.cancelButton,DF,5),n&2&&vt()},hostBindings:function(n,o){n&1&&R("keydown.escape",function(){return o.onEscape()},Dt)},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&&(v(0,"div",1),U("click",function(){return o.cancelled.emit()}),v(1,"div",2),U("click",function(r){return r.stopPropagation()}),v(2,"h2",3),p(3),x(),T(4,MF,2,1,"p",4),T(5,IF,2,1,"p",5),v(6,"div",6)(7,"button",7,0),U("click",function(){return o.cancelled.emit()}),p(9),x(),v(10,"button",8),U("click",function(){return o.confirmed.emit()}),p(11),x()()()()),n&2){let i,r;u(),oe("aria-describedby",o.body().length>0?"confirm-body":null),u(2),N(o.title()),u(),D((i=o.body())?4:-1,i),u(),D((r=o.note())?5:-1,r),u(4),ue(" ",o.cancelLabel()," "),u(2),N(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 kF(t,e){t&1&&p(0," Install it once and this panel is ready. ")}function NF(t,e){if(t&1){let n=H();v(0,"div",5)(1,"code"),p(2),x(),v(3,"button",10),U("click",function(){M(n);let i=m();return I(i.copyInstall())}),p(4),x()()}if(t&2){let n=m();u(2),N(e),u(2),ue(" ",n.copied()?"Copied":"Copy"," ")}}function OF(t,e){t&1&&(v(0,"p",6),p(1),x()),t&2&&(u(),N(e))}function AF(t,e){if(t&1){let n=H();v(0,"button",10),U("click",function(){M(n);let i=m();return I(i.openSettings())}),p(1,"Open settings"),x(),v(2,"button",10),U("click",function(){M(n);let i=m();return I(i.showLog())}),p(3,"Show log"),x()}}function PF(t,e){t&1&&(v(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. "),x())}function RF(t,e){t&1&&(v(0,"p",9),p(1," The host reads "),v(2,"code"),p(3,"MORSE_PI_PATH"),x(),p(4," at startup, so restart it after changing that (or install pi) \u2014 "),v(5,"code"),p(6,"morse restart"),x(),p(7," for the daemon. "),x())}function LF(t,e){t&1&&(v(0,"details")(1,"summary"),p(2,"What the host reported"),x(),v(3,"pre"),p(4),x()()),t&2&&(u(4),N(e))}var Nu=class t{morse=k(ht);message=this.morse.agentError;failure=this.morse.agentFailure;missing=E(()=>this.failure()?.code==="agent-unavailable");install=E(()=>this.failure()?.install??"");hint=E(()=>this.failure()?.hint??"");hasEditor=E(()=>this.morse.capabilities()?.hostKind==="vscode");copied=O(!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=ae({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&&(v(0,"section",0)(1,"p",1),Fe(2,"span",2),p(3),x(),v(4,"h1",3),p(5),x(),v(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,kF,1,0),x(),T(9,NF,5,2,"div",5),T(10,OF,2,1,"p",6),v(11,"div",7)(12,"button",8),U("click",function(){return o.retry()}),p(13,"Retry"),x(),T(14,AF,4,0),x(),T(15,PF,2,0,"p",9)(16,RF,8,0,"p",9),T(17,LF,5,1,"details"),x()),n&2){let i,r,s;u(3),ue(" ",o.missing()?"Setup":"Agent unavailable"," "),u(2),ue(" ",o.missing()?"The pi coding agent is not installed":"The pi coding agent could not start"," "),u(3),D(o.missing()?8:-1),u(),D((i=o.install())?9:-1,i),u(),D((r=o.hint())?10:-1,r),u(4),D(o.hasEditor()?14:-1),u(),D(o.hasEditor()?15:16),u(2),D((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 FF(t,e){if(t&1){let n=H();g(0,"morse-boot-splash",10),R("dismissed",function(){M(n);let i=m();return I(i.onBootDismissed())}),b()}if(t&2){let n=m();W("ready",n.bootReady())("status",n.bootStatus())}}function VF(t,e){if(t&1){let n=H();g(0,"morse-connection-screen",11),R("retry",function(){M(n);let i=m();return I(i.retryConnection())})("explore",function(){M(n);let i=m();return I(i.onConnectionExplore())})("connect",function(i){M(n);let r=m();return I(r.onConnectionConnect(i))}),b()}if(t&2){let n=e;W("eyebrow",n.eyebrow)("title",n.title)("body",n.body)("detail",n.detail)}}function jF(t,e){t&1&&xe(0,"morse-project-picker")}function BF(t,e){t&1&&xe(0,"morse-about-dialog")}function $F(t,e){t&1&&xe(0,"morse-shortcuts-dialog")}function HF(t,e){if(t&1){let n=H();g(0,"morse-confirm-dialog",12),R("confirmed",function(){M(n);let i=m();return I(i.confirmCompact())})("cancelled",function(){M(n);let i=m();return I(i.cancelCompact())}),b()}if(t&2){let n=m();W("body",n.compactBody())}}function UF(t,e){if(t&1){let n=H();g(0,"button",13),R("click",function(){M(n);let i=m();return I(i.closeNavigation())}),b()}}function zF(t,e){t&1&&(g(0,"div",7),xe(1,"span",14),g(2,"div",15)(3,"span",16),p(4,"\u2913"),b(),g(5,"strong"),p(6,"Drop to attach"),b(),g(7,"span"),p(8,"Images ride with the prompt \xB7 other files become "),g(9,"code"),p(10,"@mentions"),b()()()()),t&2&&(u(2),W("morseEnter",0)("morseEnterY",-6))}function GF(t,e){t&1&&xe(0,"morse-tab-strip")}function qF(t,e){t&1&&xe(0,"morse-file-preview",8),t&2&&W("tab",e)}function WF(t,e){if(t&1){let n=H();g(0,"section",17)(1,"strong"),p(2,"Offline \u2014 the host wouldn't take this frontend"),b(),g(3,"p"),p(4),xe(5,"br"),p(6),b(),g(7,"div",19)(8,"button",20),R("click",function(){M(n);let i=m(2);return I(i.reload())}),p(9,"Reload"),b(),g(10,"button",21),R("click",function(){M(n);let i=m(2);return I(i.retryConnection())}),p(11,"Retry"),b(),g(12,"button",21),R("click",function(){M(n);let i=m(2);return I(i.showLog())}),p(13,"Show log"),b()()()}if(t&2){let n=e;u(4),N(n.message),u(2),N(n.detail)}}function YF(t,e){if(t&1){let n=H();g(0,"section",17)(1,"strong"),p(2,"Offline \u2014 reconnecting"),b(),g(3,"p"),p(4," Morse keeps retrying in the background; the rest of the interface stays available while it does. "),b(),g(5,"div",19)(6,"button",20),R("click",function(){M(n);let i=m(2);return I(i.retryConnection())}),p(7,"Retry now"),b(),g(8,"button",21),R("click",function(){M(n);let i=m(2);return I(i.showConnectionHelp())}),p(9," Connection help "),b()()()}}function ZF(t,e){if(t&1){let n=H();g(0,"section",18)(1,"strong"),p(2,"Pi agent unavailable"),b(),g(3,"p"),p(4),b(),g(5,"div",19)(6,"button",20),R("click",function(){M(n);let i=m(2);return I(i.retryAgent())}),p(7,"Retry"),b(),g(8,"button",21),R("click",function(){M(n);let i=m(2);return I(i.openSettings())}),p(9,"Open settings"),b(),g(10,"button",21),R("click",function(){M(n);let i=m(2);return I(i.showLog())}),p(11,"Show log"),b()()()}if(t&2){let n=m(2);u(4),N(n.agentError()||"Morse could not start the pi coding agent.")}}function KF(t,e){t&1&&xe(0,"morse-agent-screen")}function QF(t,e){t&1&&xe(0,"morse-chat-transcript")(1,"morse-interaction-panel")(2,"morse-chat-composer")}function XF(t,e){if(t&1&&(T(0,WF,14,2,"section",17)(1,YF,10,0,"section",17)(2,ZF,12,1,"section",18),T(3,KF,1,0,"morse-agent-screen")(4,QF,3,0)),t&2){let n,o=m();D((n=o.lastError())?0:o.offline()?1:o.agentBanner()?2:-1,n),u(3),D(o.agentScreen()?3:4)}}function JF(t,e){if(t&1){let n=H();g(0,"div",22)(1,"span",23),p(2),b(),g(3,"button",24),R("click",function(){M(n);let i=m();return I(i.dismissToast())}),p(4," \xD7 "),b()()}if(t&2){let n=e;xo(n.level),u(2),N(n.text)}}function e3(){return typeof location>"u"?!1:new URL(location.href,"http://localhost/").searchParams.get("boot")==="1"}var Ou=class t{morse=k(ht);shell=k(Zt);tabs=k(_n);shortcuts=k(so);dropZone=k(Eu);animation=k(an);attachments=k(Ho);destroyRef=k(yt);dismissedNoticeAt=O(null);noticeTimer;bootPreview=e3();bootPending=this.animation.isEnabled&&(this.bootPreview||this.morse.connection()==="connecting");bootForceTimer;bootVisible=O(this.bootPending);bootForced=O(!1);connectionDismissed=O(!1);offline=O(!1);navigationOpen=this.shell.navigationOpen;tabsEnabled=E(()=>this.morse.capabilities()?.filePreview===!0);activeFile=E(()=>{let e=this.tabs.activeTab();return e?.kind==="file"?e:void 0});focusedSession;projectPickerOpen=this.shell.projectPickerOpen;aboutOpen=this.shell.aboutOpen;shortcutsOpen=this.shell.shortcutsOpen;navigationCollapsed=this.shell.navigationCollapsed;compactConfirmOpen=this.shell.compactConfirmOpen;compactBody=E(()=>{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=E(()=>this.connection()==="ready"&&!this.agentReady()&&!this.agentStarting()&&this.agentError()!==void 0);agentScreen=E(()=>this.agentBlocked()&&this.morse.items().length===0);agentBanner=E(()=>this.agentBlocked()&&!this.agentScreen());lastError=this.morse.lastError;dragging=this.dropZone.active;toast=E(()=>{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=se(()=>{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)),se(()=>{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()}),se(()=>{if(!this.tabsEnabled())return;let n=this.morse.state(),o=n.sessionId;if(o===void 0){this.focusedSession=void 0,this.tabs.clearActiveSession();return}let i={id:o,title:this.sessionTitle(o,n.sessionTitle),cwd:n.workspace.cwd};if(o===this.focusedSession){this.tabs.refreshSession(i);return}this.focusedSession=o,this.tabs.showSession(i)})}onBootDismissed(){this.bootVisible.set(!1),this.clearBootTimer()}sessionTitle(e,n){return n!==void 0&&n.length>0?n:this.morse.sessions().find(i=>i.id===e)?.title??"New session"}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=E(()=>{if(this.bootForced())return!0;let e=this.morse.connection();return e==="error"||e==="closed"||this.morse.slowConnection()?!0:e==="ready"});bootStatus=E(()=>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=E(()=>{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=se(()=>{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"),i=n.querySelector(".dropzone-icon"),r=n.querySelector(".dropzone-ring");this.dropzoneStops=[this.animation.loop(r,{scale:[1,1.035],opacity:[.9,.25]},{duration:1100}),this.animation.loop(o,{scale:[1,1.03]},{duration:700}),this.animation.loop(i,{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=ae({type:t,selectors:[["app-root"]],decls:16,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"],[3,"tab"],["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"],["role","status",1,"alert","offline"],["role","alert",1,"alert"],[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,FF,1,2,"morse-boot-splash",1),T(2,VF,1,4,"morse-connection-screen",2),xe(3,"morse-session-nav",3),T(4,jF,1,0,"morse-project-picker"),T(5,BF,1,0,"morse-about-dialog"),T(6,$F,1,0,"morse-shortcuts-dialog"),T(7,HF,1,1,"morse-confirm-dialog",4),T(8,UF,1,0,"button",5),g(9,"main",6),R("dragenter",function(r){return o.onDragEnter(r)})("dragover",function(r){return o.onDragOver(r)})("dragleave",function(){return o.onDragLeave()})("drop",function(r){return o.onDrop(r)}),T(10,zF,11,2,"div",7),xe(11,"morse-chat-header"),T(12,GF,1,0,"morse-tab-strip"),T(13,qF,1,1,"morse-file-preview",8)(14,XF,5,2),T(15,JF,5,3,"div",9),b()()),n&2){let i,r,s;de("collapsed",o.navigationCollapsed()),u(),D(o.bootVisible()?1:-1),u(),D((i=o.connectionScreen())?2:-1,i),u(),de("open",o.navigationOpen()),u(),D(o.projectPickerOpen()?4:-1),u(),D(o.aboutOpen()?5:-1),u(),D(o.shortcutsOpen()?6:-1),u(),D(o.compactConfirmOpen()?7:-1),u(),D(o.navigationOpen()?8:-1),u(),de("dropping",o.dragging()),u(),D(o.dragging()?10:-1),u(2),D(o.tabsEnabled()?12:-1),u(),D((r=o.activeFile())?13:14,r),u(2),D((s=o.toast())?15:-1,s)}},dependencies:[Tu,Du,Mu,Iu,Nu,ku,ou,yu,_u,nu,xu,vu,cn,Ad,Pd],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}}"]})};Gm(Ou,w_).catch(t=>console.error(t));