agent-issues 0.0.119 → 0.0.121

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,4396 +0,0 @@
1
- (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const o of n.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerPolicy&&(n.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?n.credentials="include":i.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function s(i){if(i.ep)return;i.ep=!0;const n=t(i);fetch(i.href,n)}})();var po=Object.defineProperty,uo=(r,e,t)=>e in r?po(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Is=(r,e,t)=>(uo(r,typeof e!="symbol"?e+"":e,t),t),ho=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)},Ts=(r,e)=>{if(Object(e)!==e)throw TypeError('Cannot use the "in" operator on this value');return r.has(e)},Nt=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},lr=(r,e,t)=>(ho(r,e,"access private method"),t);function an(r,e){return Object.is(r,e)}let K=null,mt=!1,jt=1;const Ut=Symbol("SIGNAL");function Ze(r){const e=K;return K=r,e}function fo(){return K}function go(){return mt}const ci={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function es(r){if(mt)throw new Error(typeof ngDevMode<"u"&&ngDevMode?"Assertion error: signal read during notification phase":"");if(K===null)return;K.consumerOnSignalRead(r);const e=K.nextProducerIndex++;if(et(K),e<K.producerNode.length&&K.producerNode[e]!==r&&Gs(K)){const t=K.producerNode[e];ts(t,K.producerIndexOfThis[e])}K.producerNode[e]!==r&&(K.producerNode[e]=r,K.producerIndexOfThis[e]=Gs(K)?dn(r,K,e):0),K.producerLastReadVersion[e]=r.version}function mo(){jt++}function ln(r){if(!(!r.dirty&&r.lastCleanEpoch===jt)){if(!r.producerMustRecompute(r)&&!wo(r)){r.dirty=!1,r.lastCleanEpoch=jt;return}r.producerRecomputeValue(r),r.dirty=!1,r.lastCleanEpoch=jt}}function cn(r){if(r.liveConsumerNode===void 0)return;const e=mt;mt=!0;try{for(const t of r.liveConsumerNode)t.dirty||xo(t)}finally{mt=e}}function bo(){return K?.consumerAllowSignalWrites!==!1}function xo(r){var e;r.dirty=!0,cn(r),(e=r.consumerMarkedDirty)==null||e.call(r.wrapper??r)}function vo(r){return r&&(r.nextProducerIndex=0),Ze(r)}function yo(r,e){if(Ze(e),!(!r||r.producerNode===void 0||r.producerIndexOfThis===void 0||r.producerLastReadVersion===void 0)){if(Gs(r))for(let t=r.nextProducerIndex;t<r.producerNode.length;t++)ts(r.producerNode[t],r.producerIndexOfThis[t]);for(;r.producerNode.length>r.nextProducerIndex;)r.producerNode.pop(),r.producerLastReadVersion.pop(),r.producerIndexOfThis.pop()}}function wo(r){et(r);for(let e=0;e<r.producerNode.length;e++){const t=r.producerNode[e],s=r.producerLastReadVersion[e];if(s!==t.version||(ln(t),s!==t.version))return!0}return!1}function dn(r,e,t){var s;if(di(r),et(r),r.liveConsumerNode.length===0){(s=r.watched)==null||s.call(r.wrapper);for(let i=0;i<r.producerNode.length;i++)r.producerIndexOfThis[i]=dn(r.producerNode[i],r,i)}return r.liveConsumerIndexOfThis.push(t),r.liveConsumerNode.push(e)-1}function ts(r,e){var t;if(di(r),et(r),typeof ngDevMode<"u"&&ngDevMode&&e>=r.liveConsumerNode.length)throw new Error(`Assertion error: active consumer index ${e} is out of bounds of ${r.liveConsumerNode.length} consumers)`);if(r.liveConsumerNode.length===1){(t=r.unwatched)==null||t.call(r.wrapper);for(let i=0;i<r.producerNode.length;i++)ts(r.producerNode[i],r.producerIndexOfThis[i])}const s=r.liveConsumerNode.length-1;if(r.liveConsumerNode[e]=r.liveConsumerNode[s],r.liveConsumerIndexOfThis[e]=r.liveConsumerIndexOfThis[s],r.liveConsumerNode.length--,r.liveConsumerIndexOfThis.length--,e<r.liveConsumerNode.length){const i=r.liveConsumerIndexOfThis[e],n=r.liveConsumerNode[e];et(n),n.producerIndexOfThis[i]=e}}function Gs(r){var e;return r.consumerIsAlwaysLive||(((e=r?.liveConsumerNode)==null?void 0:e.length)??0)>0}function et(r){r.producerNode??(r.producerNode=[]),r.producerIndexOfThis??(r.producerIndexOfThis=[]),r.producerLastReadVersion??(r.producerLastReadVersion=[])}function di(r){r.liveConsumerNode??(r.liveConsumerNode=[]),r.liveConsumerIndexOfThis??(r.liveConsumerIndexOfThis=[])}function pn(r){if(ln(r),es(r),r.value===qs)throw r.error;return r.value}function ko(r){const e=Object.create(So);e.computation=r;const t=()=>pn(e);return t[Ut]=e,t}const Rs=Symbol("UNSET"),Es=Symbol("COMPUTING"),qs=Symbol("ERRORED"),So={...ci,value:Rs,dirty:!0,error:null,equal:an,producerMustRecompute(r){return r.value===Rs||r.value===Es},producerRecomputeValue(r){if(r.value===Es)throw new Error("Detected cycle in computations.");const e=r.value;r.value=Es;const t=vo(r);let s,i=!1;try{s=r.computation.call(r.wrapper),i=e!==Rs&&e!==qs&&r.equal.call(r.wrapper,e,s)}catch(n){s=qs,r.error=n}finally{yo(r,t)}if(i){r.value=e;return}r.value=s,r.version++}};function $o(){throw new Error}let Io=$o;function To(){Io()}function Ro(r){const e=Object.create(_o);e.value=r;const t=()=>(es(e),e.value);return t[Ut]=e,t}function Eo(){return es(this),this.value}function Co(r,e){bo()||To(),r.equal.call(r.wrapper,r.value,e)||(r.value=e,Ao(r))}const _o={...ci,equal:an,value:void 0};function Ao(r){r.version++,mo(),cn(r)}const X=Symbol("node");var ee;(r=>{var e,t,s,i;class n{constructor(l,u={}){Nt(this,t),Is(this,e);const p=Ro(l)[Ut];if(this[X]=p,p.wrapper=this,u){const g=u.equals;g&&(p.equal=g),p.watched=u[r.subtle.watched],p.unwatched=u[r.subtle.unwatched]}}get(){if(!(0,r.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.get");return Eo.call(this[X])}set(l){if(!(0,r.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.set");if(go())throw new Error("Writes to signals not permitted during Watcher callback");const u=this[X];Co(u,l)}}e=X,t=new WeakSet,r.isState=a=>typeof a=="object"&&Ts(t,a),r.State=n;class o{constructor(l,u){Nt(this,i),Is(this,s);const p=ko(l)[Ut];if(p.consumerAllowSignalWrites=!0,this[X]=p,p.wrapper=this,u){const g=u.equals;g&&(p.equal=g),p.watched=u[r.subtle.watched],p.unwatched=u[r.subtle.unwatched]}}get(){if(!(0,r.isComputed)(this))throw new TypeError("Wrong receiver type for Signal.Computed.prototype.get");return pn(this[X])}}s=X,i=new WeakSet,r.isComputed=a=>typeof a=="object"&&Ts(i,a),r.Computed=o,(a=>{var l,u,d,p;function g(R){let C,E=null;try{E=Ze(null),C=R()}finally{Ze(E)}return C}a.untrack=g;function v(R){var C;if(!(0,r.isComputed)(R)&&!(0,r.isWatcher)(R))throw new TypeError("Called introspectSources without a Computed or Watcher argument");return((C=R[X].producerNode)==null?void 0:C.map(E=>E.wrapper))??[]}a.introspectSources=v;function k(R){var C;if(!(0,r.isComputed)(R)&&!(0,r.isState)(R))throw new TypeError("Called introspectSinks without a Signal argument");return((C=R[X].liveConsumerNode)==null?void 0:C.map(E=>E.wrapper))??[]}a.introspectSinks=k;function _(R){if(!(0,r.isComputed)(R)&&!(0,r.isState)(R))throw new TypeError("Called hasSinks without a Signal argument");const C=R[X].liveConsumerNode;return C?C.length>0:!1}a.hasSinks=_;function D(R){if(!(0,r.isComputed)(R)&&!(0,r.isWatcher)(R))throw new TypeError("Called hasSources without a Computed or Watcher argument");const C=R[X].producerNode;return C?C.length>0:!1}a.hasSources=D;class m{constructor(C){Nt(this,u),Nt(this,d),Is(this,l);let E=Object.create(ci);E.wrapper=this,E.consumerMarkedDirty=C,E.consumerIsAlwaysLive=!0,E.consumerAllowSignalWrites=!1,E.producerNode=[],this[X]=E}watch(...C){if(!(0,r.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");lr(this,d,p).call(this,C);const E=this[X];E.dirty=!1;const b=Ze(E);for(const j of C)es(j[X]);Ze(b)}unwatch(...C){if(!(0,r.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");lr(this,d,p).call(this,C);const E=this[X];et(E);for(let b=E.producerNode.length-1;b>=0;b--)if(C.includes(E.producerNode[b].wrapper)){ts(E.producerNode[b],E.producerIndexOfThis[b]);const j=E.producerNode.length-1;if(E.producerNode[b]=E.producerNode[j],E.producerIndexOfThis[b]=E.producerIndexOfThis[j],E.producerNode.length--,E.producerIndexOfThis.length--,E.nextProducerIndex--,b<E.producerNode.length){const ve=E.producerIndexOfThis[b],H=E.producerNode[b];di(H),H.liveConsumerIndexOfThis[ve]=b}}}getPending(){if(!(0,r.isWatcher)(this))throw new TypeError("Called getPending without Watcher receiver");return this[X].producerNode.filter(E=>E.dirty).map(E=>E.wrapper)}}l=X,u=new WeakSet,d=new WeakSet,p=function(R){for(const C of R)if(!(0,r.isComputed)(C)&&!(0,r.isState)(C))throw new TypeError("Called watch/unwatch without a Computed or State argument")},r.isWatcher=R=>Ts(u,R),a.Watcher=m;function S(){var R;return(R=fo())==null?void 0:R.wrapper}a.currentComputed=S,a.watched=Symbol("watched"),a.unwatched=Symbol("unwatched")})(r.subtle||(r.subtle={}))})(ee||(ee={}));let Cs=!1;const cr=new ee.subtle.Watcher(()=>{Cs||(Cs=!0,queueMicrotask(()=>{Cs=!1;for(const r of cr.getPending())r.get();cr.watch()}))}),Po=Symbol("SignalWatcherBrand"),Lo=new FinalizationRegistry(r=>{r.unwatch(...ee.subtle.introspectSources(r))}),dr=new WeakMap;function ss(r){return r[Po]===!0?(console.warn("SignalWatcher should not be applied to the same class more than once."),r):class extends r{constructor(){super(...arguments),this._$St=new Map,this._$So=new ee.State(0),this._$Si=!1}_$Sl(){var e,t;const s=[],i=[];this._$St.forEach((o,a)=>{(o?.beforeUpdate?s:i).push(a)});const n=(e=this.h)===null||e===void 0?void 0:e.getPending().filter(o=>o!==this._$Su&&!this._$St.has(o));s.forEach(o=>o.get()),(t=this._$Su)===null||t===void 0||t.get(),n.forEach(o=>o.get()),i.forEach(o=>o.get())}_$Sv(){this.isUpdatePending||queueMicrotask(()=>{this.isUpdatePending||this._$Sl()})}_$S_(){if(this.h!==void 0)return;this._$Su=new ee.Computed(()=>{this._$So.get(),super.performUpdate()});const e=this.h=new ee.subtle.Watcher(function(){const t=dr.get(this);t!==void 0&&(t._$Si===!1&&(new Set(this.getPending()).has(t._$Su)?t.requestUpdate():t._$Sv()),this.watch())});dr.set(e,this),Lo.register(this,e),e.watch(this._$Su),e.watch(...Array.from(this._$St).map(([t])=>t))}_$Sp(){if(this.h===void 0)return;let e=!1;this.h.unwatch(...ee.subtle.introspectSources(this.h).filter(t=>{var s;const i=((s=this._$St.get(t))===null||s===void 0?void 0:s.manualDispose)!==!0;return i&&this._$St.delete(t),e||(e=!i),i})),e||(this._$Su=void 0,this.h=void 0,this._$St.clear())}updateEffect(e,t){var s;this._$S_();const i=new ee.Computed(()=>{e()});return this.h.watch(i),this._$St.set(i,t),(s=t?.beforeUpdate)!==null&&s!==void 0&&s?ee.subtle.untrack(()=>i.get()):this.updateComplete.then(()=>ee.subtle.untrack(()=>i.get())),()=>{this._$St.delete(i),this.h.unwatch(i),this.isConnected===!1&&this._$Sp()}}performUpdate(){this.isUpdatePending&&(this._$S_(),this._$Si=!0,this._$So.set(this._$So.get()+1),this._$Si=!1,this._$Sl())}connectedCallback(){super.connectedCallback(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask(()=>{this.isConnected===!1&&this._$Sp()})}}}const pi={ATTRIBUTE:1,CHILD:2},ui=r=>(...e)=>({_$litDirective$:r,values:e});let hi=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,s){this._$Ct=e,this._$AM=t,this._$Ci=s}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};const fi=globalThis,pr=r=>r,Gt=fi.trustedTypes,ur=Gt?Gt.createPolicy("lit-html",{createHTML:r=>r}):void 0,un="$lit$",Ie=`lit$${Math.random().toFixed(9).slice(2)}$`,hn="?"+Ie,Oo=`<${hn}>`,Me=document,xt=()=>Me.createComment(""),vt=r=>r===null||typeof r!="object"&&typeof r!="function",gi=Array.isArray,No=r=>gi(r)||typeof r?.[Symbol.iterator]=="function",_s=`[
2
- \f\r]`,lt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,hr=/-->/g,fr=/>/g,Ae=RegExp(`>|${_s}(?:([^\\s"'>=/]+)(${_s}*=${_s}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),gr=/'/g,mr=/"/g,fn=/^(?:script|style|textarea|title)$/i,gn=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),h=gn(1),Dt=gn(2),be=Symbol.for("lit-noChange"),I=Symbol.for("lit-nothing"),br=new WeakMap,De=Me.createTreeWalker(Me,129);function mn(r,e){if(!gi(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return ur!==void 0?ur.createHTML(e):e}const Do=(r,e)=>{const t=r.length-1,s=[];let i,n=e===2?"<svg>":e===3?"<math>":"",o=lt;for(let a=0;a<t;a++){const l=r[a];let u,d,p=-1,g=0;for(;g<l.length&&(o.lastIndex=g,d=o.exec(l),d!==null);)g=o.lastIndex,o===lt?d[1]==="!--"?o=hr:d[1]!==void 0?o=fr:d[2]!==void 0?(fn.test(d[2])&&(i=RegExp("</"+d[2],"g")),o=Ae):d[3]!==void 0&&(o=Ae):o===Ae?d[0]===">"?(o=i??lt,p=-1):d[1]===void 0?p=-2:(p=o.lastIndex-d[2].length,u=d[1],o=d[3]===void 0?Ae:d[3]==='"'?mr:gr):o===mr||o===gr?o=Ae:o===hr||o===fr?o=lt:(o=Ae,i=void 0);const v=o===Ae&&r[a+1].startsWith("/>")?" ":"";n+=o===lt?l+Oo:p>=0?(s.push(u),l.slice(0,p)+un+l.slice(p)+Ie+v):l+Ie+(p===-2?a:v)}return[mn(r,n+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};let Hs=class bn{constructor({strings:e,_$litType$:t},s){let i;this.parts=[];let n=0,o=0;const a=e.length-1,l=this.parts,[u,d]=Do(e,t);if(this.el=bn.createElement(u,s),De.currentNode=this.el.content,t===2||t===3){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(i=De.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const p of i.getAttributeNames())if(p.endsWith(un)){const g=d[o++],v=i.getAttribute(p).split(Ie),k=/([.?@])?(.*)/.exec(g);l.push({type:1,index:n,name:k[2],strings:v,ctor:k[1]==="."?zo:k[1]==="?"?jo:k[1]==="@"?Fo:rs}),i.removeAttribute(p)}else p.startsWith(Ie)&&(l.push({type:6,index:n}),i.removeAttribute(p));if(fn.test(i.tagName)){const p=i.textContent.split(Ie),g=p.length-1;if(g>0){i.textContent=Gt?Gt.emptyScript:"";for(let v=0;v<g;v++)i.append(p[v],xt()),De.nextNode(),l.push({type:2,index:++n});i.append(p[g],xt())}}}else if(i.nodeType===8)if(i.data===hn)l.push({type:2,index:n});else{let p=-1;for(;(p=i.data.indexOf(Ie,p+1))!==-1;)l.push({type:7,index:n}),p+=Ie.length-1}n++}}static createElement(e,t){const s=Me.createElement("template");return s.innerHTML=e,s}};function tt(r,e,t=r,s){if(e===be)return e;let i=s!==void 0?t._$Co?.[s]:t._$Cl;const n=vt(e)?void 0:e._$litDirective$;return i?.constructor!==n&&(i?._$AO?.(!1),n===void 0?i=void 0:(i=new n(r),i._$AT(r,t,s)),s!==void 0?(t._$Co??=[])[s]=i:t._$Cl=i),i!==void 0&&(e=tt(r,i._$AS(r,e.values),i,s)),e}let Mo=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:s}=this._$AD,i=(e?.creationScope??Me).importNode(t,!0);De.currentNode=i;let n=De.nextNode(),o=0,a=0,l=s[0];for(;l!==void 0;){if(o===l.index){let u;l.type===2?u=new is(n,n.nextSibling,this,e):l.type===1?u=new l.ctor(n,l.name,l.strings,this,e):l.type===6&&(u=new Bo(n,this,e)),this._$AV.push(u),l=s[++a]}o!==l?.index&&(n=De.nextNode(),o++)}return De.currentNode=Me,i}p(e){let t=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}},is=class xn{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,s,i){this.type=2,this._$AH=I,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=tt(this,e,t),vt(e)?e===I||e==null||e===""?(this._$AH!==I&&this._$AR(),this._$AH=I):e!==this._$AH&&e!==be&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):No(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==I&&vt(this._$AH)?this._$AA.nextSibling.data=e:this.T(Me.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:s}=e,i=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=Hs.createElement(mn(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(t);else{const n=new Mo(i,this),o=n.u(this.options);n.p(t),this.T(o),this._$AH=n}}_$AC(e){let t=br.get(e.strings);return t===void 0&&br.set(e.strings,t=new Hs(e)),t}k(e){gi(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let s,i=0;for(const n of e)i===t.length?t.push(s=new xn(this.O(xt()),this.O(xt()),this,this.options)):s=t[i],s._$AI(n),i++;i<t.length&&(this._$AR(s&&s._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const s=pr(e).nextSibling;pr(e).remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},rs=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,i,n){this.type=1,this._$AH=I,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=I}_$AI(e,t=this,s,i){const n=this.strings;let o=!1;if(n===void 0)e=tt(this,e,t,0),o=!vt(e)||e!==this._$AH&&e!==be,o&&(this._$AH=e);else{const a=e;let l,u;for(e=n[0],l=0;l<n.length-1;l++)u=tt(this,a[s+l],t,l),u===be&&(u=this._$AH[l]),o||=!vt(u)||u!==this._$AH[l],u===I?e=I:e!==I&&(e+=(u??"")+n[l+1]),this._$AH[l]=u}o&&!i&&this.j(e)}j(e){e===I?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},zo=class extends rs{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===I?void 0:e}},jo=class extends rs{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==I)}},Fo=class extends rs{constructor(e,t,s,i,n){super(e,t,s,i,n),this.type=5}_$AI(e,t=this){if((e=tt(this,e,t,0)??I)===be)return;const s=this._$AH,i=e===I&&s!==I||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,n=e!==I&&(s===I||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Bo=class{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){tt(this,e)}};const Uo={I:is},Go=fi.litHtmlPolyfillSupport;Go?.(Hs,is),(fi.litHtmlVersions??=[]).push("3.3.3");const qo=(r,e,t)=>{const s=t?.renderBefore??e;let i=s._$litPart$;if(i===void 0){const n=t?.renderBefore??null;s._$litPart$=i=new is(e.insertBefore(xt(),n),n,void 0,t??{})}return i._$AI(r),i};const{I:Ho}=Uo,xr=r=>r,vr=()=>document.createComment(""),ct=(r,e,t)=>{const s=r._$AA.parentNode,i=e===void 0?r._$AB:e._$AA;if(t===void 0){const n=s.insertBefore(vr(),i),o=s.insertBefore(vr(),i);t=new Ho(n,o,r,r.options)}else{const n=t._$AB.nextSibling,o=t._$AM,a=o!==r;if(a){let l;t._$AQ?.(r),t._$AM=r,t._$AP!==void 0&&(l=r._$AU)!==o._$AU&&t._$AP(l)}if(n!==i||a){let l=t._$AA;for(;l!==n;){const u=xr(l).nextSibling;xr(s).insertBefore(l,i),l=u}}}return t},Pe=(r,e,t=r)=>(r._$AI(e,t),r),Wo={},Ko=(r,e=Wo)=>r._$AH=e,Vo=r=>r._$AH,As=r=>{r._$AR(),r._$AA.remove()};let Ps=!1;const yr=new ee.subtle.Watcher(async()=>{Ps||(Ps=!0,queueMicrotask(()=>{Ps=!1;for(const r of yr.getPending())r.get();yr.watch()}))});ee.State;ee.Computed;const L=(r,e)=>new ee.State(r,e),O=(r,e)=>new ee.Computed(r,e);const Ft=globalThis,mi=Ft.ShadowRoot&&(Ft.ShadyCSS===void 0||Ft.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,bi=Symbol(),wr=new WeakMap;let vn=class{constructor(e,t,s){if(this._$cssResult$=!0,s!==bi)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(mi&&e===void 0){const s=t!==void 0&&t.length===1;s&&(e=wr.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&wr.set(t,e))}return e}toString(){return this.cssText}};const Qo=r=>new vn(typeof r=="string"?r:r+"",void 0,bi),ue=(r,...e)=>{const t=r.length===1?r[0]:e.reduce((s,i,n)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[n+1],r[0]);return new vn(t,r,bi)},Yo=(r,e)=>{if(mi)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const s=document.createElement("style"),i=Ft.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=t.cssText,r.appendChild(s)}},kr=mi?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(const s of e.cssRules)t+=s.cssText;return Qo(t)})(r):r;const{is:Zo,defineProperty:Xo,getOwnPropertyDescriptor:Jo,getOwnPropertyNames:ea,getOwnPropertySymbols:ta,getPrototypeOf:sa}=Object,ns=globalThis,Sr=ns.trustedTypes,ia=Sr?Sr.emptyScript:"",ra=ns.reactiveElementPolyfillSupport,bt=(r,e)=>r,Ws={toAttribute(r,e){switch(e){case Boolean:r=r?ia:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},yn=(r,e)=>!Zo(r,e),$r={attribute:!0,type:String,converter:Ws,reflect:!1,useDefault:!1,hasChanged:yn};Symbol.metadata??=Symbol("metadata"),ns.litPropertyMetadata??=new WeakMap;let Qe=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=$r){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(e,s,t);i!==void 0&&Xo(this.prototype,e,i)}}static getPropertyDescriptor(e,t,s){const{get:i,set:n}=Jo(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:i,set(o){const a=i?.call(this);n?.call(this,o),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??$r}static _$Ei(){if(this.hasOwnProperty(bt("elementProperties")))return;const e=sa(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(bt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(bt("properties"))){const t=this.properties,s=[...ea(t),...ta(t)];for(const i of s)this.createProperty(i,t[i])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[s,i]of t)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const i of s)t.unshift(kr(i))}else e!==void 0&&t.push(kr(e));return t}static _$Eu(e,t){const s=t.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const s of t.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Yo(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,s){this._$AK(e,s)}_$ET(e,t){const s=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,s);if(i!==void 0&&s.reflect===!0){const n=(s.converter?.toAttribute!==void 0?s.converter:Ws).toAttribute(t,s.type);this._$Em=e,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(e,t){const s=this.constructor,i=s._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const n=s.getPropertyOptions(i),o=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:Ws;this._$Em=i;const a=o.fromAttribute(t,n.type);this[i]=a??this._$Ej?.get(i)??a,this._$Em=null}}requestUpdate(e,t,s,i=!1,n){if(e!==void 0){const o=this.constructor;if(i===!1&&(n=this[e]),s??=o.getPropertyOptions(e),!((s.hasChanged??yn)(n,t)||s.useDefault&&s.reflect&&n===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,s))))return;this.C(e,t,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:s,reflect:i,wrapped:n},o){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),n!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[i,n]of s){const{wrapped:o}=n,a=this[i];o!==!0||this._$AL.has(i)||a===void 0||this.C(i,void 0,n,a)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(t)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};Qe.elementStyles=[],Qe.shadowRootOptions={mode:"open"},Qe[bt("elementProperties")]=new Map,Qe[bt("finalized")]=new Map,ra?.({ReactiveElement:Qe}),(ns.reactiveElementVersions??=[]).push("2.1.2");const xi=globalThis;class le extends Qe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=qo(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return be}}le._$litElement$=!0,le.finalized=!0,xi.litElementHydrateSupport?.({LitElement:le});const na=xi.litElementPolyfillSupport;na?.({LitElement:le});(xi.litElementVersions??=[]).push("4.2.2");const Xe=(r,e,t)=>{for(const s of e)if(s[0]===r)return(0,s[1])();return t?.()};const Q=ui(class extends hi{constructor(r){if(super(r),r.type!==pi.ATTRIBUTE||r.name!=="class"||r.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(r){return" "+Object.keys(r).filter(e=>r[e]).join(" ")+" "}update(r,[e]){if(this.st===void 0){this.st=new Set,r.strings!==void 0&&(this.nt=new Set(r.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(const s in e)e[s]&&!this.nt?.has(s)&&this.st.add(s);return this.render(e)}const t=r.element.classList;for(const s of this.st)s in e||(t.remove(s),this.st.delete(s));for(const s in e){const i=!!e[s];i===this.st.has(s)||this.nt?.has(s)||(i?(t.add(s),this.st.add(s)):(t.remove(s),this.st.delete(s)))}return be}});function*Bt(r,e){if(r!==void 0){let t=0;for(const s of r)yield e(s,t++)}}const Ir=(r,e,t)=>{const s=new Map;for(let i=e;i<=t;i++)s.set(r[i],i);return s},P=ui(class extends hi{constructor(r){if(super(r),r.type!==pi.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,e,t){let s;t===void 0?t=e:e!==void 0&&(s=e);const i=[],n=[];let o=0;for(const a of r)i[o]=s?s(a,o):o,n[o]=t(a,o),o++;return{values:n,keys:i}}render(r,e,t){return this.dt(r,e,t).values}update(r,[e,t,s]){const i=Vo(r),{values:n,keys:o}=this.dt(e,t,s);if(!Array.isArray(i))return this.ut=o,n;const a=this.ut??=[],l=[];let u,d,p=0,g=i.length-1,v=0,k=n.length-1;for(;p<=g&&v<=k;)if(i[p]===null)p++;else if(i[g]===null)g--;else if(a[p]===o[v])l[v]=Pe(i[p],n[v]),p++,v++;else if(a[g]===o[k])l[k]=Pe(i[g],n[k]),g--,k--;else if(a[p]===o[k])l[k]=Pe(i[p],n[k]),ct(r,l[k+1],i[p]),p++,k--;else if(a[g]===o[v])l[v]=Pe(i[g],n[v]),ct(r,i[p],i[g]),g--,v++;else if(u===void 0&&(u=Ir(o,v,k),d=Ir(a,p,g)),u.has(a[p]))if(u.has(a[g])){const _=d.get(o[v]),D=_!==void 0?i[_]:null;if(D===null){const m=ct(r,i[p]);Pe(m,n[v]),l[v]=m}else l[v]=Pe(D,n[v]),ct(r,i[p],D),i[_]=null;v++}else As(i[g]),g--;else As(i[p]),p++;for(;v<=k;){const _=ct(r,l[k+1]);Pe(_,n[v]),l[v++]=_}for(;p<=g;){const _=i[p++];_!==null&&As(_)}return this.ut=o,Ko(r,l),be}});function w(r,e,t){return r?e(r):t?.(r)}const os=ue`
4
- button,
5
- input,
6
- select,
7
- pre,
8
- code {
9
- font: inherit;
10
- }
11
-
12
- button {
13
- color: inherit;
14
- }
15
-
16
- .repo-label,
17
- .section-label,
18
- .meta-label,
19
- .issue-number,
20
- .small-copy {
21
- color: var(--muted);
22
- font-size: 0.75rem;
23
- font-weight: 600;
24
- }
25
-
26
- .repo-title,
27
- h1,
28
- h2,
29
- h3 {
30
- margin: 0;
31
- letter-spacing: -0.01em;
32
- }
33
-
34
- .repo-title {
35
- font-size: 1rem;
36
- font-weight: 600;
37
- }
38
-
39
- .repo-subtitle,
40
- .meta-copy,
41
- .section-copy,
42
- .empty-copy,
43
- .thread-copy,
44
- .relation-copy,
45
- .definition-value,
46
- .graph-copy,
47
- .list-meta,
48
- .issue-meta-text {
49
- color: var(--muted);
50
- font-size: 0.875rem;
51
- line-height: 1.5;
52
- }
53
-
54
- .initiative-title,
55
- .backlink-title,
56
- .relation-title {
57
- font-size: 0.9375rem;
58
- font-weight: 600;
59
- line-height: 1.35;
60
- }
61
- `,vi=ue`
62
- input,
63
- select {
64
- width: 100%;
65
- box-sizing: border-box;
66
- padding: 9px 12px;
67
- border: 1px solid var(--border);
68
- border-radius: 6px;
69
- background: var(--surface);
70
- color: var(--text);
71
- }
72
-
73
- input:focus,
74
- select:focus,
75
- .issue-row-button:focus,
76
- .entity-row-button:focus,
77
- .link-button:focus,
78
- .tab-button:focus,
79
- .back-button:focus,
80
- .graph-action:focus,
81
- .initiative-button:focus,
82
- .bundle-title-button:focus,
83
- .bundle-toggle:focus {
84
- outline: 2px solid var(--focus-ring);
85
- outline-offset: 2px;
86
- }
87
-
88
- .badge,
89
- .counter,
90
- .graph-action,
91
- .tab-button,
92
- .back-button {
93
- display: inline-flex;
94
- align-items: center;
95
- justify-content: center;
96
- min-height: 28px;
97
- padding: 0 10px;
98
- border: 1px solid var(--border);
99
- border-radius: 999px;
100
- background: var(--surface);
101
- font-size: 0.75rem;
102
- font-weight: 600;
103
- line-height: 1;
104
- }
105
-
106
- .counter {
107
- background: var(--surface-muted);
108
- }
109
-
110
- .badge.success {
111
- border-color: rgba(26, 127, 55, 0.18);
112
- background: var(--success-bg);
113
- color: var(--success);
114
- }
115
-
116
- .badge.warn {
117
- border-color: rgba(154, 103, 0, 0.18);
118
- background: var(--warn-bg);
119
- color: var(--warn);
120
- }
121
-
122
- .badge.danger {
123
- border-color: rgba(207, 34, 46, 0.18);
124
- background: var(--danger-bg);
125
- color: var(--danger);
126
- }
127
-
128
- .badge.info,
129
- .graph-action {
130
- border-color: rgba(9, 105, 218, 0.18);
131
- background: var(--accent-soft);
132
- color: var(--accent);
133
- }
134
-
135
- .badge.done {
136
- border-color: rgba(130, 80, 223, 0.18);
137
- background: var(--done-bg);
138
- color: var(--done);
139
- }
140
-
141
- .badge.neutral,
142
- .tab-button,
143
- .back-button {
144
- background: var(--surface-muted);
145
- }
146
-
147
- .count-row,
148
- .issue-row-meta,
149
- .issue-row-top,
150
- .badge-row,
151
- .inline-row,
152
- .bundle-counts,
153
- .relation-meta,
154
- .backlink-meta,
155
- .graph-badges,
156
- .initiative-counts {
157
- display: flex;
158
- flex-wrap: wrap;
159
- gap: 8px;
160
- align-items: center;
161
- }
162
-
163
- .issue-row-button,
164
- .entity-row-button,
165
- .link-button,
166
- .graph-action,
167
- .tab-button,
168
- .back-button,
169
- .initiative-button,
170
- .bundle-title-button,
171
- .bundle-toggle {
172
- border: 0;
173
- cursor: pointer;
174
- text-align: left;
175
- }
176
-
177
- .link-button {
178
- background: transparent;
179
- padding: 0;
180
- color: var(--accent);
181
- font-weight: 600;
182
- }
183
-
184
- .link-button:hover {
185
- text-decoration: underline;
186
- }
187
-
188
- .empty-panel {
189
- padding: 24px;
190
- border: 1px solid var(--border);
191
- border-radius: 6px;
192
- background: var(--surface);
193
- }
194
-
195
- .error-panel {
196
- padding: 12px;
197
- border: 1px solid rgba(207, 34, 46, 0.18);
198
- border-radius: 6px;
199
- background: var(--danger-bg);
200
- color: var(--danger);
201
- }
202
- `,Kt=class Kt extends le{constructor(){super(...arguments),this.context=null,this.emptyMessage="No context has been defined yet.",this.targetTerm=null}focusTargetTerm(){const e=[...this.renderRoot.querySelectorAll(".term")];for(const s of e)s.classList.remove("is-context-term-target");const t=e.find(s=>s.dataset.term===this.targetTerm);t&&(t.offsetWidth,t.classList.add("is-context-term-target"),t.focus({preventScroll:!0}),typeof t.scrollIntoView=="function"&&t.scrollIntoView({behavior:"smooth",block:"center"}))}updated(){this.focusTargetTerm()}renderTerm(e){return h`
203
- <div
204
- class="term"
205
- data-term=${e.term}
206
- tabindex="-1"
207
- >
208
- <div class="term-name">${e.term}</div>
209
- <p class="term-def">${e.definition}</p>
210
- ${w(e.avoid.length>0,()=>h`
211
- <div class="avoid">
212
- <span class="avoid-label">Avoid</span>
213
- ${P(e.avoid,t=>t,t=>h`<span class="avoid-chip">${t}</span>`)}
214
- </div>
215
- `,()=>I)}
216
- </div>
217
- `}render(){const e=this.context,t=e?.terms??[],s=!!e?.context.summary?.trim()||t.length>0;return h`
218
- <div class="context">
219
- ${w(s,()=>h`
220
- <p class="summary">${e?.context.summary}</p>
221
- <div class="glossary-head">
222
- <span class="glossary-title">Glossary</span>
223
- <span class="glossary-count">${t.length} ${w(t.length===1,()=>h`term`,()=>h`terms`)}</span>
224
- </div>
225
- ${w(t.length>0,()=>h`<div class="terms">${P(t,i=>i.term,i=>this.renderTerm(i))}</div>`,()=>h`<p class="empty">No glossary terms have been defined yet.</p>`)}
226
- `,()=>h`<p class="empty">${this.emptyMessage}</p>`)}
227
- </div>
228
- `}};Kt.properties={context:{attribute:!1},emptyMessage:{attribute:!1},targetTerm:{attribute:!1}},Kt.styles=[os,ue`
229
- :host {
230
- display: block;
231
- }
232
- .summary {
233
- max-width: 75ch;
234
- margin: 0;
235
- color: var(--text);
236
- }
237
- .glossary-head {
238
- display: flex;
239
- gap: 10px;
240
- align-items: baseline;
241
- margin-top: 22px;
242
- }
243
- .glossary-title {
244
- font-size: 16px;
245
- font-weight: 600;
246
- }
247
- .glossary-count {
248
- color: var(--muted);
249
- font-size: 12px;
250
- }
251
- .terms {
252
- display: grid;
253
- gap: 12px;
254
- margin-top: 12px;
255
- }
256
- .term {
257
- padding: 14px 16px;
258
- border: 1px solid var(--border);
259
- border-radius: 10px;
260
- background: var(--surface);
261
- }
262
- .term:focus {
263
- outline: 2px solid var(--focus-ring);
264
- outline-offset: -2px;
265
- }
266
- .term.is-context-term-target {
267
- animation: context-term-target 1.8s ease-out;
268
- }
269
- @keyframes context-term-target {
270
- 0% {
271
- background: var(--accent-soft);
272
- box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 32%, transparent);
273
- }
274
- 100% {
275
- background: var(--surface);
276
- box-shadow: 0 0 0 0 transparent;
277
- }
278
- }
279
- @media (prefers-reduced-motion: reduce) {
280
- .term.is-context-term-target {
281
- animation: none;
282
- outline: 2px solid var(--focus-ring);
283
- }
284
- }
285
- .term-name {
286
- font-weight: 600;
287
- }
288
- .term-def {
289
- max-width: 75ch;
290
- margin: 6px 0 0;
291
- color: var(--text);
292
- }
293
- .avoid {
294
- display: flex;
295
- flex-wrap: wrap;
296
- gap: 6px;
297
- align-items: center;
298
- margin-top: 10px;
299
- }
300
- .avoid-label {
301
- color: var(--muted);
302
- font-size: 11px;
303
- letter-spacing: 0.04em;
304
- text-transform: uppercase;
305
- }
306
- .avoid-chip {
307
- padding: 2px 8px;
308
- border: 1px solid var(--border);
309
- border-radius: 999px;
310
- background: var(--surface-muted);
311
- color: var(--muted);
312
- font-size: 12px;
313
- }
314
- .empty {
315
- margin: 0;
316
- color: var(--muted);
317
- }
318
- `];let Ks=Kt;customElements.define("agent-issues-context-view",Ks);const Tr={"context-term":"T",context:"C",entity:"R","issue-comment":"M","plan-entry":"P"},oa=[{label:"Records",value:"entity"},{label:"Context",value:"context"},{label:"Terms",value:"context-term"},{label:"Plan entries",value:"plan-entry"},{label:"Comments",value:"issue-comment"}],Rr=20,Ei=class Ei extends ss(le){constructor(){super(...arguments),this.store=null,this.activeResultIndex=0,this.syntaxHelpOpen=!1,this.onInput=e=>{this.activeResultIndex=0,this.store?.setGlobalSearchQuery(e.target.value)},this.onScopeToggle=e=>{this.activeResultIndex=0,this.store?.setGlobalSearchScope(e.target.checked?"all-projects":"current-project")},this.onSourceTypeToggle=e=>{this.activeResultIndex=0;const t=e.currentTarget.dataset.sourceType,s=this.store?.globalSearchSourceTypes.get()??[],i=s.includes(t)?s.filter(n=>n!==t):[...s,t];this.store?.setGlobalSearchSourceTypes(i)},this.onToggleSyntaxHelp=()=>{this.syntaxHelpOpen=!this.syntaxHelpOpen,this.requestUpdate()},this.onResultClick=e=>{const t=Number(e.currentTarget.dataset.resultIndex),s=this.results[t];s&&this.openResult(s.navigationTarget)},this.onRecentClick=e=>{const t=Number(e.currentTarget.dataset.recentIndex),s=this.recents[t];s&&this.openResult(s.target)},this.onRetry=()=>{this.dispatchEvent(new CustomEvent("global-search-retry",{bubbles:!0,composed:!0}))},this.onBackdropPointerDown=e=>{e.target===e.currentTarget&&this.close()},this.onKeyDown=e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.close();return}if(e.key==="ArrowDown"||e.key==="ArrowUp"){if(this.results.length===0)return;e.preventDefault();const n=e.key==="ArrowDown"?1:-1;this.activeResultIndex=(this.activeResultIndex+n+this.results.length)%this.results.length,this.requestUpdate();return}if(e.key==="Enter"){const n=this.results[this.activeResultIndex];if(!n)return;e.preventDefault(),this.openResult(n.navigationTarget);return}if(e.key!=="Tab")return;const t=[...this.renderRoot.querySelectorAll("button, input, select, [tabindex]:not([tabindex='-1'])")].filter(n=>!n.hasAttribute("disabled")),s=t[0],i=t.at(-1);!s||!i||(e.shiftKey&&this.shadowRoot?.activeElement===s?(e.preventDefault(),i.focus()):!e.shiftKey&&this.shadowRoot?.activeElement===i&&(e.preventDefault(),s.focus()))},this.onWindowKeyDown=e=>{e.key==="Escape"&&(e.preventDefault(),this.close())}}focusInput(){this.renderRoot.querySelector("input")?.focus()}connectedCallback(){super.connectedCallback(),window.addEventListener("keydown",this.onWindowKeyDown)}disconnectedCallback(){window.removeEventListener("keydown",this.onWindowKeyDown),super.disconnectedCallback()}get results(){const e=this.store?.globalSearchResponse.get();return e?.state==="available"?e.results:this.store?.globalSearchResults.get()??[]}get recents(){return this.store?.globalSearchRecentRecords.get()??[]}openResult(e){this.dispatchEvent(new CustomEvent("global-search-open-target",{bubbles:!0,composed:!0,detail:e}))}close(){this.dispatchEvent(new CustomEvent("global-search-close",{bubbles:!0,composed:!0}))}renderSnippet(e){const t=e.snippet;if(!t)return"";const s=[];let i=0;for(const n of t.highlights)s.push(t.text.slice(i,n.start)),s.push(h`<mark>${t.text.slice(n.start,n.end)}</mark>`),i=n.end;return s.push(t.text.slice(i)),s}renderResult(e,t){const s=t===this.activeResultIndex;return h`
319
- <button
320
- aria-selected=${w(s,()=>"true",()=>"false")}
321
- class="result"
322
- data-result-index=${t}
323
- role="option"
324
- type="button"
325
- @click=${this.onResultClick}
326
- >
327
- <span aria-hidden="true" class="result-icon">${Tr[e.identity.sourceType]}</span>
328
- <span class="result-content">
329
- <span class="result-heading">${e.title}</span>
330
- <span class="result-meta">${e.identity.shortReference} · ${e.match.field}${w(e.statusOrRole,()=>h` · ${e.statusOrRole}`,()=>"")}</span>
331
- <span class="result-owner">${e.projectLabel}${w(e.parentLabel,()=>h` / ${e.parentLabel}`,()=>"")}</span>
332
- ${w(e.snippet,()=>h`<span class="result-snippet">${this.renderSnippet(e)}</span>`,()=>"")}
333
- </span>
334
- </button>
335
- `}renderRecent(e,t){return h`
336
- <button
337
- class="recent"
338
- data-recent-index=${t}
339
- type="button"
340
- @click=${this.onRecentClick}
341
- >
342
- <span aria-hidden="true" class="result-icon">${Tr[e.sourceType]}</span>
343
- <span class="recent-title">${e.title}</span>
344
- </button>
345
- `}renderSourceTypeOption(e){const t=this.store?.globalSearchSourceTypes.get().includes(e.value)??!1;return h`
346
- <button
347
- aria-pressed=${w(t,()=>"true",()=>"false")}
348
- class="source-type-chip"
349
- data-source-type=${e.value}
350
- type="button"
351
- @click=${this.onSourceTypeToggle}
352
- >
353
- ${e.label}
354
- </button>
355
- `}renderResultState(){const e=this.store?.globalSearchResponse.get();return e?.state==="parse-error"?h`<p aria-live="polite" class="result-state">${e.error.message} At character ${e.error.start+1}.</p>`:Xe(e?.state,[["available",()=>w(this.results.length===0,()=>h`<p class="result-state">No matching records</p>`,()=>"")],["operational-error",()=>h`
356
- <div class="result-state">
357
- <p>Unable to search records</p>
358
- <button class="retry" type="button" @click=${this.onRetry}>Retry</button>
359
- </div>
360
- `]],()=>"")}firstUpdated(){this.focusInput()}render(){return h`
361
- <div class="backdrop" @pointerdown=${this.onBackdropPointerDown}>
362
- <div
363
- aria-label="Global search"
364
- aria-modal="true"
365
- class="dialog"
366
- role="dialog"
367
- @keydown=${this.onKeyDown}
368
- >
369
- <div class="search-heading">
370
- <label class="search-label" for="global-search-input">Search records</label>
371
- </div>
372
- <div class="search-input-row">
373
- <input
374
- autocomplete="off"
375
- id="global-search-input"
376
- placeholder="Search this project"
377
- .value=${this.store?.globalSearchQuery.get()??""}
378
- @input=${this.onInput}
379
- />
380
- <button
381
- aria-expanded=${w(this.syntaxHelpOpen,()=>"true",()=>"false")}
382
- aria-label="Show search syntax help"
383
- class="syntax-help-toggle"
384
- data-global-search-help
385
- title="Search syntax help"
386
- type="button"
387
- @click=${this.onToggleSyntaxHelp}
388
- >
389
- ?
390
- </button>
391
- </div>
392
- ${w(this.syntaxHelpOpen,()=>h`
393
- <section class="syntax-help" aria-label="Search syntax help">
394
- <p>Use quotes for phrases and a trailing * for prefixes.</p>
395
- <p>Combine terms with AND, OR, NOT, parentheses, and NEAR.</p>
396
- </section>
397
- `,()=>"")}
398
- ${w(!this.store?.globalSearchQuery.get().trim(),()=>h`<p class="syntax-hint">Use quotes for phrases or * for a prefix.</p>`,()=>"")}
399
- <div class="search-controls">
400
- <label class="scope-toggle">
401
- <input
402
- data-global-search-scope
403
- type="checkbox"
404
- .checked=${this.store?.globalSearchScope.get()==="all-projects"}
405
- @change=${this.onScopeToggle}
406
- />
407
- <span>All projects</span>
408
- </label>
409
- <div aria-label="Record types" class="source-type-chips">
410
- ${Bt(oa,e=>this.renderSourceTypeOption(e))}
411
- </div>
412
- </div>
413
- <div aria-live="polite" class="result-count">
414
- ${this.results.length} result${w(this.results.length===1,()=>"",()=>"s")}
415
- </div>
416
- <div aria-label="Search results" class="results" role="listbox">
417
- ${Bt(this.results.slice(0,Rr),(e,t)=>this.renderResult(e,t))}
418
- ${w(this.results.length>Rr,()=>h`<p class="result-state">Refine the query to narrow the results.</p>`,()=>"")}
419
- ${this.renderResultState()}
420
- ${w(!this.store?.globalSearchQuery.get().trim()&&this.recents.length>0,()=>h`
421
- <section class="recents" aria-label="Recently opened">
422
- <h2>Recently opened</h2>
423
- ${Bt(this.recents,(e,t)=>this.renderRecent(e,t))}
424
- </section>
425
- `,()=>"")}
426
- </div>
427
- </div>
428
- </div>
429
- `}};Ei.styles=ue`
430
- :host {
431
- position: fixed;
432
- z-index: 50;
433
- inset: 0;
434
- width: 100%;
435
- height: 100%;
436
- }
437
- .backdrop {
438
- box-sizing: border-box;
439
- display: grid;
440
- min-height: 0;
441
- width: 100%;
442
- height: 100%;
443
- place-items: start center;
444
- padding: 12vh 16px 16px;
445
- overflow: hidden;
446
- background: rgba(31, 35, 40, 0.45);
447
- }
448
- .dialog {
449
- box-sizing: border-box;
450
- display: flex;
451
- flex-direction: column;
452
- min-height: 0;
453
- width: min(640px, 100%);
454
- max-height: 100%;
455
- padding: 16px;
456
- border: 1px solid var(--border);
457
- border-radius: 8px;
458
- background: var(--surface);
459
- box-shadow: 0 20px 50px var(--shadow);
460
- }
461
- .search-heading {
462
- display: flex;
463
- align-items: center;
464
- justify-content: space-between;
465
- margin-bottom: 8px;
466
- }
467
- .search-label {
468
- font-size: 13px;
469
- font-weight: 600;
470
- }
471
- .search-input-row {
472
- display: flex;
473
- gap: 8px;
474
- align-items: center;
475
- }
476
- .syntax-help-toggle {
477
- display: grid;
478
- width: 24px;
479
- height: 24px;
480
- place-items: center;
481
- padding: 0;
482
- border: 1px solid var(--border);
483
- border-radius: 50%;
484
- background: var(--surface);
485
- color: var(--text-muted);
486
- font: inherit;
487
- font-weight: 700;
488
- cursor: pointer;
489
- }
490
- .syntax-help {
491
- margin-top: 8px;
492
- padding: 8px 10px;
493
- border: 1px solid var(--border);
494
- border-radius: 4px;
495
- background: var(--surface-muted);
496
- color: var(--text-muted);
497
- font-size: 12px;
498
- }
499
- .syntax-help p,
500
- .syntax-hint {
501
- margin: 0;
502
- }
503
- .syntax-help p + p {
504
- margin-top: 4px;
505
- }
506
- .syntax-hint {
507
- margin-top: 8px;
508
- color: var(--text-muted);
509
- font-size: 12px;
510
- }
511
- .search-input-row input {
512
- box-sizing: border-box;
513
- width: 100%;
514
- padding: 10px 12px;
515
- border: 1px solid var(--border);
516
- border-radius: 6px;
517
- background: var(--surface-muted);
518
- color: var(--text);
519
- font: inherit;
520
- }
521
- .search-controls {
522
- display: flex;
523
- align-items: center;
524
- flex-wrap: wrap;
525
- gap: 12px;
526
- margin-top: 12px;
527
- }
528
- .scope-toggle {
529
- display: flex;
530
- flex: 0 0 auto;
531
- gap: 6px;
532
- align-items: center;
533
- color: var(--text-muted);
534
- font-size: 12px;
535
- white-space: nowrap;
536
- cursor: pointer;
537
- }
538
- .scope-toggle input {
539
- position: relative;
540
- box-sizing: border-box;
541
- width: 28px;
542
- height: 16px;
543
- margin: 0;
544
- border: 1px solid var(--border);
545
- border-radius: 999px;
546
- appearance: none;
547
- background: var(--surface-muted);
548
- cursor: pointer;
549
- }
550
- .scope-toggle input::after {
551
- position: absolute;
552
- top: 2px;
553
- left: 2px;
554
- width: 10px;
555
- height: 10px;
556
- border-radius: 50%;
557
- background: var(--text-muted);
558
- content: "";
559
- transition: transform 120ms ease, background-color 120ms ease;
560
- }
561
- .scope-toggle input:checked {
562
- border-color: var(--accent);
563
- background: var(--accent-soft);
564
- }
565
- .scope-toggle input:checked::after {
566
- background: var(--accent);
567
- transform: translateX(12px);
568
- }
569
- .scope-toggle input:focus-visible {
570
- outline: 2px solid var(--accent);
571
- outline-offset: 2px;
572
- }
573
- .source-type-chips {
574
- display: flex;
575
- flex: 1 1 320px;
576
- flex-wrap: wrap;
577
- gap: 4px;
578
- }
579
- .source-type-chip {
580
- padding: 6px 8px;
581
- border: 1px solid var(--border);
582
- border-radius: 4px;
583
- background: var(--surface-muted);
584
- color: var(--text);
585
- font: inherit;
586
- font-size: 12px;
587
- cursor: pointer;
588
- }
589
- .source-type-chip[aria-pressed="true"] {
590
- border-color: var(--accent);
591
- background: var(--accent-soft);
592
- color: var(--accent);
593
- }
594
- .result-count {
595
- margin-top: 12px;
596
- color: var(--text-muted);
597
- font-size: 12px;
598
- }
599
- .results {
600
- display: grid;
601
- gap: 4px;
602
- min-height: 0;
603
- margin-top: 8px;
604
- overflow-y: auto;
605
- overscroll-behavior: contain;
606
- }
607
- .result {
608
- display: grid;
609
- grid-template-columns: 24px minmax(0, 1fr);
610
- gap: 8px;
611
- width: 100%;
612
- padding: 10px;
613
- border: 1px solid transparent;
614
- border-radius: 6px;
615
- background: transparent;
616
- color: inherit;
617
- font: inherit;
618
- text-align: left;
619
- cursor: pointer;
620
- }
621
- .result[aria-selected="true"],
622
- .result:hover {
623
- border-color: var(--border);
624
- background: var(--surface-muted);
625
- }
626
- .result-icon {
627
- display: grid;
628
- width: 24px;
629
- height: 24px;
630
- place-items: center;
631
- border-radius: 4px;
632
- background: var(--border);
633
- font-size: 12px;
634
- font-weight: 700;
635
- }
636
- .result-content {
637
- display: grid;
638
- gap: 3px;
639
- min-width: 0;
640
- }
641
- .recents {
642
- display: grid;
643
- gap: 4px;
644
- margin-top: 12px;
645
- }
646
- .recents h2 {
647
- margin: 0 0 4px;
648
- color: var(--text-muted);
649
- font-size: 12px;
650
- font-weight: 600;
651
- }
652
- .recent {
653
- display: grid;
654
- grid-template-columns: 24px minmax(0, 1fr);
655
- gap: 8px;
656
- align-items: center;
657
- width: 100%;
658
- padding: 8px 10px;
659
- border: 1px solid transparent;
660
- border-radius: 6px;
661
- background: transparent;
662
- color: inherit;
663
- font: inherit;
664
- text-align: left;
665
- cursor: pointer;
666
- }
667
- .recent:hover {
668
- border-color: var(--border);
669
- background: var(--surface-muted);
670
- }
671
- .recent-title {
672
- overflow: hidden;
673
- text-overflow: ellipsis;
674
- white-space: nowrap;
675
- }
676
- .result-heading,
677
- .result-meta,
678
- .result-owner,
679
- .result-snippet {
680
- overflow: hidden;
681
- text-overflow: ellipsis;
682
- white-space: nowrap;
683
- }
684
- .result-heading {
685
- font-weight: 600;
686
- }
687
- .result-meta,
688
- .result-owner,
689
- .result-snippet {
690
- color: var(--text-muted);
691
- font-size: 12px;
692
- }
693
- .result-state {
694
- margin: 0;
695
- padding: 12px 10px;
696
- color: var(--text-muted);
697
- font-size: 13px;
698
- }
699
- .result-state[aria-live] {
700
- color: var(--danger);
701
- }
702
- .retry {
703
- padding: 6px 10px;
704
- border: 1px solid var(--border);
705
- border-radius: 4px;
706
- background: var(--surface);
707
- color: var(--text);
708
- font: inherit;
709
- cursor: pointer;
710
- }
711
- mark {
712
- padding: 0;
713
- background: var(--warning-soft);
714
- color: inherit;
715
- }
716
- `;let Vs=Ei;customElements.define("agent-issues-global-search-overlay",Vs);class Qs extends hi{constructor(e){if(super(e),this.it=I,e.type!==pi.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===I||e==null)return this._t=void 0,this.it=e;if(e===be)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}Qs.directiveName="unsafeHTML",Qs.resultType=1;const Ys=ui(Qs);function Er(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,s=Array(e);t<e;t++)s[t]=r[t];return s}function aa(r){if(Array.isArray(r))return r}function la(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var s,i,n,o,a=[],l=!0,u=!1;try{if(n=(t=t.call(r)).next,e!==0)for(;!(l=(s=n.call(t)).done)&&(a.push(s.value),a.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function ca(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
717
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function da(r,e){return aa(r)||la(r,e)||pa(r,e)||ca()}function pa(r,e){if(r){if(typeof r=="string")return Er(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Er(r,e):void 0}}const wn=Object.entries,Cr=Object.setPrototypeOf,ua=Object.isFrozen,ha=Object.getPrototypeOf,fa=Object.getOwnPropertyDescriptor;let Y=Object.freeze,Z=Object.seal,Ye=Object.create,kn=typeof Reflect<"u"&&Reflect,Zs=kn.apply,Xs=kn.construct;Y||(Y=function(e){return e});Z||(Z=function(e){return e});Zs||(Zs=function(e,t){for(var s=arguments.length,i=new Array(s>2?s-2:0),n=2;n<s;n++)i[n-2]=arguments[n];return e.apply(t,i)});Xs||(Xs=function(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),i=1;i<t;i++)s[i-1]=arguments[i];return new e(...s)});const Oe=V(Array.prototype.forEach),ga=V(Array.prototype.lastIndexOf),_r=V(Array.prototype.pop),dt=V(Array.prototype.push),ma=V(Array.prototype.splice),Je=Array.isArray,ft=V(String.prototype.toLowerCase),Ls=V(String.prototype.toString),Ar=V(String.prototype.match),pt=V(String.prototype.replace),Pr=V(String.prototype.indexOf),ba=V(String.prototype.trim),xa=V(Number.prototype.toString),va=V(Boolean.prototype.toString),Lr=typeof BigInt>"u"?null:V(BigInt.prototype.toString),Or=typeof Symbol>"u"?null:V(Symbol.prototype.toString),ne=V(Object.prototype.hasOwnProperty),ut=V(Object.prototype.toString),J=V(RegExp.prototype.test),Le=ya(TypeError);function V(r){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,s=new Array(t>1?t-1:0),i=1;i<t;i++)s[i-1]=arguments[i];return Zs(r,e,s)}}function ya(r){return function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return Xs(r,t)}}function M(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ft;if(Cr&&Cr(r,null),!Je(e))return r;let s=e.length;for(;s--;){let i=e[s];if(typeof i=="string"){const n=t(i);n!==i&&(ua(e)||(e[s]=n),i=n)}r[i]=!0}return r}function wa(r){for(let e=0;e<r.length;e++)ne(r,e)||(r[e]=null);return r}function ae(r){const e=Ye(null);for(const s of wn(r)){var t=da(s,2);const i=t[0],n=t[1];ne(r,i)&&(Je(n)?e[i]=wa(n):n&&typeof n=="object"&&n.constructor===Object?e[i]=ae(n):e[i]=n)}return e}function ka(r){switch(typeof r){case"string":return r;case"number":return xa(r);case"boolean":return va(r);case"bigint":return Lr?Lr(r):"0";case"symbol":return Or?Or(r):"Symbol()";case"undefined":return ut(r);case"function":case"object":{if(r===null)return ut(r);const e=r,t=ce(e,"toString");if(typeof t=="function"){const s=t(e);return typeof s=="string"?s:ut(s)}return ut(r)}default:return ut(r)}}function ce(r,e){for(;r!==null;){const s=fa(r,e);if(s){if(s.get)return V(s.get);if(typeof s.value=="function")return V(s.value)}r=ha(r)}function t(){return null}return t}function Sa(r){try{return J(r,""),!0}catch{return!1}}const Nr=Y(["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"]),Os=Y(["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"]),Ns=Y(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),$a=Y(["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"]),Ds=Y(["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"]),Ia=Y(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Dr=Y(["#text"]),Mr=Y(["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"]),Ms=Y(["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"]),zr=Y(["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"]),Mt=Y(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ta=Z(/{{[\w\W]*|^[\w\W]*}}/g),Ra=Z(/<%[\w\W]*|^[\w\W]*%>/g),Ea=Z(/\${[\w\W]*/g),Ca=Z(/^data-[\-\w.\u00B7-\uFFFF]+$/),_a=Z(/^aria-[\-\w]+$/),jr=Z(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Aa=Z(/^(?:\w+script|data):/i),Pa=Z(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),La=Z(/^html$/i),Oa=Z(/^[a-z][.\w]*(-[.\w]+)+$/i),Fr=Z(/<[/\w!]/g),Br=Z(/<[/\w]/g),Na=Z(/<\/no(script|embed|frames)/i),Da=Z(/\/>/i),oe={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Sn=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Ma=Y(M({},Sn)),za=(function(){const r={};return Oe(Sn,e=>{r[e]=Z(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),Y(r)})(),ja=function(){return typeof window>"u"?null:window},Fa=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let s=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(s=t.getAttribute(i));const n="dompurify"+(s?"#"+s:"");try{return e.createPolicy(n,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+n+" could not be created."),null}},Ur=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Se=function(e,t,s,i){return ne(e,t)&&Je(e[t])?M(i.base?ae(i.base):{},e[t],i.transform):s},zs=function(e,t,s){const i=ne(e,t)?e[t]:void 0;return i&&typeof i=="object"?ae(i):s()};function $n(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ja();const e=y=>$n(y);if(e.version="3.4.14",e.removed=[],!r||!r.document||r.document.nodeType!==oe.document||!r.Element)return e.isSupported=!1,e;let t=r.document;const s=t,i=s.currentScript;r.DocumentFragment;const n=r.HTMLTemplateElement,o=r.Node,a=r.Element,l=r.NodeFilter,u=r.NamedNodeMap;u===void 0&&(r.NamedNodeMap||r.MozNamedAttrMap),r.HTMLFormElement;const d=r.DOMParser,p=r.trustedTypes,g=a.prototype,v=ce(g,"cloneNode"),k=ce(g,"remove"),_=ce(g,"nextSibling"),D=ce(g,"childNodes"),m=ce(g,"parentNode"),S=ce(g,"shadowRoot"),R=ce(g,"attributes"),C=o&&o.prototype?ce(o.prototype,"nodeType"):null,E=o&&o.prototype?ce(o.prototype,"nodeName"):null,b=o&&o.prototype?ce(o.prototype,"ownerDocument"):null,j=function(c){return C?C(c):c.nodeType},ve=function(c){return E?E(c):c.nodeName};if(typeof n=="function"){const y=t.createElement("template");y.content&&y.content.ownerDocument&&(t=y.content.ownerDocument)}let H,Re="",ls,_i=!1,rt=0;const Ai=function(){if(rt>0)throw Le('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.')},Fe=function(c){Ai(),rt++;try{return H.createHTML(c)}finally{rt--}},Dn=function(c){Ai(),rt++;try{return H.createScriptURL(c)}finally{rt--}},Mn=function(){return _i||(ls=Fa(p,i),_i=!0),ls},kt=t,cs=kt.implementation,Pi=kt.createNodeIterator,zn=kt.createDocumentFragment,jn=kt.getElementsByTagName,Fn=s.importNode;let B=Ur();e.isSupported=typeof wn=="function"&&typeof m=="function"&&cs&&cs.createHTMLDocument!==void 0;const Bn=Ta,Un=Ra,Gn=Ea,qn=Ca,Hn=_a,Wn=Aa,Li=Pa,Kn=Oa;let Oi=jr,U=null;const ds=M({},[...Nr,...Os,...Ns,...Ds,...Dr]);let G=null;const ps=M({},[...Mr,...Ms,...zr,...Mt]);let he=Object.seal(Ye(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}})),nt=null,Ni=null;const ye=Object.seal(Ye(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Di=!0,us=!0,Mi=!1,zi=!0,we=!1,Ee=!0,Ce=!1,hs=!1,St=null,$t=null,fs=!1,Be=!1,It=!1,Tt=!1,ji=!0,Fi=!1;const Bi="user-content-";let gs=!0,ms=!1,Ue={},Ge=null;const Ui=M({},["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"]);let Gi=null;const qi=M({},["audio","video","img","source","image","track"]);let Hi=null;const Wi=M({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Rt="http://www.w3.org/1998/Math/MathML",Et="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml";let qe=fe,bs=!1,xs=null;const Vn=M({},[Rt,Et,fe],Ls),Ki=Y(["mi","mo","mn","ms","mtext"]);let vs=M({},Ki);const Vi=Y(["annotation-xml"]);let ys=M({},Vi);const Qn=M({},["title","style","font","a","script"]);let ot=null;const Yn=["application/xhtml+xml","text/html"],Zn="text/html";let W=null,He=null;const Xn=t.createElement("form"),Qi=function(c){return c instanceof RegExp||c instanceof Function},ws=function(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(He&&He===c)return;(!c||typeof c!="object")&&(c={}),c=ae(c),ot=Yn.indexOf(c.PARSER_MEDIA_TYPE)===-1?Zn:c.PARSER_MEDIA_TYPE,W=ot==="application/xhtml+xml"?Ls:ft,U=Se(c,"ALLOWED_TAGS",ds,{transform:W}),G=Se(c,"ALLOWED_ATTR",ps,{transform:W}),xs=Se(c,"ALLOWED_NAMESPACES",Vn,{transform:Ls}),Hi=Se(c,"ADD_URI_SAFE_ATTR",Wi,{transform:W,base:Wi}),Gi=Se(c,"ADD_DATA_URI_TAGS",qi,{transform:W,base:qi}),Ge=Se(c,"FORBID_CONTENTS",Ui,{transform:W}),nt=Se(c,"FORBID_TAGS",ae({}),{transform:W}),Ni=Se(c,"FORBID_ATTR",ae({}),{transform:W}),Ue=ne(c,"USE_PROFILES")?c.USE_PROFILES&&typeof c.USE_PROFILES=="object"?ae(c.USE_PROFILES):c.USE_PROFILES:!1,Di=c.ALLOW_ARIA_ATTR!==!1,us=c.ALLOW_DATA_ATTR!==!1,Mi=c.ALLOW_UNKNOWN_PROTOCOLS||!1,zi=c.ALLOW_SELF_CLOSE_IN_ATTR!==!1,we=c.SAFE_FOR_TEMPLATES||!1,Ee=c.SAFE_FOR_XML!==!1,Ce=c.WHOLE_DOCUMENT||!1,Be=c.RETURN_DOM||!1,It=c.RETURN_DOM_FRAGMENT||!1,Tt=c.RETURN_TRUSTED_TYPE||!1,fs=c.FORCE_BODY||!1,ji=c.SANITIZE_DOM!==!1,Fi=c.SANITIZE_NAMED_PROPS||!1,gs=c.KEEP_CONTENT!==!1,ms=c.IN_PLACE||!1,Oi=Sa(c.ALLOWED_URI_REGEXP)?c.ALLOWED_URI_REGEXP:jr,qe=typeof c.NAMESPACE=="string"?c.NAMESPACE:fe,vs=zs(c,"MATHML_TEXT_INTEGRATION_POINTS",()=>M({},Ki)),ys=zs(c,"HTML_INTEGRATION_POINTS",()=>M({},Vi));const f=zs(c,"CUSTOM_ELEMENT_HANDLING",()=>Ye(null));if(he=Ye(null),ne(f,"tagNameCheck")&&Qi(f.tagNameCheck)&&(he.tagNameCheck=f.tagNameCheck),ne(f,"attributeNameCheck")&&Qi(f.attributeNameCheck)&&(he.attributeNameCheck=f.attributeNameCheck),ne(f,"allowCustomizedBuiltInElements")&&typeof f.allowCustomizedBuiltInElements=="boolean"&&(he.allowCustomizedBuiltInElements=f.allowCustomizedBuiltInElements),Z(he),we&&(us=!1),It&&(Be=!0),Ue&&(U=M({},Dr),G=Ye(null),Ue.html===!0&&(M(U,Nr),M(G,Mr)),Ue.svg===!0&&(M(U,Os),M(G,Ms),M(G,Mt)),Ue.svgFilters===!0&&(M(U,Ns),M(G,Ms),M(G,Mt)),Ue.mathMl===!0&&(M(U,Ds),M(G,zr),M(G,Mt))),ye.tagCheck=null,ye.attributeCheck=null,ne(c,"ADD_TAGS")&&(typeof c.ADD_TAGS=="function"?ye.tagCheck=c.ADD_TAGS:Je(c.ADD_TAGS)&&(U===ds&&(U=ae(U)),M(U,c.ADD_TAGS,W))),ne(c,"ADD_ATTR")&&(typeof c.ADD_ATTR=="function"?ye.attributeCheck=c.ADD_ATTR:Je(c.ADD_ATTR)&&(G===ps&&(G=ae(G)),M(G,c.ADD_ATTR,W))),ne(c,"ADD_FORBID_CONTENTS")&&Je(c.ADD_FORBID_CONTENTS)&&(Ge===Ui&&(Ge=ae(Ge)),M(Ge,c.ADD_FORBID_CONTENTS,W)),gs&&(U["#text"]=!0),Ce&&M(U,["html","head","body"]),U.table&&(M(U,["tbody"]),delete nt.tbody),c.TRUSTED_TYPES_POLICY){if(typeof c.TRUSTED_TYPES_POLICY.createHTML!="function")throw Le('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof c.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Le('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const x=H;H=c.TRUSTED_TYPES_POLICY;try{Re=Fe("")}catch($){throw H=x,$}}else c.TRUSTED_TYPES_POLICY===null?(H=void 0,Re=""):(H===void 0&&(H=Mn()),H&&typeof Re=="string"&&(Re=Fe("")));Y&&Y(c),He=c},Yi=M({},[...Os,...Ns,...$a]),Zi=M({},[...Ds,...Ia]),Jn=function(c,f,x){return f.namespaceURI===fe?c==="svg":f.namespaceURI===Rt?c==="svg"&&(x==="annotation-xml"||vs[x]):!!Yi[c]},eo=function(c,f,x){return f.namespaceURI===fe?c==="math":f.namespaceURI===Et?c==="math"&&ys[x]:!!Zi[c]},to=function(c,f,x){return f.namespaceURI===Et&&!ys[x]||f.namespaceURI===Rt&&!vs[x]?!1:!Zi[c]&&(Qn[c]||!Yi[c])},so=function(c){let f=m(c);(!f||!f.tagName)&&(f={namespaceURI:qe,tagName:"template"});const x=ft(c.tagName),$=ft(f.tagName);return xs[c.namespaceURI]?c.namespaceURI===Et?Jn(x,f,$):c.namespaceURI===Rt?eo(x,f,$):c.namespaceURI===fe?to(x,f,$):!!(ot==="application/xhtml+xml"&&xs[c.namespaceURI]):!1},ke=function(c){dt(e.removed,{element:c});try{m(c).removeChild(c)}catch{if(k(c),!m(c))throw Le("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Xi=function(c,f,x){try{c.removeAttributeNode(f)}catch{try{c.removeAttribute(x)}catch{}}},Ct=function(c){_t(c);const f=D(c);if(f){const $=[];Oe(f,T=>{dt($,T)}),Oe($,T=>{try{k(T)}catch{}})}const x=R(c);if(x)for(let $=x.length-1;$>=0;--$){const T=x[$],A=T&&T.name;typeof A=="string"&&Xi(c,T,A)}},_e=function(c,f,x){if(!x)try{x=f.getAttributeNode(c)}catch{x=null}dt(e.removed,{attribute:x||null,from:f});try{x?f.removeAttributeNode(x):f.removeAttribute(c)}catch{try{f.removeAttribute(c)}catch{}}if(c==="is")if(Be||It)try{ke(f)}catch{}else try{f.setAttribute(c,"")}catch{}},io=function(c){const f=R(c);if(f)for(let x=f.length-1;x>=0;--x){const $=f[x],T=$&&$.name;typeof T!="string"||G[W(T)]||Xi(c,$,T)}},_t=function(c){const f=[c];for(;f.length>0;){const x=f.pop();j(x)===oe.element&&io(x);const T=D(x);if(T)for(let A=T.length-1;A>=0;--A)f.push(T[A])}},Ji=function(c,f){return Ee?c==="patchsrc"?!0:c==="for"&&f!=="label"&&f!=="output":!1},ro=function(c){if(!Ee)return;const f=[c];for(;f.length>0;){const x=f.pop(),$=j(x);if($===oe.processingInstruction||$===oe.comment&&J(Br,x.data)){try{k(x)}catch{}continue}if($===oe.element){const A=x,F=W(ve(x));try{A.hasAttribute&&A.hasAttribute("patchsrc")&&A.removeAttribute("patchsrc"),A.hasAttribute&&A.hasAttribute("for")&&Ji("for",F)&&A.removeAttribute("for")}catch{}}const T=D(x);if(T)for(let A=T.length-1;A>=0;--A)f.push(T[A])}},er=function(c){let f=null,x=null;if(fs)c="<remove></remove>"+c;else{const A=Ar(c,/^[\r\n\t ]+/);x=A&&A[0]}ot==="application/xhtml+xml"&&qe===fe&&(c='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+c+"</body></html>");const $=H?Fe(c):c;if(qe===fe)try{f=new d().parseFromString($,ot)}catch{}if(!f||!f.documentElement){f=cs.createDocument(qe,"template",null);try{f.documentElement.innerHTML=bs?Re:$}catch{}}const T=f.body||f.documentElement;return c&&x&&T.insertBefore(t.createTextNode(x),T.childNodes[0]||null),qe===fe?jn.call(f,Ce?"html":"body")[0]:Ce?f.documentElement:T},tr=function(c){const f=b?b(c):c.ownerDocument;return Pi.call(f||c,c,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},At=function(c){return c=pt(c,Bn," "),c=pt(c,Un," "),c=pt(c,Gn," "),c},ks=function(c){var f;c.normalize();const x=b?b(c):c.ownerDocument,$=Pi.call(x||c,c,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let T=$.nextNode();for(;T;)T.data=At(T.data),T=$.nextNode();const A=(f=c.querySelectorAll)===null||f===void 0?void 0:f.call(c,"template");A&&Oe(A,F=>{We(F.content)&&ks(F.content)})},Pt=function(c){const f=E?E(c):null;return typeof f!="string"||W(f)!=="form"?!1:typeof c.nodeName!="string"||typeof c.textContent!="string"||typeof c.removeChild!="function"||c.attributes!==R(c)||typeof c.removeAttribute!="function"||typeof c.setAttribute!="function"||typeof c.namespaceURI!="string"||typeof c.insertBefore!="function"||typeof c.hasChildNodes!="function"||c.nodeType!==C(c)||c.childNodes!==D(c)},We=function(c){if(!C||typeof c!="object"||c===null)return!1;try{return C(c)===oe.documentFragment}catch{return!1}},at=function(c){if(!C||typeof c!="object"||c===null)return!1;try{return typeof C(c)=="number"}catch{return!1}};function ge(y,c,f){y.length!==0&&Oe(y,x=>{x.call(e,c,f,He)})}const no=function(c,f){return!!(Ee&&c.hasChildNodes()&&!at(c.firstElementChild)&&J(Fr,c.textContent)&&J(Fr,c.innerHTML)||Ee&&c.namespaceURI===fe&&Ma[f]&&(at(c.firstElementChild)||typeof c.textContent=="string"&&J(za[f],c.textContent))||c.nodeType===oe.processingInstruction||Ee&&c.nodeType===oe.comment&&J(Br,c.data))},Lt=function(c,f){if(c instanceof RegExp)return J(c,f);if(c instanceof Function){for(var x=arguments.length,$=new Array(x>2?x-2:0),T=2;T<x;T++)$[T-2]=arguments[T];return!!c(f,...$)}return!1},oo=function(c,f,x){if(!nt[f]&&or(f)&&Lt(he.tagNameCheck,f))return!1;if(gs&&!Ge[f]){const $=m(c),T=D(c);if(T&&$){const A=T.length;for(let F=A-1;F>=0;--F){const q=c===x?v(T[F],!0):T[F];$.insertBefore(q,_(c))}}}return ke(c),!0},sr=function(c,f,x,$){return c.length===0?f:f===x||f===$?ae(f):f},ir=function(c,f){return c===f||m(c)!==null?!1:(ms&&_t(c),!0)},rr=function(c,f){if(ge(B.beforeSanitizeElements,c,null),ir(c,f))return!0;if(Pt(c))return ke(c),!0;const x=W(ve(c));if(U=sr(B.uponSanitizeElement,U,ds,St),ge(B.uponSanitizeElement,c,{tagName:x,allowedTags:U}),ir(c,f))return!0;if(no(c,x))return ke(c),!0;if(nt[x]||!(ye.tagCheck instanceof Function&&ye.tagCheck(x))&&!U[x]){const T=oo(c,x,f);return T===!1&&ge(B.afterSanitizeElements,c,null),T}if(j(c)===oe.element&&!so(c)||(x==="noscript"||x==="noembed"||x==="noframes")&&J(Na,c.innerHTML))return ke(c),!0;if(we&&c.nodeType===oe.text){const T=At(c.textContent);c.textContent!==T&&(dt(e.removed,{element:c.cloneNode()}),c.textContent=T)}return ge(B.afterSanitizeElements,c,null),!1},nr=function(c,f,x){if(Ni[f]||Ji(f,c)||ji&&(f==="id"||f==="name")&&(x in t||x in Xn))return!1;const $=G[f]||ye.attributeCheck instanceof Function&&ye.attributeCheck(f,c);return us&&J(qn,f)||Di&&J(Hn,f)?!0:$?Hi[f]||J(Oi,pt(x,Li,""))||(f==="src"||f==="xlink:href"||f==="href")&&c!=="script"&&Pr(x,"data:")===0&&Gi[c]||Mi&&!J(Wn,pt(x,Li,""))?!0:!x:or(c)&&Lt(he.tagNameCheck,c)&&Lt(he.attributeNameCheck,f,c)||f==="is"&&he.allowCustomizedBuiltInElements&&Lt(he.tagNameCheck,x)},ao=M({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),or=function(c){return!ao[ft(c)]&&J(Kn,c)},lo=function(c,f,x,$){if(H&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!x)switch(p.getAttributeType(c,f)){case"TrustedHTML":return Fe($);case"TrustedScriptURL":return Dn($)}return $},co=function(c,f,x,$){try{x?c.setAttributeNS(x,f,$):c.setAttribute(f,$),Pt(c)?ke(c):_r(e.removed)}catch{_e(f,c)}},ar=function(c){ge(B.beforeSanitizeAttributes,c,null);const f=c.attributes;if(!f||Pt(c))return;G=sr(B.uponSanitizeAttribute,G,ps,$t);const x={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:G,forceKeepAttr:void 0};let $=f.length;const T=W(c.nodeName);for(;$--;){const A=f[$],F=A.name,q=A.namespaceURI,ie=A.value,re=W(F),$s=ie;let se=F==="value"?$s:ba($s);if(x.attrName=re,x.attrValue=se,x.keepAttr=!0,x.forceKeepAttr=void 0,ge(B.uponSanitizeAttribute,c,x),se=x.attrValue,Fi&&(re==="id"||re==="name")&&Pr(se,Bi)!==0&&(_e(F,c,A),se=Bi+se),Ee&&J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,se)){_e(F,c,A);continue}if(re==="attributename"&&Ar(se,"href")){_e(F,c,A);continue}if(!x.forceKeepAttr){if(!x.keepAttr){_e(F,c,A);continue}if(!zi&&J(Da,se)){_e(F,c,A);continue}if(we&&(se=At(se)),!nr(T,re,se)){_e(F,c,A);continue}se=lo(T,re,q,se),se!==$s&&co(c,F,q,se)}}ge(B.afterSanitizeAttributes,c,null)},Ot=function(c){let f=null;const x=tr(c);for(ge(B.beforeSanitizeShadowDOM,c,null);f=x.nextNode();)if(ge(B.uponSanitizeShadowNode,f,null),rr(f,c),ar(f),We(f.content)&&Ot(f.content),j(f)===oe.element){const $=S(f);We($)&&(Ss($),Ot($))}ge(B.afterSanitizeShadowDOM,c,null)},Ss=function(c){const f=[{node:c,shadow:null}];for(;f.length>0;){const x=f.pop();if(x.shadow){Ot(x.shadow);continue}const $=x.node,A=j($)===oe.element,F=D($);if(F)for(let q=F.length-1;q>=0;--q)f.push({node:F[q],shadow:null});if(A){const q=E?E($):null;if(typeof q=="string"&&W(q)==="template"){const ie=$.content;We(ie)&&f.push({node:ie,shadow:null})}}if(A){const q=S($);We(q)&&f.push({node:null,shadow:q},{node:q,shadow:null})}}};return e.sanitize=function(y){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=null,x=null,$=null,T=null;if(bs=!y,bs&&(y="<!-->"),typeof y!="string"&&!at(y)&&(y=ka(y),typeof y!="string"))throw Le("dirty is not a string, aborting");if(!e.isSupported)return y;hs?(U=St,G=$t):ws(c),(B.uponSanitizeElement.length>0||B.uponSanitizeAttribute.length>0)&&(U=ae(U)),B.uponSanitizeAttribute.length>0&&(G=ae(G)),e.removed=[];const A=ms&&typeof y!="string"&&at(y);if(A){ro(y);const ie=ve(y);if(typeof ie=="string"){const re=W(ie);if(!U[re]||nt[re])throw Ct(y),Le("root node is forbidden and cannot be sanitized in-place")}if(Pt(y))throw Ct(y),Le("root node is clobbered and cannot be sanitized in-place");try{Ss(y)}catch(re){throw Ct(y),re}}else if(at(y))f=er("<!---->"),x=f.ownerDocument.importNode(y,!0),x.nodeType===oe.element&&x.nodeName==="BODY"||x.nodeName==="HTML"?f=x:f.appendChild(x),Ss(x);else{if(!Be&&!we&&!Ce&&y.indexOf("<")===-1)return H&&Tt?Fe(y):y;if(f=er(y),!f)return Be?null:Tt?Re:""}f&&fs&&ke(f.firstChild);const F=A?y:f;try{const ie=tr(F);for(;$=ie.nextNode();)rr($,F),ar($),We($.content)&&Ot($.content)}catch(ie){throw A&&(Ct(y),Oe(e.removed,re=>{re.element&&_t(re.element)})),ie}if(A)return Oe(e.removed,ie=>{ie.element&&_t(ie.element)}),we&&ks(y),y;if(Be){if(we&&ks(f),It)for(T=zn.call(f.ownerDocument);f.firstChild;)T.appendChild(f.firstChild);else T=f;return(G.shadowroot||G.shadowrootmode)&&(T=Fn.call(s,T,!0)),T}let q=Ce?f.outerHTML:f.innerHTML;return Ce&&U["!doctype"]&&f.ownerDocument&&f.ownerDocument.doctype&&f.ownerDocument.doctype.name&&J(La,f.ownerDocument.doctype.name)&&(q="<!DOCTYPE "+f.ownerDocument.doctype.name+`>
718
- `+q),we&&(q=At(q)),H&&Tt?Fe(q):q},e.setConfig=function(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ws(y),hs=!0,St=U,$t=G},e.clearConfig=function(){He=null,hs=!1,St=null,$t=null,H=ls,Re=""},e.isValidAttribute=function(y,c,f){He||ws({});const x=W(y),$=W(c);return nr(x,$,f)},e.addHook=function(y,c){typeof c=="function"&&ne(B,y)&&dt(B[y],c)},e.removeHook=function(y,c){if(ne(B,y)){if(c!==void 0){const f=ga(B[y],c);return f===-1?void 0:ma(B[y],f,1)[0]}return _r(B[y])}},e.removeHooks=function(y){ne(B,y)&&(B[y]=[])},e.removeAllHooks=function(){B=Ur()},e}var In=$n();function yi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var je=yi();function Tn(r){je=r}var Ne={exec:()=>null};function Ke(r){let e=[];return t=>{let s=Math.max(0,Math.min(3,t-1)),i=e[s];return i||(i=r(s),e[s]=i),i}}function N(r,e=""){let t=typeof r=="string"?r:r.source,s={replace:(i,n)=>{let o=typeof n=="string"?n:n.source;return o=o.replace(te.caret,"$1"),t=t.replace(i,o),s},getRegex:()=>new RegExp(t,e)};return s}var Ba=((r="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+r)}catch{return!1}})(),te={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,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,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:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Ke(r=>new RegExp(`^ {0,${r}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Ke(r=>new RegExp(`^ {0,${r}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Ke(r=>new RegExp(`^ {0,${r}}(?:\`\`\`|~~~)`)),headingBeginRegex:Ke(r=>new RegExp(`^ {0,${r}}#`)),htmlBeginRegex:Ke(r=>new RegExp(`^ {0,${r}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Ke(r=>new RegExp(`^ {0,${r}}>`))},Ua=/^(?:[ \t]*(?:\n|$))+/,Ga=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,qa=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,yt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ha=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,wi=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Rn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,En=N(Rn).replace(/bull/g,wi).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(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Wa=N(Rn).replace(/bull/g,wi).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(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ki=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Ka=/^[^\n]+/,Si=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Va=N(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Si).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Qa=N(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,wi).getRegex(),as="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",$i=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ya=N("^ {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][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",$i).replace("tag",as).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Cn=r=>N(ki).replace("hr",yt).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",r).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",as).getRegex(),Za=Cn(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Xa=Cn(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Ja=N(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Xa).getRegex(),Ii={blockquote:Ja,code:Ga,def:Va,fences:qa,heading:Ha,hr:yt,html:Ya,lheading:En,list:Qa,newline:Ua,paragraph:Za,table:Ne,text:Ka},Gr=N("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",yt).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",as).getRegex(),el={...Ii,lheading:Wa,table:Gr,paragraph:N(ki).replace("hr",yt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Gr).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",as).getRegex()},tl={...Ii,html:N(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",$i).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:Ne,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:N(ki).replace("hr",yt).replace("heading",` *#{1,6} *[^
719
- ]`).replace("lheading",En).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},sl=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,il=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,_n=/^( {2,}|\\)\n(?!\s*$)/,rl=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,xe=/[\p{P}\p{S}]/u,it=/[\s\p{P}\p{S}]/u,wt=/[^\s\p{P}\p{S}]/u,nl=N(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,it).getRegex(),ol=/[\p{Pi}\p{Ps}"']/u,An=/(?!~)[\p{P}\p{S}]/u,al=/(?!~)[\s\p{P}\p{S}]/u,ll=/(?:[^\s\p{P}\p{S}]|~)/u,cl=N(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ba?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Pn=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,dl=N(Pn,"u").replace(/punct/g,xe).getRegex(),pl=N(Pn,"u").replace(/punct/g,An).getRegex(),ul=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,hl=N(ul,"u").replace(/openQuote/g,ol).replace(/punct/g,xe).getRegex(),Ln="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",fl=N(Ln,"gu").replace(/notPunctSpace/g,wt).replace(/punctSpace/g,it).replace(/punct/g,xe).getRegex(),gl=N(Ln,"gu").replace(/notPunctSpace/g,ll).replace(/punctSpace/g,al).replace(/punct/g,An).getRegex(),ml="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",bl=N(ml,"gu").replace(/notPunctSpace/g,wt).replace(/punctSpace/g,it).replace(/punct/g,xe).getRegex(),xl=N("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,wt).replace(/punctSpace/g,it).replace(/punct/g,xe).getRegex(),vl="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",yl=N(vl,"gu").replace(/notPunctSpace/g,wt).replace(/punctSpace/g,it).replace(/punct/g,xe).getRegex(),wl=N(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,xe).getRegex(),kl="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Sl=N(kl,"gu").replace(/notPunctSpace/g,wt).replace(/punctSpace/g,it).replace(/punct/g,xe).getRegex(),$l=N(/\\(punct)/,"gu").replace(/punct/g,xe).getRegex(),Il=N(/^<(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(),Tl=N($i).replace("(?:-->|$)","-->").getRegex(),Rl=N("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Tl).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),qt=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,El=N(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",qt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),On=N(/^!?\[(label)\]\[(ref)\]/).replace("label",qt).replace("ref",Si).getRegex(),Nn=N(/^!?\[(ref)\](?:\[\])?/).replace("ref",Si).getRegex(),Cl=N("reflink|nolink(?!\\()","g").replace("reflink",On).replace("nolink",Nn).getRegex(),qr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ti={_backpedal:Ne,anyPunctuation:$l,autolink:Il,blockSkip:cl,br:_n,code:il,del:Ne,delLDelim:Ne,delRDelim:Ne,emStrongLDelim:dl,emStrongRDelimAst:fl,emStrongRDelimUnd:xl,escape:sl,link:El,nolink:Nn,punctuation:nl,reflink:On,reflinkSearch:Cl,tag:Rl,text:rl,url:Ne},_l={...Ti,emStrongLDelim:hl,emStrongRDelimAst:bl,emStrongRDelimUnd:yl,link:N(/^!?\[(label)\]\((.*?)\)/).replace("label",qt).getRegex(),reflink:N(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",qt).getRegex()},Js={...Ti,emStrongRDelimAst:gl,emStrongLDelim:pl,delLDelim:wl,delRDelim:Sl,url:N(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",qr).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:N(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",qr).getRegex()},Al={...Js,br:N(_n).replace("{2,}","*").getRegex(),text:N(Js.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},zt={normal:Ii,gfm:el,pedantic:tl},ht={normal:Ti,gfm:Js,breaks:Al,pedantic:_l},Pl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Hr=r=>Pl[r];function me(r,e){if(e){if(te.escapeTest.test(r))return r.replace(te.escapeReplace,Hr)}else if(te.escapeTestNoEncode.test(r))return r.replace(te.escapeReplaceNoEncode,Hr);return r}function Wr(r){try{r=encodeURI(r).replace(te.percentDecode,"%")}catch{return null}return r}function Kr(r,e){let t=r.replace(te.findPipe,(n,o,a)=>{let l=!1,u=o;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),s=t.split(te.splitPipe),i=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;i<s.length;i++)s[i]=s[i].trim().replace(te.slashPipe,"|");return s}function $e(r,e,t){let s=r.length;if(s===0)return"";let i=0;for(;i<s&&r.charAt(s-i-1)===e;)i++;return r.slice(0,s-i)}function Vr(r){let e=r.split(`
720
- `),t=e.length-1;for(;t>=0&&te.blankLine.test(e[t]);)t--;return e.length-t<=2?r:e.slice(0,t+1).join(`
721
- `)}function Ll(r,e){if(r.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<r.length;s++)if(r[s]==="\\")s++;else if(r[s]===e[0])t++;else if(r[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function Ol(r,e=0){let t=e,s="";for(let i of r)if(i===" "){let n=4-t%4;s+=" ".repeat(n),t+=n}else s+=i,t++;return s}function Qr(r,e,t,s,i){let n=e.href,o=e.title||null,a=r[1].replace(i.other.outputLinkReplace,"$1"),l=r[0].charAt(0)==="!";s.state.inLink=!0;let u=s.state.linkEmitted,d=s.state.inRawBlock;s.state.linkEmitted=!1;let p=s.inlineTokens(a),g=s.state.linkEmitted;if(s.state.linkEmitted=u,s.state.inLink=!1,!l){if(g){s.state.inRawBlock=d;return}s.state.linkEmitted=!0}return{type:l?"image":"link",raw:t,href:n,title:o,text:a,tokens:p}}function Nl(r,e,t){let s=r.match(t.other.indentCodeCompensation);if(s===null)return e;let i=s[1];return e.split(`
722
- `).map(n=>{let o=n.match(t.other.beginningSpace);if(o===null)return n;let[a]=o;return a.length>=i.length?n.slice(i.length):n}).join(`
723
- `)}var Ht=class{options;rules;lexer;constructor(r){this.options=r||je}space(r){let e=this.rules.block.newline.exec(r);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(r){let e=this.rules.block.code.exec(r);if(e){let t=this.options.pedantic?e[0]:Vr(e[0]),s=t.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t,codeBlockStyle:"indented",text:s}}}fences(r){let e=this.rules.block.fences.exec(r);if(e){let t=e[0],s=Nl(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(r){let e=this.rules.block.heading.exec(r);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=$e(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(t=s.trim())}return{type:"heading",raw:$e(e[0],`
724
- `),depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(r){let e=this.rules.block.hr.exec(r);if(e)return{type:"hr",raw:$e(e[0],`
725
- `)}}blockquote(r){let e=this.rules.block.blockquote.exec(r);if(e){let t=$e(e[0],`
726
- `).split(`
727
- `),s="",i="",n=[];for(;t.length>0;){let o=!1,a=[],l;for(l=0;l<t.length;l++)if(this.rules.other.blockquoteStart.test(t[l]))a.push(t[l]),o=!0;else if(!o)a.push(t[l]);else break;t=t.slice(l);let u=a.join(`
728
- `),d=u.replace(this.rules.other.blockquoteSetextReplace,`
729
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
730
- ${u}`:u,i=i?`${i}
731
- ${d}`:d;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,n,!0),this.lexer.state.top=p,t.length===0)break;let g=n.at(-1);if(g?.type==="code")break;if(g?.type==="blockquote"){let v=g,k=t.join(`
732
- `),_=v.raw+`
733
- `+k.replace(this.rules.other.blockquoteSetextReplace2,""),D=this.blockquote(_);n[n.length-1]=D,s=`${s}
734
- ${k}`,i=i.substring(0,i.length-v.text.length)+D.text;break}else if(g?.type==="list"){let v=g,k=v.raw+`
735
- `+t.join(`
736
- `),_=this.list(k);n[n.length-1]=_,s=s.substring(0,s.length-g.raw.length)+_.raw,i=i.substring(0,i.length-v.raw.length)+_.raw,t=k.substring(n.at(-1).raw.length).split(`
737
- `);continue}}return{type:"blockquote",raw:s,tokens:n,text:i}}}list(r){let e=this.rules.block.list.exec(r);if(e){let t=e[1].trim(),s=t.length>1,i={type:"list",raw:"",ordered:s,start:s?+t.slice(0,-1):"",loose:!1,items:[]};t=s?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=s?t:"[*+-]");let n=this.rules.other.listItemRegex(t),o=!1;for(;r;){let l=!1,u="",d="";if(!(e=n.exec(r))||this.rules.block.hr.test(r))break;u=e[0],r=r.substring(u.length);let p=Ol(e[2].split(`
738
- `,1)[0],e[1].length),g=r.split(`
739
- `,1)[0],v=!p.trim(),k=0;if(this.options.pedantic?(k=2,d=p.trimStart()):v?k=e[1].length+1:(k=p.search(this.rules.other.nonSpaceChar),k=k>4?1:k,d=p.slice(k),k+=e[1].length),v&&this.rules.other.blankLine.test(g)&&(u+=g+`
740
- `,r=r.substring(g.length+1),l=!0),!l){let _=this.rules.other.nextBulletRegex(k),D=this.rules.other.hrRegex(k),m=this.rules.other.fencesBeginRegex(k),S=this.rules.other.headingBeginRegex(k),R=this.rules.other.htmlBeginRegex(k),C=this.rules.other.blockquoteBeginRegex(k);for(;r;){let E=r.split(`
741
- `,1)[0],b;if(g=E,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),b=g):b=g.replace(this.rules.other.tabCharGlobal," "),m.test(g)||S.test(g)||R.test(g)||C.test(g)||_.test(g)||D.test(g))break;if(b.search(this.rules.other.nonSpaceChar)>=k||!g.trim())d+=`
742
- `+b.slice(k);else{if(v||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||m.test(p)||S.test(p)||D.test(p))break;d+=`
743
- `+g}v=!g.trim(),u+=E+`
744
- `,r=r.substring(E.length+1),p=b.slice(k)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(o=!0)),i.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),i.raw+=u}let a=i.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l of i.items)if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),!i.loose){let u=l.tokens.filter(p=>p.type==="space"),d=u.length>0&&u.some(p=>this.rules.other.anyLine.test(p.raw));i.loose=d}for(let l of i.items){let u=l.tokens[0];if(l.task&&(u?.type==="text"||u?.type==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),u.raw=u.raw.replace(this.rules.other.listReplaceTask,""),u.text=u.text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}let d=this.rules.other.listTaskCheckbox.exec(l.raw);if(d){let p={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};l.checked=p.checked,i.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=p.raw+l.tokens[0].raw,l.tokens[0].text=p.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(p)):l.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):l.tokens.unshift(p)}}else l.task&&(l.task=!1)}if(i.loose)for(let l of i.items){l.loose=!0;for(let u of l.tokens)u.type==="text"&&(u.type="paragraph")}return i}}html(r){let e=this.rules.block.html.exec(r);if(e){let t=Vr(e[0]);return{type:"html",block:!0,raw:t,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:t}}}def(r){let e=this.rules.block.def.exec(r);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:$e(e[0],`
745
- `),href:s,title:i}}}table(r){let e=this.rules.block.table.exec(r);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=Kr(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
746
- `):[],n={type:"table",raw:$e(e[0],`
747
- `),header:[],align:[],rows:[]};if(t.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?n.align.push("right"):this.rules.other.tableAlignCenter.test(o)?n.align.push("center"):this.rules.other.tableAlignLeft.test(o)?n.align.push("left"):n.align.push(null);for(let o=0;o<t.length;o++)n.header.push({text:t[o],tokens:this.lexer.inline(t[o]),header:!0,align:n.align[o]});for(let o of i)n.rows.push(Kr(o,n.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:n.align[l]})));return n}}lheading(r){let e=this.rules.block.lheading.exec(r);if(e){let t=e[1].trim();return{type:"heading",raw:$e(e[0],`
748
- `),depth:e[2].charAt(0)==="="?1:2,text:t,tokens:this.lexer.inline(t)}}}paragraph(r){let e=this.rules.block.paragraph.exec(r);if(e){let t=e[1].charAt(e[1].length-1)===`
749
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(r){let e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){let e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){let e=this.rules.inline.tag.exec(r);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(r){let e=this.rules.inline.link.exec(r);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let n=$e(t.slice(0,-1),"\\");if((t.length-n.length)%2===0)return}else{let n=Ll(e[2],"()");if(n===-2)return;if(n>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+n;e[2]=e[2].substring(0,n),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let s=e[2],i="";if(this.options.pedantic){let n=this.rules.other.pedanticHrefTitle.exec(s);n&&(s=n[1],i=n[3])}else i=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?s=s.slice(1):s=s.slice(1,-1)),Qr(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(r,e){let t;if((t=this.rules.inline.reflink.exec(r))||(t=this.rules.inline.nolink.exec(r))){let s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[s.toLowerCase()];if(!i){let n=t[0].charAt(0);return{type:"text",raw:n,text:n}}return Qr(t,i,t[0],this.lexer,this.rules)}}emStrong(r,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(r);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!t||this.rules.inline.punctuation.exec(t))){let i=[...s[0]].length-1,n,o,a=i,l=0,u=s[0][0],d=t===u,p=u==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*r.length+i);(s=p.exec(e))!==null;){if(n=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!n)continue;if(o=[...n].length,s[3]||s[4]){a+=o;continue}else if(s[5]||s[6]){if(i%3&&!((i+o)%3)){l+=o;continue}if(d)break}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let g=[...s[0]][0].length,v=r.slice(0,i+s.index+g+o);if(Math.min(i,o)%2){let _=v.slice(1,-1);return{type:"em",raw:v,text:_,tokens:this.lexer.inlineTokens(_)}}let k=v.slice(2,-2);return{type:"strong",raw:v,text:k,tokens:this.lexer.inlineTokens(k)}}}}codespan(r){let e=this.rules.inline.code.exec(r);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(t),i=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&i&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(r){let e=this.rules.inline.br.exec(r);if(e)return{type:"br",raw:e[0]}}del(r,e,t=""){let s=this.rules.inline.delLDelim.exec(r);if(s&&(!s[1]||!t||this.rules.inline.punctuation.exec(t))){let i=[...s[0]].length-1,n,o,a=i,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*r.length+i);(s=l.exec(e))!==null;){if(n=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!n||(o=[...n].length,o!==i))continue;if(s[3]||s[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let u=[...s[0]][0].length,d=r.slice(0,i+s.index+u+o),p=d.slice(i,-i);return{type:"del",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}}}autolink(r){let e=this.rules.inline.autolink.exec(r);if(e){let t,s;return e[2]==="@"?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}url(r){let e;if(e=this.rules.inline.url.exec(r)){let t,s;if(e[2]==="@")t=e[0],s="mailto:"+t;else{let i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==e[0]);t=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(r){let e=this.rules.inline.text.exec(r);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},de=class ei{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||je,this.options.tokenizer=this.options.tokenizer||new Ht,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 t={other:te,block:zt.normal,inline:ht.normal};this.options.pedantic?(t.block=zt.pedantic,t.inline=ht.pedantic):this.options.gfm&&(t.block=zt.gfm,this.options.breaks?t.inline=ht.breaks:t.inline=ht.gfm),this.tokenizer.rules=t}static get rules(){return{block:zt,inline:ht}}static lex(e,t){return new ei(t).lex(e)}static lexInline(e,t){return new ei(t).inlineTokens(e)}lex(e){e=e.replace(te.carriageReturn,`
750
- `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(te.tabCharGlobal," ").replace(te.spaceLine,""));let i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let n;if(this.options.extensions?.block?.some(a=>(n=a.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let a=t.at(-1);n.raw.length===1&&a!==void 0?a.raw+=`
751
- `:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let a=t.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
752
- `)?"":`
753
- `)+n.raw,a.text+=`
754
- `+n.text,this.inlineQueue.at(-1).src=a.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length);let a=t.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
755
- `)?"":`
756
- `)+n.raw,a.text+=`
757
- `+n.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},t.push(n));continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}let o=e;if(this.options.extensions?.startBlock){let a=1/0,l=e.slice(1),u;this.options.extensions.startBlock.forEach(d=>{u=d.call({lexer:this},l),typeof u=="number"&&u>=0&&(a=Math.min(a,u))}),a<1/0&&a>=0&&(o=e.substring(0,a+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o))){let a=t.at(-1);s&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
758
- `)?"":`
759
- `)+n.raw,a.text+=`
760
- `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(n),s=o.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let a=t.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
761
- `)?"":`
762
- `)+n.raw,a.text+=`
763
- `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(n);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes("["))return!1;let t=this.tokenizer.rules.inline.link;for(let s of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(s[0])&&e.charAt(s.index-1)!=="!")return!0;for(let s of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let i=s[0],n=i.lastIndexOf("[");if(!(i.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,i.slice(n+1,-1)))&&!(n>1&&this.linkInText(i.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let s=e;if(this.tokens.links&&e.includes("[")){let a=this.tokenizer.rules.inline.reflinkSearch,l=u=>{let d=u.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,u.slice(d+1,-1)))return u;if(d>1&&u.charAt(0)!=="!"){let p=u.slice(1,d-1);if(this.linkInText(p))return"["+p.replace(a,l)+"]["+"a".repeat(u.length-d-2)+"]"}return"["+"a".repeat(u.length-2)+"]"};s=s.replace(a,l)}s=s.replace(this.tokenizer.rules.inline.anyPunctuation,a=>"+".repeat(a.length)),s=s.replace(this.tokenizer.rules.inline.blockSkip,(a,l,u)=>{let d=u?u.length:0;return a.slice(0,d)+"["+"a".repeat(a.length-d-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,n="",o=1/0;for(;e;){if(e.length<o)o=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}i||(n=""),i=!1;let a;if(this.options.extensions?.inline?.some(u=>(a=u.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let u=t.at(-1);a.type==="text"&&u?.type==="text"?(u.raw+=a.raw,u.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,s,n)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e,s,n)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let l=e;if(this.options.extensions?.startInline){let u=1/0,d=e.slice(1),p;this.options.extensions.startInline.forEach(g=>{p=g.call({lexer:this},d),typeof p=="number"&&p>=0&&(u=Math.min(u,p))}),u<1/0&&u>=0&&(l=e.substring(0,u+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(n=a.raw.slice(-1)),i=!0;let u=t.at(-1);u?.type==="text"?(u.raw+=a.raw,u.text+=a.text):t.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(this.options.silent)console.error(t);else throw new Error(t)}},Wt=class{options;parser;constructor(r){this.options=r||je}space(r){return""}code({text:r,lang:e,escaped:t}){let s=(e||"").match(te.notSpaceStart)?.[0],i=r.replace(te.endingNewline,"")+`
764
- `;return s?'<pre><code class="language-'+me(s)+'">'+(t?i:me(i,!0))+`</code></pre>
765
- `:"<pre><code>"+(t?i:me(i,!0))+`</code></pre>
766
- `}blockquote({tokens:r}){return`<blockquote>
767
- ${this.parser.parse(r)}</blockquote>
768
- `}html({text:r}){return r}def(r){return""}heading({tokens:r,depth:e}){return`<h${e}>${this.parser.parseInline(r)}</h${e}>
769
- `}hr(r){return`<hr>
770
- `}list(r){let e=r.ordered,t=r.start,s="";for(let o=0;o<r.items.length;o++){let a=r.items[o];s+=this.listitem(a)}let i=e?"ol":"ul",n=e&&t!==1?' start="'+t+'"':"";return"<"+i+n+`>
771
- `+s+"</"+i+`>
772
- `}listitem(r){return`<li>${this.parser.parse(r.tokens)}</li>
773
- `}checkbox({checked:r}){return"<input "+(r?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:r}){return`<p>${this.parser.parseInline(r)}</p>
774
- `}table(r){let e="",t="";for(let i=0;i<r.header.length;i++)t+=this.tablecell(r.header[i]);e+=this.tablerow({text:t});let s="";for(let i=0;i<r.rows.length;i++){let n=r.rows[i];t="";for(let o=0;o<n.length;o++)t+=this.tablecell(n[o]);s+=this.tablerow({text:t})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
775
- <thead>
776
- `+e+`</thead>
777
- `+s+`</table>
778
- `}tablerow({text:r}){return`<tr>
779
- ${r}</tr>
780
- `}tablecell(r){let e=this.parser.parseInline(r.tokens),t=r.header?"th":"td";return(r.align?`<${t} align="${r.align}">`:`<${t}>`)+e+`</${t}>
781
- `}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${me(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:e,tokens:t}){let s=this.parser.parseInline(t),i=Wr(r);if(i===null)return s;r=i;let n='<a href="'+r+'"';return e&&(n+=' title="'+me(e)+'"'),n+=">"+s+"</a>",n}image({href:r,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let i=Wr(r);if(i===null)return me(t);r=i;let n=`<img src="${r}" alt="${me(t)}"`;return e&&(n+=` title="${me(e)}"`),n+=">",n}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:me(r.text)}},Ri=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}checkbox({raw:r}){return r}},pe=class ti{options;renderer;textRenderer;constructor(e){this.options=e||je,this.options.renderer=this.options.renderer||new Wt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ri}static parse(e,t){return new ti(t).parse(e)}static parseInline(e,t){return new ti(t).parseInline(e)}parse(e){this.renderer.parser=this;let t="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let o=i,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(o.type)){t+=a||"";continue}}let n=i;switch(n.type){case"space":{t+=this.renderer.space(n);break}case"hr":{t+=this.renderer.hr(n);break}case"heading":{t+=this.renderer.heading(n);break}case"code":{t+=this.renderer.code(n);break}case"table":{t+=this.renderer.table(n);break}case"blockquote":{t+=this.renderer.blockquote(n);break}case"list":{t+=this.renderer.list(n);break}case"checkbox":{t+=this.renderer.checkbox(n);break}case"html":{t+=this.renderer.html(n);break}case"def":{t+=this.renderer.def(n);break}case"paragraph":{t+=this.renderer.paragraph(n);break}case"text":{t+=this.renderer.text(n);break}default:{let o='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let s="";for(let i=0;i<e.length;i++){let n=e[i];if(this.options.extensions?.renderers?.[n.type]){let a=this.options.extensions.renderers[n.type].call({parser:this},n);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(n.type)){s+=a||"";continue}}let o=n;switch(o.type){case"escape":{s+=t.text(o);break}case"html":{s+=t.html(o);break}case"link":{s+=t.link(o);break}case"image":{s+=t.image(o);break}case"checkbox":{s+=t.checkbox(o);break}case"strong":{s+=t.strong(o);break}case"em":{s+=t.em(o);break}case"codespan":{s+=t.codespan(o);break}case"br":{s+=t.br(o);break}case"del":{s+=t.del(o);break}case"text":{s+=t.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},gt=class{options;block;constructor(r){this.options=r||je}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}emStrongMask(r){return r}provideLexer(r=this.block){return r?de.lex:de.lexInline}provideParser(r=this.block){return r?pe.parse:pe.parseInline}},Dl=class{defaults=yi();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=pe;Renderer=Wt;TextRenderer=Ri;Lexer=de;Tokenizer=Ht;Hooks=gt;constructor(...r){this.use(...r)}walkTokens(r,e){let t=[];for(let s of r)switch(t=t.concat(e.call(this,s)),s.type){case"table":{let i=s;for(let n of i.header)t=t.concat(this.walkTokens(n.tokens,e));for(let n of i.rows)for(let o of n)t=t.concat(this.walkTokens(o.tokens,e));break}case"list":{let i=s;t=t.concat(this.walkTokens(i.items,e));break}default:{let i=s;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(n=>{let o=i[n].flat(1/0);t=t.concat(this.walkTokens(o,e))}):i.tokens&&(t=t.concat(this.walkTokens(i.tokens,e)))}}return t}use(...r){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(t=>{let s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let n=e.renderers[i.name];n?e.renderers[i.name]=function(...o){let a=i.renderer.apply(this,o);return a===!1&&(a=n.apply(this,o)),a}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let n=e[i.level];n?n.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),s.extensions=e),t.renderer){let i=this.defaults.renderer||new Wt(this.defaults);for(let n in t.renderer){if(!(n in i))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let o=n,a=t.renderer[o],l=i[o];i[o]=(...u)=>{let d=a.apply(i,u);return d===!1&&(d=l.apply(i,u)),d||""}}s.renderer=i}if(t.tokenizer){let i=this.defaults.tokenizer||new Ht(this.defaults);for(let n in t.tokenizer){if(!(n in i))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let o=n,a=t.tokenizer[o],l=i[o];i[o]=(...u)=>{let d=a.apply(i,u);return d===!1&&(d=l.apply(i,u)),d}}s.tokenizer=i}if(t.hooks){let i=this.defaults.hooks||new gt;for(let n in t.hooks){if(!(n in i))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let o=n,a=t.hooks[o],l=i[o];gt.passThroughHooks.has(n)?i[o]=u=>{if(this.defaults.async&&gt.passThroughHooksRespectAsync.has(n))return(async()=>{let p=await a.call(i,u);return l.call(i,p)})();let d=a.call(i,u);return l.call(i,d)}:i[o]=(...u)=>{if(this.defaults.async)return(async()=>{let p=await a.apply(i,u);return p===!1&&(p=await l.apply(i,u)),p})();let d=a.apply(i,u);return d===!1&&(d=l.apply(i,u)),d}}s.hooks=i}if(t.walkTokens){let i=this.defaults.walkTokens,n=t.walkTokens;s.walkTokens=function(o){let a=[];return a.push(n.call(this,o)),i&&(a=a.concat(i.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,e){return de.lex(r,e??this.defaults)}parser(r,e){return pe.parse(r,e??this.defaults)}parseMarkdown(r){return(e,t)=>{let s={...t},i={...this.defaults,...s},n=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return n(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 n(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return n(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=r),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(e):e,a=await(i.hooks?await i.hooks.provideLexer(r):r?de.lex:de.lexInline)(o,i),l=i.hooks?await i.hooks.processAllTokens(a):a;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let u=await(i.hooks?await i.hooks.provideParser(r):r?pe.parse:pe.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(u):u})().catch(n);try{i.hooks&&(e=i.hooks.preprocess(e));let o=(i.hooks?i.hooks.provideLexer(r):r?de.lex:de.lexInline)(e,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let a=(i.hooks?i.hooks.provideParser(r):r?pe.parse:pe.parseInline)(o,i);return i.hooks&&(a=i.hooks.postprocess(a)),a}catch(o){return n(o)}}}onError(r,e){return t=>{if(t.message+=`
782
- Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error occurred:</p><pre>"+me(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},ze=new Dl;function z(r,e){return ze.parse(r,e)}z.options=z.setOptions=function(r){return ze.setOptions(r),z.defaults=ze.defaults,Tn(z.defaults),z};z.getDefaults=yi;z.defaults=je;function Ml(...r){return ze.use(...r),z.defaults=ze.defaults,Tn(z.defaults),z}z.use=Ml;z.walkTokens=function(r,e){return ze.walkTokens(r,e)};z.parseInline=ze.parseInline;z.Parser=pe;z.parser=pe.parse;z.Renderer=Wt;z.TextRenderer=Ri;z.Lexer=de;z.lexer=de.lex;z.Tokenizer=Ht;z.Hooks=gt;z.parse=z;z.options;z.setOptions;z.walkTokens;z.parseInline;pe.parse;de.lex;const Vt=class Vt extends le{constructor(){super(...arguments),this.active=!1,this.crossLink=!1,this.record=null,this.reference="",this.statusTone="neutral",this.onOpen=()=>{this.record&&this.dispatchEvent(new CustomEvent("record-open",{bubbles:!0,composed:!0,detail:{crossLink:this.crossLink,record:this.record}}))}}render(){const e=this.record;return e?h`
783
- <button
784
- aria-label=${`Open ${this.reference} ${e.title}`}
785
- class=${Q({active:this.active,line:!0})}
786
- @click=${this.onOpen}
787
- >
788
- <span class="idtag">${this.reference}</span>
789
- <span class="line-title">${e.title}</span>
790
- <span class=${`badge ${this.statusTone}`}>${e.status}</span>
791
- </button>
792
- `:h``}};Vt.properties={active:{type:Boolean},crossLink:{type:Boolean},record:{attribute:!1},reference:{type:String},statusTone:{type:String}},Vt.styles=ue`
793
- :host {
794
- display: block;
795
- }
796
- .line {
797
- display: flex;
798
- gap: 10px;
799
- align-items: center;
800
- width: stretch;
801
- padding: 8px;
802
- border: 0;
803
- border-radius: 6px;
804
- background: transparent;
805
- cursor: pointer;
806
- text-align: left;
807
- }
808
- .line:hover,
809
- .line.active {
810
- background: var(--surface-muted);
811
- }
812
- .line.active {
813
- box-shadow: inset 3px 0 0 0 var(--accent);
814
- }
815
- .line-title {
816
- flex: 1;
817
- }
818
- .idtag {
819
- color: var(--muted);
820
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
821
- font-size: 12px;
822
- }
823
- .badge {
824
- padding: 2px 6px;
825
- border-radius: 999px;
826
- font-size: 11px;
827
- font-weight: 600;
828
- }
829
- `;let si=Vt;const Qt=class Qt extends le{constructor(){super(...arguments),this.countText="",this.query="",this.status="all",this.statuses=[],this.title="Records",this.treeTab=null,this.treeView="list",this.onQueryInput=e=>{this.dispatchEvent(new CustomEvent("record-query-change",{bubbles:!0,composed:!0,detail:{query:e.target.value}}))},this.onStatusChange=e=>{this.dispatchEvent(new CustomEvent("record-status-change",{bubbles:!0,composed:!0,detail:{status:e.target.value}}))},this.onSetView=e=>{const t=e.currentTarget.dataset.view;!t||!this.treeTab||this.dispatchEvent(new CustomEvent("record-view-change",{bubbles:!0,composed:!0,detail:{tab:this.treeTab,view:t}}))}}render(){const e=this.title.toLowerCase();return h`
830
- <div class="toolbar">
831
- <label class="filter">
832
- <span>Filter ${e}</span>
833
- <input
834
- placeholder=${`Filter ${e}`}
835
- type="search"
836
- .value=${this.query}
837
- @input=${this.onQueryInput}
838
- >
839
- </label>
840
- <label class="filter">
841
- <span>Status</span>
842
- <select
843
- .value=${this.status}
844
- @change=${this.onStatusChange}
845
- >
846
- <option value="all">All statuses</option>
847
- ${this.statuses.map(t=>h`<option value=${t}>${t}</option>`)}
848
- </select>
849
- </label>
850
- ${w(this.treeTab!==null,()=>h`
851
- <div
852
- aria-label="Record view"
853
- class="view-toggle"
854
- role="group"
855
- >
856
- <button
857
- aria-pressed=${String(this.treeView==="list")}
858
- class=${Q({active:this.treeView==="list","view-button":!0})}
859
- data-view="list"
860
- @click=${this.onSetView}
861
- type="button"
862
- >
863
- List
864
- </button>
865
- <button
866
- aria-pressed=${String(this.treeView==="tree")}
867
- class=${Q({active:this.treeView==="tree","view-button":!0})}
868
- data-view="tree"
869
- @click=${this.onSetView}
870
- type="button"
871
- >
872
- Tree
873
- </button>
874
- </div>
875
- `,()=>h``)}
876
- <span class="count">${this.countText}</span>
877
- </div>
878
- `}};Qt.properties={countText:{type:String},query:{type:String},status:{type:String},statuses:{attribute:!1},title:{type:String},treeTab:{type:String},treeView:{type:String}},Qt.styles=ue`
879
- :host {
880
- display: block;
881
- }
882
- .toolbar {
883
- display: flex;
884
- gap: 12px;
885
- align-items: end;
886
- padding: 12px 16px;
887
- border-bottom: 1px solid var(--border-muted);
888
- }
889
- .filter {
890
- display: grid;
891
- gap: 4px;
892
- }
893
- .filter:first-child {
894
- flex: 1;
895
- }
896
- .filter > span {
897
- color: var(--muted);
898
- font-size: 12px;
899
- font-weight: 600;
900
- }
901
- .filter input,
902
- .filter select {
903
- box-sizing: border-box;
904
- min-height: 32px;
905
- padding: 6px 8px;
906
- border: 1px solid var(--border);
907
- border-radius: 6px;
908
- background: var(--surface);
909
- color: var(--text);
910
- font: inherit;
911
- }
912
- .view-toggle {
913
- display: inline-flex;
914
- align-self: end;
915
- overflow: hidden;
916
- border: 1px solid var(--border);
917
- border-radius: 6px;
918
- }
919
- .view-button {
920
- min-height: 32px;
921
- padding: 6px 10px;
922
- border: 0;
923
- border-right: 1px solid var(--border);
924
- background: var(--surface);
925
- color: var(--muted);
926
- cursor: pointer;
927
- font: inherit;
928
- }
929
- .view-button:last-child {
930
- border-right: 0;
931
- }
932
- .view-button.active {
933
- background: var(--surface-muted);
934
- color: var(--text);
935
- font-weight: 600;
936
- }
937
- .count {
938
- padding-bottom: 7px;
939
- color: var(--muted);
940
- font-size: 12px;
941
- white-space: nowrap;
942
- }
943
- @media (max-width: 640px) {
944
- .toolbar {
945
- align-items: stretch;
946
- flex-direction: column;
947
- }
948
- .count {
949
- padding-bottom: 0;
950
- }
951
- }
952
- `;let ii=Qt;customElements.define("agent-issues-record-list-item",si);customElements.define("agent-issues-record-filter-toolbar",ii);const zl={adr:"var(--graph-adr)",debt:"var(--graph-debt)",initiative:"var(--graph-initiative)",issue:"var(--graph-issue)",prd:"var(--success)",project:"var(--graph-project)",story:"var(--graph-story)"},Yr={blocked:"var(--danger)",done:"var(--done)"},Ve=184,Zr=34,js=244,Fs=28,Xr=56,Jr=58;function jl(r,e){return r.length>e?`${r.slice(0,e-1)}…`:r}const Yt=class Yt extends le{constructor(){super(...arguments),this.graph=null,this.themeObserver=null}connectedCallback(){super.connectedCallback(),this.themeObserver=new MutationObserver(()=>this.requestUpdate()),this.themeObserver.observe(document.documentElement,{attributeFilter:["data-theme"],attributes:!0})}disconnectedCallback(){this.themeObserver?.disconnect(),this.themeObserver=null,super.disconnectedCallback()}onNodeClick(e){this.dispatchEvent(new CustomEvent("node-open",{bubbles:!0,composed:!0,detail:{id:e.id,kind:e.kind}}))}nodeColor(e){return zl[e.kind]??"var(--muted)"}nodeStroke(e){return e.kind==="issue"&&e.status&&Yr[e.status]?Yr[e.status]:this.nodeColor(e)}render(){const e=this.graph;if(!e||e.nodes.length===0)return I;const t=new Map;for(const d of e.nodes){const p=t.get(d.col)??[];p.push(d),t.set(d.col,p)}const s=[...t.keys()].sort((d,p)=>d-p),i=Math.max(...e.nodes.map(d=>d.col))+1,n=Math.max(...s.map(d=>t.get(d)?.length??0)),o=Fs*2+(i-1)*js+Ve,a=Xr+n*Jr+24,l=new Map;for(const d of s)(t.get(d)??[]).forEach((g,v)=>{const k=Fs+d*js,_=Xr+v*Jr;l.set(g.key,{cx:k+Ve/2,cy:_+Zr/2,x:k,y:_})});const u=e.columns.map((d,p)=>({col:p,title:d})).filter(d=>t.has(d.col));return h`
953
- <svg
954
- width=${o}
955
- height=${a}
956
- viewBox=${`0 0 ${o} ${a}`}
957
- xmlns="http://www.w3.org/2000/svg"
958
- >
959
- ${P(u,d=>`head-${d.col}`,d=>Dt`<text
960
- class="ai-colhead"
961
- x=${Fs+d.col*js+Ve/2}
962
- y="28"
963
- text-anchor="middle"
964
- >${d.title}</text>`)}
965
- ${P(e.edges.filter(d=>l.has(d.from)&&l.has(d.to)),d=>`${d.from}->${d.to}`,d=>{const p=l.get(d.from),g=l.get(d.to),v=p.cx+Ve/2,k=p.cy,_=g.cx-Ve/2,D=g.cy;return Dt`
966
- <path
967
- class="ai-edge"
968
- d=${`M${v} ${k} C ${v+46} ${k}, ${_-46} ${D}, ${_} ${D}`}
969
- fill="none"
970
- stroke="var(--graph-edge)"
971
- stroke-width="1.5"
972
- />
973
- ${w(d.label,()=>Dt`<text
974
- class="ai-edge-label"
975
- x=${(v+_)/2}
976
- y=${(k+D)/2-5}
977
- text-anchor="middle"
978
- >${d.label}</text>`,()=>I)}
979
- `})}
980
- ${P(e.nodes,d=>d.key,d=>{const p=l.get(d.key),g=this.nodeColor(d),v=this.nodeStroke(d),k=d.kind!=="project";return Dt`<g
981
- class=${k?"ai-node":"ai-node ai-node-static"}
982
- data-id=${d.id}
983
- data-kind=${d.kind}
984
- style=${`cursor:${k?"pointer":"default"}`}
985
- @click=${k?()=>this.onNodeClick(d):I}
986
- >
987
- <title>${d.fullLabel||d.label}</title>
988
- <rect
989
- class="ai-node-rect"
990
- x=${p.x}
991
- y=${p.y}
992
- width=${Ve}
993
- height=${Zr}
994
- rx="9"
995
- fill="var(--surface)"
996
- stroke=${v}
997
- stroke-width="1.5"
998
- />
999
- <circle
1000
- cx=${p.x+15}
1001
- cy=${p.cy}
1002
- r="5"
1003
- fill=${g}
1004
- />
1005
- <text
1006
- class="ai-node-label"
1007
- x=${p.x+28}
1008
- y=${p.cy+4}
1009
- >${jl(d.label,21)}</text>
1010
- </g>`})}
1011
- </svg>
1012
- `}};Yt.properties={graph:{attribute:!1}},Yt.styles=ue`
1013
- :host {
1014
- display: block;
1015
- }
1016
- svg {
1017
- display: block;
1018
- }
1019
- .ai-node-label {
1020
- font: 600 12px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
1021
- fill: var(--text);
1022
- pointer-events: none;
1023
- }
1024
- .ai-colhead {
1025
- font: 700 11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
1026
- fill: var(--muted);
1027
- text-transform: uppercase;
1028
- letter-spacing: 0.05em;
1029
- }
1030
- .ai-edge-label {
1031
- font: 600 10px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
1032
- fill: var(--muted);
1033
- pointer-events: none;
1034
- }
1035
- .ai-node-rect {
1036
- transition: stroke-width 0.1s, filter 0.1s;
1037
- }
1038
- .ai-node:not(.ai-node-static):hover .ai-node-rect {
1039
- stroke-width: 3;
1040
- filter: drop-shadow(0 2px 6px var(--shadow));
1041
- }
1042
- `;let ri=Yt;customElements.define("agent-issues-relationship-graph",ri);const Fl=["initiatives","adrs","debt","graph","context"];function Bl(r){return typeof r=="string"&&Fl.includes(r)}const st=["project","epic","initiative","plan","prd","adr","story","issue","debt"],Ul={adr:{color:"var(--graph-adr)",label:"ADR"},debt:{color:"var(--graph-debt)",label:"Debt"},epic:{color:"var(--graph-epic)",label:"Epic"},initiative:{color:"var(--graph-initiative)",label:"Initiative"},issue:{color:"var(--graph-issue)",label:"Issue"},plan:{color:"var(--graph-adr)",label:"Plan"},prd:{color:"var(--success)",label:"PRD"},project:{color:"var(--graph-project)",label:"Project"},story:{color:"var(--graph-story)",label:"User story"}},Zt=class Zt extends le{constructor(){super(...arguments),this.kinds=[...st],this.visibleKinds=new Set(st),this.onToggleKind=e=>{const t=e.currentTarget.dataset.graphKind;t&&this.dispatchEvent(new CustomEvent("graph-kind-toggle",{bubbles:!0,composed:!0,detail:{kind:t}}))}}toAriaBoolean(e){return e?"true":"false"}render(){return h`
1043
- <div
1044
- aria-label="Filter graph records"
1045
- class="graph-kind-filters"
1046
- role="group"
1047
- >
1048
- ${P(this.kinds,e=>e,e=>{const t=Ul[e],s=this.visibleKinds.has(e);return h`
1049
- <button
1050
- aria-pressed=${this.toAriaBoolean(s)}
1051
- class=${Q({active:s,"graph-kind-chip":!0})}
1052
- data-graph-kind=${e}
1053
- @click=${this.onToggleKind}
1054
- >
1055
- <span
1056
- class="sw"
1057
- style=${`background-color:${t.color}`}
1058
- ></span>
1059
- ${t.label}
1060
- </button>
1061
- `})}
1062
- </div>
1063
- `}};Zt.properties={kinds:{attribute:!1},visibleKinds:{attribute:!1}},Zt.styles=ue`
1064
- :host {
1065
- display: contents;
1066
- }
1067
- .graph-kind-filters {
1068
- display: flex;
1069
- gap: 6px;
1070
- flex-wrap: wrap;
1071
- }
1072
- .graph-kind-chip {
1073
- display: inline-flex;
1074
- gap: 6px;
1075
- align-items: center;
1076
- padding: 5px 8px;
1077
- border: 1px solid var(--border);
1078
- border-radius: 6px;
1079
- background: var(--surface);
1080
- color: var(--muted);
1081
- cursor: pointer;
1082
- font: inherit;
1083
- font-size: 12px;
1084
- }
1085
- .graph-kind-chip.active {
1086
- border-color: var(--accent);
1087
- background: var(--accent-soft);
1088
- color: var(--text);
1089
- font-weight: 600;
1090
- }
1091
- .sw {
1092
- width: 10px;
1093
- height: 10px;
1094
- border-radius: 50%;
1095
- }
1096
- `;let ni=Zt;customElements.define("agent-issues-relationship-graph-filters",ni);function en(r){const e=z.parse(r,{async:!1});return In.sanitize(e)}const Bs=["initiative","plan","prd","adr","story","issue","debt"],Gl=[["issues","Issues"],["plans","Plans"],["prds","PRDs"],["adrs","ADRs"],["graph","Graph"],["context","Context"],["userStories","User stories"],["debt","Debt"]],Xt=class Xt extends ss(le){constructor(){super(...arguments),this.store=null,this.initiativeId=null,this.cascade=!1,this.activeChildId=null,this.collapsedIssueIds=new Set,this.collapsedOverviewSectionIds=new Set,this.recordQuery="",this.recordStatus="all",this.issueRecordView="list",this.userStoryRecordView="list",this.visibleGraphKinds=new Set(Bs),this.onSelectEntityClick=e=>{if(this.cascade){const t=e.currentTarget.dataset.id;t&&this.initiativeId&&this.store?.drillCascade(this.initiativeId,t);return}this.store?.selectEntityFromEvent(e)},this.onSetTab=e=>{const t=e.currentTarget.dataset.tab;t&&(this.recordQuery="",this.recordStatus="all",this.store?.setInitTab(t))},this.onContextQueryInput=e=>{this.recordQuery=e.target.value,this.requestUpdate()},this.onRecordQueryChange=e=>{this.recordQuery=e.detail.query,this.requestUpdate()},this.onRecordStatusChange=e=>{this.recordStatus=e.detail.status,this.requestUpdate()},this.onRecordViewChange=e=>{const{tab:t,view:s}=e.detail;t==="issues"?this.issueRecordView=s:this.userStoryRecordView=s,this.requestUpdate()},this.onRecordOpen=e=>{const t=e.detail.record;if(this.cascade&&this.initiativeId){this.store?.drillCascade(this.initiativeId,t.id);return}this.store?.selectEntity(t.id)},this.onNodeOpen=e=>{const t=e.detail.id;t&&this.store?.selectEntity(t)},this.onToggleGraphKind=e=>{const t=e.detail.kind;if(!t)return;const s=new Set(this.visibleGraphKinds);s.has(t)?s.delete(t):s.add(t),this.visibleGraphKinds=s,this.requestUpdate()},this.onToggleIssueBranch=e=>{e.stopPropagation();const t=e.currentTarget.dataset.id;t&&(this.collapsedIssueIds.has(t)?this.collapsedIssueIds.delete(t):this.collapsedIssueIds.add(t),this.requestUpdate())},this.onToggleOverviewSection=e=>{const t=e.currentTarget.dataset.sectionId;t&&(this.collapsedOverviewSectionIds.has(t)?this.collapsedOverviewSectionIds.delete(t):this.collapsedOverviewSectionIds.add(t),this.requestUpdate())}}activeBundle(){const e=this.store;return e?e.bundleForInitiativeId(this.initiativeId??e.selectedInitiativeId.get()):null}getTabButtonId(e){return`initiative-tab-${e}`}getTabPanelId(e){return`initiative-panel-${e}`}renderBodySourceNotice(){return h`
1097
- <div class="ai-body-source ai-body-source-generated">
1098
- <span class="ai-body-source-badge">Generated fallback</span>
1099
- <span class="ai-body-source-copy">Generated from tracker metadata because no authored body was present.</span>
1100
- </div>
1101
- `}renderIssueBranch(e,t=!0){const s=this.store;if(!s)return h``;const i=this.collapsedIssueIds.has(e.issue.id),n=`issue-children-${e.issue.id}`;return h`
1102
- <div class="issue-branch">
1103
- <div class="issue-branch-row">
1104
- ${w(e.children.length>0,()=>h`
1105
- <button
1106
- aria-controls=${n}
1107
- class="branch-toggle"
1108
- data-id=${e.issue.id}
1109
- aria-expanded=${String(!i)}
1110
- aria-label=${`${i?"Expand":"Collapse"} sub-issues for ${e.issue.title}`}
1111
- @click=${this.onToggleIssueBranch}
1112
- >
1113
- ${i?"+":"-"}
1114
- </button>
1115
- `,()=>w(t,()=>h`<span class="branch-spacer"></span>`,()=>I))}
1116
- <button
1117
- class=${`child issue-branch-head ${e.issue.id===this.activeChildId?"is-active-ref":""}`}
1118
- data-id=${e.issue.id}
1119
- @click=${this.onSelectEntityClick}
1120
- >
1121
- <span class="idtag">${s.shortRef(e.issue)}</span>
1122
- <span class=${`issue-dot ${s.issueStatusTone(e.issue.status)}`}></span>
1123
- <span class="child-title">${e.issue.title}</span>
1124
- <span class=${`badge ${s.badgeTone(e.issue.status)}`}>${e.issue.status}</span>
1125
- </button>
1126
- </div>
1127
- ${w(e.children.length>0&&!i,()=>h`
1128
- <div
1129
- class="issue-branch-children"
1130
- id=${n}
1131
- >
1132
- ${P(e.children,o=>o.issue.id,o=>this.renderIssueBranch(o))}
1133
- </div>
1134
- `,()=>I)}
1135
- </div>
1136
- `}renderOverviewSection(e,t,s,i={}){const n=this.collapsedOverviewSectionIds.has(e),o=i.sectionClassName?`sec ${i.sectionClassName}`:"sec";return h`
1137
- <section class=${o}>
1138
- <button
1139
- class="sec-toggle"
1140
- data-section-id=${e}
1141
- aria-expanded=${String(!n)}
1142
- @click=${this.onToggleOverviewSection}
1143
- >
1144
- <span class="sec-head">
1145
- <span class="sec-title">${t}</span>
1146
- ${w(!!i.count,()=>h`<span class="sec-count">${i.count}</span>`,()=>I)}
1147
- </span>
1148
- <span
1149
- class=${Q({collapsed:n,"sec-chevron":!0})}
1150
- aria-hidden="true"
1151
- >
1152
- >
1153
- </span>
1154
- </button>
1155
- ${w(!n,()=>s,()=>I)}
1156
- </section>
1157
- `}renderLine(e){const t=this.store;return t?h`
1158
- <agent-issues-record-list-item
1159
- .active=${e.id===this.activeChildId}
1160
- .record=${e}
1161
- .reference=${t.shortRef(e)}
1162
- .statusTone=${t.badgeTone(e.status)}
1163
- class=${Q({"is-active-ref":e.id===this.activeChildId,line:!0,"record-row":!0})}
1164
- data-id=${e.id}
1165
- @record-open=${this.onRecordOpen}
1166
- ></agent-issues-record-list-item>
1167
- `:I}getRecordView(e){return e==="issues"?this.issueRecordView:this.userStoryRecordView}relatedRecordsFor(e,t){const s=this.store,i=new Map,n=o=>{o.id!==e.id&&i.set(o.id,o)};for(const o of t.fixLinks)o.issue.id===e.id&&n(o.userStory),o.userStory.id===e.id&&n(o.issue);for(const o of t.subIssueLinks)o.issue.id===e.id&&n(o.parent),o.parent.id===e.id&&n(o.issue);for(const o of t.blockerLinks)o.source.id===e.id&&n(o.target),o.target.id===e.id&&n(o.source);for(const o of t.constrainsLinks)o.adr.id===e.id&&n(o.issue),o.issue.id===e.id&&n(o.adr);for(const o of[...s?.incomingRelationsFor(e.id)??[],...s?.outgoingRelationsFor(e.id)??[]]){const a=o.fromId===e.id?o.toId:o.fromId,l=s?.entityById.get().get(a);l&&n(l)}return[...i.values()]}recordSearchRank(e,t){const s=this.recordQuery.trim().toLowerCase();if(!s)return 0;const i=this.store,n=[...i?.incomingRelationsFor(e.id)??[],...i?.outgoingRelationsFor(e.id)??[]],{body:o,...a}=e;if(JSON.stringify(a).toLowerCase().includes(s))return 0;if(n.some(u=>JSON.stringify(u).toLowerCase().includes(s)))return 1;const l=this.relatedRecordsFor(e,t);return l.some(u=>{const{body:d,...p}=u;return JSON.stringify(p).toLowerCase().includes(s)})?1:(o??"").toLowerCase().includes(s)?2:l.some(u=>(u.body??"").toLowerCase().includes(s))?3:null}filterRecords(e,t){const s=[];for(const[i,n]of e.entries()){if(this.recordStatus!=="all"&&n.status!==this.recordStatus)continue;const o=this.recordSearchRank(n,t);o!==null&&s.push({index:i,rank:o,record:n})}return s.sort((i,n)=>i.rank-n.rank||i.index-n.index).map(({record:i})=>i)}filterIssueTree(e,t){return e.flatMap(s=>{const i=this.filterIssueTree(s.children,t);return!t.has(s.issue.id)&&i.length===0?[]:[{...s,children:i}]})}issueTreeForRecords(e,t){const s=this.store?.sortIssuesByExpectedCompletion(t,e)??t,i=new Map(s.map(u=>[u.id,u])),n=new Map(s.map((u,d)=>[u.id,d])),o=new Map,a=new Set;for(const u of e.subIssueLinks){const d=i.get(u.parent.id),p=i.get(u.issue.id);if(!d||!p)continue;const g=o.get(d.id)??[];g.push(p),o.set(d.id,g),a.add(p.id)}const l=(u,d)=>({children:(o.get(u.id)??[]).filter(p=>!d.has(p.id)).sort((p,g)=>n.get(p.id)-n.get(g.id)).map(p=>l(p,new Set([...d,p.id]))),issue:u});return s.filter(u=>!a.has(u.id)).map(u=>l(u,new Set([u.id])))}renderIssueTreeTab(e,t){const s=new Set(t.map(n=>n.id)),i=this.filterIssueTree(this.issueTreeForRecords(e,e.issues),s);return h`
1168
- <div class="record-tree issue-tree">
1169
- ${P(i,n=>n.issue.id,n=>this.renderIssueBranch(n,!1))}
1170
- </div>
1171
- `}renderUserStoryTreeTab(e,t){const s=new Set(t.map(n=>n.id)),i=new Set(this.filterRecords(e.issues,e).map(n=>n.id));return h`
1172
- <div class="record-tree">
1173
- ${e.userStories.flatMap(n=>{const o=this.filterIssueTree(this.store?.issueTreeForStory(e,n.id)??[],i);return!s.has(n.id)&&o.length===0?[]:h`
1174
- <div class="story-tree-block">
1175
- ${this.renderLine(n)}
1176
- ${w(o.length>0,()=>h`<div class="children issue-tree">${P(o,a=>a.issue.id,a=>this.renderIssueBranch(a))}</div>`,()=>I)}
1177
- </div>
1178
- `})}
1179
- </div>
1180
- `}renderRecordTab(e,t,s,i,n={}){const o=e==="Issues"?this.store?.sortIssuesByExpectedCompletion(t,i)??t:t,a=this.filterRecords(o,i),l=[...new Set(t.map(d=>d.status))].sort((d,p)=>d.localeCompare(p)),u=n.treeTab?this.getRecordView(n.treeTab)==="tree":!1;return h`
1181
- <section class="record-browser record-tab">
1182
- <agent-issues-record-filter-toolbar
1183
- .countText=${`${a.length} of ${t.length}`}
1184
- .query=${this.recordQuery}
1185
- .status=${this.recordStatus}
1186
- .statuses=${l}
1187
- .title=${e}
1188
- .treeTab=${n.treeTab??null}
1189
- .treeView=${n.treeTab?this.getRecordView(n.treeTab):"list"}
1190
- @record-query-change=${this.onRecordQueryChange}
1191
- @record-status-change=${this.onRecordStatusChange}
1192
- @record-view-change=${this.onRecordViewChange}
1193
- ></agent-issues-record-filter-toolbar>
1194
- <div class="record-browser-list record-tab-list">
1195
- ${w(t.length===0,()=>h`<div class="empty-children">${s}</div>`,()=>w(a.length>0,()=>w(u&&n.treeContent,()=>n.treeContent?.(a)??I,()=>P(a,d=>d.id,d=>this.renderLine(d))),()=>h`<div class="empty-children">No ${e.toLowerCase()} match this filter.</div>`))}
1196
- </div>
1197
- </section>
1198
- `}renderContextTab(e){const t=this.store?.getContextForInitiative(e.initiative.id)??null;if(!t)return h`
1199
- <section class="record-tab">
1200
- <div class="empty-children">No initiative context has been defined yet.</div>
1201
- </section>
1202
- `;const s=this.recordQuery.trim().toLowerCase(),i=JSON.stringify(t.context).toLowerCase(),n=t.terms.filter(a=>JSON.stringify(a).toLowerCase().includes(s)),o=!s||i.includes(s);return h`
1203
- <section class="record-tab">
1204
- <div class="context-tab-toolbar">
1205
- <label class="record-filter">
1206
- <span class="record-filter-label">Filter context</span>
1207
- <input
1208
- placeholder="Filter context"
1209
- type="search"
1210
- .value=${this.recordQuery}
1211
- @input=${this.onContextQueryInput}
1212
- >
1213
- </label>
1214
- <span class="context-count">${n.length} terms</span>
1215
- </div>
1216
- ${w(o||n.length>0,()=>h`
1217
- <div class="context-tab-summary">
1218
- <h2>${t.context.title}</h2>
1219
- <p>${t.context.summary}</p>
1220
- </div>
1221
- <div class="record-tab-list">
1222
- ${w(n.length>0,()=>P(n,a=>a.term,a=>h`
1223
- <article class="context-term">
1224
- <h3>${a.term}</h3>
1225
- <p>${a.definition}</p>
1226
- ${w(a.avoid.length>0,()=>h`<p class="context-term-avoid">Avoid: ${a.avoid.join(", ")}</p>`,()=>I)}
1227
- </article>
1228
- `),()=>h`<div class="empty-children">No glossary terms match this filter.</div>`)}
1229
- </div>
1230
- `,()=>h`<div class="empty-children">No initiative context matches this filter.</div>`)}
1231
- </section>
1232
- `}render(){const e=this.store;if(!e)return I;const t=this.activeBundle();if(!t)return I;const s=e.getContextForInitiative(t.initiative.id),i=e.initiativeStats(t),n=e.initTab.get(),o=(t.initiative.body??"").trim(),a=t.initiative.bodySource??"authored",l=this.visibleGraphKinds,u=l.size!==Bs.length,d=e.buildInitiativeGraph(t),p=u?e.buildInitiativeGraph(t,l):d,g=e.debtRecordSectionsFor(t.initiative.id),v=[...new Map(g.flatMap(S=>S.records).map(S=>[S.id,S])).values()],k=t.entities.filter(S=>S.kind==="plan").sort((S,R)=>new Date(R.updatedAt).getTime()-new Date(S.updatedAt).getTime()||S.id.localeCompare(R.id)),_={adrs:t.adrs.length,context:s?.terms.length??0,debt:v.length,graph:d.nodes.length,issues:t.issues.length,plans:k.length,prds:t.prds.length,userStories:t.userStories.length},D=[{label:"Overview",tab:"overview"},...Gl.filter(([S])=>S==="graph"?d.edges.length>0:S==="context"?s?.context.exists===!0:(_[S]??0)>0).map(([S,R])=>({label:R,recordCount:_[S],tab:S}))],m=D.some(({tab:S})=>S===n)?n:"overview";return h`
1233
- <div class="detail-inner">
1234
- <div class="ai-crumbs">${e.selectedTenantDisplayName.get()} · Initiatives</div>
1235
- <h1 class="d-title">
1236
- ${t.initiative.title}
1237
- <span class=${`badge ${e.badgeTone(t.initiative.status)}`}>${t.initiative.status}</span>
1238
- </h1>
1239
- <div class="d-sub">
1240
- ${Ys(en(s?.context.summary??"No initiative-specific context is available yet."))}
1241
- </div>
1242
-
1243
- <div class="kpis">
1244
- <div class="kpi">
1245
- <div class="k-num">${i.stories}</div>
1246
- <div class="k-label">User stories</div>
1247
- </div>
1248
- <div class="kpi">
1249
- <div class="k-num">${i.issues}</div>
1250
- <div class="k-label">Issues</div>
1251
- </div>
1252
- <div class="kpi">
1253
- <div class="k-num">${i.pct}%</div>
1254
- <div class="k-label">Complete</div>
1255
- </div>
1256
- <div class="kpi">
1257
- <div class="k-num">${i.adrs}</div>
1258
- <div class="k-label">ADRs</div>
1259
- </div>
1260
- </div>
1261
-
1262
- <div class="bar">
1263
- <span class="b-done" style=${`width:${i.pct}%`}></span>
1264
- <span class="b-open" style=${`width:${100-i.pct}%`}></span>
1265
- </div>
1266
-
1267
- <div
1268
- aria-label="Initiative details"
1269
- class="subtabs"
1270
- role="tablist"
1271
- >
1272
- ${P(D,({tab:S})=>S,({label:S,recordCount:R,tab:C})=>h`
1273
- <button
1274
- aria-label=${R===void 0?S:`${S}: ${R} records`}
1275
- aria-controls=${this.getTabPanelId(C)}
1276
- aria-selected=${String(m===C)}
1277
- class=${Q({active:m===C,subtab:!0})}
1278
- data-tab=${C}
1279
- id=${this.getTabButtonId(C)}
1280
- @click=${this.onSetTab}
1281
- role="tab"
1282
- >
1283
- <span class="subtab-label">
1284
- <span class="subtab-label-text">${S}</span>
1285
- </span>
1286
- ${w(R!==void 0,()=>h`<span aria-hidden="true" class="subtab-count">${R}</span>`,()=>I)}
1287
- </button>
1288
- `)}
1289
- </div>
1290
-
1291
- <section
1292
- aria-labelledby=${this.getTabButtonId(m)}
1293
- id=${this.getTabPanelId(m)}
1294
- role="tabpanel"
1295
- >
1296
- ${Xe(m,[["overview",()=>h`
1297
- ${w(o.length>0,()=>h`
1298
- <div class="initiative-body overview-body">
1299
- ${w(a==="generated",()=>this.renderBodySourceNotice(),()=>I)}
1300
- <div class="ai-body">${Ys(en(o))}</div>
1301
- </div>
1302
- `,()=>I)}
1303
- ${P(g,S=>S.key,S=>this.renderOverviewSection(S.key,S.title,h`
1304
- <div class="sec-body">
1305
- ${P(S.records,R=>R.id,R=>this.renderLine(R))}
1306
- </div>
1307
- `,{count:String(S.records.length)}))}
1308
- `],["issues",()=>this.renderRecordTab("Issues",t.issues,"No issues attached.",t,{treeContent:S=>this.renderIssueTreeTab(t,S),treeTab:"issues"})],["plans",()=>this.renderRecordTab("Plans",k,"No Plans attached.",t)],["prds",()=>this.renderRecordTab("PRDs",t.prds,"No PRDs attached.",t)],["adrs",()=>this.renderRecordTab("ADRs",t.adrs,"No ADRs recorded.",t)],["context",()=>h`
1309
- ${this.renderContextTab(t)}
1310
- `],["userStories",()=>this.renderRecordTab("User stories",t.userStories,"No user stories attached.",t,{treeContent:S=>this.renderUserStoryTreeTab(t,S),treeTab:"userStories"})],["debt",()=>this.renderRecordTab("Debt",v,"No debt recorded.",t)],["graph",()=>h`
1311
- <div class="ai-graph-wrap">
1312
- <div class="graph-scroll-content">
1313
- <div class="ai-graph-legend">
1314
- <agent-issues-relationship-graph-filters
1315
- .kinds=${Bs}
1316
- .visibleKinds=${l}
1317
- @graph-kind-toggle=${this.onToggleGraphKind}
1318
- ></agent-issues-relationship-graph-filters>
1319
- <span class="ai-graph-hint">Click any node to open it</span>
1320
- </div>
1321
- ${w(p.nodes.length>0,()=>h`
1322
- <div class="graph-host">
1323
- <agent-issues-relationship-graph
1324
- .graph=${p}
1325
- @node-open=${this.onNodeOpen}
1326
- ></agent-issues-relationship-graph>
1327
- </div>
1328
- `,()=>h`<div class="empty-children">No graph records match the selected filters.</div>`)}
1329
- </div>
1330
- </div>
1331
- `]])}
1332
- </section>
1333
- </div>
1334
- `}};Xt.properties={store:{attribute:!1},initiativeId:{attribute:!1},cascade:{attribute:!1},activeChildId:{attribute:!1}},Xt.styles=[os,vi,ue`
1335
- :host {
1336
- display: block;
1337
- }
1338
- .detail-inner {
1339
- max-width: 920px;
1340
- margin: 0 auto;
1341
- padding: 28px 32px 64px;
1342
- }
1343
- .ai-crumbs {
1344
- color: var(--muted);
1345
- font-size: 12px;
1346
- }
1347
- .d-title {
1348
- display: flex;
1349
- gap: 12px;
1350
- align-items: center;
1351
- margin: 6px 0 0;
1352
- font-size: 24px;
1353
- }
1354
- .d-sub {
1355
- max-width: 70ch;
1356
- margin: 10px 0 0;
1357
- color: var(--muted);
1358
- }
1359
- .d-sub > :first-child {
1360
- margin-top: 0;
1361
- }
1362
- .d-sub > :last-child {
1363
- margin-bottom: 0;
1364
- }
1365
- .d-sub h1,
1366
- .d-sub h2,
1367
- .d-sub h3 {
1368
- margin-bottom: 6px;
1369
- font-size: 16px;
1370
- line-height: 1.4;
1371
- }
1372
- .d-sub p,
1373
- .d-sub ul,
1374
- .d-sub ol {
1375
- margin: 6px 0;
1376
- }
1377
- .kpis {
1378
- display: grid;
1379
- grid-template-columns: repeat(4, 1fr);
1380
- gap: 12px;
1381
- margin-top: 20px;
1382
- }
1383
- .kpi {
1384
- padding: 14px 16px;
1385
- border: 1px solid var(--border);
1386
- border-radius: 10px;
1387
- background: var(--surface);
1388
- }
1389
- .k-num {
1390
- font-size: 22px;
1391
- font-weight: 700;
1392
- }
1393
- .k-label {
1394
- margin-top: 2px;
1395
- color: var(--muted);
1396
- font-size: 12px;
1397
- }
1398
- .bar {
1399
- display: flex;
1400
- overflow: hidden;
1401
- height: 8px;
1402
- margin-top: 16px;
1403
- border-radius: 999px;
1404
- background: #eaeef2;
1405
- }
1406
- .b-done {
1407
- background: var(--done);
1408
- }
1409
- .b-open {
1410
- background: var(--success);
1411
- }
1412
- .subtabs {
1413
- display: flex;
1414
- flex-wrap: wrap;
1415
- column-gap: 18px;
1416
- row-gap: 4px;
1417
- margin-top: 22px;
1418
- border-bottom: 1px solid var(--border-muted);
1419
- }
1420
- .subtab {
1421
- position: relative;
1422
- flex: 0 0 auto;
1423
- padding: 8px 24px;
1424
- border: 0;
1425
- border-bottom: 2px solid transparent;
1426
- background: transparent;
1427
- color: var(--muted);
1428
- cursor: pointer;
1429
- font: inherit;
1430
- text-align: center;
1431
- }
1432
- .subtab-label {
1433
- display: inline-block;
1434
- }
1435
- .subtab.active {
1436
- border-bottom-color: #fd8c73;
1437
- color: var(--text);
1438
- }
1439
- .subtab.active .subtab-label-text {
1440
- text-shadow: -0.25px 0 currentColor, 0.25px 0 currentColor;
1441
- }
1442
- .record-tab {
1443
- margin-top: 18px;
1444
- border: 1px solid var(--border);
1445
- border-radius: 10px;
1446
- background: var(--surface);
1447
- }
1448
- .context-tab-toolbar {
1449
- display: flex;
1450
- gap: 12px;
1451
- align-items: end;
1452
- padding: 12px 16px;
1453
- border-bottom: 1px solid var(--border-muted);
1454
- }
1455
- .record-filter {
1456
- display: grid;
1457
- gap: 4px;
1458
- }
1459
- .record-filter:first-child {
1460
- flex: 1;
1461
- }
1462
- .record-filter-label {
1463
- color: var(--muted);
1464
- font-size: 12px;
1465
- font-weight: 600;
1466
- }
1467
- .record-filter input,
1468
- .record-filter select {
1469
- box-sizing: border-box;
1470
- min-height: 32px;
1471
- padding: 6px 8px;
1472
- border: 1px solid var(--border);
1473
- border-radius: 6px;
1474
- background: var(--surface);
1475
- color: var(--text);
1476
- font: inherit;
1477
- }
1478
- .context-count {
1479
- padding-bottom: 7px;
1480
- color: var(--muted);
1481
- font-size: 12px;
1482
- white-space: nowrap;
1483
- }
1484
- .record-tab-list {
1485
- display: grid;
1486
- gap: 2px;
1487
- padding: 8px;
1488
- }
1489
- .record-tree {
1490
- display: grid;
1491
- gap: 8px;
1492
- }
1493
- .story-tree-block {
1494
- border-bottom: 1px solid var(--border-muted);
1495
- }
1496
- .story-tree-block:last-child {
1497
- border-bottom: 0;
1498
- }
1499
- .context-tab-summary {
1500
- padding: 14px 16px 0;
1501
- }
1502
- .context-tab-summary h2,
1503
- .context-term h3 {
1504
- margin: 0;
1505
- font-size: 14px;
1506
- }
1507
- .context-tab-summary p,
1508
- .context-term p {
1509
- margin: 6px 0 0;
1510
- color: var(--muted);
1511
- font-size: 13px;
1512
- }
1513
- .context-term .context-term-avoid {
1514
- color: var(--danger);
1515
- }
1516
- .context-term {
1517
- padding: 10px 8px;
1518
- border-bottom: 1px solid var(--border-muted);
1519
- }
1520
- .context-term:last-child {
1521
- border-bottom: 0;
1522
- }
1523
- .sec {
1524
- margin-top: 18px;
1525
- border: 1px solid var(--border);
1526
- border-radius: 12px;
1527
- background: var(--surface);
1528
- }
1529
- .sec-toggle {
1530
- display: flex;
1531
- gap: 12px;
1532
- align-items: center;
1533
- justify-content: space-between;
1534
- width: stretch;
1535
- padding: 12px 16px;
1536
- border: 0;
1537
- border-bottom: 1px solid var(--border-muted);
1538
- background: transparent;
1539
- color: var(--text);
1540
- cursor: pointer;
1541
- font: inherit;
1542
- text-align: left;
1543
- }
1544
- .sec-toggle:hover {
1545
- background: var(--surface-muted);
1546
- }
1547
- .sec-head {
1548
- display: flex;
1549
- gap: 10px;
1550
- align-items: baseline;
1551
- flex-wrap: wrap;
1552
- }
1553
- .sec-title {
1554
- font-weight: 600;
1555
- }
1556
- .sec-count {
1557
- color: var(--muted);
1558
- font-size: 12px;
1559
- font-weight: 400;
1560
- }
1561
- .sec-chevron {
1562
- color: var(--muted);
1563
- font-size: 14px;
1564
- line-height: 1;
1565
- transform: rotate(90deg);
1566
- transition: transform 120ms ease;
1567
- }
1568
- .sec-chevron.collapsed {
1569
- transform: rotate(0deg);
1570
- }
1571
- .sec-body {
1572
- padding: 8px;
1573
- }
1574
- .overview-body {
1575
- margin-top: 18px;
1576
- }
1577
- .context-sec {
1578
- padding: 16px;
1579
- }
1580
- .story-head:hover,
1581
- .child:hover,
1582
- .line:hover {
1583
- background: var(--surface-muted);
1584
- }
1585
- .story-head.is-active-ref,
1586
- .child.is-active-ref,
1587
- .handoff-focus.is-active-ref {
1588
- background: var(--surface-muted);
1589
- box-shadow: inset 3px 0 0 0 var(--accent);
1590
- }
1591
- .issue-branch {
1592
- display: grid;
1593
- gap: 6px;
1594
- }
1595
- .issue-branch-row {
1596
- display: flex;
1597
- gap: 8px;
1598
- align-items: stretch;
1599
- }
1600
- .issue-branch + .issue-branch {
1601
- margin-top: 6px;
1602
- }
1603
- .branch-toggle,
1604
- .branch-spacer {
1605
- flex-shrink: 0;
1606
- width: 24px;
1607
- height: 24px;
1608
- margin-top: 8px;
1609
- }
1610
- .branch-toggle {
1611
- border: 1px solid var(--border-muted);
1612
- border-radius: 6px;
1613
- background: var(--surface);
1614
- color: var(--muted);
1615
- cursor: pointer;
1616
- font: inherit;
1617
- line-height: 1;
1618
- }
1619
- .branch-toggle:hover {
1620
- border-color: var(--accent);
1621
- color: var(--accent);
1622
- }
1623
- .issue-branch-children {
1624
- display: grid;
1625
- gap: 6px;
1626
- margin-left: 22px;
1627
- padding-left: 12px;
1628
- border-left: 1px solid var(--border-muted);
1629
- }
1630
- .children {
1631
- padding: 0 8px 8px 28px;
1632
- }
1633
- .issue-tree {
1634
- display: grid;
1635
- gap: 6px;
1636
- }
1637
- .empty-children {
1638
- padding: 12px 8px;
1639
- color: var(--muted);
1640
- font-size: 13px;
1641
- }
1642
- @media (max-width: 640px) {
1643
- .detail-inner {
1644
- padding: 20px 16px 40px;
1645
- }
1646
- .kpis {
1647
- grid-template-columns: repeat(2, 1fr);
1648
- }
1649
- .context-tab-toolbar {
1650
- align-items: stretch;
1651
- flex-direction: column;
1652
- }
1653
- .context-count {
1654
- padding-bottom: 0;
1655
- }
1656
- }
1657
- .child,
1658
- .line {
1659
- display: flex;
1660
- gap: 10px;
1661
- align-items: center;
1662
- width: stretch;
1663
- padding: 8px;
1664
- border: 0;
1665
- border-radius: 6px;
1666
- background: transparent;
1667
- cursor: pointer;
1668
- text-align: left;
1669
- }
1670
- .child-title,
1671
- .line-title {
1672
- flex: 1;
1673
- }
1674
- .idtag {
1675
- color: var(--muted);
1676
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
1677
- font-size: 12px;
1678
- }
1679
- .issue-dot {
1680
- flex-shrink: 0;
1681
- width: 10px;
1682
- height: 10px;
1683
- border-radius: 50%;
1684
- border: 2px solid var(--success);
1685
- }
1686
- .issue-dot.done {
1687
- border-color: var(--done);
1688
- background: var(--done);
1689
- }
1690
- .issue-dot.blocked {
1691
- border-color: var(--danger);
1692
- }
1693
- .subtab-count {
1694
- box-sizing: border-box;
1695
- display: inline-grid;
1696
- min-width: 16px;
1697
- height: 16px;
1698
- padding: 0 3px;
1699
- place-items: center;
1700
- position: absolute;
1701
- top: 1px;
1702
- right: 3px;
1703
- border-radius: 50%;
1704
- background: var(--accent);
1705
- color: var(--surface);
1706
- font-size: 10px;
1707
- font-weight: 700;
1708
- line-height: 1;
1709
- }
1710
- .handoff {
1711
- padding: 14px 16px;
1712
- border: 1px solid var(--border-muted);
1713
- border-radius: 10px;
1714
- background: var(--surface);
1715
- }
1716
- .handoff + .handoff {
1717
- margin-top: 10px;
1718
- }
1719
- .handoff-head {
1720
- display: flex;
1721
- gap: 10px;
1722
- align-items: baseline;
1723
- flex-wrap: wrap;
1724
- }
1725
- .handoff-summary {
1726
- flex: 1;
1727
- font-weight: 600;
1728
- }
1729
- .handoff-time {
1730
- color: var(--muted);
1731
- font-size: 12px;
1732
- }
1733
- .handoff-focus {
1734
- display: inline-flex;
1735
- gap: 8px;
1736
- align-items: center;
1737
- margin-top: 8px;
1738
- padding: 4px 8px;
1739
- border: 1px solid var(--border-muted);
1740
- border-radius: 6px;
1741
- background: transparent;
1742
- cursor: pointer;
1743
- font: inherit;
1744
- color: var(--text);
1745
- }
1746
- .handoff-focus-title {
1747
- color: var(--muted);
1748
- font-size: 13px;
1749
- }
1750
- .handoff-body {
1751
- margin-top: 10px;
1752
- }
1753
- .ai-body-source {
1754
- display: flex;
1755
- gap: 10px;
1756
- align-items: center;
1757
- margin-bottom: 14px;
1758
- padding: 10px 12px;
1759
- border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
1760
- border-radius: 10px;
1761
- background: color-mix(in srgb, var(--surface-muted) 76%, white 24%);
1762
- }
1763
- .ai-body-source-badge {
1764
- padding: 4px 8px;
1765
- border-radius: 999px;
1766
- background: color-mix(in srgb, var(--accent) 16%, white 84%);
1767
- color: var(--accent-strong, var(--accent));
1768
- font-size: 11px;
1769
- font-weight: 700;
1770
- letter-spacing: 0.04em;
1771
- text-transform: uppercase;
1772
- }
1773
- .ai-body-source-copy {
1774
- color: var(--muted);
1775
- font-size: 12px;
1776
- font-weight: 600;
1777
- }
1778
- .ai-body {
1779
- max-width: 75ch;
1780
- color: var(--text);
1781
- font-size: 14px;
1782
- line-height: 1.6;
1783
- }
1784
- .ai-body > :first-child {
1785
- margin-top: 0;
1786
- }
1787
- .ai-body > :last-child {
1788
- margin-bottom: 0;
1789
- }
1790
- .ai-body h1,
1791
- .ai-body h2,
1792
- .ai-body h3 {
1793
- margin: 16px 0 8px;
1794
- line-height: 1.3;
1795
- }
1796
- .ai-body p {
1797
- margin: 8px 0;
1798
- }
1799
- .ai-body ul,
1800
- .ai-body ol {
1801
- margin: 8px 0;
1802
- padding-left: 22px;
1803
- }
1804
- .ai-body code {
1805
- padding: 1px 5px;
1806
- border-radius: 4px;
1807
- background: var(--border-muted);
1808
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
1809
- font-size: 12px;
1810
- }
1811
- .ai-body pre {
1812
- padding: 12px;
1813
- border-radius: 8px;
1814
- background: #f6f8fa;
1815
- overflow: auto;
1816
- }
1817
- .ai-body pre code {
1818
- padding: 0;
1819
- background: transparent;
1820
- }
1821
- .ai-body blockquote {
1822
- margin: 8px 0;
1823
- padding-left: 12px;
1824
- border-left: 3px solid var(--border);
1825
- color: var(--muted);
1826
- }
1827
- .ai-body a {
1828
- color: var(--accent, #0969da);
1829
- }
1830
- .ai-graph-wrap {
1831
- margin-top: 18px;
1832
- border: 1px solid var(--border);
1833
- border-radius: 10px;
1834
- background:
1835
- radial-gradient(circle, rgba(208, 215, 222, 0.5) 1px, transparent 1px) 0 0 / 22px 22px,
1836
- var(--surface);
1837
- overflow: auto;
1838
- }
1839
- .graph-scroll-content,
1840
- .graph-host {
1841
- width: max-content;
1842
- min-width: 100%;
1843
- }
1844
- .ai-graph-legend {
1845
- display: flex;
1846
- gap: 16px;
1847
- flex-wrap: wrap;
1848
- padding: 10px 14px;
1849
- border-bottom: 1px solid var(--border-muted);
1850
- font-size: 12px;
1851
- color: var(--muted);
1852
- background: var(--surface);
1853
- position: sticky;
1854
- top: 0;
1855
- z-index: 1;
1856
- }
1857
- .ai-graph-legend .lg {
1858
- display: inline-flex;
1859
- gap: 6px;
1860
- align-items: center;
1861
- }
1862
- .ai-graph-legend .sw {
1863
- width: 10px;
1864
- height: 10px;
1865
- border-radius: 50%;
1866
- }
1867
- .ai-graph-hint {
1868
- margin-left: auto;
1869
- }
1870
- .graph-host {
1871
- padding: 0;
1872
- }
1873
- @media (max-width: 700px) {
1874
- .kpis {
1875
- grid-template-columns: repeat(2, 1fr);
1876
- }
1877
- .detail-inner {
1878
- padding: 20px 16px 48px;
1879
- }
1880
- }
1881
- `];let oi=Xt;customElements.define("agent-issues-initiative-detail-view",oi);class Te{constructor(e,t,s){this.store=e,this.entity=t,this.host=s}usesTabs(){return!0}issueSeeds(e){return e.linkedRecords.filter(t=>t.kind==="issue")}additionalUserStories(e,t){return[]}entityTabs(){return[]}detailData(){const e=this.store.bundleForEntityId(this.entity.id),t=this.store.debtRecordSectionsFor(this.entity.id),s=this.store.linkedRecordSectionsFor(this.entity.id,{excludeRelatedIds:t.flatMap(m=>m.records.map(S=>S.id)),excludeRelationTypes:this.excludedRelationTypes()}),i=this.buildIssueGraph(e),n={bundle:e,debtSections:t,entity:this.entity,graphAvailable:i.edges.length>0,inheritedContext:e?this.store.getContextForInitiative(e.initiative.id):null,issueGraph:this.filterGraphByKind(i,this.host.visibleGraphKinds)},o=this.uniqueRecords(s.flatMap(m=>m.records)),a={bundle:e,entity:this.entity,issueTreeForStory:m=>e?this.store.issueTreeForStory(e,m):[],linkedRecords:o,parentIssue:this.parentIssue(n),prdStories:this.prdStories(n),recordsInIssueTree:m=>this.recordsInIssueTree(m)},l=this.issueSeeds(a),u=this.uniqueRecords([...l,...l.flatMap(m=>e?this.recordsInIssueTree(this.store.subIssueTreeForIssue(e,m.id)):[]),...o.filter(m=>m.kind==="issue")]),d=new Set(u.map(m=>m.id)),p=this.uniqueRecords([...o.filter(m=>m.kind==="userStory"),...this.additionalUserStories(a,d),...n.bundle?.fixLinks.filter(m=>d.has(m.issue.id)).map(m=>m.userStory)??[]]).filter(m=>m.id!==this.entity.id),g=o.filter(m=>m.kind==="plan"),v=o.filter(m=>m.kind==="prd"),k=this.uniqueRecords([...o.filter(m=>m.kind==="adr"),...e?.constrainsLinks.filter(m=>m.issue.id===this.entity.id).map(m=>m.adr)??[]]),_=this.uniqueRecords([...n.debtSections.flatMap(m=>m.records),...o.filter(m=>m.kind==="debt")]),D=o.filter(m=>!["issue","userStory","plan","prd","adr","debt"].includes(m.kind));return{adrRecords:k,bundle:e,crossLinkRecordIds:new Set(s.filter(m=>m.crossLink).flatMap(m=>m.records.map(S=>S.id))),debtRecords:_,debtSections:t,inheritedContext:n.inheritedContext,issueGraph:n.issueGraph,issueRecords:u,linkedSections:s,parentIssue:a.parentIssue,planRecords:g,prdRecords:v,relatedRecords:D,subIssueTree:this.entity.kind==="issue"&&e?this.store.subIssueTreeForIssue(e,this.entity.id):[],tabs:this.tabsFor(n,u,g,v,k,p,_,D),userStoryRecords:p}}renderDetail(){const e=this.detailData(),t=e.tabs.some(({tab:s})=>s===this.host.entityDetailTab)?this.host.entityDetailTab:"overview";return h`
1882
- ${w(this.usesTabs(),()=>this.renderTabbedDetail(e,t),()=>this.renderUntabbedDetail(e))}
1883
- `}renderTabbedDetail(e,t){return h`
1884
- <div
1885
- aria-label=${`${this.label} details`}
1886
- class="ai-subtabs"
1887
- role="tablist"
1888
- >
1889
- ${P(e.tabs,({tab:s})=>s,({label:s,recordCount:i,tab:n})=>this.host.renderTabButton(n,s,t===n,i))}
1890
- </div>
1891
- <section
1892
- aria-labelledby=${`issue-detail-${this.entity.id}-${t}-tab`}
1893
- id=${`issue-detail-${this.entity.id}-${t}-panel`}
1894
- role="tabpanel"
1895
- >
1896
- ${Xe(t,[["overview",()=>this.renderOverview()],["plan",()=>this.renderPlanTab()],["issues",()=>this.host.renderRecordBrowser("Issues",e.issueRecords,"No related issues.",this.store.bundleForEntityId(this.entity.id),{crossLinkRecordIds:e.crossLinkRecordIds,treeContent:s=>w(this.store.bundleForEntityId(this.entity.id)!==null,()=>h`
1897
- <div class="ai-record-tree ai-issue-tree">
1898
- ${this.host.renderIssueTreeForRecords(this.store.bundleForEntityId(this.entity.id),e.issueRecords,s)}
1899
- </div>
1900
- `,()=>h`
1901
- <div class="ai-record-tree ai-issue-tree">
1902
- ${P(s,i=>i.id,i=>this.host.renderRef(i))}
1903
- </div>
1904
- `),treeTab:"issues"})],["plans",()=>this.host.renderRecordBrowser("Plans",e.planRecords,"No related Plans.",this.store.bundleForEntityId(this.entity.id))],["prds",()=>this.host.renderRecordBrowser("PRDs",e.prdRecords,"No related PRDs.",this.store.bundleForEntityId(this.entity.id))],["adrs",()=>this.host.renderRecordBrowser("ADRs",e.adrRecords,"No related ADRs.",this.store.bundleForEntityId(this.entity.id))],["context",()=>this.host.renderContextTab(e.inheritedContext)],["userStories",()=>this.host.renderRecordBrowser("User stories",e.userStoryRecords,"No related user stories.",this.store.bundleForEntityId(this.entity.id),{treeContent:s=>this.renderUserStoryTree(e,s),treeTab:"userStories"})],["debt",()=>this.host.renderRecordBrowser("Debt",e.debtRecords,"No debt recorded.",this.store.bundleForEntityId(this.entity.id))],["related",()=>this.host.renderRecordBrowser("Related records",e.relatedRecords,"No other related records.",this.store.bundleForEntityId(this.entity.id))],["graph",()=>this.host.renderGraphTab(e.issueGraph)]])}
1905
- </section>
1906
- `}renderUntabbedDetail(e){return h`
1907
- ${this.renderOverview()}
1908
- ${w(e.debtSections.length>0,()=>this.host.renderRefSections(e.debtSections),()=>I)}
1909
- ${w(e.linkedSections.length>0,()=>this.host.renderRefSections(e.linkedSections),()=>h`
1910
- <section class="ai-sec">
1911
- <h2>Linked records</h2>
1912
- <div class="ai-empty">Nothing is linked to this record yet.</div>
1913
- </section>
1914
- `)}
1915
- `}renderPlanTab(){return h``}renderUserStoryTree(e,t){return h`
1916
- <div class="ai-record-tree">
1917
- ${P(t,s=>s.id,s=>h`
1918
- <div class="ai-story-block">
1919
- ${this.host.renderRef(s)}
1920
- ${w(e.bundle!==null,()=>h`<div class="ai-story-issues">${this.host.renderIssueTree(this.store.issueTreeForStory(e.bundle,s.id))}</div>`,()=>I)}
1921
- </div>
1922
- `)}
1923
- </div>
1924
- `}relatedRecordsFor(e,t){const s=new Map,i=n=>{n.id!==e.id&&s.set(n.id,n)};for(const n of t?.fixLinks??[])n.issue.id===e.id&&i(n.userStory),n.userStory.id===e.id&&i(n.issue);for(const n of t?.subIssueLinks??[])n.issue.id===e.id&&i(n.parent),n.parent.id===e.id&&i(n.issue);for(const n of t?.blockerLinks??[])n.source.id===e.id&&i(n.target),n.target.id===e.id&&i(n.source);for(const n of t?.constrainsLinks??[])n.adr.id===e.id&&i(n.issue),n.issue.id===e.id&&i(n.adr);for(const n of[...this.store.incomingRelationsFor(e.id),...this.store.outgoingRelationsFor(e.id)]){const o=n.fromId===e.id?n.toId:n.fromId,a=this.store.entityById.get().get(o);a&&i(a)}return[...s.values()]}graphKindFor(e){const t=e.kind==="userStory"?"story":e.kind;return st.includes(t)?t:null}graphKindLabel(e){return e==="story"?"User stories":`${e.slice(0,1).toUpperCase()}${e.slice(1)}s`}buildIssueGraph(e){const t=this.uniqueRecords([this.entity,...this.relatedRecordsFor(this.entity,e)]).filter(l=>this.graphKindFor(l)!==null),s=[...new Set(t.map(l=>this.graphKindFor(l)))],i=new Map(s.map((l,u)=>[l,u])),n=new Set(t.map(l=>l.id)),o=t.map(l=>({col:i.get(this.graphKindFor(l)),fullLabel:`${this.store.shortRef(l)} ${l.title}`,id:l.id,key:l.id,kind:this.graphKindFor(l),label:l.title,status:l.status})),a=(this.store.snapshot.get()?.relations??[]).filter(l=>n.has(l.fromId)&&n.has(l.toId)).map(l=>({from:l.fromId,label:l.type,to:l.toId}));return{columns:s.map(l=>this.graphKindLabel(l)),edges:a,nodes:o}}filterGraphByKind(e,t){const s=e.nodes.filter(a=>t.has(a.kind)),i=new Set(s.map(a=>a.key)),n=[...new Set(s.map(a=>a.col))].sort((a,l)=>a-l),o=new Map(n.map((a,l)=>[a,l]));return{columns:n.map(a=>e.columns[a]),edges:e.edges.filter(a=>i.has(a.from)&&i.has(a.to)),nodes:s.map(a=>({...a,col:o.get(a.col)}))}}excludedRelationTypes(){return[]}parentIssue(e){return null}prdStories(e){return[]}tabsFor(e,t,s,i,n,o,a,l){const u=[{label:"Issues",recordCount:t.length,tab:"issues",visible:()=>t.some(d=>d.id!==e.entity.id)},{label:"Plans",recordCount:s.length,tab:"plans",visible:()=>s.length>0},{label:"PRDs",recordCount:i.length,tab:"prds",visible:()=>i.length>0},{label:"ADRs",recordCount:n.length,tab:"adrs",visible:()=>n.length>0},{label:"Context",tab:"context",visible:()=>e.inheritedContext?.context.exists===!0},{label:"User stories",recordCount:o.length,tab:"userStories",visible:()=>o.length>0},{label:"Debt",recordCount:a.length,tab:"debt",visible:()=>a.length>0},{label:"Related",recordCount:l.length,tab:"related",visible:()=>l.length>0},{label:"Graph",tab:"graph",visible:()=>e.graphAvailable}];return[{label:"Overview",tab:"overview"},...this.entityTabs(),...u.filter(d=>d.visible())]}uniqueRecords(e){return[...new Map(e.map(t=>[t.id,t])).values()]}recordsInIssueTree(e){return e.flatMap(t=>[t.issue,...this.recordsInIssueTree(t.children)])}renderOverview(){const e=(this.entity.body??"").trim(),t=this.entity.bodySource??"authored",s=this.entity.kind==="issue"?this.store.snapshot.get()?.issueComments[this.entity.id]?.comments??[]:[];return h`
1925
- ${w(e.length>0,()=>h`
1926
- <section class="ai-sec ai-body">
1927
- ${w(t==="generated",()=>this.host.renderBodySourceNotice(),()=>I)}
1928
- ${ec(tc(e))}
1929
- </section>
1930
- `,()=>I)}
1931
- ${w(s.length>0,()=>h`
1932
- <section class="ai-sec ai-conversation">
1933
- <h2>Conversation</h2>
1934
- ${P(s,i=>i.id,i=>this.host.renderIssueComment(i))}
1935
- </section>
1936
- `,()=>I)}
1937
- `}}class ql extends Te{constructor(){super(...arguments),this.label="Issue"}excludedRelationTypes(){return["decomposes"]}parentIssue(e){return e.bundle?this.store.parentIssueForIssue(e.bundle,this.entity.id):null}issueSeeds(e){return[e.entity,...e.parentIssue?[e.parentIssue]:[]]}}class Hl extends Te{constructor(){super(...arguments),this.label="ADR"}issueSeeds(e){const t=e.bundle?.constrainsLinks.filter(s=>s.adr.id===e.entity.id).map(s=>s.issue)??[];return[...super.issueSeeds(e),...t]}}class Wl extends Te{constructor(){super(...arguments),this.label="PRD"}excludedRelationTypes(){return["creates"]}prdStories(e){return e.bundle?.userStories.filter(t=>this.store.outgoingRelationsFor(this.entity.id).some(s=>s.type==="creates"&&s.toId===t.id))??[]}issueSeeds(e){const t=e.prdStories.flatMap(s=>e.recordsInIssueTree(e.issueTreeForStory(s.id)));return[...super.issueSeeds(e),...t]}additionalUserStories(e){return e.prdStories}}class Kl extends Te{constructor(){super(...arguments),this.label="User story"}issueSeeds(e){return[...super.issueSeeds(e),...e.recordsInIssueTree(e.issueTreeForStory(e.entity.id))]}}class Vl extends Te{constructor(){super(...arguments),this.label="Plan"}entityTabs(){return[{label:"Plan",tab:"plan"}]}renderCurrentPlanEntry(e,t,s){const i=t?Jl(e,s):[];return h`
1938
- ${w(i.length>0,()=>h`
1939
- <div class="ai-plan-decision-pair">
1940
- ${P(i,n=>n.id,n=>h`
1941
- <section class="ai-plan-decision-question">
1942
- <div class="ai-plan-decision-pair-label">Question</div>
1943
- ${this.host.renderPlanEntry(n)}
1944
- </section>
1945
- `)}
1946
- <section class="ai-plan-decision-answer">
1947
- <div class="ai-plan-decision-pair-label">Decision</div>
1948
- ${this.host.renderPlanEntry(e)}
1949
- </section>
1950
- </div>
1951
- `,()=>this.host.renderPlanEntry(e))}
1952
- `}renderPlanTab(){const e=this.store.planProjectionFor(this.entity.id),t=e.current.filter(i=>i.entries.length>0),s=new Map(e.history.map(i=>[i.id,i]));return h`
1953
- <div class="ai-plan-tab">
1954
- <section class="ai-sec ai-plan-current">
1955
- <h2>Current plan</h2>
1956
- ${w(t.length>0,()=>P(t,i=>i.key,i=>h`
1957
- <details class="ai-plan-group">
1958
- <summary>
1959
- <span>${i.title}</span>
1960
- <span class="ai-plan-count">${i.entries.length}</span>
1961
- </summary>
1962
- <div
1963
- class="ai-plan-entries"
1964
- data-plan-group=${i.key}
1965
- >
1966
- ${P(i.entries,n=>n.id,n=>this.renderCurrentPlanEntry(n,i.key==="decisions",s))}
1967
- </div>
1968
- </details>
1969
- `),()=>h`<div class="ai-empty">No current Plan entries.</div>`)}
1970
- </section>
1971
- <details class="ai-sec ai-plan-history">
1972
- <summary>
1973
- <span>Entry history</span>
1974
- <span class="ai-plan-count">${e.history.length}</span>
1975
- </summary>
1976
- <div class="ai-plan-entries">
1977
- ${w(e.history.length>0,()=>P(e.history,i=>i.id,i=>this.host.renderPlanEntry(i)),()=>h`<div class="ai-empty">No Plan entries yet.</div>`)}
1978
- </div>
1979
- </details>
1980
- </div>
1981
- `}}class Ql extends Te{constructor(){super(...arguments),this.label="Debt"}}class Yl extends Te{constructor(){super(...arguments),this.label="Handoff"}}class Zl extends Te{constructor(){super(...arguments),this.label="Record"}usesTabs(){return!1}}function Xl(r,e,t){switch(e.kind){case"issue":return new ql(r,e,t);case"adr":return new Hl(r,e,t);case"prd":return new Wl(r,e,t);case"userStory":return new Kl(r,e,t);case"plan":return new Vl(r,e,t);case"debt":return new Ql(r,e,t);case"handoff":return new Yl(r,e,t);default:return new Zl(r,e,t)}}function Jl(r,e){const t=new Map,s=new Set,i=n=>{if(s.has(n))return;s.add(n);const o=e.get(n);if(o){o.role==="question"&&!o.tombstone&&t.set(o.id,o);for(const a of o.supersededEntryIds)i(a)}};for(const n of r.supersededEntryIds)i(n);return[...t.values()].sort((n,o)=>n.createdAt.localeCompare(o.createdAt)||n.id.localeCompare(o.id))}function ec(r){return h`${Ys(r)}`}function tc(r){const e=z.parse(r,{async:!1});return In.sanitize(e)}const Jt=class Jt extends ss(le){constructor(){super(...arguments),this.store=null,this.entityId=null,this.cascade=!1,this.activeChildId=null,this.collapsedIssueIds=new Set,this.entityDetailTab="overview",this.recordQuery="",this.recordStatus="all",this.issueRecordView="list",this.userStoryRecordView="list",this.visibleGraphKinds=new Set(st),this.onBackClick=()=>{this.store?.closeEntity()},this.onSelectEntityClick=e=>{if(this.cascade){const t=e.currentTarget,s=t.dataset.id;if(!s)return;t.dataset.crossLink==="true"?this.store?.reRootCascade(s):this.entityId&&this.store?.drillCascade(this.entityId,s);return}this.store?.selectEntityFromEvent(e)},this.onToggleIssueBranch=e=>{e.stopPropagation();const t=e.currentTarget.dataset.id;t&&(this.collapsedIssueIds.has(t)?this.collapsedIssueIds.delete(t):this.collapsedIssueIds.add(t),this.requestUpdate())},this.onSetIssueTab=e=>{const t=e.currentTarget.dataset.tab;t&&(this.entityDetailTab=t,this.recordQuery="",this.recordStatus="all",this.requestUpdate())},this.onRecordQueryChange=e=>{this.recordQuery=e.detail.query,this.requestUpdate()},this.onContextQueryInput=e=>{this.recordQuery=e.target.value,this.requestUpdate()},this.onRecordStatusChange=e=>{this.recordStatus=e.detail.status,this.requestUpdate()},this.onRecordViewChange=e=>{const{tab:t,view:s}=e.detail;t==="issues"?this.issueRecordView=s:this.userStoryRecordView=s,this.requestUpdate()},this.onRecordOpen=e=>{const{crossLink:t,record:s}=e.detail;if(this.cascade){t?this.store?.reRootCascade(s.id):this.entityId&&this.store?.drillCascade(this.entityId,s.id);return}this.store?.selectEntity(s.id)},this.onNodeOpen=e=>{const t=e.detail.id;t&&this.store?.selectEntity(t)},this.onPlanEntryJump=e=>{const t=e.currentTarget.dataset.planEntryId;t&&this.focusPlanEntry(t,".ai-plan-history .ai-plan-entry")},this.onToggleGraphKind=e=>{const t=e.detail.kind;if(!t)return;const s=new Set(this.visibleGraphKinds);s.has(t)?s.delete(t):s.add(t),this.visibleGraphKinds=s,this.requestUpdate()}}focusPlanEntry(e,t=".ai-plan-entry"){const s=[...this.renderRoot.querySelectorAll(t)].find(n=>n.dataset.planEntryId===e);if(!s)return;const i=s.closest("details");i&&(i.open=!0),s.classList.remove("is-plan-entry-target"),s.offsetWidth,s.classList.add("is-plan-entry-target"),s.focus({preventScroll:!0}),typeof s.scrollIntoView=="function"&&s.scrollIntoView({behavior:"smooth",block:"center"})}focusIssueComment(e){const t=[...this.renderRoot.querySelectorAll(".ai-comment")].find(s=>s.dataset.commentId===e);t&&(t.classList.remove("is-comment-target"),t.offsetWidth,t.classList.add("is-comment-target"),t.focus({preventScroll:!0}),typeof t.scrollIntoView=="function"&&t.scrollIntoView({behavior:"smooth",block:"center"}))}focusNestedTarget(){for(const t of this.renderRoot.querySelectorAll(".is-comment-target, .is-plan-entry-target"))t.classList.remove("is-comment-target","is-plan-entry-target");const e=this.store?.selectedNestedTarget.get();if(e?.type==="plan-entry"){this.focusPlanEntry(e.id);return}e?.type==="issue-comment"&&this.focusIssueComment(e.id)}updated(){this.focusNestedTarget()}renderBodySourceNotice(){return h`
1982
- <div class="ai-body-source ai-body-source-generated">
1983
- <span class="ai-body-source-badge">Generated fallback</span>
1984
- <span class="ai-body-source-copy">Generated from tracker metadata because no authored body was present.</span>
1985
- </div>
1986
- `}renderRef(e,t=!1){const s=this.store;return s?h`
1987
- <button
1988
- class=${`ai-ref ${e.id===this.activeChildId?"is-active-ref":""}`}
1989
- data-id=${e.id}
1990
- data-cross-link=${t?"true":I}
1991
- @click=${this.onSelectEntityClick}
1992
- >
1993
- <span class="r-id">${s.shortRef(e)}</span>
1994
- <span class="r-title">${e.title}</span>
1995
- <span class=${`badge ${s.badgeTone(e.status)}`}>${e.status}</span>
1996
- </button>
1997
- `:I}renderRecordLine(e,t=!1){const s=this.store;return s?h`
1998
- <agent-issues-record-list-item
1999
- .active=${e.id===this.activeChildId}
2000
- .crossLink=${t}
2001
- .record=${e}
2002
- .reference=${s.shortRef(e)}
2003
- .statusTone=${s.badgeTone(e.status)}
2004
- class=${Q({"is-active-ref":e.id===this.activeChildId,line:!0,"record-row":!0})}
2005
- data-id=${e.id}
2006
- @record-open=${this.onRecordOpen}
2007
- ></agent-issues-record-list-item>
2008
- `:I}getTabButtonId(e,t){return`issue-detail-${e}-${t}-tab`}getTabPanelId(e,t){return`issue-detail-${e}-${t}-panel`}relatedRecordsFor(e,t){const s=this.store,i=new Map,n=o=>{o.id!==e.id&&i.set(o.id,o)};for(const o of t?.fixLinks??[])o.issue.id===e.id&&n(o.userStory),o.userStory.id===e.id&&n(o.issue);for(const o of t?.subIssueLinks??[])o.issue.id===e.id&&n(o.parent),o.parent.id===e.id&&n(o.issue);for(const o of t?.blockerLinks??[])o.source.id===e.id&&n(o.target),o.target.id===e.id&&n(o.source);for(const o of t?.constrainsLinks??[])o.adr.id===e.id&&n(o.issue),o.issue.id===e.id&&n(o.adr);for(const o of[...s?.incomingRelationsFor(e.id)??[],...s?.outgoingRelationsFor(e.id)??[]]){const a=o.fromId===e.id?o.toId:o.fromId,l=s?.entityById.get().get(a);l&&n(l)}return[...i.values()]}recordSearchRank(e,t){const s=this.recordQuery.trim().toLowerCase();if(!s)return 0;const i=this.store,n=[...i?.incomingRelationsFor(e.id)??[],...i?.outgoingRelationsFor(e.id)??[]],{body:o,...a}=e;if(JSON.stringify(a).toLowerCase().includes(s))return 0;if(n.some(u=>JSON.stringify(u).toLowerCase().includes(s)))return 1;const l=this.relatedRecordsFor(e,t);return l.some(u=>{const{body:d,...p}=u;return JSON.stringify(p).toLowerCase().includes(s)})?1:(o??"").toLowerCase().includes(s)?2:l.some(u=>(u.body??"").toLowerCase().includes(s))?3:null}filterRecords(e,t){const s=[];for(const[i,n]of e.entries()){if(this.recordStatus!=="all"&&n.status!==this.recordStatus)continue;const o=this.recordSearchRank(n,t);o!==null&&s.push({index:i,rank:o,record:n})}return s.sort((i,n)=>i.rank-n.rank||i.index-n.index).map(({record:i})=>i)}getRecordView(e){return e==="issues"?this.issueRecordView:this.userStoryRecordView}filterIssueTree(e,t){return e.flatMap(s=>{const i=this.filterIssueTree(s.children,t);return!t.has(s.issue.id)&&i.length===0?[]:[{...s,children:i}]})}issueTreeForRecords(e,t){const s=this.store?.sortIssuesByExpectedCompletion(t,e)??t,i=new Map(s.map(u=>[u.id,u])),n=new Map(s.map((u,d)=>[u.id,d])),o=new Map,a=new Set;for(const u of e.subIssueLinks){const d=i.get(u.parent.id),p=i.get(u.issue.id);if(!d||!p)continue;const g=o.get(d.id)??[];g.push(p),o.set(d.id,g),a.add(p.id)}const l=(u,d)=>({children:(o.get(u.id)??[]).filter(p=>!d.has(p.id)).sort((p,g)=>n.get(p.id)-n.get(g.id)).map(p=>l(p,new Set([...d,p.id]))),issue:u});return s.filter(u=>!a.has(u.id)).map(u=>l(u,new Set([u.id])))}renderRecordBrowser(e,t,s,i,n={}){const o=e==="Issues"&&i?this.store?.sortIssuesByExpectedCompletion(t,i)??t:t,a=this.filterRecords(o,i),l=[...new Set(t.map(d=>d.status))].sort((d,p)=>d.localeCompare(p)),u=n.treeTab?this.getRecordView(n.treeTab)==="tree":!1;return h`
2009
- <section class="ai-record-tab record-browser">
2010
- <agent-issues-record-filter-toolbar
2011
- .countText=${`${a.length} of ${t.length}`}
2012
- .query=${this.recordQuery}
2013
- .status=${this.recordStatus}
2014
- .statuses=${l}
2015
- .title=${e}
2016
- .treeTab=${n.treeTab??null}
2017
- .treeView=${n.treeTab?this.getRecordView(n.treeTab):"list"}
2018
- @record-query-change=${this.onRecordQueryChange}
2019
- @record-status-change=${this.onRecordStatusChange}
2020
- @record-view-change=${this.onRecordViewChange}
2021
- ></agent-issues-record-filter-toolbar>
2022
- <div class="ai-record-list record-browser-list">
2023
- ${w(t.length===0,()=>h`<div class="ai-empty">${s}</div>`,()=>w(a.length>0,()=>w(u&&n.treeContent,()=>n.treeContent?.(a)??I,()=>P(a,d=>d.id,d=>this.renderRecordLine(d,n.crossLinkRecordIds?.has(d.id)))),()=>h`<div class="ai-empty">No ${e.toLowerCase()} match this filter.</div>`))}
2024
- </div>
2025
- </section>
2026
- `}renderContextTab(e){if(!e)return h`<section class="ai-record-tab"><div class="ai-empty">No inherited initiative context is available.</div></section>`;const t=this.recordQuery.trim().toLowerCase(),s=JSON.stringify(e.context).toLowerCase(),i=e.terms.filter(o=>JSON.stringify(o).toLowerCase().includes(t)),n=!t||s.includes(t);return h`
2027
- <section class="ai-record-tab">
2028
- <div class="ai-record-toolbar">
2029
- <label class="ai-record-filter">
2030
- <span>Filter context</span>
2031
- <input
2032
- placeholder="Filter context"
2033
- type="search"
2034
- .value=${this.recordQuery}
2035
- @input=${this.onContextQueryInput}
2036
- >
2037
- </label>
2038
- <span class="ai-record-count">${i.length} terms</span>
2039
- </div>
2040
- ${w(n||i.length>0,()=>h`
2041
- <div class="ai-context-summary">
2042
- <h2>${e.context.title}</h2>
2043
- <p>${e.context.summary}</p>
2044
- </div>
2045
- <div class="ai-record-list">
2046
- ${w(i.length>0,()=>P(i,o=>o.term,o=>h`
2047
- <article class="ai-context-term">
2048
- <h3>${o.term}</h3>
2049
- <p>${o.definition}</p>
2050
- ${w(o.avoid.length>0,()=>h`<p class="ai-context-avoid">Avoid: ${o.avoid.join(", ")}</p>`,()=>I)}
2051
- </article>
2052
- `),()=>h`<div class="ai-empty">No glossary terms match this filter.</div>`)}
2053
- </div>
2054
- `,()=>h`<div class="ai-empty">No inherited context matches this filter.</div>`)}
2055
- </section>
2056
- `}renderIssueTreeNode(e){const t=this.collapsedIssueIds.has(e.issue.id);return h`
2057
- <div class="ai-issue-tree-node">
2058
- <div class="ai-issue-tree-row">
2059
- ${w(e.children.length>0,()=>h`
2060
- <button
2061
- class="branch-toggle"
2062
- data-id=${e.issue.id}
2063
- aria-expanded=${String(!t)}
2064
- @click=${this.onToggleIssueBranch}
2065
- >
2066
- ${t?"+":"-"}
2067
- </button>
2068
- `,()=>h`<span class="branch-spacer"></span>`)}
2069
- ${this.renderRef(e.issue)}
2070
- </div>
2071
- ${w(e.children.length>0&&!t,()=>h`
2072
- <div class="ai-issue-tree-children">
2073
- ${P(e.children,s=>s.issue.id,s=>this.renderIssueTreeNode(s))}
2074
- </div>
2075
- `,()=>I)}
2076
- </div>
2077
- `}renderIssueTree(e){return h`${P(e,t=>t.issue.id,t=>this.renderIssueTreeNode(t))}`}renderIssueTreeForRecords(e,t,s){const i=new Set(s.map(n=>n.id));return this.renderIssueTree(this.filterIssueTree(this.issueTreeForRecords(e,t),i))}renderRefSections(e){return h`
2078
- ${P(e,t=>t.key,t=>h`
2079
- <section class="ai-sec">
2080
- <h2>${t.title}</h2>
2081
- <div class="ai-refs">
2082
- ${P(t.records,s=>s.id,s=>this.renderRef(s,t.crossLink))}
2083
- </div>
2084
- </section>
2085
- `)}
2086
- `}renderGraphTab(e){return h`
2087
- <div class="ai-graph-wrap">
2088
- <div class="ai-graph-legend">
2089
- <agent-issues-relationship-graph-filters
2090
- .kinds=${[...st]}
2091
- .visibleKinds=${this.visibleGraphKinds}
2092
- @graph-kind-toggle=${this.onToggleGraphKind}
2093
- ></agent-issues-relationship-graph-filters>
2094
- </div>
2095
- ${w(e.nodes.length>0,()=>h`
2096
- <div class="ai-graph-host">
2097
- <agent-issues-relationship-graph
2098
- .graph=${e}
2099
- @node-open=${this.onNodeOpen}
2100
- ></agent-issues-relationship-graph>
2101
- </div>
2102
- `,()=>h`<div class="ai-empty">No graph records match the selected filters.</div>`)}
2103
- </div>
2104
- `}renderTabButton(e,t,s,i){const n=this.entityId??this.store?.selectedId.get(),o=i===void 0?t:`${t}: ${i} records`;return n?h`
2105
- <button
2106
- aria-label=${o}
2107
- aria-controls=${this.getTabPanelId(n,e)}
2108
- aria-selected=${String(s)}
2109
- class=${Q({active:s,"ai-subtab":!0})}
2110
- data-tab=${e}
2111
- id=${this.getTabButtonId(n,e)}
2112
- @click=${this.onSetIssueTab}
2113
- role="tab"
2114
- >
2115
- <span class="ai-subtab-label">${t}</span>
2116
- ${w(i!==void 0,()=>h`<span aria-hidden="true" class="ai-subtab-count">${i}</span>`,()=>I)}
2117
- </button>
2118
- `:h``}displayUser(e){const t=this.store?.snapshot.get()?.users.find(s=>s.id===e);return t?.displayName??t?.authenticationSubject??e}renderIssueComment(e){return h`
2119
- <article
2120
- class="ai-comment"
2121
- data-comment-id=${e.id}
2122
- tabindex="-1"
2123
- >
2124
- <div class="ai-comment-reference">${e.reference}</div>
2125
- ${w(e.tombstone,()=>h`<div class="ai-comment-deleted">Deleted ${e.updatedAt}</div>`,()=>h`<div class="ai-comment-body">${e.body??""}</div>`)}
2126
- <div class="ai-comment-provenance">
2127
- Created by ${this.displayUser(e.createdBy)}
2128
- Updated by ${this.displayUser(e.updatedBy)}
2129
- </div>
2130
- ${w(e.referencedIssueIds.length>0,()=>h`<div class="ai-comment-references">References: ${e.referencedIssueIds.join(", ")}</div>`,()=>I)}
2131
- </article>
2132
- `}renderPlanEntry(e){const t=this.store?.snapshot.get()?.planEntries??[],s=new Map(t.map(o=>[o.id,o])),i=e.referencedEntityIds.map(o=>({entity:this.store?.entityForId(o),id:o})),n=e.supersededEntryIds.map(o=>{const a=s.get(o);return{id:o,label:a?.shortReference??a?.reference??o,reference:a?.reference??o}});return h`
2133
- <article
2134
- class="ai-plan-entry"
2135
- data-plan-entry-id=${e.id}
2136
- tabindex="-1"
2137
- >
2138
- <header class="ai-plan-entry-header">
2139
- <span
2140
- class="ai-plan-entry-reference"
2141
- title=${e.reference}
2142
- >
2143
- ${e.shortReference??e.reference}
2144
- </span>
2145
- </header>
2146
- ${w(e.tombstone,()=>h`<div class="ai-plan-entry-deleted">Deleted entry</div>`,()=>h`<div class="ai-plan-entry-body">${e.body??""}</div>`)}
2147
- ${w(i.length>0||n.length>0,()=>h`
2148
- <footer class="ai-plan-entry-meta">
2149
- ${w(i.length>0,()=>h`
2150
- <div class="ai-plan-entry-meta-row">
2151
- <span class="ai-plan-entry-meta-label">References</span>
2152
- <span class="ai-plan-entry-link-list">
2153
- ${P(i,({id:o})=>o,({entity:o,id:a})=>w(o!==null,()=>h`
2154
- <button
2155
- class="ai-plan-entry-link"
2156
- data-id=${a}
2157
- @click=${this.onSelectEntityClick}
2158
- >
2159
- ${this.store?.shortRef(o)} ${o.title}
2160
- </button>
2161
- `,()=>h`<span class="ai-plan-entry-unresolved">${a}</span>`))}
2162
- </span>
2163
- </div>
2164
- `,()=>I)}
2165
- ${w(n.length>0,()=>h`
2166
- <div class="ai-plan-entry-meta-row">
2167
- <span class="ai-plan-entry-meta-label">Supersedes</span>
2168
- <span class="ai-plan-entry-link-list">
2169
- ${P(n,({id:o})=>o,({id:o,label:a,reference:l})=>h`
2170
- <button
2171
- aria-label=${`Go to superseded Plan entry ${a}`}
2172
- class="ai-plan-entry-link"
2173
- data-plan-entry-id=${o}
2174
- title=${l}
2175
- @click=${this.onPlanEntryJump}
2176
- >
2177
- ${a}
2178
- </button>
2179
- `)}
2180
- </span>
2181
- </div>
2182
- `,()=>I)}
2183
- </footer>
2184
- `,()=>I)}
2185
- </article>
2186
- `}render(){const e=this.store;if(!e)return I;const t=this.entityId??e.selectedId.get(),s=e.entityForId(t);if(!s)return I;e.selectedNestedTarget.get()?.type==="plan-entry"&&(this.entityDetailTab="plan");const i=e.bundleForEntityId(t),n=e.activeSection.get()==="adrs",o=n?"ADRs":i?.initiative.title??"Initiatives",a=n?"ADRs":i?.initiative.title??"Workspace",l=e.detailMetaFor(s.id),u=Xl(e,s,this);return h`
2187
- <div class="detail-inner">
2188
- ${w(!this.cascade,()=>h`
2189
- <button
2190
- class="ai-back"
2191
- @click=${this.onBackClick}
2192
- >
2193
- ← Back to ${o}
2194
- </button>
2195
- `)}
2196
- <div class="ai-crumbs">${e.selectedTenantDisplayName.get()} · ${a}</div>
2197
- <div class="ai-kind">${e.formatKindLabel(s.kind)}</div>
2198
- <h1 class="ai-d-title">
2199
- ${s.title}
2200
- <span class=${`badge ${e.badgeTone(s.status)}`}>${s.status}</span>
2201
- <span class="ai-id">${e.shortRef(s)}</span>
2202
- </h1>
2203
- <div class="ai-meta">
2204
- ${P(l,([d])=>d,([d,p])=>h`
2205
- <div class="m">
2206
- <span class="k">${d}</span>
2207
- <span class="v">${p}</span>
2208
- </div>
2209
- `)}
2210
- </div>
2211
- ${u.renderDetail()}
2212
- </div>
2213
- `}};Jt.properties={store:{attribute:!1},entityId:{attribute:!1},cascade:{attribute:!1},activeChildId:{attribute:!1}},Jt.styles=[os,vi,ue`
2214
- :host {
2215
- display: block;
2216
- }
2217
- .detail-inner {
2218
- max-width: 920px;
2219
- margin: 0 auto;
2220
- padding: 28px 32px 64px;
2221
- }
2222
- .ai-back {
2223
- display: inline-flex;
2224
- gap: 6px;
2225
- align-items: center;
2226
- margin-bottom: 12px;
2227
- border: 0;
2228
- background: none;
2229
- color: var(--muted);
2230
- cursor: pointer;
2231
- font: inherit;
2232
- }
2233
- .ai-back:hover {
2234
- color: var(--accent);
2235
- }
2236
- .ai-crumbs {
2237
- margin-bottom: 12px;
2238
- color: var(--muted);
2239
- font-size: 12px;
2240
- }
2241
- .ai-kind {
2242
- color: var(--muted);
2243
- font-size: 12px;
2244
- font-weight: 700;
2245
- letter-spacing: 0.04em;
2246
- text-transform: uppercase;
2247
- }
2248
- .ai-d-title {
2249
- display: flex;
2250
- flex-wrap: wrap;
2251
- gap: 12px;
2252
- align-items: center;
2253
- margin: 6px 0 0;
2254
- font-size: 24px;
2255
- }
2256
- .ai-d-title .ai-id {
2257
- color: var(--muted);
2258
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
2259
- font-size: 14px;
2260
- font-weight: 400;
2261
- }
2262
- .ai-meta {
2263
- display: flex;
2264
- flex-wrap: wrap;
2265
- gap: 28px;
2266
- margin: 16px 0 4px;
2267
- padding: 14px 0;
2268
- border-top: 1px solid var(--border-muted);
2269
- border-bottom: 1px solid var(--border-muted);
2270
- }
2271
- .ai-meta .m {
2272
- display: flex;
2273
- flex-direction: column;
2274
- gap: 3px;
2275
- }
2276
- .ai-meta .m .k {
2277
- color: var(--muted);
2278
- font-size: 11px;
2279
- font-weight: 600;
2280
- letter-spacing: 0.04em;
2281
- text-transform: uppercase;
2282
- }
2283
- .ai-meta .m .v {
2284
- font-weight: 600;
2285
- }
2286
- .ai-subtabs {
2287
- display: flex;
2288
- flex-wrap: wrap;
2289
- gap: 18px;
2290
- margin-top: 22px;
2291
- border-bottom: 1px solid var(--border-muted);
2292
- }
2293
- .ai-subtab {
2294
- position: relative;
2295
- flex: 0 0 auto;
2296
- padding: 8px 24px;
2297
- border: 0;
2298
- border-bottom: 2px solid transparent;
2299
- background: transparent;
2300
- color: var(--muted);
2301
- cursor: pointer;
2302
- font: inherit;
2303
- text-align: center;
2304
- }
2305
- .ai-subtab-count {
2306
- box-sizing: border-box;
2307
- display: inline-grid;
2308
- min-width: 16px;
2309
- height: 16px;
2310
- padding: 0 3px;
2311
- place-items: center;
2312
- position: absolute;
2313
- top: 1px;
2314
- right: 1px;
2315
- border-radius: 50%;
2316
- background: var(--accent);
2317
- color: var(--surface);
2318
- font-size: 10px;
2319
- font-weight: 700;
2320
- line-height: 1;
2321
- }
2322
- .ai-subtab.active {
2323
- border-bottom-color: var(--accent);
2324
- color: var(--text);
2325
- font-weight: 600;
2326
- }
2327
- .ai-record-tab {
2328
- margin-top: 18px;
2329
- border: 1px solid var(--border);
2330
- border-radius: 10px;
2331
- background: var(--surface);
2332
- }
2333
- .ai-record-toolbar {
2334
- display: flex;
2335
- gap: 12px;
2336
- align-items: end;
2337
- padding: 12px 16px;
2338
- border-bottom: 1px solid var(--border-muted);
2339
- }
2340
- .ai-record-filter {
2341
- display: grid;
2342
- gap: 4px;
2343
- }
2344
- .ai-record-filter:first-child {
2345
- flex: 1;
2346
- }
2347
- .ai-record-filter > span {
2348
- color: var(--muted);
2349
- font-size: 12px;
2350
- font-weight: 600;
2351
- }
2352
- .ai-record-filter input,
2353
- .ai-record-filter select {
2354
- box-sizing: border-box;
2355
- min-height: 32px;
2356
- padding: 6px 8px;
2357
- border: 1px solid var(--border);
2358
- border-radius: 6px;
2359
- background: var(--surface);
2360
- color: var(--text);
2361
- font: inherit;
2362
- }
2363
- .ai-record-view-toggle {
2364
- display: inline-flex;
2365
- align-self: end;
2366
- overflow: hidden;
2367
- border: 1px solid var(--border);
2368
- border-radius: 6px;
2369
- }
2370
- .ai-record-view-button {
2371
- min-height: 32px;
2372
- padding: 6px 10px;
2373
- border: 0;
2374
- border-right: 1px solid var(--border);
2375
- background: var(--surface);
2376
- color: var(--muted);
2377
- cursor: pointer;
2378
- font: inherit;
2379
- }
2380
- .ai-record-view-button:last-child {
2381
- border-right: 0;
2382
- }
2383
- .ai-record-view-button.active {
2384
- background: var(--surface-muted);
2385
- color: var(--text);
2386
- font-weight: 600;
2387
- }
2388
- .ai-record-count {
2389
- padding-bottom: 7px;
2390
- color: var(--muted);
2391
- font-size: 12px;
2392
- white-space: nowrap;
2393
- }
2394
- .ai-record-list,
2395
- .ai-record-tree {
2396
- display: grid;
2397
- gap: 8px;
2398
- padding: 8px;
2399
- }
2400
- .ai-context-summary {
2401
- padding: 14px 16px 0;
2402
- }
2403
- .ai-context-summary h2,
2404
- .ai-context-term h3 {
2405
- margin: 0;
2406
- font-size: 14px;
2407
- }
2408
- .ai-context-summary p,
2409
- .ai-context-term p {
2410
- margin: 6px 0 0;
2411
- color: var(--muted);
2412
- font-size: 13px;
2413
- }
2414
- .ai-context-avoid {
2415
- color: var(--danger);
2416
- }
2417
- .ai-context-term {
2418
- padding: 10px 8px;
2419
- border-bottom: 1px solid var(--border-muted);
2420
- }
2421
- .ai-context-term:last-child {
2422
- border-bottom: 0;
2423
- }
2424
- .ai-graph-wrap {
2425
- margin-top: 18px;
2426
- border: 1px solid var(--border);
2427
- border-radius: 10px;
2428
- background:
2429
- radial-gradient(circle, rgba(208, 215, 222, 0.5) 1px, transparent 1px) 0 0 / 22px 22px,
2430
- var(--surface);
2431
- overflow: auto;
2432
- }
2433
- .ai-graph-legend {
2434
- display: flex;
2435
- gap: 16px;
2436
- flex-wrap: wrap;
2437
- padding: 10px 14px;
2438
- border-bottom: 1px solid var(--border-muted);
2439
- background: var(--surface);
2440
- }
2441
- .ai-graph-host {
2442
- width: max-content;
2443
- min-width: 100%;
2444
- padding: 14px 0;
2445
- }
2446
- .ai-sec {
2447
- margin-top: 24px;
2448
- }
2449
- .ai-sec h2 {
2450
- margin: 0 0 10px;
2451
- font-size: 15px;
2452
- }
2453
- .ai-conversation {
2454
- display: grid;
2455
- gap: 12px;
2456
- }
2457
- .ai-comment {
2458
- padding: 12px;
2459
- border: 1px solid var(--border-muted);
2460
- border-radius: 6px;
2461
- }
2462
- .ai-comment:focus {
2463
- outline: 2px solid var(--focus-ring);
2464
- outline-offset: -2px;
2465
- }
2466
- .ai-comment.is-comment-target {
2467
- animation: plan-entry-target 1.8s ease-out;
2468
- }
2469
- .ai-comment-reference,
2470
- .ai-comment-references,
2471
- .ai-comment-provenance,
2472
- .ai-comment-deleted {
2473
- color: var(--muted);
2474
- font-size: 12px;
2475
- }
2476
- .ai-comment-reference,
2477
- .ai-comment-references {
2478
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
2479
- }
2480
- .ai-comment-deleted {
2481
- margin: 8px 0;
2482
- font-style: italic;
2483
- }
2484
- .ai-comment-provenance {
2485
- display: grid;
2486
- gap: 2px;
2487
- }
2488
- .ai-comment-body {
2489
- margin: 8px 0;
2490
- white-space: pre-wrap;
2491
- }
2492
- .ai-plan-current,
2493
- .ai-plan-history {
2494
- display: grid;
2495
- gap: 12px;
2496
- }
2497
- .ai-plan-group {
2498
- border-top: 1px solid var(--border-muted);
2499
- }
2500
- .ai-plan-group:last-of-type {
2501
- border-bottom: 1px solid var(--border-muted);
2502
- }
2503
- .ai-plan-group summary,
2504
- .ai-plan-history summary {
2505
- display: flex;
2506
- gap: 8px;
2507
- align-items: center;
2508
- justify-content: space-between;
2509
- padding: 10px 0;
2510
- font-size: 13px;
2511
- font-weight: 700;
2512
- cursor: pointer;
2513
- }
2514
- .ai-plan-count {
2515
- min-width: 24px;
2516
- padding: 2px 7px;
2517
- border-radius: 999px;
2518
- background: var(--surface-strong);
2519
- color: var(--muted);
2520
- font-size: 11px;
2521
- text-align: center;
2522
- }
2523
- .ai-plan-entries {
2524
- display: grid;
2525
- gap: 2px;
2526
- overflow: hidden;
2527
- margin-bottom: 12px;
2528
- border: 1px solid var(--border-muted);
2529
- border-radius: 6px;
2530
- background: var(--border-muted);
2531
- }
2532
- @supports (row-rule: 2px solid transparent) {
2533
- .ai-plan-entries {
2534
- background: transparent;
2535
- row-rule: 2px solid var(--border-muted);
2536
- }
2537
- .ai-plan-entries[data-plan-group="decisions"] {
2538
- row-rule: none;
2539
- }
2540
- }
2541
- .ai-plan-entries[data-plan-group="decisions"] {
2542
- gap: 12px;
2543
- overflow: visible;
2544
- padding: 10px;
2545
- border: 0;
2546
- border-radius: 0;
2547
- background: var(--surface-muted);
2548
- }
2549
- .ai-plan-entry {
2550
- display: grid;
2551
- gap: 10px;
2552
- padding: 14px 16px;
2553
- background: var(--surface);
2554
- }
2555
- .ai-plan-decision-pair {
2556
- display: grid;
2557
- overflow: hidden;
2558
- border: 1px solid var(--border-muted);
2559
- border-radius: 6px;
2560
- background: var(--surface);
2561
- box-shadow: 0 1px 2px rgba(31, 35, 40, 0.05);
2562
- }
2563
- .ai-plan-decision-question {
2564
- background: var(--surface-muted);
2565
- }
2566
- .ai-plan-decision-question .ai-plan-entry {
2567
- background: transparent;
2568
- }
2569
- .ai-plan-decision-answer {
2570
- border-top: 2px solid var(--border-muted);
2571
- }
2572
- .ai-plan-decision-pair-label {
2573
- padding: 12px 16px 0;
2574
- color: var(--muted);
2575
- font-size: 10px;
2576
- font-weight: 700;
2577
- letter-spacing: 0.04em;
2578
- text-transform: uppercase;
2579
- }
2580
- .ai-plan-entry:focus {
2581
- outline: 2px solid var(--focus-ring);
2582
- outline-offset: -2px;
2583
- }
2584
- .ai-plan-entry.is-plan-entry-target {
2585
- animation: plan-entry-target 1.8s ease-out;
2586
- }
2587
- .ai-plan-entry-meta {
2588
- display: grid;
2589
- gap: 8px;
2590
- padding-top: 10px;
2591
- border-top: 1px solid var(--border-muted);
2592
- color: var(--muted);
2593
- font-size: 11px;
2594
- }
2595
- .ai-plan-entry-header {
2596
- display: flex;
2597
- align-items: center;
2598
- }
2599
- .ai-plan-entry-reference {
2600
- display: inline-flex;
2601
- width: max-content;
2602
- padding: 3px 8px;
2603
- border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
2604
- border-radius: 999px;
2605
- background: var(--accent-soft);
2606
- color: var(--accent);
2607
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
2608
- font-size: 10px;
2609
- font-weight: 700;
2610
- }
2611
- .ai-plan-entry-meta-row {
2612
- display: grid;
2613
- grid-template-columns: 70px minmax(0, 1fr);
2614
- gap: 10px;
2615
- align-items: baseline;
2616
- }
2617
- .ai-plan-entry-link-list {
2618
- display: flex;
2619
- flex-wrap: wrap;
2620
- gap: 5px 12px;
2621
- min-width: 0;
2622
- overflow-wrap: anywhere;
2623
- }
2624
- .ai-plan-entry-meta-label {
2625
- font-weight: 700;
2626
- }
2627
- .ai-plan-entry-link {
2628
- padding: 0;
2629
- border: 0;
2630
- background: transparent;
2631
- color: var(--accent);
2632
- cursor: pointer;
2633
- font: inherit;
2634
- font-weight: 600;
2635
- text-align: left;
2636
- }
2637
- .ai-plan-entry-link:hover {
2638
- text-decoration: underline;
2639
- }
2640
- .ai-plan-entry-link:focus-visible {
2641
- outline: 2px solid var(--focus-ring);
2642
- outline-offset: 2px;
2643
- }
2644
- .ai-plan-entry-unresolved {
2645
- overflow-wrap: anywhere;
2646
- }
2647
- .ai-plan-entry-deleted {
2648
- color: var(--muted);
2649
- font-style: italic;
2650
- }
2651
- .ai-plan-entry-body {
2652
- line-height: 1.55;
2653
- overflow-wrap: anywhere;
2654
- white-space: pre-wrap;
2655
- }
2656
- @keyframes plan-entry-target {
2657
- 0% {
2658
- background: color-mix(in srgb, var(--accent-soft) 72%, var(--surface));
2659
- box-shadow: inset 3px 0 0 var(--accent);
2660
- }
2661
- 100% {
2662
- background: var(--surface);
2663
- box-shadow: inset 3px 0 0 transparent;
2664
- }
2665
- }
2666
- .ai-body {
2667
- max-width: 75ch;
2668
- line-height: 1.6;
2669
- }
2670
- .ai-body-source {
2671
- display: flex;
2672
- gap: 10px;
2673
- align-items: center;
2674
- margin-bottom: 14px;
2675
- padding: 10px 12px;
2676
- border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
2677
- border-radius: 10px;
2678
- background: color-mix(in srgb, var(--surface-muted) 76%, white 24%);
2679
- }
2680
- .ai-body-source-badge {
2681
- padding: 4px 8px;
2682
- border-radius: 999px;
2683
- background: color-mix(in srgb, var(--accent) 16%, white 84%);
2684
- color: var(--accent-strong, var(--accent));
2685
- font-size: 11px;
2686
- font-weight: 700;
2687
- letter-spacing: 0.04em;
2688
- text-transform: uppercase;
2689
- }
2690
- .ai-body-source-copy {
2691
- color: var(--muted);
2692
- font-size: 12px;
2693
- font-weight: 600;
2694
- }
2695
- .ai-body > :first-child {
2696
- margin-top: 0;
2697
- }
2698
- .ai-body > :last-child {
2699
- margin-bottom: 0;
2700
- }
2701
- .ai-body h1,
2702
- .ai-body h2,
2703
- .ai-body h3 {
2704
- margin: 22px 0 10px;
2705
- line-height: 1.3;
2706
- }
2707
- .ai-body h1 {
2708
- font-size: 19px;
2709
- }
2710
- .ai-body h2 {
2711
- font-size: 16px;
2712
- }
2713
- .ai-body h3 {
2714
- font-size: 14px;
2715
- }
2716
- .ai-body p {
2717
- margin: 0 0 12px;
2718
- color: var(--text);
2719
- }
2720
- .ai-body ul,
2721
- .ai-body ol {
2722
- margin: 0 0 12px;
2723
- padding-left: 18px;
2724
- line-height: 1.7;
2725
- }
2726
- .ai-body a {
2727
- color: var(--accent);
2728
- }
2729
- .ai-body code {
2730
- padding: 2px 5px;
2731
- border-radius: 5px;
2732
- background: var(--surface-muted);
2733
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
2734
- font-size: 0.9em;
2735
- }
2736
- .ai-body pre {
2737
- overflow: auto;
2738
- margin: 0 0 12px;
2739
- padding: 12px 14px;
2740
- border: 1px solid var(--border-muted);
2741
- border-radius: 8px;
2742
- background: var(--surface-muted);
2743
- }
2744
- .ai-body pre code {
2745
- padding: 0;
2746
- background: none;
2747
- }
2748
- .ai-body blockquote {
2749
- margin: 0 0 12px;
2750
- padding: 2px 0 2px 14px;
2751
- border-left: 3px solid var(--border);
2752
- color: var(--muted);
2753
- }
2754
- .ai-refs {
2755
- display: grid;
2756
- gap: 8px;
2757
- }
2758
- .ai-story-block {
2759
- display: grid;
2760
- gap: 10px;
2761
- }
2762
- .ai-story-issues {
2763
- display: grid;
2764
- gap: 8px;
2765
- margin-left: 18px;
2766
- padding-left: 14px;
2767
- border-left: 1px solid var(--border-muted);
2768
- }
2769
- .ai-issue-tree {
2770
- display: grid;
2771
- gap: 8px;
2772
- }
2773
- .ai-issue-tree-node {
2774
- display: grid;
2775
- gap: 8px;
2776
- }
2777
- .ai-issue-tree-row {
2778
- display: flex;
2779
- gap: 8px;
2780
- align-items: flex-start;
2781
- }
2782
- .ai-issue-tree-children {
2783
- display: grid;
2784
- gap: 8px;
2785
- margin-left: 18px;
2786
- padding-left: 14px;
2787
- border-left: 1px solid var(--border-muted);
2788
- }
2789
- .branch-toggle,
2790
- .branch-spacer {
2791
- flex-shrink: 0;
2792
- width: 24px;
2793
- height: 24px;
2794
- margin-top: 10px;
2795
- }
2796
- .branch-toggle {
2797
- border: 1px solid var(--border-muted);
2798
- border-radius: 6px;
2799
- background: var(--surface);
2800
- color: var(--muted);
2801
- cursor: pointer;
2802
- font: inherit;
2803
- line-height: 1;
2804
- }
2805
- .branch-toggle:hover {
2806
- border-color: var(--accent);
2807
- color: var(--accent);
2808
- }
2809
- .ai-ref {
2810
- display: flex;
2811
- gap: 12px;
2812
- align-items: center;
2813
- width: stretch;
2814
- padding: 10px 12px;
2815
- border: 1px solid var(--border);
2816
- border-radius: 8px;
2817
- background: var(--surface);
2818
- color: inherit;
2819
- cursor: pointer;
2820
- font: inherit;
2821
- text-align: left;
2822
- }
2823
- .ai-ref:hover {
2824
- border-color: var(--accent);
2825
- background: var(--surface-muted);
2826
- }
2827
- .ai-ref.is-active-ref {
2828
- border-color: var(--accent);
2829
- background: var(--surface-muted);
2830
- box-shadow: inset 3px 0 0 0 var(--accent);
2831
- }
2832
- .ai-ref .r-id {
2833
- min-width: 56px;
2834
- color: var(--muted);
2835
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
2836
- font-size: 12px;
2837
- }
2838
- .ai-ref .r-title {
2839
- flex: 1;
2840
- font-weight: 600;
2841
- }
2842
- .ai-empty {
2843
- color: var(--muted);
2844
- font-size: 13px;
2845
- }
2846
- @media (max-width: 700px) {
2847
- .detail-inner {
2848
- padding: 20px 16px 48px;
2849
- }
2850
- .ai-record-toolbar {
2851
- align-items: stretch;
2852
- flex-direction: column;
2853
- }
2854
- .ai-record-count {
2855
- padding-bottom: 0;
2856
- }
2857
- .ai-body-source {
2858
- flex-direction: column;
2859
- align-items: flex-start;
2860
- }
2861
- }
2862
- `];let ai=Jt;customElements.define("agent-issues-detail-view",ai);const sc="0123456789ABCDEFGHJKMNPQRSTVWXYZ",ic=6,tn=5,rc="agent-issues-global-search-recents",nc=[{key:"questions",title:"Questions"},{key:"decisions",title:"Decisions"},{key:"includedScope",title:"Included scope"},{key:"excludedScope",title:"Excluded scope"},{key:"constraints",title:"Constraints"},{key:"preferences",title:"Preferences"},{key:"considerations",title:"Considerations"}],oc={project:"PROJ",epic:"EPIC",version:"VER",initiative:"INIT",prd:"PRD",userStory:"US",adr:"ADR",issue:"ISS",debt:"DEBT",handoff:"HO"};function ac(r){if(r.shortReference)return r.shortReference;const e=oc[r.kind]??r.kind.slice(0,4).toUpperCase();let t=2166136261;for(let n=0;n<r.id.length;n+=1)t^=r.id.charCodeAt(n),t=Math.imul(t,16777619);let s=BigInt(t>>>0),i="";for(let n=0;n<ic;n+=1)i=sc[Number(s&31n)]+i,s>>=5n;return`${e}_${i}`}function lc(r){if(!r||typeof r!="object"||!("type"in r))return!1;const e=r;return e.type==="entity"?typeof e.entityId=="string":e.type==="plan-entry"?typeof e.planId=="string"&&typeof e.entryId=="string":e.type==="issue-comment"?typeof e.issueId=="string"&&typeof e.commentId=="string":(e.type==="context"||e.type==="context-term"&&typeof e.term=="string")&&(e.scopeRef===void 0||typeof e.scopeRef=="string")}function sn(r,e){const t=r.nodes.filter(o=>e.has(o.kind)),s=new Set(t.map(o=>o.key)),i=[...new Set(t.map(o=>o.col))].sort((o,a)=>o-a),n=new Map(i.map((o,a)=>[o,a]));return{columns:i.map(o=>r.columns[o]),edges:r.edges.filter(o=>s.has(o.from)&&s.has(o.to)),nodes:t.map(o=>({...o,col:n.get(o.col)}))}}class cc{constructor(){this.config=L(null),this.snapshot=L(null),this.projectDiscovery=L(null),this.search=L(""),this.globalSearchCapability=L(null),this.globalSearchQuery=L(""),this.globalSearchScope=L("current-project"),this.globalSearchSourceTypes=L(["entity","context","context-term","plan-entry","issue-comment"]),this.globalSearchResponse=L(null),this.globalSearchResults=L([]),this.globalSearchRecents=L([]),this.globalSearchProgress=L(!1),this.globalSearchOpen=L(!1),this.contextSearch=L(""),this.contextTab=L("all"),this.selectedContextInitiativeId=L(null),this.visibleProjectGraphKinds=L(new Set(st)),this.initiativeStatusFilter=L("all"),this.adrStatusFilter=L("all"),this.debtLifecycleFilter=L("open"),this.debtCategoryFilter=L("all"),this.debtPriorityFilter=L("all"),this.kindFilter=L("all"),this.selectedTenant=L(null),this.selectedProjectId=L(null),this.selectedInitiativeId=L(null),this.selectedId=L(null),this.selectedNestedTarget=L(null),this.cascadePath=L([]),this.cascadeAvailableWidth=L(0),this.cascadeWindowStart=L(null),this.reRootTrail=L([]),this.railCollapsed=L(!1),this.masterCollapsedOverride=L(null),this.collapsedEpicIdsByProject=L(new Map),this.syncLabel=L("loading"),this.errorMessage=L(null),this.activeView=L("overview"),this.activePage=L("list"),this.activeRootTab=L("initiatives"),this.activeSection=L("initiatives"),this.initTab=L("overview"),this.globalSearchAbortController=null,this.globalSearchProgressTimer=null,this.globalSearchRequestTimer=null,this.tenantById=O(()=>new Map((this.config.get()?.availableTenants??[]).map(e=>[e.id,e]))),this.tenantOptions=O(()=>{const e=new Map(this.tenantById.get()),t=this.selectedTenant.get();return t&&!e.has(t)&&e.set(t,{displayName:this.formatTenantDisplayName(t),id:t}),[...e.values()].sort((s,i)=>s.displayName.localeCompare(i.displayName))}),this.selectedTenantDisplayName=O(()=>{const e=this.selectedTenant.get();return e?this.tenantById.get().get(e)?.displayName??this.formatTenantDisplayName(e):null}),this.selectedProjectDisplayName=O(()=>{const e=this.selectedProjectId.get();if(!e)return null;const t=this.projectDiscovery.get();return t?.kind!=="available"?e:t.projects.find(s=>s.project.id===e)?.project.title??e}),this.entityById=O(()=>{const e=this.snapshot.get();if(!e)return new Map;const t=e.initiatives.flatMap(s=>[s.initiative,...s.prds,...s.userStories,...s.adrs,...s.issues]);return new Map([...e.entities,...e.projectAdrs,...t].map(s=>[s.id,s]))}),this.globalSearchRecentRecords=O(()=>this.globalSearchRecents.get().flatMap(e=>{const t=this.snapshot.get();if(!t)return[];if(e.type==="entity"){const o=this.entityForId(e.entityId);return o?[{sourceType:"entity",target:e,title:o.title}]:[]}if(e.type==="plan-entry"){const o=t.planEntries?.find(a=>a.id===e.entryId&&a.planId===e.planId&&!a.tombstone);return o&&this.entityForId(e.planId)?[{sourceType:"plan-entry",target:e,title:o.body??"Plan entry"}]:[]}if(e.type==="issue-comment"){const o=t.issueComments[e.issueId]?.comments.find(a=>a.id===e.commentId&&!a.tombstone);return o&&this.entityForId(e.issueId)?[{sourceType:"issue-comment",target:e,title:o.body??"Comment"}]:[]}const s=[t.contexts.shared,...t.contexts.initiatives],i=e.scopeRef?s.find(o=>o.context.key===e.scopeRef||o.context.scopeEntityId===e.scopeRef):t.contexts.shared;if(!i?.context.exists)return[];if(e.type==="context")return[{sourceType:"context",target:e,title:i.context.title}];const n=i.terms.find(o=>o.term===e.term);return n?[{sourceType:"context-term",target:e,title:n.term}]:[]})),this.cascadeColumns=O(()=>this.cascadePath.get().map(e=>this.entityForId(e)).filter(e=>!!e)),this.masterCollapsed=O(()=>{const e=this.masterCollapsedOverride.get();return e!==null?e:!1}),this.cascadeColumnWidth=480,this.cascadeColumnGap=16,this.cascadeColumnWindow=O(()=>{const e=this.cascadeColumns.get(),t=this.cascadeCapacityForWidth(this.cascadeAvailableWidth.get());if(e.length<=t)return{breadcrumb:[],columns:e};const s=e.length-t,i=this.cascadeWindowStart.get(),n=Math.min(Math.max(i??s,0),e.length-1);return{breadcrumb:e.slice(0,n),columns:e.slice(n)}}),this.selectedEntity=O(()=>this.entityForId(this.selectedId.get())),this.selectedBundle=O(()=>this.bundleForEntityId(this.selectedId.get())),this.selectedInitiativeBundle=O(()=>this.bundleForInitiativeId(this.selectedInitiativeId.get())),this.activeInitiativeId=O(()=>this.selectedInitiativeId.get()??this.selectedBundle.get()?.initiative.id??null),this.sharedContext=O(()=>this.snapshot.get()?.contexts.shared??null),this.initiativeContextById=O(()=>new Map((this.snapshot.get()?.contexts.initiatives??[]).filter(e=>!!e.context.scopeEntityId).map(e=>[e.context.scopeEntityId??e.context.key,e]))),this.selectedContext=O(()=>{const e=this.selectedBundle.get();return e?this.initiativeContextById.get().get(e.initiative.id)??null:this.sharedContext.get()}),this.projectContextTerms=O(()=>{const e=new Map;for(const t of[this.sharedContext.get(),...this.snapshot.get()?.contexts.initiatives??[]])if(t)for(const s of t.terms){const i=s.term.toLowerCase(),n={avoid:[...s.avoid],contextKey:t.context.key,contextTitle:t.context.title,definition:s.definition,scopeEntityId:t.context.scopeEntityId,scopeKind:t.context.scopeKind,scopeLabel:t.context.scopeLabel,updatedAt:s.updatedAt},o=e.get(i);if(!o){e.set(i,{term:s.term,sources:[n],hasSharedSource:t.context.scopeKind==="default",hasDuplicates:!1,hasConflictingDefinitions:!1});continue}o.sources.push(n),o.hasDuplicates=o.sources.length>1,o.hasSharedSource=o.hasSharedSource||t.context.scopeKind==="default",o.hasConflictingDefinitions=rn(o.sources),s.term.localeCompare(o.term)<0&&(o.term=s.term)}return[...e.values()].map(t=>({...t,sources:t.sources.sort(pc)})).sort((t,s)=>t.term.localeCompare(s.term))}),this.filteredProjectContextTerms=O(()=>{const e=this.contextSearch.get().trim().toLowerCase();return e?this.projectContextTerms.get().filter(t=>t.term.toLowerCase().includes(e)?!0:t.sources.some(s=>[s.scopeLabel,s.contextTitle,s.definition,...s.avoid].join(" ").toLowerCase().includes(e))):this.projectContextTerms.get()}),this.filteredInitiativeContextTerms=O(()=>{const e=this.selectedContextInitiativeId.get(),t=this.contextSearch.get().trim().toLowerCase();return this.projectContextTerms.get().map(s=>{const i=s.sources.filter(o=>o.scopeKind==="initiative"&&(!e||o.scopeEntityId===e));return i.length===0||!(!t||s.term.toLowerCase().includes(t)||i.some(o=>[o.scopeLabel,o.contextTitle,o.definition,...o.avoid].join(" ").toLowerCase().includes(t)))?null:{...s,sources:i,hasSharedSource:!1,hasDuplicates:i.length>1,hasConflictingDefinitions:rn(i)}}).filter(s=>s!==null)}),this.filteredSharedContext=O(()=>{const e=this.sharedContext.get();if(!e)return null;const t=this.contextSearch.get().trim().toLowerCase();if(!t)return e;const s=[e.context.key,e.context.scopeLabel,e.context.summary,e.context.title].join(" ").toLowerCase().includes(t),i=e.terms.filter(n=>[n.term,n.definition,...n.avoid].join(" ").toLowerCase().includes(t));return!s&&i.length===0?null:{context:{...e.context,summary:s?e.context.summary:""},terms:i}}),this.projectContextDuplicateCount=O(()=>this.projectContextTerms.get().filter(e=>e.hasDuplicates).length),this.selectedIncoming=O(()=>this.incomingRelationsFor(this.selectedId.get())),this.selectedOutgoing=O(()=>this.outgoingRelationsFor(this.selectedId.get())),this.relatedEntities=O(()=>{const e=new Set;for(const t of[...this.selectedIncoming.get(),...this.selectedOutgoing.get()])e.add(t.fromId),e.add(t.toId);return e.delete(this.selectedId.get()??""),this.sortEntities([...e].map(t=>this.entityById.get().get(t)).filter(t=>!!t))}),this.localGraphEntities=O(()=>{const e=this.selectedEntity.get();return e?[e,...this.relatedEntities.get()]:[]}),this.localGraphRelations=O(()=>{const e=new Set(this.localGraphEntities.get().map(t=>t.id));return(this.snapshot.get()?.relations??[]).filter(t=>e.has(t.fromId)&&e.has(t.toId))}),this.filteredEntities=O(()=>{const e=this.search.get().trim().toLowerCase(),t=this.kindFilter.get();return this.sortEntities((this.snapshot.get()?.entities??[]).filter(s=>t!=="all"&&s.kind!==t?!1:e?[s.id,s.kind,s.status,s.title].join(" ").toLowerCase().includes(e):!0))}),this.kindOptions=O(()=>["issue","all",...new Set((this.snapshot.get()?.entities??[]).map(e=>e.kind).filter(e=>e!=="issue"))]),this.rootTabCounts=O(()=>({adrs:(this.snapshot.get()?.entities??[]).filter(e=>e.kind==="adr").length,initiatives:this.snapshot.get()?.initiatives.length??0})),this.allDebtRecords=O(()=>this.sortEntities((this.snapshot.get()?.entities??[]).filter(e=>e.kind==="debt"))),this.debtRecords=O(()=>{const e=this.debtLifecycleFilter.get(),t=this.debtCategoryFilter.get(),s=this.debtPriorityFilter.get();return this.sortEntities(this.allDebtRecords.get().filter(i=>(e==="all"||i.status===e)&&(t==="all"||i.category===t)&&(s==="all"||i.priority===s)))}),this.projectInitiatives=O(()=>this.snapshot.get()?.initiatives??[]),this.epicInitiativeGroups=O(()=>{const e=this.snapshot.get();if(!e)return[];const t=new Map(e.initiatives.map(i=>[i.initiative.id,i])),s=new Map;for(const i of e.relations){if(i.type!=="contains"||!t.has(i.toId))continue;const n=s.get(i.fromId)??[];n.push(i.toId),s.set(i.fromId,n)}return this.sortEntities(e.entities.filter(i=>i.kind==="epic")).map(i=>{const n=(s.get(i.id)??[]).map(o=>t.get(o)).filter(o=>!!o);return{epic:i,initiatives:n,completedInitiativeCount:n.filter(o=>this.isDoneStatus(o.initiative.status)).length}}).filter(i=>i.initiatives.length>0)}),this.projectAdrs=O(()=>this.sortEntities((this.snapshot.get()?.entities??[]).filter(e=>e.kind==="adr"))),this.adrRailEntries=O(()=>{const e=this.snapshot.get();if(!e)return[];const t=this.sortEntities(e.projectAdrs).map(i=>({adr:i,scope:"project",scopeLabel:"project decision"})),s=e.initiatives.flatMap(i=>this.sortEntities(i.adrs).map(n=>({adr:n,scope:"initiative",scopeLabel:`initiative ${i.initiative.title}`})));return[...t,...s]}),this.projectStoryCount=O(()=>this.projectInitiatives.get().reduce((e,t)=>e+t.userStories.length,0)),this.projectIssueCount=O(()=>this.projectInitiatives.get().reduce((e,t)=>e+t.issues.length,0)),this.projectDescription=O(()=>this.sharedContext.get()?.context.summary??this.selectedTenantDisplayName.get()??""),this.orphanIds=O(()=>new Set((this.snapshot.get()?.orphans??[]).map(e=>e.id))),this.connected=!1,this.events=null,this.pollTimer=null,this.onHashChange=()=>{const e=this.applyRoute(this.readRoute());this.writeRoute(e,!0)},this.onPopState=async()=>{const e=this.readRoute();if(e.tenantId!==this.selectedTenant.get()||e.projectId!==this.selectedProjectId.get()){await this.navigateToRoute(e);return}this.applyRoute(e)},this.onBrowserNavigation=async()=>{await this.navigateToRoute(this.readRoute()),new URLSearchParams(new URL(window.location.href).hash.slice(1)).has("cascade")&&this.writeRoute(this.currentRoute(),!0)},this.setSearchFromEvent=e=>{this.search.set(e.target.value)},this.setKindFilterFromEvent=e=>{this.kindFilter.set(e.target.value)},this.setTenantFromEvent=e=>{const t=e.target.value;this.selectTenant(t)},this.selectEntityFromEvent=e=>{const t=e.currentTarget.dataset.id;t&&this.selectEntity(t)},this.openViewFromEvent=e=>{const t=e.currentTarget.dataset.view;t&&this.activeView.set(t)},this.selectInitiativeFromEvent=e=>{const t=e.currentTarget.dataset.id;t&&this.selectInitiative(t)}}entityForId(e){return e?this.entityById.get().get(e)??null:null}openGlobalSearch(){this.globalSearchOpen.set(!0),this.globalSearchRecents.set(this.readGlobalSearchRecents()),this.reloadGlobalSearchCapability()}closeGlobalSearch(){this.globalSearchOpen.set(!1),this.setGlobalSearchQuery("")}setGlobalSearchQuery(e){if(this.globalSearchQuery.set(e),this.globalSearchResponse.set(null),this.globalSearchProgress.set(!1),this.cancelGlobalSearchRequest(),!e.trim()){this.globalSearchResults.set([]);return}this.globalSearchRequestTimer=window.setTimeout(()=>{this.requestGlobalSearch(e)},150)}setGlobalSearchScope(e){this.globalSearchScope.set(e),this.setGlobalSearchQuery(this.globalSearchQuery.get())}setGlobalSearchSourceTypes(e){this.globalSearchSourceTypes.set(e),this.setGlobalSearchQuery(this.globalSearchQuery.get())}async retryGlobalSearch(){const e=this.globalSearchQuery.get();e.trim()&&await this.requestGlobalSearch(e)}async reloadGlobalSearchCapability(){const e=this.selectedTenant.get();if(!e){this.globalSearchCapability.set(null);return}try{const t=await fetch(`/api/search/capability?${new URLSearchParams({tenant:e})}`,{cache:"no-store"});if(!t.ok)throw new Error("Global search capability request failed.");const s=await t.json();this.selectedTenant.get()===e&&this.globalSearchCapability.set(s)}catch{this.globalSearchCapability.set(null)}}async requestGlobalSearch(e){if(e!==this.globalSearchQuery.get())return;const t=this.selectedTenant.get(),s=this.selectedProjectId.get();if(!t||!s)return;const i=new AbortController;this.globalSearchAbortController=i,this.globalSearchProgressTimer=window.setTimeout(()=>{this.globalSearchAbortController===i&&this.globalSearchProgress.set(!0)},150);const n=new URLSearchParams({tenant:t,project:s,query:e,scope:this.globalSearchScope.get()});n.set("sourceTypes",this.globalSearchSourceTypes.get().join(","));try{const o=await fetch(`/api/search?${n}`,{cache:"no-store",signal:i.signal});if(!o.ok)throw new Error("Global search request failed.");const a=await o.json();this.globalSearchAbortController===i&&(this.globalSearchResponse.set(a),a.state==="available"&&this.globalSearchResults.set(a.results))}catch(o){if(o instanceof DOMException&&o.name==="AbortError")return;this.globalSearchAbortController===i&&this.globalSearchResponse.set({state:"operational-error"})}finally{this.globalSearchAbortController===i&&(this.globalSearchAbortController=null,this.clearGlobalSearchProgressTimer(),this.globalSearchProgress.set(!1))}}cancelGlobalSearchRequest(){this.globalSearchRequestTimer!==null&&(window.clearTimeout(this.globalSearchRequestTimer),this.globalSearchRequestTimer=null),this.globalSearchAbortController?.abort(),this.globalSearchAbortController=null,this.clearGlobalSearchProgressTimer()}clearGlobalSearchProgressTimer(){this.globalSearchProgressTimer!==null&&(window.clearTimeout(this.globalSearchProgressTimer),this.globalSearchProgressTimer=null)}cascadeCapacityForWidth(e){return e<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.floor(e/(this.cascadeColumnWidth+this.cascadeColumnGap)))}cascadeHopRelation(e,t){const s=this.snapshot.get()?.relations??[],i=s.find(o=>o.fromId===e&&o.toId===t);return i?i.type:s.find(o=>o.fromId===t&&o.toId===e)?.type??null}cascadePathForLeaf(e){const t=this.snapshot.get()?.relations??[],s=[e],i=new Set([e]);let n=e;for(;;){const d=t.find(p=>p.type==="decomposes"&&p.toId===n);if(!d||i.has(d.fromId))break;s.unshift(d.fromId),i.add(d.fromId),n=d.fromId}const o=s[0],l=this.sortEntities(t.filter(d=>d.type==="fixes"&&d.fromId===o).map(d=>this.entityForId(d.toId)).filter(d=>!!d))[0]?.id??null;return[...this.spineForStory(l,o),...s]}spineForStory(e,t){const s=this.snapshot.get()?.relations??[],i=e?s.find(a=>a.type==="creates"&&a.toId===e)?.fromId??null:null,n=i?s.find(a=>a.type==="owns"&&a.toId===i)?.fromId??null:s.find(a=>a.type==="tracks"&&a.toId===t)?.fromId??null,o=[];return n&&o.push(n),i&&o.push(i),e&&o.push(e),o}cascadeSeamFor(e,t){const s=this.cascadeHopRelation(e,t);if(s!=="fixes")return{relation:s,branch:null};const i=this.snapshot.get()?.relations??[],n=this.sortEntities(i.filter(o=>o.type==="fixes"&&o.fromId===t).map(o=>this.entityForId(o.toId)).filter(o=>!!o));return n.length<=1?{relation:s,branch:null}:{relation:s,branch:{options:n,selectedIndex:n.findIndex(o=>o.id===e)}}}selectCascadeBranch(e,t){const s=this.cascadePath.get(),i=s.indexOf(e);if(i===-1)return;const n=s.slice(i),o=this.spineForStory(t,e);this.cascadeWindowStart.set(null),this.cascadePath.set([...o,...n]),this.clearMasterOverrideIfShallow(),this.writeCascadeHash()}bundleForEntityId(e){return e?(this.snapshot.get()?.initiatives??[]).find(t=>[t.initiative,...t.entities,...t.prds,...t.userStories,...t.adrs,...t.issues].some(s=>s.id===e))??null:null}bundleForInitiativeId(e){return e?(this.snapshot.get()?.initiatives??[]).find(t=>t.initiative.id===e)??null:null}incomingRelationsFor(e){return e?(this.snapshot.get()?.relations??[]).filter(t=>t.toId===e):[]}outgoingRelationsFor(e){return e?(this.snapshot.get()?.relations??[]).filter(t=>t.fromId===e):[]}connect(){this.connected||(this.connected=!0,window.addEventListener("hashchange",this.onBrowserNavigation),window.addEventListener("popstate",this.onPopState),this.bootstrap())}disconnect(){this.connected&&(this.connected=!1,window.removeEventListener("hashchange",this.onBrowserNavigation),window.removeEventListener("popstate",this.onPopState),this.cancelGlobalSearchRequest(),this.events?.close(),this.events=null,this.pollTimer!==null&&(window.clearInterval(this.pollTimer),this.pollTimer=null))}openRootTab(e){this.activeRootTab.set(e)}selectSection(e){this.activeSection.set(e),this.selectedInitiativeId.set(null),this.selectedId.set(null),this.selectedNestedTarget.set(null),this.initTab.set("overview"),this.contextSearch.set(""),this.contextTab.set("all"),this.selectedContextInitiativeId.set(null),this.activePage.set("list"),this.writeRoute(this.currentRoute())}setContextTab(e){this.contextTab.set(e)}setContextInitiativeFilter(e){this.selectedContextInitiativeId.set(e)}setMasterStatusFilter(e,t){if(e==="initiatives"){this.initiativeStatusFilter.set(t);return}this.adrStatusFilter.set(t)}setDebtFilter(e,t){if(e==="lifecycle"){this.debtLifecycleFilter.set(t);return}if(e==="category"){this.debtCategoryFilter.set(t);return}this.debtPriorityFilter.set(t)}setInitTab(e){this.initTab.set(e)}openSearchTarget(e){if(this.recordGlobalSearchRecent(e),e.type==="entity"){this.selectEntity(e.entityId);return}if(e.type==="plan-entry"){this.selectEntity(e.planId,{id:e.entryId,type:e.type});return}if(e.type==="issue-comment"){this.selectEntity(e.issueId,{id:e.commentId,type:e.type});return}(e.type==="context"||e.type==="context-term")&&(this.activeSection.set("context"),this.selectedInitiativeId.set(null),this.selectedId.set(null),this.activePage.set("list"),this.contextTab.set(e.scopeRef?"initiatives":"global"),this.selectedContextInitiativeId.set(e.scopeRef??null),this.selectedNestedTarget.set(e.type==="context"?{id:null,scopeRef:e.scopeRef,type:e.type}:{id:e.term,scopeRef:e.scopeRef,type:e.type}),this.writeRoute(this.currentRoute()))}globalSearchRecentsStorageKey(){const e=this.selectedTenant.get(),t=this.selectedProjectId.get();return e&&t?`${rc}:${e}:${t}`:null}readGlobalSearchRecents(){const e=this.globalSearchRecentsStorageKey();if(!e)return[];try{const t=window.localStorage.getItem(e);if(!t)return[];const s=JSON.parse(t);return Array.isArray(s)?s.filter(lc).slice(0,tn):[]}catch{return[]}}recordGlobalSearchRecent(e){const t=this.globalSearchRecentsStorageKey();if(!t)return;const s=this.readGlobalSearchRecents(),i=JSON.stringify(e),n=[e,...s.filter(o=>JSON.stringify(o)!==i)].slice(0,tn);window.localStorage.setItem(t,JSON.stringify(n)),this.globalSearchRecents.set(n)}selectEntity(e,t=null){if(this.entityForId(e)?.kind==="initiative"){this.selectInitiative(e);return}this.cascadePath.set([]),this.selectedInitiativeId.set(null),this.selectedId.set(e),this.selectedNestedTarget.set(t),this.activePage.set("entity"),this.writeRoute(this.currentRoute())}selectProjectGraphEntity(e,t){this.activeSection.set(t==="adr"?"adrs":"initiatives"),this.selectEntity(e)}openCascade(e){this.cascadeWindowStart.set(null),this.cascadePath.set([e]),this.clearMasterOverrideIfShallow(),this.writeCascadeHash()}toggleRail(){this.railCollapsed.set(!this.railCollapsed.get())}toggleMaster(){this.masterCollapsedOverride.set(!this.masterCollapsed.get())}isEpicExpanded(e){const t=this.selectedProjectId.get();return!t||!this.collapsedEpicIdsByProject.get().get(t)?.has(e)}toggleEpicExpanded(e){const t=this.selectedProjectId.get();if(!t)return;const s=new Map(this.collapsedEpicIdsByProject.get()),i=new Set(s.get(t));i.has(e)?i.delete(e):i.add(e),s.set(t,i),this.collapsedEpicIdsByProject.set(s)}clearMasterOverrideIfShallow(){this.cascadePath.get().length<2&&this.masterCollapsedOverride.set(null)}reRootCascade(e){const t=this.cascadePath.get();t.length>0&&this.reRootTrail.set([...this.reRootTrail.get(),t]),this.cascadeWindowStart.set(null),this.cascadePath.set(this.cascadePathForLeaf(e)),this.clearMasterOverrideIfShallow(),this.writeCascadeHash()}restoreReRoot(e){const t=this.reRootTrail.get(),s=t[e];s&&(this.reRootTrail.set(t.slice(0,e)),this.cascadeWindowStart.set(null),this.cascadePath.set(s),this.clearMasterOverrideIfShallow(),this.writeCascadeHash())}popReRoot(){const e=this.reRootTrail.get();e.length!==0&&this.restoreReRoot(e.length-1)}drillCascade(e,t){const s=this.cascadePath.get().indexOf(e);s!==-1&&(this.cascadeWindowStart.set(null),this.cascadePath.set([...this.cascadePath.get().slice(0,s+1),t]),this.writeCascadeHash())}restoreAncestor(e){const t=this.cascadePath.get().indexOf(e);t!==-1&&this.cascadeWindowStart.set(t)}truncateCascadeTo(e){const t=this.cascadePath.get(),s=t.indexOf(e);s===-1||s===t.length-1||(this.cascadeWindowStart.set(null),this.cascadePath.set(t.slice(0,s+1)),this.clearMasterOverrideIfShallow(),this.writeCascadeHash())}writeCascadeHash(){this.writeRoute(this.currentRoute())}selectInitiative(e){this.selectedId.set(null),this.selectedInitiativeId.set(e),this.selectedNestedTarget.set(null),this.activePage.set("initiative"),this.activeSection.set("initiatives"),this.activeView.set("overview"),this.initTab.set("overview"),this.cascadePath.set([]),this.clearMasterOverrideIfShallow(),this.writeRoute(this.currentRoute())}clearSelection(){this.cascadePath.set([]),this.clearMasterOverrideIfShallow(),this.selectedInitiativeId.set(null),this.selectedId.set(null),this.selectedNestedTarget.set(null),this.activePage.set("list"),this.activeView.set("overview"),this.writeRoute(this.currentRoute())}async selectTenant(e){!e||e===this.selectedTenant.get()||(this.selectedTenant.set(e),this.selectedProjectId.set(null),this.resetScopeDetail(),this.writeRoute(this.currentRoute()),this.stopLiveUpdates(),this.syncLabel.set("choose a project"),await this.reloadProjectDiscovery())}async returnToProjectChooser(){!this.selectedTenant.get()||!this.selectedProjectId.get()||(this.selectedProjectId.set(null),this.snapshot.set(null),this.resetScopeDetail(),this.writeRoute(this.currentRoute()),this.stopLiveUpdates(),this.syncLabel.set("choose a project"),await this.reloadProjectDiscovery())}async selectProject(e){if(!(!this.selectedTenant.get()||!e||e===this.selectedProjectId.get())){this.selectedProjectId.set(e),this.resetScopeDetail(),this.writeRoute(this.currentRoute()),this.stopLiveUpdates(),this.syncLabel.set("connecting");try{await this.reloadSnapshot(),this.connectEvents()}catch(s){this.selectedProjectId.set(null),this.snapshot.set(null),this.writeRoute(this.currentRoute(),!0),this.errorMessage.set(s instanceof Error?s.message:String(s)),this.syncLabel.set("project unavailable")}}}initiativeStats(e){const t=e.issues.length,s=e.issues.filter(n=>this.isDoneStatus(n.status)).length,i=t>0?Math.round(s/t*100):0;return{adrs:e.adrs.length,done:s,issues:t,pct:i,stories:e.userStories.length}}issuesForStory(e,t){const s=new Set(e.fixLinks.filter(i=>i.userStory.id===t).map(i=>i.issue.id));return this.sortEntities(e.issues.filter(i=>s.has(i.id)))}subIssuesForIssue(e,t){return this.sortEntities(e.subIssueLinks.filter(s=>s.parent.id===t).map(s=>s.issue))}parentIssueForIssue(e,t){return e.subIssueLinks.find(s=>s.issue.id===t)?.parent??null}issueTreeForStory(e,t){const s=new Map(e.subIssueLinks.map(l=>[l.issue.id,l.parent.id])),i=new Map;for(const l of e.subIssueLinks){const u=i.get(l.parent.id)??[];u.push(l.issue.id),i.set(l.parent.id,u)}const n=new Set,o=this.issuesForStory(e,t);for(const l of o){const u=[l.id];for(;u.length>0;){const p=u.shift();if(!(!p||n.has(p))){n.add(p);for(const g of i.get(p)??[])u.push(g)}}let d=l.id;for(;d;){if(n.has(d)){d=s.get(d)??null;continue}n.add(d),d=s.get(d)??null}}const a=[...n].filter(l=>{const u=s.get(l);return!u||!n.has(u)});return this.buildIssueTree(e,a,n)}issueTreeForDirectIssues(e){const t=new Set(e.userStories.flatMap(o=>this.issueTreeForStory(e,o.id).flatMap(a=>this.issueTreeNodeIds(a)))),s=new Set(e.issues.map(o=>o.id).filter(o=>!t.has(o))),i=new Map(e.subIssueLinks.map(o=>[o.issue.id,o.parent.id])),n=[...s].filter(o=>{const a=i.get(o);return!a||!s.has(a)});return this.buildIssueTree(e,n,s)}subIssueTreeForIssue(e,t){const s=new Set,i=this.subIssuesForIssue(e,t).map(n=>n.id);for(;i.length>0;){const n=i.shift();if(!(!n||s.has(n))){s.add(n);for(const o of this.subIssuesForIssue(e,n))i.push(o.id)}}return this.buildIssueTree(e,this.subIssuesForIssue(e,t).map(n=>n.id),s)}buildInitiativeGraph(e,t){const s=e.initiative,i=this.snapshot.get(),n=[],o=[];new Map(e.issues.map(b=>[b.id,b]));const a=new Map,l=new Set(e.subIssueLinks.map(b=>b.issue.id)),u=new Map,d=this.sortEntities(e.entities.filter(b=>b.kind==="plan"));n.push({col:0,fullLabel:s.title,id:s.id,key:s.id,kind:"initiative",label:s.title});for(const b of d)n.push({col:1,fullLabel:b.title,id:b.id,key:b.id,kind:"plan",label:b.title,status:b.status}),o.push({from:s.id,to:b.id});for(const b of e.prds)n.push({col:1,fullLabel:b.title,id:b.id,key:b.id,kind:"prd",label:b.title}),o.push({from:s.id,to:b.id});for(const b of e.adrs)n.push({col:1,fullLabel:b.title,id:b.id,key:b.id,kind:"adr",label:b.title}),o.push({from:s.id,to:b.id});for(const b of e.userStories)n.push({col:2,fullLabel:b.title,id:b.id,key:b.id,kind:"story",label:b.title}),o.push({from:s.id,to:b.id});for(const b of e.subIssueLinks){const j=a.get(b.parent.id)??[];j.push(b.issue),a.set(b.parent.id,j)}for(const[b,j]of a)a.set(b,this.sortEntities(j));for(const b of e.fixLinks){const j=u.get(b.issue.id)??[];j.push(b.userStory.id),u.set(b.issue.id,j)}const p=this.sortEntities(e.issues.filter(b=>!l.has(b.id)));let g=0;const v=new Set,k=(b,j)=>{if(v.has(b.id)){g=Math.max(g,j);return}v.add(b.id),g=Math.max(g,j),n.push({col:3+j,fullLabel:b.title,id:b.id,key:b.id,kind:"issue",label:b.title,status:b.status});const ve=u.get(b.id)??[];if(ve.length>0)for(const H of ve)o.push({from:H,to:b.id});else j===0&&o.push({from:s.id,to:b.id});for(const H of a.get(b.id)??[])k(H,j+1),o.push({from:b.id,to:H.id})};for(const b of p)k(b,0);for(const b of this.sortEntities(e.issues))v.has(b.id)||k(b,0);const _=["Issues"];for(let b=1;b<=g;b+=1)_.push(b===1?"Sub-issues":"Nested sub-issues");const D=3+_.length,m=this.sortEntities((i?.entities??[]).filter(b=>b.kind==="debt"&&(i?.relations??[]).some(j=>j.fromId===s.id&&j.toId===b.id&&j.type==="records")));for(const b of m)n.push({col:D,fullLabel:b.title,id:b.id,key:b.id,kind:"debt",label:b.title,status:b.status}),o.push({from:s.id,label:"records",to:b.id});const S=new Set(n.map(b=>b.id)),R=new Set(m.map(b=>b.id)),C=new Set(d.map(b=>b.id));for(const b of i?.relations??[])b.type==="informs"&&C.has(b.fromId)&&S.has(b.toId)&&o.push({from:b.fromId,label:"informs",to:b.toId}),b.type==="resolves"&&S.has(b.fromId)&&R.has(b.toId)&&o.push({from:b.fromId,label:"resolves",to:b.toId}),b.type==="relatesTo"&&R.has(b.fromId)&&S.has(b.toId)&&o.push({from:b.fromId,label:"relatesTo",to:b.toId});const E={columns:["Initiative","Plans, PRDs & ADRs","User stories",..._,"Debt records"],edges:o,nodes:n};return t?sn(E,t):E}buildProjectGraph(){const e=this.snapshot.get(),t=this.epicInitiativeGroups.get(),s="__project",i=new Map,n=this.selectedProjectId.get(),o=[{col:0,fullLabel:this.projectDescription.get(),id:"",key:s,kind:"project",label:this.selectedTenantDisplayName.get()??""}],a=[];n&&i.set(n,s);for(const d of e?.projectAdrs??[])o.push({col:1,fullLabel:d.title,id:d.id,key:d.id,kind:"adr",label:d.title,status:d.status}),i.set(d.id,d.id),a.push({from:s,to:d.id});for(const d of t){const{epic:p}=d;o.push({col:1,fullLabel:p.title,id:p.id,key:p.id,kind:"epic",label:p.title,status:p.status}),i.set(p.id,p.id),a.push({from:s,to:p.id});for(const g of d.initiatives){const v=g.initiative,k=new Map,_=new Map;o.push({col:2,fullLabel:`${v.title} — ${g.userStories.length} stories, ${g.issues.length} issues`,id:v.id,key:v.id,kind:"initiative",label:v.title,status:v.status}),i.set(v.id,v.id),a.push({from:p.id,to:v.id});const D=[...this.sortEntities(g.entities.filter(m=>m.kind==="plan")).map(m=>({entity:m,kind:"plan"})),...g.prds.map(m=>({entity:m,kind:"prd"})),...g.adrs.map(m=>({entity:m,kind:"adr"}))];for(const{entity:m,kind:S}of D){const R=`${v.id}:${m.id}`;o.push({col:3,fullLabel:m.title,id:m.id,key:R,kind:S,label:m.title,status:m.status}),i.set(m.id,R),a.push({from:v.id,to:R})}for(const m of this.sortEntities(g.userStories)){const S=`${v.id}:${m.id}`;k.set(m.id,S),i.set(m.id,S),o.push({col:4,fullLabel:m.title,id:m.id,key:S,kind:"story",label:m.title,status:m.status}),a.push({from:v.id,to:S})}for(const m of g.fixLinks){const S=_.get(m.issue.id)??[];S.push(m.userStory.id),_.set(m.issue.id,S)}for(const m of this.sortEntities(g.issues)){const S=`${v.id}:${m.id}`;i.set(m.id,S),o.push({col:5,fullLabel:m.title,id:m.id,key:S,kind:"issue",label:m.title,status:m.status});const R=(_.get(m.id)??[]).map(C=>k.get(C)).filter(C=>!!C);if(R.length>0)for(const C of R)a.push({from:C,to:S});else a.push({from:v.id,to:S})}}}const l=new Map,u=this.sortEntities((e?.entities??[]).filter(d=>d.kind==="debt"));for(const d of u){const p=(e?.relations??[]).find(v=>v.fromId!==d.id&&v.toId===d.id&&v.type==="records"),g=p?i.get(p.fromId):void 0;g&&(l.set(d.id,d.id),o.push({col:6,fullLabel:d.title,id:d.id,key:d.id,kind:"debt",label:d.title,status:d.status}),a.push({from:g,label:"records",to:d.id}))}for(const d of e?.relations??[]){if(d.type==="informs"){const p=i.get(d.fromId),g=i.get(d.toId);p&&g&&a.push({from:p,label:"informs",to:g})}if(d.type==="resolves"){const p=i.get(d.fromId),g=l.get(d.toId);p&&g&&a.push({from:p,label:"resolves",to:g})}if(d.type==="relatesTo"){const p=l.get(d.fromId),g=i.get(d.toId)??l.get(d.toId);p&&g&&a.push({from:p,label:"relatesTo",to:g})}}return sn({columns:["Project","Epics","Initiatives","Plans, PRDs & ADRs","User stories","Issues","Debt records"],edges:a,nodes:o},this.visibleProjectGraphKinds.get())}toggleProjectGraphKind(e){const t=new Set(this.visibleProjectGraphKinds.get());t.has(e)?t.delete(e):t.add(e),this.visibleProjectGraphKinds.set(t)}isDoneStatus(e){return e==="done"||e==="complete"||e==="closed"}sortIssuesByExpectedCompletion(e,t){const s=new Map(e.map(g=>[g.id,g])),i=new Map(e.map((g,v)=>[g.id,v])),n=new Map(e.map(g=>[g.id,0])),o=new Map(e.map(g=>[g.id,[]])),a=new Set,l=(g,v)=>+!this.isDoneStatus(g.status)-+!this.isDoneStatus(v.status)||i.get(g.id)-i.get(v.id);for(const g of t.blockerLinks){if(!s.has(g.source.id)||!s.has(g.target.id)||!this.isDoneStatus(g.source.status)&&this.isDoneStatus(g.target.status))continue;const v=`${g.source.id}:${g.target.id}`;a.has(v)||(a.add(v),n.set(g.target.id,n.get(g.target.id)+1),o.get(g.source.id).push(g.target.id))}const u=e.filter(g=>n.get(g.id)===0),d=[],p=new Set;for(;u.length>0;){u.sort(l);const g=u.shift();if(!p.has(g.id)){p.add(g.id),d.push(g);for(const v of o.get(g.id)??[]){const k=n.get(v)-1;n.set(v,k),k===0&&u.push(s.get(v))}}}return[...d,...e.filter(g=>!p.has(g.id)).sort(l)]}issueStatusTone(e){return this.isDoneStatus(e)?"done":e==="blocked"||e==="paused"?"blocked":"open"}formatKindLabel(e){return e==="all"?"All work items":e==="userStory"?"User story":e==="prd"?"PRD":e==="adr"?"ADR":e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"Unknown"}statusTone(e){return e==="blocked"||e==="paused"?"warn":e==="cancelled"?"danger":e==="archived"||e==="done"||e==="complete"||e==="closed"?"neutral":"success"}badgeTone(e){return e==="done"||e==="complete"||e==="closed"?"done":e==="blocked"||e==="cancelled"?"danger":e==="ready"||e==="in-progress"?"info":e==="paused"?"warn":e==="active"||e==="current"||e==="approved"?"success":"neutral"}compactPath(e){const t=e.split("/").filter(Boolean);return t.length<=3?e:`.../${t.slice(-3).join("/")}`}formatTimestamp(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(t)}truncate(e,t){return e.length<=t?e:`${e.slice(0,Math.max(0,t-3)).trimEnd()}...`}shortRef(e){return ac(e)}buildOpenedText(e){const t=this.selectedBundle.get(),s=t?`inside ${t.initiative.id}`:"outside a visible initiative bundle";return`Opened ${this.formatTimestamp(e.createdAt)} and currently ${s}. Last updated ${this.formatTimestamp(e.updatedAt)}.`}buildSummaryBody(e){const t=this.selectedBundle.get(),s=this.selectedContext.get(),i=this.selectedIncoming.get(),n=this.selectedOutgoing.get(),o=this.orphanIds.get(),a=t?`It currently sits in ${t.initiative.id}, which includes ${t.prds.length} PRDs, ${t.userStories.length} stories, ${t.adrs.length} ADRs, and ${t.issues.length} issues.`:"It is not currently connected to a visible initiative bundle in this snapshot.",l=o.has(e.id)?"This record is marked as orphaned from the initiative structure.":"This record remains connected to the main initiative structure.",u=s?`${s.context.title} is currently ${s.context.exists?"stored":"using its default shell"} with ${s.terms.length} defined terms.`:"No context is currently available for this record.";return`${e.id} is a ${this.formatKindLabel(e.kind).toLowerCase()} with ${i.length} incoming links and ${n.length} outgoing links. ${a} ${u} ${l}`}buildRelationSentence(e){return`${e.fromId} ${e.type} ${e.toId}`}relationLabel(e,t){const s={blocks:"Blocked by",constrains:"Constrained by",decomposes:"Parent issue",creates:"Created by",fixes:"Fixed by",handsOff:"Incoming handoffs",owns:"Owned by",records:"Recorded by",resolves:"Resolved by",tracks:"Tracked by"},i={blocks:"Blocks",constrains:"Constrains",decomposes:"Sub-issues",creates:"Creates",fixes:"Fixes",relatesTo:"Related records",resolves:"Resolves debt",owns:"Owns",records:"Records",tracks:"Tracks"};return t?s[e]??`${e} (incoming)`:i[e]??e}detailMeta(e){return this.detailMetaFor(e.id)}detailMetaFor(e){const t=e?this.entityById.get().get(e)??null:null,s=this.bundleForEntityId(e),i=t?this.incomingRelationsFor(t.id).find(u=>u.type==="records")?.fromId:null,n=i?this.entityById.get().get(i)??null:null,o=t?.kind==="debt"?[["Category",t.category??"—"],["Priority",t.priority??"—"],["Lifecycle",t.status],["Owner",n?`${this.shortRef(n)} ${n.title}`:"—"]]:[],a=t?.kind==="debt"?[]:[["Status",t?.status??"—"]],l=t?.type?[["Type",t.type]]:[];return[["Initiative",s?`${this.shortRef(s.initiative)} ${s.initiative.title}`:"—"],...o,...a,...l,["Created",t?this.formatTimestamp(t.createdAt):"—"],["Updated",t?this.formatTimestamp(t.updatedAt):"—"]]}linkedRecordSections(e){return this.linkedRecordSectionsFor(this.selectedId.get(),e)}linkedRecordSectionsFor(e,t){const s=new Set(["owns","creates","fixes","decomposes","tracks","constrains"]),i=new Map,n=new Set(t?.excludeRelationTypes??[]),o=new Set(t?.excludeRelatedIds??[]),a=(l,u,d)=>{if(o.has(l))return;const p=this.entityById.get().get(l);if(!p)return;const g=i.get(u)??{crossLink:!s.has(d),records:[]};g.records.push(p),i.set(u,g)};for(const l of this.outgoingRelationsFor(e))n.has(l.type)||a(l.toId,this.relationLabel(l.type,!1),l.type);for(const l of this.incomingRelationsFor(e))n.has(l.type)||a(l.fromId,this.relationLabel(l.type,!0),l.type);return[...i.entries()].map(([l,u])=>({crossLink:u.crossLink,key:l,records:this.sortEntities(u.records),title:l}))}debtRecordSectionsFor(e){const t=e?this.entityById.get().get(e)??null:null;if(!t||!["project","epic","initiative","issue"].includes(t.kind))return[];const s=this.outgoingRelationsFor(t.id).filter(n=>n.type==="records").map(n=>this.entityById.get().get(n.toId)).filter(n=>n?.kind==="debt"),i=["epic","initiative","issue"].includes(t.kind)?this.outgoingRelationsFor(t.id).filter(n=>n.type==="resolves").map(n=>this.entityById.get().get(n.toId)).filter(n=>n?.kind==="debt"):[];return[...s.length>0?[{key:"owned-debt",records:this.sortEntities(s),title:"Owned debt"}]:[],...i.length>0?[{key:"resolved-debt",records:this.sortEntities(i),title:"Resolves debt"}]:[]]}planProjectionFor(e){const t=[...this.snapshot.get()?.planEntries??[]].filter(n=>n.planId===e).sort((n,o)=>n.createdAt.localeCompare(o.createdAt)||n.reference.localeCompare(o.reference)),s=new Set(t.flatMap(n=>n.supersededEntryIds)),i=t.filter(n=>!n.tombstone&&!s.has(n.id));return{current:nc.map(n=>({key:n.key,title:n.title,entries:i.filter(o=>dc(o,n.key))})),history:t}}closeEntity(){const e=this.selectedBundle.get();if(this.selectedId.set(null),this.selectedNestedTarget.set(null),this.activeSection.get()!=="adrs"&&e){this.selectedInitiativeId.set(e.initiative.id),this.activePage.set("initiative"),this.writeRoute(this.currentRoute());return}this.activePage.set("list"),this.writeRoute(this.currentRoute())}getContextForInitiative(e){return this.initiativeContextById.get().get(e)??null}async bootstrap(){try{const e=await this.fetchJson("site-config.json");this.config.set(e);const t=this.readRoute(),s={...t,tenantId:t.tenantId??e.currentTenant};this.selectedTenant.set(s.tenantId),await this.reloadProjectDiscovery(),await this.navigateToRoute(s),this.writeRoute(this.currentRoute(),!0)}catch(e){this.errorMessage.set(e instanceof Error?e.message:String(e)),this.syncLabel.set("load failed")}}async reloadSnapshot(){const e=await this.fetchJson(this.buildTenantScopedPath("/api/snapshot"));if(e.kind==="unavailable")throw new Error("Selected project is unavailable.");this.snapshot.set(e.snapshot),this.onHashChange();const t=this.selectedId.get();t&&!this.entityById.get().has(t)&&this.selectedId.set(null),this.errorMessage.set(null),this.syncLabel.set("listening")}async reloadProjectDiscovery(){try{this.projectDiscovery.set(await this.fetchJson(this.buildTenantScopedPath("/api/projects"))),this.errorMessage.set(null)}catch(e){this.projectDiscovery.set({kind:"unavailable"}),this.errorMessage.set(e instanceof Error?e.message:String(e))}}async navigateToRoute(e){const t=e.tenantId!==this.selectedTenant.get()||e.projectId!==this.selectedProjectId.get();if(this.selectedTenant.set(e.tenantId),this.selectedProjectId.set(e.projectId),t&&this.resetScopeDetail(),!e.projectId){this.snapshot.set(null),this.syncLabel.set("choose a project"),await this.reloadProjectDiscovery(),this.applyRoute(e);return}this.stopLiveUpdates(),this.syncLabel.set("connecting");try{await this.reloadSnapshot(),this.connectEvents(),this.applyRoute(e)}catch(s){this.selectedProjectId.set(null),this.snapshot.set(null),this.writeRoute(this.currentRoute(),!0),this.errorMessage.set(s instanceof Error?s.message:String(s)),this.syncLabel.set("project unavailable")}}resetScopeDetail(){this.cancelGlobalSearchRequest(),this.globalSearchCapability.set(null),this.globalSearchQuery.set(""),this.globalSearchResponse.set(null),this.globalSearchProgress.set(!1),this.globalSearchOpen.set(!1),this.selectedId.set(null),this.selectedInitiativeId.set(null),this.selectedNestedTarget.set(null),this.cascadePath.set([]),this.reRootTrail.set([]),this.activeSection.set("initiatives"),this.activePage.set("list"),this.activeView.set("overview"),this.initTab.set("overview"),this.initiativeStatusFilter.set("all"),this.adrStatusFilter.set("all"),this.clearMasterOverrideIfShallow()}connectEvents(){if(typeof EventSource!="function"){this.startPolling();return}this.events=new EventSource(this.buildTenantScopedPath("/events")),this.events.onmessage=()=>{this.reloadSnapshot()},this.events.onerror=()=>{this.syncLabel.set("reconnecting"),this.startPolling()}}startPolling(){this.pollTimer===null&&(this.pollTimer=window.setInterval(()=>{this.reloadSnapshot()},3e3))}async fetchJson(e){const t=e.includes("?")?"&":"?",s=await fetch(`${e}${t}ts=${Date.now()}`,{cache:"no-store"});if(!s.ok)throw new Error(`Request failed for ${e}`);return await s.json()}sortEntities(e){return[...e].sort((t,s)=>{const i=new Date(t.updatedAt).getTime(),n=new Date(s.updatedAt).getTime();return i!==n?n-i:t.id.localeCompare(s.id)})}buildIssueTree(e,t,s){const i=new Map(e.issues.map(l=>[l.id,l])),n=new Map;for(const l of e.subIssueLinks){if(!s.has(l.parent.id)||!s.has(l.issue.id))continue;const u=n.get(l.parent.id)??[];u.push(l.issue.id),n.set(l.parent.id,u)}const o=l=>{const u=i.get(l);if(!u)return null;const d=this.sortEntities((n.get(l)??[]).map(p=>i.get(p)).filter(p=>!!p));return{issue:u,children:d.map(p=>o(p.id)).filter(p=>p!==null)}};return this.sortEntities(t.map(l=>i.get(l)).filter(l=>!!l)).map(l=>o(l.id)).filter(l=>l!==null)}issueTreeNodeIds(e){return[e.issue.id,...e.children.flatMap(t=>this.issueTreeNodeIds(t))]}formatTenantDisplayName(e){return e.replace(/-[0-9a-f]{12}$/i,"").split(/[-_]+/).filter(t=>t.length>0).map(t=>`${t.charAt(0).toUpperCase()}${t.slice(1)}`).join(" ")}readTenantFromUrl(){return this.readRoute().tenantId}readProjectFromUrl(){return this.readRoute().projectId}currentRoute(){return{tenantId:this.selectedTenant.get(),projectId:this.selectedProjectId.get(),section:this.activeSection.get(),entityId:this.selectedId.get(),initiativeId:this.selectedInitiativeId.get(),target:this.selectedNestedTarget.get()}}readRoute(){const e=new URL(window.location.href),t=new URLSearchParams(e.hash.slice(1)),s=e.searchParams,i=t.get("tenant")??s.get("tenant"),n=t.get("project")??s.get("project"),o=t.get("section"),a=t.get("target"),l=t.get("target-id"),u=t.get("target-scope")??void 0,d=a==="context"?{id:null,scopeRef:u,type:"context"}:l&&a==="context-term"?{id:l,scopeRef:u,type:a}:l&&(a==="context-term"||a==="issue-comment"||a==="plan-entry")?{type:a,id:l}:null;return{tenantId:i,projectId:n,section:Bl(o)?o:"initiatives",entityId:t.get("entity"),initiativeId:t.get("initiative"),target:d}}normalizeRoute(e){const t=this.entityById.get();if(t.size===0)return e;const s=e.entityId&&t.has(e.entityId)?e.entityId:null,i=e.initiativeId&&this.bundleForInitiativeId(e.initiativeId)?e.initiativeId:null;return{...e,entityId:s,initiativeId:i,target:this.normalizeNestedTarget(e.target,s)}}normalizeNestedTarget(e,t){if(!e)return null;if(e.type==="plan-entry")return(this.snapshot.get()?.planEntries??[]).find(n=>n.id===e.id&&n.planId===t&&!n.tombstone)?e:null;if(e.type==="issue-comment")return(t?this.snapshot.get()?.issueComments[t]?.comments.find(n=>n.id===e.id&&!n.tombstone):null)?e:null;const s=e.scopeRef?this.getContextForInitiative(e.scopeRef):this.sharedContext.get();return s?.context.exists&&(e.type==="context"||s.terms.some(i=>i.term===e.id))?e:null}applyRoute(e){const t=this.normalizeRoute(e);return this.selectedTenant.set(t.tenantId),this.selectedProjectId.set(t.projectId),this.activeSection.set(t.section),this.selectedId.set(t.entityId),this.selectedInitiativeId.set(t.initiativeId),this.selectedNestedTarget.set(t.target),(t.target?.type==="context"||t.target?.type==="context-term")&&(this.contextTab.set(t.target.scopeRef?"initiatives":"global"),this.selectedContextInitiativeId.set(t.target.scopeRef??null)),this.cascadePath.set([]),this.reRootTrail.set([]),this.clearMasterOverrideIfShallow(),this.activePage.set(t.entityId?"entity":t.initiativeId?"initiative":"list"),this.activeView.set("overview"),t}writeRoute(e,t=!1){const s=new URL(window.location.href),i=[],n=(o,a)=>{a&&i.push(`${o}=${encodeURIComponent(a)}`)};n("tenant",e.tenantId),n("project",e.projectId),n("section",e.section==="initiatives"?null:e.section),n("entity",e.entityId),n("initiative",e.initiativeId),n("target",e.target?.type??null),n("target-id",e.target?.id??null),n("target-scope",e.target?.scopeRef??null),s.searchParams.delete("tenant"),s.searchParams.delete("project"),s.hash=i.join("&"),window.history[t?"replaceState":"pushState"]({},"",s)}buildTenantScopedPath(e){const t=this.selectedTenant.get(),s=this.selectedProjectId.get();if(!t&&!s)return e;const i=e.includes("?")?"&":"?",n=new URLSearchParams;return t&&n.set("tenant",t),s&&e==="/api/snapshot"&&n.set("project",s),n.size>0?`${e}${i}${n}`:e}stopLiveUpdates(){this.events?.close(),this.events=null,this.pollTimer!==null&&(window.clearInterval(this.pollTimer),this.pollTimer=null)}}function rn(r){return new Set(r.map(t=>t.definition.trim().toLowerCase()).filter(t=>t.length>0)).size>1}function dc(r,e){switch(e){case"questions":return r.role==="question";case"decisions":return r.role==="decision";case"includedScope":return r.role==="scope"&&r.scopeDirection==="included";case"excludedScope":return r.role==="scope"&&r.scopeDirection==="excluded";case"constraints":return r.role==="constraint";case"preferences":return r.role==="preference";case"considerations":return r.role==="consideration"}}function pc(r,e){return r.scopeKind!==e.scopeKind?r.scopeKind==="default"?-1:1:r.scopeLabel!==e.scopeLabel?r.scopeLabel.localeCompare(e.scopeLabel):r.contextKey.localeCompare(e.contextKey)}const Us="tenant-switcher-menu",nn="agent-issues-theme",Ci=class Ci extends ss(le){constructor(){super(...arguments),this.store=new cc,this.medium=!1,this.narrow=!1,this.mobileMasterOpen=!1,this.theme="light",this.globalSearchTrigger=null,this.onSelectTenant=e=>{const t=e.currentTarget.dataset.tenant;t&&this.store.selectTenant(t)},this.onSelectSection=e=>{const t=e.currentTarget.dataset.section;t&&(this.store.selectSection(t),this.mobileMasterOpen=!1,this.requestUpdate())},this.onSelectInitiative=e=>{const t=e.currentTarget.dataset.initiative;t&&(this.store.selectInitiative(t),this.mobileMasterOpen=!1,this.requestUpdate())},this.onSelectProject=e=>{const t=e.currentTarget.dataset.project;t&&this.store.selectProject(t)},this.onOpenProjectChooser=()=>{this.store.returnToProjectChooser()},this.onSelectEntity=e=>{const t=e.currentTarget.dataset.id;t&&(this.store.selectEntity(t),this.mobileMasterOpen=!1,this.requestUpdate())},this.onSearchInput=e=>{this.store.search.set(e.target.value)},this.onOpenGlobalSearch=e=>{this.globalSearchTrigger=e.currentTarget,this.store.openGlobalSearch()},this.onCloseGlobalSearch=()=>{this.store.closeGlobalSearch(),this.globalSearchTrigger?.focus()},this.onOpenGlobalSearchTarget=e=>{this.store.openSearchTarget(e.detail),this.onCloseGlobalSearch()},this.onRetryGlobalSearch=()=>{this.store.retryGlobalSearch()},this.onWindowKeyDown=e=>{const t=e.target;e.key.toLowerCase()!=="k"||!e.metaKey&&!e.ctrlKey||t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t?.isContentEditable||(e.preventDefault(),this.globalSearchTrigger=document.activeElement instanceof HTMLElement?document.activeElement:this.shadowRoot?.querySelector("[data-global-search-trigger]")??null,this.store.openGlobalSearch())},this.onToggleRail=()=>{this.store.toggleRail()},this.onToggleMaster=()=>{this.store.toggleMaster()},this.onToggleMobileMaster=async()=>{this.mobileMasterOpen=!this.mobileMasterOpen,this.requestUpdate(),this.mobileMasterOpen&&(await this.updateComplete,this.shadowRoot?.querySelector(".master-search")?.focus())},this.onToggleTheme=()=>{const e=this.theme==="light"?"dark":"light";this.setTheme(e,!0)},this.onToggleEpic=e=>{const t=e.currentTarget.dataset.epicToggle;t&&this.store.toggleEpicExpanded(t)},this.onContextSearchInput=e=>{this.store.contextSearch.set(e.target.value)},this.onSetContextTab=e=>{const t=e.currentTarget.dataset.contextTab;t&&this.store.setContextTab(t)},this.onSetContextInitiativeFilter=e=>{const t=e.currentTarget.dataset.contextInitiative??"";this.store.setContextInitiativeFilter(t||null)},this.onSetMasterStatusFilter=e=>{const t=e.currentTarget,s=t.dataset.masterSection,i=t.dataset.masterStatus;s!=="initiatives"&&s!=="adrs"||!i||this.store.setMasterStatusFilter(s,i)},this.onSetDebtFilter=e=>{const t=e.currentTarget,s=t.dataset.debtFilter,i=t.dataset.debtValue;!s||!i||this.store.setDebtFilter(s,i)},this.onToggleProjectGraphKind=e=>{const t=e.detail.kind;t&&this.store.toggleProjectGraphKind(t)},this.onProjectNodeOpen=e=>{const{id:t,kind:s}=e.detail;if(t){if(s==="initiative"){this.store.selectInitiative(t);return}this.store.selectProjectGraphEntity(t,s)}},this.updateNarrowMode=()=>{const e=window.innerWidth<=900,t=!e&&window.innerWidth<=1200;this.narrow===e&&this.medium===t||(this.narrow=e,this.medium=t,e||(this.mobileMasterOpen=!1),this.requestUpdate())}}toAriaBoolean(e){return e?"true":"false"}formatStatusFilter(e){return e==="all"?"All":e.split("-").map(t=>`${t.charAt(0).toUpperCase()}${t.slice(1)}`).join(" ")}focusContextTarget(){for(const i of this.renderRoot.querySelectorAll(".is-context-target, .is-context-term-target"))i.classList.remove("is-context-target","is-context-term-target");const e=this.store.selectedNestedTarget.get();if(!e||e.type!=="context"&&e.type!=="context-term")return;const t=e.type==="context"?[...this.renderRoot.querySelectorAll(".ctx-context-summary")].find(i=>i.dataset.contextScope===(e.scopeRef??"shared")):[...this.renderRoot.querySelectorAll(".ctx-term")].find(i=>i.dataset.term===e.id);if(!t)return;const s=e.type==="context"?"is-context-target":"is-context-term-target";t.classList.remove(s),t.offsetWidth,t.classList.add(s),t.focus({preventScroll:!0}),typeof t.scrollIntoView=="function"&&t.scrollIntoView({behavior:"smooth",block:"center"})}updated(){this.focusContextTarget()}connectedCallback(){super.connectedCallback();const e=window.localStorage.getItem(nn);this.setTheme(e==="dark"?"dark":"light"),this.updateNarrowMode(),window.addEventListener("resize",this.updateNarrowMode),window.addEventListener("keydown",this.onWindowKeyDown),this.store.connect()}disconnectedCallback(){window.removeEventListener("resize",this.updateNarrowMode),window.removeEventListener("keydown",this.onWindowKeyDown),this.store.disconnect(),super.disconnectedCallback()}setTheme(e,t=!1){this.theme=e,document.documentElement.dataset.theme=e,t&&window.localStorage.setItem(nn,e),this.requestUpdate()}renderThemeToggle(e){const t=this.theme==="light"?"dark":"light",s=this.theme==="light"?"☾":"☼";return h`
2863
- <button
2864
- aria-label=${`Switch to ${t} theme`}
2865
- aria-pressed=${this.toAriaBoolean(this.theme==="dark")}
2866
- class=${`theme-toggle ${e}-theme-toggle`}
2867
- data-theme-toggle=${e}
2868
- title=${`Switch to ${t} theme`}
2869
- @click=${this.onToggleTheme}
2870
- type="button"
2871
- >
2872
- ${s}
2873
- </button>
2874
- `}renderSwitcherMenu(){const e=this.store.tenantOptions.get(),t=this.store.selectedTenant.get();return h`
2875
- <div
2876
- class="menu"
2877
- id=${Us}
2878
- popover=${"auto"}
2879
- >
2880
- ${P(e,s=>s.id,s=>h`
2881
- <button
2882
- class="menu-item"
2883
- data-tenant=${s.id}
2884
- popovertarget=${Us}
2885
- popovertargetaction="hide"
2886
- @click=${this.onSelectTenant}
2887
- >
2888
- <span class="check">${w(s.id===t,()=>h`✓`,()=>I)}</span>
2889
- <span class="avatar small">${s.displayName.charAt(0)}</span>
2890
- <span class="sw-text">
2891
- <span class="sw-name">${s.displayName}</span>
2892
- <span class="sw-sub">${w(s.id===t,()=>h`current project`,()=>h`open project`)}</span>
2893
- </span>
2894
- </button>
2895
- `)}
2896
- </div>
2897
- `}renderRail(){const e=this.store,t=e.selectedProjectDisplayName.get()??"Project",s=e.activeSection.get(),i=[{count:String(e.projectInitiatives.get().length),icon:"📁",label:"Initiatives",section:"initiatives"},{count:String(e.adrRailEntries.get().length),icon:"📐",label:"ADRs",section:"adrs"},{count:String(e.debtRecords.get().length),icon:"◒",label:"Debt records",section:"debt"},{count:String(e.projectContextTerms.get().length),icon:"📖",label:"Context",section:"context"},{count:"map",icon:"🕸️",label:"Graph",section:"graph"}];return h`
2898
- <aside class="rail" data-pane="rail">
2899
- <button
2900
- aria-label=${this.mobileMasterOpen?"Close record list":"Open record list"}
2901
- aria-pressed=${this.toAriaBoolean(this.mobileMasterOpen)}
2902
- class="mobile-master-toggle"
2903
- @click=${this.onToggleMobileMaster}
2904
- type="button"
2905
- >
2906
-
2907
- </button>
2908
- <button
2909
- class="pane-collapse"
2910
- data-collapse="rail"
2911
- title=${e.railCollapsed.get()?"Expand rail":"Collapse rail"}
2912
- @click=${this.onToggleRail}
2913
- >
2914
- ${e.railCollapsed.get()?"»":"«"}
2915
- </button>
2916
- <div class="rail-switcher">
2917
- <div class="switcher-actions">
2918
- <button
2919
- class="switcher-button"
2920
- @click=${this.onOpenProjectChooser}
2921
- >
2922
- <span class="avatar">${t.charAt(0)}</span>
2923
- <span class="sw-text">
2924
- <span class="sw-name">${t}</span>
2925
- <span class="sw-sub">Switch project</span>
2926
- </span>
2927
- </button>
2928
- <button
2929
- aria-label="Switch tenant"
2930
- class="switcher-tenant-button"
2931
- popovertarget=${Us}
2932
- >
2933
-
2934
- </button>
2935
- </div>
2936
- ${this.renderSwitcherMenu()}
2937
- </div>
2938
- ${w(!this.narrow,()=>h`
2939
- <button
2940
- aria-label="Open global search"
2941
- class="global-search-trigger"
2942
- data-global-search-trigger
2943
- @click=${this.onOpenGlobalSearch}
2944
- type="button"
2945
- >
2946
- <span>Search records</span>
2947
- <kbd>⌘ K</kbd>
2948
- </button>
2949
- `,()=>h`
2950
- <button
2951
- aria-label="Open global search"
2952
- class="global-search-icon-trigger"
2953
- data-global-search-trigger
2954
- @click=${this.onOpenGlobalSearch}
2955
- type="button"
2956
- >
2957
-
2958
- </button>
2959
- `)}
2960
- <nav class="rail-nav">
2961
- <div class="nav-group-label">Plan</div>
2962
- ${Bt(i,n=>h`
2963
- <button
2964
- class=${Q({active:s===n.section,"nav-item":!0})}
2965
- data-section=${n.section}
2966
- data-tenant-nav=${n.section}
2967
- title=${n.label}
2968
- @click=${this.onSelectSection}
2969
- >
2970
- <span class="nav-icon">${n.icon}</span>
2971
- <span class="nav-label">${n.label}</span>
2972
- <span class="nav-count">${n.count}</span>
2973
- </button>
2974
- `)}
2975
- <div class="nav-group-label totals">Totals</div>
2976
- <div class="nav-item static">
2977
- <span class="nav-icon">📝</span>
2978
- <span class="nav-label">User stories</span>
2979
- <span class="nav-count">${e.projectStoryCount.get()}</span>
2980
- </div>
2981
- <div class="nav-item static">
2982
- <span class="nav-icon">⊙</span>
2983
- <span class="nav-label">Issues</span>
2984
- <span class="nav-count">${e.projectIssueCount.get()}</span>
2985
- </div>
2986
- </nav>
2987
- <div class="rail-foot">
2988
- <span class="rail-foot-copy">${e.projectDescription.get()}</span>
2989
- ${w(!this.narrow,()=>this.renderThemeToggle("rail"),()=>I)}
2990
- </div>
2991
- ${w(this.narrow,()=>this.renderThemeToggle("header"),()=>I)}
2992
- </aside>
2993
- `}renderProjectCard(e){const t=e.initiativeCount>0?Math.round(e.completedInitiativeCount/e.initiativeCount*100):0;return h`
2994
- <button
2995
- class="project-card"
2996
- data-project=${e.project.id}
2997
- @click=${this.onSelectProject}
2998
- >
2999
- <div class="project-card-head">
3000
- <div>
3001
- <h2>${e.project.title}</h2>
3002
- <p>${this.store.shortRef(e.project)}</p>
3003
- </div>
3004
- <span class="badge ${this.store.badgeTone(e.project.status)}">${e.project.status}</span>
3005
- </div>
3006
- <div class="project-counts">
3007
- <span>${e.epicCount} epics</span>
3008
- <span>${e.initiativeCount} initiatives</span>
3009
- <span>${e.completedInitiativeCount}/${e.initiativeCount} completed</span>
3010
- </div>
3011
- <div
3012
- aria-label=${`${t}% of initiatives completed`}
3013
- class="project-progress"
3014
- role="progressbar"
3015
- aria-valuemax="100"
3016
- aria-valuemin="0"
3017
- aria-valuenow=${String(t)}
3018
- >
3019
- <span style=${`width:${t}%`}></span>
3020
- </div>
3021
- </button>
3022
- `}renderProjectChooser(){const e=this.store,t=e.selectedTenantDisplayName.get()??"Selected tenant",s=e.projectDiscovery.get(),i=s?.kind==="available"?s.projects:[];return h`
3023
- <main class="project-chooser" data-view="project-chooser">
3024
- <div class="project-chooser-inner">
3025
- <div class="ai-crumbs">${t}</div>
3026
- <h1>Projects</h1>
3027
- ${w(i.length>0,()=>h`
3028
- <p class="project-chooser-copy">Choose a project to open its console.</p>
3029
- <div class="project-grid">
3030
- ${P(i,n=>n.project.id,n=>this.renderProjectCard(n))}
3031
- </div>
3032
- `,()=>w(s?.kind==="unavailable",()=>h`<div class="project-state unavailable">This tenant is unavailable. Choose an available tenant from the switcher.</div>`,()=>w(s?.kind==="available",()=>h`<div class="project-state">This tenant has no available projects.</div>`,()=>h`<div class="project-state">Loading projects…</div>`)))}
3033
- </div>
3034
- </main>
3035
- `}renderInitiativeCard(e){const t=this.store,s=t.initiativeStats(e),i=t.getContextForInitiative(e.initiative.id)?.context.summary??"No initiative-specific context is available yet.";return h`
3036
- <button
3037
- class=${Q({active:t.activeInitiativeId.get()===e.initiative.id,"m-item":!0})}
3038
- data-initiative=${e.initiative.id}
3039
- @click=${this.onSelectInitiative}
3040
- >
3041
- <div class="m-top">
3042
- <span class="m-title">${e.initiative.title}</span>
3043
- <span class=${`badge ${t.badgeTone(e.initiative.status)}`}>${e.initiative.status}</span>
3044
- </div>
3045
- <div class="m-sub">${i}</div>
3046
- <div class="m-meta">
3047
- <span><b>${s.stories}</b> stories</span>
3048
- <span><b>${s.done}/${s.issues}</b> issues</span>
3049
- <span><b>${s.adrs}</b> ADRs</span>
3050
- </div>
3051
- <div class="miniprog"><span style=${`width:${s.pct}%`}></span></div>
3052
- </button>
3053
- `}renderEpicInitiativeGroup(e){const t=this.store.isEpicExpanded(e.epic.id),s=e.epic.id==="EPIC0"?"Uncategorized work":e.epic.title,i=e.initiatives.length>0?Math.round(e.completedInitiativeCount/e.initiatives.length*100):0;return h`
3054
- <section
3055
- class="epic-group"
3056
- data-epic=${e.epic.id}
3057
- >
3058
- <button
3059
- aria-expanded=${String(t)}
3060
- class="epic-group-head"
3061
- data-epic-toggle=${e.epic.id}
3062
- @click=${this.onToggleEpic}
3063
- >
3064
- <h2>${s}</h2>
3065
- <span>${e.initiatives.length} initiatives</span>
3066
- <span>${e.completedInitiativeCount}/${e.initiatives.length} completed</span>
3067
- </button>
3068
- <div
3069
- aria-label=${`${i}% of ${s} initiatives completed`}
3070
- class="epic-progress"
3071
- role="progressbar"
3072
- aria-valuemax="100"
3073
- aria-valuemin="0"
3074
- aria-valuenow=${String(i)}
3075
- >
3076
- <span style=${`width:${i}%`}></span>
3077
- </div>
3078
- ${w(t,()=>h`
3079
- <div class="epic-group-items">
3080
- ${P(e.initiatives,n=>n.initiative.id,n=>this.renderInitiativeCard(n))}
3081
- </div>
3082
- `,()=>I)}
3083
- </section>
3084
- `}renderAdrCard(e){const t=this.store,s=e.adr;return h`
3085
- <button
3086
- class=${Q({active:t.selectedId.get()===s.id,"m-item":!0})}
3087
- data-id=${s.id}
3088
- data-scope=${e.scope}
3089
- @click=${this.onSelectEntity}
3090
- >
3091
- <div class="m-top">
3092
- <span class="m-title">${s.title}</span>
3093
- <span class=${`badge ${t.badgeTone(s.status)}`}>${s.status}</span>
3094
- </div>
3095
- <div class="m-meta">
3096
- <span class="idtag">${t.shortRef(s)}</span>
3097
- <span>${e.scopeLabel}</span>
3098
- <span>updated ${t.formatTimestamp(s.updatedAt)}</span>
3099
- </div>
3100
- </button>
3101
- `}renderDebtCard(e){const t=this.store;return h`
3102
- <button
3103
- class=${Q({active:t.selectedId.get()===e.id,"m-item":!0})}
3104
- data-id=${e.id}
3105
- @click=${this.onSelectEntity}
3106
- >
3107
- <div class="m-top">
3108
- <span class="m-title">${e.title}</span>
3109
- <span class=${`badge ${t.badgeTone(e.status)}`}>${e.status}</span>
3110
- </div>
3111
- <div class="m-meta">
3112
- <span class="idtag">${t.shortRef(e)}</span>
3113
- <span>${e.category??"uncategorized"}</span>
3114
- <span>${e.priority??"no priority"}</span>
3115
- <span>updated ${t.formatTimestamp(e.updatedAt)}</span>
3116
- </div>
3117
- </button>
3118
- `}renderDebtFilter(e,t,s,i){return h`
3119
- <div
3120
- aria-label=${`Filter debt by ${t.toLowerCase()}`}
3121
- class="master-status-filters"
3122
- role="group"
3123
- >
3124
- <span class="master-filter-label">${t}</span>
3125
- ${P(["all",...s],n=>n,n=>h`
3126
- <button
3127
- aria-pressed=${this.toAriaBoolean(i===n)}
3128
- class=${Q({active:i===n,"master-status-chip":!0})}
3129
- data-debt-filter=${e}
3130
- data-debt-value=${n}
3131
- @click=${this.onSetDebtFilter}
3132
- >
3133
- ${this.formatStatusFilter(n)}
3134
- </button>
3135
- `)}
3136
- </div>
3137
- `}renderProjectContextSource(e){const t=e.scopeKind==="default"?"Shared context":e.scopeLabel;return h`
3138
- <div
3139
- class="ctx-source"
3140
- data-scope=${e.scopeKind}
3141
- >
3142
- <div class="ctx-source-head">
3143
- <span class="ctx-scope">${t}</span>
3144
- <span class="ctx-source-title">${e.contextTitle}</span>
3145
- </div>
3146
- <p class="ctx-def">${e.definition}</p>
3147
- ${w(e.avoid.length>0,()=>h`
3148
- <div class="ctx-avoid">
3149
- <span class="ctx-avoid-label">Avoid</span>
3150
- ${P(e.avoid,s=>s,s=>h`<span class="ctx-avoid-chip">${s}</span>`)}
3151
- </div>
3152
- `,()=>I)}
3153
- </div>
3154
- `}renderProjectContextTerm(e){const t=e.hasConflictingDefinitions?`conflicting definitions across ${e.sources.length} scopes`:`defined in ${e.sources.length} scopes`;return h`
3155
- <article
3156
- class="ctx-term"
3157
- data-term=${e.term}
3158
- tabindex="-1"
3159
- >
3160
- <div class="ctx-top">
3161
- <span class="ctx-name">${e.term}</span>
3162
- ${w(e.hasSharedSource,()=>h`<span class="ctx-badge shared">shared</span>`,()=>I)}
3163
- ${w(e.hasDuplicates,()=>h`<span class="ctx-badge warn">${t}</span>`,()=>I)}
3164
- </div>
3165
- <div class="ctx-sources">
3166
- ${P(e.sources,s=>`${s.contextKey}:${s.scopeLabel}`,s=>this.renderProjectContextSource(s))}
3167
- </div>
3168
- </article>
3169
- `}renderSharedContextPanel(){const e=this.store.selectedNestedTarget.get(),t=e?.type==="context-term"&&!e.scopeRef?e.id:null;return h`
3170
- <section class="ctx-block">
3171
- <div class="ctx-section-head">
3172
- <div>
3173
- <h2 class="ctx-section-title">Shared context</h2>
3174
- <p class="ctx-section-copy">Project-canonical terms and preferred language that should be safe anywhere in this tenant.</p>
3175
- </div>
3176
- </div>
3177
- <div
3178
- class="ctx-context-summary"
3179
- data-context-scope="shared"
3180
- tabindex="-1"
3181
- >
3182
- <agent-issues-context-view
3183
- .context=${this.store.filteredSharedContext.get()}
3184
- .emptyMessage=${"No shared context matches the current search."}
3185
- .targetTerm=${t}
3186
- ></agent-issues-context-view>
3187
- </div>
3188
- </section>
3189
- `}renderInitiativeContextIndexPanel(e=!1){const t=this.store,s=e?t.filteredInitiativeContextTerms.get():t.filteredProjectContextTerms.get(),i=s.length,n=t.projectContextDuplicateCount.get(),o=t.projectInitiatives.get(),a=o.length,l=t.selectedContextInitiativeId.get(),u=l?t.getContextForInitiative(l):null,d=[`${i} discovered terms`,`${a} initiative contexts`,n>0?`${n} duplicate labels`:null].filter(p=>!!p).join(" · ");return h`
3190
- <section class="ctx-block">
3191
- <div class="ctx-section-head">
3192
- <div>
3193
- <h2 class="ctx-section-title">Initiative term index</h2>
3194
- <p class="ctx-section-copy">Discover initiative-local terminology without flattening it into project-canonical language.</p>
3195
- </div>
3196
- <div class="ctx-stats">${d}</div>
3197
- </div>
3198
- ${w(e,()=>h`
3199
- <div
3200
- aria-label="Filter initiative context"
3201
- class="ctx-initiative-tabs"
3202
- role="tablist"
3203
- >
3204
- <button
3205
- aria-selected=${this.toAriaBoolean(l===null)}
3206
- class=${Q({active:l===null,"ctx-initiative-tab":!0})}
3207
- role="tab"
3208
- @click=${this.onSetContextInitiativeFilter}
3209
- >
3210
- All initiatives
3211
- </button>
3212
- ${P(o,p=>p.initiative.id,p=>h`
3213
- <button
3214
- aria-selected=${this.toAriaBoolean(l===p.initiative.id)}
3215
- class=${Q({active:l===p.initiative.id,"ctx-initiative-tab":!0})}
3216
- data-context-initiative=${p.initiative.id}
3217
- role="tab"
3218
- @click=${this.onSetContextInitiativeFilter}
3219
- >
3220
- ${p.initiative.title}
3221
- </button>
3222
- `)}
3223
- </div>
3224
- `,()=>I)}
3225
- ${w(u!==null,()=>{const p=u;return p?h`
3226
- <div
3227
- class="ctx-context-summary"
3228
- data-context-scope=${p.context.scopeEntityId??p.context.key}
3229
- tabindex="-1"
3230
- >
3231
- <h3 class="ctx-context-title">${p.context.title}</h3>
3232
- <p class="ctx-context-copy">${p.context.summary}</p>
3233
- </div>
3234
- `:I},()=>I)}
3235
- ${w(s.length>0,()=>h`
3236
- <div class="ctx-list">
3237
- ${P(s,p=>p.term,p=>this.renderProjectContextTerm(p))}
3238
- </div>
3239
- `,()=>h`<p class="ctx-empty">No initiative-scoped terms match the current search.</p>`)}
3240
- </section>
3241
- `}renderMaster(){const e=this.store,t=e.activeSection.get(),s=e.search.get().trim().toLowerCase(),i=t==="adrs",n=t==="debt",o=i?"adrs":"initiatives",a=i?e.adrStatusFilter.get():e.initiativeStatusFilter.get(),l=i?e.adrRailEntries.get().map(m=>m.adr.status):e.projectInitiatives.get().map(m=>m.initiative.status),u=["all",...new Set(l)].sort((m,S)=>m==="all"?-1:S==="all"?1:m.localeCompare(S)),d=e.epicInitiativeGroups.get().map(m=>({...m,initiatives:m.initiatives.filter(S=>(a==="all"||S.initiative.status===a)&&`${S.initiative.title} ${S.initiative.id}`.toLowerCase().includes(s))})).filter(m=>m.initiatives.length>0),p=e.adrRailEntries.get().filter(m=>(a==="all"||m.adr.status===a)&&`${m.adr.title} ${m.adr.id}`.toLowerCase().includes(s)),g=e.allDebtRecords.get(),v=e.debtRecords.get().filter(m=>`${m.title} ${m.id} ${m.category??""} ${m.priority??""}`.toLowerCase().includes(s)),k=[...new Set(g.map(m=>m.category).filter(m=>!!m))].sort(),_=[...new Set(g.map(m=>m.priority).filter(m=>!!m))].sort(),D=[...new Set(g.map(m=>m.status))].sort();return h`
3242
- <section class="master" data-pane="master">
3243
- <button
3244
- class="pane-collapse"
3245
- data-collapse="master"
3246
- title=${e.masterCollapsed.get()?"Expand list":"Collapse list"}
3247
- @click=${this.onToggleMaster}
3248
- >
3249
- ${e.masterCollapsed.get()?"»":"«"}
3250
- </button>
3251
- <div class="master-head">
3252
- <h1>${Xe(t,[["adrs",()=>h`Architecture decisions`],["debt",()=>h`Debt records`]],()=>h`Initiatives`)}</h1>
3253
- <p>${w(n,()=>h`Review accepted debt by lifecycle, category, and priority.`,()=>w(i,()=>h`Open a decision to read its context, decision and consequences.`,()=>h`Select an initiative to explore its issues and user stories.`))}</p>
3254
- <input
3255
- class="master-search"
3256
- placeholder="Filter…"
3257
- .value=${e.search.get()}
3258
- @input=${this.onSearchInput}
3259
- />
3260
- ${w(n,()=>h`
3261
- ${this.renderDebtFilter("lifecycle","Lifecycle",D,e.debtLifecycleFilter.get())}
3262
- ${this.renderDebtFilter("category","Category",k,e.debtCategoryFilter.get())}
3263
- ${this.renderDebtFilter("priority","Priority",_,e.debtPriorityFilter.get())}
3264
- `,()=>h`
3265
- <div
3266
- aria-label=${`Filter ${i?"ADRs":"initiatives"} by status`}
3267
- class="master-status-filters"
3268
- role="group"
3269
- >
3270
- ${P(u,m=>m,m=>h`
3271
- <button
3272
- aria-pressed=${this.toAriaBoolean(a===m)}
3273
- class=${Q({active:a===m,"master-status-chip":!0})}
3274
- data-master-section=${o}
3275
- data-master-status=${m}
3276
- @click=${this.onSetMasterStatusFilter}
3277
- >
3278
- ${this.formatStatusFilter(m)}
3279
- </button>
3280
- `)}
3281
- </div>
3282
- `)}
3283
- </div>
3284
- <div class="master-list">
3285
- ${Xe(t,[["adrs",()=>h`${P(p,m=>m.adr.id,m=>this.renderAdrCard(m))}`],["debt",()=>h`${P(v,m=>m.id,m=>this.renderDebtCard(m))}`]],()=>h`${P(d,m=>m.epic.id,m=>this.renderEpicInitiativeGroup(m))}`)}
3286
- </div>
3287
- </section>
3288
- `}renderDetail(){const e=this.store,t=e.activeSection.get(),s=e.selectedInitiativeId.get(),i=e.selectedId.get();if(t==="context"){const n=e.sharedContext.get(),o=e.contextTab.get(),a={all:"Search all context…",global:"Search shared context…",initiatives:"Search initiative terminology…"}[o];return h`
3289
- <section class="detail" data-pane="detail">
3290
- <div class="detail-inner wide-inner">
3291
- <div class="ai-crumbs">${e.selectedTenantDisplayName.get()} · Context</div>
3292
- <h1 class="d-title">${n?.context.title??"Project context"}</h1>
3293
- <p class="d-sub">Shared glossary plus initiative-scoped term discovery, with scope preserved so local language stays findable without becoming silently global.</p>
3294
- <div class="ctx-controls">
3295
- <input
3296
- class="master-search"
3297
- placeholder=${a}
3298
- .value=${e.contextSearch.get()}
3299
- @input=${this.onContextSearchInput}
3300
- />
3301
- <div class="ctx-tabs">
3302
- ${P([{label:"All",tab:"all"},{label:"Global",tab:"global"},{label:"Initiatives",tab:"initiatives"}],l=>l.tab,l=>h`
3303
- <button
3304
- class=${Q({active:o===l.tab,"ctx-tab":!0})}
3305
- data-context-tab=${l.tab}
3306
- @click=${this.onSetContextTab}
3307
- >
3308
- ${l.label}
3309
- </button>
3310
- `)}
3311
- </div>
3312
- </div>
3313
- <div class="ctx-shell">
3314
- ${Xe(o,[["all",()=>h`${this.renderSharedContextPanel()}${this.renderInitiativeContextIndexPanel()}`],["global",()=>h`${this.renderSharedContextPanel()}`],["initiatives",()=>h`${this.renderInitiativeContextIndexPanel(!0)}`]])}
3315
- </div>
3316
- </div>
3317
- </section>
3318
- `}if(t==="graph"){const n=e.visibleProjectGraphKinds.get();return h`
3319
- <section class="detail" data-pane="detail">
3320
- <div class="detail-inner wide-inner">
3321
- <div class="ai-crumbs">${e.selectedTenantDisplayName.get()} · Graph</div>
3322
- <h1 class="d-title">Project relationship graph</h1>
3323
- <p class="d-sub">Project decisions, epics, initiatives, and their PRDs, ADRs, and issues. Click an initiative or record to open it.</p>
3324
- <div class="ai-graph-wrap">
3325
- <div class="graph-scroll-content">
3326
- <div class="ai-graph-legend">
3327
- <agent-issues-relationship-graph-filters
3328
- .visibleKinds=${n}
3329
- @graph-kind-toggle=${this.onToggleProjectGraphKind}
3330
- ></agent-issues-relationship-graph-filters>
3331
- <span class="ai-graph-hint">Tip: hover a node for its full title</span>
3332
- </div>
3333
- <div class="graph-host">
3334
- <agent-issues-relationship-graph
3335
- .graph=${e.buildProjectGraph()}
3336
- @node-open=${this.onProjectNodeOpen}
3337
- ></agent-issues-relationship-graph>
3338
- </div>
3339
- </div>
3340
- </div>
3341
- </div>
3342
- </section>
3343
- `}return i?h`
3344
- <section class="detail" data-pane="detail">
3345
- <agent-issues-detail-view .store=${e}></agent-issues-detail-view>
3346
- </section>
3347
- `:s?h`
3348
- <section class="detail" data-pane="detail">
3349
- <agent-issues-initiative-detail-view .store=${e}></agent-issues-initiative-detail-view>
3350
- </section>
3351
- `:h`
3352
- <section class="detail" data-pane="detail">
3353
- <div class="empty">
3354
- <div>
3355
- <div class="empty-glyph">🗂️</div>
3356
- <p>Select ${w(t==="adrs",()=>h`an ADR`,()=>h`an initiative`)} from the list</p>
3357
- </div>
3358
- </div>
3359
- </section>
3360
- `}render(){const e=this.store;if(e.selectedTenant.get()&&!e.selectedProjectId.get())return this.renderProjectChooser();const t=e.activeSection.get(),s=!this.narrow&&(t==="graph"||t==="context"),i=e.railCollapsed.get(),n=!s&&e.masterCollapsed.get(),o=e.selectedId.get()!==null||e.selectedInitiativeId.get()!==null||t==="context"||t==="graph";return h`
3361
- <div class=${Q({console:!0,"has-detail":o,"master-collapsed":n,medium:this.medium,"mobile-master-open":this.mobileMasterOpen,narrow:this.narrow,"rail-collapsed":i,wide:s})}>
3362
- ${this.renderRail()}
3363
- ${w(!s,()=>this.renderMaster(),()=>I)}
3364
- ${this.renderDetail()}
3365
- ${w(e.globalSearchOpen.get(),()=>h`
3366
- <agent-issues-global-search-overlay
3367
- .store=${e}
3368
- @global-search-close=${this.onCloseGlobalSearch}
3369
- @global-search-open-target=${this.onOpenGlobalSearchTarget}
3370
- @global-search-retry=${this.onRetryGlobalSearch}
3371
- ></agent-issues-global-search-overlay>
3372
- `,()=>I)}
3373
- </div>
3374
- `}};Ci.styles=[os,vi,ue`
3375
- :host {
3376
- display: block;
3377
- height: 100vh;
3378
- background: var(--page-bg);
3379
- color: var(--text);
3380
- }
3381
- .console {
3382
- display: grid;
3383
- grid-template-columns: 256px 380px 1fr;
3384
- height: stretch;
3385
- overflow: hidden;
3386
- }
3387
- .console.wide {
3388
- grid-template-columns: 256px 1fr;
3389
- }
3390
- .console.rail-collapsed {
3391
- grid-template-columns: 44px 380px 1fr;
3392
- }
3393
- .console.wide.rail-collapsed {
3394
- grid-template-columns: 44px 1fr;
3395
- }
3396
- .console.master-collapsed {
3397
- grid-template-columns: 256px 44px 1fr;
3398
- }
3399
- .console.rail-collapsed.master-collapsed {
3400
- grid-template-columns: 44px 44px 1fr;
3401
- }
3402
- .console.rail-collapsed .rail-switcher,
3403
- .console.rail-collapsed .rail-nav,
3404
- .console.rail-collapsed .rail-foot,
3405
- .console.master-collapsed .master-head,
3406
- .console.master-collapsed .master-list {
3407
- display: none;
3408
- }
3409
- .pane-collapse {
3410
- display: flex;
3411
- flex-shrink: 0;
3412
- align-items: center;
3413
- justify-content: center;
3414
- align-self: flex-end;
3415
- width: 24px;
3416
- height: 24px;
3417
- margin: 8px;
3418
- padding: 0;
3419
- border: 1px solid var(--border);
3420
- border-radius: 6px;
3421
- background: var(--surface);
3422
- color: var(--muted);
3423
- font-size: 13px;
3424
- line-height: 1;
3425
- cursor: pointer;
3426
- }
3427
- .pane-collapse:hover {
3428
- border-color: var(--accent);
3429
- color: var(--text);
3430
- }
3431
- .mobile-master-toggle {
3432
- display: none;
3433
- }
3434
- .console.rail-collapsed .rail .pane-collapse,
3435
- .console.master-collapsed .master .pane-collapse {
3436
- align-self: center;
3437
- }
3438
- .rail {
3439
- display: flex;
3440
- flex-direction: column;
3441
- overflow: hidden;
3442
- background: var(--rail-bg);
3443
- border-right: 1px solid var(--border);
3444
- }
3445
- .rail-switcher {
3446
- position: relative;
3447
- padding: 12px;
3448
- border-bottom: 1px solid var(--border-muted);
3449
- }
3450
- .global-search-trigger {
3451
- display: flex;
3452
- gap: 8px;
3453
- align-items: center;
3454
- justify-content: space-between;
3455
- margin: 0 12px 8px;
3456
- padding: 8px 10px;
3457
- border: 1px solid var(--border);
3458
- border-radius: 6px;
3459
- background: var(--surface);
3460
- color: var(--muted);
3461
- cursor: pointer;
3462
- font: inherit;
3463
- font-size: 13px;
3464
- }
3465
- .global-search-trigger:hover {
3466
- border-color: var(--accent);
3467
- color: var(--text);
3468
- }
3469
- .global-search-trigger kbd {
3470
- padding: 1px 4px;
3471
- border: 1px solid var(--border-muted);
3472
- border-radius: 3px;
3473
- font: inherit;
3474
- font-size: 11px;
3475
- }
3476
- .global-search-icon-trigger {
3477
- display: none;
3478
- }
3479
- .switcher-actions {
3480
- display: flex;
3481
- gap: 6px;
3482
- }
3483
- .switcher-button {
3484
- display: flex;
3485
- flex: 1;
3486
- gap: 10px;
3487
- align-items: center;
3488
- width: stretch;
3489
- padding: 8px 10px;
3490
- border: 1px solid var(--border);
3491
- border-radius: 8px;
3492
- background: var(--surface);
3493
- cursor: pointer;
3494
- text-align: left;
3495
- anchor-name: --switcher-anchor;
3496
- }
3497
- .switcher-button:hover {
3498
- background: var(--surface-muted);
3499
- }
3500
- .switcher-tenant-button {
3501
- width: 36px;
3502
- padding: 0;
3503
- border: 1px solid var(--border);
3504
- border-radius: 8px;
3505
- background: var(--surface);
3506
- color: var(--muted);
3507
- cursor: pointer;
3508
- font: inherit;
3509
- }
3510
- .switcher-tenant-button:hover {
3511
- background: var(--surface-muted);
3512
- color: var(--text);
3513
- }
3514
- .avatar {
3515
- display: grid;
3516
- flex-shrink: 0;
3517
- place-items: center;
3518
- width: 28px;
3519
- height: 28px;
3520
- border-radius: 6px;
3521
- background: linear-gradient(135deg, var(--avatar-start), var(--avatar-end));
3522
- color: var(--avatar-text);
3523
- font-size: 13px;
3524
- font-weight: 700;
3525
- }
3526
- .avatar.small {
3527
- width: 24px;
3528
- height: 24px;
3529
- font-size: 11px;
3530
- }
3531
- .sw-text {
3532
- display: grid;
3533
- }
3534
- .sw-name {
3535
- font-weight: 600;
3536
- }
3537
- .sw-sub {
3538
- color: var(--muted);
3539
- font-size: 12px;
3540
- }
3541
- .menu {
3542
- position: fixed;
3543
- position-anchor: --switcher-anchor;
3544
- top: anchor(bottom);
3545
- left: anchor(left);
3546
- right: anchor(right);
3547
- margin: 0;
3548
- margin-top: 4px;
3549
- z-index: 40;
3550
- overflow: hidden;
3551
- border: 1px solid var(--border);
3552
- border-radius: 10px;
3553
- background: var(--surface);
3554
- box-shadow: 0 12px 28px var(--shadow);
3555
- }
3556
- .menu-item {
3557
- display: flex;
3558
- gap: 10px;
3559
- align-items: center;
3560
- width: stretch;
3561
- padding: 10px 12px;
3562
- border: 0;
3563
- background: transparent;
3564
- cursor: pointer;
3565
- text-align: left;
3566
- }
3567
- .menu-item:hover {
3568
- background: var(--surface-muted);
3569
- }
3570
- .menu-item .check {
3571
- width: 14px;
3572
- color: var(--accent);
3573
- }
3574
- .rail-nav {
3575
- flex: 1;
3576
- overflow-y: auto;
3577
- padding: 12px 8px;
3578
- }
3579
- .nav-group-label {
3580
- padding: 8px 12px 4px;
3581
- color: var(--muted);
3582
- font-size: 11px;
3583
- font-weight: 700;
3584
- letter-spacing: 0.04em;
3585
- text-transform: uppercase;
3586
- }
3587
- .nav-group-label.totals {
3588
- margin-top: 8px;
3589
- }
3590
- .nav-item {
3591
- display: flex;
3592
- gap: 10px;
3593
- align-items: center;
3594
- width: stretch;
3595
- padding: 7px 12px;
3596
- border: 0;
3597
- border-radius: 6px;
3598
- background: transparent;
3599
- color: var(--text);
3600
- cursor: pointer;
3601
- text-align: left;
3602
- }
3603
- .nav-item:hover {
3604
- background: var(--surface-muted);
3605
- }
3606
- .nav-item.active {
3607
- background: var(--accent-soft);
3608
- color: var(--accent);
3609
- font-weight: 600;
3610
- }
3611
- .nav-item.static {
3612
- color: var(--muted);
3613
- cursor: default;
3614
- }
3615
- .nav-item.static:hover {
3616
- background: transparent;
3617
- }
3618
- .nav-label {
3619
- flex: 1;
3620
- }
3621
- .nav-count {
3622
- margin-left: auto;
3623
- color: var(--muted);
3624
- font-size: 12px;
3625
- }
3626
- .nav-item.active .nav-count {
3627
- color: var(--accent);
3628
- }
3629
- .rail-foot {
3630
- display: flex;
3631
- gap: 8px;
3632
- align-items: center;
3633
- padding: 12px;
3634
- border-top: 1px solid var(--border-muted);
3635
- color: var(--muted);
3636
- font-size: 12px;
3637
- }
3638
- .rail-foot-copy {
3639
- min-width: 0;
3640
- flex: 1;
3641
- }
3642
- .theme-toggle {
3643
- display: inline-flex;
3644
- align-items: center;
3645
- justify-content: center;
3646
- width: 32px;
3647
- height: 32px;
3648
- padding: 0;
3649
- border: 1px solid var(--border);
3650
- border-radius: 6px;
3651
- background: var(--surface);
3652
- color: var(--text);
3653
- font: inherit;
3654
- font-size: 17px;
3655
- line-height: 1;
3656
- cursor: pointer;
3657
- }
3658
- .theme-toggle:hover,
3659
- .theme-toggle[aria-pressed="true"] {
3660
- border-color: var(--accent);
3661
- background: var(--accent-soft);
3662
- color: var(--accent);
3663
- }
3664
- .header-theme-toggle {
3665
- display: none;
3666
- }
3667
- .master {
3668
- display: flex;
3669
- flex-direction: column;
3670
- overflow: hidden;
3671
- background: var(--surface);
3672
- border-right: 1px solid var(--border);
3673
- }
3674
- .master-head {
3675
- padding: 16px;
3676
- border-bottom: 1px solid var(--border-muted);
3677
- }
3678
- .master-head h1 {
3679
- font-size: 16px;
3680
- }
3681
- .master-head p {
3682
- margin: 4px 0 0;
3683
- color: var(--muted);
3684
- font-size: 13px;
3685
- }
3686
- .master-search {
3687
- margin-top: 12px;
3688
- background: var(--surface-muted);
3689
- }
3690
- .master-status-filters {
3691
- display: flex;
3692
- gap: 6px;
3693
- flex-wrap: wrap;
3694
- margin-top: 10px;
3695
- }
3696
- .master-status-chip {
3697
- padding: 4px 8px;
3698
- border: 1px solid var(--border);
3699
- border-radius: 999px;
3700
- background: var(--surface);
3701
- color: var(--muted);
3702
- cursor: pointer;
3703
- font: inherit;
3704
- font-size: 12px;
3705
- }
3706
- .master-status-chip.active {
3707
- border-color: var(--accent);
3708
- background: var(--accent-soft);
3709
- color: var(--text);
3710
- font-weight: 600;
3711
- }
3712
- .master-list {
3713
- flex: 1;
3714
- overflow-y: auto;
3715
- }
3716
- .m-item {
3717
- display: block;
3718
- width: stretch;
3719
- padding: 14px 16px;
3720
- border: 0;
3721
- border-bottom: 1px solid var(--border-muted);
3722
- background: transparent;
3723
- cursor: pointer;
3724
- text-align: left;
3725
- }
3726
- .epic-group + .epic-group {
3727
- border-top: 1px solid var(--border);
3728
- }
3729
- .epic-group-head {
3730
- display: flex;
3731
- gap: 8px;
3732
- align-items: baseline;
3733
- width: stretch;
3734
- padding: 12px 16px;
3735
- border: 0;
3736
- background: var(--surface-muted);
3737
- color: var(--muted);
3738
- cursor: pointer;
3739
- font: inherit;
3740
- font-size: 12px;
3741
- text-align: left;
3742
- }
3743
- .epic-group-head:hover {
3744
- background: var(--accent-soft);
3745
- }
3746
- .epic-group-head:focus-visible {
3747
- outline: 2px solid rgba(9, 105, 218, 0.45);
3748
- outline-offset: -2px;
3749
- }
3750
- .epic-group-head h2 {
3751
- flex: 1;
3752
- margin: 0;
3753
- color: var(--text);
3754
- font-size: 13px;
3755
- }
3756
- .epic-progress {
3757
- height: 3px;
3758
- background: var(--border-muted);
3759
- }
3760
- .epic-progress span {
3761
- display: block;
3762
- height: 100%;
3763
- background: var(--done);
3764
- }
3765
- .m-item:hover {
3766
- background: var(--surface-muted);
3767
- }
3768
- .m-item.active {
3769
- background: var(--accent-soft);
3770
- box-shadow: inset 3px 0 0 var(--accent);
3771
- }
3772
- .m-top {
3773
- display: flex;
3774
- gap: 8px;
3775
- justify-content: space-between;
3776
- align-items: center;
3777
- }
3778
- .m-title {
3779
- font-size: 14px;
3780
- font-weight: 600;
3781
- }
3782
- .m-sub {
3783
- display: -webkit-box;
3784
- -webkit-line-clamp: 2;
3785
- -webkit-box-orient: vertical;
3786
- overflow: hidden;
3787
- margin-top: 4px;
3788
- color: var(--muted);
3789
- font-size: 12px;
3790
- line-height: 1.4;
3791
- }
3792
- .m-meta {
3793
- display: flex;
3794
- gap: 10px;
3795
- margin-top: 8px;
3796
- color: var(--muted);
3797
- font-size: 12px;
3798
- }
3799
- .m-meta b {
3800
- color: var(--text);
3801
- }
3802
- .idtag {
3803
- color: var(--muted);
3804
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
3805
- font-size: 12px;
3806
- }
3807
- .miniprog {
3808
- overflow: hidden;
3809
- height: 4px;
3810
- margin-top: 10px;
3811
- border-radius: 999px;
3812
- background: #eaeef2;
3813
- }
3814
- .miniprog > span {
3815
- display: block;
3816
- height: 100%;
3817
- background: var(--done);
3818
- }
3819
- .detail {
3820
- overflow-y: auto;
3821
- scrollbar-gutter: stable;
3822
- }
3823
- .detail-inner {
3824
- max-width: 920px;
3825
- margin: 0 auto;
3826
- padding: 28px 32px 64px;
3827
- }
3828
- .wide-inner {
3829
- max-width: none;
3830
- }
3831
- .ai-crumbs {
3832
- color: var(--muted);
3833
- font-size: 12px;
3834
- }
3835
- .d-title {
3836
- margin: 6px 0 0;
3837
- font-size: 24px;
3838
- }
3839
- .d-sub {
3840
- max-width: 70ch;
3841
- margin: 10px 0 0;
3842
- color: var(--muted);
3843
- }
3844
- .ctx-controls {
3845
- display: grid;
3846
- gap: 14px;
3847
- margin-top: 18px;
3848
- }
3849
- .ctx-tabs {
3850
- display: flex;
3851
- gap: 18px;
3852
- border-bottom: 1px solid var(--border-muted);
3853
- }
3854
- .ctx-tab {
3855
- padding: 8px 2px;
3856
- border: 0;
3857
- border-bottom: 2px solid transparent;
3858
- background: transparent;
3859
- color: var(--muted);
3860
- cursor: pointer;
3861
- font: inherit;
3862
- }
3863
- .ctx-tab.active {
3864
- border-bottom-color: #fd8c73;
3865
- color: var(--text);
3866
- font-weight: 600;
3867
- }
3868
- .ctx-shell {
3869
- display: grid;
3870
- gap: 18px;
3871
- margin-top: 16px;
3872
- }
3873
- .ctx-block {
3874
- padding: 16px;
3875
- border: 1px solid var(--border);
3876
- border-radius: 12px;
3877
- background: var(--surface);
3878
- }
3879
- .ctx-section-head {
3880
- display: flex;
3881
- gap: 16px;
3882
- justify-content: space-between;
3883
- align-items: baseline;
3884
- }
3885
- .ctx-section-title {
3886
- margin: 0;
3887
- font-size: 16px;
3888
- }
3889
- .ctx-section-copy {
3890
- margin: 4px 0 0;
3891
- color: var(--muted);
3892
- }
3893
- .ctx-stats {
3894
- color: var(--muted);
3895
- font-size: 12px;
3896
- text-align: right;
3897
- }
3898
- .ctx-initiative-tabs {
3899
- display: flex;
3900
- gap: 8px;
3901
- flex-wrap: wrap;
3902
- margin-top: 16px;
3903
- }
3904
- .ctx-initiative-tab {
3905
- padding: 7px 10px;
3906
- border: 1px solid var(--border);
3907
- border-radius: 6px;
3908
- background: var(--surface);
3909
- color: var(--text);
3910
- cursor: pointer;
3911
- font: inherit;
3912
- }
3913
- .ctx-initiative-tab.active {
3914
- border-color: var(--accent);
3915
- background: var(--accent-soft);
3916
- font-weight: 600;
3917
- }
3918
- .ctx-list {
3919
- display: grid;
3920
- gap: 12px;
3921
- margin-top: 14px;
3922
- }
3923
- .ctx-term {
3924
- padding: 14px 16px;
3925
- border: 1px solid var(--border);
3926
- border-radius: 10px;
3927
- background: var(--surface-muted);
3928
- }
3929
- .ctx-term:focus {
3930
- outline: 2px solid var(--focus-ring);
3931
- outline-offset: -2px;
3932
- }
3933
- .ctx-term.is-context-term-target {
3934
- animation: context-term-target 1.8s ease-out;
3935
- }
3936
- .ctx-context-summary:focus {
3937
- outline: 2px solid var(--focus-ring);
3938
- outline-offset: 4px;
3939
- }
3940
- .ctx-context-summary.is-context-target {
3941
- animation: context-term-target 1.8s ease-out;
3942
- }
3943
- @keyframes context-term-target {
3944
- 0% {
3945
- background: var(--accent-soft);
3946
- box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 32%, transparent);
3947
- }
3948
- 100% {
3949
- background: var(--surface-muted);
3950
- box-shadow: 0 0 0 0 transparent;
3951
- }
3952
- }
3953
- @media (prefers-reduced-motion: reduce) {
3954
- .ctx-context-summary.is-context-target,
3955
- .ctx-term.is-context-term-target {
3956
- animation: none;
3957
- outline: 2px solid var(--focus-ring);
3958
- }
3959
- }
3960
- .ctx-top {
3961
- display: flex;
3962
- gap: 8px;
3963
- align-items: center;
3964
- flex-wrap: wrap;
3965
- }
3966
- .ctx-name {
3967
- font-size: 16px;
3968
- font-weight: 600;
3969
- }
3970
- .ctx-badge {
3971
- padding: 2px 8px;
3972
- border-radius: 999px;
3973
- font-size: 12px;
3974
- font-weight: 600;
3975
- }
3976
- .ctx-badge.shared {
3977
- background: #ddf4ff;
3978
- color: #0969da;
3979
- }
3980
- .ctx-badge.warn {
3981
- background: #fff8c5;
3982
- color: #9a6700;
3983
- }
3984
- .ctx-sources {
3985
- display: grid;
3986
- gap: 10px;
3987
- margin-top: 12px;
3988
- }
3989
- .ctx-source {
3990
- padding-left: 12px;
3991
- border-left: 3px solid var(--border);
3992
- }
3993
- .ctx-source[data-scope="default"] {
3994
- border-left-color: #0969da;
3995
- }
3996
- .ctx-source[data-scope="initiative"] {
3997
- border-left-color: #1f883d;
3998
- }
3999
- .ctx-source-head {
4000
- display: flex;
4001
- gap: 8px;
4002
- align-items: baseline;
4003
- flex-wrap: wrap;
4004
- }
4005
- .ctx-scope {
4006
- font-weight: 600;
4007
- }
4008
- .ctx-source-title {
4009
- color: var(--muted);
4010
- font-size: 12px;
4011
- }
4012
- .ctx-def {
4013
- max-width: 75ch;
4014
- margin: 6px 0 0;
4015
- }
4016
- .ctx-avoid {
4017
- display: flex;
4018
- gap: 6px;
4019
- align-items: center;
4020
- flex-wrap: wrap;
4021
- margin-top: 8px;
4022
- }
4023
- .ctx-avoid-label {
4024
- color: var(--muted);
4025
- font-size: 11px;
4026
- letter-spacing: 0.04em;
4027
- text-transform: uppercase;
4028
- }
4029
- .ctx-avoid-chip {
4030
- padding: 2px 8px;
4031
- border: 1px solid var(--border);
4032
- border-radius: 999px;
4033
- background: var(--surface);
4034
- color: var(--muted);
4035
- font-size: 12px;
4036
- }
4037
- .ctx-empty {
4038
- margin: 14px 0 0;
4039
- color: var(--muted);
4040
- }
4041
- .ai-graph-wrap {
4042
- margin-top: 18px;
4043
- border: 1px solid var(--border);
4044
- border-radius: 10px;
4045
- background:
4046
- radial-gradient(circle, rgba(208, 215, 222, 0.5) 1px, transparent 1px) 0 0 / 22px 22px,
4047
- var(--surface);
4048
- overflow: auto;
4049
- }
4050
- .graph-scroll-content,
4051
- .graph-host {
4052
- width: max-content;
4053
- min-width: 100%;
4054
- }
4055
- .ai-graph-legend {
4056
- display: flex;
4057
- gap: 16px;
4058
- flex-wrap: wrap;
4059
- padding: 10px 14px;
4060
- border-bottom: 1px solid var(--border-muted);
4061
- font-size: 12px;
4062
- color: var(--muted);
4063
- background: var(--surface);
4064
- position: sticky;
4065
- top: 0;
4066
- z-index: 1;
4067
- }
4068
- .ai-graph-hint {
4069
- margin-left: auto;
4070
- }
4071
- .graph-host {
4072
- padding: 0;
4073
- }
4074
- .empty {
4075
- display: grid;
4076
- place-items: center;
4077
- height: stretch;
4078
- color: var(--muted);
4079
- text-align: center;
4080
- }
4081
- .empty-glyph {
4082
- font-size: 40px;
4083
- }
4084
- .project-chooser {
4085
- min-height: 100%;
4086
- overflow-y: auto;
4087
- background: var(--page-bg);
4088
- }
4089
- .project-chooser-inner {
4090
- max-width: 1040px;
4091
- margin: 0 auto;
4092
- padding: 40px 32px 64px;
4093
- }
4094
- .project-chooser h1 {
4095
- margin-top: 6px;
4096
- font-size: 28px;
4097
- }
4098
- .project-chooser-copy {
4099
- margin: 10px 0 0;
4100
- color: var(--muted);
4101
- }
4102
- .project-grid {
4103
- display: grid;
4104
- grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
4105
- gap: 12px;
4106
- margin-top: 24px;
4107
- }
4108
- .project-card {
4109
- display: grid;
4110
- gap: 16px;
4111
- min-height: 180px;
4112
- padding: 18px;
4113
- border: 1px solid var(--border);
4114
- border-radius: 8px;
4115
- background: var(--surface);
4116
- cursor: pointer;
4117
- text-align: left;
4118
- }
4119
- .project-card:hover {
4120
- border-color: var(--accent);
4121
- box-shadow: 0 2px 8px rgba(31, 35, 40, 0.1);
4122
- }
4123
- .project-card:focus-visible,
4124
- .projects-button:focus-visible {
4125
- outline: 2px solid rgba(9, 105, 218, 0.45);
4126
- outline-offset: 2px;
4127
- }
4128
- .project-card-head {
4129
- display: flex;
4130
- gap: 12px;
4131
- justify-content: space-between;
4132
- align-items: start;
4133
- }
4134
- .project-card h2 {
4135
- font-size: 16px;
4136
- }
4137
- .project-card p {
4138
- margin: 4px 0 0;
4139
- color: var(--muted);
4140
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
4141
- font-size: 12px;
4142
- }
4143
- .project-counts {
4144
- display: flex;
4145
- gap: 8px;
4146
- flex-wrap: wrap;
4147
- color: var(--muted);
4148
- font-size: 13px;
4149
- }
4150
- .project-progress {
4151
- overflow: hidden;
4152
- height: 6px;
4153
- border-radius: 3px;
4154
- background: var(--border-muted);
4155
- }
4156
- .project-progress span {
4157
- display: block;
4158
- height: 100%;
4159
- background: var(--done);
4160
- }
4161
- .project-state {
4162
- max-width: 560px;
4163
- margin-top: 24px;
4164
- padding: 18px;
4165
- border: 1px solid var(--border);
4166
- border-radius: 8px;
4167
- background: var(--surface);
4168
- color: var(--muted);
4169
- }
4170
- .project-state.unavailable {
4171
- border-color: rgba(207, 34, 46, 0.25);
4172
- background: var(--danger-bg);
4173
- color: var(--danger);
4174
- }
4175
- @media (max-width: 900px) {
4176
- :host {
4177
- height: 100dvh;
4178
- }
4179
- .console,
4180
- .console.wide {
4181
- position: relative;
4182
- grid-template-columns: minmax(0, 1fr);
4183
- grid-template-rows: 52px minmax(0, 1fr);
4184
- height: 100dvh;
4185
- overflow: hidden;
4186
- }
4187
- .console.narrow .rail {
4188
- grid-column: 1;
4189
- grid-row: 1;
4190
- flex-direction: row;
4191
- align-items: center;
4192
- border-right: 0;
4193
- border-bottom: 1px solid var(--border);
4194
- overflow: hidden;
4195
- z-index: 10;
4196
- }
4197
- .console.narrow .rail .pane-collapse,
4198
- .console.narrow .rail-foot,
4199
- .console.narrow .nav-group-label,
4200
- .console.narrow .nav-item.static,
4201
- .console.narrow .nav-count,
4202
- .console.narrow .sw-text,
4203
- .console.narrow .switcher-tenant-button {
4204
- display: none;
4205
- }
4206
- .mobile-master-toggle {
4207
- display: inline-flex;
4208
- flex: 0 0 40px;
4209
- align-items: center;
4210
- justify-content: center;
4211
- align-self: stretch;
4212
- padding: 0;
4213
- border: 0;
4214
- border-right: 1px solid var(--border);
4215
- background: var(--surface);
4216
- color: var(--text);
4217
- font: inherit;
4218
- font-size: 18px;
4219
- cursor: pointer;
4220
- }
4221
- .mobile-master-toggle[aria-pressed="true"] {
4222
- background: var(--accent-soft);
4223
- color: var(--accent);
4224
- }
4225
- .console.narrow .rail-switcher {
4226
- flex: 0 0 auto;
4227
- padding: 4px 8px;
4228
- border: 0;
4229
- }
4230
- .console.narrow .header-theme-toggle {
4231
- display: inline-flex;
4232
- flex: 0 0 40px;
4233
- align-self: stretch;
4234
- width: 40px;
4235
- height: auto;
4236
- margin-left: auto;
4237
- border-top: 0;
4238
- border-right: 0;
4239
- border-bottom: 0;
4240
- border-radius: 0;
4241
- }
4242
- .console.narrow .global-search-icon-trigger {
4243
- display: inline-flex;
4244
- flex: 0 0 40px;
4245
- align-items: center;
4246
- justify-content: center;
4247
- align-self: stretch;
4248
- width: 40px;
4249
- padding: 0;
4250
- border: 0;
4251
- border-right: 1px solid var(--border);
4252
- background: var(--surface);
4253
- color: var(--text);
4254
- cursor: pointer;
4255
- font: inherit;
4256
- font-size: 20px;
4257
- }
4258
- .console.narrow .switcher-button {
4259
- width: 36px;
4260
- padding: 4px;
4261
- border: 0;
4262
- background: transparent;
4263
- }
4264
- .console.narrow .rail-nav {
4265
- display: flex;
4266
- flex: 1;
4267
- gap: 2px;
4268
- align-self: stretch;
4269
- overflow-x: auto;
4270
- overflow-y: hidden;
4271
- padding: 4px;
4272
- }
4273
- .console.narrow .nav-item {
4274
- flex: 0 0 40px;
4275
- justify-content: center;
4276
- width: 40px;
4277
- padding: 0;
4278
- }
4279
- .console.narrow .nav-label {
4280
- display: none;
4281
- }
4282
- .console.narrow .master,
4283
- .console.narrow .detail {
4284
- grid-column: 1;
4285
- grid-row: 2;
4286
- min-height: 0;
4287
- }
4288
- .console.narrow .detail {
4289
- overflow-y: auto;
4290
- }
4291
- .console.narrow .master {
4292
- z-index: 5;
4293
- border-right: 0;
4294
- box-shadow: 0 12px 28px rgba(31, 35, 40, 0.18);
4295
- }
4296
- .console.narrow.has-detail:not(.mobile-master-open) .master {
4297
- display: none;
4298
- }
4299
- .console.narrow .master .pane-collapse {
4300
- display: none;
4301
- }
4302
- .console.narrow.master-collapsed .master-head,
4303
- .console.narrow.master-collapsed .master-list {
4304
- display: block;
4305
- }
4306
- .console.narrow .detail-inner {
4307
- padding: 20px 16px 40px;
4308
- }
4309
- .project-chooser-inner {
4310
- padding: 28px 16px 40px;
4311
- }
4312
- }
4313
- @media (min-width: 901px) and (max-width: 1200px) {
4314
- .console,
4315
- .console.wide {
4316
- grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
4317
- grid-template-rows: 52px minmax(0, 1fr);
4318
- }
4319
- .console.medium.rail-collapsed,
4320
- .console.medium.master-collapsed,
4321
- .console.medium.rail-collapsed.master-collapsed {
4322
- grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
4323
- }
4324
- .console.medium .rail {
4325
- grid-column: 1 / -1;
4326
- grid-row: 1;
4327
- flex-direction: row;
4328
- align-items: center;
4329
- border-right: 0;
4330
- border-bottom: 1px solid var(--border);
4331
- overflow: hidden;
4332
- }
4333
- .console.medium .rail .pane-collapse,
4334
- .console.medium .rail-foot,
4335
- .console.medium .nav-group-label,
4336
- .console.medium .nav-item.static,
4337
- .console.medium .nav-count,
4338
- .console.medium .sw-text,
4339
- .console.medium .switcher-tenant-button {
4340
- display: none;
4341
- }
4342
- .console.medium .rail-switcher {
4343
- flex: 0 0 auto;
4344
- padding: 4px 8px;
4345
- border: 0;
4346
- }
4347
- .console.medium .switcher-button {
4348
- width: 36px;
4349
- padding: 4px;
4350
- border: 0;
4351
- background: transparent;
4352
- }
4353
- .console.medium .rail-nav {
4354
- display: flex;
4355
- flex: 1;
4356
- gap: 2px;
4357
- align-self: stretch;
4358
- overflow-x: auto;
4359
- overflow-y: hidden;
4360
- padding: 4px;
4361
- }
4362
- .console.medium .nav-item {
4363
- flex: 0 0 40px;
4364
- justify-content: center;
4365
- width: 40px;
4366
- padding: 0;
4367
- }
4368
- .console.medium .nav-label {
4369
- display: none;
4370
- }
4371
- .console.medium .master {
4372
- grid-column: 1;
4373
- grid-row: 2;
4374
- min-height: 0;
4375
- }
4376
- .console.medium .detail {
4377
- grid-column: 2;
4378
- grid-row: 2;
4379
- min-width: 0;
4380
- }
4381
- .console.medium.wide .detail {
4382
- grid-column: 1 / -1;
4383
- }
4384
- .console.medium .master .pane-collapse {
4385
- display: none;
4386
- }
4387
- .console.medium.rail-collapsed .rail-switcher,
4388
- .console.medium.rail-collapsed .rail-nav {
4389
- display: flex;
4390
- }
4391
- .console.medium.master-collapsed .master-head,
4392
- .console.medium.master-collapsed .master-list {
4393
- display: block;
4394
- }
4395
- }
4396
- `];let li=Ci;customElements.define("agent-issues-app",li);const on=document.querySelector("#app");on&&on.replaceChildren(document.createElement("agent-issues-app"));