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.
- package/dist/open-storage-driver.d.ts +2 -0
- package/dist/open-storage-driver.js +3 -1
- package/dist/open-storage-driver.js.map +1 -1
- package/dist/site/cloud-events-relay.d.ts +2 -4
- package/dist/site/cloud-events-relay.js.map +1 -1
- package/dist/site/server.js +319 -7
- package/dist/site/server.js.map +1 -1
- package/dist/skill-installer.js +9 -3
- package/dist/skill-installer.js.map +1 -1
- package/package.json +1 -1
- package/site/dist/assets/index-Cx-fLU3e.js +4496 -0
- package/site/dist/index.html +1 -1
- package/skills/agent-issues-operating-contract.md +1 -1
- package/skills/{ai-wayfinder → ai-pioneer}/SKILL.md +9 -9
- package/skills/recipes/README.md +2 -2
- package/skills/recipes/{wayfinder-map.md → pioneer-map.md} +2 -2
- package/skills/recipes/{wayfinder-ticket.md → pioneer-ticket.md} +2 -2
- package/site/dist/assets/index-DSR4mIml.js +0 -4396
|
@@ -0,0 +1,4496 @@
|
|
|
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 r of i)if(r.type==="childList")for(const a of r.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function t(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(i){if(i.ep)return;i.ep=!0;const r=t(i);fetch(i.href,r)}})();var pa=Object.defineProperty,ha=(n,e,t)=>e in n?pa(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ts=(n,e,t)=>(ha(n,typeof e!="symbol"?e+"":e,t),t),ga=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},Cs=(n,e)=>{if(Object(e)!==e)throw TypeError('Cannot use the "in" operator on this value');return n.has(e)},Ot=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},cr=(n,e,t)=>(ga(n,e,"access private method"),t);function cn(n,e){return Object.is(n,e)}let V=null,bt=!1,Bt=1;const qt=Symbol("SIGNAL");function Xe(n){const e=V;return V=n,e}function fa(){return V}function ma(){return bt}const di={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 ss(n){if(bt)throw new Error(typeof ngDevMode<"u"&&ngDevMode?"Assertion error: signal read during notification phase":"");if(V===null)return;V.consumerOnSignalRead(n);const e=V.nextProducerIndex++;if(st(V),e<V.producerNode.length&&V.producerNode[e]!==n&&qs(V)){const t=V.producerNode[e];is(t,V.producerIndexOfThis[e])}V.producerNode[e]!==n&&(V.producerNode[e]=n,V.producerIndexOfThis[e]=qs(V)?pn(n,V,e):0),V.producerLastReadVersion[e]=n.version}function ba(){Bt++}function dn(n){if(!(!n.dirty&&n.lastCleanEpoch===Bt)){if(!n.producerMustRecompute(n)&&!Sa(n)){n.dirty=!1,n.lastCleanEpoch=Bt;return}n.producerRecomputeValue(n),n.dirty=!1,n.lastCleanEpoch=Bt}}function un(n){if(n.liveConsumerNode===void 0)return;const e=bt;bt=!0;try{for(const t of n.liveConsumerNode)t.dirty||va(t)}finally{bt=e}}function xa(){return V?.consumerAllowSignalWrites!==!1}function va(n){var e;n.dirty=!0,un(n),(e=n.consumerMarkedDirty)==null||e.call(n.wrapper??n)}function ya(n){return n&&(n.nextProducerIndex=0),Xe(n)}function wa(n,e){if(Xe(e),!(!n||n.producerNode===void 0||n.producerIndexOfThis===void 0||n.producerLastReadVersion===void 0)){if(qs(n))for(let t=n.nextProducerIndex;t<n.producerNode.length;t++)is(n.producerNode[t],n.producerIndexOfThis[t]);for(;n.producerNode.length>n.nextProducerIndex;)n.producerNode.pop(),n.producerLastReadVersion.pop(),n.producerIndexOfThis.pop()}}function Sa(n){st(n);for(let e=0;e<n.producerNode.length;e++){const t=n.producerNode[e],s=n.producerLastReadVersion[e];if(s!==t.version||(dn(t),s!==t.version))return!0}return!1}function pn(n,e,t){var s;if(ui(n),st(n),n.liveConsumerNode.length===0){(s=n.watched)==null||s.call(n.wrapper);for(let i=0;i<n.producerNode.length;i++)n.producerIndexOfThis[i]=pn(n.producerNode[i],n,i)}return n.liveConsumerIndexOfThis.push(t),n.liveConsumerNode.push(e)-1}function is(n,e){var t;if(ui(n),st(n),typeof ngDevMode<"u"&&ngDevMode&&e>=n.liveConsumerNode.length)throw new Error(`Assertion error: active consumer index ${e} is out of bounds of ${n.liveConsumerNode.length} consumers)`);if(n.liveConsumerNode.length===1){(t=n.unwatched)==null||t.call(n.wrapper);for(let i=0;i<n.producerNode.length;i++)is(n.producerNode[i],n.producerIndexOfThis[i])}const s=n.liveConsumerNode.length-1;if(n.liveConsumerNode[e]=n.liveConsumerNode[s],n.liveConsumerIndexOfThis[e]=n.liveConsumerIndexOfThis[s],n.liveConsumerNode.length--,n.liveConsumerIndexOfThis.length--,e<n.liveConsumerNode.length){const i=n.liveConsumerIndexOfThis[e],r=n.liveConsumerNode[e];st(r),r.producerIndexOfThis[i]=e}}function qs(n){var e;return n.consumerIsAlwaysLive||(((e=n?.liveConsumerNode)==null?void 0:e.length)??0)>0}function st(n){n.producerNode??(n.producerNode=[]),n.producerIndexOfThis??(n.producerIndexOfThis=[]),n.producerLastReadVersion??(n.producerLastReadVersion=[])}function ui(n){n.liveConsumerNode??(n.liveConsumerNode=[]),n.liveConsumerIndexOfThis??(n.liveConsumerIndexOfThis=[])}function hn(n){if(dn(n),ss(n),n.value===Hs)throw n.error;return n.value}function ka(n){const e=Object.create($a);e.computation=n;const t=()=>hn(e);return t[qt]=e,t}const Rs=Symbol("UNSET"),Es=Symbol("COMPUTING"),Hs=Symbol("ERRORED"),$a={...di,value:Rs,dirty:!0,error:null,equal:cn,producerMustRecompute(n){return n.value===Rs||n.value===Es},producerRecomputeValue(n){if(n.value===Es)throw new Error("Detected cycle in computations.");const e=n.value;n.value=Es;const t=ya(n);let s,i=!1;try{s=n.computation.call(n.wrapper),i=e!==Rs&&e!==Hs&&n.equal.call(n.wrapper,e,s)}catch(r){s=Hs,n.error=r}finally{wa(n,t)}if(i){n.value=e;return}n.value=s,n.version++}};function Ia(){throw new Error}let Ta=Ia;function Ca(){Ta()}function Ra(n){const e=Object.create(Aa);e.value=n;const t=()=>(ss(e),e.value);return t[qt]=e,t}function Ea(){return ss(this),this.value}function _a(n,e){xa()||Ca(),n.equal.call(n.wrapper,n.value,e)||(n.value=e,Pa(n))}const Aa={...di,equal:cn,value:void 0};function Pa(n){n.version++,ba(),un(n)}const X=Symbol("node");var te;(n=>{var e,t,s,i;class r{constructor(l,u={}){Ot(this,t),Ts(this,e);const d=Ra(l)[qt];if(this[X]=d,d.wrapper=this,u){const g=u.equals;g&&(d.equal=g),d.watched=u[n.subtle.watched],d.unwatched=u[n.subtle.unwatched]}}get(){if(!(0,n.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.get");return Ea.call(this[X])}set(l){if(!(0,n.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.set");if(ma())throw new Error("Writes to signals not permitted during Watcher callback");const u=this[X];_a(u,l)}}e=X,t=new WeakSet,n.isState=o=>typeof o=="object"&&Cs(t,o),n.State=r;class a{constructor(l,u){Ot(this,i),Ts(this,s);const d=ka(l)[qt];if(d.consumerAllowSignalWrites=!0,this[X]=d,d.wrapper=this,u){const g=u.equals;g&&(d.equal=g),d.watched=u[n.subtle.watched],d.unwatched=u[n.subtle.unwatched]}}get(){if(!(0,n.isComputed)(this))throw new TypeError("Wrong receiver type for Signal.Computed.prototype.get");return hn(this[X])}}s=X,i=new WeakSet,n.isComputed=o=>typeof o=="object"&&Cs(i,o),n.Computed=a,(o=>{var l,u,p,d;function g(R){let A,C=null;try{C=Xe(null),A=R()}finally{Xe(C)}return A}o.untrack=g;function v(R){var A;if(!(0,n.isComputed)(R)&&!(0,n.isWatcher)(R))throw new TypeError("Called introspectSources without a Computed or Watcher argument");return((A=R[X].producerNode)==null?void 0:A.map(C=>C.wrapper))??[]}o.introspectSources=v;function y(R){var A;if(!(0,n.isComputed)(R)&&!(0,n.isState)(R))throw new TypeError("Called introspectSinks without a Signal argument");return((A=R[X].liveConsumerNode)==null?void 0:A.map(C=>C.wrapper))??[]}o.introspectSinks=y;function L(R){if(!(0,n.isComputed)(R)&&!(0,n.isState)(R))throw new TypeError("Called hasSinks without a Signal argument");const A=R[X].liveConsumerNode;return A?A.length>0:!1}o.hasSinks=L;function O(R){if(!(0,n.isComputed)(R)&&!(0,n.isWatcher)(R))throw new TypeError("Called hasSources without a Computed or Watcher argument");const A=R[X].producerNode;return A?A.length>0:!1}o.hasSources=O;class I{constructor(A){Ot(this,u),Ot(this,p),Ts(this,l);let C=Object.create(di);C.wrapper=this,C.consumerMarkedDirty=A,C.consumerIsAlwaysLive=!0,C.consumerAllowSignalWrites=!1,C.producerNode=[],this[X]=C}watch(...A){if(!(0,n.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");cr(this,p,d).call(this,A);const C=this[X];C.dirty=!1;const T=Xe(C);for(const z of A)ss(z[X]);Xe(T)}unwatch(...A){if(!(0,n.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");cr(this,p,d).call(this,A);const C=this[X];st(C);for(let T=C.producerNode.length-1;T>=0;T--)if(A.includes(C.producerNode[T].wrapper)){is(C.producerNode[T],C.producerIndexOfThis[T]);const z=C.producerNode.length-1;if(C.producerNode[T]=C.producerNode[z],C.producerIndexOfThis[T]=C.producerIndexOfThis[z],C.producerNode.length--,C.producerIndexOfThis.length--,C.nextProducerIndex--,T<C.producerNode.length){const m=C.producerIndexOfThis[T],M=C.producerNode[T];ui(M),M.liveConsumerIndexOfThis[m]=T}}}getPending(){if(!(0,n.isWatcher)(this))throw new TypeError("Called getPending without Watcher receiver");return this[X].producerNode.filter(C=>C.dirty).map(C=>C.wrapper)}}l=X,u=new WeakSet,p=new WeakSet,d=function(R){for(const A of R)if(!(0,n.isComputed)(A)&&!(0,n.isState)(A))throw new TypeError("Called watch/unwatch without a Computed or State argument")},n.isWatcher=R=>Cs(u,R),o.Watcher=I;function x(){var R;return(R=fa())==null?void 0:R.wrapper}o.currentComputed=x,o.watched=Symbol("watched"),o.unwatched=Symbol("unwatched")})(n.subtle||(n.subtle={}))})(te||(te={}));let _s=!1;const dr=new te.subtle.Watcher(()=>{_s||(_s=!0,queueMicrotask(()=>{_s=!1;for(const n of dr.getPending())n.get();dr.watch()}))}),La=Symbol("SignalWatcherBrand"),Da=new FinalizationRegistry(n=>{n.unwatch(...te.subtle.introspectSources(n))}),ur=new WeakMap;function rs(n){return n[La]===!0?(console.warn("SignalWatcher should not be applied to the same class more than once."),n):class extends n{constructor(){super(...arguments),this._$St=new Map,this._$So=new te.State(0),this._$Si=!1}_$Sl(){var e,t;const s=[],i=[];this._$St.forEach((a,o)=>{(a?.beforeUpdate?s:i).push(o)});const r=(e=this.h)===null||e===void 0?void 0:e.getPending().filter(a=>a!==this._$Su&&!this._$St.has(a));s.forEach(a=>a.get()),(t=this._$Su)===null||t===void 0||t.get(),r.forEach(a=>a.get()),i.forEach(a=>a.get())}_$Sv(){this.isUpdatePending||queueMicrotask(()=>{this.isUpdatePending||this._$Sl()})}_$S_(){if(this.h!==void 0)return;this._$Su=new te.Computed(()=>{this._$So.get(),super.performUpdate()});const e=this.h=new te.subtle.Watcher(function(){const t=ur.get(this);t!==void 0&&(t._$Si===!1&&(new Set(this.getPending()).has(t._$Su)?t.requestUpdate():t._$Sv()),this.watch())});ur.set(e,this),Da.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(...te.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 te.Computed(()=>{e()});return this.h.watch(i),this._$St.set(i,t),(s=t?.beforeUpdate)!==null&&s!==void 0&&s?te.subtle.untrack(()=>i.get()):this.updateComplete.then(()=>te.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},hi=n=>(...e)=>({_$litDirective$:n,values:e});let gi=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=n=>n,Ht=fi.trustedTypes,hr=Ht?Ht.createPolicy("lit-html",{createHTML:n=>n}):void 0,gn="$lit$",Ce=`lit$${Math.random().toFixed(9).slice(2)}$`,fn="?"+Ce,ja=`<${fn}>`,Me=document,vt=()=>Me.createComment(""),yt=n=>n===null||typeof n!="object"&&typeof n!="function",mi=Array.isArray,Oa=n=>mi(n)||typeof n?.[Symbol.iterator]=="function",As=`[
|
|
2
|
+
\f\r]`,ct=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,gr=/-->/g,fr=/>/g,Pe=RegExp(`>|${As}(?:([^\\s"'>=/]+)(${As}*=${As}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),mr=/'/g,br=/"/g,mn=/^(?:script|style|textarea|title)$/i,bn=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),h=bn(1),Nt=bn(2),ve=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),xr=new WeakMap,Ne=Me.createTreeWalker(Me,129);function xn(n,e){if(!mi(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return hr!==void 0?hr.createHTML(e):e}const Na=(n,e)=>{const t=n.length-1,s=[];let i,r=e===2?"<svg>":e===3?"<math>":"",a=ct;for(let o=0;o<t;o++){const l=n[o];let u,p,d=-1,g=0;for(;g<l.length&&(a.lastIndex=g,p=a.exec(l),p!==null);)g=a.lastIndex,a===ct?p[1]==="!--"?a=gr:p[1]!==void 0?a=fr:p[2]!==void 0?(mn.test(p[2])&&(i=RegExp("</"+p[2],"g")),a=Pe):p[3]!==void 0&&(a=Pe):a===Pe?p[0]===">"?(a=i??ct,d=-1):p[1]===void 0?d=-2:(d=a.lastIndex-p[2].length,u=p[1],a=p[3]===void 0?Pe:p[3]==='"'?br:mr):a===br||a===mr?a=Pe:a===gr||a===fr?a=ct:(a=Pe,i=void 0);const v=a===Pe&&n[o+1].startsWith("/>")?" ":"";r+=a===ct?l+ja:d>=0?(s.push(u),l.slice(0,d)+gn+l.slice(d)+Ce+v):l+Ce+(d===-2?o:v)}return[xn(n,r+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};let Ks=class vn{constructor({strings:e,_$litType$:t},s){let i;this.parts=[];let r=0,a=0;const o=e.length-1,l=this.parts,[u,p]=Na(e,t);if(this.el=vn.createElement(u,s),Ne.currentNode=this.el.content,t===2||t===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=Ne.nextNode())!==null&&l.length<o;){if(i.nodeType===1){if(i.hasAttributes())for(const d of i.getAttributeNames())if(d.endsWith(gn)){const g=p[a++],v=i.getAttribute(d).split(Ce),y=/([.?@])?(.*)/.exec(g);l.push({type:1,index:r,name:y[2],strings:v,ctor:y[1]==="."?Fa:y[1]==="?"?za:y[1]==="@"?Ba:as}),i.removeAttribute(d)}else d.startsWith(Ce)&&(l.push({type:6,index:r}),i.removeAttribute(d));if(mn.test(i.tagName)){const d=i.textContent.split(Ce),g=d.length-1;if(g>0){i.textContent=Ht?Ht.emptyScript:"";for(let v=0;v<g;v++)i.append(d[v],vt()),Ne.nextNode(),l.push({type:2,index:++r});i.append(d[g],vt())}}}else if(i.nodeType===8)if(i.data===fn)l.push({type:2,index:r});else{let d=-1;for(;(d=i.data.indexOf(Ce,d+1))!==-1;)l.push({type:7,index:r}),d+=Ce.length-1}r++}}static createElement(e,t){const s=Me.createElement("template");return s.innerHTML=e,s}};function it(n,e,t=n,s){if(e===ve)return e;let i=s!==void 0?t._$Co?.[s]:t._$Cl;const r=yt(e)?void 0:e._$litDirective$;return i?.constructor!==r&&(i?._$AO?.(!1),r===void 0?i=void 0:(i=new r(n),i._$AT(n,t,s)),s!==void 0?(t._$Co??=[])[s]=i:t._$Cl=i),i!==void 0&&(e=it(n,i._$AS(n,e.values),i,s)),e}let Ma=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);Ne.currentNode=i;let r=Ne.nextNode(),a=0,o=0,l=s[0];for(;l!==void 0;){if(a===l.index){let u;l.type===2?u=new ns(r,r.nextSibling,this,e):l.type===1?u=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(u=new Ua(r,this,e)),this._$AV.push(u),l=s[++o]}a!==l?.index&&(r=Ne.nextNode(),a++)}return Ne.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++}},ns=class yn{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,s,i){this.type=2,this._$AH=k,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=it(this,e,t),yt(e)?e===k||e==null||e===""?(this._$AH!==k&&this._$AR(),this._$AH=k):e!==this._$AH&&e!==ve&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Oa(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!==k&&yt(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=Ks.createElement(xn(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(t);else{const r=new Ma(i,this),a=r.u(this.options);r.p(t),this.T(a),this._$AH=r}}_$AC(e){let t=xr.get(e.strings);return t===void 0&&xr.set(e.strings,t=new Ks(e)),t}k(e){mi(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let s,i=0;for(const r of e)i===t.length?t.push(s=new yn(this.O(vt()),this.O(vt()),this,this.options)):s=t[i],s._$AI(r),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))}},as=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,i,r){this.type=1,this._$AH=k,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=k}_$AI(e,t=this,s,i){const r=this.strings;let a=!1;if(r===void 0)e=it(this,e,t,0),a=!yt(e)||e!==this._$AH&&e!==ve,a&&(this._$AH=e);else{const o=e;let l,u;for(e=r[0],l=0;l<r.length-1;l++)u=it(this,o[s+l],t,l),u===ve&&(u=this._$AH[l]),a||=!yt(u)||u!==this._$AH[l],u===k?e=k:e!==k&&(e+=(u??"")+r[l+1]),this._$AH[l]=u}a&&!i&&this.j(e)}j(e){e===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Fa=class extends as{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===k?void 0:e}},za=class extends as{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==k)}},Ba=class extends as{constructor(e,t,s,i,r){super(e,t,s,i,r),this.type=5}_$AI(e,t=this){if((e=it(this,e,t,0)??k)===ve)return;const s=this._$AH,i=e===k&&s!==k||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,r=e!==k&&(s===k||i);i&&this.element.removeEventListener(this.name,this,s),r&&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)}},Ua=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){it(this,e)}};const Ga={I:ns},qa=fi.litHtmlPolyfillSupport;qa?.(Ks,ns),(fi.litHtmlVersions??=[]).push("3.3.3");const Ha=(n,e,t)=>{const s=t?.renderBefore??e;let i=s._$litPart$;if(i===void 0){const r=t?.renderBefore??null;s._$litPart$=i=new ns(e.insertBefore(vt(),r),r,void 0,t??{})}return i._$AI(n),i};const{I:Ka}=Ga,vr=n=>n,yr=()=>document.createComment(""),dt=(n,e,t)=>{const s=n._$AA.parentNode,i=e===void 0?n._$AB:e._$AA;if(t===void 0){const r=s.insertBefore(yr(),i),a=s.insertBefore(yr(),i);t=new Ka(r,a,n,n.options)}else{const r=t._$AB.nextSibling,a=t._$AM,o=a!==n;if(o){let l;t._$AQ?.(n),t._$AM=n,t._$AP!==void 0&&(l=n._$AU)!==a._$AU&&t._$AP(l)}if(r!==i||o){let l=t._$AA;for(;l!==r;){const u=vr(l).nextSibling;vr(s).insertBefore(l,i),l=u}}}return t},Le=(n,e,t=n)=>(n._$AI(e,t),n),Wa={},Va=(n,e=Wa)=>n._$AH=e,Qa=n=>n._$AH,Ps=n=>{n._$AR(),n._$AA.remove()};let Ls=!1;const wr=new te.subtle.Watcher(async()=>{Ls||(Ls=!0,queueMicrotask(()=>{Ls=!1;for(const n of wr.getPending())n.get();wr.watch()}))});te.State;te.Computed;const _=(n,e)=>new te.State(n,e),j=(n,e)=>new te.Computed(n,e);const Ut=globalThis,bi=Ut.ShadowRoot&&(Ut.ShadyCSS===void 0||Ut.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,xi=Symbol(),Sr=new WeakMap;let wn=class{constructor(e,t,s){if(this._$cssResult$=!0,s!==xi)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(bi&&e===void 0){const s=t!==void 0&&t.length===1;s&&(e=Sr.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&Sr.set(t,e))}return e}toString(){return this.cssText}};const Ya=n=>new wn(typeof n=="string"?n:n+"",void 0,xi),he=(n,...e)=>{const t=n.length===1?n[0]:e.reduce((s,i,r)=>s+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+n[r+1],n[0]);return new wn(t,n,xi)},Ja=(n,e)=>{if(bi)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const s=document.createElement("style"),i=Ut.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=t.cssText,n.appendChild(s)}},kr=bi?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const s of e.cssRules)t+=s.cssText;return Ya(t)})(n):n;const{is:Za,defineProperty:Xa,getOwnPropertyDescriptor:eo,getOwnPropertyNames:to,getOwnPropertySymbols:so,getPrototypeOf:io}=Object,os=globalThis,$r=os.trustedTypes,ro=$r?$r.emptyScript:"",no=os.reactiveElementPolyfillSupport,xt=(n,e)=>n,Ws={toAttribute(n,e){switch(e){case Boolean:n=n?ro:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},Sn=(n,e)=>!Za(n,e),Ir={attribute:!0,type:String,converter:Ws,reflect:!1,useDefault:!1,hasChanged:Sn};Symbol.metadata??=Symbol("metadata"),os.litPropertyMetadata??=new WeakMap;let Je=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=Ir){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&&Xa(this.prototype,e,i)}}static getPropertyDescriptor(e,t,s){const{get:i,set:r}=eo(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:i,set(a){const o=i?.call(this);r?.call(this,a),this.requestUpdate(e,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Ir}static _$Ei(){if(this.hasOwnProperty(xt("elementProperties")))return;const e=io(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(xt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(xt("properties"))){const t=this.properties,s=[...to(t),...so(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 Ja(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 r=(s.converter?.toAttribute!==void 0?s.converter:Ws).toAttribute(t,s.type);this._$Em=e,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(e,t){const s=this.constructor,i=s._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const r=s.getPropertyOptions(i),a=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:Ws;this._$Em=i;const o=a.fromAttribute(t,r.type);this[i]=o??this._$Ej?.get(i)??o,this._$Em=null}}requestUpdate(e,t,s,i=!1,r){if(e!==void 0){const a=this.constructor;if(i===!1&&(r=this[e]),s??=a.getPropertyOptions(e),!((s.hasChanged??Sn)(r,t)||s.useDefault&&s.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,s))))return;this.C(e,t,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:s,reflect:i,wrapped:r},a){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),r!==!0||a!==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,r]of this._$Ep)this[i]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[i,r]of s){const{wrapped:a}=r,o=this[i];a!==!0||this._$AL.has(i)||o===void 0||this.C(i,void 0,r,o)}}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){}};Je.elementStyles=[],Je.shadowRootOptions={mode:"open"},Je[xt("elementProperties")]=new Map,Je[xt("finalized")]=new Map,no?.({ReactiveElement:Je}),(os.reactiveElementVersions??=[]).push("2.1.2");const vi=globalThis;class ce extends Je{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=Ha(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ve}}ce._$litElement$=!0,ce.finalized=!0,vi.litElementHydrateSupport?.({LitElement:ce});const ao=vi.litElementPolyfillSupport;ao?.({LitElement:ce});(vi.litElementVersions??=[]).push("4.2.2");const et=(n,e,t)=>{for(const s of e)if(s[0]===n)return(0,s[1])();return t?.()};const Y=hi(class extends gi{constructor(n){if(super(n),n.type!==pi.ATTRIBUTE||n.name!=="class"||n.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(n){return" "+Object.keys(n).filter(e=>n[e]).join(" ")+" "}update(n,[e]){if(this.st===void 0){this.st=new Set,n.strings!==void 0&&(this.nt=new Set(n.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=n.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 ve}});function*Gt(n,e){if(n!==void 0){let t=0;for(const s of n)yield e(s,t++)}}const Tr=(n,e,t)=>{const s=new Map;for(let i=e;i<=t;i++)s.set(n[i],i);return s},D=hi(class extends gi{constructor(n){if(super(n),n.type!==pi.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,e,t){let s;t===void 0?t=e:e!==void 0&&(s=e);const i=[],r=[];let a=0;for(const o of n)i[a]=s?s(o,a):a,r[a]=t(o,a),a++;return{values:r,keys:i}}render(n,e,t){return this.dt(n,e,t).values}update(n,[e,t,s]){const i=Qa(n),{values:r,keys:a}=this.dt(e,t,s);if(!Array.isArray(i))return this.ut=a,r;const o=this.ut??=[],l=[];let u,p,d=0,g=i.length-1,v=0,y=r.length-1;for(;d<=g&&v<=y;)if(i[d]===null)d++;else if(i[g]===null)g--;else if(o[d]===a[v])l[v]=Le(i[d],r[v]),d++,v++;else if(o[g]===a[y])l[y]=Le(i[g],r[y]),g--,y--;else if(o[d]===a[y])l[y]=Le(i[d],r[y]),dt(n,l[y+1],i[d]),d++,y--;else if(o[g]===a[v])l[v]=Le(i[g],r[v]),dt(n,i[d],i[g]),g--,v++;else if(u===void 0&&(u=Tr(a,v,y),p=Tr(o,d,g)),u.has(o[d]))if(u.has(o[g])){const L=p.get(a[v]),O=L!==void 0?i[L]:null;if(O===null){const I=dt(n,i[d]);Le(I,r[v]),l[v]=I}else l[v]=Le(O,r[v]),dt(n,i[d],O),i[L]=null;v++}else Ps(i[g]),g--;else Ps(i[d]),d++;for(;v<=y;){const L=dt(n,l[y+1]);Le(L,r[v]),l[v++]=L}for(;d<=g;){const L=i[d++];L!==null&&Ps(L)}return this.ut=a,Va(n,l),ve}});function w(n,e,t){return n?e(n):t?.(n)}const ls=he`
|
|
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
|
+
`,yi=he`
|
|
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
|
+
`,Qt=class Qt extends ce{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
|
+
${D(e.avoid,t=>t,t=>h`<span class="avoid-chip">${t}</span>`)}
|
|
214
|
+
</div>
|
|
215
|
+
`,()=>k)}
|
|
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">${D(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
|
+
`}};Qt.properties={context:{attribute:!1},emptyMessage:{attribute:!1},targetTerm:{attribute:!1}},Qt.styles=[ls,he`
|
|
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 Vs=Qt;customElements.define("agent-issues-context-view",Vs);const Cr={"context-term":"T",context:"C",entity:"R","issue-comment":"M","plan-entry":"P"},oo=[{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 rs(ce){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(r=>r!==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 r=e.key==="ArrowDown"?1:-1;this.activeResultIndex=(this.activeResultIndex+r+this.results.length)%this.results.length,this.requestUpdate();return}if(e.key==="Enter"){const r=this.results[this.activeResultIndex];if(!r)return;e.preventDefault(),this.openResult(r.navigationTarget);return}if(e.key!=="Tab")return;const t=[...this.renderRoot.querySelectorAll("button, input, select, [tabindex]:not([tabindex='-1'])")].filter(r=>!r.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 r of t.highlights)s.push(t.text.slice(i,r.start)),s.push(h`<mark>${t.text.slice(r.start,r.end)}</mark>`),i=r.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">${Cr[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">${Cr[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>`:et(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
|
+
${Gt(oo,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
|
+
${Gt(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
|
+
${Gt(this.recents,(e,t)=>this.renderRecent(e,t))}
|
|
424
|
+
</section>
|
|
425
|
+
`,()=>"")}
|
|
426
|
+
</div>
|
|
427
|
+
</div>
|
|
428
|
+
</div>
|
|
429
|
+
`}};Ei.styles=he`
|
|
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 Qs=Ei;customElements.define("agent-issues-global-search-overlay",Qs);class Ys extends gi{constructor(e){if(super(e),this.it=k,e.type!==pi.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===k||e==null)return this._t=void 0,this.it=e;if(e===ve)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:[]}}}Ys.directiveName="unsafeHTML",Ys.resultType=1;const Js=hi(Ys);function Er(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,s=Array(e);t<e;t++)s[t]=n[t];return s}function lo(n){if(Array.isArray(n))return n}function co(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var s,i,r,a,o=[],l=!0,u=!1;try{if(r=(t=t.call(n)).next,e!==0)for(;!(l=(s=r.call(t)).done)&&(o.push(s.value),o.length!==e);l=!0);}catch(p){u=!0,i=p}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function uo(){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 po(n,e){return lo(n)||co(n,e)||ho(n,e)||uo()}function ho(n,e){if(n){if(typeof n=="string")return Er(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Er(n,e):void 0}}const kn=Object.entries,_r=Object.setPrototypeOf,go=Object.isFrozen,fo=Object.getPrototypeOf,mo=Object.getOwnPropertyDescriptor;let J=Object.freeze,Z=Object.seal,Ze=Object.create,$n=typeof Reflect<"u"&&Reflect,Zs=$n.apply,Xs=$n.construct;J||(J=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),r=2;r<s;r++)i[r-2]=arguments[r];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 je=Q(Array.prototype.forEach),bo=Q(Array.prototype.lastIndexOf),Ar=Q(Array.prototype.pop),ut=Q(Array.prototype.push),xo=Q(Array.prototype.splice),tt=Array.isArray,ft=Q(String.prototype.toLowerCase),Ds=Q(String.prototype.toString),Pr=Q(String.prototype.match),pt=Q(String.prototype.replace),Lr=Q(String.prototype.indexOf),vo=Q(String.prototype.trim),yo=Q(Number.prototype.toString),wo=Q(Boolean.prototype.toString),Dr=typeof BigInt>"u"?null:Q(BigInt.prototype.toString),jr=typeof Symbol>"u"?null:Q(Symbol.prototype.toString),ae=Q(Object.prototype.hasOwnProperty),ht=Q(Object.prototype.toString),ee=Q(RegExp.prototype.test),De=So(TypeError);function Q(n){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(n,e,s)}}function So(n){return function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return Xs(n,t)}}function F(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ft;if(_r&&_r(n,null),!tt(e))return n;let s=e.length;for(;s--;){let i=e[s];if(typeof i=="string"){const r=t(i);r!==i&&(go(e)||(e[s]=r),i=r)}n[i]=!0}return n}function ko(n){for(let e=0;e<n.length;e++)ae(n,e)||(n[e]=null);return n}function le(n){const e=Ze(null);for(const s of kn(n)){var t=po(s,2);const i=t[0],r=t[1];ae(n,i)&&(tt(r)?e[i]=ko(r):r&&typeof r=="object"&&r.constructor===Object?e[i]=le(r):e[i]=r)}return e}function $o(n){switch(typeof n){case"string":return n;case"number":return yo(n);case"boolean":return wo(n);case"bigint":return Dr?Dr(n):"0";case"symbol":return jr?jr(n):"Symbol()";case"undefined":return ht(n);case"function":case"object":{if(n===null)return ht(n);const e=n,t=de(e,"toString");if(typeof t=="function"){const s=t(e);return typeof s=="string"?s:ht(s)}return ht(n)}default:return ht(n)}}function de(n,e){for(;n!==null;){const s=mo(n,e);if(s){if(s.get)return Q(s.get);if(typeof s.value=="function")return Q(s.value)}n=fo(n)}function t(){return null}return t}function Io(n){try{return ee(n,""),!0}catch{return!1}}const Or=J(["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"]),js=J(["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"]),Os=J(["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"]),To=J(["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"]),Ns=J(["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"]),Co=J(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Nr=J(["#text"]),Mr=J(["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=J(["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"]),Fr=J(["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=J(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ro=Z(/{{[\w\W]*|^[\w\W]*}}/g),Eo=Z(/<%[\w\W]*|^[\w\W]*%>/g),_o=Z(/\${[\w\W]*/g),Ao=Z(/^data-[\-\w.\u00B7-\uFFFF]+$/),Po=Z(/^aria-[\-\w]+$/),zr=Z(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Lo=Z(/^(?:\w+script|data):/i),Do=Z(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),jo=Z(/^html$/i),Oo=Z(/^[a-z][.\w]*(-[.\w]+)+$/i),Br=Z(/<[/\w!]/g),Ur=Z(/<[/\w]/g),No=Z(/<\/no(script|embed|frames)/i),Mo=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},In=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Fo=J(F({},In)),zo=(function(){const n={};return je(In,e=>{n[e]=Z(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),J(n)})(),Bo=function(){return typeof window>"u"?null:window},Uo=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 r="dompurify"+(s?"#"+s:"");try{return e.createPolicy(r,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},Gr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ie=function(e,t,s,i){return ae(e,t)&&tt(e[t])?F(i.base?le(i.base):{},e[t],i.transform):s},Fs=function(e,t,s){const i=ae(e,t)?e[t]:void 0;return i&&typeof i=="object"?le(i):s()};function Tn(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Bo();const e=S=>Tn(S);if(e.version="3.4.14",e.removed=[],!n||!n.document||n.document.nodeType!==oe.document||!n.Element)return e.isSupported=!1,e;let t=n.document;const s=t,i=s.currentScript;n.DocumentFragment;const r=n.HTMLTemplateElement,a=n.Node,o=n.Element,l=n.NodeFilter,u=n.NamedNodeMap;u===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const p=n.DOMParser,d=n.trustedTypes,g=o.prototype,v=de(g,"cloneNode"),y=de(g,"remove"),L=de(g,"nextSibling"),O=de(g,"childNodes"),I=de(g,"parentNode"),x=de(g,"shadowRoot"),R=de(g,"attributes"),A=a&&a.prototype?de(a.prototype,"nodeType"):null,C=a&&a.prototype?de(a.prototype,"nodeName"):null,T=a&&a.prototype?de(a.prototype,"ownerDocument"):null,z=function(c){return A?A(c):c.nodeType},m=function(c){return C?C(c):c.nodeName};if(typeof r=="function"){const S=t.createElement("template");S.content&&S.content.ownerDocument&&(t=S.content.ownerDocument)}let M,ge="",we,Ai=!1,nt=0;const Pi=function(){if(nt>0)throw De('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.')},Ue=function(c){Pi(),nt++;try{return M.createHTML(c)}finally{nt--}},Mn=function(c){Pi(),nt++;try{return M.createScriptURL(c)}finally{nt--}},Fn=function(){return Ai||(we=Uo(d,i),Ai=!0),we},kt=t,ds=kt.implementation,Li=kt.createNodeIterator,zn=kt.createDocumentFragment,Bn=kt.getElementsByTagName,Un=s.importNode;let G=Gr();e.isSupported=typeof kn=="function"&&typeof I=="function"&&ds&&ds.createHTMLDocument!==void 0;const Gn=Ro,qn=Eo,Hn=_o,Kn=Ao,Wn=Po,Vn=Lo,Di=Do,Qn=Oo;let ji=zr,q=null;const us=F({},[...Or,...js,...Os,...Ns,...Nr]);let H=null;const ps=F({},[...Mr,...Ms,...Fr,...Mt]);let fe=Object.seal(Ze(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}})),at=null,Oi=null;const Se=Object.seal(Ze(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ni=!0,hs=!0,Mi=!1,Fi=!0,ke=!1,Ee=!0,_e=!1,gs=!1,$t=null,It=null,fs=!1,Ge=!1,Tt=!1,Ct=!1,zi=!0,Bi=!1;const Ui="user-content-";let ms=!0,bs=!1,qe={},He=null;const Gi=F({},["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 qi=null;const Hi=F({},["audio","video","img","source","image","track"]);let Ki=null;const Wi=F({},["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",me="http://www.w3.org/1999/xhtml";let Ke=me,xs=!1,vs=null;const Yn=F({},[Rt,Et,me],Ds),Vi=J(["mi","mo","mn","ms","mtext"]);let ys=F({},Vi);const Qi=J(["annotation-xml"]);let ws=F({},Qi);const Jn=F({},["title","style","font","a","script"]);let ot=null;const Zn=["application/xhtml+xml","text/html"],Xn="text/html";let W=null,We=null;const ea=t.createElement("form"),Yi=function(c){return c instanceof RegExp||c instanceof Function},Ss=function(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(We&&We===c)return;(!c||typeof c!="object")&&(c={}),c=le(c),ot=Zn.indexOf(c.PARSER_MEDIA_TYPE)===-1?Xn:c.PARSER_MEDIA_TYPE,W=ot==="application/xhtml+xml"?Ds:ft,q=Ie(c,"ALLOWED_TAGS",us,{transform:W}),H=Ie(c,"ALLOWED_ATTR",ps,{transform:W}),vs=Ie(c,"ALLOWED_NAMESPACES",Yn,{transform:Ds}),Ki=Ie(c,"ADD_URI_SAFE_ATTR",Wi,{transform:W,base:Wi}),qi=Ie(c,"ADD_DATA_URI_TAGS",Hi,{transform:W,base:Hi}),He=Ie(c,"FORBID_CONTENTS",Gi,{transform:W}),at=Ie(c,"FORBID_TAGS",le({}),{transform:W}),Oi=Ie(c,"FORBID_ATTR",le({}),{transform:W}),qe=ae(c,"USE_PROFILES")?c.USE_PROFILES&&typeof c.USE_PROFILES=="object"?le(c.USE_PROFILES):c.USE_PROFILES:!1,Ni=c.ALLOW_ARIA_ATTR!==!1,hs=c.ALLOW_DATA_ATTR!==!1,Mi=c.ALLOW_UNKNOWN_PROTOCOLS||!1,Fi=c.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ke=c.SAFE_FOR_TEMPLATES||!1,Ee=c.SAFE_FOR_XML!==!1,_e=c.WHOLE_DOCUMENT||!1,Ge=c.RETURN_DOM||!1,Tt=c.RETURN_DOM_FRAGMENT||!1,Ct=c.RETURN_TRUSTED_TYPE||!1,fs=c.FORCE_BODY||!1,zi=c.SANITIZE_DOM!==!1,Bi=c.SANITIZE_NAMED_PROPS||!1,ms=c.KEEP_CONTENT!==!1,bs=c.IN_PLACE||!1,ji=Io(c.ALLOWED_URI_REGEXP)?c.ALLOWED_URI_REGEXP:zr,Ke=typeof c.NAMESPACE=="string"?c.NAMESPACE:me,ys=Fs(c,"MATHML_TEXT_INTEGRATION_POINTS",()=>F({},Vi)),ws=Fs(c,"HTML_INTEGRATION_POINTS",()=>F({},Qi));const f=Fs(c,"CUSTOM_ELEMENT_HANDLING",()=>Ze(null));if(fe=Ze(null),ae(f,"tagNameCheck")&&Yi(f.tagNameCheck)&&(fe.tagNameCheck=f.tagNameCheck),ae(f,"attributeNameCheck")&&Yi(f.attributeNameCheck)&&(fe.attributeNameCheck=f.attributeNameCheck),ae(f,"allowCustomizedBuiltInElements")&&typeof f.allowCustomizedBuiltInElements=="boolean"&&(fe.allowCustomizedBuiltInElements=f.allowCustomizedBuiltInElements),Z(fe),ke&&(hs=!1),Tt&&(Ge=!0),qe&&(q=F({},Nr),H=Ze(null),qe.html===!0&&(F(q,Or),F(H,Mr)),qe.svg===!0&&(F(q,js),F(H,Ms),F(H,Mt)),qe.svgFilters===!0&&(F(q,Os),F(H,Ms),F(H,Mt)),qe.mathMl===!0&&(F(q,Ns),F(H,Fr),F(H,Mt))),Se.tagCheck=null,Se.attributeCheck=null,ae(c,"ADD_TAGS")&&(typeof c.ADD_TAGS=="function"?Se.tagCheck=c.ADD_TAGS:tt(c.ADD_TAGS)&&(q===us&&(q=le(q)),F(q,c.ADD_TAGS,W))),ae(c,"ADD_ATTR")&&(typeof c.ADD_ATTR=="function"?Se.attributeCheck=c.ADD_ATTR:tt(c.ADD_ATTR)&&(H===ps&&(H=le(H)),F(H,c.ADD_ATTR,W))),ae(c,"ADD_FORBID_CONTENTS")&&tt(c.ADD_FORBID_CONTENTS)&&(He===Gi&&(He=le(He)),F(He,c.ADD_FORBID_CONTENTS,W)),ms&&(q["#text"]=!0),_e&&F(q,["html","head","body"]),q.table&&(F(q,["tbody"]),delete at.tbody),c.TRUSTED_TYPES_POLICY){if(typeof c.TRUSTED_TYPES_POLICY.createHTML!="function")throw De('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof c.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw De('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const b=M;M=c.TRUSTED_TYPES_POLICY;try{ge=Ue("")}catch($){throw M=b,$}}else c.TRUSTED_TYPES_POLICY===null?(M=void 0,ge=""):(M===void 0&&(M=Fn()),M&&typeof ge=="string"&&(ge=Ue("")));J&&J(c),We=c},Ji=F({},[...js,...Os,...To]),Zi=F({},[...Ns,...Co]),ta=function(c,f,b){return f.namespaceURI===me?c==="svg":f.namespaceURI===Rt?c==="svg"&&(b==="annotation-xml"||ys[b]):!!Ji[c]},sa=function(c,f,b){return f.namespaceURI===me?c==="math":f.namespaceURI===Et?c==="math"&&ws[b]:!!Zi[c]},ia=function(c,f,b){return f.namespaceURI===Et&&!ws[b]||f.namespaceURI===Rt&&!ys[b]?!1:!Zi[c]&&(Jn[c]||!Ji[c])},ra=function(c){let f=I(c);(!f||!f.tagName)&&(f={namespaceURI:Ke,tagName:"template"});const b=ft(c.tagName),$=ft(f.tagName);return vs[c.namespaceURI]?c.namespaceURI===Et?ta(b,f,$):c.namespaceURI===Rt?sa(b,f,$):c.namespaceURI===me?ia(b,f,$):!!(ot==="application/xhtml+xml"&&vs[c.namespaceURI]):!1},$e=function(c){ut(e.removed,{element:c});try{I(c).removeChild(c)}catch{if(y(c),!I(c))throw De("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,b){try{c.removeAttributeNode(f)}catch{try{c.removeAttribute(b)}catch{}}},_t=function(c){At(c);const f=O(c);if(f){const $=[];je(f,E=>{ut($,E)}),je($,E=>{try{y(E)}catch{}})}const b=R(c);if(b)for(let $=b.length-1;$>=0;--$){const E=b[$],P=E&&E.name;typeof P=="string"&&Xi(c,E,P)}},Ae=function(c,f,b){if(!b)try{b=f.getAttributeNode(c)}catch{b=null}ut(e.removed,{attribute:b||null,from:f});try{b?f.removeAttributeNode(b):f.removeAttribute(c)}catch{try{f.removeAttribute(c)}catch{}}if(c==="is")if(Ge||Tt)try{$e(f)}catch{}else try{f.setAttribute(c,"")}catch{}},na=function(c){const f=R(c);if(f)for(let b=f.length-1;b>=0;--b){const $=f[b],E=$&&$.name;typeof E!="string"||H[W(E)]||Xi(c,$,E)}},At=function(c){const f=[c];for(;f.length>0;){const b=f.pop();z(b)===oe.element&&na(b);const E=O(b);if(E)for(let P=E.length-1;P>=0;--P)f.push(E[P])}},er=function(c,f){return Ee?c==="patchsrc"?!0:c==="for"&&f!=="label"&&f!=="output":!1},aa=function(c){if(!Ee)return;const f=[c];for(;f.length>0;){const b=f.pop(),$=z(b);if($===oe.processingInstruction||$===oe.comment&&ee(Ur,b.data)){try{y(b)}catch{}continue}if($===oe.element){const P=b,U=W(m(b));try{P.hasAttribute&&P.hasAttribute("patchsrc")&&P.removeAttribute("patchsrc"),P.hasAttribute&&P.hasAttribute("for")&&er("for",U)&&P.removeAttribute("for")}catch{}}const E=O(b);if(E)for(let P=E.length-1;P>=0;--P)f.push(E[P])}},tr=function(c){let f=null,b=null;if(fs)c="<remove></remove>"+c;else{const P=Pr(c,/^[\r\n\t ]+/);b=P&&P[0]}ot==="application/xhtml+xml"&&Ke===me&&(c='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+c+"</body></html>");const $=M?Ue(c):c;if(Ke===me)try{f=new p().parseFromString($,ot)}catch{}if(!f||!f.documentElement){f=ds.createDocument(Ke,"template",null);try{f.documentElement.innerHTML=xs?ge:$}catch{}}const E=f.body||f.documentElement;return c&&b&&E.insertBefore(t.createTextNode(b),E.childNodes[0]||null),Ke===me?Bn.call(f,_e?"html":"body")[0]:_e?f.documentElement:E},sr=function(c){const f=T?T(c):c.ownerDocument;return Li.call(f||c,c,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Pt=function(c){return c=pt(c,Gn," "),c=pt(c,qn," "),c=pt(c,Hn," "),c},ks=function(c){var f;c.normalize();const b=T?T(c):c.ownerDocument,$=Li.call(b||c,c,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let E=$.nextNode();for(;E;)E.data=Pt(E.data),E=$.nextNode();const P=(f=c.querySelectorAll)===null||f===void 0?void 0:f.call(c,"template");P&&je(P,U=>{Ve(U.content)&&ks(U.content)})},Lt=function(c){const f=C?C(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!==A(c)||c.childNodes!==O(c)},Ve=function(c){if(!A||typeof c!="object"||c===null)return!1;try{return A(c)===oe.documentFragment}catch{return!1}},lt=function(c){if(!A||typeof c!="object"||c===null)return!1;try{return typeof A(c)=="number"}catch{return!1}};function be(S,c,f){S.length!==0&&je(S,b=>{b.call(e,c,f,We)})}const oa=function(c,f){return!!(Ee&&c.hasChildNodes()&&!lt(c.firstElementChild)&&ee(Br,c.textContent)&&ee(Br,c.innerHTML)||Ee&&c.namespaceURI===me&&Fo[f]&&(lt(c.firstElementChild)||typeof c.textContent=="string"&&ee(zo[f],c.textContent))||c.nodeType===oe.processingInstruction||Ee&&c.nodeType===oe.comment&&ee(Ur,c.data))},Dt=function(c,f){if(c instanceof RegExp)return ee(c,f);if(c instanceof Function){for(var b=arguments.length,$=new Array(b>2?b-2:0),E=2;E<b;E++)$[E-2]=arguments[E];return!!c(f,...$)}return!1},la=function(c,f,b){if(!at[f]&&or(f)&&Dt(fe.tagNameCheck,f))return!1;if(ms&&!He[f]){const $=I(c),E=O(c);if(E&&$){const P=E.length;for(let U=P-1;U>=0;--U){const K=c===b?v(E[U],!0):E[U];$.insertBefore(K,L(c))}}}return $e(c),!0},ir=function(c,f,b,$){return c.length===0?f:f===b||f===$?le(f):f},rr=function(c,f){return c===f||I(c)!==null?!1:(bs&&At(c),!0)},nr=function(c,f){if(be(G.beforeSanitizeElements,c,null),rr(c,f))return!0;if(Lt(c))return $e(c),!0;const b=W(m(c));if(q=ir(G.uponSanitizeElement,q,us,$t),be(G.uponSanitizeElement,c,{tagName:b,allowedTags:q}),rr(c,f))return!0;if(oa(c,b))return $e(c),!0;if(at[b]||!(Se.tagCheck instanceof Function&&Se.tagCheck(b))&&!q[b]){const E=la(c,b,f);return E===!1&&be(G.afterSanitizeElements,c,null),E}if(z(c)===oe.element&&!ra(c)||(b==="noscript"||b==="noembed"||b==="noframes")&&ee(No,c.innerHTML))return $e(c),!0;if(ke&&c.nodeType===oe.text){const E=Pt(c.textContent);c.textContent!==E&&(ut(e.removed,{element:c.cloneNode()}),c.textContent=E)}return be(G.afterSanitizeElements,c,null),!1},ar=function(c,f,b){if(Oi[f]||er(f,c)||zi&&(f==="id"||f==="name")&&(b in t||b in ea))return!1;const $=H[f]||Se.attributeCheck instanceof Function&&Se.attributeCheck(f,c);return hs&&ee(Kn,f)||Ni&&ee(Wn,f)?!0:$?Ki[f]||ee(ji,pt(b,Di,""))||(f==="src"||f==="xlink:href"||f==="href")&&c!=="script"&&Lr(b,"data:")===0&&qi[c]||Mi&&!ee(Vn,pt(b,Di,""))?!0:!b:or(c)&&Dt(fe.tagNameCheck,c)&&Dt(fe.attributeNameCheck,f,c)||f==="is"&&fe.allowCustomizedBuiltInElements&&Dt(fe.tagNameCheck,b)},ca=F({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),or=function(c){return!ca[ft(c)]&&ee(Qn,c)},da=function(c,f,b,$){if(M&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!b)switch(d.getAttributeType(c,f)){case"TrustedHTML":return Ue($);case"TrustedScriptURL":return Mn($)}return $},ua=function(c,f,b,$){try{b?c.setAttributeNS(b,f,$):c.setAttribute(f,$),Lt(c)?$e(c):Ar(e.removed)}catch{Ae(f,c)}},lr=function(c){be(G.beforeSanitizeAttributes,c,null);const f=c.attributes;if(!f||Lt(c))return;H=ir(G.uponSanitizeAttribute,H,ps,It);const b={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H,forceKeepAttr:void 0};let $=f.length;const E=W(c.nodeName);for(;$--;){const P=f[$],U=P.name,K=P.namespaceURI,re=P.value,ne=W(U),Is=re;let ie=U==="value"?Is:vo(Is);if(b.attrName=ne,b.attrValue=ie,b.keepAttr=!0,b.forceKeepAttr=void 0,be(G.uponSanitizeAttribute,c,b),ie=b.attrValue,Bi&&(ne==="id"||ne==="name")&&Lr(ie,Ui)!==0&&(Ae(U,c,P),ie=Ui+ie),Ee&&ee(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ie)){Ae(U,c,P);continue}if(ne==="attributename"&&Pr(ie,"href")){Ae(U,c,P);continue}if(!b.forceKeepAttr){if(!b.keepAttr){Ae(U,c,P);continue}if(!Fi&&ee(Mo,ie)){Ae(U,c,P);continue}if(ke&&(ie=Pt(ie)),!ar(E,ne,ie)){Ae(U,c,P);continue}ie=da(E,ne,K,ie),ie!==Is&&ua(c,U,K,ie)}}be(G.afterSanitizeAttributes,c,null)},jt=function(c){let f=null;const b=sr(c);for(be(G.beforeSanitizeShadowDOM,c,null);f=b.nextNode();)if(be(G.uponSanitizeShadowNode,f,null),nr(f,c),lr(f),Ve(f.content)&&jt(f.content),z(f)===oe.element){const $=x(f);Ve($)&&($s($),jt($))}be(G.afterSanitizeShadowDOM,c,null)},$s=function(c){const f=[{node:c,shadow:null}];for(;f.length>0;){const b=f.pop();if(b.shadow){jt(b.shadow);continue}const $=b.node,P=z($)===oe.element,U=O($);if(U)for(let K=U.length-1;K>=0;--K)f.push({node:U[K],shadow:null});if(P){const K=C?C($):null;if(typeof K=="string"&&W(K)==="template"){const re=$.content;Ve(re)&&f.push({node:re,shadow:null})}}if(P){const K=x($);Ve(K)&&f.push({node:null,shadow:K},{node:K,shadow:null})}}};return e.sanitize=function(S){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=null,b=null,$=null,E=null;if(xs=!S,xs&&(S="<!-->"),typeof S!="string"&&!lt(S)&&(S=$o(S),typeof S!="string"))throw De("dirty is not a string, aborting");if(!e.isSupported)return S;gs?(q=$t,H=It):Ss(c),(G.uponSanitizeElement.length>0||G.uponSanitizeAttribute.length>0)&&(q=le(q)),G.uponSanitizeAttribute.length>0&&(H=le(H)),e.removed=[];const P=bs&&typeof S!="string"&<(S);if(P){aa(S);const re=m(S);if(typeof re=="string"){const ne=W(re);if(!q[ne]||at[ne])throw _t(S),De("root node is forbidden and cannot be sanitized in-place")}if(Lt(S))throw _t(S),De("root node is clobbered and cannot be sanitized in-place");try{$s(S)}catch(ne){throw _t(S),ne}}else if(lt(S))f=tr("<!---->"),b=f.ownerDocument.importNode(S,!0),b.nodeType===oe.element&&b.nodeName==="BODY"||b.nodeName==="HTML"?f=b:f.appendChild(b),$s(b);else{if(!Ge&&!ke&&!_e&&S.indexOf("<")===-1)return M&&Ct?Ue(S):S;if(f=tr(S),!f)return Ge?null:Ct?ge:""}f&&fs&&$e(f.firstChild);const U=P?S:f;try{const re=sr(U);for(;$=re.nextNode();)nr($,U),lr($),Ve($.content)&&jt($.content)}catch(re){throw P&&(_t(S),je(e.removed,ne=>{ne.element&&At(ne.element)})),re}if(P)return je(e.removed,re=>{re.element&&At(re.element)}),ke&&ks(S),S;if(Ge){if(ke&&ks(f),Tt)for(E=zn.call(f.ownerDocument);f.firstChild;)E.appendChild(f.firstChild);else E=f;return(H.shadowroot||H.shadowrootmode)&&(E=Un.call(s,E,!0)),E}let K=_e?f.outerHTML:f.innerHTML;return _e&&q["!doctype"]&&f.ownerDocument&&f.ownerDocument.doctype&&f.ownerDocument.doctype.name&&ee(jo,f.ownerDocument.doctype.name)&&(K="<!DOCTYPE "+f.ownerDocument.doctype.name+`>
|
|
718
|
+
`+K),ke&&(K=Pt(K)),M&&Ct?Ue(K):K},e.setConfig=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ss(S),gs=!0,$t=q,It=H},e.clearConfig=function(){We=null,gs=!1,$t=null,It=null,M=we,ge=""},e.isValidAttribute=function(S,c,f){We||Ss({});const b=W(S),$=W(c);return ar(b,$,f)},e.addHook=function(S,c){typeof c=="function"&&ae(G,S)&&ut(G[S],c)},e.removeHook=function(S,c){if(ae(G,S)){if(c!==void 0){const f=bo(G[S],c);return f===-1?void 0:xo(G[S],f,1)[0]}return Ar(G[S])}},e.removeHooks=function(S){ae(G,S)&&(G[S]=[])},e.removeAllHooks=function(){G=Gr()},e}var Cn=Tn();function wi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Be=wi();function Rn(n){Be=n}var Oe={exec:()=>null};function Qe(n){let e=[];return t=>{let s=Math.max(0,Math.min(3,t-1)),i=e[s];return i||(i=n(s),e[s]=i),i}}function N(n,e=""){let t=typeof n=="string"?n:n.source,s={replace:(i,r)=>{let a=typeof r=="string"?r:r.source;return a=a.replace(se.caret,"$1"),t=t.replace(i,a),s},getRegex:()=>new RegExp(t,e)};return s}var Go=((n="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+n)}catch{return!1}})(),se={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:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Qe(n=>new RegExp(`^ {0,${n}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Qe(n=>new RegExp(`^ {0,${n}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Qe(n=>new RegExp(`^ {0,${n}}(?:\`\`\`|~~~)`)),headingBeginRegex:Qe(n=>new RegExp(`^ {0,${n}}#`)),htmlBeginRegex:Qe(n=>new RegExp(`^ {0,${n}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Qe(n=>new RegExp(`^ {0,${n}}>`))},qo=/^(?:[ \t]*(?:\n|$))+/,Ho=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ko=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,wt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Wo=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Si=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,En=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_n=N(En).replace(/bull/g,Si).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(),Vo=N(En).replace(/bull/g,Si).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]+)*)/,Qo=/^[^\n]+/,$i=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Yo=N(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",$i).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Jo=N(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Si).getRegex(),cs="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",Ii=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Zo=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",Ii).replace("tag",cs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),An=n=>N(ki).replace("hr",wt).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",n).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cs).getRegex(),Xo=An(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),el=An(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),tl=N(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",el).getRegex(),Ti={blockquote:tl,code:Ho,def:Yo,fences:Ko,heading:Wo,hr:wt,html:Zo,lheading:_n,list:Jo,newline:qo,paragraph:Xo,table:Oe,text:Qo},qr=N("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",wt).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",cs).getRegex(),sl={...Ti,lheading:Vo,table:qr,paragraph:N(ki).replace("hr",wt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",qr).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",cs).getRegex()},il={...Ti,html:N(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ii).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:Oe,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:N(ki).replace("hr",wt).replace("heading",` *#{1,6} *[^
|
|
719
|
+
]`).replace("lheading",_n).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},rl=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,nl=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Pn=/^( {2,}|\\)\n(?!\s*$)/,al=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ye=/[\p{P}\p{S}]/u,rt=/[\s\p{P}\p{S}]/u,St=/[^\s\p{P}\p{S}]/u,ol=N(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,rt).getRegex(),ll=/[\p{Pi}\p{Ps}"']/u,Ln=/(?!~)[\p{P}\p{S}]/u,cl=/(?!~)[\s\p{P}\p{S}]/u,dl=/(?:[^\s\p{P}\p{S}]|~)/u,ul=N(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Go?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Dn=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,pl=N(Dn,"u").replace(/punct/g,ye).getRegex(),hl=N(Dn,"u").replace(/punct/g,Ln).getRegex(),gl=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,fl=N(gl,"u").replace(/openQuote/g,ll).replace(/punct/g,ye).getRegex(),jn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ml=N(jn,"gu").replace(/notPunctSpace/g,St).replace(/punctSpace/g,rt).replace(/punct/g,ye).getRegex(),bl=N(jn,"gu").replace(/notPunctSpace/g,dl).replace(/punctSpace/g,cl).replace(/punct/g,Ln).getRegex(),xl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",vl=N(xl,"gu").replace(/notPunctSpace/g,St).replace(/punctSpace/g,rt).replace(/punct/g,ye).getRegex(),yl=N("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,St).replace(/punctSpace/g,rt).replace(/punct/g,ye).getRegex(),wl="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Sl=N(wl,"gu").replace(/notPunctSpace/g,St).replace(/punctSpace/g,rt).replace(/punct/g,ye).getRegex(),kl=N(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ye).getRegex(),$l="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Il=N($l,"gu").replace(/notPunctSpace/g,St).replace(/punctSpace/g,rt).replace(/punct/g,ye).getRegex(),Tl=N(/\\(punct)/,"gu").replace(/punct/g,ye).getRegex(),Cl=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(),Rl=N(Ii).replace("(?:-->|$)","-->").getRegex(),El=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",Rl).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Kt=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,_l=N(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Kt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),On=N(/^!?\[(label)\]\[(ref)\]/).replace("label",Kt).replace("ref",$i).getRegex(),Nn=N(/^!?\[(ref)\](?:\[\])?/).replace("ref",$i).getRegex(),Al=N("reflink|nolink(?!\\()","g").replace("reflink",On).replace("nolink",Nn).getRegex(),Hr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ci={_backpedal:Oe,anyPunctuation:Tl,autolink:Cl,blockSkip:ul,br:Pn,code:nl,del:Oe,delLDelim:Oe,delRDelim:Oe,emStrongLDelim:pl,emStrongRDelimAst:ml,emStrongRDelimUnd:yl,escape:rl,link:_l,nolink:Nn,punctuation:ol,reflink:On,reflinkSearch:Al,tag:El,text:al,url:Oe},Pl={...Ci,emStrongLDelim:fl,emStrongRDelimAst:vl,emStrongRDelimUnd:Sl,link:N(/^!?\[(label)\]\((.*?)\)/).replace("label",Kt).getRegex(),reflink:N(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Kt).getRegex()},ei={...Ci,emStrongRDelimAst:bl,emStrongLDelim:hl,delLDelim:kl,delRDelim:Il,url:N(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Hr).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",Hr).getRegex()},Ll={...ei,br:N(Pn).replace("{2,}","*").getRegex(),text:N(ei.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ft={normal:Ti,gfm:sl,pedantic:il},gt={normal:Ci,gfm:ei,breaks:Ll,pedantic:Pl},Dl={"&":"&","<":"<",">":">",'"':""","'":"'"},Kr=n=>Dl[n];function xe(n,e){if(e){if(se.escapeTest.test(n))return n.replace(se.escapeReplace,Kr)}else if(se.escapeTestNoEncode.test(n))return n.replace(se.escapeReplaceNoEncode,Kr);return n}function Wr(n){try{n=encodeURI(n).replace(se.percentDecode,"%")}catch{return null}return n}function Vr(n,e){let t=n.replace(se.findPipe,(r,a,o)=>{let l=!1,u=a;for(;--u>=0&&o[u]==="\\";)l=!l;return l?"|":" |"}),s=t.split(se.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(se.slashPipe,"|");return s}function Te(n,e,t){let s=n.length;if(s===0)return"";let i=0;for(;i<s&&n.charAt(s-i-1)===e;)i++;return n.slice(0,s-i)}function Qr(n){let e=n.split(`
|
|
720
|
+
`),t=e.length-1;for(;t>=0&&se.blankLine.test(e[t]);)t--;return e.length-t<=2?n:e.slice(0,t+1).join(`
|
|
721
|
+
`)}function jl(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])t++;else if(n[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function Ol(n,e=0){let t=e,s="";for(let i of n)if(i===" "){let r=4-t%4;s+=" ".repeat(r),t+=r}else s+=i,t++;return s}function Yr(n,e,t,s,i){let r=e.href,a=e.title||null,o=n[1].replace(i.other.outputLinkReplace,"$1"),l=n[0].charAt(0)==="!";s.state.inLink=!0;let u=s.state.linkEmitted,p=s.state.inRawBlock;s.state.linkEmitted=!1;let d=s.inlineTokens(o),g=s.state.linkEmitted;if(s.state.linkEmitted=u,s.state.inLink=!1,!l){if(g){s.state.inRawBlock=p;return}s.state.linkEmitted=!0}return{type:l?"image":"link",raw:t,href:r,title:a,text:o,tokens:d}}function Nl(n,e,t){let s=n.match(t.other.indentCodeCompensation);if(s===null)return e;let i=s[1];return e.split(`
|
|
722
|
+
`).map(r=>{let a=r.match(t.other.beginningSpace);if(a===null)return r;let[o]=a;return o.length>=i.length?r.slice(i.length):r}).join(`
|
|
723
|
+
`)}var Wt=class{options;rules;lexer;constructor(n){this.options=n||Be}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let t=this.options.pedantic?e[0]:Qr(e[0]),s=t.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t,codeBlockStyle:"indented",text:s}}}fences(n){let e=this.rules.block.fences.exec(n);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(n){let e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=Te(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(t=s.trim())}return{type:"heading",raw:Te(e[0],`
|
|
724
|
+
`),depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:Te(e[0],`
|
|
725
|
+
`)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=Te(e[0],`
|
|
726
|
+
`).split(`
|
|
727
|
+
`),s="",i="",r=[];for(;t.length>0;){let a=!1,o=[],l;for(l=0;l<t.length;l++)if(this.rules.other.blockquoteStart.test(t[l]))o.push(t[l]),a=!0;else if(!a)o.push(t[l]);else break;t=t.slice(l);let u=o.join(`
|
|
728
|
+
`),p=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
729
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
730
|
+
${u}`:u,i=i?`${i}
|
|
731
|
+
${p}`:p;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,r,!0),this.lexer.state.top=d,t.length===0)break;let g=r.at(-1);if(g?.type==="code")break;if(g?.type==="blockquote"){let v=g,y=t.join(`
|
|
732
|
+
`),L=v.raw+`
|
|
733
|
+
`+y.replace(this.rules.other.blockquoteSetextReplace2,""),O=this.blockquote(L);r[r.length-1]=O,s=`${s}
|
|
734
|
+
${y}`,i=i.substring(0,i.length-v.text.length)+O.text;break}else if(g?.type==="list"){let v=g,y=v.raw+`
|
|
735
|
+
`+t.join(`
|
|
736
|
+
`),L=this.list(y);r[r.length-1]=L,s=s.substring(0,s.length-g.raw.length)+L.raw,i=i.substring(0,i.length-v.raw.length)+L.raw,t=y.substring(r.at(-1).raw.length).split(`
|
|
737
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:r,text:i}}}list(n){let e=this.rules.block.list.exec(n);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 r=this.rules.other.listItemRegex(t),a=!1;for(;n;){let l=!1,u="",p="";if(!(e=r.exec(n))||this.rules.block.hr.test(n))break;u=e[0],n=n.substring(u.length);let d=Ol(e[2].split(`
|
|
738
|
+
`,1)[0],e[1].length),g=n.split(`
|
|
739
|
+
`,1)[0],v=!d.trim(),y=0;if(this.options.pedantic?(y=2,p=d.trimStart()):v?y=e[1].length+1:(y=d.search(this.rules.other.nonSpaceChar),y=y>4?1:y,p=d.slice(y),y+=e[1].length),v&&this.rules.other.blankLine.test(g)&&(u+=g+`
|
|
740
|
+
`,n=n.substring(g.length+1),l=!0),!l){let L=this.rules.other.nextBulletRegex(y),O=this.rules.other.hrRegex(y),I=this.rules.other.fencesBeginRegex(y),x=this.rules.other.headingBeginRegex(y),R=this.rules.other.htmlBeginRegex(y),A=this.rules.other.blockquoteBeginRegex(y);for(;n;){let C=n.split(`
|
|
741
|
+
`,1)[0],T;if(g=C,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),T=g):T=g.replace(this.rules.other.tabCharGlobal," "),I.test(g)||x.test(g)||R.test(g)||A.test(g)||L.test(g)||O.test(g))break;if(T.search(this.rules.other.nonSpaceChar)>=y||!g.trim())p+=`
|
|
742
|
+
`+T.slice(y);else{if(v||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||I.test(d)||x.test(d)||O.test(d))break;p+=`
|
|
743
|
+
`+g}v=!g.trim(),u+=C+`
|
|
744
|
+
`,n=n.substring(C.length+1),d=T.slice(y)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0)),i.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),i.raw+=u}let o=i.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.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(d=>d.type==="space"),p=u.length>0&&u.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=p}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 d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(l.raw);if(p){let d={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};l.checked=d.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=d.raw+l.tokens[0].raw,l.tokens[0].text=d.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(d)):l.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):l.tokens.unshift(d)}}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(n){let e=this.rules.block.html.exec(n);if(e){let t=Qr(e[0]);return{type:"html",block:!0,raw:t,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:t}}}def(n){let e=this.rules.block.def.exec(n);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:Te(e[0],`
|
|
745
|
+
`),href:s,title:i}}}table(n){let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=Vr(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
746
|
+
`):[],r={type:"table",raw:Te(e[0],`
|
|
747
|
+
`),header:[],align:[],rows:[]};if(t.length===s.length){for(let a of s)this.rules.other.tableAlignRight.test(a)?r.align.push("right"):this.rules.other.tableAlignCenter.test(a)?r.align.push("center"):this.rules.other.tableAlignLeft.test(a)?r.align.push("left"):r.align.push(null);for(let a=0;a<t.length;a++)r.header.push({text:t[a],tokens:this.lexer.inline(t[a]),header:!0,align:r.align[a]});for(let a of i)r.rows.push(Vr(a,r.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:r.align[l]})));return r}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e){let t=e[1].trim();return{type:"heading",raw:Te(e[0],`
|
|
748
|
+
`),depth:e[2].charAt(0)==="="?1:2,text:t,tokens:this.lexer.inline(t)}}}paragraph(n){let e=this.rules.block.paragraph.exec(n);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(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);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(n){let e=this.rules.inline.link.exec(n);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 r=Te(t.slice(0,-1),"\\");if((t.length-r.length)%2===0)return}else{let r=jl(e[2],"()");if(r===-2)return;if(r>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+r;e[2]=e[2].substring(0,r),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let s=e[2],i="";if(this.options.pedantic){let r=this.rules.other.pedanticHrefTitle.exec(s);r&&(s=r[1],i=r[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)),Yr(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(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){let s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[s.toLowerCase()];if(!i){let r=t[0].charAt(0);return{type:"text",raw:r,text:r}}return Yr(t,i,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(n);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,r,a,o=i,l=0,u=s[0][0],p=t===u,d=u==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*n.length+i);(s=d.exec(e))!==null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(a=[...r].length,s[3]||s[4]){o+=a;continue}else if(s[5]||s[6]){if(i%3&&!((i+a)%3)){l+=a;continue}if(p)break}if(o-=a,o>0)continue;a=Math.min(a,a+o+l);let g=[...s[0]][0].length,v=n.slice(0,i+s.index+g+a);if(Math.min(i,a)%2){let L=v.slice(1,-1);return{type:"em",raw:v,text:L,tokens:this.lexer.inlineTokens(L)}}let y=v.slice(2,-2);return{type:"strong",raw:v,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(n){let e=this.rules.inline.code.exec(n);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(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n,e,t=""){let s=this.rules.inline.delLDelim.exec(n);if(s&&(!s[1]||!t||this.rules.inline.punctuation.exec(t))){let i=[...s[0]].length-1,r,a,o=i,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*n.length+i);(s=l.exec(e))!==null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r||(a=[...r].length,a!==i))continue;if(s[3]||s[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let u=[...s[0]][0].length,p=n.slice(0,i+s.index+u+a),d=p.slice(i,-i);return{type:"del",raw:p,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(n){let e=this.rules.inline.autolink.exec(n);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(n){let e;if(e=this.rules.inline.url.exec(n)){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(n){let e=this.rules.inline.text.exec(n);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},ue=class ti{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Be,this.options.tokenizer=this.options.tokenizer||new Wt,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:se,block:Ft.normal,inline:gt.normal};this.options.pedantic?(t.block=Ft.pedantic,t.inline=gt.pedantic):this.options.gfm&&(t.block=Ft.gfm,this.options.breaks?t.inline=gt.breaks:t.inline=gt.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ft,inline:gt}}static lex(e,t){return new ti(t).lex(e)}static lexInline(e,t){return new ti(t).inlineTokens(e)}lex(e){e=e.replace(se.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(se.tabCharGlobal," ").replace(se.spaceLine,""));let i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let r;if(this.options.extensions?.block?.some(o=>(r=o.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let o=t.at(-1);r.raw.length===1&&o!==void 0?o.raw+=`
|
|
751
|
+
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
752
|
+
`)?"":`
|
|
753
|
+
`)+r.raw,o.text+=`
|
|
754
|
+
`+r.text,this.inlineQueue.at(-1).src=o.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
755
|
+
`)?"":`
|
|
756
|
+
`)+r.raw,o.text+=`
|
|
757
|
+
`+r.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let a=e;if(this.options.extensions?.startBlock){let o=1/0,l=e.slice(1),u;this.options.extensions.startBlock.forEach(p=>{u=p.call({lexer:this},l),typeof u=="number"&&u>=0&&(o=Math.min(o,u))}),o<1/0&&o>=0&&(a=e.substring(0,o+1))}if(this.state.top&&(r=this.tokenizer.paragraph(a))){let o=t.at(-1);s&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
|
|
758
|
+
`)?"":`
|
|
759
|
+
`)+r.raw,o.text+=`
|
|
760
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(r),s=a.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let o=t.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
761
|
+
`)?"":`
|
|
762
|
+
`)+r.raw,o.text+=`
|
|
763
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(r);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],r=i.lastIndexOf("[");if(!(i.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,i.slice(r+1,-1)))&&!(r>1&&this.linkInText(i.slice(1,r-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let s=e;if(this.tokens.links&&e.includes("[")){let o=this.tokenizer.rules.inline.reflinkSearch,l=u=>{let p=u.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,u.slice(p+1,-1)))return u;if(p>1&&u.charAt(0)!=="!"){let d=u.slice(1,p-1);if(this.linkInText(d))return"["+d.replace(o,l)+"]["+"a".repeat(u.length-p-2)+"]"}return"["+"a".repeat(u.length-2)+"]"};s=s.replace(o,l)}s=s.replace(this.tokenizer.rules.inline.anyPunctuation,o=>"+".repeat(o.length)),s=s.replace(this.tokenizer.rules.inline.blockSkip,(o,l,u)=>{let p=u?u.length:0;return o.slice(0,p)+"["+"a".repeat(o.length-p-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,r="",a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}i||(r=""),i=!1;let o;if(this.options.extensions?.inline?.some(u=>(o=u.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let u=t.at(-1);o.type==="text"&&u?.type==="text"?(u.raw+=o.raw,u.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,s,r)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,s,r)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let l=e;if(this.options.extensions?.startInline){let u=1/0,p=e.slice(1),d;this.options.extensions.startInline.forEach(g=>{d=g.call({lexer:this},p),typeof d=="number"&&d>=0&&(u=Math.min(u,d))}),u<1/0&&u>=0&&(l=e.substring(0,u+1))}if(o=this.tokenizer.inlineText(l)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(r=o.raw.slice(-1)),i=!0;let u=t.at(-1);u?.type==="text"?(u.raw+=o.raw,u.text+=o.text):t.push(o);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)}},Vt=class{options;parser;constructor(n){this.options=n||Be}space(n){return""}code({text:n,lang:e,escaped:t}){let s=(e||"").match(se.notSpaceStart)?.[0],i=n.replace(se.endingNewline,"")+`
|
|
764
|
+
`;return s?'<pre><code class="language-'+xe(s)+'">'+(t?i:xe(i,!0))+`</code></pre>
|
|
765
|
+
`:"<pre><code>"+(t?i:xe(i,!0))+`</code></pre>
|
|
766
|
+
`}blockquote({tokens:n}){return`<blockquote>
|
|
767
|
+
${this.parser.parse(n)}</blockquote>
|
|
768
|
+
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
|
|
769
|
+
`}hr(n){return`<hr>
|
|
770
|
+
`}list(n){let e=n.ordered,t=n.start,s="";for(let a=0;a<n.items.length;a++){let o=n.items[a];s+=this.listitem(o)}let i=e?"ol":"ul",r=e&&t!==1?' start="'+t+'"':"";return"<"+i+r+`>
|
|
771
|
+
`+s+"</"+i+`>
|
|
772
|
+
`}listitem(n){return`<li>${this.parser.parse(n.tokens)}</li>
|
|
773
|
+
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
774
|
+
`}table(n){let e="",t="";for(let i=0;i<n.header.length;i++)t+=this.tablecell(n.header[i]);e+=this.tablerow({text:t});let s="";for(let i=0;i<n.rows.length;i++){let r=n.rows[i];t="";for(let a=0;a<r.length;a++)t+=this.tablecell(r[a]);s+=this.tablerow({text:t})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
775
|
+
<thead>
|
|
776
|
+
`+e+`</thead>
|
|
777
|
+
`+s+`</table>
|
|
778
|
+
`}tablerow({text:n}){return`<tr>
|
|
779
|
+
${n}</tr>
|
|
780
|
+
`}tablecell(n){let e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
|
|
781
|
+
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${xe(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){let s=this.parser.parseInline(t),i=Wr(n);if(i===null)return s;n=i;let r='<a href="'+n+'"';return e&&(r+=' title="'+xe(e)+'"'),r+=">"+s+"</a>",r}image({href:n,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let i=Wr(n);if(i===null)return xe(t);n=i;let r=`<img src="${n}" alt="${xe(t)}"`;return e&&(r+=` title="${xe(e)}"`),r+=">",r}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:xe(n.text)}},Ri=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},pe=class si{options;renderer;textRenderer;constructor(e){this.options=e||Be,this.options.renderer=this.options.renderer||new Vt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ri}static parse(e,t){return new si(t).parse(e)}static parseInline(e,t){return new si(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 a=i,o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(a.type)){t+=o||"";continue}}let r=i;switch(r.type){case"space":{t+=this.renderer.space(r);break}case"hr":{t+=this.renderer.hr(r);break}case"heading":{t+=this.renderer.heading(r);break}case"code":{t+=this.renderer.code(r);break}case"table":{t+=this.renderer.table(r);break}case"blockquote":{t+=this.renderer.blockquote(r);break}case"list":{t+=this.renderer.list(r);break}case"checkbox":{t+=this.renderer.checkbox(r);break}case"html":{t+=this.renderer.html(r);break}case"def":{t+=this.renderer.def(r);break}case"paragraph":{t+=this.renderer.paragraph(r);break}case"text":{t+=this.renderer.text(r);break}default:{let a='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let s="";for(let i=0;i<e.length;i++){let r=e[i];if(this.options.extensions?.renderers?.[r.type]){let o=this.options.extensions.renderers[r.type].call({parser:this},r);if(o!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(r.type)){s+=o||"";continue}}let a=r;switch(a.type){case"escape":{s+=t.text(a);break}case"html":{s+=t.html(a);break}case"link":{s+=t.link(a);break}case"image":{s+=t.image(a);break}case"checkbox":{s+=t.checkbox(a);break}case"strong":{s+=t.strong(a);break}case"em":{s+=t.em(a);break}case"codespan":{s+=t.codespan(a);break}case"br":{s+=t.br(a);break}case"del":{s+=t.del(a);break}case"text":{s+=t.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}},mt=class{options;block;constructor(n){this.options=n||Be}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(n=this.block){return n?ue.lex:ue.lexInline}provideParser(n=this.block){return n?pe.parse:pe.parseInline}},Ml=class{defaults=wi();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=pe;Renderer=Vt;TextRenderer=Ri;Lexer=ue;Tokenizer=Wt;Hooks=mt;constructor(...n){this.use(...n)}walkTokens(n,e){let t=[];for(let s of n)switch(t=t.concat(e.call(this,s)),s.type){case"table":{let i=s;for(let r of i.header)t=t.concat(this.walkTokens(r.tokens,e));for(let r of i.rows)for(let a of r)t=t.concat(this.walkTokens(a.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(r=>{let a=i[r].flat(1/0);t=t.concat(this.walkTokens(a,e))}):i.tokens&&(t=t.concat(this.walkTokens(i.tokens,e)))}}return t}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.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 r=e.renderers[i.name];r?e.renderers[i.name]=function(...a){let o=i.renderer.apply(this,a);return o===!1&&(o=r.apply(this,a)),o}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=e[i.level];r?r.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),s.extensions=e),t.renderer){let i=this.defaults.renderer||new Vt(this.defaults);for(let r in t.renderer){if(!(r in i))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let a=r,o=t.renderer[a],l=i[a];i[a]=(...u)=>{let p=o.apply(i,u);return p===!1&&(p=l.apply(i,u)),p||""}}s.renderer=i}if(t.tokenizer){let i=this.defaults.tokenizer||new Wt(this.defaults);for(let r in t.tokenizer){if(!(r in i))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let a=r,o=t.tokenizer[a],l=i[a];i[a]=(...u)=>{let p=o.apply(i,u);return p===!1&&(p=l.apply(i,u)),p}}s.tokenizer=i}if(t.hooks){let i=this.defaults.hooks||new mt;for(let r in t.hooks){if(!(r in i))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let a=r,o=t.hooks[a],l=i[a];mt.passThroughHooks.has(r)?i[a]=u=>{if(this.defaults.async&&mt.passThroughHooksRespectAsync.has(r))return(async()=>{let d=await o.call(i,u);return l.call(i,d)})();let p=o.call(i,u);return l.call(i,p)}:i[a]=(...u)=>{if(this.defaults.async)return(async()=>{let d=await o.apply(i,u);return d===!1&&(d=await l.apply(i,u)),d})();let p=o.apply(i,u);return p===!1&&(p=l.apply(i,u)),p}}s.hooks=i}if(t.walkTokens){let i=this.defaults.walkTokens,r=t.walkTokens;s.walkTokens=function(a){let o=[];return o.push(r.call(this,a)),i&&(o=o.concat(i.call(this,a))),o}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return ue.lex(n,e??this.defaults)}parser(n,e){return pe.parse(n,e??this.defaults)}parseMarkdown(n){return(e,t)=>{let s={...t},i={...this.defaults,...s},r=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=n),i.async)return(async()=>{let a=i.hooks?await i.hooks.preprocess(e):e,o=await(i.hooks?await i.hooks.provideLexer(n):n?ue.lex:ue.lexInline)(a,i),l=i.hooks?await i.hooks.processAllTokens(o):o;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let u=await(i.hooks?await i.hooks.provideParser(n):n?pe.parse:pe.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(u):u})().catch(r);try{i.hooks&&(e=i.hooks.preprocess(e));let a=(i.hooks?i.hooks.provideLexer(n):n?ue.lex:ue.lexInline)(e,i);i.hooks&&(a=i.hooks.processAllTokens(a)),i.walkTokens&&this.walkTokens(a,i.walkTokens);let o=(i.hooks?i.hooks.provideParser(n):n?pe.parse:pe.parseInline)(a,i);return i.hooks&&(o=i.hooks.postprocess(o)),o}catch(a){return r(a)}}}onError(n,e){return t=>{if(t.message+=`
|
|
782
|
+
Please report this to https://github.com/markedjs/marked.`,n){let s="<p>An error occurred:</p><pre>"+xe(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},Fe=new Ml;function B(n,e){return Fe.parse(n,e)}B.options=B.setOptions=function(n){return Fe.setOptions(n),B.defaults=Fe.defaults,Rn(B.defaults),B};B.getDefaults=wi;B.defaults=Be;function Fl(...n){return Fe.use(...n),B.defaults=Fe.defaults,Rn(B.defaults),B}B.use=Fl;B.walkTokens=function(n,e){return Fe.walkTokens(n,e)};B.parseInline=Fe.parseInline;B.Parser=pe;B.parser=pe.parse;B.Renderer=Vt;B.TextRenderer=Ri;B.Lexer=ue;B.lexer=ue.lex;B.Tokenizer=Wt;B.Hooks=mt;B.parse=B;B.options;B.setOptions;B.walkTokens;B.parseInline;pe.parse;ue.lex;const Yt=class Yt extends ce{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=${Y({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``}};Yt.properties={active:{type:Boolean},crossLink:{type:Boolean},record:{attribute:!1},reference:{type:String},statusTone:{type:String}},Yt.styles=he`
|
|
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 ii=Yt;const Jt=class Jt extends ce{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=${Y({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=${Y({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
|
+
`}};Jt.properties={countText:{type:String},query:{type:String},status:{type:String},statuses:{attribute:!1},title:{type:String},treeTab:{type:String},treeView:{type:String}},Jt.styles=he`
|
|
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 ri=Jt;customElements.define("agent-issues-record-list-item",ii);customElements.define("agent-issues-record-filter-toolbar",ri);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)"},Jr={blocked:"var(--danger)",done:"var(--done)"},Ye=184,Zr=34,zs=244,Bs=28,Xr=56,en=58;function Bl(n,e){return n.length>e?`${n.slice(0,e-1)}…`:n}const Zt=class Zt extends ce{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&&Jr[e.status]?Jr[e.status]:this.nodeColor(e)}render(){const e=this.graph;if(!e||e.nodes.length===0)return k;const t=new Map;for(const p of e.nodes){const d=t.get(p.col)??[];d.push(p),t.set(p.col,d)}const s=[...t.keys()].sort((p,d)=>p-d),i=Math.max(...e.nodes.map(p=>p.col))+1,r=Math.max(...s.map(p=>t.get(p)?.length??0)),a=Bs*2+(i-1)*zs+Ye,o=Xr+r*en+24,l=new Map;for(const p of s)(t.get(p)??[]).forEach((g,v)=>{const y=Bs+p*zs,L=Xr+v*en;l.set(g.key,{cx:y+Ye/2,cy:L+Zr/2,x:y,y:L})});const u=e.columns.map((p,d)=>({col:d,title:p})).filter(p=>t.has(p.col));return h`
|
|
953
|
+
<svg
|
|
954
|
+
width=${a}
|
|
955
|
+
height=${o}
|
|
956
|
+
viewBox=${`0 0 ${a} ${o}`}
|
|
957
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
958
|
+
>
|
|
959
|
+
${D(u,p=>`head-${p.col}`,p=>Nt`<text
|
|
960
|
+
class="ai-colhead"
|
|
961
|
+
x=${Bs+p.col*zs+Ye/2}
|
|
962
|
+
y="28"
|
|
963
|
+
text-anchor="middle"
|
|
964
|
+
>${p.title}</text>`)}
|
|
965
|
+
${D(e.edges.filter(p=>l.has(p.from)&&l.has(p.to)),p=>`${p.from}->${p.to}`,p=>{const d=l.get(p.from),g=l.get(p.to),v=d.cx+Ye/2,y=d.cy,L=g.cx-Ye/2,O=g.cy;return Nt`
|
|
966
|
+
<path
|
|
967
|
+
class="ai-edge"
|
|
968
|
+
d=${`M${v} ${y} C ${v+46} ${y}, ${L-46} ${O}, ${L} ${O}`}
|
|
969
|
+
fill="none"
|
|
970
|
+
stroke="var(--graph-edge)"
|
|
971
|
+
stroke-width="1.5"
|
|
972
|
+
/>
|
|
973
|
+
${w(p.label,()=>Nt`<text
|
|
974
|
+
class="ai-edge-label"
|
|
975
|
+
x=${(v+L)/2}
|
|
976
|
+
y=${(y+O)/2-5}
|
|
977
|
+
text-anchor="middle"
|
|
978
|
+
>${p.label}</text>`,()=>k)}
|
|
979
|
+
`})}
|
|
980
|
+
${D(e.nodes,p=>p.key,p=>{const d=l.get(p.key),g=this.nodeColor(p),v=this.nodeStroke(p),y=p.kind!=="project";return Nt`<g
|
|
981
|
+
class=${y?"ai-node":"ai-node ai-node-static"}
|
|
982
|
+
data-id=${p.id}
|
|
983
|
+
data-kind=${p.kind}
|
|
984
|
+
style=${`cursor:${y?"pointer":"default"}`}
|
|
985
|
+
@click=${y?()=>this.onNodeClick(p):k}
|
|
986
|
+
>
|
|
987
|
+
<title>${p.fullLabel||p.label}</title>
|
|
988
|
+
<rect
|
|
989
|
+
class="ai-node-rect"
|
|
990
|
+
x=${d.x}
|
|
991
|
+
y=${d.y}
|
|
992
|
+
width=${Ye}
|
|
993
|
+
height=${Zr}
|
|
994
|
+
rx="9"
|
|
995
|
+
fill="var(--surface)"
|
|
996
|
+
stroke=${v}
|
|
997
|
+
stroke-width="1.5"
|
|
998
|
+
/>
|
|
999
|
+
<circle
|
|
1000
|
+
cx=${d.x+15}
|
|
1001
|
+
cy=${d.cy}
|
|
1002
|
+
r="5"
|
|
1003
|
+
fill=${g}
|
|
1004
|
+
/>
|
|
1005
|
+
<text
|
|
1006
|
+
class="ai-node-label"
|
|
1007
|
+
x=${d.x+28}
|
|
1008
|
+
y=${d.cy+4}
|
|
1009
|
+
>${Bl(p.label,21)}</text>
|
|
1010
|
+
</g>`})}
|
|
1011
|
+
</svg>
|
|
1012
|
+
`}};Zt.properties={graph:{attribute:!1}},Zt.styles=he`
|
|
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 ni=Zt;customElements.define("agent-issues-relationship-graph",ni);const Ul=["initiatives","adrs","debt","graph","context"];function Gl(n){return typeof n=="string"&&Ul.includes(n)}const ze=["project","epic","initiative","plan","prd","adr","story","issue","debt"],ql={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"}},Xt=class Xt extends ce{constructor(){super(...arguments),this.kinds=[...ze],this.visibleKinds=new Set(ze),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
|
+
${D(this.kinds,e=>e,e=>{const t=ql[e],s=this.visibleKinds.has(e);return h`
|
|
1049
|
+
<button
|
|
1050
|
+
aria-pressed=${this.toAriaBoolean(s)}
|
|
1051
|
+
class=${Y({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
|
+
`}};Xt.properties={kinds:{attribute:!1},visibleKinds:{attribute:!1}},Xt.styles=he`
|
|
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 ai=Xt;customElements.define("agent-issues-relationship-graph-filters",ai);function tn(n){const e=B.parse(n,{async:!1});return Cn.sanitize(e)}const Us=["initiative","plan","prd","adr","story","issue","debt"],sn=[["issues","Issues"],["plans","Plans"],["prds","PRDs"],["adrs","ADRs"],["graph","Graph"],["context","Context"],["userStories","User stories"],["debt","Debt"]],es=class es extends rs(ce){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(Us),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.onRetryLoad=e=>{const t=e.currentTarget,s=t.dataset.initiativeId,i=t.dataset.tab;if(s){if(i){this.store?.retryInitiativeTab(s,i);return}this.store?.retryInitiativeDetail(s)}},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),r=`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=${r}
|
|
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>`,()=>k))}
|
|
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=${r}
|
|
1131
|
+
>
|
|
1132
|
+
${D(e.children,a=>a.issue.id,a=>this.renderIssueBranch(a))}
|
|
1133
|
+
</div>
|
|
1134
|
+
`,()=>k)}
|
|
1135
|
+
</div>
|
|
1136
|
+
`}renderOverviewSection(e,t,s,i={}){const r=this.collapsedOverviewSectionIds.has(e),a=i.sectionClassName?`sec ${i.sectionClassName}`:"sec";return h`
|
|
1137
|
+
<section class=${a}>
|
|
1138
|
+
<button
|
|
1139
|
+
class="sec-toggle"
|
|
1140
|
+
data-section-id=${e}
|
|
1141
|
+
aria-expanded=${String(!r)}
|
|
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>`,()=>k)}
|
|
1147
|
+
</span>
|
|
1148
|
+
<span
|
|
1149
|
+
class=${Y({collapsed:r,"sec-chevron":!0})}
|
|
1150
|
+
aria-hidden="true"
|
|
1151
|
+
>
|
|
1152
|
+
>
|
|
1153
|
+
</span>
|
|
1154
|
+
</button>
|
|
1155
|
+
${w(!r,()=>s,()=>k)}
|
|
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=${Y({"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
|
+
`:k}getRecordView(e){return e==="issues"?this.issueRecordView:this.userStoryRecordView}relatedRecordsFor(e,t){const s=this.store,i=new Map,r=a=>{a.id!==e.id&&i.set(a.id,a)};for(const a of t.fixLinks)a.issue.id===e.id&&r(a.userStory),a.userStory.id===e.id&&r(a.issue);for(const a of t.subIssueLinks)a.issue.id===e.id&&r(a.parent),a.parent.id===e.id&&r(a.issue);for(const a of t.blockerLinks)a.source.id===e.id&&r(a.target),a.target.id===e.id&&r(a.source);for(const a of t.constrainsLinks)a.adr.id===e.id&&r(a.issue),a.issue.id===e.id&&r(a.adr);for(const a of[...s?.incomingRelationsFor(e.id)??[],...s?.outgoingRelationsFor(e.id)??[]]){const o=a.fromId===e.id?a.toId:a.fromId,l=s?.entityById.get().get(o);l&&r(l)}return[...i.values()]}recordSearchRank(e,t){const s=this.recordQuery.trim().toLowerCase();if(!s)return 0;const i=this.store,r=[...i?.incomingRelationsFor(e.id)??[],...i?.outgoingRelationsFor(e.id)??[]],{body:a,...o}=e;if(JSON.stringify(o).toLowerCase().includes(s))return 0;if(r.some(u=>JSON.stringify(u).toLowerCase().includes(s)))return 1;const l=this.relatedRecordsFor(e,t);return l.some(u=>{const{body:p,...d}=u;return JSON.stringify(d).toLowerCase().includes(s)})?1:(a??"").toLowerCase().includes(s)?2:l.some(u=>(u.body??"").toLowerCase().includes(s))?3:null}filterRecords(e,t){const s=[];for(const[i,r]of e.entries()){if(this.recordStatus!=="all"&&r.status!==this.recordStatus)continue;const a=this.recordSearchRank(r,t);a!==null&&s.push({index:i,rank:a,record:r})}return s.sort((i,r)=>i.rank-r.rank||i.index-r.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])),r=new Map(s.map((u,p)=>[u.id,p])),a=new Map,o=new Set;for(const u of e.subIssueLinks){const p=i.get(u.parent.id),d=i.get(u.issue.id);if(!p||!d)continue;const g=a.get(p.id)??[];g.push(d),a.set(p.id,g),o.add(d.id)}const l=(u,p)=>({children:(a.get(u.id)??[]).filter(d=>!p.has(d.id)).sort((d,g)=>r.get(d.id)-r.get(g.id)).map(d=>l(d,new Set([...p,d.id]))),issue:u});return s.filter(u=>!o.has(u.id)).map(u=>l(u,new Set([u.id])))}renderIssueTreeTab(e,t){const s=new Set(t.map(r=>r.id)),i=this.filterIssueTree(this.issueTreeForRecords(e,e.issues),s);return h`
|
|
1168
|
+
<div class="record-tree issue-tree">
|
|
1169
|
+
${D(i,r=>r.issue.id,r=>this.renderIssueBranch(r,!1))}
|
|
1170
|
+
</div>
|
|
1171
|
+
`}renderUserStoryTreeTab(e,t){const s=new Set(t.map(r=>r.id)),i=new Set(this.filterRecords(e.issues,e).map(r=>r.id));return h`
|
|
1172
|
+
<div class="record-tree">
|
|
1173
|
+
${e.userStories.flatMap(r=>{const a=this.filterIssueTree(this.store?.issueTreeForStory(e,r.id)??[],i);return!s.has(r.id)&&a.length===0?[]:h`
|
|
1174
|
+
<div class="story-tree-block">
|
|
1175
|
+
${this.renderLine(r)}
|
|
1176
|
+
${w(a.length>0,()=>h`<div class="children issue-tree">${D(a,o=>o.issue.id,o=>this.renderIssueBranch(o))}</div>`,()=>k)}
|
|
1177
|
+
</div>
|
|
1178
|
+
`})}
|
|
1179
|
+
</div>
|
|
1180
|
+
`}renderRecordTab(e,t,s,i,r={}){const a=e==="Issues"?this.store?.sortIssuesByExpectedCompletion(t,i)??t:t,o=this.filterRecords(a,i),l=[...new Set(t.map(p=>p.status))].sort((p,d)=>p.localeCompare(d)),u=r.treeTab?this.getRecordView(r.treeTab)==="tree":!1;return h`
|
|
1181
|
+
<section class="record-browser record-tab">
|
|
1182
|
+
<agent-issues-record-filter-toolbar
|
|
1183
|
+
.countText=${`${o.length} of ${t.length}`}
|
|
1184
|
+
.query=${this.recordQuery}
|
|
1185
|
+
.status=${this.recordStatus}
|
|
1186
|
+
.statuses=${l}
|
|
1187
|
+
.title=${e}
|
|
1188
|
+
.treeTab=${r.treeTab??null}
|
|
1189
|
+
.treeView=${r.treeTab?this.getRecordView(r.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(o.length>0,()=>w(u&&r.treeContent,()=>r.treeContent?.(o)??k,()=>D(o,p=>p.id,p=>this.renderLine(p))),()=>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(),r=t.terms.filter(o=>JSON.stringify(o).toLowerCase().includes(s)),a=!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">${r.length} terms</span>
|
|
1215
|
+
</div>
|
|
1216
|
+
${w(a||r.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(r.length>0,()=>D(r,o=>o.term,o=>h`
|
|
1223
|
+
<article class="context-term">
|
|
1224
|
+
<h3>${o.term}</h3>
|
|
1225
|
+
<p>${o.definition}</p>
|
|
1226
|
+
${w(o.avoid.length>0,()=>h`<p class="context-term-avoid">Avoid: ${o.avoid.join(", ")}</p>`,()=>k)}
|
|
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 k;const t=this.activeBundle();if(!t)return k;const s=e.getContextForInitiative(t.initiative.id),i=e.initiativeStats(t),r=e.initTab.get(),a=e.initiativeDetails.get().get(t.initiative.id),o=e.initiativeTabs.get().get(`${t.initiative.id}:${r}`),l=(t.initiative.body??"").trim(),u=t.initiative.bodySource??"authored",p=this.visibleGraphKinds,d=p.size!==Us.length,g=e.buildInitiativeGraph(t),v=d?e.buildInitiativeGraph(t,p):g,y=e.isSummaryInitiative(t.initiative.id),L=e.debtRecordSectionsFor(t.initiative.id),O=y&&r==="debt"?t.entities.filter(T=>T.kind==="debt"):[...new Map(L.flatMap(T=>T.records).map(T=>[T.id,T])).values()],I=t.entities.filter(T=>T.kind==="plan").sort((T,z)=>new Date(z.updatedAt).getTime()-new Date(T.updatedAt).getTime()||T.id.localeCompare(z.id)),x={adrs:t.adrs.length,context:s?.terms.length??0,debt:O.length,graph:g.nodes.length,issues:t.issues.length,plans:I.length,prds:t.prds.length,userStories:t.userStories.length},R=[{label:"Overview",tab:"overview"},...sn.filter(([T])=>T==="graph"?g.edges.length>0:T==="context"?s?.context.exists===!0:(x[T]??0)>0).map(([T,z])=>({label:z,recordCount:x[T],tab:T}))],A=y?[{label:"Overview",tab:"overview"},...sn.map(([T,z])=>({label:z,tab:T}))]:R,C=A.some(({tab:T})=>T===r)?r:"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
|
+
${Js(tn(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
|
+
${D(A,({tab:T})=>T,({label:T,recordCount:z,tab:m})=>h`
|
|
1273
|
+
<button
|
|
1274
|
+
aria-label=${z===void 0?T:`${T}: ${z} records`}
|
|
1275
|
+
aria-controls=${this.getTabPanelId(m)}
|
|
1276
|
+
aria-selected=${String(C===m)}
|
|
1277
|
+
class=${Y({active:C===m,subtab:!0})}
|
|
1278
|
+
data-tab=${m}
|
|
1279
|
+
id=${this.getTabButtonId(m)}
|
|
1280
|
+
@click=${this.onSetTab}
|
|
1281
|
+
role="tab"
|
|
1282
|
+
>
|
|
1283
|
+
<span class="subtab-label">
|
|
1284
|
+
<span class="subtab-label-text">${T}</span>
|
|
1285
|
+
</span>
|
|
1286
|
+
${w(z!==void 0,()=>h`<span aria-hidden="true" class="subtab-count">${z}</span>`,()=>k)}
|
|
1287
|
+
</button>
|
|
1288
|
+
`)}
|
|
1289
|
+
</div>
|
|
1290
|
+
|
|
1291
|
+
<section
|
|
1292
|
+
aria-labelledby=${this.getTabButtonId(C)}
|
|
1293
|
+
id=${this.getTabPanelId(C)}
|
|
1294
|
+
role="tabpanel"
|
|
1295
|
+
>
|
|
1296
|
+
${w(r!=="overview"&&o?.loading===!0,()=>h`<div class="local-state" role="status">Loading ${r}...</div>`,()=>k)}
|
|
1297
|
+
${w(r!=="overview"&&!!o?.error,()=>h`
|
|
1298
|
+
<div class="local-state local-state-error" role="alert">
|
|
1299
|
+
<span>Could not load ${r}.</span>
|
|
1300
|
+
<button
|
|
1301
|
+
data-initiative-id=${t.initiative.id}
|
|
1302
|
+
data-tab=${r}
|
|
1303
|
+
@click=${this.onRetryLoad}
|
|
1304
|
+
>
|
|
1305
|
+
Retry
|
|
1306
|
+
</button>
|
|
1307
|
+
</div>
|
|
1308
|
+
`,()=>k)}
|
|
1309
|
+
${et(C,[["overview",()=>h`
|
|
1310
|
+
${w(a?.loading===!0,()=>h`<div class="local-state" role="status">Loading initiative details...</div>`,()=>k)}
|
|
1311
|
+
${w(!!a?.error,()=>h`
|
|
1312
|
+
<div class="local-state local-state-error" role="alert">
|
|
1313
|
+
<span>Could not load initiative details.</span>
|
|
1314
|
+
<button
|
|
1315
|
+
data-initiative-id=${t.initiative.id}
|
|
1316
|
+
@click=${this.onRetryLoad}
|
|
1317
|
+
>
|
|
1318
|
+
Retry
|
|
1319
|
+
</button>
|
|
1320
|
+
</div>
|
|
1321
|
+
`,()=>k)}
|
|
1322
|
+
${w(l.length>0,()=>h`
|
|
1323
|
+
<div class="initiative-body overview-body">
|
|
1324
|
+
${w(u==="generated",()=>this.renderBodySourceNotice(),()=>k)}
|
|
1325
|
+
<div class="ai-body">${Js(tn(l))}</div>
|
|
1326
|
+
</div>
|
|
1327
|
+
`,()=>k)}
|
|
1328
|
+
${D(L,T=>T.key,T=>this.renderOverviewSection(T.key,T.title,h`
|
|
1329
|
+
<div class="sec-body">
|
|
1330
|
+
${D(T.records,z=>z.id,z=>this.renderLine(z))}
|
|
1331
|
+
</div>
|
|
1332
|
+
`,{count:String(T.records.length)}))}
|
|
1333
|
+
`],["issues",()=>this.renderRecordTab("Issues",t.issues,"No issues attached.",t,{treeContent:T=>this.renderIssueTreeTab(t,T),treeTab:"issues"})],["plans",()=>this.renderRecordTab("Plans",I,"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`
|
|
1334
|
+
${this.renderContextTab(t)}
|
|
1335
|
+
`],["userStories",()=>this.renderRecordTab("User stories",t.userStories,"No user stories attached.",t,{treeContent:T=>this.renderUserStoryTreeTab(t,T),treeTab:"userStories"})],["debt",()=>this.renderRecordTab("Debt",O,"No debt recorded.",t)],["graph",()=>h`
|
|
1336
|
+
<div class="ai-graph-wrap">
|
|
1337
|
+
<div class="graph-scroll-content">
|
|
1338
|
+
<div class="ai-graph-legend">
|
|
1339
|
+
<agent-issues-relationship-graph-filters
|
|
1340
|
+
.kinds=${Us}
|
|
1341
|
+
.visibleKinds=${p}
|
|
1342
|
+
@graph-kind-toggle=${this.onToggleGraphKind}
|
|
1343
|
+
></agent-issues-relationship-graph-filters>
|
|
1344
|
+
<span class="ai-graph-hint">Click any node to open it</span>
|
|
1345
|
+
</div>
|
|
1346
|
+
${w(v.nodes.length>0,()=>h`
|
|
1347
|
+
<div class="graph-host">
|
|
1348
|
+
<agent-issues-relationship-graph
|
|
1349
|
+
.graph=${v}
|
|
1350
|
+
@node-open=${this.onNodeOpen}
|
|
1351
|
+
></agent-issues-relationship-graph>
|
|
1352
|
+
</div>
|
|
1353
|
+
`,()=>h`<div class="empty-children">No graph records match the selected filters.</div>`)}
|
|
1354
|
+
</div>
|
|
1355
|
+
</div>
|
|
1356
|
+
`]])}
|
|
1357
|
+
</section>
|
|
1358
|
+
</div>
|
|
1359
|
+
`}};es.properties={store:{attribute:!1},initiativeId:{attribute:!1},cascade:{attribute:!1},activeChildId:{attribute:!1}},es.styles=[ls,yi,he`
|
|
1360
|
+
:host {
|
|
1361
|
+
display: block;
|
|
1362
|
+
}
|
|
1363
|
+
.detail-inner {
|
|
1364
|
+
max-width: 920px;
|
|
1365
|
+
margin: 0 auto;
|
|
1366
|
+
padding: 28px 32px 64px;
|
|
1367
|
+
}
|
|
1368
|
+
.ai-crumbs {
|
|
1369
|
+
color: var(--muted);
|
|
1370
|
+
font-size: 12px;
|
|
1371
|
+
}
|
|
1372
|
+
.d-title {
|
|
1373
|
+
display: flex;
|
|
1374
|
+
gap: 12px;
|
|
1375
|
+
align-items: center;
|
|
1376
|
+
margin: 6px 0 0;
|
|
1377
|
+
font-size: 24px;
|
|
1378
|
+
}
|
|
1379
|
+
.d-sub {
|
|
1380
|
+
max-width: 70ch;
|
|
1381
|
+
margin: 10px 0 0;
|
|
1382
|
+
color: var(--muted);
|
|
1383
|
+
}
|
|
1384
|
+
.d-sub > :first-child {
|
|
1385
|
+
margin-top: 0;
|
|
1386
|
+
}
|
|
1387
|
+
.d-sub > :last-child {
|
|
1388
|
+
margin-bottom: 0;
|
|
1389
|
+
}
|
|
1390
|
+
.d-sub h1,
|
|
1391
|
+
.d-sub h2,
|
|
1392
|
+
.d-sub h3 {
|
|
1393
|
+
margin-bottom: 6px;
|
|
1394
|
+
font-size: 16px;
|
|
1395
|
+
line-height: 1.4;
|
|
1396
|
+
}
|
|
1397
|
+
.d-sub p,
|
|
1398
|
+
.d-sub ul,
|
|
1399
|
+
.d-sub ol {
|
|
1400
|
+
margin: 6px 0;
|
|
1401
|
+
}
|
|
1402
|
+
.kpis {
|
|
1403
|
+
display: grid;
|
|
1404
|
+
grid-template-columns: repeat(4, 1fr);
|
|
1405
|
+
gap: 12px;
|
|
1406
|
+
margin-top: 20px;
|
|
1407
|
+
}
|
|
1408
|
+
.kpi {
|
|
1409
|
+
padding: 14px 16px;
|
|
1410
|
+
border: 1px solid var(--border);
|
|
1411
|
+
border-radius: 10px;
|
|
1412
|
+
background: var(--surface);
|
|
1413
|
+
}
|
|
1414
|
+
.k-num {
|
|
1415
|
+
font-size: 22px;
|
|
1416
|
+
font-weight: 700;
|
|
1417
|
+
}
|
|
1418
|
+
.k-label {
|
|
1419
|
+
margin-top: 2px;
|
|
1420
|
+
color: var(--muted);
|
|
1421
|
+
font-size: 12px;
|
|
1422
|
+
}
|
|
1423
|
+
.bar {
|
|
1424
|
+
display: flex;
|
|
1425
|
+
overflow: hidden;
|
|
1426
|
+
height: 8px;
|
|
1427
|
+
margin-top: 16px;
|
|
1428
|
+
border-radius: 999px;
|
|
1429
|
+
background: #eaeef2;
|
|
1430
|
+
}
|
|
1431
|
+
.b-done {
|
|
1432
|
+
background: var(--done);
|
|
1433
|
+
}
|
|
1434
|
+
.b-open {
|
|
1435
|
+
background: var(--success);
|
|
1436
|
+
}
|
|
1437
|
+
.subtabs {
|
|
1438
|
+
display: flex;
|
|
1439
|
+
flex-wrap: wrap;
|
|
1440
|
+
column-gap: 18px;
|
|
1441
|
+
row-gap: 4px;
|
|
1442
|
+
margin-top: 22px;
|
|
1443
|
+
border-bottom: 1px solid var(--border-muted);
|
|
1444
|
+
}
|
|
1445
|
+
.subtab {
|
|
1446
|
+
position: relative;
|
|
1447
|
+
flex: 0 0 auto;
|
|
1448
|
+
padding: 8px 24px;
|
|
1449
|
+
border: 0;
|
|
1450
|
+
border-bottom: 2px solid transparent;
|
|
1451
|
+
background: transparent;
|
|
1452
|
+
color: var(--muted);
|
|
1453
|
+
cursor: pointer;
|
|
1454
|
+
font: inherit;
|
|
1455
|
+
text-align: center;
|
|
1456
|
+
}
|
|
1457
|
+
.subtab-label {
|
|
1458
|
+
display: inline-block;
|
|
1459
|
+
}
|
|
1460
|
+
.subtab.active {
|
|
1461
|
+
border-bottom-color: #fd8c73;
|
|
1462
|
+
color: var(--text);
|
|
1463
|
+
}
|
|
1464
|
+
.subtab.active .subtab-label-text {
|
|
1465
|
+
text-shadow: -0.25px 0 currentColor, 0.25px 0 currentColor;
|
|
1466
|
+
}
|
|
1467
|
+
.record-tab {
|
|
1468
|
+
margin-top: 18px;
|
|
1469
|
+
border: 1px solid var(--border);
|
|
1470
|
+
border-radius: 10px;
|
|
1471
|
+
background: var(--surface);
|
|
1472
|
+
}
|
|
1473
|
+
.local-state {
|
|
1474
|
+
margin-top: 18px;
|
|
1475
|
+
padding: 12px 16px;
|
|
1476
|
+
border: 1px solid var(--border);
|
|
1477
|
+
border-radius: 6px;
|
|
1478
|
+
background: var(--surface);
|
|
1479
|
+
color: var(--muted);
|
|
1480
|
+
}
|
|
1481
|
+
.local-state-error {
|
|
1482
|
+
display: flex;
|
|
1483
|
+
gap: 12px;
|
|
1484
|
+
align-items: center;
|
|
1485
|
+
justify-content: space-between;
|
|
1486
|
+
color: var(--danger);
|
|
1487
|
+
}
|
|
1488
|
+
.local-state-error button {
|
|
1489
|
+
padding: 6px 10px;
|
|
1490
|
+
border: 1px solid currentColor;
|
|
1491
|
+
border-radius: 6px;
|
|
1492
|
+
background: transparent;
|
|
1493
|
+
color: inherit;
|
|
1494
|
+
cursor: pointer;
|
|
1495
|
+
font: inherit;
|
|
1496
|
+
}
|
|
1497
|
+
.context-tab-toolbar {
|
|
1498
|
+
display: flex;
|
|
1499
|
+
gap: 12px;
|
|
1500
|
+
align-items: end;
|
|
1501
|
+
padding: 12px 16px;
|
|
1502
|
+
border-bottom: 1px solid var(--border-muted);
|
|
1503
|
+
}
|
|
1504
|
+
.record-filter {
|
|
1505
|
+
display: grid;
|
|
1506
|
+
gap: 4px;
|
|
1507
|
+
}
|
|
1508
|
+
.record-filter:first-child {
|
|
1509
|
+
flex: 1;
|
|
1510
|
+
}
|
|
1511
|
+
.record-filter-label {
|
|
1512
|
+
color: var(--muted);
|
|
1513
|
+
font-size: 12px;
|
|
1514
|
+
font-weight: 600;
|
|
1515
|
+
}
|
|
1516
|
+
.record-filter input,
|
|
1517
|
+
.record-filter select {
|
|
1518
|
+
box-sizing: border-box;
|
|
1519
|
+
min-height: 32px;
|
|
1520
|
+
padding: 6px 8px;
|
|
1521
|
+
border: 1px solid var(--border);
|
|
1522
|
+
border-radius: 6px;
|
|
1523
|
+
background: var(--surface);
|
|
1524
|
+
color: var(--text);
|
|
1525
|
+
font: inherit;
|
|
1526
|
+
}
|
|
1527
|
+
.context-count {
|
|
1528
|
+
padding-bottom: 7px;
|
|
1529
|
+
color: var(--muted);
|
|
1530
|
+
font-size: 12px;
|
|
1531
|
+
white-space: nowrap;
|
|
1532
|
+
}
|
|
1533
|
+
.record-tab-list {
|
|
1534
|
+
display: grid;
|
|
1535
|
+
gap: 2px;
|
|
1536
|
+
padding: 8px;
|
|
1537
|
+
}
|
|
1538
|
+
.record-tree {
|
|
1539
|
+
display: grid;
|
|
1540
|
+
gap: 8px;
|
|
1541
|
+
}
|
|
1542
|
+
.story-tree-block {
|
|
1543
|
+
border-bottom: 1px solid var(--border-muted);
|
|
1544
|
+
}
|
|
1545
|
+
.story-tree-block:last-child {
|
|
1546
|
+
border-bottom: 0;
|
|
1547
|
+
}
|
|
1548
|
+
.context-tab-summary {
|
|
1549
|
+
padding: 14px 16px 0;
|
|
1550
|
+
}
|
|
1551
|
+
.context-tab-summary h2,
|
|
1552
|
+
.context-term h3 {
|
|
1553
|
+
margin: 0;
|
|
1554
|
+
font-size: 14px;
|
|
1555
|
+
}
|
|
1556
|
+
.context-tab-summary p,
|
|
1557
|
+
.context-term p {
|
|
1558
|
+
margin: 6px 0 0;
|
|
1559
|
+
color: var(--muted);
|
|
1560
|
+
font-size: 13px;
|
|
1561
|
+
}
|
|
1562
|
+
.context-term .context-term-avoid {
|
|
1563
|
+
color: var(--danger);
|
|
1564
|
+
}
|
|
1565
|
+
.context-term {
|
|
1566
|
+
padding: 10px 8px;
|
|
1567
|
+
border-bottom: 1px solid var(--border-muted);
|
|
1568
|
+
}
|
|
1569
|
+
.context-term:last-child {
|
|
1570
|
+
border-bottom: 0;
|
|
1571
|
+
}
|
|
1572
|
+
.sec {
|
|
1573
|
+
margin-top: 18px;
|
|
1574
|
+
border: 1px solid var(--border);
|
|
1575
|
+
border-radius: 12px;
|
|
1576
|
+
background: var(--surface);
|
|
1577
|
+
}
|
|
1578
|
+
.sec-toggle {
|
|
1579
|
+
display: flex;
|
|
1580
|
+
gap: 12px;
|
|
1581
|
+
align-items: center;
|
|
1582
|
+
justify-content: space-between;
|
|
1583
|
+
width: stretch;
|
|
1584
|
+
padding: 12px 16px;
|
|
1585
|
+
border: 0;
|
|
1586
|
+
border-bottom: 1px solid var(--border-muted);
|
|
1587
|
+
background: transparent;
|
|
1588
|
+
color: var(--text);
|
|
1589
|
+
cursor: pointer;
|
|
1590
|
+
font: inherit;
|
|
1591
|
+
text-align: left;
|
|
1592
|
+
}
|
|
1593
|
+
.sec-toggle:hover {
|
|
1594
|
+
background: var(--surface-muted);
|
|
1595
|
+
}
|
|
1596
|
+
.sec-head {
|
|
1597
|
+
display: flex;
|
|
1598
|
+
gap: 10px;
|
|
1599
|
+
align-items: baseline;
|
|
1600
|
+
flex-wrap: wrap;
|
|
1601
|
+
}
|
|
1602
|
+
.sec-title {
|
|
1603
|
+
font-weight: 600;
|
|
1604
|
+
}
|
|
1605
|
+
.sec-count {
|
|
1606
|
+
color: var(--muted);
|
|
1607
|
+
font-size: 12px;
|
|
1608
|
+
font-weight: 400;
|
|
1609
|
+
}
|
|
1610
|
+
.sec-chevron {
|
|
1611
|
+
color: var(--muted);
|
|
1612
|
+
font-size: 14px;
|
|
1613
|
+
line-height: 1;
|
|
1614
|
+
transform: rotate(90deg);
|
|
1615
|
+
transition: transform 120ms ease;
|
|
1616
|
+
}
|
|
1617
|
+
.sec-chevron.collapsed {
|
|
1618
|
+
transform: rotate(0deg);
|
|
1619
|
+
}
|
|
1620
|
+
.sec-body {
|
|
1621
|
+
padding: 8px;
|
|
1622
|
+
}
|
|
1623
|
+
.overview-body {
|
|
1624
|
+
margin-top: 18px;
|
|
1625
|
+
}
|
|
1626
|
+
.context-sec {
|
|
1627
|
+
padding: 16px;
|
|
1628
|
+
}
|
|
1629
|
+
.story-head:hover,
|
|
1630
|
+
.child:hover,
|
|
1631
|
+
.line:hover {
|
|
1632
|
+
background: var(--surface-muted);
|
|
1633
|
+
}
|
|
1634
|
+
.story-head.is-active-ref,
|
|
1635
|
+
.child.is-active-ref,
|
|
1636
|
+
.handoff-focus.is-active-ref {
|
|
1637
|
+
background: var(--surface-muted);
|
|
1638
|
+
box-shadow: inset 3px 0 0 0 var(--accent);
|
|
1639
|
+
}
|
|
1640
|
+
.issue-branch {
|
|
1641
|
+
display: grid;
|
|
1642
|
+
gap: 6px;
|
|
1643
|
+
}
|
|
1644
|
+
.issue-branch-row {
|
|
1645
|
+
display: flex;
|
|
1646
|
+
gap: 8px;
|
|
1647
|
+
align-items: stretch;
|
|
1648
|
+
}
|
|
1649
|
+
.issue-branch + .issue-branch {
|
|
1650
|
+
margin-top: 6px;
|
|
1651
|
+
}
|
|
1652
|
+
.branch-toggle,
|
|
1653
|
+
.branch-spacer {
|
|
1654
|
+
flex-shrink: 0;
|
|
1655
|
+
width: 24px;
|
|
1656
|
+
height: 24px;
|
|
1657
|
+
margin-top: 8px;
|
|
1658
|
+
}
|
|
1659
|
+
.branch-toggle {
|
|
1660
|
+
border: 1px solid var(--border-muted);
|
|
1661
|
+
border-radius: 6px;
|
|
1662
|
+
background: var(--surface);
|
|
1663
|
+
color: var(--muted);
|
|
1664
|
+
cursor: pointer;
|
|
1665
|
+
font: inherit;
|
|
1666
|
+
line-height: 1;
|
|
1667
|
+
}
|
|
1668
|
+
.branch-toggle:hover {
|
|
1669
|
+
border-color: var(--accent);
|
|
1670
|
+
color: var(--accent);
|
|
1671
|
+
}
|
|
1672
|
+
.issue-branch-children {
|
|
1673
|
+
display: grid;
|
|
1674
|
+
gap: 6px;
|
|
1675
|
+
margin-left: 22px;
|
|
1676
|
+
padding-left: 12px;
|
|
1677
|
+
border-left: 1px solid var(--border-muted);
|
|
1678
|
+
}
|
|
1679
|
+
.children {
|
|
1680
|
+
padding: 0 8px 8px 28px;
|
|
1681
|
+
}
|
|
1682
|
+
.issue-tree {
|
|
1683
|
+
display: grid;
|
|
1684
|
+
gap: 6px;
|
|
1685
|
+
}
|
|
1686
|
+
.empty-children {
|
|
1687
|
+
padding: 12px 8px;
|
|
1688
|
+
color: var(--muted);
|
|
1689
|
+
font-size: 13px;
|
|
1690
|
+
}
|
|
1691
|
+
@media (max-width: 640px) {
|
|
1692
|
+
.detail-inner {
|
|
1693
|
+
padding: 20px 16px 40px;
|
|
1694
|
+
}
|
|
1695
|
+
.kpis {
|
|
1696
|
+
grid-template-columns: repeat(2, 1fr);
|
|
1697
|
+
}
|
|
1698
|
+
.context-tab-toolbar {
|
|
1699
|
+
align-items: stretch;
|
|
1700
|
+
flex-direction: column;
|
|
1701
|
+
}
|
|
1702
|
+
.context-count {
|
|
1703
|
+
padding-bottom: 0;
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
.child,
|
|
1707
|
+
.line {
|
|
1708
|
+
display: flex;
|
|
1709
|
+
gap: 10px;
|
|
1710
|
+
align-items: center;
|
|
1711
|
+
width: stretch;
|
|
1712
|
+
padding: 8px;
|
|
1713
|
+
border: 0;
|
|
1714
|
+
border-radius: 6px;
|
|
1715
|
+
background: transparent;
|
|
1716
|
+
cursor: pointer;
|
|
1717
|
+
text-align: left;
|
|
1718
|
+
}
|
|
1719
|
+
.child-title,
|
|
1720
|
+
.line-title {
|
|
1721
|
+
flex: 1;
|
|
1722
|
+
}
|
|
1723
|
+
.idtag {
|
|
1724
|
+
color: var(--muted);
|
|
1725
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
1726
|
+
font-size: 12px;
|
|
1727
|
+
}
|
|
1728
|
+
.issue-dot {
|
|
1729
|
+
flex-shrink: 0;
|
|
1730
|
+
width: 10px;
|
|
1731
|
+
height: 10px;
|
|
1732
|
+
border-radius: 50%;
|
|
1733
|
+
border: 2px solid var(--success);
|
|
1734
|
+
}
|
|
1735
|
+
.issue-dot.done {
|
|
1736
|
+
border-color: var(--done);
|
|
1737
|
+
background: var(--done);
|
|
1738
|
+
}
|
|
1739
|
+
.issue-dot.blocked {
|
|
1740
|
+
border-color: var(--danger);
|
|
1741
|
+
}
|
|
1742
|
+
.subtab-count {
|
|
1743
|
+
box-sizing: border-box;
|
|
1744
|
+
display: inline-grid;
|
|
1745
|
+
min-width: 16px;
|
|
1746
|
+
height: 16px;
|
|
1747
|
+
padding: 0 3px;
|
|
1748
|
+
place-items: center;
|
|
1749
|
+
position: absolute;
|
|
1750
|
+
top: 1px;
|
|
1751
|
+
right: 3px;
|
|
1752
|
+
border-radius: 50%;
|
|
1753
|
+
background: var(--accent);
|
|
1754
|
+
color: var(--surface);
|
|
1755
|
+
font-size: 10px;
|
|
1756
|
+
font-weight: 700;
|
|
1757
|
+
line-height: 1;
|
|
1758
|
+
}
|
|
1759
|
+
.handoff {
|
|
1760
|
+
padding: 14px 16px;
|
|
1761
|
+
border: 1px solid var(--border-muted);
|
|
1762
|
+
border-radius: 10px;
|
|
1763
|
+
background: var(--surface);
|
|
1764
|
+
}
|
|
1765
|
+
.handoff + .handoff {
|
|
1766
|
+
margin-top: 10px;
|
|
1767
|
+
}
|
|
1768
|
+
.handoff-head {
|
|
1769
|
+
display: flex;
|
|
1770
|
+
gap: 10px;
|
|
1771
|
+
align-items: baseline;
|
|
1772
|
+
flex-wrap: wrap;
|
|
1773
|
+
}
|
|
1774
|
+
.handoff-summary {
|
|
1775
|
+
flex: 1;
|
|
1776
|
+
font-weight: 600;
|
|
1777
|
+
}
|
|
1778
|
+
.handoff-time {
|
|
1779
|
+
color: var(--muted);
|
|
1780
|
+
font-size: 12px;
|
|
1781
|
+
}
|
|
1782
|
+
.handoff-focus {
|
|
1783
|
+
display: inline-flex;
|
|
1784
|
+
gap: 8px;
|
|
1785
|
+
align-items: center;
|
|
1786
|
+
margin-top: 8px;
|
|
1787
|
+
padding: 4px 8px;
|
|
1788
|
+
border: 1px solid var(--border-muted);
|
|
1789
|
+
border-radius: 6px;
|
|
1790
|
+
background: transparent;
|
|
1791
|
+
cursor: pointer;
|
|
1792
|
+
font: inherit;
|
|
1793
|
+
color: var(--text);
|
|
1794
|
+
}
|
|
1795
|
+
.handoff-focus-title {
|
|
1796
|
+
color: var(--muted);
|
|
1797
|
+
font-size: 13px;
|
|
1798
|
+
}
|
|
1799
|
+
.handoff-body {
|
|
1800
|
+
margin-top: 10px;
|
|
1801
|
+
}
|
|
1802
|
+
.ai-body-source {
|
|
1803
|
+
display: flex;
|
|
1804
|
+
gap: 10px;
|
|
1805
|
+
align-items: center;
|
|
1806
|
+
margin-bottom: 14px;
|
|
1807
|
+
padding: 10px 12px;
|
|
1808
|
+
border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
|
|
1809
|
+
border-radius: 10px;
|
|
1810
|
+
background: color-mix(in srgb, var(--surface-muted) 76%, white 24%);
|
|
1811
|
+
}
|
|
1812
|
+
.ai-body-source-badge {
|
|
1813
|
+
padding: 4px 8px;
|
|
1814
|
+
border-radius: 999px;
|
|
1815
|
+
background: color-mix(in srgb, var(--accent) 16%, white 84%);
|
|
1816
|
+
color: var(--accent-strong, var(--accent));
|
|
1817
|
+
font-size: 11px;
|
|
1818
|
+
font-weight: 700;
|
|
1819
|
+
letter-spacing: 0.04em;
|
|
1820
|
+
text-transform: uppercase;
|
|
1821
|
+
}
|
|
1822
|
+
.ai-body-source-copy {
|
|
1823
|
+
color: var(--muted);
|
|
1824
|
+
font-size: 12px;
|
|
1825
|
+
font-weight: 600;
|
|
1826
|
+
}
|
|
1827
|
+
.ai-body {
|
|
1828
|
+
max-width: 75ch;
|
|
1829
|
+
color: var(--text);
|
|
1830
|
+
font-size: 14px;
|
|
1831
|
+
line-height: 1.6;
|
|
1832
|
+
}
|
|
1833
|
+
.ai-body > :first-child {
|
|
1834
|
+
margin-top: 0;
|
|
1835
|
+
}
|
|
1836
|
+
.ai-body > :last-child {
|
|
1837
|
+
margin-bottom: 0;
|
|
1838
|
+
}
|
|
1839
|
+
.ai-body h1,
|
|
1840
|
+
.ai-body h2,
|
|
1841
|
+
.ai-body h3 {
|
|
1842
|
+
margin: 16px 0 8px;
|
|
1843
|
+
line-height: 1.3;
|
|
1844
|
+
}
|
|
1845
|
+
.ai-body p {
|
|
1846
|
+
margin: 8px 0;
|
|
1847
|
+
}
|
|
1848
|
+
.ai-body ul,
|
|
1849
|
+
.ai-body ol {
|
|
1850
|
+
margin: 8px 0;
|
|
1851
|
+
padding-left: 22px;
|
|
1852
|
+
}
|
|
1853
|
+
.ai-body code {
|
|
1854
|
+
padding: 1px 5px;
|
|
1855
|
+
border-radius: 4px;
|
|
1856
|
+
background: var(--border-muted);
|
|
1857
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
1858
|
+
font-size: 12px;
|
|
1859
|
+
}
|
|
1860
|
+
.ai-body pre {
|
|
1861
|
+
padding: 12px;
|
|
1862
|
+
border-radius: 8px;
|
|
1863
|
+
background: #f6f8fa;
|
|
1864
|
+
overflow: auto;
|
|
1865
|
+
}
|
|
1866
|
+
.ai-body pre code {
|
|
1867
|
+
padding: 0;
|
|
1868
|
+
background: transparent;
|
|
1869
|
+
}
|
|
1870
|
+
.ai-body blockquote {
|
|
1871
|
+
margin: 8px 0;
|
|
1872
|
+
padding-left: 12px;
|
|
1873
|
+
border-left: 3px solid var(--border);
|
|
1874
|
+
color: var(--muted);
|
|
1875
|
+
}
|
|
1876
|
+
.ai-body a {
|
|
1877
|
+
color: var(--accent, #0969da);
|
|
1878
|
+
}
|
|
1879
|
+
.ai-graph-wrap {
|
|
1880
|
+
margin-top: 18px;
|
|
1881
|
+
border: 1px solid var(--border);
|
|
1882
|
+
border-radius: 10px;
|
|
1883
|
+
background:
|
|
1884
|
+
radial-gradient(circle, rgba(208, 215, 222, 0.5) 1px, transparent 1px) 0 0 / 22px 22px,
|
|
1885
|
+
var(--surface);
|
|
1886
|
+
overflow: auto;
|
|
1887
|
+
}
|
|
1888
|
+
.graph-scroll-content,
|
|
1889
|
+
.graph-host {
|
|
1890
|
+
width: max-content;
|
|
1891
|
+
min-width: 100%;
|
|
1892
|
+
}
|
|
1893
|
+
.ai-graph-legend {
|
|
1894
|
+
display: flex;
|
|
1895
|
+
gap: 16px;
|
|
1896
|
+
flex-wrap: wrap;
|
|
1897
|
+
padding: 10px 14px;
|
|
1898
|
+
border-bottom: 1px solid var(--border-muted);
|
|
1899
|
+
font-size: 12px;
|
|
1900
|
+
color: var(--muted);
|
|
1901
|
+
background: var(--surface);
|
|
1902
|
+
position: sticky;
|
|
1903
|
+
top: 0;
|
|
1904
|
+
z-index: 1;
|
|
1905
|
+
}
|
|
1906
|
+
.ai-graph-legend .lg {
|
|
1907
|
+
display: inline-flex;
|
|
1908
|
+
gap: 6px;
|
|
1909
|
+
align-items: center;
|
|
1910
|
+
}
|
|
1911
|
+
.ai-graph-legend .sw {
|
|
1912
|
+
width: 10px;
|
|
1913
|
+
height: 10px;
|
|
1914
|
+
border-radius: 50%;
|
|
1915
|
+
}
|
|
1916
|
+
.ai-graph-hint {
|
|
1917
|
+
margin-left: auto;
|
|
1918
|
+
}
|
|
1919
|
+
.graph-host {
|
|
1920
|
+
padding: 0;
|
|
1921
|
+
}
|
|
1922
|
+
@media (max-width: 700px) {
|
|
1923
|
+
.kpis {
|
|
1924
|
+
grid-template-columns: repeat(2, 1fr);
|
|
1925
|
+
}
|
|
1926
|
+
.detail-inner {
|
|
1927
|
+
padding: 20px 16px 48px;
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
`];let oi=es;customElements.define("agent-issues-initiative-detail-view",oi);class Re{constructor(e,t,s){this.onLoadMoreIssueComments=()=>{this.store.loadMoreIssueComments(this.entity.id)},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(I=>I.records.map(x=>x.id)),excludeRelationTypes:this.excludedRelationTypes()}),i=this.buildIssueGraph(e),r={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)},a=this.uniqueRecords(s.flatMap(I=>I.records)),o={bundle:e,entity:this.entity,issueTreeForStory:I=>e?this.store.issueTreeForStory(e,I):[],linkedRecords:a,parentIssue:this.parentIssue(r),prdStories:this.prdStories(r),recordsInIssueTree:I=>this.recordsInIssueTree(I)},l=this.issueSeeds(o),u=this.uniqueRecords([...l,...l.flatMap(I=>e?this.recordsInIssueTree(this.store.subIssueTreeForIssue(e,I.id)):[]),...a.filter(I=>I.kind==="issue")]),p=new Set(u.map(I=>I.id)),d=this.uniqueRecords([...a.filter(I=>I.kind==="userStory"),...this.additionalUserStories(o,p),...r.bundle?.fixLinks.filter(I=>p.has(I.issue.id)).map(I=>I.userStory)??[]]).filter(I=>I.id!==this.entity.id),g=a.filter(I=>I.kind==="plan"),v=a.filter(I=>I.kind==="prd"),y=this.uniqueRecords([...a.filter(I=>I.kind==="adr"),...e?.constrainsLinks.filter(I=>I.issue.id===this.entity.id).map(I=>I.adr)??[]]),L=this.uniqueRecords([...r.debtSections.flatMap(I=>I.records),...a.filter(I=>I.kind==="debt")]),O=a.filter(I=>!["issue","userStory","plan","prd","adr","debt"].includes(I.kind));return{adrRecords:y,bundle:e,crossLinkRecordIds:new Set(s.filter(I=>I.crossLink).flatMap(I=>I.records.map(x=>x.id))),debtRecords:L,debtSections:t,inheritedContext:r.inheritedContext,issueGraph:r.issueGraph,issueRecords:u,linkedSections:s,parentIssue:o.parentIssue,planRecords:g,prdRecords:v,relatedRecords:O,subIssueTree:this.entity.kind==="issue"&&e?this.store.subIssueTreeForIssue(e,this.entity.id):[],tabs:this.tabsFor(r,u,g,v,y,d,L,O),userStoryRecords:d}}renderDetail(){const e=this.detailData(),t=e.tabs.some(({tab:s})=>s===this.host.entityDetailTab)?this.host.entityDetailTab:"overview";return h`
|
|
1931
|
+
${w(this.usesTabs(),()=>this.renderTabbedDetail(e,t),()=>this.renderUntabbedDetail(e))}
|
|
1932
|
+
`}renderTabbedDetail(e,t){return h`
|
|
1933
|
+
<div
|
|
1934
|
+
aria-label=${`${this.label} details`}
|
|
1935
|
+
class="ai-subtabs"
|
|
1936
|
+
role="tablist"
|
|
1937
|
+
>
|
|
1938
|
+
${D(e.tabs,({tab:s})=>s,({label:s,recordCount:i,tab:r})=>this.host.renderTabButton(r,s,t===r,i))}
|
|
1939
|
+
</div>
|
|
1940
|
+
<section
|
|
1941
|
+
aria-labelledby=${`issue-detail-${this.entity.id}-${t}-tab`}
|
|
1942
|
+
id=${`issue-detail-${this.entity.id}-${t}-panel`}
|
|
1943
|
+
role="tabpanel"
|
|
1944
|
+
>
|
|
1945
|
+
${et(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`
|
|
1946
|
+
<div class="ai-record-tree ai-issue-tree">
|
|
1947
|
+
${this.host.renderIssueTreeForRecords(this.store.bundleForEntityId(this.entity.id),e.issueRecords,s)}
|
|
1948
|
+
</div>
|
|
1949
|
+
`,()=>h`
|
|
1950
|
+
<div class="ai-record-tree ai-issue-tree">
|
|
1951
|
+
${D(s,i=>i.id,i=>this.host.renderRef(i))}
|
|
1952
|
+
</div>
|
|
1953
|
+
`),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)]])}
|
|
1954
|
+
</section>
|
|
1955
|
+
`}renderUntabbedDetail(e){return h`
|
|
1956
|
+
${this.renderOverview()}
|
|
1957
|
+
${w(e.debtSections.length>0,()=>this.host.renderRefSections(e.debtSections),()=>k)}
|
|
1958
|
+
${w(e.linkedSections.length>0,()=>this.host.renderRefSections(e.linkedSections),()=>h`
|
|
1959
|
+
<section class="ai-sec">
|
|
1960
|
+
<h2>Linked records</h2>
|
|
1961
|
+
<div class="ai-empty">Nothing is linked to this record yet.</div>
|
|
1962
|
+
</section>
|
|
1963
|
+
`)}
|
|
1964
|
+
`}renderPlanTab(){return h``}renderUserStoryTree(e,t){return h`
|
|
1965
|
+
<div class="ai-record-tree">
|
|
1966
|
+
${D(t,s=>s.id,s=>h`
|
|
1967
|
+
<div class="ai-story-block">
|
|
1968
|
+
${this.host.renderRef(s)}
|
|
1969
|
+
${w(e.bundle!==null,()=>h`<div class="ai-story-issues">${this.host.renderIssueTree(this.store.issueTreeForStory(e.bundle,s.id))}</div>`,()=>k)}
|
|
1970
|
+
</div>
|
|
1971
|
+
`)}
|
|
1972
|
+
</div>
|
|
1973
|
+
`}relatedRecordsFor(e,t){const s=new Map,i=r=>{r.id!==e.id&&s.set(r.id,r)};for(const r of t?.fixLinks??[])r.issue.id===e.id&&i(r.userStory),r.userStory.id===e.id&&i(r.issue);for(const r of t?.subIssueLinks??[])r.issue.id===e.id&&i(r.parent),r.parent.id===e.id&&i(r.issue);for(const r of t?.blockerLinks??[])r.source.id===e.id&&i(r.target),r.target.id===e.id&&i(r.source);for(const r of t?.constrainsLinks??[])r.adr.id===e.id&&i(r.issue),r.issue.id===e.id&&i(r.adr);for(const r of[...this.store.incomingRelationsFor(e.id),...this.store.outgoingRelationsFor(e.id)]){const a=r.fromId===e.id?r.toId:r.fromId,o=this.store.entityById.get().get(a);o&&i(o)}return[...s.values()]}graphKindFor(e){const t=e.kind==="userStory"?"story":e.kind;return ze.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])),r=new Set(t.map(l=>l.id)),a=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})),o=this.store.scopedRelations().filter(l=>r.has(l.fromId)&&r.has(l.toId)).map(l=>({from:l.fromId,label:l.type,to:l.toId}));return{columns:s.map(l=>this.graphKindLabel(l)),edges:o,nodes:a}}filterGraphByKind(e,t){const s=e.nodes.filter(o=>t.has(o.kind)),i=new Set(s.map(o=>o.key)),r=[...new Set(s.map(o=>o.col))].sort((o,l)=>o-l),a=new Map(r.map((o,l)=>[o,l]));return{columns:r.map(o=>e.columns[o]),edges:e.edges.filter(o=>i.has(o.from)&&i.has(o.to)),nodes:s.map(o=>({...o,col:a.get(o.col)}))}}excludedRelationTypes(){return[]}parentIssue(e){return null}prdStories(e){return[]}tabsFor(e,t,s,i,r,a,o,l){const u=[{label:"Issues",recordCount:t.length,tab:"issues",visible:()=>t.some(p=>p.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:r.length,tab:"adrs",visible:()=>r.length>0},{label:"Context",tab:"context",visible:()=>e.inheritedContext?.context.exists===!0},{label:"User stories",recordCount:a.length,tab:"userStories",visible:()=>a.length>0},{label:"Debt",recordCount:o.length,tab:"debt",visible:()=>o.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(p=>p.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.issueCommentsFor(this.entity.id):[],i=this.entity.kind==="issue"&&(this.store.issueCommentPages.get().get(this.entity.id)?.data?.nextBefore??null)!==null;return h`
|
|
1974
|
+
${w(e.length>0,()=>h`
|
|
1975
|
+
<section class="ai-sec ai-body">
|
|
1976
|
+
${w(t==="generated",()=>this.host.renderBodySourceNotice(),()=>k)}
|
|
1977
|
+
${tc(sc(e))}
|
|
1978
|
+
</section>
|
|
1979
|
+
`,()=>k)}
|
|
1980
|
+
${w(s.length>0,()=>h`
|
|
1981
|
+
<section class="ai-sec ai-conversation">
|
|
1982
|
+
<h2>Conversation</h2>
|
|
1983
|
+
${D(s,r=>r.id,r=>this.host.renderIssueComment(r))}
|
|
1984
|
+
${w(i,()=>h`<button @click=${this.onLoadMoreIssueComments}>Load more comments</button>`,()=>k)}
|
|
1985
|
+
</section>
|
|
1986
|
+
`,()=>k)}
|
|
1987
|
+
`}}class Hl extends Re{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 Kl extends Re{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 Re{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 Vl extends Re{constructor(){super(...arguments),this.label="User story"}issueSeeds(e){return[...super.issueSeeds(e),...e.recordsInIssueTree(e.issueTreeForStory(e.entity.id))]}}class Ql extends Re{constructor(){super(...arguments),this.label="Plan",this.onLoadMorePlanEntries=()=>{this.store.loadMorePlanEntries(this.entity.id)}}entityTabs(){return[{label:"Plan",tab:"plan"}]}renderCurrentPlanEntry(e,t,s){const i=t?ec(e,s):[];return h`
|
|
1988
|
+
${w(i.length>0,()=>h`
|
|
1989
|
+
<div class="ai-plan-decision-pair">
|
|
1990
|
+
${D(i,r=>r.id,r=>h`
|
|
1991
|
+
<section class="ai-plan-decision-question">
|
|
1992
|
+
<div class="ai-plan-decision-pair-label">Question</div>
|
|
1993
|
+
${this.host.renderPlanEntry(r)}
|
|
1994
|
+
</section>
|
|
1995
|
+
`)}
|
|
1996
|
+
<section class="ai-plan-decision-answer">
|
|
1997
|
+
<div class="ai-plan-decision-pair-label">Decision</div>
|
|
1998
|
+
${this.host.renderPlanEntry(e)}
|
|
1999
|
+
</section>
|
|
2000
|
+
</div>
|
|
2001
|
+
`,()=>this.host.renderPlanEntry(e))}
|
|
2002
|
+
`}renderPlanTab(){const e=this.store.planProjectionFor(this.entity.id),t=e.current.filter(r=>r.entries.length>0),s=new Map(e.history.map(r=>[r.id,r])),i=(this.store.planEntryPages.get().get(this.entity.id)?.data?.nextBefore??null)!==null;return h`
|
|
2003
|
+
<div class="ai-plan-tab">
|
|
2004
|
+
<section class="ai-sec ai-plan-current">
|
|
2005
|
+
<h2>Current plan</h2>
|
|
2006
|
+
${w(t.length>0,()=>D(t,r=>r.key,r=>h`
|
|
2007
|
+
<details class="ai-plan-group">
|
|
2008
|
+
<summary>
|
|
2009
|
+
<span>${r.title}</span>
|
|
2010
|
+
<span class="ai-plan-count">${r.entries.length}</span>
|
|
2011
|
+
</summary>
|
|
2012
|
+
<div
|
|
2013
|
+
class="ai-plan-entries"
|
|
2014
|
+
data-plan-group=${r.key}
|
|
2015
|
+
>
|
|
2016
|
+
${D(r.entries,a=>a.id,a=>this.renderCurrentPlanEntry(a,r.key==="decisions",s))}
|
|
2017
|
+
</div>
|
|
2018
|
+
</details>
|
|
2019
|
+
`),()=>h`<div class="ai-empty">No current Plan entries.</div>`)}
|
|
2020
|
+
</section>
|
|
2021
|
+
<details class="ai-sec ai-plan-history">
|
|
2022
|
+
<summary>
|
|
2023
|
+
<span>Entry history</span>
|
|
2024
|
+
<span class="ai-plan-count">${e.history.length}</span>
|
|
2025
|
+
</summary>
|
|
2026
|
+
<div class="ai-plan-entries">
|
|
2027
|
+
${w(e.history.length>0,()=>D(e.history,r=>r.id,r=>this.host.renderPlanEntry(r)),()=>h`<div class="ai-empty">No Plan entries yet.</div>`)}
|
|
2028
|
+
</div>
|
|
2029
|
+
</details>
|
|
2030
|
+
${w(i,()=>h`<button @click=${this.onLoadMorePlanEntries}>Load more entries</button>`,()=>k)}
|
|
2031
|
+
</div>
|
|
2032
|
+
`}}class Yl extends Re{constructor(){super(...arguments),this.label="Debt"}}class Jl extends Re{constructor(){super(...arguments),this.label="Handoff"}}class Zl extends Re{constructor(){super(...arguments),this.label="Record"}usesTabs(){return!1}}function Xl(n,e,t){switch(e.kind){case"issue":return new Hl(n,e,t);case"adr":return new Kl(n,e,t);case"prd":return new Wl(n,e,t);case"userStory":return new Vl(n,e,t);case"plan":return new Ql(n,e,t);case"debt":return new Yl(n,e,t);case"handoff":return new Jl(n,e,t);default:return new Zl(n,e,t)}}function ec(n,e){const t=new Map,s=new Set,i=r=>{if(s.has(r))return;s.add(r);const a=e.get(r);if(a){a.role==="question"&&!a.tombstone&&t.set(a.id,a);for(const o of a.supersededEntryIds)i(o)}};for(const r of n.supersededEntryIds)i(r);return[...t.values()].sort((r,a)=>r.createdAt.localeCompare(a.createdAt)||r.id.localeCompare(a.id))}function tc(n){return h`${Js(n)}`}function sc(n){const e=B.parse(n,{async:!1});return Cn.sanitize(e)}const ts=class ts extends rs(ce){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(ze),this.onBackClick=()=>{this.store?.closeEntity()},this.onRetryEntityDetail=e=>{const t=e.currentTarget.dataset.entityId;t&&this.store?.retryEntityDetail(t)},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;if(!t)return;this.entityDetailTab=t,this.recordQuery="",this.recordStatus="all";const s=this.entityId??this.store?.selectedId.get();s&&this.store?.requestEntityTab(s,t),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(r=>r.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`
|
|
2033
|
+
<div class="ai-body-source ai-body-source-generated">
|
|
2034
|
+
<span class="ai-body-source-badge">Generated fallback</span>
|
|
2035
|
+
<span class="ai-body-source-copy">Generated from tracker metadata because no authored body was present.</span>
|
|
2036
|
+
</div>
|
|
2037
|
+
`}renderRef(e,t=!1){const s=this.store;return s?h`
|
|
2038
|
+
<button
|
|
2039
|
+
class=${`ai-ref ${e.id===this.activeChildId?"is-active-ref":""}`}
|
|
2040
|
+
data-id=${e.id}
|
|
2041
|
+
data-cross-link=${t?"true":k}
|
|
2042
|
+
@click=${this.onSelectEntityClick}
|
|
2043
|
+
>
|
|
2044
|
+
<span class="r-id">${s.shortRef(e)}</span>
|
|
2045
|
+
<span class="r-title">${e.title}</span>
|
|
2046
|
+
<span class=${`badge ${s.badgeTone(e.status)}`}>${e.status}</span>
|
|
2047
|
+
</button>
|
|
2048
|
+
`:k}renderRecordLine(e,t=!1){const s=this.store;return s?h`
|
|
2049
|
+
<agent-issues-record-list-item
|
|
2050
|
+
.active=${e.id===this.activeChildId}
|
|
2051
|
+
.crossLink=${t}
|
|
2052
|
+
.record=${e}
|
|
2053
|
+
.reference=${s.shortRef(e)}
|
|
2054
|
+
.statusTone=${s.badgeTone(e.status)}
|
|
2055
|
+
class=${Y({"is-active-ref":e.id===this.activeChildId,line:!0,"record-row":!0})}
|
|
2056
|
+
data-id=${e.id}
|
|
2057
|
+
@record-open=${this.onRecordOpen}
|
|
2058
|
+
></agent-issues-record-list-item>
|
|
2059
|
+
`:k}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,r=a=>{a.id!==e.id&&i.set(a.id,a)};for(const a of t?.fixLinks??[])a.issue.id===e.id&&r(a.userStory),a.userStory.id===e.id&&r(a.issue);for(const a of t?.subIssueLinks??[])a.issue.id===e.id&&r(a.parent),a.parent.id===e.id&&r(a.issue);for(const a of t?.blockerLinks??[])a.source.id===e.id&&r(a.target),a.target.id===e.id&&r(a.source);for(const a of t?.constrainsLinks??[])a.adr.id===e.id&&r(a.issue),a.issue.id===e.id&&r(a.adr);for(const a of[...s?.incomingRelationsFor(e.id)??[],...s?.outgoingRelationsFor(e.id)??[]]){const o=a.fromId===e.id?a.toId:a.fromId,l=s?.entityById.get().get(o);l&&r(l)}return[...i.values()]}recordSearchRank(e,t){const s=this.recordQuery.trim().toLowerCase();if(!s)return 0;const i=this.store,r=[...i?.incomingRelationsFor(e.id)??[],...i?.outgoingRelationsFor(e.id)??[]],{body:a,...o}=e;if(JSON.stringify(o).toLowerCase().includes(s))return 0;if(r.some(u=>JSON.stringify(u).toLowerCase().includes(s)))return 1;const l=this.relatedRecordsFor(e,t);return l.some(u=>{const{body:p,...d}=u;return JSON.stringify(d).toLowerCase().includes(s)})?1:(a??"").toLowerCase().includes(s)?2:l.some(u=>(u.body??"").toLowerCase().includes(s))?3:null}filterRecords(e,t){const s=[];for(const[i,r]of e.entries()){if(this.recordStatus!=="all"&&r.status!==this.recordStatus)continue;const a=this.recordSearchRank(r,t);a!==null&&s.push({index:i,rank:a,record:r})}return s.sort((i,r)=>i.rank-r.rank||i.index-r.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])),r=new Map(s.map((u,p)=>[u.id,p])),a=new Map,o=new Set;for(const u of e.subIssueLinks){const p=i.get(u.parent.id),d=i.get(u.issue.id);if(!p||!d)continue;const g=a.get(p.id)??[];g.push(d),a.set(p.id,g),o.add(d.id)}const l=(u,p)=>({children:(a.get(u.id)??[]).filter(d=>!p.has(d.id)).sort((d,g)=>r.get(d.id)-r.get(g.id)).map(d=>l(d,new Set([...p,d.id]))),issue:u});return s.filter(u=>!o.has(u.id)).map(u=>l(u,new Set([u.id])))}renderRecordBrowser(e,t,s,i,r={}){const a=e==="Issues"&&i?this.store?.sortIssuesByExpectedCompletion(t,i)??t:t,o=this.filterRecords(a,i),l=[...new Set(t.map(p=>p.status))].sort((p,d)=>p.localeCompare(d)),u=r.treeTab?this.getRecordView(r.treeTab)==="tree":!1;return h`
|
|
2060
|
+
<section class="ai-record-tab record-browser">
|
|
2061
|
+
<agent-issues-record-filter-toolbar
|
|
2062
|
+
.countText=${`${o.length} of ${t.length}`}
|
|
2063
|
+
.query=${this.recordQuery}
|
|
2064
|
+
.status=${this.recordStatus}
|
|
2065
|
+
.statuses=${l}
|
|
2066
|
+
.title=${e}
|
|
2067
|
+
.treeTab=${r.treeTab??null}
|
|
2068
|
+
.treeView=${r.treeTab?this.getRecordView(r.treeTab):"list"}
|
|
2069
|
+
@record-query-change=${this.onRecordQueryChange}
|
|
2070
|
+
@record-status-change=${this.onRecordStatusChange}
|
|
2071
|
+
@record-view-change=${this.onRecordViewChange}
|
|
2072
|
+
></agent-issues-record-filter-toolbar>
|
|
2073
|
+
<div class="ai-record-list record-browser-list">
|
|
2074
|
+
${w(t.length===0,()=>h`<div class="ai-empty">${s}</div>`,()=>w(o.length>0,()=>w(u&&r.treeContent,()=>r.treeContent?.(o)??k,()=>D(o,p=>p.id,p=>this.renderRecordLine(p,r.crossLinkRecordIds?.has(p.id)))),()=>h`<div class="ai-empty">No ${e.toLowerCase()} match this filter.</div>`))}
|
|
2075
|
+
</div>
|
|
2076
|
+
</section>
|
|
2077
|
+
`}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(a=>JSON.stringify(a).toLowerCase().includes(t)),r=!t||s.includes(t);return h`
|
|
2078
|
+
<section class="ai-record-tab">
|
|
2079
|
+
<div class="ai-record-toolbar">
|
|
2080
|
+
<label class="ai-record-filter">
|
|
2081
|
+
<span>Filter context</span>
|
|
2082
|
+
<input
|
|
2083
|
+
placeholder="Filter context"
|
|
2084
|
+
type="search"
|
|
2085
|
+
.value=${this.recordQuery}
|
|
2086
|
+
@input=${this.onContextQueryInput}
|
|
2087
|
+
>
|
|
2088
|
+
</label>
|
|
2089
|
+
<span class="ai-record-count">${i.length} terms</span>
|
|
2090
|
+
</div>
|
|
2091
|
+
${w(r||i.length>0,()=>h`
|
|
2092
|
+
<div class="ai-context-summary">
|
|
2093
|
+
<h2>${e.context.title}</h2>
|
|
2094
|
+
<p>${e.context.summary}</p>
|
|
2095
|
+
</div>
|
|
2096
|
+
<div class="ai-record-list">
|
|
2097
|
+
${w(i.length>0,()=>D(i,a=>a.term,a=>h`
|
|
2098
|
+
<article class="ai-context-term">
|
|
2099
|
+
<h3>${a.term}</h3>
|
|
2100
|
+
<p>${a.definition}</p>
|
|
2101
|
+
${w(a.avoid.length>0,()=>h`<p class="ai-context-avoid">Avoid: ${a.avoid.join(", ")}</p>`,()=>k)}
|
|
2102
|
+
</article>
|
|
2103
|
+
`),()=>h`<div class="ai-empty">No glossary terms match this filter.</div>`)}
|
|
2104
|
+
</div>
|
|
2105
|
+
`,()=>h`<div class="ai-empty">No inherited context matches this filter.</div>`)}
|
|
2106
|
+
</section>
|
|
2107
|
+
`}renderIssueTreeNode(e){const t=this.collapsedIssueIds.has(e.issue.id);return h`
|
|
2108
|
+
<div class="ai-issue-tree-node">
|
|
2109
|
+
<div class="ai-issue-tree-row">
|
|
2110
|
+
${w(e.children.length>0,()=>h`
|
|
2111
|
+
<button
|
|
2112
|
+
class="branch-toggle"
|
|
2113
|
+
data-id=${e.issue.id}
|
|
2114
|
+
aria-expanded=${String(!t)}
|
|
2115
|
+
@click=${this.onToggleIssueBranch}
|
|
2116
|
+
>
|
|
2117
|
+
${t?"+":"-"}
|
|
2118
|
+
</button>
|
|
2119
|
+
`,()=>h`<span class="branch-spacer"></span>`)}
|
|
2120
|
+
${this.renderRef(e.issue)}
|
|
2121
|
+
</div>
|
|
2122
|
+
${w(e.children.length>0&&!t,()=>h`
|
|
2123
|
+
<div class="ai-issue-tree-children">
|
|
2124
|
+
${D(e.children,s=>s.issue.id,s=>this.renderIssueTreeNode(s))}
|
|
2125
|
+
</div>
|
|
2126
|
+
`,()=>k)}
|
|
2127
|
+
</div>
|
|
2128
|
+
`}renderIssueTree(e){return h`${D(e,t=>t.issue.id,t=>this.renderIssueTreeNode(t))}`}renderIssueTreeForRecords(e,t,s){const i=new Set(s.map(r=>r.id));return this.renderIssueTree(this.filterIssueTree(this.issueTreeForRecords(e,t),i))}renderRefSections(e){return h`
|
|
2129
|
+
${D(e,t=>t.key,t=>h`
|
|
2130
|
+
<section class="ai-sec">
|
|
2131
|
+
<h2>${t.title}</h2>
|
|
2132
|
+
<div class="ai-refs">
|
|
2133
|
+
${D(t.records,s=>s.id,s=>this.renderRef(s,t.crossLink))}
|
|
2134
|
+
</div>
|
|
2135
|
+
</section>
|
|
2136
|
+
`)}
|
|
2137
|
+
`}renderGraphTab(e){return h`
|
|
2138
|
+
<div class="ai-graph-wrap">
|
|
2139
|
+
<div class="ai-graph-legend">
|
|
2140
|
+
<agent-issues-relationship-graph-filters
|
|
2141
|
+
.kinds=${[...ze]}
|
|
2142
|
+
.visibleKinds=${this.visibleGraphKinds}
|
|
2143
|
+
@graph-kind-toggle=${this.onToggleGraphKind}
|
|
2144
|
+
></agent-issues-relationship-graph-filters>
|
|
2145
|
+
</div>
|
|
2146
|
+
${w(e.nodes.length>0,()=>h`
|
|
2147
|
+
<div class="ai-graph-host">
|
|
2148
|
+
<agent-issues-relationship-graph
|
|
2149
|
+
.graph=${e}
|
|
2150
|
+
@node-open=${this.onNodeOpen}
|
|
2151
|
+
></agent-issues-relationship-graph>
|
|
2152
|
+
</div>
|
|
2153
|
+
`,()=>h`<div class="ai-empty">No graph records match the selected filters.</div>`)}
|
|
2154
|
+
</div>
|
|
2155
|
+
`}renderTabButton(e,t,s,i){const r=this.entityId??this.store?.selectedId.get(),a=i===void 0?t:`${t}: ${i} records`;return r?h`
|
|
2156
|
+
<button
|
|
2157
|
+
aria-label=${a}
|
|
2158
|
+
aria-controls=${this.getTabPanelId(r,e)}
|
|
2159
|
+
aria-selected=${String(s)}
|
|
2160
|
+
class=${Y({active:s,"ai-subtab":!0})}
|
|
2161
|
+
data-tab=${e}
|
|
2162
|
+
id=${this.getTabButtonId(r,e)}
|
|
2163
|
+
@click=${this.onSetIssueTab}
|
|
2164
|
+
role="tab"
|
|
2165
|
+
>
|
|
2166
|
+
<span class="ai-subtab-label">${t}</span>
|
|
2167
|
+
${w(i!==void 0,()=>h`<span aria-hidden="true" class="ai-subtab-count">${i}</span>`,()=>k)}
|
|
2168
|
+
</button>
|
|
2169
|
+
`:h``}displayUser(e){return this.store?.displayUser(e,this.entityId??this.store.selectedId.get()??"")??e}renderIssueComment(e){return h`
|
|
2170
|
+
<article
|
|
2171
|
+
class="ai-comment"
|
|
2172
|
+
data-comment-id=${e.id}
|
|
2173
|
+
tabindex="-1"
|
|
2174
|
+
>
|
|
2175
|
+
<div class="ai-comment-reference">${e.reference}</div>
|
|
2176
|
+
${w(e.tombstone,()=>h`<div class="ai-comment-deleted">Deleted ${e.updatedAt}</div>`,()=>h`<div class="ai-comment-body">${e.body??""}</div>`)}
|
|
2177
|
+
<div class="ai-comment-provenance">
|
|
2178
|
+
Created by ${this.displayUser(e.createdBy)}
|
|
2179
|
+
Updated by ${this.displayUser(e.updatedBy)}
|
|
2180
|
+
</div>
|
|
2181
|
+
${w(e.referencedIssueIds.length>0,()=>h`<div class="ai-comment-references">References: ${e.referencedIssueIds.join(", ")}</div>`,()=>k)}
|
|
2182
|
+
</article>
|
|
2183
|
+
`}renderPlanEntry(e){const t=this.store?.planEntriesFor(e.planId)??[],s=new Map(t.map(a=>[a.id,a])),i=e.referencedEntityIds.map(a=>({entity:this.store?.entityForId(a),id:a})),r=e.supersededEntryIds.map(a=>{const o=s.get(a);return{id:a,label:o?.shortReference??o?.reference??a,reference:o?.reference??a}});return h`
|
|
2184
|
+
<article
|
|
2185
|
+
class="ai-plan-entry"
|
|
2186
|
+
data-plan-entry-id=${e.id}
|
|
2187
|
+
tabindex="-1"
|
|
2188
|
+
>
|
|
2189
|
+
<header class="ai-plan-entry-header">
|
|
2190
|
+
<span
|
|
2191
|
+
class="ai-plan-entry-reference"
|
|
2192
|
+
title=${e.reference}
|
|
2193
|
+
>
|
|
2194
|
+
${e.shortReference??e.reference}
|
|
2195
|
+
</span>
|
|
2196
|
+
</header>
|
|
2197
|
+
${w(e.tombstone,()=>h`<div class="ai-plan-entry-deleted">Deleted entry</div>`,()=>h`<div class="ai-plan-entry-body">${e.body??""}</div>`)}
|
|
2198
|
+
${w(i.length>0||r.length>0,()=>h`
|
|
2199
|
+
<footer class="ai-plan-entry-meta">
|
|
2200
|
+
${w(i.length>0,()=>h`
|
|
2201
|
+
<div class="ai-plan-entry-meta-row">
|
|
2202
|
+
<span class="ai-plan-entry-meta-label">References</span>
|
|
2203
|
+
<span class="ai-plan-entry-link-list">
|
|
2204
|
+
${D(i,({id:a})=>a,({entity:a,id:o})=>w(a!==null,()=>h`
|
|
2205
|
+
<button
|
|
2206
|
+
class="ai-plan-entry-link"
|
|
2207
|
+
data-id=${o}
|
|
2208
|
+
@click=${this.onSelectEntityClick}
|
|
2209
|
+
>
|
|
2210
|
+
${this.store?.shortRef(a)} ${a.title}
|
|
2211
|
+
</button>
|
|
2212
|
+
`,()=>h`<span class="ai-plan-entry-unresolved">${o}</span>`))}
|
|
2213
|
+
</span>
|
|
2214
|
+
</div>
|
|
2215
|
+
`,()=>k)}
|
|
2216
|
+
${w(r.length>0,()=>h`
|
|
2217
|
+
<div class="ai-plan-entry-meta-row">
|
|
2218
|
+
<span class="ai-plan-entry-meta-label">Supersedes</span>
|
|
2219
|
+
<span class="ai-plan-entry-link-list">
|
|
2220
|
+
${D(r,({id:a})=>a,({id:a,label:o,reference:l})=>h`
|
|
2221
|
+
<button
|
|
2222
|
+
aria-label=${`Go to superseded Plan entry ${o}`}
|
|
2223
|
+
class="ai-plan-entry-link"
|
|
2224
|
+
data-plan-entry-id=${a}
|
|
2225
|
+
title=${l}
|
|
2226
|
+
@click=${this.onPlanEntryJump}
|
|
2227
|
+
>
|
|
2228
|
+
${o}
|
|
2229
|
+
</button>
|
|
2230
|
+
`)}
|
|
2231
|
+
</span>
|
|
2232
|
+
</div>
|
|
2233
|
+
`,()=>k)}
|
|
2234
|
+
</footer>
|
|
2235
|
+
`,()=>k)}
|
|
2236
|
+
</article>
|
|
2237
|
+
`}render(){const e=this.store;if(!e)return k;const t=this.entityId??e.selectedId.get(),s=e.entityForId(t),i=t?e.entityDetails.get().get(t):null;if(!s)return h`
|
|
2238
|
+
<div class="detail-inner">
|
|
2239
|
+
${w(i?.error,()=>h`
|
|
2240
|
+
<div class="ai-empty">
|
|
2241
|
+
<p>Could not load this record.</p>
|
|
2242
|
+
<button
|
|
2243
|
+
class="ai-back"
|
|
2244
|
+
data-entity-id=${t??k}
|
|
2245
|
+
@click=${this.onRetryEntityDetail}
|
|
2246
|
+
>
|
|
2247
|
+
Retry
|
|
2248
|
+
</button>
|
|
2249
|
+
</div>
|
|
2250
|
+
`,()=>h`<div class="ai-empty">Loading record...</div>`)}
|
|
2251
|
+
</div>
|
|
2252
|
+
`;e.selectedNestedTarget.get()?.type==="plan-entry"&&(this.entityDetailTab="plan");const r=e.bundleForEntityId(t),a=e.activeSection.get()==="adrs",o=a?"ADRs":r?.initiative.title??"Initiatives",l=a?"ADRs":r?.initiative.title??"Workspace",u=e.detailMetaFor(s.id),p=Xl(e,s,this);return h`
|
|
2253
|
+
<div class="detail-inner">
|
|
2254
|
+
${w(i?.loading===!0,()=>h`<p class="ai-load-state">Refreshing record...</p>`,()=>k)}
|
|
2255
|
+
${w(i?.error,()=>h`
|
|
2256
|
+
<div class="ai-load-state ai-load-error">
|
|
2257
|
+
<span>Could not refresh this record.</span>
|
|
2258
|
+
<button
|
|
2259
|
+
class="ai-back"
|
|
2260
|
+
data-entity-id=${s.id}
|
|
2261
|
+
@click=${this.onRetryEntityDetail}
|
|
2262
|
+
>
|
|
2263
|
+
Retry
|
|
2264
|
+
</button>
|
|
2265
|
+
</div>
|
|
2266
|
+
`,()=>k)}
|
|
2267
|
+
${w(!this.cascade,()=>h`
|
|
2268
|
+
<button
|
|
2269
|
+
class="ai-back"
|
|
2270
|
+
@click=${this.onBackClick}
|
|
2271
|
+
>
|
|
2272
|
+
← Back to ${o}
|
|
2273
|
+
</button>
|
|
2274
|
+
`)}
|
|
2275
|
+
<div class="ai-crumbs">${e.selectedTenantDisplayName.get()} · ${l}</div>
|
|
2276
|
+
<div class="ai-kind">${e.formatKindLabel(s.kind)}</div>
|
|
2277
|
+
<h1 class="ai-d-title">
|
|
2278
|
+
${s.title}
|
|
2279
|
+
<span class=${`badge ${e.badgeTone(s.status)}`}>${s.status}</span>
|
|
2280
|
+
<span class="ai-id">${e.shortRef(s)}</span>
|
|
2281
|
+
</h1>
|
|
2282
|
+
<div class="ai-meta">
|
|
2283
|
+
${D(u,([d])=>d,([d,g])=>h`
|
|
2284
|
+
<div class="m">
|
|
2285
|
+
<span class="k">${d}</span>
|
|
2286
|
+
<span class="v">${g}</span>
|
|
2287
|
+
</div>
|
|
2288
|
+
`)}
|
|
2289
|
+
</div>
|
|
2290
|
+
${p.renderDetail()}
|
|
2291
|
+
</div>
|
|
2292
|
+
`}};ts.properties={store:{attribute:!1},entityId:{attribute:!1},cascade:{attribute:!1},activeChildId:{attribute:!1}},ts.styles=[ls,yi,he`
|
|
2293
|
+
:host {
|
|
2294
|
+
display: block;
|
|
2295
|
+
}
|
|
2296
|
+
.detail-inner {
|
|
2297
|
+
max-width: 920px;
|
|
2298
|
+
margin: 0 auto;
|
|
2299
|
+
padding: 28px 32px 64px;
|
|
2300
|
+
}
|
|
2301
|
+
.ai-back {
|
|
2302
|
+
display: inline-flex;
|
|
2303
|
+
gap: 6px;
|
|
2304
|
+
align-items: center;
|
|
2305
|
+
margin-bottom: 12px;
|
|
2306
|
+
border: 0;
|
|
2307
|
+
background: none;
|
|
2308
|
+
color: var(--muted);
|
|
2309
|
+
cursor: pointer;
|
|
2310
|
+
font: inherit;
|
|
2311
|
+
}
|
|
2312
|
+
.ai-back:hover {
|
|
2313
|
+
color: var(--accent);
|
|
2314
|
+
}
|
|
2315
|
+
.ai-load-state {
|
|
2316
|
+
display: flex;
|
|
2317
|
+
gap: 8px;
|
|
2318
|
+
align-items: center;
|
|
2319
|
+
margin: 0 0 12px;
|
|
2320
|
+
color: var(--muted);
|
|
2321
|
+
font-size: 13px;
|
|
2322
|
+
}
|
|
2323
|
+
.ai-load-error {
|
|
2324
|
+
color: var(--danger);
|
|
2325
|
+
}
|
|
2326
|
+
.ai-crumbs {
|
|
2327
|
+
margin-bottom: 12px;
|
|
2328
|
+
color: var(--muted);
|
|
2329
|
+
font-size: 12px;
|
|
2330
|
+
}
|
|
2331
|
+
.ai-kind {
|
|
2332
|
+
color: var(--muted);
|
|
2333
|
+
font-size: 12px;
|
|
2334
|
+
font-weight: 700;
|
|
2335
|
+
letter-spacing: 0.04em;
|
|
2336
|
+
text-transform: uppercase;
|
|
2337
|
+
}
|
|
2338
|
+
.ai-d-title {
|
|
2339
|
+
display: flex;
|
|
2340
|
+
flex-wrap: wrap;
|
|
2341
|
+
gap: 12px;
|
|
2342
|
+
align-items: center;
|
|
2343
|
+
margin: 6px 0 0;
|
|
2344
|
+
font-size: 24px;
|
|
2345
|
+
}
|
|
2346
|
+
.ai-d-title .ai-id {
|
|
2347
|
+
color: var(--muted);
|
|
2348
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
2349
|
+
font-size: 14px;
|
|
2350
|
+
font-weight: 400;
|
|
2351
|
+
}
|
|
2352
|
+
.ai-meta {
|
|
2353
|
+
display: flex;
|
|
2354
|
+
flex-wrap: wrap;
|
|
2355
|
+
gap: 28px;
|
|
2356
|
+
margin: 16px 0 4px;
|
|
2357
|
+
padding: 14px 0;
|
|
2358
|
+
border-top: 1px solid var(--border-muted);
|
|
2359
|
+
border-bottom: 1px solid var(--border-muted);
|
|
2360
|
+
}
|
|
2361
|
+
.ai-meta .m {
|
|
2362
|
+
display: flex;
|
|
2363
|
+
flex-direction: column;
|
|
2364
|
+
gap: 3px;
|
|
2365
|
+
}
|
|
2366
|
+
.ai-meta .m .k {
|
|
2367
|
+
color: var(--muted);
|
|
2368
|
+
font-size: 11px;
|
|
2369
|
+
font-weight: 600;
|
|
2370
|
+
letter-spacing: 0.04em;
|
|
2371
|
+
text-transform: uppercase;
|
|
2372
|
+
}
|
|
2373
|
+
.ai-meta .m .v {
|
|
2374
|
+
font-weight: 600;
|
|
2375
|
+
}
|
|
2376
|
+
.ai-subtabs {
|
|
2377
|
+
display: flex;
|
|
2378
|
+
flex-wrap: wrap;
|
|
2379
|
+
gap: 18px;
|
|
2380
|
+
margin-top: 22px;
|
|
2381
|
+
border-bottom: 1px solid var(--border-muted);
|
|
2382
|
+
}
|
|
2383
|
+
.ai-subtab {
|
|
2384
|
+
position: relative;
|
|
2385
|
+
flex: 0 0 auto;
|
|
2386
|
+
padding: 8px 24px;
|
|
2387
|
+
border: 0;
|
|
2388
|
+
border-bottom: 2px solid transparent;
|
|
2389
|
+
background: transparent;
|
|
2390
|
+
color: var(--muted);
|
|
2391
|
+
cursor: pointer;
|
|
2392
|
+
font: inherit;
|
|
2393
|
+
text-align: center;
|
|
2394
|
+
}
|
|
2395
|
+
.ai-subtab-count {
|
|
2396
|
+
box-sizing: border-box;
|
|
2397
|
+
display: inline-grid;
|
|
2398
|
+
min-width: 16px;
|
|
2399
|
+
height: 16px;
|
|
2400
|
+
padding: 0 3px;
|
|
2401
|
+
place-items: center;
|
|
2402
|
+
position: absolute;
|
|
2403
|
+
top: 1px;
|
|
2404
|
+
right: 1px;
|
|
2405
|
+
border-radius: 50%;
|
|
2406
|
+
background: var(--accent);
|
|
2407
|
+
color: var(--surface);
|
|
2408
|
+
font-size: 10px;
|
|
2409
|
+
font-weight: 700;
|
|
2410
|
+
line-height: 1;
|
|
2411
|
+
}
|
|
2412
|
+
.ai-subtab.active {
|
|
2413
|
+
border-bottom-color: var(--accent);
|
|
2414
|
+
color: var(--text);
|
|
2415
|
+
font-weight: 600;
|
|
2416
|
+
}
|
|
2417
|
+
.ai-record-tab {
|
|
2418
|
+
margin-top: 18px;
|
|
2419
|
+
border: 1px solid var(--border);
|
|
2420
|
+
border-radius: 10px;
|
|
2421
|
+
background: var(--surface);
|
|
2422
|
+
}
|
|
2423
|
+
.ai-record-toolbar {
|
|
2424
|
+
display: flex;
|
|
2425
|
+
gap: 12px;
|
|
2426
|
+
align-items: end;
|
|
2427
|
+
padding: 12px 16px;
|
|
2428
|
+
border-bottom: 1px solid var(--border-muted);
|
|
2429
|
+
}
|
|
2430
|
+
.ai-record-filter {
|
|
2431
|
+
display: grid;
|
|
2432
|
+
gap: 4px;
|
|
2433
|
+
}
|
|
2434
|
+
.ai-record-filter:first-child {
|
|
2435
|
+
flex: 1;
|
|
2436
|
+
}
|
|
2437
|
+
.ai-record-filter > span {
|
|
2438
|
+
color: var(--muted);
|
|
2439
|
+
font-size: 12px;
|
|
2440
|
+
font-weight: 600;
|
|
2441
|
+
}
|
|
2442
|
+
.ai-record-filter input,
|
|
2443
|
+
.ai-record-filter select {
|
|
2444
|
+
box-sizing: border-box;
|
|
2445
|
+
min-height: 32px;
|
|
2446
|
+
padding: 6px 8px;
|
|
2447
|
+
border: 1px solid var(--border);
|
|
2448
|
+
border-radius: 6px;
|
|
2449
|
+
background: var(--surface);
|
|
2450
|
+
color: var(--text);
|
|
2451
|
+
font: inherit;
|
|
2452
|
+
}
|
|
2453
|
+
.ai-record-view-toggle {
|
|
2454
|
+
display: inline-flex;
|
|
2455
|
+
align-self: end;
|
|
2456
|
+
overflow: hidden;
|
|
2457
|
+
border: 1px solid var(--border);
|
|
2458
|
+
border-radius: 6px;
|
|
2459
|
+
}
|
|
2460
|
+
.ai-record-view-button {
|
|
2461
|
+
min-height: 32px;
|
|
2462
|
+
padding: 6px 10px;
|
|
2463
|
+
border: 0;
|
|
2464
|
+
border-right: 1px solid var(--border);
|
|
2465
|
+
background: var(--surface);
|
|
2466
|
+
color: var(--muted);
|
|
2467
|
+
cursor: pointer;
|
|
2468
|
+
font: inherit;
|
|
2469
|
+
}
|
|
2470
|
+
.ai-record-view-button:last-child {
|
|
2471
|
+
border-right: 0;
|
|
2472
|
+
}
|
|
2473
|
+
.ai-record-view-button.active {
|
|
2474
|
+
background: var(--surface-muted);
|
|
2475
|
+
color: var(--text);
|
|
2476
|
+
font-weight: 600;
|
|
2477
|
+
}
|
|
2478
|
+
.ai-record-count {
|
|
2479
|
+
padding-bottom: 7px;
|
|
2480
|
+
color: var(--muted);
|
|
2481
|
+
font-size: 12px;
|
|
2482
|
+
white-space: nowrap;
|
|
2483
|
+
}
|
|
2484
|
+
.ai-record-list,
|
|
2485
|
+
.ai-record-tree {
|
|
2486
|
+
display: grid;
|
|
2487
|
+
gap: 8px;
|
|
2488
|
+
padding: 8px;
|
|
2489
|
+
}
|
|
2490
|
+
.ai-context-summary {
|
|
2491
|
+
padding: 14px 16px 0;
|
|
2492
|
+
}
|
|
2493
|
+
.ai-context-summary h2,
|
|
2494
|
+
.ai-context-term h3 {
|
|
2495
|
+
margin: 0;
|
|
2496
|
+
font-size: 14px;
|
|
2497
|
+
}
|
|
2498
|
+
.ai-context-summary p,
|
|
2499
|
+
.ai-context-term p {
|
|
2500
|
+
margin: 6px 0 0;
|
|
2501
|
+
color: var(--muted);
|
|
2502
|
+
font-size: 13px;
|
|
2503
|
+
}
|
|
2504
|
+
.ai-context-avoid {
|
|
2505
|
+
color: var(--danger);
|
|
2506
|
+
}
|
|
2507
|
+
.ai-context-term {
|
|
2508
|
+
padding: 10px 8px;
|
|
2509
|
+
border-bottom: 1px solid var(--border-muted);
|
|
2510
|
+
}
|
|
2511
|
+
.ai-context-term:last-child {
|
|
2512
|
+
border-bottom: 0;
|
|
2513
|
+
}
|
|
2514
|
+
.ai-graph-wrap {
|
|
2515
|
+
margin-top: 18px;
|
|
2516
|
+
border: 1px solid var(--border);
|
|
2517
|
+
border-radius: 10px;
|
|
2518
|
+
background:
|
|
2519
|
+
radial-gradient(circle, rgba(208, 215, 222, 0.5) 1px, transparent 1px) 0 0 / 22px 22px,
|
|
2520
|
+
var(--surface);
|
|
2521
|
+
overflow: auto;
|
|
2522
|
+
}
|
|
2523
|
+
.ai-graph-legend {
|
|
2524
|
+
display: flex;
|
|
2525
|
+
gap: 16px;
|
|
2526
|
+
flex-wrap: wrap;
|
|
2527
|
+
padding: 10px 14px;
|
|
2528
|
+
border-bottom: 1px solid var(--border-muted);
|
|
2529
|
+
background: var(--surface);
|
|
2530
|
+
}
|
|
2531
|
+
.ai-graph-host {
|
|
2532
|
+
width: max-content;
|
|
2533
|
+
min-width: 100%;
|
|
2534
|
+
padding: 14px 0;
|
|
2535
|
+
}
|
|
2536
|
+
.ai-sec {
|
|
2537
|
+
margin-top: 24px;
|
|
2538
|
+
}
|
|
2539
|
+
.ai-sec h2 {
|
|
2540
|
+
margin: 0 0 10px;
|
|
2541
|
+
font-size: 15px;
|
|
2542
|
+
}
|
|
2543
|
+
.ai-conversation {
|
|
2544
|
+
display: grid;
|
|
2545
|
+
gap: 12px;
|
|
2546
|
+
}
|
|
2547
|
+
.ai-comment {
|
|
2548
|
+
padding: 12px;
|
|
2549
|
+
border: 1px solid var(--border-muted);
|
|
2550
|
+
border-radius: 6px;
|
|
2551
|
+
}
|
|
2552
|
+
.ai-comment:focus {
|
|
2553
|
+
outline: 2px solid var(--focus-ring);
|
|
2554
|
+
outline-offset: -2px;
|
|
2555
|
+
}
|
|
2556
|
+
.ai-comment.is-comment-target {
|
|
2557
|
+
animation: plan-entry-target 1.8s ease-out;
|
|
2558
|
+
}
|
|
2559
|
+
.ai-comment-reference,
|
|
2560
|
+
.ai-comment-references,
|
|
2561
|
+
.ai-comment-provenance,
|
|
2562
|
+
.ai-comment-deleted {
|
|
2563
|
+
color: var(--muted);
|
|
2564
|
+
font-size: 12px;
|
|
2565
|
+
}
|
|
2566
|
+
.ai-comment-reference,
|
|
2567
|
+
.ai-comment-references {
|
|
2568
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
2569
|
+
}
|
|
2570
|
+
.ai-comment-deleted {
|
|
2571
|
+
margin: 8px 0;
|
|
2572
|
+
font-style: italic;
|
|
2573
|
+
}
|
|
2574
|
+
.ai-comment-provenance {
|
|
2575
|
+
display: grid;
|
|
2576
|
+
gap: 2px;
|
|
2577
|
+
}
|
|
2578
|
+
.ai-comment-body {
|
|
2579
|
+
margin: 8px 0;
|
|
2580
|
+
white-space: pre-wrap;
|
|
2581
|
+
}
|
|
2582
|
+
.ai-plan-current,
|
|
2583
|
+
.ai-plan-history {
|
|
2584
|
+
display: grid;
|
|
2585
|
+
gap: 12px;
|
|
2586
|
+
}
|
|
2587
|
+
.ai-plan-group {
|
|
2588
|
+
border-top: 1px solid var(--border-muted);
|
|
2589
|
+
}
|
|
2590
|
+
.ai-plan-group:last-of-type {
|
|
2591
|
+
border-bottom: 1px solid var(--border-muted);
|
|
2592
|
+
}
|
|
2593
|
+
.ai-plan-group summary,
|
|
2594
|
+
.ai-plan-history summary {
|
|
2595
|
+
display: flex;
|
|
2596
|
+
gap: 8px;
|
|
2597
|
+
align-items: center;
|
|
2598
|
+
justify-content: space-between;
|
|
2599
|
+
padding: 10px 0;
|
|
2600
|
+
font-size: 13px;
|
|
2601
|
+
font-weight: 700;
|
|
2602
|
+
cursor: pointer;
|
|
2603
|
+
}
|
|
2604
|
+
.ai-plan-count {
|
|
2605
|
+
min-width: 24px;
|
|
2606
|
+
padding: 2px 7px;
|
|
2607
|
+
border-radius: 999px;
|
|
2608
|
+
background: var(--surface-strong);
|
|
2609
|
+
color: var(--muted);
|
|
2610
|
+
font-size: 11px;
|
|
2611
|
+
text-align: center;
|
|
2612
|
+
}
|
|
2613
|
+
.ai-plan-entries {
|
|
2614
|
+
display: grid;
|
|
2615
|
+
gap: 2px;
|
|
2616
|
+
overflow: hidden;
|
|
2617
|
+
margin-bottom: 12px;
|
|
2618
|
+
border: 1px solid var(--border-muted);
|
|
2619
|
+
border-radius: 6px;
|
|
2620
|
+
background: var(--border-muted);
|
|
2621
|
+
}
|
|
2622
|
+
@supports (row-rule: 2px solid transparent) {
|
|
2623
|
+
.ai-plan-entries {
|
|
2624
|
+
background: transparent;
|
|
2625
|
+
row-rule: 2px solid var(--border-muted);
|
|
2626
|
+
}
|
|
2627
|
+
.ai-plan-entries[data-plan-group="decisions"] {
|
|
2628
|
+
row-rule: none;
|
|
2629
|
+
}
|
|
2630
|
+
}
|
|
2631
|
+
.ai-plan-entries[data-plan-group="decisions"] {
|
|
2632
|
+
gap: 12px;
|
|
2633
|
+
overflow: visible;
|
|
2634
|
+
padding: 10px;
|
|
2635
|
+
border: 0;
|
|
2636
|
+
border-radius: 0;
|
|
2637
|
+
background: var(--surface-muted);
|
|
2638
|
+
}
|
|
2639
|
+
.ai-plan-entry {
|
|
2640
|
+
display: grid;
|
|
2641
|
+
gap: 10px;
|
|
2642
|
+
padding: 14px 16px;
|
|
2643
|
+
background: var(--surface);
|
|
2644
|
+
}
|
|
2645
|
+
.ai-plan-decision-pair {
|
|
2646
|
+
display: grid;
|
|
2647
|
+
overflow: hidden;
|
|
2648
|
+
border: 1px solid var(--border-muted);
|
|
2649
|
+
border-radius: 6px;
|
|
2650
|
+
background: var(--surface);
|
|
2651
|
+
box-shadow: 0 1px 2px rgba(31, 35, 40, 0.05);
|
|
2652
|
+
}
|
|
2653
|
+
.ai-plan-decision-question {
|
|
2654
|
+
background: var(--surface-muted);
|
|
2655
|
+
}
|
|
2656
|
+
.ai-plan-decision-question .ai-plan-entry {
|
|
2657
|
+
background: transparent;
|
|
2658
|
+
}
|
|
2659
|
+
.ai-plan-decision-answer {
|
|
2660
|
+
border-top: 2px solid var(--border-muted);
|
|
2661
|
+
}
|
|
2662
|
+
.ai-plan-decision-pair-label {
|
|
2663
|
+
padding: 12px 16px 0;
|
|
2664
|
+
color: var(--muted);
|
|
2665
|
+
font-size: 10px;
|
|
2666
|
+
font-weight: 700;
|
|
2667
|
+
letter-spacing: 0.04em;
|
|
2668
|
+
text-transform: uppercase;
|
|
2669
|
+
}
|
|
2670
|
+
.ai-plan-entry:focus {
|
|
2671
|
+
outline: 2px solid var(--focus-ring);
|
|
2672
|
+
outline-offset: -2px;
|
|
2673
|
+
}
|
|
2674
|
+
.ai-plan-entry.is-plan-entry-target {
|
|
2675
|
+
animation: plan-entry-target 1.8s ease-out;
|
|
2676
|
+
}
|
|
2677
|
+
.ai-plan-entry-meta {
|
|
2678
|
+
display: grid;
|
|
2679
|
+
gap: 8px;
|
|
2680
|
+
padding-top: 10px;
|
|
2681
|
+
border-top: 1px solid var(--border-muted);
|
|
2682
|
+
color: var(--muted);
|
|
2683
|
+
font-size: 11px;
|
|
2684
|
+
}
|
|
2685
|
+
.ai-plan-entry-header {
|
|
2686
|
+
display: flex;
|
|
2687
|
+
align-items: center;
|
|
2688
|
+
}
|
|
2689
|
+
.ai-plan-entry-reference {
|
|
2690
|
+
display: inline-flex;
|
|
2691
|
+
width: max-content;
|
|
2692
|
+
padding: 3px 8px;
|
|
2693
|
+
border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
|
|
2694
|
+
border-radius: 999px;
|
|
2695
|
+
background: var(--accent-soft);
|
|
2696
|
+
color: var(--accent);
|
|
2697
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
2698
|
+
font-size: 10px;
|
|
2699
|
+
font-weight: 700;
|
|
2700
|
+
}
|
|
2701
|
+
.ai-plan-entry-meta-row {
|
|
2702
|
+
display: grid;
|
|
2703
|
+
grid-template-columns: 70px minmax(0, 1fr);
|
|
2704
|
+
gap: 10px;
|
|
2705
|
+
align-items: baseline;
|
|
2706
|
+
}
|
|
2707
|
+
.ai-plan-entry-link-list {
|
|
2708
|
+
display: flex;
|
|
2709
|
+
flex-wrap: wrap;
|
|
2710
|
+
gap: 5px 12px;
|
|
2711
|
+
min-width: 0;
|
|
2712
|
+
overflow-wrap: anywhere;
|
|
2713
|
+
}
|
|
2714
|
+
.ai-plan-entry-meta-label {
|
|
2715
|
+
font-weight: 700;
|
|
2716
|
+
}
|
|
2717
|
+
.ai-plan-entry-link {
|
|
2718
|
+
padding: 0;
|
|
2719
|
+
border: 0;
|
|
2720
|
+
background: transparent;
|
|
2721
|
+
color: var(--accent);
|
|
2722
|
+
cursor: pointer;
|
|
2723
|
+
font: inherit;
|
|
2724
|
+
font-weight: 600;
|
|
2725
|
+
text-align: left;
|
|
2726
|
+
}
|
|
2727
|
+
.ai-plan-entry-link:hover {
|
|
2728
|
+
text-decoration: underline;
|
|
2729
|
+
}
|
|
2730
|
+
.ai-plan-entry-link:focus-visible {
|
|
2731
|
+
outline: 2px solid var(--focus-ring);
|
|
2732
|
+
outline-offset: 2px;
|
|
2733
|
+
}
|
|
2734
|
+
.ai-plan-entry-unresolved {
|
|
2735
|
+
overflow-wrap: anywhere;
|
|
2736
|
+
}
|
|
2737
|
+
.ai-plan-entry-deleted {
|
|
2738
|
+
color: var(--muted);
|
|
2739
|
+
font-style: italic;
|
|
2740
|
+
}
|
|
2741
|
+
.ai-plan-entry-body {
|
|
2742
|
+
line-height: 1.55;
|
|
2743
|
+
overflow-wrap: anywhere;
|
|
2744
|
+
white-space: pre-wrap;
|
|
2745
|
+
}
|
|
2746
|
+
@keyframes plan-entry-target {
|
|
2747
|
+
0% {
|
|
2748
|
+
background: color-mix(in srgb, var(--accent-soft) 72%, var(--surface));
|
|
2749
|
+
box-shadow: inset 3px 0 0 var(--accent);
|
|
2750
|
+
}
|
|
2751
|
+
100% {
|
|
2752
|
+
background: var(--surface);
|
|
2753
|
+
box-shadow: inset 3px 0 0 transparent;
|
|
2754
|
+
}
|
|
2755
|
+
}
|
|
2756
|
+
.ai-body {
|
|
2757
|
+
max-width: 75ch;
|
|
2758
|
+
line-height: 1.6;
|
|
2759
|
+
}
|
|
2760
|
+
.ai-body-source {
|
|
2761
|
+
display: flex;
|
|
2762
|
+
gap: 10px;
|
|
2763
|
+
align-items: center;
|
|
2764
|
+
margin-bottom: 14px;
|
|
2765
|
+
padding: 10px 12px;
|
|
2766
|
+
border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
|
|
2767
|
+
border-radius: 10px;
|
|
2768
|
+
background: color-mix(in srgb, var(--surface-muted) 76%, white 24%);
|
|
2769
|
+
}
|
|
2770
|
+
.ai-body-source-badge {
|
|
2771
|
+
padding: 4px 8px;
|
|
2772
|
+
border-radius: 999px;
|
|
2773
|
+
background: color-mix(in srgb, var(--accent) 16%, white 84%);
|
|
2774
|
+
color: var(--accent-strong, var(--accent));
|
|
2775
|
+
font-size: 11px;
|
|
2776
|
+
font-weight: 700;
|
|
2777
|
+
letter-spacing: 0.04em;
|
|
2778
|
+
text-transform: uppercase;
|
|
2779
|
+
}
|
|
2780
|
+
.ai-body-source-copy {
|
|
2781
|
+
color: var(--muted);
|
|
2782
|
+
font-size: 12px;
|
|
2783
|
+
font-weight: 600;
|
|
2784
|
+
}
|
|
2785
|
+
.ai-body > :first-child {
|
|
2786
|
+
margin-top: 0;
|
|
2787
|
+
}
|
|
2788
|
+
.ai-body > :last-child {
|
|
2789
|
+
margin-bottom: 0;
|
|
2790
|
+
}
|
|
2791
|
+
.ai-body h1,
|
|
2792
|
+
.ai-body h2,
|
|
2793
|
+
.ai-body h3 {
|
|
2794
|
+
margin: 22px 0 10px;
|
|
2795
|
+
line-height: 1.3;
|
|
2796
|
+
}
|
|
2797
|
+
.ai-body h1 {
|
|
2798
|
+
font-size: 19px;
|
|
2799
|
+
}
|
|
2800
|
+
.ai-body h2 {
|
|
2801
|
+
font-size: 16px;
|
|
2802
|
+
}
|
|
2803
|
+
.ai-body h3 {
|
|
2804
|
+
font-size: 14px;
|
|
2805
|
+
}
|
|
2806
|
+
.ai-body p {
|
|
2807
|
+
margin: 0 0 12px;
|
|
2808
|
+
color: var(--text);
|
|
2809
|
+
}
|
|
2810
|
+
.ai-body ul,
|
|
2811
|
+
.ai-body ol {
|
|
2812
|
+
margin: 0 0 12px;
|
|
2813
|
+
padding-left: 18px;
|
|
2814
|
+
line-height: 1.7;
|
|
2815
|
+
}
|
|
2816
|
+
.ai-body a {
|
|
2817
|
+
color: var(--accent);
|
|
2818
|
+
}
|
|
2819
|
+
.ai-body code {
|
|
2820
|
+
padding: 2px 5px;
|
|
2821
|
+
border-radius: 5px;
|
|
2822
|
+
background: var(--surface-muted);
|
|
2823
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
2824
|
+
font-size: 0.9em;
|
|
2825
|
+
}
|
|
2826
|
+
.ai-body pre {
|
|
2827
|
+
overflow: auto;
|
|
2828
|
+
margin: 0 0 12px;
|
|
2829
|
+
padding: 12px 14px;
|
|
2830
|
+
border: 1px solid var(--border-muted);
|
|
2831
|
+
border-radius: 8px;
|
|
2832
|
+
background: var(--surface-muted);
|
|
2833
|
+
}
|
|
2834
|
+
.ai-body pre code {
|
|
2835
|
+
padding: 0;
|
|
2836
|
+
background: none;
|
|
2837
|
+
}
|
|
2838
|
+
.ai-body blockquote {
|
|
2839
|
+
margin: 0 0 12px;
|
|
2840
|
+
padding: 2px 0 2px 14px;
|
|
2841
|
+
border-left: 3px solid var(--border);
|
|
2842
|
+
color: var(--muted);
|
|
2843
|
+
}
|
|
2844
|
+
.ai-refs {
|
|
2845
|
+
display: grid;
|
|
2846
|
+
gap: 8px;
|
|
2847
|
+
}
|
|
2848
|
+
.ai-story-block {
|
|
2849
|
+
display: grid;
|
|
2850
|
+
gap: 10px;
|
|
2851
|
+
}
|
|
2852
|
+
.ai-story-issues {
|
|
2853
|
+
display: grid;
|
|
2854
|
+
gap: 8px;
|
|
2855
|
+
margin-left: 18px;
|
|
2856
|
+
padding-left: 14px;
|
|
2857
|
+
border-left: 1px solid var(--border-muted);
|
|
2858
|
+
}
|
|
2859
|
+
.ai-issue-tree {
|
|
2860
|
+
display: grid;
|
|
2861
|
+
gap: 8px;
|
|
2862
|
+
}
|
|
2863
|
+
.ai-issue-tree-node {
|
|
2864
|
+
display: grid;
|
|
2865
|
+
gap: 8px;
|
|
2866
|
+
}
|
|
2867
|
+
.ai-issue-tree-row {
|
|
2868
|
+
display: flex;
|
|
2869
|
+
gap: 8px;
|
|
2870
|
+
align-items: flex-start;
|
|
2871
|
+
}
|
|
2872
|
+
.ai-issue-tree-children {
|
|
2873
|
+
display: grid;
|
|
2874
|
+
gap: 8px;
|
|
2875
|
+
margin-left: 18px;
|
|
2876
|
+
padding-left: 14px;
|
|
2877
|
+
border-left: 1px solid var(--border-muted);
|
|
2878
|
+
}
|
|
2879
|
+
.branch-toggle,
|
|
2880
|
+
.branch-spacer {
|
|
2881
|
+
flex-shrink: 0;
|
|
2882
|
+
width: 24px;
|
|
2883
|
+
height: 24px;
|
|
2884
|
+
margin-top: 10px;
|
|
2885
|
+
}
|
|
2886
|
+
.branch-toggle {
|
|
2887
|
+
border: 1px solid var(--border-muted);
|
|
2888
|
+
border-radius: 6px;
|
|
2889
|
+
background: var(--surface);
|
|
2890
|
+
color: var(--muted);
|
|
2891
|
+
cursor: pointer;
|
|
2892
|
+
font: inherit;
|
|
2893
|
+
line-height: 1;
|
|
2894
|
+
}
|
|
2895
|
+
.branch-toggle:hover {
|
|
2896
|
+
border-color: var(--accent);
|
|
2897
|
+
color: var(--accent);
|
|
2898
|
+
}
|
|
2899
|
+
.ai-ref {
|
|
2900
|
+
display: flex;
|
|
2901
|
+
gap: 12px;
|
|
2902
|
+
align-items: center;
|
|
2903
|
+
width: stretch;
|
|
2904
|
+
padding: 10px 12px;
|
|
2905
|
+
border: 1px solid var(--border);
|
|
2906
|
+
border-radius: 8px;
|
|
2907
|
+
background: var(--surface);
|
|
2908
|
+
color: inherit;
|
|
2909
|
+
cursor: pointer;
|
|
2910
|
+
font: inherit;
|
|
2911
|
+
text-align: left;
|
|
2912
|
+
}
|
|
2913
|
+
.ai-ref:hover {
|
|
2914
|
+
border-color: var(--accent);
|
|
2915
|
+
background: var(--surface-muted);
|
|
2916
|
+
}
|
|
2917
|
+
.ai-ref.is-active-ref {
|
|
2918
|
+
border-color: var(--accent);
|
|
2919
|
+
background: var(--surface-muted);
|
|
2920
|
+
box-shadow: inset 3px 0 0 0 var(--accent);
|
|
2921
|
+
}
|
|
2922
|
+
.ai-ref .r-id {
|
|
2923
|
+
min-width: 56px;
|
|
2924
|
+
color: var(--muted);
|
|
2925
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
2926
|
+
font-size: 12px;
|
|
2927
|
+
}
|
|
2928
|
+
.ai-ref .r-title {
|
|
2929
|
+
flex: 1;
|
|
2930
|
+
font-weight: 600;
|
|
2931
|
+
}
|
|
2932
|
+
.ai-empty {
|
|
2933
|
+
color: var(--muted);
|
|
2934
|
+
font-size: 13px;
|
|
2935
|
+
}
|
|
2936
|
+
@media (max-width: 700px) {
|
|
2937
|
+
.detail-inner {
|
|
2938
|
+
padding: 20px 16px 48px;
|
|
2939
|
+
}
|
|
2940
|
+
.ai-record-toolbar {
|
|
2941
|
+
align-items: stretch;
|
|
2942
|
+
flex-direction: column;
|
|
2943
|
+
}
|
|
2944
|
+
.ai-record-count {
|
|
2945
|
+
padding-bottom: 0;
|
|
2946
|
+
}
|
|
2947
|
+
.ai-body-source {
|
|
2948
|
+
flex-direction: column;
|
|
2949
|
+
align-items: flex-start;
|
|
2950
|
+
}
|
|
2951
|
+
}
|
|
2952
|
+
`];let li=ts;customElements.define("agent-issues-detail-view",li);const ic="0123456789ABCDEFGHJKMNPQRSTVWXYZ",rc=6,rn=5,nc="agent-issues-global-search-recents",ac=300*1e3,oc=[{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"}],lc={project:"PROJ",epic:"EPIC",version:"VER",initiative:"INIT",prd:"PRD",userStory:"US",adr:"ADR",issue:"ISS",debt:"DEBT",handoff:"HO"};function cc(n){if(n.shortReference)return n.shortReference;const e=lc[n.kind]??n.kind.slice(0,4).toUpperCase();let t=2166136261;for(let r=0;r<n.id.length;r+=1)t^=n.id.charCodeAt(r),t=Math.imul(t,16777619);let s=BigInt(t>>>0),i="";for(let r=0;r<rc;r+=1)i=ic[Number(s&31n)]+i,s>>=5n;return`${e}_${i}`}function dc(n){if(!n||typeof n!="object"||!("type"in n))return!1;const e=n;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 nn(n,e){const t=n.nodes.filter(a=>e.has(a.kind)),s=new Set(t.map(a=>a.key)),i=[...new Set(t.map(a=>a.col))].sort((a,o)=>a-o),r=new Map(i.map((a,o)=>[a,o]));return{columns:i.map(a=>n.columns[a]),edges:n.edges.filter(a=>s.has(a.from)&&s.has(a.to)),nodes:t.map(a=>({...a,col:r.get(a.col)}))}}function zt(n){return{...n,body:""}}function uc(n){return[...(n.incoming??[]).map(({entity:e,relationType:t})=>({createdAt:n.entity.createdAt,fromId:e.id,toId:n.entity.id,type:t})),...(n.outgoing??[]).map(({entity:e,relationType:t})=>({createdAt:n.entity.createdAt,fromId:n.entity.id,toId:e.id,type:t}))]}function pc(n){if(n.category==="relation")return new Set(["issues","plans","prds","adrs","context","userStories","debt","graph"]);if(n.category==="context")return new Set(["context"]);if(n.category==="plan-entry")return new Set(["plans"]);if(n.category!=="entity")return new Set;const e={adr:"adrs",debt:"debt",issue:"issues",plan:"plans",prd:"prds",userStory:"userStories"};return new Set([...(n.affectedEntityKinds??[]).flatMap(t=>e[t]?[e[t]]:[]),"graph"])}class hc{constructor(){this.config=_(null),this.snapshot=_(null),this.projectSummary=_(null),this.entityDetails=_(new Map),this.projectAdrsCache=_({data:null,error:null,loading:!1}),this.projectDebtCache=_({data:null,error:null,loading:!1}),this.projectContextCache=_({data:null,error:null,loading:!1}),this.projectGraphCache=_({data:null,error:null,loading:!1}),this.planEntryPages=_(new Map),this.issueCommentPages=_(new Map),this.initiativeDetails=_(new Map),this.initiativeTabs=_(new Map),this.projectDiscovery=_(null),this.search=_(""),this.globalSearchCapability=_(null),this.globalSearchQuery=_(""),this.globalSearchScope=_("current-project"),this.globalSearchSourceTypes=_(["entity","context","context-term","plan-entry","issue-comment"]),this.globalSearchResponse=_(null),this.globalSearchResults=_([]),this.globalSearchRecents=_([]),this.globalSearchProgress=_(!1),this.globalSearchOpen=_(!1),this.contextSearch=_(""),this.contextTab=_("all"),this.selectedContextInitiativeId=_(null),this.visibleProjectGraphKinds=_(new Set(ze)),this.initiativeStatusFilter=_("all"),this.adrStatusFilter=_("all"),this.debtLifecycleFilter=_("open"),this.debtCategoryFilter=_("all"),this.debtPriorityFilter=_("all"),this.kindFilter=_("all"),this.selectedTenant=_(null),this.selectedProjectId=_(null),this.selectedInitiativeId=_(null),this.selectedId=_(null),this.selectedNestedTarget=_(null),this.cascadePath=_([]),this.cascadeAvailableWidth=_(0),this.cascadeWindowStart=_(null),this.reRootTrail=_([]),this.railCollapsed=_(!1),this.masterCollapsedOverride=_(null),this.collapsedEpicIdsByProject=_(new Map),this.syncLabel=_("loading"),this.errorMessage=_(null),this.activeView=_("overview"),this.activePage=_("list"),this.activeRootTab=_("initiatives"),this.activeSection=_("initiatives"),this.initTab=_("overview"),this.globalSearchAbortController=null,this.globalSearchProgressTimer=null,this.globalSearchRequestTimer=null,this.localChangeCorrelations=new Map,this.tenantById=j(()=>new Map((this.config.get()?.availableTenants??[]).map(e=>[e.id,e]))),this.tenantOptions=j(()=>{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=j(()=>{const e=this.selectedTenant.get();return e?this.tenantById.get().get(e)?.displayName??this.formatTenantDisplayName(e):null}),this.selectedProjectDisplayName=j(()=>{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=j(()=>{const e=this.snapshot.get(),t=e?.initiatives.flatMap(a=>[a.initiative,...a.prds,...a.userStories,...a.adrs,...a.issues])??[],s=[...this.entityDetails.get().values()].flatMap(a=>a.detail?[a.detail]:[]),i=s.map(a=>a.entity),r=s.flatMap(a=>[...(a.incoming??[]).map(({entity:o})=>zt(o)),...(a.outgoing??[]).map(({entity:o})=>zt(o))]);return new Map([...e?.entities??[],...e?.projectAdrs??[],...t,...r,...i].map(a=>[a.id,a]))}),this.globalSearchRecentRecords=j(()=>this.globalSearchRecents.get().flatMap(e=>{const t=this.snapshot.get();if(!t)return[];if(e.type==="entity"){const a=this.entityForId(e.entityId);return a?[{sourceType:"entity",target:e,title:a.title}]:[]}if(e.type==="plan-entry"){const a=t.planEntries?.find(o=>o.id===e.entryId&&o.planId===e.planId&&!o.tombstone);return a&&this.entityForId(e.planId)?[{sourceType:"plan-entry",target:e,title:a.body??"Plan entry"}]:[]}if(e.type==="issue-comment"){const a=t.issueComments[e.issueId]?.comments.find(o=>o.id===e.commentId&&!o.tombstone);return a&&this.entityForId(e.issueId)?[{sourceType:"issue-comment",target:e,title:a.body??"Comment"}]:[]}const s=[t.contexts.shared,...t.contexts.initiatives],i=e.scopeRef?s.find(a=>a.context.key===e.scopeRef||a.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 r=i.terms.find(a=>a.term===e.term);return r?[{sourceType:"context-term",target:e,title:r.term}]:[]})),this.cascadeColumns=j(()=>this.cascadePath.get().map(e=>this.entityForId(e)).filter(e=>!!e)),this.masterCollapsed=j(()=>{const e=this.masterCollapsedOverride.get();return e!==null?e:!1}),this.cascadeColumnWidth=480,this.cascadeColumnGap=16,this.cascadeColumnWindow=j(()=>{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(),r=Math.min(Math.max(i??s,0),e.length-1);return{breadcrumb:e.slice(0,r),columns:e.slice(r)}}),this.selectedEntity=j(()=>this.entityForId(this.selectedId.get())),this.selectedBundle=j(()=>this.bundleForEntityId(this.selectedId.get())),this.selectedInitiativeBundle=j(()=>this.bundleForInitiativeId(this.selectedInitiativeId.get())),this.activeInitiativeId=j(()=>this.selectedInitiativeId.get()??this.selectedBundle.get()?.initiative.id??null),this.sharedContext=j(()=>this.projectContextCache.get().data?.shared??this.snapshot.get()?.contexts.shared??null),this.initiativeContextById=j(()=>new Map((this.projectContextCache.get().data?.initiatives??this.snapshot.get()?.contexts.initiatives??[]).filter(e=>!!e.context.scopeEntityId).map(e=>[e.context.scopeEntityId??e.context.key,e]))),this.selectedContext=j(()=>{const e=this.selectedBundle.get();return e?this.initiativeContextById.get().get(e.initiative.id)??null:this.sharedContext.get()}),this.projectContextTerms=j(()=>{const e=this.projectContextCache.get().data?.terms;if(e)return e;const t=new Map;for(const s of[this.sharedContext.get(),...this.projectContextCache.get().data?.initiatives??this.snapshot.get()?.contexts.initiatives??[]])if(s)for(const i of s.terms){const r=i.term.toLowerCase(),a={avoid:[...i.avoid],contextKey:s.context.key,contextTitle:s.context.title,definition:i.definition,scopeEntityId:s.context.scopeEntityId,scopeKind:s.context.scopeKind,scopeLabel:s.context.scopeLabel,updatedAt:i.updatedAt},o=t.get(r);if(!o){t.set(r,{term:i.term,sources:[a],hasSharedSource:s.context.scopeKind==="default",hasDuplicates:!1,hasConflictingDefinitions:!1});continue}o.sources.push(a),o.hasDuplicates=o.sources.length>1,o.hasSharedSource=o.hasSharedSource||s.context.scopeKind==="default",o.hasConflictingDefinitions=an(o.sources),i.term.localeCompare(o.term)<0&&(o.term=i.term)}return[...t.values()].map(s=>({...s,sources:s.sources.sort(fc)})).sort((s,i)=>s.term.localeCompare(i.term))}),this.filteredProjectContextTerms=j(()=>{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=j(()=>{const e=this.selectedContextInitiativeId.get(),t=this.contextSearch.get().trim().toLowerCase();return this.projectContextTerms.get().map(s=>{const i=s.sources.filter(a=>a.scopeKind==="initiative"&&(!e||a.scopeEntityId===e));return i.length===0||!(!t||s.term.toLowerCase().includes(t)||i.some(a=>[a.scopeLabel,a.contextTitle,a.definition,...a.avoid].join(" ").toLowerCase().includes(t)))?null:{...s,sources:i,hasSharedSource:!1,hasDuplicates:i.length>1,hasConflictingDefinitions:an(i)}}).filter(s=>s!==null)}),this.filteredSharedContext=j(()=>{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(r=>[r.term,r.definition,...r.avoid].join(" ").toLowerCase().includes(t));return!s&&i.length===0?null:{context:{...e.context,summary:s?e.context.summary:""},terms:i}}),this.projectContextDuplicateCount=j(()=>this.projectContextTerms.get().filter(e=>e.hasDuplicates).length),this.selectedIncoming=j(()=>this.incomingRelationsFor(this.selectedId.get())),this.selectedOutgoing=j(()=>this.outgoingRelationsFor(this.selectedId.get())),this.relatedEntities=j(()=>{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=j(()=>{const e=this.selectedEntity.get();return e?[e,...this.relatedEntities.get()]:[]}),this.localGraphRelations=j(()=>{const e=new Set(this.localGraphEntities.get().map(t=>t.id));return this.scopedRelations().filter(t=>e.has(t.fromId)&&e.has(t.toId))}),this.filteredEntities=j(()=>{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=j(()=>["issue","all",...new Set((this.snapshot.get()?.entities??[]).map(e=>e.kind).filter(e=>e!=="issue"))]),this.rootTabCounts=j(()=>({adrs:(this.snapshot.get()?.entities??[]).filter(e=>e.kind==="adr").length,initiatives:this.snapshot.get()?.initiatives.length??0})),this.allDebtRecords=j(()=>this.sortEntities(this.projectDebtCache.get().data?.records??(this.snapshot.get()?.entities??[]).filter(e=>e.kind==="debt"))),this.debtRecords=j(()=>{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=j(()=>this.snapshot.get()?.initiatives??this.projectSummaryInitiatives.get().map(e=>({adrs:[],blockerLinks:[],constrainsLinks:[],entities:[zt(e.initiative)],fixLinks:[],initiative:zt(e.initiative),issues:[],prds:[],subIssueLinks:[],userStories:[]}))),this.projectSummaryEpicGroups=j(()=>{const e=this.projectSummary.get();return e?.kind==="available"?e.epics:[]}),this.projectSummaryInitiatives=j(()=>this.projectSummaryEpicGroups.get().flatMap(e=>e.initiatives)),this.epicInitiativeGroups=j(()=>{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 r=s.get(i.fromId)??[];r.push(i.toId),s.set(i.fromId,r)}return this.sortEntities(e.entities.filter(i=>i.kind==="epic")).map(i=>{const r=(s.get(i.id)??[]).map(a=>t.get(a)).filter(a=>!!a);return{epic:i,initiatives:r,completedInitiativeCount:r.filter(a=>this.isDoneStatus(a.initiative.status)).length}}).filter(i=>i.initiatives.length>0)}),this.projectAdrs=j(()=>this.sortEntities(this.projectAdrsCache.get().data?.projectAdrs??this.snapshot.get()?.projectAdrs??(this.snapshot.get()?.entities??[]).filter(e=>e.kind==="adr"))),this.adrRailEntries=j(()=>{const e=this.snapshot.get(),t=this.projectAdrs.get().map(r=>({adr:r,scope:"project",scopeLabel:"project decision"})),i=(this.projectAdrsCache.get().data?.initiativeAdrs??e?.initiatives??[]).flatMap(r=>this.sortEntities(r.adrs).map(a=>({adr:a,scope:"initiative",scopeLabel:`initiative ${r.initiative.title}`})));return[...t,...i]}),this.projectStoryCount=j(()=>this.projectSummaryInitiatives.get().reduce((e,t)=>e+t.userStoryCount,0)),this.projectIssueCount=j(()=>this.projectSummaryInitiatives.get().reduce((e,t)=>e+t.issueCount,0)),this.projectDescription=j(()=>this.sharedContext.get()?.context.summary??this.selectedTenantDisplayName.get()??""),this.orphanIds=j(()=>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}requestEntityTab(e,t){t==="plan"&&this.loadPlanEntryPage(e)}async loadMorePlanEntries(e){const t=this.planEntryPages.get().get(e)?.data?.nextBefore;t&&await this.loadPlanEntryPage(e,!1,t)}async loadMoreIssueComments(e){const t=this.issueCommentPages.get().get(e)?.data?.nextBefore;t&&await this.loadIssueCommentPage(e,!1,t)}openGlobalSearch(){this.globalSearchOpen.set(!0),this.globalSearchRecents.set(this.readGlobalSearchRecents()),this.reloadGlobalSearchCapability()}planEntriesFor(e){return this.planEntryPages.get().get(e)?.data?.entries??(this.snapshot.get()?.planEntries??[]).filter(t=>t.planId===e)}issueCommentsFor(e){return this.issueCommentPages.get().get(e)?.data?.comments??this.snapshot.get()?.issueComments[e]?.comments??[]}displayUser(e,t){const s=this.issueCommentPages.get().get(t)?.data?.users.find(i=>i.id===e)??this.snapshot.get()?.users.find(i=>i.id===e);return s?.displayName??s?.authenticationSubject??e}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 r=new URLSearchParams({tenant:t,project:s,query:e,scope:this.globalSearchScope.get()});r.set("sourceTypes",this.globalSearchSourceTypes.get().join(","));try{const a=await fetch(`/api/search?${r}`,{cache:"no-store",signal:i.signal});if(!a.ok)throw new Error("Global search request failed.");const o=await a.json();this.globalSearchAbortController===i&&(this.globalSearchResponse.set(o),o.state==="available"&&this.globalSearchResults.set(o.results))}catch(a){if(a instanceof DOMException&&a.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(a=>a.fromId===e&&a.toId===t);return i?i.type:s.find(a=>a.fromId===t&&a.toId===e)?.type??null}cascadePathForLeaf(e){const t=this.snapshot.get()?.relations??[],s=[e],i=new Set([e]);let r=e;for(;;){const p=t.find(d=>d.type==="decomposes"&&d.toId===r);if(!p||i.has(p.fromId))break;s.unshift(p.fromId),i.add(p.fromId),r=p.fromId}const a=s[0],l=this.sortEntities(t.filter(p=>p.type==="fixes"&&p.fromId===a).map(p=>this.entityForId(p.toId)).filter(p=>!!p))[0]?.id??null;return[...this.spineForStory(l,a),...s]}spineForStory(e,t){const s=this.snapshot.get()?.relations??[],i=e?s.find(o=>o.type==="creates"&&o.toId===e)?.fromId??null:null,r=i?s.find(o=>o.type==="owns"&&o.toId===i)?.fromId??null:s.find(o=>o.type==="tracks"&&o.toId===t)?.fromId??null,a=[];return r&&a.push(r),i&&a.push(i),e&&a.push(e),a}cascadeSeamFor(e,t){const s=this.cascadeHopRelation(e,t);if(s!=="fixes")return{relation:s,branch:null};const i=this.snapshot.get()?.relations??[],r=this.sortEntities(i.filter(a=>a.type==="fixes"&&a.fromId===t).map(a=>this.entityForId(a.toId)).filter(a=>!!a));return r.length<=1?{relation:s,branch:null}:{relation:s,branch:{options:r,selectedIndex:r.findIndex(a=>a.id===e)}}}selectCascadeBranch(e,t){const s=this.cascadePath.get(),i=s.indexOf(e);if(i===-1)return;const r=s.slice(i),a=this.spineForStory(t,e);this.cascadeWindowStart.set(null),this.cascadePath.set([...a,...r]),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){if(!e)return null;const t=(this.snapshot.get()?.initiatives??[]).find(p=>p.initiative.id===e)??null;if(t)return t;const s=this.projectSummaryInitiatives.get().find(p=>p.initiative.id===e);if(!s)return null;const i=this.initiativeDetailForId(e),r=this.initiativeTabForId(e,this.initTab.get()),a=i?.initiative??{...s.initiative,body:""},o=r?.records??[],l=new Map([a,...o].map(p=>[p.id,p])),u=r?.relations??[];return{adrs:o.filter(p=>p.kind==="adr"),blockerLinks:u.filter(p=>p.type==="blocks").flatMap(p=>{const d=l.get(p.fromId),g=l.get(p.toId);return d&&g?[{source:d,target:g}]:[]}),constrainsLinks:u.filter(p=>p.type==="constrains").flatMap(p=>{const d=l.get(p.fromId),g=l.get(p.toId);return d&&g?[{adr:d,issue:g}]:[]}),entities:[a,...o],fixLinks:u.filter(p=>p.type==="fixes").flatMap(p=>{const d=l.get(p.fromId),g=l.get(p.toId);return d&&g?[{issue:d,userStory:g}]:[]}),initiative:a,issues:o.filter(p=>p.kind==="issue"),prds:o.filter(p=>p.kind==="prd"),relations:u,subIssueLinks:u.filter(p=>p.type==="decomposes").flatMap(p=>{const d=l.get(p.fromId),g=l.get(p.toId);return d&&g?[{parent:d,issue:g}]:[]}),userStories:o.filter(p=>p.kind==="userStory")}}initiativeDetailForId(e){return e?this.initiativeDetails.get().get(e)?.detail??null:null}initiativeTabForId(e,t){return e?this.initiativeTabs.get().get(this.initiativeTabCacheKey(e,t))?.data??null:null}isSummaryInitiative(e){return!this.snapshot.get()?.initiatives.some(t=>t.initiative.id===e)&&this.projectSummaryInitiatives.get().some(t=>t.initiative.id===e)}incomingRelationsFor(e){return e?this.scopedRelations().filter(t=>t.toId===e):[]}outgoingRelationsFor(e){return e?this.scopedRelations().filter(t=>t.fromId===e):[]}scopedRelations(){const e=new Map;for(const t of this.snapshot.get()?.relations??[])e.set(`${t.fromId}:${t.type}:${t.toId}`,t);for(const t of[...this.entityDetails.get().values()].flatMap(s=>s.detail?[s.detail]:[]))for(const s of uc(t))e.set(`${s.fromId}:${s.type}:${s.toId}`,s);return[...e.values()]}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))}applyLocalProjectChange(e){this.handleProjectChange(e),this.registerLocalChangeCorrelation(e.correlationId)}async mutateProject(e,t){const s=globalThis.crypto.randomUUID();this.registerLocalChangeCorrelation(s);try{const i=await fetch(this.buildTenantScopedPath("/api/project-mutation"),{body:JSON.stringify({correlationId:s,method:e,params:t}),cache:"no-store",headers:{"content-type":"application/json"},method:"POST"});if(!i.ok)throw new Error(`Project mutation ${e} failed.`);const r=await i.json();return this.applyLocalProjectChange(r.event),r.result}catch(i){throw this.localChangeCorrelations.delete(s),i}}registerLocalChangeCorrelation(e){if(!e)return;const t=Date.now();for(const[s,i]of this.localChangeCorrelations)i<t&&this.localChangeCorrelations.delete(s);this.localChangeCorrelations.set(e,t+ac)}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()),e==="adrs"?this.loadProjectAdrs():e==="debt"?this.loadProjectDebt():e==="context"?this.loadProjectContext():e==="graph"&&this.loadProjectGraph()}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);const t=this.selectedInitiativeId.get();t&&e!=="overview"&&this.projectSummaryInitiatives.get().some(s=>s.initiative.id===t)&&this.loadInitiativeTab(t,e)}async retryInitiativeDetail(e){await this.loadInitiativeDetail(e,!0)}async retryInitiativeTab(e,t){await this.loadInitiativeTab(e,t,!0)}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?`${nc}:${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(dc).slice(0,rn):[]}catch{return[]}}recordGlobalSearchRecent(e){const t=this.globalSearchRecentsStorageKey();if(!t)return;const s=this.readGlobalSearchRecents(),i=JSON.stringify(e),r=[e,...s.filter(a=>JSON.stringify(a)!==i)].slice(0,rn);window.localStorage.setItem(t,JSON.stringify(r)),this.globalSearchRecents.set(r)}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()),this.loadEntityDetail(e),this.entityForId(e)?.kind==="issue"&&this.loadIssueCommentPage(e)}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()),this.isSummaryInitiative(e)&&this.loadInitiativeDetail(e)}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.projectSummary.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.reloadProjectSummary(),this.connectEvents()}catch(s){this.selectedProjectId.set(null),this.snapshot.set(null),this.projectSummary.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=this.projectSummaryInitiatives.get().find(a=>a.initiative.id===e.initiative.id);if(t){const a=t.issueCount>0?Math.round(t.completedIssueCount/t.issueCount*100):0;return{adrs:e.adrs.length,done:t.completedIssueCount,issues:t.issueCount,pct:a,stories:t.userStoryCount}}const s=e.issues.length,i=e.issues.filter(a=>this.isDoneStatus(a.status)).length,r=s>0?Math.round(i/s*100):0;return{adrs:e.adrs.length,done:i,issues:s,pct:r,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 r=new Set,a=this.issuesForStory(e,t);for(const l of a){const u=[l.id];for(;u.length>0;){const d=u.shift();if(!(!d||r.has(d))){r.add(d);for(const g of i.get(d)??[])u.push(g)}}let p=l.id;for(;p;){if(r.has(p)){p=s.get(p)??null;continue}r.add(p),p=s.get(p)??null}}const o=[...r].filter(l=>{const u=s.get(l);return!u||!r.has(u)});return this.buildIssueTree(e,o,r)}issueTreeForDirectIssues(e){const t=new Set(e.userStories.flatMap(a=>this.issueTreeForStory(e,a.id).flatMap(o=>this.issueTreeNodeIds(o)))),s=new Set(e.issues.map(a=>a.id).filter(a=>!t.has(a))),i=new Map(e.subIssueLinks.map(a=>[a.issue.id,a.parent.id])),r=[...s].filter(a=>{const o=i.get(a);return!o||!s.has(o)});return this.buildIssueTree(e,r,s)}subIssueTreeForIssue(e,t){const s=new Set,i=this.subIssuesForIssue(e,t).map(r=>r.id);for(;i.length>0;){const r=i.shift();if(!(!r||s.has(r))){s.add(r);for(const a of this.subIssuesForIssue(e,r))i.push(a.id)}}return this.buildIssueTree(e,this.subIssuesForIssue(e,t).map(r=>r.id),s)}buildInitiativeGraph(e,t){const s=e.initiative,i=this.snapshot.get(),r=e.relations??i?.relations??[],a=e.relations?e.entities:i?.entities??[],o=[],l=[];new Map(e.issues.map(m=>[m.id,m]));const u=new Map,p=new Set(e.subIssueLinks.map(m=>m.issue.id)),d=new Map,g=this.sortEntities(e.entities.filter(m=>m.kind==="plan"));o.push({col:0,fullLabel:s.title,id:s.id,key:s.id,kind:"initiative",label:s.title});for(const m of g)o.push({col:1,fullLabel:m.title,id:m.id,key:m.id,kind:"plan",label:m.title,status:m.status}),l.push({from:s.id,to:m.id});for(const m of e.prds)o.push({col:1,fullLabel:m.title,id:m.id,key:m.id,kind:"prd",label:m.title}),l.push({from:s.id,to:m.id});for(const m of e.adrs)o.push({col:1,fullLabel:m.title,id:m.id,key:m.id,kind:"adr",label:m.title}),l.push({from:s.id,to:m.id});for(const m of e.userStories)o.push({col:2,fullLabel:m.title,id:m.id,key:m.id,kind:"story",label:m.title}),l.push({from:s.id,to:m.id});for(const m of e.subIssueLinks){const M=u.get(m.parent.id)??[];M.push(m.issue),u.set(m.parent.id,M)}for(const[m,M]of u)u.set(m,this.sortEntities(M));for(const m of e.fixLinks){const M=d.get(m.issue.id)??[];M.push(m.userStory.id),d.set(m.issue.id,M)}const v=this.sortEntities(e.issues.filter(m=>!p.has(m.id)));let y=0;const L=new Set,O=(m,M)=>{if(L.has(m.id)){y=Math.max(y,M);return}L.add(m.id),y=Math.max(y,M),o.push({col:3+M,fullLabel:m.title,id:m.id,key:m.id,kind:"issue",label:m.title,status:m.status});const ge=d.get(m.id)??[];if(ge.length>0)for(const we of ge)l.push({from:we,to:m.id});else M===0&&l.push({from:s.id,to:m.id});for(const we of u.get(m.id)??[])O(we,M+1),l.push({from:m.id,to:we.id})};for(const m of v)O(m,0);for(const m of this.sortEntities(e.issues))L.has(m.id)||O(m,0);const I=["Issues"];for(let m=1;m<=y;m+=1)I.push(m===1?"Sub-issues":"Nested sub-issues");const x=3+I.length,R=this.sortEntities(a.filter(m=>m.kind==="debt"&&r.some(M=>M.fromId===s.id&&M.toId===m.id&&M.type==="records")));for(const m of R)o.push({col:x,fullLabel:m.title,id:m.id,key:m.id,kind:"debt",label:m.title,status:m.status}),l.push({from:s.id,label:"records",to:m.id});const A=new Set(o.map(m=>m.id)),C=new Set(R.map(m=>m.id)),T=new Set(g.map(m=>m.id));for(const m of r)m.type==="informs"&&T.has(m.fromId)&&A.has(m.toId)&&l.push({from:m.fromId,label:"informs",to:m.toId}),m.type==="resolves"&&A.has(m.fromId)&&C.has(m.toId)&&l.push({from:m.fromId,label:"resolves",to:m.toId}),m.type==="relatesTo"&&C.has(m.fromId)&&A.has(m.toId)&&l.push({from:m.fromId,label:"relatesTo",to:m.toId});const z={columns:["Initiative","Plans, PRDs & ADRs","User stories",...I,"Debt records"],edges:l,nodes:o};return t?nn(z,t):z}buildProjectGraph(){const e=this.projectGraphCache.get().data;if(e)return this.buildScopedProjectGraph(e);const t=this.snapshot.get(),s=this.epicInitiativeGroups.get(),i="__project",r=new Map,a=this.selectedProjectId.get(),o=[{col:0,fullLabel:this.projectDescription.get(),id:"",key:i,kind:"project",label:this.selectedTenantDisplayName.get()??""}],l=[];a&&r.set(a,i);for(const d of t?.projectAdrs??[])o.push({col:1,fullLabel:d.title,id:d.id,key:d.id,kind:"adr",label:d.title,status:d.status}),r.set(d.id,d.id),l.push({from:i,to:d.id});for(const d of s){const{epic:g}=d;o.push({col:1,fullLabel:g.title,id:g.id,key:g.id,kind:"epic",label:g.title,status:g.status}),r.set(g.id,g.id),l.push({from:i,to:g.id});for(const v of d.initiatives){const y=v.initiative,L=new Map,O=new Map;o.push({col:2,fullLabel:`${y.title} — ${v.userStories.length} stories, ${v.issues.length} issues`,id:y.id,key:y.id,kind:"initiative",label:y.title,status:y.status}),r.set(y.id,y.id),l.push({from:g.id,to:y.id});const I=[...this.sortEntities(v.entities.filter(x=>x.kind==="plan")).map(x=>({entity:x,kind:"plan"})),...v.prds.map(x=>({entity:x,kind:"prd"})),...v.adrs.map(x=>({entity:x,kind:"adr"}))];for(const{entity:x,kind:R}of I){const A=`${y.id}:${x.id}`;o.push({col:3,fullLabel:x.title,id:x.id,key:A,kind:R,label:x.title,status:x.status}),r.set(x.id,A),l.push({from:y.id,to:A})}for(const x of this.sortEntities(v.userStories)){const R=`${y.id}:${x.id}`;L.set(x.id,R),r.set(x.id,R),o.push({col:4,fullLabel:x.title,id:x.id,key:R,kind:"story",label:x.title,status:x.status}),l.push({from:y.id,to:R})}for(const x of v.fixLinks){const R=O.get(x.issue.id)??[];R.push(x.userStory.id),O.set(x.issue.id,R)}for(const x of this.sortEntities(v.issues)){const R=`${y.id}:${x.id}`;r.set(x.id,R),o.push({col:5,fullLabel:x.title,id:x.id,key:R,kind:"issue",label:x.title,status:x.status});const A=(O.get(x.id)??[]).map(C=>L.get(C)).filter(C=>!!C);if(A.length>0)for(const C of A)l.push({from:C,to:R});else l.push({from:y.id,to:R})}}}const u=new Map,p=this.sortEntities((t?.entities??[]).filter(d=>d.kind==="debt"));for(const d of p){const g=(t?.relations??[]).find(y=>y.fromId!==d.id&&y.toId===d.id&&y.type==="records"),v=g?r.get(g.fromId):void 0;v&&(u.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}),l.push({from:v,label:"records",to:d.id}))}for(const d of t?.relations??[]){if(d.type==="informs"){const g=r.get(d.fromId),v=r.get(d.toId);g&&v&&l.push({from:g,label:"informs",to:v})}if(d.type==="resolves"){const g=r.get(d.fromId),v=u.get(d.toId);g&&v&&l.push({from:g,label:"resolves",to:v})}if(d.type==="relatesTo"){const g=u.get(d.fromId),v=r.get(d.toId)??u.get(d.toId);g&&v&&l.push({from:g,label:"relatesTo",to:v})}}return nn({columns:["Project","Epics","Initiatives","Plans, PRDs & ADRs","User stories","Issues","Debt records"],edges:l,nodes:o},this.visibleProjectGraphKinds.get())}buildScopedProjectGraph(e){const t=this.sortEntities(e.records),s=[...new Set(t.map(l=>l.kind==="userStory"?"story":l.kind).filter(l=>ze.includes(l)))],i=new Map(s.map((l,u)=>[l,u])),r=new Set(t.map(l=>l.id)),a=t.flatMap(l=>{const u=l.kind==="userStory"?"story":l.kind,p=i.get(u);return p===void 0?[]:[{col:p,fullLabel:l.title,id:l.id,key:l.id,kind:u,label:l.title,status:l.status}]}),o=e.relations.filter(l=>r.has(l.fromId)&&r.has(l.toId)).map(l=>({from:l.fromId,label:l.type,to:l.toId}));return{columns:s.map(l=>l==="story"?"User stories":`${l.slice(0,1).toUpperCase()}${l.slice(1)}s`),edges:o,nodes:a}}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])),r=new Map(e.map(g=>[g.id,0])),a=new Map(e.map(g=>[g.id,[]])),o=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}`;o.has(v)||(o.add(v),r.set(g.target.id,r.get(g.target.id)+1),a.get(g.source.id).push(g.target.id))}const u=e.filter(g=>r.get(g.id)===0),p=[],d=new Set;for(;u.length>0;){u.sort(l);const g=u.shift();if(!d.has(g.id)){d.add(g.id),p.push(g);for(const v of a.get(g.id)??[]){const y=r.get(v)-1;r.set(v,y),y===0&&u.push(s.get(v))}}}return[...p,...e.filter(g=>!d.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 cc(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(),r=this.selectedOutgoing.get(),a=this.orphanIds.get(),o=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=a.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 ${r.length} outgoing links. ${o} ${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,r=i?this.entityById.get().get(i)??null:null,a=t?.kind==="debt"?[["Category",t.category??"—"],["Priority",t.priority??"—"],["Lifecycle",t.status],["Owner",r?`${this.shortRef(r)} ${r.title}`:"—"]]:[],o=t?.kind==="debt"?[]:[["Status",t?.status??"—"]],l=t?.type?[["Type",t.type]]:[];return[["Initiative",s?`${this.shortRef(s.initiative)} ${s.initiative.title}`:"—"],...a,...o,...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,r=new Set(t?.excludeRelationTypes??[]),a=new Set(t?.excludeRelatedIds??[]),o=(l,u,p)=>{if(a.has(l))return;const d=this.entityById.get().get(l);if(!d)return;const g=i.get(u)??{crossLink:!s.has(p),records:[]};g.records.push(d),i.set(u,g)};for(const l of this.outgoingRelationsFor(e))r.has(l.type)||o(l.toId,this.relationLabel(l.type,!1),l.type);for(const l of this.incomingRelationsFor(e))r.has(l.type)||o(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(r=>r.type==="records").map(r=>this.entityById.get().get(r.toId)).filter(r=>r?.kind==="debt"),i=["epic","initiative","issue"].includes(t.kind)?this.outgoingRelationsFor(t.id).filter(r=>r.type==="resolves").map(r=>this.entityById.get().get(r.toId)).filter(r=>r?.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.planEntriesFor(e)].sort((r,a)=>r.createdAt.localeCompare(a.createdAt)||r.reference.localeCompare(a.reference)),s=new Set(t.flatMap(r=>r.supersededEntryIds)),i=t.filter(r=>!r.tombstone&&!s.has(r.id));return{current:oc.map(r=>({key:r.key,title:r.title,entries:i.filter(a=>gc(a,r.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.initiativeTabForId(e,"context")?.context??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 reloadProjectSummary(){const e=this.selectedTenant.get(),t=this.selectedProjectId.get(),s=await this.fetchJson(this.buildTenantScopedPath("/api/project-summary"));if(!(this.selectedTenant.get()!==e||this.selectedProjectId.get()!==t)){if(s.kind==="unavailable")throw new Error("Selected project is unavailable.");this.projectSummary.set(s),this.snapshot.set(null),this.errorMessage.set(null),this.syncLabel.set("listening")}}refreshProjectSummaryInBackground(){this.reloadProjectSummary().catch(e=>{this.errorMessage.set(e instanceof Error?e.message:String(e)),this.syncLabel.set("refresh failed")})}async loadInitiativeDetail(e,t=!1){const s=this.initiativeDetails.get().get(e);if(s?.loading||!t&&s?.detail&&!s.stale)return;const i=this.selectedTenant.get(),r=this.selectedProjectId.get();this.setInitiativeDetailCache(e,{detail:s?.detail??null,error:null,loading:!0,stale:s?.stale});try{const a=await this.fetchJson(this.buildTenantScopedPath(`/api/initiative-detail?initiative=${encodeURIComponent(e)}`));if(this.selectedTenant.get()!==i||this.selectedProjectId.get()!==r)return;if(!("initiative"in a)){this.selectedInitiativeId.get()===e&&this.clearSelection();return}this.setInitiativeDetailCache(e,{detail:a,error:null,loading:!1})}catch(a){if(this.selectedTenant.get()===i&&this.selectedProjectId.get()===r){const o=this.initiativeDetails.get().get(e);this.setInitiativeDetailCache(e,{detail:o?.detail??s?.detail??null,error:a instanceof Error?a.message:String(a),loading:!1,stale:o?.stale??s?.stale})}}}async retryProjectAdrs(){await this.loadProjectAdrs(!0)}async loadProjectAdrs(e=!1){const t=this.projectAdrsCache.get();if(t.loading||!e&&t.data&&!t.stale)return;const s=this.selectedTenant.get(),i=this.selectedProjectId.get();this.projectAdrsCache.set({data:t.data,error:null,loading:!0,stale:t.stale});try{const r=await this.fetchJson(this.buildTenantScopedPath("/api/project-adrs"));this.selectedTenant.get()===s&&this.selectedProjectId.get()===i&&this.projectAdrsCache.set({data:r,error:null,loading:!1})}catch(r){if(this.selectedTenant.get()===s&&this.selectedProjectId.get()===i){const a=this.projectAdrsCache.get();this.projectAdrsCache.set({data:a.data,error:r instanceof Error?r.message:String(r),loading:!1,stale:a.stale??t.stale})}}}async retryProjectDebt(){await this.loadProjectDebt(!0)}async loadProjectDebt(e=!1){await this.loadProjectRecordData("/api/project-debt",this.projectDebtCache,e)}async retryProjectContext(){await this.loadProjectContext(!0)}async loadProjectContext(e=!1){const t=this.projectContextCache.get();if(t.loading||!e&&t.data&&!t.stale)return;const s=this.selectedTenant.get(),i=this.selectedProjectId.get();this.projectContextCache.set({data:t.data,error:null,loading:!0,stale:t.stale});try{const r=await this.fetchJson(this.buildTenantScopedPath("/api/project-context"));this.selectedTenant.get()===s&&this.selectedProjectId.get()===i&&this.projectContextCache.set({data:r,error:null,loading:!1})}catch(r){if(this.selectedTenant.get()===s&&this.selectedProjectId.get()===i){const a=this.projectContextCache.get();this.projectContextCache.set({data:a.data,error:r instanceof Error?r.message:String(r),loading:!1,stale:a.stale??t.stale})}}}async retryProjectGraph(){await this.loadProjectGraph(!0)}async loadProjectGraph(e=!1){await this.loadProjectRecordData("/api/project-graph",this.projectGraphCache,e)}async loadProjectRecordData(e,t,s){const i=t.get();if(i.loading||!s&&i.data&&!i.stale)return;const r=this.selectedTenant.get(),a=this.selectedProjectId.get();t.set({data:i.data,error:null,loading:!0,stale:i.stale});try{const o=await this.fetchJson(this.buildTenantScopedPath(e));this.selectedTenant.get()===r&&this.selectedProjectId.get()===a&&t.set({data:o,error:null,loading:!1})}catch(o){if(this.selectedTenant.get()===r&&this.selectedProjectId.get()===a){const l=t.get();t.set({data:l.data,error:o instanceof Error?o.message:String(o),loading:!1,stale:l.stale??i.stale})}}}async loadPlanEntryPage(e,t=!1,s){const i=this.planEntryPages.get().get(e);if(i?.loading||!t&&i?.data&&!i.stale&&!s)return;const r=this.selectedTenant.get(),a=this.selectedProjectId.get();this.setPlanEntryPageCache(e,{data:i?.data??null,error:null,loading:!0,stale:i?.stale});try{const o=await this.fetchJson(this.buildTenantScopedPath(`/api/plan-entries?plan=${encodeURIComponent(e)}${s?`&before=${encodeURIComponent(s)}`:""}`));if(this.selectedTenant.get()===r&&this.selectedProjectId.get()===a){const l=s?[...new Map([...i?.data?.entries??[],...o.entries].map(u=>[u.id,u])).values()]:o.entries;this.setPlanEntryPageCache(e,{data:{...o,entries:l},error:null,loading:!1})}}catch(o){if(this.selectedTenant.get()===r&&this.selectedProjectId.get()===a){const l=this.planEntryPages.get().get(e);this.setPlanEntryPageCache(e,{data:l?.data??i?.data??null,error:o instanceof Error?o.message:String(o),loading:!1,stale:l?.stale??i?.stale})}}}setPlanEntryPageCache(e,t){const s=new Map(this.planEntryPages.get());s.set(e,t),this.planEntryPages.set(s)}async loadIssueCommentPage(e,t=!1,s){const i=this.issueCommentPages.get().get(e);if(i?.loading||!t&&i?.data&&!i.stale&&!s)return;const r=this.selectedTenant.get(),a=this.selectedProjectId.get();this.setIssueCommentPageCache(e,{data:i?.data??null,error:null,loading:!0,stale:i?.stale});try{const o=await this.fetchJson(this.buildTenantScopedPath(`/api/issue-comments?issue=${encodeURIComponent(e)}${s?`&before=${encodeURIComponent(s)}`:""}`));if(this.selectedTenant.get()===r&&this.selectedProjectId.get()===a){const l=s?[...new Map([...i?.data?.comments??[],...o.comments].map(p=>[p.id,p])).values()]:o.comments,u=s?[...new Map([...i?.data?.users??[],...o.users].map(p=>[p.id,p])).values()]:o.users;this.setIssueCommentPageCache(e,{data:{...o,comments:l,users:u},error:null,loading:!1})}}catch(o){if(this.selectedTenant.get()===r&&this.selectedProjectId.get()===a){const l=this.issueCommentPages.get().get(e);this.setIssueCommentPageCache(e,{data:l?.data??i?.data??null,error:o instanceof Error?o.message:String(o),loading:!1,stale:l?.stale??i?.stale})}}}setIssueCommentPageCache(e,t){const s=new Map(this.issueCommentPages.get());s.set(e,t),this.issueCommentPages.set(s)}entityDetailForId(e){return e?this.entityDetails.get().get(e)?.detail??null:null}async retryEntityDetail(e){await this.loadEntityDetail(e,!0)}async loadEntityDetail(e,t=!1){const s=this.entityDetails.get().get(e);if(s?.loading||!t&&s?.detail&&!s.stale)return;const i=this.selectedTenant.get(),r=this.selectedProjectId.get();this.setEntityDetailCache(e,{detail:s?.detail??null,error:null,loading:!0,stale:s?.stale});try{const a=await this.fetchJson(this.buildTenantScopedPath(`/api/entity-detail?entity=${encodeURIComponent(e)}`));if(this.selectedTenant.get()!==i||this.selectedProjectId.get()!==r)return;if(!("entity"in a)){this.selectedId.get()===e&&this.clearSelection();return}this.setEntityDetailCache(e,{detail:a,error:null,loading:!1}),a.entity.kind==="issue"&&this.loadIssueCommentPage(e)}catch(a){if(this.selectedTenant.get()===i&&this.selectedProjectId.get()===r){const o=this.entityDetails.get().get(e);this.setEntityDetailCache(e,{detail:o?.detail??s?.detail??null,error:a instanceof Error?a.message:String(a),loading:!1,stale:o?.stale??s?.stale})}}}setEntityDetailCache(e,t){const s=new Map(this.entityDetails.get());s.set(e,t),this.entityDetails.set(s)}setInitiativeDetailCache(e,t){const s=new Map(this.initiativeDetails.get());s.set(e,t),this.initiativeDetails.set(s)}async loadInitiativeTab(e,t,s=!1){const i=this.initiativeTabCacheKey(e,t),r=this.initiativeTabs.get().get(i);if(r?.loading||!s&&r?.data&&!r.stale)return;const a=this.selectedTenant.get(),o=this.selectedProjectId.get();this.setInitiativeTabCache(i,{data:r?.data??null,error:null,loading:!0,stale:r?.stale});try{const l=await this.fetchJson(this.buildTenantScopedPath(`/api/initiative-tab?initiative=${encodeURIComponent(e)}&tab=${t}`));if(this.selectedTenant.get()!==a||this.selectedProjectId.get()!==o)return;this.setInitiativeTabCache(i,{data:l,error:null,loading:!1})}catch(l){if(this.selectedTenant.get()===a&&this.selectedProjectId.get()===o){const u=this.initiativeTabs.get().get(i);this.setInitiativeTabCache(i,{data:u?.data??r?.data??null,error:l instanceof Error?l.message:String(l),loading:!1,stale:u?.stale??r?.stale})}}}initiativeTabCacheKey(e,t){return`${e}:${t}`}setInitiativeTabCache(e,t){const s=new Map(this.initiativeTabs.get());s.set(e,t),this.initiativeTabs.set(s)}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.projectSummary.set(null),this.syncLabel.set("choose a project"),await this.reloadProjectDiscovery(),this.applyRoute(e);return}this.stopLiveUpdates(),this.syncLabel.set("connecting");try{await this.reloadProjectSummary(),this.connectEvents(),this.applyRoute(e)}catch(s){this.selectedProjectId.set(null),this.snapshot.set(null),this.projectSummary.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.entityDetails.set(new Map),this.projectAdrsCache.set({data:null,error:null,loading:!1}),this.projectDebtCache.set({data:null,error:null,loading:!1}),this.projectContextCache.set({data:null,error:null,loading:!1}),this.projectGraphCache.set({data:null,error:null,loading:!1}),this.planEntryPages.set(new Map),this.issueCommentPages.set(new Map),this.initiativeDetails.set(new Map),this.initiativeTabs.set(new Map),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=e=>{this.handleProjectChangeEvent(e)},this.events.onerror=()=>{this.syncLabel.set("reconnecting"),this.startPolling()}}handleProjectChangeEvent(e){let t;try{t=JSON.parse(e.data)}catch{this.refreshProjectSummaryInBackground();return}if(t.correlationId){const s=this.localChangeCorrelations.get(t.correlationId);if(this.localChangeCorrelations.delete(t.correlationId),s!==void 0&&s>=Date.now())return}this.handleProjectChange(t)}handleProjectChange(e){if(e.projectId&&e.projectId!==this.selectedProjectId.get())return;if(!e.category||e.category==="bulk"||e.category==="unknown"){this.refreshProjectSummaryInBackground();return}const t=this.selectedId.get(),s=pc(e);let i=!1;if(e.category==="entity"){for(const a of e.affectedEntityIds??[]){const o=this.entityDetails.get().get(a);o&&(this.setEntityDetailCache(a,{...o,stale:!0}),i=!0)}if(t&&e.affectedEntityIds?.includes(t)&&(this.loadEntityDetail(t,!0),i=!0),e.affectedEntityKinds?.includes("adr")){const a=this.projectAdrsCache.get();a.data&&this.projectAdrsCache.set({...a,stale:!0}),this.activeSection.get()==="adrs"&&this.activePage.get()==="list"&&this.loadProjectAdrs(!0),i=!0}if(e.affectedEntityKinds?.includes("debt")){const a=this.projectDebtCache.get();a.data&&this.projectDebtCache.set({...a,stale:!0}),this.activeSection.get()==="debt"&&this.activePage.get()==="list"&&this.loadProjectDebt(!0),i=!0}const r=this.projectGraphCache.get();r.data&&this.projectGraphCache.set({...r,stale:!0}),this.activeSection.get()==="graph"&&this.activePage.get()==="list"&&(this.loadProjectGraph(!0),i=!0)}if(e.category==="issue-comment")for(const r of e.affectedEntityIds??[]){const a=this.issueCommentPages.get().get(r);a&&(this.setIssueCommentPageCache(r,{...a,stale:!0}),i=!0),t===r&&(this.loadIssueCommentPage(r,!0),i=!0)}if(e.category==="plan-entry")for(const r of e.affectedEntityIds??[]){const a=this.planEntryPages.get().get(r),o=a!==void 0||this.entityForId(r)?.kind==="plan";a&&(this.setPlanEntryPageCache(r,{...a,stale:!0}),i=!0),t===r&&o&&(this.loadPlanEntryPage(r,!0),i=!0);const l=this.entityDetails.get().get(r);l&&!o&&(this.setEntityDetailCache(r,{...l,stale:!0}),i=!0),t===r&&!o&&(this.loadEntityDetail(r,!0),i=!0)}if(e.category==="context"){const r=this.projectContextCache.get();r.data&&this.projectContextCache.set({...r,stale:!0}),this.activeSection.get()==="context"&&this.activePage.get()==="list"&&this.loadProjectContext(!0),i=!0}if(e.category==="relation"){for(const a of e.affectedEntityIds??[]){const o=this.entityDetails.get().get(a);o&&(this.setEntityDetailCache(a,{...o,stale:!0}),i=!0),t===a&&(this.loadEntityDetail(a,!0),i=!0)}const r=this.projectGraphCache.get();r.data&&this.projectGraphCache.set({...r,stale:!0}),this.activeSection.get()==="graph"&&this.activePage.get()==="list"&&this.loadProjectGraph(!0),i=!0}for(const r of e.affectedInitiativeIds??[]){if(e.affectedEntityIds?.includes(r)){const a=this.initiativeDetails.get().get(r);a&&(this.setInitiativeDetailCache(r,{...a,stale:!0}),i=!0),this.selectedInitiativeId.get()===r&&this.initTab.get()==="overview"&&(this.loadInitiativeDetail(r,!0),i=!0)}for(const[a,o]of this.initiativeTabs.get()){const l=a.slice(`${r}:`.length);a.startsWith(`${r}:`)&&s.has(l)&&(this.setInitiativeTabCache(a,{...o,stale:!0}),i=!0)}this.selectedInitiativeId.get()===r&&this.initTab.get()!=="overview"&&s.has(this.initTab.get())&&(this.loadInitiativeTab(r,this.initTab.get(),!0),i=!0)}if(i){e.affectsProjectSummary&&this.refreshProjectSummaryInBackground();return}this.refreshProjectSummaryInBackground()}startPolling(){this.pollTimer===null&&(this.pollTimer=window.setInterval(()=>{this.refreshProjectSummaryInBackground()},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(),r=new Date(s.updatedAt).getTime();return i!==r?r-i:t.id.localeCompare(s.id)})}buildIssueTree(e,t,s){const i=new Map(e.issues.map(l=>[l.id,l])),r=new Map;for(const l of e.subIssueLinks){if(!s.has(l.parent.id)||!s.has(l.issue.id))continue;const u=r.get(l.parent.id)??[];u.push(l.issue.id),r.set(l.parent.id,u)}const a=l=>{const u=i.get(l);if(!u)return null;const p=this.sortEntities((r.get(l)??[]).map(d=>i.get(d)).filter(d=>!!d));return{issue:u,children:p.map(d=>a(d.id)).filter(d=>d!==null)}};return this.sortEntities(t.map(l=>i.get(l)).filter(l=>!!l)).map(l=>a(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"),r=t.get("project")??s.get("project"),a=t.get("section"),o=t.get("target"),l=t.get("target-id"),u=t.get("target-scope")??void 0,p=o==="context"?{id:null,scopeRef:u,type:"context"}:l&&o==="context-term"?{id:l,scopeRef:u,type:o}:l&&(o==="context-term"||o==="issue-comment"||o==="plan-entry")?{type:o,id:l}:null;return{tenantId:i,projectId:r,section:Gl(a)?a:"initiatives",entityId:t.get("entity"),initiativeId:t.get("initiative"),target:p}}normalizeRoute(e){const t=this.entityById.get();if(t.size===0)return e;const s=e.entityId&&(this.snapshot.get()===null||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(r=>r.id===e.id&&r.planId===t&&!r.tombstone)?e:null;if(e.type==="issue-comment")return(t?this.snapshot.get()?.issueComments[t]?.comments.find(r=>r.id===e.id&&!r.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.entityId?this.loadEntityDetail(t.entityId):t.initiativeId&&this.isSummaryInitiative(t.initiativeId)?this.loadInitiativeDetail(t.initiativeId):t.section==="adrs"?this.loadProjectAdrs():t.section==="debt"?this.loadProjectDebt():t.section==="context"?this.loadProjectContext():t.section==="graph"&&this.loadProjectGraph(),t}writeRoute(e,t=!1){const s=new URL(window.location.href),i=[],r=(a,o)=>{o&&i.push(`${a}=${encodeURIComponent(o)}`)};r("tenant",e.tenantId),r("project",e.projectId),r("section",e.section==="initiatives"?null:e.section),r("entity",e.entityId),r("initiative",e.initiativeId),r("target",e.target?.type??null),r("target-id",e.target?.id??null),r("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("?")?"&":"?",r=new URLSearchParams;return t&&r.set("tenant",t),s&&r.set("project",s),r.size>0?`${e}${i}${r}`:e}stopLiveUpdates(){this.events?.close(),this.events=null,this.pollTimer!==null&&(window.clearInterval(this.pollTimer),this.pollTimer=null)}}function an(n){return new Set(n.map(t=>t.definition.trim().toLowerCase()).filter(t=>t.length>0)).size>1}function gc(n,e){switch(e){case"questions":return n.role==="question";case"decisions":return n.role==="decision";case"includedScope":return n.role==="scope"&&n.scopeDirection==="included";case"excludedScope":return n.role==="scope"&&n.scopeDirection==="excluded";case"constraints":return n.role==="constraint";case"preferences":return n.role==="preference";case"considerations":return n.role==="consideration"}}function fc(n,e){return n.scopeKind!==e.scopeKind?n.scopeKind==="default"?-1:1:n.scopeLabel!==e.scopeLabel?n.scopeLabel.localeCompare(e.scopeLabel):n.contextKey.localeCompare(e.contextKey)}const Gs="tenant-switcher-menu",on="agent-issues-theme",_i=class _i extends rs(ce){constructor(){super(...arguments),this.store=new hc,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.onRetryProjectSection=e=>{const t=e.currentTarget.dataset.section;t==="adrs"?this.store.retryProjectAdrs():t==="debt"?this.store.retryProjectDebt():t==="context"?this.store.retryProjectContext():t==="graph"&&this.store.retryProjectGraph()},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(on);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(on,e),this.requestUpdate()}renderThemeToggle(e){const t=this.theme==="light"?"dark":"light",s=this.theme==="light"?"☾":"☼";return h`
|
|
2953
|
+
<button
|
|
2954
|
+
aria-label=${`Switch to ${t} theme`}
|
|
2955
|
+
aria-pressed=${this.toAriaBoolean(this.theme==="dark")}
|
|
2956
|
+
class=${`theme-toggle ${e}-theme-toggle`}
|
|
2957
|
+
data-theme-toggle=${e}
|
|
2958
|
+
title=${`Switch to ${t} theme`}
|
|
2959
|
+
@click=${this.onToggleTheme}
|
|
2960
|
+
type="button"
|
|
2961
|
+
>
|
|
2962
|
+
${s}
|
|
2963
|
+
</button>
|
|
2964
|
+
`}renderSwitcherMenu(){const e=this.store.tenantOptions.get(),t=this.store.selectedTenant.get();return h`
|
|
2965
|
+
<div
|
|
2966
|
+
class="menu"
|
|
2967
|
+
id=${Gs}
|
|
2968
|
+
popover=${"auto"}
|
|
2969
|
+
>
|
|
2970
|
+
${D(e,s=>s.id,s=>h`
|
|
2971
|
+
<button
|
|
2972
|
+
class="menu-item"
|
|
2973
|
+
data-tenant=${s.id}
|
|
2974
|
+
popovertarget=${Gs}
|
|
2975
|
+
popovertargetaction="hide"
|
|
2976
|
+
@click=${this.onSelectTenant}
|
|
2977
|
+
>
|
|
2978
|
+
<span class="check">${w(s.id===t,()=>h`✓`,()=>k)}</span>
|
|
2979
|
+
<span class="avatar small">${s.displayName.charAt(0)}</span>
|
|
2980
|
+
<span class="sw-text">
|
|
2981
|
+
<span class="sw-name">${s.displayName}</span>
|
|
2982
|
+
<span class="sw-sub">${w(s.id===t,()=>h`current project`,()=>h`open project`)}</span>
|
|
2983
|
+
</span>
|
|
2984
|
+
</button>
|
|
2985
|
+
`)}
|
|
2986
|
+
</div>
|
|
2987
|
+
`}renderRail(){const e=this.store,t=e.selectedProjectDisplayName.get()??"Project",s=e.activeSection.get(),i=[{count:String(e.projectSummaryInitiatives.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`
|
|
2988
|
+
<aside class="rail" data-pane="rail">
|
|
2989
|
+
<button
|
|
2990
|
+
aria-label=${this.mobileMasterOpen?"Close record list":"Open record list"}
|
|
2991
|
+
aria-pressed=${this.toAriaBoolean(this.mobileMasterOpen)}
|
|
2992
|
+
class="mobile-master-toggle"
|
|
2993
|
+
@click=${this.onToggleMobileMaster}
|
|
2994
|
+
type="button"
|
|
2995
|
+
>
|
|
2996
|
+
☰
|
|
2997
|
+
</button>
|
|
2998
|
+
<button
|
|
2999
|
+
class="pane-collapse"
|
|
3000
|
+
data-collapse="rail"
|
|
3001
|
+
title=${e.railCollapsed.get()?"Expand rail":"Collapse rail"}
|
|
3002
|
+
@click=${this.onToggleRail}
|
|
3003
|
+
>
|
|
3004
|
+
${e.railCollapsed.get()?"»":"«"}
|
|
3005
|
+
</button>
|
|
3006
|
+
<div class="rail-switcher">
|
|
3007
|
+
<div class="switcher-actions">
|
|
3008
|
+
<button
|
|
3009
|
+
class="switcher-button"
|
|
3010
|
+
@click=${this.onOpenProjectChooser}
|
|
3011
|
+
>
|
|
3012
|
+
<span class="avatar">${t.charAt(0)}</span>
|
|
3013
|
+
<span class="sw-text">
|
|
3014
|
+
<span class="sw-name">${t}</span>
|
|
3015
|
+
<span class="sw-sub">Switch project</span>
|
|
3016
|
+
</span>
|
|
3017
|
+
</button>
|
|
3018
|
+
<button
|
|
3019
|
+
aria-label="Switch tenant"
|
|
3020
|
+
class="switcher-tenant-button"
|
|
3021
|
+
popovertarget=${Gs}
|
|
3022
|
+
>
|
|
3023
|
+
⇅
|
|
3024
|
+
</button>
|
|
3025
|
+
</div>
|
|
3026
|
+
${this.renderSwitcherMenu()}
|
|
3027
|
+
</div>
|
|
3028
|
+
${w(!this.narrow,()=>h`
|
|
3029
|
+
<button
|
|
3030
|
+
aria-label="Open global search"
|
|
3031
|
+
class="global-search-trigger"
|
|
3032
|
+
data-global-search-trigger
|
|
3033
|
+
@click=${this.onOpenGlobalSearch}
|
|
3034
|
+
type="button"
|
|
3035
|
+
>
|
|
3036
|
+
<span>Search records</span>
|
|
3037
|
+
<kbd>⌘ K</kbd>
|
|
3038
|
+
</button>
|
|
3039
|
+
`,()=>h`
|
|
3040
|
+
<button
|
|
3041
|
+
aria-label="Open global search"
|
|
3042
|
+
class="global-search-icon-trigger"
|
|
3043
|
+
data-global-search-trigger
|
|
3044
|
+
@click=${this.onOpenGlobalSearch}
|
|
3045
|
+
type="button"
|
|
3046
|
+
>
|
|
3047
|
+
⌕
|
|
3048
|
+
</button>
|
|
3049
|
+
`)}
|
|
3050
|
+
<nav class="rail-nav">
|
|
3051
|
+
<div class="nav-group-label">Plan</div>
|
|
3052
|
+
${Gt(i,r=>h`
|
|
3053
|
+
<button
|
|
3054
|
+
class=${Y({active:s===r.section,"nav-item":!0})}
|
|
3055
|
+
data-section=${r.section}
|
|
3056
|
+
data-tenant-nav=${r.section}
|
|
3057
|
+
title=${r.label}
|
|
3058
|
+
@click=${this.onSelectSection}
|
|
3059
|
+
>
|
|
3060
|
+
<span class="nav-icon">${r.icon}</span>
|
|
3061
|
+
<span class="nav-label">${r.label}</span>
|
|
3062
|
+
<span class="nav-count">${r.count}</span>
|
|
3063
|
+
</button>
|
|
3064
|
+
`)}
|
|
3065
|
+
<div class="nav-group-label totals">Totals</div>
|
|
3066
|
+
<div class="nav-item static">
|
|
3067
|
+
<span class="nav-icon">📝</span>
|
|
3068
|
+
<span class="nav-label">User stories</span>
|
|
3069
|
+
<span class="nav-count">${e.projectStoryCount.get()}</span>
|
|
3070
|
+
</div>
|
|
3071
|
+
<div class="nav-item static">
|
|
3072
|
+
<span class="nav-icon">⊙</span>
|
|
3073
|
+
<span class="nav-label">Issues</span>
|
|
3074
|
+
<span class="nav-count">${e.projectIssueCount.get()}</span>
|
|
3075
|
+
</div>
|
|
3076
|
+
</nav>
|
|
3077
|
+
<div class="rail-foot">
|
|
3078
|
+
<span class="rail-foot-copy">${e.projectDescription.get()}</span>
|
|
3079
|
+
${w(!this.narrow,()=>this.renderThemeToggle("rail"),()=>k)}
|
|
3080
|
+
</div>
|
|
3081
|
+
${w(this.narrow,()=>this.renderThemeToggle("header"),()=>k)}
|
|
3082
|
+
</aside>
|
|
3083
|
+
`}renderProjectCard(e){const t=e.initiativeCount>0?Math.round(e.completedInitiativeCount/e.initiativeCount*100):0;return h`
|
|
3084
|
+
<button
|
|
3085
|
+
class="project-card"
|
|
3086
|
+
data-project=${e.project.id}
|
|
3087
|
+
@click=${this.onSelectProject}
|
|
3088
|
+
>
|
|
3089
|
+
<div class="project-card-head">
|
|
3090
|
+
<div>
|
|
3091
|
+
<h2>${e.project.title}</h2>
|
|
3092
|
+
<p>${this.store.shortRef(e.project)}</p>
|
|
3093
|
+
</div>
|
|
3094
|
+
<span class="badge ${this.store.badgeTone(e.project.status)}">${e.project.status}</span>
|
|
3095
|
+
</div>
|
|
3096
|
+
<div class="project-counts">
|
|
3097
|
+
<span>${e.epicCount} epics</span>
|
|
3098
|
+
<span>${e.initiativeCount} initiatives</span>
|
|
3099
|
+
<span>${e.completedInitiativeCount}/${e.initiativeCount} completed</span>
|
|
3100
|
+
</div>
|
|
3101
|
+
<div
|
|
3102
|
+
aria-label=${`${t}% of initiatives completed`}
|
|
3103
|
+
class="project-progress"
|
|
3104
|
+
role="progressbar"
|
|
3105
|
+
aria-valuemax="100"
|
|
3106
|
+
aria-valuemin="0"
|
|
3107
|
+
aria-valuenow=${String(t)}
|
|
3108
|
+
>
|
|
3109
|
+
<span style=${`width:${t}%`}></span>
|
|
3110
|
+
</div>
|
|
3111
|
+
</button>
|
|
3112
|
+
`}renderProjectChooser(){const e=this.store,t=e.selectedTenantDisplayName.get()??"Selected tenant",s=e.projectDiscovery.get(),i=s?.kind==="available"?s.projects:[];return h`
|
|
3113
|
+
<main class="project-chooser" data-view="project-chooser">
|
|
3114
|
+
<div class="project-chooser-inner">
|
|
3115
|
+
<div class="ai-crumbs">${t}</div>
|
|
3116
|
+
<h1>Projects</h1>
|
|
3117
|
+
${w(i.length>0,()=>h`
|
|
3118
|
+
<p class="project-chooser-copy">Choose a project to open its console.</p>
|
|
3119
|
+
<div class="project-grid">
|
|
3120
|
+
${D(i,r=>r.project.id,r=>this.renderProjectCard(r))}
|
|
3121
|
+
</div>
|
|
3122
|
+
`,()=>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>`)))}
|
|
3123
|
+
</div>
|
|
3124
|
+
</main>
|
|
3125
|
+
`}renderInitiativeCard(e){const t=this.store,{initiative:s}=e,i=e.issueCount>0?Math.round(e.completedIssueCount/e.issueCount*100):0;return h`
|
|
3126
|
+
<button
|
|
3127
|
+
class=${Y({active:t.activeInitiativeId.get()===s.id,"m-item":!0})}
|
|
3128
|
+
data-initiative=${s.id}
|
|
3129
|
+
@click=${this.onSelectInitiative}
|
|
3130
|
+
>
|
|
3131
|
+
<div class="m-top">
|
|
3132
|
+
<span class="m-title">${s.title}</span>
|
|
3133
|
+
<span class=${`badge ${t.badgeTone(s.status)}`}>${s.status}</span>
|
|
3134
|
+
</div>
|
|
3135
|
+
<div class="m-meta">
|
|
3136
|
+
<span><b>${e.completedIssueCount}/${e.issueCount}</b> issues</span>
|
|
3137
|
+
</div>
|
|
3138
|
+
<div class="miniprog"><span style=${`width:${i}%`}></span></div>
|
|
3139
|
+
</button>
|
|
3140
|
+
`}renderEpicInitiativeGroup(e){const t=this.store.isEpicExpanded(e.epic.id),s=e.epic.id==="EPIC0"?"Uncategorized work":e.epic.title,i=e.initiatives.filter(a=>this.store.isDoneStatus(a.initiative.status)).length,r=e.initiatives.length>0?Math.round(i/e.initiatives.length*100):0;return h`
|
|
3141
|
+
<section
|
|
3142
|
+
class="epic-group"
|
|
3143
|
+
data-epic=${e.epic.id}
|
|
3144
|
+
>
|
|
3145
|
+
<button
|
|
3146
|
+
aria-expanded=${String(t)}
|
|
3147
|
+
class="epic-group-head"
|
|
3148
|
+
data-epic-toggle=${e.epic.id}
|
|
3149
|
+
@click=${this.onToggleEpic}
|
|
3150
|
+
>
|
|
3151
|
+
<h2>${s}</h2>
|
|
3152
|
+
<span>${e.initiatives.length} initiatives</span>
|
|
3153
|
+
<span>${i}/${e.initiatives.length} completed</span>
|
|
3154
|
+
</button>
|
|
3155
|
+
<div
|
|
3156
|
+
aria-label=${`${r}% of ${s} initiatives completed`}
|
|
3157
|
+
class="epic-progress"
|
|
3158
|
+
role="progressbar"
|
|
3159
|
+
aria-valuemax="100"
|
|
3160
|
+
aria-valuemin="0"
|
|
3161
|
+
aria-valuenow=${String(r)}
|
|
3162
|
+
>
|
|
3163
|
+
<span style=${`width:${r}%`}></span>
|
|
3164
|
+
</div>
|
|
3165
|
+
${w(t,()=>h`
|
|
3166
|
+
<div class="epic-group-items">
|
|
3167
|
+
${D(e.initiatives,a=>a.initiative.id,a=>this.renderInitiativeCard(a))}
|
|
3168
|
+
</div>
|
|
3169
|
+
`,()=>k)}
|
|
3170
|
+
</section>
|
|
3171
|
+
`}renderAdrCard(e){const t=this.store,s=e.adr;return h`
|
|
3172
|
+
<button
|
|
3173
|
+
class=${Y({active:t.selectedId.get()===s.id,"m-item":!0})}
|
|
3174
|
+
data-id=${s.id}
|
|
3175
|
+
data-scope=${e.scope}
|
|
3176
|
+
@click=${this.onSelectEntity}
|
|
3177
|
+
>
|
|
3178
|
+
<div class="m-top">
|
|
3179
|
+
<span class="m-title">${s.title}</span>
|
|
3180
|
+
<span class=${`badge ${t.badgeTone(s.status)}`}>${s.status}</span>
|
|
3181
|
+
</div>
|
|
3182
|
+
<div class="m-meta">
|
|
3183
|
+
<span class="idtag">${t.shortRef(s)}</span>
|
|
3184
|
+
<span>${e.scopeLabel}</span>
|
|
3185
|
+
<span>updated ${t.formatTimestamp(s.updatedAt)}</span>
|
|
3186
|
+
</div>
|
|
3187
|
+
</button>
|
|
3188
|
+
`}renderDebtCard(e){const t=this.store;return h`
|
|
3189
|
+
<button
|
|
3190
|
+
class=${Y({active:t.selectedId.get()===e.id,"m-item":!0})}
|
|
3191
|
+
data-id=${e.id}
|
|
3192
|
+
@click=${this.onSelectEntity}
|
|
3193
|
+
>
|
|
3194
|
+
<div class="m-top">
|
|
3195
|
+
<span class="m-title">${e.title}</span>
|
|
3196
|
+
<span class=${`badge ${t.badgeTone(e.status)}`}>${e.status}</span>
|
|
3197
|
+
</div>
|
|
3198
|
+
<div class="m-meta">
|
|
3199
|
+
<span class="idtag">${t.shortRef(e)}</span>
|
|
3200
|
+
<span>${e.category??"uncategorized"}</span>
|
|
3201
|
+
<span>${e.priority??"no priority"}</span>
|
|
3202
|
+
<span>updated ${t.formatTimestamp(e.updatedAt)}</span>
|
|
3203
|
+
</div>
|
|
3204
|
+
</button>
|
|
3205
|
+
`}renderDebtFilter(e,t,s,i){return h`
|
|
3206
|
+
<div
|
|
3207
|
+
aria-label=${`Filter debt by ${t.toLowerCase()}`}
|
|
3208
|
+
class="master-status-filters"
|
|
3209
|
+
role="group"
|
|
3210
|
+
>
|
|
3211
|
+
<span class="master-filter-label">${t}</span>
|
|
3212
|
+
${D(["all",...s],r=>r,r=>h`
|
|
3213
|
+
<button
|
|
3214
|
+
aria-pressed=${this.toAriaBoolean(i===r)}
|
|
3215
|
+
class=${Y({active:i===r,"master-status-chip":!0})}
|
|
3216
|
+
data-debt-filter=${e}
|
|
3217
|
+
data-debt-value=${r}
|
|
3218
|
+
@click=${this.onSetDebtFilter}
|
|
3219
|
+
>
|
|
3220
|
+
${this.formatStatusFilter(r)}
|
|
3221
|
+
</button>
|
|
3222
|
+
`)}
|
|
3223
|
+
</div>
|
|
3224
|
+
`}renderProjectContextSource(e){const t=e.scopeKind==="default"?"Shared context":e.scopeLabel;return h`
|
|
3225
|
+
<div
|
|
3226
|
+
class="ctx-source"
|
|
3227
|
+
data-scope=${e.scopeKind}
|
|
3228
|
+
>
|
|
3229
|
+
<div class="ctx-source-head">
|
|
3230
|
+
<span class="ctx-scope">${t}</span>
|
|
3231
|
+
<span class="ctx-source-title">${e.contextTitle}</span>
|
|
3232
|
+
</div>
|
|
3233
|
+
<p class="ctx-def">${e.definition}</p>
|
|
3234
|
+
${w(e.avoid.length>0,()=>h`
|
|
3235
|
+
<div class="ctx-avoid">
|
|
3236
|
+
<span class="ctx-avoid-label">Avoid</span>
|
|
3237
|
+
${D(e.avoid,s=>s,s=>h`<span class="ctx-avoid-chip">${s}</span>`)}
|
|
3238
|
+
</div>
|
|
3239
|
+
`,()=>k)}
|
|
3240
|
+
</div>
|
|
3241
|
+
`}renderProjectContextTerm(e){const t=e.hasConflictingDefinitions?`conflicting definitions across ${e.sources.length} scopes`:`defined in ${e.sources.length} scopes`;return h`
|
|
3242
|
+
<article
|
|
3243
|
+
class="ctx-term"
|
|
3244
|
+
data-term=${e.term}
|
|
3245
|
+
tabindex="-1"
|
|
3246
|
+
>
|
|
3247
|
+
<div class="ctx-top">
|
|
3248
|
+
<span class="ctx-name">${e.term}</span>
|
|
3249
|
+
${w(e.hasSharedSource,()=>h`<span class="ctx-badge shared">shared</span>`,()=>k)}
|
|
3250
|
+
${w(e.hasDuplicates,()=>h`<span class="ctx-badge warn">${t}</span>`,()=>k)}
|
|
3251
|
+
</div>
|
|
3252
|
+
<div class="ctx-sources">
|
|
3253
|
+
${D(e.sources,s=>`${s.contextKey}:${s.scopeLabel}`,s=>this.renderProjectContextSource(s))}
|
|
3254
|
+
</div>
|
|
3255
|
+
</article>
|
|
3256
|
+
`}renderSharedContextPanel(){const e=this.store.selectedNestedTarget.get(),t=e?.type==="context-term"&&!e.scopeRef?e.id:null;return h`
|
|
3257
|
+
<section class="ctx-block">
|
|
3258
|
+
<div class="ctx-section-head">
|
|
3259
|
+
<div>
|
|
3260
|
+
<h2 class="ctx-section-title">Shared context</h2>
|
|
3261
|
+
<p class="ctx-section-copy">Project-canonical terms and preferred language that should be safe anywhere in this tenant.</p>
|
|
3262
|
+
</div>
|
|
3263
|
+
</div>
|
|
3264
|
+
<div
|
|
3265
|
+
class="ctx-context-summary"
|
|
3266
|
+
data-context-scope="shared"
|
|
3267
|
+
tabindex="-1"
|
|
3268
|
+
>
|
|
3269
|
+
<agent-issues-context-view
|
|
3270
|
+
.context=${this.store.filteredSharedContext.get()}
|
|
3271
|
+
.emptyMessage=${"No shared context matches the current search."}
|
|
3272
|
+
.targetTerm=${t}
|
|
3273
|
+
></agent-issues-context-view>
|
|
3274
|
+
</div>
|
|
3275
|
+
</section>
|
|
3276
|
+
`}renderInitiativeContextIndexPanel(e=!1){const t=this.store,s=e?t.filteredInitiativeContextTerms.get():t.filteredProjectContextTerms.get(),i=s.length,r=t.projectContextDuplicateCount.get(),a=t.projectInitiatives.get(),o=a.length,l=t.selectedContextInitiativeId.get(),u=l?t.getContextForInitiative(l):null,p=[`${i} discovered terms`,`${o} initiative contexts`,r>0?`${r} duplicate labels`:null].filter(d=>!!d).join(" · ");return h`
|
|
3277
|
+
<section class="ctx-block">
|
|
3278
|
+
<div class="ctx-section-head">
|
|
3279
|
+
<div>
|
|
3280
|
+
<h2 class="ctx-section-title">Initiative term index</h2>
|
|
3281
|
+
<p class="ctx-section-copy">Discover initiative-local terminology without flattening it into project-canonical language.</p>
|
|
3282
|
+
</div>
|
|
3283
|
+
<div class="ctx-stats">${p}</div>
|
|
3284
|
+
</div>
|
|
3285
|
+
${w(e,()=>h`
|
|
3286
|
+
<div
|
|
3287
|
+
aria-label="Filter initiative context"
|
|
3288
|
+
class="ctx-initiative-tabs"
|
|
3289
|
+
role="tablist"
|
|
3290
|
+
>
|
|
3291
|
+
<button
|
|
3292
|
+
aria-selected=${this.toAriaBoolean(l===null)}
|
|
3293
|
+
class=${Y({active:l===null,"ctx-initiative-tab":!0})}
|
|
3294
|
+
role="tab"
|
|
3295
|
+
@click=${this.onSetContextInitiativeFilter}
|
|
3296
|
+
>
|
|
3297
|
+
All initiatives
|
|
3298
|
+
</button>
|
|
3299
|
+
${D(a,d=>d.initiative.id,d=>h`
|
|
3300
|
+
<button
|
|
3301
|
+
aria-selected=${this.toAriaBoolean(l===d.initiative.id)}
|
|
3302
|
+
class=${Y({active:l===d.initiative.id,"ctx-initiative-tab":!0})}
|
|
3303
|
+
data-context-initiative=${d.initiative.id}
|
|
3304
|
+
role="tab"
|
|
3305
|
+
@click=${this.onSetContextInitiativeFilter}
|
|
3306
|
+
>
|
|
3307
|
+
${d.initiative.title}
|
|
3308
|
+
</button>
|
|
3309
|
+
`)}
|
|
3310
|
+
</div>
|
|
3311
|
+
`,()=>k)}
|
|
3312
|
+
${w(u!==null,()=>{const d=u;return d?h`
|
|
3313
|
+
<div
|
|
3314
|
+
class="ctx-context-summary"
|
|
3315
|
+
data-context-scope=${d.context.scopeEntityId??d.context.key}
|
|
3316
|
+
tabindex="-1"
|
|
3317
|
+
>
|
|
3318
|
+
<h3 class="ctx-context-title">${d.context.title}</h3>
|
|
3319
|
+
<p class="ctx-context-copy">${d.context.summary}</p>
|
|
3320
|
+
</div>
|
|
3321
|
+
`:k},()=>k)}
|
|
3322
|
+
${w(s.length>0,()=>h`
|
|
3323
|
+
<div class="ctx-list">
|
|
3324
|
+
${D(s,d=>d.term,d=>this.renderProjectContextTerm(d))}
|
|
3325
|
+
</div>
|
|
3326
|
+
`,()=>h`<p class="ctx-empty">No initiative-scoped terms match the current search.</p>`)}
|
|
3327
|
+
</section>
|
|
3328
|
+
`}renderMaster(){const e=this.store,t=e.activeSection.get(),s=e.search.get().trim().toLowerCase(),i=t==="adrs",r=t==="debt",a=i?"adrs":"initiatives",o=i?e.adrStatusFilter.get():e.initiativeStatusFilter.get(),l=i?e.adrRailEntries.get().map(x=>x.adr.status):e.projectSummaryInitiatives.get().map(x=>x.initiative.status),u=["all",...new Set(l)].sort((x,R)=>x==="all"?-1:R==="all"?1:x.localeCompare(R)),p=e.projectSummaryEpicGroups.get().map(x=>({...x,initiatives:x.initiatives.filter(R=>(o==="all"||R.initiative.status===o)&&`${R.initiative.title} ${R.initiative.id}`.toLowerCase().includes(s))})).filter(x=>x.initiatives.length>0),d=e.adrRailEntries.get().filter(x=>(o==="all"||x.adr.status===o)&&`${x.adr.title} ${x.adr.id}`.toLowerCase().includes(s)),g=e.allDebtRecords.get(),v=e.debtRecords.get().filter(x=>`${x.title} ${x.id} ${x.category??""} ${x.priority??""}`.toLowerCase().includes(s)),y=[...new Set(g.map(x=>x.category).filter(x=>!!x))].sort(),L=[...new Set(g.map(x=>x.priority).filter(x=>!!x))].sort(),O=[...new Set(g.map(x=>x.status))].sort(),I=this.renderSectionFeedback(t);return h`
|
|
3329
|
+
<section class="master" data-pane="master">
|
|
3330
|
+
<button
|
|
3331
|
+
class="pane-collapse"
|
|
3332
|
+
data-collapse="master"
|
|
3333
|
+
title=${e.masterCollapsed.get()?"Expand list":"Collapse list"}
|
|
3334
|
+
@click=${this.onToggleMaster}
|
|
3335
|
+
>
|
|
3336
|
+
${e.masterCollapsed.get()?"»":"«"}
|
|
3337
|
+
</button>
|
|
3338
|
+
<div class="master-head">
|
|
3339
|
+
<h1>${et(t,[["adrs",()=>h`Architecture decisions`],["debt",()=>h`Debt records`]],()=>h`Initiatives`)}</h1>
|
|
3340
|
+
<p>${w(r,()=>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>
|
|
3341
|
+
<input
|
|
3342
|
+
class="master-search"
|
|
3343
|
+
placeholder="Filter…"
|
|
3344
|
+
.value=${e.search.get()}
|
|
3345
|
+
@input=${this.onSearchInput}
|
|
3346
|
+
/>
|
|
3347
|
+
${w(r,()=>h`
|
|
3348
|
+
${this.renderDebtFilter("lifecycle","Lifecycle",O,e.debtLifecycleFilter.get())}
|
|
3349
|
+
${this.renderDebtFilter("category","Category",y,e.debtCategoryFilter.get())}
|
|
3350
|
+
${this.renderDebtFilter("priority","Priority",L,e.debtPriorityFilter.get())}
|
|
3351
|
+
`,()=>h`
|
|
3352
|
+
<div
|
|
3353
|
+
aria-label=${`Filter ${i?"ADRs":"initiatives"} by status`}
|
|
3354
|
+
class="master-status-filters"
|
|
3355
|
+
role="group"
|
|
3356
|
+
>
|
|
3357
|
+
${D(u,x=>x,x=>h`
|
|
3358
|
+
<button
|
|
3359
|
+
aria-pressed=${this.toAriaBoolean(o===x)}
|
|
3360
|
+
class=${Y({active:o===x,"master-status-chip":!0})}
|
|
3361
|
+
data-master-section=${a}
|
|
3362
|
+
data-master-status=${x}
|
|
3363
|
+
@click=${this.onSetMasterStatusFilter}
|
|
3364
|
+
>
|
|
3365
|
+
${this.formatStatusFilter(x)}
|
|
3366
|
+
</button>
|
|
3367
|
+
`)}
|
|
3368
|
+
</div>
|
|
3369
|
+
`)}
|
|
3370
|
+
</div>
|
|
3371
|
+
${I}
|
|
3372
|
+
<div class="master-list">
|
|
3373
|
+
${et(t,[["adrs",()=>h`${D(d,x=>x.adr.id,x=>this.renderAdrCard(x))}`],["debt",()=>h`${D(v,x=>x.id,x=>this.renderDebtCard(x))}`]],()=>h`${D(p,x=>x.epic.id,x=>this.renderEpicInitiativeGroup(x))}`)}
|
|
3374
|
+
</div>
|
|
3375
|
+
</section>
|
|
3376
|
+
`}renderSectionFeedback(e){const t=e==="adrs"?this.store.projectAdrsCache.get():e==="debt"?this.store.projectDebtCache.get():e==="context"?this.store.projectContextCache.get():e==="graph"?this.store.projectGraphCache.get():null;return t?t.error?h`
|
|
3377
|
+
<div class="project-state unavailable">
|
|
3378
|
+
Could not refresh this section.
|
|
3379
|
+
<button
|
|
3380
|
+
data-section=${e}
|
|
3381
|
+
@click=${this.onRetryProjectSection}
|
|
3382
|
+
>
|
|
3383
|
+
Retry
|
|
3384
|
+
</button>
|
|
3385
|
+
</div>
|
|
3386
|
+
`:t.loading?h`<div class="project-state">Loading section...</div>`:k:k}renderDetail(){const e=this.store,t=e.activeSection.get(),s=e.selectedInitiativeId.get(),i=e.selectedId.get();if(t==="context"){const r=e.sharedContext.get(),a=e.contextTab.get(),o={all:"Search all context…",global:"Search shared context…",initiatives:"Search initiative terminology…"}[a];return h`
|
|
3387
|
+
<section class="detail" data-pane="detail">
|
|
3388
|
+
<div class="detail-inner wide-inner">
|
|
3389
|
+
<div class="ai-crumbs">${e.selectedTenantDisplayName.get()} · Context</div>
|
|
3390
|
+
<h1 class="d-title">${r?.context.title??"Project context"}</h1>
|
|
3391
|
+
<p class="d-sub">Shared glossary plus initiative-scoped term discovery, with scope preserved so local language stays findable without becoming silently global.</p>
|
|
3392
|
+
${this.renderSectionFeedback("context")}
|
|
3393
|
+
<div class="ctx-controls">
|
|
3394
|
+
<input
|
|
3395
|
+
class="master-search"
|
|
3396
|
+
placeholder=${o}
|
|
3397
|
+
.value=${e.contextSearch.get()}
|
|
3398
|
+
@input=${this.onContextSearchInput}
|
|
3399
|
+
/>
|
|
3400
|
+
<div class="ctx-tabs">
|
|
3401
|
+
${D([{label:"All",tab:"all"},{label:"Global",tab:"global"},{label:"Initiatives",tab:"initiatives"}],l=>l.tab,l=>h`
|
|
3402
|
+
<button
|
|
3403
|
+
class=${Y({active:a===l.tab,"ctx-tab":!0})}
|
|
3404
|
+
data-context-tab=${l.tab}
|
|
3405
|
+
@click=${this.onSetContextTab}
|
|
3406
|
+
>
|
|
3407
|
+
${l.label}
|
|
3408
|
+
</button>
|
|
3409
|
+
`)}
|
|
3410
|
+
</div>
|
|
3411
|
+
</div>
|
|
3412
|
+
<div class="ctx-shell">
|
|
3413
|
+
${et(a,[["all",()=>h`${this.renderSharedContextPanel()}${this.renderInitiativeContextIndexPanel()}`],["global",()=>h`${this.renderSharedContextPanel()}`],["initiatives",()=>h`${this.renderInitiativeContextIndexPanel(!0)}`]])}
|
|
3414
|
+
</div>
|
|
3415
|
+
</div>
|
|
3416
|
+
</section>
|
|
3417
|
+
`}if(t==="graph"){const r=e.visibleProjectGraphKinds.get();return h`
|
|
3418
|
+
<section class="detail" data-pane="detail">
|
|
3419
|
+
<div class="detail-inner wide-inner">
|
|
3420
|
+
<div class="ai-crumbs">${e.selectedTenantDisplayName.get()} · Graph</div>
|
|
3421
|
+
<h1 class="d-title">Project relationship graph</h1>
|
|
3422
|
+
<p class="d-sub">Project decisions, epics, initiatives, and their PRDs, ADRs, and issues. Click an initiative or record to open it.</p>
|
|
3423
|
+
${this.renderSectionFeedback("graph")}
|
|
3424
|
+
<div class="ai-graph-wrap">
|
|
3425
|
+
<div class="graph-scroll-content">
|
|
3426
|
+
<div class="ai-graph-legend">
|
|
3427
|
+
<agent-issues-relationship-graph-filters
|
|
3428
|
+
.visibleKinds=${r}
|
|
3429
|
+
@graph-kind-toggle=${this.onToggleProjectGraphKind}
|
|
3430
|
+
></agent-issues-relationship-graph-filters>
|
|
3431
|
+
<span class="ai-graph-hint">Tip: hover a node for its full title</span>
|
|
3432
|
+
</div>
|
|
3433
|
+
<div class="graph-host">
|
|
3434
|
+
<agent-issues-relationship-graph
|
|
3435
|
+
.graph=${e.buildProjectGraph()}
|
|
3436
|
+
@node-open=${this.onProjectNodeOpen}
|
|
3437
|
+
></agent-issues-relationship-graph>
|
|
3438
|
+
</div>
|
|
3439
|
+
</div>
|
|
3440
|
+
</div>
|
|
3441
|
+
</div>
|
|
3442
|
+
</section>
|
|
3443
|
+
`}return i?h`
|
|
3444
|
+
<section class="detail" data-pane="detail">
|
|
3445
|
+
<agent-issues-detail-view .store=${e}></agent-issues-detail-view>
|
|
3446
|
+
</section>
|
|
3447
|
+
`:s?h`
|
|
3448
|
+
<section class="detail" data-pane="detail">
|
|
3449
|
+
<agent-issues-initiative-detail-view .store=${e}></agent-issues-initiative-detail-view>
|
|
3450
|
+
</section>
|
|
3451
|
+
`:h`
|
|
3452
|
+
<section class="detail" data-pane="detail">
|
|
3453
|
+
<div class="empty">
|
|
3454
|
+
<div>
|
|
3455
|
+
<div class="empty-glyph">🗂️</div>
|
|
3456
|
+
<p>Select ${w(t==="adrs",()=>h`an ADR`,()=>h`an initiative`)} from the list</p>
|
|
3457
|
+
</div>
|
|
3458
|
+
</div>
|
|
3459
|
+
</section>
|
|
3460
|
+
`}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(),r=!s&&e.masterCollapsed.get(),a=e.selectedId.get()!==null||e.selectedInitiativeId.get()!==null||t==="context"||t==="graph";return h`
|
|
3461
|
+
<div class=${Y({console:!0,"has-detail":a,"master-collapsed":r,medium:this.medium,"mobile-master-open":this.mobileMasterOpen,narrow:this.narrow,"rail-collapsed":i,wide:s})}>
|
|
3462
|
+
${this.renderRail()}
|
|
3463
|
+
${w(!s,()=>this.renderMaster(),()=>k)}
|
|
3464
|
+
${this.renderDetail()}
|
|
3465
|
+
${w(e.globalSearchOpen.get(),()=>h`
|
|
3466
|
+
<agent-issues-global-search-overlay
|
|
3467
|
+
.store=${e}
|
|
3468
|
+
@global-search-close=${this.onCloseGlobalSearch}
|
|
3469
|
+
@global-search-open-target=${this.onOpenGlobalSearchTarget}
|
|
3470
|
+
@global-search-retry=${this.onRetryGlobalSearch}
|
|
3471
|
+
></agent-issues-global-search-overlay>
|
|
3472
|
+
`,()=>k)}
|
|
3473
|
+
</div>
|
|
3474
|
+
`}};_i.styles=[ls,yi,he`
|
|
3475
|
+
:host {
|
|
3476
|
+
display: block;
|
|
3477
|
+
height: 100vh;
|
|
3478
|
+
background: var(--page-bg);
|
|
3479
|
+
color: var(--text);
|
|
3480
|
+
}
|
|
3481
|
+
.console {
|
|
3482
|
+
display: grid;
|
|
3483
|
+
grid-template-columns: 256px 380px 1fr;
|
|
3484
|
+
height: stretch;
|
|
3485
|
+
overflow: hidden;
|
|
3486
|
+
}
|
|
3487
|
+
.console.wide {
|
|
3488
|
+
grid-template-columns: 256px 1fr;
|
|
3489
|
+
}
|
|
3490
|
+
.console.rail-collapsed {
|
|
3491
|
+
grid-template-columns: 44px 380px 1fr;
|
|
3492
|
+
}
|
|
3493
|
+
.console.wide.rail-collapsed {
|
|
3494
|
+
grid-template-columns: 44px 1fr;
|
|
3495
|
+
}
|
|
3496
|
+
.console.master-collapsed {
|
|
3497
|
+
grid-template-columns: 256px 44px 1fr;
|
|
3498
|
+
}
|
|
3499
|
+
.console.rail-collapsed.master-collapsed {
|
|
3500
|
+
grid-template-columns: 44px 44px 1fr;
|
|
3501
|
+
}
|
|
3502
|
+
.console.rail-collapsed .rail-switcher,
|
|
3503
|
+
.console.rail-collapsed .rail-nav,
|
|
3504
|
+
.console.rail-collapsed .rail-foot,
|
|
3505
|
+
.console.master-collapsed .master-head,
|
|
3506
|
+
.console.master-collapsed .master-list {
|
|
3507
|
+
display: none;
|
|
3508
|
+
}
|
|
3509
|
+
.pane-collapse {
|
|
3510
|
+
display: flex;
|
|
3511
|
+
flex-shrink: 0;
|
|
3512
|
+
align-items: center;
|
|
3513
|
+
justify-content: center;
|
|
3514
|
+
align-self: flex-end;
|
|
3515
|
+
width: 24px;
|
|
3516
|
+
height: 24px;
|
|
3517
|
+
margin: 8px;
|
|
3518
|
+
padding: 0;
|
|
3519
|
+
border: 1px solid var(--border);
|
|
3520
|
+
border-radius: 6px;
|
|
3521
|
+
background: var(--surface);
|
|
3522
|
+
color: var(--muted);
|
|
3523
|
+
font-size: 13px;
|
|
3524
|
+
line-height: 1;
|
|
3525
|
+
cursor: pointer;
|
|
3526
|
+
}
|
|
3527
|
+
.pane-collapse:hover {
|
|
3528
|
+
border-color: var(--accent);
|
|
3529
|
+
color: var(--text);
|
|
3530
|
+
}
|
|
3531
|
+
.mobile-master-toggle {
|
|
3532
|
+
display: none;
|
|
3533
|
+
}
|
|
3534
|
+
.console.rail-collapsed .rail .pane-collapse,
|
|
3535
|
+
.console.master-collapsed .master .pane-collapse {
|
|
3536
|
+
align-self: center;
|
|
3537
|
+
}
|
|
3538
|
+
.rail {
|
|
3539
|
+
display: flex;
|
|
3540
|
+
flex-direction: column;
|
|
3541
|
+
overflow: hidden;
|
|
3542
|
+
background: var(--rail-bg);
|
|
3543
|
+
border-right: 1px solid var(--border);
|
|
3544
|
+
}
|
|
3545
|
+
.rail-switcher {
|
|
3546
|
+
position: relative;
|
|
3547
|
+
padding: 12px;
|
|
3548
|
+
border-bottom: 1px solid var(--border-muted);
|
|
3549
|
+
}
|
|
3550
|
+
.global-search-trigger {
|
|
3551
|
+
display: flex;
|
|
3552
|
+
gap: 8px;
|
|
3553
|
+
align-items: center;
|
|
3554
|
+
justify-content: space-between;
|
|
3555
|
+
margin: 0 12px 8px;
|
|
3556
|
+
padding: 8px 10px;
|
|
3557
|
+
border: 1px solid var(--border);
|
|
3558
|
+
border-radius: 6px;
|
|
3559
|
+
background: var(--surface);
|
|
3560
|
+
color: var(--muted);
|
|
3561
|
+
cursor: pointer;
|
|
3562
|
+
font: inherit;
|
|
3563
|
+
font-size: 13px;
|
|
3564
|
+
}
|
|
3565
|
+
.global-search-trigger:hover {
|
|
3566
|
+
border-color: var(--accent);
|
|
3567
|
+
color: var(--text);
|
|
3568
|
+
}
|
|
3569
|
+
.global-search-trigger kbd {
|
|
3570
|
+
padding: 1px 4px;
|
|
3571
|
+
border: 1px solid var(--border-muted);
|
|
3572
|
+
border-radius: 3px;
|
|
3573
|
+
font: inherit;
|
|
3574
|
+
font-size: 11px;
|
|
3575
|
+
}
|
|
3576
|
+
.global-search-icon-trigger {
|
|
3577
|
+
display: none;
|
|
3578
|
+
}
|
|
3579
|
+
.switcher-actions {
|
|
3580
|
+
display: flex;
|
|
3581
|
+
gap: 6px;
|
|
3582
|
+
}
|
|
3583
|
+
.switcher-button {
|
|
3584
|
+
display: flex;
|
|
3585
|
+
flex: 1;
|
|
3586
|
+
gap: 10px;
|
|
3587
|
+
align-items: center;
|
|
3588
|
+
width: stretch;
|
|
3589
|
+
padding: 8px 10px;
|
|
3590
|
+
border: 1px solid var(--border);
|
|
3591
|
+
border-radius: 8px;
|
|
3592
|
+
background: var(--surface);
|
|
3593
|
+
cursor: pointer;
|
|
3594
|
+
text-align: left;
|
|
3595
|
+
anchor-name: --switcher-anchor;
|
|
3596
|
+
}
|
|
3597
|
+
.switcher-button:hover {
|
|
3598
|
+
background: var(--surface-muted);
|
|
3599
|
+
}
|
|
3600
|
+
.switcher-tenant-button {
|
|
3601
|
+
width: 36px;
|
|
3602
|
+
padding: 0;
|
|
3603
|
+
border: 1px solid var(--border);
|
|
3604
|
+
border-radius: 8px;
|
|
3605
|
+
background: var(--surface);
|
|
3606
|
+
color: var(--muted);
|
|
3607
|
+
cursor: pointer;
|
|
3608
|
+
font: inherit;
|
|
3609
|
+
}
|
|
3610
|
+
.switcher-tenant-button:hover {
|
|
3611
|
+
background: var(--surface-muted);
|
|
3612
|
+
color: var(--text);
|
|
3613
|
+
}
|
|
3614
|
+
.avatar {
|
|
3615
|
+
display: grid;
|
|
3616
|
+
flex-shrink: 0;
|
|
3617
|
+
place-items: center;
|
|
3618
|
+
width: 28px;
|
|
3619
|
+
height: 28px;
|
|
3620
|
+
border-radius: 6px;
|
|
3621
|
+
background: linear-gradient(135deg, var(--avatar-start), var(--avatar-end));
|
|
3622
|
+
color: var(--avatar-text);
|
|
3623
|
+
font-size: 13px;
|
|
3624
|
+
font-weight: 700;
|
|
3625
|
+
}
|
|
3626
|
+
.avatar.small {
|
|
3627
|
+
width: 24px;
|
|
3628
|
+
height: 24px;
|
|
3629
|
+
font-size: 11px;
|
|
3630
|
+
}
|
|
3631
|
+
.sw-text {
|
|
3632
|
+
display: grid;
|
|
3633
|
+
}
|
|
3634
|
+
.sw-name {
|
|
3635
|
+
font-weight: 600;
|
|
3636
|
+
}
|
|
3637
|
+
.sw-sub {
|
|
3638
|
+
color: var(--muted);
|
|
3639
|
+
font-size: 12px;
|
|
3640
|
+
}
|
|
3641
|
+
.menu {
|
|
3642
|
+
position: fixed;
|
|
3643
|
+
position-anchor: --switcher-anchor;
|
|
3644
|
+
top: anchor(bottom);
|
|
3645
|
+
left: anchor(left);
|
|
3646
|
+
right: anchor(right);
|
|
3647
|
+
margin: 0;
|
|
3648
|
+
margin-top: 4px;
|
|
3649
|
+
z-index: 40;
|
|
3650
|
+
overflow: hidden;
|
|
3651
|
+
border: 1px solid var(--border);
|
|
3652
|
+
border-radius: 10px;
|
|
3653
|
+
background: var(--surface);
|
|
3654
|
+
box-shadow: 0 12px 28px var(--shadow);
|
|
3655
|
+
}
|
|
3656
|
+
.menu-item {
|
|
3657
|
+
display: flex;
|
|
3658
|
+
gap: 10px;
|
|
3659
|
+
align-items: center;
|
|
3660
|
+
width: stretch;
|
|
3661
|
+
padding: 10px 12px;
|
|
3662
|
+
border: 0;
|
|
3663
|
+
background: transparent;
|
|
3664
|
+
cursor: pointer;
|
|
3665
|
+
text-align: left;
|
|
3666
|
+
}
|
|
3667
|
+
.menu-item:hover {
|
|
3668
|
+
background: var(--surface-muted);
|
|
3669
|
+
}
|
|
3670
|
+
.menu-item .check {
|
|
3671
|
+
width: 14px;
|
|
3672
|
+
color: var(--accent);
|
|
3673
|
+
}
|
|
3674
|
+
.rail-nav {
|
|
3675
|
+
flex: 1;
|
|
3676
|
+
overflow-y: auto;
|
|
3677
|
+
padding: 12px 8px;
|
|
3678
|
+
}
|
|
3679
|
+
.nav-group-label {
|
|
3680
|
+
padding: 8px 12px 4px;
|
|
3681
|
+
color: var(--muted);
|
|
3682
|
+
font-size: 11px;
|
|
3683
|
+
font-weight: 700;
|
|
3684
|
+
letter-spacing: 0.04em;
|
|
3685
|
+
text-transform: uppercase;
|
|
3686
|
+
}
|
|
3687
|
+
.nav-group-label.totals {
|
|
3688
|
+
margin-top: 8px;
|
|
3689
|
+
}
|
|
3690
|
+
.nav-item {
|
|
3691
|
+
display: flex;
|
|
3692
|
+
gap: 10px;
|
|
3693
|
+
align-items: center;
|
|
3694
|
+
width: stretch;
|
|
3695
|
+
padding: 7px 12px;
|
|
3696
|
+
border: 0;
|
|
3697
|
+
border-radius: 6px;
|
|
3698
|
+
background: transparent;
|
|
3699
|
+
color: var(--text);
|
|
3700
|
+
cursor: pointer;
|
|
3701
|
+
text-align: left;
|
|
3702
|
+
}
|
|
3703
|
+
.nav-item:hover {
|
|
3704
|
+
background: var(--surface-muted);
|
|
3705
|
+
}
|
|
3706
|
+
.nav-item.active {
|
|
3707
|
+
background: var(--accent-soft);
|
|
3708
|
+
color: var(--accent);
|
|
3709
|
+
font-weight: 600;
|
|
3710
|
+
}
|
|
3711
|
+
.nav-item.static {
|
|
3712
|
+
color: var(--muted);
|
|
3713
|
+
cursor: default;
|
|
3714
|
+
}
|
|
3715
|
+
.nav-item.static:hover {
|
|
3716
|
+
background: transparent;
|
|
3717
|
+
}
|
|
3718
|
+
.nav-label {
|
|
3719
|
+
flex: 1;
|
|
3720
|
+
}
|
|
3721
|
+
.nav-count {
|
|
3722
|
+
margin-left: auto;
|
|
3723
|
+
color: var(--muted);
|
|
3724
|
+
font-size: 12px;
|
|
3725
|
+
}
|
|
3726
|
+
.nav-item.active .nav-count {
|
|
3727
|
+
color: var(--accent);
|
|
3728
|
+
}
|
|
3729
|
+
.rail-foot {
|
|
3730
|
+
display: flex;
|
|
3731
|
+
gap: 8px;
|
|
3732
|
+
align-items: center;
|
|
3733
|
+
padding: 12px;
|
|
3734
|
+
border-top: 1px solid var(--border-muted);
|
|
3735
|
+
color: var(--muted);
|
|
3736
|
+
font-size: 12px;
|
|
3737
|
+
}
|
|
3738
|
+
.rail-foot-copy {
|
|
3739
|
+
min-width: 0;
|
|
3740
|
+
flex: 1;
|
|
3741
|
+
}
|
|
3742
|
+
.theme-toggle {
|
|
3743
|
+
display: inline-flex;
|
|
3744
|
+
align-items: center;
|
|
3745
|
+
justify-content: center;
|
|
3746
|
+
width: 32px;
|
|
3747
|
+
height: 32px;
|
|
3748
|
+
padding: 0;
|
|
3749
|
+
border: 1px solid var(--border);
|
|
3750
|
+
border-radius: 6px;
|
|
3751
|
+
background: var(--surface);
|
|
3752
|
+
color: var(--text);
|
|
3753
|
+
font: inherit;
|
|
3754
|
+
font-size: 17px;
|
|
3755
|
+
line-height: 1;
|
|
3756
|
+
cursor: pointer;
|
|
3757
|
+
}
|
|
3758
|
+
.theme-toggle:hover,
|
|
3759
|
+
.theme-toggle[aria-pressed="true"] {
|
|
3760
|
+
border-color: var(--accent);
|
|
3761
|
+
background: var(--accent-soft);
|
|
3762
|
+
color: var(--accent);
|
|
3763
|
+
}
|
|
3764
|
+
.header-theme-toggle {
|
|
3765
|
+
display: none;
|
|
3766
|
+
}
|
|
3767
|
+
.master {
|
|
3768
|
+
display: flex;
|
|
3769
|
+
flex-direction: column;
|
|
3770
|
+
overflow: hidden;
|
|
3771
|
+
background: var(--surface);
|
|
3772
|
+
border-right: 1px solid var(--border);
|
|
3773
|
+
}
|
|
3774
|
+
.master-head {
|
|
3775
|
+
padding: 16px;
|
|
3776
|
+
border-bottom: 1px solid var(--border-muted);
|
|
3777
|
+
}
|
|
3778
|
+
.master-head h1 {
|
|
3779
|
+
font-size: 16px;
|
|
3780
|
+
}
|
|
3781
|
+
.master-head p {
|
|
3782
|
+
margin: 4px 0 0;
|
|
3783
|
+
color: var(--muted);
|
|
3784
|
+
font-size: 13px;
|
|
3785
|
+
}
|
|
3786
|
+
.master-search {
|
|
3787
|
+
margin-top: 12px;
|
|
3788
|
+
background: var(--surface-muted);
|
|
3789
|
+
}
|
|
3790
|
+
.master-status-filters {
|
|
3791
|
+
display: flex;
|
|
3792
|
+
gap: 6px;
|
|
3793
|
+
flex-wrap: wrap;
|
|
3794
|
+
margin-top: 10px;
|
|
3795
|
+
}
|
|
3796
|
+
.master-status-chip {
|
|
3797
|
+
padding: 4px 8px;
|
|
3798
|
+
border: 1px solid var(--border);
|
|
3799
|
+
border-radius: 999px;
|
|
3800
|
+
background: var(--surface);
|
|
3801
|
+
color: var(--muted);
|
|
3802
|
+
cursor: pointer;
|
|
3803
|
+
font: inherit;
|
|
3804
|
+
font-size: 12px;
|
|
3805
|
+
}
|
|
3806
|
+
.master-status-chip.active {
|
|
3807
|
+
border-color: var(--accent);
|
|
3808
|
+
background: var(--accent-soft);
|
|
3809
|
+
color: var(--text);
|
|
3810
|
+
font-weight: 600;
|
|
3811
|
+
}
|
|
3812
|
+
.master-list {
|
|
3813
|
+
flex: 1;
|
|
3814
|
+
overflow-y: auto;
|
|
3815
|
+
}
|
|
3816
|
+
.m-item {
|
|
3817
|
+
display: block;
|
|
3818
|
+
width: stretch;
|
|
3819
|
+
padding: 14px 16px;
|
|
3820
|
+
border: 0;
|
|
3821
|
+
border-bottom: 1px solid var(--border-muted);
|
|
3822
|
+
background: transparent;
|
|
3823
|
+
cursor: pointer;
|
|
3824
|
+
text-align: left;
|
|
3825
|
+
}
|
|
3826
|
+
.epic-group + .epic-group {
|
|
3827
|
+
border-top: 1px solid var(--border);
|
|
3828
|
+
}
|
|
3829
|
+
.epic-group-head {
|
|
3830
|
+
display: flex;
|
|
3831
|
+
gap: 8px;
|
|
3832
|
+
align-items: baseline;
|
|
3833
|
+
width: stretch;
|
|
3834
|
+
padding: 12px 16px;
|
|
3835
|
+
border: 0;
|
|
3836
|
+
background: var(--surface-muted);
|
|
3837
|
+
color: var(--muted);
|
|
3838
|
+
cursor: pointer;
|
|
3839
|
+
font: inherit;
|
|
3840
|
+
font-size: 12px;
|
|
3841
|
+
text-align: left;
|
|
3842
|
+
}
|
|
3843
|
+
.epic-group-head:hover {
|
|
3844
|
+
background: var(--accent-soft);
|
|
3845
|
+
}
|
|
3846
|
+
.epic-group-head:focus-visible {
|
|
3847
|
+
outline: 2px solid rgba(9, 105, 218, 0.45);
|
|
3848
|
+
outline-offset: -2px;
|
|
3849
|
+
}
|
|
3850
|
+
.epic-group-head h2 {
|
|
3851
|
+
flex: 1;
|
|
3852
|
+
margin: 0;
|
|
3853
|
+
color: var(--text);
|
|
3854
|
+
font-size: 13px;
|
|
3855
|
+
}
|
|
3856
|
+
.epic-progress {
|
|
3857
|
+
height: 3px;
|
|
3858
|
+
background: var(--border-muted);
|
|
3859
|
+
}
|
|
3860
|
+
.epic-progress span {
|
|
3861
|
+
display: block;
|
|
3862
|
+
height: 100%;
|
|
3863
|
+
background: var(--done);
|
|
3864
|
+
}
|
|
3865
|
+
.m-item:hover {
|
|
3866
|
+
background: var(--surface-muted);
|
|
3867
|
+
}
|
|
3868
|
+
.m-item.active {
|
|
3869
|
+
background: var(--accent-soft);
|
|
3870
|
+
box-shadow: inset 3px 0 0 var(--accent);
|
|
3871
|
+
}
|
|
3872
|
+
.m-top {
|
|
3873
|
+
display: flex;
|
|
3874
|
+
gap: 8px;
|
|
3875
|
+
justify-content: space-between;
|
|
3876
|
+
align-items: center;
|
|
3877
|
+
}
|
|
3878
|
+
.m-title {
|
|
3879
|
+
font-size: 14px;
|
|
3880
|
+
font-weight: 600;
|
|
3881
|
+
}
|
|
3882
|
+
.m-sub {
|
|
3883
|
+
display: -webkit-box;
|
|
3884
|
+
-webkit-line-clamp: 2;
|
|
3885
|
+
-webkit-box-orient: vertical;
|
|
3886
|
+
overflow: hidden;
|
|
3887
|
+
margin-top: 4px;
|
|
3888
|
+
color: var(--muted);
|
|
3889
|
+
font-size: 12px;
|
|
3890
|
+
line-height: 1.4;
|
|
3891
|
+
}
|
|
3892
|
+
.m-meta {
|
|
3893
|
+
display: flex;
|
|
3894
|
+
gap: 10px;
|
|
3895
|
+
margin-top: 8px;
|
|
3896
|
+
color: var(--muted);
|
|
3897
|
+
font-size: 12px;
|
|
3898
|
+
}
|
|
3899
|
+
.m-meta b {
|
|
3900
|
+
color: var(--text);
|
|
3901
|
+
}
|
|
3902
|
+
.idtag {
|
|
3903
|
+
color: var(--muted);
|
|
3904
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
3905
|
+
font-size: 12px;
|
|
3906
|
+
}
|
|
3907
|
+
.miniprog {
|
|
3908
|
+
overflow: hidden;
|
|
3909
|
+
height: 4px;
|
|
3910
|
+
margin-top: 10px;
|
|
3911
|
+
border-radius: 999px;
|
|
3912
|
+
background: #eaeef2;
|
|
3913
|
+
}
|
|
3914
|
+
.miniprog > span {
|
|
3915
|
+
display: block;
|
|
3916
|
+
height: 100%;
|
|
3917
|
+
background: var(--done);
|
|
3918
|
+
}
|
|
3919
|
+
.detail {
|
|
3920
|
+
overflow-y: auto;
|
|
3921
|
+
scrollbar-gutter: stable;
|
|
3922
|
+
}
|
|
3923
|
+
.detail-inner {
|
|
3924
|
+
max-width: 920px;
|
|
3925
|
+
margin: 0 auto;
|
|
3926
|
+
padding: 28px 32px 64px;
|
|
3927
|
+
}
|
|
3928
|
+
.wide-inner {
|
|
3929
|
+
max-width: none;
|
|
3930
|
+
}
|
|
3931
|
+
.ai-crumbs {
|
|
3932
|
+
color: var(--muted);
|
|
3933
|
+
font-size: 12px;
|
|
3934
|
+
}
|
|
3935
|
+
.d-title {
|
|
3936
|
+
margin: 6px 0 0;
|
|
3937
|
+
font-size: 24px;
|
|
3938
|
+
}
|
|
3939
|
+
.d-sub {
|
|
3940
|
+
max-width: 70ch;
|
|
3941
|
+
margin: 10px 0 0;
|
|
3942
|
+
color: var(--muted);
|
|
3943
|
+
}
|
|
3944
|
+
.ctx-controls {
|
|
3945
|
+
display: grid;
|
|
3946
|
+
gap: 14px;
|
|
3947
|
+
margin-top: 18px;
|
|
3948
|
+
}
|
|
3949
|
+
.ctx-tabs {
|
|
3950
|
+
display: flex;
|
|
3951
|
+
gap: 18px;
|
|
3952
|
+
border-bottom: 1px solid var(--border-muted);
|
|
3953
|
+
}
|
|
3954
|
+
.ctx-tab {
|
|
3955
|
+
padding: 8px 2px;
|
|
3956
|
+
border: 0;
|
|
3957
|
+
border-bottom: 2px solid transparent;
|
|
3958
|
+
background: transparent;
|
|
3959
|
+
color: var(--muted);
|
|
3960
|
+
cursor: pointer;
|
|
3961
|
+
font: inherit;
|
|
3962
|
+
}
|
|
3963
|
+
.ctx-tab.active {
|
|
3964
|
+
border-bottom-color: #fd8c73;
|
|
3965
|
+
color: var(--text);
|
|
3966
|
+
font-weight: 600;
|
|
3967
|
+
}
|
|
3968
|
+
.ctx-shell {
|
|
3969
|
+
display: grid;
|
|
3970
|
+
gap: 18px;
|
|
3971
|
+
margin-top: 16px;
|
|
3972
|
+
}
|
|
3973
|
+
.ctx-block {
|
|
3974
|
+
padding: 16px;
|
|
3975
|
+
border: 1px solid var(--border);
|
|
3976
|
+
border-radius: 12px;
|
|
3977
|
+
background: var(--surface);
|
|
3978
|
+
}
|
|
3979
|
+
.ctx-section-head {
|
|
3980
|
+
display: flex;
|
|
3981
|
+
gap: 16px;
|
|
3982
|
+
justify-content: space-between;
|
|
3983
|
+
align-items: baseline;
|
|
3984
|
+
}
|
|
3985
|
+
.ctx-section-title {
|
|
3986
|
+
margin: 0;
|
|
3987
|
+
font-size: 16px;
|
|
3988
|
+
}
|
|
3989
|
+
.ctx-section-copy {
|
|
3990
|
+
margin: 4px 0 0;
|
|
3991
|
+
color: var(--muted);
|
|
3992
|
+
}
|
|
3993
|
+
.ctx-stats {
|
|
3994
|
+
color: var(--muted);
|
|
3995
|
+
font-size: 12px;
|
|
3996
|
+
text-align: right;
|
|
3997
|
+
}
|
|
3998
|
+
.ctx-initiative-tabs {
|
|
3999
|
+
display: flex;
|
|
4000
|
+
gap: 8px;
|
|
4001
|
+
flex-wrap: wrap;
|
|
4002
|
+
margin-top: 16px;
|
|
4003
|
+
}
|
|
4004
|
+
.ctx-initiative-tab {
|
|
4005
|
+
padding: 7px 10px;
|
|
4006
|
+
border: 1px solid var(--border);
|
|
4007
|
+
border-radius: 6px;
|
|
4008
|
+
background: var(--surface);
|
|
4009
|
+
color: var(--text);
|
|
4010
|
+
cursor: pointer;
|
|
4011
|
+
font: inherit;
|
|
4012
|
+
}
|
|
4013
|
+
.ctx-initiative-tab.active {
|
|
4014
|
+
border-color: var(--accent);
|
|
4015
|
+
background: var(--accent-soft);
|
|
4016
|
+
font-weight: 600;
|
|
4017
|
+
}
|
|
4018
|
+
.ctx-list {
|
|
4019
|
+
display: grid;
|
|
4020
|
+
gap: 12px;
|
|
4021
|
+
margin-top: 14px;
|
|
4022
|
+
}
|
|
4023
|
+
.ctx-term {
|
|
4024
|
+
padding: 14px 16px;
|
|
4025
|
+
border: 1px solid var(--border);
|
|
4026
|
+
border-radius: 10px;
|
|
4027
|
+
background: var(--surface-muted);
|
|
4028
|
+
}
|
|
4029
|
+
.ctx-term:focus {
|
|
4030
|
+
outline: 2px solid var(--focus-ring);
|
|
4031
|
+
outline-offset: -2px;
|
|
4032
|
+
}
|
|
4033
|
+
.ctx-term.is-context-term-target {
|
|
4034
|
+
animation: context-term-target 1.8s ease-out;
|
|
4035
|
+
}
|
|
4036
|
+
.ctx-context-summary:focus {
|
|
4037
|
+
outline: 2px solid var(--focus-ring);
|
|
4038
|
+
outline-offset: 4px;
|
|
4039
|
+
}
|
|
4040
|
+
.ctx-context-summary.is-context-target {
|
|
4041
|
+
animation: context-term-target 1.8s ease-out;
|
|
4042
|
+
}
|
|
4043
|
+
@keyframes context-term-target {
|
|
4044
|
+
0% {
|
|
4045
|
+
background: var(--accent-soft);
|
|
4046
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 32%, transparent);
|
|
4047
|
+
}
|
|
4048
|
+
100% {
|
|
4049
|
+
background: var(--surface-muted);
|
|
4050
|
+
box-shadow: 0 0 0 0 transparent;
|
|
4051
|
+
}
|
|
4052
|
+
}
|
|
4053
|
+
@media (prefers-reduced-motion: reduce) {
|
|
4054
|
+
.ctx-context-summary.is-context-target,
|
|
4055
|
+
.ctx-term.is-context-term-target {
|
|
4056
|
+
animation: none;
|
|
4057
|
+
outline: 2px solid var(--focus-ring);
|
|
4058
|
+
}
|
|
4059
|
+
}
|
|
4060
|
+
.ctx-top {
|
|
4061
|
+
display: flex;
|
|
4062
|
+
gap: 8px;
|
|
4063
|
+
align-items: center;
|
|
4064
|
+
flex-wrap: wrap;
|
|
4065
|
+
}
|
|
4066
|
+
.ctx-name {
|
|
4067
|
+
font-size: 16px;
|
|
4068
|
+
font-weight: 600;
|
|
4069
|
+
}
|
|
4070
|
+
.ctx-badge {
|
|
4071
|
+
padding: 2px 8px;
|
|
4072
|
+
border-radius: 999px;
|
|
4073
|
+
font-size: 12px;
|
|
4074
|
+
font-weight: 600;
|
|
4075
|
+
}
|
|
4076
|
+
.ctx-badge.shared {
|
|
4077
|
+
background: #ddf4ff;
|
|
4078
|
+
color: #0969da;
|
|
4079
|
+
}
|
|
4080
|
+
.ctx-badge.warn {
|
|
4081
|
+
background: #fff8c5;
|
|
4082
|
+
color: #9a6700;
|
|
4083
|
+
}
|
|
4084
|
+
.ctx-sources {
|
|
4085
|
+
display: grid;
|
|
4086
|
+
gap: 10px;
|
|
4087
|
+
margin-top: 12px;
|
|
4088
|
+
}
|
|
4089
|
+
.ctx-source {
|
|
4090
|
+
padding-left: 12px;
|
|
4091
|
+
border-left: 3px solid var(--border);
|
|
4092
|
+
}
|
|
4093
|
+
.ctx-source[data-scope="default"] {
|
|
4094
|
+
border-left-color: #0969da;
|
|
4095
|
+
}
|
|
4096
|
+
.ctx-source[data-scope="initiative"] {
|
|
4097
|
+
border-left-color: #1f883d;
|
|
4098
|
+
}
|
|
4099
|
+
.ctx-source-head {
|
|
4100
|
+
display: flex;
|
|
4101
|
+
gap: 8px;
|
|
4102
|
+
align-items: baseline;
|
|
4103
|
+
flex-wrap: wrap;
|
|
4104
|
+
}
|
|
4105
|
+
.ctx-scope {
|
|
4106
|
+
font-weight: 600;
|
|
4107
|
+
}
|
|
4108
|
+
.ctx-source-title {
|
|
4109
|
+
color: var(--muted);
|
|
4110
|
+
font-size: 12px;
|
|
4111
|
+
}
|
|
4112
|
+
.ctx-def {
|
|
4113
|
+
max-width: 75ch;
|
|
4114
|
+
margin: 6px 0 0;
|
|
4115
|
+
}
|
|
4116
|
+
.ctx-avoid {
|
|
4117
|
+
display: flex;
|
|
4118
|
+
gap: 6px;
|
|
4119
|
+
align-items: center;
|
|
4120
|
+
flex-wrap: wrap;
|
|
4121
|
+
margin-top: 8px;
|
|
4122
|
+
}
|
|
4123
|
+
.ctx-avoid-label {
|
|
4124
|
+
color: var(--muted);
|
|
4125
|
+
font-size: 11px;
|
|
4126
|
+
letter-spacing: 0.04em;
|
|
4127
|
+
text-transform: uppercase;
|
|
4128
|
+
}
|
|
4129
|
+
.ctx-avoid-chip {
|
|
4130
|
+
padding: 2px 8px;
|
|
4131
|
+
border: 1px solid var(--border);
|
|
4132
|
+
border-radius: 999px;
|
|
4133
|
+
background: var(--surface);
|
|
4134
|
+
color: var(--muted);
|
|
4135
|
+
font-size: 12px;
|
|
4136
|
+
}
|
|
4137
|
+
.ctx-empty {
|
|
4138
|
+
margin: 14px 0 0;
|
|
4139
|
+
color: var(--muted);
|
|
4140
|
+
}
|
|
4141
|
+
.ai-graph-wrap {
|
|
4142
|
+
margin-top: 18px;
|
|
4143
|
+
border: 1px solid var(--border);
|
|
4144
|
+
border-radius: 10px;
|
|
4145
|
+
background:
|
|
4146
|
+
radial-gradient(circle, rgba(208, 215, 222, 0.5) 1px, transparent 1px) 0 0 / 22px 22px,
|
|
4147
|
+
var(--surface);
|
|
4148
|
+
overflow: auto;
|
|
4149
|
+
}
|
|
4150
|
+
.graph-scroll-content,
|
|
4151
|
+
.graph-host {
|
|
4152
|
+
width: max-content;
|
|
4153
|
+
min-width: 100%;
|
|
4154
|
+
}
|
|
4155
|
+
.ai-graph-legend {
|
|
4156
|
+
display: flex;
|
|
4157
|
+
gap: 16px;
|
|
4158
|
+
flex-wrap: wrap;
|
|
4159
|
+
padding: 10px 14px;
|
|
4160
|
+
border-bottom: 1px solid var(--border-muted);
|
|
4161
|
+
font-size: 12px;
|
|
4162
|
+
color: var(--muted);
|
|
4163
|
+
background: var(--surface);
|
|
4164
|
+
position: sticky;
|
|
4165
|
+
top: 0;
|
|
4166
|
+
z-index: 1;
|
|
4167
|
+
}
|
|
4168
|
+
.ai-graph-hint {
|
|
4169
|
+
margin-left: auto;
|
|
4170
|
+
}
|
|
4171
|
+
.graph-host {
|
|
4172
|
+
padding: 0;
|
|
4173
|
+
}
|
|
4174
|
+
.empty {
|
|
4175
|
+
display: grid;
|
|
4176
|
+
place-items: center;
|
|
4177
|
+
height: stretch;
|
|
4178
|
+
color: var(--muted);
|
|
4179
|
+
text-align: center;
|
|
4180
|
+
}
|
|
4181
|
+
.empty-glyph {
|
|
4182
|
+
font-size: 40px;
|
|
4183
|
+
}
|
|
4184
|
+
.project-chooser {
|
|
4185
|
+
min-height: 100%;
|
|
4186
|
+
overflow-y: auto;
|
|
4187
|
+
background: var(--page-bg);
|
|
4188
|
+
}
|
|
4189
|
+
.project-chooser-inner {
|
|
4190
|
+
max-width: 1040px;
|
|
4191
|
+
margin: 0 auto;
|
|
4192
|
+
padding: 40px 32px 64px;
|
|
4193
|
+
}
|
|
4194
|
+
.project-chooser h1 {
|
|
4195
|
+
margin-top: 6px;
|
|
4196
|
+
font-size: 28px;
|
|
4197
|
+
}
|
|
4198
|
+
.project-chooser-copy {
|
|
4199
|
+
margin: 10px 0 0;
|
|
4200
|
+
color: var(--muted);
|
|
4201
|
+
}
|
|
4202
|
+
.project-grid {
|
|
4203
|
+
display: grid;
|
|
4204
|
+
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
4205
|
+
gap: 12px;
|
|
4206
|
+
margin-top: 24px;
|
|
4207
|
+
}
|
|
4208
|
+
.project-card {
|
|
4209
|
+
display: grid;
|
|
4210
|
+
gap: 16px;
|
|
4211
|
+
min-height: 180px;
|
|
4212
|
+
padding: 18px;
|
|
4213
|
+
border: 1px solid var(--border);
|
|
4214
|
+
border-radius: 8px;
|
|
4215
|
+
background: var(--surface);
|
|
4216
|
+
cursor: pointer;
|
|
4217
|
+
text-align: left;
|
|
4218
|
+
}
|
|
4219
|
+
.project-card:hover {
|
|
4220
|
+
border-color: var(--accent);
|
|
4221
|
+
box-shadow: 0 2px 8px rgba(31, 35, 40, 0.1);
|
|
4222
|
+
}
|
|
4223
|
+
.project-card:focus-visible,
|
|
4224
|
+
.projects-button:focus-visible {
|
|
4225
|
+
outline: 2px solid rgba(9, 105, 218, 0.45);
|
|
4226
|
+
outline-offset: 2px;
|
|
4227
|
+
}
|
|
4228
|
+
.project-card-head {
|
|
4229
|
+
display: flex;
|
|
4230
|
+
gap: 12px;
|
|
4231
|
+
justify-content: space-between;
|
|
4232
|
+
align-items: start;
|
|
4233
|
+
}
|
|
4234
|
+
.project-card h2 {
|
|
4235
|
+
font-size: 16px;
|
|
4236
|
+
}
|
|
4237
|
+
.project-card p {
|
|
4238
|
+
margin: 4px 0 0;
|
|
4239
|
+
color: var(--muted);
|
|
4240
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
4241
|
+
font-size: 12px;
|
|
4242
|
+
}
|
|
4243
|
+
.project-counts {
|
|
4244
|
+
display: flex;
|
|
4245
|
+
gap: 8px;
|
|
4246
|
+
flex-wrap: wrap;
|
|
4247
|
+
color: var(--muted);
|
|
4248
|
+
font-size: 13px;
|
|
4249
|
+
}
|
|
4250
|
+
.project-progress {
|
|
4251
|
+
overflow: hidden;
|
|
4252
|
+
height: 6px;
|
|
4253
|
+
border-radius: 3px;
|
|
4254
|
+
background: var(--border-muted);
|
|
4255
|
+
}
|
|
4256
|
+
.project-progress span {
|
|
4257
|
+
display: block;
|
|
4258
|
+
height: 100%;
|
|
4259
|
+
background: var(--done);
|
|
4260
|
+
}
|
|
4261
|
+
.project-state {
|
|
4262
|
+
max-width: 560px;
|
|
4263
|
+
margin-top: 24px;
|
|
4264
|
+
padding: 18px;
|
|
4265
|
+
border: 1px solid var(--border);
|
|
4266
|
+
border-radius: 8px;
|
|
4267
|
+
background: var(--surface);
|
|
4268
|
+
color: var(--muted);
|
|
4269
|
+
}
|
|
4270
|
+
.project-state.unavailable {
|
|
4271
|
+
border-color: rgba(207, 34, 46, 0.25);
|
|
4272
|
+
background: var(--danger-bg);
|
|
4273
|
+
color: var(--danger);
|
|
4274
|
+
}
|
|
4275
|
+
@media (max-width: 900px) {
|
|
4276
|
+
:host {
|
|
4277
|
+
height: 100dvh;
|
|
4278
|
+
}
|
|
4279
|
+
.console,
|
|
4280
|
+
.console.wide {
|
|
4281
|
+
position: relative;
|
|
4282
|
+
grid-template-columns: minmax(0, 1fr);
|
|
4283
|
+
grid-template-rows: 52px minmax(0, 1fr);
|
|
4284
|
+
height: 100dvh;
|
|
4285
|
+
overflow: hidden;
|
|
4286
|
+
}
|
|
4287
|
+
.console.narrow .rail {
|
|
4288
|
+
grid-column: 1;
|
|
4289
|
+
grid-row: 1;
|
|
4290
|
+
flex-direction: row;
|
|
4291
|
+
align-items: center;
|
|
4292
|
+
border-right: 0;
|
|
4293
|
+
border-bottom: 1px solid var(--border);
|
|
4294
|
+
overflow: hidden;
|
|
4295
|
+
z-index: 10;
|
|
4296
|
+
}
|
|
4297
|
+
.console.narrow .rail .pane-collapse,
|
|
4298
|
+
.console.narrow .rail-foot,
|
|
4299
|
+
.console.narrow .nav-group-label,
|
|
4300
|
+
.console.narrow .nav-item.static,
|
|
4301
|
+
.console.narrow .nav-count,
|
|
4302
|
+
.console.narrow .sw-text,
|
|
4303
|
+
.console.narrow .switcher-tenant-button {
|
|
4304
|
+
display: none;
|
|
4305
|
+
}
|
|
4306
|
+
.mobile-master-toggle {
|
|
4307
|
+
display: inline-flex;
|
|
4308
|
+
flex: 0 0 40px;
|
|
4309
|
+
align-items: center;
|
|
4310
|
+
justify-content: center;
|
|
4311
|
+
align-self: stretch;
|
|
4312
|
+
padding: 0;
|
|
4313
|
+
border: 0;
|
|
4314
|
+
border-right: 1px solid var(--border);
|
|
4315
|
+
background: var(--surface);
|
|
4316
|
+
color: var(--text);
|
|
4317
|
+
font: inherit;
|
|
4318
|
+
font-size: 18px;
|
|
4319
|
+
cursor: pointer;
|
|
4320
|
+
}
|
|
4321
|
+
.mobile-master-toggle[aria-pressed="true"] {
|
|
4322
|
+
background: var(--accent-soft);
|
|
4323
|
+
color: var(--accent);
|
|
4324
|
+
}
|
|
4325
|
+
.console.narrow .rail-switcher {
|
|
4326
|
+
flex: 0 0 auto;
|
|
4327
|
+
padding: 4px 8px;
|
|
4328
|
+
border: 0;
|
|
4329
|
+
}
|
|
4330
|
+
.console.narrow .header-theme-toggle {
|
|
4331
|
+
display: inline-flex;
|
|
4332
|
+
flex: 0 0 40px;
|
|
4333
|
+
align-self: stretch;
|
|
4334
|
+
width: 40px;
|
|
4335
|
+
height: auto;
|
|
4336
|
+
margin-left: auto;
|
|
4337
|
+
border-top: 0;
|
|
4338
|
+
border-right: 0;
|
|
4339
|
+
border-bottom: 0;
|
|
4340
|
+
border-radius: 0;
|
|
4341
|
+
}
|
|
4342
|
+
.console.narrow .global-search-icon-trigger {
|
|
4343
|
+
display: inline-flex;
|
|
4344
|
+
flex: 0 0 40px;
|
|
4345
|
+
align-items: center;
|
|
4346
|
+
justify-content: center;
|
|
4347
|
+
align-self: stretch;
|
|
4348
|
+
width: 40px;
|
|
4349
|
+
padding: 0;
|
|
4350
|
+
border: 0;
|
|
4351
|
+
border-right: 1px solid var(--border);
|
|
4352
|
+
background: var(--surface);
|
|
4353
|
+
color: var(--text);
|
|
4354
|
+
cursor: pointer;
|
|
4355
|
+
font: inherit;
|
|
4356
|
+
font-size: 20px;
|
|
4357
|
+
}
|
|
4358
|
+
.console.narrow .switcher-button {
|
|
4359
|
+
width: 36px;
|
|
4360
|
+
padding: 4px;
|
|
4361
|
+
border: 0;
|
|
4362
|
+
background: transparent;
|
|
4363
|
+
}
|
|
4364
|
+
.console.narrow .rail-nav {
|
|
4365
|
+
display: flex;
|
|
4366
|
+
flex: 1;
|
|
4367
|
+
gap: 2px;
|
|
4368
|
+
align-self: stretch;
|
|
4369
|
+
overflow-x: auto;
|
|
4370
|
+
overflow-y: hidden;
|
|
4371
|
+
padding: 4px;
|
|
4372
|
+
}
|
|
4373
|
+
.console.narrow .nav-item {
|
|
4374
|
+
flex: 0 0 40px;
|
|
4375
|
+
justify-content: center;
|
|
4376
|
+
width: 40px;
|
|
4377
|
+
padding: 0;
|
|
4378
|
+
}
|
|
4379
|
+
.console.narrow .nav-label {
|
|
4380
|
+
display: none;
|
|
4381
|
+
}
|
|
4382
|
+
.console.narrow .master,
|
|
4383
|
+
.console.narrow .detail {
|
|
4384
|
+
grid-column: 1;
|
|
4385
|
+
grid-row: 2;
|
|
4386
|
+
min-height: 0;
|
|
4387
|
+
}
|
|
4388
|
+
.console.narrow .detail {
|
|
4389
|
+
overflow-y: auto;
|
|
4390
|
+
}
|
|
4391
|
+
.console.narrow .master {
|
|
4392
|
+
z-index: 5;
|
|
4393
|
+
border-right: 0;
|
|
4394
|
+
box-shadow: 0 12px 28px rgba(31, 35, 40, 0.18);
|
|
4395
|
+
}
|
|
4396
|
+
.console.narrow.has-detail:not(.mobile-master-open) .master {
|
|
4397
|
+
display: none;
|
|
4398
|
+
}
|
|
4399
|
+
.console.narrow .master .pane-collapse {
|
|
4400
|
+
display: none;
|
|
4401
|
+
}
|
|
4402
|
+
.console.narrow.master-collapsed .master-head,
|
|
4403
|
+
.console.narrow.master-collapsed .master-list {
|
|
4404
|
+
display: block;
|
|
4405
|
+
}
|
|
4406
|
+
.console.narrow .detail-inner {
|
|
4407
|
+
padding: 20px 16px 40px;
|
|
4408
|
+
}
|
|
4409
|
+
.project-chooser-inner {
|
|
4410
|
+
padding: 28px 16px 40px;
|
|
4411
|
+
}
|
|
4412
|
+
}
|
|
4413
|
+
@media (min-width: 901px) and (max-width: 1200px) {
|
|
4414
|
+
.console,
|
|
4415
|
+
.console.wide {
|
|
4416
|
+
grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
|
|
4417
|
+
grid-template-rows: 52px minmax(0, 1fr);
|
|
4418
|
+
}
|
|
4419
|
+
.console.medium.rail-collapsed,
|
|
4420
|
+
.console.medium.master-collapsed,
|
|
4421
|
+
.console.medium.rail-collapsed.master-collapsed {
|
|
4422
|
+
grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
|
|
4423
|
+
}
|
|
4424
|
+
.console.medium .rail {
|
|
4425
|
+
grid-column: 1 / -1;
|
|
4426
|
+
grid-row: 1;
|
|
4427
|
+
flex-direction: row;
|
|
4428
|
+
align-items: center;
|
|
4429
|
+
border-right: 0;
|
|
4430
|
+
border-bottom: 1px solid var(--border);
|
|
4431
|
+
overflow: hidden;
|
|
4432
|
+
}
|
|
4433
|
+
.console.medium .rail .pane-collapse,
|
|
4434
|
+
.console.medium .rail-foot,
|
|
4435
|
+
.console.medium .nav-group-label,
|
|
4436
|
+
.console.medium .nav-item.static,
|
|
4437
|
+
.console.medium .nav-count,
|
|
4438
|
+
.console.medium .sw-text,
|
|
4439
|
+
.console.medium .switcher-tenant-button {
|
|
4440
|
+
display: none;
|
|
4441
|
+
}
|
|
4442
|
+
.console.medium .rail-switcher {
|
|
4443
|
+
flex: 0 0 auto;
|
|
4444
|
+
padding: 4px 8px;
|
|
4445
|
+
border: 0;
|
|
4446
|
+
}
|
|
4447
|
+
.console.medium .switcher-button {
|
|
4448
|
+
width: 36px;
|
|
4449
|
+
padding: 4px;
|
|
4450
|
+
border: 0;
|
|
4451
|
+
background: transparent;
|
|
4452
|
+
}
|
|
4453
|
+
.console.medium .rail-nav {
|
|
4454
|
+
display: flex;
|
|
4455
|
+
flex: 1;
|
|
4456
|
+
gap: 2px;
|
|
4457
|
+
align-self: stretch;
|
|
4458
|
+
overflow-x: auto;
|
|
4459
|
+
overflow-y: hidden;
|
|
4460
|
+
padding: 4px;
|
|
4461
|
+
}
|
|
4462
|
+
.console.medium .nav-item {
|
|
4463
|
+
flex: 0 0 40px;
|
|
4464
|
+
justify-content: center;
|
|
4465
|
+
width: 40px;
|
|
4466
|
+
padding: 0;
|
|
4467
|
+
}
|
|
4468
|
+
.console.medium .nav-label {
|
|
4469
|
+
display: none;
|
|
4470
|
+
}
|
|
4471
|
+
.console.medium .master {
|
|
4472
|
+
grid-column: 1;
|
|
4473
|
+
grid-row: 2;
|
|
4474
|
+
min-height: 0;
|
|
4475
|
+
}
|
|
4476
|
+
.console.medium .detail {
|
|
4477
|
+
grid-column: 2;
|
|
4478
|
+
grid-row: 2;
|
|
4479
|
+
min-width: 0;
|
|
4480
|
+
}
|
|
4481
|
+
.console.medium.wide .detail {
|
|
4482
|
+
grid-column: 1 / -1;
|
|
4483
|
+
}
|
|
4484
|
+
.console.medium .master .pane-collapse {
|
|
4485
|
+
display: none;
|
|
4486
|
+
}
|
|
4487
|
+
.console.medium.rail-collapsed .rail-switcher,
|
|
4488
|
+
.console.medium.rail-collapsed .rail-nav {
|
|
4489
|
+
display: flex;
|
|
4490
|
+
}
|
|
4491
|
+
.console.medium.master-collapsed .master-head,
|
|
4492
|
+
.console.medium.master-collapsed .master-list {
|
|
4493
|
+
display: block;
|
|
4494
|
+
}
|
|
4495
|
+
}
|
|
4496
|
+
`];let ci=_i;customElements.define("agent-issues-app",ci);const ln=document.querySelector("#app");ln&&ln.replaceChildren(document.createElement("agent-issues-app"));
|