beads-ui 0.12.0 → 0.12.1
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/CHANGES.md +17 -0
- package/app/main.bundle.js +203 -203
- package/app/main.bundle.js.map +3 -3
- package/package.json +1 -1
- package/server/cli/commands.js +3 -0
package/app/main.bundle.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),gn=/'/g,mn=/"/g,kn=/^(?:script|style|textarea|title)$/i,Rr=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),E=Rr(1),co=Rr(2),uo=Rr(3),dt=Symbol.for("lit-noChange"),he=Symbol.for("lit-nothing"),bn=new WeakMap,lt=ct.createTreeWalker(ct,129);function _n(r,e){if(!Cr(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return pn!==void 0?pn.createHTML(e):e}var zs=(r,e)=>{let t=r.length-1,s=[],n,i=e===2?"<svg>":e===3?"<math>":"",o=Et;for(let l=0;l<t;l++){let a=r[l],p,f,c=-1,g=0;for(;g<a.length&&(o.lastIndex=g,f=o.exec(a),f!==null);)g=o.lastIndex,o===Et?f[1]==="!--"?o=fn:f[1]!==void 0?o=hn:f[2]!==void 0?(kn.test(f[2])&&(n=RegExp("</"+f[2],"g")),o=at):f[3]!==void 0&&(o=at):o===at?f[0]===">"?(o=n??Et,c=-1):f[1]===void 0?c=-2:(c=o.lastIndex-f[2].length,p=f[1],o=f[3]===void 0?at:f[3]==='"'?mn:gn):o===mn||o===gn?o=at:o===fn||o===hn?o=Et:(o=at,n=void 0);let m=o===at&&r[l+1].startsWith("/>")?" ":"";i+=o===Et?a+Ps:c>=0?(s.push(p),a.slice(0,c)+yn+a.slice(c)+Je+m):a+Je+(c===-2?l:m)}return[_n(r,i+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]},Lt=class r{constructor({strings:e,_$litType$:t},s){let n;this.parts=[];let i=0,o=0,l=e.length-1,a=this.parts,[p,f]=zs(e,t);if(this.el=r.createElement(p,s),lt.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(n=lt.nextNode())!==null&&a.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let c of n.getAttributeNames())if(c.endsWith(yn)){let g=f[o++],m=n.getAttribute(c).split(Je),k=/([.?@])?(.*)/.exec(g);a.push({type:1,index:i,name:k[2],strings:m,ctor:k[1]==="."?Sr:k[1]==="?"?Tr:k[1]==="@"?$r:_t}),n.removeAttribute(c)}else c.startsWith(Je)&&(a.push({type:6,index:i}),n.removeAttribute(c));if(kn.test(n.tagName)){let c=n.textContent.split(Je),g=c.length-1;if(g>0){n.textContent=Jt?Jt.emptyScript:"";for(let m=0;m<g;m++)n.append(c[m],Rt()),lt.nextNode(),a.push({type:2,index:++i});n.append(c[g],Rt())}}}else if(n.nodeType===8)if(n.data===wn)a.push({type:2,index:i});else{let c=-1;for(;(c=n.data.indexOf(Je,c+1))!==-1;)a.push({type:7,index:i}),c+=Je.length-1}i++}}static createElement(e,t){let s=ct.createElement("template");return s.innerHTML=e,s}};function kt(r,e,t=r,s){if(e===dt)return e;let n=s!==void 0?t._$Co?.[s]:t._$Cl,i=It(e)?void 0:e._$litDirective$;return n?.constructor!==i&&(n?._$AO?.(!1),i===void 0?n=void 0:(n=new i(r),n._$AT(r,t,s)),s!==void 0?(t._$Co??(t._$Co=[]))[s]=n:t._$Cl=n),n!==void 0&&(e=kt(r,n._$AS(r,e.values),n,s)),e}var Ar=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){let{el:{content:t},parts:s}=this._$AD,n=(e?.creationScope??ct).importNode(t,!0);lt.currentNode=n;let i=lt.nextNode(),o=0,l=0,a=s[0];for(;a!==void 0;){if(o===a.index){let p;a.type===2?p=new Dt(i,i.nextSibling,this,e):a.type===1?p=new a.ctor(i,a.name,a.strings,this,e):a.type===6&&(p=new Er(i,this,e)),this._$AV.push(p),a=s[++l]}o!==a?.index&&(i=lt.nextNode(),o++)}return lt.currentNode=ct,n}p(e){let t=0;for(let 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++}},Dt=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,s,n){this.type=2,this._$AH=he,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,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=kt(this,e,t),It(e)?e===he||e==null||e===""?(this._$AH!==he&&this._$AR(),this._$AH=he):e!==this._$AH&&e!==dt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Fs(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!==he&&It(this._$AH)?this._$AA.nextSibling.data=e:this.T(ct.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:s}=e,n=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=Lt.createElement(_n(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(t);else{let i=new Ar(n,this),o=i.u(this.options);i.p(t),this.T(o),this._$AH=i}}_$AC(e){let t=bn.get(e.strings);return t===void 0&&bn.set(e.strings,t=new Lt(e)),t}k(e){Cr(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,s,n=0;for(let i of e)n===t.length?t.push(s=new r(this.O(Rt()),this.O(Rt()),this,this.options)):s=t[n],s._$AI(i),n++;n<t.length&&(this._$AR(s&&s._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let s=e.nextSibling;e.remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},_t=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,n,i){this.type=1,this._$AH=he,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=i,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=he}_$AI(e,t=this,s,n){let i=this.strings,o=!1;if(i===void 0)e=kt(this,e,t,0),o=!It(e)||e!==this._$AH&&e!==dt,o&&(this._$AH=e);else{let l=e,a,p;for(e=i[0],a=0;a<i.length-1;a++)p=kt(this,l[s+a],t,a),p===dt&&(p=this._$AH[a]),o||(o=!It(p)||p!==this._$AH[a]),p===he?e=he:e!==he&&(e+=(p??"")+i[a+1]),this._$AH[a]=p}o&&!n&&this.j(e)}j(e){e===he?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Sr=class extends _t{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===he?void 0:e}},Tr=class extends _t{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==he)}},$r=class extends _t{constructor(e,t,s,n,i){super(e,t,s,n,i),this.type=5}_$AI(e,t=this){if((e=kt(this,e,t,0)??he)===dt)return;let s=this._$AH,n=e===he&&s!==he||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,i=e!==he&&(s===he||n);n&&this.element.removeEventListener(this.name,this,s),i&&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)}},Er=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){kt(this,e)}};var Bs=Ct.litHtmlPolyfillSupport;Bs?.(Lt,Dt),(Ct.litHtmlVersions??(Ct.litHtmlVersions=[])).push("3.3.1");var Te=(r,e,t)=>{let s=t?.renderBefore??e,n=s._$litPart$;if(n===void 0){let i=t?.renderBefore??null;s._$litPart$=n=new Dt(e.insertBefore(Rt(),i),i,void 0,t??{})}return n._$AI(r),n};function ze(r,e){let t=r.priority??2,s=e.priority??2;if(t!==s)return t-s;let n=r.created_at??0,i=e.created_at??0;if(n!==i)return n<i?-1:1;let o=r.id,l=e.id;return o<l?-1:o>l?1:0}function vt(r,e){let t=r.closed_at??0,s=e.closed_at??0;if(t!==s)return t<s?1:-1;let n=r?.id,i=e?.id;return n<i?-1:n>i?1:0}function et(r=void 0){function e(i){return!r||typeof r.snapshotFor!="function"?[]:r.snapshotFor(i).slice().sort(ze)}function t(i,o){let l=r&&r.snapshotFor?r.snapshotFor(i).slice():[];return o==="in_progress"?l.sort(ze):o==="closed"?l.sort(vt):l.sort(ze),l}function s(i){if(!r||typeof r.snapshotFor!="function")return[];let l=(r.snapshotFor(`detail:${i}`)||[]).find(p=>String(p?.id||"")===String(i));return(Array.isArray(l?.dependents)?l.dependents:[]).slice().sort(ze)}function n(i){return r&&typeof r.subscribe=="function"?r.subscribe(i):()=>{}}return{selectIssuesFor:e,selectBoardColumn:t,selectEpicChildren:s,subscribe:n}}var $n=Os(Tn(),1);function ae(r){return(0,$n.default)(`beads-ui:${r}`)}function En(r){let e=ae("data");async function t(s){let{id:n}=s;e("updateIssue %s %o",n,Object.keys(s));let i=null;return typeof s.title=="string"&&(i=await r("edit-text",{id:n,field:"title",value:s.title})),typeof s.acceptance=="string"&&(i=await r("edit-text",{id:n,field:"acceptance",value:s.acceptance})),typeof s.notes=="string"&&(i=await r("edit-text",{id:n,field:"notes",value:s.notes})),typeof s.design=="string"&&(i=await r("edit-text",{id:n,field:"design",value:s.design})),typeof s.status=="string"&&(i=await r("update-status",{id:n,status:s.status})),typeof s.priority=="number"&&(i=await r("update-priority",{id:n,priority:s.priority})),typeof s.assignee=="string"&&(i=await r("update-assignee",{id:n,assignee:s.assignee})),e("updateIssue done %s",n),i}return{updateIssue:t}}function Ir(r,e={}){let t=ae(`issue-store:${r}`),s=new Map,n=[],i=0,o=new Set,l=!1,a=e.sort||ze;function p(){for(let g of Array.from(o))try{g()}catch{}}function f(){n=Array.from(s.values()).sort(a)}function c(g){if(l||!g||g.id!==r)return;let m=Number(g.revision)||0;if(t("apply %s rev=%d",g.type,m),!(m<=i&&g.type!=="snapshot")){if(g.type==="snapshot"){if(m<=i)return;s.clear();let k=Array.isArray(g.issues)?g.issues:[];for(let x of k)x&&typeof x.id=="string"&&x.id.length>0&&s.set(x.id,x);f(),i=m,p();return}if(g.type==="upsert"){let k=g.issue;if(k&&typeof k.id=="string"&&k.id.length>0){let x=s.get(k.id);if(!x)s.set(k.id,k);else{let T=Number.isFinite(x.updated_at)?x.updated_at:0,_=Number.isFinite(k.updated_at)?k.updated_at:0;if(T<=_){for(let P of Object.keys(x))P in k||delete x[P];for(let[P,M]of Object.entries(k))x[P]=M}}f()}i=m,p()}else if(g.type==="delete"){let k=String(g.issue_id||"");k&&(s.delete(k),f()),i=m,p()}}}return{id:r,subscribe(g){return o.add(g),()=>{o.delete(g)}},applyPush:c,snapshot(){return n},size(){return s.size},getById(g){return s.get(g)},dispose(){l=!0,s.clear(),n=[],o.clear(),i=0}}}function rr(r){let e=String(r.type||"").trim(),t={};if(r.params&&typeof r.params=="object"){let n=Object.keys(r.params).sort();for(let i of n){let o=r.params[i];t[i]=String(o)}}let s=new URLSearchParams(t).toString();return s.length>0?`${e}?${s}`:e}function Cn(r){let e=ae("subs"),t=new Map,s=new Map;function n(l,a){e("applyDelta %s +%d ~%d -%d",l,(a.added||[]).length,(a.updated||[]).length,(a.removed||[]).length);let p=s.get(l);if(!p||p.size===0)return;let f=Array.isArray(a.added)?a.added:[],c=Array.isArray(a.updated)?a.updated:[],g=Array.isArray(a.removed)?a.removed:[];for(let m of Array.from(p)){let k=t.get(m);if(!k)continue;let x=k.itemsById;for(let T of f)typeof T=="string"&&T.length>0&&x.set(T,!0);for(let T of c)typeof T=="string"&&T.length>0&&x.set(T,!0);for(let T of g)typeof T=="string"&&T.length>0&&x.delete(T)}}async function i(l,a){let p=rr(a);if(e("subscribe %s key=%s",l,p),!t.has(l))t.set(l,{key:p,itemsById:new Map});else{let c=t.get(l);if(c&&c.key!==p){let g=s.get(c.key);g&&(g.delete(l),g.size===0&&s.delete(c.key)),t.set(l,{key:p,itemsById:new Map})}}s.has(p)||s.set(p,new Set);let f=s.get(p);f&&f.add(l);try{await r("subscribe-list",{id:l,type:a.type,params:a.params})}catch(c){let g=t.get(l)||null;if(g){let m=s.get(g.key);m&&(m.delete(l),m.size===0&&s.delete(g.key))}throw t.delete(l),c}return async()=>{e("unsubscribe %s key=%s",l,p);try{await r("unsubscribe-list",{id:l})}catch{}let c=t.get(l)||null;if(c){let g=s.get(c.key);g&&(g.delete(l),g.size===0&&s.delete(c.key))}t.delete(l)}}return{subscribeList:i,_applyDelta:n,_subKeyOf:rr,selectors:{getIds(l){let a=t.get(l);return a?Array.from(a.itemsById.keys()):[]},has(l,a){let p=t.get(l);return p?p.itemsById.has(a):!1},count(l){let a=t.get(l);return a?a.itemsById.size:0},getItemsById(l){let a=t.get(l),p={};if(!a)return p;for(let f of a.itemsById.keys())p[f]=!0;return p}}}}function Rn(){let r=ae("issue-stores"),e=new Map,t=new Map,s=new Set,n=new Map;function i(){for(let a of Array.from(s))try{a()}catch{}}function o(a,p,f){let c=p?rr(p):"",g=t.get(a)||"",m=e.has(a);if(r("register %s key=%s (prev=%s)",a,c,g),m&&g&&c&&g!==c){let k=e.get(a);if(k)try{k.dispose()}catch{}let x=n.get(a);if(x){try{x()}catch{}n.delete(a)}let T=Ir(a,f);e.set(a,T);let _=T.subscribe(()=>i());n.set(a,_)}else if(!m){let k=Ir(a,f);e.set(a,k);let x=k.subscribe(()=>i());n.set(a,x)}return t.set(a,c),()=>l(a)}function l(a){r("unregister %s",a),t.delete(a);let p=e.get(a);p&&(p.dispose(),e.delete(a));let f=n.get(a);if(f){try{f()}catch{}n.delete(a)}}return{register:o,unregister:l,getStore(a){return e.get(a)||null},snapshotFor(a){let p=e.get(a);return p?p.snapshot().slice():[]},subscribe(a){return s.add(a),()=>s.delete(a)}}}function tt(r,e){return`#/${r==="epics"||r==="board"?r:"issues"}?issue=${encodeURIComponent(e)}`}function nr(r){let e=String(r||""),t=e.startsWith("#")?e.slice(1):e,s=t.indexOf("?"),n=s>=0?t.slice(s+1):"";if(n){let l=new URLSearchParams(n).get("issue");if(l)return decodeURIComponent(l)}let i=/^\/issue\/([^\s?#]+)/.exec(t);return i&&i[1]?decodeURIComponent(i[1]):null}function Tt(r){let e=String(r||"");return/^#\/epics(\b|\/|$)/.test(e)?"epics":/^#\/board(\b|\/|$)/.test(e)?"board":"issues"}function In(r){let e=ae("router"),t=()=>{let s=window.location.hash||"",n=/^#\/issue\/([^\s?#]+)/.exec(s);if(n&&n[1]){let l=decodeURIComponent(n[1]);r.setState({selected_id:l,view:"issues"});let a=`#/issues?issue=${encodeURIComponent(l)}`;if(window.location.hash!==a){window.location.hash=a;return}}let i=nr(s),o=Tt(s);e("hash change \u2192 view=%s id=%s",o,i),r.setState({selected_id:i,view:o})};return{start(){window.addEventListener("hashchange",t),t()},stop(){window.removeEventListener("hashchange",t)},gotoIssue(s){let i=(r.getState?r.getState():{view:"issues"}).view||"issues",o=tt(i,s);e("goto issue %s (view=%s)",s,i),window.location.hash!==o?window.location.hash=o:r.setState({selected_id:s,view:i})},gotoView(s){let i=(r.getState?r.getState():{selected_id:null}).selected_id,o=i?tt(s,i):`#/${s}`;e("goto view %s (id=%s)",s,i||""),window.location.hash!==o?window.location.hash=o:r.setState({view:s,selected_id:null})}}}function Ln(r={}){let e=ae("state"),t={selected_id:r.selected_id??null,view:r.view??"issues",filters:{status:r.filters?.status??"all",search:r.filters?.search??"",type:typeof r.filters?.type=="string"?r.filters?.type:""},board:{closed_filter:r.board?.closed_filter==="3"||r.board?.closed_filter==="7"||r.board?.closed_filter==="today"?r.board?.closed_filter:"today"},workspace:{current:r.workspace?.current??null,available:r.workspace?.available??[]}},s=new Set;function n(){for(let i of Array.from(s))try{i(t)}catch{}}return{getState(){return t},setState(i){let o={...t,...i,filters:{...t.filters,...i.filters||{}},board:{...t.board,...i.board||{}},workspace:{current:i.workspace?.current!==void 0?i.workspace.current:t.workspace.current,available:i.workspace?.available!==void 0?i.workspace.available:t.workspace.available}},l=o.workspace.current?.path!==t.workspace.current?.path||o.workspace.available.length!==t.workspace.available.length;o.selected_id===t.selected_id&&o.view===t.view&&o.filters.status===t.filters.status&&o.filters.search===t.filters.search&&o.filters.type===t.filters.type&&o.board.closed_filter===t.board.closed_filter&&!l||(t=o,e("state change %o",{selected_id:t.selected_id,view:t.view,filters:t.filters,board:t.board,workspace:t.workspace.current?.path}),n())},subscribe(i){return s.add(i),()=>s.delete(i)}}}function Dn(r){let e=ae("activity"),t=0,s=new Map,n=1;function i(){if(!r)return;let p=t>0;r.toggleAttribute("hidden",!p),r.setAttribute("aria-busy",p?"true":"false")}function o(){t+=1,e("start count=%d",t),i()}function l(){let p=t;t=Math.max(0,t-1),p<=0?e("done called but count was already %d",p):e("done count=%d\u2192%d",p,t),i()}function a(p){return async(c,g)=>{let m=n++,k=Date.now();s.set(m,{type:c,start_ts:k}),e("request start id=%d type=%s count=%d",m,c,t+1),o();let x=!1,T=()=>{x||(x=!0,s.delete(m),l())},_=setTimeout(()=>{x||(e("request TIMEOUT id=%d type=%s elapsed=%dms",m,c,Date.now()-k),T())},3e4);try{let P=await p(c,g),M=Date.now()-k;return e("request done id=%d type=%s elapsed=%dms",m,c,M),P}catch(P){let M=Date.now()-k;throw e("request error id=%d type=%s elapsed=%dms err=%o",m,c,M,P),P}finally{clearTimeout(_),T()}}}return i(),{wrapSend:a,start:o,done:l,getCount:()=>t,getActiveRequests:()=>{let p=Date.now();return Array.from(s.entries()).map(([f,c])=>({id:f,type:c.type,elapsed_ms:p-c.start_ts}))}}}function ue(r,e="info",t=2800){let s=document.createElement("div");s.className="toast",s.textContent=r,s.style.position="fixed",s.style.right="12px",s.style.bottom="12px",s.style.zIndex="1000",s.style.color="#fff",s.style.padding="8px 10px",s.style.borderRadius="4px",s.style.fontSize="12px",e==="success"?s.style.background="#156d36":e==="error"?s.style.background="#9f2011":s.style.background="rgba(0,0,0,0.85)",(document.body||document.documentElement).appendChild(s),setTimeout(()=>{try{s.remove()}catch{}},t)}function rt(r,e){let t=typeof e?.duration_ms=="number"?e.duration_ms:1200,s=document.createElement("button");s.className=(e?.class_name?e.class_name+" ":"")+"mono id-copy",s.type="button",s.setAttribute("aria-live","polite"),s.setAttribute("title","Copy issue ID"),s.setAttribute("aria-label",`Copy issue ID ${r}`),s.textContent=r;async function n(){try{let i=!1;if(navigator.clipboard&&typeof navigator.clipboard.writeText=="function")await navigator.clipboard.writeText(String(r)),i=!0;else{let o=document.createElement("textarea");o.value=String(r),o.style.position="fixed",o.style.left="-9999px",o.style.opacity="0";let l=s.closest("dialog[open]")||document.body;l.appendChild(o),o.focus(),o.select();try{i=document.execCommand("copy")}finally{l.removeChild(o)}}if(i){s.textContent="Copied";let o=s.getAttribute("aria-label")||"";s.setAttribute("aria-label","Copied"),setTimeout(()=>{s.textContent=r,s.setAttribute("aria-label",o)},Math.max(80,t))}}catch{}}return s.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),n()}),s.addEventListener("keydown",i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),i.stopPropagation(),n())}),s}var nt=["Critical","High","Medium","Low","Backlog"];function Nn(r){let e=typeof r=="number"?r:2,t=document.createElement("span");t.className="priority-badge",t.classList.add(`is-p${Math.max(0,Math.min(4,e))}`),t.setAttribute("role","img");let s=Js(e);return t.setAttribute("title",s),t.setAttribute("aria-label",`Priority: ${s}`),t.textContent=Nt(e)+" "+s,t}function Js(r){let e=Math.max(0,Math.min(4,r));return nt[e]||"Medium"}function Nt(r){switch(r){case 0:return"\u{1F525}";case 1:return"\u26A1\uFE0F";case 2:return"\u{1F527}";case 3:return"\u{1FAB6}";case 4:return"\u{1F4A4}";default:return"\u{1F527}"}}function pt(r){let e=document.createElement("span");e.className="type-badge";let t=(r||"").toString().toLowerCase(),s=new Set(["bug","feature","task","epic","chore"]),n=s.has(t)?t:"neutral";e.classList.add(`type-badge--${n}`),e.setAttribute("role","img");let i=s.has(t)?t==="bug"?"Bug":t==="feature"?"Feature":t==="task"?"Task":t==="epic"?"Epic":"Chore":"\u2014";return e.setAttribute("aria-label",s.has(t)?`Issue type: ${i}`:"Issue type: unknown"),e.setAttribute("title",s.has(t)?`Type: ${i}`:"Type: unknown"),e.textContent=i,e}var ei={"blocked-col":"open","ready-col":"open","in-progress-col":"in_progress","closed-col":"closed"};function Mn(r,e,t,s,n=void 0,i=void 0,o=void 0){let l=ae("views:board"),a=[],p=[],f=[],c=[],g=[],m=i?et(i):null,k="today";if(s)try{let b=s.getState(),v=b&&b.board?String(b.board.closed_filter||"today"):"today";(v==="today"||v==="3"||v==="7")&&(k=v)}catch{}function x(){return E`
|
|
1
|
+
var Rs=Object.create;var Sr=Object.defineProperty;var Is=Object.getOwnPropertyDescriptor;var Ls=Object.getOwnPropertyNames;var Ds=Object.getPrototypeOf,Ns=Object.prototype.hasOwnProperty;var Ms=(r,e,t)=>e in r?Sr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Tr=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Os=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ls(e))!Ns.call(r,n)&&n!==t&&Sr(r,n,{get:()=>e[n],enumerable:!(s=Is(e,n))||s.enumerable});return r};var Ps=(r,e,t)=>(t=r!=null?Rs(Ds(r)):{},Os(e||!r||!r.__esModule?Sr(t,"default",{value:r,enumerable:!0}):t,r));var ae=(r,e,t)=>Ms(r,typeof e!="symbol"?e+"":e,t);var An=Tr((bo,xn)=>{var At=1e3,St=At*60,Tt=St*60,pt=Tt*24,Hs=pt*7,qs=pt*365.25;xn.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return js(r);if(t==="number"&&isFinite(r))return e.long?Gs(r):Ws(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function js(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),s=(e[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"yrs":case"yr":case"y":return t*qs;case"weeks":case"week":case"w":return t*Hs;case"days":case"day":case"d":return t*pt;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Tt;case"minutes":case"minute":case"mins":case"min":case"m":return t*St;case"seconds":case"second":case"secs":case"sec":case"s":return t*At;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Ws(r){var e=Math.abs(r);return e>=pt?Math.round(r/pt)+"d":e>=Tt?Math.round(r/Tt)+"h":e>=St?Math.round(r/St)+"m":e>=At?Math.round(r/At)+"s":r+"ms"}function Gs(r){var e=Math.abs(r);return e>=pt?sr(r,e,pt,"day"):e>=Tt?sr(r,e,Tt,"hour"):e>=St?sr(r,e,St,"minute"):e>=At?sr(r,e,At,"second"):r+" ms"}function sr(r,e,t,s){var n=e>=t*1.5;return Math.round(r/t)+" "+s+(n?"s":"")}});var Tn=Tr((yo,Sn)=>{function Ks(r){t.debug=t,t.default=t,t.coerce=a,t.disable=o,t.enable=n,t.enabled=l,t.humanize=An(),t.destroy=p,Object.keys(r).forEach(f=>{t[f]=r[f]}),t.names=[],t.skips=[],t.formatters={};function e(f){let c=0;for(let g=0;g<f.length;g++)c=(c<<5)-c+f.charCodeAt(g),c|=0;return t.colors[Math.abs(c)%t.colors.length]}t.selectColor=e;function t(f){let c,g=null,m,k;function _(...$){if(!_.enabled)return;let S=_,z=Number(new Date),R=z-(c||z);S.diff=R,S.prev=c,S.curr=z,c=z,$[0]=t.coerce($[0]),typeof $[0]!="string"&&$.unshift("%O");let x=0;$[0]=$[0].replace(/%([a-zA-Z%])/g,(K,oe)=>{if(K==="%%")return"%";x++;let D=t.formatters[oe];if(typeof D=="function"){let q=$[x];K=D.call(S,q),$.splice(x,1),x--}return K}),t.formatArgs.call(S,$),(S.log||t.log).apply(S,$)}return _.namespace=f,_.useColors=t.useColors(),_.color=t.selectColor(f),_.extend=s,_.destroy=t.destroy,Object.defineProperty(_,"enabled",{enumerable:!0,configurable:!1,get:()=>g!==null?g:(m!==t.namespaces&&(m=t.namespaces,k=t.enabled(f)),k),set:$=>{g=$}}),typeof t.init=="function"&&t.init(_),_}function s(f,c){let g=t(this.namespace+(typeof c>"u"?":":c)+f);return g.log=this.log,g}function n(f){t.save(f),t.namespaces=f,t.names=[],t.skips=[];let c=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let g of c)g[0]==="-"?t.skips.push(g.slice(1)):t.names.push(g)}function i(f,c){let g=0,m=0,k=-1,_=0;for(;g<f.length;)if(m<c.length&&(c[m]===f[g]||c[m]==="*"))c[m]==="*"?(k=m,_=g,m++):(g++,m++);else if(k!==-1)m=k+1,_++,g=_;else return!1;for(;m<c.length&&c[m]==="*";)m++;return m===c.length}function o(){let f=[...t.names,...t.skips.map(c=>"-"+c)].join(",");return t.enable(""),f}function l(f){for(let c of t.skips)if(i(f,c))return!1;for(let c of t.names)if(i(f,c))return!0;return!1}function a(f){return f instanceof Error?f.stack||f.message:f}function p(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}Sn.exports=Ks});var $n=Tr((Me,ir)=>{Me.formatArgs=Ys;Me.save=Zs;Me.load=Xs;Me.useColors=Vs;Me.storage=Qs();Me.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Me.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Vs(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let r;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(r[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Ys(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+ir.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,s=0;r[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(t++,n==="%c"&&(s=t))}),r.splice(s,0,e)}Me.log=console.debug||console.log||(()=>{});function Zs(r){try{r?Me.storage.setItem("debug",r):Me.storage.removeItem("debug")}catch{}}function Xs(){let r;try{r=Me.storage.getItem("debug")||Me.storage.getItem("DEBUG")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function Qs(){try{return localStorage}catch{}}ir.exports=Tn()(Me);var{formatters:Js}=ir.exports;Js.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Nt=globalThis,nr=Nt.trustedTypes,fn=nr?nr.createPolicy("lit-html",{createHTML:r=>r}):void 0,wn="$lit$",rt=`lit$${Math.random().toFixed(9).slice(2)}$`,kn="?"+rt,Fs=`<${kn}>`,dt=document,Mt=()=>dt.createComment(""),Ot=r=>r===null||typeof r!="object"&&typeof r!="function",Dr=Array.isArray,zs=r=>Dr(r)||typeof r?.[Symbol.iterator]=="function",$r=`[
|
|
2
|
+
\f\r]`,Dt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,hn=/-->/g,gn=/>/g,lt=RegExp(`>|${$r}(?:([^\\s"'>=/]+)(${$r}*=${$r}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),mn=/'/g,bn=/"/g,_n=/^(?:script|style|textarea|title)$/i,Nr=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),C=Nr(1),uo=Nr(2),po=Nr(3),ut=Symbol.for("lit-noChange"),me=Symbol.for("lit-nothing"),yn=new WeakMap,ct=dt.createTreeWalker(dt,129);function vn(r,e){if(!Dr(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return fn!==void 0?fn.createHTML(e):e}var Bs=(r,e)=>{let t=r.length-1,s=[],n,i=e===2?"<svg>":e===3?"<math>":"",o=Dt;for(let l=0;l<t;l++){let a=r[l],p,f,c=-1,g=0;for(;g<a.length&&(o.lastIndex=g,f=o.exec(a),f!==null);)g=o.lastIndex,o===Dt?f[1]==="!--"?o=hn:f[1]!==void 0?o=gn:f[2]!==void 0?(_n.test(f[2])&&(n=RegExp("</"+f[2],"g")),o=lt):f[3]!==void 0&&(o=lt):o===lt?f[0]===">"?(o=n??Dt,c=-1):f[1]===void 0?c=-2:(c=o.lastIndex-f[2].length,p=f[1],o=f[3]===void 0?lt:f[3]==='"'?bn:mn):o===bn||o===mn?o=lt:o===hn||o===gn?o=Dt:(o=lt,n=void 0);let m=o===lt&&r[l+1].startsWith("/>")?" ":"";i+=o===Dt?a+Fs:c>=0?(s.push(p),a.slice(0,c)+wn+a.slice(c)+rt+m):a+rt+(c===-2?l:m)}return[vn(r,i+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]},Pt=class r{constructor({strings:e,_$litType$:t},s){let n;this.parts=[];let i=0,o=0,l=e.length-1,a=this.parts,[p,f]=Bs(e,t);if(this.el=r.createElement(p,s),ct.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(n=ct.nextNode())!==null&&a.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let c of n.getAttributeNames())if(c.endsWith(wn)){let g=f[o++],m=n.getAttribute(c).split(rt),k=/([.?@])?(.*)/.exec(g);a.push({type:1,index:i,name:k[2],strings:m,ctor:k[1]==="."?Cr:k[1]==="?"?Rr:k[1]==="@"?Ir:vt}),n.removeAttribute(c)}else c.startsWith(rt)&&(a.push({type:6,index:i}),n.removeAttribute(c));if(_n.test(n.tagName)){let c=n.textContent.split(rt),g=c.length-1;if(g>0){n.textContent=nr?nr.emptyScript:"";for(let m=0;m<g;m++)n.append(c[m],Mt()),ct.nextNode(),a.push({type:2,index:++i});n.append(c[g],Mt())}}}else if(n.nodeType===8)if(n.data===kn)a.push({type:2,index:i});else{let c=-1;for(;(c=n.data.indexOf(rt,c+1))!==-1;)a.push({type:7,index:i}),c+=rt.length-1}i++}}static createElement(e,t){let s=dt.createElement("template");return s.innerHTML=e,s}};function _t(r,e,t=r,s){if(e===ut)return e;let n=s!==void 0?t._$Co?.[s]:t._$Cl,i=Ot(e)?void 0:e._$litDirective$;return n?.constructor!==i&&(n?._$AO?.(!1),i===void 0?n=void 0:(n=new i(r),n._$AT(r,t,s)),s!==void 0?(t._$Co??(t._$Co=[]))[s]=n:t._$Cl=n),n!==void 0&&(e=_t(r,n._$AS(r,e.values),n,s)),e}var Er=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){let{el:{content:t},parts:s}=this._$AD,n=(e?.creationScope??dt).importNode(t,!0);ct.currentNode=n;let i=ct.nextNode(),o=0,l=0,a=s[0];for(;a!==void 0;){if(o===a.index){let p;a.type===2?p=new Ft(i,i.nextSibling,this,e):a.type===1?p=new a.ctor(i,a.name,a.strings,this,e):a.type===6&&(p=new Lr(i,this,e)),this._$AV.push(p),a=s[++l]}o!==a?.index&&(i=ct.nextNode(),o++)}return ct.currentNode=dt,n}p(e){let t=0;for(let 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++}},Ft=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,s,n){this.type=2,this._$AH=me,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,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=_t(this,e,t),Ot(e)?e===me||e==null||e===""?(this._$AH!==me&&this._$AR(),this._$AH=me):e!==this._$AH&&e!==ut&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):zs(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!==me&&Ot(this._$AH)?this._$AA.nextSibling.data=e:this.T(dt.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:s}=e,n=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=Pt.createElement(vn(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(t);else{let i=new Er(n,this),o=i.u(this.options);i.p(t),this.T(o),this._$AH=i}}_$AC(e){let t=yn.get(e.strings);return t===void 0&&yn.set(e.strings,t=new Pt(e)),t}k(e){Dr(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,s,n=0;for(let i of e)n===t.length?t.push(s=new r(this.O(Mt()),this.O(Mt()),this,this.options)):s=t[n],s._$AI(i),n++;n<t.length&&(this._$AR(s&&s._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let s=e.nextSibling;e.remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},vt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,n,i){this.type=1,this._$AH=me,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=i,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=me}_$AI(e,t=this,s,n){let i=this.strings,o=!1;if(i===void 0)e=_t(this,e,t,0),o=!Ot(e)||e!==this._$AH&&e!==ut,o&&(this._$AH=e);else{let l=e,a,p;for(e=i[0],a=0;a<i.length-1;a++)p=_t(this,l[s+a],t,a),p===ut&&(p=this._$AH[a]),o||(o=!Ot(p)||p!==this._$AH[a]),p===me?e=me:e!==me&&(e+=(p??"")+i[a+1]),this._$AH[a]=p}o&&!n&&this.j(e)}j(e){e===me?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Cr=class extends vt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===me?void 0:e}},Rr=class extends vt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==me)}},Ir=class extends vt{constructor(e,t,s,n,i){super(e,t,s,n,i),this.type=5}_$AI(e,t=this){if((e=_t(this,e,t,0)??me)===ut)return;let s=this._$AH,n=e===me&&s!==me||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,i=e!==me&&(s===me||n);n&&this.element.removeEventListener(this.name,this,s),i&&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)}},Lr=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){_t(this,e)}};var Us=Nt.litHtmlPolyfillSupport;Us?.(Pt,Ft),(Nt.litHtmlVersions??(Nt.litHtmlVersions=[])).push("3.3.1");var Te=(r,e,t)=>{let s=t?.renderBefore??e,n=s._$litPart$;if(n===void 0){let i=t?.renderBefore??null;s._$litPart$=n=new Ft(e.insertBefore(Mt(),i),i,void 0,t??{})}return n._$AI(r),n};function He(r,e){let t=r.priority??2,s=e.priority??2;if(t!==s)return t-s;let n=r.created_at??0,i=e.created_at??0;if(n!==i)return n<i?-1:1;let o=r.id,l=e.id;return o<l?-1:o>l?1:0}function xt(r,e){let t=r.closed_at??0,s=e.closed_at??0;if(t!==s)return t<s?1:-1;let n=r?.id,i=e?.id;return n<i?-1:n>i?1:0}function nt(r=void 0){function e(i){return!r||typeof r.snapshotFor!="function"?[]:r.snapshotFor(i).slice().sort(He)}function t(i,o){let l=r&&r.snapshotFor?r.snapshotFor(i).slice():[];return o==="in_progress"?l.sort(He):o==="closed"?l.sort(xt):l.sort(He),l}function s(i){if(!r||typeof r.snapshotFor!="function")return[];let l=(r.snapshotFor(`detail:${i}`)||[]).find(p=>String(p?.id||"")===String(i));return(Array.isArray(l?.dependents)?l.dependents:[]).slice().sort(He)}function n(i){return r&&typeof r.subscribe=="function"?r.subscribe(i):()=>{}}return{selectIssuesFor:e,selectBoardColumn:t,selectEpicChildren:s,subscribe:n}}var En=Ps($n(),1);function le(r){return(0,En.default)(`beads-ui:${r}`)}function Cn(r){let e=le("data");async function t(s){let{id:n}=s;e("updateIssue %s %o",n,Object.keys(s));let i=null;return typeof s.title=="string"&&(i=await r("edit-text",{id:n,field:"title",value:s.title})),typeof s.acceptance=="string"&&(i=await r("edit-text",{id:n,field:"acceptance",value:s.acceptance})),typeof s.notes=="string"&&(i=await r("edit-text",{id:n,field:"notes",value:s.notes})),typeof s.design=="string"&&(i=await r("edit-text",{id:n,field:"design",value:s.design})),typeof s.status=="string"&&(i=await r("update-status",{id:n,status:s.status})),typeof s.priority=="number"&&(i=await r("update-priority",{id:n,priority:s.priority})),typeof s.assignee=="string"&&(i=await r("update-assignee",{id:n,assignee:s.assignee})),e("updateIssue done %s",n),i}return{updateIssue:t}}function Rn(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function Mr(r,e={}){let t=le(`issue-store:${r}`),s=new Map,n=[],i=0,o=new Set,l=!1,a=e.sort||He;function p(){for(let g of Array.from(o))try{g()}catch{}}function f(){n=Array.from(s.values()).sort(a)}function c(g){if(l||!g||g.id!==r)return;let m=Number(g.revision)||0;if(t("apply %s rev=%d",g.type,m),!(m<=i&&g.type!=="snapshot")){if(g.type==="snapshot"){if(m<=i)return;s.clear();let k=Array.isArray(g.issues)?g.issues:[];for(let _ of k)_&&typeof _.id=="string"&&_.id.length>0&&s.set(_.id,_);f(),i=m,p();return}if(g.type==="upsert"){let k=g.issue;if(k&&typeof k.id=="string"&&k.id.length>0){let _=s.get(k.id);if(!_)s.set(k.id,k);else{let $=Number.isFinite(_.updated_at)?_.updated_at:0,S=Number.isFinite(k.updated_at)?k.updated_at:0;if($<=S){let R=!Rn(k,"comments")&&Rn(_,"comments"),x=R?_.comments:void 0;for(let M of Object.keys(_))M in k||delete _[M];for(let[M,K]of Object.entries(k))_[M]=K;R&&(_.comments=x)}}f()}i=m,p()}else if(g.type==="delete"){let k=String(g.issue_id||"");k&&(s.delete(k),f()),i=m,p()}}}return{id:r,subscribe(g){return o.add(g),()=>{o.delete(g)}},applyPush:c,snapshot(){return n},size(){return s.size},getById(g){return s.get(g)},dispose(){l=!0,s.clear(),n=[],o.clear(),i=0}}}function or(r){let e=String(r.type||"").trim(),t={};if(r.params&&typeof r.params=="object"){let n=Object.keys(r.params).sort();for(let i of n){let o=r.params[i];t[i]=String(o)}}let s=new URLSearchParams(t).toString();return s.length>0?`${e}?${s}`:e}function In(r){let e=le("subs"),t=new Map,s=new Map;function n(l,a){e("applyDelta %s +%d ~%d -%d",l,(a.added||[]).length,(a.updated||[]).length,(a.removed||[]).length);let p=s.get(l);if(!p||p.size===0)return;let f=Array.isArray(a.added)?a.added:[],c=Array.isArray(a.updated)?a.updated:[],g=Array.isArray(a.removed)?a.removed:[];for(let m of Array.from(p)){let k=t.get(m);if(!k)continue;let _=k.itemsById;for(let $ of f)typeof $=="string"&&$.length>0&&_.set($,!0);for(let $ of c)typeof $=="string"&&$.length>0&&_.set($,!0);for(let $ of g)typeof $=="string"&&$.length>0&&_.delete($)}}async function i(l,a){let p=or(a);if(e("subscribe %s key=%s",l,p),!t.has(l))t.set(l,{key:p,itemsById:new Map});else{let c=t.get(l);if(c&&c.key!==p){let g=s.get(c.key);g&&(g.delete(l),g.size===0&&s.delete(c.key)),t.set(l,{key:p,itemsById:new Map})}}s.has(p)||s.set(p,new Set);let f=s.get(p);f&&f.add(l);try{await r("subscribe-list",{id:l,type:a.type,params:a.params})}catch(c){let g=t.get(l)||null;if(g){let m=s.get(g.key);m&&(m.delete(l),m.size===0&&s.delete(g.key))}throw t.delete(l),c}return async()=>{e("unsubscribe %s key=%s",l,p);try{await r("unsubscribe-list",{id:l})}catch{}let c=t.get(l)||null;if(c){let g=s.get(c.key);g&&(g.delete(l),g.size===0&&s.delete(c.key))}t.delete(l)}}return{subscribeList:i,_applyDelta:n,_subKeyOf:or,selectors:{getIds(l){let a=t.get(l);return a?Array.from(a.itemsById.keys()):[]},has(l,a){let p=t.get(l);return p?p.itemsById.has(a):!1},count(l){let a=t.get(l);return a?a.itemsById.size:0},getItemsById(l){let a=t.get(l),p={};if(!a)return p;for(let f of a.itemsById.keys())p[f]=!0;return p}}}}function Ln(){let r=le("issue-stores"),e=new Map,t=new Map,s=new Set,n=new Map;function i(){for(let a of Array.from(s))try{a()}catch{}}function o(a,p,f){let c=p?or(p):"",g=t.get(a)||"",m=e.has(a);if(r("register %s key=%s (prev=%s)",a,c,g),m&&g&&c&&g!==c){let k=e.get(a);if(k)try{k.dispose()}catch{}let _=n.get(a);if(_){try{_()}catch{}n.delete(a)}let $=Mr(a,f);e.set(a,$);let S=$.subscribe(()=>i());n.set(a,S)}else if(!m){let k=Mr(a,f);e.set(a,k);let _=k.subscribe(()=>i());n.set(a,_)}return t.set(a,c),()=>l(a)}function l(a){r("unregister %s",a),t.delete(a);let p=e.get(a);p&&(p.dispose(),e.delete(a));let f=n.get(a);if(f){try{f()}catch{}n.delete(a)}}return{register:o,unregister:l,getStore(a){return e.get(a)||null},snapshotFor(a){let p=e.get(a);return p?p.snapshot().slice():[]},subscribe(a){return s.add(a),()=>s.delete(a)}}}function st(r,e){return`#/${r==="epics"||r==="board"?r:"issues"}?issue=${encodeURIComponent(e)}`}function ar(r){let e=String(r||""),t=e.startsWith("#")?e.slice(1):e,s=t.indexOf("?"),n=s>=0?t.slice(s+1):"";if(n){let l=new URLSearchParams(n).get("issue");if(l)return decodeURIComponent(l)}let i=/^\/issue\/([^\s?#]+)/.exec(t);return i&&i[1]?decodeURIComponent(i[1]):null}function $t(r){let e=String(r||"");return/^#\/epics(\b|\/|$)/.test(e)?"epics":/^#\/board(\b|\/|$)/.test(e)?"board":"issues"}function Dn(r){let e=le("router"),t=()=>{let s=window.location.hash||"",n=/^#\/issue\/([^\s?#]+)/.exec(s);if(n&&n[1]){let l=decodeURIComponent(n[1]);r.setState({selected_id:l,view:"issues"});let a=`#/issues?issue=${encodeURIComponent(l)}`;if(window.location.hash!==a){window.location.hash=a;return}}let i=ar(s),o=$t(s);e("hash change \u2192 view=%s id=%s",o,i),r.setState({selected_id:i,view:o})};return{start(){window.addEventListener("hashchange",t),t()},stop(){window.removeEventListener("hashchange",t)},gotoIssue(s){let i=(r.getState?r.getState():{view:"issues"}).view||"issues",o=st(i,s);e("goto issue %s (view=%s)",s,i),window.location.hash!==o?window.location.hash=o:r.setState({selected_id:s,view:i})},gotoView(s){let i=(r.getState?r.getState():{selected_id:null}).selected_id,o=i?st(s,i):`#/${s}`;e("goto view %s (id=%s)",s,i||""),window.location.hash!==o?window.location.hash=o:r.setState({view:s,selected_id:null})}}}function Nn(r={}){let e=le("state"),t={selected_id:r.selected_id??null,view:r.view??"issues",filters:{status:r.filters?.status??"all",search:r.filters?.search??"",type:typeof r.filters?.type=="string"?r.filters?.type:""},board:{closed_filter:r.board?.closed_filter==="3"||r.board?.closed_filter==="7"||r.board?.closed_filter==="today"?r.board?.closed_filter:"today"},workspace:{current:r.workspace?.current??null,available:r.workspace?.available??[]}},s=new Set;function n(){for(let i of Array.from(s))try{i(t)}catch{}}return{getState(){return t},setState(i){let o={...t,...i,filters:{...t.filters,...i.filters||{}},board:{...t.board,...i.board||{}},workspace:{current:i.workspace?.current!==void 0?i.workspace.current:t.workspace.current,available:i.workspace?.available!==void 0?i.workspace.available:t.workspace.available}},l=o.workspace.current?.path!==t.workspace.current?.path||o.workspace.available.length!==t.workspace.available.length;o.selected_id===t.selected_id&&o.view===t.view&&o.filters.status===t.filters.status&&o.filters.search===t.filters.search&&o.filters.type===t.filters.type&&o.board.closed_filter===t.board.closed_filter&&!l||(t=o,e("state change %o",{selected_id:t.selected_id,view:t.view,filters:t.filters,board:t.board,workspace:t.workspace.current?.path}),n())},subscribe(i){return s.add(i),()=>s.delete(i)}}}function Mn(r){let e=le("activity"),t=0,s=new Map,n=1;function i(){if(!r)return;let p=t>0;r.toggleAttribute("hidden",!p),r.setAttribute("aria-busy",p?"true":"false")}function o(){t+=1,e("start count=%d",t),i()}function l(){let p=t;t=Math.max(0,t-1),p<=0?e("done called but count was already %d",p):e("done count=%d\u2192%d",p,t),i()}function a(p){return async(c,g)=>{let m=n++,k=Date.now();s.set(m,{type:c,start_ts:k}),e("request start id=%d type=%s count=%d",m,c,t+1),o();let _=!1,$=()=>{_||(_=!0,s.delete(m),l())},S=setTimeout(()=>{_||(e("request TIMEOUT id=%d type=%s elapsed=%dms",m,c,Date.now()-k),$())},3e4);try{let z=await p(c,g),R=Date.now()-k;return e("request done id=%d type=%s elapsed=%dms",m,c,R),z}catch(z){let R=Date.now()-k;throw e("request error id=%d type=%s elapsed=%dms err=%o",m,c,R,z),z}finally{clearTimeout(S),$()}}}return i(),{wrapSend:a,start:o,done:l,getCount:()=>t,getActiveRequests:()=>{let p=Date.now();return Array.from(s.entries()).map(([f,c])=>({id:f,type:c.type,elapsed_ms:p-c.start_ts}))}}}function pe(r,e="info",t=2800){let s=document.createElement("div");s.className="toast",s.textContent=r,s.style.position="fixed",s.style.right="12px",s.style.bottom="12px",s.style.zIndex="1000",s.style.color="#fff",s.style.padding="8px 10px",s.style.borderRadius="4px",s.style.fontSize="12px",e==="success"?s.style.background="#156d36":e==="error"?s.style.background="#9f2011":s.style.background="rgba(0,0,0,0.85)",(document.body||document.documentElement).appendChild(s),setTimeout(()=>{try{s.remove()}catch{}},t)}function it(r,e){let t=typeof e?.duration_ms=="number"?e.duration_ms:1200,s=document.createElement("button");s.className=(e?.class_name?e.class_name+" ":"")+"mono id-copy",s.type="button",s.setAttribute("aria-live","polite"),s.setAttribute("title","Copy issue ID"),s.setAttribute("aria-label",`Copy issue ID ${r}`),s.textContent=r;async function n(){try{let i=!1;if(navigator.clipboard&&typeof navigator.clipboard.writeText=="function")await navigator.clipboard.writeText(String(r)),i=!0;else{let o=document.createElement("textarea");o.value=String(r),o.style.position="fixed",o.style.left="-9999px",o.style.opacity="0";let l=s.closest("dialog[open]")||document.body;l.appendChild(o),o.focus(),o.select();try{i=document.execCommand("copy")}finally{l.removeChild(o)}}if(i){s.textContent="Copied";let o=s.getAttribute("aria-label")||"";s.setAttribute("aria-label","Copied"),setTimeout(()=>{s.textContent=r,s.setAttribute("aria-label",o)},Math.max(80,t))}}catch{}}return s.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),n()}),s.addEventListener("keydown",i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),i.stopPropagation(),n())}),s}var ot=["Critical","High","Medium","Low","Backlog"];function On(r){let e=typeof r=="number"?r:2,t=document.createElement("span");t.className="priority-badge",t.classList.add(`is-p${Math.max(0,Math.min(4,e))}`),t.setAttribute("role","img");let s=ei(e);return t.setAttribute("title",s),t.setAttribute("aria-label",`Priority: ${s}`),t.textContent=zt(e)+" "+s,t}function ei(r){let e=Math.max(0,Math.min(4,r));return ot[e]||"Medium"}function zt(r){switch(r){case 0:return"\u{1F525}";case 1:return"\u26A1\uFE0F";case 2:return"\u{1F527}";case 3:return"\u{1FAB6}";case 4:return"\u{1F4A4}";default:return"\u{1F527}"}}function ft(r){let e=document.createElement("span");e.className="type-badge";let t=(r||"").toString().toLowerCase(),s=new Set(["bug","feature","task","epic","chore"]),n=s.has(t)?t:"neutral";e.classList.add(`type-badge--${n}`),e.setAttribute("role","img");let i=s.has(t)?t==="bug"?"Bug":t==="feature"?"Feature":t==="task"?"Task":t==="epic"?"Epic":"Chore":"\u2014";return e.setAttribute("aria-label",s.has(t)?`Issue type: ${i}`:"Issue type: unknown"),e.setAttribute("title",s.has(t)?`Type: ${i}`:"Type: unknown"),e.textContent=i,e}var ti={"blocked-col":"open","ready-col":"open","in-progress-col":"in_progress","closed-col":"closed"};function Pn(r,e,t,s,n=void 0,i=void 0,o=void 0){let l=le("views:board"),a=[],p=[],f=[],c=[],g=[],m=i?nt(i):null,k="today";if(s)try{let b=s.getState(),v=b&&b.board?String(b.board.closed_filter||"today"):"today";(v==="today"||v==="3"||v==="7")&&(k=v)}catch{}function _(){return C`
|
|
4
4
|
<div class="panel__body board-root">
|
|
5
|
-
${
|
|
6
|
-
${
|
|
7
|
-
${
|
|
8
|
-
${
|
|
5
|
+
${$("Blocked","blocked-col",p)}
|
|
6
|
+
${$("Ready","ready-col",a)}
|
|
7
|
+
${$("In Progress","in-progress-col",f)}
|
|
8
|
+
${$("Closed","closed-col",c)}
|
|
9
9
|
</div>
|
|
10
|
-
`}function
|
|
10
|
+
`}function $(b,v,N){let I=Array.isArray(N)?N.length:0,H=I===1?"1 issue":`${I} issues`;return C`
|
|
11
11
|
<section class="board-column" id=${v}>
|
|
12
12
|
<header
|
|
13
13
|
class="board-column__header"
|
|
@@ -17,16 +17,16 @@ var Cs=Object.create;var _r=Object.defineProperty;var Rs=Object.getOwnPropertyDe
|
|
|
17
17
|
>
|
|
18
18
|
<div class="board-column__title">
|
|
19
19
|
<span class="board-column__title-text">${b}</span>
|
|
20
|
-
<span class="badge board-column__count" aria-label=${
|
|
20
|
+
<span class="badge board-column__count" aria-label=${H}>
|
|
21
21
|
${I}
|
|
22
22
|
</span>
|
|
23
23
|
</div>
|
|
24
|
-
${v==="closed-col"?
|
|
24
|
+
${v==="closed-col"?C`<label class="board-closed-filter">
|
|
25
25
|
<span class="visually-hidden">Filter closed issues</span>
|
|
26
26
|
<select
|
|
27
27
|
id="closed-filter"
|
|
28
28
|
aria-label="Filter closed issues"
|
|
29
|
-
@change=${
|
|
29
|
+
@change=${_e}
|
|
30
30
|
>
|
|
31
31
|
<option
|
|
32
32
|
value="today"
|
|
@@ -48,35 +48,35 @@ var Cs=Object.create;var _r=Object.defineProperty;var Rs=Object.getOwnPropertyDe
|
|
|
48
48
|
role="list"
|
|
49
49
|
aria-labelledby=${v+"-header"}
|
|
50
50
|
>
|
|
51
|
-
${
|
|
51
|
+
${N.map(V=>S(V))}
|
|
52
52
|
</div>
|
|
53
53
|
</section>
|
|
54
|
-
`}function
|
|
54
|
+
`}function S(b){return C`
|
|
55
55
|
<article
|
|
56
56
|
class="board-card"
|
|
57
57
|
data-issue-id=${b.id}
|
|
58
58
|
role="listitem"
|
|
59
59
|
tabindex="-1"
|
|
60
60
|
draggable="true"
|
|
61
|
-
@click=${v=>
|
|
62
|
-
@dragstart=${v=>
|
|
63
|
-
@dragend=${
|
|
61
|
+
@click=${v=>R(v,b.id)}
|
|
62
|
+
@dragstart=${v=>x(v,b.id)}
|
|
63
|
+
@dragend=${M}
|
|
64
64
|
>
|
|
65
65
|
<div class="board-card__title text-truncate">
|
|
66
66
|
${b.title||"(no title)"}
|
|
67
67
|
</div>
|
|
68
68
|
<div class="board-card__meta">
|
|
69
|
-
${
|
|
70
|
-
${
|
|
69
|
+
${ft(b.issue_type)} ${On(b.priority)}
|
|
70
|
+
${it(b.id,{class_name:"mono"})}
|
|
71
71
|
</div>
|
|
72
72
|
</article>
|
|
73
|
-
`}let P=null;function M(b,v){P||t(v)}function A(b,v){P=v,b.dataTransfer&&(b.dataTransfer.setData("text/plain",v),b.dataTransfer.effectAllowed="move"),b.target.classList.add("board-card--dragging"),l("dragstart %s",v)}function O(b){b.target.classList.remove("board-card--dragging"),V(),setTimeout(()=>{P=null},0),l("dragend")}function V(){let b=Array.from(r.querySelectorAll(".board-column--drag-over"));for(let v of b)v.classList.remove("board-column--drag-over")}async function re(b,v){if(!o){l("no transport available, status update skipped"),ue("Cannot update status: not connected","error");return}try{l("update-status %s \u2192 %s",b,v),await o("update-status",{id:b,status:v}),ue("Status updated","success",1500)}catch(D){l("update-status failed: %o",D),ue("Failed to update status","error")}}function L(){Te(x(),r),G()}function G(){try{let b=Array.from(r.querySelectorAll(".board-column"));for(let v of b){let D=v.querySelector(".board-column__body");if(!D)continue;let I=Array.from(D.querySelectorAll(".board-card")),z=v.querySelector(".board-column__header"),Y=z&&z.textContent?.trim()||"";for(let B of I){let J=B.querySelector(".board-card__title"),j=J&&J.textContent?.trim()||"";B.setAttribute("aria-label",`Issue ${j||"(no title)"} \u2014 Column ${Y}`),B.tabIndex=-1}I.length>0&&(I[0].tabIndex=0)}}catch{}}r.addEventListener("keydown",b=>{let v=b.target;if(!v||!(v instanceof HTMLElement))return;let D=String(v.tagName||"").toLowerCase();if(D==="input"||D==="textarea"||D==="select"||v.isContentEditable===!0)return;let I=v.closest(".board-card");if(!I)return;let z=String(b.key||"");if(z==="Enter"||z===" "){b.preventDefault();let le=I.getAttribute("data-issue-id");le&&t(le);return}if(z!=="ArrowUp"&&z!=="ArrowDown"&&z!=="ArrowLeft"&&z!=="ArrowRight")return;b.preventDefault();let Y=I.closest(".board-column");if(!Y)return;let B=Y.querySelector(".board-column__body");if(!B)return;let J=Array.from(B.querySelectorAll(".board-card")),j=J.indexOf(I);if(j!==-1){if(z==="ArrowDown"&&j<J.length-1){ee(J[j],J[j+1]);return}if(z==="ArrowUp"&&j>0){ee(J[j],J[j-1]);return}if(z==="ArrowRight"||z==="ArrowLeft"){let le=Array.from(r.querySelectorAll(".board-column")),X=le.indexOf(Y);if(X===-1)return;let ke=z==="ArrowRight"?1:-1,ve=X+ke,ce=null;for(;ve>=0&&ve<le.length;){let Q=le[ve],fe=Q.querySelector(".board-column__body");if((fe?Array.from(fe.querySelectorAll(".board-card")):[]).length>0){ce=Q;break}ve+=ke}if(ce){let Q=ce.querySelector(".board-column__body .board-card");Q&&ee(I,Q)}return}}});let q=null;r.addEventListener("dragover",b=>{b.preventDefault(),b.dataTransfer&&(b.dataTransfer.dropEffect="move");let D=b.target.closest(".board-column");D&&D!==q&&(q&&q.classList.remove("board-column--drag-over"),D.classList.add("board-column--drag-over"),q=D)}),r.addEventListener("dragleave",b=>{let v=b.relatedTarget;(!v||!r.contains(v))&&q&&(q.classList.remove("board-column--drag-over"),q=null)}),r.addEventListener("drop",b=>{b.preventDefault(),q&&(q.classList.remove("board-column--drag-over"),q=null);let D=b.target.closest(".board-column");if(!D)return;let I=D.id,z=ei[I];if(!z){l("drop on unknown column: %s",I);return}let Y=b.dataTransfer?.getData("text/plain");if(!Y){l("drop without issue id");return}l("drop %s on %s \u2192 %s",Y,I,z),re(Y,z)});function ee(b,v){try{b.tabIndex=-1,v.tabIndex=0,v.focus()}catch{}}function ye(){l("applyClosedFilter %s",k);let b=Array.isArray(g)?[...g]:[],v=new Date,D=0;k==="today"?D=new Date(v.getFullYear(),v.getMonth(),v.getDate(),0,0,0,0).getTime():k==="3"?D=v.getTime()-4320*60*1e3:k==="7"&&(D=v.getTime()-10080*60*1e3),b=b.filter(I=>{let z=Number.isFinite(I.closed_at)?I.closed_at:NaN;return Number.isFinite(z)?z>=D:!1}),b.sort(vt),c=b}function we(b){try{let v=b.target,D=String(v.value||"today");if(k=D==="3"||D==="7"?D:"today",l("closed filter %s",k),s)try{s.setState({board:{closed_filter:k}})}catch{}ye(),L()}catch{}}function w(){try{if(m){let b=m.selectBoardColumn("tab:board:in-progress","in_progress"),v=m.selectBoardColumn("tab:board:blocked","blocked"),D=m.selectBoardColumn("tab:board:ready","ready"),I=m.selectBoardColumn("tab:board:closed","closed"),z=new Set(b.map(B=>B.id));a=D.filter(B=>!z.has(B.id)),p=v,f=b,g=I}ye(),L()}catch{a=[],p=[],f=[],c=[],L()}}return m&&m.subscribe(()=>{try{w()}catch{}}),{async load(){l("load"),w();try{let b=!!(n&&n.selectors),v=Y=>{if(!b||!n)return 0;let B=n.selectors;if(typeof B.count=="function")return Number(B.count(Y)||0);try{let J=B.getIds(Y);return Array.isArray(J)?J.length:0}catch{return 0}},D=v("tab:board:ready")+v("tab:board:blocked")+v("tab:board:in-progress")+v("tab:board:closed"),I=e,z=I&&typeof I.getReady=="function"&&typeof I.getBlocked=="function"&&typeof I.getInProgress=="function"&&typeof I.getClosed=="function";if(D===0&&z){l("fallback fetch");let[Y,B,J,j]=await Promise.all([I.getReady().catch(()=>[]),I.getBlocked().catch(()=>[]),I.getInProgress().catch(()=>[]),I.getClosed().catch(()=>[])]),le=Array.isArray(Y)?Y.map(Q=>Q):[],X=Array.isArray(B)?B.map(Q=>Q):[],ke=Array.isArray(J)?J.map(Q=>Q):[],ve=Array.isArray(j)?j.map(Q=>Q):[],ce=new Set(ke.map(Q=>Q.id));le=le.filter(Q=>!ce.has(Q.id)),le.sort(ze),X.sort(ze),ke.sort(ze),a=le,p=X,f=ke,g=ve,ye(),L()}}catch{}},clear(){r.replaceChildren(),a=[],p=[],f=[],c=[]}}}var{entries:jn,setPrototypeOf:On,isFrozen:ti,getPrototypeOf:ri,getOwnPropertyDescriptor:ni}=Object,{freeze:Re,seal:Pe,create:Fr}=Object,{apply:zr,construct:Br}=typeof Reflect<"u"&&Reflect;Re||(Re=function(e){return e});Pe||(Pe=function(e){return e});zr||(zr=function(e,t){for(var s=arguments.length,n=new Array(s>2?s-2:0),i=2;i<s;i++)n[i-2]=arguments[i];return e.apply(t,n)});Br||(Br=function(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),n=1;n<t;n++)s[n-1]=arguments[n];return new e(...s)});var sr=Ie(Array.prototype.forEach),si=Ie(Array.prototype.lastIndexOf),Pn=Ie(Array.prototype.pop),Mt=Ie(Array.prototype.push),ii=Ie(Array.prototype.splice),or=Ie(String.prototype.toLowerCase),Lr=Ie(String.prototype.toString),Dr=Ie(String.prototype.match),Ot=Ie(String.prototype.replace),oi=Ie(String.prototype.indexOf),ai=Ie(String.prototype.trim),Be=Ie(Object.prototype.hasOwnProperty),Ce=Ie(RegExp.prototype.test),Pt=li(TypeError);function Ie(r){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,s=new Array(t>1?t-1:0),n=1;n<t;n++)s[n-1]=arguments[n];return zr(r,e,s)}}function li(r){return function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return Br(r,t)}}function Z(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:or;On&&On(r,null);let s=e.length;for(;s--;){let n=e[s];if(typeof n=="string"){let i=t(n);i!==n&&(ti(e)||(e[s]=i),n=i)}r[n]=!0}return r}function ci(r){for(let e=0;e<r.length;e++)Be(r,e)||(r[e]=null);return r}function Ye(r){let e=Fr(null);for(let[t,s]of jn(r))Be(r,t)&&(Array.isArray(s)?e[t]=ci(s):s&&typeof s=="object"&&s.constructor===Object?e[t]=Ye(s):e[t]=s);return e}function Ft(r,e){for(;r!==null;){let s=ni(r,e);if(s){if(s.get)return Ie(s.get);if(typeof s.value=="function")return Ie(s.value)}r=ri(r)}function t(){return null}return t}var Fn=Re(["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"]),Nr=Re(["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"]),Mr=Re(["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"]),di=Re(["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"]),Or=Re(["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"]),ui=Re(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),zn=Re(["#text"]),Bn=Re(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","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","slot"]),Pr=Re(["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","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","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-rendering","textlength","type","u1","u2","unicode","values","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"]),Un=Re(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","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"]),ir=Re(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),pi=Pe(/\{\{[\w\W]*|[\w\W]*\}\}/gm),fi=Pe(/<%[\w\W]*|[\w\W]*%>/gm),hi=Pe(/\$\{[\w\W]*/gm),gi=Pe(/^data-[\-\w.\u00B7-\uFFFF]+$/),mi=Pe(/^aria-[\-\w]+$/),Wn=Pe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),bi=Pe(/^(?:\w+script|data):/i),yi=Pe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Gn=Pe(/^html$/i),wi=Pe(/^[a-z][.\w]*(-[.\w]+)+$/i),Hn=Object.freeze({__proto__:null,ARIA_ATTR:mi,ATTR_WHITESPACE:yi,CUSTOM_ELEMENT:wi,DATA_ATTR:gi,DOCTYPE_NAME:Gn,ERB_EXPR:fi,IS_ALLOWED_URI:Wn,IS_SCRIPT_OR_DATA:bi,MUSTACHE_EXPR:pi,TMPLIT_EXPR:hi}),zt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ki=function(){return typeof window>"u"?null:window},_i=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let s=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(s=t.getAttribute(n));let i="dompurify"+(s?"#"+s:"");try{return e.createPolicy(i,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},qn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Kn(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ki(),e=F=>Kn(F);if(e.version="3.3.0",e.removed=[],!r||!r.document||r.document.nodeType!==zt.document||!r.Element)return e.isSupported=!1,e;let{document:t}=r,s=t,n=s.currentScript,{DocumentFragment:i,HTMLTemplateElement:o,Node:l,Element:a,NodeFilter:p,NamedNodeMap:f=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:c,DOMParser:g,trustedTypes:m}=r,k=a.prototype,x=Ft(k,"cloneNode"),T=Ft(k,"remove"),_=Ft(k,"nextSibling"),P=Ft(k,"childNodes"),M=Ft(k,"parentNode");if(typeof o=="function"){let F=t.createElement("template");F.content&&F.content.ownerDocument&&(t=F.content.ownerDocument)}let A,O="",{implementation:V,createNodeIterator:re,createDocumentFragment:L,getElementsByTagName:G}=t,{importNode:q}=s,ee=qn();e.isSupported=typeof jn=="function"&&typeof M=="function"&&V&&V.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:ye,ERB_EXPR:we,TMPLIT_EXPR:w,DATA_ATTR:b,ARIA_ATTR:v,IS_SCRIPT_OR_DATA:D,ATTR_WHITESPACE:I,CUSTOM_ELEMENT:z}=Hn,{IS_ALLOWED_URI:Y}=Hn,B=null,J=Z({},[...Fn,...Nr,...Mr,...Or,...zn]),j=null,le=Z({},[...Bn,...Pr,...Un,...ir]),X=Object.seal(Fr(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}})),ke=null,ve=null,ce=Object.seal(Fr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Q=!0,fe=!0,Ee=!1,Me=!0,xe=!1,de=!0,Oe=!1,qe=!1,We=!1,Fe=!1,y=!1,h=!1,U=!0,W=!1,se="user-content-",$=!0,st=!1,Xe={},Qe=null,Vt=Z({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Yt=null,Zt=Z({},["audio","video","img","source","image","track"]),$t=null,u=Z({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),R="http://www.w3.org/1998/Math/MathML",H="http://www.w3.org/2000/svg",C="http://www.w3.org/1999/xhtml",ne=C,_e=!1,mt=null,Ae=Z({},[R,H,C],Lr),bt=Z({},["mi","mo","mn","ms","mtext"]),yt=Z({},["annotation-xml"]),br=Z({},["title","style","font","a","script"]),Ge=null,yr=["application/xhtml+xml","text/html"],Xt="text/html",ge=null,K=null,me=t.createElement("form"),it=function(d){return d instanceof RegExp||d instanceof Function},Qt=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(K&&K===d)){if((!d||typeof d!="object")&&(d={}),d=Ye(d),Ge=yr.indexOf(d.PARSER_MEDIA_TYPE)===-1?Xt:d.PARSER_MEDIA_TYPE,ge=Ge==="application/xhtml+xml"?Lr:or,B=Be(d,"ALLOWED_TAGS")?Z({},d.ALLOWED_TAGS,ge):J,j=Be(d,"ALLOWED_ATTR")?Z({},d.ALLOWED_ATTR,ge):le,mt=Be(d,"ALLOWED_NAMESPACES")?Z({},d.ALLOWED_NAMESPACES,Lr):Ae,$t=Be(d,"ADD_URI_SAFE_ATTR")?Z(Ye(u),d.ADD_URI_SAFE_ATTR,ge):u,Yt=Be(d,"ADD_DATA_URI_TAGS")?Z(Ye(Zt),d.ADD_DATA_URI_TAGS,ge):Zt,Qe=Be(d,"FORBID_CONTENTS")?Z({},d.FORBID_CONTENTS,ge):Vt,ke=Be(d,"FORBID_TAGS")?Z({},d.FORBID_TAGS,ge):Ye({}),ve=Be(d,"FORBID_ATTR")?Z({},d.FORBID_ATTR,ge):Ye({}),Xe=Be(d,"USE_PROFILES")?d.USE_PROFILES:!1,Q=d.ALLOW_ARIA_ATTR!==!1,fe=d.ALLOW_DATA_ATTR!==!1,Ee=d.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=d.ALLOW_SELF_CLOSE_IN_ATTR!==!1,xe=d.SAFE_FOR_TEMPLATES||!1,de=d.SAFE_FOR_XML!==!1,Oe=d.WHOLE_DOCUMENT||!1,Fe=d.RETURN_DOM||!1,y=d.RETURN_DOM_FRAGMENT||!1,h=d.RETURN_TRUSTED_TYPE||!1,We=d.FORCE_BODY||!1,U=d.SANITIZE_DOM!==!1,W=d.SANITIZE_NAMED_PROPS||!1,$=d.KEEP_CONTENT!==!1,st=d.IN_PLACE||!1,Y=d.ALLOWED_URI_REGEXP||Wn,ne=d.NAMESPACE||C,bt=d.MATHML_TEXT_INTEGRATION_POINTS||bt,yt=d.HTML_INTEGRATION_POINTS||yt,X=d.CUSTOM_ELEMENT_HANDLING||{},d.CUSTOM_ELEMENT_HANDLING&&it(d.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(X.tagNameCheck=d.CUSTOM_ELEMENT_HANDLING.tagNameCheck),d.CUSTOM_ELEMENT_HANDLING&&it(d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(X.attributeNameCheck=d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),d.CUSTOM_ELEMENT_HANDLING&&typeof d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(X.allowCustomizedBuiltInElements=d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),xe&&(fe=!1),y&&(Fe=!0),Xe&&(B=Z({},zn),j=[],Xe.html===!0&&(Z(B,Fn),Z(j,Bn)),Xe.svg===!0&&(Z(B,Nr),Z(j,Pr),Z(j,ir)),Xe.svgFilters===!0&&(Z(B,Mr),Z(j,Pr),Z(j,ir)),Xe.mathMl===!0&&(Z(B,Or),Z(j,Un),Z(j,ir))),d.ADD_TAGS&&(typeof d.ADD_TAGS=="function"?ce.tagCheck=d.ADD_TAGS:(B===J&&(B=Ye(B)),Z(B,d.ADD_TAGS,ge))),d.ADD_ATTR&&(typeof d.ADD_ATTR=="function"?ce.attributeCheck=d.ADD_ATTR:(j===le&&(j=Ye(j)),Z(j,d.ADD_ATTR,ge))),d.ADD_URI_SAFE_ATTR&&Z($t,d.ADD_URI_SAFE_ATTR,ge),d.FORBID_CONTENTS&&(Qe===Vt&&(Qe=Ye(Qe)),Z(Qe,d.FORBID_CONTENTS,ge)),$&&(B["#text"]=!0),Oe&&Z(B,["html","head","body"]),B.table&&(Z(B,["tbody"]),delete ke.tbody),d.TRUSTED_TYPES_POLICY){if(typeof d.TRUSTED_TYPES_POLICY.createHTML!="function")throw Pt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof d.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Pt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=d.TRUSTED_TYPES_POLICY,O=A.createHTML("")}else A===void 0&&(A=_i(m,n)),A!==null&&typeof O=="string"&&(O=A.createHTML(""));Re&&Re(d),K=d}},en=Z({},[...Nr,...Mr,...di]),tn=Z({},[...Or,...ui]),$s=function(d){let S=M(d);(!S||!S.tagName)&&(S={namespaceURI:ne,tagName:"template"});let N=or(d.tagName),pe=or(S.tagName);return mt[d.namespaceURI]?d.namespaceURI===H?S.namespaceURI===C?N==="svg":S.namespaceURI===R?N==="svg"&&(pe==="annotation-xml"||bt[pe]):!!en[N]:d.namespaceURI===R?S.namespaceURI===C?N==="math":S.namespaceURI===H?N==="math"&&yt[pe]:!!tn[N]:d.namespaceURI===C?S.namespaceURI===H&&!yt[pe]||S.namespaceURI===R&&!bt[pe]?!1:!tn[N]&&(br[N]||!en[N]):!!(Ge==="application/xhtml+xml"&&mt[d.namespaceURI]):!1},je=function(d){Mt(e.removed,{element:d});try{M(d).removeChild(d)}catch{T(d)}},ot=function(d,S){try{Mt(e.removed,{attribute:S.getAttributeNode(d),from:S})}catch{Mt(e.removed,{attribute:null,from:S})}if(S.removeAttribute(d),d==="is")if(Fe||y)try{je(S)}catch{}else try{S.setAttribute(d,"")}catch{}},rn=function(d){let S=null,N=null;if(We)d="<remove></remove>"+d;else{let be=Dr(d,/^[\r\n\t ]+/);N=be&&be[0]}Ge==="application/xhtml+xml"&&ne===C&&(d='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+d+"</body></html>");let pe=A?A.createHTML(d):d;if(ne===C)try{S=new g().parseFromString(pe,Ge)}catch{}if(!S||!S.documentElement){S=V.createDocument(ne,"template",null);try{S.documentElement.innerHTML=_e?O:pe}catch{}}let $e=S.body||S.documentElement;return d&&N&&$e.insertBefore(t.createTextNode(N),$e.childNodes[0]||null),ne===C?G.call(S,Oe?"html":"body")[0]:Oe?S.documentElement:$e},nn=function(d){return re.call(d.ownerDocument||d,d,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},wr=function(d){return d instanceof c&&(typeof d.nodeName!="string"||typeof d.textContent!="string"||typeof d.removeChild!="function"||!(d.attributes instanceof f)||typeof d.removeAttribute!="function"||typeof d.setAttribute!="function"||typeof d.namespaceURI!="string"||typeof d.insertBefore!="function"||typeof d.hasChildNodes!="function")},sn=function(d){return typeof l=="function"&&d instanceof l};function Ke(F,d,S){sr(F,N=>{N.call(e,d,S,K)})}let on=function(d){let S=null;if(Ke(ee.beforeSanitizeElements,d,null),wr(d))return je(d),!0;let N=ge(d.nodeName);if(Ke(ee.uponSanitizeElement,d,{tagName:N,allowedTags:B}),de&&d.hasChildNodes()&&!sn(d.firstElementChild)&&Ce(/<[/\w!]/g,d.innerHTML)&&Ce(/<[/\w!]/g,d.textContent)||d.nodeType===zt.progressingInstruction||de&&d.nodeType===zt.comment&&Ce(/<[/\w]/g,d.data))return je(d),!0;if(!(ce.tagCheck instanceof Function&&ce.tagCheck(N))&&(!B[N]||ke[N])){if(!ke[N]&&ln(N)&&(X.tagNameCheck instanceof RegExp&&Ce(X.tagNameCheck,N)||X.tagNameCheck instanceof Function&&X.tagNameCheck(N)))return!1;if($&&!Qe[N]){let pe=M(d)||d.parentNode,$e=P(d)||d.childNodes;if($e&&pe){let be=$e.length;for(let De=be-1;De>=0;--De){let Ve=x($e[De],!0);Ve.__removalCount=(d.__removalCount||0)+1,pe.insertBefore(Ve,_(d))}}}return je(d),!0}return d instanceof a&&!$s(d)||(N==="noscript"||N==="noembed"||N==="noframes")&&Ce(/<\/no(script|embed|frames)/i,d.innerHTML)?(je(d),!0):(xe&&d.nodeType===zt.text&&(S=d.textContent,sr([ye,we,w],pe=>{S=Ot(S,pe," ")}),d.textContent!==S&&(Mt(e.removed,{element:d.cloneNode()}),d.textContent=S)),Ke(ee.afterSanitizeElements,d,null),!1)},an=function(d,S,N){if(U&&(S==="id"||S==="name")&&(N in t||N in me))return!1;if(!(fe&&!ve[S]&&Ce(b,S))){if(!(Q&&Ce(v,S))){if(!(ce.attributeCheck instanceof Function&&ce.attributeCheck(S,d))){if(!j[S]||ve[S]){if(!(ln(d)&&(X.tagNameCheck instanceof RegExp&&Ce(X.tagNameCheck,d)||X.tagNameCheck instanceof Function&&X.tagNameCheck(d))&&(X.attributeNameCheck instanceof RegExp&&Ce(X.attributeNameCheck,S)||X.attributeNameCheck instanceof Function&&X.attributeNameCheck(S,d))||S==="is"&&X.allowCustomizedBuiltInElements&&(X.tagNameCheck instanceof RegExp&&Ce(X.tagNameCheck,N)||X.tagNameCheck instanceof Function&&X.tagNameCheck(N))))return!1}else if(!$t[S]){if(!Ce(Y,Ot(N,I,""))){if(!((S==="src"||S==="xlink:href"||S==="href")&&d!=="script"&&oi(N,"data:")===0&&Yt[d])){if(!(Ee&&!Ce(D,Ot(N,I,"")))){if(N)return!1}}}}}}}return!0},ln=function(d){return d!=="annotation-xml"&&Dr(d,z)},cn=function(d){Ke(ee.beforeSanitizeAttributes,d,null);let{attributes:S}=d;if(!S||wr(d))return;let N={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j,forceKeepAttr:void 0},pe=S.length;for(;pe--;){let $e=S[pe],{name:be,namespaceURI:De,value:Ve}=$e,wt=ge(be),kr=Ve,Se=be==="value"?kr:ai(kr);if(N.attrName=wt,N.attrValue=Se,N.keepAttr=!0,N.forceKeepAttr=void 0,Ke(ee.uponSanitizeAttribute,d,N),Se=N.attrValue,W&&(wt==="id"||wt==="name")&&(ot(be,d),Se=se+Se),de&&Ce(/((--!?|])>)|<\/(style|title|textarea)/i,Se)){ot(be,d);continue}if(wt==="attributename"&&Dr(Se,"href")){ot(be,d);continue}if(N.forceKeepAttr)continue;if(!N.keepAttr){ot(be,d);continue}if(!Me&&Ce(/\/>/i,Se)){ot(be,d);continue}xe&&sr([ye,we,w],un=>{Se=Ot(Se,un," ")});let dn=ge(d.nodeName);if(!an(dn,wt,Se)){ot(be,d);continue}if(A&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!De)switch(m.getAttributeType(dn,wt)){case"TrustedHTML":{Se=A.createHTML(Se);break}case"TrustedScriptURL":{Se=A.createScriptURL(Se);break}}if(Se!==kr)try{De?d.setAttributeNS(De,be,Se):d.setAttribute(be,Se),wr(d)?je(d):Pn(e.removed)}catch{ot(be,d)}}Ke(ee.afterSanitizeAttributes,d,null)},Es=function F(d){let S=null,N=nn(d);for(Ke(ee.beforeSanitizeShadowDOM,d,null);S=N.nextNode();)Ke(ee.uponSanitizeShadowNode,S,null),on(S),cn(S),S.content instanceof i&&F(S.content);Ke(ee.afterSanitizeShadowDOM,d,null)};return e.sanitize=function(F){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=null,N=null,pe=null,$e=null;if(_e=!F,_e&&(F="<!-->"),typeof F!="string"&&!sn(F))if(typeof F.toString=="function"){if(F=F.toString(),typeof F!="string")throw Pt("dirty is not a string, aborting")}else throw Pt("toString is not a function");if(!e.isSupported)return F;if(qe||Qt(d),e.removed=[],typeof F=="string"&&(st=!1),st){if(F.nodeName){let Ve=ge(F.nodeName);if(!B[Ve]||ke[Ve])throw Pt("root node is forbidden and cannot be sanitized in-place")}}else if(F instanceof l)S=rn("<!---->"),N=S.ownerDocument.importNode(F,!0),N.nodeType===zt.element&&N.nodeName==="BODY"||N.nodeName==="HTML"?S=N:S.appendChild(N);else{if(!Fe&&!xe&&!Oe&&F.indexOf("<")===-1)return A&&h?A.createHTML(F):F;if(S=rn(F),!S)return Fe?null:h?O:""}S&&We&&je(S.firstChild);let be=nn(st?F:S);for(;pe=be.nextNode();)on(pe),cn(pe),pe.content instanceof i&&Es(pe.content);if(st)return F;if(Fe){if(y)for($e=L.call(S.ownerDocument);S.firstChild;)$e.appendChild(S.firstChild);else $e=S;return(j.shadowroot||j.shadowrootmode)&&($e=q.call(s,$e,!0)),$e}let De=Oe?S.outerHTML:S.innerHTML;return Oe&&B["!doctype"]&&S.ownerDocument&&S.ownerDocument.doctype&&S.ownerDocument.doctype.name&&Ce(Gn,S.ownerDocument.doctype.name)&&(De="<!DOCTYPE "+S.ownerDocument.doctype.name+`>
|
|
74
|
-
`+
|
|
75
|
-
]`).replace("lheading",
|
|
73
|
+
`}let z=null;function R(b,v){z||t(v)}function x(b,v){z=v,b.dataTransfer&&(b.dataTransfer.setData("text/plain",v),b.dataTransfer.effectAllowed="move"),b.target.classList.add("board-card--dragging"),l("dragstart %s",v)}function M(b){b.target.classList.remove("board-card--dragging"),K(),setTimeout(()=>{z=null},0),l("dragend")}function K(){let b=Array.from(r.querySelectorAll(".board-column--drag-over"));for(let v of b)v.classList.remove("board-column--drag-over")}async function oe(b,v){if(!o){l("no transport available, status update skipped"),pe("Cannot update status: not connected","error");return}try{l("update-status %s \u2192 %s",b,v),await o("update-status",{id:b,status:v}),pe("Status updated","success",1500)}catch(N){l("update-status failed: %o",N),pe("Failed to update status","error")}}function D(){Te(_(),r),q()}function q(){try{let b=Array.from(r.querySelectorAll(".board-column"));for(let v of b){let N=v.querySelector(".board-column__body");if(!N)continue;let I=Array.from(N.querySelectorAll(".board-card")),H=v.querySelector(".board-column__header"),V=H&&H.textContent?.trim()||"";for(let B of I){let J=B.querySelector(".board-card__title"),W=J&&J.textContent?.trim()||"";B.setAttribute("aria-label",`Issue ${W||"(no title)"} \u2014 Column ${V}`),B.tabIndex=-1}I.length>0&&(I[0].tabIndex=0)}}catch{}}r.addEventListener("keydown",b=>{let v=b.target;if(!v||!(v instanceof HTMLElement))return;let N=String(v.tagName||"").toLowerCase();if(N==="input"||N==="textarea"||N==="select"||v.isContentEditable===!0)return;let I=v.closest(".board-card");if(!I)return;let H=String(b.key||"");if(H==="Enter"||H===" "){b.preventDefault();let ce=I.getAttribute("data-issue-id");ce&&t(ce);return}if(H!=="ArrowUp"&&H!=="ArrowDown"&&H!=="ArrowLeft"&&H!=="ArrowRight")return;b.preventDefault();let V=I.closest(".board-column");if(!V)return;let B=V.querySelector(".board-column__body");if(!B)return;let J=Array.from(B.querySelectorAll(".board-card")),W=J.indexOf(I);if(W!==-1){if(H==="ArrowDown"&&W<J.length-1){ee(J[W],J[W+1]);return}if(H==="ArrowUp"&&W>0){ee(J[W],J[W-1]);return}if(H==="ArrowRight"||H==="ArrowLeft"){let ce=Array.from(r.querySelectorAll(".board-column")),Z=ce.indexOf(V);if(Z===-1)return;let ve=H==="ArrowRight"?1:-1,$e=Z+ve,de=null;for(;$e>=0&&$e<ce.length;){let Q=ce[$e],he=Q.querySelector(".board-column__body");if((he?Array.from(he.querySelectorAll(".board-card")):[]).length>0){de=Q;break}$e+=ve}if(de){let Q=de.querySelector(".board-column__body .board-card");Q&&ee(I,Q)}return}}});let j=null;r.addEventListener("dragover",b=>{b.preventDefault(),b.dataTransfer&&(b.dataTransfer.dropEffect="move");let N=b.target.closest(".board-column");N&&N!==j&&(j&&j.classList.remove("board-column--drag-over"),N.classList.add("board-column--drag-over"),j=N)}),r.addEventListener("dragleave",b=>{let v=b.relatedTarget;(!v||!r.contains(v))&&j&&(j.classList.remove("board-column--drag-over"),j=null)}),r.addEventListener("drop",b=>{b.preventDefault(),j&&(j.classList.remove("board-column--drag-over"),j=null);let N=b.target.closest(".board-column");if(!N)return;let I=N.id,H=ti[I];if(!H){l("drop on unknown column: %s",I);return}let V=b.dataTransfer?.getData("text/plain");if(!V){l("drop without issue id");return}l("drop %s on %s \u2192 %s",V,I,H),oe(V,H)});function ee(b,v){try{b.tabIndex=-1,v.tabIndex=0,v.focus()}catch{}}function ke(){l("applyClosedFilter %s",k);let b=Array.isArray(g)?[...g]:[],v=new Date,N=0;k==="today"?N=new Date(v.getFullYear(),v.getMonth(),v.getDate(),0,0,0,0).getTime():k==="3"?N=v.getTime()-4320*60*1e3:k==="7"&&(N=v.getTime()-10080*60*1e3),b=b.filter(I=>{let H=Number.isFinite(I.closed_at)?I.closed_at:NaN;return Number.isFinite(H)?H>=N:!1}),b.sort(xt),c=b}function _e(b){try{let v=b.target,N=String(v.value||"today");if(k=N==="3"||N==="7"?N:"today",l("closed filter %s",k),s)try{s.setState({board:{closed_filter:k}})}catch{}ke(),D()}catch{}}function w(){try{if(m){let b=m.selectBoardColumn("tab:board:in-progress","in_progress"),v=m.selectBoardColumn("tab:board:blocked","blocked"),N=m.selectBoardColumn("tab:board:ready","ready"),I=m.selectBoardColumn("tab:board:closed","closed"),H=new Set(b.map(B=>B.id));a=N.filter(B=>!H.has(B.id)),p=v,f=b,g=I}ke(),D()}catch{a=[],p=[],f=[],c=[],D()}}return m&&m.subscribe(()=>{try{w()}catch{}}),{async load(){l("load"),w();try{let b=!!(n&&n.selectors),v=V=>{if(!b||!n)return 0;let B=n.selectors;if(typeof B.count=="function")return Number(B.count(V)||0);try{let J=B.getIds(V);return Array.isArray(J)?J.length:0}catch{return 0}},N=v("tab:board:ready")+v("tab:board:blocked")+v("tab:board:in-progress")+v("tab:board:closed"),I=e,H=I&&typeof I.getReady=="function"&&typeof I.getBlocked=="function"&&typeof I.getInProgress=="function"&&typeof I.getClosed=="function";if(N===0&&H){l("fallback fetch");let[V,B,J,W]=await Promise.all([I.getReady().catch(()=>[]),I.getBlocked().catch(()=>[]),I.getInProgress().catch(()=>[]),I.getClosed().catch(()=>[])]),ce=Array.isArray(V)?V.map(Q=>Q):[],Z=Array.isArray(B)?B.map(Q=>Q):[],ve=Array.isArray(J)?J.map(Q=>Q):[],$e=Array.isArray(W)?W.map(Q=>Q):[],de=new Set(ve.map(Q=>Q.id));ce=ce.filter(Q=>!de.has(Q.id)),ce.sort(He),Z.sort(He),ve.sort(He),a=ce,p=Z,f=ve,g=$e,ke(),D()}}catch{}},clear(){r.replaceChildren(),a=[],p=[],f=[],c=[]}}}var{entries:Gn,setPrototypeOf:Fn,isFrozen:ri,getPrototypeOf:ni,getOwnPropertyDescriptor:si}=Object,{freeze:Re,seal:ze,create:Hr}=Object,{apply:qr,construct:jr}=typeof Reflect<"u"&&Reflect;Re||(Re=function(e){return e});ze||(ze=function(e){return e});qr||(qr=function(e,t){for(var s=arguments.length,n=new Array(s>2?s-2:0),i=2;i<s;i++)n[i-2]=arguments[i];return e.apply(t,n)});jr||(jr=function(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),n=1;n<t;n++)s[n-1]=arguments[n];return new e(...s)});var lr=Ie(Array.prototype.forEach),ii=Ie(Array.prototype.lastIndexOf),zn=Ie(Array.prototype.pop),Bt=Ie(Array.prototype.push),oi=Ie(Array.prototype.splice),dr=Ie(String.prototype.toLowerCase),Or=Ie(String.prototype.toString),Pr=Ie(String.prototype.match),Ut=Ie(String.prototype.replace),ai=Ie(String.prototype.indexOf),li=Ie(String.prototype.trim),qe=Ie(Object.prototype.hasOwnProperty),Ce=Ie(RegExp.prototype.test),Ht=ci(TypeError);function Ie(r){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,s=new Array(t>1?t-1:0),n=1;n<t;n++)s[n-1]=arguments[n];return qr(r,e,s)}}function ci(r){return function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return jr(r,t)}}function Y(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:dr;Fn&&Fn(r,null);let s=e.length;for(;s--;){let n=e[s];if(typeof n=="string"){let i=t(n);i!==n&&(ri(e)||(e[s]=i),n=i)}r[n]=!0}return r}function di(r){for(let e=0;e<r.length;e++)qe(r,e)||(r[e]=null);return r}function Xe(r){let e=Hr(null);for(let[t,s]of Gn(r))qe(r,t)&&(Array.isArray(s)?e[t]=di(s):s&&typeof s=="object"&&s.constructor===Object?e[t]=Xe(s):e[t]=s);return e}function qt(r,e){for(;r!==null;){let s=si(r,e);if(s){if(s.get)return Ie(s.get);if(typeof s.value=="function")return Ie(s.value)}r=ni(r)}function t(){return null}return t}var Bn=Re(["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"]),Fr=Re(["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"]),zr=Re(["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"]),ui=Re(["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"]),Br=Re(["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"]),pi=Re(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Un=Re(["#text"]),Hn=Re(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","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","slot"]),Ur=Re(["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","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","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-rendering","textlength","type","u1","u2","unicode","values","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"]),qn=Re(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","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"]),cr=Re(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),fi=ze(/\{\{[\w\W]*|[\w\W]*\}\}/gm),hi=ze(/<%[\w\W]*|[\w\W]*%>/gm),gi=ze(/\$\{[\w\W]*/gm),mi=ze(/^data-[\-\w.\u00B7-\uFFFF]+$/),bi=ze(/^aria-[\-\w]+$/),Kn=ze(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),yi=ze(/^(?:\w+script|data):/i),wi=ze(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Vn=ze(/^html$/i),ki=ze(/^[a-z][.\w]*(-[.\w]+)+$/i),jn=Object.freeze({__proto__:null,ARIA_ATTR:bi,ATTR_WHITESPACE:wi,CUSTOM_ELEMENT:ki,DATA_ATTR:mi,DOCTYPE_NAME:Vn,ERB_EXPR:hi,IS_ALLOWED_URI:Kn,IS_SCRIPT_OR_DATA:yi,MUSTACHE_EXPR:fi,TMPLIT_EXPR:gi}),jt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},_i=function(){return typeof window>"u"?null:window},vi=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let s=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(s=t.getAttribute(n));let i="dompurify"+(s?"#"+s:"");try{return e.createPolicy(i,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Wn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Yn(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_i(),e=F=>Yn(F);if(e.version="3.3.0",e.removed=[],!r||!r.document||r.document.nodeType!==jt.document||!r.Element)return e.isSupported=!1,e;let{document:t}=r,s=t,n=s.currentScript,{DocumentFragment:i,HTMLTemplateElement:o,Node:l,Element:a,NodeFilter:p,NamedNodeMap:f=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:c,DOMParser:g,trustedTypes:m}=r,k=a.prototype,_=qt(k,"cloneNode"),$=qt(k,"remove"),S=qt(k,"nextSibling"),z=qt(k,"childNodes"),R=qt(k,"parentNode");if(typeof o=="function"){let F=t.createElement("template");F.content&&F.content.ownerDocument&&(t=F.content.ownerDocument)}let x,M="",{implementation:K,createNodeIterator:oe,createDocumentFragment:D,getElementsByTagName:q}=t,{importNode:j}=s,ee=Wn();e.isSupported=typeof Gn=="function"&&typeof R=="function"&&K&&K.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:ke,ERB_EXPR:_e,TMPLIT_EXPR:w,DATA_ATTR:b,ARIA_ATTR:v,IS_SCRIPT_OR_DATA:N,ATTR_WHITESPACE:I,CUSTOM_ELEMENT:H}=jn,{IS_ALLOWED_URI:V}=jn,B=null,J=Y({},[...Bn,...Fr,...zr,...Br,...Un]),W=null,ce=Y({},[...Hn,...Ur,...qn,...cr]),Z=Object.seal(Hr(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}})),ve=null,$e=null,de=Object.seal(Hr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Q=!0,he=!0,De=!1,Oe=!0,xe=!1,ue=!0,Pe=!1,Ge=!1,Ke=!1,Be=!1,y=!1,h=!1,U=!0,G=!1,re="user-content-",ge=!0,at=!1,Ve={},Je=null,Et=Y({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Jt=null,L=Y({},["audio","video","img","source","image","track"]),Ct=null,er=Y({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),bt="http://www.w3.org/1998/Math/MathML",yt="http://www.w3.org/2000/svg",Ue="http://www.w3.org/1999/xhtml",et=Ue,Rt=!1,u=null,A=Y({},[bt,yt,Ue],Or),P=Y({},["mi","mo","mn","ms","mtext"]),E=Y({},["annotation-xml"]),se=Y({},["title","style","font","a","script"]),be=null,tr=["application/xhtml+xml","text/html"],Ae="text/html",ye=null,tt=null,_r=t.createElement("form"),wt=function(d){return d instanceof RegExp||d instanceof Function},It=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(tt&&tt===d)){if((!d||typeof d!="object")&&(d={}),d=Xe(d),be=tr.indexOf(d.PARSER_MEDIA_TYPE)===-1?Ae:d.PARSER_MEDIA_TYPE,ye=be==="application/xhtml+xml"?Or:dr,B=qe(d,"ALLOWED_TAGS")?Y({},d.ALLOWED_TAGS,ye):J,W=qe(d,"ALLOWED_ATTR")?Y({},d.ALLOWED_ATTR,ye):ce,u=qe(d,"ALLOWED_NAMESPACES")?Y({},d.ALLOWED_NAMESPACES,Or):A,Ct=qe(d,"ADD_URI_SAFE_ATTR")?Y(Xe(er),d.ADD_URI_SAFE_ATTR,ye):er,Jt=qe(d,"ADD_DATA_URI_TAGS")?Y(Xe(L),d.ADD_DATA_URI_TAGS,ye):L,Je=qe(d,"FORBID_CONTENTS")?Y({},d.FORBID_CONTENTS,ye):Et,ve=qe(d,"FORBID_TAGS")?Y({},d.FORBID_TAGS,ye):Xe({}),$e=qe(d,"FORBID_ATTR")?Y({},d.FORBID_ATTR,ye):Xe({}),Ve=qe(d,"USE_PROFILES")?d.USE_PROFILES:!1,Q=d.ALLOW_ARIA_ATTR!==!1,he=d.ALLOW_DATA_ATTR!==!1,De=d.ALLOW_UNKNOWN_PROTOCOLS||!1,Oe=d.ALLOW_SELF_CLOSE_IN_ATTR!==!1,xe=d.SAFE_FOR_TEMPLATES||!1,ue=d.SAFE_FOR_XML!==!1,Pe=d.WHOLE_DOCUMENT||!1,Be=d.RETURN_DOM||!1,y=d.RETURN_DOM_FRAGMENT||!1,h=d.RETURN_TRUSTED_TYPE||!1,Ke=d.FORCE_BODY||!1,U=d.SANITIZE_DOM!==!1,G=d.SANITIZE_NAMED_PROPS||!1,ge=d.KEEP_CONTENT!==!1,at=d.IN_PLACE||!1,V=d.ALLOWED_URI_REGEXP||Kn,et=d.NAMESPACE||Ue,P=d.MATHML_TEXT_INTEGRATION_POINTS||P,E=d.HTML_INTEGRATION_POINTS||E,Z=d.CUSTOM_ELEMENT_HANDLING||{},d.CUSTOM_ELEMENT_HANDLING&&wt(d.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Z.tagNameCheck=d.CUSTOM_ELEMENT_HANDLING.tagNameCheck),d.CUSTOM_ELEMENT_HANDLING&&wt(d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Z.attributeNameCheck=d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),d.CUSTOM_ELEMENT_HANDLING&&typeof d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Z.allowCustomizedBuiltInElements=d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),xe&&(he=!1),y&&(Be=!0),Ve&&(B=Y({},Un),W=[],Ve.html===!0&&(Y(B,Bn),Y(W,Hn)),Ve.svg===!0&&(Y(B,Fr),Y(W,Ur),Y(W,cr)),Ve.svgFilters===!0&&(Y(B,zr),Y(W,Ur),Y(W,cr)),Ve.mathMl===!0&&(Y(B,Br),Y(W,qn),Y(W,cr))),d.ADD_TAGS&&(typeof d.ADD_TAGS=="function"?de.tagCheck=d.ADD_TAGS:(B===J&&(B=Xe(B)),Y(B,d.ADD_TAGS,ye))),d.ADD_ATTR&&(typeof d.ADD_ATTR=="function"?de.attributeCheck=d.ADD_ATTR:(W===ce&&(W=Xe(W)),Y(W,d.ADD_ATTR,ye))),d.ADD_URI_SAFE_ATTR&&Y(Ct,d.ADD_URI_SAFE_ATTR,ye),d.FORBID_CONTENTS&&(Je===Et&&(Je=Xe(Je)),Y(Je,d.FORBID_CONTENTS,ye)),ge&&(B["#text"]=!0),Pe&&Y(B,["html","head","body"]),B.table&&(Y(B,["tbody"]),delete ve.tbody),d.TRUSTED_TYPES_POLICY){if(typeof d.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ht('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof d.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ht('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=d.TRUSTED_TYPES_POLICY,M=x.createHTML("")}else x===void 0&&(x=vi(m,n)),x!==null&&typeof M=="string"&&(M=x.createHTML(""));Re&&Re(d),tt=d}},Lt=Y({},[...Fr,...zr,...ui]),rr=Y({},[...Br,...pi]),X=function(d){let T=R(d);(!T||!T.tagName)&&(T={namespaceURI:et,tagName:"template"});let O=dr(d.tagName),fe=dr(T.tagName);return u[d.namespaceURI]?d.namespaceURI===yt?T.namespaceURI===Ue?O==="svg":T.namespaceURI===bt?O==="svg"&&(fe==="annotation-xml"||P[fe]):!!Lt[O]:d.namespaceURI===bt?T.namespaceURI===Ue?O==="math":T.namespaceURI===yt?O==="math"&&E[fe]:!!rr[O]:d.namespaceURI===Ue?T.namespaceURI===yt&&!E[fe]||T.namespaceURI===bt&&!P[fe]?!1:!rr[O]&&(se[O]||!Lt[O]):!!(be==="application/xhtml+xml"&&u[d.namespaceURI]):!1},ie=function(d){Bt(e.removed,{element:d});try{R(d).removeChild(d)}catch{$(d)}},Fe=function(d,T){try{Bt(e.removed,{attribute:T.getAttributeNode(d),from:T})}catch{Bt(e.removed,{attribute:null,from:T})}if(T.removeAttribute(d),d==="is")if(Be||y)try{ie(T)}catch{}else try{T.setAttribute(d,"")}catch{}},vr=function(d){let T=null,O=null;if(Ke)d="<remove></remove>"+d;else{let we=Pr(d,/^[\r\n\t ]+/);O=we&&we[0]}be==="application/xhtml+xml"&&et===Ue&&(d='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+d+"</body></html>");let fe=x?x.createHTML(d):d;if(et===Ue)try{T=new g().parseFromString(fe,be)}catch{}if(!T||!T.documentElement){T=K.createDocument(et,"template",null);try{T.documentElement.innerHTML=Rt?M:fe}catch{}}let Ee=T.body||T.documentElement;return d&&O&&Ee.insertBefore(t.createTextNode(O),Ee.childNodes[0]||null),et===Ue?q.call(T,Pe?"html":"body")[0]:Pe?T.documentElement:Ee},sn=function(d){return oe.call(d.ownerDocument||d,d,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},xr=function(d){return d instanceof c&&(typeof d.nodeName!="string"||typeof d.textContent!="string"||typeof d.removeChild!="function"||!(d.attributes instanceof f)||typeof d.removeAttribute!="function"||typeof d.setAttribute!="function"||typeof d.namespaceURI!="string"||typeof d.insertBefore!="function"||typeof d.hasChildNodes!="function")},on=function(d){return typeof l=="function"&&d instanceof l};function Ye(F,d,T){lr(F,O=>{O.call(e,d,T,tt)})}let an=function(d){let T=null;if(Ye(ee.beforeSanitizeElements,d,null),xr(d))return ie(d),!0;let O=ye(d.nodeName);if(Ye(ee.uponSanitizeElement,d,{tagName:O,allowedTags:B}),ue&&d.hasChildNodes()&&!on(d.firstElementChild)&&Ce(/<[/\w!]/g,d.innerHTML)&&Ce(/<[/\w!]/g,d.textContent)||d.nodeType===jt.progressingInstruction||ue&&d.nodeType===jt.comment&&Ce(/<[/\w]/g,d.data))return ie(d),!0;if(!(de.tagCheck instanceof Function&&de.tagCheck(O))&&(!B[O]||ve[O])){if(!ve[O]&&cn(O)&&(Z.tagNameCheck instanceof RegExp&&Ce(Z.tagNameCheck,O)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(O)))return!1;if(ge&&!Je[O]){let fe=R(d)||d.parentNode,Ee=z(d)||d.childNodes;if(Ee&&fe){let we=Ee.length;for(let Ne=we-1;Ne>=0;--Ne){let Ze=_(Ee[Ne],!0);Ze.__removalCount=(d.__removalCount||0)+1,fe.insertBefore(Ze,S(d))}}}return ie(d),!0}return d instanceof a&&!X(d)||(O==="noscript"||O==="noembed"||O==="noframes")&&Ce(/<\/no(script|embed|frames)/i,d.innerHTML)?(ie(d),!0):(xe&&d.nodeType===jt.text&&(T=d.textContent,lr([ke,_e,w],fe=>{T=Ut(T,fe," ")}),d.textContent!==T&&(Bt(e.removed,{element:d.cloneNode()}),d.textContent=T)),Ye(ee.afterSanitizeElements,d,null),!1)},ln=function(d,T,O){if(U&&(T==="id"||T==="name")&&(O in t||O in _r))return!1;if(!(he&&!$e[T]&&Ce(b,T))){if(!(Q&&Ce(v,T))){if(!(de.attributeCheck instanceof Function&&de.attributeCheck(T,d))){if(!W[T]||$e[T]){if(!(cn(d)&&(Z.tagNameCheck instanceof RegExp&&Ce(Z.tagNameCheck,d)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(d))&&(Z.attributeNameCheck instanceof RegExp&&Ce(Z.attributeNameCheck,T)||Z.attributeNameCheck instanceof Function&&Z.attributeNameCheck(T,d))||T==="is"&&Z.allowCustomizedBuiltInElements&&(Z.tagNameCheck instanceof RegExp&&Ce(Z.tagNameCheck,O)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(O))))return!1}else if(!Ct[T]){if(!Ce(V,Ut(O,I,""))){if(!((T==="src"||T==="xlink:href"||T==="href")&&d!=="script"&&ai(O,"data:")===0&&Jt[d])){if(!(De&&!Ce(N,Ut(O,I,"")))){if(O)return!1}}}}}}}return!0},cn=function(d){return d!=="annotation-xml"&&Pr(d,H)},dn=function(d){Ye(ee.beforeSanitizeAttributes,d,null);let{attributes:T}=d;if(!T||xr(d))return;let O={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:W,forceKeepAttr:void 0},fe=T.length;for(;fe--;){let Ee=T[fe],{name:we,namespaceURI:Ne,value:Ze}=Ee,kt=ye(we),Ar=Ze,Se=we==="value"?Ar:li(Ar);if(O.attrName=kt,O.attrValue=Se,O.keepAttr=!0,O.forceKeepAttr=void 0,Ye(ee.uponSanitizeAttribute,d,O),Se=O.attrValue,G&&(kt==="id"||kt==="name")&&(Fe(we,d),Se=re+Se),ue&&Ce(/((--!?|])>)|<\/(style|title|textarea)/i,Se)){Fe(we,d);continue}if(kt==="attributename"&&Pr(Se,"href")){Fe(we,d);continue}if(O.forceKeepAttr)continue;if(!O.keepAttr){Fe(we,d);continue}if(!Oe&&Ce(/\/>/i,Se)){Fe(we,d);continue}xe&&lr([ke,_e,w],pn=>{Se=Ut(Se,pn," ")});let un=ye(d.nodeName);if(!ln(un,kt,Se)){Fe(we,d);continue}if(x&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!Ne)switch(m.getAttributeType(un,kt)){case"TrustedHTML":{Se=x.createHTML(Se);break}case"TrustedScriptURL":{Se=x.createScriptURL(Se);break}}if(Se!==Ar)try{Ne?d.setAttributeNS(Ne,we,Se):d.setAttribute(we,Se),xr(d)?ie(d):zn(e.removed)}catch{Fe(we,d)}}Ye(ee.afterSanitizeAttributes,d,null)},Cs=function F(d){let T=null,O=sn(d);for(Ye(ee.beforeSanitizeShadowDOM,d,null);T=O.nextNode();)Ye(ee.uponSanitizeShadowNode,T,null),an(T),dn(T),T.content instanceof i&&F(T.content);Ye(ee.afterSanitizeShadowDOM,d,null)};return e.sanitize=function(F){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},T=null,O=null,fe=null,Ee=null;if(Rt=!F,Rt&&(F="<!-->"),typeof F!="string"&&!on(F))if(typeof F.toString=="function"){if(F=F.toString(),typeof F!="string")throw Ht("dirty is not a string, aborting")}else throw Ht("toString is not a function");if(!e.isSupported)return F;if(Ge||It(d),e.removed=[],typeof F=="string"&&(at=!1),at){if(F.nodeName){let Ze=ye(F.nodeName);if(!B[Ze]||ve[Ze])throw Ht("root node is forbidden and cannot be sanitized in-place")}}else if(F instanceof l)T=vr("<!---->"),O=T.ownerDocument.importNode(F,!0),O.nodeType===jt.element&&O.nodeName==="BODY"||O.nodeName==="HTML"?T=O:T.appendChild(O);else{if(!Be&&!xe&&!Pe&&F.indexOf("<")===-1)return x&&h?x.createHTML(F):F;if(T=vr(F),!T)return Be?null:h?M:""}T&&Ke&&ie(T.firstChild);let we=sn(at?F:T);for(;fe=we.nextNode();)an(fe),dn(fe),fe.content instanceof i&&Cs(fe.content);if(at)return F;if(Be){if(y)for(Ee=D.call(T.ownerDocument);T.firstChild;)Ee.appendChild(T.firstChild);else Ee=T;return(W.shadowroot||W.shadowrootmode)&&(Ee=j.call(s,Ee,!0)),Ee}let Ne=Pe?T.outerHTML:T.innerHTML;return Pe&&B["!doctype"]&&T.ownerDocument&&T.ownerDocument.doctype&&T.ownerDocument.doctype.name&&Ce(Vn,T.ownerDocument.doctype.name)&&(Ne="<!DOCTYPE "+T.ownerDocument.doctype.name+`>
|
|
74
|
+
`+Ne),xe&&lr([ke,_e,w],Ze=>{Ne=Ut(Ne,Ze," ")}),x&&h?x.createHTML(Ne):Ne},e.setConfig=function(){let F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};It(F),Ge=!0},e.clearConfig=function(){tt=null,Ge=!1},e.isValidAttribute=function(F,d,T){tt||It({});let O=ye(F),fe=ye(d);return ln(O,fe,T)},e.addHook=function(F,d){typeof d=="function"&&Bt(ee[F],d)},e.removeHook=function(F,d){if(d!==void 0){let T=ii(ee[F],d);return T===-1?void 0:oi(ee[F],T,1)[0]}return zn(ee[F])},e.removeHooks=function(F){ee[F]=[]},e.removeAllHooks=function(){ee=Wn()},e}var Zn=Yn();var Xn={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Qn=r=>(...e)=>({_$litDirective$:r,values:e}),ur=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)}};var Wt=class extends ur{constructor(e){if(super(e),this.it=me,e.type!==Xn.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===me||e==null)return this._t=void 0,this.it=e;if(e===ut)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;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Wt.directiveName="unsafeHTML",Wt.resultType=1;var Jn=Qn(Wt);function Vr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var gt=Vr();function os(r){gt=r}var Yt={exec:()=>null};function te(r,e=""){let t=typeof r=="string"?r:r.source,s={replace:(n,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(Le.caret,"$1"),t=t.replace(n,o),s},getRegex:()=>new RegExp(t,e)};return s}var xi=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Le={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,listReplaceTabs:/^\t+/,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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i")},Ai=/^(?:[ \t]*(?:\n|$))+/,Si=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ti=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Zt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,$i=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Yr=/(?:[*+-]|\d{1,9}[.)])/,as=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ls=te(as).replace(/bull/g,Yr).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ei=te(as).replace(/bull/g,Yr).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Zr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ci=/^[^\n]+/,Xr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ri=te(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Xr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ii=te(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Yr).getRegex(),br="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",Qr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Li=te("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\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",Qr).replace("tag",br).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),cs=te(Zr).replace("hr",Zt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",br).getRegex(),Di=te(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",cs).getRegex(),Jr={blockquote:Di,code:Si,def:Ri,fences:Ti,heading:$i,hr:Zt,html:Li,lheading:ls,list:Ii,newline:Ai,paragraph:cs,table:Yt,text:Ci},es=te("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Zt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",br).getRegex(),Ni={...Jr,lheading:Ei,table:es,paragraph:te(Zr).replace("hr",Zt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",es).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",br).getRegex()},Mi={...Jr,html:te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Qr).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:Yt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:te(Zr).replace("hr",Zt).replace("heading",` *#{1,6} *[^
|
|
75
|
+
]`).replace("lheading",ls).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Oi=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Pi=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ds=/^( {2,}|\\)\n(?!\s*$)/,Fi=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,yr=/[\p{P}\p{S}]/u,en=/[\s\p{P}\p{S}]/u,us=/[^\s\p{P}\p{S}]/u,zi=te(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,en).getRegex(),ps=/(?!~)[\p{P}\p{S}]/u,Bi=/(?!~)[\s\p{P}\p{S}]/u,Ui=/(?:[^\s\p{P}\p{S}]|~)/u,Hi=te(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",xi?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),fs=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,qi=te(fs,"u").replace(/punct/g,yr).getRegex(),ji=te(fs,"u").replace(/punct/g,ps).getRegex(),hs="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Wi=te(hs,"gu").replace(/notPunctSpace/g,us).replace(/punctSpace/g,en).replace(/punct/g,yr).getRegex(),Gi=te(hs,"gu").replace(/notPunctSpace/g,Ui).replace(/punctSpace/g,Bi).replace(/punct/g,ps).getRegex(),Ki=te("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,us).replace(/punctSpace/g,en).replace(/punct/g,yr).getRegex(),Vi=te(/\\(punct)/,"gu").replace(/punct/g,yr).getRegex(),Yi=te(/^<(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(),Zi=te(Qr).replace("(?:-->|$)","-->").getRegex(),Xi=te("^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",Zi).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),hr=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Qi=te(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",hr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),gs=te(/^!?\[(label)\]\[(ref)\]/).replace("label",hr).replace("ref",Xr).getRegex(),ms=te(/^!?\[(ref)\](?:\[\])?/).replace("ref",Xr).getRegex(),Ji=te("reflink|nolink(?!\\()","g").replace("reflink",gs).replace("nolink",ms).getRegex(),ts=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,tn={_backpedal:Yt,anyPunctuation:Vi,autolink:Yi,blockSkip:Hi,br:ds,code:Pi,del:Yt,emStrongLDelim:qi,emStrongRDelimAst:Wi,emStrongRDelimUnd:Ki,escape:Oi,link:Qi,nolink:ms,punctuation:zi,reflink:gs,reflinkSearch:Ji,tag:Xi,text:Fi,url:Yt},eo={...tn,link:te(/^!?\[(label)\]\((.*?)\)/).replace("label",hr).getRegex(),reflink:te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",hr).getRegex()},Wr={...tn,emStrongRDelimAst:Gi,emStrongLDelim:ji,url:te(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ts).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:te(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ts).getRegex()},to={...Wr,br:te(ds).replace("{2,}","*").getRegex(),text:te(Wr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},pr={normal:Jr,gfm:Ni,pedantic:Mi},Gt={normal:tn,gfm:Wr,breaks:to,pedantic:eo},ro={"&":"&","<":"<",">":">",'"':""","'":"'"},rs=r=>ro[r];function Qe(r,e){if(e){if(Le.escapeTest.test(r))return r.replace(Le.escapeReplace,rs)}else if(Le.escapeTestNoEncode.test(r))return r.replace(Le.escapeReplaceNoEncode,rs);return r}function ns(r){try{r=encodeURI(r).replace(Le.percentDecode,"%")}catch{return null}return r}function ss(r,e){let t=r.replace(Le.findPipe,(i,o,l)=>{let a=!1,p=o;for(;--p>=0&&l[p]==="\\";)a=!a;return a?"|":" |"}),s=t.split(Le.splitPipe),n=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(;n<s.length;n++)s[n]=s[n].trim().replace(Le.slashPipe,"|");return s}function Kt(r,e,t){let s=r.length;if(s===0)return"";let n=0;for(;n<s;){let i=r.charAt(s-n-1);if(i===e&&!t)n++;else if(i!==e&&t)n++;else break}return r.slice(0,s-n)}function no(r,e){if(r.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<r.length;s++)if(r[s]==="\\")s++;else if(r[s]===e[0])t++;else if(r[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function is(r,e,t,s,n){let i=e.href,o=e.title||null,l=r[1].replace(n.other.outputLinkReplace,"$1");s.state.inLink=!0;let a={type:r[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:o,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,a}function so(r,e,t){let s=r.match(t.other.indentCodeCompensation);if(s===null)return e;let n=s[1];return e.split(`
|
|
76
76
|
`).map(i=>{let o=i.match(t.other.beginningSpace);if(o===null)return i;let[l]=o;return l.length>=n.length?i.slice(n.length):i}).join(`
|
|
77
|
-
`)}var
|
|
78
|
-
`)}}}fences(r){let e=this.rules.block.fences.exec(r);if(e){let t=e[0],s=
|
|
79
|
-
`)}}blockquote(r){let e=this.rules.block.blockquote.exec(r);if(e){let t=
|
|
77
|
+
`)}var gr=class{constructor(r){ae(this,"options");ae(this,"rules");ae(this,"lexer");this.options=r||gt}space(r){let e=this.rules.block.newline.exec(r);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(r){let e=this.rules.block.code.exec(r);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Kt(t,`
|
|
78
|
+
`)}}}fences(r){let e=this.rules.block.fences.exec(r);if(e){let t=e[0],s=so(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(r){let e=this.rules.block.heading.exec(r);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=Kt(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(t=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(r){let e=this.rules.block.hr.exec(r);if(e)return{type:"hr",raw:Kt(e[0],`
|
|
79
|
+
`)}}blockquote(r){let e=this.rules.block.blockquote.exec(r);if(e){let t=Kt(e[0],`
|
|
80
80
|
`).split(`
|
|
81
81
|
`),s="",n="",i=[];for(;t.length>0;){let o=!1,l=[],a;for(a=0;a<t.length;a++)if(this.rules.other.blockquoteStart.test(t[a]))l.push(t[a]),o=!0;else if(!o)l.push(t[a]);else break;t=t.slice(a);let p=l.join(`
|
|
82
82
|
`),f=p.replace(this.rules.other.blockquoteSetextReplace,`
|
|
@@ -84,19 +84,19 @@ var Cs=Object.create;var _r=Object.defineProperty;var Rs=Object.getOwnPropertyDe
|
|
|
84
84
|
${p}`:p,n=n?`${n}
|
|
85
85
|
${f}`:f;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,i,!0),this.lexer.state.top=c,t.length===0)break;let g=i.at(-1);if(g?.type==="code")break;if(g?.type==="blockquote"){let m=g,k=m.raw+`
|
|
86
86
|
`+t.join(`
|
|
87
|
-
`),
|
|
87
|
+
`),_=this.blockquote(k);i[i.length-1]=_,s=s.substring(0,s.length-m.raw.length)+_.raw,n=n.substring(0,n.length-m.text.length)+_.text;break}else if(g?.type==="list"){let m=g,k=m.raw+`
|
|
88
88
|
`+t.join(`
|
|
89
|
-
`),
|
|
89
|
+
`),_=this.list(k);i[i.length-1]=_,s=s.substring(0,s.length-g.raw.length)+_.raw,n=n.substring(0,n.length-m.raw.length)+_.raw,t=k.substring(i.at(-1).raw.length).split(`
|
|
90
90
|
`);continue}}return{type:"blockquote",raw:s,tokens:i,text:n}}}list(r){let e=this.rules.block.list.exec(r);if(e){let t=e[1].trim(),s=t.length>1,n={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 i=this.rules.other.listItemRegex(t),o=!1;for(;r;){let a=!1,p="",f="";if(!(e=i.exec(r))||this.rules.block.hr.test(r))break;p=e[0],r=r.substring(p.length);let c=e[2].split(`
|
|
91
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,
|
|
91
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,_=>" ".repeat(3*_.length)),g=r.split(`
|
|
92
92
|
`,1)[0],m=!c.trim(),k=0;if(this.options.pedantic?(k=2,f=c.trimStart()):m?k=e[1].length+1:(k=e[2].search(this.rules.other.nonSpaceChar),k=k>4?1:k,f=c.slice(k),k+=e[1].length),m&&this.rules.other.blankLine.test(g)&&(p+=g+`
|
|
93
|
-
`,r=r.substring(g.length+1),a=!0),!a){let
|
|
94
|
-
`,1)[0],
|
|
95
|
-
`+
|
|
96
|
-
`+g}!m&&!g.trim()&&(m=!0),p+=
|
|
97
|
-
`,r=r.substring(
|
|
98
|
-
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?i.align.push("right"):this.rules.other.tableAlignCenter.test(o)?i.align.push("center"):this.rules.other.tableAlignLeft.test(o)?i.align.push("left"):i.align.push(null);for(let o=0;o<t.length;o++)i.header.push({text:t[o],tokens:this.lexer.inline(t[o]),header:!0,align:i.align[o]});for(let o of n)i.rows.push(
|
|
99
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(r){let e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){let e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){let e=this.rules.inline.tag.exec(r);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(r){let e=this.rules.inline.link.exec(r);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let i=
|
|
93
|
+
`,r=r.substring(g.length+1),a=!0),!a){let _=this.rules.other.nextBulletRegex(k),$=this.rules.other.hrRegex(k),S=this.rules.other.fencesBeginRegex(k),z=this.rules.other.headingBeginRegex(k),R=this.rules.other.htmlBeginRegex(k);for(;r;){let x=r.split(`
|
|
94
|
+
`,1)[0],M;if(g=x,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),M=g):M=g.replace(this.rules.other.tabCharGlobal," "),S.test(g)||z.test(g)||R.test(g)||_.test(g)||$.test(g))break;if(M.search(this.rules.other.nonSpaceChar)>=k||!g.trim())f+=`
|
|
95
|
+
`+M.slice(k);else{if(m||c.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(c)||z.test(c)||$.test(c))break;f+=`
|
|
96
|
+
`+g}!m&&!g.trim()&&(m=!0),p+=x+`
|
|
97
|
+
`,r=r.substring(x.length+1),c=M.slice(k)}}n.loose||(o?n.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(o=!0)),n.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(f),loose:!1,text:f,tokens:[]}),n.raw+=p}let l=n.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let a of n.items){if(this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]),a.task){if(a.text=a.text.replace(this.rules.other.listReplaceTask,""),a.tokens[0]?.type==="text"||a.tokens[0]?.type==="paragraph"){a.tokens[0].raw=a.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),a.tokens[0].text=a.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}}let p=this.rules.other.listTaskCheckbox.exec(a.raw);if(p){let f={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};a.checked=f.checked,n.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=f.raw+a.tokens[0].raw,a.tokens[0].text=f.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(f)):a.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):a.tokens.unshift(f)}}if(!n.loose){let p=a.tokens.filter(c=>c.type==="space"),f=p.length>0&&p.some(c=>this.rules.other.anyLine.test(c.raw));n.loose=f}}if(n.loose)for(let a of n.items){a.loose=!0;for(let p of a.tokens)p.type==="text"&&(p.type="paragraph")}return n}}html(r){let e=this.rules.block.html.exec(r);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(r){let e=this.rules.block.def.exec(r);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:s,title:n}}}table(r){let e=this.rules.block.table.exec(r);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=ss(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
98
|
+
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?i.align.push("right"):this.rules.other.tableAlignCenter.test(o)?i.align.push("center"):this.rules.other.tableAlignLeft.test(o)?i.align.push("left"):i.align.push(null);for(let o=0;o<t.length;o++)i.header.push({text:t[o],tokens:this.lexer.inline(t[o]),header:!0,align:i.align[o]});for(let o of n)i.rows.push(ss(o,i.header.length).map((l,a)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:i.align[a]})));return i}}lheading(r){let e=this.rules.block.lheading.exec(r);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(r){let e=this.rules.block.paragraph.exec(r);if(e){let t=e[1].charAt(e[1].length-1)===`
|
|
99
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(r){let e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){let e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){let e=this.rules.inline.tag.exec(r);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(r){let e=this.rules.inline.link.exec(r);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let i=Kt(t.slice(0,-1),"\\");if((t.length-i.length)%2===0)return}else{let i=no(e[2],"()");if(i===-2)return;if(i>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let s=e[2],n="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],n=i[3])}else n=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)),is(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(r,e){let t;if((t=this.rules.inline.reflink.exec(r))||(t=this.rules.inline.nolink.exec(r))){let s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[s.toLowerCase()];if(!n){let i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return is(t,n,t[0],this.lexer,this.rules)}}emStrong(r,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(r);if(!(!s||s[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!t||this.rules.inline.punctuation.exec(t))){let n=[...s[0]].length-1,i,o,l=n,a=0,p=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*r.length+n);(s=p.exec(e))!=null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(o=[...i].length,s[3]||s[4]){l+=o;continue}else if((s[5]||s[6])&&n%3&&!((n+o)%3)){a+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+a);let f=[...s[0]][0].length,c=r.slice(0,n+s.index+f+o);if(Math.min(n,o)%2){let m=c.slice(1,-1);return{type:"em",raw:c,text:m,tokens:this.lexer.inlineTokens(m)}}let g=c.slice(2,-2);return{type:"strong",raw:c,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(r){let e=this.rules.inline.code.exec(r);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(t),n=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&n&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(r){let e=this.rules.inline.br.exec(r);if(e)return{type:"br",raw:e[0]}}del(r){let e=this.rules.inline.del.exec(r);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(r){let e=this.rules.inline.autolink.exec(r);if(e){let t,s;return e[2]==="@"?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}url(r){let e;if(e=this.rules.inline.url.exec(r)){let t,s;if(e[2]==="@")t=e[0],s="mailto:"+t;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==e[0]);t=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(r){let e=this.rules.inline.text.exec(r);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},je=class Gr{constructor(e){ae(this,"tokens");ae(this,"options");ae(this,"state");ae(this,"inlineQueue");ae(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||gt,this.options.tokenizer=this.options.tokenizer||new gr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Le,block:pr.normal,inline:Gt.normal};this.options.pedantic?(t.block=pr.pedantic,t.inline=Gt.pedantic):this.options.gfm&&(t.block=pr.gfm,this.options.breaks?t.inline=Gt.breaks:t.inline=Gt.gfm),this.tokenizer.rules=t}static get rules(){return{block:pr,inline:Gt}}static lex(e,t){return new Gr(t).lex(e)}static lexInline(e,t){return new Gr(t).inlineTokens(e)}lex(e){e=e.replace(Le.carriageReturn,`
|
|
100
100
|
`),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){for(this.options.pedantic&&(e=e.replace(Le.tabCharGlobal," ").replace(Le.spaceLine,""));e;){let n;if(this.options.extensions?.block?.some(o=>(n=o.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let o=t.at(-1);n.raw.length===1&&o!==void 0?o.raw+=`
|
|
101
101
|
`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
102
102
|
`)?"":`
|
|
@@ -110,9 +110,9 @@ ${f}`:f;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
110
110
|
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(n),s=i.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let o=t.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
111
111
|
`)?"":`
|
|
112
112
|
`)+n.raw,o.text+=`
|
|
113
|
-
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(n);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let s=e,n=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)a.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,n.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(n=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)i=n[2]?n[2].length:0,s=s.slice(0,n.index+i)+"["+"a".repeat(n[0].length-i-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let o=!1,l="";for(;e;){o||(l=""),o=!1;let a;if(this.options.extensions?.inline?.some(f=>(a=f.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let f=t.at(-1);a.type==="text"&&f?.type==="text"?(f.raw+=a.raw,f.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,s,l)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let p=e;if(this.options.extensions?.startInline){let f=1/0,c=e.slice(1),g;this.options.extensions.startInline.forEach(m=>{g=m.call({lexer:this},c),typeof g=="number"&&g>=0&&(f=Math.min(f,g))}),f<1/0&&f>=0&&(p=e.substring(0,f+1))}if(a=this.tokenizer.inlineText(p)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(l=a.raw.slice(-1)),o=!0;let f=t.at(-1);f?.type==="text"?(f.raw+=a.raw,f.text+=a.text):t.push(a);continue}if(e){let f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return t}},
|
|
114
|
-
`;return s?'<pre><code class="language-'+
|
|
115
|
-
`:"<pre><code>"+(t?n:
|
|
113
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(n);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let s=e,n=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)a.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,n.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(n=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)i=n[2]?n[2].length:0,s=s.slice(0,n.index+i)+"["+"a".repeat(n[0].length-i-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let o=!1,l="";for(;e;){o||(l=""),o=!1;let a;if(this.options.extensions?.inline?.some(f=>(a=f.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let f=t.at(-1);a.type==="text"&&f?.type==="text"?(f.raw+=a.raw,f.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,s,l)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let p=e;if(this.options.extensions?.startInline){let f=1/0,c=e.slice(1),g;this.options.extensions.startInline.forEach(m=>{g=m.call({lexer:this},c),typeof g=="number"&&g>=0&&(f=Math.min(f,g))}),f<1/0&&f>=0&&(p=e.substring(0,f+1))}if(a=this.tokenizer.inlineText(p)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(l=a.raw.slice(-1)),o=!0;let f=t.at(-1);f?.type==="text"?(f.raw+=a.raw,f.text+=a.text):t.push(a);continue}if(e){let f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return t}},mr=class{constructor(r){ae(this,"options");ae(this,"parser");this.options=r||gt}space(r){return""}code({text:r,lang:e,escaped:t}){let s=(e||"").match(Le.notSpaceStart)?.[0],n=r.replace(Le.endingNewline,"")+`
|
|
114
|
+
`;return s?'<pre><code class="language-'+Qe(s)+'">'+(t?n:Qe(n,!0))+`</code></pre>
|
|
115
|
+
`:"<pre><code>"+(t?n:Qe(n,!0))+`</code></pre>
|
|
116
116
|
`}blockquote({tokens:r}){return`<blockquote>
|
|
117
117
|
${this.parser.parse(r)}</blockquote>
|
|
118
118
|
`}html({text:r}){return r}def(r){return""}heading({tokens:r,depth:e}){return`<h${e}>${this.parser.parseInline(r)}</h${e}>
|
|
@@ -128,169 +128,169 @@ ${this.parser.parse(r)}</blockquote>
|
|
|
128
128
|
`}tablerow({text:r}){return`<tr>
|
|
129
129
|
${r}</tr>
|
|
130
130
|
`}tablecell(r){let e=this.parser.parseInline(r.tokens),t=r.header?"th":"td";return(r.align?`<${t} align="${r.align}">`:`<${t}>`)+e+`</${t}>
|
|
131
|
-
`}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${
|
|
132
|
-
Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error occurred:</p><pre>"+
|
|
131
|
+
`}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${Qe(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:e,tokens:t}){let s=this.parser.parseInline(t),n=ns(r);if(n===null)return s;r=n;let i='<a href="'+r+'"';return e&&(i+=' title="'+Qe(e)+'"'),i+=">"+s+"</a>",i}image({href:r,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let n=ns(r);if(n===null)return Qe(t);r=n;let i=`<img src="${r}" alt="${t}"`;return e&&(i+=` title="${Qe(e)}"`),i+=">",i}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:Qe(r.text)}},rn=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}checkbox({raw:r}){return r}},We=class Kr{constructor(e){ae(this,"options");ae(this,"renderer");ae(this,"textRenderer");this.options=e||gt,this.options.renderer=this.options.renderer||new mr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new rn}static parse(e,t){return new Kr(t).parse(e)}static parseInline(e,t){return new Kr(t).parseInline(e)}parse(e){let t="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let o=n,l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){t+=l||"";continue}}let i=n;switch(i.type){case"space":{t+=this.renderer.space(i);break}case"hr":{t+=this.renderer.hr(i);break}case"heading":{t+=this.renderer.heading(i);break}case"code":{t+=this.renderer.code(i);break}case"table":{t+=this.renderer.table(i);break}case"blockquote":{t+=this.renderer.blockquote(i);break}case"list":{t+=this.renderer.list(i);break}case"checkbox":{t+=this.renderer.checkbox(i);break}case"html":{t+=this.renderer.html(i);break}case"def":{t+=this.renderer.def(i);break}case"paragraph":{t+=this.renderer.paragraph(i);break}case"text":{t+=this.renderer.text(i);break}default:{let o='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return t}parseInline(e,t=this.renderer){let s="";for(let n=0;n<e.length;n++){let i=e[n];if(this.options.extensions?.renderers?.[i.type]){let l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=l||"";continue}}let o=i;switch(o.type){case"escape":{s+=t.text(o);break}case"html":{s+=t.html(o);break}case"link":{s+=t.link(o);break}case"image":{s+=t.image(o);break}case"checkbox":{s+=t.checkbox(o);break}case"strong":{s+=t.strong(o);break}case"em":{s+=t.em(o);break}case"codespan":{s+=t.codespan(o);break}case"br":{s+=t.br(o);break}case"del":{s+=t.del(o);break}case"text":{s+=t.text(o);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}},fr,Vt=(fr=class{constructor(r){ae(this,"options");ae(this,"block");this.options=r||gt}preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}emStrongMask(r){return r}provideLexer(){return this.block?je.lex:je.lexInline}provideParser(){return this.block?We.parse:We.parseInline}},ae(fr,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),ae(fr,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),fr),io=class{constructor(...r){ae(this,"defaults",Vr());ae(this,"options",this.setOptions);ae(this,"parse",this.parseMarkdown(!0));ae(this,"parseInline",this.parseMarkdown(!1));ae(this,"Parser",We);ae(this,"Renderer",mr);ae(this,"TextRenderer",rn);ae(this,"Lexer",je);ae(this,"Tokenizer",gr);ae(this,"Hooks",Vt);this.use(...r)}walkTokens(r,e){let t=[];for(let s of r)switch(t=t.concat(e.call(this,s)),s.type){case"table":{let n=s;for(let i of n.header)t=t.concat(this.walkTokens(i.tokens,e));for(let i of n.rows)for(let o of i)t=t.concat(this.walkTokens(o.tokens,e));break}case"list":{let n=s;t=t.concat(this.walkTokens(n.items,e));break}default:{let n=s;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(i=>{let o=n[i].flat(1/0);t=t.concat(this.walkTokens(o,e))}):n.tokens&&(t=t.concat(this.walkTokens(n.tokens,e)))}}return t}use(...r){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(t=>{let s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let i=e.renderers[n.name];i?e.renderers[n.name]=function(...o){let l=n.renderer.apply(this,o);return l===!1&&(l=i.apply(this,o)),l}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[n.level];i?i.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),s.extensions=e),t.renderer){let n=this.defaults.renderer||new mr(this.defaults);for(let i in t.renderer){if(!(i in n))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let o=i,l=t.renderer[o],a=n[o];n[o]=(...p)=>{let f=l.apply(n,p);return f===!1&&(f=a.apply(n,p)),f||""}}s.renderer=n}if(t.tokenizer){let n=this.defaults.tokenizer||new gr(this.defaults);for(let i in t.tokenizer){if(!(i in n))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let o=i,l=t.tokenizer[o],a=n[o];n[o]=(...p)=>{let f=l.apply(n,p);return f===!1&&(f=a.apply(n,p)),f}}s.tokenizer=n}if(t.hooks){let n=this.defaults.hooks||new Vt;for(let i in t.hooks){if(!(i in n))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let o=i,l=t.hooks[o],a=n[o];Vt.passThroughHooks.has(i)?n[o]=p=>{if(this.defaults.async&&Vt.passThroughHooksRespectAsync.has(i))return(async()=>{let c=await l.call(n,p);return a.call(n,c)})();let f=l.call(n,p);return a.call(n,f)}:n[o]=(...p)=>{if(this.defaults.async)return(async()=>{let c=await l.apply(n,p);return c===!1&&(c=await a.apply(n,p)),c})();let f=l.apply(n,p);return f===!1&&(f=a.apply(n,p)),f}}s.hooks=n}if(t.walkTokens){let n=this.defaults.walkTokens,i=t.walkTokens;s.walkTokens=function(o){let l=[];return l.push(i.call(this,o)),n&&(l=l.concat(n.call(this,o))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,e){return je.lex(r,e??this.defaults)}parser(r,e){return We.parse(r,e??this.defaults)}parseMarkdown(r){return(e,t)=>{let s={...t},n={...this.defaults,...s},i=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&s.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=r),n.async)return(async()=>{let o=n.hooks?await n.hooks.preprocess(e):e,l=await(n.hooks?await n.hooks.provideLexer():r?je.lex:je.lexInline)(o,n),a=n.hooks?await n.hooks.processAllTokens(l):l;n.walkTokens&&await Promise.all(this.walkTokens(a,n.walkTokens));let p=await(n.hooks?await n.hooks.provideParser():r?We.parse:We.parseInline)(a,n);return n.hooks?await n.hooks.postprocess(p):p})().catch(i);try{n.hooks&&(e=n.hooks.preprocess(e));let o=(n.hooks?n.hooks.provideLexer():r?je.lex:je.lexInline)(e,n);n.hooks&&(o=n.hooks.processAllTokens(o)),n.walkTokens&&this.walkTokens(o,n.walkTokens);let l=(n.hooks?n.hooks.provideParser():r?We.parse:We.parseInline)(o,n);return n.hooks&&(l=n.hooks.postprocess(l)),l}catch(o){return i(o)}}}onError(r,e){return t=>{if(t.message+=`
|
|
132
|
+
Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error occurred:</p><pre>"+Qe(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},ht=new io;function ne(r,e){return ht.parse(r,e)}ne.options=ne.setOptions=function(r){return ht.setOptions(r),ne.defaults=ht.defaults,os(ne.defaults),ne};ne.getDefaults=Vr;ne.defaults=gt;ne.use=function(...r){return ht.use(...r),ne.defaults=ht.defaults,os(ne.defaults),ne};ne.walkTokens=function(r,e){return ht.walkTokens(r,e)};ne.parseInline=ht.parseInline;ne.Parser=We;ne.parser=We.parse;ne.Renderer=mr;ne.TextRenderer=rn;ne.Lexer=je;ne.lexer=je.lex;ne.Tokenizer=gr;ne.Hooks=Vt;ne.parse=ne;var ia=ne.options,oa=ne.setOptions,aa=ne.use,la=ne.walkTokens,ca=ne.parseInline;var da=We.parse,ua=je.lex;function Xt(r){let e=ne.parse(r),t=Zn.sanitize(e);return Jn(t)}function mt(r){switch((r||"").toString()){case"open":return"Open";case"in_progress":return"In progress";case"closed":return"Closed";default:return(r||"").toString()||"Open"}}function oo(r){if(!r)return"";try{return new Date(r).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return r}}function ao(r){window.location.hash=r}function bs(r,e,t=ao,s=void 0){let n=le("views:detail"),i=null,o=null,l=!1,a=!1,p=!1,f=!1,c=!1,g=!1,m=!1,k="",_="",$=!1,S=new Set,z=new Map,R=null;function x(){return R||(R=document.createElement("dialog"),R.id="delete-confirm-dialog",R.setAttribute("role","alertdialog"),R.setAttribute("aria-modal","true"),document.body.appendChild(R),R)}function M(){if(!i)return;let u=x(),A=i.id,P=i.title||"(no title)";u.innerHTML=`
|
|
133
133
|
<div class="delete-confirm">
|
|
134
134
|
<h2 class="delete-confirm__title">Delete Issue</h2>
|
|
135
135
|
<p class="delete-confirm__message">
|
|
136
|
-
Are you sure you want to delete issue <strong>${
|
|
136
|
+
Are you sure you want to delete issue <strong>${A}</strong> \u2014 <strong>${P}</strong>? This action cannot be undone.
|
|
137
137
|
</p>
|
|
138
138
|
<div class="delete-confirm__actions">
|
|
139
139
|
<button type="button" class="btn" id="delete-cancel-btn">Cancel</button>
|
|
140
140
|
<button type="button" class="btn danger" id="delete-confirm-btn">Delete</button>
|
|
141
141
|
</div>
|
|
142
142
|
</div>
|
|
143
|
-
`;let
|
|
143
|
+
`;let E=u.querySelector("#delete-cancel-btn"),se=u.querySelector("#delete-confirm-btn");if(E?.addEventListener("click",()=>{typeof u.close=="function"&&u.close(),u.removeAttribute("open")}),se?.addEventListener("click",async()=>{typeof u.close=="function"&&u.close(),u.removeAttribute("open"),await K()}),u.addEventListener("cancel",be=>{be.preventDefault(),typeof u.close=="function"&&u.close(),u.removeAttribute("open")}),typeof u.showModal=="function")try{u.showModal(),u.setAttribute("open","")}catch{u.setAttribute("open","")}else u.setAttribute("open","")}async function K(){if(!i)return;let u=i.id;try{await e("delete-issue",{id:u}),i=null,o=null,L();let A=$t(window.location.hash||"");t(`#/${A}`)}catch(A){n("delete failed: %o",A),pe("Failed to delete issue","error")}}function oe(u){u.stopPropagation(),u.preventDefault(),M()}function D(u){let A=$t(window.location.hash||"");return st(A,u)}function q(u){Te(C`
|
|
144
144
|
<div class="panel__body" id="detail-root">
|
|
145
145
|
<p class="muted">${u}</p>
|
|
146
146
|
</div>
|
|
147
|
-
`,r)}function
|
|
147
|
+
`,r)}function j(){if(!o||!s||typeof s.snapshotFor!="function")return;let u=s.snapshotFor(`detail:${o}`);Array.isArray(u)&&u.length>0&&(i=u.find(P=>String(P.id)===String(o))||u[0])}function ee(u){let A=Number(u.comment_count);return Number.isFinite(A)&&A>=0?A:null}function ke(u){let A=u.comments;if(!Array.isArray(A))return!1;let P=ee(u);if(P===null)return!0;let E=String(u.id);return A.length===P||z.get(E)===P}function _e(u,A,P){let E=String(u.id),se=ee(u);z.set(E,se!==null&&P?se:A.length)}async function w(u){let A=u?String(u):"";if(!(!A||o!==A||!i||String(i.id)!==A||ke(i)||S.has(A))){S.add(A);try{let P=await e("get-comments",{id:A});if(Array.isArray(P)&&i&&o===A&&String(i.id)===A){let E=ee(i);if(E!==null&&P.length!==E){z.set(A,P.length),n("comment count mismatch for %s: expected %d, got %d",A,E,P.length);return}i.comments=P,_e(i,P,!0),L()}}catch(P){n("fetch comments failed %s %o",A,P)}finally{S.delete(A)}}}s&&typeof s.subscribe=="function"&&s.subscribe(()=>{try{j(),L(),w(o)}catch(u){n("issue stores listener error %o",u)}});let b=()=>{a=!0,L()},v=u=>{u.key==="Enter"?(a=!0,L()):u.key==="Escape"&&(a=!1,L())},N=async()=>{if(!i||l)return;let u=r.querySelector("h2 input"),A=i.title||"",P=u?u.value:"";if(P===A){a=!1,L();return}l=!0,u&&(u.disabled=!0);try{n("save title %s \u2192 %s",String(i.id),P);let E=await e("edit-text",{id:i.id,field:"title",value:P});E&&typeof E=="object"&&(i=E,a=!1,L())}catch(E){n("save title failed %s %o",String(i.id),E),i.title=A,a=!1,L(),pe("Failed to save title","error")}finally{l=!1}},I=()=>{a=!1,L()},H=()=>{m=!0,L()},V=u=>{u.key==="Enter"?(u.preventDefault(),m=!0,L()):u.key==="Escape"&&(u.preventDefault(),m=!1,L())},B=async()=>{if(!i||l)return;let u=r.querySelector("#detail-root .prop.assignee input"),A=i?.assignee??"",P=u?.value??"";if(P===A){m=!1,L();return}l=!0,u&&(u.disabled=!0);try{n("save assignee %s \u2192 %s",String(i.id),P);let E=await e("update-assignee",{id:i.id,assignee:P});E&&typeof E=="object"&&(i=E,m=!1,L())}catch(E){n("save assignee failed %s %o",String(i.id),E),i.assignee=A,m=!1,L(),pe("Failed to update assignee","error")}finally{l=!1}},J=()=>{m=!1,L()},W=u=>{k=u.currentTarget.value||""};function ce(u){u.key==="Enter"&&(u.preventDefault(),Z())}async function Z(){if(!i||l)return;let u=k.trim();if(u){l=!0;try{n("add label %s \u2192 %s",String(i.id),u);let A=await e("label-add",{id:i.id,label:u});A&&typeof A=="object"&&(i=A,k="",L())}catch(A){n("add label failed %s %o",String(i.id),A),pe("Failed to add label","error")}finally{l=!1}}}async function ve(u){if(!(!i||l)){l=!0;try{n("remove label %s \u2192 %s",String(i?.id||""),u);let A=await e("label-remove",{id:i.id,label:u});A&&typeof A=="object"&&(i=A,L())}catch(A){n("remove label failed %s %o",String(i?.id||""),A),pe("Failed to remove label","error")}finally{l=!1}}}let $e=async u=>{if(!i||l){L();return}let A=u.currentTarget,P=i.status||"open",E=A.value;if(E!==P){l=!0,i.status=E,L();try{n("update status %s \u2192 %s",String(i.id),E);let se=await e("update-status",{id:i.id,status:E});se&&typeof se=="object"&&(i=se,L())}catch(se){n("update status failed %s %o",String(i.id),se),i.status=P,L(),pe("Failed to update status","error")}finally{l=!1}}},de=async u=>{if(!i||l){L();return}let A=u.currentTarget,P=typeof i.priority=="number"?i.priority:2,E=Number(A.value);if(E!==P){l=!0,i.priority=E,L();try{n("update priority %s \u2192 %d",String(i.id),E);let se=await e("update-priority",{id:i.id,priority:E});se&&typeof se=="object"&&(i=se,L())}catch(se){n("update priority failed %s %o",String(i.id),se),i.priority=P,L(),pe("Failed to update priority","error")}finally{l=!1}}},Q=()=>{p=!0,L()},he=u=>{if(u.key==="Escape")p=!1,L();else if(u.key==="Enter"&&u.ctrlKey){let A=r.querySelector("#detail-root .editable-actions button");A&&A.click()}},De=async()=>{if(!i||l)return;let u=r.querySelector("#detail-root textarea"),A=i.description||"",P=u?u.value:"";if(P===A){p=!1,L();return}l=!0,u&&(u.disabled=!0);try{n("save description %s",String(i?.id||""));let E=await e("edit-text",{id:i.id,field:"description",value:P});E&&typeof E=="object"&&(i=E,p=!1,L())}catch(E){n("save description failed %s %o",String(i?.id||""),E),i.description=A,p=!1,L(),pe("Failed to save description","error")}finally{l=!1}},Oe=()=>{p=!1,L()},xe=()=>{f=!0,L();try{let u=r.querySelector("#detail-root .design textarea");u&&u.focus()}catch(u){n("focus design textarea failed %o",u)}},ue=u=>{if(u.key==="Escape")f=!1,L();else if(u.key==="Enter"&&(u.ctrlKey||u.metaKey)){let A=r.querySelector("#detail-root .design .editable-actions button");A&&A.click()}},Pe=async()=>{if(!i||l)return;let u=r.querySelector("#detail-root .design textarea"),A=i.design||"",P=u?u.value:"";if(P===A){f=!1,L();return}l=!0,u&&(u.disabled=!0);try{n("save design %s",String(i?.id||""));let E=await e("edit-text",{id:i.id,field:"design",value:P});E&&typeof E=="object"&&(i=E,f=!1,L())}catch(E){n("save design failed %s %o",String(i?.id||""),E),i.design=A,f=!1,L(),pe("Failed to save design","error")}finally{l=!1}},Ge=()=>{f=!1,L()},Ke=()=>{c=!0,L()},Be=u=>{if(u.key==="Escape")c=!1,L();else if(u.key==="Enter"&&(u.ctrlKey||u.metaKey)){let A=r.querySelector("#detail-root .notes .editable-actions button");A&&A.click()}},y=async()=>{if(!i||l)return;let u=r.querySelector("#detail-root .notes textarea"),A=i.notes||"",P=u?u.value:"";if(P===A){c=!1,L();return}l=!0,u&&(u.disabled=!0);try{n("save notes %s",String(i?.id||""));let E=await e("edit-text",{id:i.id,field:"notes",value:P});E&&typeof E=="object"&&(i=E,c=!1,L())}catch(E){n("save notes failed %s %o",String(i?.id||""),E),i.notes=A,c=!1,L(),pe("Failed to save notes","error")}finally{l=!1}},h=()=>{c=!1,L()},U=()=>{g=!0,L()},G=u=>{if(u.key==="Escape")g=!1,L();else if(u.key==="Enter"&&(u.ctrlKey||u.metaKey)){let A=r.querySelector("#detail-root .acceptance .editable-actions button");A&&A.click()}},re=async()=>{if(!i||l)return;let u=r.querySelector("#detail-root .acceptance textarea"),A=i.acceptance||"",P=u?u.value:"";if(P===A){g=!1,L();return}l=!0,u&&(u.disabled=!0);try{n("save acceptance %s",String(i?.id||""));let E=await e("edit-text",{id:i.id,field:"acceptance",value:P});E&&typeof E=="object"&&(i=E,g=!1,L())}catch(E){n("save acceptance failed %s %o",String(i?.id||""),E),i.acceptance=A,g=!1,L(),pe("Failed to save acceptance","error")}finally{l=!1}},ge=()=>{g=!1,L()},at=u=>{let A=u.currentTarget,P=_.trim().length>0;_=A.value||"";let E=_.trim().length>0;P!==E&&L()},Ve=async()=>{if(!(!i||$||!_.trim())){$=!0,L();try{n("add comment to %s",String(i.id));let u=await e("add-comment",{id:i.id,text:_.trim()});Array.isArray(u)&&(i.comments=u,_e(i,u,!1),_="",L())}catch(u){n("add comment failed %s %o",String(i.id),u),pe("Failed to add comment","error")}finally{$=!1,L()}}},Je=u=>{u.key==="Enter"&&(u.ctrlKey||u.metaKey)&&(u.preventDefault(),Ve())};function Et(u,A){let P=u==="Dependencies"?"add-dependency":"add-dependent";return C`
|
|
148
148
|
<div class="props-card">
|
|
149
149
|
<div>
|
|
150
150
|
<div class="props-card__title">${u}</div>
|
|
151
151
|
</div>
|
|
152
152
|
<ul>
|
|
153
|
-
${!
|
|
154
|
-
data-href=${
|
|
155
|
-
@click=${()=>t(
|
|
153
|
+
${!A||A.length===0?null:A.map(E=>{let se=E.id,be=D(se);return C`<li
|
|
154
|
+
data-href=${be}
|
|
155
|
+
@click=${()=>t(be)}
|
|
156
156
|
>
|
|
157
|
-
${
|
|
158
|
-
<span class="text-truncate">${
|
|
157
|
+
${ft(E.issue_type||"")}
|
|
158
|
+
<span class="text-truncate">${E.title||""}</span>
|
|
159
159
|
<button
|
|
160
|
-
aria-label=${`Remove dependency ${
|
|
161
|
-
@click=${
|
|
160
|
+
aria-label=${`Remove dependency ${se}`}
|
|
161
|
+
@click=${Ct(se,u)}
|
|
162
162
|
>
|
|
163
163
|
×
|
|
164
164
|
</button>
|
|
165
165
|
</li>`})}
|
|
166
166
|
</ul>
|
|
167
167
|
<div class="props-card__footer">
|
|
168
|
-
<input type="text" placeholder="Issue ID" data-testid=${
|
|
169
|
-
<button @click=${
|
|
168
|
+
<input type="text" placeholder="Issue ID" data-testid=${P} />
|
|
169
|
+
<button @click=${er(A,u)}>Add</button>
|
|
170
170
|
</div>
|
|
171
171
|
</div>
|
|
172
|
-
`}function
|
|
172
|
+
`}function Jt(u){let A=a?C`<div class="detail-title">
|
|
173
173
|
<h2>
|
|
174
174
|
<input
|
|
175
175
|
type="text"
|
|
176
176
|
aria-label="Edit title"
|
|
177
177
|
.value=${u.title||""}
|
|
178
|
-
@keydown=${
|
|
178
|
+
@keydown=${bt}
|
|
179
179
|
/>
|
|
180
|
-
<button @click=${
|
|
181
|
-
<button @click=${
|
|
180
|
+
<button @click=${N}>Save</button>
|
|
181
|
+
<button @click=${I}>Cancel</button>
|
|
182
182
|
</h2>
|
|
183
|
-
</div>`:
|
|
183
|
+
</div>`:C`<div class="detail-title">
|
|
184
184
|
<h2>
|
|
185
185
|
<span
|
|
186
186
|
class="editable"
|
|
187
187
|
tabindex="0"
|
|
188
188
|
role="button"
|
|
189
189
|
aria-label="Edit title"
|
|
190
|
-
@click=${
|
|
191
|
-
@keydown=${
|
|
190
|
+
@click=${b}
|
|
191
|
+
@keydown=${v}
|
|
192
192
|
>${u.title||""}</span
|
|
193
193
|
>
|
|
194
194
|
</h2>
|
|
195
|
-
</div>`,
|
|
195
|
+
</div>`,P=C`<select
|
|
196
196
|
class=${`badge-select badge--status is-${u.status||"open"}`}
|
|
197
|
-
@change=${
|
|
197
|
+
@change=${$e}
|
|
198
198
|
.value=${u.status||"open"}
|
|
199
199
|
?disabled=${l}
|
|
200
200
|
>
|
|
201
|
-
${(()=>{let
|
|
202
|
-
${
|
|
201
|
+
${(()=>{let X=String(u.status||"open");return["open","in_progress","closed"].map(ie=>C`<option value=${ie} ?selected=${X===ie}>
|
|
202
|
+
${mt(ie)}
|
|
203
203
|
</option>`)})()}
|
|
204
|
-
</select>`,C
|
|
204
|
+
</select>`,E=C`<select
|
|
205
205
|
class=${`badge-select badge--priority is-p${String(typeof u.priority=="number"?u.priority:2)}`}
|
|
206
|
-
@change=${
|
|
206
|
+
@change=${de}
|
|
207
207
|
.value=${String(typeof u.priority=="number"?u.priority:2)}
|
|
208
208
|
?disabled=${l}
|
|
209
209
|
>
|
|
210
|
-
${(()=>{let
|
|
211
|
-
${
|
|
210
|
+
${(()=>{let X=String(typeof u.priority=="number"?u.priority:2);return ot.map((ie,Fe)=>C`<option value=${String(Fe)} ?selected=${X===String(Fe)}>
|
|
211
|
+
${zt(Fe)} ${ie}
|
|
212
212
|
</option>`)})()}
|
|
213
|
-
</select>`,
|
|
213
|
+
</select>`,se=p?C`<div class="description">
|
|
214
214
|
<textarea
|
|
215
|
-
@keydown=${
|
|
215
|
+
@keydown=${he}
|
|
216
216
|
.value=${u.description||""}
|
|
217
217
|
rows="8"
|
|
218
218
|
style="width:100%"
|
|
219
219
|
></textarea>
|
|
220
220
|
<div class="editable-actions">
|
|
221
|
-
<button @click=${
|
|
222
|
-
<button @click=${
|
|
221
|
+
<button @click=${De}>Save</button>
|
|
222
|
+
<button @click=${Oe}>Cancel</button>
|
|
223
223
|
</div>
|
|
224
|
-
</div>`:
|
|
224
|
+
</div>`:C`<div
|
|
225
225
|
class="md editable"
|
|
226
226
|
tabindex="0"
|
|
227
227
|
role="button"
|
|
228
228
|
aria-label="Edit description"
|
|
229
|
-
@click=${
|
|
230
|
-
@keydown=${
|
|
229
|
+
@click=${Q}
|
|
230
|
+
@keydown=${yt}
|
|
231
231
|
>
|
|
232
|
-
${(()=>{let
|
|
233
|
-
</div>`,
|
|
234
|
-
${
|
|
232
|
+
${(()=>{let X=u.description||"";return X.trim()===""?C`<div class="muted">Description</div>`:Xt(X)})()}
|
|
233
|
+
</div>`,be=(()=>{let X=u;return String(u.acceptance||X.acceptance_criteria||"")})(),tr=g?C`<div class="acceptance">
|
|
234
|
+
${be.trim().length>0?C`<div class="props-card__title">Acceptance Criteria</div>`:""}
|
|
235
235
|
<textarea
|
|
236
|
-
@keydown=${
|
|
237
|
-
.value=${
|
|
236
|
+
@keydown=${G}
|
|
237
|
+
.value=${be}
|
|
238
238
|
rows="6"
|
|
239
239
|
style="width:100%"
|
|
240
240
|
></textarea>
|
|
241
241
|
<div class="editable-actions">
|
|
242
|
-
<button @click=${
|
|
243
|
-
<button @click=${
|
|
242
|
+
<button @click=${re}>Save</button>
|
|
243
|
+
<button @click=${ge}>Cancel</button>
|
|
244
244
|
</div>
|
|
245
|
-
</div>`:
|
|
246
|
-
${(()=>{let
|
|
245
|
+
</div>`:C`<div class="acceptance">
|
|
246
|
+
${(()=>{let X=be,ie=X.trim().length>0;return C`${ie?C`<div class="props-card__title">Acceptance Criteria</div>`:""}
|
|
247
247
|
<div
|
|
248
248
|
class="md editable"
|
|
249
249
|
tabindex="0"
|
|
250
250
|
role="button"
|
|
251
251
|
aria-label="Edit acceptance criteria"
|
|
252
|
-
@click=${
|
|
253
|
-
@keydown=${
|
|
252
|
+
@click=${U}
|
|
253
|
+
@keydown=${Ue}
|
|
254
254
|
>
|
|
255
|
-
${
|
|
255
|
+
${ie?Xt(X):C`<div class="muted">Add acceptance criteria…</div>`}
|
|
256
256
|
</div>`})()}
|
|
257
|
-
</div>`,Ae=String(u.notes||""),
|
|
258
|
-
${Ae.trim().length>0?
|
|
257
|
+
</div>`,Ae=String(u.notes||""),ye=c?C`<div class="notes">
|
|
258
|
+
${Ae.trim().length>0?C`<div class="props-card__title">Notes</div>`:""}
|
|
259
259
|
<textarea
|
|
260
|
-
@keydown=${
|
|
260
|
+
@keydown=${Be}
|
|
261
261
|
.value=${Ae}
|
|
262
262
|
rows="6"
|
|
263
263
|
style="width:100%"
|
|
264
264
|
></textarea>
|
|
265
265
|
<div class="editable-actions">
|
|
266
|
-
<button @click=${
|
|
267
|
-
<button @click=${
|
|
266
|
+
<button @click=${y}>Save</button>
|
|
267
|
+
<button @click=${h}>Cancel</button>
|
|
268
268
|
</div>
|
|
269
|
-
</div>`:
|
|
270
|
-
${(()=>{let
|
|
269
|
+
</div>`:C`<div class="notes">
|
|
270
|
+
${(()=>{let X=Ae,ie=X.trim().length>0;return C`${ie?C`<div class="props-card__title">Notes</div>`:""}
|
|
271
271
|
<div
|
|
272
272
|
class="md editable"
|
|
273
273
|
tabindex="0"
|
|
274
274
|
role="button"
|
|
275
275
|
aria-label="Edit notes"
|
|
276
|
-
@click=${
|
|
277
|
-
@keydown=${
|
|
276
|
+
@click=${Ke}
|
|
277
|
+
@keydown=${et}
|
|
278
278
|
>
|
|
279
|
-
${
|
|
279
|
+
${ie?Xt(X):C`<div class="muted">Add notes…</div>`}
|
|
280
280
|
</div>`})()}
|
|
281
|
-
</div>`,
|
|
281
|
+
</div>`,tt=Array.isArray(u.labels)?u.labels:[],_r=C`<div class="props-card labels">
|
|
282
282
|
<div>
|
|
283
283
|
<div class="props-card__title">Labels</div>
|
|
284
284
|
</div>
|
|
285
285
|
<ul>
|
|
286
|
-
${
|
|
287
|
-
<span class="badge" title=${
|
|
288
|
-
>${
|
|
286
|
+
${tt.map(X=>C`<li>
|
|
287
|
+
<span class="badge" title=${X}
|
|
288
|
+
>${X}
|
|
289
289
|
<button
|
|
290
290
|
class="icon-button"
|
|
291
291
|
title="Remove label"
|
|
292
|
-
aria-label=${"Remove label "+
|
|
293
|
-
@click=${()=>
|
|
292
|
+
aria-label=${"Remove label "+X}
|
|
293
|
+
@click=${()=>ve(X)}
|
|
294
294
|
style="margin-left:6px"
|
|
295
295
|
>
|
|
296
296
|
×
|
|
@@ -304,76 +304,76 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
304
304
|
placeholder="Label"
|
|
305
305
|
size="12"
|
|
306
306
|
.value=${k}
|
|
307
|
-
@input=${
|
|
308
|
-
@keydown=${
|
|
307
|
+
@input=${W}
|
|
308
|
+
@keydown=${ce}
|
|
309
309
|
/>
|
|
310
|
-
<button @click=${
|
|
310
|
+
<button @click=${Z}>Add</button>
|
|
311
311
|
</div>
|
|
312
|
-
</div>`,
|
|
313
|
-
${
|
|
312
|
+
</div>`,wt=String(u.design||""),It=f?C`<div class="design">
|
|
313
|
+
${wt.trim().length>0?C`<div class="props-card__title">Design</div>`:""}
|
|
314
314
|
<textarea
|
|
315
|
-
@keydown=${
|
|
316
|
-
.value=${
|
|
315
|
+
@keydown=${ue}
|
|
316
|
+
.value=${wt}
|
|
317
317
|
rows="6"
|
|
318
318
|
style="width:100%"
|
|
319
319
|
></textarea>
|
|
320
320
|
<div class="editable-actions">
|
|
321
|
-
<button @click=${
|
|
322
|
-
<button @click=${
|
|
321
|
+
<button @click=${Pe}>Save</button>
|
|
322
|
+
<button @click=${Ge}>Cancel</button>
|
|
323
323
|
</div>
|
|
324
|
-
</div>`:
|
|
325
|
-
${(()=>{let
|
|
324
|
+
</div>`:C`<div class="design">
|
|
325
|
+
${(()=>{let X=wt,ie=X.trim().length>0;return C`${ie?C`<div class="props-card__title">Design</div>`:""}
|
|
326
326
|
<div
|
|
327
327
|
class="md editable"
|
|
328
328
|
tabindex="0"
|
|
329
329
|
role="button"
|
|
330
330
|
aria-label="Edit design"
|
|
331
|
-
@click=${
|
|
332
|
-
@keydown=${
|
|
331
|
+
@click=${xe}
|
|
332
|
+
@keydown=${Rt}
|
|
333
333
|
>
|
|
334
|
-
${
|
|
334
|
+
${ie?Xt(X):C`<div class="muted">Add design…</div>`}
|
|
335
335
|
</div>`})()}
|
|
336
|
-
</div>`,
|
|
336
|
+
</div>`,Lt=Array.isArray(u.comments)?u.comments:[],rr=C`<div class="comments">
|
|
337
337
|
<div class="props-card__title">Comments</div>
|
|
338
|
-
${
|
|
338
|
+
${Lt.length===0?C`<div class="muted">No comments yet</div>`:Lt.map(X=>C`
|
|
339
339
|
<div class="comment-item">
|
|
340
340
|
<div class="comment-header">
|
|
341
|
-
<span class="comment-author">${
|
|
341
|
+
<span class="comment-author">${X.author||"Unknown"}</span>
|
|
342
342
|
<span class="comment-date"
|
|
343
|
-
>${
|
|
343
|
+
>${oo(X.created_at)}</span
|
|
344
344
|
>
|
|
345
345
|
</div>
|
|
346
|
-
<div class="comment-text">${
|
|
346
|
+
<div class="comment-text">${X.text}</div>
|
|
347
347
|
</div>
|
|
348
348
|
`)}
|
|
349
349
|
<div class="comment-input">
|
|
350
350
|
<textarea
|
|
351
351
|
placeholder="Add a comment... (Ctrl+Enter to submit)"
|
|
352
352
|
rows="3"
|
|
353
|
-
.value=${
|
|
354
|
-
@input=${
|
|
355
|
-
@keydown=${
|
|
356
|
-
?disabled=${
|
|
353
|
+
.value=${_}
|
|
354
|
+
@input=${at}
|
|
355
|
+
@keydown=${Je}
|
|
356
|
+
?disabled=${$}
|
|
357
357
|
></textarea>
|
|
358
358
|
<button
|
|
359
|
-
@click=${
|
|
360
|
-
?disabled=${
|
|
359
|
+
@click=${Ve}
|
|
360
|
+
?disabled=${$||!_.trim()}
|
|
361
361
|
>
|
|
362
|
-
${
|
|
362
|
+
${$?"Adding...":"Add Comment"}
|
|
363
363
|
</button>
|
|
364
364
|
</div>
|
|
365
|
-
</div>`;return
|
|
365
|
+
</div>`;return C`
|
|
366
366
|
<div class="panel__body" id="detail-root">
|
|
367
367
|
<div class="detail-layout">
|
|
368
368
|
<div class="detail-main">
|
|
369
|
-
${
|
|
370
|
-
${
|
|
369
|
+
${A} ${se} ${It} ${ye}
|
|
370
|
+
${tr} ${rr}
|
|
371
371
|
</div>
|
|
372
372
|
<div class="detail-side">
|
|
373
373
|
<div class="props-card">
|
|
374
374
|
<div class="props-card__header">
|
|
375
375
|
<div class="props-card__title">Properties</div>
|
|
376
|
-
<button class="delete-issue-btn" title="Delete issue" aria-label="Delete issue" @click=${
|
|
376
|
+
<button class="delete-issue-btn" title="Delete issue" aria-label="Delete issue" @click=${oe}>
|
|
377
377
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
378
378
|
<polyline points="3 6 5 6 21 6"></polyline>
|
|
379
379
|
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
|
|
@@ -386,87 +386,87 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
386
386
|
<div class="prop">
|
|
387
387
|
<div class="label">Type</div>
|
|
388
388
|
<div class="value">
|
|
389
|
-
${
|
|
389
|
+
${ft(u.issue_type)}
|
|
390
390
|
</div>
|
|
391
391
|
</div>
|
|
392
392
|
<div class="prop">
|
|
393
393
|
<div class="label">Status</div>
|
|
394
|
-
<div class="value">${
|
|
394
|
+
<div class="value">${P}</div>
|
|
395
395
|
</div>
|
|
396
|
-
${u.close_reason?
|
|
396
|
+
${u.close_reason?C`<div class="prop">
|
|
397
397
|
<div class="label">Close Reason</div>
|
|
398
398
|
<div class="value">${u.close_reason}</div>
|
|
399
399
|
</div>`:""}
|
|
400
400
|
<div class="prop">
|
|
401
401
|
<div class="label">Priority</div>
|
|
402
|
-
<div class="value">${
|
|
402
|
+
<div class="value">${E}</div>
|
|
403
403
|
</div>
|
|
404
404
|
<div class="prop assignee">
|
|
405
405
|
<div class="label">Assignee</div>
|
|
406
406
|
<div class="value">
|
|
407
|
-
${m?
|
|
407
|
+
${m?C`<input
|
|
408
408
|
type="text"
|
|
409
409
|
aria-label="Edit assignee"
|
|
410
410
|
.value=${u.assignee||""}
|
|
411
411
|
size=${Math.min(40,Math.max(12,(u.assignee||"").length+3))}
|
|
412
|
-
@keydown=${
|
|
412
|
+
@keydown=${X=>{X.key==="Escape"?(X.preventDefault(),J()):X.key==="Enter"&&(X.preventDefault(),B())}}
|
|
413
413
|
/>
|
|
414
414
|
<button
|
|
415
415
|
class="btn"
|
|
416
416
|
style="margin-left:6px"
|
|
417
|
-
@click=${
|
|
417
|
+
@click=${B}
|
|
418
418
|
>
|
|
419
419
|
Save
|
|
420
420
|
</button>
|
|
421
421
|
<button
|
|
422
422
|
class="btn"
|
|
423
423
|
style="margin-left:6px"
|
|
424
|
-
@click=${
|
|
424
|
+
@click=${J}
|
|
425
425
|
>
|
|
426
426
|
Cancel
|
|
427
|
-
</button>`:
|
|
428
|
-
class=${
|
|
427
|
+
</button>`:C`${(()=>{let X=u.assignee||"",ie=X.trim().length>0;return C`<span
|
|
428
|
+
class=${ie?"editable":"editable muted"}
|
|
429
429
|
tabindex="0"
|
|
430
430
|
role="button"
|
|
431
431
|
aria-label="Edit assignee"
|
|
432
|
-
@click=${
|
|
433
|
-
@keydown=${
|
|
434
|
-
>${
|
|
432
|
+
@click=${H}
|
|
433
|
+
@keydown=${V}
|
|
434
|
+
>${ie?X:"Unassigned"}</span
|
|
435
435
|
>`})()}`}
|
|
436
436
|
</div>
|
|
437
437
|
</div>
|
|
438
438
|
</div>
|
|
439
|
-
${
|
|
440
|
-
${
|
|
441
|
-
${
|
|
439
|
+
${_r}
|
|
440
|
+
${Et("Dependencies",u.dependencies||[])}
|
|
441
|
+
${Et("Dependents",u.dependents||[])}
|
|
442
442
|
</div>
|
|
443
443
|
</div>
|
|
444
444
|
</div>
|
|
445
445
|
</div>
|
|
446
|
-
`}function
|
|
446
|
+
`}function L(){if(!i){q(o?"Loading\u2026":"No issue selected");return}Te(Jt(i),r)}function Ct(u,A){return async P=>{if(P.stopPropagation(),!(!i||l)){l=!0;try{if(A==="Dependencies"){let E=await e("dep-remove",{a:i.id,b:u,view_id:i.id});E&&typeof E=="object"&&(i=E,L())}else{let E=await e("dep-remove",{a:u,b:i.id,view_id:i.id});E&&typeof E=="object"&&(i=E,L())}}catch(E){n("dep-remove failed %o",E)}finally{l=!1}}}}function er(u,A){return async P=>{if(!i||l)return;let E=P.currentTarget,se=E.previousElementSibling,be=se?se.value.trim():"";if(!be||be===i.id){pe("Enter a different issue id");return}if(new Set((u||[]).map(Ae=>Ae.id)).has(be)){pe("Link already exists");return}l=!0,E&&(E.disabled=!0),se&&(se.disabled=!0);try{if(A==="Dependencies"){let Ae=await e("dep-add",{a:i.id,b:be,view_id:i.id});Ae&&typeof Ae=="object"&&(i=Ae,L())}else{let Ae=await e("dep-add",{a:be,b:i.id,view_id:i.id});Ae&&typeof Ae=="object"&&(i=Ae,L())}}catch(Ae){n("dep-add failed %o",Ae),pe("Failed to add dependency","error")}finally{l=!1}}}function bt(u){u.key==="Escape"?(a=!1,L()):u.key==="Enter"&&(u.preventDefault(),N())}function yt(u){u.key==="Enter"&&Q()}function Ue(u){u.key==="Enter"&&U()}function et(u){u.key==="Enter"&&Ke()}function Rt(u){u.key==="Enter"&&xe()}return{async load(u){if(!u){q("No issue selected");return}o=String(u),i=null,j(),i||q("Loading\u2026"),l=!1,_="",$=!1,L(),await w(o)},clear(){q("Select an issue to view details")},destroy(){r.replaceChildren(),R&&R.parentNode&&(R.parentNode.removeChild(R),R=null)}}}function wr(r){let e=r.navigate,t=r.onUpdate,s=r.requestRender,n=r.getSelectedId||(()=>null),i=r.row_class||"issue-row",o=new Set;function l(c,g,m,k=""){let _=`${c}:${g}`;return o.has(_)?C`<span>
|
|
447
447
|
<input
|
|
448
448
|
type="text"
|
|
449
449
|
.value=${m}
|
|
450
450
|
class="inline-edit"
|
|
451
|
-
@keydown=${async
|
|
452
|
-
@blur=${async
|
|
451
|
+
@keydown=${async S=>{if(S.key==="Escape")o.delete(_),s();else if(S.key==="Enter"){let R=S.currentTarget.value||"";R!==m&&await t(c,{[g]:R}),o.delete(_),s()}}}
|
|
452
|
+
@blur=${async S=>{let R=S.currentTarget.value||"";R!==m&&await t(c,{[g]:R}),o.delete(_),s()}}
|
|
453
453
|
autofocus
|
|
454
454
|
/>
|
|
455
|
-
</span>`:
|
|
455
|
+
</span>`:C`<span
|
|
456
456
|
class="editable text-truncate ${m?"":"muted"}"
|
|
457
457
|
tabindex="0"
|
|
458
458
|
role="button"
|
|
459
|
-
@click=${
|
|
460
|
-
@keydown=${
|
|
459
|
+
@click=${S=>{S.stopPropagation(),S.preventDefault(),o.add(_),s()}}
|
|
460
|
+
@keydown=${S=>{S.key==="Enter"&&(S.preventDefault(),S.stopPropagation(),o.add(_),s())}}
|
|
461
461
|
>${m||k}</span
|
|
462
|
-
>`}function a(c,g){return async m=>{let
|
|
462
|
+
>`}function a(c,g){return async m=>{let _=m.currentTarget.value||"",$={};$[g]=g==="priority"?Number(_):_,await t(c,$)}}function p(c){return g=>{let m=g.target;m&&(m.tagName==="INPUT"||m.tagName==="SELECT")||e(c)}}function f(c){let g=String(c.status||"open"),m=String(c.priority??2),k=n()===c.id;return C`<tr
|
|
463
463
|
role="row"
|
|
464
464
|
class="${i} ${k?"selected":""}"
|
|
465
465
|
data-issue-id=${c.id}
|
|
466
466
|
@click=${p(c.id)}
|
|
467
467
|
>
|
|
468
|
-
<td role="gridcell" class="mono">${
|
|
469
|
-
<td role="gridcell">${
|
|
468
|
+
<td role="gridcell" class="mono">${it(c.id)}</td>
|
|
469
|
+
<td role="gridcell">${ft(c.issue_type)}</td>
|
|
470
470
|
<td role="gridcell">${l(c.id,"title",c.title||"")}</td>
|
|
471
471
|
<td role="gridcell">
|
|
472
472
|
<select
|
|
@@ -474,8 +474,8 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
474
474
|
.value=${g}
|
|
475
475
|
@change=${a(c.id,"status")}
|
|
476
476
|
>
|
|
477
|
-
${["open","in_progress","closed"].map(
|
|
478
|
-
${
|
|
477
|
+
${["open","in_progress","closed"].map(_=>C`<option value=${_} ?selected=${g===_}>
|
|
478
|
+
${mt(_)}
|
|
479
479
|
</option>`)}
|
|
480
480
|
</select>
|
|
481
481
|
</td>
|
|
@@ -488,55 +488,55 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
488
488
|
.value=${m}
|
|
489
489
|
@change=${a(c.id,"priority")}
|
|
490
490
|
>
|
|
491
|
-
${
|
|
492
|
-
value=${String(
|
|
493
|
-
?selected=${m===String(
|
|
491
|
+
${ot.map((_,$)=>C`<option
|
|
492
|
+
value=${String($)}
|
|
493
|
+
?selected=${m===String($)}
|
|
494
494
|
>
|
|
495
|
-
${
|
|
495
|
+
${zt($)} ${_}
|
|
496
496
|
</option>`)}
|
|
497
497
|
</select>
|
|
498
498
|
</td>
|
|
499
499
|
<td role="gridcell" class="deps-col">
|
|
500
|
-
${(c.dependency_count||0)>0||(c.dependent_count||0)>0?
|
|
501
|
-
>${(c.dependency_count||0)>0?
|
|
500
|
+
${(c.dependency_count||0)>0||(c.dependent_count||0)>0?C`<span class="deps-indicator"
|
|
501
|
+
>${(c.dependency_count||0)>0?C`<span
|
|
502
502
|
class="dep-count"
|
|
503
503
|
title="${c.dependency_count} ${(c.dependency_count||0)===1?"dependency":"dependencies"}"
|
|
504
504
|
>→${c.dependency_count}</span
|
|
505
|
-
>`:""}${(c.dependent_count||0)>0?
|
|
505
|
+
>`:""}${(c.dependent_count||0)>0?C`<span
|
|
506
506
|
class="dependent-count"
|
|
507
507
|
title="${c.dependent_count} ${(c.dependent_count||0)===1?"dependent":"dependents"}"
|
|
508
508
|
>←${c.dependent_count}</span
|
|
509
509
|
>`:""}</span
|
|
510
510
|
>`:""}
|
|
511
511
|
</td>
|
|
512
|
-
</tr>`}return f}function
|
|
513
|
-
<div class="epic-group" data-epic-id=${
|
|
512
|
+
</tr>`}return f}function ys(r,e,t,s=void 0,n=void 0){let i=[],o=new Set,l=new Set,a=new Map,p=n?nt(n):null;p&&p.subscribe(()=>{let S=i.length===0;if(i=$(),c(),S&&i.length>0){let z=String(i[0].epic?.id||"");z&&!o.has(z)&&_(z)}});let f=wr({navigate:S=>t(S),onUpdate:k,requestRender:c,getSelectedId:()=>null,row_class:"epic-row"});function c(){Te(g(),r)}function g(){return i.length?C`${i.map(S=>m(S))}`:C`<div class="panel__header muted">No epics found.</div>`}function m(S){let z=S.epic||{},R=String(z.id||""),x=o.has(R),M=p?p.selectEpicChildren(R):[],K=l.has(R);return C`
|
|
513
|
+
<div class="epic-group" data-epic-id=${R}>
|
|
514
514
|
<div
|
|
515
515
|
class="epic-header"
|
|
516
|
-
@click=${()=>
|
|
516
|
+
@click=${()=>_(R)}
|
|
517
517
|
role="button"
|
|
518
518
|
tabindex="0"
|
|
519
|
-
aria-expanded=${
|
|
519
|
+
aria-expanded=${x}
|
|
520
520
|
>
|
|
521
|
-
${
|
|
521
|
+
${it(R,{class_name:"mono"})}
|
|
522
522
|
<span class="text-truncate" style="margin-left:8px"
|
|
523
|
-
>${
|
|
523
|
+
>${z.title||"(no title)"}</span
|
|
524
524
|
>
|
|
525
525
|
<span
|
|
526
526
|
class="epic-progress"
|
|
527
527
|
style="margin-left:auto; display:flex; align-items:center; gap:8px;"
|
|
528
528
|
>
|
|
529
529
|
<progress
|
|
530
|
-
value=${Number(
|
|
531
|
-
max=${Math.max(1,Number(
|
|
530
|
+
value=${Number(S.closed_children||0)}
|
|
531
|
+
max=${Math.max(1,Number(S.total_children||0))}
|
|
532
532
|
></progress>
|
|
533
533
|
<span class="muted mono"
|
|
534
|
-
>${
|
|
534
|
+
>${S.closed_children}/${S.total_children}</span
|
|
535
535
|
>
|
|
536
536
|
</span>
|
|
537
537
|
</div>
|
|
538
|
-
${
|
|
539
|
-
${
|
|
538
|
+
${x?C`<div class="epic-children">
|
|
539
|
+
${K?C`<div class="muted">Loading…</div>`:M.length===0?C`<div class="muted">No issues found</div>`:C`<table class="table">
|
|
540
540
|
<colgroup>
|
|
541
541
|
<col style="width: 100px" />
|
|
542
542
|
<col style="width: 120px" />
|
|
@@ -556,12 +556,12 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
556
556
|
</tr>
|
|
557
557
|
</thead>
|
|
558
558
|
<tbody>
|
|
559
|
-
${
|
|
559
|
+
${M.map(oe=>f(oe))}
|
|
560
560
|
</tbody>
|
|
561
561
|
</table>`}
|
|
562
562
|
</div>`:null}
|
|
563
563
|
</div>
|
|
564
|
-
`}async function k(
|
|
564
|
+
`}async function k(S,z){try{await e.updateIssue({id:S,...z}),c()}catch{}}async function _(S){if(o.has(S)){if(o.delete(S),a.has(S)){try{let z=a.get(S);z&&await z()}catch{}a.delete(S);try{n&&n.unregister&&n.unregister(`detail:${S}`)}catch{}}}else{if(o.add(S),l.add(S),c(),s&&typeof s.subscribeList=="function")try{try{n&&n.register&&n.register(`detail:${S}`,{type:"issue-detail",params:{id:S}})}catch{}let z=await s.subscribeList(`detail:${S}`,{type:"issue-detail",params:{id:S}});a.set(S,z)}catch{}l.delete(S)}c()}function $(){let S=n&&n.snapshotFor?n.snapshotFor("tab:epics")||[]:[],z=[];for(let R of S){let x=Array.isArray(R.dependents)?R.dependents:[],M=Number.isFinite(R.total_children),K=Number.isFinite(R.closed_children),oe=M?Number(R.total_children)||0:x.length,D=K&&Number(R.closed_children)||0;if(!K)for(let q of x)String(q.status||"")==="closed"&&D++;z.push({epic:R,total_children:oe,closed_children:D})}return z}return{async load(){i=$(),c();try{if(i.length>0){let S=String(i[0].epic?.id||"");S&&!o.has(S)&&await _(S)}}catch{}}}}function ws(r){let e=document.createElement("dialog");e.id="fatal-error-dialog",e.setAttribute("role","alertdialog"),e.setAttribute("aria-modal","true"),e.innerHTML=`
|
|
565
565
|
<div class="fatal-error">
|
|
566
566
|
<div class="fatal-error__icon" aria-hidden="true">!</div>
|
|
567
567
|
<div class="fatal-error__body">
|
|
@@ -574,7 +574,7 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
574
574
|
<button type="button" class="btn" id="fatal-error-close">Dismiss</button>
|
|
575
575
|
</div>
|
|
576
576
|
</div>
|
|
577
|
-
</div>`,r.appendChild(e);let t=e.querySelector("#fatal-error-title"),s=e.querySelector("#fatal-error-message"),n=e.querySelector("#fatal-error-detail"),i=e.querySelector("#fatal-error-reload"),o=e.querySelector("#fatal-error-close"),l=()=>{if(typeof e.close=="function")try{e.close()}catch{}e.removeAttribute("open")},a=(p,f,c="")=>{t&&(t.textContent=p||"Unexpected Error"),s&&(s.textContent=f||"An unrecoverable error occurred.");let g=typeof c=="string"?c.trim():"";if(n&&(g.length>0?(n.textContent=g,n.removeAttribute("hidden")):(n.textContent="No additional diagnostics available.",n.setAttribute("hidden",""))),typeof e.showModal=="function")try{e.showModal(),e.setAttribute("open","")}catch{e.setAttribute("open","")}else e.setAttribute("open","")};return i&&i.addEventListener("click",()=>{window.location.reload()}),o&&o.addEventListener("click",()=>l()),e.addEventListener("cancel",p=>{p.preventDefault(),l()}),{open:a,close:l,getElement(){return e}}}function
|
|
577
|
+
</div>`,r.appendChild(e);let t=e.querySelector("#fatal-error-title"),s=e.querySelector("#fatal-error-message"),n=e.querySelector("#fatal-error-detail"),i=e.querySelector("#fatal-error-reload"),o=e.querySelector("#fatal-error-close"),l=()=>{if(typeof e.close=="function")try{e.close()}catch{}e.removeAttribute("open")},a=(p,f,c="")=>{t&&(t.textContent=p||"Unexpected Error"),s&&(s.textContent=f||"An unrecoverable error occurred.");let g=typeof c=="string"?c.trim():"";if(n&&(g.length>0?(n.textContent=g,n.removeAttribute("hidden")):(n.textContent="No additional diagnostics available.",n.setAttribute("hidden",""))),typeof e.showModal=="function")try{e.showModal(),e.setAttribute("open","")}catch{e.setAttribute("open","")}else e.setAttribute("open","")};return i&&i.addEventListener("click",()=>{window.location.reload()}),o&&o.addEventListener("click",()=>l()),e.addEventListener("cancel",p=>{p.preventDefault(),l()}),{open:a,close:l,getElement(){return e}}}function ks(r,e,t){let s=document.createElement("dialog");s.id="issue-dialog",s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.innerHTML=`
|
|
578
578
|
<div class="issue-dialog__container" part="container">
|
|
579
579
|
<header class="issue-dialog__header">
|
|
580
580
|
<div class="issue-dialog__title">
|
|
@@ -584,43 +584,43 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
584
584
|
</header>
|
|
585
585
|
<div class="issue-dialog__body" id="issue-dialog-body"></div>
|
|
586
586
|
</div>
|
|
587
|
-
`,r.appendChild(s);let n=s.querySelector("#issue-dialog-body"),i=s.querySelector("#issue-dialog-title"),o=s.querySelector(".issue-dialog__close");function l(m){i.replaceChildren(),i.appendChild(
|
|
587
|
+
`,r.appendChild(s);let n=s.querySelector("#issue-dialog-body"),i=s.querySelector("#issue-dialog-title"),o=s.querySelector(".issue-dialog__close");function l(m){i.replaceChildren(),i.appendChild(it(m))}s.addEventListener("mousedown",m=>{m.target===s&&(m.preventDefault(),p())}),s.addEventListener("cancel",m=>{m.preventDefault(),p()}),o.addEventListener("click",()=>p());let a=null;function p(){try{typeof s.close=="function"?s.close():s.removeAttribute("open")}catch{s.removeAttribute("open")}try{t()}catch{}g()}function f(m){try{let k=document.activeElement;k&&k instanceof HTMLElement?a=k:a=null}catch{a=null}l(m);try{"showModal"in s&&typeof s.showModal=="function"?s.showModal():s.setAttribute("open",""),setTimeout(()=>{try{o.focus()}catch{}},0)}catch{s.setAttribute("open","")}}function c(){try{typeof s.close=="function"?s.close():s.removeAttribute("open")}catch{s.removeAttribute("open")}g()}function g(){try{a&&document.contains(a)&&a.focus()}catch{}finally{a=null}}return{open:f,close:c,getMount(){return n}}}var kr=["bug","feature","task","epic","chore"];function Qt(r){switch((r||"").toString().toLowerCase()){case"bug":return"Bug";case"feature":return"Feature";case"task":return"Task";case"epic":return"Epic";case"chore":return"Chore";default:return""}}function _s(r,e,t,s,n=void 0,i=void 0){let o=le("views:list"),l=[],a="",p=[],f=[],c=s?s.getState().selected_id:null,g=null,m=!1,k=!1;function _(w){return Array.isArray(w)?w:typeof w=="string"&&w!==""&&w!=="all"?[w]:[]}function $(w){return Array.isArray(w)?w:typeof w=="string"&&w!==""?[w]:[]}let S=wr({navigate:w=>{let b=t||(N=>window.location.hash=N),v=s?s.getState().view:"issues";b(st(v,w))},onUpdate:ee,requestRender:j,getSelectedId:()=>c,row_class:"issue-row"}),z=async w=>{l.includes(w)?l=l.filter(b=>b!==w):l=[...l,w],o("status toggle %s -> %o",w,l),s&&s.setState({filters:{status:l}}),await ke()},R=w=>{a=w.currentTarget.value,o("search input %s",a),s&&s.setState({filters:{search:a}}),j()},x=w=>{f.includes(w)?f=f.filter(b=>b!==w):f=[...f,w],o("type toggle %s -> %o",w,f),s&&s.setState({filters:{type:f}}),j()},M=w=>{w.stopPropagation(),m=!m,k=!1,j()},K=w=>{w.stopPropagation(),k=!k,m=!1,j()};function oe(w,b,v){return w.length===0?`${b}: Any`:w.length===1?`${b}: ${v(w[0])}`:`${b} (${w.length})`}if(s){let w=s.getState();w&&w.filters&&typeof w.filters=="object"&&(l=_(w.filters.status),a=w.filters.search||"",f=$(w.filters.type))}let D=i?nt(i):null;function q(){let w=p;if(l.length>0&&!l.includes("ready")&&(w=w.filter(b=>l.includes(String(b.status||"")))),a){let b=a.toLowerCase();w=w.filter(v=>{let N=String(v.id).toLowerCase(),I=String(v.title||"").toLowerCase();return N.includes(b)||I.includes(b)})}return f.length>0&&(w=w.filter(b=>f.includes(String(b.issue_type||"")))),l.length===1&&l[0]==="closed"&&(w=w.slice().sort(xt)),C`
|
|
588
588
|
<div class="panel__header">
|
|
589
589
|
<div class="filter-dropdown ${m?"is-open":""}">
|
|
590
590
|
<button
|
|
591
591
|
class="filter-dropdown__trigger"
|
|
592
|
-
@click=${
|
|
592
|
+
@click=${M}
|
|
593
593
|
>
|
|
594
|
-
${
|
|
594
|
+
${oe(l,"Status",mt)}
|
|
595
595
|
<span class="filter-dropdown__arrow">▾</span>
|
|
596
596
|
</button>
|
|
597
597
|
<div class="filter-dropdown__menu">
|
|
598
|
-
${["ready","open","in_progress","closed"].map(b=>
|
|
598
|
+
${["ready","open","in_progress","closed"].map(b=>C`
|
|
599
599
|
<label class="filter-dropdown__option">
|
|
600
600
|
<input
|
|
601
601
|
type="checkbox"
|
|
602
602
|
.checked=${l.includes(b)}
|
|
603
|
-
@change=${()=>
|
|
603
|
+
@change=${()=>z(b)}
|
|
604
604
|
/>
|
|
605
|
-
${b==="ready"?"Ready":
|
|
605
|
+
${b==="ready"?"Ready":mt(b)}
|
|
606
606
|
</label>
|
|
607
607
|
`)}
|
|
608
608
|
</div>
|
|
609
609
|
</div>
|
|
610
610
|
<div class="filter-dropdown ${k?"is-open":""}">
|
|
611
|
-
<button class="filter-dropdown__trigger" @click=${
|
|
612
|
-
${
|
|
611
|
+
<button class="filter-dropdown__trigger" @click=${K}>
|
|
612
|
+
${oe(f,"Types",Qt)}
|
|
613
613
|
<span class="filter-dropdown__arrow">▾</span>
|
|
614
614
|
</button>
|
|
615
615
|
<div class="filter-dropdown__menu">
|
|
616
|
-
${
|
|
616
|
+
${kr.map(b=>C`
|
|
617
617
|
<label class="filter-dropdown__option">
|
|
618
618
|
<input
|
|
619
619
|
type="checkbox"
|
|
620
620
|
.checked=${f.includes(b)}
|
|
621
|
-
@change=${()=>
|
|
621
|
+
@change=${()=>x(b)}
|
|
622
622
|
/>
|
|
623
|
-
${
|
|
623
|
+
${Qt(b)}
|
|
624
624
|
</label>
|
|
625
625
|
`)}
|
|
626
626
|
</div>
|
|
@@ -628,14 +628,14 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
628
628
|
<input
|
|
629
629
|
type="search"
|
|
630
630
|
placeholder="Search…"
|
|
631
|
-
@input=${
|
|
631
|
+
@input=${R}
|
|
632
632
|
.value=${a}
|
|
633
633
|
/>
|
|
634
634
|
</div>
|
|
635
635
|
<div class="panel__body" id="list-root">
|
|
636
|
-
${w.length===0?
|
|
636
|
+
${w.length===0?C`<div class="issues-block">
|
|
637
637
|
<div class="muted" style="padding:10px 12px;">No issues</div>
|
|
638
|
-
</div>`:
|
|
638
|
+
</div>`:C`<div class="issues-block">
|
|
639
639
|
<table
|
|
640
640
|
class="table"
|
|
641
641
|
role="grid"
|
|
@@ -663,12 +663,12 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
663
663
|
</tr>
|
|
664
664
|
</thead>
|
|
665
665
|
<tbody role="rowgroup">
|
|
666
|
-
${w.map(b=>
|
|
666
|
+
${w.map(b=>S(b))}
|
|
667
667
|
</tbody>
|
|
668
668
|
</table>
|
|
669
669
|
</div>`}
|
|
670
670
|
</div>
|
|
671
|
-
`}function
|
|
671
|
+
`}function j(){Te(q(),r)}j();async function ee(w,b){try{o("updateInline %s %o",w,Object.keys(b)),typeof b.title=="string"&&await e("edit-text",{id:w,field:"title",value:b.title}),typeof b.assignee=="string"&&await e("update-assignee",{id:w,assignee:b.assignee}),typeof b.status=="string"&&await e("update-status",{id:w,status:b.status}),typeof b.priority=="number"&&await e("update-priority",{id:w,priority:b.priority})}catch{}}async function ke(){o("load");let w=r.querySelector("#list-root"),b=w?w.scrollTop:0;try{D?p=D.selectIssuesFor("tab:issues"):p=[]}catch(v){o("load failed: %o",v),p=[]}j();try{let v=r.querySelector("#list-root");v&&b>0&&(v.scrollTop=b)}catch{}}r.tabIndex=0,r.addEventListener("keydown",w=>{if(w.key==="ArrowDown"||w.key==="ArrowUp"){let I=w.target;if((I&&typeof I.closest=="function"?I.closest("#list-root table.table"):null)&&!!!(I&&typeof I.closest=="function"&&(I.closest("input")||I.closest("textarea")||I.closest("select")))){let B=I&&typeof I.closest=="function"?I.closest("td"):null;if(B&&B.parentElement){let J=B.parentElement,W=J.parentElement;if(W&&W.querySelectorAll){let ce=Array.from(W.querySelectorAll("tr")),Z=Math.max(0,ce.indexOf(J)),ve=B.cellIndex||0,$e=w.key==="ArrowDown"?Math.min(Z+1,ce.length-1):Math.max(Z-1,0),de=ce[$e],Q=de&&de.cells?de.cells[ve]:null;if(Q){let he=Q.querySelector('button:not([disabled]), [tabindex]:not([tabindex="-1"]), a[href], select:not([disabled]), input:not([disabled]):not([type="hidden"]), textarea:not([disabled])');if(he&&typeof he.focus=="function"){w.preventDefault(),he.focus();return}}}}}}let b=r.querySelector("#list-root tbody"),v=b?b.querySelectorAll("tr"):[];if(v.length===0)return;let N=0;if(c&&(N=Array.from(v).findIndex(H=>(H.getAttribute("data-issue-id")||"")===c),N<0&&(N=0)),w.key==="ArrowDown"){w.preventDefault();let I=v[Math.min(N+1,v.length-1)],H=I?I.getAttribute("data-issue-id"):"",V=H||null;s&&V&&s.setState({selected_id:V}),c=V,j()}else if(w.key==="ArrowUp"){w.preventDefault();let I=v[Math.max(N-1,0)],H=I?I.getAttribute("data-issue-id"):"",V=H||null;s&&V&&s.setState({selected_id:V}),c=V,j()}else if(w.key==="Enter"){w.preventDefault();let I=v[N],H=I?I.getAttribute("data-issue-id"):"";if(H){let V=t||(J=>window.location.hash=J),B=s?s.getState().view:"issues";V(st(B,H))}}});let _e=w=>{let b=w.target;b&&!b.closest(".filter-dropdown")&&(m||k)&&(m=!1,k=!1,j())};return document.addEventListener("click",_e),s&&(g=s.subscribe(w=>{if(w.selected_id!==c&&(c=w.selected_id,o("selected %s",c||"(none)"),j()),w.filters&&typeof w.filters=="object"){let b=_(w.filters.status),v=w.filters.search||"",N=!1;if(JSON.stringify(b)!==JSON.stringify(l)){l=b,ke();return}v!==a&&(a=v,N=!0);let H=$(w.filters.type);JSON.stringify(H)!==JSON.stringify(f)&&(f=H,N=!0),N&&j()}})),D&&D.subscribe(()=>{try{p=D.selectIssuesFor("tab:issues"),j()}catch{}}),{load:ke,destroy(){r.replaceChildren(),document.removeEventListener("click",_e),g&&(g(),g=null)}}}function vs(r,e,t){let s=le("views:nav"),n=null;function i(a){return p=>{p.preventDefault(),s("click tab %s",a),t.gotoView(a)}}function o(){let p=e.getState().view||"issues";return C`
|
|
672
672
|
<nav class="header-nav" aria-label="Primary">
|
|
673
673
|
<a
|
|
674
674
|
href="#/issues"
|
|
@@ -689,7 +689,7 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
689
689
|
>Board</a
|
|
690
690
|
>
|
|
691
691
|
</nav>
|
|
692
|
-
`}function l(){Te(o(),r)}return l(),n=e.subscribe(()=>l()),{destroy(){n&&(n(),n=null),Te(
|
|
692
|
+
`}function l(){Te(o(),r)}return l(),n=e.subscribe(()=>l()),{destroy(){n&&(n(),n=null),Te(C``,r)}}}function xs(r,e,t,s){let n=document.createElement("dialog");n.id="new-issue-dialog",n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true"),n.innerHTML=`
|
|
693
693
|
<div class="new-issue__container" part="container">
|
|
694
694
|
<header class="new-issue__header">
|
|
695
695
|
<div class="new-issue__title">New Issue</div>
|
|
@@ -721,13 +721,13 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
721
721
|
</form>
|
|
722
722
|
</div>
|
|
723
723
|
</div>
|
|
724
|
-
`,r.appendChild(n);let i=n.querySelector("#new-issue-form"),o=n.querySelector("#new-title"),l=n.querySelector("#new-type"),a=n.querySelector("#new-priority"),p=n.querySelector("#new-labels"),f=n.querySelector("#new-description"),c=n.querySelector("#new-issue-error"),g=n.querySelector("#btn-cancel"),m=n.querySelector("#btn-create"),k=n.querySelector(".new-issue__close");function
|
|
724
|
+
`,r.appendChild(n);let i=n.querySelector("#new-issue-form"),o=n.querySelector("#new-title"),l=n.querySelector("#new-type"),a=n.querySelector("#new-priority"),p=n.querySelector("#new-labels"),f=n.querySelector("#new-description"),c=n.querySelector("#new-issue-error"),g=n.querySelector("#btn-cancel"),m=n.querySelector("#btn-create"),k=n.querySelector(".new-issue__close");function _(){l.replaceChildren();let D=document.createElement("option");D.value="",D.textContent="\u2014 Select \u2014",l.appendChild(D);for(let q of kr){let j=document.createElement("option");j.value=q,j.textContent=Qt(q),l.appendChild(j)}a.replaceChildren();for(let q=0;q<=4;q+=1){let j=document.createElement("option");j.value=String(q);let ee=ot[q]||"Medium";j.textContent=`${q} \u2013 ${ee}`,a.appendChild(j)}}_();function $(){try{typeof n.close=="function"?n.close():n.removeAttribute("open")}catch{n.removeAttribute("open")}}function S(D){o.disabled=D,l.disabled=D,a.disabled=D,p.disabled=D,f.disabled=D,g.disabled=D,m.disabled=D,m.textContent=D?"Creating\u2026":"Create"}function z(){c.textContent=""}function R(D){c.textContent=D}function x(){try{let D=window.localStorage.getItem("beads-ui.new.type");D?l.value=D:l.value="";let q=window.localStorage.getItem("beads-ui.new.priority");q&&/^\d$/.test(q)?a.value=q:a.value="2"}catch{l.value="",a.value="2"}}function M(){let D=l.value||"",q=a.value||"";D.length>0&&window.localStorage.setItem("beads-ui.new.type",D),q.length>0&&window.localStorage.setItem("beads-ui.new.priority",q)}function K(D){let q=/-(\d+)$/.exec(String(D||""));return q&&q[1]?Number(q[1]):-1}async function oe(){z();let D=String(o.value||"").trim();if(D.length===0){R("Title is required"),o.focus();return}let q=Number(a.value||"2");if(!(q>=0&&q<=4)){R("Priority must be 0..4"),a.focus();return}let j=String(l.value||""),ee=String(f.value||""),ke=String(p.value||"").split(",").map(v=>v.trim()).filter(v=>v.length>0),_e={title:D};j.length>0&&(_e.type=j),String(q).length>0&&(_e.priority=q),ee.length>0&&(_e.description=ee),S(!0);try{await e("create-issue",_e)}catch{S(!1),R("Failed to create issue");return}M();let w=null;try{w=await e("list-issues",{filters:{status:"open",limit:50}})}catch{w=null}let b="";if(Array.isArray(w)){let v=w.filter(N=>String(N.title||"")===D);if(v.length>0){let N=v[0];for(let I of v){let H=K(N.id||"");K(I.id||"")>H&&(N=I)}b=String(N.id||"")}}if(b&&ke.length>0)for(let v of ke)try{await e("label-add",{id:b,label:v})}catch{}if(b){try{t.gotoIssue(b)}catch{}try{s&&s.setState({selected_id:b})}catch{}}S(!1),$()}return n.addEventListener("cancel",D=>{D.preventDefault(),$()}),k.addEventListener("click",()=>$()),g.addEventListener("click",()=>$()),n.addEventListener("keydown",D=>{D.key==="Enter"&&(D.ctrlKey||D.metaKey)&&(D.preventDefault(),oe())}),i.addEventListener("submit",D=>{D.preventDefault(),oe()}),{open(){i.reset(),z(),x();try{"showModal"in n&&typeof n.showModal=="function"?n.showModal():n.setAttribute("open","")}catch{n.setAttribute("open","")}setTimeout(()=>{try{o.focus()}catch{}},0)},close(){$()}}}function As(r){if(!r)return"Unknown";let e=r.split("/").filter(Boolean);return e.length>0?e[e.length-1]:"Unknown"}function Ss(r,e,t){let s=le("views:workspace-picker"),n=null,i=!1;async function o(p){let c=p.target.value,m=e.getState().workspace?.current?.path||"";if(c&&c!==m){s("switching workspace to %s",c),i=!0,a();try{await t(c)}catch(k){s("workspace switch failed: %o",k)}finally{i=!1,a()}}}function l(){let p=e.getState(),f=p.workspace?.current,c=p.workspace?.available||[];if(c.length===0)return C``;if(c.length===1){let m=As(c[0].path);return C`
|
|
725
725
|
<div class="workspace-picker workspace-picker--single">
|
|
726
726
|
<span class="workspace-picker__label" title="${c[0].path}"
|
|
727
727
|
>${m}</span
|
|
728
728
|
>
|
|
729
729
|
</div>
|
|
730
|
-
`}let g=f?.path||"";return
|
|
730
|
+
`}let g=f?.path||"";return C`
|
|
731
731
|
<div class="workspace-picker">
|
|
732
732
|
<select
|
|
733
733
|
class="workspace-picker__select"
|
|
@@ -735,27 +735,27 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
735
735
|
?disabled=${i}
|
|
736
736
|
aria-label="Select project workspace"
|
|
737
737
|
>
|
|
738
|
-
${c.map(m=>
|
|
738
|
+
${c.map(m=>C`
|
|
739
739
|
<option
|
|
740
740
|
value="${m.path}"
|
|
741
741
|
?selected=${m.path===g}
|
|
742
742
|
title="${m.path}"
|
|
743
743
|
>
|
|
744
|
-
${
|
|
744
|
+
${As(m.path)}
|
|
745
745
|
</option>
|
|
746
746
|
`)}
|
|
747
747
|
</select>
|
|
748
|
-
${i?
|
|
748
|
+
${i?C`<span
|
|
749
749
|
class="workspace-picker__loading"
|
|
750
750
|
aria-hidden="true"
|
|
751
751
|
></span>`:""}
|
|
752
752
|
</div>
|
|
753
|
-
`}function a(){Te(l(),r)}return a(),n=e.subscribe(()=>a()),{destroy(){n&&(n(),n=null),Te(
|
|
753
|
+
`}function a(){Te(l(),r)}return a(),n=e.subscribe(()=>a()),{destroy(){n&&(n(),n=null),Te(C``,r)}}}var Ts=["list-issues","update-status","edit-text","update-priority","create-issue","list-ready","dep-add","dep-remove","epic-status","update-assignee","label-add","label-remove","subscribe-list","unsubscribe-list","snapshot","upsert","delete","get-comments","add-comment","delete-issue","list-workspaces","set-workspace","get-workspace","workspace-changed"];function nn(){let r=Date.now().toString(36),e=Math.random().toString(36).slice(2,8);return`${r}-${e}`}function $s(r,e,t=nn()){return{id:t,type:r,payload:e}}function Es(r={}){let e=le("ws"),t={initialMs:r.backoff?.initialMs??1e3,maxMs:r.backoff?.maxMs??3e4,factor:r.backoff?.factor??2,jitterRatio:r.backoff?.jitterRatio??.2},s=()=>r.url&&r.url.length>0?r.url:typeof location<"u"?(location.protocol==="https:"?"wss://":"ws://")+location.host+"/ws":"ws://localhost/ws",n=null,i="closed",o=0,l=null,a=!0,p=new Map,f=[],c=new Map,g=new Set;function m(x){for(let M of Array.from(g))try{M(x)}catch{}}function k(){if(!a||l)return;i="reconnecting",e("ws reconnecting\u2026"),m(i);let x=Math.min(t.maxMs||0,(t.initialMs||0)*Math.pow(t.factor||1,o)),M=(t.jitterRatio||0)*x,K=Math.max(0,Math.round(x+(Math.random()*2-1)*M));e("ws retry in %d ms (attempt %d)",K,o+1),l=setTimeout(()=>{l=null,R()},K)}function _(x){try{n?.send(JSON.stringify(x))}catch(M){e("ws send failed",M)}}function $(){for(i="open",e("ws open"),m(i),o=0;f.length;){let x=f.shift();x&&_(x)}}function S(x){let M;try{M=JSON.parse(String(x.data))}catch{e("ws received non-JSON message");return}if(!M||typeof M.id!="string"||typeof M.type!="string"){e("ws received invalid envelope");return}if(p.has(M.id)){let oe=p.get(M.id);p.delete(M.id),M.ok?oe?.resolve(M.payload):oe?.reject(M.error||new Error("ws error"));return}let K=c.get(M.type);if(K&&K.size>0)for(let oe of Array.from(K))try{oe(M.payload)}catch(D){e("ws event handler error",D)}else e("ws received unhandled message type: %s",M.type)}function z(){i="closed",e("ws closed"),m(i);for(let[x,M]of p.entries())M.reject(new Error("ws disconnected")),p.delete(x);o+=1,k()}function R(){if(!a)return;let x=s();try{n=new WebSocket(x),e("ws connecting %s",x),i="connecting",m(i),n.addEventListener("open",$),n.addEventListener("message",S),n.addEventListener("error",()=>{}),n.addEventListener("close",z)}catch(M){e("ws connect failed %o",M),k()}}return R(),{send(x,M){if(!Ts.includes(x))return Promise.reject(new Error(`unknown message type: ${x}`));let K=nn(),oe=$s(x,M,K);return e("send %s id=%s",x,K),new Promise((D,q)=>{p.set(K,{resolve:D,reject:q,type:x}),n&&n.readyState===n.OPEN?_(oe):(e("queue %s id=%s (state=%s)",x,K,i),f.push(oe))})},on(x,M){c.has(x)||c.set(x,new Set);let K=c.get(x);return K?.add(M),()=>{K?.delete(M)}},onConnection(x){return g.add(x),()=>{g.delete(x)}},close(){a=!1,l&&(clearTimeout(l),l=null);try{n?.close()}catch{}},getState(){return i}}}function lo(r){let e=le("main");e("bootstrap start");let t=C`
|
|
754
754
|
<section id="issues-root" class="route issues">
|
|
755
755
|
<aside id="list-panel" class="panel"></aside>
|
|
756
756
|
</section>
|
|
757
757
|
<section id="epics-root" class="route epics" hidden></section>
|
|
758
758
|
<section id="board-root" class="route board" hidden></section>
|
|
759
759
|
<section id="detail-panel" class="route detail" hidden></section>
|
|
760
|
-
`;Te(t,r);let s=document.getElementById("top-nav"),n=document.getElementById("issues-root"),i=document.getElementById("epics-root"),o=document.getElementById("board-root"),l=document.getElementById("list-panel"),a=document.getElementById("detail-panel");if(l&&n&&i&&o&&a){let T=function(y,h){let U="Request failed",W="";if(y&&typeof y=="object"){let $=y;if(typeof $.message=="string"&&$.message.length>0&&(U=$.message),typeof $.details=="string")W=$.details;else if($.details&&typeof $.details=="object")try{W=JSON.stringify($.details,null,2)}catch{W=""}}else typeof y=="string"&&y.length>0&&(U=y);let se=h&&h.length>0?`Failed to load ${h}`:"Request failed";x.open(se,U,W)},L=function(y){if(!y)return"Unknown";let h=y.split("/").filter(Boolean);return h.length>0?h[h.length-1]:"Unknown"},Oe=function(y){let h=String(y?.status||"all");return h==="ready"?{type:"ready-issues"}:h==="in_progress"?{type:"in-progress-issues"}:h==="closed"?{type:"closed-issues"}:{type:"all-issues"}},We=function(y){if(y.view==="issues"){let h=Oe(y.filters||{}),U=JSON.stringify(h);try{A.register("tab:issues",h)}catch(se){e("register issues store failed: %o",se)}let W=`tab:issues:${U}`;(!ce||U!==qe)&&!de.has(W)&&(de.add(W),M.subscribeList("tab:issues",h).then(se=>{ce=se,qe=U}).catch(se=>{e("subscribe issues failed: %o",se),T(se,"issues list")}).finally(()=>{de.delete(W)}))}else if(ce){ce().catch(()=>{}),ce=null,qe=null;try{A.unregister("tab:issues")}catch(h){e("unregister issues store failed: %o",h)}}if(y.view==="epics"){try{A.register("tab:epics",{type:"epics"})}catch(h){e("register epics store failed: %o",h)}!Q&&!de.has("tab:epics")&&(de.add("tab:epics"),M.subscribeList("tab:epics",{type:"epics"}).then(h=>{Q=h}).catch(h=>{e("subscribe epics failed: %o",h),T(h,"epics")}).finally(()=>{de.delete("tab:epics")}))}else if(Q){Q().catch(()=>{}),Q=null;try{A.unregister("tab:epics")}catch(h){e("unregister epics store failed: %o",h)}}if(y.view==="board"){if(!fe&&!de.has("tab:board:ready")){try{A.register("tab:board:ready",{type:"ready-issues"})}catch(h){e("register board:ready store failed: %o",h)}de.add("tab:board:ready"),M.subscribeList("tab:board:ready",{type:"ready-issues"}).then(h=>fe=h).catch(h=>{e("subscribe board ready failed: %o",h),T(h,"board (Ready)")}).finally(()=>{de.delete("tab:board:ready")})}if(!Ee&&!de.has("tab:board:in-progress")){try{A.register("tab:board:in-progress",{type:"in-progress-issues"})}catch(h){e("register board:in-progress store failed: %o",h)}de.add("tab:board:in-progress"),M.subscribeList("tab:board:in-progress",{type:"in-progress-issues"}).then(h=>Ee=h).catch(h=>{e("subscribe board in-progress failed: %o",h),T(h,"board (In Progress)")}).finally(()=>{de.delete("tab:board:in-progress")})}if(!Me&&!de.has("tab:board:closed")){try{A.register("tab:board:closed",{type:"closed-issues"})}catch(h){e("register board:closed store failed: %o",h)}de.add("tab:board:closed"),M.subscribeList("tab:board:closed",{type:"closed-issues"}).then(h=>Me=h).catch(h=>{e("subscribe board closed failed: %o",h),T(h,"board (Closed)")}).finally(()=>{de.delete("tab:board:closed")})}if(!xe&&!de.has("tab:board:blocked")){try{A.register("tab:board:blocked",{type:"blocked-issues"})}catch(h){e("register board:blocked store failed: %o",h)}de.add("tab:board:blocked"),M.subscribeList("tab:board:blocked",{type:"blocked-issues"}).then(h=>xe=h).catch(h=>{e("subscribe board blocked failed: %o",h),T(h,"board (Blocked)")}).finally(()=>{de.delete("tab:board:blocked")})}}else{if(fe){fe().catch(()=>{}),fe=null;try{A.unregister("tab:board:ready")}catch(h){e("unregister board:ready failed: %o",h)}}if(Ee){Ee().catch(()=>{}),Ee=null;try{A.unregister("tab:board:in-progress")}catch(h){e("unregister board:in-progress failed: %o",h)}}if(Me){Me().catch(()=>{}),Me=null;try{A.unregister("tab:board:closed")}catch(h){e("unregister board:closed failed: %o",h)}}if(xe){xe().catch(()=>{}),xe=null;try{A.unregister("tab:board:blocked")}catch(h){e("unregister board:blocked failed: %o",h)}}}};var p=T,f=L,c=Oe,g=We;let m=document.getElementById("header-loading"),k=Dn(m),x=bs(r),_=Ts(),P=k.wrapSend((y,h)=>_.send(y,h)),M=Cn(P),A=Rn();_.on("snapshot",y=>{let h=y,U=h&&typeof h.id=="string"?h.id:"",W=U?A.getStore(U):null;if(W&&h&&h.type==="snapshot")try{W.applyPush(h)}catch{}}),_.on("upsert",y=>{let h=y,U=h&&typeof h.id=="string"?h.id:"",W=U?A.getStore(U):null;if(W&&h&&h.type==="upsert")try{W.applyPush(h)}catch{}}),_.on("delete",y=>{let h=y,U=h&&typeof h.id=="string"?h.id:"",W=U?A.getStore(U):null;if(W&&h&&h.type==="delete")try{W.applyPush(h)}catch{}});let O=et(A);async function V(){e("clearing all subscriptions for workspace switch"),ce&&(ce().catch(()=>{}),ce=null),Q&&(Q().catch(()=>{}),Q=null),fe&&(fe().catch(()=>{}),fe=null),Ee&&(Ee().catch(()=>{}),Ee=null),Me&&(Me().catch(()=>{}),Me=null),xe&&(xe().catch(()=>{}),xe=null);let y=["tab:issues","tab:epics","tab:board:ready","tab:board:in-progress","tab:board:closed","tab:board:blocked"];for(let U of y)try{A.unregister(U)}catch{}let h=w.getState();if(h.selected_id)try{A.unregister(`detail:${h.selected_id}`)}catch{}qe=null,We(w.getState())}async function re(y){e("requesting workspace switch to %s",y);try{let h=await _.send("set-workspace",{path:y});e("workspace switch result: %o",h),h&&h.workspace&&(w.setState({workspace:{current:{path:h.workspace.root_dir,database:h.workspace.db_path}}}),window.localStorage.setItem("beads-ui.workspace",y),h.changed&&(await V(),ue("Switched to "+L(y),"success",2e3)))}catch(h){throw e("workspace switch failed: %o",h),ue("Failed to switch workspace","error",3e3),h}}async function G(){try{let y=await _.send("list-workspaces",{});if(e("workspaces loaded: %o",y),y&&Array.isArray(y.workspaces)){let h=y.workspaces.map(se=>({path:se.path,database:se.database,pid:se.pid,version:se.version})),U=y.current?{path:y.current.root_dir,database:y.current.db_path}:null;w.setState({workspace:{current:U,available:h}});let W=window.localStorage.getItem("beads-ui.workspace");W&&U&&W!==U.path&&h.some($=>$.path===W)&&(e("restoring saved workspace preference: %s",W),await re(W))}}catch(y){e("failed to load workspaces: %o",y)}}_.on("workspace-changed",y=>{e("workspace-changed event: %o",y),y&&y.root_dir&&(w.setState({workspace:{current:{path:y.root_dir,database:y.db_path}}}),G(),V())});let q=!1;if(typeof _.onConnection=="function"){let y=h=>{e("ws state %s",h),h==="reconnecting"||h==="closed"?(q=!0,ue("Connection lost. Reconnecting\u2026","error",4e3)):h==="open"&&q&&(q=!1,ue("Reconnected","success",2200))};_.onConnection(y)}let ee={status:"all",search:"",type:""};try{let y=window.localStorage.getItem("beads-ui.filters");if(y){let h=JSON.parse(y);if(h&&typeof h=="object"){let U=["bug","feature","task","epic","chore"],W="";if(typeof h.type=="string"&&U.includes(h.type))W=h.type;else if(Array.isArray(h.types)){let se="";for(let $ of h.types)if(U.includes(String($))){se=$;break}W=se}ee={status:["all","open","in_progress","closed","ready"].includes(h.status)?h.status:"all",search:typeof h.search=="string"?h.search:"",type:W}}}}catch(y){e("filters parse error: %o",y)}let ye="issues";try{let y=window.localStorage.getItem("beads-ui.view");(y==="issues"||y==="epics"||y==="board")&&(ye=y)}catch(y){e("view parse error: %o",y)}let we={closed_filter:"today"};try{let y=window.localStorage.getItem("beads-ui.board");if(y){let h=JSON.parse(y);if(h&&typeof h=="object"){let U=String(h.closed_filter||"today");(U==="today"||U==="3"||U==="7")&&(we.closed_filter=U)}}}catch(y){e("board prefs parse error: %o",y)}let w=Ln({filters:ee,view:ye,board:we}),b=In(w);b.start();let v=async(y,h)=>{try{return await P(y,h)}catch{return[]}};s&&ks(s,w,b);let D=document.getElementById("workspace-picker");D&&xs(D,w,re),G();let I=_s(r,(y,h)=>P(y,h),b,w);try{let y=document.getElementById("new-issue-btn");y&&y.addEventListener("click",()=>I.open())}catch{}let Y=ws(l,async(y,h)=>{if(y==="list-issues")try{return O.selectIssuesFor("tab:issues")}catch(U){return e("list selectors failed: %o",U),[]}return v(y,h)},y=>{let h=nr(y);h&&b.gotoIssue(h)},w,M,A);w.subscribe(y=>{let h={status:y.filters.status,search:y.filters.search,type:typeof y.filters.type=="string"?y.filters.type:""};window.localStorage.setItem("beads-ui.filters",JSON.stringify(h))}),w.subscribe(y=>{window.localStorage.setItem("beads-ui.board",JSON.stringify({closed_filter:y.board.closed_filter}))}),Y.load();let B=ys(a,w,()=>{let y=w.getState();w.setState({selected_id:null});try{let h=y.view||"issues";b.gotoView(h)}catch{}}),J=null;J=gs(B.getMount(),v,y=>{let h=nr(y);if(h)b.gotoIssue(h);else{let U=Tt(y);b.gotoView(U)}},A);let j=w.getState().selected_id;if(j){a.hidden=!1,B.open(j),J&&J.load(j);let y=`detail:${j}`,h={type:"issue-detail",params:{id:j}};try{A.register(y,h)}catch(U){e("register detail store failed: %o",U)}M.subscribeList(y,h).catch(U=>{e("detail subscribe failed: %o",U),T(U,"issue details")})}let le=null;w.subscribe(y=>{let h=y.selected_id;if(h){a.hidden=!1,B.open(h),J&&J.load(h);let U=`detail:${h}`,W={type:"issue-detail",params:{id:h}};try{A.register(U,W)}catch{}M.subscribeList(U,W).then(se=>{le&&le().catch(()=>{}),le=se}).catch(se=>{e("detail subscribe failed: %o",se),T(se,"issue details")})}else{try{B.close()}catch{}J&&J.clear(),a.hidden=!0,le&&(le().catch(()=>{}),le=null)}});let X=En(v),ke=ms(i,X,y=>b.gotoIssue(y),M,A),ve=Mn(o,X,y=>b.gotoIssue(y),w,M,A,v),ce=null,Q=null,fe=null,Ee=null,Me=null,xe=null,de=new Set;window.__bdui_debug={getPendingSubscriptions:()=>Array.from(de),getActivityCount:()=>k.getCount(),getActiveRequests:()=>k.getActiveRequests()};let qe=null,Fe=y=>{n&&i&&o&&a&&(n.hidden=y.view!=="issues",i.hidden=y.view!=="epics",o.hidden=y.view!=="board"),We(y),!y.selected_id&&y.view==="epics"&&ke.load(),!y.selected_id&&y.view==="board"&&ve.load(),window.localStorage.setItem("beads-ui.view",y.view)};w.subscribe(Fe),Fe(w.getState()),window.addEventListener("keydown",y=>{let h=y.ctrlKey||y.metaKey,U=String(y.key||"").toLowerCase(),W=y.target,se=W&&W.tagName?String(W.tagName).toLowerCase():"",$=se==="input"||se==="textarea"||se==="select"||W&&typeof W.isContentEditable=="boolean"&&W.isContentEditable;h&&U==="n"&&($||(y.preventDefault(),I.open()))})}}typeof window<"u"&&typeof document<"u"&&window.addEventListener("DOMContentLoaded",()=>{try{let t=window.localStorage.getItem("beads-ui.theme"),s=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,n=t==="dark"||t==="light"?t:s?"dark":"light";document.documentElement.setAttribute("data-theme",n);let i=document.getElementById("theme-switch");i&&(i.checked=n==="dark")}catch{}let r=document.getElementById("theme-switch");r&&r.addEventListener("change",()=>{let t=r.checked?"dark":"light";document.documentElement.setAttribute("data-theme",t),window.localStorage.setItem("beads-ui.theme",t)});let e=document.getElementById("app");e&&ao(e)});export{ao as bootstrap};
|
|
760
|
+
`;Te(t,r);let s=document.getElementById("top-nav"),n=document.getElementById("issues-root"),i=document.getElementById("epics-root"),o=document.getElementById("board-root"),l=document.getElementById("list-panel"),a=document.getElementById("detail-panel");if(l&&n&&i&&o&&a){let $=function(y,h){let U="Request failed",G="";if(y&&typeof y=="object"){let ge=y;if(typeof ge.message=="string"&&ge.message.length>0&&(U=ge.message),typeof ge.details=="string")G=ge.details;else if(ge.details&&typeof ge.details=="object")try{G=JSON.stringify(ge.details,null,2)}catch{G=""}}else typeof y=="string"&&y.length>0&&(U=y);let re=h&&h.length>0?`Failed to load ${h}`:"Request failed";_.open(re,U,G)},D=function(y){if(!y)return"Unknown";let h=y.split("/").filter(Boolean);return h.length>0?h[h.length-1]:"Unknown"},Pe=function(y){let h=String(y?.status||"all");return h==="ready"?{type:"ready-issues"}:h==="in_progress"?{type:"in-progress-issues"}:h==="closed"?{type:"closed-issues"}:{type:"all-issues"}},Ke=function(y){if(y.view==="issues"){let h=Pe(y.filters||{}),U=JSON.stringify(h);try{x.register("tab:issues",h)}catch(re){e("register issues store failed: %o",re)}let G=`tab:issues:${U}`;(!de||U!==Ge)&&!ue.has(G)&&(ue.add(G),R.subscribeList("tab:issues",h).then(re=>{de=re,Ge=U}).catch(re=>{e("subscribe issues failed: %o",re),$(re,"issues list")}).finally(()=>{ue.delete(G)}))}else if(de){de().catch(()=>{}),de=null,Ge=null;try{x.unregister("tab:issues")}catch(h){e("unregister issues store failed: %o",h)}}if(y.view==="epics"){try{x.register("tab:epics",{type:"epics"})}catch(h){e("register epics store failed: %o",h)}!Q&&!ue.has("tab:epics")&&(ue.add("tab:epics"),R.subscribeList("tab:epics",{type:"epics"}).then(h=>{Q=h}).catch(h=>{e("subscribe epics failed: %o",h),$(h,"epics")}).finally(()=>{ue.delete("tab:epics")}))}else if(Q){Q().catch(()=>{}),Q=null;try{x.unregister("tab:epics")}catch(h){e("unregister epics store failed: %o",h)}}if(y.view==="board"){if(!he&&!ue.has("tab:board:ready")){try{x.register("tab:board:ready",{type:"ready-issues"})}catch(h){e("register board:ready store failed: %o",h)}ue.add("tab:board:ready"),R.subscribeList("tab:board:ready",{type:"ready-issues"}).then(h=>he=h).catch(h=>{e("subscribe board ready failed: %o",h),$(h,"board (Ready)")}).finally(()=>{ue.delete("tab:board:ready")})}if(!De&&!ue.has("tab:board:in-progress")){try{x.register("tab:board:in-progress",{type:"in-progress-issues"})}catch(h){e("register board:in-progress store failed: %o",h)}ue.add("tab:board:in-progress"),R.subscribeList("tab:board:in-progress",{type:"in-progress-issues"}).then(h=>De=h).catch(h=>{e("subscribe board in-progress failed: %o",h),$(h,"board (In Progress)")}).finally(()=>{ue.delete("tab:board:in-progress")})}if(!Oe&&!ue.has("tab:board:closed")){try{x.register("tab:board:closed",{type:"closed-issues"})}catch(h){e("register board:closed store failed: %o",h)}ue.add("tab:board:closed"),R.subscribeList("tab:board:closed",{type:"closed-issues"}).then(h=>Oe=h).catch(h=>{e("subscribe board closed failed: %o",h),$(h,"board (Closed)")}).finally(()=>{ue.delete("tab:board:closed")})}if(!xe&&!ue.has("tab:board:blocked")){try{x.register("tab:board:blocked",{type:"blocked-issues"})}catch(h){e("register board:blocked store failed: %o",h)}ue.add("tab:board:blocked"),R.subscribeList("tab:board:blocked",{type:"blocked-issues"}).then(h=>xe=h).catch(h=>{e("subscribe board blocked failed: %o",h),$(h,"board (Blocked)")}).finally(()=>{ue.delete("tab:board:blocked")})}}else{if(he){he().catch(()=>{}),he=null;try{x.unregister("tab:board:ready")}catch(h){e("unregister board:ready failed: %o",h)}}if(De){De().catch(()=>{}),De=null;try{x.unregister("tab:board:in-progress")}catch(h){e("unregister board:in-progress failed: %o",h)}}if(Oe){Oe().catch(()=>{}),Oe=null;try{x.unregister("tab:board:closed")}catch(h){e("unregister board:closed failed: %o",h)}}if(xe){xe().catch(()=>{}),xe=null;try{x.unregister("tab:board:blocked")}catch(h){e("unregister board:blocked failed: %o",h)}}}};var p=$,f=D,c=Pe,g=Ke;let m=document.getElementById("header-loading"),k=Mn(m),_=ws(r),S=Es(),z=k.wrapSend((y,h)=>S.send(y,h)),R=In(z),x=Ln();S.on("snapshot",y=>{let h=y,U=h&&typeof h.id=="string"?h.id:"",G=U?x.getStore(U):null;if(G&&h&&h.type==="snapshot")try{G.applyPush(h)}catch{}}),S.on("upsert",y=>{let h=y,U=h&&typeof h.id=="string"?h.id:"",G=U?x.getStore(U):null;if(G&&h&&h.type==="upsert")try{G.applyPush(h)}catch{}}),S.on("delete",y=>{let h=y,U=h&&typeof h.id=="string"?h.id:"",G=U?x.getStore(U):null;if(G&&h&&h.type==="delete")try{G.applyPush(h)}catch{}});let M=nt(x);async function K(){e("clearing all subscriptions for workspace switch"),de&&(de().catch(()=>{}),de=null),Q&&(Q().catch(()=>{}),Q=null),he&&(he().catch(()=>{}),he=null),De&&(De().catch(()=>{}),De=null),Oe&&(Oe().catch(()=>{}),Oe=null),xe&&(xe().catch(()=>{}),xe=null);let y=["tab:issues","tab:epics","tab:board:ready","tab:board:in-progress","tab:board:closed","tab:board:blocked"];for(let U of y)try{x.unregister(U)}catch{}let h=w.getState();if(h.selected_id)try{x.unregister(`detail:${h.selected_id}`)}catch{}Ge=null,Ke(w.getState())}async function oe(y){e("requesting workspace switch to %s",y);try{let h=await S.send("set-workspace",{path:y});e("workspace switch result: %o",h),h&&h.workspace&&(w.setState({workspace:{current:{path:h.workspace.root_dir,database:h.workspace.db_path}}}),window.localStorage.setItem("beads-ui.workspace",y),h.changed&&(await K(),pe("Switched to "+D(y),"success",2e3)))}catch(h){throw e("workspace switch failed: %o",h),pe("Failed to switch workspace","error",3e3),h}}async function q(){try{let y=await S.send("list-workspaces",{});if(e("workspaces loaded: %o",y),y&&Array.isArray(y.workspaces)){let h=y.workspaces.map(re=>({path:re.path,database:re.database,pid:re.pid,version:re.version})),U=y.current?{path:y.current.root_dir,database:y.current.db_path}:null;w.setState({workspace:{current:U,available:h}});let G=window.localStorage.getItem("beads-ui.workspace");G&&U&&G!==U.path&&h.some(ge=>ge.path===G)&&(e("restoring saved workspace preference: %s",G),await oe(G))}}catch(y){e("failed to load workspaces: %o",y)}}S.on("workspace-changed",y=>{e("workspace-changed event: %o",y),y&&y.root_dir&&(w.setState({workspace:{current:{path:y.root_dir,database:y.db_path}}}),q(),K())});let j=!1;if(typeof S.onConnection=="function"){let y=h=>{e("ws state %s",h),h==="reconnecting"||h==="closed"?(j=!0,pe("Connection lost. Reconnecting\u2026","error",4e3)):h==="open"&&j&&(j=!1,pe("Reconnected","success",2200))};S.onConnection(y)}let ee={status:"all",search:"",type:""};try{let y=window.localStorage.getItem("beads-ui.filters");if(y){let h=JSON.parse(y);if(h&&typeof h=="object"){let U=["bug","feature","task","epic","chore"],G="";if(typeof h.type=="string"&&U.includes(h.type))G=h.type;else if(Array.isArray(h.types)){let re="";for(let ge of h.types)if(U.includes(String(ge))){re=ge;break}G=re}ee={status:["all","open","in_progress","closed","ready"].includes(h.status)?h.status:"all",search:typeof h.search=="string"?h.search:"",type:G}}}}catch(y){e("filters parse error: %o",y)}let ke="issues";try{let y=window.localStorage.getItem("beads-ui.view");(y==="issues"||y==="epics"||y==="board")&&(ke=y)}catch(y){e("view parse error: %o",y)}let _e={closed_filter:"today"};try{let y=window.localStorage.getItem("beads-ui.board");if(y){let h=JSON.parse(y);if(h&&typeof h=="object"){let U=String(h.closed_filter||"today");(U==="today"||U==="3"||U==="7")&&(_e.closed_filter=U)}}}catch(y){e("board prefs parse error: %o",y)}let w=Nn({filters:ee,view:ke,board:_e}),b=Dn(w);b.start();let v=async(y,h)=>{try{return await z(y,h)}catch{return[]}};s&&vs(s,w,b);let N=document.getElementById("workspace-picker");N&&Ss(N,w,oe),q();let I=xs(r,(y,h)=>z(y,h),b,w);try{let y=document.getElementById("new-issue-btn");y&&y.addEventListener("click",()=>I.open())}catch{}let V=_s(l,async(y,h)=>{if(y==="list-issues")try{return M.selectIssuesFor("tab:issues")}catch(U){return e("list selectors failed: %o",U),[]}return v(y,h)},y=>{let h=ar(y);h&&b.gotoIssue(h)},w,R,x);w.subscribe(y=>{let h={status:y.filters.status,search:y.filters.search,type:typeof y.filters.type=="string"?y.filters.type:""};window.localStorage.setItem("beads-ui.filters",JSON.stringify(h))}),w.subscribe(y=>{window.localStorage.setItem("beads-ui.board",JSON.stringify({closed_filter:y.board.closed_filter}))}),V.load();let B=ks(a,w,()=>{let y=w.getState();w.setState({selected_id:null});try{let h=y.view||"issues";b.gotoView(h)}catch{}}),J=null;J=bs(B.getMount(),v,y=>{let h=ar(y);if(h)b.gotoIssue(h);else{let U=$t(y);b.gotoView(U)}},x);let W=w.getState().selected_id;if(W){a.hidden=!1,B.open(W),J&&J.load(W);let y=`detail:${W}`,h={type:"issue-detail",params:{id:W}};try{x.register(y,h)}catch(U){e("register detail store failed: %o",U)}R.subscribeList(y,h).catch(U=>{e("detail subscribe failed: %o",U),$(U,"issue details")})}let ce=null;w.subscribe(y=>{let h=y.selected_id;if(h){a.hidden=!1,B.open(h),J&&J.load(h);let U=`detail:${h}`,G={type:"issue-detail",params:{id:h}};try{x.register(U,G)}catch{}R.subscribeList(U,G).then(re=>{ce&&ce().catch(()=>{}),ce=re}).catch(re=>{e("detail subscribe failed: %o",re),$(re,"issue details")})}else{try{B.close()}catch{}J&&J.clear(),a.hidden=!0,ce&&(ce().catch(()=>{}),ce=null)}});let Z=Cn(v),ve=ys(i,Z,y=>b.gotoIssue(y),R,x),$e=Pn(o,Z,y=>b.gotoIssue(y),w,R,x,v),de=null,Q=null,he=null,De=null,Oe=null,xe=null,ue=new Set;window.__bdui_debug={getPendingSubscriptions:()=>Array.from(ue),getActivityCount:()=>k.getCount(),getActiveRequests:()=>k.getActiveRequests()};let Ge=null,Be=y=>{n&&i&&o&&a&&(n.hidden=y.view!=="issues",i.hidden=y.view!=="epics",o.hidden=y.view!=="board"),Ke(y),!y.selected_id&&y.view==="epics"&&ve.load(),!y.selected_id&&y.view==="board"&&$e.load(),window.localStorage.setItem("beads-ui.view",y.view)};w.subscribe(Be),Be(w.getState()),window.addEventListener("keydown",y=>{let h=y.ctrlKey||y.metaKey,U=String(y.key||"").toLowerCase(),G=y.target,re=G&&G.tagName?String(G.tagName).toLowerCase():"",ge=re==="input"||re==="textarea"||re==="select"||G&&typeof G.isContentEditable=="boolean"&&G.isContentEditable;h&&U==="n"&&(ge||(y.preventDefault(),I.open()))})}}typeof window<"u"&&typeof document<"u"&&window.addEventListener("DOMContentLoaded",()=>{try{let t=window.localStorage.getItem("beads-ui.theme"),s=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,n=t==="dark"||t==="light"?t:s?"dark":"light";document.documentElement.setAttribute("data-theme",n);let i=document.getElementById("theme-switch");i&&(i.checked=n==="dark")}catch{}let r=document.getElementById("theme-switch");r&&r.addEventListener("change",()=>{let t=r.checked?"dark":"light";document.documentElement.setAttribute("data-theme",t),window.localStorage.setItem("beads-ui.theme",t)});let e=document.getElementById("app");e&&lo(e)});export{lo as bootstrap};
|
|
761
761
|
//# sourceMappingURL=main.bundle.js.map
|