@supanadit/morse-web 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
var l1=Object.create;var Cc=Object.defineProperty,d1=Object.defineProperties,u1=Object.getOwnPropertyDescriptor,p1=Object.getOwnPropertyDescriptors,f1=Object.getOwnPropertyNames,yg=Object.getOwnPropertySymbols,m1=Object.getPrototypeOf,vg=Object.prototype.hasOwnProperty,h1=Object.prototype.propertyIsEnumerable;var _g=(t,e,n)=>e in t?Cc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,V=(t,e)=>{for(var n in e||={})vg.call(e,n)&&_g(t,n,e[n]);if(yg)for(var n of yg(e))h1.call(e,n)&&_g(t,n,e[n]);return t},K=(t,e)=>d1(t,p1(e));var g1=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},bg=(t,e)=>{for(var n in e)Cc(t,n,{get:e[n],enumerable:!0})},y1=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of f1(e))!vg.call(t,o)&&o!==n&&Cc(t,o,{get:()=>e[o],enumerable:!(i=u1(e,o))||i.enumerable});return t};var _1=(t,e,n)=>(n=t!=null?l1(m1(t)):{},y1(e||!t||!t.__esModule?Cc(n,"default",{value:t,enumerable:!0}):n,t));var Lx=g1((VK,Rx)=>{function Ex(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],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&Ex(n)}),t}var Gd=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function wx(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Po(t,...e){let n=Object.create(null);for(let i in t)n[i]=t[i];return e.forEach(function(i){for(let o in i)n[o]=i[o]}),n}var nN="</span>",yx=t=>!!t.scope,iN=(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((i,o)=>`${i}${"_".repeat(o+1)}`)].join(" ")}return`${e}${t}`},Eh=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=wx(e)}openNode(e){if(!yx(e))return;let n=iN(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){yx(e)&&(this.buffer+=nN)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},_x=(t={})=>{let e={children:[]};return Object.assign(e,t),e},wh=class t{constructor(){this.rootNode=_x(),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=_x({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(i=>this._walk(e,i)),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)}))}},Sh=class extends wh{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){let i=e.root;n&&(i.scope=`language:${n}`),this.add(i)}toHTML(){return new Eh(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function tc(t){return t?typeof t=="string"?t:t.source:null}function Sx(t){return kr("(?=",t,")")}function oN(t){return kr("(?:",t,")*")}function rN(t){return kr("(?:",t,")?")}function kr(...t){return t.map(n=>tc(n)).join("")}function sN(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Wd(...t){return"("+(sN(t).capture?"":"?:")+t.map(i=>tc(i)).join("|")+")"}function Tx(t){return new RegExp(t.toString()+"|").exec("").length-1}function aN(t,e){let n=t&&t.exec(e);return n&&n.index===0}var cN=new RegExp(Wd(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function Dh(t,{joinWith:e}){let n=0;return t.map(i=>{n+=1;let o=n,r=tc(i),s="";for(;r.length>0;){let a=cN.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])+o):(s+=a[0],(a[0]==="("||/^\(\?[<']/.test(a[0]))&&n++)}return s}).map(i=>`(${i})`).join(e)}var lN=/\b\B/,Dx="[a-zA-Z]\\w*",Mh="[a-zA-Z_]\\w*",Mx="\\b\\d+(\\.\\d+)?",kx="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Ix="\\b(0b[01]+)",dN="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",uN=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=kr(e,/.*\b/,t.binary,/\b.*/)),Po({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},t)},nc={begin:"\\\\[\\s\\S]",relevance:0},pN={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[nc]},fN={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[nc]},mN={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/},Yd=function(t,e,n={}){let i=Po({scope:"comment",begin:t,end:e,contains:[]},n);i.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 o=Wd("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 i.contains.push({begin:kr(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},hN=Yd("//","$"),gN=Yd("/\\*","\\*/"),yN=Yd("#","$"),_N={scope:"number",begin:Mx,relevance:0},vN={scope:"number",begin:kx,relevance:0},bN={scope:"number",begin:Ix,relevance:0},xN={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[nc,{begin:/\[/,end:/\]/,relevance:0,contains:[nc]}]},CN={scope:"title",begin:Dx,relevance:0},EN={scope:"title",begin:Mh,relevance:0},wN={begin:"\\.\\s*"+Mh,relevance:0},SN=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()}})},zd=Object.freeze({__proto__:null,APOS_STRING_MODE:pN,BACKSLASH_ESCAPE:nc,BINARY_NUMBER_MODE:bN,BINARY_NUMBER_RE:Ix,COMMENT:Yd,C_BLOCK_COMMENT_MODE:gN,C_LINE_COMMENT_MODE:hN,C_NUMBER_MODE:vN,C_NUMBER_RE:kx,END_SAME_AS_BEGIN:SN,HASH_COMMENT_MODE:yN,IDENT_RE:Dx,MATCH_NOTHING_RE:lN,METHOD_GUARD:wN,NUMBER_MODE:_N,NUMBER_RE:Mx,PHRASAL_WORDS_MODE:mN,QUOTE_STRING_MODE:fN,REGEXP_MODE:xN,RE_STARTERS_RE:dN,SHEBANG:uN,TITLE_MODE:CN,UNDERSCORE_IDENT_RE:Mh,UNDERSCORE_TITLE_MODE:EN});function TN(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function DN(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function MN(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=TN,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function kN(t,e){Array.isArray(t.illegal)&&(t.illegal=Wd(...t.illegal))}function IN(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 NN(t,e){t.relevance===void 0&&(t.relevance=1)}var ON=(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(i=>{delete t[i]}),t.keywords=n.keywords,t.begin=kr(n.beforeMatch,Sx(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},PN=["of","and","for","in","not","or","if","then","parent","list","value"],AN="keyword";function Nx(t,e,n=AN){let i=Object.create(null);return typeof t=="string"?o(n,t.split(" ")):Array.isArray(t)?o(n,t):Object.keys(t).forEach(function(r){Object.assign(i,Nx(t[r],e,r))}),i;function o(r,s){e&&(s=s.map(a=>a.toLowerCase())),s.forEach(function(a){let c=a.split("|");i[c[0]]=[r,RN(c[0],c[1])]})}}function RN(t,e){return e?Number(e):LN(t)?0:1}function LN(t){return PN.includes(t.toLowerCase())}var vx={},Mr=t=>{console.error(t)},bx=(t,...e)=>{console.log(`WARN: ${t}`,...e)},Ms=(t,e)=>{vx[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),vx[`${t}/${e}`]=!0)},qd=new Error;function Ox(t,e,{key:n}){let i=0,o=t[n],r={},s={};for(let a=1;a<=e.length;a++)s[a+i]=o[a],r[a+i]=!0,i+=Tx(e[a-1]);t[n]=s,t[n]._emit=r,t[n]._multi=!0}function FN(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Mr("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),qd;if(typeof t.beginScope!="object"||t.beginScope===null)throw Mr("beginScope must be object"),qd;Ox(t,t.begin,{key:"beginScope"}),t.begin=Dh(t.begin,{joinWith:""})}}function VN(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Mr("skip, excludeEnd, returnEnd not compatible with endScope: {}"),qd;if(typeof t.endScope!="object"||t.endScope===null)throw Mr("endScope must be object"),qd;Ox(t,t.end,{key:"endScope"}),t.end=Dh(t.end,{joinWith:""})}}function jN(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function $N(t){jN(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),FN(t),VN(t)}function BN(t){function e(s,a){return new RegExp(tc(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+=Tx(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(c=>c[1]);this.matcherRe=e(Dh(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,_)=>_>0&&f!==void 0),p=this.matchIndexes[l];return c.splice(0,l),Object.assign(c,p)}}class i{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,p])=>c.addRule(l,p)),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 p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,l=p.exec(a)}return l&&(this.regexIndex+=l.position+1,this.regexIndex===this.count&&this.considerAll()),l}}function o(s){let a=new i;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;[DN,IN,$N,ON].forEach(p=>p(s,a)),t.compilerExtensions.forEach(p=>p(s,a)),s.__beforeBegin=null,[MN,kN,NN].forEach(p=>p(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=Nx(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=tc(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(p){return HN(p==="self"?s:p)})),s.contains.forEach(function(p){r(p,c)}),s.starts&&r(s.starts,a),c.matcher=o(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=Po(t.classNameAliases||{}),r(t)}function Px(t){return t?t.endsWithParent||Px(t.starts):!1}function HN(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Po(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:Px(t)?Po(t,{starts:t.starts?Po(t.starts):null}):Object.isFrozen(t)?Po(t):t}var UN="11.12.0",Th=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},Ch=wx,xx=Po,Cx=Symbol("nomatch"),zN=7,Ax=function(t){let e=Object.create(null),n=Object.create(null),i=[],o=!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:Sh};function c(R){return a.noHighlightRe.test(R)}function l(R){let Q=R.className+" ";Q+=R.parentNode?R.parentNode.className:"";let G=a.languageDetectRe.exec(Q);if(G){let L=je(G[1]);return L||(bx(r.replace("{}",G[1])),bx("Falling back to no-highlight mode for this block.",R)),L?G[1]:"no-highlight"}return Q.split(/\s+/).find(L=>c(L)||je(L))}function p(R,Q,G){let L="",ne="";typeof Q=="object"?(L=R,G=Q.ignoreIllegals,ne=Q.language):(Ms("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ms("10.7.0",`Please use highlight(code, options) instead.
|
|
2
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),ne=R,L=Q),G===void 0&&(G=!0);let Le={code:L,language:ne};et("before:highlight",Le);let tt=Le.result?Le.result:f(Le.language,Le.code,G);return tt.code=Le.code,et("after:highlight",tt),tt}function f(R,Q,G,L){let ne=Object.create(null);function Le(j,H){return j.keywords[H]}function tt(){if(!Z.keywords){Qe.addText(de);return}let j=0;Z.keywordPatternRe.lastIndex=0;let H=Z.keywordPatternRe.exec(de),ee="";for(;H;){ee+=de.substring(j,H.index);let fe=
|
|
3
|
-
`),1;if(lt>1e5&<>H.index*3)throw new Error("potential infinite loop, way more iterations than matches");return de+=ee,ee.length}let
|
|
1
|
+
var l1=Object.create;var Cc=Object.defineProperty,d1=Object.defineProperties,u1=Object.getOwnPropertyDescriptor,p1=Object.getOwnPropertyDescriptors,f1=Object.getOwnPropertyNames,yg=Object.getOwnPropertySymbols,m1=Object.getPrototypeOf,vg=Object.prototype.hasOwnProperty,h1=Object.prototype.propertyIsEnumerable;var _g=(t,e,n)=>e in t?Cc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,V=(t,e)=>{for(var n in e||={})vg.call(e,n)&&_g(t,n,e[n]);if(yg)for(var n of yg(e))h1.call(e,n)&&_g(t,n,e[n]);return t},K=(t,e)=>d1(t,p1(e));var g1=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},bg=(t,e)=>{for(var n in e)Cc(t,n,{get:e[n],enumerable:!0})},y1=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of f1(e))!vg.call(t,o)&&o!==n&&Cc(t,o,{get:()=>e[o],enumerable:!(i=u1(e,o))||i.enumerable});return t};var _1=(t,e,n)=>(n=t!=null?l1(m1(t)):{},y1(e||!t||!t.__esModule?Cc(n,"default",{value:t,enumerable:!0}):n,t));var Lx=g1((jK,Rx)=>{function Ex(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],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&Ex(n)}),t}var Gd=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function wx(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Po(t,...e){let n=Object.create(null);for(let i in t)n[i]=t[i];return e.forEach(function(i){for(let o in i)n[o]=i[o]}),n}var nN="</span>",yx=t=>!!t.scope,iN=(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((i,o)=>`${i}${"_".repeat(o+1)}`)].join(" ")}return`${e}${t}`},Eh=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=wx(e)}openNode(e){if(!yx(e))return;let n=iN(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){yx(e)&&(this.buffer+=nN)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},_x=(t={})=>{let e={children:[]};return Object.assign(e,t),e},wh=class t{constructor(){this.rootNode=_x(),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=_x({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(i=>this._walk(e,i)),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)}))}},Sh=class extends wh{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){let i=e.root;n&&(i.scope=`language:${n}`),this.add(i)}toHTML(){return new Eh(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function tc(t){return t?typeof t=="string"?t:t.source:null}function Sx(t){return kr("(?=",t,")")}function oN(t){return kr("(?:",t,")*")}function rN(t){return kr("(?:",t,")?")}function kr(...t){return t.map(n=>tc(n)).join("")}function sN(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Wd(...t){return"("+(sN(t).capture?"":"?:")+t.map(i=>tc(i)).join("|")+")"}function Tx(t){return new RegExp(t.toString()+"|").exec("").length-1}function aN(t,e){let n=t&&t.exec(e);return n&&n.index===0}var cN=new RegExp(Wd(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function Dh(t,{joinWith:e}){let n=0;return t.map(i=>{n+=1;let o=n,r=tc(i),s="";for(;r.length>0;){let a=cN.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])+o):(s+=a[0],(a[0]==="("||/^\(\?[<']/.test(a[0]))&&n++)}return s}).map(i=>`(${i})`).join(e)}var lN=/\b\B/,Dx="[a-zA-Z]\\w*",Mh="[a-zA-Z_]\\w*",Mx="\\b\\d+(\\.\\d+)?",kx="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Ix="\\b(0b[01]+)",dN="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",uN=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=kr(e,/.*\b/,t.binary,/\b.*/)),Po({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},t)},nc={begin:"\\\\[\\s\\S]",relevance:0},pN={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[nc]},fN={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[nc]},mN={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/},Yd=function(t,e,n={}){let i=Po({scope:"comment",begin:t,end:e,contains:[]},n);i.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 o=Wd("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 i.contains.push({begin:kr(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},hN=Yd("//","$"),gN=Yd("/\\*","\\*/"),yN=Yd("#","$"),_N={scope:"number",begin:Mx,relevance:0},vN={scope:"number",begin:kx,relevance:0},bN={scope:"number",begin:Ix,relevance:0},xN={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[nc,{begin:/\[/,end:/\]/,relevance:0,contains:[nc]}]},CN={scope:"title",begin:Dx,relevance:0},EN={scope:"title",begin:Mh,relevance:0},wN={begin:"\\.\\s*"+Mh,relevance:0},SN=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()}})},zd=Object.freeze({__proto__:null,APOS_STRING_MODE:pN,BACKSLASH_ESCAPE:nc,BINARY_NUMBER_MODE:bN,BINARY_NUMBER_RE:Ix,COMMENT:Yd,C_BLOCK_COMMENT_MODE:gN,C_LINE_COMMENT_MODE:hN,C_NUMBER_MODE:vN,C_NUMBER_RE:kx,END_SAME_AS_BEGIN:SN,HASH_COMMENT_MODE:yN,IDENT_RE:Dx,MATCH_NOTHING_RE:lN,METHOD_GUARD:wN,NUMBER_MODE:_N,NUMBER_RE:Mx,PHRASAL_WORDS_MODE:mN,QUOTE_STRING_MODE:fN,REGEXP_MODE:xN,RE_STARTERS_RE:dN,SHEBANG:uN,TITLE_MODE:CN,UNDERSCORE_IDENT_RE:Mh,UNDERSCORE_TITLE_MODE:EN});function TN(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function DN(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function MN(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=TN,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function kN(t,e){Array.isArray(t.illegal)&&(t.illegal=Wd(...t.illegal))}function IN(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 NN(t,e){t.relevance===void 0&&(t.relevance=1)}var ON=(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(i=>{delete t[i]}),t.keywords=n.keywords,t.begin=kr(n.beforeMatch,Sx(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},PN=["of","and","for","in","not","or","if","then","parent","list","value"],AN="keyword";function Nx(t,e,n=AN){let i=Object.create(null);return typeof t=="string"?o(n,t.split(" ")):Array.isArray(t)?o(n,t):Object.keys(t).forEach(function(r){Object.assign(i,Nx(t[r],e,r))}),i;function o(r,s){e&&(s=s.map(a=>a.toLowerCase())),s.forEach(function(a){let c=a.split("|");i[c[0]]=[r,RN(c[0],c[1])]})}}function RN(t,e){return e?Number(e):LN(t)?0:1}function LN(t){return PN.includes(t.toLowerCase())}var vx={},Mr=t=>{console.error(t)},bx=(t,...e)=>{console.log(`WARN: ${t}`,...e)},Ms=(t,e)=>{vx[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),vx[`${t}/${e}`]=!0)},qd=new Error;function Ox(t,e,{key:n}){let i=0,o=t[n],r={},s={};for(let a=1;a<=e.length;a++)s[a+i]=o[a],r[a+i]=!0,i+=Tx(e[a-1]);t[n]=s,t[n]._emit=r,t[n]._multi=!0}function FN(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Mr("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),qd;if(typeof t.beginScope!="object"||t.beginScope===null)throw Mr("beginScope must be object"),qd;Ox(t,t.begin,{key:"beginScope"}),t.begin=Dh(t.begin,{joinWith:""})}}function VN(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Mr("skip, excludeEnd, returnEnd not compatible with endScope: {}"),qd;if(typeof t.endScope!="object"||t.endScope===null)throw Mr("endScope must be object"),qd;Ox(t,t.end,{key:"endScope"}),t.end=Dh(t.end,{joinWith:""})}}function jN(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function $N(t){jN(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),FN(t),VN(t)}function BN(t){function e(s,a){return new RegExp(tc(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+=Tx(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(c=>c[1]);this.matcherRe=e(Dh(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,_)=>_>0&&f!==void 0),p=this.matchIndexes[l];return c.splice(0,l),Object.assign(c,p)}}class i{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,p])=>c.addRule(l,p)),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 p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,l=p.exec(a)}return l&&(this.regexIndex+=l.position+1,this.regexIndex===this.count&&this.considerAll()),l}}function o(s){let a=new i;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;[DN,IN,$N,ON].forEach(p=>p(s,a)),t.compilerExtensions.forEach(p=>p(s,a)),s.__beforeBegin=null,[MN,kN,NN].forEach(p=>p(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=Nx(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=tc(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(p){return HN(p==="self"?s:p)})),s.contains.forEach(function(p){r(p,c)}),s.starts&&r(s.starts,a),c.matcher=o(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=Po(t.classNameAliases||{}),r(t)}function Px(t){return t?t.endsWithParent||Px(t.starts):!1}function HN(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Po(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:Px(t)?Po(t,{starts:t.starts?Po(t.starts):null}):Object.isFrozen(t)?Po(t):t}var UN="11.12.0",Th=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},Ch=wx,xx=Po,Cx=Symbol("nomatch"),zN=7,Ax=function(t){let e=Object.create(null),n=Object.create(null),i=[],o=!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:Sh};function c(R){return a.noHighlightRe.test(R)}function l(R){let Q=R.className+" ";Q+=R.parentNode?R.parentNode.className:"";let G=a.languageDetectRe.exec(Q);if(G){let L=je(G[1]);return L||(bx(r.replace("{}",G[1])),bx("Falling back to no-highlight mode for this block.",R)),L?G[1]:"no-highlight"}return Q.split(/\s+/).find(L=>c(L)||je(L))}function p(R,Q,G){let L="",ne="";typeof Q=="object"?(L=R,G=Q.ignoreIllegals,ne=Q.language):(Ms("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ms("10.7.0",`Please use highlight(code, options) instead.
|
|
2
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),ne=R,L=Q),G===void 0&&(G=!0);let Le={code:L,language:ne};et("before:highlight",Le);let tt=Le.result?Le.result:f(Le.language,Le.code,G);return tt.code=Le.code,et("after:highlight",tt),tt}function f(R,Q,G,L){let ne=Object.create(null);function Le(j,H){return j.keywords[H]}function tt(){if(!Z.keywords){Qe.addText(de);return}let j=0;Z.keywordPatternRe.lastIndex=0;let H=Z.keywordPatternRe.exec(de),ee="";for(;H;){ee+=de.substring(j,H.index);let fe=rt.case_insensitive?H[0].toLowerCase():H[0],mt=Le(Z,fe);if(mt){let[Tt,Yn]=mt;if(Qe.addText(ee),ee="",ne[fe]=(ne[fe]||0)+1,ne[fe]<=zN&&(Et+=Yn),Tt.startsWith("_"))ee+=H[0];else{let yn=rt.classNameAliases[Tt]||Tt;bt(H[0],yn)}}else ee+=H[0];j=Z.keywordPatternRe.lastIndex,H=Z.keywordPatternRe.exec(de)}ee+=de.substring(j),Qe.addText(ee)}function Ut(){if(de==="")return;let j=null;if(typeof Z.subLanguage=="string"){if(!e[Z.subLanguage]){Qe.addText(de);return}j=f(Z.subLanguage,de,!0,_t[Z.subLanguage]),_t[Z.subLanguage]=j._top}else j=x(de,Z.subLanguage.length?Z.subLanguage:null);Z.relevance>0&&(Et+=j.relevance),Qe.__addSublanguage(j._emitter,j.language)}function Ce(){Z.subLanguage!=null?Ut():tt(),de=""}function bt(j,H){j!==""&&(Qe.startScope(H),Qe.addText(j),Qe.endScope())}function ze(j,H){let ee=1,fe=H.length-1;for(;ee<=fe;){if(!j._emit[ee]){ee++;continue}let mt=rt.classNameAliases[j[ee]]||j[ee],Tt=H[ee];mt?bt(Tt,mt):(de=Tt,tt(),de=""),ee++}}function an(j,H){return j.scope&&typeof j.scope=="string"&&Qe.openNode(rt.classNameAliases[j.scope]||j.scope),j.beginScope&&(j.beginScope._wrap?(bt(de,rt.classNameAliases[j.beginScope._wrap]||j.beginScope._wrap),de=""):j.beginScope._multi&&(ze(j.beginScope,H),de="")),Z=Object.create(j,{parent:{value:Z}}),Z}function zt(j,H,ee){let fe=aN(j.endRe,ee);if(fe){if(j["on:end"]){let mt=new Gd(j);j["on:end"](H,mt),mt.isMatchIgnored&&(fe=!1)}if(fe){for(;j.endsParent&&j.parent;)j=j.parent;return j}}if(j.endsWithParent)return zt(j.parent,H,ee)}function Ke(j){return Z.matcher.regexIndex===0?(de+=j[0],1):(Ge=!0,0)}function Wt(j){let H=j[0],ee=j.rule,fe=new Gd(ee),mt=[ee.__beforeBegin,ee["on:begin"]];for(let Tt of mt)if(Tt&&(Tt(j,fe),fe.isMatchIgnored))return Ke(H);return ee.skip?de+=H:(ee.excludeBegin&&(de+=H),Ce(),!ee.returnBegin&&!ee.excludeBegin&&(de=H)),an(ee,j),ee.returnBegin?0:H.length}function Lt(j){let H=j[0],ee=Q.substring(j.index),fe=zt(Z,j,ee);if(!fe)return Cx;let mt=Z;Z.endScope&&Z.endScope._wrap?(Ce(),bt(H,Z.endScope._wrap)):Z.endScope&&Z.endScope._multi?(Ce(),ze(Z.endScope,j)):mt.skip?de+=H:(mt.returnEnd||mt.excludeEnd||(de+=H),Ce(),mt.excludeEnd&&(de=H));do Z.scope&&Qe.closeNode(),!Z.skip&&!Z.subLanguage&&(Et+=Z.relevance),Z=Z.parent;while(Z!==fe.parent);return fe.starts&&an(fe.starts,j),mt.returnEnd?0:H.length}function Re(){let j=[];for(let H=Z;H!==rt;H=H.parent)H.scope&&j.unshift(H.scope);j.forEach(H=>Qe.openNode(H))}let qe={};function ke(j,H){let ee=H&&H[0];if(de+=j,ee==null)return Ce(),0;if(qe.type==="begin"&&H.type==="end"&&qe.index===H.index&&ee===""){if(de+=Q.slice(H.index,H.index+1),!o){let fe=new Error(`0 width match regex (${R})`);throw fe.languageName=R,fe.badRule=qe.rule,fe}return 1}if(qe=H,H.type==="begin")return Wt(H);if(H.type==="illegal"&&!G){let fe=new Error('Illegal lexeme "'+ee+'" for mode "'+(Z.scope||"<unnamed>")+'"');throw fe.mode=Z,fe}else if(H.type==="end"){let fe=Lt(H);if(fe!==Cx)return fe}if(H.type==="illegal"&&ee==="")return H.index===Q.length||(de+=`
|
|
3
|
+
`),1;if(lt>1e5&<>H.index*3)throw new Error("potential infinite loop, way more iterations than matches");return de+=ee,ee.length}let rt=je(R);if(!rt)throw Mr(r.replace("{}",R)),new Error('Unknown language: "'+R+'"');let pe=BN(rt),ut="",Z=L||pe,_t={},Qe=new a.__emitter(a);Re();let de="",Et=0,Ee=0,lt=0,Ge=!1;try{if(rt.__emitTokens)rt.__emitTokens(Q,Qe);else{for(Z.matcher.considerAll();;){lt++,Ge?Ge=!1:Z.matcher.considerAll(),Z.matcher.lastIndex=Ee;let j=Z.matcher.exec(Q);if(!j)break;let H=Q.substring(Ee,j.index),ee=ke(H,j);Ee=j.index+ee}ke(Q.substring(Ee))}return Qe.finalize(),ut=Qe.toHTML(),{language:R,value:ut,relevance:Et,illegal:!1,_emitter:Qe,_top:Z}}catch(j){if(j.message&&j.message.includes("Illegal"))return{language:R,value:Ch(Q),illegal:!0,relevance:0,_illegalBy:{message:j.message,index:Ee,context:Q.slice(Ee-100,Ee+100),mode:j.mode,resultSoFar:ut},_emitter:Qe};if(o)return{language:R,value:Ch(Q),illegal:!1,relevance:0,errorRaised:j,_emitter:Qe,_top:Z};throw j}}function _(R){let Q={value:Ch(R),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return Q._emitter.addText(R),Q}function x(R,Q){Q=Q||a.languages||Object.keys(e);let G=_(R),L=Q.filter(je).filter(ft).map(Ce=>f(Ce,R,!1));L.unshift(G);let ne=L.sort((Ce,bt)=>{if(Ce.relevance!==bt.relevance)return bt.relevance-Ce.relevance;if(Ce.language&&bt.language){if(je(Ce.language).supersetOf===bt.language)return 1;if(je(bt.language).supersetOf===Ce.language)return-1}return 0}),[Le,tt]=ne,Ut=Le;return Ut.secondBest=tt,Ut}function C(R,Q,G){let L=Q&&n[Q]||G;R.classList.add("hljs"),R.classList.add(`language-${L}`)}function T(R){let Q=null,G=l(R);if(c(G))return;if(et("before:highlightElement",{el:R,language:G}),R.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",R);return}if(R.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(R)),a.throwUnescapedHTML))throw new Th("One of your code blocks includes unescaped HTML.",R.innerHTML);Q=R;let L=Q.textContent,ne=G?p(L,{language:G,ignoreIllegals:!0}):x(L);R.innerHTML=ne.value,R.dataset.highlighted="yes",C(R,G,ne.language),R.result={language:ne.language,re:ne.relevance,relevance:ne.relevance},ne.secondBest&&(R.secondBest={language:ne.secondBest.language,relevance:ne.secondBest.relevance}),et("after:highlightElement",{el:R,result:ne,text:L})}function P(R){a=xx(a,R)}let Y=()=>{ye(),Ms("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function W(){ye(),Ms("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let be=!1;function ye(){function R(){ye()}if(document.readyState==="loading"){be||window.addEventListener("DOMContentLoaded",R,!1),be=!0;return}document.querySelectorAll(a.cssSelector).forEach(T)}function Me(R,Q){let G=null;try{G=Q(t)}catch(L){if(Mr("Language definition for '{}' could not be registered.".replace("{}",R)),o)Mr(L);else throw L;G=s}G.name||(G.name=R),e[R]=G,G.rawDefinition=Q.bind(null,t),G.aliases&&Be(G.aliases,{languageName:R})}function me(R){delete e[R];for(let Q of Object.keys(n))n[Q]===R&&delete n[Q]}function Je(){return Object.keys(e)}function je(R){return R=(R||"").toLowerCase(),e[R]||e[n[R]]}function Be(R,{languageName:Q}){typeof R=="string"&&(R=[R]),R.forEach(G=>{n[G.toLowerCase()]=Q})}function ft(R){let Q=je(R);return Q&&!Q.disableAutodetect}function St(R){R["before:highlightBlock"]&&!R["before:highlightElement"]&&(R["before:highlightElement"]=Q=>{R["before:highlightBlock"](Object.assign({block:Q.el},Q))}),R["after:highlightBlock"]&&!R["after:highlightElement"]&&(R["after:highlightElement"]=Q=>{R["after:highlightBlock"](Object.assign({block:Q.el},Q))})}function Rt(R){St(R),i.push(R)}function kt(R){let Q=i.indexOf(R);Q!==-1&&i.splice(Q,1)}function et(R,Q){let G=R;i.forEach(function(L){L[G]&&L[G](Q)})}function Se(R){return Ms("10.7.0","highlightBlock will be removed entirely in v12.0"),Ms("10.7.0","Please use highlightElement now."),T(R)}Object.assign(t,{highlight:p,highlightAuto:x,highlightAll:ye,highlightElement:T,highlightBlock:Se,configure:P,initHighlighting:Y,initHighlightingOnLoad:W,registerLanguage:Me,unregisterLanguage:me,listLanguages:Je,getLanguage:je,registerAliases:Be,autoDetection:ft,inherit:xx,addPlugin:Rt,removePlugin:kt}),t.debugMode=function(){o=!1},t.safeMode=function(){o=!0},t.versionString=UN,t.regex={concat:kr,lookahead:Sx,either:Wd,optional:rN,anyNumberOfTimes:oN};for(let R in zd)typeof zd[R]=="object"&&Ex(zd[R]);return Object.assign(t,zd),t},ks=Ax({});ks.newInstance=()=>Ax({});Rx.exports=ks;ks.HighlightJS=ks;ks.default=ks});var Cn=null,Ec=!1,Ho=1,v1=null,fn=Symbol("SIGNAL");function ge(t){let e=Cn;return Cn=t,e}function Dc(){return Cn}var zo={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 Go(t){if(Ec)throw new Error("");if(Cn===null)return;Cn.consumerOnSignalRead(t);let e=Cn.producersTail;if(e!==void 0&&e.producer===t)return;let n,i=Cn.recomputing;if(i&&(n=e!==void 0?e.nextProducer:Cn.producers,n!==void 0&&n.producer===t)){Cn.producersTail=n,n.lastReadVersion=t.version,n.knownValidAtEpoch=Ho;return}let o=t.consumersTail;if(o!==void 0&&o.consumer===Cn&&(!i||o.knownValidAtEpoch===Ho))return;let r=Br(Cn),s={producer:t,consumer:Cn,nextProducer:n,prevConsumer:void 0,knownValidAtEpoch:Ho,lastReadVersion:t.version,nextConsumer:void 0};Cn.producersTail=s,e!==void 0?e.nextProducer=s:Cn.producers=s,r&&wg(t,s)}function xg(){Ho++}function zs(t){if(!(Br(t)&&!t.dirty)&&!(!t.dirty&&t.lastCleanEpoch===Ho)){if(!t.producerMustRecompute(t)&&!Gs(t)){Tc(t);return}t.producerRecomputeValue(t),Tc(t)}}function zu(t){if(t.consumers===void 0)return;let e=Ec;Ec=!0;try{for(let n=t.consumers;n!==void 0;n=n.nextConsumer){let i=n.consumer;i.dirty||b1(i)}}finally{Ec=e}}function Gu(){return Cn?.consumerAllowSignalWrites!==!1}function b1(t){t.dirty=!0,zu(t),t.consumerMarkedDirty?.(t)}function Tc(t){t.dirty=!1,t.lastCleanEpoch=Ho}function qo(t){return t&&Cg(t),ge(t)}function Cg(t){if(t.producersTail?.knownValidAtEpoch===Ho){let e=t.producers;for(;e!==void 0;)e.knownValidAtEpoch=null,e=e.nextProducer}t.producersTail=void 0,t.recomputing=!0}function $r(t,e){ge(e),t&&Eg(t)}function Eg(t){t.recomputing=!1;let e=t.producersTail,n=e!==void 0?e.nextProducer:t.producers;if(n!==void 0){if(Br(t))do n=qu(n);while(n!==void 0);e!==void 0?e.nextProducer=void 0:t.producers=void 0}}function Gs(t){for(let e=t.producers;e!==void 0;e=e.nextProducer){let n=e.producer,i=e.lastReadVersion;if(i!==n.version||(zs(n),i!==n.version))return!0}return!1}function Wo(t){if(Br(t)){let e=t.producers;for(;e!==void 0;)e=qu(e)}t.producers=void 0,t.producersTail=void 0,t.consumers=void 0,t.consumersTail=void 0}function wg(t,e){let n=t.consumersTail,i=Br(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,!i)for(let o=t.producers;o!==void 0;o=o.nextProducer)wg(o.producer,o)}function qu(t){let e=t.producer,n=t.nextProducer,i=t.nextConsumer,o=t.prevConsumer;if(t.nextConsumer=void 0,t.prevConsumer=void 0,i!==void 0?i.prevConsumer=o:e.consumersTail=o,o!==void 0)o.nextConsumer=i;else if(e.consumers=i,!Br(e)){let r=e.producers;for(;r!==void 0;)r=qu(r)}return n}function Br(t){return t.consumerIsAlwaysLive||t.consumers!==void 0}function Mc(t){v1?.(t)}function kc(t,e){return Object.is(t,e)}function qs(t,e){let n=Object.create(x1);n.computation=t,e!==void 0&&(n.equal=e);let i=()=>{if(zs(n),Go(n),n.value===Uo)throw n.error;return n.value};return i[fn]=n,Mc(n),i}var wc=Symbol("UNSET"),Sc=Symbol("COMPUTING"),Uo=Symbol("ERRORED"),x1=K(V({},zo),{value:wc,dirty:!0,error:null,equal:kc,kind:"computed",producerMustRecompute(t){return t.value===wc||t.value===Sc},producerRecomputeValue(t){if(t.value===Sc)throw new Error("");let e=t.value;t.value=Sc;let n=qo(t),i,o=!1;try{i=t.computation(),ge(null),o=e!==wc&&e!==Uo&&i!==Uo&&t.equal(e,i)}catch(r){i=Uo,t.error=r}finally{$r(t,n)}if(o){t.value=e;return}t.value=i,t.version++}});function C1(){throw new Error}var Sg=C1;function Tg(t){Sg(t)}function Wu(t){Sg=t}var E1=null;function Yu(t,e){let n=Object.create(Ws);n.value=t,e!==void 0&&(n.equal=e);let i=()=>Dg(n);return i[fn]=n,Mc(n),[i,s=>Yo(n,s),s=>Ku(n,s)]}function Dg(t){return Go(t),t.value}function Yo(t,e){Gu()||Tg(t),t.equal(t.value,e)||(t.value=e,w1(t))}function Ku(t,e){Gu()||Tg(t),Yo(t,e(t.value))}var Ws=K(V({},zo),{equal:kc,value:void 0,kind:"signal"});function w1(t){t.version++,xg(),zu(t),E1?.(t)}var Zu=K(V({},zo),{consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!0,dirty:!0,kind:"effect"});function Qu(t){if(t.dirty=!1,t.version>0&&!Gs(t))return;t.version++;let e=qo(t);try{t.cleanup(),t.fn()}finally{$r(t,e)}}var Xu;function Ic(){return Xu}function Ii(t){let e=Xu;return Xu=t,e}var Mg=Symbol("NotFound");function Hr(t){return t===Mg||t?.name==="\u0275NotFound"}function kg(t){let e=ge(null);try{return t()}finally{ge(e)}}function Dn(t){return typeof t=="function"}function Nc(t){let n=t(i=>{Error.call(i),i.stack=new Error().stack});return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Oc=Nc(t=>function(n){t(this),this.message=n?`${n.length} errors occurred during unsubscription:
|
|
4
4
|
${n.map((i,o)=>`${o+1}) ${i.toString()}`).join(`
|
|
5
5
|
`)}`:"",this.name="UnsubscriptionError",this.errors=n});function Ys(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:i}=this;if(Dn(i))try{i()}catch(r){e=r instanceof Oc?r.errors:[r]}let{_finalizers:o}=this;if(o){this._finalizers=null;for(let r of o)try{Ig(r)}catch(s){e=e??[],s instanceof Oc?e=[...e,...s.errors]:e.push(s)}}if(e)throw new Oc(e)}}add(e){var n;if(e&&e!==this)if(this.closed)Ig(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)&&Ys(n,e)}remove(e){let{_finalizers:n}=this;n&&Ys(n,e),e instanceof t&&e._removeParent(this)}};En.EMPTY=(()=>{let t=new En;return t.closed=!0,t})();var Ju=En.EMPTY;function Pc(t){return t instanceof En||t&&"closed"in t&&Dn(t.remove)&&Dn(t.add)&&Dn(t.unsubscribe)}function Ig(t){Dn(t)?t():t.unsubscribe()}var ui={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Ur={setTimeout(t,e,...n){let{delegate:i}=Ur;return i?.setTimeout?i.setTimeout(t,e,...n):setTimeout(t,e,...n)},clearTimeout(t){let{delegate:e}=Ur;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0};function Ng(t){Ur.setTimeout(()=>{let{onUnhandledError:e}=ui;if(e)e(t);else throw t})}function ep(){}var Og=tp("C",void 0,void 0);function Pg(t){return tp("E",void 0,t)}function Ag(t){return tp("N",t,void 0)}function tp(t,e,n){return{kind:t,value:e,error:n}}var Ko=null;function zr(t){if(ui.useDeprecatedSynchronousErrorHandling){let e=!Ko;if(e&&(Ko={errorThrown:!1,error:null}),t(),e){let{errorThrown:n,error:i}=Ko;if(Ko=null,n)throw i}}else t()}function Rg(t){ui.useDeprecatedSynchronousErrorHandling&&Ko&&(Ko.errorThrown=!0,Ko.error=t)}var Zo=class extends En{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,Pc(e)&&e.add(this)):this.destination=D1}static create(e,n,i){return new Gr(e,n,i)}next(e){this.isStopped?ip(Ag(e),this):this._next(e)}error(e){this.isStopped?ip(Pg(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?ip(Og,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()}}},S1=Function.prototype.bind;function np(t,e){return S1.call(t,e)}var op=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:n}=this;if(n.next)try{n.next(e)}catch(i){Ac(i)}}error(e){let{partialObserver:n}=this;if(n.error)try{n.error(e)}catch(i){Ac(i)}else Ac(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(n){Ac(n)}}},Gr=class extends Zo{constructor(e,n,i){super();let o;if(Dn(e)||!e)o={next:e??void 0,error:n??void 0,complete:i??void 0};else{let r;this&&ui.useDeprecatedNextContext?(r=Object.create(e),r.unsubscribe=()=>this.unsubscribe(),o={next:e.next&&np(e.next,r),error:e.error&&np(e.error,r),complete:e.complete&&np(e.complete,r)}):o=e}this.destination=new op(o)}};function Ac(t){ui.useDeprecatedSynchronousErrorHandling?Rg(t):Ng(t)}function T1(t){throw t}function ip(t,e){let{onStoppedNotification:n}=ui;n&&Ur.setTimeout(()=>n(t,e))}var D1={closed:!0,next:ep,error:T1,complete:ep};var Lg=typeof Symbol=="function"&&Symbol.observable||"@@observable";function Fg(t){return t}function Vg(t){return t.length===0?Fg:t.length===1?t[0]:function(n){return t.reduce((i,o)=>o(i),n)}}var Ni=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,i){let o=k1(e)?e:new Gr(e,n,i);return zr(()=>{let{operator:r,source:s}=this;o.add(r?r.call(o,s):s?this._subscribe(o):this._trySubscribe(o))}),o}_trySubscribe(e){try{return this._subscribe(e)}catch(n){e.error(n)}}forEach(e,n){return n=jg(n),new n((i,o)=>{let r=new Gr({next:s=>{try{e(s)}catch(a){o(a),r.unsubscribe()}},error:o,complete:i});this.subscribe(r)})}_subscribe(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)}[Lg](){return this}pipe(...e){return Vg(e)(this)}toPromise(e){return e=jg(e),new e((n,i)=>{let o;this.subscribe(r=>o=r,r=>i(r),()=>n(o))})}};Ni.create=t=>new Ni(t);function jg(t){var e;return(e=t??ui.Promise)!==null&&e!==void 0?e:Promise}function M1(t){return t&&Dn(t.next)&&Dn(t.error)&&Dn(t.complete)}function k1(t){return t&&t instanceof Zo||M1(t)&&Pc(t)}function I1(t){return Dn(t?.lift)}function $g(t){return e=>{if(I1(e))return e.lift(function(n){try{return t(n,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function Bg(t,e,n,i,o){return new rp(t,e,n,i,o)}var rp=class extends Zo{constructor(e,n,i,o,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=o?function(a){try{o(a)}catch(c){e.error(c)}finally{this.unsubscribe()}}:super._error,this._complete=i?function(){try{i()}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 Hg=Nc(t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var Zn=class extends Ni{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(e){let n=new Rc(this,this);return n.operator=e,n}_throwIfClosed(){if(this.closed)throw new Hg}next(e){zr(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let n of this.currentObservers)n.next(e)}})}error(e){zr(()=>{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(){zr(()=>{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:i,observers:o}=this;return n||i?Ju:(this.currentObservers=null,o.push(e),new En(()=>{this.currentObservers=null,Ys(o,e)}))}_checkFinalizedStatuses(e){let{hasError:n,thrownError:i,isStopped:o}=this;n?e.error(i):o&&e.complete()}asObservable(){let e=new Ni;return e.source=this,e}};Zn.create=(t,e)=>new Rc(t,e);var Rc=class extends Zn{constructor(e,n){super(),this.destination=e,this.source=n}next(e){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,e)}error(e){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.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,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(e))!==null&&i!==void 0?i:Ju}};var Ks=class extends Zn{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:i}=this;if(e)throw n;return this._throwIfClosed(),i}next(e){super.next(this._value=e)}};function sp(t,e){return $g((n,i)=>{let o=0;n.subscribe(Bg(i,r=>{i.next(t.call(e,r,o++))}))})}var Uc="https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss",Ne=class extends Error{code;constructor(e,n){super(tr(e,n)),this.code=e}};function N1(t){return`NG0${Math.abs(t)}`}function tr(t,e){return`${N1(t)}${e?": "+e:""}`}function xt(t){for(let e in t)if(t[e]===xt)return e;throw Error("")}function zc(t){if(typeof t=="string")return t;if(Array.isArray(t))return`[${t.map(zc).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 i=n.indexOf(`
|
|
6
|
-
`);return i>=0?n.slice(0,i):n}function Gc(t,e){return t?e?`${t} ${e}`:t:e||""}var O1=xt({__forward_ref__:xt});function qc(t){return t.__forward_ref__=qc,t}function Vn(t){return Yg(t)?t():t}function Yg(t){return typeof t=="function"&&Object.hasOwn(t,O1)&&t.__forward_ref__===qc}function xe(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function Wc(t){return P1(t,Yc)}function P1(t,e){return Object.hasOwn(t,e)&&t[e]||null}function A1(t){let e=t?.[Yc]??null;return e||null}function cp(t){return t&&Object.hasOwn(t,Fc)?t[Fc]:null}var Yc=xt({\u0275prov:xt}),Fc=xt({\u0275inj:xt}),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=xe({token:this,providedIn:n.providedIn||"root",factory:n.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};function Ep(t){return t&&!!t.\u0275providers}var wp=xt({\u0275cmp:xt}),Sp=xt({\u0275dir:xt}),Tp=xt({\u0275pipe:xt});var lp=xt({\u0275fac:xt}),nr=xt({__NG_ELEMENT_ID__:xt}),Ug=xt({__NG_ENV_ID__:xt});function ir(t){return Dp(t,"@Component"),t[wp]||null}function Kc(t){return Dp(t,"@Directive"),t[Sp]||null}function Kg(t){return Dp(t,"@Pipe"),t[Tp]||null}function Dp(t,e){if(t==null)throw new Ne(-919,!1)}function or(t){return typeof t=="string"?t:t==null?"":String(t)}var Zg=xt({ngErrorCode:xt}),R1=xt({ngErrorMessage:xt}),L1=xt({ngTokenPath:xt});function Mp(t,e){return Qg("",-200,e)}function Zc(t,e){throw new Ne(-201,!1)}function Qg(t,e,n){let i=new Ne(e,t);return i[Zg]=e,i[R1]=t,n&&(i[L1]=n),i}function F1(t){return t[Zg]}var dp;function Xg(){return dp}function Fn(t){let e=dp;return dp=t,e}function kp(t,e,n){let i=Wc(t);if(i&&i.providedIn=="root")return i.value===void 0?i.value=i.factory():i.value;if(n&8)return null;if(e!==void 0)return e;Zc(t,"")}var go=globalThis;var V1={},Qo=V1,j1="__NG_DI_FLAG__",up=class{injector;constructor(e){this.injector=e}retrieve(e,n){let i=Xo(n)||0;try{return this.injector.get(e,i&8?null:Qo,i)}catch(o){if(Hr(o))return o;throw o}}};function $1(t,e=0){let n=Ic();if(n===void 0)throw new Ne(-203,!1);if(n===null)return kp(t,void 0,e);{let i=B1(e),o=n.retrieve(t,i);if(Hr(o)){if(i.optional)return null;throw o}return o}}function dt(t,e=0){return(Xg()||$1)(Vn(t),e)}function N(t,e){return dt(t,Xo(e))}function Xo(t){return typeof t>"u"||typeof t=="number"?t:0|(t.optional&&8)|(t.host&&1)|(t.self&&2)|(t.skipSelf&&4)}function B1(t){return{optional:!!(t&8),host:!!(t&1),self:!!(t&2),skipSelf:!!(t&4)}}function pp(t){let e=[];for(let n=0;n<t.length;n++){let i=Vn(t[n]);if(Array.isArray(i)){if(i.length===0)throw new Ne(900,!1);let o,r=0;for(let s=0;s<i.length;s++){let a=i[s],c=H1(a);typeof c=="number"?c===-1?o=a.token:r|=c:o=a}e.push(dt(o,r))}else e.push(dt(i))}return e}function H1(t){return t[j1]}function Wr(t,e){let n=Object.hasOwn(t,lp);return n?t[lp]:null}function Jg(t,e,n){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++){let o=t[i],r=e[i];if(n&&(o=n(o),r=n(r)),r!==o)return!1}return!0}function e0(t){return t.flat(Number.POSITIVE_INFINITY)}function Qc(t,e){t.forEach(n=>Array.isArray(n)?Qc(n,e):e(n))}function Ip(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function ta(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}function t0(t,e,n,i){let o=t.length;if(o==e)t.push(n,i);else if(o===1)t.push(i,t[0]),t[0]=n;else{for(o--,t.push(t[o-1],t[o]);o>e;){let r=o-2;t[o]=t[r],o--}t[e]=n,t[e+1]=i}}function Xc(t,e,n){let i=Kr(t,e);return i>=0?t[i|1]=n:(i=~i,t0(t,i,e,n)),i}function Jc(t,e){let n=Kr(t,e);if(n>=0)return t[n|1]}function Kr(t,e){return U1(t,e,1)}function U1(t,e,n){let i=0,o=t.length>>n;for(;o!==i;){let r=i+(o-i>>1),s=t[r<<n];if(e===s)return r<<n;s>e?o=r:i=r+1}return~(o<<n)}var rr={},pi=[],sr=new He(""),el=new He("",-1),Np=new He(""),Yr=class{get(e,n=Qo){if(n===Qo){let o=Qg("",-201);throw o.name="\u0275NotFound",o}return n}};function Zr(t){return{\u0275providers:t}}function n0(t){return Zr([{provide:sr,multi:!0,useValue:t}])}function i0(...t){return{\u0275providers:Op(!0,t),\u0275fromNgModule:!0}}function Op(t,...e){let n=[],i=new Set,o,r=s=>{n.push(s)};return Qc(e,s=>{let a=s;Vc(a,r,[],i)&&(o||=[],o.push(a))}),o!==void 0&&o0(o,r),n}function o0(t,e){for(let n=0;n<t.length;n++){let{ngModule:i,providers:o}=t[n];Pp(o,r=>{e(r,i)})}}function Vc(t,e,n,i){if(t=Vn(t),!t)return!1;let o=null,r=cp(t),s=!r&&ir(t);if(!r&&!s){let c=t.ngModule;if(r=cp(c),r)o=c;else return!1}else{if(s&&!s.standalone)return!1;o=t}let a=i.has(o);if(s){if(a)return!1;if(i.add(o),s.dependencies){let c=typeof s.dependencies=="function"?s.dependencies():s.dependencies;for(let l of c)Vc(l,e,n,i)}}else if(r){if(r.imports!=null&&!a){i.add(o);let l;Qc(r.imports,p=>{Vc(p,e,n,i)&&(l||=[],l.push(p))}),l!==void 0&&o0(l,e)}if(!a){let l=Wr(o)||(()=>new o);e({provide:o,useFactory:l,deps:pi},o),e({provide:Np,useValue:o,multi:!0},o),e({provide:sr,useValue:()=>dt(o),multi:!0},o)}let c=r.providers;if(c!=null&&!a){let l=t;Pp(c,p=>{e(p,l)})}}else return!1;return o!==t&&t.providers!==void 0}function Pp(t,e){for(let n of t)Ep(n)&&(n=n.\u0275providers),Array.isArray(n)?Pp(n,e):e(n)}var z1=xt({provide:String,useValue:xt});function r0(t){return t!==null&&typeof t=="object"&&z1 in t}function G1(t){return!!(t&&t.useExisting)}function q1(t){return!!(t&&t.useFactory)}function jc(t){return typeof t=="function"}var na=new He(""),Lc={},zg={},ap;function ia(){return ap===void 0&&(ap=new Yr),ap}var fi=class{},Jo=class extends fi{parent;source;scopes;records=new Map;_ngOnDestroyHooks=new Set;_onDestroyHooks=[];get destroyed(){return this._destroyed}_destroyed=!1;injectorDefTypes;constructor(e,n,i,o){super(),this.parent=n,this.source=i,this.scopes=o,mp(e,s=>this.processProvider(s)),this.records.set(el,qr(void 0,this)),o.has("environment")&&this.records.set(fi,qr(void 0,this));let r=this.records.get(na);r!=null&&typeof r.value=="string"&&this.scopes.add(r.value),this.injectorDefTypes=new Set(this.get(Np,pi,{self:!0}))}retrieve(e,n){let i=Xo(n)||0;try{return this.get(e,Qo,i)}catch(o){if(Hr(o))return o;throw o}}destroy(){Zs(this),this._destroyed=!0;let e=ge(null);try{for(let i of this._ngOnDestroyHooks)i.ngOnDestroy();let n=this._onDestroyHooks;this._onDestroyHooks=[];for(let i of n)i()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),ge(e)}}onDestroy(e){return Zs(this),this._onDestroyHooks.push(e),()=>this.removeOnDestroy(e)}runInContext(e){Zs(this);let n=Ii(this),i=Fn(void 0),o;try{return e()}finally{Ii(n),Fn(i)}}get(e,n=Qo,i){if(Zs(this),Object.hasOwn(e,Ug))return e[Ug](this);let o=Xo(i),r,s=Ii(this),a=Fn(void 0);try{if(!(o&4)){let l=this.records.get(e);if(l===void 0){let p=Q1(e)&&Wc(e);p&&this.injectableDefInScope(p)?l=qr(fp(e),Lc):l=null,this.records.set(e,l)}if(l!=null)return this.hydrate(e,l,o)}let c=o&2?ia():this.parent;return n=o&8&&n===Qo?null:n,c.get(e,n)}catch(c){let l=F1(c);throw l===-200||l===-201?new Ne(l,null):c}finally{Fn(a),Ii(s)}}resolveInjectorInitializers(){let e=ge(null),n=Ii(this),i=Fn(void 0),o;try{let r=this.get(sr,pi,{self:!0});for(let s of r)s()}finally{Ii(n),Fn(i),ge(e)}}toString(){return"R3Injector[...]"}processProvider(e){e=Vn(e);let n=jc(e)?e:Vn(e&&e.provide),i=Y1(e);if(!jc(e)&&e.multi===!0){let o=this.records.get(n);o||(o=qr(void 0,Lc,!0),o.factory=()=>pp(o.multi),this.records.set(n,o)),n=e,o.multi.push(e)}this.records.set(n,i)}hydrate(e,n,i){let o=ge(null);try{if(n.value===zg)throw Mp("");return n.value===Lc&&(n.value=zg,n.value=n.factory(void 0,i)),typeof n.value=="object"&&n.value&&Z1(n.value)&&this._ngOnDestroyHooks.add(n.value),n.value}finally{ge(o)}}injectableDefInScope(e){if(!e.providedIn)return!1;let n=Vn(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 fp(t){let e=Wc(t),n=e!==null?e.factory:Wr(t);if(n!==null)return n;if(t instanceof He)throw new Ne(-204,!1);if(t instanceof Function)return W1(t);throw new Ne(-204,!1)}function W1(t){if(t.length>0)throw new Ne(-204,!1);let n=A1(t);return n!==null?()=>n.factory(t):()=>new t}function Y1(t){if(r0(t))return qr(void 0,t.useValue);{let e=s0(t);return qr(e,Lc)}}function s0(t,e,n){let i;if(jc(t)){let o=Vn(t);return Wr(o)||fp(o)}else if(r0(t))i=()=>Vn(t.useValue);else if(q1(t))i=()=>t.useFactory(...pp(t.deps||[]));else if(G1(t))i=(o,r)=>dt(Vn(t.useExisting),r!==void 0&&r&8?8:void 0);else{let o=Vn(t&&(t.useClass||t.provide));if(K1(t))i=()=>new o(...pp(t.deps));else return Wr(o)||fp(o)}return i}function Zs(t){if(t.destroyed)throw new Ne(-205,!1)}function qr(t,e,n=!1){return{factory:t,value:e,multi:n?[]:void 0}}function K1(t){return!!t.deps}function Z1(t){return t!==null&&typeof t=="object"&&typeof t.ngOnDestroy=="function"}function Q1(t){return typeof t=="function"||typeof t=="object"&&t.ngMetadataName==="InjectionToken"}function mp(t,e){for(let n of t)Array.isArray(n)?mp(n,e):n&&Ep(n)?mp(n.\u0275providers,e):e(n)}function tl(t,e){let n;t instanceof Jo?(Zs(t),n=t):n=new up(t);let i,o=Ii(n),r=Fn(void 0);try{return e()}finally{Ii(o),Fn(r)}}function a0(){return Xg()!==void 0||Ic()!=null}var mi=0,_e=1,Te=2,qt=3,Xn=4,In=5,Qr=6,Xr=7,jt=8,Ki=9,hi=10,It=11,Jr=12,Ap=13,yo=14,jn=15,_o=16,ar=17,Oi=18,oa=19,Rp=20,qi=21,nl=22,Wi=23,$n=24,cr=25,c0=26,ra=27,Yt=28,l0=1,Lp=6,lr=7,sa=8,dr=9,$t=10;function vo(t){return Array.isArray(t)&&typeof t[l0]=="object"}function Jn(t){return Array.isArray(t)&&t[l0]===!0}function Fp(t){return(t.flags&4)!==0}function bo(t){return t.componentOffset>-1}function es(t){return(t.flags&1)===1}function ur(t){return!!t.template}function ts(t){return(t[Te]&512)!==0}function pr(t){return(t[Te]&256)===256}var Pt=(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})(Pt||{}),Qs,er="svg",il="math",hp="",Gg="*",gp=()=>Object.create(null);function X1(){return Qs||(Qs=gp(),mo(Pt.HTML,void 0,[["iframe",["srcdoc"]],["*",["innerHTML","outerHTML"]]]),mo(Pt.STYLE,void 0,[["*",["style"]]]),mo(Pt.URL,void 0,[["*",["formAction"]],["area",["href"]],["a",["href","xlink:href"]],["form",["action"]],["img",["src"]],["video",["src"]]]),mo(Pt.URL,il,[["*",["href","xlink:href"]]]),mo(Pt.RESOURCE_URL,void 0,[["base",["href"]],["embed",["src"]],["frame",["src"]],["iframe",["src"]],["link",["href"]],["object",["codebase","data"]]]),mo(Pt.URL,er,[["a",["href","xlink:href"]]]),mo(Pt.ATTRIBUTE_NO_BINDING,er,[["animate",["attributeName","values","to","from"]],["set",["to","attributeName"]],["animateMotion",["attributeName"]],["animateTransform",["attributeName"]]]),mo(Pt.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"]]]),Qs)}function mo(t,e,n){let i=e??hp;for(let[o,r]of n){let s=o.toLowerCase();for(let a of r){let c=a.toLowerCase(),l=Qs[c]??=gp(),p=l[i]??=gp();p[s]=t}}}function d0(t,e,n){let o=X1()[e.toLowerCase()];if(!o)return Pt.NONE;let r=t.toLowerCase(),s;if(n){let a=o[n];a&&(s=a[r]??a[Gg])}if(s===void 0){let a=o[hp];a&&(s=a[r]??a[Gg])}if(s===void 0&&(!n||n===hp)){let a=o[er];a&&(s=a[r])}return s??Pt.NONE}function mn(t){for(;Array.isArray(t);)t=t[mi];return t}function Vp(t,e){return mn(e[t])}function ei(t,e){return mn(e[t.index])}function ol(t,e){return t.data[e]}function u0(t,e){return t[e]}function Pi(t,e){let n=e[t];return vo(n)?n:n[mi]}function rl(t){return(t[Te]&128)===128}function p0(t){return Jn(t[qt])}function ti(t,e){return e==null?null:t[e]}function jp(t){t[ar]=0}function $p(t){t[Te]&1024||(t[Te]|=1024,rl(t)&&fr(t))}function f0(t,e){for(;t>0;)e=e[yo],t--;return e}function aa(t){return!!(t[Te]&9216||t[$n]?.dirty)}function sl(t){t[hi].changeDetectionScheduler?.notify(8),t[Te]&64&&(t[Te]|=1024),aa(t)&&fr(t)}function fr(t){t[hi].changeDetectionScheduler?.notify(0);let e=Yi(t);for(;e!==null&&!(e[Te]&8192||(e[Te]|=8192,!rl(e)));)e=Yi(e)}function al(t,e){if(pr(t))throw new Ne(911,!1);t[qi]===null&&(t[qi]=[]),t[qi].push(e)}function m0(t,e){if(t[qi]===null)return;let n=t[qi].indexOf(e);n!==-1&&t[qi].splice(n,1)}function Yi(t){let e=t[qt];return Jn(e)?e[qt]:e}function Bp(t){return t[Xr]??=[]}function Hp(t){return t.cleanup??=[]}function h0(t,e,n,i){let o=Bp(e);o.push(n),t.firstCreatePass&&Hp(t).push(i,o.length-1)}var Fe={lFrame:I0(null),bindingsEnabled:!0,skipHydrationRootTNode:null};var yp=!1;function g0(){return Fe.lFrame.elementDepthCount}function y0(){Fe.lFrame.elementDepthCount++}function Up(){Fe.lFrame.elementDepthCount--}function cl(){return Fe.bindingsEnabled}function _0(){return Fe.skipHydrationRootTNode!==null}function zp(t){return Fe.skipHydrationRootTNode===t}function Gp(){Fe.skipHydrationRootTNode=null}function Ue(){return Fe.lFrame.lView}function hn(){return Fe.lFrame.tView}function D(t){return Fe.lFrame.contextLView=t,t[jt]}function M(t){return Fe.lFrame.contextLView=null,t}function Bn(){let t=qp();for(;t!==null&&t.type===64;)t=t.parent;return t}function qp(){return Fe.lFrame.currentTNode}function v0(){let t=Fe.lFrame,e=t.currentTNode;return t.isParent?e:e.parent}function ns(t,e){let n=Fe.lFrame;n.currentTNode=t,n.isParent=e}function Wp(){return Fe.lFrame.isParent}function b0(){Fe.lFrame.isParent=!1}function x0(){return Fe.lFrame.contextLView}function Yp(){return yp}function Xs(t){let e=yp;return yp=t,e}function Kp(){let t=Fe.lFrame,e=t.bindingRootIndex;return e===-1&&(e=t.bindingRootIndex=t.tView.bindingStartIndex),e}function C0(){return Fe.lFrame.bindingIndex}function E0(t){return Fe.lFrame.bindingIndex=t}function mr(){return Fe.lFrame.bindingIndex++}function ll(t){let e=Fe.lFrame,n=e.bindingIndex;return e.bindingIndex=e.bindingIndex+t,n}function w0(){return Fe.lFrame.inI18n}function S0(t,e){let n=Fe.lFrame;n.bindingIndex=n.bindingRootIndex=t,dl(e)}function T0(){return Fe.lFrame.currentDirectiveIndex}function dl(t){Fe.lFrame.currentDirectiveIndex=t}function D0(t){let e=Fe.lFrame.currentDirectiveIndex;return e===-1?null:t[e]}function M0(){return Fe.lFrame.currentQueryIndex}function ul(t){Fe.lFrame.currentQueryIndex=t}function J1(t){let e=t[_e];return e.type===2?e.declTNode:e.type===1?t[In]:null}function Zp(t,e,n){if(n&4){let o=e,r=t;for(;o=o.parent,o===null&&!(n&1);)if(o=J1(r),o===null||(r=r[yo],o.type&10))break;if(o===null)return!1;e=o,t=r}let i=Fe.lFrame=k0();return i.currentTNode=e,i.lView=t,!0}function pl(t){let e=k0(),n=t[_e];Fe.lFrame=e,e.currentTNode=n.firstChild,e.lView=t,e.tView=n,e.contextLView=t,e.bindingIndex=n.bindingStartIndex,e.inI18n=!1}function k0(){let t=Fe.lFrame,e=t===null?null:t.child;return e===null?I0(t):e}function I0(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 N0(){let t=Fe.lFrame;return Fe.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}var Qp=N0;function fl(){let t=N0();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 O0(t){return(Fe.lFrame.contextLView=f0(t,Fe.lFrame.contextLView))[jt]}function gi(){return Fe.lFrame.selectedIndex}function xo(t){Fe.lFrame.selectedIndex=t}function ca(){let t=Fe.lFrame;return ol(t.tView,t.selectedIndex)}function rt(){Fe.lFrame.currentNamespace=er}function Jt(){ew()}function ew(){Fe.lFrame.currentNamespace=null}function Xp(){return Fe.lFrame.currentNamespace}var P0=!0;function ml(){return P0}function la(t){P0=t}function _p(t,e=null,n=null,i){let o=A0(t,e,n,i);return o.resolveInjectorInitializers(),o}function A0(t,e=null,n=null,i,o=new Set){let r=[n||pi,i0(t)],s;return new Jo(r,e||ia(),s||null,o)}var Mn=class t{static THROW_IF_NOT_FOUND=Qo;static NULL=new Yr;static create(e,n){if(Array.isArray(e))return _p({name:""},n,e,"");{let i=e.name??"";return _p({name:i},e.parent,e.providers,i)}}static \u0275prov=xe({token:t,providedIn:"any",factory:()=>dt(el)});static __NG_ELEMENT_ID__=-1},wn=new He(""),pt=class{static __NG_ELEMENT_ID__=tw;static __NG_ENV_ID__=e=>e},$c=class extends pt{_lView;constructor(e){super(),this._lView=e}get destroyed(){return pr(this._lView)}onDestroy(e){let n=this._lView;return al(n,e),()=>m0(n,e)}};function tw(){return new $c(Ue())}var R0=!1,L0=new He(""),is=(()=>{class t{taskId=0;pendingTasks=new Set;destroyed=!1;pendingTask=new Ks(!1);debugTaskTracker=N(L0,{optional:!0});get hasPendingTasks(){return this.destroyed?!1:this.pendingTask.value}get hasPendingTasksObservable(){return this.destroyed?new Ni(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=xe({token:t,providedIn:"root",factory:()=>new t})}return t})(),vp=class extends Zn{__isAsync;destroyRef=void 0;pendingTasks=void 0;constructor(e=!1){super(),this.__isAsync=e,a0()&&(this.destroyRef=N(pt,{optional:!0})??void 0,this.pendingTasks=N(is,{optional:!0})??void 0)}emit(e){let n=ge(null);try{super.next(e)}finally{ge(n)}}subscribe(e,n,i){let o=e,r=n||(()=>null),s=i;if(e&&typeof e=="object"){let c=e;o=c.next?.bind(c),r=c.error?.bind(c),s=c.complete?.bind(c)}this.__isAsync&&(r=this.wrapInTimeout(r),o&&(o=this.wrapInTimeout(o)),s&&(s=this.wrapInTimeout(s)));let a=super.subscribe({next:o,error:r,complete:s});return e instanceof En&&e.add(a),a}wrapInTimeout(e){return n=>{let i=this.pendingTasks?.add();setTimeout(()=>{try{e(n)}finally{i!==void 0&&this.pendingTasks?.remove(i)}})}}},Gi=vp;function Bc(...t){}function Jp(t){let e,n;function i(){t=Bc;try{n!==void 0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(n),e!==void 0&&clearTimeout(e)}catch{}}return e=setTimeout(()=>{t(),i()}),typeof requestAnimationFrame=="function"&&(n=requestAnimationFrame(()=>{t(),i()})),()=>i()}function F0(t){return queueMicrotask(()=>t()),()=>{t=Bc}}var ef="isAngularZone",Js=ef+"_ID",nw=0,kn=class t{hasPendingMacrotasks=!1;hasPendingMicrotasks=!1;isStable=!0;onUnstable=new Gi(!1);onMicrotaskEmpty=new Gi(!1);onStable=new Gi(!1);onError=new Gi(!1);constructor(e){let{enableLongStackTrace:n=!1,shouldCoalesceEventChangeDetection:i=!1,shouldCoalesceRunChangeDetection:o=!1,scheduleInRootZone:r=R0}=e;if(typeof Zone>"u")throw new Ne(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=!o&&i,s.shouldCoalesceRunChangeDetection=o,s.callbackScheduled=!1,s.scheduleInRootZone=r,rw(s)}static isInAngularZone(){return typeof Zone<"u"&&Zone.current.get(ef)===!0}static assertInAngularZone(){if(!t.isInAngularZone())throw new Ne(909,!1)}static assertNotInAngularZone(){if(t.isInAngularZone())throw new Ne(909,!1)}run(e,n,i){return this._inner.run(e,n,i)}runTask(e,n,i,o){let r=this._inner,s=r.scheduleEventTask("NgZoneEvent: "+o,e,iw,Bc,Bc);try{return r.runTask(s,n,i)}finally{r.cancelTask(s)}}runGuarded(e,n,i){return this._inner.runGuarded(e,n,i)}runOutsideAngular(e){return this._outer.run(e)}},iw={};function tf(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 ow(t){if(t.isCheckStableRunning||t.callbackScheduled)return;t.callbackScheduled=!0;function e(){Jp(()=>{t.callbackScheduled=!1,bp(t),t.isCheckStableRunning=!0,tf(t),t.isCheckStableRunning=!1})}t.scheduleInRootZone?Zone.root.run(()=>{e()}):t._outer.run(()=>{e()}),bp(t)}function rw(t){let e=()=>{ow(t)},n=nw++;t._inner=t._inner.fork({name:"angular",properties:{[ef]:!0,[Js]:n,[Js+n]:!0},onInvokeTask:(i,o,r,s,a,c)=>{if(sw(c))return i.invokeTask(r,s,a,c);try{return qg(t),i.invokeTask(r,s,a,c)}finally{(t.shouldCoalesceEventChangeDetection&&s.type==="eventTask"||t.shouldCoalesceRunChangeDetection)&&e(),Wg(t)}},onInvoke:(i,o,r,s,a,c,l)=>{try{return qg(t),i.invoke(r,s,a,c,l)}finally{t.shouldCoalesceRunChangeDetection&&!t.callbackScheduled&&!aw(c)&&e(),Wg(t)}},onHasTask:(i,o,r,s)=>{i.hasTask(r,s),o===r&&(s.change=="microTask"?(t._hasPendingMicrotasks=s.microTask,bp(t),tf(t)):s.change=="macroTask"&&(t.hasPendingMacrotasks=s.macroTask))},onHandleError:(i,o,r,s)=>(i.handleError(r,s),t.runOutsideAngular(()=>t.onError.emit(s)),!1)})}function bp(t){t._hasPendingMicrotasks||(t.shouldCoalesceEventChangeDetection||t.shouldCoalesceRunChangeDetection)&&t.callbackScheduled===!0?t.hasPendingMicrotasks=!0:t.hasPendingMicrotasks=!1}function qg(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function Wg(t){t._nesting--,tf(t)}var ea=class{hasPendingMicrotasks=!1;hasPendingMacrotasks=!1;isStable=!0;onUnstable=new Gi;onMicrotaskEmpty=new Gi;onStable=new Gi;onError=new Gi;run(e,n,i){return e.apply(n,i)}runGuarded(e,n,i){return e.apply(n,i)}runOutsideAngular(e){return e()}runTask(e,n,i,o){return e.apply(n,i)}};function sw(t){return V0(t,"__ignore_ng_zone__")}function aw(t){return V0(t,"__scheduler_tick__")}function V0(t,e){return!Array.isArray(t)||t.length!==1?!1:t[0]?.data?.[e]===!0}var Qn=class{_console=console;handleError(e){this._console.error("ERROR",e)}};function j0(t){return $0(t)?t:new xp(t)}function $0(t){return t instanceof Error||typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.message=="string"}var xp=class extends Error{constructor(e){super(String(e),{cause:e}),this.name="ErrorBoundaryWrappedError"}},Co=new He("",{factory:()=>{let t=N(kn),e=N(fi),n;return i=>{t.runOutsideAngular(()=>{e.destroyed&&!n?setTimeout(()=>{throw i}):(n??=e.get(Qn),n.handleError(i))})}}}),B0={provide:sr,useValue:()=>{let t=N(Qn,{optional:!0})},multi:!0},cw=new He("",{factory:()=>{let t=N(wn).defaultView;if(!t)return;let e=N(Co),n=r=>{e(r.reason),r.preventDefault()},i=r=>{r.error?e(r.error):e(new Error(r.message,{cause:r})),r.preventDefault()},o=()=>{t.addEventListener("unhandledrejection",n),t.addEventListener("error",i)};typeof Zone<"u"?Zone.root.run(o):o(),N(pt).onDestroy(()=>{t.removeEventListener("error",i),t.removeEventListener("unhandledrejection",n)})}});function nf(){return Zr([n0(()=>{N(cw)})])}function O(t,e){let[n,i,o]=Yu(t,e?.equal),r=n,s=r[fn];return r.set=i,r.update=o,r.asReadonly=of.bind(r),r}function of(){let t=this[fn];if(t.readonlyFn===void 0){let e=()=>this();e[fn]=t,t.readonlyFn=e}return t.readonlyFn}var da=new He("",{factory:()=>lw}),lw="ng";var hl=new He(""),ua=new He("",{providedIn:"platform",factory:()=>"unknown"});var gl=new He("",{factory:()=>N(wn).body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});var pa=(()=>{class t{view;node;constructor(n,i){this.view=n,this.node=i}static __NG_ELEMENT_ID__=dw}return t})();function dw(){return new pa(Ue(),Bn())}var ho=class{},fa=new He("",{factory:()=>!0});var rf=new He(""),yl=(()=>{class t{static \u0275prov=xe({token:t,providedIn:"root",factory:()=>new Cp})}return t})(),Cp=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,i=this.queues.get(n);i.has(e)&&(i.delete(e),e.dirty&&this.dirtyEffectCount--)}enqueue(e){let n=e.zone;this.queues.has(n)||this.queues.set(n,new Set);let i=this.queues.get(n);i.has(e)||i.add(e)}flush(){for(;this.dirtyEffectCount>0;){let e=!1;for(let[n,i]of this.queues)n===null?e||=this.flushQueue(i):e||=n.run(()=>this.flushQueue(i));e||(this.dirtyEffectCount=0)}}flushQueue(e){let n=!1;for(let i of e)i.dirty&&(this.dirtyEffectCount--,n=!0,i.run());return n}},Hc=class{[fn];constructor(e){this[fn]=e}destroy(){this[fn].destroy()}};function se(t,e){let n=e?.injector??N(Mn),i=e?.manualCleanup!==!0?n.get(pt):null,o,r=n.get(pa,null,{optional:!0}),s=n.get(ho);return r!==null?(o=U0(r.view,s,t),i instanceof $c&&i._lView===r.view&&(i=null)):o=fw(t,n.get(yl),s),o.injector=n,i!==null&&(o.onDestroyFns=[i.onDestroy(()=>o.destroy())]),new Hc(o)}var H0=K(V({},Zu),{cleanupFns:void 0,zone:null,onDestroyFns:null,run(){let t=Xs(!1);try{Qu(this)}finally{Xs(t)}},cleanup(){if(!this.cleanupFns?.length)return;let t=ge(null);try{for(;this.cleanupFns.length;)this.cleanupFns.pop()()}finally{this.cleanupFns=[],ge(t)}}}),uw=K(V({},H0),{consumerMarkedDirty(){this.scheduler.schedule(this),this.notifier.notify(12)},destroy(){if(Wo(this),this.onDestroyFns!==null)for(let t of this.onDestroyFns)t();this.cleanup(),this.scheduler.remove(this)}}),pw=K(V({},H0),{consumerMarkedDirty(){this.view[Te]|=8192,fr(this.view),this.notifier.notify(13)},destroy(){if(Wo(this),this.onDestroyFns!==null)for(let t of this.onDestroyFns)t();this.cleanup(),this.view[Wi]?.delete(this)}});function U0(t,e,n){let i=Object.create(pw);return i.view=t,i.zone=typeof Zone<"u"?Zone.current:null,i.notifier=e,i.userFn=n,i.fn=z0(i,n),t[Wi]??=new Set,t[Wi].add(i),i.consumerMarkedDirty(i),i}function fw(t,e,n){let i=Object.create(uw);return i.userFn=t,i.fn=z0(i,t),i.scheduler=e,i.notifier=n,i.zone=typeof Zone<"u"?Zone.current:null,i.scheduler.add(i),i.notifier.notify(12),i}function z0(t,e){return()=>{e(n=>(t.cleanupFns??=[]).push(n))}}var Qf=Symbol("InputSignalNode#UNSET"),Ty=K(V({},Ws),{transformFn:void 0,applyValueToInputSignal(t,e){Yo(t,e)}});function Xf(t){return{toString:t}.toString()}var st=(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})(st||{}),Dl=class{previousValue;currentValue;firstChange;constructor(e,n,i){this.previousValue=e,this.currentValue=n,this.firstChange=i}isFirstChange(){return this.firstChange}};function Dy(t,e,n,i){e!==null?e.applyValueToInputSignal(e,i):t[n]=i}var My=null,Jf=(()=>{My=G0;let t=()=>G0;return t.ngInherit=!0,t})();function Dw(){return My}function G0(t){return t.type.prototype.ngOnChanges&&(t.setInput=kw),Mw}function Mw(){let t=ky(this),e=t?.current;if(e){let n=t.previous;if(n===rr)t.previous=e;else for(let i in e)n[i]=e[i];t.current=null,this.ngOnChanges(e)}}function kw(t,e,n,i,o){let r=this.declaredInputs[i],s=ky(t)||Iw(t,{previous:rr,current:null}),a=s.current||(s.current={}),c=s.previous,l=c[r];a[r]=new Dl(l&&l.currentValue,n,c===rr),Dy(t,e,o,n)}var ff="__ngSimpleChanges__";function ky(t){return Object.hasOwn(t,ff)&&t[ff]||null}function Iw(t,e){return t[ff]=e}var q0=[];var ht=function(t,e=null,n){for(let i=0;i<q0.length;i++){let o=q0[i];o(t,e,n)}};function Nw(t,e,n){let{ngOnChanges:i,ngOnInit:o,ngDoCheck:r}=e.type.prototype;if(i){let s=Dw()(e);(n.preOrderHooks??=[]).push(t,s),(n.preOrderCheckHooks??=[]).push(t,s)}o&&(n.preOrderHooks??=[]).push(0-t,o),r&&((n.preOrderHooks??=[]).push(t,r),(n.preOrderCheckHooks??=[]).push(t,r))}function Iy(t,e){for(let n=e.directiveStart,i=e.directiveEnd;n<i;n++){let r=t.data[n].type.prototype,{ngAfterContentInit:s,ngAfterContentChecked:a,ngAfterViewInit:c,ngAfterViewChecked:l,ngOnDestroy:p}=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)),p!=null&&(t.destroyHooks??=[]).push(n,p)}}function Cl(t,e,n){Ny(t,e,3,n)}function El(t,e,n,i){(t[Te]&3)===n&&Ny(t,e,n,i)}function sf(t,e){let n=t[Te];(n&3)===e&&(n&=16383,n+=1,t[Te]=n)}function Ny(t,e,n,i){let o=i!==void 0?t[ar]&65535:0,r=i??-1,s=e.length-1,a=0;for(let c=o;c<s;c++)if(typeof e[c+1]=="number"){if(a=e[c],i!=null&&a>=i)break}else e[c]<0&&(t[ar]+=65536),(a<r||r==-1)&&(Ow(t,n,e,c),t[ar]=(t[ar]&4294901760)+c+2),c++}function W0(t,e){ht(st.LifecycleHookStart,t,e);let n=ge(null);try{e.call(t)}finally{ge(n),ht(st.LifecycleHookEnd,t,e)}}function Ow(t,e,n,i){let o=n[i]<0,r=n[i+1],s=o?-n[i]:n[i],a=t[s];o?t[Te]>>14<t[ar]>>16&&(t[Te]&3)===e&&(t[Te]+=16384,W0(a,r)):W0(a,r)}var ss=-1,ga=class{factory;name;injectImpl;resolving=!1;canSeeViewProviders;multi;componentProviders;index;providerFactory;constructor(e,n,i,o){this.factory=e,this.name=o,this.canSeeViewProviders=n,this.injectImpl=i}};function Pw(t){return(t.flags&8)!==0}function Aw(t){return(t.flags&16)!==0}function Rw(t,e,n){let i=0;for(;i<n.length;){let o=n[i];if(typeof o=="number"){if(o!==0)break;i++;let r=n[i++],s=n[i++],a=n[i++];t.setAttribute(e,s,a,r)}else{let r=o,s=n[++i];Fw(r)?t.setProperty(e,r,s):t.setAttribute(e,r,s),i++}}return i}function Lw(t){return t===3||t===4||t===6}function Fw(t){return t.charCodeAt(0)===64}function $l(t,e){if(!(e===null||e.length===0))if(t===null||t.length===0)t=e.slice();else{let n=-1;for(let i=0;i<e.length;i++){let o=e[i];typeof o=="number"?n=o:n===0||(n===-1||n===2?Y0(t,n,o,null,e[++i]):Y0(t,n,o,null,null))}}return t}function Y0(t,e,n,i,o){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){o!==null&&(t[r+1]=o);return}r++,o!==null&&r++}s!==-1&&(t.splice(s,0,e),r=s+1),t.splice(r++,0,n),o!==null&&t.splice(r++,0,o)}function Oy(t){return t!==ss}function Ml(t){return t&32767}function Vw(t){return t>>16}function kl(t,e){let n=Vw(t),i=e;for(;n>0;)i=i[yo],n--;return i}var mf=!0;function K0(t){let e=mf;return mf=t,e}var jw=256,Py=jw-1,Ay=5,$w=0,Ai={};function Bw(t,e,n){let i;typeof n=="string"?i=n.charCodeAt(0)||0:Object.hasOwn(n,nr)&&(i=n[nr]),i==null&&(i=n[nr]=$w++);let o=i&Py,r=1<<o;e.data[t+(o>>Ay)]|=r}function Ry(t,e){let n=Ly(t,e);if(n!==-1)return n;let i=e[_e];i.firstCreatePass&&(t.injectorIndex=e.length,af(i.data,t),af(e,null),af(i.blueprint,null));let o=em(t,e),r=t.injectorIndex;if(Oy(o)){let s=Ml(o),a=kl(o,e),c=a[_e].data;for(let l=0;l<8;l++)e[r+l]=a[s+l]|c[s+l]}return e[r+8]=o,r}function af(t,e){t.push(0,0,0,0,0,0,0,0,e)}function Ly(t,e){return t.injectorIndex===-1||t.parent&&t.parent.injectorIndex===t.injectorIndex||e[t.injectorIndex+8]===null?-1:t.injectorIndex}function em(t,e){if(t.parent&&t.parent.injectorIndex!==-1)return t.parent.injectorIndex;let n=0,i=null,o=e;for(;o!==null;){if(i=By(o),i===null)return ss;if(n++,o=o[yo],i.injectorIndex!==-1)return i.injectorIndex|n<<16}return ss}function Hw(t,e,n){Bw(t,e,n)}function Fy(t,e,n){if(n&8||t!==void 0)return t;Zc(e,"NodeInjector")}function Vy(t,e,n,i){if(n&8&&i===void 0&&(i=null),(n&3)===0){let o=t[Ki],r=Fn(void 0);try{return o?o.get(e,i,n&8):kp(e,i,n&8)}finally{Fn(r)}}return Fy(i,e,n)}function jy(t,e,n,i=0,o){if(t!==null){if(e[Te]&2048&&!(i&2)){let s=qw(t,e,n,i,Ai);if(s!==Ai)return s}let r=$y(t,e,n,i,Ai);if(r!==Ai)return r}return Vy(e,n,i,o)}function $y(t,e,n,i,o){let r=zw(n);if(typeof r=="function"){if(!Zp(e,t,i))return i&1?Fy(o,n,i):Vy(e,n,i,o);try{let s;if(s=r(i),s==null&&!(i&8))Zc(n);else return s}finally{Qp()}}else if(typeof r=="number"){let s=null,a=Ly(t,e),c=ss,l=i&1?e[jn][In]:null;for((a===-1||i&4)&&(c=a===-1?em(t,e):e[a+8],c===ss||!Q0(i,!1)?a=-1:(s=e[_e],a=Ml(c),e=kl(c,e)));a!==-1;){let p=e[_e];if(Z0(r,a,p.data)){let f=Uw(a,e,n,s,i,l);if(f!==Ai)return f}c=e[a+8],c!==ss&&Q0(i,e[_e].data[a+8]===l)&&Z0(r,a,e)?(s=p,a=Ml(c),e=kl(c,e)):a=-1}}return o}function Uw(t,e,n,i,o,r){let s=e[_e],a=s.data[t+8],c=i==null?bo(a)&&mf:i!=s&&(a.type&3)!==0,l=o&1&&r===a,p=wl(a,s,n,c,l);return p!==null?Il(e,s,p,a,o):Ai}function wl(t,e,n,i,o){let r=t.providerIndexes,s=e.data,a=r&1048575,c=t.directiveStart,l=t.directiveEnd,p=r>>20,f=i?a:a+p,_=o?a+p:l;for(let x=f;x<_;x++){let C=s[x];if(x<c&&n===C||x>=c&&C.type===n)return x}if(o){let x=s[c];if(x&&ur(x)&&x.type===n)return c}return null}function Il(t,e,n,i,o){let r=t[n],s=e.data;if(r instanceof ga){let a=r;if(a.resolving)throw Mp("");let c=K0(a.canSeeViewProviders);a.resolving=!0;let l=s[n].type||s[n],p,f=a.injectImpl?Fn(a.injectImpl):null,_=Zp(t,i,0);try{r=t[n]=a.factory(void 0,o,s,t,i),e.firstCreatePass&&n>=i.directiveStart&&Nw(n,s[n],e)}finally{f!==null&&Fn(f),K0(c),a.resolving=!1,Qp()}}return r}function zw(t){if(typeof t=="string")return t.charCodeAt(0)||0;let e=Object.hasOwn(t,nr)?t[nr]:void 0;return typeof e=="number"?e>=0?e&Py:Gw:e}function Z0(t,e,n){let i=1<<t;return!!(n[e+(t>>Ay)]&i)}function Q0(t,e){return!(t&2)&&!(t&1&&e)}var Zi=class{_tNode;_lView;constructor(e,n){this._tNode=e,this._lView=n}get(e,n,i){return jy(this._tNode,this._lView,e,Xo(i),n)}};function Gw(){return new Zi(Bn(),Ue())}function qw(t,e,n,i,o){let r=t,s=e;for(;r!==null&&s!==null&&s[Te]&2048&&!ts(s);){let a=$y(r,s,n,i|2,Ai);if(a!==Ai)return a;i&=-5;let c=r.parent;if(!c){let l=s[Rp];if(l){let p=l.get(n,Ai,i);if(p!==Ai)return p}c=By(s),s=s[yo]}r=c}return o}function By(t){let e=t[_e],n=e.type;return n===2?e.declTNode:n===1?t[In]:null}function yr(t){return{token:t.token,providedIn:t.autoProvided===!1?null:"root",factory:t.factory,value:void 0}}function Ww(){return us(Bn(),Ue())}function us(t,e){return new Bt(ei(t,e))}var Bt=(()=>{class t{nativeElement;constructor(n){this.nativeElement=n}static __NG_ELEMENT_ID__=Ww}return t})();function Yw(t){return t instanceof Bt?t.nativeElement:t}function Kw(){return this._results[Symbol.iterator]()}var Nl=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 Zn}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 i=e0(e);(this._changesDetected=!Jg(this._results,i,n))&&(this._results=i,this.length=i.length,this.last=i[this.length-1],this.first=i[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]=Kw};function Hy(t){return(t.flags&128)===128}var tm=(function(t){return t[t.OnPush=0]="OnPush",t[t.Eager=1]="Eager",t[t.Default=1]="Default",t})(tm||{}),Uy=new Map,Zw=0;function Qw(){return Zw++}function Xw(t){Uy.set(t[oa],t)}function hf(t){Uy.delete(t[oa])}var X0="__ngContext__";function as(t,e){vo(e)?(t[X0]=e[oa],Xw(e)):t[X0]=e}function zy(t){return qy(t[Jr])}function Gy(t){return qy(t[Xn])}function qy(t){for(;t!==null&&!Jn(t);)t=t[Xn];return t}var gf;function nm(t){gf=t}function im(){if(gf!==void 0)return gf;if(typeof document<"u")return document;throw new Ne(210,!1)}var Wy="r";var Yy="di";var Ky=!1,Zy=new He("",{factory:()=>Ky});var J0=new WeakMap;function Jw(t,e){if(t==null||typeof t!="object")return;let n=J0.get(t);n||(n=new WeakSet,J0.set(t,n)),n.add(e)}var eS=(t,e,n,i)=>{};function tS(t,e,n,i){eS(t,e,n,i)}function om(t){return(t.flags&32)===32}var nS=()=>null;function Qy(t,e,n=!1){return nS(t,e,n)}function Xy(t,e){let n=t.contentQueries;if(n!==null){let i=ge(null);try{for(let o=0;o<n.length;o+=2){let r=n[o],s=n[o+1];if(s!==-1){let a=t.data[s];ul(r),a.contentQueries(2,e[s],s)}}}finally{ge(i)}}}function yf(t,e,n){ul(0);let i=ge(null);try{e(t,n)}finally{ge(i)}}function rm(t,e,n){if(Fp(e)){let i=ge(null);try{let o=e.directiveStart,r=e.directiveEnd;for(let s=o;s<r;s++){let a=t.data[s];if(a.contentQueries){let c=n[s];a.contentQueries(1,c,s)}}}finally{ge(i)}}}var vi=(function(t){return t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t[t.ExperimentalIsolatedShadowDom=4]="ExperimentalIsolatedShadowDom",t})(vi||{});var iS={"http://www.w3.org/2000/svg":er,"http://www.w3.org/1998/Math/MathML":il},_l;function oS(){if(_l===void 0&&(_l=null,go.trustedTypes))try{_l=go.trustedTypes.createPolicy("angular",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch{}return _l}function Bl(t){return oS()?.createHTML(t)||t}var vl;function rS(){if(vl===void 0&&(vl=null,go.trustedTypes))try{vl=go.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch{}return vl}function ey(t){return rS()?.createHTML(t)||t}var Qi=class{changingThisBreaksApplicationSecurity;constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${Uc})`}},_f=class extends Qi{getTypeName(){return"HTML"}},vf=class extends Qi{getTypeName(){return"Style"}},bf=class extends Qi{getTypeName(){return"Script"}},xf=class extends Qi{getTypeName(){return"URL"}},Cf=class extends Qi{getTypeName(){return"ResourceURL"}};function ni(t){return t instanceof Qi?t.changingThisBreaksApplicationSecurity:t}function Ji(t,e){let n=Jy(t);if(n!=null&&n!==e){if(n==="ResourceURL"&&e==="URL")return!0;throw new Error(`Required a safe ${e}, got a ${n} (see ${Uc})`)}return n===e}function Jy(t){return t instanceof Qi&&t.getTypeName()||null}function sm(t){return new _f(t)}function am(t){return new vf(t)}function cm(t){return new bf(t)}function lm(t){return new xf(t)}function dm(t){return new Cf(t)}function sS(t){let e=new wf(t);return aS()?new Ef(e):e}var Ef=class{inertDocumentHelper;constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e="<body><remove></remove>"+e;try{let n=new window.DOMParser().parseFromString(Bl(e),"text/html").body;return n===null?this.inertDocumentHelper.getInertBodyElement(e):(n.firstChild?.remove(),n)}catch{return null}}},wf=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=Bl(e),n}};function aS(){try{return!!new window.DOMParser().parseFromString(Bl(""),"text/html")}catch{return!1}}var cS=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function wa(t){return t=String(t),t.match(cS)?t:"unsafe:"+t}function eo(t){let e=Object.create(null);for(let n of t.split(","))e[n]=!0;return e}function Sa(...t){let e=Object.create(null);for(let n of t)for(let i in n)Object.hasOwn(n,i)&&(e[i]=!0);return e}var e_=eo("area,br,col,hr,img,wbr"),t_=eo("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),n_=eo("rp,rt"),lS=Sa(n_,t_),dS=Sa(t_,eo("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")),uS=Sa(n_,eo("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")),ty=Sa(e_,dS,uS,lS),i_=eo("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),pS=eo("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"),fS=eo("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"),mS=Sa(i_,pS,fS),hS=eo("script,style,template"),Sf=class{sanitizedSomething=!1;buf=[];sanitizeChildren(e){let n=e.firstChild,i=!0,o=[];for(;n;){if(n.nodeType===Node.ELEMENT_NODE?i=this.startElement(n):n.nodeType===Node.TEXT_NODE?this.chars(n.nodeValue):this.sanitizedSomething=!0,i&&n.firstChild){o.push(n),n=_S(n);continue}for(;n;){n.nodeType===Node.ELEMENT_NODE&&this.endElement(n);let r=yS(n);if(r){n=r;break}n=o.pop()}}return this.buf.join("")}startElement(e){let n=ny(e).toLowerCase();if(!Object.hasOwn(ty,n))return this.sanitizedSomething=!0,!Object.hasOwn(hS,n);this.buf.push("<"),this.buf.push(n);let i=e.attributes;for(let o=0;o<i.length;o++){let r=i.item(o),s=r.name,a=s.toLowerCase();if(!Object.hasOwn(mS,a)){this.sanitizedSomething=!0;continue}let c=r.value;i_[a]&&(c=wa(c)),this.buf.push(" ",s,'="',iy(c),'"')}return this.buf.push(">"),!0}endElement(e){let n=ny(e).toLowerCase();Object.hasOwn(ty,n)&&!Object.hasOwn(e_,n)&&(this.buf.push("</"),this.buf.push(n),this.buf.push(">"))}chars(e){this.buf.push(iy(e))}};function gS(t,e){return(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}function yS(t){let e=t.nextSibling;if(e&&t!==e.previousSibling)throw o_(e);return e}function _S(t){let e=t.firstChild;if(e&&gS(t,e))throw o_(e);return e}function ny(t){let e=t.nodeName;return typeof e=="string"?e:"FORM"}function o_(t){return new Error(`Failed to sanitize html because the element is clobbered: ${t.outerHTML}`)}var vS=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,bS=/([^\#-~ |!])/g;function iy(t){return t.replace(/&/g,"&").replace(vS,function(e){let n=e.charCodeAt(0),i=e.charCodeAt(1);return"&#"+((n-55296)*1024+(i-56320)+65536)+";"}).replace(bS,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"<").replace(/>/g,">")}var bl;function Hl(t,e){let n=null;try{bl=bl||sS(t);let i=e?String(e):"";n=bl.getInertBodyElement(i);let o=5,r=i;do{if(o===0)throw new Error("Failed to sanitize html because the input is unstable");o--,i=r,r=n.innerHTML,n=bl.getInertBodyElement(i)}while(i!==r);let a=new Sf().sanitizeChildren(oy(n)||n);return Bl(a)}finally{if(n){let i=oy(n)||n;for(;i.firstChild;)i.firstChild.remove()}}}function oy(t){return"content"in t&&xS(t)?t.content:null}function xS(t){return t.nodeType===Node.ELEMENT_NODE&&t.nodeName==="TEMPLATE"}var CS=/^>|^->|<!--|-->|--!>|<!-$/g,ES=/(<|>)/g,wS="\u200B$1\u200B";function SS(t){return t.replace(CS,e=>e.replace(ES,wS))}function TS(t,e){return t.createText(e)}function DS(t,e,n){t.setValue(e,n)}function MS(t,e){return t.createComment(SS(e))}function r_(t,e,n){return t.createElement(e,n)}function hr(t,e,n,i,o){t.insertBefore(e,n,i,o)}function s_(t,e,n){t.appendChild(e,n)}function ry(t,e,n,i,o){i!==null?hr(t,e,n,i,o):s_(t,e,n)}function a_(t,e,n,i){t.removeChild(null,e,n,i)}function kS(t,e,n){t.setAttribute(e,"style",n)}function IS(t,e,n){n===""?t.removeAttribute(e,"class"):t.setAttribute(e,"class",n)}function c_(t,e,n){let{mergedAttrs:i,classes:o,styles:r}=n;i!==null&&Rw(t,e,i),o!==null&&IS(t,e,o),r!==null&&kS(t,e,r)}function NS(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 Eo(t,e,n){if(e!==void 0&&n!==void 0&&OS(e,n)!==Pt.HTML)return t;let i=l_();return i?ey(i.sanitize(Pt.HTML,t)||""):Ji(t,"HTML")?ey(ni(t)):Hl(im(),or(t))}function xi(t){let e=l_();return e?e.sanitize(Pt.URL,t)||"":Ji(t,"URL")?ni(t):wa(or(t))}function l_(){let t=Ue();return t&&t[hi].sanitizer}function OS(t,e){let[n,i]=PS(t);return d0(i,e,n)}function PS(t){t=t.toLowerCase();let e=NS(t,!1);if(e[0])return e;let i=gi()===-1?null:ca(),o=i?.namespace;if(t==="#host"&&i?.type===2){let r=ei(i,Ue());if(r.tagName&&(t=r.tagName.toLowerCase()),o==null){let s=r.namespaceURI;o=s&&iS[s]}}return[o,t]}function um(t){return t.ownerDocument.defaultView}function Mt(t){return t.ownerDocument}function AS(t,e,n){let i=t.length;for(;;){let o=t.indexOf(e,n);if(o===-1)return o;if(o===0||t.charCodeAt(o-1)<=32){let r=e.length;if(o+r===i||t.charCodeAt(o+r)<=32)return o}n=o+1}}var d_="ng-template";function RS(t,e,n,i){let o=0;if(i){for(;o<e.length&&typeof e[o]=="string";o+=2)if(e[o]==="class"&&AS(e[o+1].toLowerCase(),n,0)!==-1)return!0}else if(pm(t))return!1;if(o=e.indexOf(1,o),o>-1){let r;for(;++o<e.length&&typeof(r=e[o])=="string";)if(r.toLowerCase()===n)return!0}return!1}function pm(t){return t.type===4&&t.value!==d_}function LS(t,e,n){let i=t.type===4&&!n?d_:t.value;return e===i}function FS(t,e,n){let i=4,o=t.attrs,r=o!==null?$S(o):0,s=!1;for(let a=0;a<e.length;a++){let c=e[a];if(typeof c=="number"){if(!s&&!yi(i)&&!yi(c))return!1;if(s&&yi(c))continue;s=!1,i=c|i&1;continue}if(!s)if(i&4){if(i=2|i&1,c!==""&&!LS(t,c,n)||c===""&&e.length===1){if(yi(i))return!1;s=!0}}else if(i&8){if(o===null||!RS(t,o,c,n)){if(yi(i))return!1;s=!0}}else{let l=e[++a],p=VS(c,o,pm(t),n);if(p===-1){if(yi(i))return!1;s=!0;continue}if(l!==""){let f;if(p>r?f="":f=o[p+1].toLowerCase(),i&2&&l!==f){if(yi(i))return!1;s=!0}}}}return yi(i)||s}function yi(t){return(t&1)===0}function VS(t,e,n,i){if(e===null)return-1;let o=0;if(i||!n){let r=!1;for(;o<e.length;){let s=e[o];if(s===t)return o;if(s===3||s===6)r=!0;else if(s===1||s===2){let a=e[++o];for(;typeof a=="string";)a=e[++o];continue}else{if(s===4)break;if(s===0){o+=4;continue}}o+=r?1:2}return-1}else return BS(e,t)}function jS(t,e,n=!1){for(let i=0;i<e.length;i++)if(FS(t,e[i],n))return!0;return!1}function $S(t){for(let e=0;e<t.length;e++){let n=t[e];if(Lw(n))return e}return t.length}function BS(t,e){let n=t.indexOf(4);if(n>-1)for(n++;n<t.length;){let i=t[n];if(typeof i=="number")return-1;if(i===e)return n;n++}return-1}function sy(t,e){return t?":not("+e.trim()+")":e}function HS(t){let e=t[0],n=1,i=2,o="",r=!1;for(;n<t.length;){let s=t[n];if(typeof s=="string")if(i&2){let a=t[++n];o+="["+s+(a.length>0?'="'+a+'"':"")+"]"}else i&8?o+="."+s:i&4&&(o+=" "+s);else o!==""&&!yi(s)&&(e+=sy(r,o),o=""),i=s,r=r||!yi(i);n++}return o!==""&&(e+=sy(r,o)),e}function US(t){return t.map(HS).join(",")}function zS(t){let e=[],n=[],i=1,o=2;for(;i<t.length;){let r=t[i];if(typeof r=="string")o===2?r!==""&&e.push(r,t[++i]):o===8&&n.push(r);else{if(!yi(o))break;o=r}i++}return n.length&&e.push(1,...n),e}var Sn={},Ri=(function(t){return t[t.Important=1]="Important",t[t.DashCase=2]="DashCase",t})(Ri||{}),GS;function fm(t,e){return GS(t,e)}var mm=new Set;var nH=typeof document<"u"&&typeof document?.documentElement?.getAnimations=="function";var Tf=new WeakMap;function u_(t){return t?t[yo]??t:null}var os=new WeakSet;function qS(t,e,n){let i=Tf.get(t);if(!i||i.length===0)return;let o=e.parentNode,r=e.previousSibling,s=u_(n);for(let a=i.length-1;a>=0;a--){let{el:c,declarationView:l}=i[a],p=c.parentNode;c===e?(i.splice(a,1),os.add(c),c.dispatchEvent(new CustomEvent("animationend",{detail:{cancel:!0}}))):r&&c===r?(i.splice(a,1),c.dispatchEvent(new CustomEvent("animationend",{detail:{cancel:!0}})),c.parentNode?.removeChild(c)):p&&o&&p!==o&&(s===null||l===null||s===l)&&(i.splice(a,1),c.dispatchEvent(new CustomEvent("animationend",{detail:{cancel:!0}})),c.parentNode?.removeChild(c))}}function WS(t,e,n){let i=u_(n),o=Tf.get(t);o?o.some(r=>r.el===e)||o.push({el:e,declarationView:i}):Tf.set(t,[{el:e,declarationView:i}])}var Ul=(function(t){return t[t.CHANGE_DETECTION=0]="CHANGE_DETECTION",t[t.AFTER_NEXT_RENDER=1]="AFTER_NEXT_RENDER",t})(Ul||{}),to=new He(""),ay=new Set;function _r(t){ay.has(t)||(ay.add(t),performance?.mark?.("mark_feature_usage",{detail:{feature:t}}))}var hm=(()=>{class t{impl=null;execute(){this.impl?.execute()}static \u0275prov=xe({token:t,providedIn:"root",factory:()=>new t})}return t})(),p_=[0,1,2,3],f_=(()=>{class t{ngZone=N(kn);scheduler=N(ho);errorHandler=N(Qn,{optional:!0});sequences=new Set;deferredRegistrations=new Set;executing=!1;constructor(){N(to,{optional:!0})}execute(){let n=this.sequences.size>0;n&&ht(st.AfterRenderHooksStart),this.executing=!0;for(let i of p_)for(let o of this.sequences)if(!(o.erroredOrDestroyed||!o.hooks[i]))try{o.pipelinedValue=this.ngZone.runOutsideAngular(()=>this.maybeTrace(()=>{let r=o.hooks[i];return r(o.pipelinedValue)},o.snapshot))}catch(r){o.erroredOrDestroyed=!0,this.errorHandler?.handleError(r)}this.executing=!1;for(let i of this.sequences)i.afterRun(),i.once&&(this.sequences.delete(i),i.destroy());for(let i of this.deferredRegistrations)this.sequences.add(i);this.deferredRegistrations.size>0&&this.scheduler.notify(7),this.deferredRegistrations.clear(),n&&ht(st.AfterRenderHooksEnd)}register(n){let{view:i}=n;i!==void 0?((i[cr]??=[]).push(n),fr(i),i[Te]|=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,i){return i?i.run(Ul.AFTER_NEXT_RENDER,n):n()}static \u0275prov=xe({token:t,providedIn:"root",factory:()=>new t})}return t})(),Ol=class{impl;hooks;view;once;snapshot;erroredOrDestroyed=!1;pipelinedValue=void 0;unregisterOnDestroy;constructor(e,n,i,o,r,s=null){this.impl=e,this.hooks=n,this.view=i,this.once=o,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?.[cr];e&&(this.view[cr]=e.filter(n=>n!==this))}};function no(t,e){let n=e?.injector??N(Mn);return _r("NgAfterNextRender"),KS(t,n,e,!0)}function YS(t){return t instanceof Function?[void 0,void 0,t,void 0]:[t.earlyRead,t.write,t.mixedReadWrite,t.read]}function KS(t,e,n,i){let o=e.get(hm);o.impl??=e.get(f_);let r=e.get(to,null,{optional:!0}),s=n?.manualCleanup!==!0?e.get(pt):null,a=e.get(pa,null,{optional:!0}),c=new Ol(o.impl,YS(t),a?.view,i,s,r?.snapshot(null));return o.impl.register(c),c}var Df=null,m_=null;function cy(t,e,n,i){Df?.maybeQueueEnterAnimation(t,e,n,i)}function ly(t,e,n,i){Df===null?i(!1):Df.runLeaveAnimationsWithCallback(t,e,n,i)}function ZS(t){m_?.initViewDetachAnimations(t)}function QS(t){m_?.clearViewDetachAnimations(t)}function rs(t,e,n,i,o,r,s,a){if(o!=null){let c,l=!1;Jn(o)?c=o:vo(o)&&(l=!0,o=o[mi]);let p=mn(o);t===0&&i!==null?(cy(a,i,r,n),s==null?s_(e,i,p):hr(e,i,p,s||null,!0)):t===1&&i!==null?(hr(e,i,p,s||null,!0),qS(r,p,a),os.has(p)||cy(a,i,r,n)):t===2?(a?.[c0]?.leave?.has(r.index)&&WS(r,p,a),os.delete(p),ly(a,r,n,f=>{if(os.has(p)){os.delete(p);return}a_(e,p,l,f)})):t===3&&(os.delete(p),ly(a,r,n,()=>{e.destroyNode(p)})),c!=null&&dT(e,t,n,c,r,i,s)}}function XS(t,e){h_(t,e),e[mi]=null,e[In]=null}function JS(t,e,n,i,o,r){i[mi]=o,i[In]=e,Gl(t,i,n,1,o,r)}function h_(t,e){e[hi].changeDetectionScheduler?.notify(9),Gl(t,e,e[It],2,null,null)}function eT(t){let e=t[Jr];if(!e)return cf(t[_e],t);for(;e;){let n=null;if(vo(e))n=e[Jr];else{let i=e[$t];i&&(n=i)}if(!n){for(;e&&!e[Xn]&&e!==t;)vo(e)&&cf(e[_e],e),e=e[qt];e===null&&(e=t),vo(e)&&cf(e[_e],e),n=e&&e[Xn]}e=n}}function gm(t,e){let n=t[dr],i=n.indexOf(e);n.splice(i,1)}function zl(t,e){if(pr(e))return;let n=e[It];n.destroyNode&&Gl(t,e,n,3,null,null),eT(e)}function cf(t,e){if(pr(e))return;let n=ge(null);try{e[Te]&=-129,e[Te]|=256,e[$n]&&Wo(e[$n]),nT(t,e),tT(t,e),e[_e].type===1&&e[It].destroy();let i=e[_o];if(i!==null&&Jn(e[qt])){i!==e[qt]&&gm(i,e);let o=e[Oi];o!==null&&o.detachView(t)}hf(e)}finally{ge(n)}}function tT(t,e){let n=t.cleanup,i=e[Xr];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?i[a]():i[-a].unsubscribe(),s+=2}else{let a=i[n[s+1]];n[s].call(a)}i!==null&&(e[Xr]=null);let o=e[qi];if(o!==null){e[qi]=null;for(let s=0;s<o.length;s++){let a=o[s];a()}}let r=e[Wi];if(r!==null){e[Wi]=null;for(let s of r)s.destroy()}}function nT(t,e){let n;if(t!=null&&(n=t.destroyHooks)!=null)for(let i=0;i<n.length;i+=2){let o=e[n[i]];if(!(o instanceof ga)){let r=n[i+1];if(Array.isArray(r))for(let s=0;s<r.length;s+=2){let a=o[r[s]],c=r[s+1];ht(st.LifecycleHookStart,a,c);try{c.call(a)}finally{ht(st.LifecycleHookEnd,a,c)}}else{ht(st.LifecycleHookStart,o,r);try{r.call(o)}finally{ht(st.LifecycleHookEnd,o,r)}}}}}function iT(t,e,n){if(e===null)throw new Ne(510,!1);return oT(t,e.parent,n)}function oT(t,e,n){let i=e;for(;i!==null&&i.type&168;)e=i,i=e.parent;if(i===null)return n[mi];if(bo(i)){let{encapsulation:o}=t.data[i.directiveStart+i.componentOffset];if(o===vi.None||o===vi.Emulated)return null}return ei(i,n)}function rT(t,e,n){return aT(t,e,n)}function sT(t,e,n){return t.type&40?ei(t,n):null}var aT=sT,dy;function ym(t,e,n,i){let o=iT(t,i,e),r=e[It],s=i.parent||e[In],a=rT(s,i,e);if(o!=null)if(Array.isArray(n))for(let c=0;c<n.length;c++)ry(r,o,n[c],a,!1);else ry(r,o,n,a,!1);dy!==void 0&&dy(r,i,e,n,o)}function ma(t,e){if(e!==null){let n=e.type;if(n&3)return ei(e,t);if(n&4)return Mf(-1,t[e.index]);if(n&8){let i=e.child;if(i!==null)return ma(t,i);{let o=t[e.index];return Jn(o)?Mf(-1,o):mn(o)}}else{if(n&128)return ma(t,e.next);if(n&32)return fm(e,t)()||mn(t[e.index]);{let i=g_(t,e);if(i!==null){if(Array.isArray(i))return i[0];let o=Yi(t[jn]);return ma(o,i)}else return ma(t,e.next)}}}return null}function g_(t,e){if(e!==null){let i=t[jn][In],o=e.projection;return i.projection[o]}return null}function Mf(t,e){let n=$t+t+1;if(n<e.length){let i=e[n],o=i[_e].firstChild;if(o!==null)return ma(i,o)}return e[lr]}function _m(t,e,n,i,o,r,s){for(;n!=null;){let a=i[Ki];if(n.type===128){n=n.next;continue}let c=i[n.index],l=n.type;if(s&&e===0&&(c&&as(mn(c),i),n.flags|=2),!om(n))if(l&8)_m(t,e,n.child,i,o,r,!1),rs(e,t,a,o,c,n,r,i);else if(l&32){let p=fm(n,i),f;for(;f=p();)rs(e,t,a,o,f,n,r,i);rs(e,t,a,o,c,n,r,i)}else l&16?lT(t,e,i,n,o,r):rs(e,t,a,o,c,n,r,i);n=s?n.projectionNext:n.next}}function Gl(t,e,n,i,o,r){t.type===3?cT(n,i,e,o,r):_m(n,i,t.firstChild,e,o,r,!1)}function cT(t,e,n,i,o){let s=n[_e].firstChild,a=s.next,c=mn(n[s.index]),l=mn(n[a.index]),p=a.index+1,f=n[p];if(e===1||e===0)i!==null&&(f&&f.hasChildNodes()?hr(t,i,f,o,!0):(hr(t,i,c,o,!0),hr(t,i,l,o,!0)));else if(e===2){if(f||(f=document.createDocumentFragment(),n[p]=f),c&&c.parentNode===f)return;let _=c;for(;_!==null;){let x=_.nextSibling;if(f.appendChild(_),_===l)break;_=x}}}function lT(t,e,n,i,o,r){let s=n[jn],c=s[In].projection[i.projection];if(Array.isArray(c))for(let l=0;l<c.length;l++){let p=c[l];rs(e,t,n[Ki],o,p,i,r,n)}else{let l=c,p=s[qt];Hy(i)&&(l.flags|=128),_m(t,e,l,p,o,r,!0)}}function dT(t,e,n,i,o,r,s){let a=i[lr],c=mn(i);if(a!==c&&rs(e,t,n,r,a,o,s),(i[Te]&4)===0)for(let l=$t;l<i.length;l++){let p=i[l];Gl(p[_e],p,t,e,r,a)}}function uT(t,e,n,i,o){if(e)o?t.addClass(n,i):t.removeClass(n,i);else{let r=i.indexOf("-")===-1?void 0:Ri.DashCase;o==null?t.removeStyle(n,i,r):(typeof o=="string"&&o.endsWith("!important")&&(o=o.slice(0,-10),r|=Ri.Important),t.setStyle(n,i,o,r))}}function vm(t,e,n,i,o,r,s,a,c,l,p){let f=Yt+i,_=f+o,x=pT(f,_),C=typeof l=="function"?l():l;return x[_e]={type:t,blueprint:x,template:n,queries:null,viewQuery:a,declTNode:e,data:x.slice().fill(null,f),bindingStartIndex:f,expandoStartIndex:_,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:p}}function pT(t,e){let n=[];for(let i=0;i<e;i++)n.push(i<t?null:Sn);return n}function fT(t){let e=t.tView;return e===null||e.incompleteFirstPass?t.tView=vm(1,null,t.template,t.decls,t.vars,t.directiveDefs,t.pipeDefs,t.viewQuery,t.schemas,t.consts,t.id):e}function bm(t,e,n,i,o,r,s,a,c,l,p){let f=e.blueprint.slice();return f[mi]=o,f[Te]=i|4|128|8|64|1024,(l!==null||t&&t[Te]&2048)&&(f[Te]|=2048),jp(f),f[qt]=f[yo]=t,f[jt]=n,f[hi]=s||t&&t[hi],f[It]=a||t&&t[It],f[Ki]=c||t&&t[Ki]||null,f[In]=r,f[oa]=Qw(),f[Qr]=p,f[Rp]=l,f[jn]=e.type==2?t[jn]:f,f}function mT(t,e,n){let i=ei(e,t),o=fT(n),r=t[hi].rendererFactory,s=xm(t,bm(t,o,null,y_(n),i,e,null,r.createRenderer(i,n),null,null,null));return t[e.index]=s}function y_(t){let e=16;return t.signals?e=4096:t.onPush&&(e=64),e}function __(t,e,n,i){if(n===0)return-1;let o=e.length;for(let r=0;r<n;r++)e.push(i),t.blueprint.push(i),t.data.push(null);return o}function xm(t,e){return t[Jr]?t[Ap][Xn]=e:t[Jr]=e,t[Ap]=e,e}function d(t=1){v_(hn(),Ue(),gi()+t,!1)}function v_(t,e,n,i){if(!i)if((e[Te]&3)===3){let r=t.preOrderCheckHooks;r!==null&&Cl(e,r,n)}else{let r=t.preOrderHooks;r!==null&&El(e,r,0,n)}xo(n)}var ql=(function(t){return t[t.None=0]="None",t[t.SignalBased=1]="SignalBased",t[t.HasDecoratorInputTransform=2]="HasDecoratorInputTransform",t})(ql||{});function kf(t,e,n,i){let o=ge(null);try{let[r,s,a]=t.inputs[n],c=null;(s&ql.SignalBased)!==0&&(c=e[r][fn]),c!==null&&c.transformFn!==void 0?i=c.transformFn(i):a!==null&&(i=a.call(e,i)),t.setInput!==null?t.setInput(e,c,i,n,r):Dy(e,c,r,i)}finally{ge(o)}}function b_(t,e,n,i,o){let r=gi(),s=i&2;try{xo(-1),s&&e.length>Yt&&v_(t,e,Yt,!1);let a=s?st.TemplateUpdateStart:st.TemplateCreateStart;ht(a,o,n),n(i,o)}finally{xo(r);let a=s?st.TemplateUpdateEnd:st.TemplateCreateEnd;ht(a,o,n)}}function Wl(t,e,n){xT(t,e,n),(n.flags&64)===64&&CT(t,e,n)}function Ta(t,e,n=ei){let i=e.localNames;if(i!==null){let o=e.index+1;for(let r=0;r<i.length;r+=2){let s=i[r+1],a=s===-1?n(e,t):t[s];t[o++]=a}}}function hT(t,e,n,i){let r=i.get(Zy,Ky)||n===vi.ShadowDom||n===vi.ExperimentalIsolatedShadowDom,s=t.selectRootElement(e,r);return gT(s),s}function gT(t){yT(t)}var yT=()=>null;function _T(t){return t==="class"?"className":t==="for"?"htmlFor":t==="formaction"?"formAction":t==="innerHtml"?"innerHTML":t==="readonly"?"readOnly":t==="tabindex"?"tabIndex":t}function vT(t,e,n,i,o,r){let s=e[_e];if(Sm(t,s,e,n,i)){bo(t)&&bT(e,t.index);return}t.type&3&&(n=_T(n)),x_(t,e,n,i,o,r)}function x_(t,e,n,i,o,r){if(t.type&3){let s=ei(t,e);i=r!=null?r(i,t.value||"",n):i,o.setProperty(s,n,i)}else t.type&12}function bT(t,e){let n=Pi(e,t);n[Te]&16||(n[Te]|=64)}function xT(t,e,n){let i=n.directiveStart,o=n.directiveEnd;bo(n)&&mT(e,n,t.data[i+n.componentOffset]),t.firstCreatePass||Ry(n,e);let r=n.initialInputs;for(let s=i;s<o;s++){let a=t.data[s],c=Il(e,t,s,n);if(as(c,e),r!==null&&TT(e,s-i,c,a,n,r),ur(a)){let l=Pi(n.index,e);l[jt]=Il(e,t,s,n)}}}function CT(t,e,n){let i=n.directiveStart,o=n.directiveEnd,r=n.index,s=T0();try{xo(r);for(let a=i;a<o;a++){let c=t.data[a],l=e[a];dl(a),(c.hostBindings!==null||c.hostVars!==0||c.hostAttrs!==null)&&ET(c,l)}}finally{xo(-1),dl(s)}}function ET(t,e){t.hostBindings!==null&&t.hostBindings(1,e)}function Cm(t,e){let n=t.directiveRegistry,i=null;if(n)for(let o=0;o<n.length;o++){let r=n[o];jS(e,r.selectors,!1)&&(i??=[],ur(r)?i.unshift(r):i.push(r))}return i}function wT(t,e,n,i,o,r){let s=ei(t,e);ST(e[It],s,r,t.value,n,i,o)}function ST(t,e,n,i,o,r,s){if(r==null)s?.(r,i||"",o),t.removeAttribute(e,o,n);else{let a=s==null?or(r):s(r,i||"",o);t.setAttribute(e,o,a,n)}}function TT(t,e,n,i,o,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];kf(i,n,c,l)}}function Em(t,e,n,i,o){let r=Yt+n,s=e[_e],a=o(s,e,t,i,n);e[r]=a,ns(t,!0);let c=t.type===2;return c?(c_(e[It],a,t),(g0()===0||es(t))&&as(a,e),y0()):as(a,e),ml()&&(!c||!om(t))&&ym(s,e,a,t),t}function wm(t){let e=t;return Wp()?b0():(e=e.parent,ns(e,!1)),e}function DT(t,e){let n=t[Ki];if(!n)return;let i;try{i=n.get(Co,null)}catch{i=null}i?.(e)}function Sm(t,e,n,i,o){let r=t.inputs?.[i],s=t.hostDirectiveInputs?.[i],a=!1;if(s)for(let c=0;c<s.length;c+=2){let l=s[c],p=s[c+1],f=e.data[l];kf(f,n[l],p,o),a=!0}if(r)for(let c of r){let l=n[c],p=e.data[c];kf(p,l,i,o),a=!0}return a}function MT(t,e){let n=Pi(e,t),i=n[_e];kT(i,n);let o=n[mi];o!==null&&n[Qr]===null&&(n[Qr]=Qy(o,n[Ki])),ht(st.ComponentStart);try{Tm(i,n,n[jt])}finally{ht(st.ComponentEnd,n[jt])}}function kT(t,e){for(let n=e.length;n<t.blueprint.length;n++)e.push(t.blueprint[n])}function Tm(t,e,n){pl(e);try{let i=t.viewQuery;i!==null&&yf(1,i,n);let o=t.template;o!==null&&b_(t,e,o,1,n),t.firstCreatePass&&(t.firstCreatePass=!1),e[Oi]?.finishViewCreation(t),t.staticContentQueries&&Xy(t,e),t.staticViewQueries&&yf(2,t.viewQuery,n);let r=t.components;r!==null&&IT(e,r)}catch(i){throw t.firstCreatePass&&(t.incompleteFirstPass=!0,t.firstCreatePass=!1),i}finally{e[Te]&=-5,fl()}}function IT(t,e){for(let n=0;n<e.length;n++)MT(t,e[n])}function Yl(t,e,n,i){let o=ge(null);try{let r=e.tView,a=t[Te]&4096?4096:16,c=bm(t,r,n,a,null,e,null,null,i?.injector??null,i?.embeddedViewInjector??null,i?.dehydratedView??null),l=t[e.index];c[_o]=l;let p=t[Oi];return p!==null&&(c[Oi]=p.createEmbeddedView(r)),Tm(r,c,n),c}finally{ge(o)}}function ya(t,e){return!e||e.firstChild===null||Hy(t)}function _a(t,e,n,i,o=!1){if(t.type===3){let r=t.firstChild,s=r.next,a=mn(e[r.index]),c=mn(e[s.index]),l=a;for(;l!==null&&(i.push(l),l!==c);)l=l.nextSibling;return i}for(;n!==null;){if(n.type===128){n=o?n.projectionNext:n.next;continue}let r=e[n.index];if(r!==null)if(Jn(r)){let a=r[lr];a!==r[mi]&&i.push(mn(r)),r[Te]&4||C_(r,i),i.push(a)}else i.push(mn(r));let s=n.type;if(s&8)_a(t,e,n.child,i);else if(s&32){let a=fm(n,e),c;for(;c=a();)i.push(c)}else if(s&16){let a=g_(e,n);if(Array.isArray(a))i.push(...a);else{let c=Yi(e[jn]);_a(c[_e],c,a,i,!0)}}n=o?n.projectionNext:n.next}return i}function C_(t,e){for(let n=$t;n<t.length;n++){let i=t[n],o=i[_e].firstChild;o!==null&&_a(i[_e],i,o,e)}}function E_(t){if(t[cr]!==null){for(let e of t[cr])e.impl.addSequence(e);t[cr].length=0}}var w_=[];function NT(t){return t[$n]??OT(t)}function OT(t){let e=w_.pop()??Object.create(AT);return e.lView=t,e}function PT(t){t.lView[$n]!==t&&(t.lView=null,w_.push(t))}var AT=K(V({},zo),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:t=>{fr(t.lView)},consumerOnSignalRead(){this.lView[$n]=this}});function RT(t){let e=t[$n]??Object.create(LT);return e.lView=t,e}var LT=K(V({},zo),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:t=>{let e=Yi(t.lView);for(;e&&!S_(e[_e]);)e=Yi(e);e&&$p(e)},consumerOnSignalRead(){this.lView[$n]=this}});function S_(t){return t.type!==2}function T_(t){if(t[Wi]===null)return;let e=!0;for(;e;){let n=!1;for(let i of t[Wi])if(i.dirty&&(n=!0,i.zone===null||Zone.current===i.zone?i.run():i.zone.run(()=>i.run()),t[Wi]===null))return;e=n&&!!(t[Te]&8192)}}var FT=100;function D_(t,e=0){let i=t[hi].rendererFactory,o=!1;o||i.begin?.();try{VT(t,e)}finally{o||i.end?.()}}function VT(t,e){let n=Yp();try{Xs(!0),If(t,e);let i=0;for(;aa(t);){if(i===FT)throw new Ne(103,!1);i++,If(t,1)}}finally{Xs(n)}}function jT(t,e,n,i){if(pr(e))return;let o=e[Te],r=!1,s=!1;pl(e);let a=!0,c=null,l=null;r||(S_(t)?(l=NT(e),c=qo(l)):Dc()===null?(a=!1,l=RT(e),c=qo(l)):e[$n]&&(Wo(e[$n]),e[$n]=null));try{jp(e),E0(t.bindingStartIndex),n!==null&&b_(t,e,n,2,i);let p=(o&3)===3;if(!r)if(p){let x=t.preOrderCheckHooks;x!==null&&Cl(e,x,null)}else{let x=t.preOrderHooks;x!==null&&El(e,x,0,null),sf(e,0)}if(s||$T(e),T_(e),M_(e,0),t.contentQueries!==null&&Xy(t,e),!r)if(p){let x=t.contentCheckHooks;x!==null&&Cl(e,x)}else{let x=t.contentHooks;x!==null&&El(e,x,1),sf(e,1)}HT(t,e);let f=t.components;f!==null&&I_(e,f,0);let _=t.viewQuery;if(_!==null&&yf(2,_,i),!r)if(p){let x=t.viewCheckHooks;x!==null&&Cl(e,x)}else{let x=t.viewHooks;x!==null&&El(e,x,2),sf(e,2)}if(t.firstUpdatePass===!0&&(t.firstUpdatePass=!1),e[nl]){for(let x of e[nl])x();e[nl]=null}r||(E_(e),e[Te]&=-73)}catch(p){let f=!1,_=p,x=e;for(;x!==null;){if(Jn(x)){x=x[qt];continue}let C=x[ra];if(C)try{let T=e[jn][jt],P=T?.constructor,Y={declarationInstance:T,declarationType:P,caughtBy:C};C(j0(_),Y),f=!0;break}catch(T){_=T}x=x[qt]}if(!f)throw r||fr(e),_}finally{l!==null&&($r(l,c),a&&PT(l)),fl()}}function M_(t,e){for(let n=zy(t);n!==null;n=Gy(n))for(let i=$t;i<n.length;i++){let o=n[i];k_(o,e)}}function $T(t){for(let e=zy(t);e!==null;e=Gy(e)){if(!(e[Te]&2))continue;let n=e[dr];for(let i=0;i<n.length;i++){let o=n[i];$p(o)}}}function BT(t,e,n){ht(st.ComponentStart);let i=Pi(e,t);try{k_(i,n)}finally{ht(st.ComponentEnd,i[jt])}}function k_(t,e){rl(t)&&If(t,e)}function If(t,e){let i=t[_e],o=t[Te],r=t[$n],s=!!(e===0&&o&16);if(s||=!!(o&64&&e===0),s||=!!(o&1024),s||=!!(r?.dirty&&Gs(r)),s||=!1,r&&(r.dirty=!1),t[Te]&=-9217,s)jT(i,t,i.template,t[jt]);else if(o&8192){let a=ge(null);try{T_(t),M_(t,1);let c=i.components;c!==null&&I_(t,c,1),E_(t)}finally{ge(a)}}}function I_(t,e,n){for(let i=0;i<e.length;i++)BT(t,e[i],n)}function HT(t,e){let n=t.hostBindingOpCodes;if(n!==null)try{for(let i=0;i<n.length;i++){let o=n[i];if(o<0)xo(~o);else{let r=o,s=n[++i],a=n[++i];S0(s,r);let c=e[r];ht(st.HostBindingsUpdateStart,c);try{a(2,c)}finally{ht(st.HostBindingsUpdateEnd,c)}}}}finally{xo(-1)}}function Dm(t,e){let n=Yp()?64:1088;for(t[hi].changeDetectionScheduler?.notify(e);t;){t[Te]|=n;let i=Yi(t);if(ts(t)&&!i)return t;t=i}return null}function N_(t,e,n,i){return[t,!0,0,e,null,i,null,n,null,null]}function O_(t,e){let n=$t+e;if(n<t.length)return t[n]}function Kl(t,e,n,i=!0){let o=e[_e];if(UT(o,e,t,n),i){let s=Mf(n,t),a=e[It],c=a.parentNode(t[lr]);c!==null&&JS(o,t[In],a,e,c,s)}let r=e[Qr];r!==null&&r.firstChild!==null&&(r.firstChild=null)}function P_(t,e){let n=va(t,e);return n!==void 0&&zl(n[_e],n),n}function va(t,e){if(t.length<=$t)return;let n=$t+e,i=t[n];if(i){let o=i[_o];o!==null&&o!==t&&gm(o,i),e>0&&(t[n-1][Xn]=i[Xn]);let r=ta(t,$t+e);XS(i[_e],i);let s=r[Oi];s!==null&&s.detachView(r[_e]),i[qt]=null,i[Xn]=null,i[Te]&=-129}return i}function UT(t,e,n,i){let o=$t+i,r=n.length;i>0&&(n[o-1][Xn]=e),i<r-$t?(e[Xn]=n[o],Ip(n,$t+i,e)):(n.push(e),e[Xn]=null),e[qt]=n;let s=e[_o];s!==null&&n!==s&&A_(s,e);let a=e[Oi];a!==null&&a.insertView(t),sl(e),e[Te]|=128}function A_(t,e){let n=t[dr],i=e[qt];if(vo(i))t[Te]|=2;else{let o=i[qt][jn];e[jn]!==o&&(t[Te]|=2)}n===null?t[dr]=[e]:n.push(e)}var cs=class{_lView;_cdRefInjectingView;_appRef=null;_attachedToViewContainer=!1;exhaustive;get rootNodes(){let e=this._lView,n=e[_e];return _a(n,e,n.firstChild,[])}constructor(e,n){this._lView=e,this._cdRefInjectingView=n}get context(){return this._lView[jt]}set context(e){this._lView[jt]=e}get destroyed(){return pr(this._lView)}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){let e=this._lView[qt];if(Jn(e)){let n=e[sa],i=n?n.indexOf(this):-1;i>-1&&(va(e,i),ta(n,i))}this._attachedToViewContainer=!1}zl(this._lView[_e],this._lView)}onDestroy(e){al(this._lView,e)}markForCheck(){Dm(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[Te]&=-129}reattach(){sl(this._lView),this._lView[Te]|=128}detectChanges(){this._lView[Te]|=1024,D_(this._lView)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new Ne(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;let e=ts(this._lView),n=this._lView[_o];n!==null&&!e&&gm(n,this._lView),h_(this._lView[_e],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new Ne(902,!1);this._appRef=e;let n=ts(this._lView),i=this._lView[_o];i!==null&&!n&&A_(i,this._lView),sl(this._lView)}};var ls=(()=>{class t{_declarationLView;_declarationTContainer;elementRef;static __NG_ELEMENT_ID__=zT;constructor(n,i,o){this._declarationLView=n,this._declarationTContainer=i,this.elementRef=o}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(n,i){return this.createEmbeddedViewImpl(n,i)}createEmbeddedViewImpl(n,i,o){let r=Yl(this._declarationLView,this._declarationTContainer,n,{embeddedViewInjector:i,dehydratedView:o});return new cs(r)}}return t})();function zT(){return Zl(Bn(),Ue())}function Zl(t,e){return t.type&4?new ls(e,t,us(t,e)):null}function Da(t,e,n,i,o){let r=t.data[e];if(r===null)r=GT(t,e,n,i,o),w0()&&(r.flags|=32);else if(r.type&64){r.type=n,r.value=i,r.attrs=o;let s=v0();r.injectorIndex=s===null?-1:s.injectorIndex}return ns(r,!0),r}function GT(t,e,n,i,o){let r=qp(),s=Wp(),a=s?r:r&&r.parent,c=t.data[e]=WT(t,a,n,e,i,o);return qT(t,c,r,s),c}function qT(t,e,n,i){t.firstChild===null&&(t.firstChild=e),n!==null&&(i?n.child==null&&e.parent!==null&&(n.child=e):n.next===null&&(n.next=e,e.prev=n))}function WT(t,e,n,i,o,r){let s=e?e.injectorIndex:-1,a=0;return _0()&&(a|=128),{type:n,index:i,insertBeforeIndex:null,injectorIndex:s,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,controlDirectiveIndex:-1,customControlIndex:-1,propertyBindings:null,flags:a,providerIndexes:0,value:o,namespace:Xp(),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 YT(t){let e=t[Lp]??[],i=t[qt][It],o=[];for(let r of e)r.data[Yy]!==void 0?o.push(r):KT(r,i);t[Lp]=o}function KT(t,e){let n=0,i=t.firstChild;if(i){let o=t.data[Wy];for(;n<o;){let r=i.nextSibling;a_(e,i,!1),i=r,n++}}}var ZT=()=>null,QT=()=>null;function Nf(t,e){return ZT(t,e)}function R_(t,e,n){return QT(t,e,n)}var L_=class{},Xi=class{};var F_=(()=>{class t{static \u0275prov=xe({token:t,providedIn:"root",factory:()=>null})}return t})();function V_(t){return t.debugInfo?.className||t.type.name||null}var Sl={},Pl=class{injector;parentInjector;constructor(e,n){this.injector=e,this.parentInjector=n}get(e,n,i){let o=this.injector.get(e,Sl,i);return o!==Sl||n===Sl?o:this.parentInjector.get(e,n,i)}};function j_(t,e,n){return t[e]=n}function XT(t,e){return t[e]}function bi(t,e,n){if(n===Sn)return!1;let i=t[e];return Object.is(i,n)?!1:(t[e]=n,!0)}function JT(t,e,n,i){let o=bi(t,e,n);return bi(t,e+1,i)||o}function Tl(t,e,n){return function i(o){let r=i.__ngNativeEl__;r!==void 0&&Jw(o,r);let s=bo(t)?Pi(t.index,e):e;Dm(s,5);let a=e[jt],c=uy(e,a,n,o),l=i.__ngNextListenerFn__;for(;l;)c=uy(e,a,l,o)&&c,l=l.__ngNextListenerFn__;return c}}function uy(t,e,n,i){let o=ge(null);try{return ht(st.OutputStart,e,n),n(i)!==!1}catch(r){return DT(t,r),!1}finally{ht(st.OutputEnd,e,n),ge(o)}}function $_(t,e,n,i,o,r,s,a){let c=es(t),l=!1,p=null;if(!i&&c&&(p=tD(e,n,r,t.index)),p!==null){let f=p.__ngLastListenerFn__||p;f.__ngNextListenerFn__=s,p.__ngLastListenerFn__=s,l=!0}else{let f=ei(t,n),_=i?i(f):f;tS(n,_,r,a),i||(a.__ngNativeEl__=f);let x=o.listen(_,r,a);if(!eD(r)){let C=i?T=>i(mn(T[t.index])):t.index;B_(C,e,n,r,a,x,!1)}}return l}function eD(t){return t.startsWith("animation")||t.startsWith("transition")}function tD(t,e,n,i){let o=t.cleanup;if(o!=null)for(let r=0;r<o.length-1;r+=2){let s=o[r];if(s===n&&o[r+1]===i){let a=e[Xr],c=o[r+2];return a&&a.length>c?a[c]:null}typeof s=="string"&&(r+=2)}return null}function B_(t,e,n,i,o,r,s){let a=e.firstCreatePass?Hp(e):null,c=Bp(n),l=c.length;c.push(o,r),a&&a.push(i,t,l,(l+1)*(s?-1:1))}function py(t,e,n,i,o,r){let s=e[n],a=e[_e],l=a.data[n].outputs[i],f=s[l].subscribe(r);B_(t.index,a,e,o,r,f,!0)}var Of=Symbol("BINDING");var vr=new He("");function Al(t,e,n){let i=n?t.styles:null,o=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)o=Gc(o,a);else if(r==2){let c=a,l=e[++s];i=Gc(i,c+": "+l+";")}}n?t.styles=i:t.stylesWithoutHost=i,n?t.classes=o:t.classesWithoutHost=o}function Ql(t,e=0){let n=Ue();if(n===null)return dt(t,e);let i=Bn();return jy(i,n,Vn(t),e)}function H_(t,e,n,i,o){let r=i===null?null:{"":-1},s=o(t,n);if(s!==null){let a=s,c=null,l=null;for(let p of s)if(p.resolveHostDirectives!==null){[a,c,l]=p.resolveHostDirectives(s);break}oD(t,e,n,a,r,c,l)}r!==null&&i!==null&&nD(n,i,r)}function nD(t,e,n){let i=t.localNames=[];for(let o=0;o<e.length;o+=2){let r=n[e[o+1]];if(r==null)throw new Ne(-301,!1);i.push(e[o],r)}}function iD(t,e,n){e.componentOffset=n,(t.components??=[]).push(e.index)}function oD(t,e,n,i,o,r,s){let a=i.length,c=null;for(let _=0;_<a;_++){let x=i[_];c===null&&ur(x)&&(c=x,iD(t,n,_)),Hw(Ry(n,e),t,x.type)}dD(n,t.data.length,a),c?.viewProvidersResolver&&c.viewProvidersResolver(c);for(let _=0;_<a;_++){let x=i[_];x.providersResolver&&x.providersResolver(x)}let l=!1,p=!1,f=__(t,e,a,null);a>0&&(n.directiveToIndex=new Map);for(let _=0;_<a;_++){let x=i[_];if(n.mergedAttrs=$l(n.mergedAttrs,x.hostAttrs),sD(t,n,e,f,x),lD(f,x,o),s!==null&&s.has(x)){let[T,P]=s.get(x);n.directiveToIndex.set(x.type,[f,T+n.directiveStart,P+n.directiveStart])}else(r===null||!r.has(x))&&n.directiveToIndex.set(x.type,f);x.contentQueries!==null&&(n.flags|=4),(x.hostBindings!==null||x.hostAttrs!==null||x.hostVars!==0)&&(n.flags|=64);let C=x.type.prototype;!l&&(C.ngOnChanges||C.ngOnInit||C.ngDoCheck)&&((t.preOrderHooks??=[]).push(n.index),l=!0),!p&&(C.ngOnChanges||C.ngDoCheck)&&((t.preOrderCheckHooks??=[]).push(n.index),p=!0),f++}rD(t,n,r)}function rD(t,e,n){for(let i=e.directiveStart;i<e.directiveEnd;i++){let o=t.data[i];if(n===null||!n.has(o))fy(0,e,o,i),fy(1,e,o,i),hy(e,i,!1);else{let r=n.get(o);my(0,e,r,i),my(1,e,r,i),hy(e,i,!0)}}}function fy(t,e,n,i){let o=t===0?n.inputs:n.outputs;for(let r in o)if(Object.hasOwn(o,r)){let s;t===0?s=e.inputs??={}:s=e.outputs??={},s[r]??=[],s[r].push(i),U_(e,r)}}function my(t,e,n,i){let o=t===0?n.inputs:n.outputs;for(let r in o)if(Object.hasOwn(o,r)){let s=o[r],a;t===0?a=e.hostDirectiveInputs??={}:a=e.hostDirectiveOutputs??={},a[s]??=[],a[s].push(i,r),U_(e,s)}}function U_(t,e){e==="class"?t.flags|=8:e==="style"&&(t.flags|=16)}function hy(t,e,n){let{attrs:i,inputs:o,hostDirectiveInputs:r}=t;if(i===null||!n&&o===null||n&&r===null||pm(t)){t.initialInputs??=[],t.initialInputs.push(null);return}let s=null,a=0;for(;a<i.length;){let c=i[a];if(c===0){a+=4;continue}else if(c===5){a+=2;continue}else if(typeof c=="number")break;if(!n&&Object.hasOwn(o,c)){let l=o[c];for(let p of l)if(p===e){s??=[],s.push(c,i[a+1]);break}}else if(n&&Object.hasOwn(r,c)){let l=r[c];for(let p=0;p<l.length;p+=2)if(l[p]===e){s??=[],s.push(l[p+1],i[a+1]);break}}a+=2}t.initialInputs??=[],t.initialInputs.push(s)}function sD(t,e,n,i,o){t.data[i]=o;let r=o.factory||(o.factory=Wr(o.type,!0)),s=new ga(r,ur(o),Ql,null);t.blueprint[i]=s,n[i]=s,aD(t,e,i,__(t,n,o.hostVars,Sn),o)}function aD(t,e,n,i,o){let r=o.hostBindings;if(r){let s=t.hostBindingOpCodes;s===null&&(s=t.hostBindingOpCodes=[]);let a=~e.index;cD(s)!=a&&s.push(a),s.push(n,i,r)}}function cD(t){let e=t.length;for(;e>0;){let n=t[--e];if(typeof n=="number"&&n<0)return n}return 0}function lD(t,e,n){if(n){if(e.exportAs)for(let i=0;i<e.exportAs.length;i++)n[e.exportAs[i]]=t;ur(e)&&(n[""]=t)}}function dD(t,e,n){t.flags|=1,t.directiveStart=e,t.directiveEnd=e+n,t.providerIndexes=e}function Mm(t,e,n,i,o,r,s,a){let c=e[_e],l=c.consts,p=ti(l,s),f=Da(c,t,n,i,p);return r&&H_(c,e,f,ti(l,a),o),f.mergedAttrs=$l(f.mergedAttrs,f.attrs),f.attrs!==null&&Al(f,f.attrs,!1),f.mergedAttrs!==null&&Al(f,f.mergedAttrs,!0),c.queries!==null&&c.queries.elementStart(c,f),f}function km(t,e){Iy(t,e),Fp(e)&&t.queries.elementEnd(e)}function uD(t,e,n,i,o,r){let s=e.consts,a=ti(s,o),c=Da(e,t,n,i,a);if(c.mergedAttrs=$l(c.mergedAttrs,c.attrs),r!=null){let l=ti(s,r);c.localNames=[];for(let p=0;p<l.length;p+=2)c.localNames.push(l[p],-1)}return c.attrs!==null&&Al(c,c.attrs,!1),c.mergedAttrs!==null&&Al(c,c.mergedAttrs,!0),e.queries!==null&&e.queries.elementStart(e,c),c}var z_=typeof ShadowRoot<"u",pD=typeof Document<"u";function fD(t){return Object.keys(t).map(e=>{let[n,i,o]=t[e],r={propName:n,templateName:e,isSignal:(i&ql.SignalBased)!==0};return o&&(r.transform=o),r})}function mD(t){return Object.keys(t).map(e=>({propName:t[e],templateName:e}))}function hD(t,e,n){let i=e instanceof fi?e:e?.injector;return i&&t.getStandaloneInjector!==null&&(i=t.getStandaloneInjector(i)||i),i?new Pl(n,i):n}function gD(t){let e=t.get(Xi,null);if(e===null)throw new Ne(407,!1);let n=t.get(F_,null),i=t.get(ho,null),o=t.get(to,null,{optional:!0});return{rendererFactory:e,sanitizer:n,changeDetectionScheduler:i,ngReflect:!1,tracingService:o}}function yD(t,e,n){let i=G_(t);return r_(e,i,i==="svg"?er:i==="math"?il:n)}function _D(t){if((t&&"localName"in t&&typeof t.localName=="string"?t.localName:t?.tagName)?.toLowerCase()==="script")throw new Ne(905,!1)}function G_(t){return(t.selectors[0][0]||"div").toLowerCase()}var ba=class{componentDef;ngModule;selector;componentType;ngContentSelectors;isBoundToModule;cachedInputs=null;cachedOutputs=null;get inputs(){return this.cachedInputs??=fD(this.componentDef.inputs),this.cachedInputs}get outputs(){return this.cachedOutputs??=mD(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,i,o,r,s,a,c){ht(st.DynamicComponentStart);let l=ge(null);try{let p=this.componentDef,f=hD(p,o||this.ngModule,e),_=gD(f),x=_.tracingService;return x&&x.componentCreate?x.componentCreate(V_(p),()=>this.createComponentRef(_,f,n,i,r,s,a,c)):this.createComponentRef(_,f,n,i,r,s,a,c)}finally{ge(l)}}createComponentRef(e,n,i,o,r,s,a,c){let l=this.componentDef,p=vD(o,l,s,r,c),f=e.rendererFactory.createRenderer(null,l),_=o?hT(f,o,l.encapsulation,n):yD(l,f,a??null);_D(_);let x=n.get(vr,null),C=bD(_,()=>n.get(wn,null)??im());x&&x.addHost(C);let T=s?.some(gy)||r?.some(W=>typeof W!="function"&&W.bindings.some(gy)),P=bm(null,p,null,512|y_(l),null,null,e,f,n,null,Qy(_,n,!0));x&&z_&&C instanceof ShadowRoot&&al(P,()=>{x.removeHost(C)}),P[Yt]=_,pl(P);let Y=null;try{let W=Mm(Yt,P,2,"#host",()=>p.directiveRegistry,!0,0);c_(f,_,W),as(_,P),Wl(p,P,W),rm(p,W,P),km(p,W),i!==void 0&&CD(W,this.ngContentSelectors,i),Y=Pi(W.index,P),P[jt]=Y[jt],Tm(p,P,null)}catch(W){throw Y!==null&&hf(Y),hf(P),W}finally{ht(st.DynamicComponentEnd),fl()}return new Rl(this.componentType,P,!!T)}};function vD(t,e,n,i,o){let r=t?["ng-version","22.2.1"]:zS(e.selectors[0]),s=null,a=null,c=0;if(n)for(let f of n)c+=f[Of].requiredVars,f.create&&(f.targetIdx=0,(s??=[]).push(f)),f.update&&(f.targetIdx=0,(a??=[]).push(f));if(i)for(let f=0;f<i.length;f++){let _=i[f];if(typeof _!="function")for(let x of _.bindings){c+=x[Of].requiredVars;let C=f+1;x.create&&(x.targetIdx=C,(s??=[]).push(x)),x.update&&(x.targetIdx=C,(a??=[]).push(x))}}let l=[e];if(i)for(let f of i){let _=typeof f=="function"?f:f.type,x=Kc(_);l.push(x)}return vm(0,null,xD(s,a),1,c,l,null,null,null,[r],null)}function bD(t,e){let n=t.getRootNode?.();return pD&&n instanceof Document?n.head:n&&z_&&n instanceof ShadowRoot?n:e().head}function xD(t,e){return!t&&!e?null:n=>{if(n&1&&t)for(let i of t)i.create();if(n&2&&e)for(let i of e)i.update()}}function gy(t){let e=t[Of].kind;return e==="input"||e==="twoWay"}var Rl=class extends L_{_rootLView;_hasInputBindings;instance;hostView;changeDetectorRef;componentType;location;previousInputValues=null;_tNode;constructor(e,n,i){super(),this._rootLView=n,this._hasInputBindings=i,this._tNode=ol(n[_e],Yt),this.location=us(this._tNode,n),this.instance=Pi(this._tNode.index,n)[jt],this.hostView=this.changeDetectorRef=new cs(n,void 0),this.componentType=e}setInput(e,n){this._hasInputBindings;let i=this._tNode;if(this.previousInputValues??=new Map,this.previousInputValues.has(e)&&Object.is(this.previousInputValues.get(e),n))return;let o=this._rootLView,r=Sm(i,o[_e],o,e,n);this.previousInputValues.set(e,n);let s=Pi(i.index,o);Dm(s,1)}get injector(){return new Zi(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}};function CD(t,e,n){let i=t.projection=[];for(let o=0;o<e.length;o++){let r=n[o];i.push(r!=null&&r.length?Array.from(r):null)}}var ps=(()=>{class t{static __NG_ELEMENT_ID__=ED}return t})();function ED(){let t=Bn();return q_(t,Ue())}var Pf=class t extends ps{_lContainer;_hostTNode;_hostLView;constructor(e,n,i){super(),this._lContainer=e,this._hostTNode=n,this._hostLView=i}get element(){return us(this._hostTNode,this._hostLView)}get injector(){return new Zi(this._hostTNode,this._hostLView)}get parentInjector(){let e=em(this._hostTNode,this._hostLView);if(Oy(e)){let n=kl(e,this._hostLView),i=Ml(e),o=n[_e].data[i+8];return new Zi(o,n)}else return new Zi(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){let n=yy(this._lContainer);return n!==null&&n[e]||null}get length(){return this._lContainer.length-$t}createEmbeddedView(e,n,i){let o,r,s;typeof i=="number"?o=i:i!=null&&(o=i.index,r=i.injector,s=i.onError);let a=Nf(this._lContainer,e.ssrId),c=e.createEmbeddedViewImpl(n||{},r,a);return s&&(c._lView[ra]=s),this.insertImpl(c,o,ya(this._hostTNode,a)),c}createComponent(e,n,i,o,r,s,a){let c,l,p=n||{};c=p.index,i=p.injector,o=p.projectableNodes,r=p.environmentInjector||p.ngModuleRef,s=p.directives,a=p.bindings,l=p.onError;let f=new ba(ir(e)),_=i||this.parentInjector;if(!r&&f.ngModule==null){let W=this.parentInjector.get(fi,null);W&&(r=W)}let x=ir(f.componentType??{}),C=Nf(this._lContainer,x?.id??null),T=C?.firstChild??null,P=f.create(_,o,T,r,s,a,this._getHostElementNamespace());return l&&(P.hostView._lView[ra]=l),this.insertImpl(P.hostView,c,ya(this._hostTNode,C)),P}_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,i){let o=e._lView;if(p0(o)){let a=this.indexOf(e);if(a!==-1)this.detach(a);else{let c=o[qt],l=new t(c,c[In],c[qt]);l.detach(l.indexOf(e))}}let r=this._adjustIndex(n),s=this._lContainer;return Kl(s,o,r,i),e.attachToViewContainerRef(),Ip(lf(s),r,e),e}move(e,n){return this.insert(e,n)}indexOf(e){let n=yy(this._lContainer);return n!==null?n.indexOf(e):-1}remove(e){let n=this._adjustIndex(e,-1),i=va(this._lContainer,n);i&&(ta(lf(this._lContainer),n),zl(i[_e],i))}detach(e){let n=this._adjustIndex(e,-1),i=va(this._lContainer,n);return i&&ta(lf(this._lContainer),n)!=null?new cs(i):null}_adjustIndex(e,n=0){return e??this.length+n}};function yy(t){return t[sa]}function lf(t){return t[sa]||(t[sa]=[])}function q_(t,e){let n,i=e[t.index];return Jn(i)?n=i:(n=N_(i,e,null,t),e[t.index]=n,xm(e,n)),SD(n,e,t,i),new Pf(n,t,e)}function wD(t,e){let n=t[It],i=n.createComment(""),o=ei(e,t),r=n.parentNode(o);return hr(n,r,i,n.nextSibling(o),!1),i}var SD=MD,TD=()=>!1;function DD(t,e,n){return TD(t,e,n)}function MD(t,e,n,i){if(t[lr])return;let o;n.type&8?o=mn(i):o=wD(e,n),t[lr]=o}var Af=class t{queryList;matches=null;constructor(e){this.queryList=e}clone(){return new t(this.queryList)}setDirty(){this.queryList.setDirty()}},Rf=class t{queries;constructor(e=[]){this.queries=e}createEmbeddedView(e){let n=e.queries;if(n!==null){let i=e.contentQueries!==null?e.contentQueries[0]:n.length,o=[];for(let r=0;r<i;r++){let s=n.getByIndex(r),a=this.queries[s.indexInDeclarationView];o.push(a.clone())}return new t(o)}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++)K_(e,n).matches!==null&&this.queries[n].setDirty()}},Lf=class{flags;read;predicate;constructor(e,n,i=null){this.flags=n,this.read=i,typeof e=="string"?this.predicate=RD(e):this.predicate=e}},Ff=class t{queries;constructor(e=[]){this.queries=e}elementStart(e,n){for(let i=0;i<this.queries.length;i++)this.queries[i].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 i=0;i<this.length;i++){let o=n!==null?n.length:0,r=this.getByIndex(i).embeddedTView(e,o);r&&(r.indexInDeclarationView=i,n!==null?n.push(r):n=[r])}return n!==null?new t(n):null}template(e,n){for(let i=0;i<this.queries.length;i++)this.queries[i].template(e,n)}getByIndex(e){return this.queries[e]}get length(){return this.queries.length}track(e){this.queries.push(e)}},Vf=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,i=e.parent;for(;i!==null&&i.type&8&&i.index!==n;)i=i.parent;return n===(i!==null?i.index:-1)}return this._appliesToNextNode}matchTNode(e,n){let i=this.metadata.predicate;if(Array.isArray(i))for(let o=0;o<i.length;o++){let r=i[o];this.matchTNodeWithReadOption(e,n,kD(n,r)),this.matchTNodeWithReadOption(e,n,wl(n,e,r,!1,!1))}else i===ls?n.type&4&&this.matchTNodeWithReadOption(e,n,-1):this.matchTNodeWithReadOption(e,n,wl(n,e,i,!1,!1))}matchTNodeWithReadOption(e,n,i){if(i!==null){let o=this.metadata.read;if(o!==null)if(o===Bt||o===ps||o===Mn||o===ls&&n.type&4)this.addMatch(n.index,-2);else{let r=wl(n,e,o,!1,!1);r!==null&&this.addMatch(n.index,r)}else this.addMatch(n.index,i)}}addMatch(e,n){this.matches===null?this.matches=[e,n]:this.matches.push(e,n)}};function kD(t,e){let n=t.localNames;if(n!==null){for(let i=0;i<n.length;i+=2)if(n[i]===e)return n[i+1]}return null}function ID(t,e){return t.type&11?us(t,e):t.type&4?Zl(t,e):null}function ND(t,e,n,i){return n===-1?ID(e,t):n===-2?OD(t,e,i):Il(t,t[_e],n,e)}function OD(t,e,n){if(n===Bt)return us(e,t);if(n===ls)return Zl(e,t);if(n===ps)return q_(e,t);if(n===Mn)return new Zi(e,t)}function W_(t,e,n,i){let o=e[Oi].queries[i];if(o.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 p=r[l];a.push(ND(e,p,s[c+1],n.metadata.read))}}o.matches=a}return o.matches}function jf(t,e,n,i){let o=t.queries.getByIndex(n),r=o.matches;if(r!==null){let s=W_(t,e,o,n);for(let a=0;a<r.length;a+=2){let c=r[a];if(c>0)i.push(s[a/2]);else{let l=r[a+1],p=e[-c];for(let f=$t;f<p.length;f++){let _=p[f];_[_o]===_[qt]&&jf(_[_e],_,l,i)}if(p[dr]!==null){let f=p[dr];for(let _=0;_<f.length;_++){let x=f[_];jf(x[_e],x,l,i)}}}}}return i}function Y_(t,e){return t[Oi].queries[e].queryList}function PD(t,e,n){let i=new Nl((n&4)===4);return h0(t,e,i,i.destroy),(e[Oi]??=new Rf).queries.push(new Af(i))-1}function AD(t,e,n){let i=hn();return i.firstCreatePass&&(LD(i,new Lf(t,e,n),-1),(e&2)===2&&(i.staticViewQueries=!0)),PD(i,Ue(),e)}function RD(t){return t.split(",").map(e=>e.trim())}function LD(t,e,n){t.queries===null&&(t.queries=new Ff),t.queries.track(new Vf(e,n))}function K_(t,e){return t.queries.getByIndex(e)}function FD(t,e){let n=t[_e],i=K_(n,e);return i.crossesNgTemplate?jf(n,t,e,[]):W_(n,t,i,e)}function Im(t,e,n){let i,o=qs(()=>{i._dirtyCounter();let r=jD(i,t);if(e&&r===void 0)throw new Ne(-951,!1);return r});return i=o[fn],i._dirtyCounter=O(0),i._flatValue=void 0,o}function Z_(t){return Im(!0,!1,t)}function Q_(t){return Im(!0,!0,t)}function X_(t){return Im(!1,!1,t)}function VD(t,e){let n=t[fn];n._lView=Ue(),n._queryIndex=e,n._queryList=Y_(n._lView,e),n._queryList.onDirty(()=>n._dirtyCounter.update(i=>i+1))}function jD(t,e){let n=t._lView,i=t._queryIndex;if(n===void 0||i===void 0||n[Te]&4)return e?void 0:pi;let o=Y_(n,i),r=FD(n,i);return o.reset(r,Yw),e?o.first:o._changesDetected||t._flatValue===void 0?t._flatValue=o.toArray():t._flatValue}function Xl(t){return!!t&&typeof t.then=="function"}function Nm(t){return!!t&&typeof t.subscribe=="function"}var xa=class{};var Ca=class extends xa{injector;instance=null;constructor(e){super();let n=new Jo([...e.providers,{provide:xa,useValue:this}],e.parent||ia(),e.debugName,new Set(["environment"]));this.injector=n,e.runEnvironmentInitializers&&n.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(e){this.injector.onDestroy(e)}};function J_(t,e,n=null){return new Ca({providers:t,parent:e,debugName:n,runEnvironmentInitializers:!0}).injector}var $D=(()=>{class t{_injector;cachedInjectors=new Map;constructor(n){this._injector=n}getOrCreateStandaloneInjector(n){if(!n.standalone)return null;if(!this.cachedInjectors.has(n)){let i=Op(!1,n.type),o=i.length>0?J_([i],this._injector,""):null;this.cachedInjectors.set(n,o)}return this.cachedInjectors.get(n)}ngOnDestroy(){try{for(let n of this.cachedInjectors.values())n!==null&&n.destroy()}finally{this.cachedInjectors.clear()}}static \u0275prov=xe({token:t,providedIn:"environment",factory:()=>new t(dt(fi))})}return t})();function ue(t){return Xf(()=>{let e=ev(t),n=K(V({},e),{decls:t.decls,vars:t.vars,template:t.template,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,onPush:t.changeDetection!==tm.Eager,directiveDefs:null,pipeDefs:null,dependencies:e.standalone&&t.dependencies||null,getStandaloneInjector:e.standalone?o=>o.get($D).getOrCreateStandaloneInjector(n):null,getExternalStyles:null,signals:t.signals??!1,data:t.data||{},encapsulation:t.encapsulation||vi.Emulated,styles:t.styles||pi,_:null,schemas:t.schemas||null,tView:null,id:""});e.standalone&&_r("NgStandalone"),tv(n);let i=t.dependencies;return n.directiveDefs=_y(i,BD),n.pipeDefs=_y(i,Kg),n.id=zD(n),n})}function BD(t){return ir(t)||Kc(t)}function HD(t,e){if(t==null)return rr;let n={};for(let i in t)if(Object.hasOwn(t,i)){let o=t[i],r,s,a,c;Array.isArray(o)?(a=o[0],r=o[1],s=o[2]??r,c=o[3]||null):(r=o,s=o,a=ql.None,c=null),n[r]=[i,a,c],e[r]=s}return n}function UD(t){if(t==null)return rr;let e={};for(let n in t)Object.hasOwn(t,n)&&(e[t[n]]=n);return e}function br(t){return Xf(()=>{let e=ev(t);return tv(e),e})}function ev(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||rr,exportAs:t.exportAs||null,standalone:t.standalone??!0,signals:t.signals===!0,selectors:t.selectors||pi,viewQuery:t.viewQuery||null,features:t.features||null,setInput:null,resolveHostDirectives:null,hostDirectives:null,controlDef:null,signalFormsInputPresence:null,inputs:HD(t.inputs,e),outputs:UD(t.outputs),debugInfo:null}}function tv(t){t.features?.forEach(e=>e(t))}function _y(t,e){return t?()=>{let n=typeof t=="function"?t():t,i=[];for(let o of n){let r=e(o);r!==null&&i.push(r)}return i}:null}function zD(t){let e=0,n=typeof t.consts=="function"?"":t.consts,i=[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 i.join("|"))e=Math.imul(31,e)+r.charCodeAt(0)<<0;return e+=2147483648,"c"+e}var nv=new He("");var Om=(()=>{class t{resolve;reject;initialized=!1;done=!1;donePromise=new Promise((n,i)=>{this.resolve=n,this.reject=i});appInits=N(nv,{optional:!0})??[];injector=N(Mn);constructor(){}runInitializers(){if(this.initialized)return;let n=[];for(let o of this.appInits){let r=tl(this.injector,o);if(Xl(r))n.push(r);else if(Nm(r)){let s=new Promise((a,c)=>{r.subscribe({complete:a,error:c})});n.push(s)}}let i=()=>{this.done=!0,this.resolve()};Promise.all(n).then(()=>{i()}).catch(o=>{this.reject(o)}),n.length===0&&i(),this.initialized=!0}static \u0275fac=function(i){return new(i||t)};static \u0275prov=yr({token:t,factory:t.\u0275fac})}return t})();function iv(t,e,n,i,o,r,s,a){if(n.firstCreatePass){t.mergedAttrs=$l(t.mergedAttrs,t.attrs);let p=t.tView=vm(2,t,o,r,s,n.directiveRegistry,n.pipeRegistry,null,n.schemas,n.consts,null);n.queries!==null&&(n.queries.template(n,t),p.queries=n.queries.embeddedTView(t))}a&&(t.flags|=a),ns(t,!1);let c=qD(n,e,t,i);ml()&&ym(n,e,c,t),as(c,e);let l=N_(c,e,c,t);e[i+Yt]=l,xm(e,l),DD(l,t,e)}function GD(t,e,n,i,o,r,s,a,c,l,p){let f=n+Yt,_;return e.firstCreatePass?(_=Da(e,f,4,s||null,a||null),cl()&&H_(e,t,_,ti(e.consts,l),Cm),Iy(e,_)):_=e.data[f],iv(_,t,e,n,i,o,r,c),es(_)&&Wl(e,t,_),l!=null&&Ta(t,_,p),_}function Ll(t,e,n,i,o,r,s,a,c,l,p){let f=n+Yt,_;if(e.firstCreatePass){if(_=Da(e,f,4,s||null,a||null),l!=null){let x=ti(e.consts,l);_.localNames=[];for(let C=0;C<x.length;C+=2)_.localNames.push(x[C],-1)}}else _=e.data[f];return iv(_,t,e,n,i,o,r,c),l!=null&&Ta(t,_,p),_}function Jl(t,e,n,i,o,r,s,a){let c=Ue(),l=hn(),p=ti(l.consts,r);return GD(c,l,t,e,n,i,o,p,void 0,s,a),Jl}var qD=WD;function WD(t,e,n,i){return la(!0),e[It].createComment("")}var Pm=new He("");var Am=new He("");function ov(){Wu(t=>{let e="";throw new Ne(-600,e)})}var YD=10;var Ma=(()=>{class t{_runningTick=!1;_destroyed=!1;_destroyListeners=[];_views=[];internalErrorHandler=N(Co);afterRenderManager=N(hm);zonelessEnabled=N(fa);rootEffectScheduler=N(yl);dirtyFlags=0;tracingSnapshot=null;allTestViews=new Set;autoDetectTestViews=new Set;includeAllTestViews=!1;afterTick=new Zn;get allViews(){return[...(this.includeAllTestViews?this.allTestViews:this.autoDetectTestViews).keys(),...this._views]}get destroyed(){return this._destroyed}componentTypes=[];components=[];internalPendingTask=N(is);get isStable(){return this.internalPendingTask.hasPendingTasksObservable.pipe(sp(n=>!n))}constructor(){N(to,{optional:!0})}whenStable(){let n;return new Promise(i=>{n=this.isStable.subscribe({next:o=>{o&&i()}})}).finally(()=>{n.unsubscribe()})}_injector=N(fi);_rendererFactory=null;get injector(){return this._injector}bootstrap(n,i){return this.bootstrapImpl(n,i)}bootstrapImpl(n,i,o=Mn.NULL){return this._injector.get(kn).run(()=>{if(ht(st.BootstrapComponentStart),!this._injector.get(Om).done){let Y="";throw new Ne(405,Y)}let a=ir(n),c=this._injector.get(xa),l=new ba(a,c);this.componentTypes.push(n);let{hostElement:p,directives:f,bindings:_}=KD(i),x=p||l.selector,C=l.create(o,[],x,c.injector,f,_),T=C.location.nativeElement,P=C.injector.get(Pm,null);return P?.registerApplication(T),C.onDestroy(()=>{this.detachView(C.hostView),ha(this.components,C),P?.unregisterApplication(T)}),this._loadComponent(C),ht(st.BootstrapComponentEnd,C),C})}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick(){ht(st.ChangeDetectionStart),this.tracingSnapshot!==null?this.tracingSnapshot.run(Ul.CHANGE_DETECTION,this.tickImpl):this.tickImpl()}tickImpl=()=>{if(this._runningTick)throw ht(st.ChangeDetectionEnd),new Ne(101,!1);let n=ge(null);try{this._runningTick=!0,this.synchronize()}finally{this._runningTick=!1,this.tracingSnapshot?.dispose(),this.tracingSnapshot=null,ge(n),this.afterTick.next(),ht(st.ChangeDetectionEnd)}};synchronize(){this._rendererFactory===null&&!this._injector.destroyed&&(this._rendererFactory=this._injector.get(Xi,null,{optional:!0}));let n=0;for(;this.dirtyFlags!==0&&n++<YD;){ht(st.ChangeDetectionSyncStart);try{this.synchronizeOnce()}finally{ht(st.ChangeDetectionSyncEnd)}}}synchronizeOnce(){this.dirtyFlags&16&&(this.dirtyFlags&=-17,this.rootEffectScheduler.flush());let n=!1;if(this.dirtyFlags&7){let i=!!(this.dirtyFlags&1);this.dirtyFlags&=-8,this.dirtyFlags|=8;for(let{_lView:o}of this.allViews){if(!i&&!aa(o))continue;let r=i&&!this.zonelessEnabled?0:1;D_(o,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})=>aa(n))){this.dirtyFlags|=2;return}else this.dirtyFlags&=-8}attachView(n){let i=n;this._views.push(i),i.attachToAppRef(this)}detachView(n){let i=n;ha(this._views,i),i.detachFromAppRef()}_loadComponent(n){this.attachView(n.hostView);try{this.tick()}catch(o){this.internalErrorHandler(o)}this.components.push(n),this._injector.get(Am,[]).forEach(o=>o(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),()=>ha(this._destroyListeners,n)}destroy(){if(this._destroyed)throw new Ne(406,!1);let n=this._injector;n.destroy&&!n.destroyed&&n.destroy()}get viewCount(){return this._views.length}static \u0275fac=function(i){return new(i||t)};static \u0275prov=yr({token:t,factory:t.\u0275fac})}return t})();function KD(t){return t===void 0||typeof t=="string"||t instanceof Element?{hostElement:t}:t}function ha(t,e){let n=t.indexOf(e);n>-1&&t.splice(n,1)}function J(t,e,n,i){let o=Ue(),r=mr();if(bi(o,r,e)){let s=hn(),a=ca();wT(a,o,t,e,n,i)}return J}var $f=class{destroy(e){}updateValue(e,n){}swap(e,n){let i=Math.min(e,n),o=Math.max(e,n),r=this.detach(o);if(o-i>1){let s=this.detach(i);this.attach(i,r),this.attach(o,s)}else this.attach(i,r)}move(e,n){this.attach(n,this.detach(e))}};function df(t,e,n,i,o){return t===n&&Object.is(e,i)?1:Object.is(o(t,e),o(n,i))?-1:0}function ZD(t,e,n,i){let o,r,s=0,a=t.length-1,c=void 0;if(Array.isArray(e)){ge(i);let l=e.length-1;for(ge(null);s<=a&&s<=l;){let p=t.at(s),f=e[s],_=df(s,p,s,f,n);if(_!==0){_<0&&t.updateValue(s,f),s++;continue}let x=t.at(a),C=e[l],T=df(a,x,l,C,n);if(T!==0){T<0&&t.updateValue(a,C),a--,l--;continue}let P=n(s,p),Y=n(a,x),W=n(s,f);if(Object.is(W,Y)){let be=n(l,C);Object.is(be,P)?(t.swap(s,a),t.updateValue(a,C),l--,a--):t.move(a,s),t.updateValue(s,f),s++;continue}if(o??=new Fl,r??=by(t,s,a,n),Bf(t,o,s,W))t.updateValue(s,f),s++,a++;else if(r.has(W))o.set(P,t.detach(s)),a--;else{let be=t.create(s,e[s]);t.attach(s,be),s++,a++}}for(;s<=l;)vy(t,o,n,s,e[s]),s++}else if(e!=null){ge(i);let l=e[Symbol.iterator]();ge(null);let p=l.next();for(;!p.done&&s<=a;){let f=t.at(s),_=p.value,x=df(s,f,s,_,n);if(x!==0)x<0&&t.updateValue(s,_),s++,p=l.next();else{o??=new Fl,r??=by(t,s,a,n);let C=n(s,_);if(Bf(t,o,s,C))t.updateValue(s,_),s++,a++,p=l.next();else if(!r.has(C))t.attach(s,t.create(s,_)),s++,a++,p=l.next();else{let T=n(s,f);o.set(T,t.detach(s)),a--}}}for(;!p.done;)vy(t,o,n,t.length,p.value),p=l.next()}for(;s<=a;)t.destroy(t.detach(a--));o?.forEach(l=>{t.destroy(l)})}function Bf(t,e,n,i){return e!==void 0&&e.has(i)?(t.attach(n,e.get(i)),e.delete(i),!0):!1}function vy(t,e,n,i,o){if(Bf(t,e,i,n(i,o)))t.updateValue(i,o);else{let r=t.create(i,o);t.attach(i,r)}}function by(t,e,n,i){let o=new Set;for(let r=e;r<=n;r++)o.add(i(r,t.at(r)));return o}var Fl=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 i=this.kvMap.get(e);this._vMap===void 0&&(this._vMap=new Map);let o=this._vMap;for(;o.has(i);)i=o.get(i);o.set(i,n)}else this.kvMap.set(e,n)}forEach(e){for(let[n,i]of this.kvMap)if(e(i,n),this._vMap!==void 0){let o=this._vMap;for(;o.has(i);)i=o.get(i),e(i,n)}}};function w(t,e,n,i,o,r,s,a){_r("NgControlFlow");let c=Ue(),l=hn(),p=ti(l.consts,r);return Ll(c,l,t,e,n,i,o,p,256,s,a),Rm}function Rm(t,e,n,i,o,r,s,a){return _r("NgControlFlow"),QD(t,e,n,i,o,r,s,a),Rm}function QD(t,e,n,i,o,r,s,a){let c=Ue(),l=hn(),p=ti(l.consts,r);Ll(c,l,t,e,n,i,o,p,512,s,a)}function S(t,e){_r("NgControlFlow");let n=Ue(),i=mr(),o=n[i]!==Sn?n[i]:-1,r=o!==-1?Vl(n,Yt+o):void 0,s=0;if(bi(n,i,t)){let a=ge(null);try{if(r!==void 0&&P_(r,s),t!==-1){let c=Yt+t,l=Vl(n,c),p=Gf(n[_e],c),f=R_(l,p,n),_=Yl(n,p,e,{dehydratedView:f});Kl(l,_,s,ya(p,f))}}finally{ge(a)}}else if(r!==void 0){let a=O_(r,s);a!==void 0&&(a[jt]=e)}}var Hf=class{lContainer;$implicit;$index;constructor(e,n,i){this.lContainer=e,this.$implicit=n,this.$index=i}get $count(){return this.lContainer.length-$t}};function Ci(t){return t}function Ei(t,e){return e}var Uf=class{hasEmptyBlock;trackByFn;liveCollection;constructor(e,n,i){this.hasEmptyBlock=e,this.trackByFn=n,this.liveCollection=i}};function oe(t,e,n,i,o,r,s,a,c,l,p,f,_){_r("NgControlFlow");let x=Ue(),C=hn(),T=c!==void 0,P=Ue(),Y=a?s.bind(P[jn][jt]):s,W=new Uf(T,Y);P[Yt+t]=W,Ll(x,C,t+1,e,n,i,o,ti(C.consts,r),256),T&&Ll(x,C,t+2,c,l,p,f,ti(C.consts,_),512)}var zf=class extends $f{lContainer;hostLView;templateTNode;operationsCounter=void 0;needsIndexUpdate=!1;constructor(e,n,i){super(),this.lContainer=e,this.hostLView=n,this.templateTNode=i}get length(){return this.lContainer.length-$t}at(e){return this.getLView(e)[jt].$implicit}attach(e,n){let i=n[Qr];this.needsIndexUpdate||=e!==this.length,Kl(this.lContainer,n,e,ya(this.templateTNode,i)),XD(this.lContainer,e)}detach(e){return this.needsIndexUpdate||=e!==this.length-1,JD(this.lContainer,e),eM(this.lContainer,e)}create(e,n){let i=Nf(this.lContainer,this.templateTNode.tView.ssrId);return Yl(this.hostLView,this.templateTNode,new Hf(this.lContainer,n,e),{dehydratedView:i})}destroy(e){zl(e[_e],e)}updateValue(e,n){this.getLView(e)[jt].$implicit=n}reset(){this.needsIndexUpdate=!1}updateIndexes(){if(this.needsIndexUpdate)for(let e=0;e<this.length;e++)this.getLView(e)[jt].$index=e}getLView(e){return tM(this.lContainer,e)}};function re(t){let e=ge(null),n=gi();try{let i=Ue(),o=i[_e],r=i[n],s=n+1,a=Vl(i,s);if(r.liveCollection===void 0){let l=Gf(o,s);r.liveCollection=new zf(a,i,l)}else r.liveCollection.reset();let c=r.liveCollection;if(ZD(c,t,r.trackByFn,e),c.updateIndexes(),r.hasEmptyBlock){let l=mr(),p=c.length===0;if(bi(i,l,p)){let f=n+2,_=Vl(i,f);if(p){let x=Gf(o,f),C=R_(_,x,i),T=Yl(i,x,void 0,{dehydratedView:C});Kl(_,T,0,ya(x,C))}else o.firstUpdatePass&&YT(_),P_(_,0)}}}finally{ge(e)}}function Vl(t,e){return t[e]}function XD(t,e){if(t.length<=$t)return;let n=$t+e,i=t[n];i&&QS(i)}function JD(t,e){if(t.length<=$t)return;let n=$t+e,i=t[n];i&&ZS(i)}function eM(t,e){return va(t,e)}function tM(t,e){return O_(t,e)}function Gf(t,e){return ol(t,e)}function q(t,e,n){let i=Ue(),o=mr();if(bi(i,o,e)){let r=hn(),s=ca();vT(s,i,t,e,i[It],n)}return q}function qf(t,e,n,i,o){Sm(e,t,n,o?"class":"style",i)}function y(t,e,n,i){let o=Ue(),r=o[_e],s=t+Yt,a=r.firstCreatePass?Mm(s,o,2,e,Cm,cl(),n,i):r.data[s];if(bo(a)){let c=o[hi].tracingService;if(c&&c.componentCreate){let l=r.data[a.directiveStart+a.componentOffset];return c.componentCreate(V_(l),()=>(xy(t,e,o,a,i),y))}}return xy(t,e,o,a,i),y}function xy(t,e,n,i,o){if(Em(i,n,t,e,rv),es(i)){let r=n[_e];Wl(r,n,i),rm(r,i,n)}o!=null&&Ta(n,i)}function b(){let t=hn(),e=Bn(),n=wm(e);return t.firstCreatePass&&km(t,n),zp(n)&&Gp(),Up(),n.classesWithoutHost!=null&&Pw(n)&&qf(t,n,Ue(),n.classesWithoutHost,!0),n.stylesWithoutHost!=null&&Aw(n)&&qf(t,n,Ue(),n.stylesWithoutHost,!1),b}function ve(t,e,n,i){return y(t,e,n,i),b(),ve}function h(t,e,n,i){let o=Ue(),r=o[_e],s=t+Yt,a=r.firstCreatePass?uD(s,r,2,e,n,i):r.data[s];return Em(a,o,t,e,rv),i!=null&&Ta(o,a),h}function g(){let t=Bn(),e=wm(t);return zp(e)&&Gp(),Up(),g}function ce(t,e,n,i){return h(t,e,n,i),g(),ce}var rv=(t,e,n,i,o)=>(la(!0),r_(e[It],i,Xp()));function Lm(t,e,n){let i=Ue(),o=i[_e],r=t+Yt,s=o.firstCreatePass?Mm(r,i,8,"ng-container",Cm,cl(),e,n):o.data[r];if(Em(s,i,t,"ng-container",nM),es(s)){let a=i[_e];Wl(a,i,s),rm(a,s,i)}return n!=null&&Ta(i,s),Lm}function Fm(){let t=hn(),e=Bn(),n=wm(e);return t.firstCreatePass&&km(t,n),Fm}function ka(t,e,n){return Lm(t,e,n),Fm(),ka}var nM=(t,e,n,i,o)=>(la(!0),MS(e[It],""));function $(){return Ue()}function ie(t,e,n){let i=Ue(),o=mr();if(bi(i,o,e)){let r=hn(),s=ca();x_(s,i,t,e,i[It],n)}return ie}var Ia="en-US";var iM=Ia;function sv(t){typeof t=="string"&&(iM=t.toLowerCase().replace(/_/g,"-"))}function A(t,e,n){let i=Ue(),o=hn(),r=Bn();return oM(o,i,i[It],r,t,e,n),A}function F(t,e,n){let i=Ue(),o=hn(),r=Bn();return(r.type&3||n)&&$_(r,o,i,n,i[It],t,e,Tl(r,i,e)),F}function oM(t,e,n,i,o,r,s){let a=!0,c=null;if((i.type&3||s)&&(c??=Tl(i,e,r),$_(i,t,e,s,n,o,r,c)&&(a=!1)),a){let l=i.outputs?.[o],p=i.hostDirectiveOutputs?.[o];if(p&&p.length)for(let f=0;f<p.length;f+=2){let _=p[f],x=p[f+1];c??=Tl(i,e,r),py(i,e,_,x,o,c)}if(l&&l.length)for(let f of l)c??=Tl(i,e,r),py(i,e,f,o,o,c)}}function m(t=1){return O0(t)}function gt(t,e,n,i){return VD(t,AD(e,n,i)),gt}function vt(t=1){ul(M0()+t)}function ed(t){let e=x0();return u0(e,Yt+t)}function xl(t,e){return t<<17|e<<2}function gr(t){return t>>17&32767}function rM(t){return(t&2)==2}function sM(t,e){return t&131071|e<<17}function Wf(t){return t|2}function ds(t){return(t&131068)>>2}function uf(t,e){return t&-131069|e<<2}function aM(t){return(t&1)===1}function Yf(t){return t|1}function cM(t,e,n,i,o,r){let s=r?e.classBindings:e.styleBindings,a=gr(s),c=ds(s);t[i]=n;let l=!1,p;if(Array.isArray(n)){let f=n;p=f[1],(p===null||Kr(f,p)>0)&&(l=!0)}else p=n;if(o)if(c!==0){let _=gr(t[a+1]);t[i+1]=xl(_,a),_!==0&&(t[_+1]=uf(t[_+1],i)),t[a+1]=sM(t[a+1],i)}else t[i+1]=xl(a,0),a!==0&&(t[a+1]=uf(t[a+1],i)),a=i;else t[i+1]=xl(c,0),a===0?a=i:t[c+1]=uf(t[c+1],i),c=i;l&&(t[i+1]=Wf(t[i+1])),Cy(t,p,i,!0),Cy(t,p,i,!1),lM(e,p,t,i,r),s=xl(a,c),r?e.classBindings=s:e.styleBindings=s}function lM(t,e,n,i,o){let r=o?t.residualClasses:t.residualStyles;r!=null&&typeof e=="string"&&Kr(r,e)>=0&&(n[i+1]=Yf(n[i+1]))}function Cy(t,e,n,i){let o=t[n+1],r=e===null,s=i?gr(o):ds(o),a=!1;for(;s!==0&&(a===!1||r);){let c=t[s],l=t[s+1];dM(c,e)&&(a=!0,t[s+1]=i?Yf(l):Wf(l)),s=i?gr(l):ds(l)}a&&(t[n+1]=i?Wf(o):Yf(o))}function dM(t,e){return t===null||e==null||(Array.isArray(t)?t[1]:t)===e?!0:Array.isArray(t)&&typeof e=="string"?Kr(t,e)>=0:!1}var _i={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function uM(t){return t.substring(_i.key,_i.keyEnd)}function pM(t){return fM(t),av(t,cv(t,0,_i.textEnd))}function av(t,e){let n=_i.textEnd;return n===e?-1:(e=_i.keyEnd=mM(t,_i.key=e,n),cv(t,e,n))}function fM(t){_i.key=0,_i.keyEnd=0,_i.value=0,_i.valueEnd=0,_i.textEnd=t.length}function cv(t,e,n){for(;e<n&&t.charCodeAt(e)<=32;)e++;return e}function mM(t,e,n){for(;e<n&&t.charCodeAt(e)>32;)e++;return e}function At(t,e,n){return lv(t,e,n,!1),At}function X(t,e){return lv(t,e,null,!0),X}function Tn(t){gM(CM,hM,t,!0)}function hM(t,e){for(let n=pM(e);n>=0;n=av(e,n))Xc(t,uM(e),!0)}function lv(t,e,n,i){let o=Ue(),r=hn(),s=ll(2);if(r.firstUpdatePass&&uv(r,t,s,i),e!==Sn&&bi(o,s,e)){let a=r.data[gi()];pv(r,a,o,o[It],t,o[s+1]=wM(e,n),i,s)}}function gM(t,e,n,i){let o=hn(),r=ll(2);o.firstUpdatePass&&uv(o,null,r,i);let s=Ue();if(n!==Sn&&bi(s,r,n)){let a=o.data[gi()];if(fv(a,i)&&!dv(o,r)){let c=i?a.classesWithoutHost:a.stylesWithoutHost;c!==null&&(n=Gc(c,n||"")),qf(o,a,s,n,i)}else EM(o,a,s,s[It],s[r+1],s[r+1]=xM(t,e,n),i,r)}}function dv(t,e){return e>=t.expandoStartIndex}function uv(t,e,n,i){let o=t.data;if(o[n+1]===null){let r=o[gi()],s=dv(t,n);fv(r,i)&&e===null&&!s&&(e=!1),e=yM(o,r,e,i),cM(o,r,e,n,s,i)}}function yM(t,e,n,i){let o=D0(t),r=i?e.residualClasses:e.residualStyles;if(o===null)(i?e.classBindings:e.styleBindings)===0&&(n=pf(null,t,e,n,i),n=Ea(n,e.attrs,i),r=null);else{let s=e.directiveStylingLast;if(s===-1||t[s]!==o)if(n=pf(o,t,e,n,i),r===null){let c=_M(t,e,i);c!==void 0&&Array.isArray(c)&&(c=pf(null,t,e,c[1],i),c=Ea(c,e.attrs,i),vM(t,e,i,c))}else r=bM(t,e,i)}return r!==void 0&&(i?e.residualClasses=r:e.residualStyles=r),n}function _M(t,e,n){let i=n?e.classBindings:e.styleBindings;if(ds(i)!==0)return t[gr(i)]}function vM(t,e,n,i){let o=n?e.classBindings:e.styleBindings;t[gr(o)]=i}function bM(t,e,n){let i,o=e.directiveEnd;for(let r=1+e.directiveStylingLast;r<o;r++){let s=t[r].hostAttrs;i=Ea(i,s,n)}return Ea(i,e.attrs,n)}function pf(t,e,n,i,o){let r=null,s=n.directiveEnd,a=n.directiveStylingLast;for(a===-1?a=n.directiveStart:a++;a<s&&(r=e[a],i=Ea(i,r.hostAttrs,o),r!==t);)a++;return t!==null&&(n.directiveStylingLast=a),i}function Ea(t,e,n){let i=n?1:2,o=-1;if(e!==null)for(let r=0;r<e.length;r++){let s=e[r];typeof s=="number"?o=s:o===i&&(Array.isArray(t)||(t=t===void 0?[]:["",t]),Xc(t,s,n?!0:e[++r]))}return t===void 0?null:t}function xM(t,e,n){if(n==null||n==="")return pi;let i=[],o=ni(n);if(Array.isArray(o))for(let r=0;r<o.length;r++)t(i,o[r],!0);else if(o instanceof Set)for(let r of o)t(i,r,!0);else if(typeof o=="object")for(let r in o)Object.hasOwn(o,r)&&t(i,r,o[r]);else typeof o=="string"&&e(i,o);return i}function CM(t,e,n){let i=String(e);i!==""&&!i.includes(" ")&&Xc(t,i,n)}function EM(t,e,n,i,o,r,s,a){o===Sn&&(o=pi);let c=0,l=0,p=0<o.length?o[0]:null,f=0<r.length?r[0]:null;for(;p!==null||f!==null;){let _=c<o.length?o[c+1]:void 0,x=l<r.length?r[l+1]:void 0,C=null,T;p===f?(c+=2,l+=2,_!==x&&(C=f,T=x)):f===null||p!==null&&p<f?(c+=2,C=p):(l+=2,C=f,T=x),C!==null&&pv(t,e,n,i,C,T,s,a),p=c<o.length?o[c]:null,f=l<r.length?r[l]:null}}function pv(t,e,n,i,o,r,s,a){if(!(e.type&3))return;let c=t.data,l=c[a+1],p=aM(l)?Ey(c,e,n,o,ds(l),s):void 0;if(!jl(p)){jl(r)||rM(l)&&(r=Ey(c,null,n,o,a,s));let f=Vp(gi(),n);uT(i,s,f,o,r)}}function Ey(t,e,n,i,o,r){let s=e===null,a;for(;o>0;){let c=t[o],l=Array.isArray(c),p=l?c[1]:c,f=p===null,_=n[o+1];_===Sn&&(_=f?pi:void 0);let x=f?Jc(_,i):p===i?_:void 0;if(l&&!jl(x)&&(x=Jc(c,i)),jl(x)&&(a=x,s))return a;let C=t[o+1];o=s?gr(C):ds(C)}if(e!==null){let c=r?e.residualClasses:e.residualStyles;c!=null&&(a=Jc(c,i))}return a}function jl(t){return t!==void 0}function wM(t,e){return t==null||t===""||(typeof e=="string"?t=ni(t)+e:typeof t=="object"&&(t=zc(ni(t)))),t}function fv(t,e){return(t.flags&(e?8:16))!==0}function u(t,e=""){let n=Ue(),i=hn(),o=t+Yt,r=i.firstCreatePass?Da(i,o,1,e,null):i.data[o],s=SM(i,n,r,e);n[o]=s,ml()&&ym(i,n,s,r),ns(r,!1)}var SM=(t,e,n,i)=>(la(!0),TS(e[It],i));function TM(t,e,n,i=""){return bi(t,mr(),n)?e+or(n)+i:Sn}function DM(t,e,n,i,o,r=""){let s=C0(),a=JT(t,s,n,o);return ll(2),a?e+or(n)+i+or(o)+r:Sn}function k(t){return ae("",t),k}function ae(t,e,n){let i=Ue(),o=TM(i,t,e,n);return o!==Sn&&mv(i,gi(),o),ae}function wo(t,e,n,i,o){let r=Ue(),s=DM(r,t,e,n,i,o);return s!==Sn&&mv(r,gi(),s),wo}function mv(t,e,n){let i=Vp(e,t);DS(t[It],i,n)}function td(t,e){let n=Kp()+t,i=Ue();return i[n]===Sn?j_(i,n,e()):XT(i,n)}function nd(t,e,n){return kM(Ue(),Kp(),t,e,n)}function MM(t,e){let n=t[e];return n===Sn?void 0:n}function kM(t,e,n,i,o,r){let s=e+n;return bi(t,s,o)?j_(t,s+1,r?i.call(r,o):i(o)):MM(t,s+1)}function Vm(t,e){return Zl(t,e)}var hv=(()=>{class t{applicationErrorHandler=N(Co);appRef=N(Ma);taskService=N(is);ngZone=N(kn);zonelessEnabled=N(fa);tracing=N(to,{optional:!0});zoneIsDefined=typeof Zone<"u"&&!!Zone.root.run;schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}];subscriptions=new En;angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(Js):null;scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(N(rf,{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 i=this.useMicrotaskScheduler?F0:Jp;this.pendingRenderTaskId=this.taskService.add(),this.scheduleInRootZone?this.cancelScheduledCallback=Zone.root.run(()=>i(()=>this.tick())):this.cancelScheduledCallback=this.ngZone.runOutsideAngular(()=>i(()=>this.tick()))}shouldScheduleTick(){return!(this.appRef.destroyed||this.pendingRenderTaskId!==null||this.runningTick||this.appRef._runningTick||!this.zonelessEnabled&&this.zoneIsDefined&&Zone.current.get(Js+this.angularZoneId))}tick(){if(this.runningTick||this.appRef.destroyed)return;if(this.appRef.dirtyFlags===0){this.cleanup();return}!this.zonelessEnabled&&this.appRef.dirtyFlags&7&&(this.appRef.dirtyFlags|=1);let n=this.taskService.add();try{this.ngZone.run(()=>{this.runningTick=!0,this.appRef._tick()},void 0,this.schedulerTickApplyArgs)}catch(i){this.applicationErrorHandler(i)}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(i){return new(i||t)};static \u0275prov=yr({token:t,factory:t.\u0275fac})}return t})();function gv(){return[{provide:ho,useExisting:hv},{provide:kn,useClass:ea},{provide:fa,useValue:!0}]}function IM(){return typeof $localize<"u"&&$localize.locale||Ia}var id=new He("",{factory:()=>N(id,{optional:!0,skipSelf:!0})||IM()});var od=class{destroyed=!1;listeners=null;errorHandler=N(Qn,{optional:!0});isEmitting=!1;hasNullListeners=!1;destroyRef=N(pt);constructor(){this.destroyRef.onDestroy(()=>{this.destroyed=!0,this.listeners=null})}subscribe(e){if(this.destroyed)throw new Ne(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(tr(953,!1));return}if(this.listeners===null)return;this.isEmitting=!0;let n=ge(null);try{for(let i of this.listeners)try{i!==null&&i(e)}catch(o){this.errorHandler?.handleError(o)}}finally{this.hasNullListeners&&(this.hasNullListeners=!1,this.listeners&&NM(this.listeners)),ge(n),this.isEmitting=!1}}};function NM(t){let e=t.length-1;for(;e>-1;)t[e]===null&&t.splice(e,1),e--}function E(t,e){return qs(t,e?.equal)}function ii(t){return kg(t)}var yv=class t extends Error{_brand;constructor(e){super(e)}static IDLE=new t("IDLE");static LOADING=new t("LOADING")};function xv(t,e){let n=Object.create(Ty);n.value=t,n.transformFn=e?.transform;function i(){if(Go(n),n.value===Qf){let o=null;throw new Ne(-950,o)}return n.value}return i[fn]=n,i}function at(t){return new od}function _v(t,e){return xv(t,e)}function ZM(t){return xv(Qf,t)}var te=(_v.required=ZM,_v);function vv(t,e){return Z_(e)}function QM(t,e){return Q_(e)}var Xe=(vv.required=QM,vv);function Cv(t,e){return X_(e)}var XM=1e4;var P8=XM-1e3;var jm=new He(""),JM=new He("");function Na(t){return!t.moduleRef}function ek(t){let e=Na(t)?t.r3Injector:t.moduleRef.injector,n=e.get(kn);return n.run(()=>{Na(t)?t.r3Injector.resolveInjectorInitializers():t.moduleRef.resolveInjectorInitializers();let i=e.get(Co),o;if(n.runOutsideAngular(()=>{o=n.onError.subscribe({next:i})}),Na(t)){let r=()=>e.destroy(),s=t.platformInjector.get(jm);s.add(r),e.onDestroy(()=>{o.unsubscribe(),s.delete(r)})}else{let r=()=>t.moduleRef.destroy(),s=t.platformInjector.get(jm);s.add(r),t.moduleRef.onDestroy(()=>{ha(t.allPlatformModules,t.moduleRef),o.unsubscribe(),s.delete(r)})}return nk(i,n,()=>{let r=e.get(is),s=r.add(),a=e.get(Om);return a.runInitializers(),a.donePromise.then(()=>{let c=e.get(id,Ia);if(sv(c||Ia),!e.get(JM,!0))return Na(t)?e.get(Ma):(t.allPlatformModules.push(t.moduleRef),t.moduleRef);if(Na(t)){let p=e.get(Ma);return t.rootComponent!==void 0&&p.bootstrap(t.rootComponent),p}else return tk?.(t.moduleRef,t.allPlatformModules),t.moduleRef}).finally(()=>{r.remove(s)})})})}var tk;function nk(t,e,n){try{let i=n();return Xl(i)?i.catch(o=>{throw e.runOutsideAngular(()=>t(o)),o}):i}catch(i){throw e.runOutsideAngular(()=>t(i)),i}}var rd=null;function ik(t=[],e){return Mn.create({name:e,providers:[{provide:na,useValue:"platform"},{provide:jm,useValue:new Set([()=>rd=null])},...t]})}function ok(t=[]){if(rd)return rd;let e=ik(t);return rd=e,ov(),rk(e),e}function rk(t){let e=t.get(hl,null);tl(t,()=>{e?.forEach(n=>n())})}function Ev(t){let{rootComponent:e,appProviders:n,platformProviders:i,platformRef:o}=t;ht(st.BootstrapApplicationStart);try{let r=o?.injector??ok(i),s=[gv(),B0,...n||[]],a=new Ca({providers:s,parent:r,debugName:"",runEnvironmentInitializers:!1});return ek({r3Injector:a.injector,platformInjector:r,rootComponent:e})}catch(r){return Promise.reject(r)}finally{ht(st.BootstrapApplicationEnd)}}var wv=null;function fs(){return wv}function $m(t){wv??=t}var Oa=class{};var Bm=(()=>{class t{_viewContainerRef;_viewRef=null;ngTemplateOutletContext=null;ngTemplateOutlet=null;ngTemplateOutletInjector=null;injector=N(Mn);constructor(n){this._viewContainerRef=n}ngOnChanges(n){if(this._shouldRecreateView(n)){let i=this._viewContainerRef;if(this._viewRef&&i.remove(i.indexOf(this._viewRef)),!this.ngTemplateOutlet){this._viewRef=null;return}let o=this._createContextForwardProxy();this._viewRef=i.createEmbeddedView(this.ngTemplateOutlet,o,{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,i,o)=>this.ngTemplateOutletContext?Reflect.set(this.ngTemplateOutletContext,i,o):!1,get:(n,i,o)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,i,o)}})}static \u0275fac=function(i){return new(i||t)(Ql(ps))};static \u0275dir=br({type:t,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},features:[Jf]})}return t})();function Hm(t,e){e=encodeURIComponent(e);for(let n of t.split(";")){let i=n.indexOf("="),[o,r]=i==-1?[n,""]:[n.slice(0,i),n.slice(i+1)];if(o.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 Sv="browser";var Pa=class{_doc;constructor(e){this._doc=e}manager},ad=(()=>{class t extends Pa{constructor(n){super(n)}supports(n){return!0}addEventListener(n,i,o,r){return n.addEventListener(i,o,r),()=>this.removeEventListener(n,i,o,r)}removeEventListener(n,i,o,r){return n.removeEventListener(i,o,r)}static \u0275fac=function(i){return new(i||t)(dt(wn))};static \u0275prov=xe({token:t,factory:t.\u0275fac})}return t})(),dd=new He(""),qm=(()=>{class t{_zone;_plugins;_eventNameToPlugin=new Map;constructor(n,i){this._zone=i,n.forEach(s=>{s.manager=this});let o=n.filter(s=>!(s instanceof ad));this._plugins=o.slice().reverse();let r=n.find(s=>s instanceof ad);r&&this._plugins.push(r)}addEventListener(n,i,o,r){return this._findPluginFor(i).addEventListener(n,i,o,r)}getZone(){return this._zone}_findPluginFor(n){let i=this._eventNameToPlugin.get(n);if(i)return i;if(i=this._plugins.find(r=>r.supports(n)),!i)throw new Ne(-5101,!1);return this._eventNameToPlugin.set(n,i),i}static \u0275fac=function(i){return new(i||t)(dt(dd),dt(kn))};static \u0275prov=xe({token:t,factory:t.\u0275fac})}return t})(),Um="ng-app-id";function Tv(t){for(let e of t)e.remove()}function Dv(t,e){let n=e.createElement("style");return n.textContent=t,n}function ck(t,e,n,i){let o=t.head?.querySelectorAll(`style[${Um}="${e}"],link[${Um}="${e}"]`);if(!o||o.length===0)return!1;for(let r of o)r.removeAttribute(Um),r instanceof HTMLLinkElement?i.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 Gm(t,e){let n=e.createElement("link");return n.setAttribute("rel","stylesheet"),n.setAttribute("href",t),n}var Wm=(()=>{class t{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;constructor(n,i,o,r={}){this.doc=n,this.appId=i,this.nonce=o,ck(n,i,this.inline,this.external)&&this.hosts.add(n.head)}addStyles(n,i){for(let o of n)this.addUsage(o,this.inline,Dv);i?.forEach(o=>this.addUsage(o,this.external,Gm))}removeStyles(n,i){for(let o of n)this.removeUsage(o,this.inline);i?.forEach(o=>this.removeUsage(o,this.external))}addUsage(n,i,o){let r=i.get(n);r?r.usage++:i.set(n,{usage:1,elements:[...this.hosts].map(s=>this.addElement(s,o(n,this.doc)))})}removeUsage(n,i){let o=i.get(n);o&&(o.usage--,o.usage<=0&&(Tv(o.elements),i.delete(n)))}ngOnDestroy(){for(let[,{elements:n}]of[...this.inline,...this.external])Tv(n);this.hosts.clear()}addHost(n){if(!this.hosts.has(n)){this.hosts.add(n);for(let[i,{elements:o}]of this.inline)o.push(this.addElement(n,Dv(i,this.doc)));for(let[i,{elements:o}]of this.external)o.push(this.addElement(n,Gm(i,this.doc)))}}removeHost(n){this.hosts.delete(n);for(let i of[...this.inline.values(),...this.external.values()]){let o=[];for(let r of i.elements)r.parentNode===n?r.remove():o.push(r);i.elements=o}}addElement(n,i){return this.nonce&&i.setAttribute("nonce",this.nonce),n.appendChild(i)}static \u0275fac=function(i){return new(i||t)(dt(wn),dt(da),dt(gl,8),dt(ua))};static \u0275prov=xe({token:t,factory:t.\u0275fac})}return t})(),zm={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"},Ym=/%COMP%/g;var kv="%COMP%",lk=`_nghost-${kv}`,dk=`_ngcontent-${kv}`,uk=!0,pk=new He("",{factory:()=>uk}),fk=new He("");function mk(t){return dk.replace(Ym,t)}function hk(t){return lk.replace(Ym,t)}function Iv(t,e){return e.map(n=>n.replace(Ym,t))}var Km=(()=>{class t{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;cssVarNamespace;constructor(n,i,o,r,s,a,c=null,l=null,p=null){this.eventManager=n,this.sharedStylesHost=i,this.appId=o,this.removeStylesOnCompDestroy=r,this.doc=s,this.ngZone=a,this.nonce=c,this.tracingService=l,this.cssVarNamespace=p??"",this.defaultRenderer=new Aa(n,s,a,this.tracingService,this.cssVarNamespace)}createRenderer(n,i){if(!n||!i)return this.defaultRenderer;let o=this.getOrCreateRenderer(n,i);return o instanceof ld?o.applyToHost(n):o instanceof Ra&&o.applyStyles(),o}getOrCreateRenderer(n,i){let o=this.rendererByCompId,r=o.get(i.id);if(!r){let s=this.doc,a=this.ngZone,c=this.eventManager,l=this.sharedStylesHost,p=this.removeStylesOnCompDestroy,f=this.tracingService;switch(i.encapsulation){case vi.Emulated:r=new ld(c,l,i,this.appId,p,s,a,f,this.cssVarNamespace);break;case vi.ShadowDom:return new cd(c,n,i,s,a,this.nonce,f,this.cssVarNamespace,l);case vi.ExperimentalIsolatedShadowDom:return new cd(c,n,i,s,a,this.nonce,f,this.cssVarNamespace);default:r=new Ra(c,l,i,p,s,a,f,this.cssVarNamespace);break}o.set(i.id,r)}return r}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(n){this.rendererByCompId.delete(n)}static \u0275fac=function(i){return new(i||t)(dt(qm),dt(vr),dt(da),dt(pk),dt(wn),dt(kn),dt(gl),dt(to,8),dt(fk,8))};static \u0275prov=xe({token:t,factory:t.\u0275fac})}return t})(),Aa=class{eventManager;doc;ngZone;tracingService;cssVarNamespace;data=Object.create(null);throwOnSyntheticProps=!0;constructor(e,n,i,o,r=""){this.eventManager=e,this.doc=n,this.ngZone=i,this.tracingService=o,this.cssVarNamespace=r}destroy(){}destroyNode=null;createElement(e,n){return n?this.doc.createElementNS(zm[n]||n,e):this.doc.createElement(e)}createComment(e){return this.doc.createComment(e)}createText(e){return this.doc.createTextNode(e)}appendChild(e,n){(Mv(e)?e.content:e).appendChild(n)}insertBefore(e,n,i){if(e){let o=Mv(e)?e.content:e;if(i!=null&&i.parentNode!==o)throw new Ne(-5106,!1);o.insertBefore(n,i)}}removeChild(e,n){n.remove()}selectRootElement(e,n){let i=typeof e=="string"?this.doc.querySelector(e):e;if(!i)throw new Ne(-5104,!1);return n||(i.textContent=""),i}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,n,i,o){if(o){n=o+":"+n;let r=zm[o];r?e.setAttributeNS(r,n,i):e.setAttribute(n,i)}else e.setAttribute(n,i)}removeAttribute(e,n,i){if(i){let o=zm[i];o?e.removeAttributeNS(o,n):e.removeAttribute(`${i}:${n}`)}else e.removeAttribute(n)}addClass(e,n){e.classList.add(n)}removeClass(e,n){e.classList.remove(n)}setStyle(e,n,i,o){let r=n.startsWith("--");r&&(n=n.replace("%NS%",this.cssVarNamespace)),r||o&(Ri.DashCase|Ri.Important)?e.style.setProperty(n,i,o&Ri.Important?"important":""):e.style[n]=i}removeStyle(e,n,i){let o=n.startsWith("--");o&&(n=n.replace("%NS%",this.cssVarNamespace)),o||i&Ri.DashCase?e.style.removeProperty(n):e.style[n]=""}setProperty(e,n,i){e!=null&&(e[n]=i)}setValue(e,n){e.nodeValue=n}listen(e,n,i,o){if(typeof e=="string"&&(e=fs().getGlobalEventTarget(this.doc,e),!e))throw new Ne(-5102,!1);let r=this.decoratePreventDefault(i);return this.tracingService?.wrapEventListener&&(r=this.tracingService.wrapEventListener(e,n,r)),this.eventManager.addEventListener(e,n,r,o)}decoratePreventDefault(e){return n=>{if(n==="__ngUnwrap__")return e;e(n)===!1&&n.preventDefault()}}};function Mv(t){return t.tagName==="TEMPLATE"&&t.content!==void 0}var cd=class extends Aa{hostEl;sharedStylesHost;shadowRoot;constructor(e,n,i,o,r,s,a,c,l){super(e,o,r,a,c),this.hostEl=n,this.sharedStylesHost=l,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost&&this.sharedStylesHost.addHost(this.shadowRoot);let p=i.styles;p=Iv(i.id,p).map(_=>_.replace(/%NS%/g,c));for(let _ of p){let x=document.createElement("style");s&&x.setAttribute("nonce",s),x.textContent=_,this.shadowRoot.appendChild(x)}let f=i.getExternalStyles?.();if(f)for(let _ of f){let x=Gm(_,o);s&&x.setAttribute("nonce",s),this.shadowRoot.appendChild(x)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}appendChild(e,n){return super.appendChild(this.nodeOrShadowRoot(e),n)}insertBefore(e,n,i){return super.insertBefore(this.nodeOrShadowRoot(e),n,i)}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)}},Ra=class extends Aa{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(e,n,i,o,r,s,a,c,l){super(e,r,s,a,c),this.sharedStylesHost=n,this.removeStylesOnCompDestroy=o;let p=i.styles,f=l?Iv(l,p):p;this.styles=f.map(_=>_.replace(/%NS%/g,c)),this.styleUrls=i.getExternalStyles?.(l)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&mm.size===0&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},ld=class extends Ra{contentAttr;hostAttr;constructor(e,n,i,o,r,s,a,c,l){let p=o+"-"+i.id;super(e,n,i,r,s,a,c,l,p),this.contentAttr=mk(p),this.hostAttr=hk(p)}applyToHost(e){this.applyStyles(),this.setAttribute(e,this.hostAttr,"")}createElement(e,n){let i=super.createElement(e,n);return super.setAttribute(i,this.contentAttr,""),i}};var ud=class t extends Oa{supportsDOMEvents=!0;static makeCurrent(){$m(new t)}onAndCancel(e,n,i,o){return e.addEventListener(n,i,o),()=>{e.removeEventListener(n,i,o)}}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=gk();return n==null?null:yk(n)}resetBaseElement(){La=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return Hm(document.cookie,e)}},La=null;function gk(){return La=La||document.head.querySelector("base"),La?La.getAttribute("href"):null}function yk(t){return new URL(t,document.baseURI).pathname}var Nv=["alt","control","meta","shift"],_k={"\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"},vk={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey},Ov=(()=>{class t extends Pa{constructor(n){super(n)}supports(n){return t.parseEventName(n)!=null}addEventListener(n,i,o,r){let s=t.parseEventName(i),a=t.eventCallback(s.fullKey,o,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>fs().onAndCancel(n,s.domEventName,a,r))}static parseEventName(n){let i=n.toLowerCase().split("."),o=i.shift();if(i.length===0||!(o==="keydown"||o==="keyup"))return null;let r=t._normalizeKey(i.pop()),s="",a=i.indexOf("code");if(a>-1&&(i.splice(a,1),s="code."),Nv.forEach(l=>{let p=i.indexOf(l);p>-1&&(i.splice(p,1),s+=l+".")}),s+=r,i.length!=0||r.length===0)return null;let c={};return c.domEventName=o,c.fullKey=s,c}static matchEventFullKeyCode(n,i){let o=_k[n.key]||n.key,r="";return i.indexOf("code.")>-1&&(o=n.code,r="code."),o==null||!o?!1:(o=o.toLowerCase(),o===" "?o="space":o==="."&&(o="dot"),Nv.forEach(s=>{if(s!==o){let a=vk[s];a(n)&&(r+=s+".")}}),r+=o,r===i)}static eventCallback(n,i,o){return r=>{t.matchEventFullKeyCode(r,n)&&o.runGuarded(()=>i(r))}}static _normalizeKey(n){return n==="esc"?"escape":n}static \u0275fac=function(i){return new(i||t)(dt(wn))};static \u0275prov=xe({token:t,factory:t.\u0275fac})}return t})();async function Zm(t,e,n){let i=V({rootComponent:t},bk(e,n));return Ev(i)}function bk(t,e){return{platformRef:e?.platformRef,appProviders:[...Sk,...t?.providers??[]],platformProviders:wk}}function xk(){ud.makeCurrent()}function Ck(){return new Qn}function Ek(){return nm(document),document}var wk=[{provide:ua,useValue:Sv},{provide:hl,useValue:xk,multi:!0},{provide:wn,useFactory:Ek}];var Sk=[{provide:na,useValue:"root"},{provide:Qn,useFactory:Ck},{provide:dd,useClass:ad,multi:!0},{provide:dd,useClass:Ov,multi:!0},Km,{provide:vr,useClass:Wm},{provide:Wm,useExisting:vr},qm,{provide:Xi,useExisting:Km},[]];var Fa=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275prov=xe({token:t,factory:function(i){let o=null;return i?o=new(i||t):o=dt(Tk),o},providedIn:"root"})}return t})(),Tk=(()=>{class t extends Fa{_doc=N(wn);sanitize(n,i){if(i==null)return null;switch(n){case Pt.NONE:return i;case Pt.HTML:return Ji(i,"HTML")?ni(i):Hl(this._doc,String(i)).toString();case Pt.STYLE:return Ji(i,"Style")?ni(i):i;case Pt.SCRIPT:if(Ji(i,"Script"))return ni(i);throw new Ne(5200,!1);case Pt.URL:return Ji(i,"URL")?ni(i):wa(String(i));case Pt.RESOURCE_URL:if(Ji(i,"ResourceURL"))return ni(i);throw new Ne(-5201,!1);default:throw new Ne(5202,!1)}}bypassSecurityTrustHtml(n){return sm(n)}bypassSecurityTrustStyle(n){return am(n)}bypassSecurityTrustScript(n){return cm(n)}bypassSecurityTrustUrl(n){return lm(n)}bypassSecurityTrustResourceUrl(n){return dm(n)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=yr({token:t,factory:t.\u0275fac})}return t})();var Pv={providers:[nf()]};var oi=typeof window<"u",pd=oi?window:null,So=oi?document:null,yt={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},Pe={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},en={NONE:0,AUTO:1,FORCE:2},Nt={replace:0,none:1,blend:2},Qm=Symbol(),Li=Symbol(),fd=Symbol(),To=Symbol(),md=Symbol(),Ae=1e-11,Va=1e12,ri=1e3,ja=240,si="",Av="var(",$a=[],hd=(()=>{let t=new Map;return t.set("x","translateX"),t.set("y","translateY"),t.set("z","translateZ"),t})(),ms=["perspective","translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY"],Rv=ms.reduce((t,e)=>K(V({},t),{[e]:e+"("}),{}),Kt=()=>{},Lv=t=>t,Fv=/\)\s*[-.\d]/,Vv=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,jv=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,$v=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,Bv=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,Hv=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,Xm=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,gd=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,Uv=/([a-z])([A-Z])/g,zv=/(\*=|\+=|-=)/,Gv=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/;var hs={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:ja,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:ri,delay:0,loopDelay:0,ease:"out(2)",composition:Nt.replace,modifier:Lv,onBegin:Kt,onBeforeUpdate:Kt,onUpdate:Kt,onLoop:Kt,onPause:Kt,onComplete:Kt,onRender:Kt},Ba={current:null,root:So},Ie={defaults:hs,precision:4,timeScale:1,tickThreshold:200,editor:null},Jm={version:"4.5.0",engine:null};oi&&(pd.AnimeJS||(pd.AnimeJS=[]),pd.AnimeJS.push(Jm));var th=t=>t.replace(Uv,"$1-$2").toLowerCase(),Hn=(t,e)=>t.indexOf(e)===0,io=Date.now,Un=Array.isArray,Cr=t=>t&&t.constructor===Object,Nn=t=>typeof t=="number"&&!isNaN(t),On=t=>typeof t=="string",tn=t=>typeof t=="function",le=t=>typeof t>"u",Fi=t=>le(t)||t===null,yd=t=>oi&&t instanceof SVGElement,nh=t=>Vv.test(t),ih=t=>Hn(t,"rgb"),oh=t=>Hn(t,"hsl"),qv=t=>nh(t)||(ih(t)||oh(t))&&(t[t.length-1]===")"||!Fv.test(t)),Ha=t=>!Ie.defaults.hasOwnProperty(t),Dk=["opacity","rotate","overflow","color"],Wv=(t,e)=>{if(Dk.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}},_d=t=>On(t)?parseFloat(t):t,Er=Math.pow,Do=Math.sqrt,Yv=Math.sin,Kv=Math.cos,xr=Math.abs;var wr=Math.floor,Zv=Math.asin;var Ua=Math.PI,eh=Math.round,_n=(t,e,n)=>t<e?e:t>n?n:t,Ye=(t,e)=>{if(e<0)return t;if(!e)return eh(t);let n=10**e;return eh(t*n)/n},Qv=(t,e)=>Un(e)?e.reduce((n,i)=>xr(i-t)<xr(n-t)?i:n):e?eh(t/e)*e:t,oo=(t,e,n)=>n===1?e:n===0?t:t+(e-t)*n,Sr=t=>t===1/0?Va:t===-1/0?-Va:t,ro=t=>t<=Ae?Ae:Sr(Ye(t,11)),Zt=t=>Un(t)?[...t]:t,vd=(t,e)=>{let n=V({},t);for(let i in e){let o=t[i];n[i]=le(o)?e[i]:o}return n},it=(t,e,n,i="_prev",o="_next")=>{let r=t._head,s=o;for(n&&(r=t._tail,s=i);r;){let a=r[s];e(r),r=a}},zn=(t,e,n="_prev",i="_next")=>{let o=e[n],r=e[i];o?o[i]=r:t._head=r,r?r[n]=o:t._tail=o,e[n]=null,e[i]=null},Pn=(t,e,n,i="_prev",o="_next")=>{let r=t._tail;for(;r&&n&&n(r,e);)r=r[i];let s=r?r[o]:t._head;r?r[o]=e:t._head=e,s?s[i]=e:t._tail=e,e[i]=r,e[o]=s};var Xv=(t,e,n)=>{let i=t.style.transform;if(i){let o=t[To],r=0,s=i.length,a;for(;r<s;){for(;r<s&&i.charCodeAt(r)===32;)r++;if(r>=s)break;let l=r;for(;r<s&&i.charCodeAt(r)!==40;)r++;if(r>=s)break;let p=i.substring(l,r),f=1,_=r+1,x=-1,C=-1;for(r++;r<s&&f>0;){let P=i.charCodeAt(r);P===40?f++:P===41?f--:P===44&&f===1&&(x===-1?x=r:C===-1&&(C=r)),r++}let T=r-1;p==="translate"||p==="translate3d"?(x===-1?o.translateX=i.substring(_,T).trim():(o.translateX=i.substring(_,x).trim(),C===-1?o.translateY=i.substring(x+1,T).trim():(o.translateY=i.substring(x+1,C).trim(),o.translateZ=i.substring(C+1,T).trim())),a=i.substring(_,T)):p==="scale"||p==="scale3d"?x===-1?o.scale=i.substring(_,T).trim():(o.scaleX=i.substring(_,x).trim(),C===-1?o.scaleY=i.substring(x+1,T).trim():(o.scaleY=i.substring(x+1,C).trim(),o.scaleZ=i.substring(C+1,T).trim())):o[p]=i.substring(_,T)}if(e==="translate3d"&&a)return n&&(n[e]=a),a;let c=o[e];if(!le(c))return n&&(n[e]=c),c}return e==="translate3d"?"0px, 0px, 0px":e==="rotate3d"?"0, 0, 0, 0deg":Hn(e,"scale")?"1":Hn(e,"rotate")||Hn(e,"skew")?"0deg":"0px"},bd=t=>{let e=si;for(let n=0,i=ms.length;n<i;n++){let o=ms[n],r=t[o];if(r!==void 0){if(o==="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(o==="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+=`${Rv[o]}${r}) `}o==="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 rh=[];function xd(t,e){if(!t)return null;let n=rh.length;e:for(let i=0;i<n;i++){let o=rh[i];if(o.detect&&!o.detect(t))continue;let r=o.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 i=0;i<n;i++){let o=rh[i];if(o.detect&&!o.detect(t))continue;let r=o.propertyResolvers;for(let s=0,a=r.length;s<a;s++){let c=r[s](t,e);if(c)return c}}return null}var Mk=t=>{let e=jv.exec(t)||$v.exec(t),n=le(e[4])?1:+e[4];return[+e[1],+e[2],+e[3],n]},kk=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]},sh=(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),Ik=t=>{let e=Bv.exec(t)||Hv.exec(t),n=+e[1]/360,i=+e[2]/100,o=+e[3]/100,r=le(e[4])?1:+e[4],s,a,c;if(i===0)s=a=c=o;else{let l=o<.5?o*(1+i):o+i-o*i,p=2*o-l;s=Ye(sh(p,l,n+1/3)*255,0),a=Ye(sh(p,l,n)*255,0),c=Ye(sh(p,l,n-1/3)*255,0)}return[s,a,c,r]},Jv=t=>ih(t)?Mk(t):nh(t)?kk(t):oh(t)?Ik(t):[0,0,0,1];var Ot=(t,e)=>le(t)?e:t,eb=(t,e)=>{let n=t.match(Gv),i=e[Li]?e:document.documentElement,o=getComputedStyle(i)?.getPropertyValue(n[1]);return(!o||o.trim()===si)&&n[2]&&(o=n[2].trim()),o||0},Vi=(t,e,n,i,o,r)=>{if(tn(t)){if(!o){let a=t(e,n,i,r);return isNaN(+a)?a||0:+a}let s=()=>{let a=t(e,n,i,r);return isNaN(+a)?a||0:+a};return o.func=s,s()}if(On(t)&&Hn(t,Av)){if(!o)return eb(t,e);let s=()=>eb(t,e);return o.func=s,s()}return t},za=(t,e)=>t[Li]?t[fd]&&Wv(t,e)?yt.ATTRIBUTE:ms.includes(e)||hd.get(e)?yt.TRANSFORM:Hn(e,"--")?yt.CSS_VAR:e in t.style?yt.CSS:e in t?yt.OBJECT:yt.ATTRIBUTE:yt.OBJECT,tb=(t,e,n)=>{let i=t.style[e];i&&n&&(n[e]=i);let o=i||getComputedStyle(t[md]||t).getPropertyValue(e);return o==="auto"?"0":o},ji=(t,e,n,i)=>{let o=le(n)?za(t,e):n,r=xd(t,e);if(r){let s=r.get(t);return s&&i&&(i[e]=s),s??0}if(o===yt.OBJECT){let s=t[e];return s&&i&&(i[e]=s),s||0}if(o===yt.ATTRIBUTE){let s=t.getAttribute(e);return s&&i&&(i[e]=s),s}return o===yt.TRANSFORM?Xv(t,e,i):o===yt.CSS_VAR?tb(t,e,i).trimStart():tb(t,e,i)},gs=(t,e,n)=>n==="-"?t-e:n==="+"?t+e:t*e,Cd=()=>({t:Pe.NUMBER,n:0,u:null,o:null,d:null,s:null}),vn=(t,e)=>{if(e.t=Pe.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 i=t;i[1]==="="&&(e.o=i[0],i=i.slice(2));let o=i.includes(" ")?!1:gd.exec(i);if(o)return e.t=Pe.UNIT,e.n=+o[1],e.u=o[2],e;if(e.o)return e.n=+i,e;if(qv(i))return e.t=Pe.COLOR,e.d=Jv(i),e;{let r=i.match(Xm);return e.t=Pe.COMPLEX,e.d=r?r.map(Number):[],e.s=i.split(Xm)||[],e}},ah=(t,e)=>(e.t=t._valueType,e.n=t._toNumber,e.u=t._unit,e.o=null,e.d=Zt(t._toNumbers),e.s=Zt(t._strings),e),nn=Cd(),Ed=(t,e,n)=>{let i=t._modifier,o=t._fromNumbers,r=t._toNumbers,s=t._strings,a=s[0];for(let c=0,l=r.length;c<l;c++){let p=i(Ye(oo(o[c],r[c],e),n)),f=s[c+1];a+=`${f?p+f:p}`,t._numbers[c]=p}return a};var Ga=(t,e,n,i,o)=>{let r=t.parent,s=t.duration,a=t.completed,c=t.iterationDuration,l=t.iterationCount,p=t._currentIteration,f=t._loopDelay,_=t._reversed,x=t._alternate,C=t._hasChildren,T=t._delay,P=t._currentTime,Y=T+c,W=e-T,be=_n(P,-T,s),ye=_n(W,-T,s),Me=W-P,me=ye>0,Je=ye>=s,je=s<=Ae,Be=o===en.FORCE,ft=0,St=W,Rt=0;if(l>1){let Q=c+(Je?0:f),G=~~(ye/Q);t._currentIteration=_n(G,0,l),Je&&t._currentIteration--,ft=t._currentIteration%2,St=ye-G*Q||0}let kt=_^(x&&ft),et=t._ease,Se=Je?kt?0:s:kt?c-St:St;et&&(Se=c*et(Se/c)||0);let R=(r?r.backwards:W<P)?!kt:!!kt;if(t._currentTime=W,t._iterationTime=Se,t.backwards=R,me&&!t.began?(t.began=!0,!n&&!(r&&(R||!r.began))&&t.onBegin(t)):W<=0&&(t.began=!1),!n&&!C&&me&&t._currentIteration!==p&&t.onLoop(t),Be||o===en.AUTO&&(e>=(r&&T>0?0:T)&&e<=Y||e<=T&&be>T||e>=Y&&be!==s)||Se>=Y&&be!==s||Se<=T&&be>0&&!Je||e<=be&&be===s&&a||Je&&!a&&je){if(me&&(t.computeDeltaTime(be),n||t.onBeforeUpdate(t)),!C){let Q=Be||(R?Me*-1:Me)>=Ie.tickThreshold,G=Ye(t._offset+(r?r._offset:0)+T+Se,12),L=t._head,ne,Le,tt,Ut,Ce=0;for(;L;){let bt=L._composition,ze=L._currentTime,an=L._changeDuration,zt=L._absoluteStartTime+L._changeDuration,Ke=L._nextRep,Wt=L._prevRep,Lt=bt!==Nt.none,Re=Wt?Wt._absoluteStartTime+Wt._changeDuration:0,qe=Wt&&Wt.parent!==L.parent,ke=!Ke||Ke._isOverridden?zt:Ke.parent===L.parent?zt+Ke._delay:Ke._absoluteStartTime<Ke._absoluteUpdateStartTime?Ke._absoluteStartTime:Ke._absoluteUpdateStartTime;if((Q||(ze!==an||G<=ke||Wt&&!qe&&(!Ke||Ke.parent!==L.parent))&&(ze!==0||G>=L._absoluteStartTime||qe&&!L._hasFromValue&&!Wt._isOverridden&&G>=Re||Ke&&!Ke._isOverridden&&Ke.parent===L.parent&&Ke._currentTime!==0&&Se<Ke._startTime))&&(!Wt||qe||Se>=L._startTime)&&(!Lt||!L._isOverridden&&(!L._isOverlapped||G<=zt)&&(!Ke||Ke._isOverridden||G<=ke)&&(!Wt||Wt._isOverridden||(qe?G>=L._absoluteStartTime||!L._hasFromValue&&G>=Re:G>=Re+L._delay)))){let ot=L._currentTime=_n(Se-L._startTime,0,an),pe=L._ease(ot/L._updateDuration),ut=L._modifier,Z=L._valueType,_t=L._tweenType,Qe=_t===yt.OBJECT,de=Z===Pe.NUMBER,Et=de&&Qe||pe===0||pe===1?-1:Ie.precision,Ee,lt;if(de)Ee=lt=ut(Ye(oo(L._fromNumber,L._toNumber,pe),Et));else if(Z===Pe.UNIT)lt=ut(Ye(oo(L._fromNumber,L._toNumber,pe),Et)),Ee=`${lt}${L._unit}`;else if(Z===Pe.COLOR){let Ge=L._numbers,j=L._fromNumbers,H=L._toNumbers,ee=1-pe,fe=j[0],mt=j[1],Tt=j[2],Yn=H[0],yn=H[1],Ti=H[2];Ge[0]=ut(Math.sqrt(fe*fe*ee+Yn*Yn*pe)),Ge[1]=ut(Math.sqrt(mt*mt*ee+yn*yn*pe)),Ge[2]=ut(Math.sqrt(Tt*Tt*ee+Ti*Ti*pe)),Ge[3]=ut(oo(j[3],H[3],pe)),(!L._setter||i)&&(Ee=`rgba(${Ye(Ge[0],0)},${Ye(Ge[1],0)},${Ye(Ge[2],0)},${Ge[3]})`)}else Z===Pe.COMPLEX&&(Ee=Ed(L,pe,Et));if(Lt&&(L._number=lt),!i&&bt!==Nt.blend){let Ge=L.property;ne=L.target,L._setter?L._setter(ne,lt,L):Qe?ne[Ge]=Ee:_t===yt.ATTRIBUTE?ne.setAttribute(Ge,Ee):(Le=ne.style,_t===yt.TRANSFORM?(ne!==tt&&(tt=ne,Ut=ne[To]),Ut[Ge]=Ee,Ce=1):_t===yt.CSS?Le[Ge]=Ee:_t===yt.CSS_VAR&&Le.setProperty(Ge,Ee)),me&&(Rt=1)}else L._value=Ee}else ze&&Wt&&!qe&&Se<L._startTime&&(L._currentTime=0);Ce&&L._renderTransforms&&(Le.transform=bd(Ut),Ce=0),L=L._next}!n&&Rt&&t.onRender(t)}!n&&me&&t.onUpdate(t)}return r&&je?!n&&(r.began&&!R&&W>0&&!a||R&&W<=Ae&&a)&&(t.onComplete(t),t.completed=!R):me&&Je?l===1/0?t._startTime+=t.duration:t._currentIteration>=l-1&&(t.paused=!0,!a&&!C&&(t.completed=!0,!n&&!(r&&(R||!r.began))&&(t.onComplete(t),t._resolve(t)))):t.completed=!1,Rt},$i=(t,e,n,i,o)=>{let r=t._currentIteration;if(Ga(t,e,n,i,o),t._hasChildren){let s=t,a=s.backwards,c=i?e:s._iterationTime,l=io(),p=0,f=!0;if(!i&&s._currentIteration!==r){let _=s.iterationDuration;it(s,x=>{if(!a)!x.completed&&!x.backwards&&x._currentTime<x.iterationDuration&&Ga(x,_,n,1,en.FORCE),x.began=!1,x.completed=!1;else{let C=x.duration,T=x._offset+x._delay,P=T+C;!n&&C<=Ae&&(!T||P===_)&&x.onComplete(x)}}),n||s.onLoop(s)}it(s,_=>{let x=Ye((c-_._offset)*_._speed,12);if(a&&x>_._delay+_.duration)return;let C=_._fps<s._fps?_.requestTick(l):o;p+=Ga(_,x,n,i,C),!_.completed&&f&&(f=!1)},a),!n&&p&&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 nb={},ys=(t,e,n)=>{if(n===yt.TRANSFORM){let i=hd.get(t);return i||t}else if(n===yt.CSS||n===yt.ATTRIBUTE&&yd(e)&&t in e.style){let i=nb[t];if(i)return i;{let o=t&&th(t);return nb[t]=o,o}}else return t},_s=(t,e=!1)=>{if(t._hasChildren)it(t,n=>_s(n,e),!0);else{let n=t;n.pause(),it(n,i=>{let o=i.property,r=i.target,s=i._tweenType,a=i._inlineValue,c=Fi(a)||a===si;if(i._setter){if(!e&&!c){if(vn(a,nn),nn.d){let l=nn.d,p=i._numbers;for(let f=0,_=l.length;f<_;f++)p[f]=l[f]}else i._number=nn.n;i._setter(i.target,i._number,i)}}else if(s===yt.OBJECT)!e&&!c&&(r[o]=a);else if(r[Li])if(s===yt.ATTRIBUTE)e||(c?r.removeAttribute(o):r.setAttribute(o,a));else{let l=r.style;if(s===yt.TRANSFORM){let p=r[To];c?delete p[o]:p[o]=a,i._renderTransforms&&(Object.keys(p).length?l.transform=bd(p):l.removeProperty("transform"))}else c?l.removeProperty(th(o)):l[o]=a}r[Li]&&n._tail===i&&n.targets.forEach(l=>{l.getAttribute&&l.getAttribute("style")===si&&l.removeAttribute("style")})})}return t},ib=t=>_s(t,!0);var vs=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=ri/ja,this._fps=ja,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){let n=+e,i=n<Ae?Ae:n,o=ri/i;i>hs.frameRate&&(hs.frameRate=i),this._fps=i,this._frameDuration=o}get speed(){return this._speed}set speed(e){let n=+e;this._speed=n<Ae?Ae:n}requestTick(e){let n=this._frameDuration,i=e-this._lastTickTime,o=n*.25,r=o<4?o:4;return i+r<n?en.NONE:(this._lastTickTime=i>=n?e-i%n:e,en.AUTO)}computeDeltaTime(e){let n=e-this._lastTime;return this.deltaTime=n,this._lastTime=e,n}};var so={animation:null,update:Kt},ob=t=>{let e=so.animation;return e||(e={duration:Ae,computeDeltaTime:Kt,_offset:0,_delay:0,_head:null,_tail:null},so.animation=e,so.update=()=>{t.forEach(n=>{for(let i in n){let o=n[i],r=o._head;if(r){let s=r._valueType,a=s===Pe.COMPLEX||s===Pe.COLOR?Zt(r._fromNumbers):null,c=r._fromNumber,l=o._tail;for(;l&&l!==r;){if(a)for(let p=0,f=l._numbers.length;p<f;p++)a[p]+=l._numbers[p];else c+=l._number;l=l._prevAdd}r._toNumber=c,r._toNumbers=a}}}),Ga(e,1,1,0,en.FORCE)}),e};var rb=oi?requestAnimationFrame:setImmediate,Nk=oi?cancelAnimationFrame:clearImmediate,ch=class extends vs{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=hs,this.paused=!0,this.reqId=0}update(){let e=this._currentTime=io();if(this.requestTick(e)){this.computeDeltaTime(e);let n=this._speed,i=this._fps,o=this._head;for(;o;){let r=o._next;o.paused?(zn(this,o),this._hasChildren=!!this._tail,o._running=!1,o.completed&&!o._cancelled&&o.cancel()):$i(o,(e-o._startTime)*o._speed*n,0,0,o._fps<i?o.requestTick(e):en.AUTO),o=r}so.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(io()),this.reqId=rb(sb)),this}pause(){if(this.reqId)return this.paused=!0,Ok()}resume(){if(this.paused)return this.paused=!1,it(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(Ie.timeScale===1?1:ri)}set speed(e){let n=e*Ie.timeScale;this._speed!==n&&(this._speed=n,it(this,i=>i.speed=i._speed))}get timeUnit(){return Ie.timeScale===1?"ms":"s"}set timeUnit(e){let i=e==="s",o=i?.001:1;if(Ie.timeScale!==o){Ie.timeScale=o,Ie.tickThreshold=200*o;let r=i?.001:ri;this.defaults.duration*=r,this._speed*=r}}get precision(){return Ie.precision}set precision(e){Ie.precision=e}},on=(()=>{let t=new ch(io());return oi&&(Jm.engine=t,So.addEventListener("visibilitychange",()=>{t.pauseOnDocumentHidden&&(So.hidden?t.pause():t.resume())})),t})(),sb=()=>{on._head?(on.reqId=rb(sb),on.update()):on.reqId=0},Ok=()=>(Nk(on.reqId),on.reqId=0,on);var wd={_rep:new WeakMap,_add:new Map},Wa=(t,e,n="_rep")=>{let i=wd[n],o=i.get(t);return o||(o={},i.set(t,o)),o[e]?o[e]:o[e]={_head:null,_tail:null}},Pk=(t,e)=>t._isOverridden||t._absoluteStartTime>e._absoluteStartTime,qa=t=>{t._isOverlapped=1,t._isOverridden=1,t._changeDuration=Ae,t._currentTime=Ae},Sd=(t,e)=>{let n=t._composition;if(n===Nt.replace){let i=t._absoluteStartTime;Pn(e,t,Pk,"_prevRep","_nextRep");let o=t._prevRep;if(o){let r=o.parent,s=o._absoluteEndTime;if(t.parent.id!==r.id&&r.iterationCount>1&&s+(r.duration-r.iterationDuration)>i){qa(o);let l=o._prevRep;for(;l&&l.parent.id===r.id;)qa(l),l=l._prevRep}let a=t._absoluteUpdateStartTime;if(s>a){let l=o._startTime,p=s-(l+o._updateDuration),f=Ye(a-p-l,12);o._changeDuration=f,o._currentTime=f,o._isOverlapped=1,f<Ae&&qa(o)}let c=t.parent.parent;if(!c||c!==r.parent){let l=!0;if(it(r,p=>{p._isOverlapped||(l=!1)}),l){let p=r.parent;if(p){let f=!0;it(p,_=>{_!==r&&it(_,x=>{x._isOverlapped||(f=!1)})}),f&&p.cancel()}else r.cancel()}}}}else if(n===Nt.blend){let i=Wa(t.target,t.property,"_add"),o=ob(wd._add),r=i._head;r||(r=V({},t),r._composition=Nt.replace,r._updateDuration=Ae,r._startTime=0,r._numbers=Zt(t._fromNumbers),r._number=0,r._next=null,r._prev=null,Pn(i,r),Pn(o,r));let s=t._toNumber;if(t._fromNumber=r._fromNumber-s,t._toNumber=0,t._numbers=Zt(t._fromNumbers),t._number=0,r._fromNumber=s,t._toNumbers.length){let a=Zt(t._toNumbers);a.forEach((c,l)=>{t._fromNumbers[l]=r._fromNumbers[l]-c,t._toNumbers[l]=0}),r._fromNumbers=a}Pn(i,t,null,"_prevAdd","_nextAdd")}return t},lh=t=>{let e=t._composition;if(e!==Nt.none){let n=t.target,i=t.property,s=wd._rep.get(n)[i];if(zn(s,t,"_prevRep","_nextRep"),e===Nt.blend){let a=wd._add,c=a.get(n);if(!c)return;let l=c[i],p=so.animation;zn(l,t,"_prevAdd","_nextAdd");let f=l._head;if(f&&f===l._tail){zn(l,f,"_prevAdd","_nextAdd"),zn(p,f);let _=!0;for(let x in c)if(c[x]._head){_=!1;break}_&&a.delete(n)}}}return t},ab=(t,e,n)=>{let i=!1;return it(e,o=>{let r=o.target;if(t.includes(r)){let s=o.property,a=o._tweenType,c=ys(n,r,a);(!c||c&&c===s)&&(o.parent._tail===o&&o._tweenType===yt.TRANSFORM&&o._prev&&o._prev._tweenType===yt.TRANSFORM&&(o._prev._renderTransforms=1),zn(e,o),lh(o),i=!0)}},!0),i},Ya=(t,e,n)=>{let i=e||on,o;if(i._hasChildren){let r=0;it(i,s=>{if(!s._hasChildren)if(o=ab(t,s,n),o&&!s._head)s.cancel(),zn(i,s);else{let c=s._offset+s._delay+s.duration;c>r&&(r=c)}s._head?Ya(t,s,n):s._hasChildren=!1},!0),le(i.iterationDuration)||(i.iterationDuration=r)}else o=ab(t,i,n);o&&!i._head&&(i._hasChildren=!1,i.cancel&&i.cancel())};var cb=t=>(t.paused=!0,t.began=!1,t.completed=!1,t),dh=t=>(t._cancelled&&(t._hasChildren?it(t,dh):it(t,e=>{e._composition!==Nt.none&&Sd(e,Wa(e.target,e.property))}),t._cancelled=0),t),lb=0,Ak=(t,e)=>t._priority>e._priority,ao=class extends vs{constructor(e={},n=null,i=0){super(0),++lb;let{id:o,delay:r,duration:s,reversed:a,alternate:c,loop:l,loopDelay:p,autoplay:f,frameRate:_,playbackRate:x,priority:C,onComplete:T,onLoop:P,onPause:Y,onBegin:W,onBeforeUpdate:be,onUpdate:ye}=e;Ba.current&&Ba.current.register(this);let Me=n?0:on._lastTickTime,me=n?n.defaults:Ie.defaults,Je=tn(r)||le(r)?me.delay:+r,je=tn(s)||le(s)?1/0:+s,Be=Ot(l,me.loop),ft=Ot(p,me.loopDelay),St=Be===!0||Be===1/0||Be<0?1/0:Be+1,Rt=0;n?Rt=i:(on.reqId||on.requestTick(io()),Rt=(on._lastTickTime-on._startTime)*Ie.timeScale),this.id=le(o)?lb:o,this.parent=n,this.duration=Sr((je+ft)*St-ft)||Ae,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=W||me.onBegin,this.onBeforeUpdate=be||me.onBeforeUpdate,this.onUpdate=ye||me.onUpdate,this.onLoop=P||me.onLoop,this.onPause=Y||me.onPause,this.onComplete=T||me.onComplete,this.iterationDuration=je,this.iterationCount=St,this._autoplay=n?!1:Ot(f,me.autoplay),this._offset=Rt,this._delay=Je,this._loopDelay=ft,this._iterationTime=0,this._currentIteration=0,this._resolve=Kt,this._running=!1,this._reversed=+Ot(a,me.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=Ot(c,me.alternate),this._prev=null,this._next=null,this._lastTickTime=Me,this._startTime=Me,this._lastTime=Me,this._fps=Ot(_,me.frameRate),this._speed=Ot(x,me.playbackRate),this._priority=+Ot(C,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return _n(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 _n(Ye(this._iterationTime,Ie.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return _n(Ye(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return _n(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*_n(+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 dh(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,$i(this,0,1,~~e,en.FORCE),cb(this),this._hasChildren&&it(this,cb),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&$i(this,this.duration,1,~~e,en.FORCE),this.reset(e);let n=this._autoplay;return n===!0?this.resume():n&&!le(n.linked)&&n.link(this),this}resetTime(){let e=1/(this._speed*on._speed);return this._startTime=io()-(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?$i(this,Ae,0,0,en.FORCE):(this._running||(Pn(on,this,Ak),on._hasChildren=!0,this._running=!0),this.resetTime(),this._startTime-=12,on.wake()),this):this}restart(){return this.reset().resume()}seek(e,n=0,i=0){dh(this),this.completed=!1;let o=this.paused;return this.paused=!0,$i(this,e+this._delay,~~n,~~i,en.AUTO),o?this:this.resume()}alternate(){let e=this._reversed,n=this.iterationCount,i=this.iterationDuration,o=n===1/0?wr(Va/i):n;return this._reversed=+(this._alternate&&!(o%2)?e:!e),n===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(i*o-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?it(this,e=>e.cancel(),!0):it(this,lh),this._cancelled=1,this.pause()}stretch(e){let n=this.duration,i=ro(e);if(n===i)return this;let o=e/n,r=e<=Ae;return this.duration=r?Ae:i,this.iterationDuration=r?Ae:ro(this.iterationDuration*o),this._offset*=o,this._delay*=o,this._loopDelay*=o,this}revert(){$i(this,0,1,0,en.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=Kt){let n=this.then,i=()=>{this.then=null,e(this),this.then=n,this._resolve=Kt};return new Promise(o=>(this._resolve=()=>o(i()),this.completed&&this._resolve(),this))}};function db(t){let e=On(t)?Ba.root.querySelectorAll(t):t;if(e instanceof NodeList||e instanceof HTMLCollection)return e}function Mo(t){if(Fi(t))return[];if(!oi)return Un(t)&&t.flat(1/0)||[t];if(Un(t)){let n=t.flat(1/0),i=[];for(let o=0,r=n.length;o<r;o++){let s=n[o];if(!Fi(s)){let a=db(s);if(a)for(let c=0,l=a.length;c<l;c++){let p=a[c];if(!Fi(p)){let f=!1;for(let _=0,x=i.length;_<x;_++)if(i[_]===p){f=!0;break}f||i.push(p)}}else{let c=!1;for(let l=0,p=i.length;l<p;l++)if(i[l]===s){c=!0;break}c||i.push(s)}}}return i}let e=db(t);return e?Array.from(e):[t]}function ko(t){let e=Mo(t),n=e.length;for(let i=0;i<n;i++){let o=e[i];if(!o[Qm]){o[Qm]=!0;let r=yd(o);(o.nodeType||r)&&(o[Li]=!0,o[fd]=r,o[To]={})}}return e}var uh={deg:1,rad:180/Ua,turn:360},ub={},Ka=(t,e,n,i=!1)=>{let o=e.u,r=e.n;if(e.t===Pe.UNIT&&o===n)return e;let s=r+o+n,a=ub[s];if(!le(a)&&!i)e.n=a;else{let c;if(o in uh)c=r*uh[o]/uh[n];else{let p=t.cloneNode(),f=t.parentNode,_=f&&f!==So?f:So.body;_.appendChild(p);let x=p.style;x.width=100+o;let C=p.offsetWidth||100;x.width=100+n;let T=p.offsetWidth||100,P=C/T;_.removeChild(p),c=P*r}e.n=c,ub[s]=c}return e.t,Pe.UNIT,e.u=n,e};var co=t=>t;var Za=(t=1.68)=>e=>Er(e,+t),fh={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},Rk=Ua/2,pb=Ua*2,fb={[si]:Za,Quad:Za(2),Cubic:Za(3),Quart:Za(4),Quint:Za(5),Sine:t=>1-Kv(t*Rk),Circ:t=>1-Do(1-t*t),Expo:t=>t?Er(2,10*t-10):0,Bounce:t=>{let e,n=4;for(;t<((e=Er(2,--n))-1)/11;);return 1/Er(4,3-n)-7.5625*Er((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=_n(+t,1,10),i=_n(+e,Ae,2),o=i/pb*Zv(1/n),r=pb/i;return s=>s===0||s===1?s:-n*Er(2,-10*(1-s))*Yv((1-s-o)*r)}},ph=(()=>{let t={linear:co,none:co};for(let e in fh)for(let n in fb){let i=fb[n],o=fh[e];t[e+n]=n===si||n==="Back"||n==="Elastic"?(r,s)=>o(i(r,s)):o(i)}return t})(),Td={linear:co,none:co},Lk=t=>{if(Td[t])return Td[t];if(t.indexOf("(")<=-1){let n=fh[t]||t.includes("Back")||t.includes("Elastic")?ph[t]():ph[t];return n?Td[t]=n:co}else{let e=t.slice(0,-1).split("("),n=ph[e[0]];return n?Td[t]=n(...e[1].split(",")):co}},mb=["steps(","irregular(","linear(","cubicBezier("],Tr=t=>{if(On(t)){for(let n=0,i=mb.length;n<i;n++)if(Hn(t,mb[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}\``),co}return tn(t)?t:On(t)?Lk(t):co};var De=Cd(),$e=Cd(),bs={},Dd={func:null},Md={func:null},kd=[null],xs=[null,null],Id={to:null},Fk=0,hb=0,Io,Bi,Vk=(t,e)=>{let n={};if(Un(t)){let i=[].concat(...t.map(o=>Object.keys(o))).filter(Ha);for(let o=0,r=i.length;o<r;o++){let s=i[o],a=t.map(c=>{let l={};for(let p in c){let f=c[p];Ha(p)?p===s&&(l.to=f):l[p]=f}return l});n[s]=a}}else{let i=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(Ha(c)){let l=n[c];l||(l=n[c]=[]);let p=s*i,f=l.length,_=l[f-1],x={to:a[c]},C=0;for(let T=0;T<f;T++)C+=l[T].duration;f===1&&(x.from=_.to),a.ease&&(x.ease=a.ease),x.duration=p-(f?C:0),l.push(x)}return r});for(let r in n){let s=n[r],a;for(let c=0,l=s.length;c<l;c++){let p=s[c],f=p.ease;p.ease=a||void 0,a=f}s[0].duration||s.shift()}}return n},No=class extends ao{constructor(e,n,i,o,r=!1,s=0,a){super(n,i,o),this._head,this._tail,++hb;let c=ko(e),l=c.length,p=n.keyframes,f=p?vd(Vk(p,n),n):n,{id:_,delay:x,duration:C,ease:T,playbackEase:P,modifier:Y,composition:W,onRender:be}=f,ye=i?i.defaults:Ie.defaults,Me=Ot(T,ye.ease),me=Ot(P,ye.playbackEase),Je=me?Tr(me):null,je=!le(Me.ease),Be=je?Me.ease:Ot(T,Je?"linear":ye.ease),ft=je?Me.settlingDuration:Ot(C,ye.duration),St=Ot(x,ye.delay),Rt=Y||ye.modifier,kt=le(W)&&l>=ri?Nt.none:le(W)?ye.composition:W,et=this._offset+(i?i._offset:0);je&&(Me.parent=this);let Se=NaN,R=NaN,Q=0,G=0;for(let L=0;L<l;L++){let ne=c[L],Le=s||L,tt=a||c,Ut=NaN,Ce=NaN;for(let bt in f)if(Ha(bt)){let ze=za(ne,bt),an=xd(ne,bt),zt=ys(bt,ne,ze),Ke=f[bt],Wt=Un(Ke);if(r&&!Wt&&(xs[0]=Ke,xs[1]=Ke,Ke=xs),Wt){let pe=Ke.length,ut=!Cr(Ke[0]);pe===2&&ut?(Id.to=Ke,kd[0]=Id,Io=kd):pe>2&&ut?(Io=[],Ke.forEach((Z,_t)=>{_t?_t===1?(xs[1]=Z,Io.push(xs)):Io.push(Z):xs[0]=Z})):Io=Ke}else kd[0]=Ke,Io=kd;let Lt=null,Re=null,qe=NaN,ke=0,ot=0;for(let pe=Io.length;ot<pe;ot++){let ut=Io[ot];Cr(ut)?Bi=ut:(Id.to=ut,Bi=Id),Dd.func=null,Md.func=null;let Z=Vi(Ot(Bi.composition,kt),ne,Le,tt,null,null),_t=Nn(Z)?Z:Nt[Z];!Lt&&_t!==Nt.none&&(Lt=Wa(ne,zt));let Qe=Lt?Lt._tail:null,de=i&&Qe&&Qe.parent.parent===i?Qe:Re,Et=Vi(Bi.to,ne,Le,tt,Dd,de),Ee;Cr(Et)&&!le(Et.to)?(Bi=Et,Ee=Et.to):Ee=Et;let lt=Vi(Bi.from,ne,Le,tt,Md,de),Ge=Bi.ease||Be,j=Vi(Ge,ne,Le,tt,null,de),H=tn(j)||On(j)?j:Ge,ee=!le(H)&&!le(H.ease),fe=ee?H.ease:H,mt=ee?H.settlingDuration:Vi(Ot(Bi.duration,pe>1?Vi(ft,ne,Le,tt,null,de)/pe:ft),ne,Le,tt,null,de),Tt=Vi(Ot(Bi.delay,ot?0:St),ne,Le,tt,null,de),Yn=Bi.modifier||Rt,yn=!le(lt),Ti=!le(Ee),Di=Un(Ee),pc=Di||yn&&Ti,fc=Re?ke:0,Ar=Re?ke+Tt:Tt,jo=Ye(et+Ar,12),Vs=Ye(et+fc,12);!G&&(yn||Di)&&(G=1);let Xt=Re;if(_t!==Nt.none){let Oe=Lt._head;for(;Oe&&Oe._absoluteStartTime<=jo;)if(Oe._isOverridden||(Xt=Oe),Oe=Oe._nextRep,Oe&&Oe._absoluteStartTime>=jo)for(;Oe;)qa(Oe),Oe=Oe._nextRep}if(pc){vn(Di?Vi(Ee[0],ne,Le,tt,Md,de):lt,De),vn(Di?Vi(Ee[1],ne,Le,tt,Dd,de):Ee,$e);let Oe=ji(ne,zt,ze,bs);De.t===Pe.NUMBER&&(Xt?Xt._valueType===Pe.UNIT&&(De.t=Pe.UNIT,De.u=Xt._unit):(vn(Oe,nn),nn.t===Pe.UNIT&&(De.t=Pe.UNIT,De.u=nn.u)))}else Ti?vn(Ee,$e):Re?ah(Re,$e):vn(i&&Xt&&Xt.parent.parent===i?Xt._value:ji(ne,zt,ze,bs),$e),yn?vn(lt,De):Re?ah(Re,De):vn(i&&Xt&&Xt.parent.parent===i?Xt._value:ji(ne,zt,ze,bs),De);if(De.o&&(De.n=gs(Xt?Xt._toNumber:vn(ji(ne,zt,ze,bs),nn).n,De.n,De.o)),$e.o&&($e.n=gs(De.n,$e.n,$e.o)),De.t!==$e.t){if(De.t===Pe.COMPLEX||$e.t===Pe.COMPLEX){let Oe=De.t===Pe.COMPLEX?De:$e,Ft=De.t===Pe.COMPLEX?$e:De;Ft.t=Pe.COMPLEX,Ft.s=Zt(Oe.s),Ft.d=Oe.d.map(()=>Ft.n)}else if(De.t===Pe.UNIT||$e.t===Pe.UNIT){let Oe=De.t===Pe.UNIT?De:$e,Ft=De.t===Pe.UNIT?$e:De;Ft.t=Pe.UNIT,Ft.u=Oe.u}else if(De.t===Pe.COLOR||$e.t===Pe.COLOR){let Oe=De.t===Pe.COLOR?De:$e,Ft=De.t===Pe.COLOR?$e:De;Ft.t=Pe.COLOR,Ft.d=Oe.d.map(()=>0)}}if(De.u!==$e.u){let Oe=$e.u?De:$e;Oe=Ka(ne,Oe,$e.u?$e.u:De.u,!1)}if($e.d&&De.d&&$e.d.length!==De.d.length){let Oe=De.d.length>$e.d.length?De:$e,Ft=Oe===De?$e:De;Ft.d=Oe.d.map((hc,Rr)=>le(Ft.d[Rr])?0:Ft.d[Rr]),Ft.s=Zt(Oe.s)}let Mi=Ye(+mt||Ae,12),js=bs[zt];Fi(js)||(bs[zt]=null);let mc=an?an.set:null;ke=Ye(Ar+Mi,12);let $o=De.d,$s=$e.d,Bs=$e.s,cn={parent:this,id:Fk++,property:zt,target:ne,_value:null,_toFunc:Dd.func,_fromFunc:Md.func,_ease:Tr(fe),_fromNumbers:$o?Zt($o):$a,_toNumbers:$s?Zt($s):$a,_strings:Bs?Zt(Bs):$a,_fromNumber:De.n,_toNumber:$e.n,_numbers:$o?Zt($o):$a,_number:De.n,_unit:$e.u,_modifier:Yn,_currentTime:0,_startTime:Ar,_delay:+Tt,_updateDuration:Mi,_changeDuration:Mi,_absoluteStartTime:jo,_absoluteUpdateStartTime:Vs,_absoluteEndTime:Ye(et+ke,12),_hasFromValue:yn||Di?1:0,_tweenType:ze,_setter:mc,_valueType:$e.t,_composition:_t,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:js,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};_t!==Nt.none&&Sd(cn,Lt);let po=cn._valueType;if(po===Pe.COMPLEX)cn._value=Ed(cn,1,-1);else if(po===Pe.UNIT)cn._value=`${Yn(cn._toNumber)}${cn._unit}`;else if(po===Pe.COLOR){let Oe=$e.d;cn._value=`rgba(${Ye(Oe[0],0)},${Ye(Oe[1],0)},${Ye(Oe[2],0)},${Oe[3]})`}else cn._value=Yn(cn._toNumber);isNaN(qe)&&(qe=cn._startTime),Re=cn,Q++,Pn(this,cn)}(isNaN(R)||qe<R)&&(R=qe),(isNaN(Se)||ke>Se)&&(Se=ke),ze===yt.TRANSFORM&&(Ut=Q-ot,Ce=Q)}if(!isNaN(Ut)){let bt=0;it(this,ze=>{bt>=Ut&&bt<Ce&&(ze._renderTransforms=1,ze._composition===Nt.blend&&it(so.animation,an=>{an.id===ze.id&&(an._renderTransforms=1)})),bt++})}}l||console.warn("No target found. Make sure the element you're trying to animate is accessible before creating your animation."),R?(it(this,L=>{L._startTime-L._delay||(L._delay-=R),L._startTime-=R}),Se-=R):R=0,Se||(Se=Ae,this.iterationCount=0),this.targets=c,this.id=le(_)?hb:_,this.duration=Se===Ae?Ae:Sr((Se+this._loopDelay)*this.iterationCount-this._loopDelay)||Ae,this.onRender=be||ye.onRender,this._ease=Je,this._delay=R,this.iterationDuration=Se,!this._autoplay&&G&&this.onRender(this)}stretch(e){let n=this.duration;if(n===ro(e))return this;let i=e/n;return it(this,o=>{o._updateDuration=ro(o._updateDuration*i),o._changeDuration=ro(o._changeDuration*i),o._currentTime*=i,o._delay*=i,o._startTime*=i,o._absoluteStartTime*=i,o._absoluteUpdateStartTime*=i,o._absoluteEndTime*=i}),super.stretch(e)}refresh(){return it(this,e=>{let n=e._toFunc,i=e._fromFunc;(n||i)&&(i?(vn(i(),De),De.u!==e._unit&&e.target[Li]&&Ka(e.target,De,e._unit,!0),e._fromNumbers=Zt(De.d),e._fromNumber=De.n):n&&(vn(ji(e.target,e.property,e._tweenType),nn),e._fromNumbers=Zt(nn.d),e._fromNumber=nn.n),n&&(vn(n(),$e),e._toNumbers=Zt($e.d),e._strings=Zt($e.s),e._toNumber=$e.o?gs(e._fromNumber,$e.n,$e.o):$e.n))}),this.duration===Ae&&this.restart(),this}revert(){return super.revert(),_s(this)}then(e){return super.then(e)}},rn=(t,e)=>Ie.editor?Ie.editor.addAnimation(t,e):new No(t,e,null,0,!1).init();var jk=(t,e)=>{if(Hn(e,"<")){let n=e[1]==="<",i=t._tail,o=i?i._offset+i._delay:0;return n?o:o+i.duration}},Dr=(t,e)=>{let n=t.iterationDuration;if(n===Ae&&(n=0),le(e))return n;if(Nn(+e))return+e;let i=e,o=t?t.labels:null,r=!Fi(o),s=jk(t,i),a=!le(s),c=zv.exec(i);if(c){let l=c[0],p=i.split(l),f=r&&p[0]?o[p[0]]:n,_=a?s:r?f:n,x=+p[1];return gs(_,x,l[0])}else return a?s:r?le(o[i])?n:o[i]:n};function $k(t){return Sr((t.iterationDuration+t._loopDelay)*t.iterationCount-t._loopDelay)||Ae}function mh(t,e,n,i,o,r){let a=Nn(t.duration)&&t.duration<=Ae?n-Ae:n;e.composition&&$i(e,a,1,1,en.AUTO);let c=i?new No(i,t,e,a,!1,o,r):new ao(t,e,a);return e.composition&&c.init(!0),Pn(e,c),it(e,l=>{let f=l._offset+l._delay+l.duration;f>e.iterationDuration&&(e.iterationDuration=f)}),e.duration=$k(e),e}var gb=0,Nd=class extends ao{constructor(e={}){super(e,null,0),++gb,this.id=le(e.id)?gb:e.id,this.duration=0,this.labels={};let n=e.defaults,i=Ie.defaults;this.defaults=n?vd(n,i):i,this.composition=Ot(e.composition,!0),this.onRender=e.onRender||i.onRender;let o=Ot(e.playbackEase,i.playbackEase);this._ease=o?Tr(o):null,this.iterationDuration=0}add(e,n,i){let o=Cr(n),r=Cr(e);if(o||r){if(this._hasChildren=!0,o){let s=n,a=Ie.editor&&Ie.editor.addTimelineChild,c=i&&i.type==="Stagger"&&Ie.editor,l=tn(i)?i:null;if(l||c){let p=Mo(e),f=this.duration,_=this.iterationDuration,x=s.id,C=0,T=p.length,P=a?a(e,s,this.id,i,T):null,Y=l||Ie.editor.resolveStagger(i.defaultValue);p.forEach(W=>{let be=V({},P||s);this.duration=f,this.iterationDuration=_,le(x)||(be.id=x+"-"+C);let ye=Dr(this,Y(W,C,p,null,this));mh(be,this,ye,W,C,p),C++})}else{let p=a?a(e,s,this.id,i):s,f=i&&i.type?i.defaultValue:i;mh(p,this,Dr(this,f),e)}}else mh(e,this,Dr(this,n));return this.composition&&this.init(!0),this}}sync(e,n){if(le(e)||e&&le(e.pause))return this;e.pause();let i=+(e.effect?e.effect.getTiming().duration:e.duration);!le(e)&&!le(e.persist)&&(e.persist=!0);let o=Ie.editor,r=o&&o.addTimelineChild;o&&o.addTimelineSync&&(n=o.addTimelineSync(e,n,this.id),o.addTimelineChild=null);let s=this.add(e,{currentTime:[0,i],duration:i,delay:0,ease:"linear",playbackEase:"linear"},n);return o&&(o.addTimelineChild=r),s}set(e,n,i){return le(n)?this:(n.duration=Ae,n.composition=Nt.replace,this.add(e,n,i))}call(e,n){return le(e)||e&&!tn(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 le(e)||e&&!On(e)?this:(Ie.editor&&Ie.editor.addTimelineLabel&&(n=Ie.editor.addTimelineLabel(e,n,this.id)),this.labels[e]=Dr(this,n),this)}remove(e,n){return Ya(Mo(e),this,n),this}stretch(e){let n=this.duration;if(n===ro(e))return this;let i=e/n,o=this.labels;it(this,r=>r.stretch(r.duration*i));for(let r in o)o[r]*=i;return super.stretch(e)}refresh(){return it(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),it(this,e=>e.revert,!0),_s(this)}then(e){return super.then(e)}},Od=t=>Ie.editor?Ie.editor.addTimeline(t):new Nd(t).init();var hh={};bg(hh,{clamp:()=>_n,damp:()=>Yk,degToRad:()=>qk,lerp:()=>oo,mapRange:()=>Gk,padEnd:()=>Uk,padStart:()=>Hk,radToDeg:()=>Wk,round:()=>Ye,roundPad:()=>Bk,snap:()=>Qv,wrap:()=>zk});var Bk=(t,e)=>(+t).toFixed(e),Hk=(t,e,n)=>`${t}`.padStart(e,n),Uk=(t,e,n)=>`${t}`.padEnd(e,n),zk=(t,e,n)=>((t-e)%(n-e)+(n-e))%(n-e)+e,Gk=(t,e,n,i,o)=>i+(t-e)/(n-e)*(o-i),qk=t=>t*Math.PI/180,Wk=t=>t*180/Math.PI,Yk=(t,e,n,i)=>i?i===1?e:oo(t,e,1-Math.exp(-i*n*.1)):t;var yb={_head:null,_tail:null},_b=(t,e,n)=>{let i=yb._head,o;for(;i;){let r=i._next,s=i.$el===t,a=!e||i.property===e,c=!n||i.parent===n;if(s&&a&&c){o=i.animation;try{o.commitStyles()}catch{}o.cancel(),zn(yb,i);let l=i.parent;l&&(l._completed++,l.animations.length===l._completed&&(l.completed=!0,l.paused=!0,l.muteCallbacks||(l.onComplete(l),l._resolve(l))))}i=r}return o};function vb(t,e,n){let i=ko(t);if(!i.length)return;let[o]=i,r=za(o,e),s=ys(e,o,r),a=ji(o,s);if(le(n))return a;if(vn(a,nn),nn.t===Pe.NUMBER||nn.t===Pe.UNIT){if(n===!1)return nn.n;{let c=Ka(o,nn,n,!1);return`${Ye(c.n,Ie.precision)}${c.u}`}}}var bb=(t,e)=>{if(!le(e))return Ie.editor&&Ie.editor.addSet?Ie.editor.addSet(t,e):(e.duration=Ae,e.composition=Ot(e.composition,Nt.none),new No(t,e,null,0,!0).resume())},xb=(t,e,n)=>{let i=Mo(t);for(let o=0,r=i.length;o<r;o++)_b(i[o],n,e&&e.controlAnimation&&e);return Ya(i,e,n),i};var Cb=(t=Kt)=>new ao({duration:1*Ie.timeScale,onComplete:t},null,0).resume(),Eb=t=>{let e;return((...n)=>{let i,o,r,s,a;e&&(i=e.currentIteration,o=e.iterationProgress,r=e.reversed,s=e._alternate,a=e._startTime,e.revert());let c=t(...n);return c&&!tn(c)&&c.revert&&(e=c),le(o)||(e.currentIteration=i,e.iterationProgress=(s&&i%2?!r:r)?1-o:o,e._startTime=a),c||Kt})};var Dt={};bg(Dt,{$:()=>ko,addChild:()=>Pn,clamp:()=>Pb,cleanInlineStyles:()=>ib,createSeededRandom:()=>Ad,damp:()=>Lb,degToRad:()=>Ib,forEachChildren:()=>it,get:()=>vb,keepTime:()=>Eb,lerp:()=>Rb,mapRange:()=>kb,padEnd:()=>Db,padStart:()=>Tb,radToDeg:()=>Nb,random:()=>Cs,randomPick:()=>Fb,remove:()=>xb,removeChild:()=>zn,round:()=>Ab,roundPad:()=>Sb,set:()=>bb,shuffle:()=>Rd,snap:()=>Ob,stagger:()=>Hi,sync:()=>Cb,wrap:()=>Mb});var ai=hh,Pd={},Kk=(t,e=0)=>(...n)=>e?i=>t(...n,i):i=>t(i,...n),wb=t=>(...e)=>{let n=t(...e);return new Proxy(Kt,{apply:(i,o,[r])=>n(r),get:(i,o)=>{if(Pd[o])return wb((...r)=>{let s=Pd[o](...r);return a=>s(n(a))})}})},ci=(t,e,n=0)=>{let i=(...o)=>(o.length<e.length?wb(Kk(e,n)):e)(...o);return Pd[t]||(Pd[t]=i),i},Sb=ci("roundPad",ai.roundPad),Tb=ci("padStart",ai.padStart),Db=ci("padEnd",ai.padEnd),Mb=ci("wrap",ai.wrap),kb=ci("mapRange",ai.mapRange),Ib=ci("degToRad",ai.degToRad),Nb=ci("radToDeg",ai.radToDeg),Ob=ci("snap",ai.snap),Pb=ci("clamp",ai.clamp),Ab=ci("round",ai.round),Rb=ci("lerp",ai.lerp,1),Lb=ci("damp",ai.damp,1);var Cs=(t=0,e=1,n=0)=>{let i=10**n;return Math.floor((Math.random()*(e-t+1/i)+t)*i)/i},Zk=0,Ad=(t,e=0,n=1,i=0)=>{let o=t===void 0?Zk++:t;return(r=e,s=n,a=i)=>{o+=1831565813,o=Math.imul(o^o>>>15,o|1),o^=o+Math.imul(o^o>>>7,o|61);let c=10**a;return Math.floor((((o^o>>>14)>>>0)/4294967296*(s-r+1/c)+r)*c)/c}},Fb=t=>t[Cs(0,t.length-1)],Rd=(t,e=Cs)=>{let n=t.length,i,o;for(;n;)o=e(0,--n),i=t[n],t[n]=t[o],t[o]=i;return t};var Hi=(t,e={})=>{let n=[],i=0,o,r=null,s=e.from,a=e.reversed,c=e.ease,l=!le(c),f=l&&!le(c.ease)?c.ease:l?Tr(c):null,_=e.grid,x=_===!0,C=e.axis,T=e.total,P=le(s)||s===0||s==="first",Y=s==="center",W=s==="last",be=s==="random",ye=Un(s),Me=Un(t),me=e.use,Je=Me?_d(t[0]):_d(t),je=Me?_d(t[1]):0,Be=gd.exec((Me?t[1]:t)+si),ft=e.start||0+(Me?Je:0),St=e.seed,kt=!le(St)&&St!==!1?Ad(St===!0?0:St):Cs,et=e.jitter,Se=!le(et),R=Un(et),Q=R?et[0]:et||0,G=R?et[1]:et||0,L=P?0:Nn(s)?s:0;return(ne,Le,tt,Ut,Ce)=>{let[bt]=ko(ne),ze=le(T)?tt.length:T,an=le(me)?!1:tn(me)?me(bt,Le,ze):ji(bt,me),zt=Nn(an)||On(an)&&Nn(+an)?+an:Le,Ke=zt>=0&&zt<ze?zt:Le;if(Y&&(L=(ze-1)/2),W&&(L=ze-1),!n.length){if(x){let Re=!0,qe=!1,ke=1/0,ot=1/0,pe=1/0,ut=-1/0,Z=-1/0,_t=-1/0,Qe=[],de=[],Et=[];for(let Ee=0;Ee<ze;Ee++){let lt=tt[Ee],Ge=0,j=0,H=0,ee=!1;if(lt&&tn(lt.getBoundingClientRect)){let fe=lt.getBoundingClientRect();Ge=fe.left+fe.width/2,j=fe.top+fe.height/2,ee=!0}else{let fe=lt;fe&&Nn(fe.x)&&Nn(fe.y)&&(Ge=fe.x,j=fe.y,Nn(fe.z)&&(H=fe.z,qe=!0),ee=!0)}if(!ee){Re=!1;break}Qe.push(Ge),de.push(j),Et.push(H),Ge<ke&&(ke=Ge),j<ot&&(ot=j),H<pe&&(pe=H),Ge>ut&&(ut=Ge),j>Z&&(Z=j),H>_t&&(_t=H)}if(Re){let Ee=Qe[0],lt=de[0],Ge=Et[0];ye?(Ee=ke+s[0]*(ut-ke),lt=ot+s[1]*(Z-ot),Ge=qe?pe+(s.length>=3?s[2]:.5)*(_t-pe):0):Y?(Ee=(ke+ut)/2,lt=(ot+Z)/2,Ge=(pe+_t)/2):W?(Ee=Qe[ze-1],lt=de[ze-1],Ge=Et[ze-1]):Nn(s)&&(Ee=Qe[s],lt=de[s],Ge=Et[s]);for(let H=0;H<ze;H++){let ee=Ee-Qe[H],fe=lt-de[H],mt=Ge-Et[H],Tt=Do(ee*ee+fe*fe+(qe?mt*mt:0));C==="x"&&(Tt=-ee),C==="y"&&(Tt=-fe),C==="z"&&(Tt=-mt),n.push(Tt)}let j=1/0;for(let H=0;H<ze;H++){let ee=xr(n[H]);ee>0&&ee<j&&(j=ee)}if(j>0&&j<1/0)for(let H=0;H<ze;H++)n[H]=n[H]/j}else for(let Ee=0;Ee<ze;Ee++)n.push(xr(L-Ee))}else for(let Re=0;Re<ze;Re++)if(!_)n.push(xr(L-Re));else{let qe=_.length,ke=_[0]*_[1],ot,pe,ut;ye?(ot=s[0]*(_[0]-1),pe=s[1]*(_[1]-1),ut=qe===3?(s.length>=3?s[2]:.5)*(_[2]-1):0):Y?(ot=(_[0]-1)/2,pe=(_[1]-1)/2,ut=qe===3?(_[2]-1)/2:0):(ot=L%_[0],pe=wr(L/_[0])%_[1],ut=qe===3?wr(L/ke):0);let Z=Re%_[0],_t=wr(Re/_[0])%_[1],Qe=qe===3?wr(Re/ke):0,de=ot-Z,Et=pe-_t,Ee=ut-Qe,lt=Do(de*de+Et*Et+(qe===3?Ee*Ee:0));C==="x"&&(lt=-de),C==="y"&&(lt=-Et),C==="z"&&(lt=-Ee),n.push(lt)}i=n[0];for(let Re=1;Re<ze;Re++)n[Re]>i&&(i=n[Re]);if(f||a)for(let Re=0;Re<ze;Re++){let qe=n[Re];f&&(qe=f(qe/i)*i),a&&(qe=C?-qe:xr(i-qe)),n[Re]=qe}if(Se){r=new Array(ze);for(let Re=0;Re<ze;Re++)r[Re]=kt(-1,1,4)}be&&(n=Rd(n,kt))}let Wt=Me?(je-Je)/i:Je;le(o)&&(o=Ce?Dr(Ce,le(e.start)?Ce.iterationDuration:ft):ft);let Lt=o+(Wt*Ye(n[Ke],2)||0);if(Se){let Re=i?n[Ke]/i:0,qe=Q+(G-Q)*Re;Lt=Lt+r[Ke]*qe}return e.modifier&&(Lt=e.modifier(Lt)),Be&&(Lt=`${Lt}${Be[2]}`),Lt}};var Qk=t=>{let e=1;if(t&&t.getCTM){let n=t.getCTM();if(n){let i=Do(n.a*n.a+n.b*n.b),o=Do(n.c*n.c+n.d*n.d);e=(i+o)/2}}return e},Xk=(t,e,n)=>{let i=ri,o=getComputedStyle(t),r=o.strokeLinecap,s=o.vectorEffect==="non-scaling-stroke"?t:null,a=r,c=new Proxy(t,{get(l,p){let f=l[p];return p===md?l:p==="setAttribute"?(..._)=>{if(_[0]==="draw"){let C=_[1].split(" "),T=+C[0],P=+C[1],Y=Qk(s),W=T*-i*Y,be=P*i*Y+W,ye=i*Y+(T===0&&P===1||T===1&&P===0?0:10*Y)-be;if(r!=="butt"){let Me=T===P?"butt":r;a!==Me&&(l.style.strokeLinecap=`${Me}`,a=Me)}l.setAttribute("stroke-dashoffset",`${W}`),l.setAttribute("stroke-dasharray",`${be} ${ye}`)}return Reflect.apply(f,l,_)}:tn(f)?(..._)=>Reflect.apply(f,l,_):f}});return t.getAttribute("pathLength")!==`${i}`&&(t.setAttribute("pathLength",`${i}`),c.setAttribute("draw",`${e} ${n}`)),c},gh=(t,e=0,n=0)=>Mo(t).map(o=>Xk(o,e,n));var ln=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,i){setTimeout(()=>Dt.set(e,n),i)}enter(e,n={}){if(!e)return;let{y:i=8,scale:o,duration:r=260,delay:s=0,ease:a="out(3)"}=n,c={opacity:1,translateY:"0px",scale:1};if(!this.enabled){Dt.set(e,c);return}this.settle(e,c,s+r+120),rn(e,K(V({opacity:[0,1],translateY:[`${i}px`,"0px"]},o===void 0?{}:{scale:[o,1]}),{duration:r,delay:s,ease:a}))}enterList(e,n={}){let i=Array.from(e);if(i.length===0)return;let{y:o=8,duration:r=240,delay:s=0,each:a=30,ease:c="out(3)"}=n;if(!this.enabled){for(let l of i)Dt.set(l,{opacity:1,translateY:"0px"});return}i.forEach((l,p)=>{this.settle(l,{opacity:1,translateY:"0px"},s+p*a+r+120)}),rn(i,{opacity:[0,1],translateY:[`${o}px`,"0px"],duration:r,delay:Hi(a,{start:s}),ease:c})}reveal(e,n,i={}){let{animate:o=!0,after:r}=i;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||!o||c===0){Dt.set(e,n?a:s),r?.();return}this.settle(e,n?a:s,(n?240:180)+160),rn(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:()=>{Dt.set(e,n?a:s),r?.()}})}pulse(e){!this.enabled||!e||(this.settle(e,{opacity:1,scale:1},520),rn(e,{opacity:[.4,1],scale:[.99,1],duration:320,ease:"out(2)"}))}pop(e,n={}){if(!e)return;let{scale:i=1.18,duration:o=220,ease:r="out(2)"}=n;this.enabled&&(this.settle(e,{scale:1},o+120),rn(e,{scale:[i,1],duration:o,ease:r}))}static CONFETTI_COLORS=["#f43f5e","#fb923c","#facc15","#4ade80","#38bdf8","#a78bfa","#f472b6"];confetti(e,n){if(!e||!this.enabled)return;let{x:i,y:o,count:r=30,duration:s=900}=n,a=e.ownerDocument,c=e.getBoundingClientRect(),l=c.left+i,p=c.top+o,f=[],_=[];for(let T=0;T<r;T+=1){let P=Dt.random(-Math.PI*.85,-Math.PI*.15),Y=Dt.random(55,140);_.push({dx:Math.cos(P)*Y,dy:Math.sin(P)*Y,fall:Dt.random(90,180),rotate:Dt.random(-420,420)});let W=a.createElement("span");W.setAttribute("aria-hidden","true");let be=t.CONFETTI_COLORS[T%t.CONFETTI_COLORS.length];W.style.cssText=`position:fixed;left:${l}px;top:${p}px;width:${Dt.random(5,8)}px;height:${Dt.random(8,13)}px;margin:-5px 0 0 -3px;border-radius:1.5px;background:${be};pointer-events:none;z-index:60;opacity:0;`,a.body.appendChild(W),f.push(W)}let x=!1;setTimeout(()=>{if(!x){x=!0;for(let T of f)T.remove()}},s+420),f.forEach((T,P)=>{let{dx:Y,dy:W,fall:be,rotate:ye}=_[P];rn(T,{translateX:[0,Y],translateY:[0,W,W+be],rotate:[0,ye],opacity:[0,1,1,0],duration:s,ease:"out(2)",onComplete:()=>T.remove()})})}loop(e,n,i={}){if(!e||!this.enabled)return()=>{};let{duration:o=900,delay:r=0,ease:s="inOut(2)",alternate:a=!0}=i,c=rn(e,K(V({},n),{duration:o,delay:r,ease:s,loop:!0,alternate:a})),l={};for(let[p,f]of Object.entries(n))l[p]=f[0];return()=>{c.pause(),Dt.set(e,l)}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};var Es=class t{target=null;aim(e){this.target=e}read(){return this.target}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};function Jk(t,e){if(t&1&&(h(0,"span",22),u(1),g()),t&2){let n=e.$implicit;d(),k(n)}}var Vb=1800,eI=520,tI=Vb,Ld=class t{status=te("Connecting to the host\u2026");ready=te(!1);dismissed=at();letters=["M","o","r","s","e"];leaving=O(!1);host=N(Bt);animation=N(ln);handoff=N(Es);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"),i=this.query(".ring-b"),o=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"),p=this.query(".dash"),f=this.queryAll(".letter"),_=this.query(".tagline"),x=this.query(".foot"),C=this.query(".pulse");try{let T=[n,i].filter(P=>P!==null).map(P=>gh(P)[0]);for(let P of T)P.setAttribute("draw","0 0");this.intro=Od(),this.intro.add(this.one(o),{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(T,{draw:["0 0","0 1"],duration:720,ease:"inOut(3)",delay:Hi(110)},120).add(this.one(a),{opacity:[0,1],duration:420,ease:"out(2)"},260).add(this.one(i),{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(p),{opacity:[0,1],scaleX:[0,1],duration:700,ease:"outElastic(1, .55)"},960).add(this.one(o),{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:Hi(40)},1100).add(this.one(_),{opacity:[0,1],translateY:[8,0],duration:420,ease:"out(3)"},1480).add(this.one(x),{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(),Vb+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"),Dt.set(this.queryAll(".boot"),{opacity:1}),Dt.set(this.queryAll(".aura"),{opacity:.85}),Dt.set(this.queryAll(".grid"),{opacity:.5}),Dt.set(this.queryAll(".halo"),{opacity:.62,scale:1}),Dt.set(this.queryAll(".spark"),{opacity:1}),Dt.set(this.queryAll(".dot, .dash"),{opacity:1,scale:1,translateY:"0px"}),Dt.set(this.queryAll(".letter"),{opacity:1,scale:1,translateY:"0px"}),Dt.set(this.queryAll(".tagline, .foot"),{opacity:1,translateY:"0px"}),Dt.set(this.queryAll(".pulse"),{opacity:1,scale:1}),Dt.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,p]of n)l&&e(rn(l,{scale:[.4,2.05],opacity:[0,.7,0],duration:2600,delay:p,loop:!0,ease:"out(3)"}));let i=this.one(this.query(".spin-a")),o=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(rn(i,{rotate:[0,360],duration:16e3,loop:!0,ease:"linear"})),e(rn(o,{rotate:[0,-360],duration:22e3,loop:!0,ease:"linear"})),e(rn(r,{rotate:[0,360],duration:5400,delay:340,loop:!0,ease:"linear"})),e(rn(s,{scale:[1,1.9,1],opacity:[1,.6,1],duration:1100,delay:340,loop:!0,ease:"inOut(2)"})),e(rn(a,{opacity:[.6,.78],scale:[1,1.045],duration:2400,delay:1400,loop:!0,alternate:!0,ease:"inOut(2)"})),c.length>0&&e(rn(c,{opacity:[.15,1],translateY:[0,-2],duration:620,delay:Hi(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,tI-(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"),i=this.query(".grid"),o=this.query(".mark"),r=this.query(".halo"),s=this.queryAll(".letter"),a=this.query(".words"),c=this.query(".foot"),l=this.handoff.read(),p=o?.getBoundingClientRect(),f=l&&p&&p.width>0?{translateX:l.x-(p.left+p.width/2),translateY:l.y-(p.top+p.height/2),scale:l.width/p.width}:null;try{let _=Od({defaults:{ease:"inOut(2)"},onComplete:()=>this.dismiss()}).add(this.one(r),{opacity:0,scale:1.3,duration:320},0).add(this.one(n,i),{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:Hi(20)},0).add(this.one(a,c),{opacity:0,duration:220},40);f&&o?_.add(o,K(V({},f),{duration:560,ease:"inOut(3)"}),0).add(o,{opacity:0,duration:160,ease:"out(2)"},500).add(this.one(e),{opacity:0,duration:380},520):_.add(this.one(o),{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(),eI+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=ue({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,i){n&1&&(h(0,"div",0),ce(1,"span",1)(2,"span",2)(3,"span",3),h(4,"div",4)(5,"div",5),ce(6,"span",6)(7,"span",7)(8,"span",8),rt(),h(9,"svg",9)(10,"g",10),ce(11,"circle",11),g(),h(12,"g",12),ce(13,"circle",13),g(),h(14,"g",14),ce(15,"circle",15),g()(),Jt(),h(16,"span",16),ce(17,"span",17)(18,"span",18)(19,"span",19),g()(),h(20,"div",20)(21,"div",21),oe(22,Jk,2,1,"span",22,Ci),g(),h(24,"div",23),u(25,"the pi coding agent"),g()()(),h(26,"div",24),ce(27,"span",25),h(28,"span",26),u(29),g(),h(30,"span",27),ce(31,"i")(32,"i")(33,"i"),g()()()),n&2&&(X("leaving",i.leaving()),d(22),re(i.letters),d(7),k(i.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 nI(t,e){t&1&&(h(0,"p",19),u(1),g()),t&2&&(d(),k(e))}function iI(t,e){if(t&1){let n=$();h(0,"div",23)(1,"p",24),u(2,"Start a Morse host"),g(),h(3,"div",25)(4,"span",26),u(5,"installed CLI"),g(),h(6,"code"),u(7,"morse start"),g()(),h(8,"div",25)(9,"span",26),u(10,"from the repo"),g(),h(11,"code"),u(12,"npm run dev:server"),g()(),h(13,"p",27),u(14," Not installed? "),h(15,"code"),u(16,"npm install -g @supanadit/morse-web"),g(),u(17,". "),g(),h(18,"p",27),u(19," Stopped it with "),h(20,"code"),u(21,"morse stop"),g(),u(22,"? "),h(23,"code"),u(24,"morse start"),g(),u(25," brings it back \u2014 "),h(26,"code"),u(27,"morse logs"),g(),u(28," says what happened. "),g(),h(29,"p",27),u(30,"or point this window at a host that is already running"),g(),h(31,"form",28),F("submit",function(o){D(n);let r=m();return M(r.submit(o))}),h(32,"input",29),F("input",function(o){D(n);let r=m();return M(r.onInput(o))}),g(),h(33,"button",30),u(34,"Connect"),g()()()}if(t&2){let n=m();d(32),ie("value",n.server()),d(),ie("disabled",n.server().trim().length===0)}}var Fd=class t{eyebrow=te("Offline");title=te("Morse is waiting for a host");body=te("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=te("");isBrowser=typeof globalThis<"u"&&typeof globalThis.acquireVsCodeApi>"u";server=O("");retry=at();explore=at();connect=at();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=ue({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,i){if(n&1&&(h(0,"div",0),ce(1,"span",1)(2,"span",2)(3,"span",3),h(4,"div",4)(5,"div",5),ce(6,"span",6)(7,"span",7)(8,"span",8),rt(),h(9,"svg",9),ce(10,"circle",10)(11,"circle",11),g(),Jt(),h(12,"span",12),ce(13,"span",13)(14,"span",13)(15,"span",14),g()(),h(16,"p",15),ce(17,"span",16),u(18),g(),h(19,"h1",17),u(20),g(),h(21,"p",18),u(22),g(),w(23,nI,2,1,"p",19),h(24,"div",20)(25,"button",21),F("click",function(){return i.retry.emit()}),u(26,"Retry now"),g(),h(27,"button",22),F("click",function(){return i.explore.emit()}),u(28,"Explore the app"),g()(),w(29,iI,35,2,"div",23),g()()),n&2){let o;d(18),k(i.eyebrow()),d(2),k(i.title()),d(2),k(i.body()),d(),S((o=i.detail())?23:-1,o),d(6),S(i.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 oI=["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 yh(t){return JSON.stringify(t)}function rI(t){return sI(t,oI)}function Vd(t){let e=Qa(t);return rI(e)?e:void 0}function Qa(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return}return t instanceof Uint8Array?Qa(new TextDecoder().decode(t)):t instanceof ArrayBuffer?Qa(new TextDecoder().decode(new Uint8Array(t))):t}function sI(t,e){if(typeof t!="object"||t===null)return!1;let n=t.type;return typeof n=="string"&&e.includes(n)}function jd(t={cwd:"",name:"workspace"}){return{protocolVersion:19,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 jb(t,e,n){return K(V({},t),{connection:e,connectionDetail:n})}function $b(t,e){switch(e.type){case"host/ready":return K(V({},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 K(V({},t),{state:e.payload});case"transcript/append":return K(V({},t),{items:[...t.items,e.payload]});case"transcript/update":return K(V({},t),{items:aI(t.items,e.payload)});case"transcript/delta":return K(V({},t),{items:cI(t.items,e.payload)});case"transcript/replace":return K(V({},t),{items:[...e.payload.items]});case"transcript/prepend":return K(V({},t),{items:[...e.payload.items,...t.items]});case"session/list":return K(V({},t),{sessions:[...e.payload.sessions]});case"session/activity":return K(V({},t),{activity:[...e.payload.sessions]});case"project/list":return K(V({},t),{projects:[...e.payload.projects]});case"interaction/request":return K(V({},t),{pendingInteraction:e.payload});case"interaction/dismiss":return t.pendingInteraction?.requestId===e.payload.requestId?K(V({},t),{pendingInteraction:null}):t;case"notice":return K(V({},t),{lastNotice:V({},e.payload)});case"error":return K(V({},t),{lastError:V({},e.payload)});default:return t}}function aI(t,e){let n=t.findIndex(o=>o.id===e.id);if(n===-1)return[...t,e];let i=[...t];return i[n]=e,i}function cI(t,e){let n=t.findIndex(r=>r.id===e.id);if(n===-1)return t;let i=t[n];if(i.kind!=="assistant")return t;let o=[...t];return o[n]=K(V({},i),{text:i.text+(e.text??""),thinking:i.thinking+(e.thinking??""),streaming:!0}),o}var lI=5e3;function Bb(t){let e=jd(t.workspace??{cwd:"",name:"workspace"}),n=new Set,i=C=>{e=C;for(let T of[...n])T(e)},o=C=>{t.transport.send(C)},r=new Map,s=0,a=new Set,c=new Set,l=new Set,p=(C,T)=>{s+=1;let P=`host-${s}`;return new Promise(Y=>{let W=setTimeout(()=>{r.delete(P),Y(void 0)},lI);r.set(P,{resolve:Y,timer:W}),o({type:"host/command",payload:{command:C,args:T,requestId:P}})})},f=t.transport.onMessage(C=>{if(C.type==="host/command/result"){let T=r.get(C.payload.requestId);T&&(clearTimeout(T.timer),r.delete(C.payload.requestId),T.resolve(C.payload.ok?C.payload.data:void 0));return}if(C.type==="context/selection"){for(let T of[...a])T(C.payload);return}if(C.type==="context/selectionLive"){for(let T of[...c])T(C.payload);return}if(C.type==="composer/seed"){for(let T of[...l])T(C.payload);return}i($b(e,C))}),_=t.transport.onStatus((C,T)=>{i(jb(e,dI(C),C==="open"?"Waiting for the Morse host to answer\u2026":T))}),x={ready:C=>o({type:"client/ready",payload:{protocolVersion:19,frontend:C??t.frontend}}),prompt:(C,T,P,Y)=>o({type:"chat/prompt",payload:{text:C,mode:T,images:P,pins:Y}}),editMessage:(C,T)=>o({type:"chat/edit",payload:{itemId:C,text:T}}),forkMessage:C=>o({type:"chat/fork",payload:{itemId:C}}),hostCommand:(C,T)=>p(C,T),abort:()=>o({type:"chat/abort",payload:{}}),newSession:C=>o({type:"session/new",payload:{cwd:C}}),loadSession:(C,T)=>o({type:"session/load",payload:{sessionId:C,cwd:T}}),activateSession:(C,T)=>o({type:"session/activate",payload:{sessionId:C,cwd:T}}),closeSession:C=>o({type:"session/close",payload:{sessionId:C}}),deleteSession:C=>o({type:"session/delete",payload:{sessionId:C}}),compactSession:C=>o({type:"session/compact",payload:{instructions:C}}),loadOlderHistory:()=>o({type:"history/load",payload:{}}),requestSessions:()=>o({type:"session/list",payload:{}}),requestProjects:()=>o({type:"project/list",payload:{}}),refreshCommands:()=>o({type:"commands/refresh",payload:{}}),openProject:C=>o({type:"project/open",payload:{path:C}}),setModel:(C,T)=>o({type:"model/set",payload:{provider:C,id:T}}),setThinkingLevel:C=>o({type:"thinking/set",payload:{level:C}}),respond:C=>o({type:"interaction/respond",payload:C})};return t.transport.connect(),x.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:x,dispose:()=>{f(),_(),n.clear(),t.transport.dispose()}}}function dI(t){switch(t){case"open":return"connecting";case"connecting":return"connecting";case"error":return"error";case"closed":return"closed"}}var uI=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/,Hb=/<([^<>]+)>|\[([^\[\]]+)\]/g,Ub=/\$(\d+)|\$\{(\d+):/g,pI=/\$(?:@|ARGUMENTS)|\$\{(?:@|ARGUMENTS)(?::|-)/;function fI(t){let e=[],n="",i=null;for(let o of t)i!==null?o===i?i=null:n+=o:o==='"'||o==="'"?i=o:/\s/.test(o)?n.length>0&&(e.push(n),n=""):n+=o;return n.length>0&&e.push(n),e}function mI(t,e){let n=e.join(" ");return t.replace(/\$\{(\d+|ARGUMENTS|@):-([^}]*)\}|\$\{@:(\d+)(?::(\d+))?\}|\$(ARGUMENTS|@|\d+)/g,(i,o,r,s,a,c)=>{if(o!==void 0){let l=o==="@"||o==="ARGUMENTS"?n:e[Number.parseInt(o,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 hI(t){if(t===void 0)return[];let e=[];Hb.lastIndex=0;let n,i=0;for(;(n=Hb.exec(t))!==null;){i+=1;let o=(n[1]??n[2]??"").trim();e.push({id:`arg${i}`,label:o.length>0?o:`Argument ${i}`,required:n[1]!==void 0,index:i})}return e}function gI(t){let e=0;Ub.lastIndex=0;let n;for(;(n=Ub.exec(t))!==null;){let o=Number.parseInt(n[1]??n[2]??"0",10);Number.isFinite(o)&&o>e&&(e=o)}let i=[];for(let o=1;o<=e;o+=1)i.push({id:`arg${o}`,label:`Argument ${o}`,required:!1,index:o});return i}function yI(t){let e=/^(['"])([\s\S]*)\1$/.exec(t);return e===null?t:e[2]}function _h(t){let e=uI.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:yI(n[1].trim())}}function zb(t){let e=_h(t),n=hI(e.argumentHint),i=n.length>0?n:gI(e.body);if(i.length>0)return{body:e.body,arguments:i};if(pI.test(e.body))return{body:e.body,arguments:[{id:"arguments",label:"Arguments",required:!1}]}}function Gb(t,e,n=""){let i=t.arguments.find(a=>a.index===void 0),o=i!==void 0?fI(e[i.id]??""):t.arguments.map(a=>(e[a.id]??"").trim()),r=mI(t.body,o),s=n.trim();return s.length===0?r:`${r.replace(/\s+$/,"")}
|
|
6
|
+
`);return i>=0?n.slice(0,i):n}function Gc(t,e){return t?e?`${t} ${e}`:t:e||""}var O1=xt({__forward_ref__:xt});function qc(t){return t.__forward_ref__=qc,t}function Vn(t){return Yg(t)?t():t}function Yg(t){return typeof t=="function"&&Object.hasOwn(t,O1)&&t.__forward_ref__===qc}function xe(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function Wc(t){return P1(t,Yc)}function P1(t,e){return Object.hasOwn(t,e)&&t[e]||null}function A1(t){let e=t?.[Yc]??null;return e||null}function cp(t){return t&&Object.hasOwn(t,Fc)?t[Fc]:null}var Yc=xt({\u0275prov:xt}),Fc=xt({\u0275inj:xt}),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=xe({token:this,providedIn:n.providedIn||"root",factory:n.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};function Ep(t){return t&&!!t.\u0275providers}var wp=xt({\u0275cmp:xt}),Sp=xt({\u0275dir:xt}),Tp=xt({\u0275pipe:xt});var lp=xt({\u0275fac:xt}),nr=xt({__NG_ELEMENT_ID__:xt}),Ug=xt({__NG_ENV_ID__:xt});function ir(t){return Dp(t,"@Component"),t[wp]||null}function Kc(t){return Dp(t,"@Directive"),t[Sp]||null}function Kg(t){return Dp(t,"@Pipe"),t[Tp]||null}function Dp(t,e){if(t==null)throw new Ne(-919,!1)}function or(t){return typeof t=="string"?t:t==null?"":String(t)}var Zg=xt({ngErrorCode:xt}),R1=xt({ngErrorMessage:xt}),L1=xt({ngTokenPath:xt});function Mp(t,e){return Qg("",-200,e)}function Zc(t,e){throw new Ne(-201,!1)}function Qg(t,e,n){let i=new Ne(e,t);return i[Zg]=e,i[R1]=t,n&&(i[L1]=n),i}function F1(t){return t[Zg]}var dp;function Xg(){return dp}function Fn(t){let e=dp;return dp=t,e}function kp(t,e,n){let i=Wc(t);if(i&&i.providedIn=="root")return i.value===void 0?i.value=i.factory():i.value;if(n&8)return null;if(e!==void 0)return e;Zc(t,"")}var go=globalThis;var V1={},Qo=V1,j1="__NG_DI_FLAG__",up=class{injector;constructor(e){this.injector=e}retrieve(e,n){let i=Xo(n)||0;try{return this.injector.get(e,i&8?null:Qo,i)}catch(o){if(Hr(o))return o;throw o}}};function $1(t,e=0){let n=Ic();if(n===void 0)throw new Ne(-203,!1);if(n===null)return kp(t,void 0,e);{let i=B1(e),o=n.retrieve(t,i);if(Hr(o)){if(i.optional)return null;throw o}return o}}function dt(t,e=0){return(Xg()||$1)(Vn(t),e)}function N(t,e){return dt(t,Xo(e))}function Xo(t){return typeof t>"u"||typeof t=="number"?t:0|(t.optional&&8)|(t.host&&1)|(t.self&&2)|(t.skipSelf&&4)}function B1(t){return{optional:!!(t&8),host:!!(t&1),self:!!(t&2),skipSelf:!!(t&4)}}function pp(t){let e=[];for(let n=0;n<t.length;n++){let i=Vn(t[n]);if(Array.isArray(i)){if(i.length===0)throw new Ne(900,!1);let o,r=0;for(let s=0;s<i.length;s++){let a=i[s],c=H1(a);typeof c=="number"?c===-1?o=a.token:r|=c:o=a}e.push(dt(o,r))}else e.push(dt(i))}return e}function H1(t){return t[j1]}function Wr(t,e){let n=Object.hasOwn(t,lp);return n?t[lp]:null}function Jg(t,e,n){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++){let o=t[i],r=e[i];if(n&&(o=n(o),r=n(r)),r!==o)return!1}return!0}function e0(t){return t.flat(Number.POSITIVE_INFINITY)}function Qc(t,e){t.forEach(n=>Array.isArray(n)?Qc(n,e):e(n))}function Ip(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function ta(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}function t0(t,e,n,i){let o=t.length;if(o==e)t.push(n,i);else if(o===1)t.push(i,t[0]),t[0]=n;else{for(o--,t.push(t[o-1],t[o]);o>e;){let r=o-2;t[o]=t[r],o--}t[e]=n,t[e+1]=i}}function Xc(t,e,n){let i=Kr(t,e);return i>=0?t[i|1]=n:(i=~i,t0(t,i,e,n)),i}function Jc(t,e){let n=Kr(t,e);if(n>=0)return t[n|1]}function Kr(t,e){return U1(t,e,1)}function U1(t,e,n){let i=0,o=t.length>>n;for(;o!==i;){let r=i+(o-i>>1),s=t[r<<n];if(e===s)return r<<n;s>e?o=r:i=r+1}return~(o<<n)}var rr={},pi=[],sr=new He(""),el=new He("",-1),Np=new He(""),Yr=class{get(e,n=Qo){if(n===Qo){let o=Qg("",-201);throw o.name="\u0275NotFound",o}return n}};function Zr(t){return{\u0275providers:t}}function n0(t){return Zr([{provide:sr,multi:!0,useValue:t}])}function i0(...t){return{\u0275providers:Op(!0,t),\u0275fromNgModule:!0}}function Op(t,...e){let n=[],i=new Set,o,r=s=>{n.push(s)};return Qc(e,s=>{let a=s;Vc(a,r,[],i)&&(o||=[],o.push(a))}),o!==void 0&&o0(o,r),n}function o0(t,e){for(let n=0;n<t.length;n++){let{ngModule:i,providers:o}=t[n];Pp(o,r=>{e(r,i)})}}function Vc(t,e,n,i){if(t=Vn(t),!t)return!1;let o=null,r=cp(t),s=!r&&ir(t);if(!r&&!s){let c=t.ngModule;if(r=cp(c),r)o=c;else return!1}else{if(s&&!s.standalone)return!1;o=t}let a=i.has(o);if(s){if(a)return!1;if(i.add(o),s.dependencies){let c=typeof s.dependencies=="function"?s.dependencies():s.dependencies;for(let l of c)Vc(l,e,n,i)}}else if(r){if(r.imports!=null&&!a){i.add(o);let l;Qc(r.imports,p=>{Vc(p,e,n,i)&&(l||=[],l.push(p))}),l!==void 0&&o0(l,e)}if(!a){let l=Wr(o)||(()=>new o);e({provide:o,useFactory:l,deps:pi},o),e({provide:Np,useValue:o,multi:!0},o),e({provide:sr,useValue:()=>dt(o),multi:!0},o)}let c=r.providers;if(c!=null&&!a){let l=t;Pp(c,p=>{e(p,l)})}}else return!1;return o!==t&&t.providers!==void 0}function Pp(t,e){for(let n of t)Ep(n)&&(n=n.\u0275providers),Array.isArray(n)?Pp(n,e):e(n)}var z1=xt({provide:String,useValue:xt});function r0(t){return t!==null&&typeof t=="object"&&z1 in t}function G1(t){return!!(t&&t.useExisting)}function q1(t){return!!(t&&t.useFactory)}function jc(t){return typeof t=="function"}var na=new He(""),Lc={},zg={},ap;function ia(){return ap===void 0&&(ap=new Yr),ap}var fi=class{},Jo=class extends fi{parent;source;scopes;records=new Map;_ngOnDestroyHooks=new Set;_onDestroyHooks=[];get destroyed(){return this._destroyed}_destroyed=!1;injectorDefTypes;constructor(e,n,i,o){super(),this.parent=n,this.source=i,this.scopes=o,mp(e,s=>this.processProvider(s)),this.records.set(el,qr(void 0,this)),o.has("environment")&&this.records.set(fi,qr(void 0,this));let r=this.records.get(na);r!=null&&typeof r.value=="string"&&this.scopes.add(r.value),this.injectorDefTypes=new Set(this.get(Np,pi,{self:!0}))}retrieve(e,n){let i=Xo(n)||0;try{return this.get(e,Qo,i)}catch(o){if(Hr(o))return o;throw o}}destroy(){Zs(this),this._destroyed=!0;let e=ge(null);try{for(let i of this._ngOnDestroyHooks)i.ngOnDestroy();let n=this._onDestroyHooks;this._onDestroyHooks=[];for(let i of n)i()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),ge(e)}}onDestroy(e){return Zs(this),this._onDestroyHooks.push(e),()=>this.removeOnDestroy(e)}runInContext(e){Zs(this);let n=Ii(this),i=Fn(void 0),o;try{return e()}finally{Ii(n),Fn(i)}}get(e,n=Qo,i){if(Zs(this),Object.hasOwn(e,Ug))return e[Ug](this);let o=Xo(i),r,s=Ii(this),a=Fn(void 0);try{if(!(o&4)){let l=this.records.get(e);if(l===void 0){let p=Q1(e)&&Wc(e);p&&this.injectableDefInScope(p)?l=qr(fp(e),Lc):l=null,this.records.set(e,l)}if(l!=null)return this.hydrate(e,l,o)}let c=o&2?ia():this.parent;return n=o&8&&n===Qo?null:n,c.get(e,n)}catch(c){let l=F1(c);throw l===-200||l===-201?new Ne(l,null):c}finally{Fn(a),Ii(s)}}resolveInjectorInitializers(){let e=ge(null),n=Ii(this),i=Fn(void 0),o;try{let r=this.get(sr,pi,{self:!0});for(let s of r)s()}finally{Ii(n),Fn(i),ge(e)}}toString(){return"R3Injector[...]"}processProvider(e){e=Vn(e);let n=jc(e)?e:Vn(e&&e.provide),i=Y1(e);if(!jc(e)&&e.multi===!0){let o=this.records.get(n);o||(o=qr(void 0,Lc,!0),o.factory=()=>pp(o.multi),this.records.set(n,o)),n=e,o.multi.push(e)}this.records.set(n,i)}hydrate(e,n,i){let o=ge(null);try{if(n.value===zg)throw Mp("");return n.value===Lc&&(n.value=zg,n.value=n.factory(void 0,i)),typeof n.value=="object"&&n.value&&Z1(n.value)&&this._ngOnDestroyHooks.add(n.value),n.value}finally{ge(o)}}injectableDefInScope(e){if(!e.providedIn)return!1;let n=Vn(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 fp(t){let e=Wc(t),n=e!==null?e.factory:Wr(t);if(n!==null)return n;if(t instanceof He)throw new Ne(-204,!1);if(t instanceof Function)return W1(t);throw new Ne(-204,!1)}function W1(t){if(t.length>0)throw new Ne(-204,!1);let n=A1(t);return n!==null?()=>n.factory(t):()=>new t}function Y1(t){if(r0(t))return qr(void 0,t.useValue);{let e=s0(t);return qr(e,Lc)}}function s0(t,e,n){let i;if(jc(t)){let o=Vn(t);return Wr(o)||fp(o)}else if(r0(t))i=()=>Vn(t.useValue);else if(q1(t))i=()=>t.useFactory(...pp(t.deps||[]));else if(G1(t))i=(o,r)=>dt(Vn(t.useExisting),r!==void 0&&r&8?8:void 0);else{let o=Vn(t&&(t.useClass||t.provide));if(K1(t))i=()=>new o(...pp(t.deps));else return Wr(o)||fp(o)}return i}function Zs(t){if(t.destroyed)throw new Ne(-205,!1)}function qr(t,e,n=!1){return{factory:t,value:e,multi:n?[]:void 0}}function K1(t){return!!t.deps}function Z1(t){return t!==null&&typeof t=="object"&&typeof t.ngOnDestroy=="function"}function Q1(t){return typeof t=="function"||typeof t=="object"&&t.ngMetadataName==="InjectionToken"}function mp(t,e){for(let n of t)Array.isArray(n)?mp(n,e):n&&Ep(n)?mp(n.\u0275providers,e):e(n)}function tl(t,e){let n;t instanceof Jo?(Zs(t),n=t):n=new up(t);let i,o=Ii(n),r=Fn(void 0);try{return e()}finally{Ii(o),Fn(r)}}function a0(){return Xg()!==void 0||Ic()!=null}var mi=0,_e=1,Te=2,qt=3,Xn=4,In=5,Qr=6,Xr=7,jt=8,Ki=9,hi=10,It=11,Jr=12,Ap=13,yo=14,jn=15,_o=16,ar=17,Oi=18,oa=19,Rp=20,qi=21,nl=22,Wi=23,$n=24,cr=25,c0=26,ra=27,Yt=28,l0=1,Lp=6,lr=7,sa=8,dr=9,$t=10;function vo(t){return Array.isArray(t)&&typeof t[l0]=="object"}function Jn(t){return Array.isArray(t)&&t[l0]===!0}function Fp(t){return(t.flags&4)!==0}function bo(t){return t.componentOffset>-1}function es(t){return(t.flags&1)===1}function ur(t){return!!t.template}function ts(t){return(t[Te]&512)!==0}function pr(t){return(t[Te]&256)===256}var Pt=(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})(Pt||{}),Qs,er="svg",il="math",hp="",Gg="*",gp=()=>Object.create(null);function X1(){return Qs||(Qs=gp(),mo(Pt.HTML,void 0,[["iframe",["srcdoc"]],["*",["innerHTML","outerHTML"]]]),mo(Pt.STYLE,void 0,[["*",["style"]]]),mo(Pt.URL,void 0,[["*",["formAction"]],["area",["href"]],["a",["href","xlink:href"]],["form",["action"]],["img",["src"]],["video",["src"]]]),mo(Pt.URL,il,[["*",["href","xlink:href"]]]),mo(Pt.RESOURCE_URL,void 0,[["base",["href"]],["embed",["src"]],["frame",["src"]],["iframe",["src"]],["link",["href"]],["object",["codebase","data"]]]),mo(Pt.URL,er,[["a",["href","xlink:href"]]]),mo(Pt.ATTRIBUTE_NO_BINDING,er,[["animate",["attributeName","values","to","from"]],["set",["to","attributeName"]],["animateMotion",["attributeName"]],["animateTransform",["attributeName"]]]),mo(Pt.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"]]]),Qs)}function mo(t,e,n){let i=e??hp;for(let[o,r]of n){let s=o.toLowerCase();for(let a of r){let c=a.toLowerCase(),l=Qs[c]??=gp(),p=l[i]??=gp();p[s]=t}}}function d0(t,e,n){let o=X1()[e.toLowerCase()];if(!o)return Pt.NONE;let r=t.toLowerCase(),s;if(n){let a=o[n];a&&(s=a[r]??a[Gg])}if(s===void 0){let a=o[hp];a&&(s=a[r]??a[Gg])}if(s===void 0&&(!n||n===hp)){let a=o[er];a&&(s=a[r])}return s??Pt.NONE}function mn(t){for(;Array.isArray(t);)t=t[mi];return t}function Vp(t,e){return mn(e[t])}function ei(t,e){return mn(e[t.index])}function ol(t,e){return t.data[e]}function u0(t,e){return t[e]}function Pi(t,e){let n=e[t];return vo(n)?n:n[mi]}function rl(t){return(t[Te]&128)===128}function p0(t){return Jn(t[qt])}function ti(t,e){return e==null?null:t[e]}function jp(t){t[ar]=0}function $p(t){t[Te]&1024||(t[Te]|=1024,rl(t)&&fr(t))}function f0(t,e){for(;t>0;)e=e[yo],t--;return e}function aa(t){return!!(t[Te]&9216||t[$n]?.dirty)}function sl(t){t[hi].changeDetectionScheduler?.notify(8),t[Te]&64&&(t[Te]|=1024),aa(t)&&fr(t)}function fr(t){t[hi].changeDetectionScheduler?.notify(0);let e=Yi(t);for(;e!==null&&!(e[Te]&8192||(e[Te]|=8192,!rl(e)));)e=Yi(e)}function al(t,e){if(pr(t))throw new Ne(911,!1);t[qi]===null&&(t[qi]=[]),t[qi].push(e)}function m0(t,e){if(t[qi]===null)return;let n=t[qi].indexOf(e);n!==-1&&t[qi].splice(n,1)}function Yi(t){let e=t[qt];return Jn(e)?e[qt]:e}function Bp(t){return t[Xr]??=[]}function Hp(t){return t.cleanup??=[]}function h0(t,e,n,i){let o=Bp(e);o.push(n),t.firstCreatePass&&Hp(t).push(i,o.length-1)}var Fe={lFrame:I0(null),bindingsEnabled:!0,skipHydrationRootTNode:null};var yp=!1;function g0(){return Fe.lFrame.elementDepthCount}function y0(){Fe.lFrame.elementDepthCount++}function Up(){Fe.lFrame.elementDepthCount--}function cl(){return Fe.bindingsEnabled}function _0(){return Fe.skipHydrationRootTNode!==null}function zp(t){return Fe.skipHydrationRootTNode===t}function Gp(){Fe.skipHydrationRootTNode=null}function Ue(){return Fe.lFrame.lView}function hn(){return Fe.lFrame.tView}function D(t){return Fe.lFrame.contextLView=t,t[jt]}function M(t){return Fe.lFrame.contextLView=null,t}function Bn(){let t=qp();for(;t!==null&&t.type===64;)t=t.parent;return t}function qp(){return Fe.lFrame.currentTNode}function v0(){let t=Fe.lFrame,e=t.currentTNode;return t.isParent?e:e.parent}function ns(t,e){let n=Fe.lFrame;n.currentTNode=t,n.isParent=e}function Wp(){return Fe.lFrame.isParent}function b0(){Fe.lFrame.isParent=!1}function x0(){return Fe.lFrame.contextLView}function Yp(){return yp}function Xs(t){let e=yp;return yp=t,e}function Kp(){let t=Fe.lFrame,e=t.bindingRootIndex;return e===-1&&(e=t.bindingRootIndex=t.tView.bindingStartIndex),e}function C0(){return Fe.lFrame.bindingIndex}function E0(t){return Fe.lFrame.bindingIndex=t}function mr(){return Fe.lFrame.bindingIndex++}function ll(t){let e=Fe.lFrame,n=e.bindingIndex;return e.bindingIndex=e.bindingIndex+t,n}function w0(){return Fe.lFrame.inI18n}function S0(t,e){let n=Fe.lFrame;n.bindingIndex=n.bindingRootIndex=t,dl(e)}function T0(){return Fe.lFrame.currentDirectiveIndex}function dl(t){Fe.lFrame.currentDirectiveIndex=t}function D0(t){let e=Fe.lFrame.currentDirectiveIndex;return e===-1?null:t[e]}function M0(){return Fe.lFrame.currentQueryIndex}function ul(t){Fe.lFrame.currentQueryIndex=t}function J1(t){let e=t[_e];return e.type===2?e.declTNode:e.type===1?t[In]:null}function Zp(t,e,n){if(n&4){let o=e,r=t;for(;o=o.parent,o===null&&!(n&1);)if(o=J1(r),o===null||(r=r[yo],o.type&10))break;if(o===null)return!1;e=o,t=r}let i=Fe.lFrame=k0();return i.currentTNode=e,i.lView=t,!0}function pl(t){let e=k0(),n=t[_e];Fe.lFrame=e,e.currentTNode=n.firstChild,e.lView=t,e.tView=n,e.contextLView=t,e.bindingIndex=n.bindingStartIndex,e.inI18n=!1}function k0(){let t=Fe.lFrame,e=t===null?null:t.child;return e===null?I0(t):e}function I0(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 N0(){let t=Fe.lFrame;return Fe.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}var Qp=N0;function fl(){let t=N0();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 O0(t){return(Fe.lFrame.contextLView=f0(t,Fe.lFrame.contextLView))[jt]}function gi(){return Fe.lFrame.selectedIndex}function xo(t){Fe.lFrame.selectedIndex=t}function ca(){let t=Fe.lFrame;return ol(t.tView,t.selectedIndex)}function st(){Fe.lFrame.currentNamespace=er}function Jt(){ew()}function ew(){Fe.lFrame.currentNamespace=null}function Xp(){return Fe.lFrame.currentNamespace}var P0=!0;function ml(){return P0}function la(t){P0=t}function _p(t,e=null,n=null,i){let o=A0(t,e,n,i);return o.resolveInjectorInitializers(),o}function A0(t,e=null,n=null,i,o=new Set){let r=[n||pi,i0(t)],s;return new Jo(r,e||ia(),s||null,o)}var Mn=class t{static THROW_IF_NOT_FOUND=Qo;static NULL=new Yr;static create(e,n){if(Array.isArray(e))return _p({name:""},n,e,"");{let i=e.name??"";return _p({name:i},e.parent,e.providers,i)}}static \u0275prov=xe({token:t,providedIn:"any",factory:()=>dt(el)});static __NG_ELEMENT_ID__=-1},wn=new He(""),pt=class{static __NG_ELEMENT_ID__=tw;static __NG_ENV_ID__=e=>e},$c=class extends pt{_lView;constructor(e){super(),this._lView=e}get destroyed(){return pr(this._lView)}onDestroy(e){let n=this._lView;return al(n,e),()=>m0(n,e)}};function tw(){return new $c(Ue())}var R0=!1,L0=new He(""),is=(()=>{class t{taskId=0;pendingTasks=new Set;destroyed=!1;pendingTask=new Ks(!1);debugTaskTracker=N(L0,{optional:!0});get hasPendingTasks(){return this.destroyed?!1:this.pendingTask.value}get hasPendingTasksObservable(){return this.destroyed?new Ni(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=xe({token:t,providedIn:"root",factory:()=>new t})}return t})(),vp=class extends Zn{__isAsync;destroyRef=void 0;pendingTasks=void 0;constructor(e=!1){super(),this.__isAsync=e,a0()&&(this.destroyRef=N(pt,{optional:!0})??void 0,this.pendingTasks=N(is,{optional:!0})??void 0)}emit(e){let n=ge(null);try{super.next(e)}finally{ge(n)}}subscribe(e,n,i){let o=e,r=n||(()=>null),s=i;if(e&&typeof e=="object"){let c=e;o=c.next?.bind(c),r=c.error?.bind(c),s=c.complete?.bind(c)}this.__isAsync&&(r=this.wrapInTimeout(r),o&&(o=this.wrapInTimeout(o)),s&&(s=this.wrapInTimeout(s)));let a=super.subscribe({next:o,error:r,complete:s});return e instanceof En&&e.add(a),a}wrapInTimeout(e){return n=>{let i=this.pendingTasks?.add();setTimeout(()=>{try{e(n)}finally{i!==void 0&&this.pendingTasks?.remove(i)}})}}},Gi=vp;function Bc(...t){}function Jp(t){let e,n;function i(){t=Bc;try{n!==void 0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(n),e!==void 0&&clearTimeout(e)}catch{}}return e=setTimeout(()=>{t(),i()}),typeof requestAnimationFrame=="function"&&(n=requestAnimationFrame(()=>{t(),i()})),()=>i()}function F0(t){return queueMicrotask(()=>t()),()=>{t=Bc}}var ef="isAngularZone",Js=ef+"_ID",nw=0,kn=class t{hasPendingMacrotasks=!1;hasPendingMicrotasks=!1;isStable=!0;onUnstable=new Gi(!1);onMicrotaskEmpty=new Gi(!1);onStable=new Gi(!1);onError=new Gi(!1);constructor(e){let{enableLongStackTrace:n=!1,shouldCoalesceEventChangeDetection:i=!1,shouldCoalesceRunChangeDetection:o=!1,scheduleInRootZone:r=R0}=e;if(typeof Zone>"u")throw new Ne(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=!o&&i,s.shouldCoalesceRunChangeDetection=o,s.callbackScheduled=!1,s.scheduleInRootZone=r,rw(s)}static isInAngularZone(){return typeof Zone<"u"&&Zone.current.get(ef)===!0}static assertInAngularZone(){if(!t.isInAngularZone())throw new Ne(909,!1)}static assertNotInAngularZone(){if(t.isInAngularZone())throw new Ne(909,!1)}run(e,n,i){return this._inner.run(e,n,i)}runTask(e,n,i,o){let r=this._inner,s=r.scheduleEventTask("NgZoneEvent: "+o,e,iw,Bc,Bc);try{return r.runTask(s,n,i)}finally{r.cancelTask(s)}}runGuarded(e,n,i){return this._inner.runGuarded(e,n,i)}runOutsideAngular(e){return this._outer.run(e)}},iw={};function tf(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 ow(t){if(t.isCheckStableRunning||t.callbackScheduled)return;t.callbackScheduled=!0;function e(){Jp(()=>{t.callbackScheduled=!1,bp(t),t.isCheckStableRunning=!0,tf(t),t.isCheckStableRunning=!1})}t.scheduleInRootZone?Zone.root.run(()=>{e()}):t._outer.run(()=>{e()}),bp(t)}function rw(t){let e=()=>{ow(t)},n=nw++;t._inner=t._inner.fork({name:"angular",properties:{[ef]:!0,[Js]:n,[Js+n]:!0},onInvokeTask:(i,o,r,s,a,c)=>{if(sw(c))return i.invokeTask(r,s,a,c);try{return qg(t),i.invokeTask(r,s,a,c)}finally{(t.shouldCoalesceEventChangeDetection&&s.type==="eventTask"||t.shouldCoalesceRunChangeDetection)&&e(),Wg(t)}},onInvoke:(i,o,r,s,a,c,l)=>{try{return qg(t),i.invoke(r,s,a,c,l)}finally{t.shouldCoalesceRunChangeDetection&&!t.callbackScheduled&&!aw(c)&&e(),Wg(t)}},onHasTask:(i,o,r,s)=>{i.hasTask(r,s),o===r&&(s.change=="microTask"?(t._hasPendingMicrotasks=s.microTask,bp(t),tf(t)):s.change=="macroTask"&&(t.hasPendingMacrotasks=s.macroTask))},onHandleError:(i,o,r,s)=>(i.handleError(r,s),t.runOutsideAngular(()=>t.onError.emit(s)),!1)})}function bp(t){t._hasPendingMicrotasks||(t.shouldCoalesceEventChangeDetection||t.shouldCoalesceRunChangeDetection)&&t.callbackScheduled===!0?t.hasPendingMicrotasks=!0:t.hasPendingMicrotasks=!1}function qg(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function Wg(t){t._nesting--,tf(t)}var ea=class{hasPendingMicrotasks=!1;hasPendingMacrotasks=!1;isStable=!0;onUnstable=new Gi;onMicrotaskEmpty=new Gi;onStable=new Gi;onError=new Gi;run(e,n,i){return e.apply(n,i)}runGuarded(e,n,i){return e.apply(n,i)}runOutsideAngular(e){return e()}runTask(e,n,i,o){return e.apply(n,i)}};function sw(t){return V0(t,"__ignore_ng_zone__")}function aw(t){return V0(t,"__scheduler_tick__")}function V0(t,e){return!Array.isArray(t)||t.length!==1?!1:t[0]?.data?.[e]===!0}var Qn=class{_console=console;handleError(e){this._console.error("ERROR",e)}};function j0(t){return $0(t)?t:new xp(t)}function $0(t){return t instanceof Error||typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.message=="string"}var xp=class extends Error{constructor(e){super(String(e),{cause:e}),this.name="ErrorBoundaryWrappedError"}},Co=new He("",{factory:()=>{let t=N(kn),e=N(fi),n;return i=>{t.runOutsideAngular(()=>{e.destroyed&&!n?setTimeout(()=>{throw i}):(n??=e.get(Qn),n.handleError(i))})}}}),B0={provide:sr,useValue:()=>{let t=N(Qn,{optional:!0})},multi:!0},cw=new He("",{factory:()=>{let t=N(wn).defaultView;if(!t)return;let e=N(Co),n=r=>{e(r.reason),r.preventDefault()},i=r=>{r.error?e(r.error):e(new Error(r.message,{cause:r})),r.preventDefault()},o=()=>{t.addEventListener("unhandledrejection",n),t.addEventListener("error",i)};typeof Zone<"u"?Zone.root.run(o):o(),N(pt).onDestroy(()=>{t.removeEventListener("error",i),t.removeEventListener("unhandledrejection",n)})}});function nf(){return Zr([n0(()=>{N(cw)})])}function O(t,e){let[n,i,o]=Yu(t,e?.equal),r=n,s=r[fn];return r.set=i,r.update=o,r.asReadonly=of.bind(r),r}function of(){let t=this[fn];if(t.readonlyFn===void 0){let e=()=>this();e[fn]=t,t.readonlyFn=e}return t.readonlyFn}var da=new He("",{factory:()=>lw}),lw="ng";var hl=new He(""),ua=new He("",{providedIn:"platform",factory:()=>"unknown"});var gl=new He("",{factory:()=>N(wn).body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});var pa=(()=>{class t{view;node;constructor(n,i){this.view=n,this.node=i}static __NG_ELEMENT_ID__=dw}return t})();function dw(){return new pa(Ue(),Bn())}var ho=class{},fa=new He("",{factory:()=>!0});var rf=new He(""),yl=(()=>{class t{static \u0275prov=xe({token:t,providedIn:"root",factory:()=>new Cp})}return t})(),Cp=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,i=this.queues.get(n);i.has(e)&&(i.delete(e),e.dirty&&this.dirtyEffectCount--)}enqueue(e){let n=e.zone;this.queues.has(n)||this.queues.set(n,new Set);let i=this.queues.get(n);i.has(e)||i.add(e)}flush(){for(;this.dirtyEffectCount>0;){let e=!1;for(let[n,i]of this.queues)n===null?e||=this.flushQueue(i):e||=n.run(()=>this.flushQueue(i));e||(this.dirtyEffectCount=0)}}flushQueue(e){let n=!1;for(let i of e)i.dirty&&(this.dirtyEffectCount--,n=!0,i.run());return n}},Hc=class{[fn];constructor(e){this[fn]=e}destroy(){this[fn].destroy()}};function se(t,e){let n=e?.injector??N(Mn),i=e?.manualCleanup!==!0?n.get(pt):null,o,r=n.get(pa,null,{optional:!0}),s=n.get(ho);return r!==null?(o=U0(r.view,s,t),i instanceof $c&&i._lView===r.view&&(i=null)):o=fw(t,n.get(yl),s),o.injector=n,i!==null&&(o.onDestroyFns=[i.onDestroy(()=>o.destroy())]),new Hc(o)}var H0=K(V({},Zu),{cleanupFns:void 0,zone:null,onDestroyFns:null,run(){let t=Xs(!1);try{Qu(this)}finally{Xs(t)}},cleanup(){if(!this.cleanupFns?.length)return;let t=ge(null);try{for(;this.cleanupFns.length;)this.cleanupFns.pop()()}finally{this.cleanupFns=[],ge(t)}}}),uw=K(V({},H0),{consumerMarkedDirty(){this.scheduler.schedule(this),this.notifier.notify(12)},destroy(){if(Wo(this),this.onDestroyFns!==null)for(let t of this.onDestroyFns)t();this.cleanup(),this.scheduler.remove(this)}}),pw=K(V({},H0),{consumerMarkedDirty(){this.view[Te]|=8192,fr(this.view),this.notifier.notify(13)},destroy(){if(Wo(this),this.onDestroyFns!==null)for(let t of this.onDestroyFns)t();this.cleanup(),this.view[Wi]?.delete(this)}});function U0(t,e,n){let i=Object.create(pw);return i.view=t,i.zone=typeof Zone<"u"?Zone.current:null,i.notifier=e,i.userFn=n,i.fn=z0(i,n),t[Wi]??=new Set,t[Wi].add(i),i.consumerMarkedDirty(i),i}function fw(t,e,n){let i=Object.create(uw);return i.userFn=t,i.fn=z0(i,t),i.scheduler=e,i.notifier=n,i.zone=typeof Zone<"u"?Zone.current:null,i.scheduler.add(i),i.notifier.notify(12),i}function z0(t,e){return()=>{e(n=>(t.cleanupFns??=[]).push(n))}}var Qf=Symbol("InputSignalNode#UNSET"),Ty=K(V({},Ws),{transformFn:void 0,applyValueToInputSignal(t,e){Yo(t,e)}});function Xf(t){return{toString:t}.toString()}var at=(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})(at||{}),Dl=class{previousValue;currentValue;firstChange;constructor(e,n,i){this.previousValue=e,this.currentValue=n,this.firstChange=i}isFirstChange(){return this.firstChange}};function Dy(t,e,n,i){e!==null?e.applyValueToInputSignal(e,i):t[n]=i}var My=null,Jf=(()=>{My=G0;let t=()=>G0;return t.ngInherit=!0,t})();function Dw(){return My}function G0(t){return t.type.prototype.ngOnChanges&&(t.setInput=kw),Mw}function Mw(){let t=ky(this),e=t?.current;if(e){let n=t.previous;if(n===rr)t.previous=e;else for(let i in e)n[i]=e[i];t.current=null,this.ngOnChanges(e)}}function kw(t,e,n,i,o){let r=this.declaredInputs[i],s=ky(t)||Iw(t,{previous:rr,current:null}),a=s.current||(s.current={}),c=s.previous,l=c[r];a[r]=new Dl(l&&l.currentValue,n,c===rr),Dy(t,e,o,n)}var ff="__ngSimpleChanges__";function ky(t){return Object.hasOwn(t,ff)&&t[ff]||null}function Iw(t,e){return t[ff]=e}var q0=[];var ht=function(t,e=null,n){for(let i=0;i<q0.length;i++){let o=q0[i];o(t,e,n)}};function Nw(t,e,n){let{ngOnChanges:i,ngOnInit:o,ngDoCheck:r}=e.type.prototype;if(i){let s=Dw()(e);(n.preOrderHooks??=[]).push(t,s),(n.preOrderCheckHooks??=[]).push(t,s)}o&&(n.preOrderHooks??=[]).push(0-t,o),r&&((n.preOrderHooks??=[]).push(t,r),(n.preOrderCheckHooks??=[]).push(t,r))}function Iy(t,e){for(let n=e.directiveStart,i=e.directiveEnd;n<i;n++){let r=t.data[n].type.prototype,{ngAfterContentInit:s,ngAfterContentChecked:a,ngAfterViewInit:c,ngAfterViewChecked:l,ngOnDestroy:p}=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)),p!=null&&(t.destroyHooks??=[]).push(n,p)}}function Cl(t,e,n){Ny(t,e,3,n)}function El(t,e,n,i){(t[Te]&3)===n&&Ny(t,e,n,i)}function sf(t,e){let n=t[Te];(n&3)===e&&(n&=16383,n+=1,t[Te]=n)}function Ny(t,e,n,i){let o=i!==void 0?t[ar]&65535:0,r=i??-1,s=e.length-1,a=0;for(let c=o;c<s;c++)if(typeof e[c+1]=="number"){if(a=e[c],i!=null&&a>=i)break}else e[c]<0&&(t[ar]+=65536),(a<r||r==-1)&&(Ow(t,n,e,c),t[ar]=(t[ar]&4294901760)+c+2),c++}function W0(t,e){ht(at.LifecycleHookStart,t,e);let n=ge(null);try{e.call(t)}finally{ge(n),ht(at.LifecycleHookEnd,t,e)}}function Ow(t,e,n,i){let o=n[i]<0,r=n[i+1],s=o?-n[i]:n[i],a=t[s];o?t[Te]>>14<t[ar]>>16&&(t[Te]&3)===e&&(t[Te]+=16384,W0(a,r)):W0(a,r)}var ss=-1,ga=class{factory;name;injectImpl;resolving=!1;canSeeViewProviders;multi;componentProviders;index;providerFactory;constructor(e,n,i,o){this.factory=e,this.name=o,this.canSeeViewProviders=n,this.injectImpl=i}};function Pw(t){return(t.flags&8)!==0}function Aw(t){return(t.flags&16)!==0}function Rw(t,e,n){let i=0;for(;i<n.length;){let o=n[i];if(typeof o=="number"){if(o!==0)break;i++;let r=n[i++],s=n[i++],a=n[i++];t.setAttribute(e,s,a,r)}else{let r=o,s=n[++i];Fw(r)?t.setProperty(e,r,s):t.setAttribute(e,r,s),i++}}return i}function Lw(t){return t===3||t===4||t===6}function Fw(t){return t.charCodeAt(0)===64}function $l(t,e){if(!(e===null||e.length===0))if(t===null||t.length===0)t=e.slice();else{let n=-1;for(let i=0;i<e.length;i++){let o=e[i];typeof o=="number"?n=o:n===0||(n===-1||n===2?Y0(t,n,o,null,e[++i]):Y0(t,n,o,null,null))}}return t}function Y0(t,e,n,i,o){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){o!==null&&(t[r+1]=o);return}r++,o!==null&&r++}s!==-1&&(t.splice(s,0,e),r=s+1),t.splice(r++,0,n),o!==null&&t.splice(r++,0,o)}function Oy(t){return t!==ss}function Ml(t){return t&32767}function Vw(t){return t>>16}function kl(t,e){let n=Vw(t),i=e;for(;n>0;)i=i[yo],n--;return i}var mf=!0;function K0(t){let e=mf;return mf=t,e}var jw=256,Py=jw-1,Ay=5,$w=0,Ai={};function Bw(t,e,n){let i;typeof n=="string"?i=n.charCodeAt(0)||0:Object.hasOwn(n,nr)&&(i=n[nr]),i==null&&(i=n[nr]=$w++);let o=i&Py,r=1<<o;e.data[t+(o>>Ay)]|=r}function Ry(t,e){let n=Ly(t,e);if(n!==-1)return n;let i=e[_e];i.firstCreatePass&&(t.injectorIndex=e.length,af(i.data,t),af(e,null),af(i.blueprint,null));let o=em(t,e),r=t.injectorIndex;if(Oy(o)){let s=Ml(o),a=kl(o,e),c=a[_e].data;for(let l=0;l<8;l++)e[r+l]=a[s+l]|c[s+l]}return e[r+8]=o,r}function af(t,e){t.push(0,0,0,0,0,0,0,0,e)}function Ly(t,e){return t.injectorIndex===-1||t.parent&&t.parent.injectorIndex===t.injectorIndex||e[t.injectorIndex+8]===null?-1:t.injectorIndex}function em(t,e){if(t.parent&&t.parent.injectorIndex!==-1)return t.parent.injectorIndex;let n=0,i=null,o=e;for(;o!==null;){if(i=By(o),i===null)return ss;if(n++,o=o[yo],i.injectorIndex!==-1)return i.injectorIndex|n<<16}return ss}function Hw(t,e,n){Bw(t,e,n)}function Fy(t,e,n){if(n&8||t!==void 0)return t;Zc(e,"NodeInjector")}function Vy(t,e,n,i){if(n&8&&i===void 0&&(i=null),(n&3)===0){let o=t[Ki],r=Fn(void 0);try{return o?o.get(e,i,n&8):kp(e,i,n&8)}finally{Fn(r)}}return Fy(i,e,n)}function jy(t,e,n,i=0,o){if(t!==null){if(e[Te]&2048&&!(i&2)){let s=qw(t,e,n,i,Ai);if(s!==Ai)return s}let r=$y(t,e,n,i,Ai);if(r!==Ai)return r}return Vy(e,n,i,o)}function $y(t,e,n,i,o){let r=zw(n);if(typeof r=="function"){if(!Zp(e,t,i))return i&1?Fy(o,n,i):Vy(e,n,i,o);try{let s;if(s=r(i),s==null&&!(i&8))Zc(n);else return s}finally{Qp()}}else if(typeof r=="number"){let s=null,a=Ly(t,e),c=ss,l=i&1?e[jn][In]:null;for((a===-1||i&4)&&(c=a===-1?em(t,e):e[a+8],c===ss||!Q0(i,!1)?a=-1:(s=e[_e],a=Ml(c),e=kl(c,e)));a!==-1;){let p=e[_e];if(Z0(r,a,p.data)){let f=Uw(a,e,n,s,i,l);if(f!==Ai)return f}c=e[a+8],c!==ss&&Q0(i,e[_e].data[a+8]===l)&&Z0(r,a,e)?(s=p,a=Ml(c),e=kl(c,e)):a=-1}}return o}function Uw(t,e,n,i,o,r){let s=e[_e],a=s.data[t+8],c=i==null?bo(a)&&mf:i!=s&&(a.type&3)!==0,l=o&1&&r===a,p=wl(a,s,n,c,l);return p!==null?Il(e,s,p,a,o):Ai}function wl(t,e,n,i,o){let r=t.providerIndexes,s=e.data,a=r&1048575,c=t.directiveStart,l=t.directiveEnd,p=r>>20,f=i?a:a+p,_=o?a+p:l;for(let x=f;x<_;x++){let C=s[x];if(x<c&&n===C||x>=c&&C.type===n)return x}if(o){let x=s[c];if(x&&ur(x)&&x.type===n)return c}return null}function Il(t,e,n,i,o){let r=t[n],s=e.data;if(r instanceof ga){let a=r;if(a.resolving)throw Mp("");let c=K0(a.canSeeViewProviders);a.resolving=!0;let l=s[n].type||s[n],p,f=a.injectImpl?Fn(a.injectImpl):null,_=Zp(t,i,0);try{r=t[n]=a.factory(void 0,o,s,t,i),e.firstCreatePass&&n>=i.directiveStart&&Nw(n,s[n],e)}finally{f!==null&&Fn(f),K0(c),a.resolving=!1,Qp()}}return r}function zw(t){if(typeof t=="string")return t.charCodeAt(0)||0;let e=Object.hasOwn(t,nr)?t[nr]:void 0;return typeof e=="number"?e>=0?e&Py:Gw:e}function Z0(t,e,n){let i=1<<t;return!!(n[e+(t>>Ay)]&i)}function Q0(t,e){return!(t&2)&&!(t&1&&e)}var Zi=class{_tNode;_lView;constructor(e,n){this._tNode=e,this._lView=n}get(e,n,i){return jy(this._tNode,this._lView,e,Xo(i),n)}};function Gw(){return new Zi(Bn(),Ue())}function qw(t,e,n,i,o){let r=t,s=e;for(;r!==null&&s!==null&&s[Te]&2048&&!ts(s);){let a=$y(r,s,n,i|2,Ai);if(a!==Ai)return a;i&=-5;let c=r.parent;if(!c){let l=s[Rp];if(l){let p=l.get(n,Ai,i);if(p!==Ai)return p}c=By(s),s=s[yo]}r=c}return o}function By(t){let e=t[_e],n=e.type;return n===2?e.declTNode:n===1?t[In]:null}function yr(t){return{token:t.token,providedIn:t.autoProvided===!1?null:"root",factory:t.factory,value:void 0}}function Ww(){return us(Bn(),Ue())}function us(t,e){return new Bt(ei(t,e))}var Bt=(()=>{class t{nativeElement;constructor(n){this.nativeElement=n}static __NG_ELEMENT_ID__=Ww}return t})();function Yw(t){return t instanceof Bt?t.nativeElement:t}function Kw(){return this._results[Symbol.iterator]()}var Nl=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 Zn}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 i=e0(e);(this._changesDetected=!Jg(this._results,i,n))&&(this._results=i,this.length=i.length,this.last=i[this.length-1],this.first=i[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]=Kw};function Hy(t){return(t.flags&128)===128}var tm=(function(t){return t[t.OnPush=0]="OnPush",t[t.Eager=1]="Eager",t[t.Default=1]="Default",t})(tm||{}),Uy=new Map,Zw=0;function Qw(){return Zw++}function Xw(t){Uy.set(t[oa],t)}function hf(t){Uy.delete(t[oa])}var X0="__ngContext__";function as(t,e){vo(e)?(t[X0]=e[oa],Xw(e)):t[X0]=e}function zy(t){return qy(t[Jr])}function Gy(t){return qy(t[Xn])}function qy(t){for(;t!==null&&!Jn(t);)t=t[Xn];return t}var gf;function nm(t){gf=t}function im(){if(gf!==void 0)return gf;if(typeof document<"u")return document;throw new Ne(210,!1)}var Wy="r";var Yy="di";var Ky=!1,Zy=new He("",{factory:()=>Ky});var J0=new WeakMap;function Jw(t,e){if(t==null||typeof t!="object")return;let n=J0.get(t);n||(n=new WeakSet,J0.set(t,n)),n.add(e)}var eS=(t,e,n,i)=>{};function tS(t,e,n,i){eS(t,e,n,i)}function om(t){return(t.flags&32)===32}var nS=()=>null;function Qy(t,e,n=!1){return nS(t,e,n)}function Xy(t,e){let n=t.contentQueries;if(n!==null){let i=ge(null);try{for(let o=0;o<n.length;o+=2){let r=n[o],s=n[o+1];if(s!==-1){let a=t.data[s];ul(r),a.contentQueries(2,e[s],s)}}}finally{ge(i)}}}function yf(t,e,n){ul(0);let i=ge(null);try{e(t,n)}finally{ge(i)}}function rm(t,e,n){if(Fp(e)){let i=ge(null);try{let o=e.directiveStart,r=e.directiveEnd;for(let s=o;s<r;s++){let a=t.data[s];if(a.contentQueries){let c=n[s];a.contentQueries(1,c,s)}}}finally{ge(i)}}}var vi=(function(t){return t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t[t.ExperimentalIsolatedShadowDom=4]="ExperimentalIsolatedShadowDom",t})(vi||{});var iS={"http://www.w3.org/2000/svg":er,"http://www.w3.org/1998/Math/MathML":il},_l;function oS(){if(_l===void 0&&(_l=null,go.trustedTypes))try{_l=go.trustedTypes.createPolicy("angular",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch{}return _l}function Bl(t){return oS()?.createHTML(t)||t}var vl;function rS(){if(vl===void 0&&(vl=null,go.trustedTypes))try{vl=go.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch{}return vl}function ey(t){return rS()?.createHTML(t)||t}var Qi=class{changingThisBreaksApplicationSecurity;constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${Uc})`}},_f=class extends Qi{getTypeName(){return"HTML"}},vf=class extends Qi{getTypeName(){return"Style"}},bf=class extends Qi{getTypeName(){return"Script"}},xf=class extends Qi{getTypeName(){return"URL"}},Cf=class extends Qi{getTypeName(){return"ResourceURL"}};function ni(t){return t instanceof Qi?t.changingThisBreaksApplicationSecurity:t}function Ji(t,e){let n=Jy(t);if(n!=null&&n!==e){if(n==="ResourceURL"&&e==="URL")return!0;throw new Error(`Required a safe ${e}, got a ${n} (see ${Uc})`)}return n===e}function Jy(t){return t instanceof Qi&&t.getTypeName()||null}function sm(t){return new _f(t)}function am(t){return new vf(t)}function cm(t){return new bf(t)}function lm(t){return new xf(t)}function dm(t){return new Cf(t)}function sS(t){let e=new wf(t);return aS()?new Ef(e):e}var Ef=class{inertDocumentHelper;constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e="<body><remove></remove>"+e;try{let n=new window.DOMParser().parseFromString(Bl(e),"text/html").body;return n===null?this.inertDocumentHelper.getInertBodyElement(e):(n.firstChild?.remove(),n)}catch{return null}}},wf=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=Bl(e),n}};function aS(){try{return!!new window.DOMParser().parseFromString(Bl(""),"text/html")}catch{return!1}}var cS=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function wa(t){return t=String(t),t.match(cS)?t:"unsafe:"+t}function eo(t){let e=Object.create(null);for(let n of t.split(","))e[n]=!0;return e}function Sa(...t){let e=Object.create(null);for(let n of t)for(let i in n)Object.hasOwn(n,i)&&(e[i]=!0);return e}var e_=eo("area,br,col,hr,img,wbr"),t_=eo("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),n_=eo("rp,rt"),lS=Sa(n_,t_),dS=Sa(t_,eo("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")),uS=Sa(n_,eo("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")),ty=Sa(e_,dS,uS,lS),i_=eo("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),pS=eo("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"),fS=eo("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"),mS=Sa(i_,pS,fS),hS=eo("script,style,template"),Sf=class{sanitizedSomething=!1;buf=[];sanitizeChildren(e){let n=e.firstChild,i=!0,o=[];for(;n;){if(n.nodeType===Node.ELEMENT_NODE?i=this.startElement(n):n.nodeType===Node.TEXT_NODE?this.chars(n.nodeValue):this.sanitizedSomething=!0,i&&n.firstChild){o.push(n),n=_S(n);continue}for(;n;){n.nodeType===Node.ELEMENT_NODE&&this.endElement(n);let r=yS(n);if(r){n=r;break}n=o.pop()}}return this.buf.join("")}startElement(e){let n=ny(e).toLowerCase();if(!Object.hasOwn(ty,n))return this.sanitizedSomething=!0,!Object.hasOwn(hS,n);this.buf.push("<"),this.buf.push(n);let i=e.attributes;for(let o=0;o<i.length;o++){let r=i.item(o),s=r.name,a=s.toLowerCase();if(!Object.hasOwn(mS,a)){this.sanitizedSomething=!0;continue}let c=r.value;i_[a]&&(c=wa(c)),this.buf.push(" ",s,'="',iy(c),'"')}return this.buf.push(">"),!0}endElement(e){let n=ny(e).toLowerCase();Object.hasOwn(ty,n)&&!Object.hasOwn(e_,n)&&(this.buf.push("</"),this.buf.push(n),this.buf.push(">"))}chars(e){this.buf.push(iy(e))}};function gS(t,e){return(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}function yS(t){let e=t.nextSibling;if(e&&t!==e.previousSibling)throw o_(e);return e}function _S(t){let e=t.firstChild;if(e&&gS(t,e))throw o_(e);return e}function ny(t){let e=t.nodeName;return typeof e=="string"?e:"FORM"}function o_(t){return new Error(`Failed to sanitize html because the element is clobbered: ${t.outerHTML}`)}var vS=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,bS=/([^\#-~ |!])/g;function iy(t){return t.replace(/&/g,"&").replace(vS,function(e){let n=e.charCodeAt(0),i=e.charCodeAt(1);return"&#"+((n-55296)*1024+(i-56320)+65536)+";"}).replace(bS,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"<").replace(/>/g,">")}var bl;function Hl(t,e){let n=null;try{bl=bl||sS(t);let i=e?String(e):"";n=bl.getInertBodyElement(i);let o=5,r=i;do{if(o===0)throw new Error("Failed to sanitize html because the input is unstable");o--,i=r,r=n.innerHTML,n=bl.getInertBodyElement(i)}while(i!==r);let a=new Sf().sanitizeChildren(oy(n)||n);return Bl(a)}finally{if(n){let i=oy(n)||n;for(;i.firstChild;)i.firstChild.remove()}}}function oy(t){return"content"in t&&xS(t)?t.content:null}function xS(t){return t.nodeType===Node.ELEMENT_NODE&&t.nodeName==="TEMPLATE"}var CS=/^>|^->|<!--|-->|--!>|<!-$/g,ES=/(<|>)/g,wS="\u200B$1\u200B";function SS(t){return t.replace(CS,e=>e.replace(ES,wS))}function TS(t,e){return t.createText(e)}function DS(t,e,n){t.setValue(e,n)}function MS(t,e){return t.createComment(SS(e))}function r_(t,e,n){return t.createElement(e,n)}function hr(t,e,n,i,o){t.insertBefore(e,n,i,o)}function s_(t,e,n){t.appendChild(e,n)}function ry(t,e,n,i,o){i!==null?hr(t,e,n,i,o):s_(t,e,n)}function a_(t,e,n,i){t.removeChild(null,e,n,i)}function kS(t,e,n){t.setAttribute(e,"style",n)}function IS(t,e,n){n===""?t.removeAttribute(e,"class"):t.setAttribute(e,"class",n)}function c_(t,e,n){let{mergedAttrs:i,classes:o,styles:r}=n;i!==null&&Rw(t,e,i),o!==null&&IS(t,e,o),r!==null&&kS(t,e,r)}function NS(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 Eo(t,e,n){if(e!==void 0&&n!==void 0&&OS(e,n)!==Pt.HTML)return t;let i=l_();return i?ey(i.sanitize(Pt.HTML,t)||""):Ji(t,"HTML")?ey(ni(t)):Hl(im(),or(t))}function xi(t){let e=l_();return e?e.sanitize(Pt.URL,t)||"":Ji(t,"URL")?ni(t):wa(or(t))}function l_(){let t=Ue();return t&&t[hi].sanitizer}function OS(t,e){let[n,i]=PS(t);return d0(i,e,n)}function PS(t){t=t.toLowerCase();let e=NS(t,!1);if(e[0])return e;let i=gi()===-1?null:ca(),o=i?.namespace;if(t==="#host"&&i?.type===2){let r=ei(i,Ue());if(r.tagName&&(t=r.tagName.toLowerCase()),o==null){let s=r.namespaceURI;o=s&&iS[s]}}return[o,t]}function um(t){return t.ownerDocument.defaultView}function Mt(t){return t.ownerDocument}function AS(t,e,n){let i=t.length;for(;;){let o=t.indexOf(e,n);if(o===-1)return o;if(o===0||t.charCodeAt(o-1)<=32){let r=e.length;if(o+r===i||t.charCodeAt(o+r)<=32)return o}n=o+1}}var d_="ng-template";function RS(t,e,n,i){let o=0;if(i){for(;o<e.length&&typeof e[o]=="string";o+=2)if(e[o]==="class"&&AS(e[o+1].toLowerCase(),n,0)!==-1)return!0}else if(pm(t))return!1;if(o=e.indexOf(1,o),o>-1){let r;for(;++o<e.length&&typeof(r=e[o])=="string";)if(r.toLowerCase()===n)return!0}return!1}function pm(t){return t.type===4&&t.value!==d_}function LS(t,e,n){let i=t.type===4&&!n?d_:t.value;return e===i}function FS(t,e,n){let i=4,o=t.attrs,r=o!==null?$S(o):0,s=!1;for(let a=0;a<e.length;a++){let c=e[a];if(typeof c=="number"){if(!s&&!yi(i)&&!yi(c))return!1;if(s&&yi(c))continue;s=!1,i=c|i&1;continue}if(!s)if(i&4){if(i=2|i&1,c!==""&&!LS(t,c,n)||c===""&&e.length===1){if(yi(i))return!1;s=!0}}else if(i&8){if(o===null||!RS(t,o,c,n)){if(yi(i))return!1;s=!0}}else{let l=e[++a],p=VS(c,o,pm(t),n);if(p===-1){if(yi(i))return!1;s=!0;continue}if(l!==""){let f;if(p>r?f="":f=o[p+1].toLowerCase(),i&2&&l!==f){if(yi(i))return!1;s=!0}}}}return yi(i)||s}function yi(t){return(t&1)===0}function VS(t,e,n,i){if(e===null)return-1;let o=0;if(i||!n){let r=!1;for(;o<e.length;){let s=e[o];if(s===t)return o;if(s===3||s===6)r=!0;else if(s===1||s===2){let a=e[++o];for(;typeof a=="string";)a=e[++o];continue}else{if(s===4)break;if(s===0){o+=4;continue}}o+=r?1:2}return-1}else return BS(e,t)}function jS(t,e,n=!1){for(let i=0;i<e.length;i++)if(FS(t,e[i],n))return!0;return!1}function $S(t){for(let e=0;e<t.length;e++){let n=t[e];if(Lw(n))return e}return t.length}function BS(t,e){let n=t.indexOf(4);if(n>-1)for(n++;n<t.length;){let i=t[n];if(typeof i=="number")return-1;if(i===e)return n;n++}return-1}function sy(t,e){return t?":not("+e.trim()+")":e}function HS(t){let e=t[0],n=1,i=2,o="",r=!1;for(;n<t.length;){let s=t[n];if(typeof s=="string")if(i&2){let a=t[++n];o+="["+s+(a.length>0?'="'+a+'"':"")+"]"}else i&8?o+="."+s:i&4&&(o+=" "+s);else o!==""&&!yi(s)&&(e+=sy(r,o),o=""),i=s,r=r||!yi(i);n++}return o!==""&&(e+=sy(r,o)),e}function US(t){return t.map(HS).join(",")}function zS(t){let e=[],n=[],i=1,o=2;for(;i<t.length;){let r=t[i];if(typeof r=="string")o===2?r!==""&&e.push(r,t[++i]):o===8&&n.push(r);else{if(!yi(o))break;o=r}i++}return n.length&&e.push(1,...n),e}var Sn={},Ri=(function(t){return t[t.Important=1]="Important",t[t.DashCase=2]="DashCase",t})(Ri||{}),GS;function fm(t,e){return GS(t,e)}var mm=new Set;var iH=typeof document<"u"&&typeof document?.documentElement?.getAnimations=="function";var Tf=new WeakMap;function u_(t){return t?t[yo]??t:null}var os=new WeakSet;function qS(t,e,n){let i=Tf.get(t);if(!i||i.length===0)return;let o=e.parentNode,r=e.previousSibling,s=u_(n);for(let a=i.length-1;a>=0;a--){let{el:c,declarationView:l}=i[a],p=c.parentNode;c===e?(i.splice(a,1),os.add(c),c.dispatchEvent(new CustomEvent("animationend",{detail:{cancel:!0}}))):r&&c===r?(i.splice(a,1),c.dispatchEvent(new CustomEvent("animationend",{detail:{cancel:!0}})),c.parentNode?.removeChild(c)):p&&o&&p!==o&&(s===null||l===null||s===l)&&(i.splice(a,1),c.dispatchEvent(new CustomEvent("animationend",{detail:{cancel:!0}})),c.parentNode?.removeChild(c))}}function WS(t,e,n){let i=u_(n),o=Tf.get(t);o?o.some(r=>r.el===e)||o.push({el:e,declarationView:i}):Tf.set(t,[{el:e,declarationView:i}])}var Ul=(function(t){return t[t.CHANGE_DETECTION=0]="CHANGE_DETECTION",t[t.AFTER_NEXT_RENDER=1]="AFTER_NEXT_RENDER",t})(Ul||{}),to=new He(""),ay=new Set;function _r(t){ay.has(t)||(ay.add(t),performance?.mark?.("mark_feature_usage",{detail:{feature:t}}))}var hm=(()=>{class t{impl=null;execute(){this.impl?.execute()}static \u0275prov=xe({token:t,providedIn:"root",factory:()=>new t})}return t})(),p_=[0,1,2,3],f_=(()=>{class t{ngZone=N(kn);scheduler=N(ho);errorHandler=N(Qn,{optional:!0});sequences=new Set;deferredRegistrations=new Set;executing=!1;constructor(){N(to,{optional:!0})}execute(){let n=this.sequences.size>0;n&&ht(at.AfterRenderHooksStart),this.executing=!0;for(let i of p_)for(let o of this.sequences)if(!(o.erroredOrDestroyed||!o.hooks[i]))try{o.pipelinedValue=this.ngZone.runOutsideAngular(()=>this.maybeTrace(()=>{let r=o.hooks[i];return r(o.pipelinedValue)},o.snapshot))}catch(r){o.erroredOrDestroyed=!0,this.errorHandler?.handleError(r)}this.executing=!1;for(let i of this.sequences)i.afterRun(),i.once&&(this.sequences.delete(i),i.destroy());for(let i of this.deferredRegistrations)this.sequences.add(i);this.deferredRegistrations.size>0&&this.scheduler.notify(7),this.deferredRegistrations.clear(),n&&ht(at.AfterRenderHooksEnd)}register(n){let{view:i}=n;i!==void 0?((i[cr]??=[]).push(n),fr(i),i[Te]|=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,i){return i?i.run(Ul.AFTER_NEXT_RENDER,n):n()}static \u0275prov=xe({token:t,providedIn:"root",factory:()=>new t})}return t})(),Ol=class{impl;hooks;view;once;snapshot;erroredOrDestroyed=!1;pipelinedValue=void 0;unregisterOnDestroy;constructor(e,n,i,o,r,s=null){this.impl=e,this.hooks=n,this.view=i,this.once=o,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?.[cr];e&&(this.view[cr]=e.filter(n=>n!==this))}};function no(t,e){let n=e?.injector??N(Mn);return _r("NgAfterNextRender"),KS(t,n,e,!0)}function YS(t){return t instanceof Function?[void 0,void 0,t,void 0]:[t.earlyRead,t.write,t.mixedReadWrite,t.read]}function KS(t,e,n,i){let o=e.get(hm);o.impl??=e.get(f_);let r=e.get(to,null,{optional:!0}),s=n?.manualCleanup!==!0?e.get(pt):null,a=e.get(pa,null,{optional:!0}),c=new Ol(o.impl,YS(t),a?.view,i,s,r?.snapshot(null));return o.impl.register(c),c}var Df=null,m_=null;function cy(t,e,n,i){Df?.maybeQueueEnterAnimation(t,e,n,i)}function ly(t,e,n,i){Df===null?i(!1):Df.runLeaveAnimationsWithCallback(t,e,n,i)}function ZS(t){m_?.initViewDetachAnimations(t)}function QS(t){m_?.clearViewDetachAnimations(t)}function rs(t,e,n,i,o,r,s,a){if(o!=null){let c,l=!1;Jn(o)?c=o:vo(o)&&(l=!0,o=o[mi]);let p=mn(o);t===0&&i!==null?(cy(a,i,r,n),s==null?s_(e,i,p):hr(e,i,p,s||null,!0)):t===1&&i!==null?(hr(e,i,p,s||null,!0),qS(r,p,a),os.has(p)||cy(a,i,r,n)):t===2?(a?.[c0]?.leave?.has(r.index)&&WS(r,p,a),os.delete(p),ly(a,r,n,f=>{if(os.has(p)){os.delete(p);return}a_(e,p,l,f)})):t===3&&(os.delete(p),ly(a,r,n,()=>{e.destroyNode(p)})),c!=null&&dT(e,t,n,c,r,i,s)}}function XS(t,e){h_(t,e),e[mi]=null,e[In]=null}function JS(t,e,n,i,o,r){i[mi]=o,i[In]=e,Gl(t,i,n,1,o,r)}function h_(t,e){e[hi].changeDetectionScheduler?.notify(9),Gl(t,e,e[It],2,null,null)}function eT(t){let e=t[Jr];if(!e)return cf(t[_e],t);for(;e;){let n=null;if(vo(e))n=e[Jr];else{let i=e[$t];i&&(n=i)}if(!n){for(;e&&!e[Xn]&&e!==t;)vo(e)&&cf(e[_e],e),e=e[qt];e===null&&(e=t),vo(e)&&cf(e[_e],e),n=e&&e[Xn]}e=n}}function gm(t,e){let n=t[dr],i=n.indexOf(e);n.splice(i,1)}function zl(t,e){if(pr(e))return;let n=e[It];n.destroyNode&&Gl(t,e,n,3,null,null),eT(e)}function cf(t,e){if(pr(e))return;let n=ge(null);try{e[Te]&=-129,e[Te]|=256,e[$n]&&Wo(e[$n]),nT(t,e),tT(t,e),e[_e].type===1&&e[It].destroy();let i=e[_o];if(i!==null&&Jn(e[qt])){i!==e[qt]&&gm(i,e);let o=e[Oi];o!==null&&o.detachView(t)}hf(e)}finally{ge(n)}}function tT(t,e){let n=t.cleanup,i=e[Xr];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?i[a]():i[-a].unsubscribe(),s+=2}else{let a=i[n[s+1]];n[s].call(a)}i!==null&&(e[Xr]=null);let o=e[qi];if(o!==null){e[qi]=null;for(let s=0;s<o.length;s++){let a=o[s];a()}}let r=e[Wi];if(r!==null){e[Wi]=null;for(let s of r)s.destroy()}}function nT(t,e){let n;if(t!=null&&(n=t.destroyHooks)!=null)for(let i=0;i<n.length;i+=2){let o=e[n[i]];if(!(o instanceof ga)){let r=n[i+1];if(Array.isArray(r))for(let s=0;s<r.length;s+=2){let a=o[r[s]],c=r[s+1];ht(at.LifecycleHookStart,a,c);try{c.call(a)}finally{ht(at.LifecycleHookEnd,a,c)}}else{ht(at.LifecycleHookStart,o,r);try{r.call(o)}finally{ht(at.LifecycleHookEnd,o,r)}}}}}function iT(t,e,n){if(e===null)throw new Ne(510,!1);return oT(t,e.parent,n)}function oT(t,e,n){let i=e;for(;i!==null&&i.type&168;)e=i,i=e.parent;if(i===null)return n[mi];if(bo(i)){let{encapsulation:o}=t.data[i.directiveStart+i.componentOffset];if(o===vi.None||o===vi.Emulated)return null}return ei(i,n)}function rT(t,e,n){return aT(t,e,n)}function sT(t,e,n){return t.type&40?ei(t,n):null}var aT=sT,dy;function ym(t,e,n,i){let o=iT(t,i,e),r=e[It],s=i.parent||e[In],a=rT(s,i,e);if(o!=null)if(Array.isArray(n))for(let c=0;c<n.length;c++)ry(r,o,n[c],a,!1);else ry(r,o,n,a,!1);dy!==void 0&&dy(r,i,e,n,o)}function ma(t,e){if(e!==null){let n=e.type;if(n&3)return ei(e,t);if(n&4)return Mf(-1,t[e.index]);if(n&8){let i=e.child;if(i!==null)return ma(t,i);{let o=t[e.index];return Jn(o)?Mf(-1,o):mn(o)}}else{if(n&128)return ma(t,e.next);if(n&32)return fm(e,t)()||mn(t[e.index]);{let i=g_(t,e);if(i!==null){if(Array.isArray(i))return i[0];let o=Yi(t[jn]);return ma(o,i)}else return ma(t,e.next)}}}return null}function g_(t,e){if(e!==null){let i=t[jn][In],o=e.projection;return i.projection[o]}return null}function Mf(t,e){let n=$t+t+1;if(n<e.length){let i=e[n],o=i[_e].firstChild;if(o!==null)return ma(i,o)}return e[lr]}function _m(t,e,n,i,o,r,s){for(;n!=null;){let a=i[Ki];if(n.type===128){n=n.next;continue}let c=i[n.index],l=n.type;if(s&&e===0&&(c&&as(mn(c),i),n.flags|=2),!om(n))if(l&8)_m(t,e,n.child,i,o,r,!1),rs(e,t,a,o,c,n,r,i);else if(l&32){let p=fm(n,i),f;for(;f=p();)rs(e,t,a,o,f,n,r,i);rs(e,t,a,o,c,n,r,i)}else l&16?lT(t,e,i,n,o,r):rs(e,t,a,o,c,n,r,i);n=s?n.projectionNext:n.next}}function Gl(t,e,n,i,o,r){t.type===3?cT(n,i,e,o,r):_m(n,i,t.firstChild,e,o,r,!1)}function cT(t,e,n,i,o){let s=n[_e].firstChild,a=s.next,c=mn(n[s.index]),l=mn(n[a.index]),p=a.index+1,f=n[p];if(e===1||e===0)i!==null&&(f&&f.hasChildNodes()?hr(t,i,f,o,!0):(hr(t,i,c,o,!0),hr(t,i,l,o,!0)));else if(e===2){if(f||(f=document.createDocumentFragment(),n[p]=f),c&&c.parentNode===f)return;let _=c;for(;_!==null;){let x=_.nextSibling;if(f.appendChild(_),_===l)break;_=x}}}function lT(t,e,n,i,o,r){let s=n[jn],c=s[In].projection[i.projection];if(Array.isArray(c))for(let l=0;l<c.length;l++){let p=c[l];rs(e,t,n[Ki],o,p,i,r,n)}else{let l=c,p=s[qt];Hy(i)&&(l.flags|=128),_m(t,e,l,p,o,r,!0)}}function dT(t,e,n,i,o,r,s){let a=i[lr],c=mn(i);if(a!==c&&rs(e,t,n,r,a,o,s),(i[Te]&4)===0)for(let l=$t;l<i.length;l++){let p=i[l];Gl(p[_e],p,t,e,r,a)}}function uT(t,e,n,i,o){if(e)o?t.addClass(n,i):t.removeClass(n,i);else{let r=i.indexOf("-")===-1?void 0:Ri.DashCase;o==null?t.removeStyle(n,i,r):(typeof o=="string"&&o.endsWith("!important")&&(o=o.slice(0,-10),r|=Ri.Important),t.setStyle(n,i,o,r))}}function vm(t,e,n,i,o,r,s,a,c,l,p){let f=Yt+i,_=f+o,x=pT(f,_),C=typeof l=="function"?l():l;return x[_e]={type:t,blueprint:x,template:n,queries:null,viewQuery:a,declTNode:e,data:x.slice().fill(null,f),bindingStartIndex:f,expandoStartIndex:_,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:p}}function pT(t,e){let n=[];for(let i=0;i<e;i++)n.push(i<t?null:Sn);return n}function fT(t){let e=t.tView;return e===null||e.incompleteFirstPass?t.tView=vm(1,null,t.template,t.decls,t.vars,t.directiveDefs,t.pipeDefs,t.viewQuery,t.schemas,t.consts,t.id):e}function bm(t,e,n,i,o,r,s,a,c,l,p){let f=e.blueprint.slice();return f[mi]=o,f[Te]=i|4|128|8|64|1024,(l!==null||t&&t[Te]&2048)&&(f[Te]|=2048),jp(f),f[qt]=f[yo]=t,f[jt]=n,f[hi]=s||t&&t[hi],f[It]=a||t&&t[It],f[Ki]=c||t&&t[Ki]||null,f[In]=r,f[oa]=Qw(),f[Qr]=p,f[Rp]=l,f[jn]=e.type==2?t[jn]:f,f}function mT(t,e,n){let i=ei(e,t),o=fT(n),r=t[hi].rendererFactory,s=xm(t,bm(t,o,null,y_(n),i,e,null,r.createRenderer(i,n),null,null,null));return t[e.index]=s}function y_(t){let e=16;return t.signals?e=4096:t.onPush&&(e=64),e}function __(t,e,n,i){if(n===0)return-1;let o=e.length;for(let r=0;r<n;r++)e.push(i),t.blueprint.push(i),t.data.push(null);return o}function xm(t,e){return t[Jr]?t[Ap][Xn]=e:t[Jr]=e,t[Ap]=e,e}function d(t=1){v_(hn(),Ue(),gi()+t,!1)}function v_(t,e,n,i){if(!i)if((e[Te]&3)===3){let r=t.preOrderCheckHooks;r!==null&&Cl(e,r,n)}else{let r=t.preOrderHooks;r!==null&&El(e,r,0,n)}xo(n)}var ql=(function(t){return t[t.None=0]="None",t[t.SignalBased=1]="SignalBased",t[t.HasDecoratorInputTransform=2]="HasDecoratorInputTransform",t})(ql||{});function kf(t,e,n,i){let o=ge(null);try{let[r,s,a]=t.inputs[n],c=null;(s&ql.SignalBased)!==0&&(c=e[r][fn]),c!==null&&c.transformFn!==void 0?i=c.transformFn(i):a!==null&&(i=a.call(e,i)),t.setInput!==null?t.setInput(e,c,i,n,r):Dy(e,c,r,i)}finally{ge(o)}}function b_(t,e,n,i,o){let r=gi(),s=i&2;try{xo(-1),s&&e.length>Yt&&v_(t,e,Yt,!1);let a=s?at.TemplateUpdateStart:at.TemplateCreateStart;ht(a,o,n),n(i,o)}finally{xo(r);let a=s?at.TemplateUpdateEnd:at.TemplateCreateEnd;ht(a,o,n)}}function Wl(t,e,n){xT(t,e,n),(n.flags&64)===64&&CT(t,e,n)}function Ta(t,e,n=ei){let i=e.localNames;if(i!==null){let o=e.index+1;for(let r=0;r<i.length;r+=2){let s=i[r+1],a=s===-1?n(e,t):t[s];t[o++]=a}}}function hT(t,e,n,i){let r=i.get(Zy,Ky)||n===vi.ShadowDom||n===vi.ExperimentalIsolatedShadowDom,s=t.selectRootElement(e,r);return gT(s),s}function gT(t){yT(t)}var yT=()=>null;function _T(t){return t==="class"?"className":t==="for"?"htmlFor":t==="formaction"?"formAction":t==="innerHtml"?"innerHTML":t==="readonly"?"readOnly":t==="tabindex"?"tabIndex":t}function vT(t,e,n,i,o,r){let s=e[_e];if(Sm(t,s,e,n,i)){bo(t)&&bT(e,t.index);return}t.type&3&&(n=_T(n)),x_(t,e,n,i,o,r)}function x_(t,e,n,i,o,r){if(t.type&3){let s=ei(t,e);i=r!=null?r(i,t.value||"",n):i,o.setProperty(s,n,i)}else t.type&12}function bT(t,e){let n=Pi(e,t);n[Te]&16||(n[Te]|=64)}function xT(t,e,n){let i=n.directiveStart,o=n.directiveEnd;bo(n)&&mT(e,n,t.data[i+n.componentOffset]),t.firstCreatePass||Ry(n,e);let r=n.initialInputs;for(let s=i;s<o;s++){let a=t.data[s],c=Il(e,t,s,n);if(as(c,e),r!==null&&TT(e,s-i,c,a,n,r),ur(a)){let l=Pi(n.index,e);l[jt]=Il(e,t,s,n)}}}function CT(t,e,n){let i=n.directiveStart,o=n.directiveEnd,r=n.index,s=T0();try{xo(r);for(let a=i;a<o;a++){let c=t.data[a],l=e[a];dl(a),(c.hostBindings!==null||c.hostVars!==0||c.hostAttrs!==null)&&ET(c,l)}}finally{xo(-1),dl(s)}}function ET(t,e){t.hostBindings!==null&&t.hostBindings(1,e)}function Cm(t,e){let n=t.directiveRegistry,i=null;if(n)for(let o=0;o<n.length;o++){let r=n[o];jS(e,r.selectors,!1)&&(i??=[],ur(r)?i.unshift(r):i.push(r))}return i}function wT(t,e,n,i,o,r){let s=ei(t,e);ST(e[It],s,r,t.value,n,i,o)}function ST(t,e,n,i,o,r,s){if(r==null)s?.(r,i||"",o),t.removeAttribute(e,o,n);else{let a=s==null?or(r):s(r,i||"",o);t.setAttribute(e,o,a,n)}}function TT(t,e,n,i,o,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];kf(i,n,c,l)}}function Em(t,e,n,i,o){let r=Yt+n,s=e[_e],a=o(s,e,t,i,n);e[r]=a,ns(t,!0);let c=t.type===2;return c?(c_(e[It],a,t),(g0()===0||es(t))&&as(a,e),y0()):as(a,e),ml()&&(!c||!om(t))&&ym(s,e,a,t),t}function wm(t){let e=t;return Wp()?b0():(e=e.parent,ns(e,!1)),e}function DT(t,e){let n=t[Ki];if(!n)return;let i;try{i=n.get(Co,null)}catch{i=null}i?.(e)}function Sm(t,e,n,i,o){let r=t.inputs?.[i],s=t.hostDirectiveInputs?.[i],a=!1;if(s)for(let c=0;c<s.length;c+=2){let l=s[c],p=s[c+1],f=e.data[l];kf(f,n[l],p,o),a=!0}if(r)for(let c of r){let l=n[c],p=e.data[c];kf(p,l,i,o),a=!0}return a}function MT(t,e){let n=Pi(e,t),i=n[_e];kT(i,n);let o=n[mi];o!==null&&n[Qr]===null&&(n[Qr]=Qy(o,n[Ki])),ht(at.ComponentStart);try{Tm(i,n,n[jt])}finally{ht(at.ComponentEnd,n[jt])}}function kT(t,e){for(let n=e.length;n<t.blueprint.length;n++)e.push(t.blueprint[n])}function Tm(t,e,n){pl(e);try{let i=t.viewQuery;i!==null&&yf(1,i,n);let o=t.template;o!==null&&b_(t,e,o,1,n),t.firstCreatePass&&(t.firstCreatePass=!1),e[Oi]?.finishViewCreation(t),t.staticContentQueries&&Xy(t,e),t.staticViewQueries&&yf(2,t.viewQuery,n);let r=t.components;r!==null&&IT(e,r)}catch(i){throw t.firstCreatePass&&(t.incompleteFirstPass=!0,t.firstCreatePass=!1),i}finally{e[Te]&=-5,fl()}}function IT(t,e){for(let n=0;n<e.length;n++)MT(t,e[n])}function Yl(t,e,n,i){let o=ge(null);try{let r=e.tView,a=t[Te]&4096?4096:16,c=bm(t,r,n,a,null,e,null,null,i?.injector??null,i?.embeddedViewInjector??null,i?.dehydratedView??null),l=t[e.index];c[_o]=l;let p=t[Oi];return p!==null&&(c[Oi]=p.createEmbeddedView(r)),Tm(r,c,n),c}finally{ge(o)}}function ya(t,e){return!e||e.firstChild===null||Hy(t)}function _a(t,e,n,i,o=!1){if(t.type===3){let r=t.firstChild,s=r.next,a=mn(e[r.index]),c=mn(e[s.index]),l=a;for(;l!==null&&(i.push(l),l!==c);)l=l.nextSibling;return i}for(;n!==null;){if(n.type===128){n=o?n.projectionNext:n.next;continue}let r=e[n.index];if(r!==null)if(Jn(r)){let a=r[lr];a!==r[mi]&&i.push(mn(r)),r[Te]&4||C_(r,i),i.push(a)}else i.push(mn(r));let s=n.type;if(s&8)_a(t,e,n.child,i);else if(s&32){let a=fm(n,e),c;for(;c=a();)i.push(c)}else if(s&16){let a=g_(e,n);if(Array.isArray(a))i.push(...a);else{let c=Yi(e[jn]);_a(c[_e],c,a,i,!0)}}n=o?n.projectionNext:n.next}return i}function C_(t,e){for(let n=$t;n<t.length;n++){let i=t[n],o=i[_e].firstChild;o!==null&&_a(i[_e],i,o,e)}}function E_(t){if(t[cr]!==null){for(let e of t[cr])e.impl.addSequence(e);t[cr].length=0}}var w_=[];function NT(t){return t[$n]??OT(t)}function OT(t){let e=w_.pop()??Object.create(AT);return e.lView=t,e}function PT(t){t.lView[$n]!==t&&(t.lView=null,w_.push(t))}var AT=K(V({},zo),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:t=>{fr(t.lView)},consumerOnSignalRead(){this.lView[$n]=this}});function RT(t){let e=t[$n]??Object.create(LT);return e.lView=t,e}var LT=K(V({},zo),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:t=>{let e=Yi(t.lView);for(;e&&!S_(e[_e]);)e=Yi(e);e&&$p(e)},consumerOnSignalRead(){this.lView[$n]=this}});function S_(t){return t.type!==2}function T_(t){if(t[Wi]===null)return;let e=!0;for(;e;){let n=!1;for(let i of t[Wi])if(i.dirty&&(n=!0,i.zone===null||Zone.current===i.zone?i.run():i.zone.run(()=>i.run()),t[Wi]===null))return;e=n&&!!(t[Te]&8192)}}var FT=100;function D_(t,e=0){let i=t[hi].rendererFactory,o=!1;o||i.begin?.();try{VT(t,e)}finally{o||i.end?.()}}function VT(t,e){let n=Yp();try{Xs(!0),If(t,e);let i=0;for(;aa(t);){if(i===FT)throw new Ne(103,!1);i++,If(t,1)}}finally{Xs(n)}}function jT(t,e,n,i){if(pr(e))return;let o=e[Te],r=!1,s=!1;pl(e);let a=!0,c=null,l=null;r||(S_(t)?(l=NT(e),c=qo(l)):Dc()===null?(a=!1,l=RT(e),c=qo(l)):e[$n]&&(Wo(e[$n]),e[$n]=null));try{jp(e),E0(t.bindingStartIndex),n!==null&&b_(t,e,n,2,i);let p=(o&3)===3;if(!r)if(p){let x=t.preOrderCheckHooks;x!==null&&Cl(e,x,null)}else{let x=t.preOrderHooks;x!==null&&El(e,x,0,null),sf(e,0)}if(s||$T(e),T_(e),M_(e,0),t.contentQueries!==null&&Xy(t,e),!r)if(p){let x=t.contentCheckHooks;x!==null&&Cl(e,x)}else{let x=t.contentHooks;x!==null&&El(e,x,1),sf(e,1)}HT(t,e);let f=t.components;f!==null&&I_(e,f,0);let _=t.viewQuery;if(_!==null&&yf(2,_,i),!r)if(p){let x=t.viewCheckHooks;x!==null&&Cl(e,x)}else{let x=t.viewHooks;x!==null&&El(e,x,2),sf(e,2)}if(t.firstUpdatePass===!0&&(t.firstUpdatePass=!1),e[nl]){for(let x of e[nl])x();e[nl]=null}r||(E_(e),e[Te]&=-73)}catch(p){let f=!1,_=p,x=e;for(;x!==null;){if(Jn(x)){x=x[qt];continue}let C=x[ra];if(C)try{let T=e[jn][jt],P=T?.constructor,Y={declarationInstance:T,declarationType:P,caughtBy:C};C(j0(_),Y),f=!0;break}catch(T){_=T}x=x[qt]}if(!f)throw r||fr(e),_}finally{l!==null&&($r(l,c),a&&PT(l)),fl()}}function M_(t,e){for(let n=zy(t);n!==null;n=Gy(n))for(let i=$t;i<n.length;i++){let o=n[i];k_(o,e)}}function $T(t){for(let e=zy(t);e!==null;e=Gy(e)){if(!(e[Te]&2))continue;let n=e[dr];for(let i=0;i<n.length;i++){let o=n[i];$p(o)}}}function BT(t,e,n){ht(at.ComponentStart);let i=Pi(e,t);try{k_(i,n)}finally{ht(at.ComponentEnd,i[jt])}}function k_(t,e){rl(t)&&If(t,e)}function If(t,e){let i=t[_e],o=t[Te],r=t[$n],s=!!(e===0&&o&16);if(s||=!!(o&64&&e===0),s||=!!(o&1024),s||=!!(r?.dirty&&Gs(r)),s||=!1,r&&(r.dirty=!1),t[Te]&=-9217,s)jT(i,t,i.template,t[jt]);else if(o&8192){let a=ge(null);try{T_(t),M_(t,1);let c=i.components;c!==null&&I_(t,c,1),E_(t)}finally{ge(a)}}}function I_(t,e,n){for(let i=0;i<e.length;i++)BT(t,e[i],n)}function HT(t,e){let n=t.hostBindingOpCodes;if(n!==null)try{for(let i=0;i<n.length;i++){let o=n[i];if(o<0)xo(~o);else{let r=o,s=n[++i],a=n[++i];S0(s,r);let c=e[r];ht(at.HostBindingsUpdateStart,c);try{a(2,c)}finally{ht(at.HostBindingsUpdateEnd,c)}}}}finally{xo(-1)}}function Dm(t,e){let n=Yp()?64:1088;for(t[hi].changeDetectionScheduler?.notify(e);t;){t[Te]|=n;let i=Yi(t);if(ts(t)&&!i)return t;t=i}return null}function N_(t,e,n,i){return[t,!0,0,e,null,i,null,n,null,null]}function O_(t,e){let n=$t+e;if(n<t.length)return t[n]}function Kl(t,e,n,i=!0){let o=e[_e];if(UT(o,e,t,n),i){let s=Mf(n,t),a=e[It],c=a.parentNode(t[lr]);c!==null&&JS(o,t[In],a,e,c,s)}let r=e[Qr];r!==null&&r.firstChild!==null&&(r.firstChild=null)}function P_(t,e){let n=va(t,e);return n!==void 0&&zl(n[_e],n),n}function va(t,e){if(t.length<=$t)return;let n=$t+e,i=t[n];if(i){let o=i[_o];o!==null&&o!==t&&gm(o,i),e>0&&(t[n-1][Xn]=i[Xn]);let r=ta(t,$t+e);XS(i[_e],i);let s=r[Oi];s!==null&&s.detachView(r[_e]),i[qt]=null,i[Xn]=null,i[Te]&=-129}return i}function UT(t,e,n,i){let o=$t+i,r=n.length;i>0&&(n[o-1][Xn]=e),i<r-$t?(e[Xn]=n[o],Ip(n,$t+i,e)):(n.push(e),e[Xn]=null),e[qt]=n;let s=e[_o];s!==null&&n!==s&&A_(s,e);let a=e[Oi];a!==null&&a.insertView(t),sl(e),e[Te]|=128}function A_(t,e){let n=t[dr],i=e[qt];if(vo(i))t[Te]|=2;else{let o=i[qt][jn];e[jn]!==o&&(t[Te]|=2)}n===null?t[dr]=[e]:n.push(e)}var cs=class{_lView;_cdRefInjectingView;_appRef=null;_attachedToViewContainer=!1;exhaustive;get rootNodes(){let e=this._lView,n=e[_e];return _a(n,e,n.firstChild,[])}constructor(e,n){this._lView=e,this._cdRefInjectingView=n}get context(){return this._lView[jt]}set context(e){this._lView[jt]=e}get destroyed(){return pr(this._lView)}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){let e=this._lView[qt];if(Jn(e)){let n=e[sa],i=n?n.indexOf(this):-1;i>-1&&(va(e,i),ta(n,i))}this._attachedToViewContainer=!1}zl(this._lView[_e],this._lView)}onDestroy(e){al(this._lView,e)}markForCheck(){Dm(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[Te]&=-129}reattach(){sl(this._lView),this._lView[Te]|=128}detectChanges(){this._lView[Te]|=1024,D_(this._lView)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new Ne(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;let e=ts(this._lView),n=this._lView[_o];n!==null&&!e&&gm(n,this._lView),h_(this._lView[_e],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new Ne(902,!1);this._appRef=e;let n=ts(this._lView),i=this._lView[_o];i!==null&&!n&&A_(i,this._lView),sl(this._lView)}};var ls=(()=>{class t{_declarationLView;_declarationTContainer;elementRef;static __NG_ELEMENT_ID__=zT;constructor(n,i,o){this._declarationLView=n,this._declarationTContainer=i,this.elementRef=o}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(n,i){return this.createEmbeddedViewImpl(n,i)}createEmbeddedViewImpl(n,i,o){let r=Yl(this._declarationLView,this._declarationTContainer,n,{embeddedViewInjector:i,dehydratedView:o});return new cs(r)}}return t})();function zT(){return Zl(Bn(),Ue())}function Zl(t,e){return t.type&4?new ls(e,t,us(t,e)):null}function Da(t,e,n,i,o){let r=t.data[e];if(r===null)r=GT(t,e,n,i,o),w0()&&(r.flags|=32);else if(r.type&64){r.type=n,r.value=i,r.attrs=o;let s=v0();r.injectorIndex=s===null?-1:s.injectorIndex}return ns(r,!0),r}function GT(t,e,n,i,o){let r=qp(),s=Wp(),a=s?r:r&&r.parent,c=t.data[e]=WT(t,a,n,e,i,o);return qT(t,c,r,s),c}function qT(t,e,n,i){t.firstChild===null&&(t.firstChild=e),n!==null&&(i?n.child==null&&e.parent!==null&&(n.child=e):n.next===null&&(n.next=e,e.prev=n))}function WT(t,e,n,i,o,r){let s=e?e.injectorIndex:-1,a=0;return _0()&&(a|=128),{type:n,index:i,insertBeforeIndex:null,injectorIndex:s,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,controlDirectiveIndex:-1,customControlIndex:-1,propertyBindings:null,flags:a,providerIndexes:0,value:o,namespace:Xp(),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 YT(t){let e=t[Lp]??[],i=t[qt][It],o=[];for(let r of e)r.data[Yy]!==void 0?o.push(r):KT(r,i);t[Lp]=o}function KT(t,e){let n=0,i=t.firstChild;if(i){let o=t.data[Wy];for(;n<o;){let r=i.nextSibling;a_(e,i,!1),i=r,n++}}}var ZT=()=>null,QT=()=>null;function Nf(t,e){return ZT(t,e)}function R_(t,e,n){return QT(t,e,n)}var L_=class{},Xi=class{};var F_=(()=>{class t{static \u0275prov=xe({token:t,providedIn:"root",factory:()=>null})}return t})();function V_(t){return t.debugInfo?.className||t.type.name||null}var Sl={},Pl=class{injector;parentInjector;constructor(e,n){this.injector=e,this.parentInjector=n}get(e,n,i){let o=this.injector.get(e,Sl,i);return o!==Sl||n===Sl?o:this.parentInjector.get(e,n,i)}};function j_(t,e,n){return t[e]=n}function XT(t,e){return t[e]}function bi(t,e,n){if(n===Sn)return!1;let i=t[e];return Object.is(i,n)?!1:(t[e]=n,!0)}function JT(t,e,n,i){let o=bi(t,e,n);return bi(t,e+1,i)||o}function Tl(t,e,n){return function i(o){let r=i.__ngNativeEl__;r!==void 0&&Jw(o,r);let s=bo(t)?Pi(t.index,e):e;Dm(s,5);let a=e[jt],c=uy(e,a,n,o),l=i.__ngNextListenerFn__;for(;l;)c=uy(e,a,l,o)&&c,l=l.__ngNextListenerFn__;return c}}function uy(t,e,n,i){let o=ge(null);try{return ht(at.OutputStart,e,n),n(i)!==!1}catch(r){return DT(t,r),!1}finally{ht(at.OutputEnd,e,n),ge(o)}}function $_(t,e,n,i,o,r,s,a){let c=es(t),l=!1,p=null;if(!i&&c&&(p=tD(e,n,r,t.index)),p!==null){let f=p.__ngLastListenerFn__||p;f.__ngNextListenerFn__=s,p.__ngLastListenerFn__=s,l=!0}else{let f=ei(t,n),_=i?i(f):f;tS(n,_,r,a),i||(a.__ngNativeEl__=f);let x=o.listen(_,r,a);if(!eD(r)){let C=i?T=>i(mn(T[t.index])):t.index;B_(C,e,n,r,a,x,!1)}}return l}function eD(t){return t.startsWith("animation")||t.startsWith("transition")}function tD(t,e,n,i){let o=t.cleanup;if(o!=null)for(let r=0;r<o.length-1;r+=2){let s=o[r];if(s===n&&o[r+1]===i){let a=e[Xr],c=o[r+2];return a&&a.length>c?a[c]:null}typeof s=="string"&&(r+=2)}return null}function B_(t,e,n,i,o,r,s){let a=e.firstCreatePass?Hp(e):null,c=Bp(n),l=c.length;c.push(o,r),a&&a.push(i,t,l,(l+1)*(s?-1:1))}function py(t,e,n,i,o,r){let s=e[n],a=e[_e],l=a.data[n].outputs[i],f=s[l].subscribe(r);B_(t.index,a,e,o,r,f,!0)}var Of=Symbol("BINDING");var vr=new He("");function Al(t,e,n){let i=n?t.styles:null,o=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)o=Gc(o,a);else if(r==2){let c=a,l=e[++s];i=Gc(i,c+": "+l+";")}}n?t.styles=i:t.stylesWithoutHost=i,n?t.classes=o:t.classesWithoutHost=o}function Ql(t,e=0){let n=Ue();if(n===null)return dt(t,e);let i=Bn();return jy(i,n,Vn(t),e)}function H_(t,e,n,i,o){let r=i===null?null:{"":-1},s=o(t,n);if(s!==null){let a=s,c=null,l=null;for(let p of s)if(p.resolveHostDirectives!==null){[a,c,l]=p.resolveHostDirectives(s);break}oD(t,e,n,a,r,c,l)}r!==null&&i!==null&&nD(n,i,r)}function nD(t,e,n){let i=t.localNames=[];for(let o=0;o<e.length;o+=2){let r=n[e[o+1]];if(r==null)throw new Ne(-301,!1);i.push(e[o],r)}}function iD(t,e,n){e.componentOffset=n,(t.components??=[]).push(e.index)}function oD(t,e,n,i,o,r,s){let a=i.length,c=null;for(let _=0;_<a;_++){let x=i[_];c===null&&ur(x)&&(c=x,iD(t,n,_)),Hw(Ry(n,e),t,x.type)}dD(n,t.data.length,a),c?.viewProvidersResolver&&c.viewProvidersResolver(c);for(let _=0;_<a;_++){let x=i[_];x.providersResolver&&x.providersResolver(x)}let l=!1,p=!1,f=__(t,e,a,null);a>0&&(n.directiveToIndex=new Map);for(let _=0;_<a;_++){let x=i[_];if(n.mergedAttrs=$l(n.mergedAttrs,x.hostAttrs),sD(t,n,e,f,x),lD(f,x,o),s!==null&&s.has(x)){let[T,P]=s.get(x);n.directiveToIndex.set(x.type,[f,T+n.directiveStart,P+n.directiveStart])}else(r===null||!r.has(x))&&n.directiveToIndex.set(x.type,f);x.contentQueries!==null&&(n.flags|=4),(x.hostBindings!==null||x.hostAttrs!==null||x.hostVars!==0)&&(n.flags|=64);let C=x.type.prototype;!l&&(C.ngOnChanges||C.ngOnInit||C.ngDoCheck)&&((t.preOrderHooks??=[]).push(n.index),l=!0),!p&&(C.ngOnChanges||C.ngDoCheck)&&((t.preOrderCheckHooks??=[]).push(n.index),p=!0),f++}rD(t,n,r)}function rD(t,e,n){for(let i=e.directiveStart;i<e.directiveEnd;i++){let o=t.data[i];if(n===null||!n.has(o))fy(0,e,o,i),fy(1,e,o,i),hy(e,i,!1);else{let r=n.get(o);my(0,e,r,i),my(1,e,r,i),hy(e,i,!0)}}}function fy(t,e,n,i){let o=t===0?n.inputs:n.outputs;for(let r in o)if(Object.hasOwn(o,r)){let s;t===0?s=e.inputs??={}:s=e.outputs??={},s[r]??=[],s[r].push(i),U_(e,r)}}function my(t,e,n,i){let o=t===0?n.inputs:n.outputs;for(let r in o)if(Object.hasOwn(o,r)){let s=o[r],a;t===0?a=e.hostDirectiveInputs??={}:a=e.hostDirectiveOutputs??={},a[s]??=[],a[s].push(i,r),U_(e,s)}}function U_(t,e){e==="class"?t.flags|=8:e==="style"&&(t.flags|=16)}function hy(t,e,n){let{attrs:i,inputs:o,hostDirectiveInputs:r}=t;if(i===null||!n&&o===null||n&&r===null||pm(t)){t.initialInputs??=[],t.initialInputs.push(null);return}let s=null,a=0;for(;a<i.length;){let c=i[a];if(c===0){a+=4;continue}else if(c===5){a+=2;continue}else if(typeof c=="number")break;if(!n&&Object.hasOwn(o,c)){let l=o[c];for(let p of l)if(p===e){s??=[],s.push(c,i[a+1]);break}}else if(n&&Object.hasOwn(r,c)){let l=r[c];for(let p=0;p<l.length;p+=2)if(l[p]===e){s??=[],s.push(l[p+1],i[a+1]);break}}a+=2}t.initialInputs??=[],t.initialInputs.push(s)}function sD(t,e,n,i,o){t.data[i]=o;let r=o.factory||(o.factory=Wr(o.type,!0)),s=new ga(r,ur(o),Ql,null);t.blueprint[i]=s,n[i]=s,aD(t,e,i,__(t,n,o.hostVars,Sn),o)}function aD(t,e,n,i,o){let r=o.hostBindings;if(r){let s=t.hostBindingOpCodes;s===null&&(s=t.hostBindingOpCodes=[]);let a=~e.index;cD(s)!=a&&s.push(a),s.push(n,i,r)}}function cD(t){let e=t.length;for(;e>0;){let n=t[--e];if(typeof n=="number"&&n<0)return n}return 0}function lD(t,e,n){if(n){if(e.exportAs)for(let i=0;i<e.exportAs.length;i++)n[e.exportAs[i]]=t;ur(e)&&(n[""]=t)}}function dD(t,e,n){t.flags|=1,t.directiveStart=e,t.directiveEnd=e+n,t.providerIndexes=e}function Mm(t,e,n,i,o,r,s,a){let c=e[_e],l=c.consts,p=ti(l,s),f=Da(c,t,n,i,p);return r&&H_(c,e,f,ti(l,a),o),f.mergedAttrs=$l(f.mergedAttrs,f.attrs),f.attrs!==null&&Al(f,f.attrs,!1),f.mergedAttrs!==null&&Al(f,f.mergedAttrs,!0),c.queries!==null&&c.queries.elementStart(c,f),f}function km(t,e){Iy(t,e),Fp(e)&&t.queries.elementEnd(e)}function uD(t,e,n,i,o,r){let s=e.consts,a=ti(s,o),c=Da(e,t,n,i,a);if(c.mergedAttrs=$l(c.mergedAttrs,c.attrs),r!=null){let l=ti(s,r);c.localNames=[];for(let p=0;p<l.length;p+=2)c.localNames.push(l[p],-1)}return c.attrs!==null&&Al(c,c.attrs,!1),c.mergedAttrs!==null&&Al(c,c.mergedAttrs,!0),e.queries!==null&&e.queries.elementStart(e,c),c}var z_=typeof ShadowRoot<"u",pD=typeof Document<"u";function fD(t){return Object.keys(t).map(e=>{let[n,i,o]=t[e],r={propName:n,templateName:e,isSignal:(i&ql.SignalBased)!==0};return o&&(r.transform=o),r})}function mD(t){return Object.keys(t).map(e=>({propName:t[e],templateName:e}))}function hD(t,e,n){let i=e instanceof fi?e:e?.injector;return i&&t.getStandaloneInjector!==null&&(i=t.getStandaloneInjector(i)||i),i?new Pl(n,i):n}function gD(t){let e=t.get(Xi,null);if(e===null)throw new Ne(407,!1);let n=t.get(F_,null),i=t.get(ho,null),o=t.get(to,null,{optional:!0});return{rendererFactory:e,sanitizer:n,changeDetectionScheduler:i,ngReflect:!1,tracingService:o}}function yD(t,e,n){let i=G_(t);return r_(e,i,i==="svg"?er:i==="math"?il:n)}function _D(t){if((t&&"localName"in t&&typeof t.localName=="string"?t.localName:t?.tagName)?.toLowerCase()==="script")throw new Ne(905,!1)}function G_(t){return(t.selectors[0][0]||"div").toLowerCase()}var ba=class{componentDef;ngModule;selector;componentType;ngContentSelectors;isBoundToModule;cachedInputs=null;cachedOutputs=null;get inputs(){return this.cachedInputs??=fD(this.componentDef.inputs),this.cachedInputs}get outputs(){return this.cachedOutputs??=mD(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,i,o,r,s,a,c){ht(at.DynamicComponentStart);let l=ge(null);try{let p=this.componentDef,f=hD(p,o||this.ngModule,e),_=gD(f),x=_.tracingService;return x&&x.componentCreate?x.componentCreate(V_(p),()=>this.createComponentRef(_,f,n,i,r,s,a,c)):this.createComponentRef(_,f,n,i,r,s,a,c)}finally{ge(l)}}createComponentRef(e,n,i,o,r,s,a,c){let l=this.componentDef,p=vD(o,l,s,r,c),f=e.rendererFactory.createRenderer(null,l),_=o?hT(f,o,l.encapsulation,n):yD(l,f,a??null);_D(_);let x=n.get(vr,null),C=bD(_,()=>n.get(wn,null)??im());x&&x.addHost(C);let T=s?.some(gy)||r?.some(W=>typeof W!="function"&&W.bindings.some(gy)),P=bm(null,p,null,512|y_(l),null,null,e,f,n,null,Qy(_,n,!0));x&&z_&&C instanceof ShadowRoot&&al(P,()=>{x.removeHost(C)}),P[Yt]=_,pl(P);let Y=null;try{let W=Mm(Yt,P,2,"#host",()=>p.directiveRegistry,!0,0);c_(f,_,W),as(_,P),Wl(p,P,W),rm(p,W,P),km(p,W),i!==void 0&&CD(W,this.ngContentSelectors,i),Y=Pi(W.index,P),P[jt]=Y[jt],Tm(p,P,null)}catch(W){throw Y!==null&&hf(Y),hf(P),W}finally{ht(at.DynamicComponentEnd),fl()}return new Rl(this.componentType,P,!!T)}};function vD(t,e,n,i,o){let r=t?["ng-version","22.2.1"]:zS(e.selectors[0]),s=null,a=null,c=0;if(n)for(let f of n)c+=f[Of].requiredVars,f.create&&(f.targetIdx=0,(s??=[]).push(f)),f.update&&(f.targetIdx=0,(a??=[]).push(f));if(i)for(let f=0;f<i.length;f++){let _=i[f];if(typeof _!="function")for(let x of _.bindings){c+=x[Of].requiredVars;let C=f+1;x.create&&(x.targetIdx=C,(s??=[]).push(x)),x.update&&(x.targetIdx=C,(a??=[]).push(x))}}let l=[e];if(i)for(let f of i){let _=typeof f=="function"?f:f.type,x=Kc(_);l.push(x)}return vm(0,null,xD(s,a),1,c,l,null,null,null,[r],null)}function bD(t,e){let n=t.getRootNode?.();return pD&&n instanceof Document?n.head:n&&z_&&n instanceof ShadowRoot?n:e().head}function xD(t,e){return!t&&!e?null:n=>{if(n&1&&t)for(let i of t)i.create();if(n&2&&e)for(let i of e)i.update()}}function gy(t){let e=t[Of].kind;return e==="input"||e==="twoWay"}var Rl=class extends L_{_rootLView;_hasInputBindings;instance;hostView;changeDetectorRef;componentType;location;previousInputValues=null;_tNode;constructor(e,n,i){super(),this._rootLView=n,this._hasInputBindings=i,this._tNode=ol(n[_e],Yt),this.location=us(this._tNode,n),this.instance=Pi(this._tNode.index,n)[jt],this.hostView=this.changeDetectorRef=new cs(n,void 0),this.componentType=e}setInput(e,n){this._hasInputBindings;let i=this._tNode;if(this.previousInputValues??=new Map,this.previousInputValues.has(e)&&Object.is(this.previousInputValues.get(e),n))return;let o=this._rootLView,r=Sm(i,o[_e],o,e,n);this.previousInputValues.set(e,n);let s=Pi(i.index,o);Dm(s,1)}get injector(){return new Zi(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}};function CD(t,e,n){let i=t.projection=[];for(let o=0;o<e.length;o++){let r=n[o];i.push(r!=null&&r.length?Array.from(r):null)}}var ps=(()=>{class t{static __NG_ELEMENT_ID__=ED}return t})();function ED(){let t=Bn();return q_(t,Ue())}var Pf=class t extends ps{_lContainer;_hostTNode;_hostLView;constructor(e,n,i){super(),this._lContainer=e,this._hostTNode=n,this._hostLView=i}get element(){return us(this._hostTNode,this._hostLView)}get injector(){return new Zi(this._hostTNode,this._hostLView)}get parentInjector(){let e=em(this._hostTNode,this._hostLView);if(Oy(e)){let n=kl(e,this._hostLView),i=Ml(e),o=n[_e].data[i+8];return new Zi(o,n)}else return new Zi(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){let n=yy(this._lContainer);return n!==null&&n[e]||null}get length(){return this._lContainer.length-$t}createEmbeddedView(e,n,i){let o,r,s;typeof i=="number"?o=i:i!=null&&(o=i.index,r=i.injector,s=i.onError);let a=Nf(this._lContainer,e.ssrId),c=e.createEmbeddedViewImpl(n||{},r,a);return s&&(c._lView[ra]=s),this.insertImpl(c,o,ya(this._hostTNode,a)),c}createComponent(e,n,i,o,r,s,a){let c,l,p=n||{};c=p.index,i=p.injector,o=p.projectableNodes,r=p.environmentInjector||p.ngModuleRef,s=p.directives,a=p.bindings,l=p.onError;let f=new ba(ir(e)),_=i||this.parentInjector;if(!r&&f.ngModule==null){let W=this.parentInjector.get(fi,null);W&&(r=W)}let x=ir(f.componentType??{}),C=Nf(this._lContainer,x?.id??null),T=C?.firstChild??null,P=f.create(_,o,T,r,s,a,this._getHostElementNamespace());return l&&(P.hostView._lView[ra]=l),this.insertImpl(P.hostView,c,ya(this._hostTNode,C)),P}_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,i){let o=e._lView;if(p0(o)){let a=this.indexOf(e);if(a!==-1)this.detach(a);else{let c=o[qt],l=new t(c,c[In],c[qt]);l.detach(l.indexOf(e))}}let r=this._adjustIndex(n),s=this._lContainer;return Kl(s,o,r,i),e.attachToViewContainerRef(),Ip(lf(s),r,e),e}move(e,n){return this.insert(e,n)}indexOf(e){let n=yy(this._lContainer);return n!==null?n.indexOf(e):-1}remove(e){let n=this._adjustIndex(e,-1),i=va(this._lContainer,n);i&&(ta(lf(this._lContainer),n),zl(i[_e],i))}detach(e){let n=this._adjustIndex(e,-1),i=va(this._lContainer,n);return i&&ta(lf(this._lContainer),n)!=null?new cs(i):null}_adjustIndex(e,n=0){return e??this.length+n}};function yy(t){return t[sa]}function lf(t){return t[sa]||(t[sa]=[])}function q_(t,e){let n,i=e[t.index];return Jn(i)?n=i:(n=N_(i,e,null,t),e[t.index]=n,xm(e,n)),SD(n,e,t,i),new Pf(n,t,e)}function wD(t,e){let n=t[It],i=n.createComment(""),o=ei(e,t),r=n.parentNode(o);return hr(n,r,i,n.nextSibling(o),!1),i}var SD=MD,TD=()=>!1;function DD(t,e,n){return TD(t,e,n)}function MD(t,e,n,i){if(t[lr])return;let o;n.type&8?o=mn(i):o=wD(e,n),t[lr]=o}var Af=class t{queryList;matches=null;constructor(e){this.queryList=e}clone(){return new t(this.queryList)}setDirty(){this.queryList.setDirty()}},Rf=class t{queries;constructor(e=[]){this.queries=e}createEmbeddedView(e){let n=e.queries;if(n!==null){let i=e.contentQueries!==null?e.contentQueries[0]:n.length,o=[];for(let r=0;r<i;r++){let s=n.getByIndex(r),a=this.queries[s.indexInDeclarationView];o.push(a.clone())}return new t(o)}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++)K_(e,n).matches!==null&&this.queries[n].setDirty()}},Lf=class{flags;read;predicate;constructor(e,n,i=null){this.flags=n,this.read=i,typeof e=="string"?this.predicate=RD(e):this.predicate=e}},Ff=class t{queries;constructor(e=[]){this.queries=e}elementStart(e,n){for(let i=0;i<this.queries.length;i++)this.queries[i].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 i=0;i<this.length;i++){let o=n!==null?n.length:0,r=this.getByIndex(i).embeddedTView(e,o);r&&(r.indexInDeclarationView=i,n!==null?n.push(r):n=[r])}return n!==null?new t(n):null}template(e,n){for(let i=0;i<this.queries.length;i++)this.queries[i].template(e,n)}getByIndex(e){return this.queries[e]}get length(){return this.queries.length}track(e){this.queries.push(e)}},Vf=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,i=e.parent;for(;i!==null&&i.type&8&&i.index!==n;)i=i.parent;return n===(i!==null?i.index:-1)}return this._appliesToNextNode}matchTNode(e,n){let i=this.metadata.predicate;if(Array.isArray(i))for(let o=0;o<i.length;o++){let r=i[o];this.matchTNodeWithReadOption(e,n,kD(n,r)),this.matchTNodeWithReadOption(e,n,wl(n,e,r,!1,!1))}else i===ls?n.type&4&&this.matchTNodeWithReadOption(e,n,-1):this.matchTNodeWithReadOption(e,n,wl(n,e,i,!1,!1))}matchTNodeWithReadOption(e,n,i){if(i!==null){let o=this.metadata.read;if(o!==null)if(o===Bt||o===ps||o===Mn||o===ls&&n.type&4)this.addMatch(n.index,-2);else{let r=wl(n,e,o,!1,!1);r!==null&&this.addMatch(n.index,r)}else this.addMatch(n.index,i)}}addMatch(e,n){this.matches===null?this.matches=[e,n]:this.matches.push(e,n)}};function kD(t,e){let n=t.localNames;if(n!==null){for(let i=0;i<n.length;i+=2)if(n[i]===e)return n[i+1]}return null}function ID(t,e){return t.type&11?us(t,e):t.type&4?Zl(t,e):null}function ND(t,e,n,i){return n===-1?ID(e,t):n===-2?OD(t,e,i):Il(t,t[_e],n,e)}function OD(t,e,n){if(n===Bt)return us(e,t);if(n===ls)return Zl(e,t);if(n===ps)return q_(e,t);if(n===Mn)return new Zi(e,t)}function W_(t,e,n,i){let o=e[Oi].queries[i];if(o.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 p=r[l];a.push(ND(e,p,s[c+1],n.metadata.read))}}o.matches=a}return o.matches}function jf(t,e,n,i){let o=t.queries.getByIndex(n),r=o.matches;if(r!==null){let s=W_(t,e,o,n);for(let a=0;a<r.length;a+=2){let c=r[a];if(c>0)i.push(s[a/2]);else{let l=r[a+1],p=e[-c];for(let f=$t;f<p.length;f++){let _=p[f];_[_o]===_[qt]&&jf(_[_e],_,l,i)}if(p[dr]!==null){let f=p[dr];for(let _=0;_<f.length;_++){let x=f[_];jf(x[_e],x,l,i)}}}}}return i}function Y_(t,e){return t[Oi].queries[e].queryList}function PD(t,e,n){let i=new Nl((n&4)===4);return h0(t,e,i,i.destroy),(e[Oi]??=new Rf).queries.push(new Af(i))-1}function AD(t,e,n){let i=hn();return i.firstCreatePass&&(LD(i,new Lf(t,e,n),-1),(e&2)===2&&(i.staticViewQueries=!0)),PD(i,Ue(),e)}function RD(t){return t.split(",").map(e=>e.trim())}function LD(t,e,n){t.queries===null&&(t.queries=new Ff),t.queries.track(new Vf(e,n))}function K_(t,e){return t.queries.getByIndex(e)}function FD(t,e){let n=t[_e],i=K_(n,e);return i.crossesNgTemplate?jf(n,t,e,[]):W_(n,t,i,e)}function Im(t,e,n){let i,o=qs(()=>{i._dirtyCounter();let r=jD(i,t);if(e&&r===void 0)throw new Ne(-951,!1);return r});return i=o[fn],i._dirtyCounter=O(0),i._flatValue=void 0,o}function Z_(t){return Im(!0,!1,t)}function Q_(t){return Im(!0,!0,t)}function X_(t){return Im(!1,!1,t)}function VD(t,e){let n=t[fn];n._lView=Ue(),n._queryIndex=e,n._queryList=Y_(n._lView,e),n._queryList.onDirty(()=>n._dirtyCounter.update(i=>i+1))}function jD(t,e){let n=t._lView,i=t._queryIndex;if(n===void 0||i===void 0||n[Te]&4)return e?void 0:pi;let o=Y_(n,i),r=FD(n,i);return o.reset(r,Yw),e?o.first:o._changesDetected||t._flatValue===void 0?t._flatValue=o.toArray():t._flatValue}function Xl(t){return!!t&&typeof t.then=="function"}function Nm(t){return!!t&&typeof t.subscribe=="function"}var xa=class{};var Ca=class extends xa{injector;instance=null;constructor(e){super();let n=new Jo([...e.providers,{provide:xa,useValue:this}],e.parent||ia(),e.debugName,new Set(["environment"]));this.injector=n,e.runEnvironmentInitializers&&n.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(e){this.injector.onDestroy(e)}};function J_(t,e,n=null){return new Ca({providers:t,parent:e,debugName:n,runEnvironmentInitializers:!0}).injector}var $D=(()=>{class t{_injector;cachedInjectors=new Map;constructor(n){this._injector=n}getOrCreateStandaloneInjector(n){if(!n.standalone)return null;if(!this.cachedInjectors.has(n)){let i=Op(!1,n.type),o=i.length>0?J_([i],this._injector,""):null;this.cachedInjectors.set(n,o)}return this.cachedInjectors.get(n)}ngOnDestroy(){try{for(let n of this.cachedInjectors.values())n!==null&&n.destroy()}finally{this.cachedInjectors.clear()}}static \u0275prov=xe({token:t,providedIn:"environment",factory:()=>new t(dt(fi))})}return t})();function ue(t){return Xf(()=>{let e=ev(t),n=K(V({},e),{decls:t.decls,vars:t.vars,template:t.template,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,onPush:t.changeDetection!==tm.Eager,directiveDefs:null,pipeDefs:null,dependencies:e.standalone&&t.dependencies||null,getStandaloneInjector:e.standalone?o=>o.get($D).getOrCreateStandaloneInjector(n):null,getExternalStyles:null,signals:t.signals??!1,data:t.data||{},encapsulation:t.encapsulation||vi.Emulated,styles:t.styles||pi,_:null,schemas:t.schemas||null,tView:null,id:""});e.standalone&&_r("NgStandalone"),tv(n);let i=t.dependencies;return n.directiveDefs=_y(i,BD),n.pipeDefs=_y(i,Kg),n.id=zD(n),n})}function BD(t){return ir(t)||Kc(t)}function HD(t,e){if(t==null)return rr;let n={};for(let i in t)if(Object.hasOwn(t,i)){let o=t[i],r,s,a,c;Array.isArray(o)?(a=o[0],r=o[1],s=o[2]??r,c=o[3]||null):(r=o,s=o,a=ql.None,c=null),n[r]=[i,a,c],e[r]=s}return n}function UD(t){if(t==null)return rr;let e={};for(let n in t)Object.hasOwn(t,n)&&(e[t[n]]=n);return e}function br(t){return Xf(()=>{let e=ev(t);return tv(e),e})}function ev(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||rr,exportAs:t.exportAs||null,standalone:t.standalone??!0,signals:t.signals===!0,selectors:t.selectors||pi,viewQuery:t.viewQuery||null,features:t.features||null,setInput:null,resolveHostDirectives:null,hostDirectives:null,controlDef:null,signalFormsInputPresence:null,inputs:HD(t.inputs,e),outputs:UD(t.outputs),debugInfo:null}}function tv(t){t.features?.forEach(e=>e(t))}function _y(t,e){return t?()=>{let n=typeof t=="function"?t():t,i=[];for(let o of n){let r=e(o);r!==null&&i.push(r)}return i}:null}function zD(t){let e=0,n=typeof t.consts=="function"?"":t.consts,i=[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 i.join("|"))e=Math.imul(31,e)+r.charCodeAt(0)<<0;return e+=2147483648,"c"+e}var nv=new He("");var Om=(()=>{class t{resolve;reject;initialized=!1;done=!1;donePromise=new Promise((n,i)=>{this.resolve=n,this.reject=i});appInits=N(nv,{optional:!0})??[];injector=N(Mn);constructor(){}runInitializers(){if(this.initialized)return;let n=[];for(let o of this.appInits){let r=tl(this.injector,o);if(Xl(r))n.push(r);else if(Nm(r)){let s=new Promise((a,c)=>{r.subscribe({complete:a,error:c})});n.push(s)}}let i=()=>{this.done=!0,this.resolve()};Promise.all(n).then(()=>{i()}).catch(o=>{this.reject(o)}),n.length===0&&i(),this.initialized=!0}static \u0275fac=function(i){return new(i||t)};static \u0275prov=yr({token:t,factory:t.\u0275fac})}return t})();function iv(t,e,n,i,o,r,s,a){if(n.firstCreatePass){t.mergedAttrs=$l(t.mergedAttrs,t.attrs);let p=t.tView=vm(2,t,o,r,s,n.directiveRegistry,n.pipeRegistry,null,n.schemas,n.consts,null);n.queries!==null&&(n.queries.template(n,t),p.queries=n.queries.embeddedTView(t))}a&&(t.flags|=a),ns(t,!1);let c=qD(n,e,t,i);ml()&&ym(n,e,c,t),as(c,e);let l=N_(c,e,c,t);e[i+Yt]=l,xm(e,l),DD(l,t,e)}function GD(t,e,n,i,o,r,s,a,c,l,p){let f=n+Yt,_;return e.firstCreatePass?(_=Da(e,f,4,s||null,a||null),cl()&&H_(e,t,_,ti(e.consts,l),Cm),Iy(e,_)):_=e.data[f],iv(_,t,e,n,i,o,r,c),es(_)&&Wl(e,t,_),l!=null&&Ta(t,_,p),_}function Ll(t,e,n,i,o,r,s,a,c,l,p){let f=n+Yt,_;if(e.firstCreatePass){if(_=Da(e,f,4,s||null,a||null),l!=null){let x=ti(e.consts,l);_.localNames=[];for(let C=0;C<x.length;C+=2)_.localNames.push(x[C],-1)}}else _=e.data[f];return iv(_,t,e,n,i,o,r,c),l!=null&&Ta(t,_,p),_}function Jl(t,e,n,i,o,r,s,a){let c=Ue(),l=hn(),p=ti(l.consts,r);return GD(c,l,t,e,n,i,o,p,void 0,s,a),Jl}var qD=WD;function WD(t,e,n,i){return la(!0),e[It].createComment("")}var Pm=new He("");var Am=new He("");function ov(){Wu(t=>{let e="";throw new Ne(-600,e)})}var YD=10;var Ma=(()=>{class t{_runningTick=!1;_destroyed=!1;_destroyListeners=[];_views=[];internalErrorHandler=N(Co);afterRenderManager=N(hm);zonelessEnabled=N(fa);rootEffectScheduler=N(yl);dirtyFlags=0;tracingSnapshot=null;allTestViews=new Set;autoDetectTestViews=new Set;includeAllTestViews=!1;afterTick=new Zn;get allViews(){return[...(this.includeAllTestViews?this.allTestViews:this.autoDetectTestViews).keys(),...this._views]}get destroyed(){return this._destroyed}componentTypes=[];components=[];internalPendingTask=N(is);get isStable(){return this.internalPendingTask.hasPendingTasksObservable.pipe(sp(n=>!n))}constructor(){N(to,{optional:!0})}whenStable(){let n;return new Promise(i=>{n=this.isStable.subscribe({next:o=>{o&&i()}})}).finally(()=>{n.unsubscribe()})}_injector=N(fi);_rendererFactory=null;get injector(){return this._injector}bootstrap(n,i){return this.bootstrapImpl(n,i)}bootstrapImpl(n,i,o=Mn.NULL){return this._injector.get(kn).run(()=>{if(ht(at.BootstrapComponentStart),!this._injector.get(Om).done){let Y="";throw new Ne(405,Y)}let a=ir(n),c=this._injector.get(xa),l=new ba(a,c);this.componentTypes.push(n);let{hostElement:p,directives:f,bindings:_}=KD(i),x=p||l.selector,C=l.create(o,[],x,c.injector,f,_),T=C.location.nativeElement,P=C.injector.get(Pm,null);return P?.registerApplication(T),C.onDestroy(()=>{this.detachView(C.hostView),ha(this.components,C),P?.unregisterApplication(T)}),this._loadComponent(C),ht(at.BootstrapComponentEnd,C),C})}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick(){ht(at.ChangeDetectionStart),this.tracingSnapshot!==null?this.tracingSnapshot.run(Ul.CHANGE_DETECTION,this.tickImpl):this.tickImpl()}tickImpl=()=>{if(this._runningTick)throw ht(at.ChangeDetectionEnd),new Ne(101,!1);let n=ge(null);try{this._runningTick=!0,this.synchronize()}finally{this._runningTick=!1,this.tracingSnapshot?.dispose(),this.tracingSnapshot=null,ge(n),this.afterTick.next(),ht(at.ChangeDetectionEnd)}};synchronize(){this._rendererFactory===null&&!this._injector.destroyed&&(this._rendererFactory=this._injector.get(Xi,null,{optional:!0}));let n=0;for(;this.dirtyFlags!==0&&n++<YD;){ht(at.ChangeDetectionSyncStart);try{this.synchronizeOnce()}finally{ht(at.ChangeDetectionSyncEnd)}}}synchronizeOnce(){this.dirtyFlags&16&&(this.dirtyFlags&=-17,this.rootEffectScheduler.flush());let n=!1;if(this.dirtyFlags&7){let i=!!(this.dirtyFlags&1);this.dirtyFlags&=-8,this.dirtyFlags|=8;for(let{_lView:o}of this.allViews){if(!i&&!aa(o))continue;let r=i&&!this.zonelessEnabled?0:1;D_(o,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})=>aa(n))){this.dirtyFlags|=2;return}else this.dirtyFlags&=-8}attachView(n){let i=n;this._views.push(i),i.attachToAppRef(this)}detachView(n){let i=n;ha(this._views,i),i.detachFromAppRef()}_loadComponent(n){this.attachView(n.hostView);try{this.tick()}catch(o){this.internalErrorHandler(o)}this.components.push(n),this._injector.get(Am,[]).forEach(o=>o(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),()=>ha(this._destroyListeners,n)}destroy(){if(this._destroyed)throw new Ne(406,!1);let n=this._injector;n.destroy&&!n.destroyed&&n.destroy()}get viewCount(){return this._views.length}static \u0275fac=function(i){return new(i||t)};static \u0275prov=yr({token:t,factory:t.\u0275fac})}return t})();function KD(t){return t===void 0||typeof t=="string"||t instanceof Element?{hostElement:t}:t}function ha(t,e){let n=t.indexOf(e);n>-1&&t.splice(n,1)}function J(t,e,n,i){let o=Ue(),r=mr();if(bi(o,r,e)){let s=hn(),a=ca();wT(a,o,t,e,n,i)}return J}var $f=class{destroy(e){}updateValue(e,n){}swap(e,n){let i=Math.min(e,n),o=Math.max(e,n),r=this.detach(o);if(o-i>1){let s=this.detach(i);this.attach(i,r),this.attach(o,s)}else this.attach(i,r)}move(e,n){this.attach(n,this.detach(e))}};function df(t,e,n,i,o){return t===n&&Object.is(e,i)?1:Object.is(o(t,e),o(n,i))?-1:0}function ZD(t,e,n,i){let o,r,s=0,a=t.length-1,c=void 0;if(Array.isArray(e)){ge(i);let l=e.length-1;for(ge(null);s<=a&&s<=l;){let p=t.at(s),f=e[s],_=df(s,p,s,f,n);if(_!==0){_<0&&t.updateValue(s,f),s++;continue}let x=t.at(a),C=e[l],T=df(a,x,l,C,n);if(T!==0){T<0&&t.updateValue(a,C),a--,l--;continue}let P=n(s,p),Y=n(a,x),W=n(s,f);if(Object.is(W,Y)){let be=n(l,C);Object.is(be,P)?(t.swap(s,a),t.updateValue(a,C),l--,a--):t.move(a,s),t.updateValue(s,f),s++;continue}if(o??=new Fl,r??=by(t,s,a,n),Bf(t,o,s,W))t.updateValue(s,f),s++,a++;else if(r.has(W))o.set(P,t.detach(s)),a--;else{let be=t.create(s,e[s]);t.attach(s,be),s++,a++}}for(;s<=l;)vy(t,o,n,s,e[s]),s++}else if(e!=null){ge(i);let l=e[Symbol.iterator]();ge(null);let p=l.next();for(;!p.done&&s<=a;){let f=t.at(s),_=p.value,x=df(s,f,s,_,n);if(x!==0)x<0&&t.updateValue(s,_),s++,p=l.next();else{o??=new Fl,r??=by(t,s,a,n);let C=n(s,_);if(Bf(t,o,s,C))t.updateValue(s,_),s++,a++,p=l.next();else if(!r.has(C))t.attach(s,t.create(s,_)),s++,a++,p=l.next();else{let T=n(s,f);o.set(T,t.detach(s)),a--}}}for(;!p.done;)vy(t,o,n,t.length,p.value),p=l.next()}for(;s<=a;)t.destroy(t.detach(a--));o?.forEach(l=>{t.destroy(l)})}function Bf(t,e,n,i){return e!==void 0&&e.has(i)?(t.attach(n,e.get(i)),e.delete(i),!0):!1}function vy(t,e,n,i,o){if(Bf(t,e,i,n(i,o)))t.updateValue(i,o);else{let r=t.create(i,o);t.attach(i,r)}}function by(t,e,n,i){let o=new Set;for(let r=e;r<=n;r++)o.add(i(r,t.at(r)));return o}var Fl=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 i=this.kvMap.get(e);this._vMap===void 0&&(this._vMap=new Map);let o=this._vMap;for(;o.has(i);)i=o.get(i);o.set(i,n)}else this.kvMap.set(e,n)}forEach(e){for(let[n,i]of this.kvMap)if(e(i,n),this._vMap!==void 0){let o=this._vMap;for(;o.has(i);)i=o.get(i),e(i,n)}}};function w(t,e,n,i,o,r,s,a){_r("NgControlFlow");let c=Ue(),l=hn(),p=ti(l.consts,r);return Ll(c,l,t,e,n,i,o,p,256,s,a),Rm}function Rm(t,e,n,i,o,r,s,a){return _r("NgControlFlow"),QD(t,e,n,i,o,r,s,a),Rm}function QD(t,e,n,i,o,r,s,a){let c=Ue(),l=hn(),p=ti(l.consts,r);Ll(c,l,t,e,n,i,o,p,512,s,a)}function S(t,e){_r("NgControlFlow");let n=Ue(),i=mr(),o=n[i]!==Sn?n[i]:-1,r=o!==-1?Vl(n,Yt+o):void 0,s=0;if(bi(n,i,t)){let a=ge(null);try{if(r!==void 0&&P_(r,s),t!==-1){let c=Yt+t,l=Vl(n,c),p=Gf(n[_e],c),f=R_(l,p,n),_=Yl(n,p,e,{dehydratedView:f});Kl(l,_,s,ya(p,f))}}finally{ge(a)}}else if(r!==void 0){let a=O_(r,s);a!==void 0&&(a[jt]=e)}}var Hf=class{lContainer;$implicit;$index;constructor(e,n,i){this.lContainer=e,this.$implicit=n,this.$index=i}get $count(){return this.lContainer.length-$t}};function Ci(t){return t}function Ei(t,e){return e}var Uf=class{hasEmptyBlock;trackByFn;liveCollection;constructor(e,n,i){this.hasEmptyBlock=e,this.trackByFn=n,this.liveCollection=i}};function oe(t,e,n,i,o,r,s,a,c,l,p,f,_){_r("NgControlFlow");let x=Ue(),C=hn(),T=c!==void 0,P=Ue(),Y=a?s.bind(P[jn][jt]):s,W=new Uf(T,Y);P[Yt+t]=W,Ll(x,C,t+1,e,n,i,o,ti(C.consts,r),256),T&&Ll(x,C,t+2,c,l,p,f,ti(C.consts,_),512)}var zf=class extends $f{lContainer;hostLView;templateTNode;operationsCounter=void 0;needsIndexUpdate=!1;constructor(e,n,i){super(),this.lContainer=e,this.hostLView=n,this.templateTNode=i}get length(){return this.lContainer.length-$t}at(e){return this.getLView(e)[jt].$implicit}attach(e,n){let i=n[Qr];this.needsIndexUpdate||=e!==this.length,Kl(this.lContainer,n,e,ya(this.templateTNode,i)),XD(this.lContainer,e)}detach(e){return this.needsIndexUpdate||=e!==this.length-1,JD(this.lContainer,e),eM(this.lContainer,e)}create(e,n){let i=Nf(this.lContainer,this.templateTNode.tView.ssrId);return Yl(this.hostLView,this.templateTNode,new Hf(this.lContainer,n,e),{dehydratedView:i})}destroy(e){zl(e[_e],e)}updateValue(e,n){this.getLView(e)[jt].$implicit=n}reset(){this.needsIndexUpdate=!1}updateIndexes(){if(this.needsIndexUpdate)for(let e=0;e<this.length;e++)this.getLView(e)[jt].$index=e}getLView(e){return tM(this.lContainer,e)}};function re(t){let e=ge(null),n=gi();try{let i=Ue(),o=i[_e],r=i[n],s=n+1,a=Vl(i,s);if(r.liveCollection===void 0){let l=Gf(o,s);r.liveCollection=new zf(a,i,l)}else r.liveCollection.reset();let c=r.liveCollection;if(ZD(c,t,r.trackByFn,e),c.updateIndexes(),r.hasEmptyBlock){let l=mr(),p=c.length===0;if(bi(i,l,p)){let f=n+2,_=Vl(i,f);if(p){let x=Gf(o,f),C=R_(_,x,i),T=Yl(i,x,void 0,{dehydratedView:C});Kl(_,T,0,ya(x,C))}else o.firstUpdatePass&&YT(_),P_(_,0)}}}finally{ge(e)}}function Vl(t,e){return t[e]}function XD(t,e){if(t.length<=$t)return;let n=$t+e,i=t[n];i&&QS(i)}function JD(t,e){if(t.length<=$t)return;let n=$t+e,i=t[n];i&&ZS(i)}function eM(t,e){return va(t,e)}function tM(t,e){return O_(t,e)}function Gf(t,e){return ol(t,e)}function q(t,e,n){let i=Ue(),o=mr();if(bi(i,o,e)){let r=hn(),s=ca();vT(s,i,t,e,i[It],n)}return q}function qf(t,e,n,i,o){Sm(e,t,n,o?"class":"style",i)}function y(t,e,n,i){let o=Ue(),r=o[_e],s=t+Yt,a=r.firstCreatePass?Mm(s,o,2,e,Cm,cl(),n,i):r.data[s];if(bo(a)){let c=o[hi].tracingService;if(c&&c.componentCreate){let l=r.data[a.directiveStart+a.componentOffset];return c.componentCreate(V_(l),()=>(xy(t,e,o,a,i),y))}}return xy(t,e,o,a,i),y}function xy(t,e,n,i,o){if(Em(i,n,t,e,rv),es(i)){let r=n[_e];Wl(r,n,i),rm(r,i,n)}o!=null&&Ta(n,i)}function b(){let t=hn(),e=Bn(),n=wm(e);return t.firstCreatePass&&km(t,n),zp(n)&&Gp(),Up(),n.classesWithoutHost!=null&&Pw(n)&&qf(t,n,Ue(),n.classesWithoutHost,!0),n.stylesWithoutHost!=null&&Aw(n)&&qf(t,n,Ue(),n.stylesWithoutHost,!1),b}function ve(t,e,n,i){return y(t,e,n,i),b(),ve}function h(t,e,n,i){let o=Ue(),r=o[_e],s=t+Yt,a=r.firstCreatePass?uD(s,r,2,e,n,i):r.data[s];return Em(a,o,t,e,rv),i!=null&&Ta(o,a),h}function g(){let t=Bn(),e=wm(t);return zp(e)&&Gp(),Up(),g}function ce(t,e,n,i){return h(t,e,n,i),g(),ce}var rv=(t,e,n,i,o)=>(la(!0),r_(e[It],i,Xp()));function Lm(t,e,n){let i=Ue(),o=i[_e],r=t+Yt,s=o.firstCreatePass?Mm(r,i,8,"ng-container",Cm,cl(),e,n):o.data[r];if(Em(s,i,t,"ng-container",nM),es(s)){let a=i[_e];Wl(a,i,s),rm(a,s,i)}return n!=null&&Ta(i,s),Lm}function Fm(){let t=hn(),e=Bn(),n=wm(e);return t.firstCreatePass&&km(t,n),Fm}function ka(t,e,n){return Lm(t,e,n),Fm(),ka}var nM=(t,e,n,i,o)=>(la(!0),MS(e[It],""));function $(){return Ue()}function ie(t,e,n){let i=Ue(),o=mr();if(bi(i,o,e)){let r=hn(),s=ca();x_(s,i,t,e,i[It],n)}return ie}var Ia="en-US";var iM=Ia;function sv(t){typeof t=="string"&&(iM=t.toLowerCase().replace(/_/g,"-"))}function A(t,e,n){let i=Ue(),o=hn(),r=Bn();return oM(o,i,i[It],r,t,e,n),A}function F(t,e,n){let i=Ue(),o=hn(),r=Bn();return(r.type&3||n)&&$_(r,o,i,n,i[It],t,e,Tl(r,i,e)),F}function oM(t,e,n,i,o,r,s){let a=!0,c=null;if((i.type&3||s)&&(c??=Tl(i,e,r),$_(i,t,e,s,n,o,r,c)&&(a=!1)),a){let l=i.outputs?.[o],p=i.hostDirectiveOutputs?.[o];if(p&&p.length)for(let f=0;f<p.length;f+=2){let _=p[f],x=p[f+1];c??=Tl(i,e,r),py(i,e,_,x,o,c)}if(l&&l.length)for(let f of l)c??=Tl(i,e,r),py(i,e,f,o,o,c)}}function m(t=1){return O0(t)}function gt(t,e,n,i){return VD(t,AD(e,n,i)),gt}function vt(t=1){ul(M0()+t)}function ed(t){let e=x0();return u0(e,Yt+t)}function xl(t,e){return t<<17|e<<2}function gr(t){return t>>17&32767}function rM(t){return(t&2)==2}function sM(t,e){return t&131071|e<<17}function Wf(t){return t|2}function ds(t){return(t&131068)>>2}function uf(t,e){return t&-131069|e<<2}function aM(t){return(t&1)===1}function Yf(t){return t|1}function cM(t,e,n,i,o,r){let s=r?e.classBindings:e.styleBindings,a=gr(s),c=ds(s);t[i]=n;let l=!1,p;if(Array.isArray(n)){let f=n;p=f[1],(p===null||Kr(f,p)>0)&&(l=!0)}else p=n;if(o)if(c!==0){let _=gr(t[a+1]);t[i+1]=xl(_,a),_!==0&&(t[_+1]=uf(t[_+1],i)),t[a+1]=sM(t[a+1],i)}else t[i+1]=xl(a,0),a!==0&&(t[a+1]=uf(t[a+1],i)),a=i;else t[i+1]=xl(c,0),a===0?a=i:t[c+1]=uf(t[c+1],i),c=i;l&&(t[i+1]=Wf(t[i+1])),Cy(t,p,i,!0),Cy(t,p,i,!1),lM(e,p,t,i,r),s=xl(a,c),r?e.classBindings=s:e.styleBindings=s}function lM(t,e,n,i,o){let r=o?t.residualClasses:t.residualStyles;r!=null&&typeof e=="string"&&Kr(r,e)>=0&&(n[i+1]=Yf(n[i+1]))}function Cy(t,e,n,i){let o=t[n+1],r=e===null,s=i?gr(o):ds(o),a=!1;for(;s!==0&&(a===!1||r);){let c=t[s],l=t[s+1];dM(c,e)&&(a=!0,t[s+1]=i?Yf(l):Wf(l)),s=i?gr(l):ds(l)}a&&(t[n+1]=i?Wf(o):Yf(o))}function dM(t,e){return t===null||e==null||(Array.isArray(t)?t[1]:t)===e?!0:Array.isArray(t)&&typeof e=="string"?Kr(t,e)>=0:!1}var _i={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function uM(t){return t.substring(_i.key,_i.keyEnd)}function pM(t){return fM(t),av(t,cv(t,0,_i.textEnd))}function av(t,e){let n=_i.textEnd;return n===e?-1:(e=_i.keyEnd=mM(t,_i.key=e,n),cv(t,e,n))}function fM(t){_i.key=0,_i.keyEnd=0,_i.value=0,_i.valueEnd=0,_i.textEnd=t.length}function cv(t,e,n){for(;e<n&&t.charCodeAt(e)<=32;)e++;return e}function mM(t,e,n){for(;e<n&&t.charCodeAt(e)>32;)e++;return e}function At(t,e,n){return lv(t,e,n,!1),At}function X(t,e){return lv(t,e,null,!0),X}function Tn(t){gM(CM,hM,t,!0)}function hM(t,e){for(let n=pM(e);n>=0;n=av(e,n))Xc(t,uM(e),!0)}function lv(t,e,n,i){let o=Ue(),r=hn(),s=ll(2);if(r.firstUpdatePass&&uv(r,t,s,i),e!==Sn&&bi(o,s,e)){let a=r.data[gi()];pv(r,a,o,o[It],t,o[s+1]=wM(e,n),i,s)}}function gM(t,e,n,i){let o=hn(),r=ll(2);o.firstUpdatePass&&uv(o,null,r,i);let s=Ue();if(n!==Sn&&bi(s,r,n)){let a=o.data[gi()];if(fv(a,i)&&!dv(o,r)){let c=i?a.classesWithoutHost:a.stylesWithoutHost;c!==null&&(n=Gc(c,n||"")),qf(o,a,s,n,i)}else EM(o,a,s,s[It],s[r+1],s[r+1]=xM(t,e,n),i,r)}}function dv(t,e){return e>=t.expandoStartIndex}function uv(t,e,n,i){let o=t.data;if(o[n+1]===null){let r=o[gi()],s=dv(t,n);fv(r,i)&&e===null&&!s&&(e=!1),e=yM(o,r,e,i),cM(o,r,e,n,s,i)}}function yM(t,e,n,i){let o=D0(t),r=i?e.residualClasses:e.residualStyles;if(o===null)(i?e.classBindings:e.styleBindings)===0&&(n=pf(null,t,e,n,i),n=Ea(n,e.attrs,i),r=null);else{let s=e.directiveStylingLast;if(s===-1||t[s]!==o)if(n=pf(o,t,e,n,i),r===null){let c=_M(t,e,i);c!==void 0&&Array.isArray(c)&&(c=pf(null,t,e,c[1],i),c=Ea(c,e.attrs,i),vM(t,e,i,c))}else r=bM(t,e,i)}return r!==void 0&&(i?e.residualClasses=r:e.residualStyles=r),n}function _M(t,e,n){let i=n?e.classBindings:e.styleBindings;if(ds(i)!==0)return t[gr(i)]}function vM(t,e,n,i){let o=n?e.classBindings:e.styleBindings;t[gr(o)]=i}function bM(t,e,n){let i,o=e.directiveEnd;for(let r=1+e.directiveStylingLast;r<o;r++){let s=t[r].hostAttrs;i=Ea(i,s,n)}return Ea(i,e.attrs,n)}function pf(t,e,n,i,o){let r=null,s=n.directiveEnd,a=n.directiveStylingLast;for(a===-1?a=n.directiveStart:a++;a<s&&(r=e[a],i=Ea(i,r.hostAttrs,o),r!==t);)a++;return t!==null&&(n.directiveStylingLast=a),i}function Ea(t,e,n){let i=n?1:2,o=-1;if(e!==null)for(let r=0;r<e.length;r++){let s=e[r];typeof s=="number"?o=s:o===i&&(Array.isArray(t)||(t=t===void 0?[]:["",t]),Xc(t,s,n?!0:e[++r]))}return t===void 0?null:t}function xM(t,e,n){if(n==null||n==="")return pi;let i=[],o=ni(n);if(Array.isArray(o))for(let r=0;r<o.length;r++)t(i,o[r],!0);else if(o instanceof Set)for(let r of o)t(i,r,!0);else if(typeof o=="object")for(let r in o)Object.hasOwn(o,r)&&t(i,r,o[r]);else typeof o=="string"&&e(i,o);return i}function CM(t,e,n){let i=String(e);i!==""&&!i.includes(" ")&&Xc(t,i,n)}function EM(t,e,n,i,o,r,s,a){o===Sn&&(o=pi);let c=0,l=0,p=0<o.length?o[0]:null,f=0<r.length?r[0]:null;for(;p!==null||f!==null;){let _=c<o.length?o[c+1]:void 0,x=l<r.length?r[l+1]:void 0,C=null,T;p===f?(c+=2,l+=2,_!==x&&(C=f,T=x)):f===null||p!==null&&p<f?(c+=2,C=p):(l+=2,C=f,T=x),C!==null&&pv(t,e,n,i,C,T,s,a),p=c<o.length?o[c]:null,f=l<r.length?r[l]:null}}function pv(t,e,n,i,o,r,s,a){if(!(e.type&3))return;let c=t.data,l=c[a+1],p=aM(l)?Ey(c,e,n,o,ds(l),s):void 0;if(!jl(p)){jl(r)||rM(l)&&(r=Ey(c,null,n,o,a,s));let f=Vp(gi(),n);uT(i,s,f,o,r)}}function Ey(t,e,n,i,o,r){let s=e===null,a;for(;o>0;){let c=t[o],l=Array.isArray(c),p=l?c[1]:c,f=p===null,_=n[o+1];_===Sn&&(_=f?pi:void 0);let x=f?Jc(_,i):p===i?_:void 0;if(l&&!jl(x)&&(x=Jc(c,i)),jl(x)&&(a=x,s))return a;let C=t[o+1];o=s?gr(C):ds(C)}if(e!==null){let c=r?e.residualClasses:e.residualStyles;c!=null&&(a=Jc(c,i))}return a}function jl(t){return t!==void 0}function wM(t,e){return t==null||t===""||(typeof e=="string"?t=ni(t)+e:typeof t=="object"&&(t=zc(ni(t)))),t}function fv(t,e){return(t.flags&(e?8:16))!==0}function u(t,e=""){let n=Ue(),i=hn(),o=t+Yt,r=i.firstCreatePass?Da(i,o,1,e,null):i.data[o],s=SM(i,n,r,e);n[o]=s,ml()&&ym(i,n,s,r),ns(r,!1)}var SM=(t,e,n,i)=>(la(!0),TS(e[It],i));function TM(t,e,n,i=""){return bi(t,mr(),n)?e+or(n)+i:Sn}function DM(t,e,n,i,o,r=""){let s=C0(),a=JT(t,s,n,o);return ll(2),a?e+or(n)+i+or(o)+r:Sn}function k(t){return ae("",t),k}function ae(t,e,n){let i=Ue(),o=TM(i,t,e,n);return o!==Sn&&mv(i,gi(),o),ae}function wo(t,e,n,i,o){let r=Ue(),s=DM(r,t,e,n,i,o);return s!==Sn&&mv(r,gi(),s),wo}function mv(t,e,n){let i=Vp(e,t);DS(t[It],i,n)}function td(t,e){let n=Kp()+t,i=Ue();return i[n]===Sn?j_(i,n,e()):XT(i,n)}function nd(t,e,n){return kM(Ue(),Kp(),t,e,n)}function MM(t,e){let n=t[e];return n===Sn?void 0:n}function kM(t,e,n,i,o,r){let s=e+n;return bi(t,s,o)?j_(t,s+1,r?i.call(r,o):i(o)):MM(t,s+1)}function Vm(t,e){return Zl(t,e)}var hv=(()=>{class t{applicationErrorHandler=N(Co);appRef=N(Ma);taskService=N(is);ngZone=N(kn);zonelessEnabled=N(fa);tracing=N(to,{optional:!0});zoneIsDefined=typeof Zone<"u"&&!!Zone.root.run;schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}];subscriptions=new En;angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(Js):null;scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(N(rf,{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 i=this.useMicrotaskScheduler?F0:Jp;this.pendingRenderTaskId=this.taskService.add(),this.scheduleInRootZone?this.cancelScheduledCallback=Zone.root.run(()=>i(()=>this.tick())):this.cancelScheduledCallback=this.ngZone.runOutsideAngular(()=>i(()=>this.tick()))}shouldScheduleTick(){return!(this.appRef.destroyed||this.pendingRenderTaskId!==null||this.runningTick||this.appRef._runningTick||!this.zonelessEnabled&&this.zoneIsDefined&&Zone.current.get(Js+this.angularZoneId))}tick(){if(this.runningTick||this.appRef.destroyed)return;if(this.appRef.dirtyFlags===0){this.cleanup();return}!this.zonelessEnabled&&this.appRef.dirtyFlags&7&&(this.appRef.dirtyFlags|=1);let n=this.taskService.add();try{this.ngZone.run(()=>{this.runningTick=!0,this.appRef._tick()},void 0,this.schedulerTickApplyArgs)}catch(i){this.applicationErrorHandler(i)}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(i){return new(i||t)};static \u0275prov=yr({token:t,factory:t.\u0275fac})}return t})();function gv(){return[{provide:ho,useExisting:hv},{provide:kn,useClass:ea},{provide:fa,useValue:!0}]}function IM(){return typeof $localize<"u"&&$localize.locale||Ia}var id=new He("",{factory:()=>N(id,{optional:!0,skipSelf:!0})||IM()});var od=class{destroyed=!1;listeners=null;errorHandler=N(Qn,{optional:!0});isEmitting=!1;hasNullListeners=!1;destroyRef=N(pt);constructor(){this.destroyRef.onDestroy(()=>{this.destroyed=!0,this.listeners=null})}subscribe(e){if(this.destroyed)throw new Ne(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(tr(953,!1));return}if(this.listeners===null)return;this.isEmitting=!0;let n=ge(null);try{for(let i of this.listeners)try{i!==null&&i(e)}catch(o){this.errorHandler?.handleError(o)}}finally{this.hasNullListeners&&(this.hasNullListeners=!1,this.listeners&&NM(this.listeners)),ge(n),this.isEmitting=!1}}};function NM(t){let e=t.length-1;for(;e>-1;)t[e]===null&&t.splice(e,1),e--}function E(t,e){return qs(t,e?.equal)}function ii(t){return kg(t)}var yv=class t extends Error{_brand;constructor(e){super(e)}static IDLE=new t("IDLE");static LOADING=new t("LOADING")};function xv(t,e){let n=Object.create(Ty);n.value=t,n.transformFn=e?.transform;function i(){if(Go(n),n.value===Qf){let o=null;throw new Ne(-950,o)}return n.value}return i[fn]=n,i}function it(t){return new od}function _v(t,e){return xv(t,e)}function ZM(t){return xv(Qf,t)}var te=(_v.required=ZM,_v);function vv(t,e){return Z_(e)}function QM(t,e){return Q_(e)}var Xe=(vv.required=QM,vv);function Cv(t,e){return X_(e)}var XM=1e4;var A8=XM-1e3;var jm=new He(""),JM=new He("");function Na(t){return!t.moduleRef}function ek(t){let e=Na(t)?t.r3Injector:t.moduleRef.injector,n=e.get(kn);return n.run(()=>{Na(t)?t.r3Injector.resolveInjectorInitializers():t.moduleRef.resolveInjectorInitializers();let i=e.get(Co),o;if(n.runOutsideAngular(()=>{o=n.onError.subscribe({next:i})}),Na(t)){let r=()=>e.destroy(),s=t.platformInjector.get(jm);s.add(r),e.onDestroy(()=>{o.unsubscribe(),s.delete(r)})}else{let r=()=>t.moduleRef.destroy(),s=t.platformInjector.get(jm);s.add(r),t.moduleRef.onDestroy(()=>{ha(t.allPlatformModules,t.moduleRef),o.unsubscribe(),s.delete(r)})}return nk(i,n,()=>{let r=e.get(is),s=r.add(),a=e.get(Om);return a.runInitializers(),a.donePromise.then(()=>{let c=e.get(id,Ia);if(sv(c||Ia),!e.get(JM,!0))return Na(t)?e.get(Ma):(t.allPlatformModules.push(t.moduleRef),t.moduleRef);if(Na(t)){let p=e.get(Ma);return t.rootComponent!==void 0&&p.bootstrap(t.rootComponent),p}else return tk?.(t.moduleRef,t.allPlatformModules),t.moduleRef}).finally(()=>{r.remove(s)})})})}var tk;function nk(t,e,n){try{let i=n();return Xl(i)?i.catch(o=>{throw e.runOutsideAngular(()=>t(o)),o}):i}catch(i){throw e.runOutsideAngular(()=>t(i)),i}}var rd=null;function ik(t=[],e){return Mn.create({name:e,providers:[{provide:na,useValue:"platform"},{provide:jm,useValue:new Set([()=>rd=null])},...t]})}function ok(t=[]){if(rd)return rd;let e=ik(t);return rd=e,ov(),rk(e),e}function rk(t){let e=t.get(hl,null);tl(t,()=>{e?.forEach(n=>n())})}function Ev(t){let{rootComponent:e,appProviders:n,platformProviders:i,platformRef:o}=t;ht(at.BootstrapApplicationStart);try{let r=o?.injector??ok(i),s=[gv(),B0,...n||[]],a=new Ca({providers:s,parent:r,debugName:"",runEnvironmentInitializers:!1});return ek({r3Injector:a.injector,platformInjector:r,rootComponent:e})}catch(r){return Promise.reject(r)}finally{ht(at.BootstrapApplicationEnd)}}var wv=null;function fs(){return wv}function $m(t){wv??=t}var Oa=class{};var Bm=(()=>{class t{_viewContainerRef;_viewRef=null;ngTemplateOutletContext=null;ngTemplateOutlet=null;ngTemplateOutletInjector=null;injector=N(Mn);constructor(n){this._viewContainerRef=n}ngOnChanges(n){if(this._shouldRecreateView(n)){let i=this._viewContainerRef;if(this._viewRef&&i.remove(i.indexOf(this._viewRef)),!this.ngTemplateOutlet){this._viewRef=null;return}let o=this._createContextForwardProxy();this._viewRef=i.createEmbeddedView(this.ngTemplateOutlet,o,{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,i,o)=>this.ngTemplateOutletContext?Reflect.set(this.ngTemplateOutletContext,i,o):!1,get:(n,i,o)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,i,o)}})}static \u0275fac=function(i){return new(i||t)(Ql(ps))};static \u0275dir=br({type:t,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},features:[Jf]})}return t})();function Hm(t,e){e=encodeURIComponent(e);for(let n of t.split(";")){let i=n.indexOf("="),[o,r]=i==-1?[n,""]:[n.slice(0,i),n.slice(i+1)];if(o.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 Sv="browser";var Pa=class{_doc;constructor(e){this._doc=e}manager},ad=(()=>{class t extends Pa{constructor(n){super(n)}supports(n){return!0}addEventListener(n,i,o,r){return n.addEventListener(i,o,r),()=>this.removeEventListener(n,i,o,r)}removeEventListener(n,i,o,r){return n.removeEventListener(i,o,r)}static \u0275fac=function(i){return new(i||t)(dt(wn))};static \u0275prov=xe({token:t,factory:t.\u0275fac})}return t})(),dd=new He(""),qm=(()=>{class t{_zone;_plugins;_eventNameToPlugin=new Map;constructor(n,i){this._zone=i,n.forEach(s=>{s.manager=this});let o=n.filter(s=>!(s instanceof ad));this._plugins=o.slice().reverse();let r=n.find(s=>s instanceof ad);r&&this._plugins.push(r)}addEventListener(n,i,o,r){return this._findPluginFor(i).addEventListener(n,i,o,r)}getZone(){return this._zone}_findPluginFor(n){let i=this._eventNameToPlugin.get(n);if(i)return i;if(i=this._plugins.find(r=>r.supports(n)),!i)throw new Ne(-5101,!1);return this._eventNameToPlugin.set(n,i),i}static \u0275fac=function(i){return new(i||t)(dt(dd),dt(kn))};static \u0275prov=xe({token:t,factory:t.\u0275fac})}return t})(),Um="ng-app-id";function Tv(t){for(let e of t)e.remove()}function Dv(t,e){let n=e.createElement("style");return n.textContent=t,n}function ck(t,e,n,i){let o=t.head?.querySelectorAll(`style[${Um}="${e}"],link[${Um}="${e}"]`);if(!o||o.length===0)return!1;for(let r of o)r.removeAttribute(Um),r instanceof HTMLLinkElement?i.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 Gm(t,e){let n=e.createElement("link");return n.setAttribute("rel","stylesheet"),n.setAttribute("href",t),n}var Wm=(()=>{class t{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;constructor(n,i,o,r={}){this.doc=n,this.appId=i,this.nonce=o,ck(n,i,this.inline,this.external)&&this.hosts.add(n.head)}addStyles(n,i){for(let o of n)this.addUsage(o,this.inline,Dv);i?.forEach(o=>this.addUsage(o,this.external,Gm))}removeStyles(n,i){for(let o of n)this.removeUsage(o,this.inline);i?.forEach(o=>this.removeUsage(o,this.external))}addUsage(n,i,o){let r=i.get(n);r?r.usage++:i.set(n,{usage:1,elements:[...this.hosts].map(s=>this.addElement(s,o(n,this.doc)))})}removeUsage(n,i){let o=i.get(n);o&&(o.usage--,o.usage<=0&&(Tv(o.elements),i.delete(n)))}ngOnDestroy(){for(let[,{elements:n}]of[...this.inline,...this.external])Tv(n);this.hosts.clear()}addHost(n){if(!this.hosts.has(n)){this.hosts.add(n);for(let[i,{elements:o}]of this.inline)o.push(this.addElement(n,Dv(i,this.doc)));for(let[i,{elements:o}]of this.external)o.push(this.addElement(n,Gm(i,this.doc)))}}removeHost(n){this.hosts.delete(n);for(let i of[...this.inline.values(),...this.external.values()]){let o=[];for(let r of i.elements)r.parentNode===n?r.remove():o.push(r);i.elements=o}}addElement(n,i){return this.nonce&&i.setAttribute("nonce",this.nonce),n.appendChild(i)}static \u0275fac=function(i){return new(i||t)(dt(wn),dt(da),dt(gl,8),dt(ua))};static \u0275prov=xe({token:t,factory:t.\u0275fac})}return t})(),zm={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"},Ym=/%COMP%/g;var kv="%COMP%",lk=`_nghost-${kv}`,dk=`_ngcontent-${kv}`,uk=!0,pk=new He("",{factory:()=>uk}),fk=new He("");function mk(t){return dk.replace(Ym,t)}function hk(t){return lk.replace(Ym,t)}function Iv(t,e){return e.map(n=>n.replace(Ym,t))}var Km=(()=>{class t{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;cssVarNamespace;constructor(n,i,o,r,s,a,c=null,l=null,p=null){this.eventManager=n,this.sharedStylesHost=i,this.appId=o,this.removeStylesOnCompDestroy=r,this.doc=s,this.ngZone=a,this.nonce=c,this.tracingService=l,this.cssVarNamespace=p??"",this.defaultRenderer=new Aa(n,s,a,this.tracingService,this.cssVarNamespace)}createRenderer(n,i){if(!n||!i)return this.defaultRenderer;let o=this.getOrCreateRenderer(n,i);return o instanceof ld?o.applyToHost(n):o instanceof Ra&&o.applyStyles(),o}getOrCreateRenderer(n,i){let o=this.rendererByCompId,r=o.get(i.id);if(!r){let s=this.doc,a=this.ngZone,c=this.eventManager,l=this.sharedStylesHost,p=this.removeStylesOnCompDestroy,f=this.tracingService;switch(i.encapsulation){case vi.Emulated:r=new ld(c,l,i,this.appId,p,s,a,f,this.cssVarNamespace);break;case vi.ShadowDom:return new cd(c,n,i,s,a,this.nonce,f,this.cssVarNamespace,l);case vi.ExperimentalIsolatedShadowDom:return new cd(c,n,i,s,a,this.nonce,f,this.cssVarNamespace);default:r=new Ra(c,l,i,p,s,a,f,this.cssVarNamespace);break}o.set(i.id,r)}return r}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(n){this.rendererByCompId.delete(n)}static \u0275fac=function(i){return new(i||t)(dt(qm),dt(vr),dt(da),dt(pk),dt(wn),dt(kn),dt(gl),dt(to,8),dt(fk,8))};static \u0275prov=xe({token:t,factory:t.\u0275fac})}return t})(),Aa=class{eventManager;doc;ngZone;tracingService;cssVarNamespace;data=Object.create(null);throwOnSyntheticProps=!0;constructor(e,n,i,o,r=""){this.eventManager=e,this.doc=n,this.ngZone=i,this.tracingService=o,this.cssVarNamespace=r}destroy(){}destroyNode=null;createElement(e,n){return n?this.doc.createElementNS(zm[n]||n,e):this.doc.createElement(e)}createComment(e){return this.doc.createComment(e)}createText(e){return this.doc.createTextNode(e)}appendChild(e,n){(Mv(e)?e.content:e).appendChild(n)}insertBefore(e,n,i){if(e){let o=Mv(e)?e.content:e;if(i!=null&&i.parentNode!==o)throw new Ne(-5106,!1);o.insertBefore(n,i)}}removeChild(e,n){n.remove()}selectRootElement(e,n){let i=typeof e=="string"?this.doc.querySelector(e):e;if(!i)throw new Ne(-5104,!1);return n||(i.textContent=""),i}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,n,i,o){if(o){n=o+":"+n;let r=zm[o];r?e.setAttributeNS(r,n,i):e.setAttribute(n,i)}else e.setAttribute(n,i)}removeAttribute(e,n,i){if(i){let o=zm[i];o?e.removeAttributeNS(o,n):e.removeAttribute(`${i}:${n}`)}else e.removeAttribute(n)}addClass(e,n){e.classList.add(n)}removeClass(e,n){e.classList.remove(n)}setStyle(e,n,i,o){let r=n.startsWith("--");r&&(n=n.replace("%NS%",this.cssVarNamespace)),r||o&(Ri.DashCase|Ri.Important)?e.style.setProperty(n,i,o&Ri.Important?"important":""):e.style[n]=i}removeStyle(e,n,i){let o=n.startsWith("--");o&&(n=n.replace("%NS%",this.cssVarNamespace)),o||i&Ri.DashCase?e.style.removeProperty(n):e.style[n]=""}setProperty(e,n,i){e!=null&&(e[n]=i)}setValue(e,n){e.nodeValue=n}listen(e,n,i,o){if(typeof e=="string"&&(e=fs().getGlobalEventTarget(this.doc,e),!e))throw new Ne(-5102,!1);let r=this.decoratePreventDefault(i);return this.tracingService?.wrapEventListener&&(r=this.tracingService.wrapEventListener(e,n,r)),this.eventManager.addEventListener(e,n,r,o)}decoratePreventDefault(e){return n=>{if(n==="__ngUnwrap__")return e;e(n)===!1&&n.preventDefault()}}};function Mv(t){return t.tagName==="TEMPLATE"&&t.content!==void 0}var cd=class extends Aa{hostEl;sharedStylesHost;shadowRoot;constructor(e,n,i,o,r,s,a,c,l){super(e,o,r,a,c),this.hostEl=n,this.sharedStylesHost=l,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost&&this.sharedStylesHost.addHost(this.shadowRoot);let p=i.styles;p=Iv(i.id,p).map(_=>_.replace(/%NS%/g,c));for(let _ of p){let x=document.createElement("style");s&&x.setAttribute("nonce",s),x.textContent=_,this.shadowRoot.appendChild(x)}let f=i.getExternalStyles?.();if(f)for(let _ of f){let x=Gm(_,o);s&&x.setAttribute("nonce",s),this.shadowRoot.appendChild(x)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}appendChild(e,n){return super.appendChild(this.nodeOrShadowRoot(e),n)}insertBefore(e,n,i){return super.insertBefore(this.nodeOrShadowRoot(e),n,i)}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)}},Ra=class extends Aa{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(e,n,i,o,r,s,a,c,l){super(e,r,s,a,c),this.sharedStylesHost=n,this.removeStylesOnCompDestroy=o;let p=i.styles,f=l?Iv(l,p):p;this.styles=f.map(_=>_.replace(/%NS%/g,c)),this.styleUrls=i.getExternalStyles?.(l)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&mm.size===0&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},ld=class extends Ra{contentAttr;hostAttr;constructor(e,n,i,o,r,s,a,c,l){let p=o+"-"+i.id;super(e,n,i,r,s,a,c,l,p),this.contentAttr=mk(p),this.hostAttr=hk(p)}applyToHost(e){this.applyStyles(),this.setAttribute(e,this.hostAttr,"")}createElement(e,n){let i=super.createElement(e,n);return super.setAttribute(i,this.contentAttr,""),i}};var ud=class t extends Oa{supportsDOMEvents=!0;static makeCurrent(){$m(new t)}onAndCancel(e,n,i,o){return e.addEventListener(n,i,o),()=>{e.removeEventListener(n,i,o)}}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=gk();return n==null?null:yk(n)}resetBaseElement(){La=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return Hm(document.cookie,e)}},La=null;function gk(){return La=La||document.head.querySelector("base"),La?La.getAttribute("href"):null}function yk(t){return new URL(t,document.baseURI).pathname}var Nv=["alt","control","meta","shift"],_k={"\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"},vk={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey},Ov=(()=>{class t extends Pa{constructor(n){super(n)}supports(n){return t.parseEventName(n)!=null}addEventListener(n,i,o,r){let s=t.parseEventName(i),a=t.eventCallback(s.fullKey,o,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>fs().onAndCancel(n,s.domEventName,a,r))}static parseEventName(n){let i=n.toLowerCase().split("."),o=i.shift();if(i.length===0||!(o==="keydown"||o==="keyup"))return null;let r=t._normalizeKey(i.pop()),s="",a=i.indexOf("code");if(a>-1&&(i.splice(a,1),s="code."),Nv.forEach(l=>{let p=i.indexOf(l);p>-1&&(i.splice(p,1),s+=l+".")}),s+=r,i.length!=0||r.length===0)return null;let c={};return c.domEventName=o,c.fullKey=s,c}static matchEventFullKeyCode(n,i){let o=_k[n.key]||n.key,r="";return i.indexOf("code.")>-1&&(o=n.code,r="code."),o==null||!o?!1:(o=o.toLowerCase(),o===" "?o="space":o==="."&&(o="dot"),Nv.forEach(s=>{if(s!==o){let a=vk[s];a(n)&&(r+=s+".")}}),r+=o,r===i)}static eventCallback(n,i,o){return r=>{t.matchEventFullKeyCode(r,n)&&o.runGuarded(()=>i(r))}}static _normalizeKey(n){return n==="esc"?"escape":n}static \u0275fac=function(i){return new(i||t)(dt(wn))};static \u0275prov=xe({token:t,factory:t.\u0275fac})}return t})();async function Zm(t,e,n){let i=V({rootComponent:t},bk(e,n));return Ev(i)}function bk(t,e){return{platformRef:e?.platformRef,appProviders:[...Sk,...t?.providers??[]],platformProviders:wk}}function xk(){ud.makeCurrent()}function Ck(){return new Qn}function Ek(){return nm(document),document}var wk=[{provide:ua,useValue:Sv},{provide:hl,useValue:xk,multi:!0},{provide:wn,useFactory:Ek}];var Sk=[{provide:na,useValue:"root"},{provide:Qn,useFactory:Ck},{provide:dd,useClass:ad,multi:!0},{provide:dd,useClass:Ov,multi:!0},Km,{provide:vr,useClass:Wm},{provide:Wm,useExisting:vr},qm,{provide:Xi,useExisting:Km},[]];var Fa=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275prov=xe({token:t,factory:function(i){let o=null;return i?o=new(i||t):o=dt(Tk),o},providedIn:"root"})}return t})(),Tk=(()=>{class t extends Fa{_doc=N(wn);sanitize(n,i){if(i==null)return null;switch(n){case Pt.NONE:return i;case Pt.HTML:return Ji(i,"HTML")?ni(i):Hl(this._doc,String(i)).toString();case Pt.STYLE:return Ji(i,"Style")?ni(i):i;case Pt.SCRIPT:if(Ji(i,"Script"))return ni(i);throw new Ne(5200,!1);case Pt.URL:return Ji(i,"URL")?ni(i):wa(String(i));case Pt.RESOURCE_URL:if(Ji(i,"ResourceURL"))return ni(i);throw new Ne(-5201,!1);default:throw new Ne(5202,!1)}}bypassSecurityTrustHtml(n){return sm(n)}bypassSecurityTrustStyle(n){return am(n)}bypassSecurityTrustScript(n){return cm(n)}bypassSecurityTrustUrl(n){return lm(n)}bypassSecurityTrustResourceUrl(n){return dm(n)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=yr({token:t,factory:t.\u0275fac})}return t})();var Pv={providers:[nf()]};var oi=typeof window<"u",pd=oi?window:null,So=oi?document:null,yt={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},Pe={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},en={NONE:0,AUTO:1,FORCE:2},Nt={replace:0,none:1,blend:2},Qm=Symbol(),Li=Symbol(),fd=Symbol(),To=Symbol(),md=Symbol(),Ae=1e-11,Va=1e12,ri=1e3,ja=240,si="",Av="var(",$a=[],hd=(()=>{let t=new Map;return t.set("x","translateX"),t.set("y","translateY"),t.set("z","translateZ"),t})(),ms=["perspective","translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY"],Rv=ms.reduce((t,e)=>K(V({},t),{[e]:e+"("}),{}),Kt=()=>{},Lv=t=>t,Fv=/\)\s*[-.\d]/,Vv=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,jv=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,$v=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,Bv=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,Hv=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,Xm=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,gd=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,Uv=/([a-z])([A-Z])/g,zv=/(\*=|\+=|-=)/,Gv=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/;var hs={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:ja,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:ri,delay:0,loopDelay:0,ease:"out(2)",composition:Nt.replace,modifier:Lv,onBegin:Kt,onBeforeUpdate:Kt,onUpdate:Kt,onLoop:Kt,onPause:Kt,onComplete:Kt,onRender:Kt},Ba={current:null,root:So},Ie={defaults:hs,precision:4,timeScale:1,tickThreshold:200,editor:null},Jm={version:"4.5.0",engine:null};oi&&(pd.AnimeJS||(pd.AnimeJS=[]),pd.AnimeJS.push(Jm));var th=t=>t.replace(Uv,"$1-$2").toLowerCase(),Hn=(t,e)=>t.indexOf(e)===0,io=Date.now,Un=Array.isArray,Cr=t=>t&&t.constructor===Object,Nn=t=>typeof t=="number"&&!isNaN(t),On=t=>typeof t=="string",tn=t=>typeof t=="function",le=t=>typeof t>"u",Fi=t=>le(t)||t===null,yd=t=>oi&&t instanceof SVGElement,nh=t=>Vv.test(t),ih=t=>Hn(t,"rgb"),oh=t=>Hn(t,"hsl"),qv=t=>nh(t)||(ih(t)||oh(t))&&(t[t.length-1]===")"||!Fv.test(t)),Ha=t=>!Ie.defaults.hasOwnProperty(t),Dk=["opacity","rotate","overflow","color"],Wv=(t,e)=>{if(Dk.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}},_d=t=>On(t)?parseFloat(t):t,Er=Math.pow,Do=Math.sqrt,Yv=Math.sin,Kv=Math.cos,xr=Math.abs;var wr=Math.floor,Zv=Math.asin;var Ua=Math.PI,eh=Math.round,_n=(t,e,n)=>t<e?e:t>n?n:t,Ye=(t,e)=>{if(e<0)return t;if(!e)return eh(t);let n=10**e;return eh(t*n)/n},Qv=(t,e)=>Un(e)?e.reduce((n,i)=>xr(i-t)<xr(n-t)?i:n):e?eh(t/e)*e:t,oo=(t,e,n)=>n===1?e:n===0?t:t+(e-t)*n,Sr=t=>t===1/0?Va:t===-1/0?-Va:t,ro=t=>t<=Ae?Ae:Sr(Ye(t,11)),Zt=t=>Un(t)?[...t]:t,vd=(t,e)=>{let n=V({},t);for(let i in e){let o=t[i];n[i]=le(o)?e[i]:o}return n},ot=(t,e,n,i="_prev",o="_next")=>{let r=t._head,s=o;for(n&&(r=t._tail,s=i);r;){let a=r[s];e(r),r=a}},zn=(t,e,n="_prev",i="_next")=>{let o=e[n],r=e[i];o?o[i]=r:t._head=r,r?r[n]=o:t._tail=o,e[n]=null,e[i]=null},Pn=(t,e,n,i="_prev",o="_next")=>{let r=t._tail;for(;r&&n&&n(r,e);)r=r[i];let s=r?r[o]:t._head;r?r[o]=e:t._head=e,s?s[i]=e:t._tail=e,e[i]=r,e[o]=s};var Xv=(t,e,n)=>{let i=t.style.transform;if(i){let o=t[To],r=0,s=i.length,a;for(;r<s;){for(;r<s&&i.charCodeAt(r)===32;)r++;if(r>=s)break;let l=r;for(;r<s&&i.charCodeAt(r)!==40;)r++;if(r>=s)break;let p=i.substring(l,r),f=1,_=r+1,x=-1,C=-1;for(r++;r<s&&f>0;){let P=i.charCodeAt(r);P===40?f++:P===41?f--:P===44&&f===1&&(x===-1?x=r:C===-1&&(C=r)),r++}let T=r-1;p==="translate"||p==="translate3d"?(x===-1?o.translateX=i.substring(_,T).trim():(o.translateX=i.substring(_,x).trim(),C===-1?o.translateY=i.substring(x+1,T).trim():(o.translateY=i.substring(x+1,C).trim(),o.translateZ=i.substring(C+1,T).trim())),a=i.substring(_,T)):p==="scale"||p==="scale3d"?x===-1?o.scale=i.substring(_,T).trim():(o.scaleX=i.substring(_,x).trim(),C===-1?o.scaleY=i.substring(x+1,T).trim():(o.scaleY=i.substring(x+1,C).trim(),o.scaleZ=i.substring(C+1,T).trim())):o[p]=i.substring(_,T)}if(e==="translate3d"&&a)return n&&(n[e]=a),a;let c=o[e];if(!le(c))return n&&(n[e]=c),c}return e==="translate3d"?"0px, 0px, 0px":e==="rotate3d"?"0, 0, 0, 0deg":Hn(e,"scale")?"1":Hn(e,"rotate")||Hn(e,"skew")?"0deg":"0px"},bd=t=>{let e=si;for(let n=0,i=ms.length;n<i;n++){let o=ms[n],r=t[o];if(r!==void 0){if(o==="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(o==="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+=`${Rv[o]}${r}) `}o==="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 rh=[];function xd(t,e){if(!t)return null;let n=rh.length;e:for(let i=0;i<n;i++){let o=rh[i];if(o.detect&&!o.detect(t))continue;let r=o.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 i=0;i<n;i++){let o=rh[i];if(o.detect&&!o.detect(t))continue;let r=o.propertyResolvers;for(let s=0,a=r.length;s<a;s++){let c=r[s](t,e);if(c)return c}}return null}var Mk=t=>{let e=jv.exec(t)||$v.exec(t),n=le(e[4])?1:+e[4];return[+e[1],+e[2],+e[3],n]},kk=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]},sh=(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),Ik=t=>{let e=Bv.exec(t)||Hv.exec(t),n=+e[1]/360,i=+e[2]/100,o=+e[3]/100,r=le(e[4])?1:+e[4],s,a,c;if(i===0)s=a=c=o;else{let l=o<.5?o*(1+i):o+i-o*i,p=2*o-l;s=Ye(sh(p,l,n+1/3)*255,0),a=Ye(sh(p,l,n)*255,0),c=Ye(sh(p,l,n-1/3)*255,0)}return[s,a,c,r]},Jv=t=>ih(t)?Mk(t):nh(t)?kk(t):oh(t)?Ik(t):[0,0,0,1];var Ot=(t,e)=>le(t)?e:t,eb=(t,e)=>{let n=t.match(Gv),i=e[Li]?e:document.documentElement,o=getComputedStyle(i)?.getPropertyValue(n[1]);return(!o||o.trim()===si)&&n[2]&&(o=n[2].trim()),o||0},Vi=(t,e,n,i,o,r)=>{if(tn(t)){if(!o){let a=t(e,n,i,r);return isNaN(+a)?a||0:+a}let s=()=>{let a=t(e,n,i,r);return isNaN(+a)?a||0:+a};return o.func=s,s()}if(On(t)&&Hn(t,Av)){if(!o)return eb(t,e);let s=()=>eb(t,e);return o.func=s,s()}return t},za=(t,e)=>t[Li]?t[fd]&&Wv(t,e)?yt.ATTRIBUTE:ms.includes(e)||hd.get(e)?yt.TRANSFORM:Hn(e,"--")?yt.CSS_VAR:e in t.style?yt.CSS:e in t?yt.OBJECT:yt.ATTRIBUTE:yt.OBJECT,tb=(t,e,n)=>{let i=t.style[e];i&&n&&(n[e]=i);let o=i||getComputedStyle(t[md]||t).getPropertyValue(e);return o==="auto"?"0":o},ji=(t,e,n,i)=>{let o=le(n)?za(t,e):n,r=xd(t,e);if(r){let s=r.get(t);return s&&i&&(i[e]=s),s??0}if(o===yt.OBJECT){let s=t[e];return s&&i&&(i[e]=s),s||0}if(o===yt.ATTRIBUTE){let s=t.getAttribute(e);return s&&i&&(i[e]=s),s}return o===yt.TRANSFORM?Xv(t,e,i):o===yt.CSS_VAR?tb(t,e,i).trimStart():tb(t,e,i)},gs=(t,e,n)=>n==="-"?t-e:n==="+"?t+e:t*e,Cd=()=>({t:Pe.NUMBER,n:0,u:null,o:null,d:null,s:null}),vn=(t,e)=>{if(e.t=Pe.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 i=t;i[1]==="="&&(e.o=i[0],i=i.slice(2));let o=i.includes(" ")?!1:gd.exec(i);if(o)return e.t=Pe.UNIT,e.n=+o[1],e.u=o[2],e;if(e.o)return e.n=+i,e;if(qv(i))return e.t=Pe.COLOR,e.d=Jv(i),e;{let r=i.match(Xm);return e.t=Pe.COMPLEX,e.d=r?r.map(Number):[],e.s=i.split(Xm)||[],e}},ah=(t,e)=>(e.t=t._valueType,e.n=t._toNumber,e.u=t._unit,e.o=null,e.d=Zt(t._toNumbers),e.s=Zt(t._strings),e),nn=Cd(),Ed=(t,e,n)=>{let i=t._modifier,o=t._fromNumbers,r=t._toNumbers,s=t._strings,a=s[0];for(let c=0,l=r.length;c<l;c++){let p=i(Ye(oo(o[c],r[c],e),n)),f=s[c+1];a+=`${f?p+f:p}`,t._numbers[c]=p}return a};var Ga=(t,e,n,i,o)=>{let r=t.parent,s=t.duration,a=t.completed,c=t.iterationDuration,l=t.iterationCount,p=t._currentIteration,f=t._loopDelay,_=t._reversed,x=t._alternate,C=t._hasChildren,T=t._delay,P=t._currentTime,Y=T+c,W=e-T,be=_n(P,-T,s),ye=_n(W,-T,s),Me=W-P,me=ye>0,Je=ye>=s,je=s<=Ae,Be=o===en.FORCE,ft=0,St=W,Rt=0;if(l>1){let Q=c+(Je?0:f),G=~~(ye/Q);t._currentIteration=_n(G,0,l),Je&&t._currentIteration--,ft=t._currentIteration%2,St=ye-G*Q||0}let kt=_^(x&&ft),et=t._ease,Se=Je?kt?0:s:kt?c-St:St;et&&(Se=c*et(Se/c)||0);let R=(r?r.backwards:W<P)?!kt:!!kt;if(t._currentTime=W,t._iterationTime=Se,t.backwards=R,me&&!t.began?(t.began=!0,!n&&!(r&&(R||!r.began))&&t.onBegin(t)):W<=0&&(t.began=!1),!n&&!C&&me&&t._currentIteration!==p&&t.onLoop(t),Be||o===en.AUTO&&(e>=(r&&T>0?0:T)&&e<=Y||e<=T&&be>T||e>=Y&&be!==s)||Se>=Y&&be!==s||Se<=T&&be>0&&!Je||e<=be&&be===s&&a||Je&&!a&&je){if(me&&(t.computeDeltaTime(be),n||t.onBeforeUpdate(t)),!C){let Q=Be||(R?Me*-1:Me)>=Ie.tickThreshold,G=Ye(t._offset+(r?r._offset:0)+T+Se,12),L=t._head,ne,Le,tt,Ut,Ce=0;for(;L;){let bt=L._composition,ze=L._currentTime,an=L._changeDuration,zt=L._absoluteStartTime+L._changeDuration,Ke=L._nextRep,Wt=L._prevRep,Lt=bt!==Nt.none,Re=Wt?Wt._absoluteStartTime+Wt._changeDuration:0,qe=Wt&&Wt.parent!==L.parent,ke=!Ke||Ke._isOverridden?zt:Ke.parent===L.parent?zt+Ke._delay:Ke._absoluteStartTime<Ke._absoluteUpdateStartTime?Ke._absoluteStartTime:Ke._absoluteUpdateStartTime;if((Q||(ze!==an||G<=ke||Wt&&!qe&&(!Ke||Ke.parent!==L.parent))&&(ze!==0||G>=L._absoluteStartTime||qe&&!L._hasFromValue&&!Wt._isOverridden&&G>=Re||Ke&&!Ke._isOverridden&&Ke.parent===L.parent&&Ke._currentTime!==0&&Se<Ke._startTime))&&(!Wt||qe||Se>=L._startTime)&&(!Lt||!L._isOverridden&&(!L._isOverlapped||G<=zt)&&(!Ke||Ke._isOverridden||G<=ke)&&(!Wt||Wt._isOverridden||(qe?G>=L._absoluteStartTime||!L._hasFromValue&&G>=Re:G>=Re+L._delay)))){let rt=L._currentTime=_n(Se-L._startTime,0,an),pe=L._ease(rt/L._updateDuration),ut=L._modifier,Z=L._valueType,_t=L._tweenType,Qe=_t===yt.OBJECT,de=Z===Pe.NUMBER,Et=de&&Qe||pe===0||pe===1?-1:Ie.precision,Ee,lt;if(de)Ee=lt=ut(Ye(oo(L._fromNumber,L._toNumber,pe),Et));else if(Z===Pe.UNIT)lt=ut(Ye(oo(L._fromNumber,L._toNumber,pe),Et)),Ee=`${lt}${L._unit}`;else if(Z===Pe.COLOR){let Ge=L._numbers,j=L._fromNumbers,H=L._toNumbers,ee=1-pe,fe=j[0],mt=j[1],Tt=j[2],Yn=H[0],yn=H[1],Ti=H[2];Ge[0]=ut(Math.sqrt(fe*fe*ee+Yn*Yn*pe)),Ge[1]=ut(Math.sqrt(mt*mt*ee+yn*yn*pe)),Ge[2]=ut(Math.sqrt(Tt*Tt*ee+Ti*Ti*pe)),Ge[3]=ut(oo(j[3],H[3],pe)),(!L._setter||i)&&(Ee=`rgba(${Ye(Ge[0],0)},${Ye(Ge[1],0)},${Ye(Ge[2],0)},${Ge[3]})`)}else Z===Pe.COMPLEX&&(Ee=Ed(L,pe,Et));if(Lt&&(L._number=lt),!i&&bt!==Nt.blend){let Ge=L.property;ne=L.target,L._setter?L._setter(ne,lt,L):Qe?ne[Ge]=Ee:_t===yt.ATTRIBUTE?ne.setAttribute(Ge,Ee):(Le=ne.style,_t===yt.TRANSFORM?(ne!==tt&&(tt=ne,Ut=ne[To]),Ut[Ge]=Ee,Ce=1):_t===yt.CSS?Le[Ge]=Ee:_t===yt.CSS_VAR&&Le.setProperty(Ge,Ee)),me&&(Rt=1)}else L._value=Ee}else ze&&Wt&&!qe&&Se<L._startTime&&(L._currentTime=0);Ce&&L._renderTransforms&&(Le.transform=bd(Ut),Ce=0),L=L._next}!n&&Rt&&t.onRender(t)}!n&&me&&t.onUpdate(t)}return r&&je?!n&&(r.began&&!R&&W>0&&!a||R&&W<=Ae&&a)&&(t.onComplete(t),t.completed=!R):me&&Je?l===1/0?t._startTime+=t.duration:t._currentIteration>=l-1&&(t.paused=!0,!a&&!C&&(t.completed=!0,!n&&!(r&&(R||!r.began))&&(t.onComplete(t),t._resolve(t)))):t.completed=!1,Rt},$i=(t,e,n,i,o)=>{let r=t._currentIteration;if(Ga(t,e,n,i,o),t._hasChildren){let s=t,a=s.backwards,c=i?e:s._iterationTime,l=io(),p=0,f=!0;if(!i&&s._currentIteration!==r){let _=s.iterationDuration;ot(s,x=>{if(!a)!x.completed&&!x.backwards&&x._currentTime<x.iterationDuration&&Ga(x,_,n,1,en.FORCE),x.began=!1,x.completed=!1;else{let C=x.duration,T=x._offset+x._delay,P=T+C;!n&&C<=Ae&&(!T||P===_)&&x.onComplete(x)}}),n||s.onLoop(s)}ot(s,_=>{let x=Ye((c-_._offset)*_._speed,12);if(a&&x>_._delay+_.duration)return;let C=_._fps<s._fps?_.requestTick(l):o;p+=Ga(_,x,n,i,C),!_.completed&&f&&(f=!1)},a),!n&&p&&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 nb={},ys=(t,e,n)=>{if(n===yt.TRANSFORM){let i=hd.get(t);return i||t}else if(n===yt.CSS||n===yt.ATTRIBUTE&&yd(e)&&t in e.style){let i=nb[t];if(i)return i;{let o=t&&th(t);return nb[t]=o,o}}else return t},_s=(t,e=!1)=>{if(t._hasChildren)ot(t,n=>_s(n,e),!0);else{let n=t;n.pause(),ot(n,i=>{let o=i.property,r=i.target,s=i._tweenType,a=i._inlineValue,c=Fi(a)||a===si;if(i._setter){if(!e&&!c){if(vn(a,nn),nn.d){let l=nn.d,p=i._numbers;for(let f=0,_=l.length;f<_;f++)p[f]=l[f]}else i._number=nn.n;i._setter(i.target,i._number,i)}}else if(s===yt.OBJECT)!e&&!c&&(r[o]=a);else if(r[Li])if(s===yt.ATTRIBUTE)e||(c?r.removeAttribute(o):r.setAttribute(o,a));else{let l=r.style;if(s===yt.TRANSFORM){let p=r[To];c?delete p[o]:p[o]=a,i._renderTransforms&&(Object.keys(p).length?l.transform=bd(p):l.removeProperty("transform"))}else c?l.removeProperty(th(o)):l[o]=a}r[Li]&&n._tail===i&&n.targets.forEach(l=>{l.getAttribute&&l.getAttribute("style")===si&&l.removeAttribute("style")})})}return t},ib=t=>_s(t,!0);var vs=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=ri/ja,this._fps=ja,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){let n=+e,i=n<Ae?Ae:n,o=ri/i;i>hs.frameRate&&(hs.frameRate=i),this._fps=i,this._frameDuration=o}get speed(){return this._speed}set speed(e){let n=+e;this._speed=n<Ae?Ae:n}requestTick(e){let n=this._frameDuration,i=e-this._lastTickTime,o=n*.25,r=o<4?o:4;return i+r<n?en.NONE:(this._lastTickTime=i>=n?e-i%n:e,en.AUTO)}computeDeltaTime(e){let n=e-this._lastTime;return this.deltaTime=n,this._lastTime=e,n}};var so={animation:null,update:Kt},ob=t=>{let e=so.animation;return e||(e={duration:Ae,computeDeltaTime:Kt,_offset:0,_delay:0,_head:null,_tail:null},so.animation=e,so.update=()=>{t.forEach(n=>{for(let i in n){let o=n[i],r=o._head;if(r){let s=r._valueType,a=s===Pe.COMPLEX||s===Pe.COLOR?Zt(r._fromNumbers):null,c=r._fromNumber,l=o._tail;for(;l&&l!==r;){if(a)for(let p=0,f=l._numbers.length;p<f;p++)a[p]+=l._numbers[p];else c+=l._number;l=l._prevAdd}r._toNumber=c,r._toNumbers=a}}}),Ga(e,1,1,0,en.FORCE)}),e};var rb=oi?requestAnimationFrame:setImmediate,Nk=oi?cancelAnimationFrame:clearImmediate,ch=class extends vs{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=hs,this.paused=!0,this.reqId=0}update(){let e=this._currentTime=io();if(this.requestTick(e)){this.computeDeltaTime(e);let n=this._speed,i=this._fps,o=this._head;for(;o;){let r=o._next;o.paused?(zn(this,o),this._hasChildren=!!this._tail,o._running=!1,o.completed&&!o._cancelled&&o.cancel()):$i(o,(e-o._startTime)*o._speed*n,0,0,o._fps<i?o.requestTick(e):en.AUTO),o=r}so.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(io()),this.reqId=rb(sb)),this}pause(){if(this.reqId)return this.paused=!0,Ok()}resume(){if(this.paused)return this.paused=!1,ot(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(Ie.timeScale===1?1:ri)}set speed(e){let n=e*Ie.timeScale;this._speed!==n&&(this._speed=n,ot(this,i=>i.speed=i._speed))}get timeUnit(){return Ie.timeScale===1?"ms":"s"}set timeUnit(e){let i=e==="s",o=i?.001:1;if(Ie.timeScale!==o){Ie.timeScale=o,Ie.tickThreshold=200*o;let r=i?.001:ri;this.defaults.duration*=r,this._speed*=r}}get precision(){return Ie.precision}set precision(e){Ie.precision=e}},on=(()=>{let t=new ch(io());return oi&&(Jm.engine=t,So.addEventListener("visibilitychange",()=>{t.pauseOnDocumentHidden&&(So.hidden?t.pause():t.resume())})),t})(),sb=()=>{on._head?(on.reqId=rb(sb),on.update()):on.reqId=0},Ok=()=>(Nk(on.reqId),on.reqId=0,on);var wd={_rep:new WeakMap,_add:new Map},Wa=(t,e,n="_rep")=>{let i=wd[n],o=i.get(t);return o||(o={},i.set(t,o)),o[e]?o[e]:o[e]={_head:null,_tail:null}},Pk=(t,e)=>t._isOverridden||t._absoluteStartTime>e._absoluteStartTime,qa=t=>{t._isOverlapped=1,t._isOverridden=1,t._changeDuration=Ae,t._currentTime=Ae},Sd=(t,e)=>{let n=t._composition;if(n===Nt.replace){let i=t._absoluteStartTime;Pn(e,t,Pk,"_prevRep","_nextRep");let o=t._prevRep;if(o){let r=o.parent,s=o._absoluteEndTime;if(t.parent.id!==r.id&&r.iterationCount>1&&s+(r.duration-r.iterationDuration)>i){qa(o);let l=o._prevRep;for(;l&&l.parent.id===r.id;)qa(l),l=l._prevRep}let a=t._absoluteUpdateStartTime;if(s>a){let l=o._startTime,p=s-(l+o._updateDuration),f=Ye(a-p-l,12);o._changeDuration=f,o._currentTime=f,o._isOverlapped=1,f<Ae&&qa(o)}let c=t.parent.parent;if(!c||c!==r.parent){let l=!0;if(ot(r,p=>{p._isOverlapped||(l=!1)}),l){let p=r.parent;if(p){let f=!0;ot(p,_=>{_!==r&&ot(_,x=>{x._isOverlapped||(f=!1)})}),f&&p.cancel()}else r.cancel()}}}}else if(n===Nt.blend){let i=Wa(t.target,t.property,"_add"),o=ob(wd._add),r=i._head;r||(r=V({},t),r._composition=Nt.replace,r._updateDuration=Ae,r._startTime=0,r._numbers=Zt(t._fromNumbers),r._number=0,r._next=null,r._prev=null,Pn(i,r),Pn(o,r));let s=t._toNumber;if(t._fromNumber=r._fromNumber-s,t._toNumber=0,t._numbers=Zt(t._fromNumbers),t._number=0,r._fromNumber=s,t._toNumbers.length){let a=Zt(t._toNumbers);a.forEach((c,l)=>{t._fromNumbers[l]=r._fromNumbers[l]-c,t._toNumbers[l]=0}),r._fromNumbers=a}Pn(i,t,null,"_prevAdd","_nextAdd")}return t},lh=t=>{let e=t._composition;if(e!==Nt.none){let n=t.target,i=t.property,s=wd._rep.get(n)[i];if(zn(s,t,"_prevRep","_nextRep"),e===Nt.blend){let a=wd._add,c=a.get(n);if(!c)return;let l=c[i],p=so.animation;zn(l,t,"_prevAdd","_nextAdd");let f=l._head;if(f&&f===l._tail){zn(l,f,"_prevAdd","_nextAdd"),zn(p,f);let _=!0;for(let x in c)if(c[x]._head){_=!1;break}_&&a.delete(n)}}}return t},ab=(t,e,n)=>{let i=!1;return ot(e,o=>{let r=o.target;if(t.includes(r)){let s=o.property,a=o._tweenType,c=ys(n,r,a);(!c||c&&c===s)&&(o.parent._tail===o&&o._tweenType===yt.TRANSFORM&&o._prev&&o._prev._tweenType===yt.TRANSFORM&&(o._prev._renderTransforms=1),zn(e,o),lh(o),i=!0)}},!0),i},Ya=(t,e,n)=>{let i=e||on,o;if(i._hasChildren){let r=0;ot(i,s=>{if(!s._hasChildren)if(o=ab(t,s,n),o&&!s._head)s.cancel(),zn(i,s);else{let c=s._offset+s._delay+s.duration;c>r&&(r=c)}s._head?Ya(t,s,n):s._hasChildren=!1},!0),le(i.iterationDuration)||(i.iterationDuration=r)}else o=ab(t,i,n);o&&!i._head&&(i._hasChildren=!1,i.cancel&&i.cancel())};var cb=t=>(t.paused=!0,t.began=!1,t.completed=!1,t),dh=t=>(t._cancelled&&(t._hasChildren?ot(t,dh):ot(t,e=>{e._composition!==Nt.none&&Sd(e,Wa(e.target,e.property))}),t._cancelled=0),t),lb=0,Ak=(t,e)=>t._priority>e._priority,ao=class extends vs{constructor(e={},n=null,i=0){super(0),++lb;let{id:o,delay:r,duration:s,reversed:a,alternate:c,loop:l,loopDelay:p,autoplay:f,frameRate:_,playbackRate:x,priority:C,onComplete:T,onLoop:P,onPause:Y,onBegin:W,onBeforeUpdate:be,onUpdate:ye}=e;Ba.current&&Ba.current.register(this);let Me=n?0:on._lastTickTime,me=n?n.defaults:Ie.defaults,Je=tn(r)||le(r)?me.delay:+r,je=tn(s)||le(s)?1/0:+s,Be=Ot(l,me.loop),ft=Ot(p,me.loopDelay),St=Be===!0||Be===1/0||Be<0?1/0:Be+1,Rt=0;n?Rt=i:(on.reqId||on.requestTick(io()),Rt=(on._lastTickTime-on._startTime)*Ie.timeScale),this.id=le(o)?lb:o,this.parent=n,this.duration=Sr((je+ft)*St-ft)||Ae,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=W||me.onBegin,this.onBeforeUpdate=be||me.onBeforeUpdate,this.onUpdate=ye||me.onUpdate,this.onLoop=P||me.onLoop,this.onPause=Y||me.onPause,this.onComplete=T||me.onComplete,this.iterationDuration=je,this.iterationCount=St,this._autoplay=n?!1:Ot(f,me.autoplay),this._offset=Rt,this._delay=Je,this._loopDelay=ft,this._iterationTime=0,this._currentIteration=0,this._resolve=Kt,this._running=!1,this._reversed=+Ot(a,me.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=Ot(c,me.alternate),this._prev=null,this._next=null,this._lastTickTime=Me,this._startTime=Me,this._lastTime=Me,this._fps=Ot(_,me.frameRate),this._speed=Ot(x,me.playbackRate),this._priority=+Ot(C,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return _n(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 _n(Ye(this._iterationTime,Ie.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return _n(Ye(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return _n(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*_n(+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 dh(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,$i(this,0,1,~~e,en.FORCE),cb(this),this._hasChildren&&ot(this,cb),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&$i(this,this.duration,1,~~e,en.FORCE),this.reset(e);let n=this._autoplay;return n===!0?this.resume():n&&!le(n.linked)&&n.link(this),this}resetTime(){let e=1/(this._speed*on._speed);return this._startTime=io()-(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?$i(this,Ae,0,0,en.FORCE):(this._running||(Pn(on,this,Ak),on._hasChildren=!0,this._running=!0),this.resetTime(),this._startTime-=12,on.wake()),this):this}restart(){return this.reset().resume()}seek(e,n=0,i=0){dh(this),this.completed=!1;let o=this.paused;return this.paused=!0,$i(this,e+this._delay,~~n,~~i,en.AUTO),o?this:this.resume()}alternate(){let e=this._reversed,n=this.iterationCount,i=this.iterationDuration,o=n===1/0?wr(Va/i):n;return this._reversed=+(this._alternate&&!(o%2)?e:!e),n===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(i*o-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?ot(this,e=>e.cancel(),!0):ot(this,lh),this._cancelled=1,this.pause()}stretch(e){let n=this.duration,i=ro(e);if(n===i)return this;let o=e/n,r=e<=Ae;return this.duration=r?Ae:i,this.iterationDuration=r?Ae:ro(this.iterationDuration*o),this._offset*=o,this._delay*=o,this._loopDelay*=o,this}revert(){$i(this,0,1,0,en.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=Kt){let n=this.then,i=()=>{this.then=null,e(this),this.then=n,this._resolve=Kt};return new Promise(o=>(this._resolve=()=>o(i()),this.completed&&this._resolve(),this))}};function db(t){let e=On(t)?Ba.root.querySelectorAll(t):t;if(e instanceof NodeList||e instanceof HTMLCollection)return e}function Mo(t){if(Fi(t))return[];if(!oi)return Un(t)&&t.flat(1/0)||[t];if(Un(t)){let n=t.flat(1/0),i=[];for(let o=0,r=n.length;o<r;o++){let s=n[o];if(!Fi(s)){let a=db(s);if(a)for(let c=0,l=a.length;c<l;c++){let p=a[c];if(!Fi(p)){let f=!1;for(let _=0,x=i.length;_<x;_++)if(i[_]===p){f=!0;break}f||i.push(p)}}else{let c=!1;for(let l=0,p=i.length;l<p;l++)if(i[l]===s){c=!0;break}c||i.push(s)}}}return i}let e=db(t);return e?Array.from(e):[t]}function ko(t){let e=Mo(t),n=e.length;for(let i=0;i<n;i++){let o=e[i];if(!o[Qm]){o[Qm]=!0;let r=yd(o);(o.nodeType||r)&&(o[Li]=!0,o[fd]=r,o[To]={})}}return e}var uh={deg:1,rad:180/Ua,turn:360},ub={},Ka=(t,e,n,i=!1)=>{let o=e.u,r=e.n;if(e.t===Pe.UNIT&&o===n)return e;let s=r+o+n,a=ub[s];if(!le(a)&&!i)e.n=a;else{let c;if(o in uh)c=r*uh[o]/uh[n];else{let p=t.cloneNode(),f=t.parentNode,_=f&&f!==So?f:So.body;_.appendChild(p);let x=p.style;x.width=100+o;let C=p.offsetWidth||100;x.width=100+n;let T=p.offsetWidth||100,P=C/T;_.removeChild(p),c=P*r}e.n=c,ub[s]=c}return e.t,Pe.UNIT,e.u=n,e};var co=t=>t;var Za=(t=1.68)=>e=>Er(e,+t),fh={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},Rk=Ua/2,pb=Ua*2,fb={[si]:Za,Quad:Za(2),Cubic:Za(3),Quart:Za(4),Quint:Za(5),Sine:t=>1-Kv(t*Rk),Circ:t=>1-Do(1-t*t),Expo:t=>t?Er(2,10*t-10):0,Bounce:t=>{let e,n=4;for(;t<((e=Er(2,--n))-1)/11;);return 1/Er(4,3-n)-7.5625*Er((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=_n(+t,1,10),i=_n(+e,Ae,2),o=i/pb*Zv(1/n),r=pb/i;return s=>s===0||s===1?s:-n*Er(2,-10*(1-s))*Yv((1-s-o)*r)}},ph=(()=>{let t={linear:co,none:co};for(let e in fh)for(let n in fb){let i=fb[n],o=fh[e];t[e+n]=n===si||n==="Back"||n==="Elastic"?(r,s)=>o(i(r,s)):o(i)}return t})(),Td={linear:co,none:co},Lk=t=>{if(Td[t])return Td[t];if(t.indexOf("(")<=-1){let n=fh[t]||t.includes("Back")||t.includes("Elastic")?ph[t]():ph[t];return n?Td[t]=n:co}else{let e=t.slice(0,-1).split("("),n=ph[e[0]];return n?Td[t]=n(...e[1].split(",")):co}},mb=["steps(","irregular(","linear(","cubicBezier("],Tr=t=>{if(On(t)){for(let n=0,i=mb.length;n<i;n++)if(Hn(t,mb[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}\``),co}return tn(t)?t:On(t)?Lk(t):co};var De=Cd(),$e=Cd(),bs={},Dd={func:null},Md={func:null},kd=[null],xs=[null,null],Id={to:null},Fk=0,hb=0,Io,Bi,Vk=(t,e)=>{let n={};if(Un(t)){let i=[].concat(...t.map(o=>Object.keys(o))).filter(Ha);for(let o=0,r=i.length;o<r;o++){let s=i[o],a=t.map(c=>{let l={};for(let p in c){let f=c[p];Ha(p)?p===s&&(l.to=f):l[p]=f}return l});n[s]=a}}else{let i=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(Ha(c)){let l=n[c];l||(l=n[c]=[]);let p=s*i,f=l.length,_=l[f-1],x={to:a[c]},C=0;for(let T=0;T<f;T++)C+=l[T].duration;f===1&&(x.from=_.to),a.ease&&(x.ease=a.ease),x.duration=p-(f?C:0),l.push(x)}return r});for(let r in n){let s=n[r],a;for(let c=0,l=s.length;c<l;c++){let p=s[c],f=p.ease;p.ease=a||void 0,a=f}s[0].duration||s.shift()}}return n},No=class extends ao{constructor(e,n,i,o,r=!1,s=0,a){super(n,i,o),this._head,this._tail,++hb;let c=ko(e),l=c.length,p=n.keyframes,f=p?vd(Vk(p,n),n):n,{id:_,delay:x,duration:C,ease:T,playbackEase:P,modifier:Y,composition:W,onRender:be}=f,ye=i?i.defaults:Ie.defaults,Me=Ot(T,ye.ease),me=Ot(P,ye.playbackEase),Je=me?Tr(me):null,je=!le(Me.ease),Be=je?Me.ease:Ot(T,Je?"linear":ye.ease),ft=je?Me.settlingDuration:Ot(C,ye.duration),St=Ot(x,ye.delay),Rt=Y||ye.modifier,kt=le(W)&&l>=ri?Nt.none:le(W)?ye.composition:W,et=this._offset+(i?i._offset:0);je&&(Me.parent=this);let Se=NaN,R=NaN,Q=0,G=0;for(let L=0;L<l;L++){let ne=c[L],Le=s||L,tt=a||c,Ut=NaN,Ce=NaN;for(let bt in f)if(Ha(bt)){let ze=za(ne,bt),an=xd(ne,bt),zt=ys(bt,ne,ze),Ke=f[bt],Wt=Un(Ke);if(r&&!Wt&&(xs[0]=Ke,xs[1]=Ke,Ke=xs),Wt){let pe=Ke.length,ut=!Cr(Ke[0]);pe===2&&ut?(Id.to=Ke,kd[0]=Id,Io=kd):pe>2&&ut?(Io=[],Ke.forEach((Z,_t)=>{_t?_t===1?(xs[1]=Z,Io.push(xs)):Io.push(Z):xs[0]=Z})):Io=Ke}else kd[0]=Ke,Io=kd;let Lt=null,Re=null,qe=NaN,ke=0,rt=0;for(let pe=Io.length;rt<pe;rt++){let ut=Io[rt];Cr(ut)?Bi=ut:(Id.to=ut,Bi=Id),Dd.func=null,Md.func=null;let Z=Vi(Ot(Bi.composition,kt),ne,Le,tt,null,null),_t=Nn(Z)?Z:Nt[Z];!Lt&&_t!==Nt.none&&(Lt=Wa(ne,zt));let Qe=Lt?Lt._tail:null,de=i&&Qe&&Qe.parent.parent===i?Qe:Re,Et=Vi(Bi.to,ne,Le,tt,Dd,de),Ee;Cr(Et)&&!le(Et.to)?(Bi=Et,Ee=Et.to):Ee=Et;let lt=Vi(Bi.from,ne,Le,tt,Md,de),Ge=Bi.ease||Be,j=Vi(Ge,ne,Le,tt,null,de),H=tn(j)||On(j)?j:Ge,ee=!le(H)&&!le(H.ease),fe=ee?H.ease:H,mt=ee?H.settlingDuration:Vi(Ot(Bi.duration,pe>1?Vi(ft,ne,Le,tt,null,de)/pe:ft),ne,Le,tt,null,de),Tt=Vi(Ot(Bi.delay,rt?0:St),ne,Le,tt,null,de),Yn=Bi.modifier||Rt,yn=!le(lt),Ti=!le(Ee),Di=Un(Ee),pc=Di||yn&&Ti,fc=Re?ke:0,Ar=Re?ke+Tt:Tt,jo=Ye(et+Ar,12),Vs=Ye(et+fc,12);!G&&(yn||Di)&&(G=1);let Xt=Re;if(_t!==Nt.none){let Oe=Lt._head;for(;Oe&&Oe._absoluteStartTime<=jo;)if(Oe._isOverridden||(Xt=Oe),Oe=Oe._nextRep,Oe&&Oe._absoluteStartTime>=jo)for(;Oe;)qa(Oe),Oe=Oe._nextRep}if(pc){vn(Di?Vi(Ee[0],ne,Le,tt,Md,de):lt,De),vn(Di?Vi(Ee[1],ne,Le,tt,Dd,de):Ee,$e);let Oe=ji(ne,zt,ze,bs);De.t===Pe.NUMBER&&(Xt?Xt._valueType===Pe.UNIT&&(De.t=Pe.UNIT,De.u=Xt._unit):(vn(Oe,nn),nn.t===Pe.UNIT&&(De.t=Pe.UNIT,De.u=nn.u)))}else Ti?vn(Ee,$e):Re?ah(Re,$e):vn(i&&Xt&&Xt.parent.parent===i?Xt._value:ji(ne,zt,ze,bs),$e),yn?vn(lt,De):Re?ah(Re,De):vn(i&&Xt&&Xt.parent.parent===i?Xt._value:ji(ne,zt,ze,bs),De);if(De.o&&(De.n=gs(Xt?Xt._toNumber:vn(ji(ne,zt,ze,bs),nn).n,De.n,De.o)),$e.o&&($e.n=gs(De.n,$e.n,$e.o)),De.t!==$e.t){if(De.t===Pe.COMPLEX||$e.t===Pe.COMPLEX){let Oe=De.t===Pe.COMPLEX?De:$e,Ft=De.t===Pe.COMPLEX?$e:De;Ft.t=Pe.COMPLEX,Ft.s=Zt(Oe.s),Ft.d=Oe.d.map(()=>Ft.n)}else if(De.t===Pe.UNIT||$e.t===Pe.UNIT){let Oe=De.t===Pe.UNIT?De:$e,Ft=De.t===Pe.UNIT?$e:De;Ft.t=Pe.UNIT,Ft.u=Oe.u}else if(De.t===Pe.COLOR||$e.t===Pe.COLOR){let Oe=De.t===Pe.COLOR?De:$e,Ft=De.t===Pe.COLOR?$e:De;Ft.t=Pe.COLOR,Ft.d=Oe.d.map(()=>0)}}if(De.u!==$e.u){let Oe=$e.u?De:$e;Oe=Ka(ne,Oe,$e.u?$e.u:De.u,!1)}if($e.d&&De.d&&$e.d.length!==De.d.length){let Oe=De.d.length>$e.d.length?De:$e,Ft=Oe===De?$e:De;Ft.d=Oe.d.map((hc,Rr)=>le(Ft.d[Rr])?0:Ft.d[Rr]),Ft.s=Zt(Oe.s)}let Mi=Ye(+mt||Ae,12),js=bs[zt];Fi(js)||(bs[zt]=null);let mc=an?an.set:null;ke=Ye(Ar+Mi,12);let $o=De.d,$s=$e.d,Bs=$e.s,cn={parent:this,id:Fk++,property:zt,target:ne,_value:null,_toFunc:Dd.func,_fromFunc:Md.func,_ease:Tr(fe),_fromNumbers:$o?Zt($o):$a,_toNumbers:$s?Zt($s):$a,_strings:Bs?Zt(Bs):$a,_fromNumber:De.n,_toNumber:$e.n,_numbers:$o?Zt($o):$a,_number:De.n,_unit:$e.u,_modifier:Yn,_currentTime:0,_startTime:Ar,_delay:+Tt,_updateDuration:Mi,_changeDuration:Mi,_absoluteStartTime:jo,_absoluteUpdateStartTime:Vs,_absoluteEndTime:Ye(et+ke,12),_hasFromValue:yn||Di?1:0,_tweenType:ze,_setter:mc,_valueType:$e.t,_composition:_t,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:js,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};_t!==Nt.none&&Sd(cn,Lt);let po=cn._valueType;if(po===Pe.COMPLEX)cn._value=Ed(cn,1,-1);else if(po===Pe.UNIT)cn._value=`${Yn(cn._toNumber)}${cn._unit}`;else if(po===Pe.COLOR){let Oe=$e.d;cn._value=`rgba(${Ye(Oe[0],0)},${Ye(Oe[1],0)},${Ye(Oe[2],0)},${Oe[3]})`}else cn._value=Yn(cn._toNumber);isNaN(qe)&&(qe=cn._startTime),Re=cn,Q++,Pn(this,cn)}(isNaN(R)||qe<R)&&(R=qe),(isNaN(Se)||ke>Se)&&(Se=ke),ze===yt.TRANSFORM&&(Ut=Q-rt,Ce=Q)}if(!isNaN(Ut)){let bt=0;ot(this,ze=>{bt>=Ut&&bt<Ce&&(ze._renderTransforms=1,ze._composition===Nt.blend&&ot(so.animation,an=>{an.id===ze.id&&(an._renderTransforms=1)})),bt++})}}l||console.warn("No target found. Make sure the element you're trying to animate is accessible before creating your animation."),R?(ot(this,L=>{L._startTime-L._delay||(L._delay-=R),L._startTime-=R}),Se-=R):R=0,Se||(Se=Ae,this.iterationCount=0),this.targets=c,this.id=le(_)?hb:_,this.duration=Se===Ae?Ae:Sr((Se+this._loopDelay)*this.iterationCount-this._loopDelay)||Ae,this.onRender=be||ye.onRender,this._ease=Je,this._delay=R,this.iterationDuration=Se,!this._autoplay&&G&&this.onRender(this)}stretch(e){let n=this.duration;if(n===ro(e))return this;let i=e/n;return ot(this,o=>{o._updateDuration=ro(o._updateDuration*i),o._changeDuration=ro(o._changeDuration*i),o._currentTime*=i,o._delay*=i,o._startTime*=i,o._absoluteStartTime*=i,o._absoluteUpdateStartTime*=i,o._absoluteEndTime*=i}),super.stretch(e)}refresh(){return ot(this,e=>{let n=e._toFunc,i=e._fromFunc;(n||i)&&(i?(vn(i(),De),De.u!==e._unit&&e.target[Li]&&Ka(e.target,De,e._unit,!0),e._fromNumbers=Zt(De.d),e._fromNumber=De.n):n&&(vn(ji(e.target,e.property,e._tweenType),nn),e._fromNumbers=Zt(nn.d),e._fromNumber=nn.n),n&&(vn(n(),$e),e._toNumbers=Zt($e.d),e._strings=Zt($e.s),e._toNumber=$e.o?gs(e._fromNumber,$e.n,$e.o):$e.n))}),this.duration===Ae&&this.restart(),this}revert(){return super.revert(),_s(this)}then(e){return super.then(e)}},rn=(t,e)=>Ie.editor?Ie.editor.addAnimation(t,e):new No(t,e,null,0,!1).init();var jk=(t,e)=>{if(Hn(e,"<")){let n=e[1]==="<",i=t._tail,o=i?i._offset+i._delay:0;return n?o:o+i.duration}},Dr=(t,e)=>{let n=t.iterationDuration;if(n===Ae&&(n=0),le(e))return n;if(Nn(+e))return+e;let i=e,o=t?t.labels:null,r=!Fi(o),s=jk(t,i),a=!le(s),c=zv.exec(i);if(c){let l=c[0],p=i.split(l),f=r&&p[0]?o[p[0]]:n,_=a?s:r?f:n,x=+p[1];return gs(_,x,l[0])}else return a?s:r?le(o[i])?n:o[i]:n};function $k(t){return Sr((t.iterationDuration+t._loopDelay)*t.iterationCount-t._loopDelay)||Ae}function mh(t,e,n,i,o,r){let a=Nn(t.duration)&&t.duration<=Ae?n-Ae:n;e.composition&&$i(e,a,1,1,en.AUTO);let c=i?new No(i,t,e,a,!1,o,r):new ao(t,e,a);return e.composition&&c.init(!0),Pn(e,c),ot(e,l=>{let f=l._offset+l._delay+l.duration;f>e.iterationDuration&&(e.iterationDuration=f)}),e.duration=$k(e),e}var gb=0,Nd=class extends ao{constructor(e={}){super(e,null,0),++gb,this.id=le(e.id)?gb:e.id,this.duration=0,this.labels={};let n=e.defaults,i=Ie.defaults;this.defaults=n?vd(n,i):i,this.composition=Ot(e.composition,!0),this.onRender=e.onRender||i.onRender;let o=Ot(e.playbackEase,i.playbackEase);this._ease=o?Tr(o):null,this.iterationDuration=0}add(e,n,i){let o=Cr(n),r=Cr(e);if(o||r){if(this._hasChildren=!0,o){let s=n,a=Ie.editor&&Ie.editor.addTimelineChild,c=i&&i.type==="Stagger"&&Ie.editor,l=tn(i)?i:null;if(l||c){let p=Mo(e),f=this.duration,_=this.iterationDuration,x=s.id,C=0,T=p.length,P=a?a(e,s,this.id,i,T):null,Y=l||Ie.editor.resolveStagger(i.defaultValue);p.forEach(W=>{let be=V({},P||s);this.duration=f,this.iterationDuration=_,le(x)||(be.id=x+"-"+C);let ye=Dr(this,Y(W,C,p,null,this));mh(be,this,ye,W,C,p),C++})}else{let p=a?a(e,s,this.id,i):s,f=i&&i.type?i.defaultValue:i;mh(p,this,Dr(this,f),e)}}else mh(e,this,Dr(this,n));return this.composition&&this.init(!0),this}}sync(e,n){if(le(e)||e&&le(e.pause))return this;e.pause();let i=+(e.effect?e.effect.getTiming().duration:e.duration);!le(e)&&!le(e.persist)&&(e.persist=!0);let o=Ie.editor,r=o&&o.addTimelineChild;o&&o.addTimelineSync&&(n=o.addTimelineSync(e,n,this.id),o.addTimelineChild=null);let s=this.add(e,{currentTime:[0,i],duration:i,delay:0,ease:"linear",playbackEase:"linear"},n);return o&&(o.addTimelineChild=r),s}set(e,n,i){return le(n)?this:(n.duration=Ae,n.composition=Nt.replace,this.add(e,n,i))}call(e,n){return le(e)||e&&!tn(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 le(e)||e&&!On(e)?this:(Ie.editor&&Ie.editor.addTimelineLabel&&(n=Ie.editor.addTimelineLabel(e,n,this.id)),this.labels[e]=Dr(this,n),this)}remove(e,n){return Ya(Mo(e),this,n),this}stretch(e){let n=this.duration;if(n===ro(e))return this;let i=e/n,o=this.labels;ot(this,r=>r.stretch(r.duration*i));for(let r in o)o[r]*=i;return super.stretch(e)}refresh(){return ot(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),ot(this,e=>e.revert,!0),_s(this)}then(e){return super.then(e)}},Od=t=>Ie.editor?Ie.editor.addTimeline(t):new Nd(t).init();var hh={};bg(hh,{clamp:()=>_n,damp:()=>Yk,degToRad:()=>qk,lerp:()=>oo,mapRange:()=>Gk,padEnd:()=>Uk,padStart:()=>Hk,radToDeg:()=>Wk,round:()=>Ye,roundPad:()=>Bk,snap:()=>Qv,wrap:()=>zk});var Bk=(t,e)=>(+t).toFixed(e),Hk=(t,e,n)=>`${t}`.padStart(e,n),Uk=(t,e,n)=>`${t}`.padEnd(e,n),zk=(t,e,n)=>((t-e)%(n-e)+(n-e))%(n-e)+e,Gk=(t,e,n,i,o)=>i+(t-e)/(n-e)*(o-i),qk=t=>t*Math.PI/180,Wk=t=>t*180/Math.PI,Yk=(t,e,n,i)=>i?i===1?e:oo(t,e,1-Math.exp(-i*n*.1)):t;var yb={_head:null,_tail:null},_b=(t,e,n)=>{let i=yb._head,o;for(;i;){let r=i._next,s=i.$el===t,a=!e||i.property===e,c=!n||i.parent===n;if(s&&a&&c){o=i.animation;try{o.commitStyles()}catch{}o.cancel(),zn(yb,i);let l=i.parent;l&&(l._completed++,l.animations.length===l._completed&&(l.completed=!0,l.paused=!0,l.muteCallbacks||(l.onComplete(l),l._resolve(l))))}i=r}return o};function vb(t,e,n){let i=ko(t);if(!i.length)return;let[o]=i,r=za(o,e),s=ys(e,o,r),a=ji(o,s);if(le(n))return a;if(vn(a,nn),nn.t===Pe.NUMBER||nn.t===Pe.UNIT){if(n===!1)return nn.n;{let c=Ka(o,nn,n,!1);return`${Ye(c.n,Ie.precision)}${c.u}`}}}var bb=(t,e)=>{if(!le(e))return Ie.editor&&Ie.editor.addSet?Ie.editor.addSet(t,e):(e.duration=Ae,e.composition=Ot(e.composition,Nt.none),new No(t,e,null,0,!0).resume())},xb=(t,e,n)=>{let i=Mo(t);for(let o=0,r=i.length;o<r;o++)_b(i[o],n,e&&e.controlAnimation&&e);return Ya(i,e,n),i};var Cb=(t=Kt)=>new ao({duration:1*Ie.timeScale,onComplete:t},null,0).resume(),Eb=t=>{let e;return((...n)=>{let i,o,r,s,a;e&&(i=e.currentIteration,o=e.iterationProgress,r=e.reversed,s=e._alternate,a=e._startTime,e.revert());let c=t(...n);return c&&!tn(c)&&c.revert&&(e=c),le(o)||(e.currentIteration=i,e.iterationProgress=(s&&i%2?!r:r)?1-o:o,e._startTime=a),c||Kt})};var Dt={};bg(Dt,{$:()=>ko,addChild:()=>Pn,clamp:()=>Pb,cleanInlineStyles:()=>ib,createSeededRandom:()=>Ad,damp:()=>Lb,degToRad:()=>Ib,forEachChildren:()=>ot,get:()=>vb,keepTime:()=>Eb,lerp:()=>Rb,mapRange:()=>kb,padEnd:()=>Db,padStart:()=>Tb,radToDeg:()=>Nb,random:()=>Cs,randomPick:()=>Fb,remove:()=>xb,removeChild:()=>zn,round:()=>Ab,roundPad:()=>Sb,set:()=>bb,shuffle:()=>Rd,snap:()=>Ob,stagger:()=>Hi,sync:()=>Cb,wrap:()=>Mb});var ai=hh,Pd={},Kk=(t,e=0)=>(...n)=>e?i=>t(...n,i):i=>t(i,...n),wb=t=>(...e)=>{let n=t(...e);return new Proxy(Kt,{apply:(i,o,[r])=>n(r),get:(i,o)=>{if(Pd[o])return wb((...r)=>{let s=Pd[o](...r);return a=>s(n(a))})}})},ci=(t,e,n=0)=>{let i=(...o)=>(o.length<e.length?wb(Kk(e,n)):e)(...o);return Pd[t]||(Pd[t]=i),i},Sb=ci("roundPad",ai.roundPad),Tb=ci("padStart",ai.padStart),Db=ci("padEnd",ai.padEnd),Mb=ci("wrap",ai.wrap),kb=ci("mapRange",ai.mapRange),Ib=ci("degToRad",ai.degToRad),Nb=ci("radToDeg",ai.radToDeg),Ob=ci("snap",ai.snap),Pb=ci("clamp",ai.clamp),Ab=ci("round",ai.round),Rb=ci("lerp",ai.lerp,1),Lb=ci("damp",ai.damp,1);var Cs=(t=0,e=1,n=0)=>{let i=10**n;return Math.floor((Math.random()*(e-t+1/i)+t)*i)/i},Zk=0,Ad=(t,e=0,n=1,i=0)=>{let o=t===void 0?Zk++:t;return(r=e,s=n,a=i)=>{o+=1831565813,o=Math.imul(o^o>>>15,o|1),o^=o+Math.imul(o^o>>>7,o|61);let c=10**a;return Math.floor((((o^o>>>14)>>>0)/4294967296*(s-r+1/c)+r)*c)/c}},Fb=t=>t[Cs(0,t.length-1)],Rd=(t,e=Cs)=>{let n=t.length,i,o;for(;n;)o=e(0,--n),i=t[n],t[n]=t[o],t[o]=i;return t};var Hi=(t,e={})=>{let n=[],i=0,o,r=null,s=e.from,a=e.reversed,c=e.ease,l=!le(c),f=l&&!le(c.ease)?c.ease:l?Tr(c):null,_=e.grid,x=_===!0,C=e.axis,T=e.total,P=le(s)||s===0||s==="first",Y=s==="center",W=s==="last",be=s==="random",ye=Un(s),Me=Un(t),me=e.use,Je=Me?_d(t[0]):_d(t),je=Me?_d(t[1]):0,Be=gd.exec((Me?t[1]:t)+si),ft=e.start||0+(Me?Je:0),St=e.seed,kt=!le(St)&&St!==!1?Ad(St===!0?0:St):Cs,et=e.jitter,Se=!le(et),R=Un(et),Q=R?et[0]:et||0,G=R?et[1]:et||0,L=P?0:Nn(s)?s:0;return(ne,Le,tt,Ut,Ce)=>{let[bt]=ko(ne),ze=le(T)?tt.length:T,an=le(me)?!1:tn(me)?me(bt,Le,ze):ji(bt,me),zt=Nn(an)||On(an)&&Nn(+an)?+an:Le,Ke=zt>=0&&zt<ze?zt:Le;if(Y&&(L=(ze-1)/2),W&&(L=ze-1),!n.length){if(x){let Re=!0,qe=!1,ke=1/0,rt=1/0,pe=1/0,ut=-1/0,Z=-1/0,_t=-1/0,Qe=[],de=[],Et=[];for(let Ee=0;Ee<ze;Ee++){let lt=tt[Ee],Ge=0,j=0,H=0,ee=!1;if(lt&&tn(lt.getBoundingClientRect)){let fe=lt.getBoundingClientRect();Ge=fe.left+fe.width/2,j=fe.top+fe.height/2,ee=!0}else{let fe=lt;fe&&Nn(fe.x)&&Nn(fe.y)&&(Ge=fe.x,j=fe.y,Nn(fe.z)&&(H=fe.z,qe=!0),ee=!0)}if(!ee){Re=!1;break}Qe.push(Ge),de.push(j),Et.push(H),Ge<ke&&(ke=Ge),j<rt&&(rt=j),H<pe&&(pe=H),Ge>ut&&(ut=Ge),j>Z&&(Z=j),H>_t&&(_t=H)}if(Re){let Ee=Qe[0],lt=de[0],Ge=Et[0];ye?(Ee=ke+s[0]*(ut-ke),lt=rt+s[1]*(Z-rt),Ge=qe?pe+(s.length>=3?s[2]:.5)*(_t-pe):0):Y?(Ee=(ke+ut)/2,lt=(rt+Z)/2,Ge=(pe+_t)/2):W?(Ee=Qe[ze-1],lt=de[ze-1],Ge=Et[ze-1]):Nn(s)&&(Ee=Qe[s],lt=de[s],Ge=Et[s]);for(let H=0;H<ze;H++){let ee=Ee-Qe[H],fe=lt-de[H],mt=Ge-Et[H],Tt=Do(ee*ee+fe*fe+(qe?mt*mt:0));C==="x"&&(Tt=-ee),C==="y"&&(Tt=-fe),C==="z"&&(Tt=-mt),n.push(Tt)}let j=1/0;for(let H=0;H<ze;H++){let ee=xr(n[H]);ee>0&&ee<j&&(j=ee)}if(j>0&&j<1/0)for(let H=0;H<ze;H++)n[H]=n[H]/j}else for(let Ee=0;Ee<ze;Ee++)n.push(xr(L-Ee))}else for(let Re=0;Re<ze;Re++)if(!_)n.push(xr(L-Re));else{let qe=_.length,ke=_[0]*_[1],rt,pe,ut;ye?(rt=s[0]*(_[0]-1),pe=s[1]*(_[1]-1),ut=qe===3?(s.length>=3?s[2]:.5)*(_[2]-1):0):Y?(rt=(_[0]-1)/2,pe=(_[1]-1)/2,ut=qe===3?(_[2]-1)/2:0):(rt=L%_[0],pe=wr(L/_[0])%_[1],ut=qe===3?wr(L/ke):0);let Z=Re%_[0],_t=wr(Re/_[0])%_[1],Qe=qe===3?wr(Re/ke):0,de=rt-Z,Et=pe-_t,Ee=ut-Qe,lt=Do(de*de+Et*Et+(qe===3?Ee*Ee:0));C==="x"&&(lt=-de),C==="y"&&(lt=-Et),C==="z"&&(lt=-Ee),n.push(lt)}i=n[0];for(let Re=1;Re<ze;Re++)n[Re]>i&&(i=n[Re]);if(f||a)for(let Re=0;Re<ze;Re++){let qe=n[Re];f&&(qe=f(qe/i)*i),a&&(qe=C?-qe:xr(i-qe)),n[Re]=qe}if(Se){r=new Array(ze);for(let Re=0;Re<ze;Re++)r[Re]=kt(-1,1,4)}be&&(n=Rd(n,kt))}let Wt=Me?(je-Je)/i:Je;le(o)&&(o=Ce?Dr(Ce,le(e.start)?Ce.iterationDuration:ft):ft);let Lt=o+(Wt*Ye(n[Ke],2)||0);if(Se){let Re=i?n[Ke]/i:0,qe=Q+(G-Q)*Re;Lt=Lt+r[Ke]*qe}return e.modifier&&(Lt=e.modifier(Lt)),Be&&(Lt=`${Lt}${Be[2]}`),Lt}};var Qk=t=>{let e=1;if(t&&t.getCTM){let n=t.getCTM();if(n){let i=Do(n.a*n.a+n.b*n.b),o=Do(n.c*n.c+n.d*n.d);e=(i+o)/2}}return e},Xk=(t,e,n)=>{let i=ri,o=getComputedStyle(t),r=o.strokeLinecap,s=o.vectorEffect==="non-scaling-stroke"?t:null,a=r,c=new Proxy(t,{get(l,p){let f=l[p];return p===md?l:p==="setAttribute"?(..._)=>{if(_[0]==="draw"){let C=_[1].split(" "),T=+C[0],P=+C[1],Y=Qk(s),W=T*-i*Y,be=P*i*Y+W,ye=i*Y+(T===0&&P===1||T===1&&P===0?0:10*Y)-be;if(r!=="butt"){let Me=T===P?"butt":r;a!==Me&&(l.style.strokeLinecap=`${Me}`,a=Me)}l.setAttribute("stroke-dashoffset",`${W}`),l.setAttribute("stroke-dasharray",`${be} ${ye}`)}return Reflect.apply(f,l,_)}:tn(f)?(..._)=>Reflect.apply(f,l,_):f}});return t.getAttribute("pathLength")!==`${i}`&&(t.setAttribute("pathLength",`${i}`),c.setAttribute("draw",`${e} ${n}`)),c},gh=(t,e=0,n=0)=>Mo(t).map(o=>Xk(o,e,n));var ln=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,i){setTimeout(()=>Dt.set(e,n),i)}enter(e,n={}){if(!e)return;let{y:i=8,scale:o,duration:r=260,delay:s=0,ease:a="out(3)"}=n,c={opacity:1,translateY:"0px",scale:1};if(!this.enabled){Dt.set(e,c);return}this.settle(e,c,s+r+120),rn(e,K(V({opacity:[0,1],translateY:[`${i}px`,"0px"]},o===void 0?{}:{scale:[o,1]}),{duration:r,delay:s,ease:a}))}enterList(e,n={}){let i=Array.from(e);if(i.length===0)return;let{y:o=8,duration:r=240,delay:s=0,each:a=30,ease:c="out(3)"}=n;if(!this.enabled){for(let l of i)Dt.set(l,{opacity:1,translateY:"0px"});return}i.forEach((l,p)=>{this.settle(l,{opacity:1,translateY:"0px"},s+p*a+r+120)}),rn(i,{opacity:[0,1],translateY:[`${o}px`,"0px"],duration:r,delay:Hi(a,{start:s}),ease:c})}reveal(e,n,i={}){let{animate:o=!0,after:r}=i;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||!o||c===0){Dt.set(e,n?a:s),r?.();return}this.settle(e,n?a:s,(n?240:180)+160),rn(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:()=>{Dt.set(e,n?a:s),r?.()}})}pulse(e){!this.enabled||!e||(this.settle(e,{opacity:1,scale:1},520),rn(e,{opacity:[.4,1],scale:[.99,1],duration:320,ease:"out(2)"}))}pop(e,n={}){if(!e)return;let{scale:i=1.18,duration:o=220,ease:r="out(2)"}=n;this.enabled&&(this.settle(e,{scale:1},o+120),rn(e,{scale:[i,1],duration:o,ease:r}))}static CONFETTI_COLORS=["#f43f5e","#fb923c","#facc15","#4ade80","#38bdf8","#a78bfa","#f472b6"];confetti(e,n){if(!e||!this.enabled)return;let{x:i,y:o,count:r=30,duration:s=900}=n,a=e.ownerDocument,c=e.getBoundingClientRect(),l=c.left+i,p=c.top+o,f=[],_=[];for(let T=0;T<r;T+=1){let P=Dt.random(-Math.PI*.85,-Math.PI*.15),Y=Dt.random(55,140);_.push({dx:Math.cos(P)*Y,dy:Math.sin(P)*Y,fall:Dt.random(90,180),rotate:Dt.random(-420,420)});let W=a.createElement("span");W.setAttribute("aria-hidden","true");let be=t.CONFETTI_COLORS[T%t.CONFETTI_COLORS.length];W.style.cssText=`position:fixed;left:${l}px;top:${p}px;width:${Dt.random(5,8)}px;height:${Dt.random(8,13)}px;margin:-5px 0 0 -3px;border-radius:1.5px;background:${be};pointer-events:none;z-index:60;opacity:0;`,a.body.appendChild(W),f.push(W)}let x=!1;setTimeout(()=>{if(!x){x=!0;for(let T of f)T.remove()}},s+420),f.forEach((T,P)=>{let{dx:Y,dy:W,fall:be,rotate:ye}=_[P];rn(T,{translateX:[0,Y],translateY:[0,W,W+be],rotate:[0,ye],opacity:[0,1,1,0],duration:s,ease:"out(2)",onComplete:()=>T.remove()})})}loop(e,n,i={}){if(!e||!this.enabled)return()=>{};let{duration:o=900,delay:r=0,ease:s="inOut(2)",alternate:a=!0}=i,c=rn(e,K(V({},n),{duration:o,delay:r,ease:s,loop:!0,alternate:a})),l={};for(let[p,f]of Object.entries(n))l[p]=f[0];return()=>{c.pause(),Dt.set(e,l)}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};var Es=class t{target=null;aim(e){this.target=e}read(){return this.target}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};function Jk(t,e){if(t&1&&(h(0,"span",22),u(1),g()),t&2){let n=e.$implicit;d(),k(n)}}var Vb=1800,eI=520,tI=Vb,Ld=class t{status=te("Connecting to the host\u2026");ready=te(!1);dismissed=it();letters=["M","o","r","s","e"];leaving=O(!1);host=N(Bt);animation=N(ln);handoff=N(Es);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"),i=this.query(".ring-b"),o=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"),p=this.query(".dash"),f=this.queryAll(".letter"),_=this.query(".tagline"),x=this.query(".foot"),C=this.query(".pulse");try{let T=[n,i].filter(P=>P!==null).map(P=>gh(P)[0]);for(let P of T)P.setAttribute("draw","0 0");this.intro=Od(),this.intro.add(this.one(o),{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(T,{draw:["0 0","0 1"],duration:720,ease:"inOut(3)",delay:Hi(110)},120).add(this.one(a),{opacity:[0,1],duration:420,ease:"out(2)"},260).add(this.one(i),{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(p),{opacity:[0,1],scaleX:[0,1],duration:700,ease:"outElastic(1, .55)"},960).add(this.one(o),{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:Hi(40)},1100).add(this.one(_),{opacity:[0,1],translateY:[8,0],duration:420,ease:"out(3)"},1480).add(this.one(x),{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(),Vb+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"),Dt.set(this.queryAll(".boot"),{opacity:1}),Dt.set(this.queryAll(".aura"),{opacity:.85}),Dt.set(this.queryAll(".grid"),{opacity:.5}),Dt.set(this.queryAll(".halo"),{opacity:.62,scale:1}),Dt.set(this.queryAll(".spark"),{opacity:1}),Dt.set(this.queryAll(".dot, .dash"),{opacity:1,scale:1,translateY:"0px"}),Dt.set(this.queryAll(".letter"),{opacity:1,scale:1,translateY:"0px"}),Dt.set(this.queryAll(".tagline, .foot"),{opacity:1,translateY:"0px"}),Dt.set(this.queryAll(".pulse"),{opacity:1,scale:1}),Dt.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,p]of n)l&&e(rn(l,{scale:[.4,2.05],opacity:[0,.7,0],duration:2600,delay:p,loop:!0,ease:"out(3)"}));let i=this.one(this.query(".spin-a")),o=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(rn(i,{rotate:[0,360],duration:16e3,loop:!0,ease:"linear"})),e(rn(o,{rotate:[0,-360],duration:22e3,loop:!0,ease:"linear"})),e(rn(r,{rotate:[0,360],duration:5400,delay:340,loop:!0,ease:"linear"})),e(rn(s,{scale:[1,1.9,1],opacity:[1,.6,1],duration:1100,delay:340,loop:!0,ease:"inOut(2)"})),e(rn(a,{opacity:[.6,.78],scale:[1,1.045],duration:2400,delay:1400,loop:!0,alternate:!0,ease:"inOut(2)"})),c.length>0&&e(rn(c,{opacity:[.15,1],translateY:[0,-2],duration:620,delay:Hi(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,tI-(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"),i=this.query(".grid"),o=this.query(".mark"),r=this.query(".halo"),s=this.queryAll(".letter"),a=this.query(".words"),c=this.query(".foot"),l=this.handoff.read(),p=o?.getBoundingClientRect(),f=l&&p&&p.width>0?{translateX:l.x-(p.left+p.width/2),translateY:l.y-(p.top+p.height/2),scale:l.width/p.width}:null;try{let _=Od({defaults:{ease:"inOut(2)"},onComplete:()=>this.dismiss()}).add(this.one(r),{opacity:0,scale:1.3,duration:320},0).add(this.one(n,i),{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:Hi(20)},0).add(this.one(a,c),{opacity:0,duration:220},40);f&&o?_.add(o,K(V({},f),{duration:560,ease:"inOut(3)"}),0).add(o,{opacity:0,duration:160,ease:"out(2)"},500).add(this.one(e),{opacity:0,duration:380},520):_.add(this.one(o),{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(),eI+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=ue({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,i){n&1&&(h(0,"div",0),ce(1,"span",1)(2,"span",2)(3,"span",3),h(4,"div",4)(5,"div",5),ce(6,"span",6)(7,"span",7)(8,"span",8),st(),h(9,"svg",9)(10,"g",10),ce(11,"circle",11),g(),h(12,"g",12),ce(13,"circle",13),g(),h(14,"g",14),ce(15,"circle",15),g()(),Jt(),h(16,"span",16),ce(17,"span",17)(18,"span",18)(19,"span",19),g()(),h(20,"div",20)(21,"div",21),oe(22,Jk,2,1,"span",22,Ci),g(),h(24,"div",23),u(25,"the pi coding agent"),g()()(),h(26,"div",24),ce(27,"span",25),h(28,"span",26),u(29),g(),h(30,"span",27),ce(31,"i")(32,"i")(33,"i"),g()()()),n&2&&(X("leaving",i.leaving()),d(22),re(i.letters),d(7),k(i.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 nI(t,e){t&1&&(h(0,"p",19),u(1),g()),t&2&&(d(),k(e))}function iI(t,e){if(t&1){let n=$();h(0,"div",23)(1,"p",24),u(2,"Start a Morse host"),g(),h(3,"div",25)(4,"span",26),u(5,"installed CLI"),g(),h(6,"code"),u(7,"morse start"),g()(),h(8,"div",25)(9,"span",26),u(10,"from the repo"),g(),h(11,"code"),u(12,"npm run dev:server"),g()(),h(13,"p",27),u(14," Not installed? "),h(15,"code"),u(16,"npm install -g @supanadit/morse-web"),g(),u(17,". "),g(),h(18,"p",27),u(19," Stopped it with "),h(20,"code"),u(21,"morse stop"),g(),u(22,"? "),h(23,"code"),u(24,"morse start"),g(),u(25," brings it back \u2014 "),h(26,"code"),u(27,"morse logs"),g(),u(28," says what happened. "),g(),h(29,"p",27),u(30,"or point this window at a host that is already running"),g(),h(31,"form",28),F("submit",function(o){D(n);let r=m();return M(r.submit(o))}),h(32,"input",29),F("input",function(o){D(n);let r=m();return M(r.onInput(o))}),g(),h(33,"button",30),u(34,"Connect"),g()()()}if(t&2){let n=m();d(32),ie("value",n.server()),d(),ie("disabled",n.server().trim().length===0)}}var Fd=class t{eyebrow=te("Offline");title=te("Morse is waiting for a host");body=te("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=te("");isBrowser=typeof globalThis<"u"&&typeof globalThis.acquireVsCodeApi>"u";server=O("");retry=it();explore=it();connect=it();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=ue({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,i){if(n&1&&(h(0,"div",0),ce(1,"span",1)(2,"span",2)(3,"span",3),h(4,"div",4)(5,"div",5),ce(6,"span",6)(7,"span",7)(8,"span",8),st(),h(9,"svg",9),ce(10,"circle",10)(11,"circle",11),g(),Jt(),h(12,"span",12),ce(13,"span",13)(14,"span",13)(15,"span",14),g()(),h(16,"p",15),ce(17,"span",16),u(18),g(),h(19,"h1",17),u(20),g(),h(21,"p",18),u(22),g(),w(23,nI,2,1,"p",19),h(24,"div",20)(25,"button",21),F("click",function(){return i.retry.emit()}),u(26,"Retry now"),g(),h(27,"button",22),F("click",function(){return i.explore.emit()}),u(28,"Explore the app"),g()(),w(29,iI,35,2,"div",23),g()()),n&2){let o;d(18),k(i.eyebrow()),d(2),k(i.title()),d(2),k(i.body()),d(),S((o=i.detail())?23:-1,o),d(6),S(i.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 oI=["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 yh(t){return JSON.stringify(t)}function rI(t){return sI(t,oI)}function Vd(t){let e=Qa(t);return rI(e)?e:void 0}function Qa(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return}return t instanceof Uint8Array?Qa(new TextDecoder().decode(t)):t instanceof ArrayBuffer?Qa(new TextDecoder().decode(new Uint8Array(t))):t}function sI(t,e){if(typeof t!="object"||t===null)return!1;let n=t.type;return typeof n=="string"&&e.includes(n)}function jd(t={cwd:"",name:"workspace"}){return{protocolVersion:19,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 jb(t,e,n){return K(V({},t),{connection:e,connectionDetail:n})}function $b(t,e){switch(e.type){case"host/ready":return K(V({},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 K(V({},t),{state:e.payload});case"transcript/append":return K(V({},t),{items:[...t.items,e.payload]});case"transcript/update":return K(V({},t),{items:aI(t.items,e.payload)});case"transcript/delta":return K(V({},t),{items:cI(t.items,e.payload)});case"transcript/replace":return K(V({},t),{items:[...e.payload.items]});case"transcript/prepend":return K(V({},t),{items:[...e.payload.items,...t.items]});case"session/list":return K(V({},t),{sessions:[...e.payload.sessions]});case"session/activity":return K(V({},t),{activity:[...e.payload.sessions]});case"project/list":return K(V({},t),{projects:[...e.payload.projects]});case"interaction/request":return K(V({},t),{pendingInteraction:e.payload});case"interaction/dismiss":return t.pendingInteraction?.requestId===e.payload.requestId?K(V({},t),{pendingInteraction:null}):t;case"notice":return K(V({},t),{lastNotice:V({},e.payload)});case"error":return K(V({},t),{lastError:V({},e.payload)});default:return t}}function aI(t,e){let n=t.findIndex(o=>o.id===e.id);if(n===-1)return[...t,e];let i=[...t];return i[n]=e,i}function cI(t,e){let n=t.findIndex(r=>r.id===e.id);if(n===-1)return t;let i=t[n];if(i.kind!=="assistant")return t;let o=[...t];return o[n]=K(V({},i),{text:i.text+(e.text??""),thinking:i.thinking+(e.thinking??""),streaming:!0}),o}var lI=5e3;function Bb(t){let e=jd(t.workspace??{cwd:"",name:"workspace"}),n=new Set,i=C=>{e=C;for(let T of[...n])T(e)},o=C=>{t.transport.send(C)},r=new Map,s=0,a=new Set,c=new Set,l=new Set,p=(C,T)=>{s+=1;let P=`host-${s}`;return new Promise(Y=>{let W=setTimeout(()=>{r.delete(P),Y(void 0)},lI);r.set(P,{resolve:Y,timer:W}),o({type:"host/command",payload:{command:C,args:T,requestId:P}})})},f=t.transport.onMessage(C=>{if(C.type==="host/command/result"){let T=r.get(C.payload.requestId);T&&(clearTimeout(T.timer),r.delete(C.payload.requestId),T.resolve(C.payload.ok?C.payload.data:void 0));return}if(C.type==="context/selection"){for(let T of[...a])T(C.payload);return}if(C.type==="context/selectionLive"){for(let T of[...c])T(C.payload);return}if(C.type==="composer/seed"){for(let T of[...l])T(C.payload);return}i($b(e,C))}),_=t.transport.onStatus((C,T)=>{i(jb(e,dI(C),C==="open"?"Waiting for the Morse host to answer\u2026":T))}),x={ready:C=>o({type:"client/ready",payload:{protocolVersion:19,frontend:C??t.frontend}}),prompt:(C,T,P,Y)=>o({type:"chat/prompt",payload:{text:C,mode:T,images:P,pins:Y}}),editMessage:(C,T)=>o({type:"chat/edit",payload:{itemId:C,text:T}}),forkMessage:C=>o({type:"chat/fork",payload:{itemId:C}}),hostCommand:(C,T)=>p(C,T),abort:()=>o({type:"chat/abort",payload:{}}),newSession:C=>o({type:"session/new",payload:{cwd:C}}),loadSession:(C,T)=>o({type:"session/load",payload:{sessionId:C,cwd:T}}),activateSession:(C,T)=>o({type:"session/activate",payload:{sessionId:C,cwd:T}}),closeSession:C=>o({type:"session/close",payload:{sessionId:C}}),deleteSession:C=>o({type:"session/delete",payload:{sessionId:C}}),compactSession:C=>o({type:"session/compact",payload:{instructions:C}}),loadOlderHistory:()=>o({type:"history/load",payload:{}}),requestSessions:()=>o({type:"session/list",payload:{}}),requestProjects:()=>o({type:"project/list",payload:{}}),refreshCommands:()=>o({type:"commands/refresh",payload:{}}),openProject:C=>o({type:"project/open",payload:{path:C}}),setModel:(C,T)=>o({type:"model/set",payload:{provider:C,id:T}}),setThinkingLevel:C=>o({type:"thinking/set",payload:{level:C}}),respond:C=>o({type:"interaction/respond",payload:C})};return t.transport.connect(),x.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:x,dispose:()=>{f(),_(),n.clear(),t.transport.dispose()}}}function dI(t){switch(t){case"open":return"connecting";case"connecting":return"connecting";case"error":return"error";case"closed":return"closed"}}var uI=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/,Hb=/<([^<>]+)>|\[([^\[\]]+)\]/g,Ub=/\$(\d+)|\$\{(\d+):/g,pI=/\$(?:@|ARGUMENTS)|\$\{(?:@|ARGUMENTS)(?::|-)/;function fI(t){let e=[],n="",i=null;for(let o of t)i!==null?o===i?i=null:n+=o:o==='"'||o==="'"?i=o:/\s/.test(o)?n.length>0&&(e.push(n),n=""):n+=o;return n.length>0&&e.push(n),e}function mI(t,e){let n=e.join(" ");return t.replace(/\$\{(\d+|ARGUMENTS|@):-([^}]*)\}|\$\{@:(\d+)(?::(\d+))?\}|\$(ARGUMENTS|@|\d+)/g,(i,o,r,s,a,c)=>{if(o!==void 0){let l=o==="@"||o==="ARGUMENTS"?n:e[Number.parseInt(o,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 hI(t){if(t===void 0)return[];let e=[];Hb.lastIndex=0;let n,i=0;for(;(n=Hb.exec(t))!==null;){i+=1;let o=(n[1]??n[2]??"").trim();e.push({id:`arg${i}`,label:o.length>0?o:`Argument ${i}`,required:n[1]!==void 0,index:i})}return e}function gI(t){let e=0;Ub.lastIndex=0;let n;for(;(n=Ub.exec(t))!==null;){let o=Number.parseInt(n[1]??n[2]??"0",10);Number.isFinite(o)&&o>e&&(e=o)}let i=[];for(let o=1;o<=e;o+=1)i.push({id:`arg${o}`,label:`Argument ${o}`,required:!1,index:o});return i}function yI(t){let e=/^(['"])([\s\S]*)\1$/.exec(t);return e===null?t:e[2]}function _h(t){let e=uI.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:yI(n[1].trim())}}function zb(t){let e=_h(t),n=hI(e.argumentHint),i=n.length>0?n:gI(e.body);if(i.length>0)return{body:e.body,arguments:i};if(pI.test(e.body))return{body:e.body,arguments:[{id:"arguments",label:"Arguments",required:!1}]}}function Gb(t,e,n=""){let i=t.arguments.find(a=>a.index===void 0),o=i!==void 0?fI(e[i.id]??""):t.arguments.map(a=>(e[a.id]??"").trim()),r=mI(t.body,o),s=n.trim();return s.length===0?r:`${r.replace(/\s+$/,"")}
|
|
7
7
|
|
|
8
8
|
${s}`}var Oo=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 i of[...this.statusListeners])i(e,n)}};var qb,Wb=!1;function Yb(){return typeof globalThis.acquireVsCodeApi=="function"}function _I(){let t=globalThis.acquireVsCodeApi;if(typeof t=="function")return Wb||(Wb=!0,qb=t()),qb}var $d=class extends Oo{kind="vscode";api=_I();listener=e=>{let n=Vd(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 vI=8e3,Xa=class extends Oo{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(yh(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 i=this.queue.splice(0,this.queue.length);for(let o of i)n.send(yh(o))},n.onmessage=i=>{let o=Vd(Qa(i.data));o&&this.emitMessage(o)},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??vI,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 Ts={cwd:"/mock/workspace",name:"mock-workspace"},bI={hostKind:"server",scope:Qb()?"workspace":"global",editorContext:!1,nativeDialogs:!1,insertIntoEditor:!1,revealFile:!1,filePicker:!0,gitPanel:!0,fileUpload:!0,directoryPicker:!0,updateCheck:xI()};function xI(){return typeof location>"u"?!1:new URL(location.href,"http://localhost/").searchParams.get("update")==="1"}var Bd=class extends Oo{kind="memory";timers=new Set;items=MI()?[]:kI();sessions=Xb();hot=new Set(this.sessions.slice(0,2).map(e=>e.id));counter=100;disposed=!1;streaming=!1;state={workspace:Ts,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:V({},e)}),this.state=K(V({},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:Zb()}}),this.emit({type:"session/list",payload:{sessions:this.sessions}}),this.emitActivity(),this.emit({type:"host/ready",payload:V({protocolVersion:19,capabilities:bI,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:Ts.cwd,updatedAt:Date.now(),messageCount:0};this.sessions=[n,...this.sessions],this.hot.add(n.id),this.state=K(V({},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:Zb()}});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(i=>i.provider===e.payload.provider&&i.id===e.payload.id);this.state=K(V({},this.state),{model:n?V({},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=K(V({},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:SI}}});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==="gitLog"&&e.payload.requestId){this.emit({type:"host/command/result",payload:{requestId:e.payload.requestId,ok:!0,data:CI}});return}if(e.payload.command==="gitStatus"&&e.payload.requestId){this.emit({type:"host/command/result",payload:{requestId:e.payload.requestId,ok:!0,data:EI}});return}if(e.payload.command==="gitDiff"&&e.payload.requestId){this.emit({type:"host/command/result",payload:{requestId:e.payload.requestId,ok:!0,data:{path:String(e.payload.args?.path??""),diff:wI}}});return}if(e.payload.command==="listDirectories"&&e.payload.requestId){this.emit({type:"host/command/result",payload:{requestId:e.payload.requestId,ok:!0,data:DI(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:K(V({},this.state),{streaming:!0})}),this.emitActivity();let n=0,i=[{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
9
|
2 ... 38 lines`}}];for(let s of i){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 p of Kb(s.thinking)){let f=p;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 o=`Mock host received: "${e}".
|
|
10
10
|
|
|
11
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 Kb(o)){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:o,thinking:"",streaming:!1,model:this.state.model?.name}),this.emit({type:"session/state",payload:K(V({},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 i=setTimeout(()=>{this.timers.delete(i),this.disposed||e()},n);this.timers.add(i)}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)}},CI={isRepo:!0,root:"/mock/workspace",branch:"main",commits:[Ss("f1a2b3c4","Add the git panel to the browser host",["e2f3a4b5"],["HEAD -> main"],2),Ss("e2f3a4b5","Merge branch feature/graph",["d3e4f5a6","c4d5e6f7"],["origin/main"],5),Ss("d3e4f5a6","Wire the graph lanes",["b5c6d7e8"],[],8),Ss("c4d5e6f7","Fix the lane colours in light mode",["b5c6d7e8"],[],11),Ss("b5c6d7e8","Bump the protocol version",["a6b7c8d9"],["tag: v0.8.0"],26),Ss("a6b7c8d9","Initial commit",[],[],52)]};function Ss(t,e,n,i,o){return{hash:t,shortHash:t.slice(0,7),parents:n,refs:i,author:"Morse Dev",date:new Date(Date.now()-o*36e5).toISOString(),subject:e}}var EI={isRepo:!0,files:[{path:"README.md",status:" M"},{path:"package.json",status:" M"},{path:"packages/protocol/src/wire.ts",status:"A "},{path:"packages/ui-angular/src/app/core/markdown.ts",status:"??"}]},wI=["diff --git a/README.md b/README.md","index 1111111..2222222 100644","--- a/README.md","+++ b/README.md","@@ -1,4 +1,5 @@"," # Morse"," ","-An old line","+A new line","+A line that was added"," A line that stayed",""].join(`
|
|
12
12
|
`),SI=["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"],TI={"/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 DI(t){let e=typeof t=="string"&&t.trim().length>0?t.trim():Ts.cwd,n=e==="/mock"?void 0:e.slice(0,e.lastIndexOf("/"))||"/";return{path:e,parent:n,directories:TI[e]??[],isGitRepo:e==="/mock/projects/morse",canOpen:!0,roots:[{name:"mock",path:"/mock"},{name:"workspace",path:Ts.cwd}]}}function Kb(t){return t.match(/.{1,14}/g)??[]}function Qb(){return typeof location>"u"?!1:new URL(location.href).searchParams.get("scope")==="workspace"}function MI(){return typeof location>"u"?!1:new URL(location.href).searchParams.get("empty")==="1"}function Xb(){let t=Date.now(),e=[{id:"/mock/morse/2026-01-01_ui-overhaul.jsonl",title:"Sidebar overhaul: projects, sessions, composer",cwd:Ts.cwd,updatedAt:t-6e4,messageCount:12},{id:"/mock/morse/2026-01-01_scrollbar.jsonl",title:"Improve native scrollbar: compact and themed",cwd:Ts.cwd,updatedAt:t-7*6e4,messageCount:6}];return Qb()?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 Zb(){let t=new Map;for(let e of Xb()){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 kI(){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(`
|
|
13
|
-
`);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 Jb(t={}){if(Yb())return new $d;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 Bd;let i=n.searchParams.get("server");if(i)return new Xa({url:i,WebSocketImpl:t.WebSocketImpl});let o=n.protocol==="https:",r=t.websocketPath??"/ws";return new Xa({url:`${o?"wss":"ws"}://${n.host}${r}`,WebSocketImpl:t.WebSocketImpl})}var Ui=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=[],i=[];for(let o of e){if(!o.type.startsWith("image/")){i.push(o.name);continue}let r=await vh(o);if(!r){i.push(o.name);continue}this.counter+=1,n.push({id:`attachment-${this.counter}`,name:o.name||`image-${this.counter}.png`,mimeType:o.type,data:r,bytes:o.size})}return{images:n,skipped:i}}add(e){e.length!==0&&this.attached.update(n=>[...n,...e])}async accept(e){let{images:n,skipped:i}=await this.read(e);return this.add(n),{attached:n.length,skipped:i}}addMentions(e){let n=e.map(i=>i.trim()).filter(i=>i.length>0);n.length!==0&&this.pendingMentions.update(i=>[...i,...n])}seed(e,n){e.length>0&&this.add(e.map((i,o)=>{this.counter+=1;let s=(i.mimeType.split("/")[1]?.toLowerCase()??"").replace(/[^a-z0-9]/g,"")||"png";return{id:`seed-${this.counter}`,name:o===0?`image.${s}`:`image-${o+1}.${s}`,mimeType:i.mimeType,data:i.data,bytes:Math.floor(i.data.length*3/4)}}));for(let i of n)this.pin({path:i.path,startLine:i.startLine,endLine:i.endLine})}setPinRange(e,n){this.pinned.update(i=>i.map(o=>o.id===e?K(V({},o),{startLine:n.startLine,endLine:n.endLine}):o))}pin(e,n){if(e.path.length===0)return"";if(e.startLine===void 0){let _=this.pinned().find(C=>C.path===e.path&&C.startLine===void 0);if(_!==void 0)return _.id;this.counter+=1;let x=`pin-${this.counter}`;return this.pinned.update(C=>[...C,K(V({},e),{id:x})]),x}let i=this.pinned(),o=e.startLine,r=e.endLine??e.startLine,s=new Set(n===void 0?[]:[n]),a,c=!0;for(;c;){c=!1;for(let _ of i){if(s.has(_.id)||_.path!==e.path||_.startLine===void 0)continue;let x=_.startLine,C=_.endLine??x;x<=r+1&&C+1>=o&&(o=Math.min(o,x),r=Math.max(r,C),s.add(_.id),a??=_.id,c=!0)}}this.counter+=1;let l={id:n??a??`pin-${this.counter}`,path:e.path,startLine:o,endLine:r>o?r:void 0},p=[],f=!1;for(let _ of i){if(s.has(_.id)){f||(p.push(l),f=!0);continue}p.push(_)}return f||p.push(l),this.pinned.set(p),l.id}removePin(e){this.pinned.update(n=>n.filter(i=>i.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(i=>i.id!==e))}takeImages(){let e=this.attached().map(({data:n,mimeType:i})=>({data:n,mimeType:i}));return this.attached.set([]),e}takePins(){let e=this.pinned().map(({path:n,startLine:i,endLine:o})=>{let r={path:n};return i!==void 0&&(r.startLine=i),o!==void 0&&(r.endLine=o),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=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};function vh(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 i=n.result;if(typeof i!="string"){e(void 0);return}let o=i.indexOf(",");e(o===-1?void 0:i.slice(o+1))},n.readAsDataURL(t)})}var ex=new He("morse.transport",{providedIn:"root",factory:()=>Jb()});var tx={name:"@morse/ui-angular",version:"0.9.0"},NI=6e3,Ze=class t{transport=N(ex);destroyRef=N(pt);view=O(jd());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??tx.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=Bb({transport:this.transport,frontend:tx}),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)},NI))}clearSlowConnectionTimer(){this.slowConnectionTimer!==void 0&&(clearTimeout(this.slowConnectionTimer),this.slowConnectionTimer=void 0)}prompt(e,n="new",i,o){this.actions.prompt(e,n,i,o)}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=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};var Hd=class t{items=O([]);counter=0;queued=this.items.asReadonly();count=E(()=>this.items().length);head(e){return this.items().find(n=>n.sessionId===e)}enqueue(e,n){this.counter+=1;let i=`queued-${this.counter}`;return this.items.update(o=>[...o,K(V({},e),{id:i,sessionId:n})]),i}remove(e){this.items.update(n=>n.filter(i=>i.id!==e))}shift(e){let n=this.head(e);if(n!==void 0)return this.remove(n.id),n}clear(){this.items.set([])}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};var sx="morse.navigation.collapsed",ax="morse.git.open",cx="morse.git.expanded",bh="morse.git.width",OI=220,PI=1600,lx="morse.git.changesHeight",nx="morse.git.changesCollapsed",ix="morse.git.historyCollapsed",AI=48,RI=1200,dx="morse.explorer.height",LI=140,FI=720;function VI(){try{return globalThis.localStorage?.getItem(sx)==="1"}catch{return!1}}function jI(t){try{globalThis.localStorage?.setItem(sx,t?"1":"0")}catch{}}function $I(){try{return globalThis.localStorage?.getItem(ax)==="1"}catch{return!1}}function BI(t){try{globalThis.localStorage?.setItem(ax,t?"1":"0")}catch{}}function HI(){try{return globalThis.localStorage?.getItem(cx)==="1"}catch{return!1}}function UI(t){try{globalThis.localStorage?.setItem(cx,t?"1":"0")}catch{}}function ux(t){return Math.round(Math.min(RI,Math.max(AI,t)))}function px(t){return Math.round(Math.min(PI,Math.max(OI,t)))}function zI(){try{let t=globalThis.localStorage?.getItem(bh);if(t==null)return;let e=Number.parseInt(t,10);return Number.isFinite(e)?px(e):void 0}catch{return}}function GI(t){try{globalThis.localStorage?.setItem(bh,String(t))}catch{}}function qI(){try{let t=globalThis.localStorage?.getItem(lx);if(t==null)return;let e=Number.parseInt(t,10);return Number.isFinite(e)?ux(e):void 0}catch{return}}function WI(t){try{globalThis.localStorage?.setItem(lx,String(t))}catch{}}function ox(t){try{return globalThis.localStorage?.getItem(t)==="1"}catch{return!1}}function rx(t,e){try{globalThis.localStorage?.setItem(t,e?"1":"0")}catch{}}function fx(t){return Math.round(Math.min(FI,Math.max(LI,t)))}function YI(){try{let t=globalThis.localStorage?.getItem(dx);if(t==null)return;let e=Number.parseInt(t,10);return Number.isFinite(e)?fx(e):void 0}catch{return}}function KI(t){try{globalThis.localStorage?.setItem(dx,String(t))}catch{}}var Ht=class t{navigationVisible=O(!1);navigationOpen=this.navigationVisible.asReadonly();collapsed=O(VI());navigationCollapsed=this.collapsed.asReadonly();gitPanel=O($I());gitPanelOpen=this.gitPanel.asReadonly();gitExpanded=O(HI());gitPanelExpanded=this.gitExpanded.asReadonly();gitWidthSignal=O(zI());gitPanelWidth=this.gitWidthSignal.asReadonly();changesHeightSignal=O(qI());gitChangesHeight=this.changesHeightSignal.asReadonly();changesCollapsedSignal=O(ox(nx));gitChangesCollapsed=this.changesCollapsedSignal.asReadonly();historyCollapsedSignal=O(ox(ix));gitHistoryCollapsed=this.historyCollapsedSignal.asReadonly();explorer=O(YI());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),jI(e)}toggleGitPanel(){this.setGitPanel(!this.gitPanel())}closeGitPanel(){this.setGitPanel(!1)}setGitPanel(e){this.gitPanel.set(e),BI(e)}toggleGitPanelExpanded(){this.setGitExpanded(!this.gitExpanded())}setGitExpanded(e){this.gitExpanded.set(e),UI(e)}toggleGitChanges(){this.changesCollapsedSignal.update(e=>!e),rx(nx,this.changesCollapsedSignal())}toggleGitHistory(){this.historyCollapsedSignal.update(e=>!e),rx(ix,this.historyCollapsedSignal())}setGitChangesHeight(e,n=!0){let i=ux(e);this.changesHeightSignal.set(i),n&&WI(i)}setGitPanelWidth(e,n=!0){let i=px(e);this.gitWidthSignal.set(i),n&&GI(i)}resetGitPanelWidth(){this.gitWidthSignal.set(void 0);try{globalThis.localStorage?.removeItem(bh)}catch{}}setExplorerHeight(e){let n=fx(e);this.explorer.set(n),KI(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=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};var Ja=[{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:"view.git",group:"Navigate",label:"Toggle the git panel",detail:"Shows or hides the history and graph for the active project. The browser host only \u2014 VS Code has its own Source Control view.",binding:{key:"g",mod:!0,alt:!0},overlay:!0,whileTyping:!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 ec(t){return"binding"in t}function mx(){let t=globalThis.navigator;return/mac|iphone|ipad/i.test(t?.userAgent??"")}function hx(t,e=mx()){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 An=class t{shell=N(Ht);handlers=new Map;revision=O(0);catalog=Ja;available=E(()=>{this.revision();let e=new Map;for(let n of Ja){if(!ec(n))continue;let i=this.handlers.get(n.id);e.set(n.id,i!==void 0&&(i.enabled?.()??!0))}return e});constructor(){let e=globalThis.document;e&&(e.addEventListener("keydown",this.onKeydown,!0),N(pt).onDestroy(()=>e.removeEventListener("keydown",this.onKeydown,!0)))}bind(e,n,i){let o={run:n,enabled:i};return this.handlers.set(e,o),this.bump(),()=>{this.handlers.get(e)===o&&(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=Ja.find(o=>ec(o)&&ZI(o.binding,e));if(n===void 0||n.whileTyping!==!0&&QI(e.target)||n.overlay===!0&&this.shell.modalOpen()&&!(n.id==="help.shortcuts"&&this.shell.shortcutsOpen()))return;let i=this.handlers.get(n.id);i===void 0||i.enabled!==void 0&&!i.enabled()||(e.preventDefault(),i.run())};static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};function ZI(t,e){return e.key.toLowerCase()!==t.key.toLowerCase()||t.mod===!0!==(mx()?e.metaKey:e.ctrlKey)?!1:t.alt===!0===e.altKey}function QI(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 XI=10*1024*1024,Ds=class t{morse=N(Ze);available=E(()=>this.morse.capabilities()?.fileUpload===!0);async upload(e){let n=[],i=[];for(let o of e){if(o.size>XI){i.push(o.name);continue}let r=await vh(o);if(!r){i.push(o.name);continue}let s=await this.morse.requestHostCommand("uploadFile",{name:o.name,mimeType:o.type,data:r}),a=typeof s?.path=="string"?s.path:void 0;if(!a){i.push(o.name);continue}n.push({path:a,name:o.name,bytes:typeof s?.bytes=="number"?s.bytes:o.size})}return{added:n,failed:i}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};function xh(t){if(t==="??")return"U";if(t.includes("U")||t==="AA"||t==="DD")return"C";if(t.includes("R")||t.includes("C"))return"R";if(t.includes("D"))return"D";if(t.includes("A"))return"A";if(t.includes("M")||t.includes("T"))return"M"}function gx(t){if(typeof t!="object"||t===null)return;let e=t;return e.isRepo!==!0?typeof e.isRepo=="boolean"?{isRepo:!1,files:[]}:void 0:{isRepo:!0,files:Array.isArray(e.files)?e.files.map(JI).filter(i=>i!==void 0):[]}}function Ud(t){let e=new Map;for(let n of t?.files??[]){let i=xh(n.status);i!==void 0&&e.set(n.path,i)}return e}function JI(t){if(typeof t!="object"||t===null)return;let e=t,n=e.path,i=e.status;if(!(typeof n!="string"||typeof i!="string"))return{path:n,status:i}}var eN=4e3,zi=class t{morse=N(Ze);cache=O([]);loading=O(!1);statuses=O(void 0);failure=O(void 0);loadedFor;inFlight=!1;files=this.cache.asReadonly();busy=this.loading.asReadonly();status=this.statuses.asReadonly();error=this.failure.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)}),se(e=>{if(!this.available())return;let n=setInterval(()=>{typeof document<"u"&&document.hidden||this.ensureLoaded(!0,!0)},eN);e(()=>clearInterval(n))})}refresh(){this.ensureLoaded(!0)}ensureLoaded(e=!1,n=!1){let i=this.morse.workspace().cwd;i.length===0||this.inFlight||!e&&this.loadedFor===i||(this.inFlight=!0,n||(this.loading.set(!0),this.failure.set(void 0)),Promise.all([this.morse.requestHostCommand("listFiles",e?{fresh:!0}:void 0),this.morse.requestHostCommand("gitStatus")]).then(([o,r])=>{if(this.morse.workspace().cwd!==i)return;let s=tN(o);if(s===void 0){this.failure.set("Could not list this project.");return}this.loadedFor=i,this.cache.set(s),this.statuses.set(gx(r))}).finally(()=>{this.inFlight=!1,n||this.loading.set(!1),this.morse.workspace().cwd!==i&&this.ensureLoaded(!0)}))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};function tN(t){if(typeof t!="object"||t===null)return;let e=t.files;if(Array.isArray(e))return e.filter(n=>typeof n=="string")}var Fx=_1(Lx(),1);var Kd=Fx.default;function Vx(t){let e=t.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});let o={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,o]};o.contains.push(a);let c={match:/\\"/},l={className:"string",begin:/'/,end:/'/},p={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},_=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],x=t.SHEBANG({binary:`(${_.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},T=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],P=["true","false"],Y={match:/(\/[a-z._-]+)+/},W=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],be=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],ye=["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"],Me=["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:T,literal:P,built_in:[...W,...be,"set","shopt",...ye,...Me]},contains:[x,t.SHEBANG(),C,f,r,s,Y,a,c,l,p,n]}}var GN=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_-]*/}}),qN=["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"],WN=["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"],YN=[...qN,...WN],KN=["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(),ZN=["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(),QN=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),XN=["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 jx(t){let e=t.regex,n=GN(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},o="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,i,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:":("+ZN.join("|")+")"},{begin:":(:)?("+QN.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+XN.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:o,attribute:KN.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+YN.join("|")+")\\b"}]}}function $x(t){let e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Bx(t){let 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 Hx="[A-Za-z$_][0-9A-Za-z$_]*",JN=["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"],eO=["true","false","null","undefined","NaN","Infinity"],Ux=["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"],zx=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Gx=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],tO=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],nO=[].concat(Gx,Ux,zx);function qx(t){let e=t.regex,n=(G,{after:L})=>{let ne="</"+G[0].slice(1);return G.input.indexOf(ne,L)!==-1},i=Hx,o={begin:"<>",end:"</>"},r=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(G,L)=>{let ne=G[0].length+G.index,Le=G.input[ne];if(Le==="<"||Le===","){L.ignoreMatch();return}Le===">"&&(n(G,{after:ne})||L.ignoreMatch());let tt,Ut=G.input.substring(ne);if(tt=Ut.match(/^\s*=/)){L.ignoreMatch();return}if((tt=Ut.match(/^\s+extends\s+/))&&tt.index===0){L.ignoreMatch();return}}},a={$pattern:Hx,keyword:JN,literal:eO,built_in:nO,"variable.language":tO},c="[0-9](_?[0-9])*",l=`\\.(${c})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${p})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${p})\\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},_={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},x={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,_],subLanguage:"xml"}},C={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,_],subLanguage:"css"}},T={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,_],subLanguage:"graphql"}},P={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,_]},W={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:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},be=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,x,C,T,P,{match:/\$\d+/},f];_.contains=be.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(be)});let ye=[].concat(W,_.contains),Me=ye.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(ye)}]),me={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:Me},Je={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,e.concat(i,"(",e.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],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:{_:[...Ux,...zx]}},Be={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ft={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[me],illegal:/%/},St={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Rt(G){return e.concat("(?!",G.join("|"),")")}let kt={match:e.concat(/\b/,Rt([...Gx,"super","import","await"].map(G=>`${G}\\s*\\(`)),i,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},et={begin:e.concat(/\./,e.lookahead(e.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Se={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},me]},R="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",Q={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(R)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[me]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:Me,CLASS_REFERENCE:je},illegal:/#(?![$_A-Za-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),Be,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,x,C,T,P,W,{match:/\$\d+/},f,je,{scope:"attr",match:i+e.lookahead(":"),relevance:0},Q,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[W,t.REGEXP_MODE,{className:"function",begin:R,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:Me}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.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"]}]}]},ft,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[me,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},et,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[me]},kt,St,Je,Se,{match:/\$[(.]/}]}}var iO="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",oO={scope:"number",match:iO,relevance:0};function Wx(t){let e={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],o={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:i},contains:[e,n,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,o,oO,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Yx(t){let e=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},o={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}/}]},p={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=t.inherit(l,{contains:[]}),_=t.inherit(p,{contains:[]});l.contains.push(_),p.contains.push(f);let x=[n,c];return[l,p,f,_].forEach(Y=>{Y.contains=Y.contains.concat(x)}),x=x.concat(l,p),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:x},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:x}]}]},n,r,i,l,p,{className:"quote",begin:"^>\\s+",contains:x,end:"$"},o,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])(?![$])/,i=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),o=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:"\\$+"+i},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}),p=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":(et,Se)=>{Se.data._beginMatch=et[1]||et[2]},"on:end":(et,Se)=>{Se.data._beginMatch!==et[1]&&Se.ignoreMatch()}},_=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),x=`[
|
|
14
|
-
]`,C={scope:"string",variants:[p,l,f,_]},T={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},P=["false","null","true"],Y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],W=["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"],ye={keyword:Y,literal:(et=>{let Se=[];return et.forEach(R=>{Se.push(R),R.toLowerCase()===R?Se.push(R.toUpperCase()):Se.push(R.toLowerCase())}),Se})(P),built_in:W},Me=et=>et.map(Se=>Se.replace(/\|\d+$/,"")),me={variants:[{match:[/new/,e.concat(x,"+"),e.concat("(?!",Me(W).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},Je=e.concat(i,"\\b(?!\\()"),je={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),Je],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,e.concat(/::/,e.lookahead(/(?!class\b)/)),Je],scope:{1:"title.class",3:"variable.constant"}},{match:[o,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},Be={scope:"attr",match:e.concat(i,e.lookahead(":"),e.lookahead(/(?!::)/))},ft={relevance:0,begin:/\(/,end:/\)/,keywords:ye,contains:[Be,s,je,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,C,T,me]},St={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",Me(Y).join("\\b|"),"|",Me(W).join("\\b|"),"\\b)"),i,e.concat(x,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[ft]};ft.contains.push(St);let Rt=[Be,je,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,C,T,me],kt={begin:e.concat(/#\[\s*\\?/,e.either(o,r)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:P,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:P,keyword:["new","array"]},contains:["self",...Rt]},...Rt,{scope:"meta",variants:[{match:o},{match:r}]}]};return{case_insensitive:!1,keywords:ye,contains:[kt,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,St,je,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},me,{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:ye,contains:["self",kt,s,je,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,C,T]}]},{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,T]}}function Zx(t){let e=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["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:i,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:/#/},p={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,p,l]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,c,p,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,p,l]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,p,l]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},_="[0-9](_?[0-9])*",x=`(\\b(${_}))?\\.(${_})|\\b(${_})\\.`,C=`\\b|${i.join("|")}`,T={className:"number",relevance:0,variants:[{begin:`(\\b(${_})|(${x}))[eE][+-]?(${_})[jJ]?(?=${C})`},{begin:`(${x})[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(${_})[jJ](?=${C})`}]},P={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},Y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",c,T,f,t.HASH_COMMENT_MODE]}]};return l.contains=[f,T,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[c,T,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,P,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[Y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[T,Y,f]}]}}var Zd="[A-Za-z$_][0-9A-Za-z$_]*",Qx=["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"],Xx=["true","false","null","undefined","NaN","Infinity"],Jx=["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"],eC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],tC=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],nC=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],iC=[].concat(tC,Jx,eC);function rO(t){let e=t.regex,n=(G,{after:L})=>{let ne="</"+G[0].slice(1);return G.input.indexOf(ne,L)!==-1},i=Zd,o={begin:"<>",end:"</>"},r=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(G,L)=>{let ne=G[0].length+G.index,Le=G.input[ne];if(Le==="<"||Le===","){L.ignoreMatch();return}Le===">"&&(n(G,{after:ne})||L.ignoreMatch());let tt,Ut=G.input.substring(ne);if(tt=Ut.match(/^\s*=/)){L.ignoreMatch();return}if((tt=Ut.match(/^\s+extends\s+/))&&tt.index===0){L.ignoreMatch();return}}},a={$pattern:Zd,keyword:Qx,literal:Xx,built_in:iC,"variable.language":nC},c="[0-9](_?[0-9])*",l=`\\.(${c})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${p})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${p})\\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},_={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},x={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,_],subLanguage:"xml"}},C={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,_],subLanguage:"css"}},T={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,_],subLanguage:"graphql"}},P={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,_]},W={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:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},be=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,x,C,T,P,{match:/\$\d+/},f];_.contains=be.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(be)});let ye=[].concat(W,_.contains),Me=ye.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(ye)}]),me={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:Me},Je={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,e.concat(i,"(",e.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],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:{_:[...Jx,...eC]}},Be={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ft={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[me],illegal:/%/},St={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Rt(G){return e.concat("(?!",G.join("|"),")")}let kt={match:e.concat(/\b/,Rt([...tC,"super","import","await"].map(G=>`${G}\\s*\\(`)),i,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},et={begin:e.concat(/\./,e.lookahead(e.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Se={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},me]},R="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",Q={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(R)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[me]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:Me,CLASS_REFERENCE:je},illegal:/#(?![$_A-Za-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),Be,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,x,C,T,P,W,{match:/\$\d+/},f,je,{scope:"attr",match:i+e.lookahead(":"),relevance:0},Q,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[W,t.REGEXP_MODE,{className:"function",begin:R,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:Me}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.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"]}]}]},ft,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[me,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},et,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[me]},kt,St,Je,Se,{match:/\$[(.]/}]}}function oC(t){let e=t.regex,n=rO(t),i=Zd,o=["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:o},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:Zd,keyword:Qx.concat(c),literal:Xx,built_in:iC.concat(o),"variable.language":nC},p={className:"meta",begin:"@"+i},f=(T,P,Y)=>{let W=T.contains.findIndex(be=>be.label===P);if(W===-1)throw new Error("can not find mode to replace");T.contains.splice(W,1,Y)};Object.assign(n.keywords,l),n.exports.PARAMS_CONTAINS.push(p);let _=n.contains.find(T=>T.scope==="attr"),x=Object.assign({},_,{match:e.concat(i,e.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,_,x]),n.contains=n.contains.concat([p,r,s,x]),f(n,"shebang",t.SHEBANG()),f(n,"use_strict",a);let C=n.contains.find(T=>T.label==="func.def");return C.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function rC(t){let e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,o={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:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{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},o,{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 sC(t){let e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={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,o]},a=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),_={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"},x={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},C={begin:/\{/,end:/\}/,contains:[x],illegal:"\\n",relevance:0},T={begin:"\\[",end:"\\]",contains:[x],illegal:"\\n",relevance:0},P=[i,{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}},_,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},C,T,r,s],Y=[...P];return Y.pop(),Y.push(a),x.contains=Y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:P}}for(let[t,e]of Object.entries({bash:Vx,css:jx,diff:$x,go:Bx,javascript:qx,json:Wx,markdown:Yx,php:Kx,python:Zx,typescript:oC,xml:rC,yaml:sC}))Kd.registerLanguage(t,e);var sO={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"},aO={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 kh(t){let e=t.split("/").pop()??"",n=e.lastIndexOf(".");if(!(n<=0))return aO[e.slice(n+1).toLowerCase()]}function Is(t,e){let n=(e??"").trim().toLowerCase(),i=sO[n]??n;return i.length>0&&Kd.getLanguage(i)!==void 0?{html:Kd.highlight(t,{language:i,ignoreIllegals:!0}).value,language:i}:{html:cO(t),language:"text"}}function cO(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}var lO="file:",dO="mention:",Ao="draft",dn=class t{morse=N(Ze);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));activeTab=E(()=>this.items().find(e=>e.id===this.active()));contextSessionId=E(()=>{let e=this.activeTab();return e?.kind==="session"?e.id:e?.kind==="file"&&e.mention===!0?e.sessionId:void 0});mentionTabs=E(()=>{let e=this.contextSessionId();return this.items().filter(n=>n.kind==="file"&&n.mention===!0&&(e===void 0?n.sessionId===void 0:n.sessionId===e))});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(i=>[...i,V({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(i=>i.map(o=>o.kind==="session"&&o.id===e.id?V(V({},o),e):o))}startDraft(e){this.openDraft(e),this.morse.newSession(e)}openDraft(e){this.items().find(i=>i.kind==="session"&&i.id===Ao)===void 0&&this.items.update(i=>[...i,{kind:"session",id:Ao,title:"New session",cwd:e,draft:!0}]),this.active.set(Ao)}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,void 0)}openMentionFile(e){this.openFileTab(e,!0,this.contextSessionId())}openFileTab(e,n,i){let o=n?aC(i,e):`${lO}${e}`,r=this.items().find(s=>s.id===o);r===void 0&&this.items.update(s=>[...s,{kind:"file",id:o,path:e,title:fO(e),language:kh(e),loading:!0,mention:n,sessionId:n?i:void 0}]),this.active.set(o),(r===void 0||this.needsLoad(r))&&this.load(o)}select(e){let n=this.items().find(i=>i.id===e);if(n!==void 0){if(this.active.set(e),n.kind==="session"){n.draft!==!0&&this.morse.activateSession(n.id,n.cwd);return}this.needsLoad(n)&&this.load(e)}}close(e){let n=this.items().findIndex(s=>s.id===e);if(n===-1)return;let i=this.items()[n],o=i.kind==="session"&&i.draft!==!0,r=i.kind==="session"?i.cwd:void 0;this.remove(this.doomedWith(e),n),o&&this.fallBackToEmptySession(r)}forget(e){let n=this.items().findIndex(i=>i.id===e);n!==-1&&this.remove(this.doomedWith(e),n)}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(a=>a.id===e);if(n===void 0)return;let i=new Set([e]);if(n.kind==="session")for(let a of this.mentionFilesOf(e))i.add(a.id);else n.mention===!0&&n.sessionId!==void 0&&i.add(n.sessionId);let o=this.items().filter(a=>!i.has(a.id)),r=o.some(a=>a.kind==="session"&&a.draft!==!0),s=o.find(a=>a.kind==="session")?.cwd;this.items.update(a=>a.filter(c=>i.has(c.id))),this.active.set(e),n.kind==="session"&&n.draft!==!0&&this.morse.activateSession(n.id,n.cwd),r&&this.fallBackToEmptySession(s)}closeToTheRight(e){let n=this.items().findIndex(c=>c.id===e);if(n===-1)return;let i=this.items().slice(n+1);if(i.length===0)return;let o=new Set(i.map(c=>c.id)),r=i.some(c=>c.kind==="session"&&c.draft!==!0),s=i.find(c=>c.kind==="session")?.cwd,a=this.active();this.items.update(c=>c.filter(l=>!o.has(l.id))),this.pruneOrphanMentions(),a!==void 0&&o.has(a)&&this.select(e),r&&this.fallBackToEmptySession(s)}closeAll(){let e=this.items().some(i=>i.kind==="session"&&i.draft!==!0),n=this.items().find(i=>i.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)}doomedWith(e){let n=new Set([e]),i=new Set(this.items().filter(o=>o.kind==="session"&&o.id!==e).map(o=>o.id));for(let o of this.items())o.kind!=="file"||o.mention!==!0||(o.sessionId===void 0||o.sessionId===e||!i.has(o.sessionId))&&n.add(o.id);return n}mentionFilesOf(e){return this.items().filter(n=>n.kind==="file"&&n.mention===!0&&n.sessionId===e)}remove(e,n){let i=this.active();if(this.items.update(s=>s.filter(a=>!e.has(a.id))),i===void 0||!e.has(i))return;let o=this.items(),r=o[Math.min(n,o.length-1)];if(r===void 0){this.active.set(void 0);return}this.select(r.id)}pruneOrphanMentions(){let e=new Set(this.items().filter(o=>o.kind==="session").map(o=>o.id)),n=this.items(),i=new Set(n.filter(o=>o.kind==="file"&&o.mention===!0&&(o.sessionId===void 0||!e.has(o.sessionId))).map(o=>o.id));i.size!==0&&this.remove(i,n.findIndex(o=>o.id===this.active()))}reload(e){this.patch(e,{diff:void 0,diffError:void 0}),this.load(e)}loadDiff(e){let n=this.items().find(i=>i.id===e);n===void 0||n.kind!=="file"||n.diff!==void 0||n.diffLoading===!0||(this.patch(e,{diffLoading:!0,diffError:void 0}),this.morse.requestHostCommand("gitDiff",{path:n.path}).then(i=>{let o=pO(i);if(o===void 0){this.patch(e,{diffLoading:!1,diffError:"Could not read this file\u2019s changes."});return}this.patch(e,{diffLoading:!1,diff:o})}))}findSession(e){return this.items().find(n=>n.kind==="session"&&n.id===e)}promoteDraft(e){this.items().some(i=>i.kind==="session"&&i.id===Ao)&&this.items.update(i=>i.map(o=>o.kind==="session"&&o.id===Ao?V({kind:"session"},e):o.kind==="file"&&o.mention===!0&&o.sessionId===Ao?K(V({},o),{sessionId:e.id,id:aC(e.id,o.path)}):o))}discardDraft(){this.items().some(n=>n.kind==="session"&&n.id===Ao)&&(this.items.update(n=>n.filter(i=>!(i.kind==="session"&&i.id===Ao))),this.pruneOrphanMentions())}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 i=await this.morse.requestHostCommand("readFile",{path:n.path}),o=uO(i);if(o===void 0){this.patch(e,{loading:!1,error:"Could not read this file."});return}this.patch(e,{loading:!1,content:o.content,size:o.size,truncated:o.truncated,binary:o.binary,language:kh(o.path)})}patch(e,n){this.items.update(i=>i.map(o=>o.id===e&&o.kind==="file"?V(V({},o),n):o))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};function uO(t){if(typeof t!="object"||t===null)return;let e=t,n=e.content,i=e.path;if(typeof n!="string"||typeof i!="string")return;let o=e.size;return{path:i,content:n,size:typeof o=="number"?o:n.length,truncated:e.truncated===!0,binary:e.binary===!0}}function pO(t){if(typeof t!="object"||t===null)return;let e=t.diff;return typeof e=="string"?e:void 0}function fO(t){let e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function aC(t,e){return`${dO}${t??""}:${e}`}function mO(t,e,n=80){let i=Math.floor(t-4-8);return Math.max(n,Math.min(e,i))}var Qd=class t{preferred=te(320,{alias:"morsePopoverFit"});host=N(Bt);renderer=N(Xi).createRenderer(null,null);observer;constructor(){no(()=>{this.fit();let e=this.anchor();e&&typeof ResizeObserver<"u"&&(this.observer=new ResizeObserver(()=>this.fit()),this.observer.observe(e))}),N(pt).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=mO(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=br({type:t,selectors:[["","morsePopoverFit",""]],hostBindings:function(n,i){n&1&&A("resize",function(){return i.onWindowResize()},um)},inputs:{preferred:[1,"morsePopoverFit","preferred"]}})};var un=class t{morseEnter=te(0);morseEnterY=te(8);morseEnterDuration=te(260);morseEnterScale=te(void 0);element=N(Bt);animation=N(ln);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=br({type:t,selectors:[["","morseEnter",""]],inputs:{morseEnter:[1,"morseEnter"],morseEnterY:[1,"morseEnterY"],morseEnterDuration:[1,"morseEnterDuration"],morseEnterScale:[1,"morseEnterScale"]}})};var hO=["list"];function gO(t,e){t&1&&(y(0,"div",2),u(1,"Reading the workspace\u2026"),b())}function yO(t,e){if(t&1&&(y(0,"div",4),u(1),b()),t&2){let n=m(2);d(),ae("No match for \u201C",n.query(),"\u201D.")}}function _O(t,e){if(t&1){let n=$();y(0,"div",4),u(1," The host returned no workspace files. "),y(2,"button",5),A("click",function(){D(n);let o=m(2);return M(o.reload.emit())}),u(3,"Load again"),b()()}}function vO(t,e){if(t&1&&w(0,yO,2,1,"div",4)(1,_O,4,0,"div",4),t&2){let n=m();S(n.query().length>0?0:1)}}function bO(t,e){if(t&1){let n=$();y(0,"li")(1,"button",6),A("mouseenter",function(){let o=D(n).$index,r=m(2);return M(r.activeChange.emit(o))})("click",function(){let o=D(n).$implicit,r=m(2);return M(r.pick.emit(o))}),y(2,"span",7),u(3),b(),y(4,"span",8)(5,"span",9),u(6),b(),u(7),b()()()}if(t&2){let n=e.$implicit,i=e.$index,o=m(2);d(),X("active",i===o.active()),d(2),k(o.isDirectory(n)?"\u25B8":"\u25A4"),d(3),k(o.split(n).dir),d(),ae("",o.split(n).base," ")}}function xO(t,e){if(t&1&&(y(0,"ul",null,0),oe(2,bO,8,5,"li",null,Ei),b()),t&2){let n=m();d(2),re(n.files())}}var Xd=class t{files=te.required();busy=te(!1);query=te("");active=te(0);pick=at();close=at();reload=at();activeChange=at();list=Xe("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 i=e.getBoundingClientRect(),o=n.getBoundingClientRect();o.top<i.top?e.scrollTop-=i.top-o.top:o.bottom>i.bottom&&(e.scrollTop+=o.bottom-i.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 Ih(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-file-picker"]],viewQuery:function(n,i){n&1&>(i.list,hO,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,i){n&1&&(y(0,"div",1),w(1,gO,2,0,"div",2)(2,vO,2,1)(3,xO,4,0,"ul"),y(4,"div",3)(5,"kbd"),u(6,"\u2191"),b(),y(7,"kbd"),u(8,"\u2193"),b(),u(9," move \xB7 "),y(10,"kbd"),u(11,"Enter"),b(),u(12," attach/open \xB7 "),y(13,"kbd"),u(14,"Esc"),b(),u(15," close "),b()()),n&2&&(q("morseEnter",0)("morseEnterY",6),d(),S(i.busy()&&i.files().length===0?1:i.files().length===0?2:3))},dependencies:[un],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 lC(t,e,n=50){let i=e.trim().toLowerCase();return t.map(o=>({file:o,score:i.length===0?0:CO(o,i)})).filter(o=>o.score<Number.POSITIVE_INFINITY).sort((o,r)=>cC(o.file)-cC(r.file)||o.score-r.score||o.file.length-r.file.length||o.file.localeCompare(r.file)).slice(0,n).map(o=>o.file)}function Ih(t){return t.endsWith("/")}function cC(t){return Ih(t)?0:1}function CO(t,e){let n=(Ih(t)?t.slice(0,-1):t).toLowerCase(),i=n.lastIndexOf("/"),o=i===-1?n:n.slice(i+1);return o.startsWith(e)?0:o.includes(e)?1:n.startsWith(e)?2:n.includes(e)?3:Number.POSITIVE_INFINITY}var EO=["list"],wO=(t,e)=>e.id;function SO(t,e){if(t&1&&(y(0,"div",3),u(1),b()),t&2){let n=m(2);d(),ae("No command matches \u201C",n.query(),"\u201D.")}}function TO(t,e){t&1&&(y(0,"div",3),u(1,"No commands available in this session."),b())}function DO(t,e){if(t&1&&w(0,SO,2,1,"div",3)(1,TO,2,0,"div",3),t&2){let n=m();S(n.query().length>0?0:1)}}function MO(t,e){if(t&1&&(y(0,"span",5),u(1),b()),t&2){let n=m().$implicit;d(),k(n.icon)}}function kO(t,e){if(t&1&&(y(0,"span",8),u(1),b()),t&2){let n=m().$implicit;d(),k(n.description)}}function IO(t,e){if(t&1&&(y(0,"span",9),u(1),b()),t&2){let n=m().$implicit;d(),k(n.badge)}}function NO(t,e){if(t&1){let n=$();y(0,"li")(1,"button",4),A("mouseenter",function(){let o=D(n).$index,r=m(2);return M(r.activeChange.emit(o))})("pointerdown",function(o){return o.preventDefault()})("click",function(){let o=D(n).$implicit,r=m(2);return M(r.pick.emit(o.id))}),w(2,MO,2,1,"span",5),y(3,"span",6)(4,"span",7),u(5),b(),w(6,kO,2,1,"span",8),b(),w(7,IO,2,1,"span",9),b()()}if(t&2){let n=e.$implicit,i=e.$index,o=m(2);d(),X("active",i===o.active()),d(),S(n.icon?2:-1),d(3),k(n.label),d(),S(n.description?6:-1),d(),S(n.badge?7:-1)}}function OO(t,e){if(t&1&&(y(0,"ul",null,0),oe(2,NO,8,6,"li",null,wO),b()),t&2){let n=m();d(2),re(n.items())}}var Jd=class t{items=te.required();query=te("");active=te(0);pick=at();close=at();activeChange=at();list=Xe("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 i=e.getBoundingClientRect(),o=n.getBoundingClientRect();o.top<i.top?e.scrollTop-=i.top-o.top:o.bottom>i.bottom&&(e.scrollTop+=o.bottom-i.bottom)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-command-picker"]],viewQuery:function(n,i){n&1&>(i.list,EO,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,i){n&1&&(y(0,"div",1),w(1,DO,2,1)(2,OO,4,0,"ul"),y(3,"div",2)(4,"kbd"),u(5,"\u2191"),b(),y(6,"kbd"),u(7,"\u2193"),b(),u(8," move \xB7 "),y(9,"kbd"),u(10,"Enter"),b(),u(11," run \xB7 "),y(12,"kbd"),u(13,"Tab"),b(),u(14," insert \xB7 "),y(15,"kbd"),u(16,"Esc"),b(),u(17," close "),b()()),n&2&&(q("morseEnter",0)("morseEnterY",6),d(),S(i.items().length===0?1:2))},dependencies:[un],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 dC(t,e,n=50){let i=e.trim().toLowerCase();return i.length===0?t.slice(0,n):t.map(o=>({item:o,score:PO(o,i)})).filter(o=>o.score<Number.POSITIVE_INFINITY).sort((o,r)=>o.score-r.score||o.item.label.length-r.item.label.length).slice(0,n).map(o=>o.item)}function PO(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 AO=["card"],RO=(t,e)=>e.id;function LO(t,e){t&1&&(h(0,"p",5),u(1),g()),t&2&&(d(),k(e))}function FO(t,e){t&1&&(h(0,"span",16),u(1,"required"),g())}function VO(t,e){if(t&1){let n=$();h(0,"textarea",19),F("input",function(o){D(n);let r=m().$implicit,s=m();return M(s.setValue(r.id,o))})("keydown",function(o){D(n);let r=m(2);return M(r.onSubmitKey(o))}),g()}if(t&2){let n=m().$implicit,i=m();ie("value",i.value(n.id)),J("aria-label",n.label)}}function jO(t,e){if(t&1){let n=$();h(0,"input",20),F("input",function(o){D(n);let r=m().$implicit,s=m();return M(s.setValue(r.id,o))})("keydown.enter",function(o){D(n);let r=m(2);return M(r.submit(o))}),g()}if(t&2){let n=m().$implicit,i=m();ie("value",i.value(n.id)),J("aria-label",n.label)}}function $O(t,e){if(t&1&&(h(0,"label",7)(1,"span",8),u(2),w(3,FO,2,0,"span",16),g(),w(4,VO,1,2,"textarea",17)(5,jO,1,2,"input",18),g()),t&2){let n=e.$implicit;d(2),ae(" ",n.label," "),d(),S(n.required?3:-1),d(),S(n.index===void 0?4:5)}}var eu=class t{request=te.required();submitted=at();cancelled=at();card=Xe("card");values=O({});extra=O("");preview=E(()=>Gb(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 i=n.target.value;this.values.update(o=>K(V({},o),{[e]:i}))}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=ue({type:t,selectors:[["morse-prompt-template-dialog"]],viewQuery:function(n,i){n&1&>(i.card,AO,5),n&2&&vt()},hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.onEscape()},Mt)},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,i){if(n&1&&(h(0,"div",1),F("click",function(){return i.cancelled.emit()}),h(1,"div",2,0),F("click",function(r){return r.stopPropagation()}),h(3,"header",3)(4,"h2",4),u(5),g(),w(6,LO,2,1,"p",5),g(),h(7,"div",6),oe(8,$O,6,3,"label",7,RO),h(10,"label",7)(11,"span",8),u(12," Additional instructions "),h(13,"span",9),u(14,"optional \xB7 appended below the template"),g()(),h(15,"textarea",10),F("input",function(r){return i.setExtra(r)})("keydown",function(r){return i.onSubmitKey(r)}),g()(),h(16,"div",11)(17,"span",8),u(18,"Preview"),g(),h(19,"pre",12),u(20),g()(),h(21,"div",13)(22,"button",14),F("click",function(){return i.cancelled.emit()}),u(23,"Cancel"),g(),h(24,"button",15),F("click",function(){return i.submit()}),u(25,"Send"),g()()()()()),n&2){let o;d(5),ae("/",i.request().name),d(),S((o=i.request().description)?6:-1,o),d(2),re(i.request().form.arguments),d(7),ie("value",i.extra()),d(5),k(i.preview()),d(4),ie("disabled",!i.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 li(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 uC(t,e){let n=t?.[e];return typeof n=="number"?li(n):"\u2014"}function Nh(t){if(!t)return;let e=t.cacheReadTokens??0,n=t.cacheWriteTokens??0,i=t.inputTokens+e+n;if(!(i<=0||e===0&&n===0))return e/i*100}function Oh(t){if(!(t===void 0||t<=0))return`$${t.toFixed(3)}`}function Ph(t){let e=[],n=t.usage;if(n){n.inputTokens>0&&e.push(`\u2191${li(n.inputTokens)}`),n.outputTokens>0&&e.push(`\u2193${li(n.outputTokens)}`),n.cacheReadTokens&&e.push(`R${li(n.cacheReadTokens)}`),n.cacheWriteTokens&&e.push(`W${li(n.cacheWriteTokens)}`);let r=Nh(n);r!==void 0&&e.push(`CH${r.toFixed(1)}%`)}let i=Oh(t.costUsd);i&&e.push(i);let o=t.contextUsage;if(o){let r=o.percent!==null?`${o.percent.toFixed(1)}%`:"?";e.push(`${r}/${li(o.contextWindow)}`)}return e.join(" ")}var BO=["search"],HO=["list"],UO=(t,e)=>e.provider,zO=(t,e)=>e.index;function GO(t,e){if(t&1&&(y(0,"div",10),u(1),b()),t&2){let n=m();d(),ae("No model matches \u201C",n.filter(),"\u201D.")}}function qO(t,e){t&1&&(y(0,"span",15),u(1),b()),t&2&&(d(),k(e))}function WO(t,e){t&1&&(y(0,"span",16),u(1,"\u2713"),b())}function YO(t,e){if(t&1){let n=$();y(0,"button",13),A("mouseenter",function(){let o=D(n).$implicit,r=m(4);return M(r.active.set(o.index))})("click",function(){let o=D(n).$implicit,r=m(4);return M(r.pick.emit(o.model))}),y(1,"span",14),u(2),b(),w(3,qO,2,1,"span",15),w(4,WO,2,0,"span",16),b()}if(t&2){let n,i=e.$implicit,o=m(4);X("active",i.index===o.active())("selected",o.keyOf(i.model)===o.current()),q("title",o.keyOf(i.model)),J("aria-current",o.keyOf(i.model)===o.current()?"true":null),d(2),k(i.model.name),d(),S((n=o.context(i.model))?3:-1,n),d(),S(o.keyOf(i.model)===o.current()?4:-1)}}function KO(t,e){if(t&1&&(y(0,"div",11),u(1),b(),oe(2,YO,5,9,"button",12,zO)),t&2){let n=m().$implicit;d(),k(n.provider),d(),re(n.rows)}}function ZO(t,e){if(t&1&&w(0,KO,4,1),t&2){let n=e.$implicit;S(n.rows.length>0?0:-1)}}function QO(t,e){if(t&1&&oe(0,ZO,1,1,null,null,UO),t&2){let n=m();re(n.groups())}}function XO(t,e){let n=e.trim().toLowerCase(),i=new Map;for(let o of t){if(n.length>0&&!`${o.provider} ${o.id} ${o.name}`.toLowerCase().includes(n))continue;let r=i.get(o.provider);r?r.push(o):i.set(o.provider,[o])}return[...i].map(([o,r])=>({provider:o,models:r}))}var tu=class t{models=te.required();current=te("");pick=at();close=at();host=N(Bt);search=Xe("search");list=Xe("list");filter=O("");active=O(0);groups=E(()=>{let e=0;return XO(this.models(),this.filter()).map(n=>({provider:n.provider,rows:n.models.map(i=>({model:i,index:e++}))}))});visible=E(()=>this.groups().flatMap(e=>e.rows.map(n=>n.model)));constructor(){no(()=>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 i=e.getBoundingClientRect(),o=n.getBoundingClientRect(),r=e.querySelector(".group")?.offsetHeight??0,s=i.top+r;o.top<s?e.scrollTop-=s-o.top:o.bottom>i.bottom&&(e.scrollTop+=o.bottom-i.bottom)}keyOf(e){return`${e.provider}/${e.id}`}context(e){return e.contextWindow?li(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(i=>Math.min(i+1,Math.max(0,n.length-1)));return;case"ArrowUp":e.preventDefault(),this.active.update(i=>Math.max(0,i-1));return;case"Enter":{let i=n[this.active()];i&&(e.preventDefault(),this.pick.emit(i));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=ue({type:t,selectors:[["morse-model-picker"]],viewQuery:function(n,i){n&1&>(i.search,BO,5)(i.list,HO,5),n&2&&vt(2)},hostBindings:function(n,i){n&1&&A("pointerdown",function(r){return i.onDocumentPointerdown(r)},Mt)},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,i){n&1&&(y(0,"div",2)(1,"div",3)(2,"span",4),rt(),y(3,"svg",5),ve(4,"circle",6)(5,"path",7),b()(),Jt(),y(6,"input",8,0),A("input",function(r){return i.onFilter(r)})("keydown",function(r){return i.onKeydown(r)}),b()(),y(8,"div",9,1),w(10,GO,2,1,"div",10)(11,QO,2,0),b()()),n&2&&(q("morseEnter",0)("morseEnterY",6),d(6),q("value",i.filter()),d(4),S(i.visible().length===0?10:11))},dependencies:[un],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 JO=["brain"],eP=["halo"];function tP(t,e){if(t&1&&(rt(),ce(0,"path")),t&2){let n=e.$implicit;J("d",n)}}function nP(t,e){t&1&&ce(0,"span",3,1)}function iP(t,e){t&1&&ce(0,"span",4,1)}var oP=["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"],rP={off:0,minimal:1,low:2,medium:3,high:4,xhigh:5,max:6};function sP(t){return rP[t]??2}function aP(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 nu=class t{level=te.required();bumped=te(!1);host=N(Bt);animation=N(ln);brain=Xe("brain");halos=Cv("halo");stoppers=[];paths=oP;intensity=E(()=>sP(this.level()));constructor(){se(()=>{let e=this.level(),n=this.brain()?.nativeElement,i=this.halos().map(r=>r.nativeElement);if(this.stopLoops(),!n||!this.animation.isEnabled)return;let o=aP(e);this.stoppers.push(this.animation.loop(n,o.params,{duration:o.duration,delay:o.delay??0,ease:o.ease??"inOut(2)"})),o.halo&&i.forEach((r,s)=>{this.stoppers.push(this.animation.loop(r,{scale:[.72,1.9],opacity:[.55,0]},{duration:o.halo.duration,delay:(o.halo.delay??0)+s*o.halo.duration*.5,ease:"out(2)",alternate:!1}))})}),se(()=>{this.bumped()&&this.animation.pop(this.host.nativeElement,{scale:1.3,duration:420})}),N(pt).onDestroy(()=>this.stopLoops())}stopLoops(){for(let e of this.stoppers)e();this.stoppers=[]}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-brain"]],viewQuery:function(n,i){n&1&>(i.brain,JO,5)(i.halos,eP,5),n&2&&vt(2)},hostVars:3,hostBindings:function(n,i){n&2&&(J("data-level",i.level()),X("bumped",i.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,i){n&1&&(rt(),h(0,"svg",2,0),oe(2,tP,1,1,":svg:path",null,Ei),g(),w(4,nP,2,0,"span",3),w(5,iP,2,0,"span",4)),n&2&&(d(2),re(i.paths),d(2),S(i.intensity()>=3?4:-1),d(),S(i.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 cP=["panel"];function lP(t,e){t&1&&(y(0,"span",10),u(1,"\u2713"),b())}function dP(t,e){if(t&1){let n=$();y(0,"button",8),A("mouseenter",function(){let o=D(n).$index,r=m(2);return M(r.active.set(o))})("click",function(){let o=D(n).$implicit,r=m(2);return M(r.choose(o))}),ve(1,"morse-brain",2),y(2,"span",9),u(3),b(),w(4,lP,2,0,"span",10),b()}if(t&2){let n=e.$implicit,i=e.$index,o=m(2);X("active",i===o.active())("selected",n===o.current()),J("aria-selected",n===o.current()),d(),q("level",n),d(2),k(n),d(),S(n===o.current()?4:-1)}}function uP(t,e){if(t&1){let n=$();y(0,"div",6,0),A("keydown",function(o){D(n);let r=m();return M(r.onKeydown(o))}),oe(2,dP,5,8,"button",7,Ei),b()}if(t&2){let n=m();q("morseEnter",0)("morseEnterY",6),d(2),re(n.levels())}}var iu=class t{levels=te.required();current=te.required();pick=at();host=N(Bt);shortcuts=N(An);destroyRef=N(pt);panel=Xe("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(i=>Math.min(i+1,Math.max(0,n.length-1)));return;case"ArrowUp":e.preventDefault(),this.active.update(i=>Math.max(0,i-1));return;case"Enter":{let i=n[this.active()];i&&(e.preventDefault(),this.choose(i));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=ue({type:t,selectors:[["morse-thinking-picker"]],viewQuery:function(n,i){n&1&>(i.panel,cP,5),n&2&&vt()},hostBindings:function(n,i){n&1&&A("pointerdown",function(r){return i.onDocumentPointerdown(r)},Mt)},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,i){n&1&&(y(0,"button",1),A("click",function(){return i.toggle()}),ve(1,"morse-brain",2),y(2,"span",3),u(3),b(),y(4,"span",4),u(5,"\u25BE"),b()(),w(6,uP,4,2,"div",5)),n&2&&(q("title","Thinking level: "+i.current()),J("aria-expanded",i.open()),d(),q("level",i.current()),d(2),k(i.current()),d(3),S(i.open()?6:-1))},dependencies:[un,nu],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 pP(t,e){t&1&&(h(0,"span"),u(1),g()),t&2&&(d(),ae(" \xB7 ",e))}function fP(t,e){if(t&1&&(h(0,"section")(1,"h4"),u(2,"Last assistant message"),g(),h(3,"div",13)(4,"div",14)(5,"span",15),u(6,"Input"),g(),h(7,"span",16),u(8),g()(),h(9,"div",14)(10,"span",15),u(11,"Output"),g(),h(12,"span",16),u(13),g()(),h(14,"div",14)(15,"span",15),u(16,"Reasoning"),g(),h(17,"span",16),u(18),g()(),h(19,"div",14)(20,"span",15),u(21,"Cache read"),g(),h(22,"span",16),u(23),g()(),h(24,"div",14)(25,"span",15),u(26,"Cache write"),g(),h(27,"span",16),u(28),g()(),h(29,"div",14)(30,"span",15),u(31,"Cache hit"),g(),h(32,"span",16),u(33),g()()()()),t&2){let n=m(2);d(8),k(n.lastValue("inputTokens")),d(5),k(n.lastValue("outputTokens")),d(5),k(n.lastValue("reasoningTokens")),d(5),k(n.lastValue("cacheReadTokens")),d(5),k(n.lastValue("cacheWriteTokens")),d(5),k(n.cacheHitLabel())}}function mP(t,e){if(t&1){let n=$();h(0,"button",5),F("click",function(){D(n);let o=m();return M(o.close())}),g(),h(1,"div",6)(2,"header")(3,"h3"),u(4,"Context"),g(),h(5,"button",7),F("click",function(){D(n);let o=m();return M(o.close())}),u(6,"\xD7"),g()(),h(7,"div",8),u(8),w(9,pP,2,1,"span"),g(),h(10,"div",9)(11,"span"),u(12,"Context"),g(),h(13,"span"),u(14),g()(),h(15,"div",10),ce(16,"span",11),g(),h(17,"div",12)(18,"span"),u(19),g()(),h(20,"div",13)(21,"div",14)(22,"span",15),u(23,"Messages"),g(),h(24,"span",16),u(25),g()(),h(26,"div",14)(27,"span",15),u(28,"User"),g(),h(29,"span",16),u(30),g()(),h(31,"div",14)(32,"span",15),u(33,"Assistant"),g(),h(34,"span",16),u(35),g()(),h(36,"div",14)(37,"span",15),u(38,"Tool calls"),g(),h(39,"span",16),u(40),g()(),h(41,"div",14)(42,"span",15),u(43,"Cost"),g(),h(44,"span",16),u(45),g()(),h(46,"div",14)(47,"span",15),u(48,"Output limit"),g(),h(49,"span",16),u(50),g()()(),w(51,fP,34,6,"section"),h(52,"section")(53,"h4"),u(54,"Session totals"),g(),h(55,"div",17),u(56),g()()()}if(t&2){let n,i=m();d(8),ae(" ",i.modelLabel()),d(),S((n=i.sessionTitle())?9:-1,n),d(5),wo("",i.usedLabel()," / ",i.limitLabel()),d(2),At("width",i.fillPercent(),"%"),X("warn",i.level()==="warn")("danger",i.level()==="danger"),d(3),ae("",i.percentLabel()," used"),d(6),k(i.counts()?.totalMessages??"\u2014"),d(5),k(i.counts()?.userMessages??"\u2014"),d(5),k(i.counts()?.assistantMessages??"\u2014"),d(5),k(i.counts()?.toolCalls??"\u2014"),d(5),k(i.costLabel()),d(5),k(i.outputLimitLabel()),d(),S(i.lastUsage()?51:-1),d(5),k(i.sessionLine()||"No usage yet.")}}var hP=15.5,pC=2*Math.PI*hP,ou=class t{usage=te();lastUsage=te();costUsd=te();contextUsage=te();counts=te();model=te();sessionTitle=te();open=O(!1);circumference=pC;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(()=>pC*(1-this.fillPercent()/100));usedLabel=E(()=>{let e=this.contextUsage()?.tokens;return e==null?"\u2014":li(e)});limitLabel=E(()=>{let e=this.contextUsage()?.contextWindow;return e===void 0?"\u2014":li(e)});costLabel=E(()=>Oh(this.costUsd())??"\u2014");outputLimitLabel=E(()=>{let e=this.model()?.maxTokens;return e===void 0?"\u2014":li(e)});modelLabel=E(()=>this.model()?.name??this.model()?.id??"no model");tooltip=E(()=>{let e=[`Context ${this.percentLabel()} \xB7 ${this.usedLabel()} / ${this.limitLabel()}`],n=Ph({usage:this.usage(),costUsd:this.costUsd(),contextUsage:this.contextUsage()});return n.length>0&&e.push(n),e.join(`
|
|
15
|
-
`)});sessionLine=E(()=>Ph({usage:this.usage(),costUsd:this.costUsd(),contextUsage:this.contextUsage()}));cacheHitLabel=E(()=>{let e=Nh(this.lastUsage());return e===void 0?"\u2014":`${e.toFixed(1)}%`});lastValue(e){return uC(this.lastUsage(),e)}toggle(){this.open.update(e=>!e)}close(){this.open.set(!1)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-usage-indicator"]],hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.close()},Mt)},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,i){n&1&&(h(0,"button",0),F("click",function(){return i.toggle()}),rt(),h(1,"svg",1),ce(2,"circle",2)(3,"circle",3),g(),Jt(),h(4,"span",4),u(5),g()(),w(6,mP,57,19)),n&2&&(ie("title",i.tooltip()),J("aria-expanded",i.open()),d(),X("warn",i.level()==="warn")("danger",i.level()==="danger"),d(2),J("stroke-dasharray",i.circumference)("stroke-dashoffset",i.dashOffset()),d(2),k(i.percentLabel()),d(),S(i.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 gP=["promptInput"],yP=["fileInput"],Rh=(t,e)=>e.id;function _P(t,e){if(t&1){let n=$();y(0,"div",30)(1,"span",31),u(2,"\u283F"),b(),y(3,"span",32),u(4),b(),y(5,"div",33)(6,"button",34),A("click",function(){let o=D(n).$implicit,r=m(2);return M(r.editQueued(o))}),u(7," \u270E "),y(8,"span"),u(9,"edit"),b()(),y(10,"button",35),A("click",function(){let o=D(n).$implicit,r=m(2);return M(r.sendQueued(o))}),u(11," \u27A4 "),y(12,"span"),u(13,"send"),b()(),y(14,"button",36),A("click",function(){let o=D(n).$implicit,r=m(2);return M(r.removeQueued(o))}),u(15," \xD7 "),b()()()}if(t&2){let n=e.$implicit,i=e.$index;q("morseEnter",i)("morseEnterY",4),d(3),q("title",n.text),d(),k(n.text)}}function vP(t,e){if(t&1&&(y(0,"div",3)(1,"div",26)(2,"span",27),u(3,"\u23F2"),b(),y(4,"span",28),u(5,"Queued messages"),b(),y(6,"span",29),u(7),b()(),oe(8,_P,16,4,"div",30,Rh),b()),t&2){let n=m();d(7),k(n.queuedMessages().length),d(),re(n.queuedMessages())}}function bP(t,e){if(t&1){let n=$();y(0,"button",37),A("click",function(){D(n);let o=m();return M(o.attachSelection())}),u(1," \u29C9 "),b()}}function xP(t,e){t&1&&u(0," add files \xB7 @ to mention \xB7 / for commands ")}function CP(t,e){t&1&&u(0," upload or drop files \xB7 / for commands ")}function EP(t,e){t&1&&u(0," drop files here \xB7 / for commands ")}function wP(t,e){if(t&1){let n=$();y(0,"morse-file-picker",38),A("activeChange",function(o){D(n);let r=m();return M(r.mentionActive.set(o))})("pick",function(o){D(n);let r=m();return M(r.onPickFile(o))})("reload",function(){D(n);let o=m();return M(o.reloadFiles())})("close",function(){D(n);let o=m();return M(o.onPickerClose())}),b()}if(t&2){let n=m();q("morsePopoverFit",300)("files",n.pickerMatches())("busy",n.loadingFiles())("query",n.pickerFilter())("active",n.mentionActive())}}function SP(t,e){if(t&1){let n=$();y(0,"morse-command-picker",39),A("activeChange",function(o){D(n);let r=m();return M(r.paletteActive.set(o))})("pick",function(o){D(n);let r=m();return M(r.activatePalette(o,"run"))})("close",function(){D(n);let o=m();return M(o.onPaletteClose())}),b()}if(t&2){let n=m();q("morsePopoverFit",320)("items",n.paletteItems())("query",n.paletteFilter())("active",n.paletteActive())}}function TP(t,e){if(t&1){let n=$();y(0,"li",40)(1,"button",42),A("click",function(){D(n);let o=m(2);return M(o.lockLive())}),y(2,"span",43),u(3,"\u29C9"),b(),y(4,"span",44),u(5),b(),y(6,"span",45),u(7),b()(),y(8,"button",46),A("click",function(){D(n);let o=m(2);return M(o.dismissLive())}),u(9," \xD7 "),b()()}if(t&2){let n=e,i=m(2);q("morseEnter",0)("morseEnterY",6)("morseEnterScale",.55)("morseEnterDuration",320),d(),q("title",i.lockLiveLabel()),J("aria-label","Lock the "+n.path+" selection as a pin"),d(3),q("title",n.path),d(),k(n.path),d(2),k(i.pinRange(n)),d(),J("aria-label","Dismiss the "+n.path+" selection preview")}}function DP(t,e){if(t&1){let n=$();y(0,"li",41),ve(1,"img",47),y(2,"span",44),u(3),b(),y(4,"button",48),A("click",function(){let o=D(n).$implicit,r=m(2);return M(r.removeImage(o.id))}),u(5," \xD7 "),b()()}if(t&2){let n=e.$implicit,i=e.$index,o=m(2);q("morseEnter",o.chipOffset()+i)("morseEnterY",6)("morseEnterScale",.55)("morseEnterDuration",320),d(),q("src",o.preview(n),xi)("alt",n.name),d(),q("title",n.name),d(),k(n.name),d(),J("aria-label","Remove "+n.name)}}function MP(t,e){if(t&1&&(y(0,"span",45),u(1),b()),t&2){let n=m().$implicit,i=m(2);d(),k(i.pinRange(n))}}function kP(t,e){if(t&1){let n=$();y(0,"li",41)(1,"button",42),A("click",function(){let o=D(n).$implicit,r=m(2);return M(r.openPinPreview(o))}),y(2,"span",43),u(3,"\u29C9"),b(),y(4,"span",49),u(5),b(),w(6,MP,2,1,"span",45),b(),y(7,"button",48),A("click",function(){let o=D(n).$implicit,r=m(2);return M(r.removePin(o.id))}),u(8," \xD7 "),b()()}if(t&2){let n=e.$implicit,i=e.$index,o=m(2);q("morseEnter",o.chipOffset()+o.images().length+i)("morseEnterY",6)("morseEnterScale",.55)("morseEnterDuration",320),d(),q("title","Open "+n.path+" in the preview"),d(4),k(n.path),d(),S(n.startLine!==void 0?6:-1),d(),J("aria-label","Unpin "+n.path)}}function IP(t,e){if(t&1&&(y(0,"ul",12),w(1,TP,10,10,"li",40),oe(2,DP,6,9,"li",41,Rh),oe(4,kP,9,8,"li",41,Rh),b()),t&2){let n,i=m();d(),S((n=i.livePreview())?1:-1,n),d(),re(i.images()),d(2),re(i.pins())}}function NP(t,e){if(t&1&&(y(0,"span",51),u(1),b()),t&2){let n=m(2);d(),wo(" \u2193",n.streamedTokens()," \xB7 ",n.tokensPerSecond()??0," t/s ")}}function OP(t,e){if(t&1&&(y(0,"span",53),ve(1,"span",55),y(2,"span"),u(3),b(),y(4,"span",56),ve(5,"i")(6,"i")(7,"i"),b()()),t&2){let n=m(2);d(3),ae("Working ",n.elapsed())}}function PP(t,e){if(t&1&&ve(0,"morse-usage-indicator",54),t&2){let n=m(2);q("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 AP(t,e){if(t&1&&(y(0,"div",14)(1,"div",50),w(2,NP,2,2,"span",51),b(),y(3,"div",52),w(4,OP,8,1,"span",53),w(5,PP,1,7,"morse-usage-indicator",54),b()()),t&2){let n=m();d(2),S(n.running()?2:-1),d(2),S(n.running()?4:-1),d(),S(n.showUsage()?5:-1)}}function RP(t,e){if(t&1&&(y(0,"span",18),u(1),b()),t&2){let n=e;q("title",n),d(),k(n)}}function LP(t,e){if(t&1){let n=$();y(0,"morse-model-picker",57),A("pick",function(o){D(n);let r=m();return M(r.onModelPick(o))})("close",function(){D(n);let o=m();return M(o.closeModelPicker())}),b()}if(t&2){let n=m();q("morsePopoverFit",340)("models",n.models())("current",n.modelKey())}}function FP(t,e){if(t&1){let n=$();y(0,"button",58),A("click",function(){D(n);let o=m();return M(o.sendWith("steer"))}),u(1,"Steer"),b(),y(2,"button",58),A("click",function(){D(n);let o=m();return M(o.sendWith("followUp"))}),u(3,"Follow up"),b(),y(4,"button",59),A("click",function(){D(n);let o=m();return M(o.abort())}),u(5,"\u25A0"),b()}}function VP(t,e){if(t&1){let n=$();y(0,"button",60),A("click",function(){D(n);let o=m();return M(o.sendWith("new"))}),u(1," \u2191 "),b()}if(t&2){let n=m();q("disabled",!n.canSend())}}function jP(t,e){if(t&1){let n=$();y(0,"morse-prompt-template-dialog",61),A("submitted",function(o){D(n);let r=m();return M(r.onTemplateSubmit(o))})("cancelled",function(){D(n);let o=m();return M(o.closeTemplate())}),b()}t&2&&q("request",e)}var ru=class t{morse=N(Ze);shell=N(Ht);shortcuts=N(An);destroyRef=N(pt);attachments=N(Ui);queue=N(Hd);workspace=N(zi);tabs=N(dn);uploads=N(Ds);promptInput=Xe("promptInput");fileInput=Xe("fileInput");draining=!1;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,Ah(this.morse.items())-this.baseline())/4));tokensPerSecond=O(void 0);baseline=O(0);throughput=[];images=this.attachments.images;pins=this.attachments.pins;queuedMessages=this.queue.queued;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(()=>lC(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=[...fC.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 dC(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?"":HP(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 o=this.attachments.takeMentions().map(s=>s.startsWith("@")?s:`@${s}`).join(`
|
|
13
|
+
`);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 Jb(t={}){if(Yb())return new $d;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 Bd;let i=n.searchParams.get("server");if(i)return new Xa({url:i,WebSocketImpl:t.WebSocketImpl});let o=n.protocol==="https:",r=t.websocketPath??"/ws";return new Xa({url:`${o?"wss":"ws"}://${n.host}${r}`,WebSocketImpl:t.WebSocketImpl})}var Ui=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=[],i=[];for(let o of e){if(!o.type.startsWith("image/")){i.push(o.name);continue}let r=await vh(o);if(!r){i.push(o.name);continue}this.counter+=1,n.push({id:`attachment-${this.counter}`,name:o.name||`image-${this.counter}.png`,mimeType:o.type,data:r,bytes:o.size})}return{images:n,skipped:i}}add(e){e.length!==0&&this.attached.update(n=>[...n,...e])}async accept(e){let{images:n,skipped:i}=await this.read(e);return this.add(n),{attached:n.length,skipped:i}}addMentions(e){let n=e.map(i=>i.trim()).filter(i=>i.length>0);n.length!==0&&this.pendingMentions.update(i=>[...i,...n])}seed(e,n){e.length>0&&this.add(e.map((i,o)=>{this.counter+=1;let s=(i.mimeType.split("/")[1]?.toLowerCase()??"").replace(/[^a-z0-9]/g,"")||"png";return{id:`seed-${this.counter}`,name:o===0?`image.${s}`:`image-${o+1}.${s}`,mimeType:i.mimeType,data:i.data,bytes:Math.floor(i.data.length*3/4)}}));for(let i of n)this.pin({path:i.path,startLine:i.startLine,endLine:i.endLine})}setPinRange(e,n){this.pinned.update(i=>i.map(o=>o.id===e?K(V({},o),{startLine:n.startLine,endLine:n.endLine}):o))}pin(e,n){if(e.path.length===0)return"";if(e.startLine===void 0){let _=this.pinned().find(C=>C.path===e.path&&C.startLine===void 0);if(_!==void 0)return _.id;this.counter+=1;let x=`pin-${this.counter}`;return this.pinned.update(C=>[...C,K(V({},e),{id:x})]),x}let i=this.pinned(),o=e.startLine,r=e.endLine??e.startLine,s=new Set(n===void 0?[]:[n]),a,c=!0;for(;c;){c=!1;for(let _ of i){if(s.has(_.id)||_.path!==e.path||_.startLine===void 0)continue;let x=_.startLine,C=_.endLine??x;x<=r+1&&C+1>=o&&(o=Math.min(o,x),r=Math.max(r,C),s.add(_.id),a??=_.id,c=!0)}}this.counter+=1;let l={id:n??a??`pin-${this.counter}`,path:e.path,startLine:o,endLine:r>o?r:void 0},p=[],f=!1;for(let _ of i){if(s.has(_.id)){f||(p.push(l),f=!0);continue}p.push(_)}return f||p.push(l),this.pinned.set(p),l.id}removePin(e){this.pinned.update(n=>n.filter(i=>i.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(i=>i.id!==e))}takeImages(){let e=this.attached().map(({data:n,mimeType:i})=>({data:n,mimeType:i}));return this.attached.set([]),e}takePins(){let e=this.pinned().map(({path:n,startLine:i,endLine:o})=>{let r={path:n};return i!==void 0&&(r.startLine=i),o!==void 0&&(r.endLine=o),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=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};function vh(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 i=n.result;if(typeof i!="string"){e(void 0);return}let o=i.indexOf(",");e(o===-1?void 0:i.slice(o+1))},n.readAsDataURL(t)})}var ex=new He("morse.transport",{providedIn:"root",factory:()=>Jb()});var tx={name:"@morse/ui-angular",version:"0.9.2"},NI=6e3,Ze=class t{transport=N(ex);destroyRef=N(pt);view=O(jd());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??tx.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=Bb({transport:this.transport,frontend:tx}),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)},NI))}clearSlowConnectionTimer(){this.slowConnectionTimer!==void 0&&(clearTimeout(this.slowConnectionTimer),this.slowConnectionTimer=void 0)}prompt(e,n="new",i,o){this.actions.prompt(e,n,i,o)}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=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};var Hd=class t{items=O([]);counter=0;queued=this.items.asReadonly();count=E(()=>this.items().length);head(e){return this.items().find(n=>n.sessionId===e)}enqueue(e,n){this.counter+=1;let i=`queued-${this.counter}`;return this.items.update(o=>[...o,K(V({},e),{id:i,sessionId:n})]),i}remove(e){this.items.update(n=>n.filter(i=>i.id!==e))}shift(e){let n=this.head(e);if(n!==void 0)return this.remove(n.id),n}clear(){this.items.set([])}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};var sx="morse.navigation.collapsed",ax="morse.git.open",cx="morse.git.expanded",bh="morse.git.width",OI=220,PI=1600,lx="morse.git.changesHeight",nx="morse.git.changesCollapsed",ix="morse.git.historyCollapsed",AI=48,RI=1200,dx="morse.explorer.height",LI=140,FI=720;function VI(){try{return globalThis.localStorage?.getItem(sx)==="1"}catch{return!1}}function jI(t){try{globalThis.localStorage?.setItem(sx,t?"1":"0")}catch{}}function $I(){try{return globalThis.localStorage?.getItem(ax)==="1"}catch{return!1}}function BI(t){try{globalThis.localStorage?.setItem(ax,t?"1":"0")}catch{}}function HI(){try{return globalThis.localStorage?.getItem(cx)==="1"}catch{return!1}}function UI(t){try{globalThis.localStorage?.setItem(cx,t?"1":"0")}catch{}}function ux(t){return Math.round(Math.min(RI,Math.max(AI,t)))}function px(t){return Math.round(Math.min(PI,Math.max(OI,t)))}function zI(){try{let t=globalThis.localStorage?.getItem(bh);if(t==null)return;let e=Number.parseInt(t,10);return Number.isFinite(e)?px(e):void 0}catch{return}}function GI(t){try{globalThis.localStorage?.setItem(bh,String(t))}catch{}}function qI(){try{let t=globalThis.localStorage?.getItem(lx);if(t==null)return;let e=Number.parseInt(t,10);return Number.isFinite(e)?ux(e):void 0}catch{return}}function WI(t){try{globalThis.localStorage?.setItem(lx,String(t))}catch{}}function ox(t){try{return globalThis.localStorage?.getItem(t)==="1"}catch{return!1}}function rx(t,e){try{globalThis.localStorage?.setItem(t,e?"1":"0")}catch{}}function fx(t){return Math.round(Math.min(FI,Math.max(LI,t)))}function YI(){try{let t=globalThis.localStorage?.getItem(dx);if(t==null)return;let e=Number.parseInt(t,10);return Number.isFinite(e)?fx(e):void 0}catch{return}}function KI(t){try{globalThis.localStorage?.setItem(dx,String(t))}catch{}}var Ht=class t{navigationVisible=O(!1);navigationOpen=this.navigationVisible.asReadonly();collapsed=O(VI());navigationCollapsed=this.collapsed.asReadonly();gitPanel=O($I());gitPanelOpen=this.gitPanel.asReadonly();gitExpanded=O(HI());gitPanelExpanded=this.gitExpanded.asReadonly();gitWidthSignal=O(zI());gitPanelWidth=this.gitWidthSignal.asReadonly();changesHeightSignal=O(qI());gitChangesHeight=this.changesHeightSignal.asReadonly();changesCollapsedSignal=O(ox(nx));gitChangesCollapsed=this.changesCollapsedSignal.asReadonly();historyCollapsedSignal=O(ox(ix));gitHistoryCollapsed=this.historyCollapsedSignal.asReadonly();explorer=O(YI());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),jI(e)}toggleGitPanel(){this.setGitPanel(!this.gitPanel())}closeGitPanel(){this.setGitPanel(!1)}setGitPanel(e){this.gitPanel.set(e),BI(e)}toggleGitPanelExpanded(){this.setGitExpanded(!this.gitExpanded())}setGitExpanded(e){this.gitExpanded.set(e),UI(e)}toggleGitChanges(){this.changesCollapsedSignal.update(e=>!e),rx(nx,this.changesCollapsedSignal())}toggleGitHistory(){this.historyCollapsedSignal.update(e=>!e),rx(ix,this.historyCollapsedSignal())}setGitChangesHeight(e,n=!0){let i=ux(e);this.changesHeightSignal.set(i),n&&WI(i)}setGitPanelWidth(e,n=!0){let i=px(e);this.gitWidthSignal.set(i),n&&GI(i)}resetGitPanelWidth(){this.gitWidthSignal.set(void 0);try{globalThis.localStorage?.removeItem(bh)}catch{}}setExplorerHeight(e){let n=fx(e);this.explorer.set(n),KI(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=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};var Ja=[{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:"view.git",group:"Navigate",label:"Toggle the git panel",detail:"Shows or hides the history and graph for the active project. The browser host only \u2014 VS Code has its own Source Control view.",binding:{key:"g",mod:!0,alt:!0},overlay:!0,whileTyping:!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 ec(t){return"binding"in t}function mx(){let t=globalThis.navigator;return/mac|iphone|ipad/i.test(t?.userAgent??"")}function hx(t,e=mx()){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 An=class t{shell=N(Ht);handlers=new Map;revision=O(0);catalog=Ja;available=E(()=>{this.revision();let e=new Map;for(let n of Ja){if(!ec(n))continue;let i=this.handlers.get(n.id);e.set(n.id,i!==void 0&&(i.enabled?.()??!0))}return e});constructor(){let e=globalThis.document;e&&(e.addEventListener("keydown",this.onKeydown,!0),N(pt).onDestroy(()=>e.removeEventListener("keydown",this.onKeydown,!0)))}bind(e,n,i){let o={run:n,enabled:i};return this.handlers.set(e,o),this.bump(),()=>{this.handlers.get(e)===o&&(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=Ja.find(o=>ec(o)&&ZI(o.binding,e));if(n===void 0||n.whileTyping!==!0&&QI(e.target)||n.overlay===!0&&this.shell.modalOpen()&&!(n.id==="help.shortcuts"&&this.shell.shortcutsOpen()))return;let i=this.handlers.get(n.id);i===void 0||i.enabled!==void 0&&!i.enabled()||(e.preventDefault(),i.run())};static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};function ZI(t,e){return e.key.toLowerCase()!==t.key.toLowerCase()||t.mod===!0!==(mx()?e.metaKey:e.ctrlKey)?!1:t.alt===!0===e.altKey}function QI(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 XI=10*1024*1024,Ds=class t{morse=N(Ze);available=E(()=>this.morse.capabilities()?.fileUpload===!0);async upload(e){let n=[],i=[];for(let o of e){if(o.size>XI){i.push(o.name);continue}let r=await vh(o);if(!r){i.push(o.name);continue}let s=await this.morse.requestHostCommand("uploadFile",{name:o.name,mimeType:o.type,data:r}),a=typeof s?.path=="string"?s.path:void 0;if(!a){i.push(o.name);continue}n.push({path:a,name:o.name,bytes:typeof s?.bytes=="number"?s.bytes:o.size})}return{added:n,failed:i}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};function xh(t){if(t==="??")return"U";if(t.includes("U")||t==="AA"||t==="DD")return"C";if(t.includes("R")||t.includes("C"))return"R";if(t.includes("D"))return"D";if(t.includes("A"))return"A";if(t.includes("M")||t.includes("T"))return"M"}function gx(t){if(typeof t!="object"||t===null)return;let e=t;return e.isRepo!==!0?typeof e.isRepo=="boolean"?{isRepo:!1,files:[]}:void 0:{isRepo:!0,files:Array.isArray(e.files)?e.files.map(JI).filter(i=>i!==void 0):[]}}function Ud(t){let e=new Map;for(let n of t?.files??[]){let i=xh(n.status);i!==void 0&&e.set(n.path,i)}return e}function JI(t){if(typeof t!="object"||t===null)return;let e=t,n=e.path,i=e.status;if(!(typeof n!="string"||typeof i!="string"))return{path:n,status:i}}var eN=4e3,zi=class t{morse=N(Ze);cache=O([]);loading=O(!1);statuses=O(void 0);failure=O(void 0);loadedFor;inFlight=!1;files=this.cache.asReadonly();busy=this.loading.asReadonly();status=this.statuses.asReadonly();error=this.failure.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)}),se(e=>{if(!this.available())return;let n=setInterval(()=>{typeof document<"u"&&document.hidden||this.ensureLoaded(!0,!0)},eN);e(()=>clearInterval(n))})}refresh(){this.ensureLoaded(!0)}ensureLoaded(e=!1,n=!1){let i=this.morse.workspace().cwd;i.length===0||this.inFlight||!e&&this.loadedFor===i||(this.inFlight=!0,n||(this.loading.set(!0),this.failure.set(void 0)),Promise.all([this.morse.requestHostCommand("listFiles",e?{fresh:!0}:void 0),this.morse.requestHostCommand("gitStatus")]).then(([o,r])=>{if(this.morse.workspace().cwd!==i)return;let s=tN(o);if(s===void 0){this.failure.set("Could not list this project.");return}this.loadedFor=i,this.cache.set(s),this.statuses.set(gx(r))}).finally(()=>{this.inFlight=!1,n||this.loading.set(!1),this.morse.workspace().cwd!==i&&this.ensureLoaded(!0)}))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};function tN(t){if(typeof t!="object"||t===null)return;let e=t.files;if(Array.isArray(e))return e.filter(n=>typeof n=="string")}var Fx=_1(Lx(),1);var Kd=Fx.default;function Vx(t){let e=t.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});let o={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,o]};o.contains.push(a);let c={match:/\\"/},l={className:"string",begin:/'/,end:/'/},p={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},_=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],x=t.SHEBANG({binary:`(${_.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},T=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],P=["true","false"],Y={match:/(\/[a-z._-]+)+/},W=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],be=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],ye=["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"],Me=["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:T,literal:P,built_in:[...W,...be,"set","shopt",...ye,...Me]},contains:[x,t.SHEBANG(),C,f,r,s,Y,a,c,l,p,n]}}var GN=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_-]*/}}),qN=["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"],WN=["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"],YN=[...qN,...WN],KN=["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(),ZN=["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(),QN=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),XN=["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 jx(t){let e=t.regex,n=GN(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},o="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,i,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:":("+ZN.join("|")+")"},{begin:":(:)?("+QN.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+XN.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:o,attribute:KN.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+YN.join("|")+")\\b"}]}}function $x(t){let e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Bx(t){let 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 Hx="[A-Za-z$_][0-9A-Za-z$_]*",JN=["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"],eO=["true","false","null","undefined","NaN","Infinity"],Ux=["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"],zx=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Gx=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],tO=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],nO=[].concat(Gx,Ux,zx);function qx(t){let e=t.regex,n=(G,{after:L})=>{let ne="</"+G[0].slice(1);return G.input.indexOf(ne,L)!==-1},i=Hx,o={begin:"<>",end:"</>"},r=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(G,L)=>{let ne=G[0].length+G.index,Le=G.input[ne];if(Le==="<"||Le===","){L.ignoreMatch();return}Le===">"&&(n(G,{after:ne})||L.ignoreMatch());let tt,Ut=G.input.substring(ne);if(tt=Ut.match(/^\s*=/)){L.ignoreMatch();return}if((tt=Ut.match(/^\s+extends\s+/))&&tt.index===0){L.ignoreMatch();return}}},a={$pattern:Hx,keyword:JN,literal:eO,built_in:nO,"variable.language":tO},c="[0-9](_?[0-9])*",l=`\\.(${c})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${p})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${p})\\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},_={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},x={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,_],subLanguage:"xml"}},C={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,_],subLanguage:"css"}},T={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,_],subLanguage:"graphql"}},P={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,_]},W={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:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},be=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,x,C,T,P,{match:/\$\d+/},f];_.contains=be.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(be)});let ye=[].concat(W,_.contains),Me=ye.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(ye)}]),me={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:Me},Je={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,e.concat(i,"(",e.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],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:{_:[...Ux,...zx]}},Be={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ft={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[me],illegal:/%/},St={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Rt(G){return e.concat("(?!",G.join("|"),")")}let kt={match:e.concat(/\b/,Rt([...Gx,"super","import","await"].map(G=>`${G}\\s*\\(`)),i,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},et={begin:e.concat(/\./,e.lookahead(e.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Se={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},me]},R="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",Q={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(R)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[me]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:Me,CLASS_REFERENCE:je},illegal:/#(?![$_A-Za-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),Be,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,x,C,T,P,W,{match:/\$\d+/},f,je,{scope:"attr",match:i+e.lookahead(":"),relevance:0},Q,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[W,t.REGEXP_MODE,{className:"function",begin:R,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:Me}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.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"]}]}]},ft,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[me,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},et,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[me]},kt,St,Je,Se,{match:/\$[(.]/}]}}var iO="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",oO={scope:"number",match:iO,relevance:0};function Wx(t){let e={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],o={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:i},contains:[e,n,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,o,oO,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Yx(t){let e=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},o={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}/}]},p={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=t.inherit(l,{contains:[]}),_=t.inherit(p,{contains:[]});l.contains.push(_),p.contains.push(f);let x=[n,c];return[l,p,f,_].forEach(Y=>{Y.contains=Y.contains.concat(x)}),x=x.concat(l,p),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:x},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:x}]}]},n,r,i,l,p,{className:"quote",begin:"^>\\s+",contains:x,end:"$"},o,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])(?![$])/,i=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),o=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:"\\$+"+i},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}),p=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":(et,Se)=>{Se.data._beginMatch=et[1]||et[2]},"on:end":(et,Se)=>{Se.data._beginMatch!==et[1]&&Se.ignoreMatch()}},_=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),x=`[
|
|
14
|
+
]`,C={scope:"string",variants:[p,l,f,_]},T={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},P=["false","null","true"],Y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],W=["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"],ye={keyword:Y,literal:(et=>{let Se=[];return et.forEach(R=>{Se.push(R),R.toLowerCase()===R?Se.push(R.toUpperCase()):Se.push(R.toLowerCase())}),Se})(P),built_in:W},Me=et=>et.map(Se=>Se.replace(/\|\d+$/,"")),me={variants:[{match:[/new/,e.concat(x,"+"),e.concat("(?!",Me(W).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},Je=e.concat(i,"\\b(?!\\()"),je={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),Je],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,e.concat(/::/,e.lookahead(/(?!class\b)/)),Je],scope:{1:"title.class",3:"variable.constant"}},{match:[o,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},Be={scope:"attr",match:e.concat(i,e.lookahead(":"),e.lookahead(/(?!::)/))},ft={relevance:0,begin:/\(/,end:/\)/,keywords:ye,contains:[Be,s,je,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,C,T,me]},St={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",Me(Y).join("\\b|"),"|",Me(W).join("\\b|"),"\\b)"),i,e.concat(x,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[ft]};ft.contains.push(St);let Rt=[Be,je,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,C,T,me],kt={begin:e.concat(/#\[\s*\\?/,e.either(o,r)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:P,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:P,keyword:["new","array"]},contains:["self",...Rt]},...Rt,{scope:"meta",variants:[{match:o},{match:r}]}]};return{case_insensitive:!1,keywords:ye,contains:[kt,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,St,je,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},me,{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:ye,contains:["self",kt,s,je,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,C,T]}]},{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,T]}}function Zx(t){let e=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["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:i,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:/#/},p={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,p,l]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,c,p,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,p,l]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,p,l]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},_="[0-9](_?[0-9])*",x=`(\\b(${_}))?\\.(${_})|\\b(${_})\\.`,C=`\\b|${i.join("|")}`,T={className:"number",relevance:0,variants:[{begin:`(\\b(${_})|(${x}))[eE][+-]?(${_})[jJ]?(?=${C})`},{begin:`(${x})[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(${_})[jJ](?=${C})`}]},P={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},Y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",c,T,f,t.HASH_COMMENT_MODE]}]};return l.contains=[f,T,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[c,T,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,P,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[Y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[T,Y,f]}]}}var Zd="[A-Za-z$_][0-9A-Za-z$_]*",Qx=["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"],Xx=["true","false","null","undefined","NaN","Infinity"],Jx=["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"],eC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],tC=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],nC=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],iC=[].concat(tC,Jx,eC);function rO(t){let e=t.regex,n=(G,{after:L})=>{let ne="</"+G[0].slice(1);return G.input.indexOf(ne,L)!==-1},i=Zd,o={begin:"<>",end:"</>"},r=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(G,L)=>{let ne=G[0].length+G.index,Le=G.input[ne];if(Le==="<"||Le===","){L.ignoreMatch();return}Le===">"&&(n(G,{after:ne})||L.ignoreMatch());let tt,Ut=G.input.substring(ne);if(tt=Ut.match(/^\s*=/)){L.ignoreMatch();return}if((tt=Ut.match(/^\s+extends\s+/))&&tt.index===0){L.ignoreMatch();return}}},a={$pattern:Zd,keyword:Qx,literal:Xx,built_in:iC,"variable.language":nC},c="[0-9](_?[0-9])*",l=`\\.(${c})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${p})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${p})\\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},_={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},x={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,_],subLanguage:"xml"}},C={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,_],subLanguage:"css"}},T={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,_],subLanguage:"graphql"}},P={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,_]},W={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:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},be=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,x,C,T,P,{match:/\$\d+/},f];_.contains=be.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(be)});let ye=[].concat(W,_.contains),Me=ye.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(ye)}]),me={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:Me},Je={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,e.concat(i,"(",e.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],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:{_:[...Jx,...eC]}},Be={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ft={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[me],illegal:/%/},St={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Rt(G){return e.concat("(?!",G.join("|"),")")}let kt={match:e.concat(/\b/,Rt([...tC,"super","import","await"].map(G=>`${G}\\s*\\(`)),i,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},et={begin:e.concat(/\./,e.lookahead(e.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Se={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},me]},R="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",Q={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(R)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[me]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:Me,CLASS_REFERENCE:je},illegal:/#(?![$_A-Za-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),Be,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,x,C,T,P,W,{match:/\$\d+/},f,je,{scope:"attr",match:i+e.lookahead(":"),relevance:0},Q,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[W,t.REGEXP_MODE,{className:"function",begin:R,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:Me}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.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"]}]}]},ft,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[me,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},et,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[me]},kt,St,Je,Se,{match:/\$[(.]/}]}}function oC(t){let e=t.regex,n=rO(t),i=Zd,o=["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:o},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:Zd,keyword:Qx.concat(c),literal:Xx,built_in:iC.concat(o),"variable.language":nC},p={className:"meta",begin:"@"+i},f=(T,P,Y)=>{let W=T.contains.findIndex(be=>be.label===P);if(W===-1)throw new Error("can not find mode to replace");T.contains.splice(W,1,Y)};Object.assign(n.keywords,l),n.exports.PARAMS_CONTAINS.push(p);let _=n.contains.find(T=>T.scope==="attr"),x=Object.assign({},_,{match:e.concat(i,e.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,_,x]),n.contains=n.contains.concat([p,r,s,x]),f(n,"shebang",t.SHEBANG()),f(n,"use_strict",a);let C=n.contains.find(T=>T.label==="func.def");return C.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function rC(t){let e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,o={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:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{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},o,{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 sC(t){let e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={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,o]},a=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),_={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"},x={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},C={begin:/\{/,end:/\}/,contains:[x],illegal:"\\n",relevance:0},T={begin:"\\[",end:"\\]",contains:[x],illegal:"\\n",relevance:0},P=[i,{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}},_,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},C,T,r,s],Y=[...P];return Y.pop(),Y.push(a),x.contains=Y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:P}}for(let[t,e]of Object.entries({bash:Vx,css:jx,diff:$x,go:Bx,javascript:qx,json:Wx,markdown:Yx,php:Kx,python:Zx,typescript:oC,xml:rC,yaml:sC}))Kd.registerLanguage(t,e);var sO={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"},aO={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 kh(t){let e=t.split("/").pop()??"",n=e.lastIndexOf(".");if(!(n<=0))return aO[e.slice(n+1).toLowerCase()]}function Is(t,e){let n=(e??"").trim().toLowerCase(),i=sO[n]??n;return i.length>0&&Kd.getLanguage(i)!==void 0?{html:Kd.highlight(t,{language:i,ignoreIllegals:!0}).value,language:i}:{html:cO(t),language:"text"}}function cO(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}var lO="file:",dO="mention:",Ao="draft",dn=class t{morse=N(Ze);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));activeTab=E(()=>this.items().find(e=>e.id===this.active()));contextSessionId=E(()=>{let e=this.activeTab();return e?.kind==="session"?e.id:e?.kind==="file"&&e.mention===!0?e.sessionId:void 0});mentionTabs=E(()=>{let e=this.contextSessionId();return this.items().filter(n=>n.kind==="file"&&n.mention===!0&&(e===void 0?n.sessionId===void 0:n.sessionId===e))});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(i=>[...i,V({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(i=>i.map(o=>o.kind==="session"&&o.id===e.id?V(V({},o),e):o))}startDraft(e){this.openDraft(e),this.morse.newSession(e)}openDraft(e){this.items().find(i=>i.kind==="session"&&i.id===Ao)===void 0&&this.items.update(i=>[...i,{kind:"session",id:Ao,title:"New session",cwd:e,draft:!0}]),this.active.set(Ao)}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,void 0)}openMentionFile(e){this.openFileTab(e,!0,this.contextSessionId())}openFileTab(e,n,i){let o=n?aC(i,e):`${lO}${e}`,r=this.items().find(s=>s.id===o);r===void 0&&this.items.update(s=>[...s,{kind:"file",id:o,path:e,title:fO(e),language:kh(e),loading:!0,mention:n,sessionId:n?i:void 0}]),this.active.set(o),(r===void 0||this.needsLoad(r))&&this.load(o)}select(e){let n=this.items().find(i=>i.id===e);if(n!==void 0){if(this.active.set(e),n.kind==="session"){n.draft!==!0&&this.morse.activateSession(n.id,n.cwd);return}this.needsLoad(n)&&this.load(e)}}close(e){let n=this.items().findIndex(s=>s.id===e);if(n===-1)return;let i=this.items()[n],o=i.kind==="session"&&i.draft!==!0,r=i.kind==="session"?i.cwd:void 0;this.remove(this.doomedWith(e),n),o&&this.fallBackToEmptySession(r)}forget(e){let n=this.items().findIndex(i=>i.id===e);n!==-1&&this.remove(this.doomedWith(e),n)}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(a=>a.id===e);if(n===void 0)return;let i=new Set([e]);if(n.kind==="session")for(let a of this.mentionFilesOf(e))i.add(a.id);else n.mention===!0&&n.sessionId!==void 0&&i.add(n.sessionId);let o=this.items().filter(a=>!i.has(a.id)),r=o.some(a=>a.kind==="session"&&a.draft!==!0),s=o.find(a=>a.kind==="session")?.cwd;this.items.update(a=>a.filter(c=>i.has(c.id))),this.active.set(e),n.kind==="session"&&n.draft!==!0&&this.morse.activateSession(n.id,n.cwd),r&&this.fallBackToEmptySession(s)}closeToTheRight(e){let n=this.items().findIndex(c=>c.id===e);if(n===-1)return;let i=this.items().slice(n+1);if(i.length===0)return;let o=new Set(i.map(c=>c.id)),r=i.some(c=>c.kind==="session"&&c.draft!==!0),s=i.find(c=>c.kind==="session")?.cwd,a=this.active();this.items.update(c=>c.filter(l=>!o.has(l.id))),this.pruneOrphanMentions(),a!==void 0&&o.has(a)&&this.select(e),r&&this.fallBackToEmptySession(s)}closeAll(){let e=this.items().some(i=>i.kind==="session"&&i.draft!==!0),n=this.items().find(i=>i.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)}doomedWith(e){let n=new Set([e]),i=new Set(this.items().filter(o=>o.kind==="session"&&o.id!==e).map(o=>o.id));for(let o of this.items())o.kind!=="file"||o.mention!==!0||(o.sessionId===void 0||o.sessionId===e||!i.has(o.sessionId))&&n.add(o.id);return n}mentionFilesOf(e){return this.items().filter(n=>n.kind==="file"&&n.mention===!0&&n.sessionId===e)}remove(e,n){let i=this.active();if(this.items.update(s=>s.filter(a=>!e.has(a.id))),i===void 0||!e.has(i))return;let o=this.items(),r=o[Math.min(n,o.length-1)];if(r===void 0){this.active.set(void 0);return}this.select(r.id)}pruneOrphanMentions(){let e=new Set(this.items().filter(o=>o.kind==="session").map(o=>o.id)),n=this.items(),i=new Set(n.filter(o=>o.kind==="file"&&o.mention===!0&&(o.sessionId===void 0||!e.has(o.sessionId))).map(o=>o.id));i.size!==0&&this.remove(i,n.findIndex(o=>o.id===this.active()))}reload(e){this.patch(e,{diff:void 0,diffError:void 0}),this.load(e)}loadDiff(e){let n=this.items().find(i=>i.id===e);n===void 0||n.kind!=="file"||n.diff!==void 0||n.diffLoading===!0||(this.patch(e,{diffLoading:!0,diffError:void 0}),this.morse.requestHostCommand("gitDiff",{path:n.path}).then(i=>{let o=pO(i);if(o===void 0){this.patch(e,{diffLoading:!1,diffError:"Could not read this file\u2019s changes."});return}this.patch(e,{diffLoading:!1,diff:o})}))}findSession(e){return this.items().find(n=>n.kind==="session"&&n.id===e)}promoteDraft(e){this.items().some(i=>i.kind==="session"&&i.id===Ao)&&this.items.update(i=>i.map(o=>o.kind==="session"&&o.id===Ao?V({kind:"session"},e):o.kind==="file"&&o.mention===!0&&o.sessionId===Ao?K(V({},o),{sessionId:e.id,id:aC(e.id,o.path)}):o))}discardDraft(){this.items().some(n=>n.kind==="session"&&n.id===Ao)&&(this.items.update(n=>n.filter(i=>!(i.kind==="session"&&i.id===Ao))),this.pruneOrphanMentions())}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 i=await this.morse.requestHostCommand("readFile",{path:n.path}),o=uO(i);if(o===void 0){this.patch(e,{loading:!1,error:"Could not read this file."});return}this.patch(e,{loading:!1,content:o.content,size:o.size,truncated:o.truncated,binary:o.binary,language:kh(o.path)})}patch(e,n){this.items.update(i=>i.map(o=>o.id===e&&o.kind==="file"?V(V({},o),n):o))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};function uO(t){if(typeof t!="object"||t===null)return;let e=t,n=e.content,i=e.path;if(typeof n!="string"||typeof i!="string")return;let o=e.size;return{path:i,content:n,size:typeof o=="number"?o:n.length,truncated:e.truncated===!0,binary:e.binary===!0}}function pO(t){if(typeof t!="object"||t===null)return;let e=t.diff;return typeof e=="string"?e:void 0}function fO(t){let e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function aC(t,e){return`${dO}${t??""}:${e}`}function mO(t,e,n=80){let i=Math.floor(t-4-8);return Math.max(n,Math.min(e,i))}var Qd=class t{preferred=te(320,{alias:"morsePopoverFit"});host=N(Bt);renderer=N(Xi).createRenderer(null,null);observer;constructor(){no(()=>{this.fit();let e=this.anchor();e&&typeof ResizeObserver<"u"&&(this.observer=new ResizeObserver(()=>this.fit()),this.observer.observe(e))}),N(pt).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=mO(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=br({type:t,selectors:[["","morsePopoverFit",""]],hostBindings:function(n,i){n&1&&A("resize",function(){return i.onWindowResize()},um)},inputs:{preferred:[1,"morsePopoverFit","preferred"]}})};var un=class t{morseEnter=te(0);morseEnterY=te(8);morseEnterDuration=te(260);morseEnterScale=te(void 0);element=N(Bt);animation=N(ln);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=br({type:t,selectors:[["","morseEnter",""]],inputs:{morseEnter:[1,"morseEnter"],morseEnterY:[1,"morseEnterY"],morseEnterDuration:[1,"morseEnterDuration"],morseEnterScale:[1,"morseEnterScale"]}})};var hO=["list"];function gO(t,e){t&1&&(y(0,"div",2),u(1,"Reading the workspace\u2026"),b())}function yO(t,e){if(t&1&&(y(0,"div",4),u(1),b()),t&2){let n=m(2);d(),ae("No match for \u201C",n.query(),"\u201D.")}}function _O(t,e){if(t&1){let n=$();y(0,"div",4),u(1," The host returned no workspace files. "),y(2,"button",5),A("click",function(){D(n);let o=m(2);return M(o.reload.emit())}),u(3,"Load again"),b()()}}function vO(t,e){if(t&1&&w(0,yO,2,1,"div",4)(1,_O,4,0,"div",4),t&2){let n=m();S(n.query().length>0?0:1)}}function bO(t,e){if(t&1){let n=$();y(0,"button",12),A("mouseenter",function(){D(n);let o=m().$index,r=m(2);return M(r.activeChange.emit(o))})("click",function(){D(n);let o=m().$implicit,r=m(2);return M(r.quote.emit(o))}),u(1," \u29C9 "),b()}}function xO(t,e){if(t&1){let n=$();y(0,"li")(1,"button",7),A("mouseenter",function(){let o=D(n).$index,r=m(2);return M(r.activeChange.emit(o))})("click",function(){let o=D(n).$implicit,r=m(2);return M(r.pick.emit(o))}),y(2,"span",8),u(3),b(),y(4,"span",9)(5,"span",10),u(6),b(),u(7),b()(),w(8,bO,2,0,"button",11),b()}if(t&2){let n=e.$implicit,i=e.$index,o=m(2);X("active",i===o.active()),d(3),k(o.isDirectory(n)?"\u25B8":"\u25A4"),d(3),k(o.split(n).dir),d(),ae("",o.split(n).base," "),d(),S(o.isDirectory(n)?-1:8)}}function CO(t,e){if(t&1&&(y(0,"ul",null,0),oe(2,xO,9,6,"li",6,Ei),b()),t&2){let n=m();d(2),re(n.files())}}var Xd=class t{files=te.required();busy=te(!1);query=te("");active=te(0);pick=it();quote=it();close=it();reload=it();activeChange=it();list=Xe("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 i=e.getBoundingClientRect(),o=n.getBoundingClientRect();o.top<i.top?e.scrollTop-=i.top-o.top:o.bottom>i.bottom&&(e.scrollTop+=o.bottom-i.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 Ih(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-file-picker"]],viewQuery:function(n,i){n&1&>(i.list,hO,5),n&2&&vt()},inputs:{files:[1,"files"],busy:[1,"busy"],query:[1,"query"],active:[1,"active"]},outputs:{pick:"pick",quote:"quote",close:"close",reload:"reload",activeChange:"activeChange"},decls:19,vars:3,consts:[["list",""],[1,"picker",3,"morseEnter","morseEnterY"],[1,"busy"],[1,"hint"],[1,"empty"],["type","button",1,"reload",3,"click"],[3,"active"],["type","button",1,"row",3,"mouseenter","click"],[1,"icon"],[1,"path"],[1,"dir"],["type","button","title","Mention and quote a line range","aria-label","Mention and quote a line range",1,"quote"],["type","button","title","Mention and quote a line range","aria-label","Mention and quote a line range",1,"quote",3,"mouseenter","click"]],template:function(n,i){n&1&&(y(0,"div",1),w(1,gO,2,0,"div",2)(2,vO,2,1)(3,CO,4,0,"ul"),y(4,"div",3)(5,"kbd"),u(6,"\u2191"),b(),y(7,"kbd"),u(8,"\u2193"),b(),u(9," move \xB7 "),y(10,"kbd"),u(11,"Enter"),b(),u(12," mention \xB7 "),y(13,"kbd"),u(14,"\u21E7Enter"),b(),u(15," quote \xB7 "),y(16,"kbd"),u(17,"Esc"),b(),u(18," close "),b()()),n&2&&(q("morseEnter",0)("morseEnterY",6),d(),S(i.busy()&&i.files().length===0?1:i.files().length===0?2:3))},dependencies:[un],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%]{display:flex;align-items:center}li[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]{flex:1;display:flex;align-items:center;gap:8px;padding:4px 10px;border:0;border-radius:0;background:transparent;color:var(--%NS%morse-fg);font-size:12px;text-align:left;cursor:pointer}li.active[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]{background:var(--%NS%morse-active)}.quote[_ngcontent-%COMP%]{flex:none;width:26px;height:26px;margin-right:4px;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:12px;cursor:pointer;opacity:.55}.quote[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--%NS%morse-hover);color:var(--%NS%morse-fg);opacity:1}.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 lC(t,e,n=50){let i=e.trim().toLowerCase();return t.map(o=>({file:o,score:i.length===0?0:EO(o,i)})).filter(o=>o.score<Number.POSITIVE_INFINITY).sort((o,r)=>cC(o.file)-cC(r.file)||o.score-r.score||o.file.length-r.file.length||o.file.localeCompare(r.file)).slice(0,n).map(o=>o.file)}function Ih(t){return t.endsWith("/")}function cC(t){return Ih(t)?0:1}function EO(t,e){let n=(Ih(t)?t.slice(0,-1):t).toLowerCase(),i=n.lastIndexOf("/"),o=i===-1?n:n.slice(i+1);return o.startsWith(e)?0:o.includes(e)?1:n.startsWith(e)?2:n.includes(e)?3:Number.POSITIVE_INFINITY}var wO=["list"],SO=(t,e)=>e.id;function TO(t,e){if(t&1&&(y(0,"div",3),u(1),b()),t&2){let n=m(2);d(),ae("No command matches \u201C",n.query(),"\u201D.")}}function DO(t,e){t&1&&(y(0,"div",3),u(1,"No commands available in this session."),b())}function MO(t,e){if(t&1&&w(0,TO,2,1,"div",3)(1,DO,2,0,"div",3),t&2){let n=m();S(n.query().length>0?0:1)}}function kO(t,e){if(t&1&&(y(0,"span",5),u(1),b()),t&2){let n=m().$implicit;d(),k(n.icon)}}function IO(t,e){if(t&1&&(y(0,"span",8),u(1),b()),t&2){let n=m().$implicit;d(),k(n.description)}}function NO(t,e){if(t&1&&(y(0,"span",9),u(1),b()),t&2){let n=m().$implicit;d(),k(n.badge)}}function OO(t,e){if(t&1){let n=$();y(0,"li")(1,"button",4),A("mouseenter",function(){let o=D(n).$index,r=m(2);return M(r.activeChange.emit(o))})("pointerdown",function(o){return o.preventDefault()})("click",function(){let o=D(n).$implicit,r=m(2);return M(r.pick.emit(o.id))}),w(2,kO,2,1,"span",5),y(3,"span",6)(4,"span",7),u(5),b(),w(6,IO,2,1,"span",8),b(),w(7,NO,2,1,"span",9),b()()}if(t&2){let n=e.$implicit,i=e.$index,o=m(2);d(),X("active",i===o.active()),d(),S(n.icon?2:-1),d(3),k(n.label),d(),S(n.description?6:-1),d(),S(n.badge?7:-1)}}function PO(t,e){if(t&1&&(y(0,"ul",null,0),oe(2,OO,8,6,"li",null,SO),b()),t&2){let n=m();d(2),re(n.items())}}var Jd=class t{items=te.required();query=te("");active=te(0);pick=it();close=it();activeChange=it();list=Xe("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 i=e.getBoundingClientRect(),o=n.getBoundingClientRect();o.top<i.top?e.scrollTop-=i.top-o.top:o.bottom>i.bottom&&(e.scrollTop+=o.bottom-i.bottom)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-command-picker"]],viewQuery:function(n,i){n&1&>(i.list,wO,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,i){n&1&&(y(0,"div",1),w(1,MO,2,1)(2,PO,4,0,"ul"),y(3,"div",2)(4,"kbd"),u(5,"\u2191"),b(),y(6,"kbd"),u(7,"\u2193"),b(),u(8," move \xB7 "),y(9,"kbd"),u(10,"Enter"),b(),u(11," run \xB7 "),y(12,"kbd"),u(13,"Tab"),b(),u(14," insert \xB7 "),y(15,"kbd"),u(16,"Esc"),b(),u(17," close "),b()()),n&2&&(q("morseEnter",0)("morseEnterY",6),d(),S(i.items().length===0?1:2))},dependencies:[un],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 dC(t,e,n=50){let i=e.trim().toLowerCase();return i.length===0?t.slice(0,n):t.map(o=>({item:o,score:AO(o,i)})).filter(o=>o.score<Number.POSITIVE_INFINITY).sort((o,r)=>o.score-r.score||o.item.label.length-r.item.label.length).slice(0,n).map(o=>o.item)}function AO(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 RO=["card"],LO=(t,e)=>e.id;function FO(t,e){t&1&&(h(0,"p",5),u(1),g()),t&2&&(d(),k(e))}function VO(t,e){t&1&&(h(0,"span",16),u(1,"required"),g())}function jO(t,e){if(t&1){let n=$();h(0,"textarea",19),F("input",function(o){D(n);let r=m().$implicit,s=m();return M(s.setValue(r.id,o))})("keydown",function(o){D(n);let r=m(2);return M(r.onSubmitKey(o))}),g()}if(t&2){let n=m().$implicit,i=m();ie("value",i.value(n.id)),J("aria-label",n.label)}}function $O(t,e){if(t&1){let n=$();h(0,"input",20),F("input",function(o){D(n);let r=m().$implicit,s=m();return M(s.setValue(r.id,o))})("keydown.enter",function(o){D(n);let r=m(2);return M(r.submit(o))}),g()}if(t&2){let n=m().$implicit,i=m();ie("value",i.value(n.id)),J("aria-label",n.label)}}function BO(t,e){if(t&1&&(h(0,"label",7)(1,"span",8),u(2),w(3,VO,2,0,"span",16),g(),w(4,jO,1,2,"textarea",17)(5,$O,1,2,"input",18),g()),t&2){let n=e.$implicit;d(2),ae(" ",n.label," "),d(),S(n.required?3:-1),d(),S(n.index===void 0?4:5)}}var eu=class t{request=te.required();submitted=it();cancelled=it();card=Xe("card");values=O({});extra=O("");preview=E(()=>Gb(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 i=n.target.value;this.values.update(o=>K(V({},o),{[e]:i}))}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=ue({type:t,selectors:[["morse-prompt-template-dialog"]],viewQuery:function(n,i){n&1&>(i.card,RO,5),n&2&&vt()},hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.onEscape()},Mt)},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,i){if(n&1&&(h(0,"div",1),F("click",function(){return i.cancelled.emit()}),h(1,"div",2,0),F("click",function(r){return r.stopPropagation()}),h(3,"header",3)(4,"h2",4),u(5),g(),w(6,FO,2,1,"p",5),g(),h(7,"div",6),oe(8,BO,6,3,"label",7,LO),h(10,"label",7)(11,"span",8),u(12," Additional instructions "),h(13,"span",9),u(14,"optional \xB7 appended below the template"),g()(),h(15,"textarea",10),F("input",function(r){return i.setExtra(r)})("keydown",function(r){return i.onSubmitKey(r)}),g()(),h(16,"div",11)(17,"span",8),u(18,"Preview"),g(),h(19,"pre",12),u(20),g()(),h(21,"div",13)(22,"button",14),F("click",function(){return i.cancelled.emit()}),u(23,"Cancel"),g(),h(24,"button",15),F("click",function(){return i.submit()}),u(25,"Send"),g()()()()()),n&2){let o;d(5),ae("/",i.request().name),d(),S((o=i.request().description)?6:-1,o),d(2),re(i.request().form.arguments),d(7),ie("value",i.extra()),d(5),k(i.preview()),d(4),ie("disabled",!i.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 li(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 uC(t,e){let n=t?.[e];return typeof n=="number"?li(n):"\u2014"}function Nh(t){if(!t)return;let e=t.cacheReadTokens??0,n=t.cacheWriteTokens??0,i=t.inputTokens+e+n;if(!(i<=0||e===0&&n===0))return e/i*100}function Oh(t){if(!(t===void 0||t<=0))return`$${t.toFixed(3)}`}function Ph(t){let e=[],n=t.usage;if(n){n.inputTokens>0&&e.push(`\u2191${li(n.inputTokens)}`),n.outputTokens>0&&e.push(`\u2193${li(n.outputTokens)}`),n.cacheReadTokens&&e.push(`R${li(n.cacheReadTokens)}`),n.cacheWriteTokens&&e.push(`W${li(n.cacheWriteTokens)}`);let r=Nh(n);r!==void 0&&e.push(`CH${r.toFixed(1)}%`)}let i=Oh(t.costUsd);i&&e.push(i);let o=t.contextUsage;if(o){let r=o.percent!==null?`${o.percent.toFixed(1)}%`:"?";e.push(`${r}/${li(o.contextWindow)}`)}return e.join(" ")}var HO=["search"],UO=["list"],zO=(t,e)=>e.provider,GO=(t,e)=>e.index;function qO(t,e){if(t&1&&(y(0,"div",10),u(1),b()),t&2){let n=m();d(),ae("No model matches \u201C",n.filter(),"\u201D.")}}function WO(t,e){t&1&&(y(0,"span",15),u(1),b()),t&2&&(d(),k(e))}function YO(t,e){t&1&&(y(0,"span",16),u(1,"\u2713"),b())}function KO(t,e){if(t&1){let n=$();y(0,"button",13),A("mouseenter",function(){let o=D(n).$implicit,r=m(4);return M(r.active.set(o.index))})("click",function(){let o=D(n).$implicit,r=m(4);return M(r.pick.emit(o.model))}),y(1,"span",14),u(2),b(),w(3,WO,2,1,"span",15),w(4,YO,2,0,"span",16),b()}if(t&2){let n,i=e.$implicit,o=m(4);X("active",i.index===o.active())("selected",o.keyOf(i.model)===o.current()),q("title",o.keyOf(i.model)),J("aria-current",o.keyOf(i.model)===o.current()?"true":null),d(2),k(i.model.name),d(),S((n=o.context(i.model))?3:-1,n),d(),S(o.keyOf(i.model)===o.current()?4:-1)}}function ZO(t,e){if(t&1&&(y(0,"div",11),u(1),b(),oe(2,KO,5,9,"button",12,GO)),t&2){let n=m().$implicit;d(),k(n.provider),d(),re(n.rows)}}function QO(t,e){if(t&1&&w(0,ZO,4,1),t&2){let n=e.$implicit;S(n.rows.length>0?0:-1)}}function XO(t,e){if(t&1&&oe(0,QO,1,1,null,null,zO),t&2){let n=m();re(n.groups())}}function JO(t,e){let n=e.trim().toLowerCase(),i=new Map;for(let o of t){if(n.length>0&&!`${o.provider} ${o.id} ${o.name}`.toLowerCase().includes(n))continue;let r=i.get(o.provider);r?r.push(o):i.set(o.provider,[o])}return[...i].map(([o,r])=>({provider:o,models:r}))}var tu=class t{models=te.required();current=te("");pick=it();close=it();host=N(Bt);search=Xe("search");list=Xe("list");filter=O("");active=O(0);groups=E(()=>{let e=0;return JO(this.models(),this.filter()).map(n=>({provider:n.provider,rows:n.models.map(i=>({model:i,index:e++}))}))});visible=E(()=>this.groups().flatMap(e=>e.rows.map(n=>n.model)));constructor(){no(()=>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 i=e.getBoundingClientRect(),o=n.getBoundingClientRect(),r=e.querySelector(".group")?.offsetHeight??0,s=i.top+r;o.top<s?e.scrollTop-=s-o.top:o.bottom>i.bottom&&(e.scrollTop+=o.bottom-i.bottom)}keyOf(e){return`${e.provider}/${e.id}`}context(e){return e.contextWindow?li(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(i=>Math.min(i+1,Math.max(0,n.length-1)));return;case"ArrowUp":e.preventDefault(),this.active.update(i=>Math.max(0,i-1));return;case"Enter":{let i=n[this.active()];i&&(e.preventDefault(),this.pick.emit(i));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=ue({type:t,selectors:[["morse-model-picker"]],viewQuery:function(n,i){n&1&>(i.search,HO,5)(i.list,UO,5),n&2&&vt(2)},hostBindings:function(n,i){n&1&&A("pointerdown",function(r){return i.onDocumentPointerdown(r)},Mt)},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,i){n&1&&(y(0,"div",2)(1,"div",3)(2,"span",4),st(),y(3,"svg",5),ve(4,"circle",6)(5,"path",7),b()(),Jt(),y(6,"input",8,0),A("input",function(r){return i.onFilter(r)})("keydown",function(r){return i.onKeydown(r)}),b()(),y(8,"div",9,1),w(10,qO,2,1,"div",10)(11,XO,2,0),b()()),n&2&&(q("morseEnter",0)("morseEnterY",6),d(6),q("value",i.filter()),d(4),S(i.visible().length===0?10:11))},dependencies:[un],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 eP=["brain"],tP=["halo"];function nP(t,e){if(t&1&&(st(),ce(0,"path")),t&2){let n=e.$implicit;J("d",n)}}function iP(t,e){t&1&&ce(0,"span",3,1)}function oP(t,e){t&1&&ce(0,"span",4,1)}var rP=["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"],sP={off:0,minimal:1,low:2,medium:3,high:4,xhigh:5,max:6};function aP(t){return sP[t]??2}function cP(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 nu=class t{level=te.required();bumped=te(!1);host=N(Bt);animation=N(ln);brain=Xe("brain");halos=Cv("halo");stoppers=[];paths=rP;intensity=E(()=>aP(this.level()));constructor(){se(()=>{let e=this.level(),n=this.brain()?.nativeElement,i=this.halos().map(r=>r.nativeElement);if(this.stopLoops(),!n||!this.animation.isEnabled)return;let o=cP(e);this.stoppers.push(this.animation.loop(n,o.params,{duration:o.duration,delay:o.delay??0,ease:o.ease??"inOut(2)"})),o.halo&&i.forEach((r,s)=>{this.stoppers.push(this.animation.loop(r,{scale:[.72,1.9],opacity:[.55,0]},{duration:o.halo.duration,delay:(o.halo.delay??0)+s*o.halo.duration*.5,ease:"out(2)",alternate:!1}))})}),se(()=>{this.bumped()&&this.animation.pop(this.host.nativeElement,{scale:1.3,duration:420})}),N(pt).onDestroy(()=>this.stopLoops())}stopLoops(){for(let e of this.stoppers)e();this.stoppers=[]}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-brain"]],viewQuery:function(n,i){n&1&>(i.brain,eP,5)(i.halos,tP,5),n&2&&vt(2)},hostVars:3,hostBindings:function(n,i){n&2&&(J("data-level",i.level()),X("bumped",i.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,i){n&1&&(st(),h(0,"svg",2,0),oe(2,nP,1,1,":svg:path",null,Ei),g(),w(4,iP,2,0,"span",3),w(5,oP,2,0,"span",4)),n&2&&(d(2),re(i.paths),d(2),S(i.intensity()>=3?4:-1),d(),S(i.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 lP=["panel"];function dP(t,e){t&1&&(y(0,"span",10),u(1,"\u2713"),b())}function uP(t,e){if(t&1){let n=$();y(0,"button",8),A("mouseenter",function(){let o=D(n).$index,r=m(2);return M(r.active.set(o))})("click",function(){let o=D(n).$implicit,r=m(2);return M(r.choose(o))}),ve(1,"morse-brain",2),y(2,"span",9),u(3),b(),w(4,dP,2,0,"span",10),b()}if(t&2){let n=e.$implicit,i=e.$index,o=m(2);X("active",i===o.active())("selected",n===o.current()),J("aria-selected",n===o.current()),d(),q("level",n),d(2),k(n),d(),S(n===o.current()?4:-1)}}function pP(t,e){if(t&1){let n=$();y(0,"div",6,0),A("keydown",function(o){D(n);let r=m();return M(r.onKeydown(o))}),oe(2,uP,5,8,"button",7,Ei),b()}if(t&2){let n=m();q("morseEnter",0)("morseEnterY",6),d(2),re(n.levels())}}var iu=class t{levels=te.required();current=te.required();pick=it();host=N(Bt);shortcuts=N(An);destroyRef=N(pt);panel=Xe("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(i=>Math.min(i+1,Math.max(0,n.length-1)));return;case"ArrowUp":e.preventDefault(),this.active.update(i=>Math.max(0,i-1));return;case"Enter":{let i=n[this.active()];i&&(e.preventDefault(),this.choose(i));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=ue({type:t,selectors:[["morse-thinking-picker"]],viewQuery:function(n,i){n&1&>(i.panel,lP,5),n&2&&vt()},hostBindings:function(n,i){n&1&&A("pointerdown",function(r){return i.onDocumentPointerdown(r)},Mt)},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,i){n&1&&(y(0,"button",1),A("click",function(){return i.toggle()}),ve(1,"morse-brain",2),y(2,"span",3),u(3),b(),y(4,"span",4),u(5,"\u25BE"),b()(),w(6,pP,4,2,"div",5)),n&2&&(q("title","Thinking level: "+i.current()),J("aria-expanded",i.open()),d(),q("level",i.current()),d(2),k(i.current()),d(3),S(i.open()?6:-1))},dependencies:[un,nu],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 fP(t,e){t&1&&(h(0,"span"),u(1),g()),t&2&&(d(),ae(" \xB7 ",e))}function mP(t,e){if(t&1&&(h(0,"section")(1,"h4"),u(2,"Last assistant message"),g(),h(3,"div",13)(4,"div",14)(5,"span",15),u(6,"Input"),g(),h(7,"span",16),u(8),g()(),h(9,"div",14)(10,"span",15),u(11,"Output"),g(),h(12,"span",16),u(13),g()(),h(14,"div",14)(15,"span",15),u(16,"Reasoning"),g(),h(17,"span",16),u(18),g()(),h(19,"div",14)(20,"span",15),u(21,"Cache read"),g(),h(22,"span",16),u(23),g()(),h(24,"div",14)(25,"span",15),u(26,"Cache write"),g(),h(27,"span",16),u(28),g()(),h(29,"div",14)(30,"span",15),u(31,"Cache hit"),g(),h(32,"span",16),u(33),g()()()()),t&2){let n=m(2);d(8),k(n.lastValue("inputTokens")),d(5),k(n.lastValue("outputTokens")),d(5),k(n.lastValue("reasoningTokens")),d(5),k(n.lastValue("cacheReadTokens")),d(5),k(n.lastValue("cacheWriteTokens")),d(5),k(n.cacheHitLabel())}}function hP(t,e){if(t&1){let n=$();h(0,"button",5),F("click",function(){D(n);let o=m();return M(o.close())}),g(),h(1,"div",6)(2,"header")(3,"h3"),u(4,"Context"),g(),h(5,"button",7),F("click",function(){D(n);let o=m();return M(o.close())}),u(6,"\xD7"),g()(),h(7,"div",8),u(8),w(9,fP,2,1,"span"),g(),h(10,"div",9)(11,"span"),u(12,"Context"),g(),h(13,"span"),u(14),g()(),h(15,"div",10),ce(16,"span",11),g(),h(17,"div",12)(18,"span"),u(19),g()(),h(20,"div",13)(21,"div",14)(22,"span",15),u(23,"Messages"),g(),h(24,"span",16),u(25),g()(),h(26,"div",14)(27,"span",15),u(28,"User"),g(),h(29,"span",16),u(30),g()(),h(31,"div",14)(32,"span",15),u(33,"Assistant"),g(),h(34,"span",16),u(35),g()(),h(36,"div",14)(37,"span",15),u(38,"Tool calls"),g(),h(39,"span",16),u(40),g()(),h(41,"div",14)(42,"span",15),u(43,"Cost"),g(),h(44,"span",16),u(45),g()(),h(46,"div",14)(47,"span",15),u(48,"Output limit"),g(),h(49,"span",16),u(50),g()()(),w(51,mP,34,6,"section"),h(52,"section")(53,"h4"),u(54,"Session totals"),g(),h(55,"div",17),u(56),g()()()}if(t&2){let n,i=m();d(8),ae(" ",i.modelLabel()),d(),S((n=i.sessionTitle())?9:-1,n),d(5),wo("",i.usedLabel()," / ",i.limitLabel()),d(2),At("width",i.fillPercent(),"%"),X("warn",i.level()==="warn")("danger",i.level()==="danger"),d(3),ae("",i.percentLabel()," used"),d(6),k(i.counts()?.totalMessages??"\u2014"),d(5),k(i.counts()?.userMessages??"\u2014"),d(5),k(i.counts()?.assistantMessages??"\u2014"),d(5),k(i.counts()?.toolCalls??"\u2014"),d(5),k(i.costLabel()),d(5),k(i.outputLimitLabel()),d(),S(i.lastUsage()?51:-1),d(5),k(i.sessionLine()||"No usage yet.")}}var gP=15.5,pC=2*Math.PI*gP,ou=class t{usage=te();lastUsage=te();costUsd=te();contextUsage=te();counts=te();model=te();sessionTitle=te();open=O(!1);circumference=pC;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(()=>pC*(1-this.fillPercent()/100));usedLabel=E(()=>{let e=this.contextUsage()?.tokens;return e==null?"\u2014":li(e)});limitLabel=E(()=>{let e=this.contextUsage()?.contextWindow;return e===void 0?"\u2014":li(e)});costLabel=E(()=>Oh(this.costUsd())??"\u2014");outputLimitLabel=E(()=>{let e=this.model()?.maxTokens;return e===void 0?"\u2014":li(e)});modelLabel=E(()=>this.model()?.name??this.model()?.id??"no model");tooltip=E(()=>{let e=[`Context ${this.percentLabel()} \xB7 ${this.usedLabel()} / ${this.limitLabel()}`],n=Ph({usage:this.usage(),costUsd:this.costUsd(),contextUsage:this.contextUsage()});return n.length>0&&e.push(n),e.join(`
|
|
15
|
+
`)});sessionLine=E(()=>Ph({usage:this.usage(),costUsd:this.costUsd(),contextUsage:this.contextUsage()}));cacheHitLabel=E(()=>{let e=Nh(this.lastUsage());return e===void 0?"\u2014":`${e.toFixed(1)}%`});lastValue(e){return uC(this.lastUsage(),e)}toggle(){this.open.update(e=>!e)}close(){this.open.set(!1)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-usage-indicator"]],hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.close()},Mt)},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,i){n&1&&(h(0,"button",0),F("click",function(){return i.toggle()}),st(),h(1,"svg",1),ce(2,"circle",2)(3,"circle",3),g(),Jt(),h(4,"span",4),u(5),g()(),w(6,hP,57,19)),n&2&&(ie("title",i.tooltip()),J("aria-expanded",i.open()),d(),X("warn",i.level()==="warn")("danger",i.level()==="danger"),d(2),J("stroke-dasharray",i.circumference)("stroke-dashoffset",i.dashOffset()),d(2),k(i.percentLabel()),d(),S(i.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 yP=["promptInput"],_P=["fileInput"],Rh=(t,e)=>e.id;function vP(t,e){if(t&1){let n=$();y(0,"div",30)(1,"span",31),u(2,"\u283F"),b(),y(3,"span",32),u(4),b(),y(5,"div",33)(6,"button",34),A("click",function(){let o=D(n).$implicit,r=m(2);return M(r.editQueued(o))}),u(7," \u270E "),y(8,"span"),u(9,"edit"),b()(),y(10,"button",35),A("click",function(){let o=D(n).$implicit,r=m(2);return M(r.sendQueued(o))}),u(11," \u27A4 "),y(12,"span"),u(13,"send"),b()(),y(14,"button",36),A("click",function(){let o=D(n).$implicit,r=m(2);return M(r.removeQueued(o))}),u(15," \xD7 "),b()()()}if(t&2){let n=e.$implicit,i=e.$index;q("morseEnter",i)("morseEnterY",4),d(3),q("title",n.text),d(),k(n.text)}}function bP(t,e){if(t&1&&(y(0,"div",3)(1,"div",26)(2,"span",27),u(3,"\u23F2"),b(),y(4,"span",28),u(5,"Queued messages"),b(),y(6,"span",29),u(7),b()(),oe(8,vP,16,4,"div",30,Rh),b()),t&2){let n=m();d(7),k(n.queuedMessages().length),d(),re(n.queuedMessages())}}function xP(t,e){if(t&1){let n=$();y(0,"button",37),A("click",function(){D(n);let o=m();return M(o.attachSelection())}),u(1," \u29C9 "),b()}}function CP(t,e){t&1&&u(0," add files \xB7 @ to mention \xB7 / for commands ")}function EP(t,e){t&1&&u(0," upload or drop files \xB7 / for commands ")}function wP(t,e){t&1&&u(0," drop files here \xB7 / for commands ")}function SP(t,e){if(t&1){let n=$();y(0,"morse-file-picker",38),A("activeChange",function(o){D(n);let r=m();return M(r.mentionActive.set(o))})("pick",function(o){D(n);let r=m();return M(r.onPickFile(o))})("quote",function(o){D(n);let r=m();return M(r.onQuoteFile(o))})("reload",function(){D(n);let o=m();return M(o.reloadFiles())})("close",function(){D(n);let o=m();return M(o.onPickerClose())}),b()}if(t&2){let n=m();q("morsePopoverFit",300)("files",n.pickerMatches())("busy",n.loadingFiles())("query",n.pickerFilter())("active",n.mentionActive())}}function TP(t,e){if(t&1){let n=$();y(0,"morse-command-picker",39),A("activeChange",function(o){D(n);let r=m();return M(r.paletteActive.set(o))})("pick",function(o){D(n);let r=m();return M(r.activatePalette(o,"run"))})("close",function(){D(n);let o=m();return M(o.onPaletteClose())}),b()}if(t&2){let n=m();q("morsePopoverFit",320)("items",n.paletteItems())("query",n.paletteFilter())("active",n.paletteActive())}}function DP(t,e){if(t&1){let n=$();y(0,"li",40)(1,"button",42),A("click",function(){D(n);let o=m(2);return M(o.lockLive())}),y(2,"span",43),u(3,"\u29C9"),b(),y(4,"span",44),u(5),b(),y(6,"span",45),u(7),b()(),y(8,"button",46),A("click",function(){D(n);let o=m(2);return M(o.dismissLive())}),u(9," \xD7 "),b()()}if(t&2){let n=e,i=m(2);q("morseEnter",0)("morseEnterY",6)("morseEnterScale",.55)("morseEnterDuration",320),d(),q("title",i.lockLiveLabel()),J("aria-label","Lock the "+n.path+" selection as a pin"),d(3),q("title",n.path),d(),k(n.path),d(2),k(i.pinRange(n)),d(),J("aria-label","Dismiss the "+n.path+" selection preview")}}function MP(t,e){if(t&1){let n=$();y(0,"li",41),ve(1,"img",47),y(2,"span",44),u(3),b(),y(4,"button",48),A("click",function(){let o=D(n).$implicit,r=m(2);return M(r.removeImage(o.id))}),u(5," \xD7 "),b()()}if(t&2){let n=e.$implicit,i=e.$index,o=m(2);q("morseEnter",o.chipOffset()+i)("morseEnterY",6)("morseEnterScale",.55)("morseEnterDuration",320),d(),q("src",o.preview(n),xi)("alt",n.name),d(),q("title",n.name),d(),k(n.name),d(),J("aria-label","Remove "+n.name)}}function kP(t,e){if(t&1&&(y(0,"span",45),u(1),b()),t&2){let n=m().$implicit,i=m(2);d(),k(i.pinRange(n))}}function IP(t,e){if(t&1){let n=$();y(0,"li",41)(1,"button",42),A("click",function(){let o=D(n).$implicit,r=m(2);return M(r.openPinPreview(o))}),y(2,"span",43),u(3,"\u29C9"),b(),y(4,"span",49),u(5),b(),w(6,kP,2,1,"span",45),b(),y(7,"button",48),A("click",function(){let o=D(n).$implicit,r=m(2);return M(r.removePin(o.id))}),u(8," \xD7 "),b()()}if(t&2){let n=e.$implicit,i=e.$index,o=m(2);q("morseEnter",o.chipOffset()+o.images().length+i)("morseEnterY",6)("morseEnterScale",.55)("morseEnterDuration",320),d(),q("title","Open "+n.path+" in the preview"),d(4),k(n.path),d(),S(n.startLine!==void 0?6:-1),d(),J("aria-label","Unpin "+n.path)}}function NP(t,e){if(t&1&&(y(0,"ul",12),w(1,DP,10,10,"li",40),oe(2,MP,6,9,"li",41,Rh),oe(4,IP,9,8,"li",41,Rh),b()),t&2){let n,i=m();d(),S((n=i.livePreview())?1:-1,n),d(),re(i.images()),d(2),re(i.pins())}}function OP(t,e){if(t&1&&(y(0,"span",51),u(1),b()),t&2){let n=m(2);d(),wo(" \u2193",n.streamedTokens()," \xB7 ",n.tokensPerSecond()??0," t/s ")}}function PP(t,e){if(t&1&&(y(0,"span",53),ve(1,"span",55),y(2,"span"),u(3),b(),y(4,"span",56),ve(5,"i")(6,"i")(7,"i"),b()()),t&2){let n=m(2);d(3),ae("Working ",n.elapsed())}}function AP(t,e){if(t&1&&ve(0,"morse-usage-indicator",54),t&2){let n=m(2);q("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 RP(t,e){if(t&1&&(y(0,"div",14)(1,"div",50),w(2,OP,2,2,"span",51),b(),y(3,"div",52),w(4,PP,8,1,"span",53),w(5,AP,1,7,"morse-usage-indicator",54),b()()),t&2){let n=m();d(2),S(n.running()?2:-1),d(2),S(n.running()?4:-1),d(),S(n.showUsage()?5:-1)}}function LP(t,e){if(t&1&&(y(0,"span",18),u(1),b()),t&2){let n=e;q("title",n),d(),k(n)}}function FP(t,e){if(t&1){let n=$();y(0,"morse-model-picker",57),A("pick",function(o){D(n);let r=m();return M(r.onModelPick(o))})("close",function(){D(n);let o=m();return M(o.closeModelPicker())}),b()}if(t&2){let n=m();q("morsePopoverFit",340)("models",n.models())("current",n.modelKey())}}function VP(t,e){if(t&1){let n=$();y(0,"button",58),A("click",function(){D(n);let o=m();return M(o.sendWith("steer"))}),u(1,"Steer"),b(),y(2,"button",58),A("click",function(){D(n);let o=m();return M(o.sendWith("followUp"))}),u(3,"Follow up"),b(),y(4,"button",59),A("click",function(){D(n);let o=m();return M(o.abort())}),u(5,"\u25A0"),b()}}function jP(t,e){if(t&1){let n=$();y(0,"button",60),A("click",function(){D(n);let o=m();return M(o.sendWith("new"))}),u(1," \u2191 "),b()}if(t&2){let n=m();q("disabled",!n.canSend())}}function $P(t,e){if(t&1){let n=$();y(0,"morse-prompt-template-dialog",61),A("submitted",function(o){D(n);let r=m();return M(r.onTemplateSubmit(o))})("cancelled",function(){D(n);let o=m();return M(o.closeTemplate())}),b()}t&2&&q("request",e)}var ru=class t{morse=N(Ze);shell=N(Ht);shortcuts=N(An);destroyRef=N(pt);attachments=N(Ui);queue=N(Hd);workspace=N(zi);tabs=N(dn);uploads=N(Ds);promptInput=Xe("promptInput");fileInput=Xe("fileInput");draining=!1;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,Ah(this.morse.items())-this.baseline())/4));tokensPerSecond=O(void 0);baseline=O(0);throughput=[];images=this.attachments.images;pins=this.attachments.pins;queuedMessages=this.queue.queued;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(()=>lC(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=[...fC.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 dC(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?"":UP(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 o=this.attachments.takeMentions().map(s=>s.startsWith("@")?s:`@${s}`).join(`
|
|
16
16
|
`);this.text.update(s=>s.trim().length===0?o:`${s.trimEnd()}
|
|
17
|
-
${o}`),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(o=>o??Date.now()),this.baseline.set(ii(()=>Ah(this.morse.items())));let i=setInterval(()=>{this.tick.update(o=>o+1),this.sampleThroughput()},500);n(()=>clearInterval(i))}),se(()=>{let n=this.running(),i=this.morse.state().sessionId,o=this.queue.head(i);ii(()=>{if(n){this.draining=!1;return}if(o===void 0||this.draining)return;this.draining=!0;let r=this.queue.shift(i);r!==void 0&&this.morse.prompt(r.text,"new",r.images,r.pins)})})}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(i=>Math.min(i+1,Math.max(0,n.length-1)));return;case"ArrowUp":e.preventDefault(),this.paletteActive.update(i=>Math.max(0,i-1));return;case"Tab":{let i=n[this.paletteActive()];e.preventDefault(),i&&this.activatePalette(i.id,"insert");return}case"Enter":{if(e.isComposing)return;let i=n[this.paletteActive()];if(i){e.preventDefault(),this.activatePalette(i.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(i=>Math.min(i+1,Math.max(0,n.length-1)));return;case"ArrowUp":e.preventDefault(),this.mentionActive.update(i=>Math.max(0,i-1));return;case"Tab":case"Enter":{let i=n[this.mentionActive()];if(i){e.preventDefault(),this.onPickFile(i);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(),i=BP(n);if(i!==void 0){this.text.set(""),this.shell.requestCompact(i);return}let o=$P(n);if(o){this.text.set(""),this.runBuiltin(o);return}let r=this.attachments.takeImages(),s=this.attachments.takePins();if(n.length===0&&r.length===0&&s.length===0){this.promptInput()?.nativeElement.focus();return}e==="followUp"&&this.running()?this.queue.enqueue({text:n,images:r,pins:s},this.morse.state().sessionId):this.morse.prompt(n,e==="followUp"?"new":e,r,s),this.attachments.setLivePreview(null),this.text.set("")}editQueued(e){this.queue.remove(e.id),this.text.set(e.text),this.syncInputValue(),this.attachments.seed(e.images,e.pins),this.promptInput()?.nativeElement.focus()}sendQueued(e){this.queue.remove(e.id),this.morse.prompt(e.text,this.running()?"steer":"new",e.images,e.pins)}removeQueued(e){this.queue.remove(e.id)}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(i=>i.type.startsWith("image/"));n.length!==0&&(e.preventDefault(),this.attachments.accept(n).then(i=>{i.attached>0&&this.attachments.say("info",`${i.attached} pasted image${i.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 i=this.promptInput()?.nativeElement;if(i){let o=this.text();i.value=o,i.focus(),i.setSelectionRange(o.length,o.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,i=Array.from(n?.files??[]);n&&(n.value=""),i.length!==0&&this.importFiles(i.filter(o=>o.type.startsWith("image/")),i.filter(o=>!o.type.startsWith("image/")))}async importFiles(e,n){let i=await this.attachments.accept(e),o=n.length>0?await this.uploads.upload(n):{added:[],failed:[]};this.attachments.addMentions(o.added.map(a=>a.path));let r=[];i.attached>0&&r.push(`${i.attached} image${i.attached===1?"":"s"} attached`),o.added.length>0&&r.push(`${o.added.length} file${o.added.length===1?"":"s"} uploaded`);let s=[...i.skipped,...o.failed];if(s.length>0&&r.push(`could not attach ${s.join(", ")}`),r.length>0){let a=i.attached===0&&o.added.length===0;this.attachments.say(a?"warn":"info",r.join(" \xB7 "))}}refreshMentionQuery(e,n){if(!this.canPickFiles())return;let i=e.slice(0,n??e.length),o=/(?:^|\s)@([\w./-]*)$/.exec(i);if(!o){this.mentionMode()&&(this.pickerOpen.set(!1),this.mentionMode.set(!1));return}o[1]!==this.pickerFilter()&&this.mentionActive.set(0),this.mentionMode.set(!0),this.pickerFilter.set(o[1]??""),this.pickerOpen.set(!0),this.workspace.ensureLoaded()}refreshPaletteQuery(e,n){let i=e.slice(0,n??e.length),o=/(?:^|\n)\s*\/([\w:-]*)$/.exec(i);if(!o){this.paletteOpen()&&this.paletteOpen.set(!1);return}o[1]!==this.paletteFilter()&&this.paletteActive.set(0),this.paletteFilter.set(o[1]??""),this.paletteOpen()||this.morse.refreshCommands(),this.paletteOpen.set(!0)}activatePalette(e,n){if(e.startsWith("builtin:")){let i=e.slice(8);if(i==="model"){this.stripSlashToken(),this.closePalette(),this.openModelPicker();return}this.stripSlashToken(),this.closePalette(),this.runBuiltin(i);return}if(e.startsWith("command:")){let i=e.slice(8);if(n==="run"){let o=this.availableCommands().find(r=>r.name===i);if(o?.template!==void 0){let r=zb(o.template);if(r!==void 0){this.stripSlashToken(),this.text.set(""),this.closePalette(),this.openTemplate({name:i,description:o.description,form:r});return}this.stripSlashToken(),this.text.set(""),this.closePalette(),this.sendTemplate(_h(o.template).body);return}this.stripSlashToken(),this.text.set(""),this.closePalette(),this.morse.prompt(`/${i}`,this.streaming()?"steer":"new");return}this.replaceSlashToken(`/${i} `),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(i=>i.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=Ah(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 i=this.throughput[0];if(!i)return;let o=n-i.at;if(o<500)return;let r=(e-i.chars)/4;this.tokensPerSecond.set(Math.max(0,Math.round(r/o*1e4)/10))}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-chat-composer"]],viewQuery:function(n,i){n&1&>(i.promptInput,gP,5)(i.fileInput,yP,5),n&2&&vt(2)},decls:33,vars:24,consts:[["fileInput",""],["promptInput",""],[1,"host"],["role","region","aria-label","Queued follow-up messages",1,"queue"],[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"],[1,"queue-head"],["aria-hidden","true",1,"queue-glyph"],[1,"queue-title"],[1,"queue-count"],[1,"queue-row",3,"morseEnter","morseEnterY"],["aria-hidden","true",1,"queue-grip"],[1,"queue-text",3,"title"],[1,"queue-actions"],["type","button","title","Edit in the composer",1,"queue-action",3,"click"],["type","button","title","Send now",1,"queue-action",3,"click"],["type","button","title","Remove from the queue","aria-label","Remove from the queue",1,"queue-remove",3,"click"],["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,i){if(n&1&&(y(0,"footer",2),w(1,vP,10,1,"div",3),y(2,"div",4)(3,"div",5)(4,"button",6),A("click",function(){return i.onAddFiles()}),u(5," + "),b(),y(6,"input",7,0),A("change",function(r){return i.onFilesChosen(r)}),b(),w(8,bP,2,0,"button",8),y(9,"span",9),w(10,xP,1,0)(11,CP,1,0)(12,EP,1,0),b()(),w(13,wP,1,5,"morse-file-picker",10),w(14,SP,1,4,"morse-command-picker",11),w(15,IP,6,1,"ul",12),y(16,"textarea",13,1),A("input",function(r){return i.onInput(r)})("keydown",function(r){return i.onKeydown(r)})("paste",function(r){return i.onPaste(r)}),b(),w(18,AP,6,3,"div",14),y(19,"div",15)(20,"div",16)(21,"button",17),A("pointerdown",function(r){return r.stopPropagation()})("click",function(){return i.toggleModelPicker()}),w(22,RP,2,2,"span",18),y(23,"span",19),u(24),b(),y(25,"span",20),u(26,"\u25BE"),b()(),w(27,LP,1,3,"morse-model-picker",21),y(28,"morse-thinking-picker",22),A("pick",function(r){return i.onThinkingPick(r)}),b()(),y(29,"div",23),w(30,FP,6,0)(31,VP,2,1,"button",24),b()()(),w(32,jP,1,1,"morse-prompt-template-dialog",25),b()),n&2){let o,r;d(),S(i.queuedMessages().length>0?1:-1),d(3),q("disabled",!i.canAddFiles())("title",i.addFilesLabel()),J("aria-label",i.addFilesLabel())("aria-expanded",i.pickerOpen()),d(4),S(i.canAttachSelection()?8:-1),d(2),S(i.canPickFiles()?10:i.canUpload()?11:12),d(3),S(i.pickerOpen()?13:-1),d(),S(i.paletteOpen()?14:-1),d(),S(i.images().length>0||i.pins().length>0||i.livePreview()!==null?15:-1),d(),q("value",i.text())("disabled",!i.canSend())("placeholder",i.connected()?i.agentStarting()?"Starting the Pi agent\u2026":i.agentError()?"The pi agent is unavailable.":i.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"),d(2),S(i.showStatusRow()?18:-1),d(3),q("disabled",i.models().length===0)("title",i.modelLabel()),J("aria-expanded",i.modelPickerOpen()),d(),S((o=i.currentProvider())?22:-1,o),d(2),k(i.currentModel()?.name||"no model"),d(3),S(i.modelPickerOpen()?27:-1),d(),q("levels",i.levels())("current",i.thinkingLevel()),d(2),S(i.streaming()?30:31),d(2),S((r=i.templateRequest())?32:-1,r)}},dependencies:[un,Xd,ou,Jd,tu,iu,eu,Qd],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}.queue[_ngcontent-%COMP%]{max-width:780px;margin:0 auto 8px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-panel, var(--%NS%morse-hover));overflow:hidden}.queue-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:5px 10px;border-bottom:1px solid var(--%NS%morse-border);color:var(--%NS%morse-fg-muted);font-size:11px;text-transform:uppercase;letter-spacing:.04em}.queue-count[_ngcontent-%COMP%]{min-width:16px;padding:0 5px;border-radius:999px;background:var(--%NS%morse-badge-bg);color:var(--%NS%morse-fg-muted);text-align:center;font-size:10px}.queue-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:5px 8px 5px 10px}.queue-row[_ngcontent-%COMP%] + .queue-row[_ngcontent-%COMP%]{border-top:1px solid var(--%NS%morse-hover)}.queue-grip[_ngcontent-%COMP%]{flex:none;color:var(--%NS%morse-fg-muted);opacity:.5}.queue-text[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.queue-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:2px;flex:none}.queue-action[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;padding:2px 7px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);font:inherit;font-size:11px;cursor:pointer}.queue-action[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.queue-remove[_ngcontent-%COMP%]{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}.queue-remove[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.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}}"]})},fC=[{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 $P(t){let e=/^\/([\w-]+)$/.exec(t);if(e)return fC.some(n=>n.name===e[1])?e[1]:void 0}function BP(t){return/^\/compact\s+([\s\S]+)$/.exec(t)?.[1]?.trim()||void 0}function HP(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 Ah(t){let e=0;for(let n of t)n.kind==="assistant"&&(e+=(n.text??"").length+(n.thinking??"").length);return e}var mC="morse.chat.toolDisplay",hC="morse.chat.diffView";function UP(t){return t==="timeline"||t==="compact"}function zP(){try{let t=globalThis.localStorage?.getItem(mC);return UP(t)?t:"compact"}catch{return"compact"}}function GP(t){try{globalThis.localStorage?.setItem(mC,t)}catch{}}function qP(t){return t==="file"||t==="unified"||t==="split"}function WP(){try{let t=globalThis.localStorage?.getItem(hC);return qP(t)?t:"unified"}catch{return"unified"}}function YP(t){try{globalThis.localStorage?.setItem(hC,t)}catch{}}var Ro=class t{toolDisplaySignal=O(zP());toolDisplay=this.toolDisplaySignal.asReadonly();diffViewSignal=O(WP());diffView=this.diffViewSignal.asReadonly();setToolDisplay(e){this.toolDisplaySignal.set(e),GP(e)}setDiffView(e){this.diffViewSignal.set(e),YP(e)}toggleToolDisplay(){this.setToolDisplay(this.toolDisplaySignal()==="compact"?"timeline":"compact")}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};function KP(t,e){if(t&1&&(h(0,"div",8),u(1),g()),t&2){let n=m();ie("title",n.workspace().cwd),d(),k(e)}}function ZP(t,e){if(t&1&&(h(0,"span",12),u(1),g()),t&2){let n=m();d(),k(n.statusLabel())}}function QP(t,e){if(t&1){let n=$();h(0,"button",14),F("click",function(){D(n);let o=m();return M(o.toggleGit())}),rt(),h(1,"svg",3),ce(2,"circle",18)(3,"circle",19)(4,"circle",20)(5,"path",21)(6,"path",22),g()()}if(t&2){let n=m();ie("title",n.gitOpen()?"Hide the git panel":"Show the git panel"),J("aria-label",n.gitOpen()?"Hide the git panel":"Show the git panel")("aria-pressed",n.gitOpen())}}function XP(t,e){t&1&&(rt(),h(0,"svg",3),ce(1,"path",23),g())}function JP(t,e){t&1&&(rt(),h(0,"svg",3),ce(1,"path",24),g())}var su=class t{morse=N(Ze);shell=N(Ht);display=N(Ro);shortcuts=N(An);destroyRef=N(pt);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");gitEnabled=E(()=>this.morse.capabilities()?.gitPanel===!0);gitOpen=this.shell.gitPanelOpen;constructor(){let e=this.shortcuts.bind("view.git",()=>this.shell.toggleGitPanel(),()=>this.gitEnabled());this.destroyRef.onDestroy(e)}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 i=this.state().model;return i&&e.push(i.name),e.join(" \xB7 ")});toggleNavigation(){this.shell.toggleNavigation()}toggleSidebar(){this.shell.toggleNavigationCollapsed()}compact(){this.shell.requestCompact()}toggleToolDisplay(){this.display.toggleToolDisplay()}toggleGit(){this.shell.toggleGitPanel()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-chat-header"]],decls:23,vars:21,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,"title"],["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"],["cx","4.5","cy","3.5","r","1.6"],["cx","4.5","cy","12.5","r","1.6"],["cx","11.5","cy","6.5","r","1.6"],["d","M4.5 5.1v5.8"],["d","M4.5 5.1c0 2.4 7 1 7 3"],["d","M3 6h10M3 10h6"],["d","M3 4.5h10M3 8h10M3 11.5h10"]],template:function(n,i){if(n&1&&(h(0,"header",0)(1,"button",1),F("click",function(){return i.toggleNavigation()}),u(2," \u2630 "),g(),h(3,"button",2),F("click",function(){return i.toggleSidebar()}),rt(),h(4,"svg",3),ce(5,"rect",4)(6,"path",5),g()(),Jt(),h(7,"div",6)(8,"div",7),u(9),g(),w(10,KP,2,2,"div",8),g(),h(11,"div",9)(12,"span",10),ce(13,"span",11),w(14,ZP,2,1,"span",12),g(),w(15,QP,7,3,"button",13),h(16,"button",14),F("click",function(){return i.toggleToolDisplay()}),w(17,XP,2,0,":svg:svg",3)(18,JP,2,0,":svg:svg",3),g(),h(19,"button",15),F("click",function(){return i.compact()}),rt(),h(20,"svg",3),ce(21,"path",16)(22,"path",17),g()()()()),n&2){let o;d(),J("aria-expanded",i.navigationOpen()),d(2),ie("title",i.collapsed()?"Show the sidebar":"Hide the sidebar"),J("aria-label",i.collapsed()?"Show the sidebar":"Hide the sidebar")("aria-expanded",!i.collapsed()),d(5),ie("title",i.state().sessionId??i.workspace().cwd),d(),k(i.title()),d(),S((o=i.meta())?10:-1,o),d(2),X("online",i.status()==="ready")("busy",i.status()==="starting")("failed",i.status()==="error"||i.status()==="closed"),ie("title",i.statusTitle()),d(2),S(i.status()!=="ready"?14:-1),d(),S(i.gitEnabled()?15:-1),d(),ie("title",i.compactTools()?"Tool calls: compact \u2014 click for the legacy timeline":"Tool calls: legacy timeline \u2014 click for the compact tree"),J("aria-label","Tool call display: "+(i.compactTools()?"compact":"timeline"))("aria-pressed",i.compactTools()),d(),S(i.compactTools()?17:18),d(2),ie("disabled",!i.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 _C(t){let e=[],n=[],i=()=>{n.length!==0&&(e.push({kind:"process",key:`process-${n[0]?.key??e.length}`,steps:n}),n=[])};for(let o of t){if(o.kind==="tool"){n.push({kind:"tool",key:o.id,item:o});continue}if(o.kind==="assistant"){let r=o.thinking.trim();r.length>0&&n.push({kind:"thinking",key:`${o.id}:thinking`,item:o}),o.text.trim().length>0||o.streaming&&r.length===0?(i(),e.push({kind:"assistant",key:o.id,item:o})):r.length===0&&i();continue}i(),o.kind==="user"?e.push({kind:"user",key:o.id,item:o}):o.kind==="notice"?e.push({kind:"notice",key:o.id,item:o}):o.kind==="compaction"&&e.push({kind:"compaction",key:o.id,item:o})}return i(),e}function vC(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 eA=/(^|\s)@([^\s:]+(?::\d+(?:-\d+)?)?)(?=$|\s)/g;function tA(t){if(t.length===0)return;let e=t.indexOf(":");if(e===-1)return{path:t};let n=t.slice(0,e),i=t.slice(e+1),o=/^(\d+)(?:-(\d+))?$/.exec(i);if(n.length===0||!o)return;let r=Number(o[1]),s=o[2]===void 0?r:Number(o[2]);return{path:n,startLine:r,endLine:s}}function bC(t){let e;return t.split(`
|
|
18
|
-
`).map(n=>{let i=/^\s*(`{3,}|~{3,})/.exec(n);if(i){let o=i[1]?.charAt(0)??"";return e===void 0?e=o:o===e&&(e=void 0),n}return e===void 0?
|
|
19
|
-
`)}function
|
|
20
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cA(t,e){return rA(t)||sA(t,e)||lA(t,e)||aA()}function lA(t,e){if(t){if(typeof t=="string")return xC(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)?xC(t,e):void 0}}function au(t){var e,n;function i(r,s){try{var a=t[r](s),c=a.value,l=c instanceof oA;Promise.resolve(l?c.v:c).then(function(p){if(l){var f=r==="return"&&c.k?r:"next";if(!c.k||p.done)return i(f,p);p=t[f](p).value}o(!!a.done,p)},function(p){i("throw",p)})}catch(p){o(2,p)}}function o(r,s){r===2?e.reject(s):e.resolve({value:s,done:r}),(e=e.next)?i(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,i(r,s))})},typeof t.return!="function"&&(this.return=void 0)}au.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},au.prototype.next=function(t){return this._invoke("next",t)},au.prototype.throw=function(t){return this._invoke("throw",t)},au.prototype.return=function(t){return this._invoke("return",t)};var LC=Object.entries,CC=Object.setPrototypeOf,dA=Object.isFrozen,uA=Object.getPrototypeOf,pA=Object.getOwnPropertyDescriptor,sn=Object.freeze,pn=Object.seal,Ns=Object.create,FC=typeof Reflect<"u"&&Reflect,Hh=FC.apply,Uh=FC.construct;sn||(sn=function(e){return e});pn||(pn=function(e){return e});Hh||(Hh=function(e,n){for(var i=arguments.length,o=new Array(i>2?i-2:0),r=2;r<i;r++)o[r-2]=arguments[r];return e.apply(n,o)});Uh||(Uh=function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return new e(...i)});var Ir=Qt(Array.prototype.forEach);Array.prototype.indexOf;var fA=Qt(Array.prototype.lastIndexOf),EC=Qt(Array.prototype.pop),ic=Qt(Array.prototype.push);Array.prototype.slice;var mA=Qt(Array.prototype.splice),Os=Array.isArray,sc=Qt(String.prototype.toLowerCase),Lh=Qt(String.prototype.toString),wC=Qt(String.prototype.match),oc=Qt(String.prototype.replace),SC=Qt(String.prototype.indexOf),hA=Qt(String.prototype.trim),gA=Qt(Number.prototype.toString),yA=Qt(Boolean.prototype.toString),TC=typeof BigInt>"u"?null:Qt(BigInt.prototype.toString),DC=typeof Symbol>"u"?null:Qt(Symbol.prototype.toString),Rn=Qt(Object.prototype.hasOwnProperty),rc=Qt(Object.prototype.toString),bn=Qt(RegExp.prototype.test),Lo=_A(TypeError);function Qt(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return Hh(t,e,i)}}function _A(t){return function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return Uh(t,n)}}function ct(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:sc;if(CC&&CC(t,null),!Os(e))return t;let i=e.length;for(;i--;){let o=e[i];if(typeof o=="string"){let r=n(o);r!==o&&(dA(e)||(e[i]=r),o=r)}t[o]=!0}return t}function vA(t){for(let e=0;e<t.length;e++)Rn(t,e)||(t[e]=null);return t}function qn(t){let e=Ns(null);for(let i of LC(t)){var n=cA(i,2);let o=n[0],r=n[1];Rn(t,o)&&(Os(r)?e[o]=vA(r):r&&typeof r=="object"&&r.constructor===Object?e[o]=qn(r):e[o]=r)}return e}function bA(t){switch(typeof t){case"string":return t;case"number":return gA(t);case"boolean":return yA(t);case"bigint":return TC?TC(t):"0";case"symbol":return DC?DC(t):"Symbol()";case"undefined":return rc(t);case"function":case"object":{if(t===null)return rc(t);let e=t,n=di(e,"toString");if(typeof n=="function"){let i=n(e);return typeof i=="string"?i:rc(i)}return rc(t)}default:return rc(t)}}function di(t,e){for(;t!==null;){let i=pA(t,e);if(i){if(i.get)return Qt(i.get);if(typeof i.value=="function")return Qt(i.value)}t=uA(t)}function n(){return null}return n}function xA(t){try{return bn(t,""),!0}catch{return!1}}var MC=sn(["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"]),Fh=sn(["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"]),Vh=sn(["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"]),CA=sn(["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"]),jh=sn(["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"]),EA=sn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),kC=sn(["#text"]),IC=sn(["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"]),$h=sn(["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"]),NC=sn(["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"]),cu=sn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),wA=pn(/{{[\w\W]*|^[\w\W]*}}/g),SA=pn(/<%[\w\W]*|^[\w\W]*%>/g),TA=pn(/\${[\w\W]*/g),DA=pn(/^data-[\-\w.\u00B7-\uFFFF]+$/),MA=pn(/^aria-[\-\w]+$/),OC=pn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),kA=pn(/^(?:\w+script|data):/i),IA=pn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),NA=pn(/^html$/i),OA=pn(/^[a-z][.\w]*(-[.\w]+)+$/i),PC=pn(/<[/\w!]/g),AC=pn(/<[/\w]/g),PA=pn(/<\/no(script|embed|frames)/i),AA=pn(/\/>/i),Gn={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"],RA=sn(ct({},VC)),LA=(function(){let t={};return Ir(VC,e=>{t[e]=pn(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),sn(t)})(),FA=function(){return typeof window>"u"?null:window},VA=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(i=n.getAttribute(o));let r="dompurify"+(i?"#"+i:"");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}},RC=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Fo=function(e,n,i,o){return Rn(e,n)&&Os(e[n])?ct(o.base?qn(o.base):{},e[n],o.transform):i},Bh=function(e,n,i){let o=Rn(e,n)?e[n]:void 0;return o&&typeof o=="object"?qn(o):i()};function jC(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:FA(),e=U=>jC(U);if(e.version="3.4.16",e.removed=[],!t||!t.document||t.document.nodeType!==Gn.document||!t.Element)return e.isSupported=!1,e;let n=t.document,i=n,o=i.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,p=t.trustedTypes,f=a.prototype,_=di(f,"cloneNode"),x=di(f,"remove"),C=di(f,"removeAttributeNode"),T=di(f,"nextSibling"),P=di(f,"childNodes"),Y=di(f,"parentNode"),W=di(f,"shadowRoot"),be=di(f,"attributes"),ye=s&&s.prototype?di(s.prototype,"nodeType"):null,Me=s&&s.prototype?di(s.prototype,"nodeName"):null,me=s&&s.prototype?di(s.prototype,"ownerDocument"):null,Je=function(v){return ye?ye(v):v.nodeType},je=function(v){return Me?Me(v):v.nodeName};if(typeof r=="function"){let U=n.createElement("template");U.content&&U.content.ownerDocument&&(n=U.content.ownerDocument)}let Be,ft="",St,Rt=!1,kt=0,et=function(){if(kt>0)throw Lo('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.')},Se=function(v){et(),kt++;try{return Be.createHTML(v)}finally{kt--}},R=function(v){et(),kt++;try{return Be.createScriptURL(v)}finally{kt--}},Q=function(){return Rt||(St=VA(p,o),Rt=!0),St},G=n,L=G.implementation,ne=G.createNodeIterator,Le=G.createDocumentFragment,tt=G.getElementsByTagName,Ut=i.importNode,Ce=RC();e.isSupported=typeof LC=="function"&&typeof Y=="function"&&L&&L.createHTMLDocument!==void 0;let bt=wA,ze=SA,an=TA,zt=DA,Ke=MA,Wt=kA,Lt=IA,Re=OA,qe=OC,ke=null,ot=ct({},[...MC,...Fh,...Vh,...jh,...kC]),pe=null,ut=ct({},[...IC,...$h,...NC,...cu]),Z=Object.seal(Ns(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}})),_t=null,Qe=null,de=Object.seal(Ns(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Et=!0,Ee=!0,lt=!1,Ge=!0,j=!1,H=!0,ee=!1,fe=!1,mt=null,Tt=null,Yn=!1,yn=!1,Ti=!1,Di=!1,pc=!0,fc=!1,Ar="user-content-",jo=!0,Vs=!1,Xt={},Mi=null,js=ct({},["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"]),mc=null,$o=ct({},["audio","video","img","source","image","track"]),$s=null,Bs=ct({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),cn="http://www.w3.org/1998/Math/MathML",po="http://www.w3.org/2000/svg",Oe="http://www.w3.org/1999/xhtml",Ft=Oe,hc=!1,Rr=null,WE=ct({},[cn,po,Oe],Lh),ng=sn(["mi","mo","mn","ms","mtext"]),Vu=ct({},ng),ig=sn(["annotation-xml"]),ju=ct({},ig),YE=ct({},["title","style","font","a","script"]),Hs=null,KE=["application/xhtml+xml","text/html"],ZE="text/html",Gt=null,Lr=null,QE=n.createElement("form"),og=function(v){return v instanceof RegExp||v instanceof Function},$u=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Lr&&Lr===v)return;(!v||typeof v!="object")&&(v={}),v=qn(v),Hs=KE.indexOf(v.PARSER_MEDIA_TYPE)===-1?ZE:v.PARSER_MEDIA_TYPE,Gt=Hs==="application/xhtml+xml"?Lh:sc,ke=Fo(v,"ALLOWED_TAGS",ot,{transform:Gt}),pe=Fo(v,"ALLOWED_ATTR",ut,{transform:Gt}),Rr=Fo(v,"ALLOWED_NAMESPACES",WE,{transform:Lh}),$s=Fo(v,"ADD_URI_SAFE_ATTR",Bs,{transform:Gt,base:Bs}),mc=Fo(v,"ADD_DATA_URI_TAGS",$o,{transform:Gt,base:$o}),Mi=Fo(v,"FORBID_CONTENTS",js,{transform:Gt}),_t=Fo(v,"FORBID_TAGS",qn({}),{transform:Gt}),Qe=Fo(v,"FORBID_ATTR",qn({}),{transform:Gt}),Xt=Rn(v,"USE_PROFILES")?v.USE_PROFILES&&typeof v.USE_PROFILES=="object"?qn(v.USE_PROFILES):v.USE_PROFILES:!1,Et=v.ALLOW_ARIA_ATTR!==!1,Ee=v.ALLOW_DATA_ATTR!==!1,lt=v.ALLOW_UNKNOWN_PROTOCOLS||!1,Ge=v.ALLOW_SELF_CLOSE_IN_ATTR!==!1,j=v.SAFE_FOR_TEMPLATES||!1,H=v.SAFE_FOR_XML!==!1,ee=v.WHOLE_DOCUMENT||!1,yn=v.RETURN_DOM||!1,Ti=v.RETURN_DOM_FRAGMENT||!1,Di=v.RETURN_TRUSTED_TYPE||!1,Yn=v.FORCE_BODY||!1,pc=v.SANITIZE_DOM!==!1,fc=v.SANITIZE_NAMED_PROPS||!1,jo=v.KEEP_CONTENT!==!1,Vs=v.IN_PLACE||!1,qe=xA(v.ALLOWED_URI_REGEXP)?v.ALLOWED_URI_REGEXP:OC,Ft=typeof v.NAMESPACE=="string"?v.NAMESPACE:Oe,Vu=Bh(v,"MATHML_TEXT_INTEGRATION_POINTS",()=>ct({},ng)),ju=Bh(v,"HTML_INTEGRATION_POINTS",()=>ct({},ig));let I=Bh(v,"CUSTOM_ELEMENT_HANDLING",()=>Ns(null));if(Z=Ns(null),Rn(I,"tagNameCheck")&&og(I.tagNameCheck)&&(Z.tagNameCheck=I.tagNameCheck),Rn(I,"attributeNameCheck")&&og(I.attributeNameCheck)&&(Z.attributeNameCheck=I.attributeNameCheck),Rn(I,"allowCustomizedBuiltInElements")&&typeof I.allowCustomizedBuiltInElements=="boolean"&&(Z.allowCustomizedBuiltInElements=I.allowCustomizedBuiltInElements),pn(Z),j&&(Ee=!1),Ti&&(yn=!0),Xt&&(ke=ct({},kC),pe=Ns(null),Xt.html===!0&&(ct(ke,MC),ct(pe,IC)),Xt.svg===!0&&(ct(ke,Fh),ct(pe,$h),ct(pe,cu)),Xt.svgFilters===!0&&(ct(ke,Vh),ct(pe,$h),ct(pe,cu)),Xt.mathMl===!0&&(ct(ke,jh),ct(pe,NC),ct(pe,cu))),de.tagCheck=null,de.attributeCheck=null,Rn(v,"ADD_TAGS")&&(typeof v.ADD_TAGS=="function"?de.tagCheck=v.ADD_TAGS:Os(v.ADD_TAGS)&&(ke===ot&&(ke=qn(ke)),ct(ke,v.ADD_TAGS,Gt))),Rn(v,"ADD_ATTR")&&(typeof v.ADD_ATTR=="function"?de.attributeCheck=v.ADD_ATTR:Os(v.ADD_ATTR)&&(pe===ut&&(pe=qn(pe)),ct(pe,v.ADD_ATTR,Gt))),Rn(v,"ADD_FORBID_CONTENTS")&&Os(v.ADD_FORBID_CONTENTS)&&(Mi===js&&(Mi=qn(Mi)),ct(Mi,v.ADD_FORBID_CONTENTS,Gt)),jo&&(ke["#text"]=!0),ee&&ct(ke,["html","head","body"]),ke.table&&(ct(ke,["tbody"]),delete _t.tbody),v.TRUSTED_TYPES_POLICY){if(typeof v.TRUSTED_TYPES_POLICY.createHTML!="function")throw Lo('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof v.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Lo('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let B=Be;Be=v.TRUSTED_TYPES_POLICY;try{ft=Se("")}catch(z){throw Be=B,z}}else v.TRUSTED_TYPES_POLICY===null?(Be=void 0,ft=""):(Be===void 0&&(Be=Q()),Be&&typeof ft=="string"&&(ft=Se("")));sn&&sn(v),Lr=v},rg=ct({},[...Fh,...Vh,...CA]),sg=ct({},[...jh,...EA]),XE=function(v,I,B){return I.namespaceURI===Oe?v==="svg":I.namespaceURI===cn?v==="svg"&&(B==="annotation-xml"||Vu[B]):!!rg[v]},JE=function(v,I,B){return I.namespaceURI===Oe?v==="math":I.namespaceURI===po?v==="math"&&ju[B]:!!sg[v]},e1=function(v,I,B){return I.namespaceURI===po&&!ju[B]||I.namespaceURI===cn&&!Vu[B]?!1:!sg[v]&&(YE[v]||!rg[v])},t1=function(v){let I=Y(v);(!I||!I.tagName)&&(I={namespaceURI:Ft,tagName:"template"});let B=sc(v.tagName),z=sc(I.tagName);return Rr[v.namespaceURI]?v.namespaceURI===po?XE(B,I,z):v.namespaceURI===cn?JE(B,I,z):v.namespaceURI===Oe?e1(B,I,z):!!(Hs==="application/xhtml+xml"&&Rr[v.namespaceURI]):!1},fo=function(v){ic(e.removed,{element:v});try{Y(v).removeChild(v)}catch{if(x(v),!Y(v))throw Lo("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ag=function(v,I,B){try{C(v,I)}catch{try{v.removeAttribute(B)}catch{}}},gc=function(v){yc(v);let I=P(v);if(I){let z=[];Ir(I,he=>{ic(z,he)}),Ir(z,he=>{try{x(he)}catch{}})}let B=be(v);if(B)for(let z=B.length-1;z>=0;--z){let he=B[z],We=he&&he.name;typeof We=="string"&&ag(v,he,We)}},Bo=function(v,I,B){if(!B)try{B=I.getAttributeNode(v)}catch{B=null}ic(e.removed,{attribute:B||null,from:I});try{B?C(I,B):I.removeAttribute(v)}catch{try{I.removeAttribute(v)}catch{}}if(v==="is")if(yn||Ti)try{fo(I)}catch{}else try{I.setAttribute(v,"")}catch{}},n1=function(v){let I=be(v);if(I)for(let B=I.length-1;B>=0;--B){let z=I[B],he=z&&z.name;typeof he!="string"||pe[Gt(he)]||ag(v,z,he)}},yc=function(v){let I=[v];for(;I.length>0;){let B=I.pop();Je(B)===Gn.element&&n1(B);let z=P(B);if(z)for(let he=z.length-1;he>=0;--he)I.push(z[he])}},cg=function(v,I){return H?v==="patchsrc"?!0:v==="for"&&I!=="label"&&I!=="output":!1},i1=function(v){if(!H)return;let I=[v];for(;I.length>0;){let B=I.pop(),z=Je(B);if(z===Gn.processingInstruction||z===Gn.comment&&bn(AC,B.data)){try{x(B)}catch{}continue}if(z===Gn.element){let We=B,nt=Gt(je(B));try{We.hasAttribute&&We.hasAttribute("patchsrc")&&We.removeAttribute("patchsrc"),We.hasAttribute&&We.hasAttribute("for")&&cg("for",nt)&&We.removeAttribute("for")}catch{}}let he=P(B);if(he)for(let We=he.length-1;We>=0;--We)I.push(he[We])}},lg=function(v){let I=null,B=null;if(Yn)v="<remove></remove>"+v;else{let We=wC(v,/^[\r\n\t ]+/);B=We&&We[0]}Hs==="application/xhtml+xml"&&Ft===Oe&&(v='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+v+"</body></html>");let z=Be?Se(v):v;if(Ft===Oe)try{I=new l().parseFromString(z,Hs)}catch{}if(!I||!I.documentElement){I=L.createDocument(Ft,"template",null);try{I.documentElement.innerHTML=hc?ft:z}catch{}}let he=I.body||I.documentElement;return v&&B&&he.insertBefore(n.createTextNode(B),he.childNodes[0]||null),Ft===Oe?tt.call(I,ee?"html":"body")[0]:ee?I.documentElement:he},dg=function(v){let I=me?me(v):v.ownerDocument;return ne.call(I||v,v,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},_c=function(v){return v=oc(v,bt," "),v=oc(v,ze," "),v=oc(v,an," "),v},Bu=function(v){var I;v.normalize();let B=me?me(v):v.ownerDocument,z=ne.call(B||v,v,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),he=z.nextNode();for(;he;)he.data=_c(he.data),he=z.nextNode();let We=(I=v.querySelectorAll)===null||I===void 0?void 0:I.call(v,"template");We&&Ir(We,nt=>{Fr(nt.content)&&Bu(nt.content)})},vc=function(v){let I=Me?Me(v):null;return typeof I!="string"||Gt(I)!=="form"?!1:typeof v.nodeName!="string"||typeof v.textContent!="string"||typeof v.removeChild!="function"||v.attributes!==be(v)||typeof v.removeAttribute!="function"||typeof v.removeAttributeNode!="function"||typeof v.getAttributeNode!="function"||typeof v.setAttribute!="function"||typeof v.namespaceURI!="string"||typeof v.insertBefore!="function"||typeof v.hasChildNodes!="function"||v.nodeType!==ye(v)||v.childNodes!==P(v)},Fr=function(v){if(!ye||typeof v!="object"||v===null)return!1;try{return ye(v)===Gn.documentFragment}catch{return!1}},Us=function(v){if(!ye||typeof v!="object"||v===null)return!1;try{return typeof ye(v)=="number"}catch{return!1}};function ki(U,v,I){U.length!==0&&Ir(U,B=>{B.call(e,v,I,Lr)})}let o1=function(v,I){return!!(H&&v.hasChildNodes()&&!Us(v.firstElementChild)&&bn(PC,v.textContent)&&bn(PC,v.innerHTML)||H&&v.namespaceURI===Oe&&RA[I]&&(Us(v.firstElementChild)||typeof v.textContent=="string"&&bn(LA[I],v.textContent))||v.nodeType===Gn.processingInstruction||H&&v.nodeType===Gn.comment&&bn(AC,v.data))},bc=function(v,I){if(v instanceof RegExp)return bn(v,I);if(v instanceof Function){for(var B=arguments.length,z=new Array(B>2?B-2:0),he=2;he<B;he++)z[he-2]=arguments[he];return!!v(I,...z)}return!1},r1=function(v,I,B){if(!_t[I]&&mg(I)&&bc(Z.tagNameCheck,I))return!1;if(jo&&!Mi[I]){let z=Y(v),he=P(v);if(he&&z){let We=he.length;for(let nt=We-1;nt>=0;--nt){let Vt=v===B?_(he[nt],!0):he[nt];z.insertBefore(Vt,T(v))}}}return fo(v),!0},ug=function(v,I,B,z){return v.length===0?I:I===B||I===z?qn(I):I},Vr=function(v,I){return v===I||Y(v)!==null?!1:(Vs&&yc(v),!0)},pg=function(v,I){if(ki(Ce.beforeSanitizeElements,v,null),Vr(v,I))return!0;if(vc(v))return fo(v),!0;let B=Gt(je(v));if(ke=ug(Ce.uponSanitizeElement,ke,ot,mt),ki(Ce.uponSanitizeElement,v,{tagName:B,allowedTags:ke}),Vr(v,I))return!0;if(o1(v,B))return fo(v),!0;if(_t[B]||!(de.tagCheck instanceof Function&&de.tagCheck(B))&&!ke[B]){let z=r1(v,B,I);return z===!1&&(ki(Ce.afterSanitizeElements,v,null),Vr(v,I))?!0:z}if(Je(v)===Gn.element&&!t1(v)||(B==="noscript"||B==="noembed"||B==="noframes")&&bn(PA,v.innerHTML))return fo(v),!0;if(j&&v.nodeType===Gn.text){let z=_c(v.textContent);v.textContent!==z&&(ic(e.removed,{element:v.cloneNode()}),v.textContent=z)}return ki(Ce.afterSanitizeElements,v,null),Vr(v,I)},fg=function(v,I,B){if(Qe[I]||cg(I,v)||pc&&(I==="id"||I==="name")&&(B in n||B in QE))return!1;let z=pe[I]||de.attributeCheck instanceof Function&&de.attributeCheck(I,v);return Ee&&bn(zt,I)||Et&&bn(Ke,I)?!0:z?$s[I]||bn(qe,oc(B,Lt,""))||(I==="src"||I==="xlink:href"||I==="href")&&v!=="script"&&SC(B,"data:")===0&&mc[v]||lt&&!bn(Wt,oc(B,Lt,""))?!0:!B:mg(v)&&bc(Z.tagNameCheck,v)&&bc(Z.attributeNameCheck,I,v)||I==="is"&&Z.allowCustomizedBuiltInElements&&bc(Z.tagNameCheck,B)},s1=ct({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),mg=function(v){return!s1[sc(v)]&&bn(Re,v)},a1=function(v,I,B,z){if(Be&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!B)switch(p.getAttributeType(v,I)){case"TrustedHTML":return Se(z);case"TrustedScriptURL":return R(z)}return z},c1=function(v,I,B,z){try{return B?v.setAttributeNS(B,I,z):v.setAttribute(I,z),vc(v)?(fo(v),!1):!0}catch{return Bo(I,v),!1}},hg=function(v,I){if(ki(Ce.beforeSanitizeAttributes,v,null),Vr(v,I))return;let B=v.attributes;if(!B||vc(v))return;pe=ug(Ce.uponSanitizeAttribute,pe,ut,Tt);let z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:pe,forceKeepAttr:void 0},he=B.length,We=Gt(v.nodeName);for(;he--;){let nt=B[he],Vt=nt.name,Kn=nt.namespaceURI,Ln=nt.value,jr=Gt(Vt),Uu=Ln,xn=Vt==="value"?Uu:hA(Uu),gg=!1;if(z.attrName=jr,z.attrValue=xn,z.keepAttr=!0,z.forceKeepAttr=void 0,ki(Ce.uponSanitizeAttribute,v,z),xn=z.attrValue,fc&&(jr==="id"||jr==="name")&&SC(xn,Ar)!==0&&(Bo(Vt,v,nt),xn=Ar+xn,gg=!0),H&&bn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,xn)){Bo(Vt,v,nt);continue}if(jr==="attributename"&&wC(xn,"href")){Bo(Vt,v,nt);continue}if(!z.forceKeepAttr){if(!z.keepAttr){Bo(Vt,v,nt);continue}if(!Ge&&bn(AA,xn)){Bo(Vt,v,nt);continue}if(j&&(xn=_c(xn)),!fg(We,jr,xn)){Bo(Vt,v,nt);continue}xn=a1(We,jr,Kn,xn),xn!==Uu&&c1(v,Vt,Kn,xn)&&gg&&EC(e.removed)}}ki(Ce.afterSanitizeAttributes,v,null),Vr(v,I)},xc=function(v){let I=null,B=dg(v);for(ki(Ce.beforeSanitizeShadowDOM,v,null);I=B.nextNode();)if(ki(Ce.uponSanitizeShadowNode,I,null),pg(I,v),hg(I,v),Fr(I.content)&&xc(I.content),Je(I)===Gn.element){let z=W(I);Fr(z)&&(Hu(z),xc(z))}ki(Ce.afterSanitizeShadowDOM,v,null)},Hu=function(v){let I=[{node:v,shadow:null}];for(;I.length>0;){let B=I.pop();if(B.shadow){xc(B.shadow);continue}let z=B.node,he=Je(z)===Gn.element,We=P(z);if(We)for(let nt=We.length-1;nt>=0;--nt)I.push({node:We[nt],shadow:null});if(he){let nt=Me?Me(z):null;if(typeof nt=="string"&&Gt(nt)==="template"){let Vt=z.content;Fr(Vt)&&I.push({node:Vt,shadow:null})}}if(he){let nt=W(z);Fr(nt)&&I.push({node:null,shadow:nt},{node:nt,shadow:null})}}};return e.sanitize=function(U){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,B=null,z=null,he=null;if(hc=!U,hc&&(U="<!-->"),typeof U!="string"&&!Us(U)&&(U=bA(U),typeof U!="string"))throw Lo("dirty is not a string, aborting");if(!e.isSupported)return U;fe?(ke=mt,pe=Tt):$u(v),(Ce.uponSanitizeElement.length>0||Ce.uponSanitizeAttribute.length>0)&&(ke=qn(ke)),Ce.uponSanitizeAttribute.length>0&&(pe=qn(pe)),e.removed=[];let We=Vs&&typeof U!="string"&&Us(U);if(We){i1(U);let Kn=je(U);if(typeof Kn=="string"){let Ln=Gt(Kn);if(!ke[Ln]||_t[Ln])throw gc(U),Lo("root node is forbidden and cannot be sanitized in-place")}if(vc(U))throw gc(U),Lo("root node is clobbered and cannot be sanitized in-place");try{Hu(U)}catch(Ln){throw gc(U),Ln}}else if(Us(U))I=lg("<!---->"),B=I.ownerDocument.importNode(U,!0),B.nodeType===Gn.element&&B.nodeName==="BODY"||B.nodeName==="HTML"?I=B:I.appendChild(B),Hu(I);else{if(!yn&&!j&&!ee&&U.indexOf("<")===-1)return Be&&Di?Se(U):U;if(I=lg(U),!I)return yn?null:Di?ft:""}I&&Yn&&fo(I.firstChild);let nt=We?U:I;try{let Kn=dg(nt);for(;z=Kn.nextNode();)pg(z,nt),hg(z,nt),Fr(z.content)&&xc(z.content)}catch(Kn){throw We&&(gc(U),Ir(e.removed,Ln=>{Ln.element&&yc(Ln.element)})),Kn}if(We){let Kn=!1;if(Ir(e.removed,Ln=>{Ln.element&&(Ln.element===U&&(Kn=!0),yc(Ln.element))}),Kn)throw Lo("a node selected for removal could not be safely returned; refusing to sanitize in place");return j&&Bu(U),U}if(yn){if(j&&Bu(I),Ti)for(he=Le.call(I.ownerDocument);I.firstChild;)he.appendChild(I.firstChild);else he=I;return(pe.shadowroot||pe.shadowrootmode)&&(he=Ut.call(i,he,!0)),he}let Vt=ee?I.outerHTML:I.innerHTML;return ee&&ke["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&bn(NA,I.ownerDocument.doctype.name)&&(Vt="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
|
|
21
|
-
`+Vt),j&&(Vt=_c(Vt)),Be&&Di?Se(Vt):Vt},e.setConfig=function(){let U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$u(U),fe=!0,mt=ke,Tt=pe},e.clearConfig=function(){Lr=null,fe=!1,mt=null,Tt=null,Be=St,ft=""},e.isValidAttribute=function(U,v,I){Lr||$u({});let B=Gt(U),z=Gt(v);return fg(B,z,I)},e.addHook=function(U,v){typeof v=="function"&&Rn(Ce,U)&&ic(Ce[U],v)},e.removeHook=function(U,v){if(Rn(Ce,U)){if(v!==void 0){let I=
|
|
22
|
-
]`).replace("lheading",JC).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),
|
|
17
|
+
${o}`),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(o=>o??Date.now()),this.baseline.set(ii(()=>Ah(this.morse.items())));let i=setInterval(()=>{this.tick.update(o=>o+1),this.sampleThroughput()},500);n(()=>clearInterval(i))}),se(()=>{let n=this.running(),i=this.morse.state().sessionId,o=this.queue.head(i);ii(()=>{if(n){this.draining=!1;return}if(o===void 0||this.draining)return;this.draining=!0;let r=this.queue.shift(i);r!==void 0&&this.morse.prompt(r.text,"new",r.images,r.pins)})})}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(i=>Math.min(i+1,Math.max(0,n.length-1)));return;case"ArrowUp":e.preventDefault(),this.paletteActive.update(i=>Math.max(0,i-1));return;case"Tab":{let i=n[this.paletteActive()];e.preventDefault(),i&&this.activatePalette(i.id,"insert");return}case"Enter":{if(e.isComposing)return;let i=n[this.paletteActive()];if(i){e.preventDefault(),this.activatePalette(i.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(i=>Math.min(i+1,Math.max(0,n.length-1)));return;case"ArrowUp":e.preventDefault(),this.mentionActive.update(i=>Math.max(0,i-1));return;case"Tab":case"Enter":{let i=n[this.mentionActive()];if(i){e.preventDefault(),this.onPickFile(i,e.shiftKey);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(),i=HP(n);if(i!==void 0){this.text.set(""),this.shell.requestCompact(i);return}let o=BP(n);if(o){this.text.set(""),this.runBuiltin(o);return}let r=this.attachments.takeImages(),s=this.attachments.takePins();if(n.length===0&&r.length===0&&s.length===0){this.promptInput()?.nativeElement.focus();return}e==="followUp"&&this.running()?this.queue.enqueue({text:n,images:r,pins:s},this.morse.state().sessionId):this.morse.prompt(n,e==="followUp"?"new":e,r,s),this.attachments.setLivePreview(null),this.text.set("")}editQueued(e){this.queue.remove(e.id),this.text.set(e.text),this.syncInputValue(),this.attachments.seed(e.images,e.pins),this.promptInput()?.nativeElement.focus()}sendQueued(e){this.queue.remove(e.id),this.morse.prompt(e.text,this.running()?"steer":"new",e.images,e.pins)}removeQueued(e){this.queue.remove(e.id)}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(i=>i.type.startsWith("image/"));n.length!==0&&(e.preventDefault(),this.attachments.accept(n).then(i=>{i.attached>0&&this.attachments.say("info",`${i.attached} pasted image${i.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 i=this.promptInput()?.nativeElement;if(i){let o=this.text();i.value=o,i.focus(),i.setSelectionRange(o.length,o.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,i=Array.from(n?.files??[]);n&&(n.value=""),i.length!==0&&this.importFiles(i.filter(o=>o.type.startsWith("image/")),i.filter(o=>!o.type.startsWith("image/")))}async importFiles(e,n){let i=await this.attachments.accept(e),o=n.length>0?await this.uploads.upload(n):{added:[],failed:[]};this.attachments.addMentions(o.added.map(a=>a.path));let r=[];i.attached>0&&r.push(`${i.attached} image${i.attached===1?"":"s"} attached`),o.added.length>0&&r.push(`${o.added.length} file${o.added.length===1?"":"s"} uploaded`);let s=[...i.skipped,...o.failed];if(s.length>0&&r.push(`could not attach ${s.join(", ")}`),r.length>0){let a=i.attached===0&&o.added.length===0;this.attachments.say(a?"warn":"info",r.join(" \xB7 "))}}refreshMentionQuery(e,n){if(!this.canPickFiles())return;let i=e.slice(0,n??e.length),o=/(?:^|\s)@([\w./-]*)$/.exec(i);if(!o){this.mentionMode()&&(this.pickerOpen.set(!1),this.mentionMode.set(!1));return}o[1]!==this.pickerFilter()&&this.mentionActive.set(0),this.mentionMode.set(!0),this.pickerFilter.set(o[1]??""),this.pickerOpen.set(!0),this.workspace.ensureLoaded()}refreshPaletteQuery(e,n){let i=e.slice(0,n??e.length),o=/(?:^|\n)\s*\/([\w:-]*)$/.exec(i);if(!o){this.paletteOpen()&&this.paletteOpen.set(!1);return}o[1]!==this.paletteFilter()&&this.paletteActive.set(0),this.paletteFilter.set(o[1]??""),this.paletteOpen()||this.morse.refreshCommands(),this.paletteOpen.set(!0)}activatePalette(e,n){if(e.startsWith("builtin:")){let i=e.slice(8);if(i==="model"){this.stripSlashToken(),this.closePalette(),this.openModelPicker();return}this.stripSlashToken(),this.closePalette(),this.runBuiltin(i);return}if(e.startsWith("command:")){let i=e.slice(8);if(n==="run"){let o=this.availableCommands().find(r=>r.name===i);if(o?.template!==void 0){let r=zb(o.template);if(r!==void 0){this.stripSlashToken(),this.text.set(""),this.closePalette(),this.openTemplate({name:i,description:o.description,form:r});return}this.stripSlashToken(),this.text.set(""),this.closePalette(),this.sendTemplate(_h(o.template).body);return}this.stripSlashToken(),this.text.set(""),this.closePalette(),this.morse.prompt(`/${i}`,this.streaming()?"steer":"new");return}this.replaceSlashToken(`/${i} `),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,n=!1){let i=e.endsWith("/");this.mentionMode()?this.text.update(o=>o.replace(/@[\w./-]*$/,`@${e}${i?"":" "}`)):i||(this.attachments.addMentions([e]),this.attachments.say("info",`Pinned ${e} to this message.`)),n&&!i&&this.morse.capabilities()?.filePreview&&this.tabs.openMentionFile(e),i?(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()}onQuoteFile(e){this.onPickFile(e,!0)}onThinkingPick(e){this.morse.setThinkingLevel(e)}sampleThroughput(){let e=Ah(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 i=this.throughput[0];if(!i)return;let o=n-i.at;if(o<500)return;let r=(e-i.chars)/4;this.tokensPerSecond.set(Math.max(0,Math.round(r/o*1e4)/10))}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-chat-composer"]],viewQuery:function(n,i){n&1&>(i.promptInput,yP,5)(i.fileInput,_P,5),n&2&&vt(2)},decls:33,vars:24,consts:[["fileInput",""],["promptInput",""],[1,"host"],["role","region","aria-label","Queued follow-up messages",1,"queue"],[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"],[1,"queue-head"],["aria-hidden","true",1,"queue-glyph"],[1,"queue-title"],[1,"queue-count"],[1,"queue-row",3,"morseEnter","morseEnterY"],["aria-hidden","true",1,"queue-grip"],[1,"queue-text",3,"title"],[1,"queue-actions"],["type","button","title","Edit in the composer",1,"queue-action",3,"click"],["type","button","title","Send now",1,"queue-action",3,"click"],["type","button","title","Remove from the queue","aria-label","Remove from the queue",1,"queue-remove",3,"click"],["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","quote","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,i){if(n&1&&(y(0,"footer",2),w(1,bP,10,1,"div",3),y(2,"div",4)(3,"div",5)(4,"button",6),A("click",function(){return i.onAddFiles()}),u(5," + "),b(),y(6,"input",7,0),A("change",function(r){return i.onFilesChosen(r)}),b(),w(8,xP,2,0,"button",8),y(9,"span",9),w(10,CP,1,0)(11,EP,1,0)(12,wP,1,0),b()(),w(13,SP,1,5,"morse-file-picker",10),w(14,TP,1,4,"morse-command-picker",11),w(15,NP,6,1,"ul",12),y(16,"textarea",13,1),A("input",function(r){return i.onInput(r)})("keydown",function(r){return i.onKeydown(r)})("paste",function(r){return i.onPaste(r)}),b(),w(18,RP,6,3,"div",14),y(19,"div",15)(20,"div",16)(21,"button",17),A("pointerdown",function(r){return r.stopPropagation()})("click",function(){return i.toggleModelPicker()}),w(22,LP,2,2,"span",18),y(23,"span",19),u(24),b(),y(25,"span",20),u(26,"\u25BE"),b()(),w(27,FP,1,3,"morse-model-picker",21),y(28,"morse-thinking-picker",22),A("pick",function(r){return i.onThinkingPick(r)}),b()(),y(29,"div",23),w(30,VP,6,0)(31,jP,2,1,"button",24),b()()(),w(32,$P,1,1,"morse-prompt-template-dialog",25),b()),n&2){let o,r;d(),S(i.queuedMessages().length>0?1:-1),d(3),q("disabled",!i.canAddFiles())("title",i.addFilesLabel()),J("aria-label",i.addFilesLabel())("aria-expanded",i.pickerOpen()),d(4),S(i.canAttachSelection()?8:-1),d(2),S(i.canPickFiles()?10:i.canUpload()?11:12),d(3),S(i.pickerOpen()?13:-1),d(),S(i.paletteOpen()?14:-1),d(),S(i.images().length>0||i.pins().length>0||i.livePreview()!==null?15:-1),d(),q("value",i.text())("disabled",!i.canSend())("placeholder",i.connected()?i.agentStarting()?"Starting the Pi agent\u2026":i.agentError()?"The pi agent is unavailable.":i.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"),d(2),S(i.showStatusRow()?18:-1),d(3),q("disabled",i.models().length===0)("title",i.modelLabel()),J("aria-expanded",i.modelPickerOpen()),d(),S((o=i.currentProvider())?22:-1,o),d(2),k(i.currentModel()?.name||"no model"),d(3),S(i.modelPickerOpen()?27:-1),d(),q("levels",i.levels())("current",i.thinkingLevel()),d(2),S(i.streaming()?30:31),d(2),S((r=i.templateRequest())?32:-1,r)}},dependencies:[un,Xd,ou,Jd,tu,iu,eu,Qd],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}.queue[_ngcontent-%COMP%]{max-width:780px;margin:0 auto 8px;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-md);background:var(--%NS%morse-panel, var(--%NS%morse-hover));overflow:hidden}.queue-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:5px 10px;border-bottom:1px solid var(--%NS%morse-border);color:var(--%NS%morse-fg-muted);font-size:11px;text-transform:uppercase;letter-spacing:.04em}.queue-count[_ngcontent-%COMP%]{min-width:16px;padding:0 5px;border-radius:999px;background:var(--%NS%morse-badge-bg);color:var(--%NS%morse-fg-muted);text-align:center;font-size:10px}.queue-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:5px 8px 5px 10px}.queue-row[_ngcontent-%COMP%] + .queue-row[_ngcontent-%COMP%]{border-top:1px solid var(--%NS%morse-hover)}.queue-grip[_ngcontent-%COMP%]{flex:none;color:var(--%NS%morse-fg-muted);opacity:.5}.queue-text[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.queue-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:2px;flex:none}.queue-action[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;padding:2px 7px;border:0;border-radius:var(--%NS%morse-radius-sm);background:transparent;color:var(--%NS%morse-fg-muted);font:inherit;font-size:11px;cursor:pointer}.queue-action[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.queue-remove[_ngcontent-%COMP%]{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}.queue-remove[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.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}}"]})},fC=[{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 BP(t){let e=/^\/([\w-]+)$/.exec(t);if(e)return fC.some(n=>n.name===e[1])?e[1]:void 0}function HP(t){return/^\/compact\s+([\s\S]+)$/.exec(t)?.[1]?.trim()||void 0}function UP(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 Ah(t){let e=0;for(let n of t)n.kind==="assistant"&&(e+=(n.text??"").length+(n.thinking??"").length);return e}var mC="morse.chat.toolDisplay",hC="morse.chat.diffView";function zP(t){return t==="timeline"||t==="compact"}function GP(){try{let t=globalThis.localStorage?.getItem(mC);return zP(t)?t:"compact"}catch{return"compact"}}function qP(t){try{globalThis.localStorage?.setItem(mC,t)}catch{}}function WP(t){return t==="file"||t==="unified"||t==="split"}function YP(){try{let t=globalThis.localStorage?.getItem(hC);return WP(t)?t:"unified"}catch{return"unified"}}function KP(t){try{globalThis.localStorage?.setItem(hC,t)}catch{}}var Ro=class t{toolDisplaySignal=O(GP());toolDisplay=this.toolDisplaySignal.asReadonly();diffViewSignal=O(YP());diffView=this.diffViewSignal.asReadonly();setToolDisplay(e){this.toolDisplaySignal.set(e),qP(e)}setDiffView(e){this.diffViewSignal.set(e),KP(e)}toggleToolDisplay(){this.setToolDisplay(this.toolDisplaySignal()==="compact"?"timeline":"compact")}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};function ZP(t,e){if(t&1&&(h(0,"div",8),u(1),g()),t&2){let n=m();ie("title",n.workspace().cwd),d(),k(e)}}function QP(t,e){if(t&1&&(h(0,"span",12),u(1),g()),t&2){let n=m();d(),k(n.statusLabel())}}function XP(t,e){if(t&1){let n=$();h(0,"button",14),F("click",function(){D(n);let o=m();return M(o.toggleGit())}),st(),h(1,"svg",3),ce(2,"circle",18)(3,"circle",19)(4,"circle",20)(5,"path",21)(6,"path",22),g()()}if(t&2){let n=m();ie("title",n.gitOpen()?"Hide the git panel":"Show the git panel"),J("aria-label",n.gitOpen()?"Hide the git panel":"Show the git panel")("aria-pressed",n.gitOpen())}}function JP(t,e){t&1&&(st(),h(0,"svg",3),ce(1,"path",23),g())}function eA(t,e){t&1&&(st(),h(0,"svg",3),ce(1,"path",24),g())}var su=class t{morse=N(Ze);shell=N(Ht);display=N(Ro);shortcuts=N(An);destroyRef=N(pt);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");gitEnabled=E(()=>this.morse.capabilities()?.gitPanel===!0);gitOpen=this.shell.gitPanelOpen;constructor(){let e=this.shortcuts.bind("view.git",()=>this.shell.toggleGitPanel(),()=>this.gitEnabled());this.destroyRef.onDestroy(e)}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 i=this.state().model;return i&&e.push(i.name),e.join(" \xB7 ")});toggleNavigation(){this.shell.toggleNavigation()}toggleSidebar(){this.shell.toggleNavigationCollapsed()}compact(){this.shell.requestCompact()}toggleToolDisplay(){this.display.toggleToolDisplay()}toggleGit(){this.shell.toggleGitPanel()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-chat-header"]],decls:23,vars:21,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,"title"],["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"],["cx","4.5","cy","3.5","r","1.6"],["cx","4.5","cy","12.5","r","1.6"],["cx","11.5","cy","6.5","r","1.6"],["d","M4.5 5.1v5.8"],["d","M4.5 5.1c0 2.4 7 1 7 3"],["d","M3 6h10M3 10h6"],["d","M3 4.5h10M3 8h10M3 11.5h10"]],template:function(n,i){if(n&1&&(h(0,"header",0)(1,"button",1),F("click",function(){return i.toggleNavigation()}),u(2," \u2630 "),g(),h(3,"button",2),F("click",function(){return i.toggleSidebar()}),st(),h(4,"svg",3),ce(5,"rect",4)(6,"path",5),g()(),Jt(),h(7,"div",6)(8,"div",7),u(9),g(),w(10,ZP,2,2,"div",8),g(),h(11,"div",9)(12,"span",10),ce(13,"span",11),w(14,QP,2,1,"span",12),g(),w(15,XP,7,3,"button",13),h(16,"button",14),F("click",function(){return i.toggleToolDisplay()}),w(17,JP,2,0,":svg:svg",3)(18,eA,2,0,":svg:svg",3),g(),h(19,"button",15),F("click",function(){return i.compact()}),st(),h(20,"svg",3),ce(21,"path",16)(22,"path",17),g()()()()),n&2){let o;d(),J("aria-expanded",i.navigationOpen()),d(2),ie("title",i.collapsed()?"Show the sidebar":"Hide the sidebar"),J("aria-label",i.collapsed()?"Show the sidebar":"Hide the sidebar")("aria-expanded",!i.collapsed()),d(5),ie("title",i.state().sessionId??i.workspace().cwd),d(),k(i.title()),d(),S((o=i.meta())?10:-1,o),d(2),X("online",i.status()==="ready")("busy",i.status()==="starting")("failed",i.status()==="error"||i.status()==="closed"),ie("title",i.statusTitle()),d(2),S(i.status()!=="ready"?14:-1),d(),S(i.gitEnabled()?15:-1),d(),ie("title",i.compactTools()?"Tool calls: compact \u2014 click for the legacy timeline":"Tool calls: legacy timeline \u2014 click for the compact tree"),J("aria-label","Tool call display: "+(i.compactTools()?"compact":"timeline"))("aria-pressed",i.compactTools()),d(),S(i.compactTools()?17:18),d(2),ie("disabled",!i.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 _C(t){let e=[],n=[],i=()=>{n.length!==0&&(e.push({kind:"process",key:`process-${n[0]?.key??e.length}`,steps:n}),n=[])};for(let o of t){if(o.kind==="tool"){n.push({kind:"tool",key:o.id,item:o});continue}if(o.kind==="assistant"){let r=o.thinking.trim();r.length>0&&n.push({kind:"thinking",key:`${o.id}:thinking`,item:o}),o.text.trim().length>0||o.streaming&&r.length===0?(i(),e.push({kind:"assistant",key:o.id,item:o})):r.length===0&&i();continue}i(),o.kind==="user"?e.push({kind:"user",key:o.id,item:o}):o.kind==="notice"?e.push({kind:"notice",key:o.id,item:o}):o.kind==="compaction"&&e.push({kind:"compaction",key:o.id,item:o})}return i(),e}function vC(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 tA=/(^|\s)@([^\s:]+(?::\d+(?:-\d+)?)?)(?=$|\s)/g;function nA(t){if(t.length===0)return;let e=t.indexOf(":");if(e===-1)return{path:t};let n=t.slice(0,e),i=t.slice(e+1),o=/^(\d+)(?:-(\d+))?$/.exec(i);if(n.length===0||!o)return;let r=Number(o[1]),s=o[2]===void 0?r:Number(o[2]);return{path:n,startLine:r,endLine:s}}function bC(t){let e;return t.split(`
|
|
18
|
+
`).map(n=>{let i=/^\s*(`{3,}|~{3,})/.exec(n);if(i){let o=i[1]?.charAt(0)??"";return e===void 0?e=o:o===e&&(e=void 0),n}return e===void 0?iA(n):n}).join(`
|
|
19
|
+
`)}function iA(t){let e="",n=0;for(;n<t.length;){let i=t.indexOf("`",n);if(i===-1){e+=gC(t.slice(n));break}e+=gC(t.slice(n,i));let o=t.indexOf("`",i+1);if(o===-1){e+=t.slice(i);break}e+=t.slice(i,o+1),n=o+1}return e}function gC(t){return t.replace(tA,(e,n,i)=>{let o=nA(i);if(!o)return e;let r=oA(o.path),s=o.startLine===void 0?`@${r}`:`@${r}:${o.startLine}-${o.endLine}`,a=yC(o.path),c=o.startLine===void 0?"":` data-mention-start="${o.startLine}" data-mention-end="${o.endLine}"`;return`${n}<span class="mention" data-mention-path="${a}" title="${a}"${c}><span class="mention-label">${yC(s)}</span></span>`})}function oA(t){let e=t.replace(/[\\/]+$/,""),n=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return n===-1?e:e.slice(n+1)}function yC(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function rA(t,e){this.v=t,this.k=e}function xC(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function sA(t){if(Array.isArray(t))return t}function aA(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,o,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=(i=r.call(n)).done)&&(a.push(i.value),a.length!==e);c=!0);}catch(p){l=!0,o=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw o}}return a}}function cA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
20
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lA(t,e){return sA(t)||aA(t,e)||dA(t,e)||cA()}function dA(t,e){if(t){if(typeof t=="string")return xC(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)?xC(t,e):void 0}}function au(t){var e,n;function i(r,s){try{var a=t[r](s),c=a.value,l=c instanceof rA;Promise.resolve(l?c.v:c).then(function(p){if(l){var f=r==="return"&&c.k?r:"next";if(!c.k||p.done)return i(f,p);p=t[f](p).value}o(!!a.done,p)},function(p){i("throw",p)})}catch(p){o(2,p)}}function o(r,s){r===2?e.reject(s):e.resolve({value:s,done:r}),(e=e.next)?i(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,i(r,s))})},typeof t.return!="function"&&(this.return=void 0)}au.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},au.prototype.next=function(t){return this._invoke("next",t)},au.prototype.throw=function(t){return this._invoke("throw",t)},au.prototype.return=function(t){return this._invoke("return",t)};var LC=Object.entries,CC=Object.setPrototypeOf,uA=Object.isFrozen,pA=Object.getPrototypeOf,fA=Object.getOwnPropertyDescriptor,sn=Object.freeze,pn=Object.seal,Ns=Object.create,FC=typeof Reflect<"u"&&Reflect,Hh=FC.apply,Uh=FC.construct;sn||(sn=function(e){return e});pn||(pn=function(e){return e});Hh||(Hh=function(e,n){for(var i=arguments.length,o=new Array(i>2?i-2:0),r=2;r<i;r++)o[r-2]=arguments[r];return e.apply(n,o)});Uh||(Uh=function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return new e(...i)});var Ir=Qt(Array.prototype.forEach);Array.prototype.indexOf;var mA=Qt(Array.prototype.lastIndexOf),EC=Qt(Array.prototype.pop),ic=Qt(Array.prototype.push);Array.prototype.slice;var hA=Qt(Array.prototype.splice),Os=Array.isArray,sc=Qt(String.prototype.toLowerCase),Lh=Qt(String.prototype.toString),wC=Qt(String.prototype.match),oc=Qt(String.prototype.replace),SC=Qt(String.prototype.indexOf),gA=Qt(String.prototype.trim),yA=Qt(Number.prototype.toString),_A=Qt(Boolean.prototype.toString),TC=typeof BigInt>"u"?null:Qt(BigInt.prototype.toString),DC=typeof Symbol>"u"?null:Qt(Symbol.prototype.toString),Rn=Qt(Object.prototype.hasOwnProperty),rc=Qt(Object.prototype.toString),bn=Qt(RegExp.prototype.test),Lo=vA(TypeError);function Qt(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return Hh(t,e,i)}}function vA(t){return function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return Uh(t,n)}}function ct(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:sc;if(CC&&CC(t,null),!Os(e))return t;let i=e.length;for(;i--;){let o=e[i];if(typeof o=="string"){let r=n(o);r!==o&&(uA(e)||(e[i]=r),o=r)}t[o]=!0}return t}function bA(t){for(let e=0;e<t.length;e++)Rn(t,e)||(t[e]=null);return t}function qn(t){let e=Ns(null);for(let i of LC(t)){var n=lA(i,2);let o=n[0],r=n[1];Rn(t,o)&&(Os(r)?e[o]=bA(r):r&&typeof r=="object"&&r.constructor===Object?e[o]=qn(r):e[o]=r)}return e}function xA(t){switch(typeof t){case"string":return t;case"number":return yA(t);case"boolean":return _A(t);case"bigint":return TC?TC(t):"0";case"symbol":return DC?DC(t):"Symbol()";case"undefined":return rc(t);case"function":case"object":{if(t===null)return rc(t);let e=t,n=di(e,"toString");if(typeof n=="function"){let i=n(e);return typeof i=="string"?i:rc(i)}return rc(t)}default:return rc(t)}}function di(t,e){for(;t!==null;){let i=fA(t,e);if(i){if(i.get)return Qt(i.get);if(typeof i.value=="function")return Qt(i.value)}t=pA(t)}function n(){return null}return n}function CA(t){try{return bn(t,""),!0}catch{return!1}}var MC=sn(["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"]),Fh=sn(["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"]),Vh=sn(["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"]),EA=sn(["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"]),jh=sn(["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"]),wA=sn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),kC=sn(["#text"]),IC=sn(["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"]),$h=sn(["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"]),NC=sn(["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"]),cu=sn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),SA=pn(/{{[\w\W]*|^[\w\W]*}}/g),TA=pn(/<%[\w\W]*|^[\w\W]*%>/g),DA=pn(/\${[\w\W]*/g),MA=pn(/^data-[\-\w.\u00B7-\uFFFF]+$/),kA=pn(/^aria-[\-\w]+$/),OC=pn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IA=pn(/^(?:\w+script|data):/i),NA=pn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),OA=pn(/^html$/i),PA=pn(/^[a-z][.\w]*(-[.\w]+)+$/i),PC=pn(/<[/\w!]/g),AC=pn(/<[/\w]/g),AA=pn(/<\/no(script|embed|frames)/i),RA=pn(/\/>/i),Gn={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"],LA=sn(ct({},VC)),FA=(function(){let t={};return Ir(VC,e=>{t[e]=pn(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),sn(t)})(),VA=function(){return typeof window>"u"?null:window},jA=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(i=n.getAttribute(o));let r="dompurify"+(i?"#"+i:"");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}},RC=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Fo=function(e,n,i,o){return Rn(e,n)&&Os(e[n])?ct(o.base?qn(o.base):{},e[n],o.transform):i},Bh=function(e,n,i){let o=Rn(e,n)?e[n]:void 0;return o&&typeof o=="object"?qn(o):i()};function jC(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:VA(),e=U=>jC(U);if(e.version="3.4.16",e.removed=[],!t||!t.document||t.document.nodeType!==Gn.document||!t.Element)return e.isSupported=!1,e;let n=t.document,i=n,o=i.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,p=t.trustedTypes,f=a.prototype,_=di(f,"cloneNode"),x=di(f,"remove"),C=di(f,"removeAttributeNode"),T=di(f,"nextSibling"),P=di(f,"childNodes"),Y=di(f,"parentNode"),W=di(f,"shadowRoot"),be=di(f,"attributes"),ye=s&&s.prototype?di(s.prototype,"nodeType"):null,Me=s&&s.prototype?di(s.prototype,"nodeName"):null,me=s&&s.prototype?di(s.prototype,"ownerDocument"):null,Je=function(v){return ye?ye(v):v.nodeType},je=function(v){return Me?Me(v):v.nodeName};if(typeof r=="function"){let U=n.createElement("template");U.content&&U.content.ownerDocument&&(n=U.content.ownerDocument)}let Be,ft="",St,Rt=!1,kt=0,et=function(){if(kt>0)throw Lo('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.')},Se=function(v){et(),kt++;try{return Be.createHTML(v)}finally{kt--}},R=function(v){et(),kt++;try{return Be.createScriptURL(v)}finally{kt--}},Q=function(){return Rt||(St=jA(p,o),Rt=!0),St},G=n,L=G.implementation,ne=G.createNodeIterator,Le=G.createDocumentFragment,tt=G.getElementsByTagName,Ut=i.importNode,Ce=RC();e.isSupported=typeof LC=="function"&&typeof Y=="function"&&L&&L.createHTMLDocument!==void 0;let bt=SA,ze=TA,an=DA,zt=MA,Ke=kA,Wt=IA,Lt=NA,Re=PA,qe=OC,ke=null,rt=ct({},[...MC,...Fh,...Vh,...jh,...kC]),pe=null,ut=ct({},[...IC,...$h,...NC,...cu]),Z=Object.seal(Ns(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}})),_t=null,Qe=null,de=Object.seal(Ns(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Et=!0,Ee=!0,lt=!1,Ge=!0,j=!1,H=!0,ee=!1,fe=!1,mt=null,Tt=null,Yn=!1,yn=!1,Ti=!1,Di=!1,pc=!0,fc=!1,Ar="user-content-",jo=!0,Vs=!1,Xt={},Mi=null,js=ct({},["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"]),mc=null,$o=ct({},["audio","video","img","source","image","track"]),$s=null,Bs=ct({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),cn="http://www.w3.org/1998/Math/MathML",po="http://www.w3.org/2000/svg",Oe="http://www.w3.org/1999/xhtml",Ft=Oe,hc=!1,Rr=null,WE=ct({},[cn,po,Oe],Lh),ng=sn(["mi","mo","mn","ms","mtext"]),Vu=ct({},ng),ig=sn(["annotation-xml"]),ju=ct({},ig),YE=ct({},["title","style","font","a","script"]),Hs=null,KE=["application/xhtml+xml","text/html"],ZE="text/html",Gt=null,Lr=null,QE=n.createElement("form"),og=function(v){return v instanceof RegExp||v instanceof Function},$u=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Lr&&Lr===v)return;(!v||typeof v!="object")&&(v={}),v=qn(v),Hs=KE.indexOf(v.PARSER_MEDIA_TYPE)===-1?ZE:v.PARSER_MEDIA_TYPE,Gt=Hs==="application/xhtml+xml"?Lh:sc,ke=Fo(v,"ALLOWED_TAGS",rt,{transform:Gt}),pe=Fo(v,"ALLOWED_ATTR",ut,{transform:Gt}),Rr=Fo(v,"ALLOWED_NAMESPACES",WE,{transform:Lh}),$s=Fo(v,"ADD_URI_SAFE_ATTR",Bs,{transform:Gt,base:Bs}),mc=Fo(v,"ADD_DATA_URI_TAGS",$o,{transform:Gt,base:$o}),Mi=Fo(v,"FORBID_CONTENTS",js,{transform:Gt}),_t=Fo(v,"FORBID_TAGS",qn({}),{transform:Gt}),Qe=Fo(v,"FORBID_ATTR",qn({}),{transform:Gt}),Xt=Rn(v,"USE_PROFILES")?v.USE_PROFILES&&typeof v.USE_PROFILES=="object"?qn(v.USE_PROFILES):v.USE_PROFILES:!1,Et=v.ALLOW_ARIA_ATTR!==!1,Ee=v.ALLOW_DATA_ATTR!==!1,lt=v.ALLOW_UNKNOWN_PROTOCOLS||!1,Ge=v.ALLOW_SELF_CLOSE_IN_ATTR!==!1,j=v.SAFE_FOR_TEMPLATES||!1,H=v.SAFE_FOR_XML!==!1,ee=v.WHOLE_DOCUMENT||!1,yn=v.RETURN_DOM||!1,Ti=v.RETURN_DOM_FRAGMENT||!1,Di=v.RETURN_TRUSTED_TYPE||!1,Yn=v.FORCE_BODY||!1,pc=v.SANITIZE_DOM!==!1,fc=v.SANITIZE_NAMED_PROPS||!1,jo=v.KEEP_CONTENT!==!1,Vs=v.IN_PLACE||!1,qe=CA(v.ALLOWED_URI_REGEXP)?v.ALLOWED_URI_REGEXP:OC,Ft=typeof v.NAMESPACE=="string"?v.NAMESPACE:Oe,Vu=Bh(v,"MATHML_TEXT_INTEGRATION_POINTS",()=>ct({},ng)),ju=Bh(v,"HTML_INTEGRATION_POINTS",()=>ct({},ig));let I=Bh(v,"CUSTOM_ELEMENT_HANDLING",()=>Ns(null));if(Z=Ns(null),Rn(I,"tagNameCheck")&&og(I.tagNameCheck)&&(Z.tagNameCheck=I.tagNameCheck),Rn(I,"attributeNameCheck")&&og(I.attributeNameCheck)&&(Z.attributeNameCheck=I.attributeNameCheck),Rn(I,"allowCustomizedBuiltInElements")&&typeof I.allowCustomizedBuiltInElements=="boolean"&&(Z.allowCustomizedBuiltInElements=I.allowCustomizedBuiltInElements),pn(Z),j&&(Ee=!1),Ti&&(yn=!0),Xt&&(ke=ct({},kC),pe=Ns(null),Xt.html===!0&&(ct(ke,MC),ct(pe,IC)),Xt.svg===!0&&(ct(ke,Fh),ct(pe,$h),ct(pe,cu)),Xt.svgFilters===!0&&(ct(ke,Vh),ct(pe,$h),ct(pe,cu)),Xt.mathMl===!0&&(ct(ke,jh),ct(pe,NC),ct(pe,cu))),de.tagCheck=null,de.attributeCheck=null,Rn(v,"ADD_TAGS")&&(typeof v.ADD_TAGS=="function"?de.tagCheck=v.ADD_TAGS:Os(v.ADD_TAGS)&&(ke===rt&&(ke=qn(ke)),ct(ke,v.ADD_TAGS,Gt))),Rn(v,"ADD_ATTR")&&(typeof v.ADD_ATTR=="function"?de.attributeCheck=v.ADD_ATTR:Os(v.ADD_ATTR)&&(pe===ut&&(pe=qn(pe)),ct(pe,v.ADD_ATTR,Gt))),Rn(v,"ADD_FORBID_CONTENTS")&&Os(v.ADD_FORBID_CONTENTS)&&(Mi===js&&(Mi=qn(Mi)),ct(Mi,v.ADD_FORBID_CONTENTS,Gt)),jo&&(ke["#text"]=!0),ee&&ct(ke,["html","head","body"]),ke.table&&(ct(ke,["tbody"]),delete _t.tbody),v.TRUSTED_TYPES_POLICY){if(typeof v.TRUSTED_TYPES_POLICY.createHTML!="function")throw Lo('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof v.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Lo('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let B=Be;Be=v.TRUSTED_TYPES_POLICY;try{ft=Se("")}catch(z){throw Be=B,z}}else v.TRUSTED_TYPES_POLICY===null?(Be=void 0,ft=""):(Be===void 0&&(Be=Q()),Be&&typeof ft=="string"&&(ft=Se("")));sn&&sn(v),Lr=v},rg=ct({},[...Fh,...Vh,...EA]),sg=ct({},[...jh,...wA]),XE=function(v,I,B){return I.namespaceURI===Oe?v==="svg":I.namespaceURI===cn?v==="svg"&&(B==="annotation-xml"||Vu[B]):!!rg[v]},JE=function(v,I,B){return I.namespaceURI===Oe?v==="math":I.namespaceURI===po?v==="math"&&ju[B]:!!sg[v]},e1=function(v,I,B){return I.namespaceURI===po&&!ju[B]||I.namespaceURI===cn&&!Vu[B]?!1:!sg[v]&&(YE[v]||!rg[v])},t1=function(v){let I=Y(v);(!I||!I.tagName)&&(I={namespaceURI:Ft,tagName:"template"});let B=sc(v.tagName),z=sc(I.tagName);return Rr[v.namespaceURI]?v.namespaceURI===po?XE(B,I,z):v.namespaceURI===cn?JE(B,I,z):v.namespaceURI===Oe?e1(B,I,z):!!(Hs==="application/xhtml+xml"&&Rr[v.namespaceURI]):!1},fo=function(v){ic(e.removed,{element:v});try{Y(v).removeChild(v)}catch{if(x(v),!Y(v))throw Lo("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ag=function(v,I,B){try{C(v,I)}catch{try{v.removeAttribute(B)}catch{}}},gc=function(v){yc(v);let I=P(v);if(I){let z=[];Ir(I,he=>{ic(z,he)}),Ir(z,he=>{try{x(he)}catch{}})}let B=be(v);if(B)for(let z=B.length-1;z>=0;--z){let he=B[z],We=he&&he.name;typeof We=="string"&&ag(v,he,We)}},Bo=function(v,I,B){if(!B)try{B=I.getAttributeNode(v)}catch{B=null}ic(e.removed,{attribute:B||null,from:I});try{B?C(I,B):I.removeAttribute(v)}catch{try{I.removeAttribute(v)}catch{}}if(v==="is")if(yn||Ti)try{fo(I)}catch{}else try{I.setAttribute(v,"")}catch{}},n1=function(v){let I=be(v);if(I)for(let B=I.length-1;B>=0;--B){let z=I[B],he=z&&z.name;typeof he!="string"||pe[Gt(he)]||ag(v,z,he)}},yc=function(v){let I=[v];for(;I.length>0;){let B=I.pop();Je(B)===Gn.element&&n1(B);let z=P(B);if(z)for(let he=z.length-1;he>=0;--he)I.push(z[he])}},cg=function(v,I){return H?v==="patchsrc"?!0:v==="for"&&I!=="label"&&I!=="output":!1},i1=function(v){if(!H)return;let I=[v];for(;I.length>0;){let B=I.pop(),z=Je(B);if(z===Gn.processingInstruction||z===Gn.comment&&bn(AC,B.data)){try{x(B)}catch{}continue}if(z===Gn.element){let We=B,nt=Gt(je(B));try{We.hasAttribute&&We.hasAttribute("patchsrc")&&We.removeAttribute("patchsrc"),We.hasAttribute&&We.hasAttribute("for")&&cg("for",nt)&&We.removeAttribute("for")}catch{}}let he=P(B);if(he)for(let We=he.length-1;We>=0;--We)I.push(he[We])}},lg=function(v){let I=null,B=null;if(Yn)v="<remove></remove>"+v;else{let We=wC(v,/^[\r\n\t ]+/);B=We&&We[0]}Hs==="application/xhtml+xml"&&Ft===Oe&&(v='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+v+"</body></html>");let z=Be?Se(v):v;if(Ft===Oe)try{I=new l().parseFromString(z,Hs)}catch{}if(!I||!I.documentElement){I=L.createDocument(Ft,"template",null);try{I.documentElement.innerHTML=hc?ft:z}catch{}}let he=I.body||I.documentElement;return v&&B&&he.insertBefore(n.createTextNode(B),he.childNodes[0]||null),Ft===Oe?tt.call(I,ee?"html":"body")[0]:ee?I.documentElement:he},dg=function(v){let I=me?me(v):v.ownerDocument;return ne.call(I||v,v,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},_c=function(v){return v=oc(v,bt," "),v=oc(v,ze," "),v=oc(v,an," "),v},Bu=function(v){var I;v.normalize();let B=me?me(v):v.ownerDocument,z=ne.call(B||v,v,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),he=z.nextNode();for(;he;)he.data=_c(he.data),he=z.nextNode();let We=(I=v.querySelectorAll)===null||I===void 0?void 0:I.call(v,"template");We&&Ir(We,nt=>{Fr(nt.content)&&Bu(nt.content)})},vc=function(v){let I=Me?Me(v):null;return typeof I!="string"||Gt(I)!=="form"?!1:typeof v.nodeName!="string"||typeof v.textContent!="string"||typeof v.removeChild!="function"||v.attributes!==be(v)||typeof v.removeAttribute!="function"||typeof v.removeAttributeNode!="function"||typeof v.getAttributeNode!="function"||typeof v.setAttribute!="function"||typeof v.namespaceURI!="string"||typeof v.insertBefore!="function"||typeof v.hasChildNodes!="function"||v.nodeType!==ye(v)||v.childNodes!==P(v)},Fr=function(v){if(!ye||typeof v!="object"||v===null)return!1;try{return ye(v)===Gn.documentFragment}catch{return!1}},Us=function(v){if(!ye||typeof v!="object"||v===null)return!1;try{return typeof ye(v)=="number"}catch{return!1}};function ki(U,v,I){U.length!==0&&Ir(U,B=>{B.call(e,v,I,Lr)})}let o1=function(v,I){return!!(H&&v.hasChildNodes()&&!Us(v.firstElementChild)&&bn(PC,v.textContent)&&bn(PC,v.innerHTML)||H&&v.namespaceURI===Oe&&LA[I]&&(Us(v.firstElementChild)||typeof v.textContent=="string"&&bn(FA[I],v.textContent))||v.nodeType===Gn.processingInstruction||H&&v.nodeType===Gn.comment&&bn(AC,v.data))},bc=function(v,I){if(v instanceof RegExp)return bn(v,I);if(v instanceof Function){for(var B=arguments.length,z=new Array(B>2?B-2:0),he=2;he<B;he++)z[he-2]=arguments[he];return!!v(I,...z)}return!1},r1=function(v,I,B){if(!_t[I]&&mg(I)&&bc(Z.tagNameCheck,I))return!1;if(jo&&!Mi[I]){let z=Y(v),he=P(v);if(he&&z){let We=he.length;for(let nt=We-1;nt>=0;--nt){let Vt=v===B?_(he[nt],!0):he[nt];z.insertBefore(Vt,T(v))}}}return fo(v),!0},ug=function(v,I,B,z){return v.length===0?I:I===B||I===z?qn(I):I},Vr=function(v,I){return v===I||Y(v)!==null?!1:(Vs&&yc(v),!0)},pg=function(v,I){if(ki(Ce.beforeSanitizeElements,v,null),Vr(v,I))return!0;if(vc(v))return fo(v),!0;let B=Gt(je(v));if(ke=ug(Ce.uponSanitizeElement,ke,rt,mt),ki(Ce.uponSanitizeElement,v,{tagName:B,allowedTags:ke}),Vr(v,I))return!0;if(o1(v,B))return fo(v),!0;if(_t[B]||!(de.tagCheck instanceof Function&&de.tagCheck(B))&&!ke[B]){let z=r1(v,B,I);return z===!1&&(ki(Ce.afterSanitizeElements,v,null),Vr(v,I))?!0:z}if(Je(v)===Gn.element&&!t1(v)||(B==="noscript"||B==="noembed"||B==="noframes")&&bn(AA,v.innerHTML))return fo(v),!0;if(j&&v.nodeType===Gn.text){let z=_c(v.textContent);v.textContent!==z&&(ic(e.removed,{element:v.cloneNode()}),v.textContent=z)}return ki(Ce.afterSanitizeElements,v,null),Vr(v,I)},fg=function(v,I,B){if(Qe[I]||cg(I,v)||pc&&(I==="id"||I==="name")&&(B in n||B in QE))return!1;let z=pe[I]||de.attributeCheck instanceof Function&&de.attributeCheck(I,v);return Ee&&bn(zt,I)||Et&&bn(Ke,I)?!0:z?$s[I]||bn(qe,oc(B,Lt,""))||(I==="src"||I==="xlink:href"||I==="href")&&v!=="script"&&SC(B,"data:")===0&&mc[v]||lt&&!bn(Wt,oc(B,Lt,""))?!0:!B:mg(v)&&bc(Z.tagNameCheck,v)&&bc(Z.attributeNameCheck,I,v)||I==="is"&&Z.allowCustomizedBuiltInElements&&bc(Z.tagNameCheck,B)},s1=ct({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),mg=function(v){return!s1[sc(v)]&&bn(Re,v)},a1=function(v,I,B,z){if(Be&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!B)switch(p.getAttributeType(v,I)){case"TrustedHTML":return Se(z);case"TrustedScriptURL":return R(z)}return z},c1=function(v,I,B,z){try{return B?v.setAttributeNS(B,I,z):v.setAttribute(I,z),vc(v)?(fo(v),!1):!0}catch{return Bo(I,v),!1}},hg=function(v,I){if(ki(Ce.beforeSanitizeAttributes,v,null),Vr(v,I))return;let B=v.attributes;if(!B||vc(v))return;pe=ug(Ce.uponSanitizeAttribute,pe,ut,Tt);let z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:pe,forceKeepAttr:void 0},he=B.length,We=Gt(v.nodeName);for(;he--;){let nt=B[he],Vt=nt.name,Kn=nt.namespaceURI,Ln=nt.value,jr=Gt(Vt),Uu=Ln,xn=Vt==="value"?Uu:gA(Uu),gg=!1;if(z.attrName=jr,z.attrValue=xn,z.keepAttr=!0,z.forceKeepAttr=void 0,ki(Ce.uponSanitizeAttribute,v,z),xn=z.attrValue,fc&&(jr==="id"||jr==="name")&&SC(xn,Ar)!==0&&(Bo(Vt,v,nt),xn=Ar+xn,gg=!0),H&&bn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,xn)){Bo(Vt,v,nt);continue}if(jr==="attributename"&&wC(xn,"href")){Bo(Vt,v,nt);continue}if(!z.forceKeepAttr){if(!z.keepAttr){Bo(Vt,v,nt);continue}if(!Ge&&bn(RA,xn)){Bo(Vt,v,nt);continue}if(j&&(xn=_c(xn)),!fg(We,jr,xn)){Bo(Vt,v,nt);continue}xn=a1(We,jr,Kn,xn),xn!==Uu&&c1(v,Vt,Kn,xn)&&gg&&EC(e.removed)}}ki(Ce.afterSanitizeAttributes,v,null),Vr(v,I)},xc=function(v){let I=null,B=dg(v);for(ki(Ce.beforeSanitizeShadowDOM,v,null);I=B.nextNode();)if(ki(Ce.uponSanitizeShadowNode,I,null),pg(I,v),hg(I,v),Fr(I.content)&&xc(I.content),Je(I)===Gn.element){let z=W(I);Fr(z)&&(Hu(z),xc(z))}ki(Ce.afterSanitizeShadowDOM,v,null)},Hu=function(v){let I=[{node:v,shadow:null}];for(;I.length>0;){let B=I.pop();if(B.shadow){xc(B.shadow);continue}let z=B.node,he=Je(z)===Gn.element,We=P(z);if(We)for(let nt=We.length-1;nt>=0;--nt)I.push({node:We[nt],shadow:null});if(he){let nt=Me?Me(z):null;if(typeof nt=="string"&&Gt(nt)==="template"){let Vt=z.content;Fr(Vt)&&I.push({node:Vt,shadow:null})}}if(he){let nt=W(z);Fr(nt)&&I.push({node:null,shadow:nt},{node:nt,shadow:null})}}};return e.sanitize=function(U){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,B=null,z=null,he=null;if(hc=!U,hc&&(U="<!-->"),typeof U!="string"&&!Us(U)&&(U=xA(U),typeof U!="string"))throw Lo("dirty is not a string, aborting");if(!e.isSupported)return U;fe?(ke=mt,pe=Tt):$u(v),(Ce.uponSanitizeElement.length>0||Ce.uponSanitizeAttribute.length>0)&&(ke=qn(ke)),Ce.uponSanitizeAttribute.length>0&&(pe=qn(pe)),e.removed=[];let We=Vs&&typeof U!="string"&&Us(U);if(We){i1(U);let Kn=je(U);if(typeof Kn=="string"){let Ln=Gt(Kn);if(!ke[Ln]||_t[Ln])throw gc(U),Lo("root node is forbidden and cannot be sanitized in-place")}if(vc(U))throw gc(U),Lo("root node is clobbered and cannot be sanitized in-place");try{Hu(U)}catch(Ln){throw gc(U),Ln}}else if(Us(U))I=lg("<!---->"),B=I.ownerDocument.importNode(U,!0),B.nodeType===Gn.element&&B.nodeName==="BODY"||B.nodeName==="HTML"?I=B:I.appendChild(B),Hu(I);else{if(!yn&&!j&&!ee&&U.indexOf("<")===-1)return Be&&Di?Se(U):U;if(I=lg(U),!I)return yn?null:Di?ft:""}I&&Yn&&fo(I.firstChild);let nt=We?U:I;try{let Kn=dg(nt);for(;z=Kn.nextNode();)pg(z,nt),hg(z,nt),Fr(z.content)&&xc(z.content)}catch(Kn){throw We&&(gc(U),Ir(e.removed,Ln=>{Ln.element&&yc(Ln.element)})),Kn}if(We){let Kn=!1;if(Ir(e.removed,Ln=>{Ln.element&&(Ln.element===U&&(Kn=!0),yc(Ln.element))}),Kn)throw Lo("a node selected for removal could not be safely returned; refusing to sanitize in place");return j&&Bu(U),U}if(yn){if(j&&Bu(I),Ti)for(he=Le.call(I.ownerDocument);I.firstChild;)he.appendChild(I.firstChild);else he=I;return(pe.shadowroot||pe.shadowrootmode)&&(he=Ut.call(i,he,!0)),he}let Vt=ee?I.outerHTML:I.innerHTML;return ee&&ke["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&bn(OA,I.ownerDocument.doctype.name)&&(Vt="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
|
|
21
|
+
`+Vt),j&&(Vt=_c(Vt)),Be&&Di?Se(Vt):Vt},e.setConfig=function(){let U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$u(U),fe=!0,mt=ke,Tt=pe},e.clearConfig=function(){Lr=null,fe=!1,mt=null,Tt=null,Be=St,ft=""},e.isValidAttribute=function(U,v,I){Lr||$u({});let B=Gt(U),z=Gt(v);return fg(B,z,I)},e.addHook=function(U,v){typeof v=="function"&&Rn(Ce,U)&&ic(Ce[U],v)},e.removeHook=function(U,v){if(Rn(Ce,U)){if(v!==void 0){let I=mA(Ce[U],v);return I===-1?void 0:hA(Ce[U],I,1)[0]}return EC(Ce[U])}},e.removeHooks=function(U){Rn(Ce,U)&&(Ce[U]=[])},e.removeAllHooks=function(){Ce=RC()},e}var $C=jC();function Wh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Pr=Wh();function QC(t){Pr=t}var Nr={exec:()=>null};function Ps(t){let e=[];return n=>{let i=Math.max(0,Math.min(3,n-1)),o=e[i];return o||(o=t(i),e[i]=o),o}}function Ve(t,e=""){let n=typeof t=="string"?t:t.source,i={replace:(o,r)=>{let s=typeof r=="string"?r:r.source;return s=s.replace(gn.caret,"$1"),n=n.replace(o,s),i},getRegex:()=>new RegExp(n,e)};return i}var $A=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),gn={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:Ps(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Ps(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:Ps(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Ps(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Ps(t=>new RegExp(`^ {0,${t}}(?:</?(?:${dc})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:Ps(t=>new RegExp(`^ {0,${t}}>`))},BA=/^(?:[ \t]*(?:\n|$))+/,HA=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,UA=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,lc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,zA=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Yh=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,XC=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,JC=Ve(XC).replace(/bull/g,Yh).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(),GA=Ve(XC).replace(/bull/g,Yh).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(),Kh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,qA=/^[^\n]+/,Zh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,WA=Ve(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Zh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),YA=Ve(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Yh).getRegex(),dc="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",Qh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,KA=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",Qh).replace("tag",dc).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),eE=t=>Ve(Kh).replace("hr",lc).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",dc).getRegex(),ZA=eE(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),QA=eE(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),XA=Ve(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",QA).getRegex(),Xh={blockquote:XA,code:HA,def:WA,fences:UA,heading:zA,hr:lc,html:KA,lheading:JC,list:YA,newline:BA,paragraph:ZA,table:Nr,text:qA},BC=Ve("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",lc).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",dc).getRegex(),JA=K(V({},Xh),{lheading:GA,table:BC,paragraph:Ve(Kh).replace("hr",lc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",BC).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",dc).getRegex()}),eR=K(V({},Xh),{html:Ve(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Qh).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:Nr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ve(Kh).replace("hr",lc).replace("heading",` *#{1,6} *[^
|
|
22
|
+
]`).replace("lheading",JC).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),tR=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,nR=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,tE=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,iR=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,lo=/[\p{P}\p{S}]/u,As=/[\s\p{P}\p{S}]/u,uc=/[^\s\p{P}\p{S}]/u,oR=Ve(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,As).getRegex(),rR=/[\p{Pi}\p{Ps}"']/u,nE=/(?!~)[\p{P}\p{S}]/u,sR=/(?!~)[\s\p{P}\p{S}]/u,aR=/(?:[^\s\p{P}\p{S}]|~)/u,cR=Ve(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",$A?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),iE=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,lR=Ve(iE,"u").replace(/punct/g,lo).getRegex(),dR=Ve(iE,"u").replace(/punct/g,nE).getRegex(),uR=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,pR=Ve(uR,"u").replace(/openQuote/g,rR).replace(/punct/g,lo).getRegex(),oE="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",fR=Ve(oE,"gu").replace(/notPunctSpace/g,uc).replace(/punctSpace/g,As).replace(/punct/g,lo).getRegex(),mR=Ve(oE,"gu").replace(/notPunctSpace/g,aR).replace(/punctSpace/g,sR).replace(/punct/g,nE).getRegex(),hR="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",gR=Ve(hR,"gu").replace(/notPunctSpace/g,uc).replace(/punctSpace/g,As).replace(/punct/g,lo).getRegex(),yR=Ve("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,uc).replace(/punctSpace/g,As).replace(/punct/g,lo).getRegex(),_R="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",vR=Ve(_R,"gu").replace(/notPunctSpace/g,uc).replace(/punctSpace/g,As).replace(/punct/g,lo).getRegex(),bR=Ve(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,lo).getRegex(),xR="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",CR=Ve(xR,"gu").replace(/notPunctSpace/g,uc).replace(/punctSpace/g,As).replace(/punct/g,lo).getRegex(),ER=Ve(/\\(punct)/,"gu").replace(/punct/g,lo).getRegex(),wR=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(),SR=Ve(Qh).replace("(?:-->|$)","-->").getRegex(),TR=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",SR).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),rE=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,du=Ve(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",rE).getRegex(),DR=Ve(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",du).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),MR=Ve(/^!?\[(label)\]\[(ref)\]/).replace("label",du).replace("ref",Zh).getRegex(),kR=Ve(/^!?\[(ref)\](?:\[\])?/).replace("ref",Zh).getRegex(),HC=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,IR=Ve(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",rE).getRegex(),NR=Ve("reflink|nolink(?!\\()","g").replace("reflink",Ve(/^!?\[(label)\]\[(ref)\]/).replace("label",IR).replace("ref",HC).getRegex()).replace("nolink",Ve(/^!?\[(ref)\](?:\[\])?/).replace("ref",HC).getRegex()).getRegex(),UC=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,OR=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,PR=Ve(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,OR).getRegex(),Jh={_backpedal:Nr,anyPunctuation:ER,autolink:wR,blockSkip:cR,br:tE,code:nR,del:Nr,delLDelim:Nr,delRDelim:Nr,emStrongLDelim:lR,emStrongRDelimAst:fR,emStrongRDelimUnd:yR,escape:tR,link:DR,nolink:kR,punctuation:oR,reflink:MR,reflinkSearch:NR,tag:TR,text:iR,url:Nr},AR=K(V({},Jh),{emStrongLDelim:pR,emStrongRDelimAst:gR,emStrongRDelimUnd:vR,link:Ve(/^!?\[(label)\]\((.*?)\)/).replace("label",du).getRegex(),reflink:Ve(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",du).getRegex()}),zh=K(V({},Jh),{emStrongRDelimAst:mR,emStrongLDelim:dR,delLDelim:bR,delRDelim:CR,url:Ve(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",PR).replace("protocol",UC).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",UC).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()}),RR=K(V({},zh),{br:Ve(tE).replace("{2,}","*").getRegex(),text:Ve(zh.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),lu={normal:Xh,gfm:JA,pedantic:eR},ac={normal:Jh,gfm:zh,breaks:RR,pedantic:AR},LR={"&":"&","<":"<",">":">",'"':""","'":"'"},zC=t=>LR[t];function Wn(t,e){if(e){if(gn.escapeTest.test(t))return t.replace(gn.escapeReplace,zC)}else if(gn.escapeTestNoEncode.test(t))return t.replace(gn.escapeReplaceNoEncode,zC);return t}function FR(t){return t.replace(gn.numericCharacterReference,(e,n,i)=>{let o=n===void 0?Number.parseInt(i,16):Number.parseInt(n,10);return o===0||o>1114111||o>=55296&&o<=57343?"\uFFFD":String.fromCodePoint(o)})}function GC(t){try{t=encodeURI(t).replace(gn.percentDecode,"%")}catch{return null}return t}function qC(t,e){let n=t.replace(gn.findPipe,(r,s,a)=>{let c=!1,l=s;for(;--l>=0&&a[l]==="\\";)c=!c;return c?"|":" |"}),i=n.split(gn.splitPipe),o=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;o<i.length;o++)i[o]=i[o].trim().replace(gn.slashPipe,"|");return i}function Vo(t,e,n){let i=t.length;if(i===0)return"";let o=0;for(;o<i;){let r=t.charAt(i-o-1);if(r===e&&!n)o++;else if(r!==e&&n)o++;else break}return t.slice(0,i-o)}function WC(t){let e=t.split(`
|
|
23
23
|
`),n=e.length-1;for(;n>=0&&gn.blankLine.test(e[n]);)n--;return e.length-n<=2?t:e.slice(0,n+1).join(`
|
|
24
|
-
`)}function uu(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function
|
|
24
|
+
`)}function uu(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function VR(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let i=0;i<t.length;i++)if(t[i]==="\\")i++;else if(t[i]===e[0])n++;else if(t[i]===e[1]&&(n--,n<0))return i;return n>0?-2:-1}function YC(t,e=0){let n=e,i="";for(let o of t)if(o===" "){let r=4-n%4;i+=" ".repeat(r),n+=r}else i+=o,n++;return i}function KC(t,e,n,i,o){let r=e.href,s=e.title||null,a=t[1].replace(o.other.outputLinkReplace,"$1"),c=t[0].charAt(0)==="!";i.state.inLink=!0;let l=i.state.linkEmitted,p=i.state.inRawBlock;i.state.linkEmitted=!1;let f=i.inlineTokens(a),_=i.state.linkEmitted;if(i.state.linkEmitted=l,i.state.inLink=!1,!c){if(_){i.state.inRawBlock=p;return}i.state.linkEmitted=!0}return{type:c?"image":"link",raw:n,href:r,title:s,text:a,tokens:f}}function jR(t,e,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return e;let o=i[1];return e.split(`
|
|
25
25
|
`).map(r=>{let s=r.match(n.other.beginningSpace);if(s===null)return r;let[a]=s;return r.slice(Math.min(a.length,o.length))}).join(`
|
|
26
|
-
`)}function ZC(t,e,n,i){if(!e.includes("<"))return!1;for(let o=0;o<e.length;o++){if(e[o]==="\\"){o++;continue}if(e[o]==="`"){let a=i.inline.code.exec(e.slice(o));if(a){o+=a[0].length-1;continue}}if(e[o]!=="<")continue;let r=t.slice(n+o),s=i.inline.tag.exec(r)||i.inline.autolink.exec(r);if(s){if(s[0].length>e.length-o)return!0;o+=s[0].length-1}}return!1}var pu=class{options;rules;lexer;constructor(t){this.options=t||Pr}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]:WC(e[0]),i=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:i}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],i=
|
|
26
|
+
`)}function ZC(t,e,n,i){if(!e.includes("<"))return!1;for(let o=0;o<e.length;o++){if(e[o]==="\\"){o++;continue}if(e[o]==="`"){let a=i.inline.code.exec(e.slice(o));if(a){o+=a[0].length-1;continue}}if(e[o]!=="<")continue;let r=t.slice(n+o),s=i.inline.tag.exec(r)||i.inline.autolink.exec(r);if(s){if(s[0].length>e.length-o)return!0;o+=s[0].length-1}}return!1}var pu=class{options;rules;lexer;constructor(t){this.options=t||Pr}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]:WC(e[0]),i=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:i}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],i=jR(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:i}}}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 i=Vo(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceTabChar.test(i))&&(n=i.trim())}return{type:"heading",raw:Vo(e[0],`
|
|
27
27
|
`),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:Vo(e[0],`
|
|
28
28
|
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=Vo(e[0],`
|
|
29
29
|
`).split(`
|
|
@@ -51,7 +51,7 @@ ${be.join(`
|
|
|
51
51
|
`):[],r={type:"table",raw:Vo(e[0],`
|
|
52
52
|
`),header:[],align:[],rows:[]};if(n.length===i.length){for(let s of i)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 o)r.rows.push(qC(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:Vo(e[0],`
|
|
53
53
|
`),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)===`
|
|
54
|
-
`?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&&ZC(t,e[1],n,this.rules))return;let i=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let s=Vo(i.slice(0,-1),"\\");if((i.length-s.length)%2===0)return}else{let s=
|
|
54
|
+
`?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&&ZC(t,e[1],n,this.rules))return;let i=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let s=Vo(i.slice(0,-1),"\\");if((i.length-s.length)%2===0)return}else{let s=VR(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 o=e[2],r="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(o);s&&(o=s[1],r=s[3])}else r=e[3]?e[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?o=o.slice(1):o=o.slice(1,-1)),KC(e,{href:o&&o.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 i=n[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&ZC(t,n[1],i,this.rules))return;let o=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[uu(o)];if(!r){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return KC(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!n||this.rules.inline.punctuation.exec(n))){let o=[...i[0]].length-1,r,s,a=o,c=0,l=i[0][0],p=n===l,f=l==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,e=e.slice(-1*t.length+o);(i=f.exec(e))!==null;){if(r=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!r)continue;if(s=[...r].length,i[3]||i[4]){a+=s;continue}else if(i[5]||i[6]){if(o%3&&!((o+s)%3)){c+=s;continue}if(p)break}if(a-=s,a>0)continue;s=Math.min(s,s+a+c);let _=[...i[0]][0].length,x=t.slice(0,o+i.index+_+s);if(Math.min(o,s)%2){let T=x.slice(1,-1);return{type:"em",raw:x,text:T,tokens:this.lexer.inlineTokens(T)}}let C=x.slice(2,-2);return{type:"strong",raw:x,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," "),i=this.rules.other.nonSpaceChar.test(n),o=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&o&&(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 i=this.rules.inline.delLDelim.exec(t);if(i&&(!i[1]||!n||this.rules.inline.punctuation.exec(n))){let o=[...i[0]].length-1,r,s,a=o,c=this.rules.inline.delRDelim;for(c.lastIndex=0,e=e.slice(-1*t.length+o);(i=c.exec(e))!==null;){if(r=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!r||(s=[...r].length,s!==o))continue;if(i[3]||i[4]){a+=s;continue}if(a-=s,a>0)continue;s=Math.min(s,s+a);let l=[...i[0]][0].length,p=t.slice(0,o+i.index+l+s),f=p.slice(o,-o);return{type:"del",raw:p,text:f,tokens:this.lexer.inlineTokens(f)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,i;return e[2]==="@"?(n=e[1],i="mailto:"+n):(n=e[1],i=n),{type:"link",raw:e[0],text:n,href:i,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,i;if(e[2]==="@")n=e[0],i="mailto:"+n;else{let o;do o=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(o!==e[0]);n=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:n,href:i,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]:FR(e[0]),escaped:n}}}},wi=class Gh{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Pr,this.options.tokenizer=this.options.tokenizer||new pu,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:gn,block:lu.normal,inline:ac.normal};this.options.pedantic?(n.block=lu.pedantic,n.inline=ac.pedantic):this.options.gfm&&(n.block=lu.gfm,this.options.breaks?n.inline=ac.breaks:n.inline=ac.gfm),this.tokenizer.rules=n}static get rules(){return{block:lu,inline:ac}}static lex(e,n){return new Gh(n).lex(e)}static lexInline(e,n){return new Gh(n).inlineTokens(e)}lex(e){e=e.replace(gn.carriageReturn,`
|
|
55
55
|
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let i=this.inlineQueue[n];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],i=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(gn.tabCharGlobal," ").replace(gn.spaceLine,""));let o=1/0;for(;e;){if(e.length<o)o=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+=`
|
|
56
56
|
`: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(`
|
|
57
57
|
`)?"":`
|
|
@@ -84,15 +84,15 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
84
84
|
${t}</tr>
|
|
85
85
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
86
86
|
`}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>${Wn(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:i,autolink:o}){let r=o?Wn(n,!0):this.parser.parseInline(i),s=GC(t);if(s===null)return r;t=Wn(s,o);let a='<a href="'+t+'"';return e&&(a+=' title="'+Wn(e)+'"'),a+=">"+r+"</a>",a}image({href:t,title:e,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let o=GC(t);if(o===null)return Wn(n);t=o;let r=`<img src="${Wn(t)}" alt="${Wn(n)}"`;return e&&(r+=` title="${Wn(e)}"`),r+=">",r}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Wn(t.text)}},eg=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}},Si=class qh{options;renderer;textRenderer;constructor(e){this.options=e||Pr,this.options.renderer=this.options.renderer||new fu,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new eg}static parse(e,n){return new qh(n).parse(e)}static parseInline(e,n){return new qh(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let i=0;i<e.length;i++){let o=e[i];if(this.options.extensions?.renderers?.[o.type]){let s=o,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=o;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 i="";for(let o=0;o<e.length;o++){let r=e[o];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)){i+=a||"";continue}}let s=r;switch(s.type){case"escape":{i+=n.text(s);break}case"html":{i+=n.html(s);break}case"link":{i+=n.link(s);break}case"image":{i+=n.image(s);break}case"checkbox":{i+=n.checkbox(s);break}case"strong":{i+=n.strong(s);break}case"em":{i+=n.em(s);break}case"codespan":{i+=n.codespan(s);break}case"br":{i+=n.br(s);break}case"del":{i+=n.del(s);break}case"text":{i+=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 i}},cc=class{options;block;constructor(t){this.options=t||Pr}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?wi.lex:wi.lexInline}provideParser(t=this.block){return t?Si.parse:Si.parseInline}},mu=class{defaults=Wh();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Si;Renderer=fu;TextRenderer=eg;Lexer=wi;Tokenizer=pu;Hooks=cc;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let i of t)switch(n=n.concat(e.call(this,i)),i.type){case"table":{let o=i;for(let r of o.header)n=n.concat(this.walkTokens(r.tokens,e));for(let r of o.rows)for(let s of r)n=n.concat(this.walkTokens(s.tokens,e));break}case"list":{let o=i;n=n.concat(this.walkTokens(o.items,e));break}default:{let o=i;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(r=>{let s=o[r].flat(1/0);n=n.concat(this.walkTokens(s,e))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let i=V({},n);if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let r=e.renderers[o.name];r?e.renderers[o.name]=function(...s){let a=o.renderer.apply(this,s);return a===!1&&(a=r.apply(this,s)),a}:e.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=e[o.level];r?r.unshift(o.tokenizer):e[o.level]=[o.tokenizer],o.start&&(o.level==="block"?e.startBlock?e.startBlock.push(o.start):e.startBlock=[o.start]:o.level==="inline"&&(e.startInline?e.startInline.push(o.start):e.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(e.childTokens[o.name]=o.childTokens)}),i.extensions=e),n.renderer){let o=this.defaults.renderer||new fu(this.defaults);for(let r in n.renderer){if(!(r in o))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let s=r,a=n.renderer[s],c=o[s];o[s]=(...l)=>{let p=a.apply(o,l);return p===!1&&(p=c.apply(o,l)),p||""}}i.renderer=o}if(n.tokenizer){let o=this.defaults.tokenizer||new pu(this.defaults);for(let r in n.tokenizer){if(!(r in o))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let s=r,a=n.tokenizer[s],c=o[s];o[s]=(...l)=>{let p=a.apply(o,l);return p===!1&&(p=c.apply(o,l)),p}}i.tokenizer=o}if(n.hooks){let o=this.defaults.hooks||new cc;for(let r in n.hooks){if(!(r in o))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let s=r,a=n.hooks[s],c=o[s];cc.passThroughHooks.has(r)?o[s]=l=>{if(this.defaults.async&&cc.passThroughHooksRespectAsync.has(r))return(async()=>{let f=await a.call(o,l);return c.call(o,f)})();let p=a.call(o,l);return c.call(o,p)}:o[s]=(...l)=>{if(this.defaults.async)return(async()=>{let f=await a.apply(o,l);return f===!1&&(f=await c.apply(o,l)),f})();let p=a.apply(o,l);return p===!1&&(p=c.apply(o,l)),p}}i.hooks=o}if(n.walkTokens){let o=this.defaults.walkTokens,r=n.walkTokens;i.walkTokens=function(s){let a=[];return a.push(r.call(this,s)),o&&(a=a.concat(o.call(this,s))),a}}this.defaults=V(V({},this.defaults),i)}),this}setOptions(t){return this.defaults=V(V({},this.defaults),t),this}lexer(t,e){return wi.lex(t,e??this.defaults)}parser(t,e){return Si.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let i=V({},n),o=V(V({},this.defaults),i),r=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&i.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(o.hooks&&(o.hooks.options=o,o.hooks.block=t),o.async)return(async()=>{let s=o.hooks?await o.hooks.preprocess(e):e,a=await(o.hooks?await o.hooks.provideLexer(t):t?wi.lex:wi.lexInline)(s,o),c=o.hooks?await o.hooks.processAllTokens(a):a;o.walkTokens&&await Promise.all(this.walkTokens(c,o.walkTokens));let l=await(o.hooks?await o.hooks.provideParser(t):t?Si.parse:Si.parseInline)(c,o);return o.hooks?await o.hooks.postprocess(l):l})().catch(r);try{o.hooks&&(e=o.hooks.preprocess(e));let s=(o.hooks?o.hooks.provideLexer(t):t?wi.lex:wi.lexInline)(e,o);o.hooks&&(s=o.hooks.processAllTokens(s)),o.walkTokens&&this.walkTokens(s,o.walkTokens);let a=(o.hooks?o.hooks.provideParser(t):t?Si.parse:Si.parseInline)(s,o);return o.hooks&&(a=o.hooks.postprocess(a)),a}catch(s){return r(s)}}}onError(t,e){return n=>{if(n.message+=`
|
|
87
|
-
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+Wn(n.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(n);throw n}}},Or=new mu;function wt(t,e){return Or.parse(t,e)}wt.options=wt.setOptions=function(t){return Or.setOptions(t),wt.defaults=Or.defaults,QC(wt.defaults),wt};wt.getDefaults=Wh;wt.defaults=Pr;function jR(...t){return Or.use(...t),wt.defaults=Or.defaults,QC(wt.defaults),wt}wt.use=jR;wt.walkTokens=function(t,e){return Or.walkTokens(t,e)};wt.parseInline=Or.parseInline;wt.Parser=Si;wt.parser=Si.parse;wt.Renderer=fu;wt.TextRenderer=eg;wt.Lexer=wi;wt.lexer=wi.lex;wt.Tokenizer=pu;wt.Hooks=cc;wt.parse=wt;var tX=wt.options,nX=wt.setOptions,iX=wt.walkTokens,oX=wt.parseInline;var rX=Si.parse,sX=wi.lex;function sE(){return{code({text:t,lang:e}){let{html:n,language:i}=Is(t,e??void 0);return`<div class="code"><div class="code-head"><span class="code-lang">${i}</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 i=this.parser.parseInline(n),o=t.replace(/"/g,"""),r=e?` title="${e.replace(/"/g,""")}"`:"";return`<a href="${o}"${r} target="_blank" rel="noreferrer noopener">${i}</a>`}}}var aE=new mu({gfm:!0,breaks:!1});aE.use({renderer:sE()});var cE=new mu({gfm:!0,breaks:!0});cE.use({renderer:sE()});var $R=new Map,BR=new Map,HR=200;function UR(t){return $C.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 lE(t,e,n){let i=t.get(n);if(i!==void 0)return i;let o=UR(e.parse(n,{async:!1}));if(t.size>=HR){let r=t.keys().next().value;r!==void 0&&t.delete(r)}return t.set(n,o),o}function dE(t){return lE($R,aE,t)}function uE(t){return lE(BR,cE,t)}var zR=90,hu=class t{text=te.required();variant=te("assistant");mention=at();sanitizer=N(Fa);painted=O(null);pending;timer;html=E(()=>{let e=this.painted()??this.text();return this.sanitizer.bypassSecurityTrustHtml(this.variant()==="user"?uE(e):dE(e))});constructor(){se(()=>{let e=this.text(),n=ii(()=>this.painted());if(n===null){this.painted.set(e);return}n===e||this.pending===e||(this.pending=e,this.schedule())}),N(pt).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)},zR)}cancel(){clearTimeout(this.timer),this.timer=void 0}onClick(e){let n=e.target,i=n?.closest("[data-mention-path]")?.getAttribute("data-mention-path");if(i){this.mention.emit(i);return}let o=n?.closest("button[data-copy]");if(!(o instanceof HTMLButtonElement))return;let s=o.closest(".code")?.querySelector("code")?.textContent??"";navigator.clipboard?.writeText(s);let a=o.textContent;o.textContent="Copied",setTimeout(()=>{o.textContent=a??"Copy"},1200)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({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,i){n&1&&(h(0,"div",0),F("click",function(r){return i.onClick(r)}),g()),n&2&&ie("innerHTML",i.html(),Eo)},styles:["[_nghost-%COMP%]{display:block}"]})};function uo(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 pE(t){switch(uo(t.name)){case"edit":return"Edit";case"read":return"Read";case"search":return"Search";case"shell":return"Run";default:return t.name}}function fE(t){switch(uo(t.name)){case"edit":return"Editing";case"read":return"Reading";case"search":return"Searching";case"shell":return"Running";default:return t.name}}function mE(t){switch(uo(t.name)){case"edit":return"\u270E";case"search":return"\u2315";case"shell":return"\u276F";default:return"\u2630"}}function Rs(t){return t.title.startsWith(`${t.name}: `)?t.title.slice(t.name.length+2):t.title}function gu(t){let e=t.replace(/[\\/]+$/,""),n=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return n===-1?e:e.slice(n+1)}function hE(t){if(uo(t.name)!=="edit")return null;let e=Rs(t);return e.length>0&&e!==t.name?e:null}var GR=["list"],gE=(t,e)=>e.key;function qR(t,e){t&1&&ve(0,"span",4)}function WR(t,e){if(t&1&&u(0),t&2){let n=m();ae(" ",n.state()==="error"?"\u2717":"\u2713"," ")}}function YR(t,e){t&1&&(y(0,"span",5),ve(1,"i")(2,"i")(3,"i"),b())}function KR(t,e){t&1&&ve(0,"span",4)}function ZR(t,e){t&1&&(y(0,"span",12),u(1,"\u2717"),b())}function QR(t,e){t&1&&(y(0,"span",13),u(1,"\u2713"),b())}function XR(t,e){if(t&1&&(y(0,"span",22),u(1),b()),t&2){let n=m();d(),ae("+",n.added)}}function JR(t,e){if(t&1&&(y(0,"span",23),u(1),b()),t&2){let n=m();d(),ae("\u2212",n.removed)}}function e2(t,e){if(t&1&&(y(0,"span",17),w(1,XR,2,1,"span",22),w(2,JR,2,1,"span",23),b()),t&2){let n=e;d(),S(n.added>0?1:-1),d(),S(n.removed>0?2:-1)}}function t2(t,e){t&1&&(y(0,"span",5),ve(1,"i")(2,"i")(3,"i"),b())}function n2(t,e){t&1&&(y(0,"span",19),u(1),b()),t&2&&(d(),k(e))}function i2(t,e){if(t&1&&(y(0,"ul",20)(1,"li",24),rt(),y(2,"svg",25),ve(3,"path",26)(4,"path",27),b(),Jt(),y(5,"span",28),u(6),b()()()),t&2){let n=e,i=m(4);d(5),q("title",n),d(),k(i.basename(n))}}function o2(t,e){if(t&1&&(y(0,"span",29),u(1,"input"),b(),y(2,"pre"),u(3),b()),t&2){let n=m(3).$implicit;d(3),k(n.item.input)}}function r2(t,e){if(t&1&&(y(0,"span",29),u(1,"output"),b(),y(2,"pre"),u(3),b()),t&2){let n=m(3).$implicit;d(3),k(n.item.output)}}function s2(t,e){t&1&&(y(0,"span",29),u(1,"no details reported"),b())}function a2(t,e){if(t&1&&(y(0,"div",21),w(1,o2,4,1),w(2,r2,4,1),w(3,s2,2,0,"span",29),b()),t&2){let n=m(2).$implicit;J("data-body",n.key),d(),S(n.item.input?1:-1),d(),S(n.item.output?2:-1),d(),S(!n.item.input&&!n.item.output?3:-1)}}function c2(t,e){if(t&1){let n=$();y(0,"button",10),A("click",function(){D(n);let o=m().$implicit,r=m(2);return M(r.toggleStep(o.key))}),y(1,"span",11),w(2,KR,1,0,"span",4)(3,ZR,2,0,"span",12)(4,QR,2,0,"span",13),b(),y(5,"span",14),u(6),b(),y(7,"span",15),u(8),b(),y(9,"span",16),u(10),b(),w(11,e2,3,2,"span",17),ve(12,"span",18),w(13,t2,4,0,"span",5),w(14,n2,2,1,"span",19),y(15,"span",6),u(16,"\u203A"),b()(),w(17,i2,7,2,"ul",20),w(18,a2,4,4,"div",21)}if(t&2){let n,i,o,r=m().$implicit,s=m(2);J("aria-expanded",s.isStepOpen(r.key)),d(),Tn(r.item.status),d(),S(r.item.status==="running"?2:r.item.status==="error"?3:4),d(3),Tn(s.glyphClass(r.item)),d(),k(s.glyph(r.item)),d(2),k(s.verb(r.item)),d(),q("title",r.item.title),d(),k(s.compactTarget(r.item)),d(),S((n=s.diff(r.item))?11:-1,n),d(2),S(r.item.status==="running"?13:-1),d(),S((i=s.elapsed(r.item))?14:-1,i),d(),X("open",s.isStepOpen(r.key)),d(2),S((o=s.fileOf(r.item))?17:-1,o),d(),S(s.isStepOpen(r.key)?18:-1)}}function l2(t,e){if(t&1&&(y(0,"div",21)(1,"pre"),u(2),b()()),t&2){let n=m(2).$implicit;J("data-body",n.key),d(2),k(n.item.thinking)}}function d2(t,e){if(t&1){let n=$();y(0,"button",10),A("click",function(){D(n);let o=m().$implicit,r=m(2);return M(r.toggleStep(o.key))}),y(1,"span",30),u(2,"\u273B"),b(),y(3,"span",15),u(4,"Thinking"),b(),y(5,"span",31),u(6),b(),ve(7,"span",18),y(8,"span",6),u(9,"\u203A"),b()(),w(10,l2,3,2,"div",21)}if(t&2){let n=m().$implicit,i=m(2);J("aria-expanded",i.isStepOpen(n.key)),d(),X("live",i.isThoughtLive(n.key)),d(5),k(i.preview(n.item.thinking)),d(2),X("open",i.isStepOpen(n.key)),d(2),S(i.isStepOpen(n.key)?10:-1)}}function u2(t,e){if(t&1&&(y(0,"li",9),w(1,c2,19,17)(2,d2,11,7),b()),t&2){let n=e.$implicit;d(),S(n.kind==="tool"?1:2)}}function p2(t,e){if(t&1&&(y(0,"ul",7),oe(1,u2,3,1,"li",9,gE),b()),t&2){let n=m();d(),re(n.compactSteps())}}function f2(t,e){t&1&&ve(0,"span",4)}function m2(t,e){t&1&&(y(0,"span",12),u(1,"\u2717"),b())}function h2(t,e){t&1&&(y(0,"span",13),u(1,"\u2713"),b())}function g2(t,e){if(t&1&&(y(0,"span",22),u(1),b()),t&2){let n=m();d(),ae("+",n.added)}}function y2(t,e){if(t&1&&(y(0,"span",23),u(1),b()),t&2){let n=m();d(),ae("\u2212",n.removed)}}function _2(t,e){if(t&1&&(y(0,"span",17),w(1,g2,2,1,"span",22),w(2,y2,2,1,"span",23),b()),t&2){let n=e;d(),S(n.added>0?1:-1),d(),S(n.removed>0?2:-1)}}function v2(t,e){t&1&&(y(0,"span",5),ve(1,"i")(2,"i")(3,"i"),b())}function b2(t,e){t&1&&(y(0,"span",19),u(1),b()),t&2&&(d(),k(e))}function x2(t,e){if(t&1&&(y(0,"span",29),u(1,"input"),b(),y(2,"pre"),u(3),b()),t&2){let n=m(3).$implicit;d(3),k(n.item.input)}}function C2(t,e){if(t&1&&(y(0,"span",29),u(1,"output"),b(),y(2,"pre"),u(3),b()),t&2){let n=m(3).$implicit;d(3),k(n.item.output)}}function E2(t,e){t&1&&(y(0,"span",29),u(1,"no details reported"),b())}function w2(t,e){if(t&1&&(y(0,"div",21),w(1,x2,4,1),w(2,C2,4,1),w(3,E2,2,0,"span",29),b()),t&2){let n=m(2).$implicit;J("data-body",n.key),d(),S(n.item.input?1:-1),d(),S(n.item.output?2:-1),d(),S(!n.item.input&&!n.item.output?3:-1)}}function S2(t,e){if(t&1){let n=$();y(0,"div",35)(1,"button",36),A("click",function(){D(n);let o=m().$implicit,r=m(2);return M(r.toggleStep(o.key))}),y(2,"span",11),w(3,f2,1,0,"span",4)(4,m2,2,0,"span",12)(5,h2,2,0,"span",13),b(),y(6,"span",14),u(7),b(),y(8,"span",37),u(9),b(),y(10,"span",38)(11,"span",39),u(12),b(),y(13,"span",40),u(14),b()(),w(15,_2,3,2,"span",17),ve(16,"span",18),w(17,v2,4,0,"span",5),w(18,b2,2,1,"span",19),y(19,"span",6),u(20,"\u203A"),b()(),w(21,w2,4,4,"div",21),b()}if(t&2){let n,i,o=m().$implicit,r=m(2);X("running",o.item.status==="running")("failed",o.item.status==="error"),d(),J("aria-expanded",r.isStepOpen(o.key)),d(),Tn(o.item.status),d(),S(o.item.status==="running"?3:o.item.status==="error"?4:5),d(3),Tn(r.glyphClass(o.item)),d(),k(r.glyph(o.item)),d(2),k(o.item.name),d(),q("title",o.item.title),d(2),k(r.target(o.item).dir),d(2),k(r.target(o.item).base),d(),S((n=r.diff(o.item))?15:-1,n),d(2),S(o.item.status==="running"?17:-1),d(),S((i=r.elapsed(o.item))?18:-1,i),d(),X("open",r.isStepOpen(o.key)),d(2),S(r.isStepOpen(o.key)?21:-1)}}function T2(t,e){if(t&1&&(y(0,"div",21)(1,"pre"),u(2),b()()),t&2){let n=m(2).$implicit;J("data-body",n.key),d(2),k(n.item.thinking)}}function D2(t,e){if(t&1){let n=$();y(0,"div",34)(1,"button",36),A("click",function(){D(n);let o=m().$implicit,r=m(2);return M(r.toggleStep(o.key))}),y(2,"span",11)(3,"span",41),u(4,"\u273B"),b()(),y(5,"span",42),u(6,"thinking"),b(),y(7,"span",43),u(8),b(),y(9,"span",6),u(10,"\u203A"),b()(),w(11,T2,3,2,"div",21),b()}if(t&2){let n=m().$implicit,i=m(2);d(),J("aria-expanded",i.isStepOpen(n.key)),d(2),X("live",i.isThoughtLive(n.key)),d(5),k(i.preview(n.item.thinking)),d(),X("open",i.isStepOpen(n.key)),d(2),S(i.isStepOpen(n.key)?11:-1)}}function M2(t,e){if(t&1&&(y(0,"li",32),w(1,S2,22,21,"div",33)(2,D2,12,7,"div",34),b()),t&2){let n,i=e.$implicit,o=e.$index;q("morseEnter",o)("morseEnterY",6),d(),S((n=i.kind)==="tool"?1:n==="thinking"?2:-1)}}function k2(t,e){if(t&1&&(y(0,"ul",8,0),oe(2,M2,3,3,"li",32,gE),b()),t&2){let n=m();d(2),re(n.steps())}}var _u=class t{steps=te.required();working=te(!1);animation=N(ln);display=N(Ro);host=N(Bt);list=Xe("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());liveThoughtKeys=E(()=>{let e=new Set;for(let n of this.steps())n.kind==="thinking"&&n.item.streaming&&n.item.text.trim().length===0&&e.add(n.key);return e});state=E(()=>this.running()?"running":this.failed()?"error":"ok");summary=E(()=>{let e=this.tools().length,n=this.thoughts(),i=e===1?"action":"actions",o=n>0?` \xB7 ${n} ${n===1?"thought":"thoughts"}`:"",r=this.totalMs();return this.running()?r>0?`Working for ${yu(r)} \xB7 ${e} ${i}${o}`:`Working\u2026 \xB7 ${e} ${i}${o}`:r>0?`Worked for ${yu(r)} \xB7 ${e} ${i}${o}`:`${e} ${i}${o}`});constructor(){se(n=>{if(!this.running())return;let i=setInterval(()=>this.tick.update(o=>o+1),500);n(()=>clearInterval(i))}),se(()=>{this.autoOpen(),this.override.set(null)}),se(n=>{let i=this.liveThoughtKeys();if(i.size===0)return;let o=setTimeout(()=>{let r=Array.from(this.host.nativeElement.querySelectorAll("[data-body]"));for(let s of r){if(!i.has(s.dataset.body??""))continue;let a=s.querySelector("pre");a&&(a.scrollTop=a.scrollHeight)}},0);n(()=>clearTimeout(o))});let e=!1;se(n=>{let i=this.isOpen(),o=e;e=!0;let r=setTimeout(()=>{this.animation.reveal(this.list()?.nativeElement??null,i,{animate:o})},0);n(()=>clearTimeout(r))})}toggle(){this.override.set(!this.isOpen())}toggleStep(e){let n=!this.isStepOpen(e);this.openSteps.update(i=>K(V({},i),{[e]:n})),setTimeout(()=>{let i=this.host.nativeElement.querySelector(`[data-body="${CSS.escape(e)}"]`);i&&this.animation.reveal(i,n,{animate:!0})},0)}isStepOpen(e){return this.openSteps()[e]??this.liveThoughtKeys().has(e)}isThoughtLive(e){return this.liveThoughtKeys().has(e)}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?yu(n):""}return e.durationMs===void 0?"":yu(e.durationMs)}target(e){let n=Rs(e),i=n.lastIndexOf("/");return i===-1?{dir:"",base:n}:{dir:n.slice(0,i+1),base:n.slice(i+1)}}diff(e){let n=`${e.title}
|
|
88
|
-
${e.output??""}`,i=/\+(\d+)\s*[-−](\d+)/.exec(n);if(i)return{added:Number(i[1]),removed:Number(i[2])};let o=/(\d+)\s+insertions?\(\+\)/.exec(n)?.[1],r=/(\d+)\s+deletions?\([-−]\)/.exec(n)?.[1];return o===void 0&&r===void 0?null:{added:Number(o??0),removed:Number(r??0)}}glyphClass(e){let n=uo(e.name);return n==="other"?"read":n}verb(e){return pE(e)}compactTarget(e){if(uo(e.name)!=="shell")return this.target(e).base;let n=Rs(e).replace(/\s+/g," ").trim();return n.length>80?`${n.slice(0,80)}\u2026`:n}fileOf(e){return hE(e)}basename(e){return gu(e)}glyph(e){return mE(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=ue({type:t,selectors:[["morse-tool-group"]],viewQuery:function(n,i){n&1&>(i.list,GR,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,i){n&1&&(y(0,"div",1)(1,"button",2),A("click",function(){return i.toggle()}),y(2,"span",3),w(3,qR,1,0,"span",4)(4,WR,1,1),b(),y(5,"span"),u(6),b(),w(7,YR,4,0,"span",5),y(8,"span",6),u(9,"\u203A"),b()(),w(10,p2,3,0,"ul",7)(11,k2,4,0,"ul",8),b()),n&2&&(X("compact",i.compact()),d(),J("aria-expanded",i.isOpen()),d(),Tn(i.state()),d(),S(i.state()==="running"?3:4),d(3),k(i.summary()),d(),S(i.running()?7:-1),d(),X("open",i.isOpen()),d(2),S(i.compact()?10:11))},dependencies:[un],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)}.glyph.thinking[_ngcontent-%COMP%], .status[_ngcontent-%COMP%] .bulb[_ngcontent-%COMP%]{display:inline-block;transform-origin:center}.glyph.thinking.live[_ngcontent-%COMP%], .status[_ngcontent-%COMP%] .bulb.live[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_think-breathe 1.1s ease-in-out infinite}@keyframes _ngcontent-%COMP%_think-breathe{0%,to{transform:scale(.8);opacity:.6}50%{transform:scale(1.3);opacity:1}}@media(prefers-reduced-motion:reduce){.glyph.thinking.live[_ngcontent-%COMP%], .status[_ngcontent-%COMP%] .bulb.live[_ngcontent-%COMP%]{animation:none}}.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 yu(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 I2=["track"],N2=["previewList"],bE=(t,e)=>e.id;function O2(t,e){if(t&1&&ce(0,"span",10),t&2){let n=e.$implicit,i=e.$index,o=m(2);At("top",i*o.tickPitch,"px")("width",o.tickWidth(i),"px"),X("active",n.id===o.activeId()),J("aria-selected",i===o.hovered())("aria-label",n.preview||"Prompt")}}function P2(t,e){if(t&1){let n=$();h(0,"button",14),F("mouseenter",function(){let o=D(n).$index,r=m(3);return M(r.hovered.set(o))})("click",function(){let o=D(n).$index,r=m(3);return M(r.choose(o))}),h(1,"span",15),u(2),g()()}if(t&2){let n=e.$implicit,i=e.$index,o=m(3);X("active",n.id===o.activeId())("hovered",i===o.hovered()),d(2),k(n.preview||"No text")}}function A2(t,e){if(t&1){let n=$();h(0,"div",11),F("mouseenter",function(){D(n);let o=m(2);return M(o.onEnter())})("mouseleave",function(){D(n);let o=m(2);return M(o.onLeave())}),h(1,"div",12,1),oe(3,P2,3,5,"button",13,bE),g()()}if(t&2){let n=m(2);d(3),re(n.prompts())}}function R2(t,e){if(t&1){let n=$();h(0,"nav",3),F("mouseenter",function(){D(n);let o=m();return M(o.onEnter())}),h(1,"button",4),F("click",function(){D(n);let o=m();return M(o.stepWindow(-1))}),u(2," \u2303 "),g(),h(3,"div",5,0),F("mousemove",function(o){D(n);let r=m();return M(r.onMove(o))})("mouseleave",function(){D(n);let o=m();return M(o.onLeave())})("click",function(o){D(n);let r=m();return M(r.onTrackClick(o))})("keydown",function(o){D(n);let r=m();return M(r.onKeydown(o))}),h(5,"div",6),oe(6,O2,1,8,"span",7,bE),g()(),h(8,"button",8),F("click",function(){D(n);let o=m();return M(o.stepWindow(1))}),u(9," \u2304 "),g(),w(10,A2,5,0,"div",9),g()}if(t&2){let n=m();d(),ie("disabled",!n.hasMoreAbove()),d(2),At("height",n.visibleCount()*n.tickPitch,"px")("mask-image",n.mask()),d(2),At("transform","translateY(-"+n.clampedWindowStart()*n.tickPitch+"px)"),d(),re(n.prompts()),d(2),ie("disabled",!n.hasMoreBelow()),d(2),S(n.hovered()!==null?10:-1)}}var yE=12,_E=30,vE=18,L2=80,F2=10,V2=14,j2=20,$2=[1,.6,.35,.15],B2=160,vu=class t{prompts=te.required();activeId=te(null);pick=at();tickPitch=yE;hovered=O(null);windowStart=O(0);track=Xe("track");previewList=Xe("previewList");pointerY=null;direction=0;carouselTimer=null;hideTimer=null;visibleCount=E(()=>Math.min(this.prompts().length,_E));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,_E),i=Math.max(0,e-n),o=this.activeIndex()>=0?this.activeIndex():e-1;this.windowStart.set(Math.max(0,Math.min(i,o-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()?V2:F2,i=this.hovered();if(i===null)return n;let o=$2[Math.abs(e-i)]??0;return Math.round(n+(j2-n)*o)}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)),i=Math.max(0,Math.min(this.maxWindowStart(),this.clampedWindowStart()+e*n));this.windowStart.set(i)}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 i=this.hovered()??(this.activeIndex()>=0?this.activeIndex():n-1),o=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(),o(i-1);return;case"ArrowDown":e.preventDefault(),o(i+1);return;case"Home":e.preventDefault(),o(0);return;case"End":e.preventDefault(),o(n-1);return;case"Enter":case" ":e.preventDefault(),this.choose(i);return;case"Escape":e.preventDefault(),this.hovered.set(null);return;default:return}}indexFromPointer(e){let n=this.track()?.nativeElement,i=this.visibleCount();if(!n||i===0)return null;let o=n.getBoundingClientRect(),r=Math.floor((e-o.top)/yE),s=Math.max(0,Math.min(i-1,r));return Math.min(this.prompts().length-1,this.clampedWindowStart()+s)}updateCarousel(e){let n=this.track()?.nativeElement;if(!n)return;let i=n.getBoundingClientRect(),o=e-i.top,r=0;if(o<=vE&&this.hasMoreAbove()?r=-1:o>=i.height-vE&&this.hasMoreBelow()&&(r=1),this.direction=r,r===0){this.stopCarousel();return}this.carouselTimer===null&&(this.carouselTimer=setInterval(()=>this.carouselStep(),L2))}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 i=this.indexFromPointer(this.pointerY);i!==null&&this.hovered.set(i)}}stopCarousel(){this.direction=0,this.carouselTimer!==null&&(clearInterval(this.carouselTimer),this.carouselTimer=null)}ensureWindowContains(e){let n=this.visibleCount(),i=this.maxWindowStart(),o=Math.min(this.clampedWindowStart(),i);e<o?this.windowStart.set(e):e>=o+n&&this.windowStart.set(Math.min(i,e-n+1))}scheduleHide(){this.cancelHide(),this.hideTimer=setTimeout(()=>{this.hideTimer=null,this.hovered.set(null)},B2)}cancelHide(){this.hideTimer!==null&&(clearTimeout(this.hideTimer),this.hideTimer=null)}revealRow(e){let n=this.previewList()?.nativeElement,i=n?.children.item(e);if(!n||!i)return;let o=n.getBoundingClientRect(),r=i.getBoundingClientRect();r.top<o.top?n.scrollTop-=o.top-r.top:r.bottom>o.bottom&&(n.scrollTop+=r.bottom-o.bottom)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-prompt-rail"]],viewQuery:function(n,i){n&1&>(i.track,I2,5)(i.previewList,N2,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,i){n&1&&w(0,R2,11,9,"nav",2),n&2&&S(i.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 H2=["scroll"],U2=["inner"],z2=["heroMark"],xE=()=>[],G2=(t,e)=>e.key,q2=(t,e)=>e.path+(e.startLine??"");function W2(t,e){t&1&&(y(0,"span",11),u(1,"Loading older messages\u2026"),b())}function Y2(t,e){if(t&1){let n=$();y(0,"button",13),A("click",function(){D(n);let o=m(2);return M(o.loadOlder())}),u(1," Load older messages "),b()}}function K2(t,e){if(t&1&&(y(0,"div",5),w(1,W2,2,0,"span",11)(2,Y2,2,0,"button",12),b()),t&2){let n=m();d(),S(n.loadingOlderHistory()?1:2)}}function Z2(t,e){t&1&&(y(0,"div",6)(1,"span"),u(2,"Start of conversation"),b()())}function Q2(t,e){if(t&1&&(y(0,"span",31),u(1),b()),t&2){let n=m().$implicit,i=m(4);d(),k(i.pinRange(n))}}function X2(t,e){if(t&1&&(y(0,"li",27)(1,"span",29),u(2,"\u29C9"),b(),y(3,"span",30),u(4),b(),w(5,Q2,2,1,"span",31),b()),t&2){let n=e.$implicit,i=m(4);q("title",n.path),d(4),k(i.basename(n.path)),d(),S(n.startLine!==void 0?5:-1)}}function J2(t,e){if(t&1){let n=$();y(0,"li",28)(1,"button",32),A("click",function(){let o=D(n),r=o.$implicit,s=o.$index,a=m(4);return M(a.openImage(r,s))}),ve(2,"img",33),b()()}if(t&2){let n=e.$implicit,i=e.$index,o=m(4);d(),q("title",o.imageName(n,i)),J("aria-label","View "+o.imageName(n,i)),d(),q("src",o.thumb(n),xi)("alt",o.imageName(n,i))}}function eL(t,e){if(t&1&&(y(0,"ul",19),oe(1,X2,6,3,"li",27,q2),oe(3,J2,3,4,"li",28,Ci),b()),t&2){let n=m(2).$implicit;d(),re(n.item.pins??td(0,xE)),d(2),re(n.item.images??td(1,xE))}}function tL(t,e){if(t&1){let n=$();y(0,"div",20)(1,"textarea",34),A("input",function(o){D(n);let r=m(3);return M(r.onEditInput(o))})("keydown",function(o){D(n);let r=m(2).$implicit,s=m();return M(s.onEditKeydown(o,r.item))}),b(),y(2,"div",35)(3,"span",36),u(4,"Enter sends \xB7 Shift+Enter for a new line"),b(),y(5,"button",37),A("click",function(){D(n);let o=m(3);return M(o.cancelEdit())}),u(6,"Cancel"),b(),y(7,"button",38),A("click",function(){D(n);let o=m(2).$implicit,r=m();return M(r.submitEdit(o.item))}),u(8," Send "),b()()()}if(t&2){let n=m(3);d(),q("value",n.editingText()),d(6),q("disabled",n.editingText().trim().length===0)}}function nL(t,e){if(t&1){let n=$();y(0,"div",21)(1,"morse-markdown",39),A("mention",function(o){D(n);let r=m(3);return M(r.openMention(o))}),b()()}if(t&2){let n=m(2).$implicit,i=m();d(),q("text",i.userMarkdown(n.item))}}function iL(t,e){if(t&1){let n=$();y(0,"button",40),A("click",function(){D(n);let o=m(2).$implicit,r=m();return M(r.startEdit(o.item))}),u(1," \u270E "),b()}}function oL(t,e){if(t&1){let n=$();y(0,"button",41),A("click",function(){D(n);let o=m(2).$implicit,r=m();return M(r.fork(o.item))}),rt(),y(1,"svg",42),ve(2,"path",43),b()()}}function rL(t,e){if(t&1){let n=$();y(0,"div",14),w(1,eL,5,2,"ul",19),w(2,tL,9,2,"div",20)(3,nL,2,1,"div",21),y(4,"div",22)(5,"span",23),u(6),b(),w(7,iL,2,0,"button",24),w(8,oL,3,0,"button",25),y(9,"button",26),A("click",function(){D(n);let o=m().$implicit,r=m();return M(r.copy(o.item))}),u(10),b()()()}if(t&2){let n=m().$implicit,i=m();q("morseEnter",0),J("data-prompt-id",n.item.id),d(),S(i.pinsOf(n.item)!==void 0||n.item.images!==void 0?1:-1),d(),S(i.editingId()===n.item.id?2:3),d(4),k(i.stamp(n.item.at)),d(),S(i.canEdit()?7:-1),d(),S(i.canFork()?8:-1),d(),q("title",i.copiedId()===n.item.id?"Copied":"Copy message"),d(),ae(" ",i.copiedId()===n.item.id?"\u2713":"\u29C9"," ")}}function sL(t,e){if(t&1){let n=$();ve(0,"morse-markdown",45),y(1,"div",46)(2,"button",26),A("click",function(){D(n);let o=m(2).$implicit,r=m();return M(r.copyAssistant(o.item))}),u(3),b()()}if(t&2){let n=m(2).$implicit,i=m();q("text",n.item.text),d(2),X("revealed",i.copiedId()===n.item.id),q("title",i.copiedId()===n.item.id?"Copied":"Copy response"),d(),ae(" ",i.copiedId()===n.item.id?"\u2713 Copied":"\u29C9 Copy"," ")}}function aL(t,e){t&1&&(y(0,"span",44),u(1,"\xA0"),b())}function cL(t,e){if(t&1&&(y(0,"div",15),w(1,sL,4,5)(2,aL,2,0,"span",44),b()),t&2){let n=m().$implicit;q("morseEnter",0),d(),S(n.item.text?1:n.item.streaming?2:-1)}}function lL(t,e){if(t&1&&ve(0,"morse-tool-group",16),t&2){let n=m().$implicit,i=m();q("morseEnter",0)("steps",n.steps)("working",i.working()&&n.key===i.activeProcess())}}function dL(t,e){if(t&1&&(y(0,"div",47)(1,"pre"),u(2),b()()),t&2){let n=m().$implicit;Tn(n.item.level),q("morseEnter",0),d(2),k(n.item.text)}}function uL(t,e){if(t&1&&(y(0,"span",51),u(1),b()),t&2){let n=m(2).$implicit,i=m();d(),ae("~",i.formatTokens(n.item.tokensBefore)," tokens folded")}}function pL(t,e){if(t&1&&(y(0,"div",52),ve(1,"morse-markdown",45),b()),t&2){let n=m(2).$implicit;q("morseEnter",0),d(),q("text",n.item.summary)}}function fL(t,e){if(t&1){let n=$();y(0,"div",18)(1,"button",48),A("click",function(){D(n);let o=m().$implicit,r=m();return M(r.toggleCompaction(o.key))}),ve(2,"span",49),y(3,"span",50),u(4,"\u26A1 Compacted"),b(),w(5,uL,2,1,"span",51),ve(6,"span",49),b(),w(7,pL,2,2,"div",52),b()}if(t&2){let n=m().$implicit,i=m();q("morseEnter",0),d(),q("title",n.item.summary?i.expandedCompaction()===n.key?"Hide the summary":"Show the summary":"Everything before this point was summarized into the running context"),d(4),S(n.item.tokensBefore?5:-1),d(2),S(i.expandedCompaction()===n.key&&n.item.summary?7:-1)}}function mL(t,e){if(t&1&&w(0,rL,11,9,"div",14)(1,cL,3,2,"div",15)(2,lL,1,3,"morse-tool-group",16)(3,dL,3,4,"div",17)(4,fL,8,4,"div",18),t&2){let n,i=e.$implicit;S((n=i.kind)==="user"?0:n==="assistant"?1:n==="process"?2:n==="notice"?3:n==="compaction"?4:-1)}}function hL(t,e){if(t&1&&(y(0,"span",59),u(1),b()),t&2){let n=e.$implicit;d(),k(n)}}function gL(t,e){t&1&&(u(0,", or select code and pin it with the "),y(1,"span",63),u(2,"\u29C9"),b(),u(3," button under the chat"))}function yL(t,e){if(t&1&&(y(0,"div",7)(1,"div",53),ve(2,"span",54),y(3,"span",55,2),ve(5,"span",56)(6,"span",56)(7,"span",57),b()(),y(8,"div",58),oe(9,hL,2,1,"span",59,Ci),b(),y(11,"div",60),u(12,"the pi coding agent"),b(),y(13,"p",61),u(14," It runs the same pi coding agent you use in the terminal, with your models, tools, skills and sessions. "),b(),y(15,"p",62),u(16," Try "),y(17,"em"),u(18,"\u201Cexplain this repository\u201D"),b(),u(19," or "),y(20,"em"),u(21,"\u201Cwhy is this failing?\u201D"),b(),w(22,gL,4,0),u(23,". "),b()()),t&2){let n=m();d(9),re(n.heroLetters),d(13),S(n.canPinSelection()?22:-1)}}function _L(t,e){if(t&1){let n=$();y(0,"button",64),A("click",function(){D(n);let o=m();return M(o.jumpToLatest())}),u(1,"\u2193 Latest"),b()}}function vL(t,e){if(t&1){let n=$();y(0,"div",65),A("click",function(){D(n);let o=m();return M(o.closeImage())}),y(1,"button",66),A("click",function(){D(n);let o=m();return M(o.closeImage())}),u(2," \xD7 "),b(),y(3,"figure",67),A("click",function(o){return o.stopPropagation()}),ve(4,"img",33),y(5,"figcaption"),u(6),b()()()}if(t&2){let n=e;d(4),q("src",n.src,xi)("alt",n.label),d(2),k(n.label)}}var bL={png:"png",jpeg:"jpg",jpg:"jpg",webp:"webp",gif:"gif","svg+xml":"svg",bmp:"bmp",avif:"avif"},CE=160;function xL(t){let e=t.replace(/\s+/g," ").trim();return e.length>CE?`${e.slice(0,CE)}\u2026`:e}var bu=class t{morse=N(Ze);animation=N(ln);handoff=N(Es);scrollHost=Xe.required("scroll");inner=Xe("inner");heroMark=Xe("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(()=>_C(this.morse.items()));activeProcess=E(()=>vC(this.rows()));railPrompts=E(()=>this.rows().filter(e=>e.kind==="user").map(e=>({id:e.item.id,preview:xL(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 i=new ResizeObserver(()=>{this.pinned()&&this.afterRender(()=>this.scrollToBottom())});i.observe(n),e(()=>i.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 i=n.getBoundingClientRect();this.handoff.aim({x:i.left+i.width/2,y:i.top+i.height/2,width:i.width,height:i.height})})}),se(()=>{this.railPrompts(),this.afterRender(()=>this.updateActivePrompt())}),se(()=>{let e=this.morse.state().sessionId,n=this.morse.items(),i=n[0]?.id,o=e===this.previousSessionId&&this.previousFirstId!==void 0&&i!==this.previousFirstId&&n.length>this.previousLength;this.previousSessionId=e,this.previousFirstId=i,this.previousLength=n.length,o&&this.afterRender(()=>this.restoreBottomDistance())})}afterRender(e){setTimeout(e,0)}onScroll(e){let n=e.target,i=n.scrollHeight-n.scrollTop-n.clientHeight;this.pinned.set(i<48),this.bottomDistance=i,this.anchorScroll=i>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),i=e.scrollHeight-e.clientHeight-this.bottomDistance;e.scrollTop=Math.max(0,Math.min(n,i))}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 i=e.getBoundingClientRect().top+100,o=n[0]?.dataset.promptId??null;for(let s of Array.from(n))if(s.getBoundingClientRect().top<=i)o=s.dataset.promptId??o;else break;e.scrollHeight-e.scrollTop-e.clientHeight<=Math.max(48,e.clientHeight*.1)&&(o=n[n.length-1]?.dataset.promptId??o),this.activePromptId.set(o)}scrollToPrompt(e){let n=this.scrollHost().nativeElement,i=n.querySelector(`[data-prompt-id="${e}"]`);if(!i)return;let o=i.getBoundingClientRect().top-n.getBoundingClientRect().top+n.scrollTop-12;this.pinned.set(!1),this.animation.isEnabled&&typeof n.scrollTo=="function"?n.scrollTo({top:o,behavior:"smooth"}):n.scrollTop=o,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 bC(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 i=e.mimeType.split("/")[1]?.toLowerCase()??"",o=bL[i]??(i.replace(/[^a-z0-9]/g,"")||"png");return n===0?`image.${o}`:`image-${n+1}.${o}`}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 i=n?.value.length??0;n?.setSelectionRange(i,i)})}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 i=n.map(o=>`${o.path}${o.startLine!==void 0?`:${o.startLine}-${o.endLine??o.startLine}`:""}`).map(o=>`@${o}`).join(`
|
|
87
|
+
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+Wn(n.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(n);throw n}}},Or=new mu;function wt(t,e){return Or.parse(t,e)}wt.options=wt.setOptions=function(t){return Or.setOptions(t),wt.defaults=Or.defaults,QC(wt.defaults),wt};wt.getDefaults=Wh;wt.defaults=Pr;function $R(...t){return Or.use(...t),wt.defaults=Or.defaults,QC(wt.defaults),wt}wt.use=$R;wt.walkTokens=function(t,e){return Or.walkTokens(t,e)};wt.parseInline=Or.parseInline;wt.Parser=Si;wt.parser=Si.parse;wt.Renderer=fu;wt.TextRenderer=eg;wt.Lexer=wi;wt.lexer=wi.lex;wt.Tokenizer=pu;wt.Hooks=cc;wt.parse=wt;var nX=wt.options,iX=wt.setOptions,oX=wt.walkTokens,rX=wt.parseInline;var sX=Si.parse,aX=wi.lex;function sE(){return{code({text:t,lang:e}){let{html:n,language:i}=Is(t,e??void 0);return`<div class="code"><div class="code-head"><span class="code-lang">${i}</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 i=this.parser.parseInline(n),o=t.replace(/"/g,"""),r=e?` title="${e.replace(/"/g,""")}"`:"";return`<a href="${o}"${r} target="_blank" rel="noreferrer noopener">${i}</a>`}}}var aE=new mu({gfm:!0,breaks:!1});aE.use({renderer:sE()});var cE=new mu({gfm:!0,breaks:!0});cE.use({renderer:sE()});var BR=new Map,HR=new Map,UR=200;function zR(t){return $C.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 lE(t,e,n){let i=t.get(n);if(i!==void 0)return i;let o=zR(e.parse(n,{async:!1}));if(t.size>=UR){let r=t.keys().next().value;r!==void 0&&t.delete(r)}return t.set(n,o),o}function dE(t){return lE(BR,aE,t)}function uE(t){return lE(HR,cE,t)}var GR=90,hu=class t{text=te.required();variant=te("assistant");mention=it();sanitizer=N(Fa);painted=O(null);pending;timer;html=E(()=>{let e=this.painted()??this.text();return this.sanitizer.bypassSecurityTrustHtml(this.variant()==="user"?uE(e):dE(e))});constructor(){se(()=>{let e=this.text(),n=ii(()=>this.painted());if(n===null){this.painted.set(e);return}n===e||this.pending===e||(this.pending=e,this.schedule())}),N(pt).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)},GR)}cancel(){clearTimeout(this.timer),this.timer=void 0}onClick(e){let n=e.target,i=n?.closest("[data-mention-path]")?.getAttribute("data-mention-path");if(i){this.mention.emit(i);return}let o=n?.closest("button[data-copy]");if(!(o instanceof HTMLButtonElement))return;let s=o.closest(".code")?.querySelector("code")?.textContent??"";navigator.clipboard?.writeText(s);let a=o.textContent;o.textContent="Copied",setTimeout(()=>{o.textContent=a??"Copy"},1200)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({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,i){n&1&&(h(0,"div",0),F("click",function(r){return i.onClick(r)}),g()),n&2&&ie("innerHTML",i.html(),Eo)},styles:["[_nghost-%COMP%]{display:block}"]})};function uo(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 pE(t){switch(uo(t.name)){case"edit":return"Edit";case"read":return"Read";case"search":return"Search";case"shell":return"Run";default:return t.name}}function fE(t){switch(uo(t.name)){case"edit":return"Editing";case"read":return"Reading";case"search":return"Searching";case"shell":return"Running";default:return t.name}}function mE(t){switch(uo(t.name)){case"edit":return"\u270E";case"search":return"\u2315";case"shell":return"\u276F";default:return"\u2630"}}function Rs(t){return t.title.startsWith(`${t.name}: `)?t.title.slice(t.name.length+2):t.title}function gu(t){let e=t.replace(/[\\/]+$/,""),n=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return n===-1?e:e.slice(n+1)}function hE(t){if(uo(t.name)!=="edit")return null;let e=Rs(t);return e.length>0&&e!==t.name?e:null}var qR=["list"],gE=(t,e)=>e.key;function WR(t,e){t&1&&ve(0,"span",4)}function YR(t,e){if(t&1&&u(0),t&2){let n=m();ae(" ",n.state()==="error"?"\u2717":"\u2713"," ")}}function KR(t,e){t&1&&(y(0,"span",5),ve(1,"i")(2,"i")(3,"i"),b())}function ZR(t,e){t&1&&ve(0,"span",4)}function QR(t,e){t&1&&(y(0,"span",12),u(1,"\u2717"),b())}function XR(t,e){t&1&&(y(0,"span",13),u(1,"\u2713"),b())}function JR(t,e){if(t&1&&(y(0,"span",22),u(1),b()),t&2){let n=m();d(),ae("+",n.added)}}function e2(t,e){if(t&1&&(y(0,"span",23),u(1),b()),t&2){let n=m();d(),ae("\u2212",n.removed)}}function t2(t,e){if(t&1&&(y(0,"span",17),w(1,JR,2,1,"span",22),w(2,e2,2,1,"span",23),b()),t&2){let n=e;d(),S(n.added>0?1:-1),d(),S(n.removed>0?2:-1)}}function n2(t,e){t&1&&(y(0,"span",5),ve(1,"i")(2,"i")(3,"i"),b())}function i2(t,e){t&1&&(y(0,"span",19),u(1),b()),t&2&&(d(),k(e))}function o2(t,e){if(t&1&&(y(0,"ul",20)(1,"li",24),st(),y(2,"svg",25),ve(3,"path",26)(4,"path",27),b(),Jt(),y(5,"span",28),u(6),b()()()),t&2){let n=e,i=m(4);d(5),q("title",n),d(),k(i.basename(n))}}function r2(t,e){if(t&1&&(y(0,"span",29),u(1,"input"),b(),y(2,"pre"),u(3),b()),t&2){let n=m(3).$implicit;d(3),k(n.item.input)}}function s2(t,e){if(t&1&&(y(0,"span",29),u(1,"output"),b(),y(2,"pre"),u(3),b()),t&2){let n=m(3).$implicit;d(3),k(n.item.output)}}function a2(t,e){t&1&&(y(0,"span",29),u(1,"no details reported"),b())}function c2(t,e){if(t&1&&(y(0,"div",21),w(1,r2,4,1),w(2,s2,4,1),w(3,a2,2,0,"span",29),b()),t&2){let n=m(2).$implicit;J("data-body",n.key),d(),S(n.item.input?1:-1),d(),S(n.item.output?2:-1),d(),S(!n.item.input&&!n.item.output?3:-1)}}function l2(t,e){if(t&1){let n=$();y(0,"button",10),A("click",function(){D(n);let o=m().$implicit,r=m(2);return M(r.toggleStep(o.key))}),y(1,"span",11),w(2,ZR,1,0,"span",4)(3,QR,2,0,"span",12)(4,XR,2,0,"span",13),b(),y(5,"span",14),u(6),b(),y(7,"span",15),u(8),b(),y(9,"span",16),u(10),b(),w(11,t2,3,2,"span",17),ve(12,"span",18),w(13,n2,4,0,"span",5),w(14,i2,2,1,"span",19),y(15,"span",6),u(16,"\u203A"),b()(),w(17,o2,7,2,"ul",20),w(18,c2,4,4,"div",21)}if(t&2){let n,i,o,r=m().$implicit,s=m(2);J("aria-expanded",s.isStepOpen(r.key)),d(),Tn(r.item.status),d(),S(r.item.status==="running"?2:r.item.status==="error"?3:4),d(3),Tn(s.glyphClass(r.item)),d(),k(s.glyph(r.item)),d(2),k(s.verb(r.item)),d(),q("title",r.item.title),d(),k(s.compactTarget(r.item)),d(),S((n=s.diff(r.item))?11:-1,n),d(2),S(r.item.status==="running"?13:-1),d(),S((i=s.elapsed(r.item))?14:-1,i),d(),X("open",s.isStepOpen(r.key)),d(2),S((o=s.fileOf(r.item))?17:-1,o),d(),S(s.isStepOpen(r.key)?18:-1)}}function d2(t,e){if(t&1&&(y(0,"div",21)(1,"pre"),u(2),b()()),t&2){let n=m(2).$implicit;J("data-body",n.key),d(2),k(n.item.thinking)}}function u2(t,e){if(t&1){let n=$();y(0,"button",10),A("click",function(){D(n);let o=m().$implicit,r=m(2);return M(r.toggleStep(o.key))}),y(1,"span",30),u(2,"\u273B"),b(),y(3,"span",15),u(4,"Thinking"),b(),y(5,"span",31),u(6),b(),ve(7,"span",18),y(8,"span",6),u(9,"\u203A"),b()(),w(10,d2,3,2,"div",21)}if(t&2){let n=m().$implicit,i=m(2);J("aria-expanded",i.isStepOpen(n.key)),d(),X("live",i.isThoughtLive(n.key)),d(5),k(i.preview(n.item.thinking)),d(2),X("open",i.isStepOpen(n.key)),d(2),S(i.isStepOpen(n.key)?10:-1)}}function p2(t,e){if(t&1&&(y(0,"li",9),w(1,l2,19,17)(2,u2,11,7),b()),t&2){let n=e.$implicit;d(),S(n.kind==="tool"?1:2)}}function f2(t,e){if(t&1&&(y(0,"ul",7),oe(1,p2,3,1,"li",9,gE),b()),t&2){let n=m();d(),re(n.compactSteps())}}function m2(t,e){t&1&&ve(0,"span",4)}function h2(t,e){t&1&&(y(0,"span",12),u(1,"\u2717"),b())}function g2(t,e){t&1&&(y(0,"span",13),u(1,"\u2713"),b())}function y2(t,e){if(t&1&&(y(0,"span",22),u(1),b()),t&2){let n=m();d(),ae("+",n.added)}}function _2(t,e){if(t&1&&(y(0,"span",23),u(1),b()),t&2){let n=m();d(),ae("\u2212",n.removed)}}function v2(t,e){if(t&1&&(y(0,"span",17),w(1,y2,2,1,"span",22),w(2,_2,2,1,"span",23),b()),t&2){let n=e;d(),S(n.added>0?1:-1),d(),S(n.removed>0?2:-1)}}function b2(t,e){t&1&&(y(0,"span",5),ve(1,"i")(2,"i")(3,"i"),b())}function x2(t,e){t&1&&(y(0,"span",19),u(1),b()),t&2&&(d(),k(e))}function C2(t,e){if(t&1&&(y(0,"span",29),u(1,"input"),b(),y(2,"pre"),u(3),b()),t&2){let n=m(3).$implicit;d(3),k(n.item.input)}}function E2(t,e){if(t&1&&(y(0,"span",29),u(1,"output"),b(),y(2,"pre"),u(3),b()),t&2){let n=m(3).$implicit;d(3),k(n.item.output)}}function w2(t,e){t&1&&(y(0,"span",29),u(1,"no details reported"),b())}function S2(t,e){if(t&1&&(y(0,"div",21),w(1,C2,4,1),w(2,E2,4,1),w(3,w2,2,0,"span",29),b()),t&2){let n=m(2).$implicit;J("data-body",n.key),d(),S(n.item.input?1:-1),d(),S(n.item.output?2:-1),d(),S(!n.item.input&&!n.item.output?3:-1)}}function T2(t,e){if(t&1){let n=$();y(0,"div",35)(1,"button",36),A("click",function(){D(n);let o=m().$implicit,r=m(2);return M(r.toggleStep(o.key))}),y(2,"span",11),w(3,m2,1,0,"span",4)(4,h2,2,0,"span",12)(5,g2,2,0,"span",13),b(),y(6,"span",14),u(7),b(),y(8,"span",37),u(9),b(),y(10,"span",38)(11,"span",39),u(12),b(),y(13,"span",40),u(14),b()(),w(15,v2,3,2,"span",17),ve(16,"span",18),w(17,b2,4,0,"span",5),w(18,x2,2,1,"span",19),y(19,"span",6),u(20,"\u203A"),b()(),w(21,S2,4,4,"div",21),b()}if(t&2){let n,i,o=m().$implicit,r=m(2);X("running",o.item.status==="running")("failed",o.item.status==="error"),d(),J("aria-expanded",r.isStepOpen(o.key)),d(),Tn(o.item.status),d(),S(o.item.status==="running"?3:o.item.status==="error"?4:5),d(3),Tn(r.glyphClass(o.item)),d(),k(r.glyph(o.item)),d(2),k(o.item.name),d(),q("title",o.item.title),d(2),k(r.target(o.item).dir),d(2),k(r.target(o.item).base),d(),S((n=r.diff(o.item))?15:-1,n),d(2),S(o.item.status==="running"?17:-1),d(),S((i=r.elapsed(o.item))?18:-1,i),d(),X("open",r.isStepOpen(o.key)),d(2),S(r.isStepOpen(o.key)?21:-1)}}function D2(t,e){if(t&1&&(y(0,"div",21)(1,"pre"),u(2),b()()),t&2){let n=m(2).$implicit;J("data-body",n.key),d(2),k(n.item.thinking)}}function M2(t,e){if(t&1){let n=$();y(0,"div",34)(1,"button",36),A("click",function(){D(n);let o=m().$implicit,r=m(2);return M(r.toggleStep(o.key))}),y(2,"span",11)(3,"span",41),u(4,"\u273B"),b()(),y(5,"span",42),u(6,"thinking"),b(),y(7,"span",43),u(8),b(),y(9,"span",6),u(10,"\u203A"),b()(),w(11,D2,3,2,"div",21),b()}if(t&2){let n=m().$implicit,i=m(2);d(),J("aria-expanded",i.isStepOpen(n.key)),d(2),X("live",i.isThoughtLive(n.key)),d(5),k(i.preview(n.item.thinking)),d(),X("open",i.isStepOpen(n.key)),d(2),S(i.isStepOpen(n.key)?11:-1)}}function k2(t,e){if(t&1&&(y(0,"li",32),w(1,T2,22,21,"div",33)(2,M2,12,7,"div",34),b()),t&2){let n,i=e.$implicit,o=e.$index;q("morseEnter",o)("morseEnterY",6),d(),S((n=i.kind)==="tool"?1:n==="thinking"?2:-1)}}function I2(t,e){if(t&1&&(y(0,"ul",8,0),oe(2,k2,3,3,"li",32,gE),b()),t&2){let n=m();d(2),re(n.steps())}}var _u=class t{steps=te.required();working=te(!1);animation=N(ln);display=N(Ro);host=N(Bt);list=Xe("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());liveThoughtKeys=E(()=>{let e=new Set;for(let n of this.steps())n.kind==="thinking"&&n.item.streaming&&n.item.text.trim().length===0&&e.add(n.key);return e});state=E(()=>this.running()?"running":this.failed()?"error":"ok");summary=E(()=>{let e=this.tools().length,n=this.thoughts(),i=e===1?"action":"actions",o=n>0?` \xB7 ${n} ${n===1?"thought":"thoughts"}`:"",r=this.totalMs();return this.running()?r>0?`Working for ${yu(r)} \xB7 ${e} ${i}${o}`:`Working\u2026 \xB7 ${e} ${i}${o}`:r>0?`Worked for ${yu(r)} \xB7 ${e} ${i}${o}`:`${e} ${i}${o}`});constructor(){se(n=>{if(!this.running())return;let i=setInterval(()=>this.tick.update(o=>o+1),500);n(()=>clearInterval(i))}),se(()=>{this.autoOpen(),this.override.set(null)}),se(n=>{let i=this.liveThoughtKeys();if(i.size===0)return;let o=setTimeout(()=>{let r=Array.from(this.host.nativeElement.querySelectorAll("[data-body]"));for(let s of r){if(!i.has(s.dataset.body??""))continue;let a=s.querySelector("pre");a&&(a.scrollTop=a.scrollHeight)}},0);n(()=>clearTimeout(o))});let e=!1;se(n=>{let i=this.isOpen(),o=e;e=!0;let r=setTimeout(()=>{this.animation.reveal(this.list()?.nativeElement??null,i,{animate:o})},0);n(()=>clearTimeout(r))})}toggle(){this.override.set(!this.isOpen())}toggleStep(e){let n=!this.isStepOpen(e);this.openSteps.update(i=>K(V({},i),{[e]:n})),setTimeout(()=>{let i=this.host.nativeElement.querySelector(`[data-body="${CSS.escape(e)}"]`);i&&this.animation.reveal(i,n,{animate:!0})},0)}isStepOpen(e){return this.openSteps()[e]??this.liveThoughtKeys().has(e)}isThoughtLive(e){return this.liveThoughtKeys().has(e)}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?yu(n):""}return e.durationMs===void 0?"":yu(e.durationMs)}target(e){let n=Rs(e),i=n.lastIndexOf("/");return i===-1?{dir:"",base:n}:{dir:n.slice(0,i+1),base:n.slice(i+1)}}diff(e){let n=`${e.title}
|
|
88
|
+
${e.output??""}`,i=/\+(\d+)\s*[-−](\d+)/.exec(n);if(i)return{added:Number(i[1]),removed:Number(i[2])};let o=/(\d+)\s+insertions?\(\+\)/.exec(n)?.[1],r=/(\d+)\s+deletions?\([-−]\)/.exec(n)?.[1];return o===void 0&&r===void 0?null:{added:Number(o??0),removed:Number(r??0)}}glyphClass(e){let n=uo(e.name);return n==="other"?"read":n}verb(e){return pE(e)}compactTarget(e){if(uo(e.name)!=="shell")return this.target(e).base;let n=Rs(e).replace(/\s+/g," ").trim();return n.length>80?`${n.slice(0,80)}\u2026`:n}fileOf(e){return hE(e)}basename(e){return gu(e)}glyph(e){return mE(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=ue({type:t,selectors:[["morse-tool-group"]],viewQuery:function(n,i){n&1&>(i.list,qR,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,i){n&1&&(y(0,"div",1)(1,"button",2),A("click",function(){return i.toggle()}),y(2,"span",3),w(3,WR,1,0,"span",4)(4,YR,1,1),b(),y(5,"span"),u(6),b(),w(7,KR,4,0,"span",5),y(8,"span",6),u(9,"\u203A"),b()(),w(10,f2,3,0,"ul",7)(11,I2,4,0,"ul",8),b()),n&2&&(X("compact",i.compact()),d(),J("aria-expanded",i.isOpen()),d(),Tn(i.state()),d(),S(i.state()==="running"?3:4),d(3),k(i.summary()),d(),S(i.running()?7:-1),d(),X("open",i.isOpen()),d(2),S(i.compact()?10:11))},dependencies:[un],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)}.glyph.thinking[_ngcontent-%COMP%], .status[_ngcontent-%COMP%] .bulb[_ngcontent-%COMP%]{display:inline-block;transform-origin:center}.glyph.thinking.live[_ngcontent-%COMP%], .status[_ngcontent-%COMP%] .bulb.live[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_think-breathe 1.1s ease-in-out infinite}@keyframes _ngcontent-%COMP%_think-breathe{0%,to{transform:scale(.8);opacity:.6}50%{transform:scale(1.3);opacity:1}}@media(prefers-reduced-motion:reduce){.glyph.thinking.live[_ngcontent-%COMP%], .status[_ngcontent-%COMP%] .bulb.live[_ngcontent-%COMP%]{animation:none}}.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 yu(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 N2=["track"],O2=["previewList"],bE=(t,e)=>e.id;function P2(t,e){if(t&1&&ce(0,"span",10),t&2){let n=e.$implicit,i=e.$index,o=m(2);At("top",i*o.tickPitch,"px")("width",o.tickWidth(i),"px"),X("active",n.id===o.activeId()),J("aria-selected",i===o.hovered())("aria-label",n.preview||"Prompt")}}function A2(t,e){if(t&1){let n=$();h(0,"button",14),F("mouseenter",function(){let o=D(n).$index,r=m(3);return M(r.hovered.set(o))})("click",function(){let o=D(n).$index,r=m(3);return M(r.choose(o))}),h(1,"span",15),u(2),g()()}if(t&2){let n=e.$implicit,i=e.$index,o=m(3);X("active",n.id===o.activeId())("hovered",i===o.hovered()),d(2),k(n.preview||"No text")}}function R2(t,e){if(t&1){let n=$();h(0,"div",11),F("mouseenter",function(){D(n);let o=m(2);return M(o.onEnter())})("mouseleave",function(){D(n);let o=m(2);return M(o.onLeave())}),h(1,"div",12,1),oe(3,A2,3,5,"button",13,bE),g()()}if(t&2){let n=m(2);d(3),re(n.prompts())}}function L2(t,e){if(t&1){let n=$();h(0,"nav",3),F("mouseenter",function(){D(n);let o=m();return M(o.onEnter())}),h(1,"button",4),F("click",function(){D(n);let o=m();return M(o.stepWindow(-1))}),u(2," \u2303 "),g(),h(3,"div",5,0),F("mousemove",function(o){D(n);let r=m();return M(r.onMove(o))})("mouseleave",function(){D(n);let o=m();return M(o.onLeave())})("click",function(o){D(n);let r=m();return M(r.onTrackClick(o))})("keydown",function(o){D(n);let r=m();return M(r.onKeydown(o))}),h(5,"div",6),oe(6,P2,1,8,"span",7,bE),g()(),h(8,"button",8),F("click",function(){D(n);let o=m();return M(o.stepWindow(1))}),u(9," \u2304 "),g(),w(10,R2,5,0,"div",9),g()}if(t&2){let n=m();d(),ie("disabled",!n.hasMoreAbove()),d(2),At("height",n.visibleCount()*n.tickPitch,"px")("mask-image",n.mask()),d(2),At("transform","translateY(-"+n.clampedWindowStart()*n.tickPitch+"px)"),d(),re(n.prompts()),d(2),ie("disabled",!n.hasMoreBelow()),d(2),S(n.hovered()!==null?10:-1)}}var yE=12,_E=30,vE=18,F2=80,V2=10,j2=14,$2=20,B2=[1,.6,.35,.15],H2=160,vu=class t{prompts=te.required();activeId=te(null);pick=it();tickPitch=yE;hovered=O(null);windowStart=O(0);track=Xe("track");previewList=Xe("previewList");pointerY=null;direction=0;carouselTimer=null;hideTimer=null;visibleCount=E(()=>Math.min(this.prompts().length,_E));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,_E),i=Math.max(0,e-n),o=this.activeIndex()>=0?this.activeIndex():e-1;this.windowStart.set(Math.max(0,Math.min(i,o-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()?j2:V2,i=this.hovered();if(i===null)return n;let o=B2[Math.abs(e-i)]??0;return Math.round(n+($2-n)*o)}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)),i=Math.max(0,Math.min(this.maxWindowStart(),this.clampedWindowStart()+e*n));this.windowStart.set(i)}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 i=this.hovered()??(this.activeIndex()>=0?this.activeIndex():n-1),o=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(),o(i-1);return;case"ArrowDown":e.preventDefault(),o(i+1);return;case"Home":e.preventDefault(),o(0);return;case"End":e.preventDefault(),o(n-1);return;case"Enter":case" ":e.preventDefault(),this.choose(i);return;case"Escape":e.preventDefault(),this.hovered.set(null);return;default:return}}indexFromPointer(e){let n=this.track()?.nativeElement,i=this.visibleCount();if(!n||i===0)return null;let o=n.getBoundingClientRect(),r=Math.floor((e-o.top)/yE),s=Math.max(0,Math.min(i-1,r));return Math.min(this.prompts().length-1,this.clampedWindowStart()+s)}updateCarousel(e){let n=this.track()?.nativeElement;if(!n)return;let i=n.getBoundingClientRect(),o=e-i.top,r=0;if(o<=vE&&this.hasMoreAbove()?r=-1:o>=i.height-vE&&this.hasMoreBelow()&&(r=1),this.direction=r,r===0){this.stopCarousel();return}this.carouselTimer===null&&(this.carouselTimer=setInterval(()=>this.carouselStep(),F2))}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 i=this.indexFromPointer(this.pointerY);i!==null&&this.hovered.set(i)}}stopCarousel(){this.direction=0,this.carouselTimer!==null&&(clearInterval(this.carouselTimer),this.carouselTimer=null)}ensureWindowContains(e){let n=this.visibleCount(),i=this.maxWindowStart(),o=Math.min(this.clampedWindowStart(),i);e<o?this.windowStart.set(e):e>=o+n&&this.windowStart.set(Math.min(i,e-n+1))}scheduleHide(){this.cancelHide(),this.hideTimer=setTimeout(()=>{this.hideTimer=null,this.hovered.set(null)},H2)}cancelHide(){this.hideTimer!==null&&(clearTimeout(this.hideTimer),this.hideTimer=null)}revealRow(e){let n=this.previewList()?.nativeElement,i=n?.children.item(e);if(!n||!i)return;let o=n.getBoundingClientRect(),r=i.getBoundingClientRect();r.top<o.top?n.scrollTop-=o.top-r.top:r.bottom>o.bottom&&(n.scrollTop+=r.bottom-o.bottom)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-prompt-rail"]],viewQuery:function(n,i){n&1&>(i.track,N2,5)(i.previewList,O2,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,i){n&1&&w(0,L2,11,9,"nav",2),n&2&&S(i.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 U2=["scroll"],z2=["inner"],G2=["heroMark"],xE=()=>[],q2=(t,e)=>e.key,W2=(t,e)=>e.path+(e.startLine??"");function Y2(t,e){t&1&&(y(0,"span",11),u(1,"Loading older messages\u2026"),b())}function K2(t,e){if(t&1){let n=$();y(0,"button",13),A("click",function(){D(n);let o=m(2);return M(o.loadOlder())}),u(1," Load older messages "),b()}}function Z2(t,e){if(t&1&&(y(0,"div",5),w(1,Y2,2,0,"span",11)(2,K2,2,0,"button",12),b()),t&2){let n=m();d(),S(n.loadingOlderHistory()?1:2)}}function Q2(t,e){t&1&&(y(0,"div",6)(1,"span"),u(2,"Start of conversation"),b()())}function X2(t,e){if(t&1&&(y(0,"span",31),u(1),b()),t&2){let n=m().$implicit,i=m(4);d(),k(i.pinRange(n))}}function J2(t,e){if(t&1&&(y(0,"li",27)(1,"span",29),u(2,"\u29C9"),b(),y(3,"span",30),u(4),b(),w(5,X2,2,1,"span",31),b()),t&2){let n=e.$implicit,i=m(4);q("title",n.path),d(4),k(i.basename(n.path)),d(),S(n.startLine!==void 0?5:-1)}}function eL(t,e){if(t&1){let n=$();y(0,"li",28)(1,"button",32),A("click",function(){let o=D(n),r=o.$implicit,s=o.$index,a=m(4);return M(a.openImage(r,s))}),ve(2,"img",33),b()()}if(t&2){let n=e.$implicit,i=e.$index,o=m(4);d(),q("title",o.imageName(n,i)),J("aria-label","View "+o.imageName(n,i)),d(),q("src",o.thumb(n),xi)("alt",o.imageName(n,i))}}function tL(t,e){if(t&1&&(y(0,"ul",19),oe(1,J2,6,3,"li",27,W2),oe(3,eL,3,4,"li",28,Ci),b()),t&2){let n=m(2).$implicit;d(),re(n.item.pins??td(0,xE)),d(2),re(n.item.images??td(1,xE))}}function nL(t,e){if(t&1){let n=$();y(0,"div",20)(1,"textarea",34),A("input",function(o){D(n);let r=m(3);return M(r.onEditInput(o))})("keydown",function(o){D(n);let r=m(2).$implicit,s=m();return M(s.onEditKeydown(o,r.item))}),b(),y(2,"div",35)(3,"span",36),u(4,"Enter sends \xB7 Shift+Enter for a new line"),b(),y(5,"button",37),A("click",function(){D(n);let o=m(3);return M(o.cancelEdit())}),u(6,"Cancel"),b(),y(7,"button",38),A("click",function(){D(n);let o=m(2).$implicit,r=m();return M(r.submitEdit(o.item))}),u(8," Send "),b()()()}if(t&2){let n=m(3);d(),q("value",n.editingText()),d(6),q("disabled",n.editingText().trim().length===0)}}function iL(t,e){if(t&1){let n=$();y(0,"div",21)(1,"morse-markdown",39),A("mention",function(o){D(n);let r=m(3);return M(r.openMention(o))}),b()()}if(t&2){let n=m(2).$implicit,i=m();d(),q("text",i.userMarkdown(n.item))}}function oL(t,e){if(t&1){let n=$();y(0,"button",40),A("click",function(){D(n);let o=m(2).$implicit,r=m();return M(r.startEdit(o.item))}),u(1," \u270E "),b()}}function rL(t,e){if(t&1){let n=$();y(0,"button",41),A("click",function(){D(n);let o=m(2).$implicit,r=m();return M(r.fork(o.item))}),st(),y(1,"svg",42),ve(2,"path",43),b()()}}function sL(t,e){if(t&1){let n=$();y(0,"div",14),w(1,tL,5,2,"ul",19),w(2,nL,9,2,"div",20)(3,iL,2,1,"div",21),y(4,"div",22)(5,"span",23),u(6),b(),w(7,oL,2,0,"button",24),w(8,rL,3,0,"button",25),y(9,"button",26),A("click",function(){D(n);let o=m().$implicit,r=m();return M(r.copy(o.item))}),u(10),b()()()}if(t&2){let n=m().$implicit,i=m();q("morseEnter",0),J("data-prompt-id",n.item.id),d(),S(i.pinsOf(n.item)!==void 0||n.item.images!==void 0?1:-1),d(),S(i.editingId()===n.item.id?2:3),d(4),k(i.stamp(n.item.at)),d(),S(i.canEdit()?7:-1),d(),S(i.canFork()?8:-1),d(),q("title",i.copiedId()===n.item.id?"Copied":"Copy message"),d(),ae(" ",i.copiedId()===n.item.id?"\u2713":"\u29C9"," ")}}function aL(t,e){if(t&1){let n=$();ve(0,"morse-markdown",45),y(1,"div",46)(2,"button",26),A("click",function(){D(n);let o=m(2).$implicit,r=m();return M(r.copyAssistant(o.item))}),u(3),b()()}if(t&2){let n=m(2).$implicit,i=m();q("text",n.item.text),d(2),X("revealed",i.copiedId()===n.item.id),q("title",i.copiedId()===n.item.id?"Copied":"Copy response"),d(),ae(" ",i.copiedId()===n.item.id?"\u2713 Copied":"\u29C9 Copy"," ")}}function cL(t,e){t&1&&(y(0,"span",44),u(1,"\xA0"),b())}function lL(t,e){if(t&1&&(y(0,"div",15),w(1,aL,4,5)(2,cL,2,0,"span",44),b()),t&2){let n=m().$implicit;q("morseEnter",0),d(),S(n.item.text?1:n.item.streaming?2:-1)}}function dL(t,e){if(t&1&&ve(0,"morse-tool-group",16),t&2){let n=m().$implicit,i=m();q("morseEnter",0)("steps",n.steps)("working",i.working()&&n.key===i.activeProcess())}}function uL(t,e){if(t&1&&(y(0,"div",47)(1,"pre"),u(2),b()()),t&2){let n=m().$implicit;Tn(n.item.level),q("morseEnter",0),d(2),k(n.item.text)}}function pL(t,e){if(t&1&&(y(0,"span",51),u(1),b()),t&2){let n=m(2).$implicit,i=m();d(),ae("~",i.formatTokens(n.item.tokensBefore)," tokens folded")}}function fL(t,e){if(t&1&&(y(0,"div",52),ve(1,"morse-markdown",45),b()),t&2){let n=m(2).$implicit;q("morseEnter",0),d(),q("text",n.item.summary)}}function mL(t,e){if(t&1){let n=$();y(0,"div",18)(1,"button",48),A("click",function(){D(n);let o=m().$implicit,r=m();return M(r.toggleCompaction(o.key))}),ve(2,"span",49),y(3,"span",50),u(4,"\u26A1 Compacted"),b(),w(5,pL,2,1,"span",51),ve(6,"span",49),b(),w(7,fL,2,2,"div",52),b()}if(t&2){let n=m().$implicit,i=m();q("morseEnter",0),d(),q("title",n.item.summary?i.expandedCompaction()===n.key?"Hide the summary":"Show the summary":"Everything before this point was summarized into the running context"),d(4),S(n.item.tokensBefore?5:-1),d(2),S(i.expandedCompaction()===n.key&&n.item.summary?7:-1)}}function hL(t,e){if(t&1&&w(0,sL,11,9,"div",14)(1,lL,3,2,"div",15)(2,dL,1,3,"morse-tool-group",16)(3,uL,3,4,"div",17)(4,mL,8,4,"div",18),t&2){let n,i=e.$implicit;S((n=i.kind)==="user"?0:n==="assistant"?1:n==="process"?2:n==="notice"?3:n==="compaction"?4:-1)}}function gL(t,e){if(t&1&&(y(0,"span",59),u(1),b()),t&2){let n=e.$implicit;d(),k(n)}}function yL(t,e){t&1&&(u(0,", or select code and pin it with the "),y(1,"span",63),u(2,"\u29C9"),b(),u(3," button under the chat"))}function _L(t,e){if(t&1&&(y(0,"div",7)(1,"div",53),ve(2,"span",54),y(3,"span",55,2),ve(5,"span",56)(6,"span",56)(7,"span",57),b()(),y(8,"div",58),oe(9,gL,2,1,"span",59,Ci),b(),y(11,"div",60),u(12,"the pi coding agent"),b(),y(13,"p",61),u(14," It runs the same pi coding agent you use in the terminal, with your models, tools, skills and sessions. "),b(),y(15,"p",62),u(16," Try "),y(17,"em"),u(18,"\u201Cexplain this repository\u201D"),b(),u(19," or "),y(20,"em"),u(21,"\u201Cwhy is this failing?\u201D"),b(),w(22,yL,4,0),u(23,". "),b()()),t&2){let n=m();d(9),re(n.heroLetters),d(13),S(n.canPinSelection()?22:-1)}}function vL(t,e){if(t&1){let n=$();y(0,"button",64),A("click",function(){D(n);let o=m();return M(o.jumpToLatest())}),u(1,"\u2193 Latest"),b()}}function bL(t,e){if(t&1){let n=$();y(0,"div",65),A("click",function(){D(n);let o=m();return M(o.closeImage())}),y(1,"button",66),A("click",function(){D(n);let o=m();return M(o.closeImage())}),u(2," \xD7 "),b(),y(3,"figure",67),A("click",function(o){return o.stopPropagation()}),ve(4,"img",33),y(5,"figcaption"),u(6),b()()()}if(t&2){let n=e;d(4),q("src",n.src,xi)("alt",n.label),d(2),k(n.label)}}var xL={png:"png",jpeg:"jpg",jpg:"jpg",webp:"webp",gif:"gif","svg+xml":"svg",bmp:"bmp",avif:"avif"},CE=160;function CL(t){let e=t.replace(/\s+/g," ").trim();return e.length>CE?`${e.slice(0,CE)}\u2026`:e}var bu=class t{morse=N(Ze);animation=N(ln);handoff=N(Es);scrollHost=Xe.required("scroll");inner=Xe("inner");heroMark=Xe("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(()=>_C(this.morse.items()));activeProcess=E(()=>vC(this.rows()));railPrompts=E(()=>this.rows().filter(e=>e.kind==="user").map(e=>({id:e.item.id,preview:CL(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 i=new ResizeObserver(()=>{this.pinned()&&this.afterRender(()=>this.scrollToBottom())});i.observe(n),e(()=>i.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 i=n.getBoundingClientRect();this.handoff.aim({x:i.left+i.width/2,y:i.top+i.height/2,width:i.width,height:i.height})})}),se(()=>{this.railPrompts(),this.afterRender(()=>this.updateActivePrompt())}),se(()=>{let e=this.morse.state().sessionId,n=this.morse.items(),i=n[0]?.id,o=e===this.previousSessionId&&this.previousFirstId!==void 0&&i!==this.previousFirstId&&n.length>this.previousLength;this.previousSessionId=e,this.previousFirstId=i,this.previousLength=n.length,o&&this.afterRender(()=>this.restoreBottomDistance())})}afterRender(e){setTimeout(e,0)}onScroll(e){let n=e.target,i=n.scrollHeight-n.scrollTop-n.clientHeight;this.pinned.set(i<48),this.bottomDistance=i,this.anchorScroll=i>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),i=e.scrollHeight-e.clientHeight-this.bottomDistance;e.scrollTop=Math.max(0,Math.min(n,i))}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 i=e.getBoundingClientRect().top+100,o=n[0]?.dataset.promptId??null;for(let s of Array.from(n))if(s.getBoundingClientRect().top<=i)o=s.dataset.promptId??o;else break;e.scrollHeight-e.scrollTop-e.clientHeight<=Math.max(48,e.clientHeight*.1)&&(o=n[n.length-1]?.dataset.promptId??o),this.activePromptId.set(o)}scrollToPrompt(e){let n=this.scrollHost().nativeElement,i=n.querySelector(`[data-prompt-id="${e}"]`);if(!i)return;let o=i.getBoundingClientRect().top-n.getBoundingClientRect().top+n.scrollTop-12;this.pinned.set(!1),this.animation.isEnabled&&typeof n.scrollTo=="function"?n.scrollTo({top:o,behavior:"smooth"}):n.scrollTop=o,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 bC(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 i=e.mimeType.split("/")[1]?.toLowerCase()??"",o=xL[i]??(i.replace(/[^a-z0-9]/g,"")||"png");return n===0?`image.${o}`:`image-${n+1}.${o}`}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 i=n?.value.length??0;n?.setSelectionRange(i,i)})}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 i=n.map(o=>`${o.path}${o.startLine!==void 0?`:${o.startLine}-${o.endLine??o.startLine}`:""}`).map(o=>`@${o}`).join(`
|
|
89
89
|
`);return e.text.trim().length>0?`${e.text}
|
|
90
90
|
|
|
91
|
-
${i}`:i}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=ue({type:t,selectors:[["morse-chat-transcript"]],viewQuery:function(n,i){n&1&>(i.scrollHost,H2,5)(i.inner,U2,5)(i.heroMark,z2,5),n&2&&vt(3)},hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.onEscape()},Mt)},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,i){if(n&1&&(y(0,"div",3,0),A("scroll",function(r){return i.onScroll(r)}),y(2,"div",4,1),w(4,K2,3,1,"div",5)(5,Z2,3,0,"div",6),oe(6,mL,5,1,null,null,G2,!1,yL,24,1,"div",7),b()(),y(9,"morse-prompt-rail",8),A("pick",function(r){return i.scrollToPrompt(r)}),b(),w(10,_L,2,0,"button",9),w(11,vL,7,3,"div",10)),n&2){let o;d(2),X("blank",i.rows().length===0),d(2),S(i.hasOlderHistory()||i.loadingOlderHistory()?4:i.rows().length>0?5:-1),d(2),re(i.rows()),d(3),q("prompts",i.railPrompts())("activeId",i.activePromptId()),d(),S(!i.pinned()&&i.rows().length>0?10:-1),d(),S((o=i.preview())?11:-1,o)}},dependencies:[hu,_u,un,vu],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 CL=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function EE(t){let e=[],n,i=0,o=0,r=0,s=0,a=!1,c=t.split(`
|
|
92
|
-
`);c.at(-1)===""&&c.pop();for(let l of c){if(l.startsWith("Binary files ")||l.startsWith("GIT binary patch")){a=!0;continue}let p=
|
|
91
|
+
${i}`:i}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=ue({type:t,selectors:[["morse-chat-transcript"]],viewQuery:function(n,i){n&1&>(i.scrollHost,U2,5)(i.inner,z2,5)(i.heroMark,G2,5),n&2&&vt(3)},hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.onEscape()},Mt)},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,i){if(n&1&&(y(0,"div",3,0),A("scroll",function(r){return i.onScroll(r)}),y(2,"div",4,1),w(4,Z2,3,1,"div",5)(5,Q2,3,0,"div",6),oe(6,hL,5,1,null,null,q2,!1,_L,24,1,"div",7),b()(),y(9,"morse-prompt-rail",8),A("pick",function(r){return i.scrollToPrompt(r)}),b(),w(10,vL,2,0,"button",9),w(11,bL,7,3,"div",10)),n&2){let o;d(2),X("blank",i.rows().length===0),d(2),S(i.hasOlderHistory()||i.loadingOlderHistory()?4:i.rows().length>0?5:-1),d(2),re(i.rows()),d(3),q("prompts",i.railPrompts())("activeId",i.activePromptId()),d(),S(!i.pinned()&&i.rows().length>0?10:-1),d(),S((o=i.preview())?11:-1,o)}},dependencies:[hu,_u,un,vu],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 EL=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function EE(t){let e=[],n,i=0,o=0,r=0,s=0,a=!1,c=t.split(`
|
|
92
|
+
`);c.at(-1)===""&&c.pop();for(let l of c){if(l.startsWith("Binary files ")||l.startsWith("GIT binary patch")){a=!0;continue}let p=EL.exec(l);if(p){n={header:l,rows:[]},e.push(n),i=Number(p[1]),o=Number(p[3]);continue}if(n===void 0||l.startsWith("\\"))continue;let f=l.charAt(0),_=l.slice(1);f==="+"?(n.rows.push({kind:"add",text:_,newLine:o,newAnchor:o}),o+=1,r+=1):f==="-"?(n.rows.push({kind:"del",text:_,oldLine:i,newAnchor:o}),i+=1,s+=1):f===" "&&(n.rows.push({kind:"context",text:_,oldLine:i,newLine:o,newAnchor:o}),i+=1,o+=1)}for(let l of e)wL(l.rows);return{hunks:e,additions:r,deletions:s,binary:a}}function wL(t){let e=0;for(;e<t.length;){if(t[e].kind==="context"){e+=1;continue}let n=[];for(;e<t.length&&t[e].kind!=="context";)n.push(t[e]),e+=1;let i=n.map(r=>r.newAnchor).filter(r=>r!==void 0);if(i.length===0)continue;let o={start:Math.min(...i),end:Math.max(...i)};for(let r of n)r.change=o}}function wE(t){let e=[];for(let n of t.hunks)e.push({kind:"hunk",text:n.header}),e.push(...n.rows);return e}function SE(t){let e=[];for(let n of t.hunks){e.push({hunk:n.header});let i=0;for(;i<n.rows.length;){let o=n.rows[i];if(o.kind==="context"){e.push({left:o,right:o}),i+=1;continue}let r=[],s=[];for(;i<n.rows.length&&n.rows[i].kind==="del";)r.push(n.rows[i]),i+=1;for(;i<n.rows.length&&n.rows[i].kind==="add";)s.push(n.rows[i]),i+=1;let a=Math.max(r.length,s.length);for(let c=0;c<a;c+=1)e.push({left:r[c],right:s[c]})}}return e}function TE(t){let e=t.split(`
|
|
93
93
|
`);e.at(-1)===""&&e.pop();let n=e.map(o=>`+${o}`).join(`
|
|
94
94
|
`);return`${`@@ -0,0 +1,${e.length} @@`}
|
|
95
95
|
${n}${n.length===0?"":`
|
|
96
|
-
`}`}var
|
|
96
|
+
`}`}var SL=["source"],TL=["gutter"],DL=(t,e)=>e.id;function ML(t,e){if(t&1&&(h(0,"span",7),u(1),g()),t&2){let n=m(2);d(),k(n.diffStats())}}function kL(t,e){if(t&1){let n=$();h(0,"div",11)(1,"button",12),F("click",function(){D(n);let o=m();return M(o.setMode("file"))}),u(2," File "),g(),h(3,"button",13),F("click",function(){D(n);let o=m();return M(o.setMode("unified"))}),u(4," Unified "),g(),h(5,"button",14),F("click",function(){D(n);let o=m();return M(o.setMode("split"))}),u(6," Split "),g()(),w(7,ML,2,1,"span",7)}if(t&2){let n=m();d(),X("on",n.mode()==="file"),d(2),X("on",n.mode()==="unified"),d(2),X("on",n.mode()==="split"),d(2),S(n.mode()!=="file"?7:-1)}}function IL(t,e){t&1&&(h(0,"span",5),u(1),g()),t&2&&(ie("title","Pinned to the next prompt"),d(),k(e))}function NL(t,e){if(t&1&&(h(0,"span",5),u(1),g()),t&2){let n=m();ie("title","Pinned to the next prompt"),d(),k(n.pinnedCount()===1?"1 range":n.pinnedCount()+" ranges")}}function OL(t,e){t&1&&(h(0,"p",9),u(1,"Reading the changes\u2026"),g())}function PL(t,e){t&1&&(h(0,"p",10),u(1),g()),t&2&&(d(),k(e))}function AL(t,e){if(t&1&&(h(0,"p",9),u(1),g()),t&2){let n=m(2);d(),ae("Binary file \xB7 ",n.size()," \xB7 no textual diff.")}}function RL(t,e){t&1&&(h(0,"p",9),u(1,"No changes against HEAD."),g())}function LL(t,e){t&1&&(h(0,"div",17)(1,"span",19),u(2),g()()),t&2&&(d(2),k(e))}function FL(t,e){if(t&1){let n=$();h(0,"div",18)(1,"div",20),F("click",function(){D(n);let o=m().$implicit,r=m(3);return M(r.toggleChange(o.left))}),h(2,"span",21),u(3),g(),h(4,"span",22),u(5),g(),ce(6,"span",23),g(),h(7,"div",20),F("click",function(){D(n);let o=m().$implicit,r=m(3);return M(r.toggleChange(o.right))}),h(8,"span",21),u(9),g(),h(10,"span",22),u(11),g(),ce(12,"span",23),g()()}if(t&2){let n=m().$implicit,i=m(3);d(),X("del",n.left?.kind==="del")("clickable",n.left?.change!==void 0)("pinned",i.isChangePinned(n.left?.newAnchor)),J("title",n.left?.change!==void 0?"Click to pin this change to your next message":null),d(2),k(n.left?.oldLine??""),d(2),k(i.diffSign(n.left)),d(),ie("innerHTML",n.left?.html,Eo),d(),X("add",n.right?.kind==="add")("clickable",n.right?.change!==void 0)("pinned",i.isChangePinned(n.right?.newAnchor)),J("title",n.right?.change!==void 0?"Click to pin this change to your next message":null),d(2),k(n.right?.newLine??""),d(2),k(i.diffSign(n.right)),d(),ie("innerHTML",n.right?.html,Eo)}}function VL(t,e){if(t&1&&w(0,LL,3,1,"div",17)(1,FL,13,20,"div",18),t&2){let n,i=e.$implicit;S((n=i.hunk)?0:1,n)}}function jL(t,e){if(t&1&&(h(0,"div",15),oe(1,VL,2,1,null,null,Ci),g()),t&2){let n=m(2);d(),re(n.splitView())}}function $L(t,e){if(t&1&&(h(0,"div",17)(1,"span",19),u(2),g()()),t&2){let n=m().$implicit;d(2),k(n.text)}}function BL(t,e){if(t&1){let n=$();h(0,"div",25),F("click",function(){D(n);let o=m().$implicit,r=m(3);return M(r.toggleChange(o))}),h(1,"span",21),u(2),g(),h(3,"span",21),u(4),g(),h(5,"span",22),u(6),g(),ce(7,"span",23),g()}if(t&2){let n=m().$implicit,i=m(3);X("add",n.kind==="add")("del",n.kind==="del")("clickable",n.change!==void 0)("pinned",i.isChangePinned(n.newAnchor)),J("title",n.change!==void 0?"Click to pin this change to your next message":null),d(2),k(n.oldLine??""),d(2),k(n.newLine??""),d(2),k(i.diffSign(n)),d(),ie("innerHTML",n.html,Eo)}}function HL(t,e){if(t&1&&w(0,$L,3,1,"div",17)(1,BL,8,13,"div",24),t&2){let n=e.$implicit;S(n.kind==="hunk"?0:1)}}function UL(t,e){if(t&1&&(h(0,"div",16),oe(1,HL,2,1,null,null,Ci),g()),t&2){let n=m(2);d(),re(n.unifiedView())}}function zL(t,e){if(t&1&&w(0,OL,2,0,"p",9)(1,PL,2,1,"p",10)(2,AL,2,1,"p",9)(3,RL,2,0,"p",9)(4,jL,3,0,"div",15)(5,UL,3,0,"div",16),t&2){let n,i=m();S(i.tab().diffLoading&&i.diffText().length===0?0:(n=i.tab().diffError)?1:i.parsed().binary?2:i.parsed().hunks.length===0?3:i.mode()==="split"?4:5,n)}}function GL(t,e){if(t&1&&(h(0,"p",9),u(1),g()),t&2){let n=m();d(),ae("Reading ",n.tab().title,"\u2026")}}function qL(t,e){t&1&&(h(0,"p",10),u(1),g()),t&2&&(d(),k(e))}function WL(t,e){if(t&1&&(h(0,"p",9),u(1),g()),t&2){let n=m();d(),ae("Binary file \xB7 ",n.size()," \xB7 no text preview.")}}function YL(t,e){if(t&1){let n=$();h(0,"span",33),F("pointerdown",function(o){let r=D(n).$implicit,s=m(2);return M(s.startSelection(o,r))}),u(1),g()}if(t&2){let n=e.$implicit,i=m(2);X("selected",i.isSelected(n)),J("data-line",n),d(),k(n)}}function KL(t,e){if(t&1){let n=$();h(0,"span",34)(1,"span",35),F("pointerdown",function(o){let r=D(n).$implicit,s=m(2);return M(s.startResizeEdge(o,r,"start"))}),g(),h(2,"span",36),F("pointerdown",function(o){let r=D(n).$implicit,s=m(2);return M(s.startResizeEdge(o,r,"end"))}),g()()}if(t&2){let n=e.$implicit,i=m(2);At("top",i.topOf(n),"px")("height",i.heightOf(n),"px"),X("merged",n.id===i.mergedId())}}function ZL(t,e){if(t&1&&(h(0,"p",9),u(1),g()),t&2){let n=m(2);d(),ae("Showing the first 512 KB of ",n.size(),".")}}function QL(t,e){if(t&1&&(h(0,"div",26)(1,"div",27,0),oe(3,YL,2,4,"span",28,Ei),g(),h(5,"div",29)(6,"pre",30,1),ce(8,"code",31),g(),oe(9,KL,3,6,"span",32,DL),g()(),w(11,ZL,2,1,"p",9)),t&2){let n=m();d(3),re(n.lines()),d(5),ie("innerHTML",n.highlighted(),Eo),d(),re(n.highlights()),d(2),S(n.tab().truncated?11:-1)}}function DE(t){return t===void 0?"":t.start===t.end?`L${t.start}`:`L${t.start}\u2013${t.end}`}var XL=19.2,xu=class t{tab=te.required();tabs=N(dn);attachments=N(Ui);animation=N(ln);sanitizer=N(Fa);display=N(Ro);workspace=N(zi);sourceElement=Xe("source");gutterElement=Xe("gutter");source=E(()=>{let e=this.tab().content??"";return e.endsWith(`
|
|
97
97
|
`)?e.slice(0,-1):e});lines=E(()=>{let e=this.source(),n=e.length===0?1:e.split(`
|
|
98
|
-
`).length;return Array.from({length:n},(i,o)=>o+1)});highlighted=E(()=>{let e=this.tab();return e.content===void 0||e.binary?this.sanitizer.bypassSecurityTrustHtml(""):this.sanitizer.bypassSecurityTrustHtml(Is(this.source(),e.language).html)});language=E(()=>this.tab().language??"text");size=E(()=>XL(this.tab().size??0));changed=E(()=>Ud(this.workspace.status()).get(this.tab().path));mode=E(()=>this.changed()===void 0?"file":this.display.diffView());diffText=E(()=>{let e=this.tab();return e.diff!==void 0&&e.diff.trim().length>0?e.diff:this.changed()==="U"&&e.content!==void 0&&!e.binary?TE(e.content):e.diff??""});parsed=E(()=>EE(this.diffText()));unified=E(()=>wE(this.parsed()));split=E(()=>SE(this.parsed()));unifiedView=E(()=>{let e=this.language();return this.unified().map(n=>K(V({},n),{html:n.kind==="hunk"?"":this.sanitizer.bypassSecurityTrustHtml(Is(n.text,e).html)}))});splitView=E(()=>{let e=this.language(),n=i=>i===void 0?void 0:K(V({},i),{html:this.sanitizer.bypassSecurityTrustHtml(Is(i.text,e).html)});return this.split().map(i=>({hunk:i.hunk,left:n(i.left),right:n(i.right)}))});diffStats=E(()=>{let e=this.parsed();return`+${e.additions} \u2212${e.deletions}`});lineHeight=O(QL);selected=O(void 0);editingId=O(void 0);mergedId=O(void 0);anchor=1;rangeLabel=E(()=>DE(this.selected()));highlights=E(()=>{let e=this.tab().path,n=this.editingId(),i=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})),o=this.selected();return o===void 0?i:[...i,{id:"live",start:o.start,end:o.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(){no(()=>this.measureLineHeight()),se(()=>{this.tab(),ii(()=>this.selected.set(void 0))}),se(()=>{if(this.mode()==="file"||this.changed()===void 0)return;let e=this.tab().id;ii(()=>this.tabs.loadDiff(e))})}setMode(e){this.display.setDiffView(e)}diffSign(e){if(e===void 0)return"";switch(e.kind){case"add":return"+";case"del":return"\u2212";case"context":return" ";default:return""}}isChangePinned(e){if(e===void 0)return!1;let n=this.tab().path;return this.attachments.pins().some(i=>i.path===n&&i.startLine!==void 0&&e>=i.startLine&&e<=(i.endLine??i.startLine))}toggleChange(e){let n=e!==void 0&&e.kind!=="hunk"?e.change:void 0;if(n===void 0)return;let i=this.tab().path,o=this.attachments.pins().find(r=>r.path===i&&r.startLine!==void 0&&r.startLine<=n.start&&(r.endLine??r.startLine)>=n.end);if(o!==void 0){this.attachments.removePin(o.id);return}this.attachments.pin({path:i,startLine:n.start,endLine:n.end>n.start?n.end:void 0}),this.attachments.say("info",`Pinned ${this.tab().title} ${DE(n)} to this message.`)}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 i=e.currentTarget;try{i.setPointerCapture(e.pointerId)}catch{}let o=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=()=>{i.removeEventListener("pointermove",o),i.removeEventListener("pointerup",r),i.removeEventListener("pointercancel",r),this.pinSelection()};i.addEventListener("pointermove",o),i.addEventListener("pointerup",r),i.addEventListener("pointercancel",r)}clearSelection(){this.selected.set(void 0),this.editingId.set(void 0)}reload(){this.tabs.reload(this.tab().id)}startResizeEdge(e,n,i){if(e.button!==0)return;e.preventDefault(),e.stopPropagation();let o=e.currentTarget;try{o.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),p=l?.startLine??n.start,f=l?.endLine??p,_=i==="start"?Math.min(c,f):p,x=i==="end"?Math.max(c,p):f;this.attachments.setPinRange(n.id,{startLine:_,endLine:x>_?x:void 0})},s=()=>{o.removeEventListener("pointermove",r),o.removeEventListener("pointerup",s),o.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})}};o.addEventListener("pointermove",r),o.addEventListener("pointerup",s),o.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 i=n.getBoundingClientRect().top,o=Math.floor((e-i)/this.lineHeight())+1;return Math.min(this.lines().length,Math.max(1,o))}pinSelection(){let e=this.selected();if(e===void 0)return;let n=e.end>e.start?e.end:void 0,i=this.attachments.pins().length,o=this.attachments.pin({path:this.tab().path,startLine:e.start,endLine:n},this.editingId());this.attachments.pins().length<i&&this.celebrate(o,{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 i=this.attachments.pins().find(l=>l.id===e),o=this.sourceElement()?.nativeElement.closest(".source-wrap");if(i?.startLine===void 0||!(o instanceof HTMLElement))return;let r=i.startLine,s=i.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(o,{x:o.clientWidth/2,y:c})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-file-preview"]],viewQuery:function(n,i){n&1&>(i.sourceElement,wL,5)(i.gutterElement,SL,5),n&2&&vt(2)},inputs:{tab:[1,"tab"]},decls:18,vars:7,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"],["role","group","aria-label","Preview mode",1,"modes"],["type","button","title","The file's content",3,"click"],["type","button","title","Unified diff",3,"click"],["type","button","title","Side-by-side diff",3,"click"],[1,"diff","split"],[1,"diff"],[1,"drow","hunk"],[1,"srow"],[1,"dtext"],[1,"side",3,"click"],[1,"dnum"],[1,"dsign"],[1,"dtext",3,"innerHTML"],[1,"drow",3,"add","del","clickable","pinned"],[1,"drow",3,"click"],[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,i){if(n&1&&(h(0,"header",2)(1,"span",3),u(2),g(),h(3,"div",4),w(4,ML,8,7),w(5,kL,2,2,"span",5)(6,IL,2,2,"span",5),h(7,"span",6),u(8),g(),h(9,"span",7),u(10),g(),h(11,"button",8),F("click",function(){return i.reload()}),u(12," \u27F3 "),g()()(),w(13,UL,6,1)(14,zL,2,1,"p",9)(15,GL,2,1,"p",10)(16,qL,2,1,"p",9)(17,ZL,12,2)),n&2){let o,r;d(),ie("title",i.tab().path),d(),k(i.tab().path),d(2),S(i.changed()?4:-1),d(),S((o=i.rangeLabel())?5:i.pinnedCount()>0?6:-1,o),d(3),k(i.language()),d(2),k(i.size()),d(3),S(i.mode()!=="file"?13:i.tab().loading?14:(r=i.tab().error)?15:i.tab().binary?16:17,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)}.modes[_ngcontent-%COMP%]{display:inline-flex;flex:none;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);overflow:hidden}.modes[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:2px 8px;border:0;background:transparent;color:var(--%NS%morse-fg-muted);font:inherit;font-size:11px;cursor:pointer}.modes[_ngcontent-%COMP%] button[_ngcontent-%COMP%] + button[_ngcontent-%COMP%]{border-left:1px solid var(--%NS%morse-border)}.modes[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.modes[_ngcontent-%COMP%] button.on[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--%NS%morse-accent) 24%,transparent);color:var(--%NS%morse-fg)}.diff[_ngcontent-%COMP%]{flex:1;min-height:0;overflow:auto;padding:6px 0;background:var(--%NS%morse-code-bg, var(--%NS%morse-bg));font-family:var(--%NS%morse-font-mono);font-size:12px;line-height:1.6}.drow[_ngcontent-%COMP%], .srow[_ngcontent-%COMP%]{display:flex;align-items:stretch;min-height:1.6em}.dtext[_ngcontent-%COMP%]{flex:1;min-width:0;padding:0 16px 0 6px;white-space:pre}.dnum[_ngcontent-%COMP%]{flex:none;min-width:44px;padding:0 8px 0 10px;color:var(--%NS%morse-fg-muted);text-align:right;-webkit-user-select:none;user-select:none;font-variant-numeric:tabular-nums;opacity:.7}.dsign[_ngcontent-%COMP%]{flex:none;width:14px;text-align:center;color:var(--%NS%morse-fg-muted);-webkit-user-select:none;user-select:none}.drow.add[_ngcontent-%COMP%], .side.add[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--%NS%morse-success) 14%,transparent)}.drow.del[_ngcontent-%COMP%], .side.del[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--%NS%morse-error) 14%,transparent)}.drow.add[_ngcontent-%COMP%] .dsign[_ngcontent-%COMP%], .side.add[_ngcontent-%COMP%] .dsign[_ngcontent-%COMP%]{color:var(--%NS%morse-success)}.drow.del[_ngcontent-%COMP%] .dsign[_ngcontent-%COMP%], .side.del[_ngcontent-%COMP%] .dsign[_ngcontent-%COMP%]{color:var(--%NS%morse-error)}.drow.clickable[_ngcontent-%COMP%], .side.clickable[_ngcontent-%COMP%]{cursor:pointer}.drow.clickable[_ngcontent-%COMP%]:hover, .side.clickable[_ngcontent-%COMP%]:hover{background:color-mix(in srgb,var(--%NS%morse-accent) 12%,transparent)}.drow.pinned[_ngcontent-%COMP%], .side.pinned[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--%NS%morse-accent) 22%,transparent);box-shadow:inset 2px 0 color-mix(in srgb,var(--%NS%morse-accent) 70%,transparent)}.drow.hunk[_ngcontent-%COMP%]{margin:6px 0 2px;padding:2px 12px;background:var(--%NS%morse-code-head, var(--%NS%morse-hover));color:var(--%NS%morse-fg-muted)}.srow[_ngcontent-%COMP%] .side[_ngcontent-%COMP%]{flex:1 1 50%;min-width:0;display:flex;align-items:stretch;border-left:1px solid var(--%NS%morse-border)}.srow[_ngcontent-%COMP%] .side[_ngcontent-%COMP%]:first-child{border-left:0}.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 XL(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 JL=(t,e)=>e.value;function eF(t,e){t&1&&(h(0,"p",1),u(1),g()),t&2&&(d(),k(e))}function tF(t,e){if(t&1){let n=$();h(0,"button",4),F("click",function(){let o=D(n).$implicit,r=m(3);return M(r.choose(o.value))}),u(1),g()}if(t&2){let n=e.$implicit;d(),ae(" ",n.label," ")}}function nF(t,e){if(t&1&&(w(0,eF,2,1,"p",1),h(1,"div",2),oe(2,tF,2,1,"button",3,JL),g()),t&2){let n,i=m(),o=m();S((n=o.messageOf(i))?0:-1,n),d(2),re(o.optionsOf(i))}}function iF(t,e){if(t&1){let n=$();h(0,"p"),u(1),g(),h(2,"div",2)(3,"button",5),F("click",function(){D(n);let o=m(2);return M(o.decide(!0))}),u(4,"Yes"),g(),h(5,"button",4),F("click",function(){D(n);let o=m(2);return M(o.decide(!1))}),u(6,"No"),g()()}if(t&2){let n=m(),i=m();d(),k(i.messageOf(n))}}function oF(t,e){if(t&1){let n=$();h(0,"input",6),F("input",function(o){D(n);let r=m(2);return M(r.onInput(o))}),g(),h(1,"div",2)(2,"button",5),F("click",function(){D(n);let o=m(2);return M(o.submit())}),u(3,"Submit"),g(),h(4,"button",4),F("click",function(){D(n);let o=m(2);return M(o.cancel())}),u(5,"Cancel"),g()()}if(t&2){let n=m(),i=m();ie("value",i.value()||i.prefillOf(n))("placeholder",i.placeholderOf(n))}}function rF(t,e){if(t&1){let n=$();h(0,"textarea",7),F("input",function(o){D(n);let r=m(2);return M(r.onInput(o))}),g(),h(1,"div",2)(2,"button",5),F("click",function(){D(n);let o=m(2);return M(o.submit())}),u(3,"Submit"),g(),h(4,"button",4),F("click",function(){D(n);let o=m(2);return M(o.cancel())}),u(5,"Cancel"),g()()}if(t&2){let n=m(),i=m();ie("value",i.value()||i.prefillOf(n))}}function sF(t,e){if(t&1&&(h(0,"section",0)(1,"header"),u(2),g(),w(3,nF,4,1)(4,iF,7,1)(5,oF,6,2)(6,rF,6,1),g()),t&2){let n,i=e;d(2),k(i.title),d(),S((n=i.kind)==="select"?3:n==="confirm"?4:n==="input"?5:n==="editor"?6:-1)}}var Cu=class t{morse=N(Ze);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(V({requestId:n.requestId},e))}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({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,i){if(n&1&&w(0,sF,7,2,"section",0),n&2){let o;S((o=i.visible()&&i.request())?0:-1,o)}},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 ME(t){let e={name:"",path:"",kind:"dir",children:[]},n=new Map([["",e]]),i=o=>{let r=n.get(o);if(r!==void 0)return r;let s=o.lastIndexOf("/"),a=i(s===-1?"":o.slice(0,s)),c={name:o.slice(s+1),path:o,kind:"dir",children:[]};return a.children.push(c),n.set(o,c),c};for(let o of t){let r=o.endsWith("/"),s=r?o.slice(0,-1):o;if(s.length===0)continue;if(r){i(s);continue}let a=s.lastIndexOf("/"),c=i(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 kE(e.children),e.children}function kE(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)kE(e.children)}function Eu(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 aF=t=>({items:t,label:"Open tabs"}),cF=t=>({items:t,label:"Mentioned files"}),lF=(t,e)=>e.id;function dF(t,e){t&1&&ve(0,"span",6)}function uF(t,e){if(t&1&&(y(0,"span",7),u(1),b()),t&2){let n=m().$implicit,i=m(2);d(),k(i.glyph(n))}}function pF(t,e){if(t&1){let n=$();y(0,"div",5),A("click",function(){let o=D(n).$implicit,r=m(2);return M(r.select(o.id))})("keydown.enter",function(){let o=D(n).$implicit,r=m(2);return M(r.select(o.id))})("keydown.space",function(){let o=D(n).$implicit,r=m(2);return M(r.select(o.id))})("contextmenu",function(o){let r=D(n).$implicit,s=m(2);return M(s.openMenu(o,r.id))})("auxclick",function(o){let r=D(n).$implicit,s=m(2);return M(s.onAuxClick(r.id,o))}),w(1,dF,1,0,"span",6)(2,uF,2,1,"span",7),y(3,"span",8),u(4),b(),y(5,"button",9),A("click",function(o){let r=D(n).$implicit,s=m(2);return M(s.close(r.id,o))}),u(6," \xD7 "),b()()}if(t&2){let n=e.$implicit,i=m(2);X("active",n.id===i.activeId())("running",n.kind==="session"&&i.isRunning(n.id)),q("title",i.title(n)),J("aria-selected",n.id===i.activeId()),d(),S(n.kind==="session"&&i.isRunning(n.id)?1:2),d(3),k(n.title),d(),q("title","Close "+n.title)}}function fF(t,e){t&1&&(y(0,"span",4),u(1,"No open tabs"),b())}function mF(t,e){if(t&1&&(y(0,"div",2),oe(1,pF,7,9,"div",3,lF,!1,fF,2,0,"span",4),b()),t&2){let n=e.items,i=e.label;J("aria-label",i),d(),re(n)}}function hF(t,e){if(t&1&&ka(0,1),t&2){let n=m(),i=ed(1);q("ngTemplateOutlet",i)("ngTemplateOutletContext",nd(2,cF,n.mentionTabs()))}}function gF(t,e){if(t&1){let n=$();y(0,"div",10),A("click",function(){D(n);let o=m();return M(o.closeMenu())})("contextmenu",function(o){D(n);let r=m();return o.preventDefault(),M(r.closeMenu())}),b(),y(1,"div",11)(2,"button",12),A("click",function(){D(n);let o=m();return M(o.menuClose())}),u(3,"Close"),b(),y(4,"button",13),A("click",function(){D(n);let o=m();return M(o.menuCloseOthers())}),u(5," Close Others "),b(),y(6,"button",13),A("click",function(){D(n);let o=m();return M(o.menuCloseToTheRight())}),u(7," Close to the Right "),b(),y(8,"button",12),A("click",function(){D(n);let o=m();return M(o.menuCloseAll())}),u(9,"Close All"),b()()}if(t&2){let n=e,i=m();d(),At("left",n.x,"px")("top",n.y,"px"),d(3),q("disabled",!i.closableOthers()),d(2),q("disabled",!i.canCloseToTheRight(n.id))}}var wu=class t{tabs=N(dn);morse=N(Ze);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":Eu(e.title)}isRunning(e){let n=this.morse.sessionActivity().get(e);if(n!==void 0)return n.streaming;let i=this.morse.state();return i.sessionId===e&&i.streaming}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(i=>i.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=ue({type:t,selectors:[["morse-tab-strip"]],hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.onEscape()},Mt)},decls:5,vars:6,consts:[["row",""],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["role","tablist",1,"strip"],["role","tab","tabindex","0",1,"tab",3,"active","running","title"],[1,"empty"],["role","tab","tabindex","0",1,"tab",3,"click","keydown.enter","keydown.space","contextmenu","auxclick","title"],["aria-hidden","true",1,"live"],["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,i){if(n&1&&(Jl(0,mF,4,2,"ng-template",null,0,Vm),ka(2,1),w(3,hF,1,4,"ng-container",1),w(4,gF,10,6)),n&2){let o,r=ed(1);d(2),q("ngTemplateOutlet",r)("ngTemplateOutletContext",nd(4,aF,i.mainTabs())),d(),S(i.mentionTabs().length>0?3:-1),d(),S((o=i.menu())?4:-1,o)}},dependencies:[Bm],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%]{height:auto;min-height:30px;align-items:center;gap:6px;padding:4px 8px;border-top:1px solid var(--%NS%morse-border);background:var(--%NS%morse-panel, var(--%NS%morse-bg))}.strip[_ngcontent-%COMP%] + .strip[_ngcontent-%COMP%] .tab[_ngcontent-%COMP%]{height:22px;max-width:190px;padding:0 4px 0 8px;border:1px solid var(--%NS%morse-border);border-radius:999px;background:var(--%NS%morse-bubble, var(--%NS%morse-hover));font-size:11.5px}.strip[_ngcontent-%COMP%] + .strip[_ngcontent-%COMP%] .tab[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover);border-color:var(--%NS%morse-accent);color:var(--%NS%morse-fg)}.strip[_ngcontent-%COMP%] + .strip[_ngcontent-%COMP%] .tab.active[_ngcontent-%COMP%]{border-color:var(--%NS%morse-accent);background:color-mix(in srgb,var(--%NS%morse-accent) 22%,transparent);color:var(--%NS%morse-fg);box-shadow:none}.strip[_ngcontent-%COMP%] + .strip[_ngcontent-%COMP%] .tab[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{width:15px;height:15px;font-size:11px;border-radius:999px}.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)}.tab[_ngcontent-%COMP%] .live[_ngcontent-%COMP%]{flex:none;width:9px;height:9px;border-radius:50%;border:1.5px solid color-mix(in srgb,var(--%NS%morse-accent) 30%,transparent);border-top-color:var(--%NS%morse-accent);animation:_ngcontent-%COMP%_tab-spin .8s linear infinite}@keyframes _ngcontent-%COMP%_tab-spin{to{transform:rotate(360deg)}}.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 OE=250,Su=class t{morse=N(Ze);items=O([]);meta=O(void 0);busy=O(!1);failure=O(void 0);generation=0;loading=this.busy.asReadonly();error=this.failure.asReadonly();isRepo=E(()=>this.meta()?.isRepo===!0);loaded=E(()=>this.meta()!==void 0);branch=E(()=>this.meta()?.branch);root=E(()=>this.meta()?.root);hasMore=E(()=>this.meta()?.hasMore===!0);commits=this.items.asReadonly();refresh(){if(!this.morse.workspace().cwd)return;let n=this.generation+=1;this.busy.set(!0),this.failure.set(void 0),this.page(0).then(i=>{if(n===this.generation){if(i===void 0){this.items.set([]),this.meta.set(void 0),this.failure.set("The host could not read git history for this project.");return}this.items.set(i.commits),this.meta.set(IE(i))}}).finally(()=>{n===this.generation&&this.busy.set(!1)})}loadMore(){if(this.busy()||!this.hasMore()||!this.isRepo())return;let e=this.generation,n=this.items().length;this.busy.set(!0),this.page(n).then(i=>{e!==this.generation||i===void 0||(this.items.update(o=>[...o,...i.commits]),this.meta.set(IE(i)))}).finally(()=>{e===this.generation&&this.busy.set(!1)})}async page(e){let n=await this.morse.requestHostCommand("gitLog",{max:OE,skip:e});return yF(n)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};function IE(t){return{isRepo:t.isRepo,root:t.root,branch:t.branch,hasMore:t.commits.length===OE}}function yF(t){if(typeof t!="object"||t===null)return;let e=t;if(e.isRepo!==!0)return typeof e.isRepo=="boolean"?{isRepo:!1,commits:[]}:void 0;let n=Array.isArray(e.commits)?e.commits.map(_F).filter(i=>i!==void 0):[];return{isRepo:!0,root:typeof e.root=="string"?e.root:void 0,branch:typeof e.branch=="string"?e.branch:void 0,commits:n}}function _F(t){if(typeof t!="object"||t===null)return;let e=t,n=e.hash,i=e.shortHash;if(!(typeof n!="string"||typeof i!="string"))return{hash:n,shortHash:i,parents:NE(e.parents),refs:NE(e.refs),author:typeof e.author=="string"?e.author:"",date:typeof e.date=="string"?e.date:"",subject:typeof e.subject=="string"?e.subject:""}}function NE(t){return Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function AE(t){let e=[],n=[],i=0;for(let o of t){let r=e.slice(),s=[];for(let l=0;l<e.length;l+=1)e[l]===o.hash&&s.push(l);let a=s.length>0?s[0]:PE(e);e[a]=void 0;for(let l=1;l<s.length;l+=1)e[s[l]]=void 0;let c=[];for(let l=0;l<r.length;l+=1)r[l]!==void 0&&e[l]===r[l]&&c.push({fromLane:l,fromY:0,toLane:l,toY:1,color:l});r[a]===o.hash&&c.push({fromLane:a,fromY:0,toLane:a,toY:.5,color:a});for(let l of s)l!==a&&c.push({fromLane:l,fromY:0,toLane:a,toY:.5,color:l});for(let l=0;l<o.parents.length;l+=1){let p=o.parents[l],f=vF(e,p,a);f===-1&&(f=l===0?a:PE(e)),e[f]=p,c.push({fromLane:a,fromY:.5,toLane:f,toY:1,color:f})}i=Math.max(i,e.length),n.push({lane:a,color:a,edges:c})}return{rows:n,laneCount:i}}function PE(t){let e=t.indexOf(void 0);return e===-1?t.length:e}function vF(t,e,n){for(let i=0;i<t.length;i+=1)if(i!==n&&t[i]===e)return i;return-1}var bF=(t,e)=>e.path,xF=(t,e)=>e.commit.hash;function CF(t,e){if(t&1&&(h(0,"span",10),u(1),g()),t&2){let n=e;ie("title",n),d(),k(n)}}function EF(t,e){if(t&1&&(h(0,"span",11),u(1),g()),t&2){let n=m();d(),ae("",n.commits().length," commits")}}function wF(t,e){t&1&&(rt(),h(0,"svg",14),ce(1,"path",23)(2,"path",24)(3,"path",25)(4,"path",26),g())}function SF(t,e){t&1&&(rt(),h(0,"svg",14),ce(1,"path",27)(2,"path",28)(3,"path",29)(4,"path",30),g())}function TF(t,e){if(t&1&&(h(0,"span",32),u(1),g()),t&2){let n=m(2);d(),k(n.changes().length)}}function DF(t,e){t&1&&(h(0,"div",34)(1,"span",36),rt(),h(2,"svg",37),ce(3,"circle",38),g(),h(4,"svg",39),ce(5,"path",40),g()(),u(6," No uncommitted changes "),g())}function MF(t,e){if(t&1){let n=$();h(0,"li")(1,"button",41),F("click",function(){let o=D(n).$implicit,r=m(4);return M(r.openChange(o.path))}),h(2,"span"),u(3),g(),h(4,"span",42),u(5),g(),h(6,"span",43),u(7),g(),ce(8,"span",12),g()()}if(t&2){let n=e.$implicit,i=m(4);d(),ie("title",n.path),d(),Tn("badge "+n.kind),d(),k(n.kind),d(2),k(i.dirOf(n.path)),d(2),k(i.baseOf(n.path))}}function kF(t,e){if(t&1&&(h(0,"ul",35),oe(1,MF,9,6,"li",null,bF),g()),t&2){let n=m(3);d(),re(n.changes())}}function IF(t,e){if(t&1&&w(0,DF,7,0,"div",34)(1,kF,3,0,"ul",35),t&2){let n=m(2);S(n.changes().length===0?0:1)}}function NF(t,e){if(t&1){let n=$();h(0,"section",31)(1,"div",19)(2,"button",20),F("click",function(){D(n);let o=m();return M(o.toggleChanges())}),h(3,"span",21),u(4,"\u203A"),g(),h(5,"span",22),u(6,"Changes"),g(),w(7,TF,2,1,"span",32),g()(),w(8,IF,2,1),g(),h(9,"div",33),F("pointerdown",function(o){D(n);let r=m();return M(r.startResize(o))}),g()}if(t&2){let n=m();At("height",n.changesHeightPx(),"px"),d(2),J("aria-expanded",!n.changesCollapsed()),d(),X("open",!n.changesCollapsed()),d(4),S(n.changes().length>0?7:-1),d(),S(n.changesCollapsed()?-1:8),d(),X("gone",n.changesCollapsed()||n.historyCollapsed())}}function OF(t,e){t&1&&(h(0,"p",44),u(1,"Reading git history\u2026"),g())}function PF(t,e){t&1&&(h(0,"p",45),u(1),g()),t&2&&(d(),k(e))}function AF(t,e){t&1&&(h(0,"p",44),u(1,"This project is not a git repository."),g())}function RF(t,e){t&1&&(h(0,"div",34)(1,"span",47),rt(),h(2,"svg",48),ce(3,"path",49)(4,"circle",50),g()(),u(5," No commits yet "),g())}function LF(t,e){if(t&1&&(rt(),ce(0,"path")(1,"path",64)),t&2){let n=e.$implicit,i=m(4);At("stroke",i.color(n.color)),J("d",i.path(n)),d(),J("d",i.path(n))}}function FF(t,e){if(t&1&&(h(0,"span",66),u(1),g()),t&2){let n=e.$implicit,i=m(5);X("kind-head",i.refKind(n)==="head")("kind-local",i.refKind(n)==="local")("kind-tag",i.refKind(n)==="tag"),ie("title",i.refLabel(n)),d(),k(i.refLabel(n))}}function VF(t,e){if(t&1&&(h(0,"span",66),u(1),g()),t&2){let n=m(2).$implicit;ie("title",n.restTitle),d(),ae("+",n.moreRefs)}}function jF(t,e){if(t&1&&(h(0,"span",58),oe(1,FF,2,8,"span",65,Ei),w(3,VF,2,2,"span",66),g()),t&2){let n=m().$implicit;d(),re(n.refs),d(2),S(n.moreRefs>0?3:-1)}}function $F(t,e){if(t&1&&(h(0,"span",61),u(1,"\xB7"),g(),h(2,"span",67),u(3),g()),t&2){let n=m().$implicit;d(3),k(n.commit.author)}}function BF(t,e){if(t&1){let n=$();h(0,"li",54),rt(),h(1,"svg",55),oe(2,LF,2,4,null,null,Ci),ce(4,"circle",56),g(),Jt(),h(5,"span",57),u(6),g(),w(7,jF,4,1,"span",58),ce(8,"span",12),h(9,"span",59)(10,"span",60),u(11),g(),h(12,"span",61),u(13,"\xB7"),g(),h(14,"span",62),u(15),g(),w(16,$F,4,1),g(),h(17,"button",63),F("click",function(){let o=D(n).$implicit,r=m(3);return M(r.copy(o.commit))}),u(18),g()()}if(t&2){let n=e.$implicit,i=m(3);X("expanded",i.expanded()),d(),J("width",i.graphWidth())("height",i.rowHeight)("viewBox","0 0 "+i.graphWidth()+" "+i.rowHeight),d(),re(n.row.edges),d(2),At("fill",i.rowColor(n.row)),J("cx",i.x(n.row.lane))("cy",i.rowHeight/2),d(2),k(n.commit.subject),d(),S(n.refs.length>0?7:-1),d(3),ie("title",n.commit.hash),d(),k(n.commit.shortHash),d(4),k(i.when(n.commit.date)),d(),S(i.expanded()?16:-1),d(),ie("title",i.copied()===n.commit.hash?"Copied":"Copy commit hash"),J("aria-label","Copy commit hash "+n.commit.shortHash),d(),ae(" ",i.copied()===n.commit.hash?"\u2713":"\u29C9"," ")}}function HF(t,e){if(t&1&&u(0),t&2){let n=m(3);ae(" ",n.loading()?"Loading older commits\u2026":"Scroll for older commits"," ")}}function UF(t,e){t&1&&u(0," Beginning of history ")}function zF(t,e){if(t&1){let n=$();h(0,"ul",51),F("scroll",function(o){D(n);let r=m(2);return M(r.onScroll(o))}),oe(1,BF,19,18,"li",52,xF),h(3,"li",53),w(4,HF,1,1)(5,UF,1,0),g()()}if(t&2){let n=m(2);d(),re(n.entries().rows),d(3),S(n.hasMore()?4:5)}}function GF(t,e){if(t&1&&w(0,OF,2,0,"p",44)(1,PF,2,1,"p",45)(2,AF,2,0,"p",44)(3,RF,6,0,"div",34)(4,zF,6,1,"ul",46),t&2){let n,i=m();S(i.loading()&&!i.loaded()?0:(n=i.error())?1:i.isRepo()?i.commits().length===0?3:4:2,n)}}var RE=["var(--morse-accent)","var(--morse-success)","var(--morse-number)","var(--morse-typename)","var(--morse-keyword)","var(--morse-info)","var(--morse-warn)"],tg=16,LE=32,qF=180,Tu=class t{expanded=te(!1);morse=N(Ze);shell=N(Ht);git=N(Su);workspace=N(zi);tabs=N(dn);commits=this.git.commits;branch=this.git.branch;root=this.git.root;isRepo=this.git.isRepo;loading=this.git.loading;loaded=this.git.loaded;hasMore=this.git.hasMore;error=this.git.error;changesCollapsed=this.shell.gitChangesCollapsed;historyCollapsed=this.shell.gitHistoryCollapsed;changesHeight=this.shell.gitChangesHeight;changes=E(()=>{let e=this.workspace.status();if(e===void 0||!e.isRepo)return[];let n=[];for(let i of e.files){let o=xh(i.status);o!==void 0&&n.push({path:i.path,kind:o})}return n.sort((i,o)=>i.path.localeCompare(o.path))});rowHeight=LE;copied=O(void 0);entries=E(()=>{let e=this.commits(),n=AE(e),i=this.expanded()?3:1;return{laneCount:n.laneCount,rows:n.rows.map((o,r)=>{let s=e[r],a=s.refs.slice(0,i),c=s.refs.slice(i);return{row:o,commit:s,refs:a,moreRefs:c.length,restTitle:c.map(l=>this.refLabel(l)).join(", ")}})}});graphWidth=E(()=>Math.max(1,this.entries().laneCount)*tg);constructor(){se(()=>{!this.shell.gitPanelOpen()||!this.morse.workspace().cwd||this.git.refresh()})}refresh(){this.git.refresh()}onScroll(e){let n=e.target;n.scrollHeight-n.scrollTop-n.clientHeight<600&&this.git.loadMore()}close(){this.shell.closeGitPanel()}openChange(e){this.tabs.openFile(e)}dirOf(e){let n=e.lastIndexOf("/");return n===-1?"":e.slice(0,n+1)}baseOf(e){let n=e.lastIndexOf("/");return n===-1?e:e.slice(n+1)}toggleExpanded(){this.shell.toggleGitPanelExpanded()}toggleChanges(){this.shell.toggleGitChanges()}toggleHistory(){this.shell.toggleGitHistory()}changesHeightPx(){return this.changesCollapsed()||this.historyCollapsed()?null:this.changesHeight()??null}startResize(e){e.preventDefault();let n=e.currentTarget,i=n.parentElement;if(!i)return;let o=i.getBoundingClientRect().top,r=i.getBoundingClientRect().bottom;n.setPointerCapture(e.pointerId);let s=0,a=0,c=()=>{s=0,this.shell.setGitChangesHeight(a,!1)},l=f=>{a=Math.min(r-o-80,f.clientY-o),s===0&&(s=requestAnimationFrame(c))},p=()=>{s!==0&&(cancelAnimationFrame(s),c()),this.shell.setGitChangesHeight(a),n.removeEventListener("pointermove",l),n.removeEventListener("pointerup",p),n.removeEventListener("pointercancel",p)};n.addEventListener("pointermove",l),n.addEventListener("pointerup",p),n.addEventListener("pointercancel",p)}startWidthResize(e){e.preventDefault(),this.shell.gitPanelExpanded()&&this.shell.toggleGitPanelExpanded();let n=e.currentTarget,i=n.parentElement,o=e.clientX,r=i?.getBoundingClientRect().width??340,s=n.closest(".shell"),a=s?.querySelector(".nav"),c=s?.getBoundingClientRect().width??window.innerWidth,l=this.shell.navigationCollapsed()?0:a?.getBoundingClientRect().width??240,p=Math.max(320,c-l-qF);n.setPointerCapture(e.pointerId),s?.style.setProperty("transition","none"),i?.classList.add("resizing");let f=0,_=this.shell.gitPanelWidth()??Math.round(r),x=()=>{f=0,this.shell.setGitPanelWidth(_,!1)},C=P=>{_=Math.min(p,r+(o-P.clientX)),f===0&&(f=requestAnimationFrame(x))},T=()=>{f!==0&&(cancelAnimationFrame(f),x()),s?.style.removeProperty("transition"),i?.classList.remove("resizing"),this.shell.setGitPanelWidth(_),n.removeEventListener("pointermove",C),n.removeEventListener("pointerup",T),n.removeEventListener("pointercancel",T)};n.addEventListener("pointermove",C),n.addEventListener("pointerup",T),n.addEventListener("pointercancel",T)}resetWidth(){this.shell.resetGitPanelWidth()}refLabel(e){if(e.startsWith("tag: "))return e.slice(5);let n=e.indexOf(" -> ");return n===-1?e:e.slice(n+4)}refKind(e){return e.startsWith("tag: ")?"tag":e.includes("HEAD")?"head":"local"}when(e){let n=Date.parse(e);if(!Number.isFinite(n))return"";let i=Math.max(0,Math.round((Date.now()-n)/1e3));if(i<60)return`${i}s`;let o=Math.round(i/60);if(o<60)return`${o}m`;let r=Math.round(o/60);return r<24?`${r}h`:`${Math.round(r/24)}d`}async copy(e){try{await navigator.clipboard.writeText(e.hash),this.copied.set(e.hash),setTimeout(()=>{this.copied()===e.hash&&this.copied.set(void 0)},1200)}catch{}}x(e){return e*tg+tg/2}y(e){return e*LE}color(e){return RE[e%RE.length]}path(e){let n=this.x(e.fromLane),i=this.y(e.fromY),o=this.x(e.toLane),r=this.y(e.toY);if(n===o)return`M ${n} ${i} L ${o} ${r}`;let s=(i+r)/2;return`M ${n} ${i} C ${n} ${s}, ${o} ${s}, ${o} ${r}`}rowColor(e){return this.color(e.color)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-git-panel"]],inputs:{expanded:[1,"expanded"]},decls:31,vars:19,consts:[["aria-label","Git history",1,"panel"],["role","separator","aria-orientation","vertical","aria-label","Resize the git panel","title","Drag to resize",1,"edge-resize",3,"pointerdown","dblclick"],[1,"head"],[1,"brand",3,"title"],["viewBox","0 0 16 16","aria-hidden","true"],["cx","4.5","cy","3.5","r","1.8"],["cx","4.5","cy","12.5","r","1.8"],["cx","11.5","cy","6.5","r","1.8"],["d","M4.5 5.3v5.4"],["d","M4.5 5.3c0 2.4 7 1 7 3"],[1,"branch",3,"title"],[1,"count"],[1,"grow"],["type","button",1,"icon",3,"click","title"],["viewBox","0 0 16 16","aria-hidden","true",1,"glyph"],["type","button","title","Refresh history","aria-label","Refresh history",1,"icon",3,"click","disabled"],["type","button","title","Hide the git panel","aria-label","Hide the git panel",1,"icon",3,"click"],[1,"body"],[1,"history"],[1,"section-head"],["type","button",1,"section-toggle",3,"click"],[1,"chevron"],[1,"section-title"],["d","M3.5 6.5h3v-3"],["d","M12.5 9.5h-3v3"],["d","M6.5 6.5 3 3"],["d","M9.5 9.5 13 13"],["d","M6.5 3.5h-3v3"],["d","M9.5 12.5h3v-3"],["d","M3.5 3.5 8 8"],["d","M12.5 12.5 8 8"],["aria-label","Uncommitted changes",1,"changes"],[1,"section-count"],["role","separator","aria-orientation","horizontal","aria-label","Resize the git sections","title","Drag to resize",1,"divider",3,"pointerdown"],[1,"empty"],[1,"change-list"],["aria-hidden","true",1,"mark"],["viewBox","0 0 24 24",1,"ring"],["cx","12","cy","12","r","10"],["viewBox","0 0 24 24",1,"check"],["d","M7.5 12.5 11 16l6-7"],["type","button",1,"change",3,"click","title"],[1,"change-dir"],[1,"change-name"],[1,"hint"],[1,"hint","error"],[1,"list"],["aria-hidden","true",1,"mark","node"],["viewBox","0 0 24 24"],["d","M12 3v18",1,"line"],["cx","12","cy","12","r","3.4",1,"dot"],[1,"list",3,"scroll"],[1,"commit",3,"expanded"],[1,"more"],[1,"commit"],["aria-hidden","true",1,"graph"],["r","3.4"],[1,"subject"],[1,"refs"],[1,"meta"],[1,"hash",3,"title"],["aria-hidden","true",1,"sep"],[1,"when"],["type","button",1,"copy",3,"click","title"],[1,"flow"],[1,"ref",3,"title","kind-head","kind-local","kind-tag"],[1,"ref",3,"title"],[1,"author"]],template:function(n,i){if(n&1&&(h(0,"aside",0)(1,"div",1),F("pointerdown",function(r){return i.startWidthResize(r)})("dblclick",function(){return i.resetWidth()}),g(),h(2,"header",2)(3,"span",3),rt(),h(4,"svg",4),ce(5,"circle",5)(6,"circle",6)(7,"circle",7)(8,"path",8)(9,"path",9),g(),u(10," Git "),g(),w(11,CF,2,2,"span",10),w(12,EF,2,1,"span",11),Jt(),ce(13,"span",12),h(14,"button",13),F("click",function(){return i.toggleExpanded()}),w(15,wF,5,0,":svg:svg",14)(16,SF,5,0,":svg:svg",14),g(),h(17,"button",15),F("click",function(){return i.refresh()}),u(18," \u27F3 "),g(),h(19,"button",16),F("click",function(){return i.close()}),u(20," \u2715 "),g()(),h(21,"div",17),w(22,NF,10,9),h(23,"section",18)(24,"div",19)(25,"button",20),F("click",function(){return i.toggleHistory()}),h(26,"span",21),u(27,"\u203A"),g(),h(28,"span",22),u(29,"History"),g()()(),w(30,GF,5,1),g()()()),n&2){let o;X("full",i.expanded()),d(3),ie("title",i.root()??""),d(8),S((o=i.branch())?11:-1,o),d(),S(i.expanded()&&i.commits().length>0?12:-1),d(2),ie("title",i.expanded()?"Fit the git panel back into the sidebar":"Expand the git graph"),J("aria-label",i.expanded()?"Collapse the git panel":"Expand the git panel")("aria-pressed",i.expanded()),d(),S(i.expanded()?15:16),d(2),ie("disabled",i.loading()),d(4),X("changes-collapsed",i.changesCollapsed())("history-collapsed",i.historyCollapsed()),d(),S(i.isRepo()?22:-1),d(3),J("aria-expanded",!i.historyCollapsed()),d(),X("open",!i.historyCollapsed()),d(4),S(i.historyCollapsed()?-1:30)}},styles:['[_nghost-%COMP%]{position:relative;display:block;min-width:0;min-height:0;height:100%;overflow:hidden;border-left:1px solid var(--%NS%morse-border);background:var(--%NS%morse-nav-bg)}.edge-resize[_ngcontent-%COMP%]{position:absolute;top:0;bottom:0;left:0;width:6px;z-index:3;cursor:ew-resize}.edge-resize[_ngcontent-%COMP%]:hover, .edge-resize[_ngcontent-%COMP%]:active{background:color-mix(in srgb,var(--%NS%morse-accent) 45%,transparent)}.panel.resizing[_ngcontent-%COMP%] .body[_ngcontent-%COMP%]{pointer-events:none}.panel.resizing[_ngcontent-%COMP%] .graph[_ngcontent-%COMP%] path.flow[_ngcontent-%COMP%]{animation:none}.head[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0;z-index:1;display:flex;align-items:center;gap:6px;min-height:var(--%NS%morse-head-height);padding:0 6px 0 10px;border-bottom:1px solid var(--%NS%morse-border);background:var(--%NS%morse-nav-bg)}.brand[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;font-weight:600}.brand[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}.branch[_ngcontent-%COMP%], .ref[_ngcontent-%COMP%]{flex:none;padding:0 6px;border-radius:4px;font-family:var(--%NS%morse-font-mono);font-size:10px;line-height:16px;background:color-mix(in srgb,var(--%NS%morse-fg-muted) 12%,transparent);color:var(--%NS%morse-fg-muted)}.branch[_ngcontent-%COMP%], .ref[_ngcontent-%COMP%]{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.commit.expanded[_ngcontent-%COMP%] .ref[_ngcontent-%COMP%]{max-width:240px}.branch[_ngcontent-%COMP%], .ref.kind-head[_ngcontent-%COMP%]{color:var(--%NS%morse-accent)}.ref.kind-local[_ngcontent-%COMP%]{color:var(--%NS%morse-success)}.ref.kind-tag[_ngcontent-%COMP%]{color:var(--%NS%morse-typename)}.grow[_ngcontent-%COMP%]{flex:1}.icon[_ngcontent-%COMP%]{flex:none;width:24px;height:24px;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-muted);font-size:13px;line-height:1;cursor:pointer}.icon[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}.count[_ngcontent-%COMP%]{color:var(--%NS%morse-fg-muted);font-size:11px}.body[_ngcontent-%COMP%]{position:absolute;top:var(--%NS%morse-head-height);right:0;bottom:0;left:0;display:flex;flex-direction:column;min-height:0}.changes[_ngcontent-%COMP%]{flex:none;height:45%;display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden}.body.changes-collapsed[_ngcontent-%COMP%] .changes[_ngcontent-%COMP%], .body.history-collapsed[_ngcontent-%COMP%] .changes[_ngcontent-%COMP%]{height:auto}.body.history-collapsed[_ngcontent-%COMP%] .changes[_ngcontent-%COMP%]{flex:1}.divider[_ngcontent-%COMP%]{flex:none;position:relative;height:5px;border-top:1px solid var(--%NS%morse-border);background:transparent;cursor:ns-resize}.divider[_ngcontent-%COMP%]:hover{border-top-color:var(--%NS%morse-accent);background:color-mix(in srgb,var(--%NS%morse-accent) 30%,transparent)}.divider[_ngcontent-%COMP%]:after{content:"";position:absolute;inset:-3px 0}.divider.gone[_ngcontent-%COMP%]{display:none}.history[_ngcontent-%COMP%]{flex:1;min-height:0;display:flex;flex-direction:column}.body.history-collapsed[_ngcontent-%COMP%] .history[_ngcontent-%COMP%]{flex:none}.section-head[_ngcontent-%COMP%]{display:flex;flex:none;align-items:center}.section-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:5px;flex:1;min-width:0;padding:5px 10px;border:0;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer}.section-toggle[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}.chevron[_ngcontent-%COMP%]{flex:none;display:inline-block;color:var(--%NS%morse-fg-muted);font-size:11px;line-height:1;transition:transform .12s ease}.chevron.open[_ngcontent-%COMP%]{transform:rotate(90deg)}.section-title[_ngcontent-%COMP%]{font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--%NS%morse-fg-muted)}.section-count[_ngcontent-%COMP%]{font-size:10.5px;color:var(--%NS%morse-fg-muted)}.change-list[_ngcontent-%COMP%]{margin:0;padding:0 0 6px;list-style:none}.change[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;width:100%;padding:2px 10px;border:0;background:none;color:var(--%NS%morse-fg);font:inherit;text-align:left;cursor:pointer}.change[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--%NS%morse-hover)}.change-dir[_ngcontent-%COMP%]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--%NS%morse-fg-muted);font-size:11px}.change-name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.empty[_ngcontent-%COMP%]{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:16px;color:var(--%NS%morse-fg-muted);font-size:11.5px;text-align:center}.mark[_ngcontent-%COMP%]{position:relative;display:inline-grid;place-items:center;width:38px;height:38px;animation:_ngcontent-%COMP%_mark-breathe 2.8s ease-in-out infinite}.mark[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{position:absolute;inset:0;width:100%;height:100%;fill:none;stroke-linecap:round;stroke-linejoin:round}.mark[_ngcontent-%COMP%] .ring[_ngcontent-%COMP%]{stroke:color-mix(in srgb,var(--%NS%morse-fg-muted) 40%,transparent);stroke-width:1.4}.mark[_ngcontent-%COMP%] .check[_ngcontent-%COMP%]{stroke:var(--%NS%morse-success);stroke-width:2;stroke-dasharray:20;stroke-dashoffset:20;animation:_ngcontent-%COMP%_check-draw .9s ease-out .12s forwards}.mark.node[_ngcontent-%COMP%] .line[_ngcontent-%COMP%]{stroke:color-mix(in srgb,var(--%NS%morse-fg-muted) 35%,transparent);stroke-width:1.4}.mark.node[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{stroke:var(--%NS%morse-accent);stroke-width:1.6;transform-box:fill-box;transform-origin:center;animation:_ngcontent-%COMP%_node-pulse 2.8s ease-in-out infinite}.mark[_ngcontent-%COMP%]:after{content:"";position:absolute;inset:-4px;border-radius:50%;border:1px solid color-mix(in srgb,var(--%NS%morse-success) 45%,transparent);animation:_ngcontent-%COMP%_mark-ping 2.8s ease-out infinite}.mark.node[_ngcontent-%COMP%]:after{border-color:color-mix(in srgb,var(--%NS%morse-accent) 45%,transparent)}@keyframes _ngcontent-%COMP%_mark-breathe{0%,to{transform:scale(.95)}50%{transform:scale(1.05)}}@keyframes _ngcontent-%COMP%_check-draw{to{stroke-dashoffset:0}}@keyframes _ngcontent-%COMP%_node-pulse{0%,to{transform:scale(.7);opacity:.6}50%{transform:scale(1.15);opacity:1}}@keyframes _ngcontent-%COMP%_mark-ping{0%{transform:scale(.85);opacity:.7}70%,to{transform:scale(1.35);opacity:0}}@media(prefers-reduced-motion:reduce){.mark[_ngcontent-%COMP%], .mark[_ngcontent-%COMP%]:after{animation:none}.mark[_ngcontent-%COMP%] .check[_ngcontent-%COMP%]{animation:none;stroke-dashoffset:0}.mark.node[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{animation:none}}.badge[_ngcontent-%COMP%]{flex:none;padding:0 4px;border-radius:4px;font-family:var(--%NS%morse-font-mono);font-size:9.5px;line-height:15px;color:var(--%NS%morse-fg-muted)}.badge.M[_ngcontent-%COMP%]{color:var(--%NS%morse-warn)}.badge.A[_ngcontent-%COMP%], .badge.U[_ngcontent-%COMP%]{color:var(--%NS%morse-success)}.badge.D[_ngcontent-%COMP%], .badge.C[_ngcontent-%COMP%]{color:var(--%NS%morse-error)}.badge.R[_ngcontent-%COMP%]{color:var(--%NS%morse-info)}.list[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;margin:0;padding:2px 0 10px;list-style:none}.hint[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;padding:12px;color:var(--%NS%morse-fg-muted);font-size:12px;line-height:1.5}.hint.error[_ngcontent-%COMP%]{color:var(--%NS%morse-error)}.more[_ngcontent-%COMP%]{padding:10px 12px;color:var(--%NS%morse-fg-muted);font-size:11px;text-align:center}.commit[_ngcontent-%COMP%]{display:flex;flex-wrap:nowrap;align-items:center;gap:10px;height:32px;padding-right:8px}.commit[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}.graph[_ngcontent-%COMP%]{flex:none;display:block;overflow:visible}.graph[_ngcontent-%COMP%] path[_ngcontent-%COMP%]{fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.graph[_ngcontent-%COMP%] circle[_ngcontent-%COMP%]{stroke:var(--%NS%morse-nav-bg);stroke-width:1.6}.graph[_ngcontent-%COMP%] path.flow[_ngcontent-%COMP%]{stroke:var(--%NS%morse-fg);stroke-dasharray:5 15;stroke-linecap:round;opacity:.35;animation:_ngcontent-%COMP%_graph-flow 1.4s linear infinite}@keyframes _ngcontent-%COMP%_graph-flow{to{stroke-dashoffset:-20}}@media(prefers-reduced-motion:reduce){.graph[_ngcontent-%COMP%] path.flow[_ngcontent-%COMP%]{animation:none;opacity:0}}.subject[_ngcontent-%COMP%]{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;color:var(--%NS%morse-fg)}.refs[_ngcontent-%COMP%]{flex:0 1 auto;display:flex;align-items:center;gap:4px;min-width:0}.grow[_ngcontent-%COMP%]{flex:1;min-width:8px}.meta[_ngcontent-%COMP%]{flex:none;display:flex;align-items:center;gap:6px;color:var(--%NS%morse-fg-muted);font-size:11px;white-space:nowrap}.hash[_ngcontent-%COMP%]{font-family:var(--%NS%morse-font-mono)}.author[_ngcontent-%COMP%]{display:none;max-width:170px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.commit.expanded[_ngcontent-%COMP%] .author[_ngcontent-%COMP%]{display:inline}.sep[_ngcontent-%COMP%]{opacity:.5}.copy[_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:11px;cursor:pointer;opacity:0}.commit[_ngcontent-%COMP%]:hover .copy[_ngcontent-%COMP%]{opacity:1}.copy[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--%NS%morse-border);color:var(--%NS%morse-fg)}']})};var Ls=520,FE=70,Du=class t{animation=N(ln);async play(e,n){let i=this.resolveTarget();if(!this.animation.isEnabled||!n||!i||e.length===0||typeof document>"u")return;let o=Ls+(e.length-1)*FE;e.forEach((r,s)=>{this.launch(r,n,i,s*FE)}),await WF(o)}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,i,o){let r=this.createGhost(e,n);document.body.appendChild(r);let s=Math.min(n.y,i.y)-Math.max(60,Math.abs(n.y-i.y)*.35);rn(r,{translateX:[n.x,i.x],translateY:[{to:n.y,duration:Ls*.18},{to:s,duration:Ls*.42},{to:i.y,duration:Ls*.4}],rotate:[0,-8,6,0],scale:[1,1.04,.86,.42],opacity:[1,1,.9,0],duration:Ls,delay:o,ease:"inOut(2)",onComplete:()=>r.remove()}),setTimeout(()=>r.remove(),o+Ls+400)}createGhost(e,n){let i=document.createElement("div");if(i.className="drop-ghost",e.thumbnail){let r=document.createElement("img");r.src=e.thumbnail,r.alt="",i.appendChild(r)}else{let r=document.createElement("span");r.className="drop-ghost-glyph",r.textContent="\u25A4",i.appendChild(r)}let o=document.createElement("span");return o.className="drop-ghost-name",o.textContent=e.name,i.appendChild(o),i}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};function WF(t){return new Promise(e=>setTimeout(e,t))}var Mu=class t{attachments=N(Ui);flight=N(Du);uploads=N(Ds);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 i=e.dataTransfer;if(!i)return;let o=Array.from(i.files??[]),{images:r}=await this.attachments.read(o.filter(T=>T.type.startsWith("image/"))),s=ZF(i),a=o.filter(T=>!T.type.startsWith("image/")),c=this.uploads.available()&&a.length>0?this.uploads.upload(a):Promise.resolve({added:[],failed:a.map(T=>T.name)}),l=[...s.paths.map(T=>VE(T,n)),...s.names,...a.map(T=>T.name)],p=e.clientX>0||e.clientY>0?{x:e.clientX,y:e.clientY}:YF();await this.flight.play([...r.map(T=>({name:T.name,thumbnail:`data:${T.mimeType};base64,${T.data}`})),...l.map(T=>({name:T}))],p);let f=await c,_=[...s.paths.map(T=>VE(T,n)),...s.names,...f.added.map(T=>T.path),...f.failed];this.attachments.add(r),this.attachments.addMentions(_);let x=[];if(r.length>0&&x.push(`${r.length} image${r.length===1?"":"s"} attached`),_.length>0&&x.push(`${_.length} file${_.length===1?"":"s"} added to the prompt`),x.length>0){this.attachments.say("info",x.join(" \xB7 "));return}let C=Array.from(i.types??[]).join(", ")||"none";this.attachments.say("warn",`That drop carried no file (types: ${C}).`)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};function YF(){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 KF=["application/vnd.code.uri-list","ResourceURLs","text/uri-list"];function ZF(t){let e=[];for(let o of[...KF,"text/plain"])for(let r of QF(t.getData(o)))e.push(r);let n=[],i=[];for(let o of e){if(o.startsWith("file://")){let s=t3(o);s&&n.push(s);continue}if(/^[a-z]+:\/\//i.test(o))continue;if(e3(o)){n.push(o);continue}let r=JF(o);r&&i.push(r)}return{paths:Array.from(new Set(n)),names:Array.from(new Set(i))}}function QF(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(i=>{if(typeof i=="string")return i;let o=i,r=o.fsPath??o.uri??o.path;return typeof r=="string"?r:""}).filter(i=>i.length>0)}catch{}return XF(e)}function XF(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 JF(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 e3(t){return!!(t.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t))}function t3(t){try{let e=new URL(t);return decodeURIComponent(e.pathname)}catch{return}}function VE(t,e){if(!e)return t;let n=e.endsWith("/")?e:`${e}/`;return t.startsWith(n)?t.slice(n.length):t}var n3="https://registry.npmjs.org/@supanadit/morse-web/latest";function i3(t){return`https://github.com/supanadit/morse/releases/tag/v${t}`}var o3=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 r3(t){let e=t;return typeof e?.version=="string"?e.version:void 0}function s3(t,e){let n=$E(t),i=$E(e);if(n===void 0||i===void 0)return!1;for(let o=0;o<n.numbers.length;o+=1)if(n.numbers[o]!==i.numbers[o])return n.numbers[o]>i.numbers[o];return n.prerelease===i.prerelease?!1:n.prerelease===void 0?!0:i.prerelease===void 0?!1:n.prerelease>i.prerelease}function a3(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 jE(){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 $E(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 Fs=class t{morse=N(Ze);loader=N(o3);notice=O(void 0);started=!1;available=this.notice.asReadonly();constructor(){se(()=>{let e=this.morse.capabilities();this.started||jE()===void 0&&e?.updateCheck!==!0||(this.started=!0,this.check(this.morse.version(),e?.hostKind??"server"))})}async check(e,n,i=this.loader){try{let o=jE()??(i===void 0?void 0:r3(await i(n3)));if(o===void 0||!s3(o,e))return;this.notice.set({current:e,latest:o,hint:a3(n,o),url:i3(o)})}catch{}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};var c3=(t,e)=>e.node.path;function l3(t,e){if(t&1){let n=$();h(0,"div",8),F("pointerdown",function(o){D(n);let r=m();return M(r.startResize(o))}),g()}}function d3(t,e){t&1&&(h(0,"p",9),u(1,"Loading files\u2026"),g())}function u3(t,e){t&1&&(h(0,"p",10),u(1),g()),t&2&&(d(),k(e))}function p3(t,e){t&1&&(h(0,"p",9),u(1,"No files found."),g())}function f3(t,e){if(t&1&&(h(0,"span",17),u(1),g()),t&2){let n=e,i=m(5);Tn("badge "+n),ie("title",i.badgeTitle(n)),d(),k(n)}}function m3(t,e){if(t&1&&w(0,f3,2,4,"span",16),t&2){let n,i=m().$implicit,o=m(3);S((n=o.changeOf(i.node.path))?0:-1,n)}}function h3(t,e){t&1&&ce(0,"span",15)}function g3(t,e){if(t&1){let n=$();h(0,"button",12),F("click",function(){let o=D(n).$implicit,r=m(3);return M(r.onRow(o.node))}),h(1,"span",13),u(2),g(),h(3,"span",14),u(4),g(),w(5,m3,1,1)(6,h3,1,0,"span",15),g()}if(t&2){let n=e.$implicit,i=m(3);At("padding-left",6+n.depth*12,"px"),X("dir",n.node.kind==="dir"),ie("title",n.node.path),d(2),k(i.glyph(n.node)),d(2),k(n.node.name),d(),S(n.node.kind==="file"?5:i.dirChanged(n.node.path)?6:-1)}}function y3(t,e){if(t&1&&oe(0,g3,7,8,"button",11,c3),t&2){let n=m(2);re(n.rows())}}function _3(t,e){if(t&1&&(h(0,"div",7),w(1,d3,2,0,"p",9)(2,u3,2,1,"p",10)(3,p3,2,0,"p",9)(4,y3,2,0),g()),t&2){let n,i=m();d(),S(i.isLoading()&&i.rows().length===0?1:(n=i.errorMessage())?2:i.rows().length===0?3:4,n)}}var v3=140,ku=class t{morse=N(Ze);tabs=N(dn);shell=N(Ht);workspace=N(zi);host=N(Bt);height=this.shell.explorerHeight;expanded=O(new Set);folded=O(!1);expandedFor="";tree=E(()=>ME(this.workspace.files()));rows=E(()=>b3(this.tree(),this.expanded()));fileCount=E(()=>BE(this.tree()));collapsed=this.folded.asReadonly();isLoading=this.workspace.busy;errorMessage=this.workspace.error;changes=E(()=>Ud(this.workspace.status()));changedDirs=E(()=>{let e=new Set;for(let n of this.changes().keys()){let i=n.split("/");for(let o=1;o<i.length;o+=1)e.add(i.slice(0,o).join("/"))}return e});constructor(){se(()=>{let e=this.morse.state().workspace.cwd;ii(()=>{e.length>0&&e!==this.expandedFor&&(this.expanded.set(new Set),this.expandedFor=e)})})}glyph(e){return e.kind==="dir"?this.expanded().has(e.path)?"\u25BE":"\u25B8":Eu(e.name)}isExpanded(e){return this.expanded().has(e)}changeOf(e){return this.changes().get(e)}badgeTitle(e){switch(e){case"M":return"Modified";case"A":return"Added";case"D":return"Deleted";case"R":return"Renamed";case"U":return"Untracked";case"C":return"Conflict"}}dirChanged(e){return this.changedDirs().has(e)}toggleFold(){this.folded.update(e=>!e)}refresh(){this.workspace.refresh()}onRow(e){if(e.kind==="dir"){this.expanded.update(n=>{let i=new Set(n);return i.has(e.path)?i.delete(e.path):i.add(e.path),i});return}this.tabs.openFile(e.path)}startResize(e){e.preventDefault();let n=this.host.nativeElement,i=n.getBoundingClientRect().bottom,o=n.parentElement?.getBoundingClientRect().top??0,r=Math.max(v3,i-o-120),s=e.currentTarget;s.setPointerCapture(e.pointerId);let a=l=>{this.shell.setExplorerHeight(Math.min(r,i-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)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-file-explorer"]],hostVars:4,hostBindings:function(n,i){n&2&&(At("height",i.collapsed()?null:i.height(),"px"),X("sized",i.height()!==void 0&&!i.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"],[1,"rows"],["role","separator","aria-orientation","horizontal","aria-label","Resize the file explorer","title","Drag to resize",1,"resize",3,"pointerdown"],[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"],["title","Contains changes","aria-hidden","true",1,"dot"],[3,"class","title"],[3,"title"]],template:function(n,i){n&1&&(h(0,"div",0),w(1,l3,1,0,"div",1),h(2,"button",2),F("click",function(){return i.toggleFold()}),h(3,"span",3),u(4,"\u203A"),g(),h(5,"span",4),u(6,"Explorer"),g(),h(7,"span",5),u(8),g()(),h(9,"button",6),F("click",function(){return i.refresh()}),u(10," \u27F3 "),g()(),w(11,_3,5,1,"div",7)),n&2&&(d(),S(i.collapsed()?-1:1),d(),J("aria-expanded",!i.collapsed()),d(),X("open",!i.collapsed()),d(5),k(i.fileCount()),d(3),S(i.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)}.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}.badge[_ngcontent-%COMP%]{flex:none;padding:0 4px;border-radius:4px;font-family:var(--%NS%morse-font-mono);font-size:9.5px;line-height:15px;color:var(--%NS%morse-fg-muted)}.badge.M[_ngcontent-%COMP%]{color:var(--%NS%morse-warn)}.badge.A[_ngcontent-%COMP%], .badge.U[_ngcontent-%COMP%]{color:var(--%NS%morse-success)}.badge.D[_ngcontent-%COMP%], .badge.C[_ngcontent-%COMP%]{color:var(--%NS%morse-error)}.badge.R[_ngcontent-%COMP%]{color:var(--%NS%morse-info)}.dot[_ngcontent-%COMP%]{flex:none;width:6px;height:6px;border-radius:50%;background:var(--%NS%morse-warn)}.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 b3(t,e){let n=[],i=(o,r)=>{for(let s of o)n.push({node:s,depth:r}),s.kind==="dir"&&e.has(s.path)&&i(s.children,r+1)};return i(t,0),n}function BE(t){let e=0;for(let n of t)e+=n.kind==="file"?1:BE(n.children);return e}var x3=["search"],C3=["list"],E3=(t,e)=>e.path||"all";function w3(t,e){if(t&1&&(h(0,"span",17),u(1),g()),t&2){let n=m().$implicit;d(),k(n.path)}}function S3(t,e){t&1&&(h(0,"span",19),u(1,"\u2713"),g())}function T3(t,e){if(t&1){let n=$();h(0,"button",15),F("mouseenter",function(){let o=D(n).$index,r=m();return M(r.active.set(o))})("click",function(){let o=D(n).$implicit,r=m();return M(r.pick(o))}),h(1,"span",16),u(2),g(),w(3,w3,2,1,"span",17),h(4,"span",18),u(5),g(),w(6,S3,2,0,"span",19),g()}if(t&2){let n=e.$implicit,i=m();X("all",n.all)("active",n.path===i.rows()[i.active()].path)("selected",n.path===i.selected()),ie("title",n.path||"Every project pi knows about"),J("aria-selected",n.path===i.selected()),d(2),k(n.name),d(),S(n.all?-1:3),d(2),k(n.sessionCount),d(),S(n.path===i.selected()?6:-1)}}var D3="All projects";function M3(t,e,n){let i={path:"",name:D3,sessionCount:n,all:!0},o=e.trim().toLowerCase(),r=t.filter(s=>o.length===0||`${s.name} ${s.path}`.toLowerCase().includes(o)).map(s=>K(V({},s),{all:!1}));return[i,...r]}var Iu=class t{projects=te.required();selected=te("");totalSessions=te(0);select=at();close=at();search=Xe("search");list=Xe("list");query=O("");active=O(0);rows=E(()=>M3(this.projects(),this.query(),this.totalSessions()));constructor(){no(()=>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 i=e.getBoundingClientRect(),o=n.getBoundingClientRect();o.top<i.top?e.scrollTop-=i.top-o.top:o.bottom>i.bottom&&(e.scrollTop+=o.bottom-i.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(i=>Math.min(i+1,Math.max(0,n.length-1)));return;case"ArrowUp":e.preventDefault(),this.active.update(i=>Math.max(0,i-1));return;case"Enter":{let i=n[this.active()];i&&(e.preventDefault(),this.pick(i));return}default:return}}onEscape(){this.close.emit()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-project-filter"]],viewQuery:function(n,i){n&1&>(i.search,x3,5)(i.list,C3,5),n&2&&vt(2)},hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.onEscape()},Mt)},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,i){n&1&&(h(0,"div",2),F("click",function(){return i.close.emit()}),h(1,"div",3),F("click",function(r){return r.stopPropagation()}),h(2,"div",4)(3,"strong",5),u(4,"Filter by project"),g(),h(5,"button",6),F("click",function(){return i.close.emit()}),u(6,"\xD7"),g()(),h(7,"div",7)(8,"span",8),rt(),h(9,"svg",9),ce(10,"circle",10)(11,"path",11),g()(),Jt(),h(12,"input",12,0),F("input",function(r){return i.onQuery(r)})("keydown",function(r){return i.onKeydown(r)}),g()(),h(14,"div",13,1),oe(16,T3,7,12,"button",14,E3),g()()()),n&2&&(d(12),ie("value",i.query()),d(4),re(i.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 k3=["search"],UE=(t,e)=>e.path,zE=(t,e)=>e.id;function I3(t,e){if(t&1){let n=$();y(0,"button",15),A("click",function(){D(n);let o=m();return M(o.openFilter())}),y(1,"span",16),u(2,"\u25A4"),b(),y(3,"span",17),u(4),b()()}if(t&2){let n=m();X("filtered",n.selectedProject()!==void 0),q("title",n.selectedProject()?.path??"Every project pi knows about"),J("aria-expanded",n.filterOpen()),d(4),k(n.selectedProject()?.name??"All projects")}}function N3(t,e){if(t&1){let n=$();y(0,"morse-project-filter",18),A("select",function(o){D(n);let r=m();return M(r.onProjectSelect(o))})("close",function(){D(n);let o=m();return M(o.closeFilter())}),b()}if(t&2){let n=m();q("projects",n.projectOptions())("selected",n.projectFilter())("totalSessions",n.totalSessions())}}function O3(t,e){if(t&1){let n=$();y(0,"li")(1,"button",22),A("click",function(){let o=D(n).$implicit,r=m(2);return M(r.activate(o))})("contextmenu",function(o){let r=D(n).$implicit,s=m(2);return M(s.openMenu(o,r))}),ve(2,"span",23),y(3,"span",24)(4,"span",25),u(5),b(),y(6,"span",26),u(7),b()()()()}if(t&2){let n=e.$implicit,i=m(2);d(),X("active",n.id===i.activeSessionId()),q("title",n.id),d(4),k(n.title),d(2),k(i.activityLabel(n))}}function P3(t,e){if(t&1&&(y(0,"section",9)(1,"div",19)(2,"span",20),u(3,"In progress"),b(),y(4,"span",21),u(5),b()(),y(6,"ul"),oe(7,O3,8,5,"li",null,zE),b()()),t&2){let n=m();d(5),k(n.inProgress().length),d(2),re(n.inProgress())}}function A3(t,e){if(t&1&&(y(0,"span",33),u(1,"\u203A"),b()),t&2){let n=m(2).$implicit,i=m();X("open",!i.isCollapsed(n.path))}}function R3(t,e){if(t&1){let n=$();y(0,"div",27)(1,"button",28),A("click",function(){D(n);let o=m().$implicit,r=m();return M(r.toggleGroup(o.path))}),y(2,"span",29),u(3),b(),y(4,"span",30),u(5),b(),w(6,A3,2,2,"span",31),b(),y(7,"button",32),A("click",function(o){D(n);let r=m().$implicit,s=m();return M(s.newSession(o,r.path))}),u(8," + "),b()()}if(t&2){let n=m().$implicit,i=m();d(),q("title",n.path),J("aria-expanded",!i.isCollapsed(n.path)),d(2),k(n.name),d(2),k(n.sessions.length),d(),S(i.projectFilter()!==n.path?6:-1),d(),J("aria-label","New session in "+n.name)}}function L3(t,e){if(t&1&&(y(0,"div",19)(1,"span",20),u(2,"Sessions"),b(),y(3,"span",21),u(4),b()()),t&2){let n=m().$implicit;d(4),k(n.sessions.length)}}function F3(t,e){if(t&1){let n=$();y(0,"li")(1,"button",34),A("click",function(){let o=D(n).$implicit,r=m(3);return M(r.activate(o))})("contextmenu",function(o){let r=D(n).$implicit,s=m(3);return M(s.openMenu(o,r))}),y(2,"span",24)(3,"span",25),u(4),b()(),y(5,"span",35),u(6),b()()()}if(t&2){let n=e.$implicit,i=m(3);d(),X("active",n.id===i.activeSessionId()),q("title",n.id),d(3),k(n.title),d(2),k(i.age(n.updatedAt))}}function V3(t,e){if(t&1&&u(0),t&2){let n=m(5);ae(" No session matches \u201C",n.query(),"\u201D. ")}}function j3(t,e){t&1&&u(0," No sessions yet. ")}function $3(t,e){if(t&1&&(y(0,"li",36),w(1,V3,1,1)(2,j3,1,0),b()),t&2){let n=m(4);d(),S(n.query().length>0?1:2)}}function B3(t,e){if(t&1&&w(0,$3,3,1,"li",36),t&2){let n=m(2).$implicit;S(n.hiddenRunning===0?0:-1)}}function H3(t,e){if(t&1&&(y(0,"ul"),oe(1,F3,7,5,"li",null,zE,!1,B3,1,1),b()),t&2){let n=m().$implicit;d(),re(n.sessions)}}function U3(t,e){if(t&1&&(y(0,"section",9),w(1,R3,9,6,"div",27)(2,L3,5,1,"div",19),w(3,H3,4,1,"ul"),b()),t&2){let n=e.$implicit,i=m();d(),S(i.scope()==="global"?1:n.sessions.length>0?2:-1),d(2),S(i.scope()==="workspace"||!i.isCollapsed(n.path)?3:-1)}}function z3(t,e){t&1&&u(0," Looking for a project? ")}function G3(t,e){if(t&1&&(u(0),w(1,z3,1,0)),t&2){let n=m(2);ae(" No session matches \u201C",n.query(),"\u201D. "),d(),S(n.projectMatches().length>0?1:-1)}}function q3(t,e){t&1&&u(0," Nothing found. ")}function W3(t,e){if(t&1){let n=$();y(0,"button",38),A("click",function(){let o=D(n).$implicit,r=m(2);return M(r.filterToProject(o))}),u(1),b()}if(t&2){let n=e.$implicit;d(),wo(" Show all ",n.sessionCount," sessions in ",n.name," ")}}function Y3(t,e){if(t&1&&(y(0,"p",36),w(1,G3,2,2)(2,q3,1,0),b(),oe(3,W3,2,2,"button",37,UE)),t&2){let n=m();d(),S(n.query().length>0?1:2),d(2),re(n.projectMatches())}}function K3(t,e){t&1&&ve(0,"morse-file-explorer")}function Z3(t,e){if(t&1&&(y(0,"a",11)(1,"span",39),u(2,"\u2191"),b(),y(3,"span"),u(4,"Update available"),b(),y(5,"span",13),u(6),b()()),t&2){let n=e;q("href",n.url,xi)("title",n.hint+" You are on v"+n.current+"."),d(6),ae("v",n.latest)}}function Q3(t,e){t&1&&(y(0,"span",13),u(1),b()),t&2&&(d(),ae("v",e))}function X3(t,e){if(t&1){let n=$();y(0,"p",42),u(1,"Delete this session?"),b(),y(2,"p",43),u(3),b(),y(4,"button",44),A("click",function(){D(n);let o=m(2);return M(o.closeMenu())}),u(5,"Cancel"),b(),y(6,"button",45),A("click",function(){D(n);let o=m(),r=m();return M(r.deleteNow(o.session))}),u(7," Delete "),b()}if(t&2){let n=m();d(3),k(n.session.title)}}function J3(t,e){if(t&1){let n=$();y(0,"button",44),A("click",function(){D(n);let o=m(),r=m();return M(r.closeNow(o.session))}),u(1," Close session "),b(),y(2,"button",45),A("click",function(){D(n);let o=m(),r=m();return M(r.askDelete(o))}),u(3," Delete session\u2026 "),b()}}function eV(t,e){if(t&1){let n=$();y(0,"div",40),A("click",function(){D(n);let o=m();return M(o.closeMenu())})("contextmenu",function(o){D(n);let r=m();return o.preventDefault(),M(r.closeMenu())}),b(),y(1,"div",41),w(2,X3,8,1)(3,J3,4,0),b()}if(t&2){let n=e;d(),At("left",n.x,"px")("top",n.y,"px"),d(),S(n.confirming?2:3)}}var Nu=class t{morse=N(Ze);shell=N(Ht);shortcuts=N(An);update=N(Fs);tabs=N(dn);destroyRef=N(pt);searchInput=Xe("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:tV(n)});inProgress=E(()=>{let e=this.projectFilter();return this.morse.sessions().filter(n=>(e.length===0||n.cwd===e)&&this.isRunning(n)).sort((n,i)=>i.updatedAt-n.updatedAt)});groups=E(()=>{let e=this.morse.sessions();if(this.scope()==="workspace"){let n=this.morse.workspace(),i=this.morse.projects()[0];return[{path:i?.path??n.cwd,name:n.name||i?.name||"workspace",sessions:e,hiddenRunning:0}]}return this.morse.projects().map(n=>({path:n.path,name:n.name,sessions:e.filter(i=>i.cwd===n.path),hiddenRunning:0}))});visibleGroups=E(()=>{let e=this.query().trim().toLowerCase(),n=this.projectFilter(),i=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=>!i.has(c.id));return K(V({},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=>K(V({},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(K(V({},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(K(V({},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 i=Math.round(n/60);if(i<60)return`${i}m`;let o=Math.round(i/60);return o<24?`${o}h`:`${Math.round(o/24)}d`}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-session-nav"]],viewQuery:function(n,i){n&1&>(i.searchInput,k3,5),n&2&&vt()},hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.onEscape()},Mt)},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,i){if(n&1&&(y(0,"div",1)(1,"button",2),A("click",function(r){return i.newSession(r)}),u(2," New session "),b(),y(3,"button",3),A("click",function(){return i.refresh()}),u(4,"\u27F3"),b()(),y(5,"div",4),w(6,I3,5,5,"button",5),y(7,"input",6,0),A("input",function(r){return i.onQuery(r)}),b()(),w(9,N3,1,3,"morse-project-filter",7),y(10,"div",8),w(11,P3,9,1,"section",9),oe(12,U3,4,2,"section",9,UE,!1,Y3,5,1),b(),w(15,K3,1,0,"morse-file-explorer"),y(16,"div",10),w(17,Z3,7,3,"a",11),y(18,"button",12),A("click",function(){return i.openShortcuts()}),u(19," Keyboard shortcuts "),y(20,"span",13),u(21,"?"),b()(),y(22,"button",14),A("click",function(){return i.openAbout()}),u(23," About Morse "),w(24,Q3,2,1,"span",13),b()(),w(25,eV,4,5)),n&2){let o,r,s;d(6),S(i.filterable()?6:-1),d(),q("value",i.query()),d(2),S(i.filterOpen()?9:-1),d(2),S(i.inProgress().length>0?11:-1),d(),re(i.visibleGroups()),d(3),S(i.filePreview()?15:-1),d(2),S((o=i.updateNotice())?17:-1,o),d(7),S((r=i.version())?24:-1,r),d(),S((s=i.menu())?25:-1,s)}},dependencies:[Iu,ku],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 tV(t){if(t.kind==="tool"){let e=uo(t.name),n=fE(t),i=Rs(t);return e==="shell"?`${n} ${HE(i.replace(/\s+/g," ").trim(),40)}`:e==="search"?`${n} ${HE(i,40)}`:`${n} ${gu(i)}`}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 HE(t,e){return t.length>e?`${t.slice(0,e)}\u2026`:t}var GE=(t,e)=>e.path;function nV(t,e){if(t&1){let n=$();h(0,"button",20),F("click",function(){let o=D(n).$implicit,r=m(2);return M(r.go(o.path))}),u(1),g()}if(t&2){let n=e.$implicit;ie("title",n.path),d(),ae(" ",n.name," ")}}function iV(t,e){if(t&1&&(h(0,"div",9),oe(1,nV,2,2,"button",19,GE),g()),t&2){let n=m();d(),re(n.roots())}}function oV(t,e){t&1&&(h(0,"p",11),u(1,"Reading folder\u2026"),g())}function rV(t,e){t&1&&(h(0,"p",12),u(1),g()),t&2&&(d(),k(e))}function sV(t,e){if(t&1){let n=$();h(0,"button",22),F("click",function(){let o=D(n),r=m(2);return M(r.go(o))}),h(1,"span",23),u(2,"\u21B0"),g(),h(3,"span",24),u(4,".."),g()()}t&2&&ie("title",e)}function aV(t,e){if(t&1){let n=$();h(0,"button",22),F("click",function(){let o=D(n).$implicit,r=m(2);return M(r.go(o.path))}),h(1,"span",23),u(2,"\u25B8"),g(),h(3,"span",24),u(4),g()()}if(t&2){let n=e.$implicit;ie("title",n.path),d(4),k(n.name)}}function cV(t,e){t&1&&(h(0,"p",11),u(1,"No subfolders here."),g())}function lV(t,e){if(t&1&&w(0,cV,2,0,"p",11),t&2){let n=m(2);S(n.parent()===void 0&&n.directories().length===0?0:-1)}}function dV(t,e){if(t&1&&(w(0,sV,5,1,"button",21),oe(1,aV,5,2,"button",21,GE,!1,lV,1,1)),t&2){let n,i=m();S((n=i.parent())?0:-1,n),d(),re(i.directories())}}function uV(t,e){t&1&&(h(0,"em"),u(1," \xB7 not in MORSE_PROJECTS"),g())}function pV(t,e){t&1&&(h(0,"em",15),u(1," \xB7 git"),g())}var Ou=class t{morse=N(Ze);shell=N(Ht);tabs=N(dn);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 i=n;if(!i||typeof i.path!="string"){this.error.set("That folder could not be read.");return}this.path.set(i.path),this.draftPath.set(i.path),this.parent.set(i.parent),this.directories.set(i.directories??[]),this.roots.set(i.roots??[]),this.isGitRepo.set(i.isGitRepo===!0),this.canOpen.set(i.canOpen===!0)})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-project-picker"]],hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.onEscape()},Mt)},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,i){if(n&1&&(h(0,"div",0),F("click",function(){return i.close()}),h(1,"div",1),F("click",function(r){return r.stopPropagation()}),h(2,"header",2)(3,"strong"),u(4,"New session"),g(),h(5,"button",3),F("click",function(){return i.close()}),u(6," \xD7 "),g()(),h(7,"p",4),u(8," Choose the project folder the agent should run in. It starts only after your first prompt. "),g(),h(9,"div",5)(10,"button",6),F("click",function(){return i.go(i.parent())}),u(11," \u2191 "),g(),h(12,"input",7),F("input",function(r){return i.onPathInput(r)})("keydown.enter",function(){return i.go(i.draftPath())}),g(),h(13,"button",8),F("click",function(){return i.go(i.draftPath())}),u(14," Go "),g()(),w(15,iV,3,0,"div",9),h(16,"div",10),w(17,oV,2,0,"p",11)(18,rV,2,1,"p",12)(19,dV,4,2),g(),h(20,"footer",13)(21,"span",14),u(22),w(23,uV,2,0,"em"),w(24,pV,2,0,"em",15),g(),h(25,"div",16)(26,"button",17),F("click",function(){return i.close()}),u(27,"Cancel"),g(),h(28,"button",18),F("click",function(){return i.confirm()}),u(29," New session here "),g()()()()()),n&2){let o;d(10),ie("disabled",i.parent()===void 0),d(2),ie("value",i.draftPath()),d(),ie("disabled",i.draftPath().trim().length===0),d(2),S(i.roots().length>0?15:-1),d(2),S(i.loading()?17:(o=i.error())?18:19,o),d(4),ie("title",i.path()),d(),ae(" ",i.path()," "),d(),S(i.canOpen()?-1:23),d(),S(i.isGitRepo()?24:-1),d(4),ie("disabled",!i.canOpen()||i.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 qE=[{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 fV=(t,e)=>e.title,mV=(t,e)=>e.name;function hV(t,e){if(t&1&&(h(0,"div")(1,"dt"),u(2,"update"),g(),h(3,"dd")(4,"a",14),u(5),g()()()),t&2){let n=e;d(4),ie("href",n.url,xi)("title",n.hint),d(),ae(" v",n.latest," available ")}}function gV(t,e){t&1&&(h(0,"p",15),u(1),g()),t&2&&(d(),k(e))}function yV(t,e){t&1&&(h(0,"span",17),u(1),g()),t&2&&(d(),ae("by ",e))}function _V(t,e){if(t&1&&(h(0,"li")(1,"a",16),u(2),w(3,yV,2,1,"span",17),g(),h(4,"span",18),u(5),g(),h(6,"p",19),u(7),g()()),t&2){let n,i=e.$implicit;d(),ie("href",i.url,xi),d(),ae(" ",i.name," "),d(),S((n=i.by)?3:-1,n),d(2),k(i.license),d(2),k(i.role)}}function vV(t,e){if(t&1&&(h(0,"section",9)(1,"h3"),u(2),g(),w(3,gV,2,1,"p",15),h(4,"ul"),oe(5,_V,8,5,"li",null,mV),g()()),t&2){let n,i=e.$implicit;d(2),k(i.title),d(),S((n=i.blurb)?3:-1,n),d(2),re(i.entries)}}var Pu=class t{morse=N(Ze);shell=N(Ht);update=N(Fs);groups=qE;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=ue({type:t,selectors:[["morse-about-dialog"]],hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.onEscape()},Mt)},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,i){if(n&1&&(h(0,"div",0),F("click",function(){return i.close()}),h(1,"div",1),F("click",function(r){return r.stopPropagation()}),h(2,"div",2)(3,"strong",3),u(4,"About Morse"),g(),h(5,"span",4),u(6,"a comfortable Pi interface \xB7 MIT"),g(),h(7,"button",5),F("click",function(){return i.close()}),u(8,"\xD7"),g()(),h(9,"p",6),u(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 "),h(11,"code"),u(12,"pi --mode rpc"),g(),u(13," \u2014 and never talks to a model provider itself. Below is what it stands on, and the licence each piece asks for. "),g(),h(14,"dl",7)(15,"div")(16,"dt"),u(17,"frontend"),g(),h(18,"dd"),u(19),g()(),h(20,"div")(21,"dt"),u(22,"protocol"),g(),h(23,"dd"),u(24),g()(),h(25,"div")(26,"dt"),u(27,"host"),g(),h(28,"dd"),u(29),g()(),w(30,hV,6,3,"div"),g(),h(31,"div",8),oe(32,vV,7,2,"section",9,fV),g(),h(34,"div",10)(35,"span"),u(36,"Licence texts ship with this build. Morse is MIT \xB7 \xA9 2026 Supan Adit Pratama."),g(),ce(37,"span",11),h(38,"a",12),u(39," Source "),g(),h(40,"button",13),F("click",function(){return i.close()}),u(41,"Close"),g()()()()),n&2){let o;d(19),k(i.frontend()),d(5),k(i.protocolVersion()),d(5),k(i.host()),d(),S((o=i.updateNotice())?30:-1,o),d(2),re(i.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 bV=(t,e)=>e.name,xV=(t,e)=>e.id;function CV(t,e){t&1&&(h(0,"span",15),u(1,"not in this host"),g())}function EV(t,e){if(t&1&&(h(0,"li")(1,"div",13)(2,"span",14),u(3),w(4,CV,2,0,"span",15),g(),h(5,"span",16),u(6),g()(),h(7,"kbd"),u(8),g()()),t&2){let n=e.$implicit;X("unavailable",n.available===!1),d(3),ae(" ",n.label," "),d(),S(n.available===!1?4:-1),d(2),k(n.detail),d(2),k(n.keys)}}function wV(t,e){if(t&1&&(h(0,"section",8)(1,"h3"),u(2),g(),h(3,"ul"),oe(4,EV,9,6,"li",12,xV),g()()),t&2){let n=e.$implicit;d(2),k(n.name),d(2),re(n.rows)}}var Au=class t{shell=N(Ht);shortcuts=N(An);groups=E(()=>{let e=this.shortcuts.available(),n=new Map;for(let i of Ja){let o=n.get(i.group)??[];o.push({id:i.id,label:i.label,detail:i.detail,keys:ec(i)?hx(i.binding):i.keys,available:ec(i)?e.get(i.id)===!0:void 0}),n.set(i.group,o)}return[...n].map(([i,o])=>({name:i,rows:o}))});close(){this.shell.closeShortcuts()}onEscape(){this.close()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-shortcuts-dialog"]],hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.onEscape()},Mt)},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,i){n&1&&(h(0,"div",0),F("click",function(){return i.close()}),h(1,"div",1),F("click",function(r){return r.stopPropagation()}),h(2,"div",2)(3,"strong",3),u(4,"Keyboard shortcuts"),g(),h(5,"span",4),u(6,"the same keys in the browser and in the VS Code panel"),g(),h(7,"button",5),F("click",function(){return i.close()}),u(8,"\xD7"),g()(),h(9,"p",6),u(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. "),g(),h(11,"div",7),oe(12,wV,6,1,"section",8,bV),g(),h(14,"div",9)(15,"span"),u(16,"Esc closes this list, and the panel in front of it."),g(),ce(17,"span",10),h(18,"button",11),F("click",function(){return i.close()}),u(19,"Close"),g()()()()),n&2&&(d(12),re(i.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 SV=["cancel"];function TV(t,e){t&1&&(h(0,"p",4),u(1),g()),t&2&&(d(),k(e))}function DV(t,e){t&1&&(h(0,"p",5),u(1),g()),t&2&&(d(),k(e))}var Ru=class t{title=te.required();body=te("");note=te("");confirmLabel=te("Confirm");cancelLabel=te("Cancel");confirmed=at();cancelled=at();cancelButton=Xe("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=ue({type:t,selectors:[["morse-confirm-dialog"]],viewQuery:function(n,i){n&1&>(i.cancelButton,SV,5),n&2&&vt()},hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.onEscape()},Mt)},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,i){if(n&1&&(h(0,"div",1),F("click",function(){return i.cancelled.emit()}),h(1,"div",2),F("click",function(r){return r.stopPropagation()}),h(2,"h2",3),u(3),g(),w(4,TV,2,1,"p",4),w(5,DV,2,1,"p",5),h(6,"div",6)(7,"button",7,0),F("click",function(){return i.cancelled.emit()}),u(9),g(),h(10,"button",8),F("click",function(){return i.confirmed.emit()}),u(11),g()()()()),n&2){let o,r;d(),J("aria-describedby",i.body().length>0?"confirm-body":null),d(2),k(i.title()),d(),S((o=i.body())?4:-1,o),d(),S((r=i.note())?5:-1,r),d(4),ae(" ",i.cancelLabel()," "),d(2),k(i.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 MV(t,e){t&1&&u(0," Install it once and this panel is ready. ")}function kV(t,e){if(t&1){let n=$();h(0,"div",5)(1,"code"),u(2),g(),h(3,"button",10),F("click",function(){D(n);let o=m();return M(o.copyInstall())}),u(4),g()()}if(t&2){let n=m();d(2),k(e),d(2),ae(" ",n.copied()?"Copied":"Copy"," ")}}function IV(t,e){t&1&&(h(0,"p",6),u(1),g()),t&2&&(d(),k(e))}function NV(t,e){if(t&1){let n=$();h(0,"button",10),F("click",function(){D(n);let o=m();return M(o.openSettings())}),u(1,"Open settings"),g(),h(2,"button",10),F("click",function(){D(n);let o=m();return M(o.showLog())}),u(3,"Show log"),g()}}function OV(t,e){t&1&&(h(0,"p",9),u(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. "),g())}function PV(t,e){t&1&&(h(0,"p",9),u(1," The host reads "),h(2,"code"),u(3,"MORSE_PI_PATH"),g(),u(4," at startup, so restart it after changing that (or install pi) \u2014 "),h(5,"code"),u(6,"morse restart"),g(),u(7," for the daemon. "),g())}function AV(t,e){t&1&&(h(0,"details")(1,"summary"),u(2,"What the host reported"),g(),h(3,"pre"),u(4),g()()),t&2&&(d(4),k(e))}var Lu=class t{morse=N(Ze);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=ue({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,i){if(n&1&&(h(0,"section",0)(1,"p",1),ce(2,"span",2),u(3),g(),h(4,"h1",3),u(5),g(),h(6,"p",4),u(7," Morse is only the interface \u2014 every answer comes from the pi CLI on this machine, with your own models, tools and sessions. "),w(8,MV,1,0),g(),w(9,kV,5,2,"div",5),w(10,IV,2,1,"p",6),h(11,"div",7)(12,"button",8),F("click",function(){return i.retry()}),u(13,"Retry"),g(),w(14,NV,4,0),g(),w(15,OV,2,0,"p",9)(16,PV,8,0,"p",9),w(17,AV,5,1,"details"),g()),n&2){let o,r,s;d(3),ae(" ",i.missing()?"Setup":"Agent unavailable"," "),d(2),ae(" ",i.missing()?"The pi coding agent is not installed":"The pi coding agent could not start"," "),d(3),S(i.missing()?8:-1),d(),S((o=i.install())?9:-1,o),d(),S((r=i.hint())?10:-1,r),d(4),S(i.hasEditor()?14:-1),d(),S(i.hasEditor()?15:16),d(2),S((s=i.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 RV(t,e){if(t&1){let n=$();y(0,"morse-boot-splash",11),A("dismissed",function(){D(n);let o=m();return M(o.onBootDismissed())}),b()}if(t&2){let n=m();q("ready",n.bootReady())("status",n.bootStatus())}}function LV(t,e){if(t&1){let n=$();y(0,"morse-connection-screen",12),A("retry",function(){D(n);let o=m();return M(o.retryConnection())})("explore",function(){D(n);let o=m();return M(o.onConnectionExplore())})("connect",function(o){D(n);let r=m();return M(r.onConnectionConnect(o))}),b()}if(t&2){let n=e;q("eyebrow",n.eyebrow)("title",n.title)("body",n.body)("detail",n.detail)}}function FV(t,e){t&1&&ve(0,"morse-project-picker")}function VV(t,e){t&1&&ve(0,"morse-about-dialog")}function jV(t,e){t&1&&ve(0,"morse-shortcuts-dialog")}function $V(t,e){if(t&1){let n=$();y(0,"morse-confirm-dialog",13),A("confirmed",function(){D(n);let o=m();return M(o.confirmCompact())})("cancelled",function(){D(n);let o=m();return M(o.cancelCompact())}),b()}if(t&2){let n=m();q("body",n.compactBody())}}function BV(t,e){if(t&1){let n=$();y(0,"button",14),A("click",function(){D(n);let o=m();return M(o.closeNavigation())}),b()}}function HV(t,e){t&1&&(y(0,"div",7),ve(1,"span",15),y(2,"div",16)(3,"span",17),u(4,"\u2913"),b(),y(5,"strong"),u(6,"Drop to attach"),b(),y(7,"span"),u(8,"Images ride with the prompt \xB7 other files become "),y(9,"code"),u(10,"@mentions"),b()()()()),t&2&&(d(2),q("morseEnter",0)("morseEnterY",-6))}function UV(t,e){t&1&&ve(0,"morse-tab-strip")}function zV(t,e){t&1&&ve(0,"morse-file-preview",8),t&2&&q("tab",e)}function GV(t,e){if(t&1){let n=$();y(0,"section",18)(1,"strong"),u(2,"Offline \u2014 the host wouldn't take this frontend"),b(),y(3,"p"),u(4),ve(5,"br"),u(6),b(),y(7,"div",20)(8,"button",21),A("click",function(){D(n);let o=m(2);return M(o.reload())}),u(9,"Reload"),b(),y(10,"button",22),A("click",function(){D(n);let o=m(2);return M(o.retryConnection())}),u(11,"Retry"),b(),y(12,"button",22),A("click",function(){D(n);let o=m(2);return M(o.showLog())}),u(13,"Show log"),b()()()}if(t&2){let n=e;d(4),k(n.message),d(2),k(n.detail)}}function qV(t,e){if(t&1){let n=$();y(0,"section",18)(1,"strong"),u(2,"Offline \u2014 reconnecting"),b(),y(3,"p"),u(4," Morse keeps retrying in the background; the rest of the interface stays available while it does. "),b(),y(5,"div",20)(6,"button",21),A("click",function(){D(n);let o=m(2);return M(o.retryConnection())}),u(7,"Retry now"),b(),y(8,"button",22),A("click",function(){D(n);let o=m(2);return M(o.showConnectionHelp())}),u(9," Connection help "),b()()()}}function WV(t,e){if(t&1){let n=$();y(0,"section",19)(1,"strong"),u(2,"Pi agent unavailable"),b(),y(3,"p"),u(4),b(),y(5,"div",20)(6,"button",21),A("click",function(){D(n);let o=m(2);return M(o.retryAgent())}),u(7,"Retry"),b(),y(8,"button",22),A("click",function(){D(n);let o=m(2);return M(o.openSettings())}),u(9,"Open settings"),b(),y(10,"button",22),A("click",function(){D(n);let o=m(2);return M(o.showLog())}),u(11,"Show log"),b()()()}if(t&2){let n=m(2);d(4),k(n.agentError()||"Morse could not start the pi coding agent.")}}function YV(t,e){t&1&&ve(0,"morse-agent-screen")}function KV(t,e){t&1&&ve(0,"morse-chat-transcript")(1,"morse-interaction-panel")(2,"morse-chat-composer")}function ZV(t,e){if(t&1&&(w(0,GV,14,2,"section",18)(1,qV,10,0,"section",18)(2,WV,12,1,"section",19),w(3,YV,1,0,"morse-agent-screen")(4,KV,3,0)),t&2){let n,i=m();S((n=i.lastError())?0:i.offline()?1:i.agentBanner()?2:-1,n),d(3),S(i.agentScreen()?3:4)}}function QV(t,e){if(t&1){let n=$();y(0,"div",23)(1,"span",24),u(2),b(),y(3,"button",25),A("click",function(){D(n);let o=m();return M(o.dismissToast())}),u(4," \xD7 "),b()()}if(t&2){let n=e;Tn(n.level),d(2),k(n.text)}}function XV(t,e){if(t&1&&ve(0,"morse-git-panel",10),t&2){let n=m();q("expanded",n.gitExpanded())}}function JV(){return typeof location>"u"?!1:new URL(location.href,"http://localhost/").searchParams.get("boot")==="1"}var Fu=class t{morse=N(Ze);shell=N(Ht);tabs=N(dn);shortcuts=N(An);dropZone=N(Mu);animation=N(ln);attachments=N(Ui);destroyRef=N(pt);dismissedNoticeAt=O(null);noticeTimer;bootPreview=JV();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);gitEnabled=E(()=>this.morse.capabilities()?.gitPanel===!0);gitOpen=E(()=>this.gitEnabled()&&this.shell.gitPanelOpen());gitExpanded=E(()=>this.gitOpen()&&this.shell.gitPanelExpanded());gitWidth=E(()=>{let e=this.shell.gitPanelWidth();return e===void 0?null:`${e}px`});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(),i=n&&(!e||n.at>=e.at)?n:e;return!i||i.at===this.dismissedNoticeAt()?null:i});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(),i=n.sessionId;if(i===void 0){this.focusedSession=void 0,this.tabs.clearActiveSession();return}let o={id:i,title:this.sessionTitle(i,n.sessionTitle),cwd:n.workspace.cwd};if(i===this.focusedSession){this.tabs.refreshSession(o);return}this.focusedSession=i,this.tabs.showSession(o)})}onBootDismissed(){this.bootVisible.set(!1),this.clearBootTimer()}sessionTitle(e,n){return n!==void 0&&n.length>0?n:this.morse.sessions().find(o=>o.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 i=n.querySelector(".dropzone-card"),o=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(i,{scale:[1,1.03]},{duration:700}),this.animation.loop(o,{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=ue({type:t,selectors:[["app-root"]],decls:17,vars:24,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"],[1,"git-panel",3,"expanded"],[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,i){if(n&1&&(y(0,"div",0),w(1,RV,1,2,"morse-boot-splash",1),w(2,LV,1,4,"morse-connection-screen",2),ve(3,"morse-session-nav",3),w(4,FV,1,0,"morse-project-picker"),w(5,VV,1,0,"morse-about-dialog"),w(6,jV,1,0,"morse-shortcuts-dialog"),w(7,$V,1,1,"morse-confirm-dialog",4),w(8,BV,1,0,"button",5),y(9,"main",6),A("dragenter",function(r){return i.onDragEnter(r)})("dragover",function(r){return i.onDragOver(r)})("dragleave",function(){return i.onDragLeave()})("drop",function(r){return i.onDrop(r)}),w(10,HV,11,2,"div",7),ve(11,"morse-chat-header"),w(12,UV,1,0,"morse-tab-strip"),w(13,zV,1,1,"morse-file-preview",8)(14,ZV,5,2),w(15,QV,5,3,"div",9),b(),w(16,XV,1,1,"morse-git-panel",10),b()),n&2){let o,r,s;At("--%NS%morse-git-width",i.gitWidth()),X("collapsed",i.navigationCollapsed())("with-git",i.gitOpen())("git-expanded",i.gitExpanded()),d(),S(i.bootVisible()?1:-1),d(),S((o=i.connectionScreen())?2:-1,o),d(),X("open",i.navigationOpen()),d(),S(i.projectPickerOpen()?4:-1),d(),S(i.aboutOpen()?5:-1),d(),S(i.shortcutsOpen()?6:-1),d(),S(i.compactConfirmOpen()?7:-1),d(),S(i.navigationOpen()?8:-1),d(),X("dropping",i.dragging()),d(),S(i.dragging()?10:-1),d(2),S(i.tabsEnabled()?12:-1),d(),S((r=i.activeFile())?13:14,r),d(2),S((s=i.toast())?15:-1,s),d(),S(i.gitOpen()?16:-1)}},dependencies:[Nu,Ou,Pu,Au,Lu,Ru,su,bu,Cu,ru,wu,xu,Tu,un,Ld,Fd],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);grid-template-rows:minmax(0,1fr);height:100%;min-height:0;overflow:hidden;background:var(--%NS%morse-bg)}.nav[_ngcontent-%COMP%]{min-width:0}.shell.with-git[_ngcontent-%COMP%]{grid-template-columns:var(--%NS%morse-nav-width) minmax(0,1fr) var(--%NS%morse-git-width)}.git-panel[_ngcontent-%COMP%]{min-width:0}.shell.git-expanded[_ngcontent-%COMP%]{grid-template-columns:var(--%NS%morse-nav-width) minmax(0,1fr)}.shell.git-expanded[_ngcontent-%COMP%] .chat[_ngcontent-%COMP%]{display:none}@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.with-git[_ngcontent-%COMP%]{grid-template-columns:0 minmax(0,1fr) var(--%NS%morse-git-width)}.shell.collapsed.git-expanded[_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%], .shell.with-git[_ngcontent-%COMP%], .shell.git-expanded[_ngcontent-%COMP%]{grid-template-columns:minmax(0,1fr)}.shell.git-expanded[_ngcontent-%COMP%] .git-panel[_ngcontent-%COMP%]{position:static;width:auto;box-shadow:none}.shell[_ngcontent-%COMP%] > .git-panel[_ngcontent-%COMP%]{position:absolute;z-index:20;top:0;bottom:0;right:0;width:min(86%,340px);box-shadow:0 0 24px #00000059}.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}}"]})};Zm(Fu,Pv).catch(t=>console.error(t));
|
|
98
|
+
`).length;return Array.from({length:n},(i,o)=>o+1)});highlighted=E(()=>{let e=this.tab();return e.content===void 0||e.binary?this.sanitizer.bypassSecurityTrustHtml(""):this.sanitizer.bypassSecurityTrustHtml(Is(this.source(),e.language).html)});language=E(()=>this.tab().language??"text");size=E(()=>JL(this.tab().size??0));changed=E(()=>Ud(this.workspace.status()).get(this.tab().path));mode=E(()=>this.changed()===void 0?"file":this.display.diffView());diffText=E(()=>{let e=this.tab();return e.diff!==void 0&&e.diff.trim().length>0?e.diff:this.changed()==="U"&&e.content!==void 0&&!e.binary?TE(e.content):e.diff??""});parsed=E(()=>EE(this.diffText()));unified=E(()=>wE(this.parsed()));split=E(()=>SE(this.parsed()));unifiedView=E(()=>{let e=this.language();return this.unified().map(n=>K(V({},n),{html:n.kind==="hunk"?"":this.sanitizer.bypassSecurityTrustHtml(Is(n.text,e).html)}))});splitView=E(()=>{let e=this.language(),n=i=>i===void 0?void 0:K(V({},i),{html:this.sanitizer.bypassSecurityTrustHtml(Is(i.text,e).html)});return this.split().map(i=>({hunk:i.hunk,left:n(i.left),right:n(i.right)}))});diffStats=E(()=>{let e=this.parsed();return`+${e.additions} \u2212${e.deletions}`});lineHeight=O(XL);selected=O(void 0);editingId=O(void 0);mergedId=O(void 0);anchor=1;rangeLabel=E(()=>DE(this.selected()));highlights=E(()=>{let e=this.tab().path,n=this.editingId(),i=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})),o=this.selected();return o===void 0?i:[...i,{id:"live",start:o.start,end:o.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(){no(()=>this.measureLineHeight()),se(()=>{this.tab(),ii(()=>this.selected.set(void 0))}),se(()=>{if(this.mode()==="file"||this.changed()===void 0)return;let e=this.tab().id;ii(()=>this.tabs.loadDiff(e))})}setMode(e){this.display.setDiffView(e)}diffSign(e){if(e===void 0)return"";switch(e.kind){case"add":return"+";case"del":return"\u2212";case"context":return" ";default:return""}}isChangePinned(e){if(e===void 0)return!1;let n=this.tab().path;return this.attachments.pins().some(i=>i.path===n&&i.startLine!==void 0&&e>=i.startLine&&e<=(i.endLine??i.startLine))}toggleChange(e){let n=e!==void 0&&e.kind!=="hunk"?e.change:void 0;if(n===void 0)return;let i=this.tab().path,o=this.attachments.pins().find(r=>r.path===i&&r.startLine!==void 0&&r.startLine<=n.start&&(r.endLine??r.startLine)>=n.end);if(o!==void 0){this.attachments.removePin(o.id);return}this.attachments.pin({path:i,startLine:n.start,endLine:n.end>n.start?n.end:void 0}),this.attachments.say("info",`Pinned ${this.tab().title} ${DE(n)} to this message.`)}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 i=e.currentTarget;try{i.setPointerCapture(e.pointerId)}catch{}let o=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=()=>{i.removeEventListener("pointermove",o),i.removeEventListener("pointerup",r),i.removeEventListener("pointercancel",r),this.pinSelection()};i.addEventListener("pointermove",o),i.addEventListener("pointerup",r),i.addEventListener("pointercancel",r)}clearSelection(){this.selected.set(void 0),this.editingId.set(void 0)}reload(){this.tabs.reload(this.tab().id)}startResizeEdge(e,n,i){if(e.button!==0)return;e.preventDefault(),e.stopPropagation();let o=e.currentTarget;try{o.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),p=l?.startLine??n.start,f=l?.endLine??p,_=i==="start"?Math.min(c,f):p,x=i==="end"?Math.max(c,p):f;this.attachments.setPinRange(n.id,{startLine:_,endLine:x>_?x:void 0})},s=()=>{o.removeEventListener("pointermove",r),o.removeEventListener("pointerup",s),o.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})}};o.addEventListener("pointermove",r),o.addEventListener("pointerup",s),o.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 i=n.getBoundingClientRect().top,o=Math.floor((e-i)/this.lineHeight())+1;return Math.min(this.lines().length,Math.max(1,o))}pinSelection(){let e=this.selected();if(e===void 0)return;let n=e.end>e.start?e.end:void 0,i=this.attachments.pins().length,o=this.attachments.pin({path:this.tab().path,startLine:e.start,endLine:n},this.editingId());this.attachments.pins().length<i&&this.celebrate(o,{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 i=this.attachments.pins().find(l=>l.id===e),o=this.sourceElement()?.nativeElement.closest(".source-wrap");if(i?.startLine===void 0||!(o instanceof HTMLElement))return;let r=i.startLine,s=i.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(o,{x:o.clientWidth/2,y:c})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-file-preview"]],viewQuery:function(n,i){n&1&>(i.sourceElement,SL,5)(i.gutterElement,TL,5),n&2&&vt(2)},inputs:{tab:[1,"tab"]},decls:18,vars:7,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"],["role","group","aria-label","Preview mode",1,"modes"],["type","button","title","The file's content",3,"click"],["type","button","title","Unified diff",3,"click"],["type","button","title","Side-by-side diff",3,"click"],[1,"diff","split"],[1,"diff"],[1,"drow","hunk"],[1,"srow"],[1,"dtext"],[1,"side",3,"click"],[1,"dnum"],[1,"dsign"],[1,"dtext",3,"innerHTML"],[1,"drow",3,"add","del","clickable","pinned"],[1,"drow",3,"click"],[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,i){if(n&1&&(h(0,"header",2)(1,"span",3),u(2),g(),h(3,"div",4),w(4,kL,8,7),w(5,IL,2,2,"span",5)(6,NL,2,2,"span",5),h(7,"span",6),u(8),g(),h(9,"span",7),u(10),g(),h(11,"button",8),F("click",function(){return i.reload()}),u(12," \u27F3 "),g()()(),w(13,zL,6,1)(14,GL,2,1,"p",9)(15,qL,2,1,"p",10)(16,WL,2,1,"p",9)(17,QL,12,2)),n&2){let o,r;d(),ie("title",i.tab().path),d(),k(i.tab().path),d(2),S(i.changed()?4:-1),d(),S((o=i.rangeLabel())?5:i.pinnedCount()>0?6:-1,o),d(3),k(i.language()),d(2),k(i.size()),d(3),S(i.mode()!=="file"?13:i.tab().loading?14:(r=i.tab().error)?15:i.tab().binary?16:17,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)}.modes[_ngcontent-%COMP%]{display:inline-flex;flex:none;border:1px solid var(--%NS%morse-border);border-radius:var(--%NS%morse-radius-sm);overflow:hidden}.modes[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:2px 8px;border:0;background:transparent;color:var(--%NS%morse-fg-muted);font:inherit;font-size:11px;cursor:pointer}.modes[_ngcontent-%COMP%] button[_ngcontent-%COMP%] + button[_ngcontent-%COMP%]{border-left:1px solid var(--%NS%morse-border)}.modes[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.modes[_ngcontent-%COMP%] button.on[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--%NS%morse-accent) 24%,transparent);color:var(--%NS%morse-fg)}.diff[_ngcontent-%COMP%]{flex:1;min-height:0;overflow:auto;padding:6px 0;background:var(--%NS%morse-code-bg, var(--%NS%morse-bg));font-family:var(--%NS%morse-font-mono);font-size:12px;line-height:1.6}.drow[_ngcontent-%COMP%], .srow[_ngcontent-%COMP%]{display:flex;align-items:stretch;min-height:1.6em}.dtext[_ngcontent-%COMP%]{flex:1;min-width:0;padding:0 16px 0 6px;white-space:pre-wrap;overflow-wrap:anywhere}.dnum[_ngcontent-%COMP%]{flex:none;min-width:44px;padding:0 8px 0 10px;color:var(--%NS%morse-fg-muted);text-align:right;-webkit-user-select:none;user-select:none;font-variant-numeric:tabular-nums;opacity:.7}.dsign[_ngcontent-%COMP%]{flex:none;width:14px;text-align:center;color:var(--%NS%morse-fg-muted);-webkit-user-select:none;user-select:none}.drow.add[_ngcontent-%COMP%], .side.add[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--%NS%morse-success) 14%,transparent)}.drow.del[_ngcontent-%COMP%], .side.del[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--%NS%morse-error) 14%,transparent)}.drow.add[_ngcontent-%COMP%] .dsign[_ngcontent-%COMP%], .side.add[_ngcontent-%COMP%] .dsign[_ngcontent-%COMP%]{color:var(--%NS%morse-success)}.drow.del[_ngcontent-%COMP%] .dsign[_ngcontent-%COMP%], .side.del[_ngcontent-%COMP%] .dsign[_ngcontent-%COMP%]{color:var(--%NS%morse-error)}.drow.clickable[_ngcontent-%COMP%], .side.clickable[_ngcontent-%COMP%]{cursor:pointer}.drow.clickable[_ngcontent-%COMP%]:hover, .side.clickable[_ngcontent-%COMP%]:hover{background:color-mix(in srgb,var(--%NS%morse-accent) 12%,transparent)}.drow.pinned[_ngcontent-%COMP%], .side.pinned[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--%NS%morse-accent) 22%,transparent);box-shadow:inset 2px 0 color-mix(in srgb,var(--%NS%morse-accent) 70%,transparent)}.drow.hunk[_ngcontent-%COMP%]{margin:6px 0 2px;padding:2px 12px;background:var(--%NS%morse-code-head, var(--%NS%morse-hover));color:var(--%NS%morse-fg-muted)}.srow[_ngcontent-%COMP%] .side[_ngcontent-%COMP%]{flex:1 1 50%;min-width:0;display:flex;align-items:stretch;border-left:1px solid var(--%NS%morse-border)}.srow[_ngcontent-%COMP%] .side[_ngcontent-%COMP%]:first-child{border-left:0}.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 JL(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 eF=(t,e)=>e.value;function tF(t,e){t&1&&(h(0,"p",1),u(1),g()),t&2&&(d(),k(e))}function nF(t,e){if(t&1){let n=$();h(0,"button",4),F("click",function(){let o=D(n).$implicit,r=m(3);return M(r.choose(o.value))}),u(1),g()}if(t&2){let n=e.$implicit;d(),ae(" ",n.label," ")}}function iF(t,e){if(t&1&&(w(0,tF,2,1,"p",1),h(1,"div",2),oe(2,nF,2,1,"button",3,eF),g()),t&2){let n,i=m(),o=m();S((n=o.messageOf(i))?0:-1,n),d(2),re(o.optionsOf(i))}}function oF(t,e){if(t&1){let n=$();h(0,"p"),u(1),g(),h(2,"div",2)(3,"button",5),F("click",function(){D(n);let o=m(2);return M(o.decide(!0))}),u(4,"Yes"),g(),h(5,"button",4),F("click",function(){D(n);let o=m(2);return M(o.decide(!1))}),u(6,"No"),g()()}if(t&2){let n=m(),i=m();d(),k(i.messageOf(n))}}function rF(t,e){if(t&1){let n=$();h(0,"input",6),F("input",function(o){D(n);let r=m(2);return M(r.onInput(o))}),g(),h(1,"div",2)(2,"button",5),F("click",function(){D(n);let o=m(2);return M(o.submit())}),u(3,"Submit"),g(),h(4,"button",4),F("click",function(){D(n);let o=m(2);return M(o.cancel())}),u(5,"Cancel"),g()()}if(t&2){let n=m(),i=m();ie("value",i.value()||i.prefillOf(n))("placeholder",i.placeholderOf(n))}}function sF(t,e){if(t&1){let n=$();h(0,"textarea",7),F("input",function(o){D(n);let r=m(2);return M(r.onInput(o))}),g(),h(1,"div",2)(2,"button",5),F("click",function(){D(n);let o=m(2);return M(o.submit())}),u(3,"Submit"),g(),h(4,"button",4),F("click",function(){D(n);let o=m(2);return M(o.cancel())}),u(5,"Cancel"),g()()}if(t&2){let n=m(),i=m();ie("value",i.value()||i.prefillOf(n))}}function aF(t,e){if(t&1&&(h(0,"section",0)(1,"header"),u(2),g(),w(3,iF,4,1)(4,oF,7,1)(5,rF,6,2)(6,sF,6,1),g()),t&2){let n,i=e;d(2),k(i.title),d(),S((n=i.kind)==="select"?3:n==="confirm"?4:n==="input"?5:n==="editor"?6:-1)}}var Cu=class t{morse=N(Ze);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(V({requestId:n.requestId},e))}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({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,i){if(n&1&&w(0,aF,7,2,"section",0),n&2){let o;S((o=i.visible()&&i.request())?0:-1,o)}},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 ME(t){let e={name:"",path:"",kind:"dir",children:[]},n=new Map([["",e]]),i=o=>{let r=n.get(o);if(r!==void 0)return r;let s=o.lastIndexOf("/"),a=i(s===-1?"":o.slice(0,s)),c={name:o.slice(s+1),path:o,kind:"dir",children:[]};return a.children.push(c),n.set(o,c),c};for(let o of t){let r=o.endsWith("/"),s=r?o.slice(0,-1):o;if(s.length===0)continue;if(r){i(s);continue}let a=s.lastIndexOf("/"),c=i(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 kE(e.children),e.children}function kE(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)kE(e.children)}function Eu(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 cF=t=>({items:t,label:"Open tabs"}),lF=t=>({items:t,label:"Mentioned files"}),dF=(t,e)=>e.id;function uF(t,e){t&1&&ve(0,"span",6)}function pF(t,e){if(t&1&&(y(0,"span",7),u(1),b()),t&2){let n=m().$implicit,i=m(2);d(),k(i.glyph(n))}}function fF(t,e){if(t&1){let n=$();y(0,"div",5),A("click",function(){let o=D(n).$implicit,r=m(2);return M(r.select(o.id))})("keydown.enter",function(){let o=D(n).$implicit,r=m(2);return M(r.select(o.id))})("keydown.space",function(){let o=D(n).$implicit,r=m(2);return M(r.select(o.id))})("contextmenu",function(o){let r=D(n).$implicit,s=m(2);return M(s.openMenu(o,r.id))})("auxclick",function(o){let r=D(n).$implicit,s=m(2);return M(s.onAuxClick(r.id,o))}),w(1,uF,1,0,"span",6)(2,pF,2,1,"span",7),y(3,"span",8),u(4),b(),y(5,"button",9),A("click",function(o){let r=D(n).$implicit,s=m(2);return M(s.close(r.id,o))}),u(6," \xD7 "),b()()}if(t&2){let n=e.$implicit,i=m(2);X("active",n.id===i.activeId())("running",n.kind==="session"&&i.isRunning(n.id)),q("title",i.title(n)),J("aria-selected",n.id===i.activeId()),d(),S(n.kind==="session"&&i.isRunning(n.id)?1:2),d(3),k(n.title),d(),q("title","Close "+n.title)}}function mF(t,e){t&1&&(y(0,"span",4),u(1,"No open tabs"),b())}function hF(t,e){if(t&1&&(y(0,"div",2),oe(1,fF,7,9,"div",3,dF,!1,mF,2,0,"span",4),b()),t&2){let n=e.items,i=e.label;J("aria-label",i),d(),re(n)}}function gF(t,e){if(t&1&&ka(0,1),t&2){let n=m(),i=ed(1);q("ngTemplateOutlet",i)("ngTemplateOutletContext",nd(2,lF,n.mentionTabs()))}}function yF(t,e){if(t&1){let n=$();y(0,"div",10),A("click",function(){D(n);let o=m();return M(o.closeMenu())})("contextmenu",function(o){D(n);let r=m();return o.preventDefault(),M(r.closeMenu())}),b(),y(1,"div",11)(2,"button",12),A("click",function(){D(n);let o=m();return M(o.menuClose())}),u(3,"Close"),b(),y(4,"button",13),A("click",function(){D(n);let o=m();return M(o.menuCloseOthers())}),u(5," Close Others "),b(),y(6,"button",13),A("click",function(){D(n);let o=m();return M(o.menuCloseToTheRight())}),u(7," Close to the Right "),b(),y(8,"button",12),A("click",function(){D(n);let o=m();return M(o.menuCloseAll())}),u(9,"Close All"),b()()}if(t&2){let n=e,i=m();d(),At("left",n.x,"px")("top",n.y,"px"),d(3),q("disabled",!i.closableOthers()),d(2),q("disabled",!i.canCloseToTheRight(n.id))}}var wu=class t{tabs=N(dn);morse=N(Ze);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":Eu(e.title)}isRunning(e){let n=this.morse.sessionActivity().get(e);if(n!==void 0)return n.streaming;let i=this.morse.state();return i.sessionId===e&&i.streaming}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(i=>i.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=ue({type:t,selectors:[["morse-tab-strip"]],hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.onEscape()},Mt)},decls:5,vars:6,consts:[["row",""],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["role","tablist",1,"strip"],["role","tab","tabindex","0",1,"tab",3,"active","running","title"],[1,"empty"],["role","tab","tabindex","0",1,"tab",3,"click","keydown.enter","keydown.space","contextmenu","auxclick","title"],["aria-hidden","true",1,"live"],["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,i){if(n&1&&(Jl(0,hF,4,2,"ng-template",null,0,Vm),ka(2,1),w(3,gF,1,4,"ng-container",1),w(4,yF,10,6)),n&2){let o,r=ed(1);d(2),q("ngTemplateOutlet",r)("ngTemplateOutletContext",nd(4,cF,i.mainTabs())),d(),S(i.mentionTabs().length>0?3:-1),d(),S((o=i.menu())?4:-1,o)}},dependencies:[Bm],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%]{height:auto;min-height:30px;align-items:center;gap:6px;padding:4px 8px;border-top:1px solid var(--%NS%morse-border);background:var(--%NS%morse-panel, var(--%NS%morse-bg))}.strip[_ngcontent-%COMP%] + .strip[_ngcontent-%COMP%] .tab[_ngcontent-%COMP%]{height:22px;max-width:190px;padding:0 4px 0 8px;border:1px solid var(--%NS%morse-border);border-radius:999px;background:var(--%NS%morse-bubble, var(--%NS%morse-hover));font-size:11.5px}.strip[_ngcontent-%COMP%] + .strip[_ngcontent-%COMP%] .tab[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover);border-color:var(--%NS%morse-accent);color:var(--%NS%morse-fg)}.strip[_ngcontent-%COMP%] + .strip[_ngcontent-%COMP%] .tab.active[_ngcontent-%COMP%]{border-color:var(--%NS%morse-accent);background:color-mix(in srgb,var(--%NS%morse-accent) 22%,transparent);color:var(--%NS%morse-fg);box-shadow:none}.strip[_ngcontent-%COMP%] + .strip[_ngcontent-%COMP%] .tab[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{width:15px;height:15px;font-size:11px;border-radius:999px}.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)}.tab[_ngcontent-%COMP%] .live[_ngcontent-%COMP%]{flex:none;width:9px;height:9px;border-radius:50%;border:1.5px solid color-mix(in srgb,var(--%NS%morse-accent) 30%,transparent);border-top-color:var(--%NS%morse-accent);animation:_ngcontent-%COMP%_tab-spin .8s linear infinite}@keyframes _ngcontent-%COMP%_tab-spin{to{transform:rotate(360deg)}}.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 OE=250,Su=class t{morse=N(Ze);items=O([]);meta=O(void 0);busy=O(!1);failure=O(void 0);generation=0;loading=this.busy.asReadonly();error=this.failure.asReadonly();isRepo=E(()=>this.meta()?.isRepo===!0);loaded=E(()=>this.meta()!==void 0);branch=E(()=>this.meta()?.branch);root=E(()=>this.meta()?.root);hasMore=E(()=>this.meta()?.hasMore===!0);commits=this.items.asReadonly();refresh(){if(!this.morse.workspace().cwd)return;let n=this.generation+=1;this.busy.set(!0),this.failure.set(void 0),this.page(0).then(i=>{if(n===this.generation){if(i===void 0){this.items.set([]),this.meta.set(void 0),this.failure.set("The host could not read git history for this project.");return}this.items.set(i.commits),this.meta.set(IE(i))}}).finally(()=>{n===this.generation&&this.busy.set(!1)})}loadMore(){if(this.busy()||!this.hasMore()||!this.isRepo())return;let e=this.generation,n=this.items().length;this.busy.set(!0),this.page(n).then(i=>{e!==this.generation||i===void 0||(this.items.update(o=>[...o,...i.commits]),this.meta.set(IE(i)))}).finally(()=>{e===this.generation&&this.busy.set(!1)})}async page(e){let n=await this.morse.requestHostCommand("gitLog",{max:OE,skip:e});return _F(n)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};function IE(t){return{isRepo:t.isRepo,root:t.root,branch:t.branch,hasMore:t.commits.length===OE}}function _F(t){if(typeof t!="object"||t===null)return;let e=t;if(e.isRepo!==!0)return typeof e.isRepo=="boolean"?{isRepo:!1,commits:[]}:void 0;let n=Array.isArray(e.commits)?e.commits.map(vF).filter(i=>i!==void 0):[];return{isRepo:!0,root:typeof e.root=="string"?e.root:void 0,branch:typeof e.branch=="string"?e.branch:void 0,commits:n}}function vF(t){if(typeof t!="object"||t===null)return;let e=t,n=e.hash,i=e.shortHash;if(!(typeof n!="string"||typeof i!="string"))return{hash:n,shortHash:i,parents:NE(e.parents),refs:NE(e.refs),author:typeof e.author=="string"?e.author:"",date:typeof e.date=="string"?e.date:"",subject:typeof e.subject=="string"?e.subject:""}}function NE(t){return Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function AE(t){let e=[],n=[],i=0;for(let o of t){let r=e.slice(),s=[];for(let l=0;l<e.length;l+=1)e[l]===o.hash&&s.push(l);let a=s.length>0?s[0]:PE(e);e[a]=void 0;for(let l=1;l<s.length;l+=1)e[s[l]]=void 0;let c=[];for(let l=0;l<r.length;l+=1)r[l]!==void 0&&e[l]===r[l]&&c.push({fromLane:l,fromY:0,toLane:l,toY:1,color:l});r[a]===o.hash&&c.push({fromLane:a,fromY:0,toLane:a,toY:.5,color:a});for(let l of s)l!==a&&c.push({fromLane:l,fromY:0,toLane:a,toY:.5,color:l});for(let l=0;l<o.parents.length;l+=1){let p=o.parents[l],f=bF(e,p,a);f===-1&&(f=l===0?a:PE(e)),e[f]=p,c.push({fromLane:a,fromY:.5,toLane:f,toY:1,color:f})}i=Math.max(i,e.length),n.push({lane:a,color:a,edges:c})}return{rows:n,laneCount:i}}function PE(t){let e=t.indexOf(void 0);return e===-1?t.length:e}function bF(t,e,n){for(let i=0;i<t.length;i+=1)if(i!==n&&t[i]===e)return i;return-1}var xF=(t,e)=>e.path,CF=(t,e)=>e.commit.hash;function EF(t,e){if(t&1&&(h(0,"span",10),u(1),g()),t&2){let n=e;ie("title",n),d(),k(n)}}function wF(t,e){if(t&1&&(h(0,"span",11),u(1),g()),t&2){let n=m();d(),ae("",n.commits().length," commits")}}function SF(t,e){t&1&&(st(),h(0,"svg",14),ce(1,"path",23)(2,"path",24)(3,"path",25)(4,"path",26),g())}function TF(t,e){t&1&&(st(),h(0,"svg",14),ce(1,"path",27)(2,"path",28)(3,"path",29)(4,"path",30),g())}function DF(t,e){if(t&1&&(h(0,"span",32),u(1),g()),t&2){let n=m(2);d(),k(n.changes().length)}}function MF(t,e){t&1&&(h(0,"div",34)(1,"span",36),st(),h(2,"svg",37),ce(3,"circle",38),g(),h(4,"svg",39),ce(5,"path",40),g()(),u(6," No uncommitted changes "),g())}function kF(t,e){if(t&1){let n=$();h(0,"li")(1,"button",41),F("click",function(){let o=D(n).$implicit,r=m(4);return M(r.openChange(o.path))}),h(2,"span"),u(3),g(),h(4,"span",42),u(5),g(),h(6,"span",43),u(7),g(),ce(8,"span",12),g()()}if(t&2){let n=e.$implicit,i=m(4);d(),ie("title",n.path),d(),Tn("badge "+n.kind),d(),k(n.kind),d(2),k(i.dirOf(n.path)),d(2),k(i.baseOf(n.path))}}function IF(t,e){if(t&1&&(h(0,"ul",35),oe(1,kF,9,6,"li",null,xF),g()),t&2){let n=m(3);d(),re(n.changes())}}function NF(t,e){if(t&1&&w(0,MF,7,0,"div",34)(1,IF,3,0,"ul",35),t&2){let n=m(2);S(n.changes().length===0?0:1)}}function OF(t,e){if(t&1){let n=$();h(0,"section",31)(1,"div",19)(2,"button",20),F("click",function(){D(n);let o=m();return M(o.toggleChanges())}),h(3,"span",21),u(4,"\u203A"),g(),h(5,"span",22),u(6,"Changes"),g(),w(7,DF,2,1,"span",32),g()(),w(8,NF,2,1),g(),h(9,"div",33),F("pointerdown",function(o){D(n);let r=m();return M(r.startResize(o))}),g()}if(t&2){let n=m();At("height",n.changesHeightPx(),"px"),d(2),J("aria-expanded",!n.changesCollapsed()),d(),X("open",!n.changesCollapsed()),d(4),S(n.changes().length>0?7:-1),d(),S(n.changesCollapsed()?-1:8),d(),X("gone",n.changesCollapsed()||n.historyCollapsed())}}function PF(t,e){t&1&&(h(0,"p",44),u(1,"Reading git history\u2026"),g())}function AF(t,e){t&1&&(h(0,"p",45),u(1),g()),t&2&&(d(),k(e))}function RF(t,e){t&1&&(h(0,"p",44),u(1,"This project is not a git repository."),g())}function LF(t,e){t&1&&(h(0,"div",34)(1,"span",47),st(),h(2,"svg",48),ce(3,"path",49)(4,"circle",50),g()(),u(5," No commits yet "),g())}function FF(t,e){if(t&1&&(st(),ce(0,"path")(1,"path",64)),t&2){let n=e.$implicit,i=m(4);At("stroke",i.color(n.color)),J("d",i.path(n)),d(),J("d",i.path(n))}}function VF(t,e){if(t&1&&(h(0,"span",66),u(1),g()),t&2){let n=e.$implicit,i=m(5);X("kind-head",i.refKind(n)==="head")("kind-local",i.refKind(n)==="local")("kind-tag",i.refKind(n)==="tag"),ie("title",i.refLabel(n)),d(),k(i.refLabel(n))}}function jF(t,e){if(t&1&&(h(0,"span",66),u(1),g()),t&2){let n=m(2).$implicit;ie("title",n.restTitle),d(),ae("+",n.moreRefs)}}function $F(t,e){if(t&1&&(h(0,"span",58),oe(1,VF,2,8,"span",65,Ei),w(3,jF,2,2,"span",66),g()),t&2){let n=m().$implicit;d(),re(n.refs),d(2),S(n.moreRefs>0?3:-1)}}function BF(t,e){if(t&1&&(h(0,"span",61),u(1,"\xB7"),g(),h(2,"span",67),u(3),g()),t&2){let n=m().$implicit;d(3),k(n.commit.author)}}function HF(t,e){if(t&1){let n=$();h(0,"li",54),st(),h(1,"svg",55),oe(2,FF,2,4,null,null,Ci),ce(4,"circle",56),g(),Jt(),h(5,"span",57),u(6),g(),w(7,$F,4,1,"span",58),ce(8,"span",12),h(9,"span",59)(10,"span",60),u(11),g(),h(12,"span",61),u(13,"\xB7"),g(),h(14,"span",62),u(15),g(),w(16,BF,4,1),g(),h(17,"button",63),F("click",function(){let o=D(n).$implicit,r=m(3);return M(r.copy(o.commit))}),u(18),g()()}if(t&2){let n=e.$implicit,i=m(3);X("expanded",i.expanded()),d(),J("width",i.graphWidth())("height",i.rowHeight)("viewBox","0 0 "+i.graphWidth()+" "+i.rowHeight),d(),re(n.row.edges),d(2),At("fill",i.rowColor(n.row)),J("cx",i.x(n.row.lane))("cy",i.rowHeight/2),d(2),k(n.commit.subject),d(),S(n.refs.length>0?7:-1),d(3),ie("title",n.commit.hash),d(),k(n.commit.shortHash),d(4),k(i.when(n.commit.date)),d(),S(i.expanded()?16:-1),d(),ie("title",i.copied()===n.commit.hash?"Copied":"Copy commit hash"),J("aria-label","Copy commit hash "+n.commit.shortHash),d(),ae(" ",i.copied()===n.commit.hash?"\u2713":"\u29C9"," ")}}function UF(t,e){if(t&1&&u(0),t&2){let n=m(3);ae(" ",n.loading()?"Loading older commits\u2026":"Scroll for older commits"," ")}}function zF(t,e){t&1&&u(0," Beginning of history ")}function GF(t,e){if(t&1){let n=$();h(0,"ul",51),F("scroll",function(o){D(n);let r=m(2);return M(r.onScroll(o))}),oe(1,HF,19,18,"li",52,CF),h(3,"li",53),w(4,UF,1,1)(5,zF,1,0),g()()}if(t&2){let n=m(2);d(),re(n.entries().rows),d(3),S(n.hasMore()?4:5)}}function qF(t,e){if(t&1&&w(0,PF,2,0,"p",44)(1,AF,2,1,"p",45)(2,RF,2,0,"p",44)(3,LF,6,0,"div",34)(4,GF,6,1,"ul",46),t&2){let n,i=m();S(i.loading()&&!i.loaded()?0:(n=i.error())?1:i.isRepo()?i.commits().length===0?3:4:2,n)}}var RE=["var(--morse-accent)","var(--morse-success)","var(--morse-number)","var(--morse-typename)","var(--morse-keyword)","var(--morse-info)","var(--morse-warn)"],tg=16,LE=32,WF=180,Tu=class t{expanded=te(!1);morse=N(Ze);shell=N(Ht);git=N(Su);workspace=N(zi);tabs=N(dn);commits=this.git.commits;branch=this.git.branch;root=this.git.root;isRepo=this.git.isRepo;loading=this.git.loading;loaded=this.git.loaded;hasMore=this.git.hasMore;error=this.git.error;changesCollapsed=this.shell.gitChangesCollapsed;historyCollapsed=this.shell.gitHistoryCollapsed;changesHeight=this.shell.gitChangesHeight;changes=E(()=>{let e=this.workspace.status();if(e===void 0||!e.isRepo)return[];let n=[];for(let i of e.files){let o=xh(i.status);o!==void 0&&n.push({path:i.path,kind:o})}return n.sort((i,o)=>i.path.localeCompare(o.path))});rowHeight=LE;copied=O(void 0);entries=E(()=>{let e=this.commits(),n=AE(e),i=this.expanded()?3:1;return{laneCount:n.laneCount,rows:n.rows.map((o,r)=>{let s=e[r],a=s.refs.slice(0,i),c=s.refs.slice(i);return{row:o,commit:s,refs:a,moreRefs:c.length,restTitle:c.map(l=>this.refLabel(l)).join(", ")}})}});graphWidth=E(()=>Math.max(1,this.entries().laneCount)*tg);constructor(){se(()=>{!this.shell.gitPanelOpen()||!this.morse.workspace().cwd||this.git.refresh()})}refresh(){this.git.refresh()}onScroll(e){let n=e.target;n.scrollHeight-n.scrollTop-n.clientHeight<600&&this.git.loadMore()}close(){this.shell.closeGitPanel()}openChange(e){this.tabs.openFile(e)}dirOf(e){let n=e.lastIndexOf("/");return n===-1?"":e.slice(0,n+1)}baseOf(e){let n=e.lastIndexOf("/");return n===-1?e:e.slice(n+1)}toggleExpanded(){this.shell.toggleGitPanelExpanded()}toggleChanges(){this.shell.toggleGitChanges()}toggleHistory(){this.shell.toggleGitHistory()}changesHeightPx(){return this.changesCollapsed()||this.historyCollapsed()?null:this.changesHeight()??null}startResize(e){e.preventDefault();let n=e.currentTarget,i=n.parentElement;if(!i)return;let o=i.getBoundingClientRect().top,r=i.getBoundingClientRect().bottom;n.setPointerCapture(e.pointerId);let s=0,a=0,c=()=>{s=0,this.shell.setGitChangesHeight(a,!1)},l=f=>{a=Math.min(r-o-80,f.clientY-o),s===0&&(s=requestAnimationFrame(c))},p=()=>{s!==0&&(cancelAnimationFrame(s),c()),this.shell.setGitChangesHeight(a),n.removeEventListener("pointermove",l),n.removeEventListener("pointerup",p),n.removeEventListener("pointercancel",p)};n.addEventListener("pointermove",l),n.addEventListener("pointerup",p),n.addEventListener("pointercancel",p)}startWidthResize(e){e.preventDefault(),this.shell.gitPanelExpanded()&&this.shell.toggleGitPanelExpanded();let n=e.currentTarget,i=n.parentElement,o=e.clientX,r=i?.getBoundingClientRect().width??340,s=n.closest(".shell"),a=s?.querySelector(".nav"),c=s?.getBoundingClientRect().width??window.innerWidth,l=this.shell.navigationCollapsed()?0:a?.getBoundingClientRect().width??240,p=Math.max(320,c-l-WF);n.setPointerCapture(e.pointerId),s?.style.setProperty("transition","none"),i?.classList.add("resizing");let f=0,_=this.shell.gitPanelWidth()??Math.round(r),x=()=>{f=0,this.shell.setGitPanelWidth(_,!1)},C=P=>{_=Math.min(p,r+(o-P.clientX)),f===0&&(f=requestAnimationFrame(x))},T=()=>{f!==0&&(cancelAnimationFrame(f),x()),s?.style.removeProperty("transition"),i?.classList.remove("resizing"),this.shell.setGitPanelWidth(_),n.removeEventListener("pointermove",C),n.removeEventListener("pointerup",T),n.removeEventListener("pointercancel",T)};n.addEventListener("pointermove",C),n.addEventListener("pointerup",T),n.addEventListener("pointercancel",T)}resetWidth(){this.shell.resetGitPanelWidth()}refLabel(e){if(e.startsWith("tag: "))return e.slice(5);let n=e.indexOf(" -> ");return n===-1?e:e.slice(n+4)}refKind(e){return e.startsWith("tag: ")?"tag":e.includes("HEAD")?"head":"local"}when(e){let n=Date.parse(e);if(!Number.isFinite(n))return"";let i=Math.max(0,Math.round((Date.now()-n)/1e3));if(i<60)return`${i}s`;let o=Math.round(i/60);if(o<60)return`${o}m`;let r=Math.round(o/60);return r<24?`${r}h`:`${Math.round(r/24)}d`}async copy(e){try{await navigator.clipboard.writeText(e.hash),this.copied.set(e.hash),setTimeout(()=>{this.copied()===e.hash&&this.copied.set(void 0)},1200)}catch{}}x(e){return e*tg+tg/2}y(e){return e*LE}color(e){return RE[e%RE.length]}path(e){let n=this.x(e.fromLane),i=this.y(e.fromY),o=this.x(e.toLane),r=this.y(e.toY);if(n===o)return`M ${n} ${i} L ${o} ${r}`;let s=(i+r)/2;return`M ${n} ${i} C ${n} ${s}, ${o} ${s}, ${o} ${r}`}rowColor(e){return this.color(e.color)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-git-panel"]],inputs:{expanded:[1,"expanded"]},decls:31,vars:19,consts:[["aria-label","Git history",1,"panel"],["role","separator","aria-orientation","vertical","aria-label","Resize the git panel","title","Drag to resize",1,"edge-resize",3,"pointerdown","dblclick"],[1,"head"],[1,"brand",3,"title"],["viewBox","0 0 16 16","aria-hidden","true"],["cx","4.5","cy","3.5","r","1.8"],["cx","4.5","cy","12.5","r","1.8"],["cx","11.5","cy","6.5","r","1.8"],["d","M4.5 5.3v5.4"],["d","M4.5 5.3c0 2.4 7 1 7 3"],[1,"branch",3,"title"],[1,"count"],[1,"grow"],["type","button",1,"icon",3,"click","title"],["viewBox","0 0 16 16","aria-hidden","true",1,"glyph"],["type","button","title","Refresh history","aria-label","Refresh history",1,"icon",3,"click","disabled"],["type","button","title","Hide the git panel","aria-label","Hide the git panel",1,"icon",3,"click"],[1,"body"],[1,"history"],[1,"section-head"],["type","button",1,"section-toggle",3,"click"],[1,"chevron"],[1,"section-title"],["d","M3.5 6.5h3v-3"],["d","M12.5 9.5h-3v3"],["d","M6.5 6.5 3 3"],["d","M9.5 9.5 13 13"],["d","M6.5 3.5h-3v3"],["d","M9.5 12.5h3v-3"],["d","M3.5 3.5 8 8"],["d","M12.5 12.5 8 8"],["aria-label","Uncommitted changes",1,"changes"],[1,"section-count"],["role","separator","aria-orientation","horizontal","aria-label","Resize the git sections","title","Drag to resize",1,"divider",3,"pointerdown"],[1,"empty"],[1,"change-list"],["aria-hidden","true",1,"mark"],["viewBox","0 0 24 24",1,"ring"],["cx","12","cy","12","r","10"],["viewBox","0 0 24 24",1,"check"],["d","M7.5 12.5 11 16l6-7"],["type","button",1,"change",3,"click","title"],[1,"change-dir"],[1,"change-name"],[1,"hint"],[1,"hint","error"],[1,"list"],["aria-hidden","true",1,"mark","node"],["viewBox","0 0 24 24"],["d","M12 3v18",1,"line"],["cx","12","cy","12","r","3.4",1,"dot"],[1,"list",3,"scroll"],[1,"commit",3,"expanded"],[1,"more"],[1,"commit"],["aria-hidden","true",1,"graph"],["r","3.4"],[1,"subject"],[1,"refs"],[1,"meta"],[1,"hash",3,"title"],["aria-hidden","true",1,"sep"],[1,"when"],["type","button",1,"copy",3,"click","title"],[1,"flow"],[1,"ref",3,"title","kind-head","kind-local","kind-tag"],[1,"ref",3,"title"],[1,"author"]],template:function(n,i){if(n&1&&(h(0,"aside",0)(1,"div",1),F("pointerdown",function(r){return i.startWidthResize(r)})("dblclick",function(){return i.resetWidth()}),g(),h(2,"header",2)(3,"span",3),st(),h(4,"svg",4),ce(5,"circle",5)(6,"circle",6)(7,"circle",7)(8,"path",8)(9,"path",9),g(),u(10," Git "),g(),w(11,EF,2,2,"span",10),w(12,wF,2,1,"span",11),Jt(),ce(13,"span",12),h(14,"button",13),F("click",function(){return i.toggleExpanded()}),w(15,SF,5,0,":svg:svg",14)(16,TF,5,0,":svg:svg",14),g(),h(17,"button",15),F("click",function(){return i.refresh()}),u(18," \u27F3 "),g(),h(19,"button",16),F("click",function(){return i.close()}),u(20," \u2715 "),g()(),h(21,"div",17),w(22,OF,10,9),h(23,"section",18)(24,"div",19)(25,"button",20),F("click",function(){return i.toggleHistory()}),h(26,"span",21),u(27,"\u203A"),g(),h(28,"span",22),u(29,"History"),g()()(),w(30,qF,5,1),g()()()),n&2){let o;X("full",i.expanded()),d(3),ie("title",i.root()??""),d(8),S((o=i.branch())?11:-1,o),d(),S(i.expanded()&&i.commits().length>0?12:-1),d(2),ie("title",i.expanded()?"Fit the git panel back into the sidebar":"Expand the git graph"),J("aria-label",i.expanded()?"Collapse the git panel":"Expand the git panel")("aria-pressed",i.expanded()),d(),S(i.expanded()?15:16),d(2),ie("disabled",i.loading()),d(4),X("changes-collapsed",i.changesCollapsed())("history-collapsed",i.historyCollapsed()),d(),S(i.isRepo()?22:-1),d(3),J("aria-expanded",!i.historyCollapsed()),d(),X("open",!i.historyCollapsed()),d(4),S(i.historyCollapsed()?-1:30)}},styles:['[_nghost-%COMP%]{position:relative;display:block;min-width:0;min-height:0;height:100%;overflow:hidden;border-left:1px solid var(--%NS%morse-border);background:var(--%NS%morse-nav-bg)}.edge-resize[_ngcontent-%COMP%]{position:absolute;top:0;bottom:0;left:0;width:6px;z-index:3;cursor:ew-resize}.edge-resize[_ngcontent-%COMP%]:hover, .edge-resize[_ngcontent-%COMP%]:active{background:color-mix(in srgb,var(--%NS%morse-accent) 45%,transparent)}.panel.resizing[_ngcontent-%COMP%] .body[_ngcontent-%COMP%]{pointer-events:none}.panel.resizing[_ngcontent-%COMP%] .graph[_ngcontent-%COMP%] path.flow[_ngcontent-%COMP%]{animation:none}.head[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0;z-index:1;display:flex;align-items:center;gap:6px;min-height:var(--%NS%morse-head-height);padding:0 6px 0 10px;border-bottom:1px solid var(--%NS%morse-border);background:var(--%NS%morse-nav-bg)}.brand[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;font-weight:600}.brand[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}.branch[_ngcontent-%COMP%], .ref[_ngcontent-%COMP%]{flex:none;padding:0 6px;border-radius:4px;font-family:var(--%NS%morse-font-mono);font-size:10px;line-height:16px;background:color-mix(in srgb,var(--%NS%morse-fg-muted) 12%,transparent);color:var(--%NS%morse-fg-muted)}.branch[_ngcontent-%COMP%], .ref[_ngcontent-%COMP%]{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.commit.expanded[_ngcontent-%COMP%] .ref[_ngcontent-%COMP%]{max-width:240px}.branch[_ngcontent-%COMP%], .ref.kind-head[_ngcontent-%COMP%]{color:var(--%NS%morse-accent)}.ref.kind-local[_ngcontent-%COMP%]{color:var(--%NS%morse-success)}.ref.kind-tag[_ngcontent-%COMP%]{color:var(--%NS%morse-typename)}.grow[_ngcontent-%COMP%]{flex:1}.icon[_ngcontent-%COMP%]{flex:none;width:24px;height:24px;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-muted);font-size:13px;line-height:1;cursor:pointer}.icon[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover);color:var(--%NS%morse-fg)}.icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}.count[_ngcontent-%COMP%]{color:var(--%NS%morse-fg-muted);font-size:11px}.body[_ngcontent-%COMP%]{position:absolute;top:var(--%NS%morse-head-height);right:0;bottom:0;left:0;display:flex;flex-direction:column;min-height:0}.changes[_ngcontent-%COMP%]{flex:none;height:45%;display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden}.body.changes-collapsed[_ngcontent-%COMP%] .changes[_ngcontent-%COMP%], .body.history-collapsed[_ngcontent-%COMP%] .changes[_ngcontent-%COMP%]{height:auto}.body.history-collapsed[_ngcontent-%COMP%] .changes[_ngcontent-%COMP%]{flex:1}.divider[_ngcontent-%COMP%]{flex:none;position:relative;height:5px;border-top:1px solid var(--%NS%morse-border);background:transparent;cursor:ns-resize}.divider[_ngcontent-%COMP%]:hover{border-top-color:var(--%NS%morse-accent);background:color-mix(in srgb,var(--%NS%morse-accent) 30%,transparent)}.divider[_ngcontent-%COMP%]:after{content:"";position:absolute;inset:-3px 0}.divider.gone[_ngcontent-%COMP%]{display:none}.history[_ngcontent-%COMP%]{flex:1;min-height:0;display:flex;flex-direction:column}.body.history-collapsed[_ngcontent-%COMP%] .history[_ngcontent-%COMP%]{flex:none}.section-head[_ngcontent-%COMP%]{display:flex;flex:none;align-items:center}.section-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:5px;flex:1;min-width:0;padding:5px 10px;border:0;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer}.section-toggle[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}.chevron[_ngcontent-%COMP%]{flex:none;display:inline-block;color:var(--%NS%morse-fg-muted);font-size:11px;line-height:1;transition:transform .12s ease}.chevron.open[_ngcontent-%COMP%]{transform:rotate(90deg)}.section-title[_ngcontent-%COMP%]{font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--%NS%morse-fg-muted)}.section-count[_ngcontent-%COMP%]{font-size:10.5px;color:var(--%NS%morse-fg-muted)}.change-list[_ngcontent-%COMP%]{margin:0;padding:0 0 6px;list-style:none}.change[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;width:100%;padding:2px 10px;border:0;background:none;color:var(--%NS%morse-fg);font:inherit;text-align:left;cursor:pointer}.change[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--%NS%morse-hover)}.change-dir[_ngcontent-%COMP%]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--%NS%morse-fg-muted);font-size:11px}.change-name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.empty[_ngcontent-%COMP%]{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:16px;color:var(--%NS%morse-fg-muted);font-size:11.5px;text-align:center}.mark[_ngcontent-%COMP%]{position:relative;display:inline-grid;place-items:center;width:38px;height:38px;animation:_ngcontent-%COMP%_mark-breathe 2.8s ease-in-out infinite}.mark[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{position:absolute;inset:0;width:100%;height:100%;fill:none;stroke-linecap:round;stroke-linejoin:round}.mark[_ngcontent-%COMP%] .ring[_ngcontent-%COMP%]{stroke:color-mix(in srgb,var(--%NS%morse-fg-muted) 40%,transparent);stroke-width:1.4}.mark[_ngcontent-%COMP%] .check[_ngcontent-%COMP%]{stroke:var(--%NS%morse-success);stroke-width:2;stroke-dasharray:20;stroke-dashoffset:20;animation:_ngcontent-%COMP%_check-draw .9s ease-out .12s forwards}.mark.node[_ngcontent-%COMP%] .line[_ngcontent-%COMP%]{stroke:color-mix(in srgb,var(--%NS%morse-fg-muted) 35%,transparent);stroke-width:1.4}.mark.node[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{stroke:var(--%NS%morse-accent);stroke-width:1.6;transform-box:fill-box;transform-origin:center;animation:_ngcontent-%COMP%_node-pulse 2.8s ease-in-out infinite}.mark[_ngcontent-%COMP%]:after{content:"";position:absolute;inset:-4px;border-radius:50%;border:1px solid color-mix(in srgb,var(--%NS%morse-success) 45%,transparent);animation:_ngcontent-%COMP%_mark-ping 2.8s ease-out infinite}.mark.node[_ngcontent-%COMP%]:after{border-color:color-mix(in srgb,var(--%NS%morse-accent) 45%,transparent)}@keyframes _ngcontent-%COMP%_mark-breathe{0%,to{transform:scale(.95)}50%{transform:scale(1.05)}}@keyframes _ngcontent-%COMP%_check-draw{to{stroke-dashoffset:0}}@keyframes _ngcontent-%COMP%_node-pulse{0%,to{transform:scale(.7);opacity:.6}50%{transform:scale(1.15);opacity:1}}@keyframes _ngcontent-%COMP%_mark-ping{0%{transform:scale(.85);opacity:.7}70%,to{transform:scale(1.35);opacity:0}}@media(prefers-reduced-motion:reduce){.mark[_ngcontent-%COMP%], .mark[_ngcontent-%COMP%]:after{animation:none}.mark[_ngcontent-%COMP%] .check[_ngcontent-%COMP%]{animation:none;stroke-dashoffset:0}.mark.node[_ngcontent-%COMP%] .dot[_ngcontent-%COMP%]{animation:none}}.badge[_ngcontent-%COMP%]{flex:none;padding:0 4px;border-radius:4px;font-family:var(--%NS%morse-font-mono);font-size:9.5px;line-height:15px;color:var(--%NS%morse-fg-muted)}.badge.M[_ngcontent-%COMP%]{color:var(--%NS%morse-warn)}.badge.A[_ngcontent-%COMP%], .badge.U[_ngcontent-%COMP%]{color:var(--%NS%morse-success)}.badge.D[_ngcontent-%COMP%], .badge.C[_ngcontent-%COMP%]{color:var(--%NS%morse-error)}.badge.R[_ngcontent-%COMP%]{color:var(--%NS%morse-info)}.list[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;margin:0;padding:2px 0 10px;list-style:none}.hint[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;padding:12px;color:var(--%NS%morse-fg-muted);font-size:12px;line-height:1.5}.hint.error[_ngcontent-%COMP%]{color:var(--%NS%morse-error)}.more[_ngcontent-%COMP%]{padding:10px 12px;color:var(--%NS%morse-fg-muted);font-size:11px;text-align:center}.commit[_ngcontent-%COMP%]{display:flex;flex-wrap:nowrap;align-items:center;gap:10px;height:32px;padding-right:8px}.commit[_ngcontent-%COMP%]:hover{background:var(--%NS%morse-hover)}.graph[_ngcontent-%COMP%]{flex:none;display:block;overflow:visible}.graph[_ngcontent-%COMP%] path[_ngcontent-%COMP%]{fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.graph[_ngcontent-%COMP%] circle[_ngcontent-%COMP%]{stroke:var(--%NS%morse-nav-bg);stroke-width:1.6}.graph[_ngcontent-%COMP%] path.flow[_ngcontent-%COMP%]{stroke:var(--%NS%morse-fg);stroke-dasharray:5 15;stroke-linecap:round;opacity:.35;animation:_ngcontent-%COMP%_graph-flow 1.4s linear infinite}@keyframes _ngcontent-%COMP%_graph-flow{to{stroke-dashoffset:-20}}@media(prefers-reduced-motion:reduce){.graph[_ngcontent-%COMP%] path.flow[_ngcontent-%COMP%]{animation:none;opacity:0}}.subject[_ngcontent-%COMP%]{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;color:var(--%NS%morse-fg)}.refs[_ngcontent-%COMP%]{flex:0 1 auto;display:flex;align-items:center;gap:4px;min-width:0}.grow[_ngcontent-%COMP%]{flex:1;min-width:8px}.meta[_ngcontent-%COMP%]{flex:none;display:flex;align-items:center;gap:6px;color:var(--%NS%morse-fg-muted);font-size:11px;white-space:nowrap}.hash[_ngcontent-%COMP%]{font-family:var(--%NS%morse-font-mono)}.author[_ngcontent-%COMP%]{display:none;max-width:170px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.commit.expanded[_ngcontent-%COMP%] .author[_ngcontent-%COMP%]{display:inline}.sep[_ngcontent-%COMP%]{opacity:.5}.copy[_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:11px;cursor:pointer;opacity:0}.commit[_ngcontent-%COMP%]:hover .copy[_ngcontent-%COMP%]{opacity:1}.copy[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--%NS%morse-border);color:var(--%NS%morse-fg)}']})};var Ls=520,FE=70,Du=class t{animation=N(ln);async play(e,n){let i=this.resolveTarget();if(!this.animation.isEnabled||!n||!i||e.length===0||typeof document>"u")return;let o=Ls+(e.length-1)*FE;e.forEach((r,s)=>{this.launch(r,n,i,s*FE)}),await YF(o)}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,i,o){let r=this.createGhost(e,n);document.body.appendChild(r);let s=Math.min(n.y,i.y)-Math.max(60,Math.abs(n.y-i.y)*.35);rn(r,{translateX:[n.x,i.x],translateY:[{to:n.y,duration:Ls*.18},{to:s,duration:Ls*.42},{to:i.y,duration:Ls*.4}],rotate:[0,-8,6,0],scale:[1,1.04,.86,.42],opacity:[1,1,.9,0],duration:Ls,delay:o,ease:"inOut(2)",onComplete:()=>r.remove()}),setTimeout(()=>r.remove(),o+Ls+400)}createGhost(e,n){let i=document.createElement("div");if(i.className="drop-ghost",e.thumbnail){let r=document.createElement("img");r.src=e.thumbnail,r.alt="",i.appendChild(r)}else{let r=document.createElement("span");r.className="drop-ghost-glyph",r.textContent="\u25A4",i.appendChild(r)}let o=document.createElement("span");return o.className="drop-ghost-name",o.textContent=e.name,i.appendChild(o),i}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};function YF(t){return new Promise(e=>setTimeout(e,t))}var Mu=class t{attachments=N(Ui);flight=N(Du);uploads=N(Ds);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 i=e.dataTransfer;if(!i)return;let o=Array.from(i.files??[]),{images:r}=await this.attachments.read(o.filter(T=>T.type.startsWith("image/"))),s=QF(i),a=o.filter(T=>!T.type.startsWith("image/")),c=this.uploads.available()&&a.length>0?this.uploads.upload(a):Promise.resolve({added:[],failed:a.map(T=>T.name)}),l=[...s.paths.map(T=>VE(T,n)),...s.names,...a.map(T=>T.name)],p=e.clientX>0||e.clientY>0?{x:e.clientX,y:e.clientY}:KF();await this.flight.play([...r.map(T=>({name:T.name,thumbnail:`data:${T.mimeType};base64,${T.data}`})),...l.map(T=>({name:T}))],p);let f=await c,_=[...s.paths.map(T=>VE(T,n)),...s.names,...f.added.map(T=>T.path),...f.failed];this.attachments.add(r),this.attachments.addMentions(_);let x=[];if(r.length>0&&x.push(`${r.length} image${r.length===1?"":"s"} attached`),_.length>0&&x.push(`${_.length} file${_.length===1?"":"s"} added to the prompt`),x.length>0){this.attachments.say("info",x.join(" \xB7 "));return}let C=Array.from(i.types??[]).join(", ")||"none";this.attachments.say("warn",`That drop carried no file (types: ${C}).`)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};function KF(){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 ZF=["application/vnd.code.uri-list","ResourceURLs","text/uri-list"];function QF(t){let e=[];for(let o of[...ZF,"text/plain"])for(let r of XF(t.getData(o)))e.push(r);let n=[],i=[];for(let o of e){if(o.startsWith("file://")){let s=n3(o);s&&n.push(s);continue}if(/^[a-z]+:\/\//i.test(o))continue;if(t3(o)){n.push(o);continue}let r=e3(o);r&&i.push(r)}return{paths:Array.from(new Set(n)),names:Array.from(new Set(i))}}function XF(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(i=>{if(typeof i=="string")return i;let o=i,r=o.fsPath??o.uri??o.path;return typeof r=="string"?r:""}).filter(i=>i.length>0)}catch{}return JF(e)}function JF(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 e3(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 t3(t){return!!(t.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t))}function n3(t){try{let e=new URL(t);return decodeURIComponent(e.pathname)}catch{return}}function VE(t,e){if(!e)return t;let n=e.endsWith("/")?e:`${e}/`;return t.startsWith(n)?t.slice(n.length):t}var i3="https://registry.npmjs.org/@supanadit/morse-web/latest";function o3(t){return`https://github.com/supanadit/morse/releases/tag/v${t}`}var r3=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 s3(t){let e=t;return typeof e?.version=="string"?e.version:void 0}function a3(t,e){let n=$E(t),i=$E(e);if(n===void 0||i===void 0)return!1;for(let o=0;o<n.numbers.length;o+=1)if(n.numbers[o]!==i.numbers[o])return n.numbers[o]>i.numbers[o];return n.prerelease===i.prerelease?!1:n.prerelease===void 0?!0:i.prerelease===void 0?!1:n.prerelease>i.prerelease}function c3(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 jE(){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 $E(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 Fs=class t{morse=N(Ze);loader=N(r3);notice=O(void 0);started=!1;available=this.notice.asReadonly();constructor(){se(()=>{let e=this.morse.capabilities();this.started||jE()===void 0&&e?.updateCheck!==!0||(this.started=!0,this.check(this.morse.version(),e?.hostKind??"server"))})}async check(e,n,i=this.loader){try{let o=jE()??(i===void 0?void 0:s3(await i(i3)));if(o===void 0||!a3(o,e))return;this.notice.set({current:e,latest:o,hint:c3(n,o),url:o3(o)})}catch{}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=xe({token:t,factory:t.\u0275fac,providedIn:"root"})};var l3=(t,e)=>e.node.path;function d3(t,e){if(t&1){let n=$();h(0,"div",8),F("pointerdown",function(o){D(n);let r=m();return M(r.startResize(o))}),g()}}function u3(t,e){t&1&&(h(0,"p",9),u(1,"Loading files\u2026"),g())}function p3(t,e){t&1&&(h(0,"p",10),u(1),g()),t&2&&(d(),k(e))}function f3(t,e){t&1&&(h(0,"p",9),u(1,"No files found."),g())}function m3(t,e){if(t&1&&(h(0,"span",17),u(1),g()),t&2){let n=e,i=m(5);Tn("badge "+n),ie("title",i.badgeTitle(n)),d(),k(n)}}function h3(t,e){if(t&1&&w(0,m3,2,4,"span",16),t&2){let n,i=m().$implicit,o=m(3);S((n=o.changeOf(i.node.path))?0:-1,n)}}function g3(t,e){t&1&&ce(0,"span",15)}function y3(t,e){if(t&1){let n=$();h(0,"button",12),F("click",function(){let o=D(n).$implicit,r=m(3);return M(r.onRow(o.node))}),h(1,"span",13),u(2),g(),h(3,"span",14),u(4),g(),w(5,h3,1,1)(6,g3,1,0,"span",15),g()}if(t&2){let n=e.$implicit,i=m(3);At("padding-left",6+n.depth*12,"px"),X("dir",n.node.kind==="dir"),ie("title",n.node.path),d(2),k(i.glyph(n.node)),d(2),k(n.node.name),d(),S(n.node.kind==="file"?5:i.dirChanged(n.node.path)?6:-1)}}function _3(t,e){if(t&1&&oe(0,y3,7,8,"button",11,l3),t&2){let n=m(2);re(n.rows())}}function v3(t,e){if(t&1&&(h(0,"div",7),w(1,u3,2,0,"p",9)(2,p3,2,1,"p",10)(3,f3,2,0,"p",9)(4,_3,2,0),g()),t&2){let n,i=m();d(),S(i.isLoading()&&i.rows().length===0?1:(n=i.errorMessage())?2:i.rows().length===0?3:4,n)}}var b3=140,ku=class t{morse=N(Ze);tabs=N(dn);shell=N(Ht);workspace=N(zi);host=N(Bt);height=this.shell.explorerHeight;expanded=O(new Set);folded=O(!1);expandedFor="";tree=E(()=>ME(this.workspace.files()));rows=E(()=>x3(this.tree(),this.expanded()));fileCount=E(()=>BE(this.tree()));collapsed=this.folded.asReadonly();isLoading=this.workspace.busy;errorMessage=this.workspace.error;changes=E(()=>Ud(this.workspace.status()));changedDirs=E(()=>{let e=new Set;for(let n of this.changes().keys()){let i=n.split("/");for(let o=1;o<i.length;o+=1)e.add(i.slice(0,o).join("/"))}return e});constructor(){se(()=>{let e=this.morse.state().workspace.cwd;ii(()=>{e.length>0&&e!==this.expandedFor&&(this.expanded.set(new Set),this.expandedFor=e)})})}glyph(e){return e.kind==="dir"?this.expanded().has(e.path)?"\u25BE":"\u25B8":Eu(e.name)}isExpanded(e){return this.expanded().has(e)}changeOf(e){return this.changes().get(e)}badgeTitle(e){switch(e){case"M":return"Modified";case"A":return"Added";case"D":return"Deleted";case"R":return"Renamed";case"U":return"Untracked";case"C":return"Conflict"}}dirChanged(e){return this.changedDirs().has(e)}toggleFold(){this.folded.update(e=>!e)}refresh(){this.workspace.refresh()}onRow(e){if(e.kind==="dir"){this.expanded.update(n=>{let i=new Set(n);return i.has(e.path)?i.delete(e.path):i.add(e.path),i});return}this.tabs.openFile(e.path)}startResize(e){e.preventDefault();let n=this.host.nativeElement,i=n.getBoundingClientRect().bottom,o=n.parentElement?.getBoundingClientRect().top??0,r=Math.max(b3,i-o-120),s=e.currentTarget;s.setPointerCapture(e.pointerId);let a=l=>{this.shell.setExplorerHeight(Math.min(r,i-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)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-file-explorer"]],hostVars:4,hostBindings:function(n,i){n&2&&(At("height",i.collapsed()?null:i.height(),"px"),X("sized",i.height()!==void 0&&!i.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"],[1,"rows"],["role","separator","aria-orientation","horizontal","aria-label","Resize the file explorer","title","Drag to resize",1,"resize",3,"pointerdown"],[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"],["title","Contains changes","aria-hidden","true",1,"dot"],[3,"class","title"],[3,"title"]],template:function(n,i){n&1&&(h(0,"div",0),w(1,d3,1,0,"div",1),h(2,"button",2),F("click",function(){return i.toggleFold()}),h(3,"span",3),u(4,"\u203A"),g(),h(5,"span",4),u(6,"Explorer"),g(),h(7,"span",5),u(8),g()(),h(9,"button",6),F("click",function(){return i.refresh()}),u(10," \u27F3 "),g()(),w(11,v3,5,1,"div",7)),n&2&&(d(),S(i.collapsed()?-1:1),d(),J("aria-expanded",!i.collapsed()),d(),X("open",!i.collapsed()),d(5),k(i.fileCount()),d(3),S(i.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)}.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}.badge[_ngcontent-%COMP%]{flex:none;padding:0 4px;border-radius:4px;font-family:var(--%NS%morse-font-mono);font-size:9.5px;line-height:15px;color:var(--%NS%morse-fg-muted)}.badge.M[_ngcontent-%COMP%]{color:var(--%NS%morse-warn)}.badge.A[_ngcontent-%COMP%], .badge.U[_ngcontent-%COMP%]{color:var(--%NS%morse-success)}.badge.D[_ngcontent-%COMP%], .badge.C[_ngcontent-%COMP%]{color:var(--%NS%morse-error)}.badge.R[_ngcontent-%COMP%]{color:var(--%NS%morse-info)}.dot[_ngcontent-%COMP%]{flex:none;width:6px;height:6px;border-radius:50%;background:var(--%NS%morse-warn)}.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 x3(t,e){let n=[],i=(o,r)=>{for(let s of o)n.push({node:s,depth:r}),s.kind==="dir"&&e.has(s.path)&&i(s.children,r+1)};return i(t,0),n}function BE(t){let e=0;for(let n of t)e+=n.kind==="file"?1:BE(n.children);return e}var C3=["search"],E3=["list"],w3=(t,e)=>e.path||"all";function S3(t,e){if(t&1&&(h(0,"span",17),u(1),g()),t&2){let n=m().$implicit;d(),k(n.path)}}function T3(t,e){t&1&&(h(0,"span",19),u(1,"\u2713"),g())}function D3(t,e){if(t&1){let n=$();h(0,"button",15),F("mouseenter",function(){let o=D(n).$index,r=m();return M(r.active.set(o))})("click",function(){let o=D(n).$implicit,r=m();return M(r.pick(o))}),h(1,"span",16),u(2),g(),w(3,S3,2,1,"span",17),h(4,"span",18),u(5),g(),w(6,T3,2,0,"span",19),g()}if(t&2){let n=e.$implicit,i=m();X("all",n.all)("active",n.path===i.rows()[i.active()].path)("selected",n.path===i.selected()),ie("title",n.path||"Every project pi knows about"),J("aria-selected",n.path===i.selected()),d(2),k(n.name),d(),S(n.all?-1:3),d(2),k(n.sessionCount),d(),S(n.path===i.selected()?6:-1)}}var M3="All projects";function k3(t,e,n){let i={path:"",name:M3,sessionCount:n,all:!0},o=e.trim().toLowerCase(),r=t.filter(s=>o.length===0||`${s.name} ${s.path}`.toLowerCase().includes(o)).map(s=>K(V({},s),{all:!1}));return[i,...r]}var Iu=class t{projects=te.required();selected=te("");totalSessions=te(0);select=it();close=it();search=Xe("search");list=Xe("list");query=O("");active=O(0);rows=E(()=>k3(this.projects(),this.query(),this.totalSessions()));constructor(){no(()=>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 i=e.getBoundingClientRect(),o=n.getBoundingClientRect();o.top<i.top?e.scrollTop-=i.top-o.top:o.bottom>i.bottom&&(e.scrollTop+=o.bottom-i.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(i=>Math.min(i+1,Math.max(0,n.length-1)));return;case"ArrowUp":e.preventDefault(),this.active.update(i=>Math.max(0,i-1));return;case"Enter":{let i=n[this.active()];i&&(e.preventDefault(),this.pick(i));return}default:return}}onEscape(){this.close.emit()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-project-filter"]],viewQuery:function(n,i){n&1&>(i.search,C3,5)(i.list,E3,5),n&2&&vt(2)},hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.onEscape()},Mt)},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,i){n&1&&(h(0,"div",2),F("click",function(){return i.close.emit()}),h(1,"div",3),F("click",function(r){return r.stopPropagation()}),h(2,"div",4)(3,"strong",5),u(4,"Filter by project"),g(),h(5,"button",6),F("click",function(){return i.close.emit()}),u(6,"\xD7"),g()(),h(7,"div",7)(8,"span",8),st(),h(9,"svg",9),ce(10,"circle",10)(11,"path",11),g()(),Jt(),h(12,"input",12,0),F("input",function(r){return i.onQuery(r)})("keydown",function(r){return i.onKeydown(r)}),g()(),h(14,"div",13,1),oe(16,D3,7,12,"button",14,w3),g()()()),n&2&&(d(12),ie("value",i.query()),d(4),re(i.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 I3=["search"],UE=(t,e)=>e.path,zE=(t,e)=>e.id;function N3(t,e){if(t&1){let n=$();y(0,"button",15),A("click",function(){D(n);let o=m();return M(o.openFilter())}),y(1,"span",16),u(2,"\u25A4"),b(),y(3,"span",17),u(4),b()()}if(t&2){let n=m();X("filtered",n.selectedProject()!==void 0),q("title",n.selectedProject()?.path??"Every project pi knows about"),J("aria-expanded",n.filterOpen()),d(4),k(n.selectedProject()?.name??"All projects")}}function O3(t,e){if(t&1){let n=$();y(0,"morse-project-filter",18),A("select",function(o){D(n);let r=m();return M(r.onProjectSelect(o))})("close",function(){D(n);let o=m();return M(o.closeFilter())}),b()}if(t&2){let n=m();q("projects",n.projectOptions())("selected",n.projectFilter())("totalSessions",n.totalSessions())}}function P3(t,e){if(t&1){let n=$();y(0,"li")(1,"button",22),A("click",function(){let o=D(n).$implicit,r=m(2);return M(r.activate(o))})("contextmenu",function(o){let r=D(n).$implicit,s=m(2);return M(s.openMenu(o,r))}),ve(2,"span",23),y(3,"span",24)(4,"span",25),u(5),b(),y(6,"span",26),u(7),b()()()()}if(t&2){let n=e.$implicit,i=m(2);d(),X("active",n.id===i.activeSessionId()),q("title",n.id),d(4),k(n.title),d(2),k(i.activityLabel(n))}}function A3(t,e){if(t&1&&(y(0,"section",9)(1,"div",19)(2,"span",20),u(3,"In progress"),b(),y(4,"span",21),u(5),b()(),y(6,"ul"),oe(7,P3,8,5,"li",null,zE),b()()),t&2){let n=m();d(5),k(n.inProgress().length),d(2),re(n.inProgress())}}function R3(t,e){if(t&1&&(y(0,"span",33),u(1,"\u203A"),b()),t&2){let n=m(2).$implicit,i=m();X("open",!i.isCollapsed(n.path))}}function L3(t,e){if(t&1){let n=$();y(0,"div",27)(1,"button",28),A("click",function(){D(n);let o=m().$implicit,r=m();return M(r.toggleGroup(o.path))}),y(2,"span",29),u(3),b(),y(4,"span",30),u(5),b(),w(6,R3,2,2,"span",31),b(),y(7,"button",32),A("click",function(o){D(n);let r=m().$implicit,s=m();return M(s.newSession(o,r.path))}),u(8," + "),b()()}if(t&2){let n=m().$implicit,i=m();d(),q("title",n.path),J("aria-expanded",!i.isCollapsed(n.path)),d(2),k(n.name),d(2),k(n.sessions.length),d(),S(i.projectFilter()!==n.path?6:-1),d(),J("aria-label","New session in "+n.name)}}function F3(t,e){if(t&1&&(y(0,"div",19)(1,"span",20),u(2,"Sessions"),b(),y(3,"span",21),u(4),b()()),t&2){let n=m().$implicit;d(4),k(n.sessions.length)}}function V3(t,e){if(t&1){let n=$();y(0,"li")(1,"button",34),A("click",function(){let o=D(n).$implicit,r=m(3);return M(r.activate(o))})("contextmenu",function(o){let r=D(n).$implicit,s=m(3);return M(s.openMenu(o,r))}),y(2,"span",24)(3,"span",25),u(4),b()(),y(5,"span",35),u(6),b()()()}if(t&2){let n=e.$implicit,i=m(3);d(),X("active",n.id===i.activeSessionId()),q("title",n.id),d(3),k(n.title),d(2),k(i.age(n.updatedAt))}}function j3(t,e){if(t&1&&u(0),t&2){let n=m(5);ae(" No session matches \u201C",n.query(),"\u201D. ")}}function $3(t,e){t&1&&u(0," No sessions yet. ")}function B3(t,e){if(t&1&&(y(0,"li",36),w(1,j3,1,1)(2,$3,1,0),b()),t&2){let n=m(4);d(),S(n.query().length>0?1:2)}}function H3(t,e){if(t&1&&w(0,B3,3,1,"li",36),t&2){let n=m(2).$implicit;S(n.hiddenRunning===0?0:-1)}}function U3(t,e){if(t&1&&(y(0,"ul"),oe(1,V3,7,5,"li",null,zE,!1,H3,1,1),b()),t&2){let n=m().$implicit;d(),re(n.sessions)}}function z3(t,e){if(t&1&&(y(0,"section",9),w(1,L3,9,6,"div",27)(2,F3,5,1,"div",19),w(3,U3,4,1,"ul"),b()),t&2){let n=e.$implicit,i=m();d(),S(i.scope()==="global"?1:n.sessions.length>0?2:-1),d(2),S(i.scope()==="workspace"||!i.isCollapsed(n.path)?3:-1)}}function G3(t,e){t&1&&u(0," Looking for a project? ")}function q3(t,e){if(t&1&&(u(0),w(1,G3,1,0)),t&2){let n=m(2);ae(" No session matches \u201C",n.query(),"\u201D. "),d(),S(n.projectMatches().length>0?1:-1)}}function W3(t,e){t&1&&u(0," Nothing found. ")}function Y3(t,e){if(t&1){let n=$();y(0,"button",38),A("click",function(){let o=D(n).$implicit,r=m(2);return M(r.filterToProject(o))}),u(1),b()}if(t&2){let n=e.$implicit;d(),wo(" Show all ",n.sessionCount," sessions in ",n.name," ")}}function K3(t,e){if(t&1&&(y(0,"p",36),w(1,q3,2,2)(2,W3,1,0),b(),oe(3,Y3,2,2,"button",37,UE)),t&2){let n=m();d(),S(n.query().length>0?1:2),d(2),re(n.projectMatches())}}function Z3(t,e){t&1&&ve(0,"morse-file-explorer")}function Q3(t,e){if(t&1&&(y(0,"a",11)(1,"span",39),u(2,"\u2191"),b(),y(3,"span"),u(4,"Update available"),b(),y(5,"span",13),u(6),b()()),t&2){let n=e;q("href",n.url,xi)("title",n.hint+" You are on v"+n.current+"."),d(6),ae("v",n.latest)}}function X3(t,e){t&1&&(y(0,"span",13),u(1),b()),t&2&&(d(),ae("v",e))}function J3(t,e){if(t&1){let n=$();y(0,"p",42),u(1,"Delete this session?"),b(),y(2,"p",43),u(3),b(),y(4,"button",44),A("click",function(){D(n);let o=m(2);return M(o.closeMenu())}),u(5,"Cancel"),b(),y(6,"button",45),A("click",function(){D(n);let o=m(),r=m();return M(r.deleteNow(o.session))}),u(7," Delete "),b()}if(t&2){let n=m();d(3),k(n.session.title)}}function eV(t,e){if(t&1){let n=$();y(0,"button",44),A("click",function(){D(n);let o=m(),r=m();return M(r.closeNow(o.session))}),u(1," Close session "),b(),y(2,"button",45),A("click",function(){D(n);let o=m(),r=m();return M(r.askDelete(o))}),u(3," Delete session\u2026 "),b()}}function tV(t,e){if(t&1){let n=$();y(0,"div",40),A("click",function(){D(n);let o=m();return M(o.closeMenu())})("contextmenu",function(o){D(n);let r=m();return o.preventDefault(),M(r.closeMenu())}),b(),y(1,"div",41),w(2,J3,8,1)(3,eV,4,0),b()}if(t&2){let n=e;d(),At("left",n.x,"px")("top",n.y,"px"),d(),S(n.confirming?2:3)}}var Nu=class t{morse=N(Ze);shell=N(Ht);shortcuts=N(An);update=N(Fs);tabs=N(dn);destroyRef=N(pt);searchInput=Xe("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:nV(n)});inProgress=E(()=>{let e=this.projectFilter();return this.morse.sessions().filter(n=>(e.length===0||n.cwd===e)&&this.isRunning(n)).sort((n,i)=>i.updatedAt-n.updatedAt)});groups=E(()=>{let e=this.morse.sessions();if(this.scope()==="workspace"){let n=this.morse.workspace(),i=this.morse.projects()[0];return[{path:i?.path??n.cwd,name:n.name||i?.name||"workspace",sessions:e,hiddenRunning:0}]}return this.morse.projects().map(n=>({path:n.path,name:n.name,sessions:e.filter(i=>i.cwd===n.path),hiddenRunning:0}))});visibleGroups=E(()=>{let e=this.query().trim().toLowerCase(),n=this.projectFilter(),i=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=>!i.has(c.id));return K(V({},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=>K(V({},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(K(V({},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(K(V({},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 i=Math.round(n/60);if(i<60)return`${i}m`;let o=Math.round(i/60);return o<24?`${o}h`:`${Math.round(o/24)}d`}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-session-nav"]],viewQuery:function(n,i){n&1&>(i.searchInput,I3,5),n&2&&vt()},hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.onEscape()},Mt)},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,i){if(n&1&&(y(0,"div",1)(1,"button",2),A("click",function(r){return i.newSession(r)}),u(2," New session "),b(),y(3,"button",3),A("click",function(){return i.refresh()}),u(4,"\u27F3"),b()(),y(5,"div",4),w(6,N3,5,5,"button",5),y(7,"input",6,0),A("input",function(r){return i.onQuery(r)}),b()(),w(9,O3,1,3,"morse-project-filter",7),y(10,"div",8),w(11,A3,9,1,"section",9),oe(12,z3,4,2,"section",9,UE,!1,K3,5,1),b(),w(15,Z3,1,0,"morse-file-explorer"),y(16,"div",10),w(17,Q3,7,3,"a",11),y(18,"button",12),A("click",function(){return i.openShortcuts()}),u(19," Keyboard shortcuts "),y(20,"span",13),u(21,"?"),b()(),y(22,"button",14),A("click",function(){return i.openAbout()}),u(23," About Morse "),w(24,X3,2,1,"span",13),b()(),w(25,tV,4,5)),n&2){let o,r,s;d(6),S(i.filterable()?6:-1),d(),q("value",i.query()),d(2),S(i.filterOpen()?9:-1),d(2),S(i.inProgress().length>0?11:-1),d(),re(i.visibleGroups()),d(3),S(i.filePreview()?15:-1),d(2),S((o=i.updateNotice())?17:-1,o),d(7),S((r=i.version())?24:-1,r),d(),S((s=i.menu())?25:-1,s)}},dependencies:[Iu,ku],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 nV(t){if(t.kind==="tool"){let e=uo(t.name),n=fE(t),i=Rs(t);return e==="shell"?`${n} ${HE(i.replace(/\s+/g," ").trim(),40)}`:e==="search"?`${n} ${HE(i,40)}`:`${n} ${gu(i)}`}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 HE(t,e){return t.length>e?`${t.slice(0,e)}\u2026`:t}var GE=(t,e)=>e.path;function iV(t,e){if(t&1){let n=$();h(0,"button",20),F("click",function(){let o=D(n).$implicit,r=m(2);return M(r.go(o.path))}),u(1),g()}if(t&2){let n=e.$implicit;ie("title",n.path),d(),ae(" ",n.name," ")}}function oV(t,e){if(t&1&&(h(0,"div",9),oe(1,iV,2,2,"button",19,GE),g()),t&2){let n=m();d(),re(n.roots())}}function rV(t,e){t&1&&(h(0,"p",11),u(1,"Reading folder\u2026"),g())}function sV(t,e){t&1&&(h(0,"p",12),u(1),g()),t&2&&(d(),k(e))}function aV(t,e){if(t&1){let n=$();h(0,"button",22),F("click",function(){let o=D(n),r=m(2);return M(r.go(o))}),h(1,"span",23),u(2,"\u21B0"),g(),h(3,"span",24),u(4,".."),g()()}t&2&&ie("title",e)}function cV(t,e){if(t&1){let n=$();h(0,"button",22),F("click",function(){let o=D(n).$implicit,r=m(2);return M(r.go(o.path))}),h(1,"span",23),u(2,"\u25B8"),g(),h(3,"span",24),u(4),g()()}if(t&2){let n=e.$implicit;ie("title",n.path),d(4),k(n.name)}}function lV(t,e){t&1&&(h(0,"p",11),u(1,"No subfolders here."),g())}function dV(t,e){if(t&1&&w(0,lV,2,0,"p",11),t&2){let n=m(2);S(n.parent()===void 0&&n.directories().length===0?0:-1)}}function uV(t,e){if(t&1&&(w(0,aV,5,1,"button",21),oe(1,cV,5,2,"button",21,GE,!1,dV,1,1)),t&2){let n,i=m();S((n=i.parent())?0:-1,n),d(),re(i.directories())}}function pV(t,e){t&1&&(h(0,"em"),u(1," \xB7 not in MORSE_PROJECTS"),g())}function fV(t,e){t&1&&(h(0,"em",15),u(1," \xB7 git"),g())}var Ou=class t{morse=N(Ze);shell=N(Ht);tabs=N(dn);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 i=n;if(!i||typeof i.path!="string"){this.error.set("That folder could not be read.");return}this.path.set(i.path),this.draftPath.set(i.path),this.parent.set(i.parent),this.directories.set(i.directories??[]),this.roots.set(i.roots??[]),this.isGitRepo.set(i.isGitRepo===!0),this.canOpen.set(i.canOpen===!0)})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-project-picker"]],hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.onEscape()},Mt)},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,i){if(n&1&&(h(0,"div",0),F("click",function(){return i.close()}),h(1,"div",1),F("click",function(r){return r.stopPropagation()}),h(2,"header",2)(3,"strong"),u(4,"New session"),g(),h(5,"button",3),F("click",function(){return i.close()}),u(6," \xD7 "),g()(),h(7,"p",4),u(8," Choose the project folder the agent should run in. It starts only after your first prompt. "),g(),h(9,"div",5)(10,"button",6),F("click",function(){return i.go(i.parent())}),u(11," \u2191 "),g(),h(12,"input",7),F("input",function(r){return i.onPathInput(r)})("keydown.enter",function(){return i.go(i.draftPath())}),g(),h(13,"button",8),F("click",function(){return i.go(i.draftPath())}),u(14," Go "),g()(),w(15,oV,3,0,"div",9),h(16,"div",10),w(17,rV,2,0,"p",11)(18,sV,2,1,"p",12)(19,uV,4,2),g(),h(20,"footer",13)(21,"span",14),u(22),w(23,pV,2,0,"em"),w(24,fV,2,0,"em",15),g(),h(25,"div",16)(26,"button",17),F("click",function(){return i.close()}),u(27,"Cancel"),g(),h(28,"button",18),F("click",function(){return i.confirm()}),u(29," New session here "),g()()()()()),n&2){let o;d(10),ie("disabled",i.parent()===void 0),d(2),ie("value",i.draftPath()),d(),ie("disabled",i.draftPath().trim().length===0),d(2),S(i.roots().length>0?15:-1),d(2),S(i.loading()?17:(o=i.error())?18:19,o),d(4),ie("title",i.path()),d(),ae(" ",i.path()," "),d(),S(i.canOpen()?-1:23),d(),S(i.isGitRepo()?24:-1),d(4),ie("disabled",!i.canOpen()||i.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 qE=[{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 mV=(t,e)=>e.title,hV=(t,e)=>e.name;function gV(t,e){if(t&1&&(h(0,"div")(1,"dt"),u(2,"update"),g(),h(3,"dd")(4,"a",14),u(5),g()()()),t&2){let n=e;d(4),ie("href",n.url,xi)("title",n.hint),d(),ae(" v",n.latest," available ")}}function yV(t,e){t&1&&(h(0,"p",15),u(1),g()),t&2&&(d(),k(e))}function _V(t,e){t&1&&(h(0,"span",17),u(1),g()),t&2&&(d(),ae("by ",e))}function vV(t,e){if(t&1&&(h(0,"li")(1,"a",16),u(2),w(3,_V,2,1,"span",17),g(),h(4,"span",18),u(5),g(),h(6,"p",19),u(7),g()()),t&2){let n,i=e.$implicit;d(),ie("href",i.url,xi),d(),ae(" ",i.name," "),d(),S((n=i.by)?3:-1,n),d(2),k(i.license),d(2),k(i.role)}}function bV(t,e){if(t&1&&(h(0,"section",9)(1,"h3"),u(2),g(),w(3,yV,2,1,"p",15),h(4,"ul"),oe(5,vV,8,5,"li",null,hV),g()()),t&2){let n,i=e.$implicit;d(2),k(i.title),d(),S((n=i.blurb)?3:-1,n),d(2),re(i.entries)}}var Pu=class t{morse=N(Ze);shell=N(Ht);update=N(Fs);groups=qE;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=ue({type:t,selectors:[["morse-about-dialog"]],hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.onEscape()},Mt)},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,i){if(n&1&&(h(0,"div",0),F("click",function(){return i.close()}),h(1,"div",1),F("click",function(r){return r.stopPropagation()}),h(2,"div",2)(3,"strong",3),u(4,"About Morse"),g(),h(5,"span",4),u(6,"a comfortable Pi interface \xB7 MIT"),g(),h(7,"button",5),F("click",function(){return i.close()}),u(8,"\xD7"),g()(),h(9,"p",6),u(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 "),h(11,"code"),u(12,"pi --mode rpc"),g(),u(13," \u2014 and never talks to a model provider itself. Below is what it stands on, and the licence each piece asks for. "),g(),h(14,"dl",7)(15,"div")(16,"dt"),u(17,"frontend"),g(),h(18,"dd"),u(19),g()(),h(20,"div")(21,"dt"),u(22,"protocol"),g(),h(23,"dd"),u(24),g()(),h(25,"div")(26,"dt"),u(27,"host"),g(),h(28,"dd"),u(29),g()(),w(30,gV,6,3,"div"),g(),h(31,"div",8),oe(32,bV,7,2,"section",9,mV),g(),h(34,"div",10)(35,"span"),u(36,"Licence texts ship with this build. Morse is MIT \xB7 \xA9 2026 Supan Adit Pratama."),g(),ce(37,"span",11),h(38,"a",12),u(39," Source "),g(),h(40,"button",13),F("click",function(){return i.close()}),u(41,"Close"),g()()()()),n&2){let o;d(19),k(i.frontend()),d(5),k(i.protocolVersion()),d(5),k(i.host()),d(),S((o=i.updateNotice())?30:-1,o),d(2),re(i.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 xV=(t,e)=>e.name,CV=(t,e)=>e.id;function EV(t,e){t&1&&(h(0,"span",15),u(1,"not in this host"),g())}function wV(t,e){if(t&1&&(h(0,"li")(1,"div",13)(2,"span",14),u(3),w(4,EV,2,0,"span",15),g(),h(5,"span",16),u(6),g()(),h(7,"kbd"),u(8),g()()),t&2){let n=e.$implicit;X("unavailable",n.available===!1),d(3),ae(" ",n.label," "),d(),S(n.available===!1?4:-1),d(2),k(n.detail),d(2),k(n.keys)}}function SV(t,e){if(t&1&&(h(0,"section",8)(1,"h3"),u(2),g(),h(3,"ul"),oe(4,wV,9,6,"li",12,CV),g()()),t&2){let n=e.$implicit;d(2),k(n.name),d(2),re(n.rows)}}var Au=class t{shell=N(Ht);shortcuts=N(An);groups=E(()=>{let e=this.shortcuts.available(),n=new Map;for(let i of Ja){let o=n.get(i.group)??[];o.push({id:i.id,label:i.label,detail:i.detail,keys:ec(i)?hx(i.binding):i.keys,available:ec(i)?e.get(i.id)===!0:void 0}),n.set(i.group,o)}return[...n].map(([i,o])=>({name:i,rows:o}))});close(){this.shell.closeShortcuts()}onEscape(){this.close()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ue({type:t,selectors:[["morse-shortcuts-dialog"]],hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.onEscape()},Mt)},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,i){n&1&&(h(0,"div",0),F("click",function(){return i.close()}),h(1,"div",1),F("click",function(r){return r.stopPropagation()}),h(2,"div",2)(3,"strong",3),u(4,"Keyboard shortcuts"),g(),h(5,"span",4),u(6,"the same keys in the browser and in the VS Code panel"),g(),h(7,"button",5),F("click",function(){return i.close()}),u(8,"\xD7"),g()(),h(9,"p",6),u(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. "),g(),h(11,"div",7),oe(12,SV,6,1,"section",8,xV),g(),h(14,"div",9)(15,"span"),u(16,"Esc closes this list, and the panel in front of it."),g(),ce(17,"span",10),h(18,"button",11),F("click",function(){return i.close()}),u(19,"Close"),g()()()()),n&2&&(d(12),re(i.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 TV=["cancel"];function DV(t,e){t&1&&(h(0,"p",4),u(1),g()),t&2&&(d(),k(e))}function MV(t,e){t&1&&(h(0,"p",5),u(1),g()),t&2&&(d(),k(e))}var Ru=class t{title=te.required();body=te("");note=te("");confirmLabel=te("Confirm");cancelLabel=te("Cancel");confirmed=it();cancelled=it();cancelButton=Xe("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=ue({type:t,selectors:[["morse-confirm-dialog"]],viewQuery:function(n,i){n&1&>(i.cancelButton,TV,5),n&2&&vt()},hostBindings:function(n,i){n&1&&A("keydown.escape",function(){return i.onEscape()},Mt)},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,i){if(n&1&&(h(0,"div",1),F("click",function(){return i.cancelled.emit()}),h(1,"div",2),F("click",function(r){return r.stopPropagation()}),h(2,"h2",3),u(3),g(),w(4,DV,2,1,"p",4),w(5,MV,2,1,"p",5),h(6,"div",6)(7,"button",7,0),F("click",function(){return i.cancelled.emit()}),u(9),g(),h(10,"button",8),F("click",function(){return i.confirmed.emit()}),u(11),g()()()()),n&2){let o,r;d(),J("aria-describedby",i.body().length>0?"confirm-body":null),d(2),k(i.title()),d(),S((o=i.body())?4:-1,o),d(),S((r=i.note())?5:-1,r),d(4),ae(" ",i.cancelLabel()," "),d(2),k(i.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 kV(t,e){t&1&&u(0," Install it once and this panel is ready. ")}function IV(t,e){if(t&1){let n=$();h(0,"div",5)(1,"code"),u(2),g(),h(3,"button",10),F("click",function(){D(n);let o=m();return M(o.copyInstall())}),u(4),g()()}if(t&2){let n=m();d(2),k(e),d(2),ae(" ",n.copied()?"Copied":"Copy"," ")}}function NV(t,e){t&1&&(h(0,"p",6),u(1),g()),t&2&&(d(),k(e))}function OV(t,e){if(t&1){let n=$();h(0,"button",10),F("click",function(){D(n);let o=m();return M(o.openSettings())}),u(1,"Open settings"),g(),h(2,"button",10),F("click",function(){D(n);let o=m();return M(o.showLog())}),u(3,"Show log"),g()}}function PV(t,e){t&1&&(h(0,"p",9),u(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. "),g())}function AV(t,e){t&1&&(h(0,"p",9),u(1," The host reads "),h(2,"code"),u(3,"MORSE_PI_PATH"),g(),u(4," at startup, so restart it after changing that (or install pi) \u2014 "),h(5,"code"),u(6,"morse restart"),g(),u(7," for the daemon. "),g())}function RV(t,e){t&1&&(h(0,"details")(1,"summary"),u(2,"What the host reported"),g(),h(3,"pre"),u(4),g()()),t&2&&(d(4),k(e))}var Lu=class t{morse=N(Ze);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=ue({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,i){if(n&1&&(h(0,"section",0)(1,"p",1),ce(2,"span",2),u(3),g(),h(4,"h1",3),u(5),g(),h(6,"p",4),u(7," Morse is only the interface \u2014 every answer comes from the pi CLI on this machine, with your own models, tools and sessions. "),w(8,kV,1,0),g(),w(9,IV,5,2,"div",5),w(10,NV,2,1,"p",6),h(11,"div",7)(12,"button",8),F("click",function(){return i.retry()}),u(13,"Retry"),g(),w(14,OV,4,0),g(),w(15,PV,2,0,"p",9)(16,AV,8,0,"p",9),w(17,RV,5,1,"details"),g()),n&2){let o,r,s;d(3),ae(" ",i.missing()?"Setup":"Agent unavailable"," "),d(2),ae(" ",i.missing()?"The pi coding agent is not installed":"The pi coding agent could not start"," "),d(3),S(i.missing()?8:-1),d(),S((o=i.install())?9:-1,o),d(),S((r=i.hint())?10:-1,r),d(4),S(i.hasEditor()?14:-1),d(),S(i.hasEditor()?15:16),d(2),S((s=i.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 LV(t,e){if(t&1){let n=$();y(0,"morse-boot-splash",11),A("dismissed",function(){D(n);let o=m();return M(o.onBootDismissed())}),b()}if(t&2){let n=m();q("ready",n.bootReady())("status",n.bootStatus())}}function FV(t,e){if(t&1){let n=$();y(0,"morse-connection-screen",12),A("retry",function(){D(n);let o=m();return M(o.retryConnection())})("explore",function(){D(n);let o=m();return M(o.onConnectionExplore())})("connect",function(o){D(n);let r=m();return M(r.onConnectionConnect(o))}),b()}if(t&2){let n=e;q("eyebrow",n.eyebrow)("title",n.title)("body",n.body)("detail",n.detail)}}function VV(t,e){t&1&&ve(0,"morse-project-picker")}function jV(t,e){t&1&&ve(0,"morse-about-dialog")}function $V(t,e){t&1&&ve(0,"morse-shortcuts-dialog")}function BV(t,e){if(t&1){let n=$();y(0,"morse-confirm-dialog",13),A("confirmed",function(){D(n);let o=m();return M(o.confirmCompact())})("cancelled",function(){D(n);let o=m();return M(o.cancelCompact())}),b()}if(t&2){let n=m();q("body",n.compactBody())}}function HV(t,e){if(t&1){let n=$();y(0,"button",14),A("click",function(){D(n);let o=m();return M(o.closeNavigation())}),b()}}function UV(t,e){t&1&&(y(0,"div",7),ve(1,"span",15),y(2,"div",16)(3,"span",17),u(4,"\u2913"),b(),y(5,"strong"),u(6,"Drop to attach"),b(),y(7,"span"),u(8,"Images ride with the prompt \xB7 other files become "),y(9,"code"),u(10,"@mentions"),b()()()()),t&2&&(d(2),q("morseEnter",0)("morseEnterY",-6))}function zV(t,e){t&1&&ve(0,"morse-tab-strip")}function GV(t,e){t&1&&ve(0,"morse-file-preview",8),t&2&&q("tab",e)}function qV(t,e){if(t&1){let n=$();y(0,"section",18)(1,"strong"),u(2,"Offline \u2014 the host wouldn't take this frontend"),b(),y(3,"p"),u(4),ve(5,"br"),u(6),b(),y(7,"div",20)(8,"button",21),A("click",function(){D(n);let o=m(2);return M(o.reload())}),u(9,"Reload"),b(),y(10,"button",22),A("click",function(){D(n);let o=m(2);return M(o.retryConnection())}),u(11,"Retry"),b(),y(12,"button",22),A("click",function(){D(n);let o=m(2);return M(o.showLog())}),u(13,"Show log"),b()()()}if(t&2){let n=e;d(4),k(n.message),d(2),k(n.detail)}}function WV(t,e){if(t&1){let n=$();y(0,"section",18)(1,"strong"),u(2,"Offline \u2014 reconnecting"),b(),y(3,"p"),u(4," Morse keeps retrying in the background; the rest of the interface stays available while it does. "),b(),y(5,"div",20)(6,"button",21),A("click",function(){D(n);let o=m(2);return M(o.retryConnection())}),u(7,"Retry now"),b(),y(8,"button",22),A("click",function(){D(n);let o=m(2);return M(o.showConnectionHelp())}),u(9," Connection help "),b()()()}}function YV(t,e){if(t&1){let n=$();y(0,"section",19)(1,"strong"),u(2,"Pi agent unavailable"),b(),y(3,"p"),u(4),b(),y(5,"div",20)(6,"button",21),A("click",function(){D(n);let o=m(2);return M(o.retryAgent())}),u(7,"Retry"),b(),y(8,"button",22),A("click",function(){D(n);let o=m(2);return M(o.openSettings())}),u(9,"Open settings"),b(),y(10,"button",22),A("click",function(){D(n);let o=m(2);return M(o.showLog())}),u(11,"Show log"),b()()()}if(t&2){let n=m(2);d(4),k(n.agentError()||"Morse could not start the pi coding agent.")}}function KV(t,e){t&1&&ve(0,"morse-agent-screen")}function ZV(t,e){t&1&&ve(0,"morse-chat-transcript")(1,"morse-interaction-panel")(2,"morse-chat-composer")}function QV(t,e){if(t&1&&(w(0,qV,14,2,"section",18)(1,WV,10,0,"section",18)(2,YV,12,1,"section",19),w(3,KV,1,0,"morse-agent-screen")(4,ZV,3,0)),t&2){let n,i=m();S((n=i.lastError())?0:i.offline()?1:i.agentBanner()?2:-1,n),d(3),S(i.agentScreen()?3:4)}}function XV(t,e){if(t&1){let n=$();y(0,"div",23)(1,"span",24),u(2),b(),y(3,"button",25),A("click",function(){D(n);let o=m();return M(o.dismissToast())}),u(4," \xD7 "),b()()}if(t&2){let n=e;Tn(n.level),d(2),k(n.text)}}function JV(t,e){if(t&1&&ve(0,"morse-git-panel",10),t&2){let n=m();q("expanded",n.gitExpanded())}}function ej(){return typeof location>"u"?!1:new URL(location.href,"http://localhost/").searchParams.get("boot")==="1"}var Fu=class t{morse=N(Ze);shell=N(Ht);tabs=N(dn);shortcuts=N(An);dropZone=N(Mu);animation=N(ln);attachments=N(Ui);destroyRef=N(pt);dismissedNoticeAt=O(null);noticeTimer;bootPreview=ej();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);gitEnabled=E(()=>this.morse.capabilities()?.gitPanel===!0);gitOpen=E(()=>this.gitEnabled()&&this.shell.gitPanelOpen());gitExpanded=E(()=>this.gitOpen()&&this.shell.gitPanelExpanded());gitWidth=E(()=>{let e=this.shell.gitPanelWidth();return e===void 0?null:`${e}px`});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(),i=n&&(!e||n.at>=e.at)?n:e;return!i||i.at===this.dismissedNoticeAt()?null:i});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(),i=n.sessionId;if(i===void 0){this.focusedSession=void 0,this.tabs.clearActiveSession();return}let o={id:i,title:this.sessionTitle(i,n.sessionTitle),cwd:n.workspace.cwd};if(i===this.focusedSession){this.tabs.refreshSession(o);return}this.focusedSession=i,this.tabs.showSession(o)})}onBootDismissed(){this.bootVisible.set(!1),this.clearBootTimer()}sessionTitle(e,n){return n!==void 0&&n.length>0?n:this.morse.sessions().find(o=>o.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 i=n.querySelector(".dropzone-card"),o=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(i,{scale:[1,1.03]},{duration:700}),this.animation.loop(o,{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=ue({type:t,selectors:[["app-root"]],decls:17,vars:24,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"],[1,"git-panel",3,"expanded"],[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,i){if(n&1&&(y(0,"div",0),w(1,LV,1,2,"morse-boot-splash",1),w(2,FV,1,4,"morse-connection-screen",2),ve(3,"morse-session-nav",3),w(4,VV,1,0,"morse-project-picker"),w(5,jV,1,0,"morse-about-dialog"),w(6,$V,1,0,"morse-shortcuts-dialog"),w(7,BV,1,1,"morse-confirm-dialog",4),w(8,HV,1,0,"button",5),y(9,"main",6),A("dragenter",function(r){return i.onDragEnter(r)})("dragover",function(r){return i.onDragOver(r)})("dragleave",function(){return i.onDragLeave()})("drop",function(r){return i.onDrop(r)}),w(10,UV,11,2,"div",7),ve(11,"morse-chat-header"),w(12,zV,1,0,"morse-tab-strip"),w(13,GV,1,1,"morse-file-preview",8)(14,QV,5,2),w(15,XV,5,3,"div",9),b(),w(16,JV,1,1,"morse-git-panel",10),b()),n&2){let o,r,s;At("--%NS%morse-git-width",i.gitWidth()),X("collapsed",i.navigationCollapsed())("with-git",i.gitOpen())("git-expanded",i.gitExpanded()),d(),S(i.bootVisible()?1:-1),d(),S((o=i.connectionScreen())?2:-1,o),d(),X("open",i.navigationOpen()),d(),S(i.projectPickerOpen()?4:-1),d(),S(i.aboutOpen()?5:-1),d(),S(i.shortcutsOpen()?6:-1),d(),S(i.compactConfirmOpen()?7:-1),d(),S(i.navigationOpen()?8:-1),d(),X("dropping",i.dragging()),d(),S(i.dragging()?10:-1),d(2),S(i.tabsEnabled()?12:-1),d(),S((r=i.activeFile())?13:14,r),d(2),S((s=i.toast())?15:-1,s),d(),S(i.gitOpen()?16:-1)}},dependencies:[Nu,Ou,Pu,Au,Lu,Ru,su,bu,Cu,ru,wu,xu,Tu,un,Ld,Fd],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);grid-template-rows:minmax(0,1fr);height:100%;min-height:0;overflow:hidden;background:var(--%NS%morse-bg)}.nav[_ngcontent-%COMP%]{min-width:0}.shell.with-git[_ngcontent-%COMP%]{grid-template-columns:var(--%NS%morse-nav-width) minmax(0,1fr) var(--%NS%morse-git-width)}.git-panel[_ngcontent-%COMP%]{min-width:0}.shell.git-expanded[_ngcontent-%COMP%]{grid-template-columns:var(--%NS%morse-nav-width) minmax(0,1fr)}.shell.git-expanded[_ngcontent-%COMP%] .chat[_ngcontent-%COMP%]{display:none}@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.with-git[_ngcontent-%COMP%]{grid-template-columns:0 minmax(0,1fr) var(--%NS%morse-git-width)}.shell.collapsed.git-expanded[_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%], .shell.with-git[_ngcontent-%COMP%], .shell.git-expanded[_ngcontent-%COMP%]{grid-template-columns:minmax(0,1fr)}.shell.git-expanded[_ngcontent-%COMP%] .git-panel[_ngcontent-%COMP%]{position:static;width:auto;box-shadow:none}.shell[_ngcontent-%COMP%] > .git-panel[_ngcontent-%COMP%]{position:absolute;z-index:20;top:0;bottom:0;right:0;width:min(86%,340px);box-shadow:0 0 24px #00000059}.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}}"]})};Zm(Fu,Pv).catch(t=>console.error(t));
|