heartbeads 0.6.2 → 0.6.4

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.
Files changed (64) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/required-server-files.json +1 -1
  4. package/.next/server/app/_global-error.html +2 -2
  5. package/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/.next/server/app/_not-found.html +1 -1
  13. package/.next/server/app/_not-found.rsc +2 -2
  14. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  15. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  16. package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  17. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  20. package/.next/server/app/api/docs/page_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/docs.html +2 -2
  22. package/.next/server/app/api/docs.rsc +2 -2
  23. package/.next/server/app/api/docs.segments/_full.segment.rsc +2 -2
  24. package/.next/server/app/api/docs.segments/_head.segment.rsc +1 -1
  25. package/.next/server/app/api/docs.segments/_index.segment.rsc +2 -2
  26. package/.next/server/app/api/docs.segments/_tree.segment.rsc +2 -2
  27. package/.next/server/app/api/docs.segments/api/docs/__PAGE__.segment.rsc +1 -1
  28. package/.next/server/app/api/docs.segments/api/docs.segment.rsc +1 -1
  29. package/.next/server/app/api/docs.segments/api.segment.rsc +1 -1
  30. package/.next/server/app/index.html +1 -1
  31. package/.next/server/app/index.rsc +3 -3
  32. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  33. package/.next/server/app/index.segments/_full.segment.rsc +3 -3
  34. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  35. package/.next/server/app/index.segments/_index.segment.rsc +2 -2
  36. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  37. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  38. package/.next/server/app/login.html +1 -1
  39. package/.next/server/app/login.rsc +2 -2
  40. package/.next/server/app/login.segments/_full.segment.rsc +2 -2
  41. package/.next/server/app/login.segments/_head.segment.rsc +1 -1
  42. package/.next/server/app/login.segments/_index.segment.rsc +2 -2
  43. package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  44. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
  45. package/.next/server/app/login.segments/login.segment.rsc +1 -1
  46. package/.next/server/app/page_client-reference-manifest.js +1 -1
  47. package/.next/server/chunks/ssr/[root-of-the-server]__04e6e565._.js +3 -3
  48. package/.next/server/chunks/ssr/[root-of-the-server]__04e6e565._.js.map +1 -1
  49. package/.next/server/middleware/middleware-manifest.json +1 -1
  50. package/.next/server/middleware-manifest.json +1 -1
  51. package/.next/server/pages/404.html +1 -1
  52. package/.next/server/pages/500.html +2 -2
  53. package/.next/static/chunks/{7e4fcecd4ca504d5.js → 2394a2e7d0fff196.js} +3 -3
  54. package/.next/static/chunks/295ab055d1c2269f.css +1 -0
  55. package/app/page.tsx +163 -0
  56. package/components/AllCommentsPanel.tsx +177 -128
  57. package/components/BeadsGraph.tsx +8 -2
  58. package/components/DescriptionModal.tsx +51 -0
  59. package/components/ProfilePanel.tsx +107 -86
  60. package/package.json +1 -1
  61. package/.next/static/chunks/5d4996401af7e2d1.css +0 -1
  62. /package/.next/static/{zq8Ew2hci2YIJ61-i832n → 9kusRFLCVoWHASQ-qfwqV}/_buildManifest.js +0 -0
  63. /package/.next/static/{zq8Ew2hci2YIJ61-i832n → 9kusRFLCVoWHASQ-qfwqV}/_clientMiddlewareManifest.json +0 -0
  64. /package/.next/static/{zq8Ew2hci2YIJ61-i832n → 9kusRFLCVoWHASQ-qfwqV}/_ssgManifest.js +0 -0
@@ -1,8 +1,8 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,69090,(e,t,n)=>{"use strict";var r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,l=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g;function u(e){return e?e.replace(d,""):""}t.exports=function(e,t){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,d=1;function h(e){var t=e.match(i);t&&(n+=t.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function p(){var e={line:n,column:d};return function(t){return t.position=new f(e),m(l),t}}function f(e){this.start=e,this.end={line:n,column:d},this.source=t.source}function x(r){var i=Error(t.source+":"+n+":"+d+": "+r);if(i.reason=r,i.filename=t.source,i.line=n,i.column=d,i.source=e,t.silent);else throw i}function m(t){var n=t.exec(e);if(n){var r=n[0];return h(r),e=e.slice(r.length),n}}function g(e){var t;for(e=e||[];t=k();)!1!==t&&e.push(t);return e}function k(){var t=p();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return x("End of comment missing");var r=e.slice(2,n-2);return d+=2,h(r),e=e.slice(n),d+=2,t({type:"comment",comment:r})}}f.prototype.content=e,m(l);var b,v=[];for(g(v);b=function(){var e=p(),t=m(a);if(t){if(k(),!m(o))return x("property missing ':'");var n=m(s),i=e({type:"declaration",property:u(t[0].replace(r,"")),value:n?u(n[0].replace(r,"")):""});return m(c),i}}();)!1!==b&&(v.push(b),g(v));return v}},59596,(e,t,n)=>{"use strict";var r=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;let r=(0,i.default)(e),l="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;let{property:r,value:i}=e;l?t(r,i,e):i&&((n=n||{})[r]=i)}),n};let i=r(e.r(69090))},51521,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.camelCase=void 0;var r=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,l=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(e,t){return t.toUpperCase()},c=function(e,t){return"".concat(t,"-")};n.camelCase=function(e,t){var n;return(void 0===t&&(t={}),!(n=e)||l.test(n)||r.test(n))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(o,c):e.replace(a,c)).replace(i,s))}},63185,(e,t,n)=>{"use strict";var r=(e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(e.r(59596)),i=e.r(51521);function l(e,t){var n={};return e&&"string"==typeof e&&(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}l.default=l,t.exports=l},75609,(e,t,n)=>{"use strict";var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,l=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},s=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),l=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!l)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){l&&"__proto__"===t.name?l(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},d=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;else if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,l,a,u=arguments[0],h=1,p=arguments.length,f=!1;for("boolean"==typeof u&&(f=u,u=arguments[1]||{},h=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});h<p;++h)if(t=arguments[h],null!=t)for(n in t)r=d(u,n),u!==(i=d(t,n))&&(f&&i&&(s(i)||(l=o(i)))?(l?(l=!1,a=r&&o(r)?r:[]):a=r&&s(r)?r:{},c(u,{name:n,newValue:e(f,a,i)})):void 0!==i&&c(u,{name:n,newValue:i}));return u}},31713,e=>{"use strict";var t=e.i(66083),n=e.i(94607),r=e.i(14189);let i={status:"Status",priority:"Priority",type:"Type",owner:"Owner",assignee:"Assignee",prefix:"Prefix"},l={open:"#10b981",in_progress:"#f59e0b",blocked:"#ef4444",deferred:"#8b5cf6",closed:"#a1a1aa"},a={open:"Open",in_progress:"In Progress",blocked:"Blocked",deferred:"Deferred",closed:"Closed"},o={0:"P0 - Critical",1:"P1 - High",2:"P2 - Medium",3:"P3 - Low",4:"P4 - Backlog"},s={0:"#ef4444",1:"#f97316",2:"#3b82f6",3:"#a1a1aa",4:"#d4d4d8"},c=["#d20f39","#179299","#fe640b","#1e66f5","#40a02b","#8839ef","#df8e1d","#209fb5","#ea76cb","#04a5e5","#e64553","#7287fd","#dd7878","#dc8a78","#862d2d","#bf4040","#d27979","#931f1f","#d22d2d","#e06c6c","#a11212","#e61919","#ed5e5e","#86592d","#bf8040","#d2a679","#93591f","#d2802d","#e0a66c","#a15912","#e68019","#eda65e","#86862d","#bfbf40","#d2d279","#93931f","#d2d22d","#e0e06c","#a1a112","#e6e619","#eded5e","#59862d","#80bf40","#a6d279","#59931f","#80d22d","#a6e06c","#59a112","#80e619","#a6ed5e","#2d862d","#40bf40","#79d279","#1f931f","#2dd22d","#6ce06c","#12a112","#19e619","#5eed5e","#2d8659","#40bf80","#79d2a6","#1f9359","#2dd280","#6ce0a6","#12a159","#19e680","#5eeda6","#2d8686","#40bfbf","#79d2d2","#1f9393","#2dd2d2","#6ce0e0","#12a1a1","#19e6e6","#5eeded","#2d5986","#4080bf","#79a6d2","#1f5993","#2d80d2","#6ca6e0","#1259a1","#1980e6"],d={bug:"🐛",feature:"✨",task:"📝",epic:"🎯",chore:"🔧"},u={epic:"#8839ef",task:"#1e66f5",bug:"#d20f39",feature:"#40a02b",chore:"#acb0be"},h={epic:"Epic",task:"Task",bug:"Bug",feature:"Feature",chore:"Chore"};function p(e){return e.split(/[-_]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function f(e){if(!e)return"#acb0be";let t=0x811c9dc5;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=0x1000193*t>>>0;return c[t%c.length]}let x=new Proxy({},{get:(e,t)=>p(t),has:()=>!0}),m=new Proxy({},{get:(e,t)=>(function(e){let t=0x811c9dc5;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=0x1000193*t>>>0;let n=t%360;return`hsl(${n}, 65%, 55%)`})(t),has:()=>!0});function g(e){let t="object"==typeof e.source?e.source.id:e.source,n="object"==typeof e.target?e.target.id:e.target;return`${t}->${n}:${e.type}`}function k(e,t){if(!e)return{addedNodeIds:new Set(t.graphData.nodes.map(e=>e.id)),removedNodeIds:new Set,changedNodes:new Map,addedLinkKeys:new Set(t.graphData.links.map(g)),removedLinkKeys:new Set,hasChanges:!0};let n=new Map(e.graphData.nodes.map(e=>[e.id,e])),r=new Map(t.graphData.nodes.map(e=>[e.id,e])),i=new Set,l=new Set,a=new Map;for(let[e,t]of r)if(n.has(e)){let r=n.get(e),i=[];r.status!==t.status&&i.push({field:"status",from:r.status,to:t.status}),r.priority!==t.priority&&i.push({field:"priority",from:String(r.priority),to:String(t.priority)}),r.title!==t.title&&i.push({field:"title",from:r.title,to:t.title}),(r.owner||"")!==(t.owner||"")&&i.push({field:"owner",from:r.owner||"",to:t.owner||""}),(r.assignee||"")!==(t.assignee||"")&&i.push({field:"assignee",from:r.assignee||"",to:t.assignee||""}),i.length>0&&a.set(e,i)}else i.add(e);for(let e of n.keys())r.has(e)||l.add(e);let o=new Set(e.graphData.links.map(g)),s=new Set(t.graphData.links.map(g)),c=new Set,d=new Set;for(let e of s)o.has(e)||c.add(e);for(let e of o)s.has(e)||d.add(e);let u=i.size>0||l.size>0||a.size>0||c.size>0||d.size>0;return{addedNodeIds:i,removedNodeIds:l,changedNodes:a,addedLinkKeys:c,removedLinkKeys:d,hasChanges:u}}var b=e.i(40708);function v(e){return function(){return e}}function y(e){return(e()-.5)*1e-6}function w(e){return e.x+e.vx}function j(e){return e.y+e.vy}function z(e){var t,n,r,i=1,l=1;function a(){for(var e,a,s,c,d,u,h,p=t.length,f=0;f<l;++f)for(e=0,a=(0,b.quadtree)(t,w,j).visitAfter(o);e<p;++e)h=(u=n[(s=t[e]).index])*u,c=s.x+s.vx,d=s.y+s.vy,a.visit(x);function x(e,t,n,l,a){var o=e.data,p=e.r,f=u+p;if(o){if(o.index>s.index){var x=c-o.x-o.vx,m=d-o.y-o.vy,g=x*x+m*m;g<f*f&&(0===x&&(g+=(x=y(r))*x),0===m&&(g+=(m=y(r))*m),g=(f-(g=Math.sqrt(g)))/g*i,s.vx+=(x*=g)*(f=(p*=p)/(h+p)),s.vy+=(m*=g)*f,o.vx-=x*(f=1-f),o.vy-=m*f)}return}return t>c+f||l<c-f||n>d+f||a<d-f}}function o(e){if(e.data)return e.r=n[e.data.index];for(var t=e.r=0;t<4;++t)e[t]&&e[t].r>e.r&&(e.r=e[t].r)}function s(){if(t){var r,i,l=t.length;for(r=0,n=Array(l);r<l;++r)n[(i=t[r]).index]=+e(i,r,t)}}return"function"!=typeof e&&(e=v(null==e?1:+e)),a.initialize=function(e,n){t=e,r=n,s()},a.iterations=function(e){return arguments.length?(l=+e,a):l},a.strength=function(e){return arguments.length?(i=+e,a):i},a.radius=function(t){return arguments.length?(e="function"==typeof t?t:v(+t),s(),a):e},a}let N=null;function C(e){let t=e.blockerCount+e.dependentCount;return"epic"===e.issueType&&(t+=3),5+17*Math.min(t/6,1)}let S="status";function M(e){switch(S){case"priority":return s[e.priority]||s[2];case"type":return u[e.issueType]||u.task;case"owner":return f(e.createdBy);case"assignee":return f(e.assignee);case"prefix":return f(e.prefix);default:return l[e.status]||l.open}}function L(e){return 1-(1-e)*(1-e)}let A=new Map;function T(e,t){let n=A.get(e);if("loading"===n||"failed"===n)return null;if(n)return n;A.set(e,"loading");let r=new Image;return r.onload=()=>{A.set(e,r),t()},r.onerror=()=>{A.set(e,"failed")},r.src=e,null}function E(e,t,n,r,i,l,a){e.beginPath(),e.arc(t,n,r,0,2*Math.PI),e.fillStyle=a?"#3f3f46":"#e4e4e7",e.fill();let o=i.replace("@","").charAt(0).toUpperCase(),s=Math.min(7,Math.max(3,1.3*r));e.font=`600 ${s}px 'Inter', system-ui, sans-serif`,e.textAlign="center",e.textBaseline="middle",e.fillStyle="#71717a",e.fillText(o,t,n+.3)}function D(e,t){let n=new Set([e]),r=[{id:e,depth:0}];for(;r.length>0;){let{id:e,depth:i}=r.shift();if(!(i>=2))for(let l of t){let t="object"==typeof l.source?l.source.id:l.source,a="object"==typeof l.target?l.target.id:l.target;t!==e||n.has(a)||(n.add(a),r.push({id:a,depth:i+1})),a!==e||n.has(t)||(n.add(t),r.push({id:t,depth:i+1}))}}return n}function I(e){let t=e.current;if(!t)return;let n=t.zoom();"number"!=typeof n||isNaN(n)||(t.zoom(1.000001*n,0),requestAnimationFrame(()=>{e.current&&e.current.zoom(n,0)}))}let P=()=>"replace",F=()=>"#10b981",R=(0,r.forwardRef)(function({nodes:t,links:c,selectedNode:d,selectedNodeIds:x,onSelectedNodeIdsChange:m,onNodeClick:g,onNodeHover:k,onBackgroundClick:b,onNodeRightClick:y,commentedNodeIds:w,claimedNodeAvatars:j,assigneeNodeAvatars:A,onAvatarHover:R,onAvatarClick:B,timelineActive:$,stats:_,sidebarOpen:W,collapsedEpicIds:H,onCollapseAll:U,onExpandAll:V,colorMode:q="status",onColorModeChange:Y,autoFit:X=!0,onAutoFitToggle:K,pulseNodeId:G,showPulse:J=!0,onShowPulseToggle:Q,showParticles:Z=!0,onShowParticlesToggle:ee,focusedEpicId:et,onExitFocusedEpic:en,isMobile:er,onNodeDoubleTap:ei,activeLegendFilters:el,onToggleLegendFilter:ea,onClearLegendFilters:eo,theme:es},ec){let ed=(0,r.useRef)(null),eu=(0,r.useRef)(null),eh=(0,r.useRef)(null),ep=(0,r.useRef)(0),ef=(0,r.useRef)(()=>{}),[ex,em]=(0,r.useState)({width:800,height:600}),eg=(0,r.useRef)(!1),ek=(0,r.useRef)(new Set),eb=(0,r.useRef)(null),ev=(0,r.useRef)(es),[ey,ew]=(0,r.useState)(null),ej=(0,r.useRef)(null),ez=(0,r.useRef)(null),eN=(0,r.useRef)(null);(0,r.useEffect)(()=>()=>{eN.current&&clearTimeout(eN.current)},[]);let[eC,eS]=(0,r.useState)({w:160,h:120}),eM=eC.w,eL=eC.h,eA=(0,r.useRef)(null),[eT,eE]=(0,r.useState)(N);(0,r.useEffect)(()=>{N||e.A(1878).then(e=>{N=e.default||e,eE(()=>N)})},[]);let[eD,eI]=(0,r.useState)("dag"),[eP,eF]=(0,r.useState)(!0),eR=(0,r.useRef)(d),eB=(0,r.useRef)(null),eO=(0,r.useRef)(new Set),e$=(0,r.useRef)(w||new Map),e_=(0,r.useRef)(j||new Map),eW=(0,r.useRef)(A||new Map),eH=(0,r.useRef)(q),eU=(0,r.useRef)(G||null),eV=(0,r.useRef)(J),eq=(0,r.useRef)(()=>{});eq.current=()=>I(ed);let eY=(0,r.useRef)(R);eY.current=R;let eX=(0,r.useRef)(B);(0,r.useEffect)(()=>{eX.current=B},[B]);let eK=(0,r.useRef)(m);(0,r.useEffect)(()=>{eK.current=m},[m]);let eG=(0,r.useRef)(null),eJ=(0,r.useRef)(0),eQ=(0,r.useRef)({x:0,y:0}),eZ=(0,r.useRef)(t),e0=(0,r.useRef)(null),e1=(0,r.useRef)(null),e5=(0,r.useRef)([]),{viewNodes:e2,viewLinks:e4,preFilterNodes:e3}=(0,r.useMemo)(()=>{let e=t,n=c;if(et){let t=new Map;for(let e of n){let n="object"==typeof e.source?e.source.id:e.source,r="object"==typeof e.target?e.target.id:e.target;"parent-child"===e.type&&t.set(r,n)}let r=new Set(e.map(e=>e.id));for(let n of e)if(!t.has(n.id)&&n.id.includes(".")){let e=n.id.split(".")[0];r.has(e)&&t.set(n.id,e)}let i=new Set;for(let[e,n]of(i.add(et),t))n===et&&i.add(e);for(let e of n){let t="object"==typeof e.source?e.source.id:e.source,n="object"==typeof e.target?e.target.id:e.target;"parent-child"!==e.type&&(i.has(t)&&r.has(n)&&i.add(n),i.has(n)&&r.has(t)&&i.add(t))}e=e.filter(e=>i.has(e.id)),n=n.filter(e=>{let t="object"==typeof e.source?e.source.id:e.source,n="object"==typeof e.target?e.target.id:e.target;return i.has(t)&&i.has(n)})}if(H&&H.size>0){let t=new Map;for(let e of n){let n="object"==typeof e.source?e.source.id:e.source,r="object"==typeof e.target?e.target.id:e.target;"parent-child"===e.type&&t.set(r,n)}let r=new Set(e.map(e=>e.id));for(let n of e)if(!t.has(n.id)&&n.id.includes(".")){let e=n.id.split(".")[0];r.has(e)&&t.set(n.id,e)}let i=new Set;for(let[e,n]of t)H.has(n)&&i.add(e);if(i.size>0){let r=new Map;for(let e of i)r.set(e,t.get(e));let l=new Map,a=new Map,o=new Map;for(let[t,n]of r){l.set(n,(l.get(n)||0)+1);let r=e.find(e=>e.id===t);r&&(a.set(n,(a.get(n)||0)+r.blockerCount),o.set(n,(o.get(n)||0)+r.dependentCount))}let s=e.filter(e=>!i.has(e.id)).map(e=>({...e,blockerCount:e.blockerCount+(a.get(e.id)||0),dependentCount:e.dependentCount+(o.get(e.id)||0),collapsedCount:l.get(e.id)||0})),c=[],d=new Set;for(let e of n){let t="object"==typeof e.source?e.source.id:e.source,n="object"==typeof e.target?e.target.id:e.target;if("parent-child"===e.type&&i.has(n)||(t=r.get(t)||t)===(n=r.get(n)||n))continue;let l=`${t}->${n}:${e.type}`;d.has(l)||(d.add(l),c.push({source:t,target:n,type:e.type}))}e=s,n=c}}let r=[...e];if(el&&el.size>0){let t=new Set(e.filter(e=>{switch(q){case"status":return el.has(e.status);case"priority":return el.has(String(e.priority));case"type":return el.has(e.issueType);case"owner":return el.has(e.createdBy||"Unassigned");case"assignee":return el.has(e.assignee||"Unassigned");case"prefix":return el.has(p(e.prefix));default:return!0}}).map(e=>e.id));e=e.filter(e=>t.has(e.id)),n=n.filter(e=>{let n="object"==typeof e.source?e.source.id:e.source,r="object"==typeof e.target?e.target.id:e.target;return t.has(n)&&t.has(r)})}return{viewNodes:e,viewLinks:n,preFilterNodes:r}},[t,c,H,et,el,q]);eZ.current=e2;let e6=(0,r.useMemo)(()=>_&&el&&0!==el.size?{total:e2.length,edges:e4.length,prefixes:[...new Set(e2.map(e=>e.prefix))]}:_,[_,el,e2,e4]);(0,r.useEffect)(()=>{let e=new Map;for(let t of c){let n="object"==typeof t.source?t.source.id:t.source,r="object"==typeof t.target?t.target.id:t.target;"parent-child"===t.type&&e.set(r,n)}let n=new Set(t.map(e=>e.id));for(let r of t)if(!e.has(r.id)&&r.id.includes(".")){let t=r.id.split(".")[0];n.has(t)&&e.set(r.id,t)}let r=new Map;for(let[t,n]of e){let e=r.get(n)||[];e.push(t),r.set(n,e)}let i=new Map(t.map(e=>[e.id,e])),l=[];for(let[e,t]of r){let n=i.get(e);n&&l.push({parentId:e,title:n.title||e,prefix:n.prefix,memberIds:[e,...t]})}e5.current=l},[t,c]);let e8=(0,r.useMemo)(()=>{if("status"===q||"priority"===q||"type"===q)return[];let e=new Map;for(let t of e3)switch(q){case"owner":{let n=t.createdBy||void 0;e.set(n||"Unassigned",f(n));break}case"assignee":{let n=t.assignee||void 0;e.set(n||"Unassigned",f(n));break}case"prefix":e.set(p(t.prefix),f(t.prefix))}return Array.from(e.entries()).sort(([e],[t])=>"Unassigned"===e?1:"Unassigned"===t?-1:e.localeCompare(t)).map(([e,t])=>({label:e,color:t}))},[q,e3]),e7=(0,r.useRef)(e4);(0,r.useEffect)(()=>{e7.current=e4},[e4]),(0,r.useEffect)(()=>{eR.current=d;let e=eB.current||d;e?eO.current=D(e.id,e4):eO.current=new Set,I(ed),cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current())},[d,e4]),(0,r.useEffect)(()=>{ek.current=x||new Set,I(ed),cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current())},[x]),(0,r.useEffect)(()=>{e$.current=w||new Map,I(ed)},[w]),(0,r.useEffect)(()=>{e_.current=j||new Map,I(ed)},[j]),(0,r.useEffect)(()=>{eW.current=A||new Map,I(ed)},[A]),(0,r.useEffect)(()=>{eH.current=q,S=q,I(ed),ep.current=requestAnimationFrame(()=>ef.current())},[q]),(0,r.useEffect)(()=>{eU.current=G||null,eV.current=J,I(ed)},[G,J]),(0,r.useEffect)(()=>{ev.current=es,I(ed),ep.current=requestAnimationFrame(()=>ef.current())},[es]),(0,r.useEffect)(()=>{ej.current=ey},[ey]),(0,r.useEffect)(()=>{if(!ey)return;let e=e=>{let t=ej.current;if(!t)return;let n=e.clientX-t.startX,r=e.clientY-t.startY,i=t.active||Math.abs(n)>5||Math.abs(r)>5;ew(t=>t?{...t,currentX:e.clientX,currentY:e.clientY,active:i}:null)},t=e=>{let t=ej.current;if(!t)return void ew(null);if(t.active){let n=ed.current;if(n){let r=eu.current?.getBoundingClientRect();if(r){let i=n.screen2GraphCoords(Math.min(t.startX,e.clientX)-r.left,Math.min(t.startY,e.clientY)-r.top),l=n.screen2GraphCoords(Math.max(t.startX,e.clientX)-r.left,Math.max(t.startY,e.clientY)-r.top),a=new Set;for(let e of eZ.current)null!=e.x&&null!=e.y&&e.x>=i.x&&e.x<=l.x&&e.y>=i.y&&e.y<=l.y&&a.add(e.id);a.size>0&&eK.current?.(a)}}}ew(null)};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t)}},[!!ey]),(0,r.useEffect)(()=>{let e=eu.current;if(!e)return;let t=t=>{let n;eQ.current={x:t.clientX,y:t.clientY};let r=ed.current,i=eY.current;if(!r||!i)return;let l=e_.current;if(0===l.size&&0===eW.current.size){eG.current&&(eG.current=null,i(null));return}let a=e.getBoundingClientRect(),o=t.clientX-a.left,s=t.clientY-a.top;try{n=r.screen2GraphCoords(o,s)}catch{return}let c=Math.max(4,10/(r.zoom()||1));for(let r of eZ.current){if(null==r.x||null==r.y)continue;let a=l.get(r.id);if(!a)continue;let o=C(r),s=r.x+.7*o,d=r.y+.7*o,u=n.x-s,h=n.y-d;if(u*u+h*h<=c*c){eG.current!==r.id&&(eG.current=r.id,i({handle:a.handle,avatar:a.avatar,claimedAt:a.claimedAt,did:a.did,x:t.clientX,y:t.clientY,nodeId:r.id,nodeClosed:"closed"===r.status})),e.style.cursor="pointer";return}}let d=eW.current;if(d.size>0)for(let r of eZ.current){if(null==r.x||null==r.y||l.get(r.id))continue;let a=d.get(r.id);if(!a)continue;let o=C(r),s=r.x+.7*o,u=r.y+.7*o,h=n.x-s,p=n.y-u;if(h*h+p*p<=c*c){eG.current!==r.id&&(eG.current=r.id,i({handle:a.handle,avatar:a.avatar,claimedAt:a.updatedAt,did:void 0,x:t.clientX,y:t.clientY,isAssignee:!0,nodeId:r.id,nodeClosed:"closed"===r.status})),e.style.cursor="pointer";return}}eG.current&&(eG.current=null,i(null)),e.style.cursor=""},n=t=>{let n=ed.current,r=eX.current;if(!n||!r)return;let i=e_.current,l=eW.current;if((!i||0===i.size)&&(!l||0===l.size))return;let a=e.getBoundingClientRect(),o=t.clientX-a.left,s=t.clientY-a.top,{x:c,y:d}=n.screen2GraphCoords(o,s),u=Math.max(4,10/(n.zoom()||1));if(i)for(let e of eZ.current){if(null==e.x||null==e.y)continue;let n=i.get(e.id);if(!n)continue;let l=C(e),a=e.x+.7*l,o=e.y+.7*l,s=c-a,h=d-o;if(s*s+h*h<=u*u){t.stopPropagation(),eJ.current=Date.now(),r({handle:n.handle,avatar:n.avatar,did:n.did,nodeId:e.id});return}}if(l)for(let e of eZ.current){if(null==e.x||null==e.y||i?.has(e.id))continue;let n=l.get(e.id);if(!n)continue;let a=C(e),o=e.x+.7*a,s=e.y+.7*a,h=c-o,p=d-s;if(h*h+p*p<=u*u){t.stopPropagation(),eJ.current=Date.now(),r({handle:n.handle,avatar:n.avatar,did:void 0,nodeId:e.id,isAssignee:!0});return}}};return e.addEventListener("mousemove",t),e.addEventListener("click",n),()=>{e.removeEventListener("mousemove",t),e.removeEventListener("click",n)}},[]),(0,r.useEffect)(()=>{let e=()=>{if(eu.current){let e=eu.current.getBoundingClientRect();em({width:e.width,height:e.height})}};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&ek.current.size>0&&eK.current?.(new Set)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);let e9=(0,r.useCallback)(e=>{let t=ed.current;if(!t)return;let n=e2.find(t=>t.id===e.id);n&&void 0!==n.x&&void 0!==n.y&&(t.centerAt(n.x,n.y,500),t.zoom(2.5,500),g(e))},[g,e2]),te=(0,r.useCallback)(e=>{let t=ed.current;if(!t)return;let n=e2.find(t=>t.id===e);n&&void 0!==n.x&&void 0!==n.y&&(t.centerAt(n.x,n.y,500),t.zoom(2.5,500))},[e2]);(0,r.useImperativeHandle)(ec,()=>({focusNode:e9,zoomToNode:te}),[e9,te]);let tt=(0,r.useCallback)(e=>{let t=e||null;eB.current=t;let n=t||eR.current;n?eO.current=D(n.id,e7.current):eO.current=new Set,I(ed),cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current()),k(t,eQ.current.x,eQ.current.y)},[k]),tn=(0,r.useCallback)((e,t)=>{t.preventDefault(),y?.(e,t)},[y]);(0,r.useEffect)(()=>{let e,t=ed.current;if(!t||0===e2.length)return;let n=()=>{t.d3Force("radial",null),t.d3Force("x",null),t.d3Force("y",null)},r=()=>{e2.forEach(e=>{delete e.fx,delete e.fy})};if("dag"===eD)n(),t.d3Force("charge")?.strength(-250).distanceMax(500),t.d3Force("link")?.distance(120).strength(.3),t.d3Force("center")?.strength(.015),t.d3Force("collision",z().radius(e=>C(e)+8).strength(.8));else if("radial"===eD){n(),r();let e=new Map;for(let t of e4){if("parent-child"===t.type)continue;let n="object"==typeof t.target?t.target.id:t.target,r="object"==typeof t.source?t.source.id:t.source;e.has(n)||e.set(n,[]),e.get(n).push(r)}let i=new Map,l=[];e2.forEach(t=>{e.has(t.id)||(i.set(t.id,0),l.push(t.id))});let a=0;for(;a<l.length;){let e=l[a++],t=i.get(e);for(let n of e4){if("parent-child"===n.type)continue;let r="object"==typeof n.source?n.source.id:n.source,a="object"==typeof n.target?n.target.id:n.target;r!==e||i.has(a)||(i.set(a,t+1),l.push(a))}}e2.forEach(e=>{e._depth=i.get(e.id)??0}),Array.from(i.values());let o=Math.max(200,4*e2.length);t.d3Force("charge")?.strength(-300).distanceMax(800),t.d3Force("link")?.distance(150).strength(.15),t.d3Force("center")?.strength(0),t.d3Force("radial",(function(e,t,n){var r,i,l,a=v(.1);function o(e){for(var a=0,o=r.length;a<o;++a){var s=r[a],c=s.x-t||1e-6,d=s.y-n||1e-6,u=Math.sqrt(c*c+d*d),h=(l[a]-u)*i[a]*e/u;s.vx+=c*h,s.vy+=d*h}}function s(){if(r){var t,n=r.length;for(t=0,i=Array(n),l=Array(n);t<n;++t)l[t]=+e(r[t],t,r),i[t]=isNaN(l[t])?0:+a(r[t],t,r)}}return"function"!=typeof e&&(e=v(+e)),null==t&&(t=0),null==n&&(n=0),o.initialize=function(e){r=e,s()},o.strength=function(e){return arguments.length?(a="function"==typeof e?e:v(+e),s(),o):a},o.radius=function(t){return arguments.length?(e="function"==typeof t?t:v(+t),s(),o):e},o.x=function(e){return arguments.length?(t=+e,o):t},o.y=function(e){return arguments.length?(n=+e,o):n},o})(e=>(e._depth||0)*o,0,0).strength(.8)),t.d3Force("x",null),t.d3Force("y",null),t.d3Force("collision",z().radius(e=>C(e)+10).strength(.9))}else if("cluster"===eD){n(),r();let e=[...new Set(e2.map(e=>e.prefix))],i=Math.max(400,5*e2.length,150*e.length),l=new Map;e.forEach((t,n)=>{let r=2*Math.PI*n/e.length-Math.PI/2;l.set(t,{x:Math.cos(r)*i,y:Math.sin(r)*i})}),t.d3Force("charge")?.strength(-200).distanceMax(600),t.d3Force("link")?.distance(100).strength(.15),t.d3Force("center")?.strength(0),t.d3Force("x",(function(e){var t,n,r,i=v(.1);function l(e){for(var i,l=0,a=t.length;l<a;++l)i=t[l],i.vx+=(r[l]-i.x)*n[l]*e}function a(){if(t){var l,a=t.length;for(l=0,n=Array(a),r=Array(a);l<a;++l)n[l]=isNaN(r[l]=+e(t[l],l,t))?0:+i(t[l],l,t)}}return"function"!=typeof e&&(e=v(null==e?0:+e)),l.initialize=function(e){t=e,a()},l.strength=function(e){return arguments.length?(i="function"==typeof e?e:v(+e),a(),l):i},l.x=function(t){return arguments.length?(e="function"==typeof t?t:v(+t),a(),l):e},l})(e=>l.get(e.prefix)?.x||0).strength(.5)),t.d3Force("y",(function(e){var t,n,r,i=v(.1);function l(e){for(var i,l=0,a=t.length;l<a;++l)i=t[l],i.vy+=(r[l]-i.y)*n[l]*e}function a(){if(t){var l,a=t.length;for(l=0,n=Array(a),r=Array(a);l<a;++l)n[l]=isNaN(r[l]=+e(t[l],l,t))?0:+i(t[l],l,t)}}return"function"!=typeof e&&(e=v(null==e?0:+e)),l.initialize=function(e){t=e,a()},l.strength=function(e){return arguments.length?(i="function"==typeof e?e:v(+e),a(),l):i},l.y=function(t){return arguments.length?(e="function"==typeof t?t:v(+t),a(),l):e},l})(e=>l.get(e.prefix)?.y||0).strength(.5)),t.d3Force("collision",z().radius(e=>C(e)+10).strength(.9))}else"spread"===eD?(n(),r(),t.d3Force("charge")?.strength(-300).distanceMax(500),t.d3Force("link")?.distance(180).strength(.4),t.d3Force("center")?.strength(.02),t.d3Force("collision",z().radius(e=>C(e)+8).strength(.8))):(n(),r(),t.d3Force("charge")?.strength(-180).distanceMax(400),t.d3Force("link")?.distance(e=>((e.source?.blockerCount||0)+(e.source?.dependentCount||0)+((e.target?.blockerCount||0)+(e.target?.dependentCount||0)))/2>4?90:120).strength(.6),t.d3Force("center")?.strength(.03),t.d3Force("collision",z().radius(e=>C(e)+6).strength(.7)));return t.d3ReheatSimulation(),X&&(e=setTimeout(()=>{ed.current&&ed.current.zoomToFit(400,60)},eg.current?600:1e3)),eg.current=!0,()=>{e&&clearTimeout(e)}},[eD,e2,e4,X]);let tr=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(tr.current||!eT||0===t.length)return;tr.current=!0;let e=setTimeout(()=>{eI("force")},15);return()=>clearTimeout(e)},[eT,t.length]),(0,r.useEffect)(()=>{if(!$&&X&&ed.current&&t.length>0){let e=setTimeout(()=>{ed.current.zoomToFit(400,60)},800);return()=>clearTimeout(e)}},[t.length,$,X]);let ti=(0,r.useRef)(void 0);(0,r.useEffect)(()=>{if(void 0===ti.current){ti.current=et??null;return}ti.current=et??null;let e=ed.current;if(!e)return;let t=setTimeout(()=>{e.zoomToFit(400,60)},100);return()=>clearTimeout(t)},[et]);let tl=(0,r.useMemo)(()=>{let e=Math.sqrt(e2.length)||1;return e2.forEach((t,n)=>{if(null==t.x&&null==t.y){let r=n*Math.PI*(3-Math.sqrt(5)),i=300*Math.sqrt(.5+n)/e;t.x=i*Math.cos(r),t.y=i*Math.sin(r)}}),{nodes:e2,links:e4}},[e2,e4]),ta=()=>"dark"===ev.current,to=(0,r.useCallback)((e,t,n)=>{let r=C(e),i=M(e),a=f(e.prefix),o=eR.current?.id===e.id,s=eB.current?.id===e.id,c=ek.current.has(e.id),d=eO.current,u=d.has(e.id),h=d.size>0,p=Date.now(),x=1,m=e._spawnTime;if(m){var g;let e=p-m;e<500&&(x=1+2.70158*Math.pow((g=e/500)-1,3)+1.70158*Math.pow(g-1,2))}let k=1,b=1,v=e._removeTime;if(v){let e=p-v;if(e<400){let t=e/400;k=1-L(t),b=1-t}else k=0,b=0}let y=x*k;if(y<=.01)return;let w=r*y,j=(ek.current.size>0&&!c?.25:h&&!u?.15:"closed"===e.status?.5:1)*b;if(j<=.01)return;t.save(),t.globalAlpha=j,(u&&h||c)&&(t.shadowColor="#10b981",t.shadowBlur=o?20:c?14:s?16:10),n>.3&&(t.beginPath(),t.arc(e.x,e.y,w+2,0,2*Math.PI),t.strokeStyle=a,t.lineWidth=2,t.stroke()),t.beginPath(),t.arc(e.x,e.y,w,0,2*Math.PI),t.fillStyle=i,t.fill(),t.strokeStyle=o?"#10b981":c?"#34d399":s?"#3f3f46":"#e4e4e7",t.lineWidth=o?2.5:c||s?2:1,t.stroke(),t.shadowBlur=0;let z=e._changedAt;if(z){let n=p-z;if(n<800){let r=n/800,i=l[e.status]||"#a1a1aa";t.beginPath(),t.arc(e.x,e.y,w+4+20*r,0,2*Math.PI),t.strokeStyle=i,t.lineWidth=2*(1-r),t.globalAlpha=(1-r)*.6,t.stroke(),t.globalAlpha=j}}if(eV.current&&eU.current===e.id){let r=w+Math.max(25,30/n);for(let i=0;i<3;i++){let l=(p+500*i)%2e3/2e3,a=w+2/n+l*(r-w),o=(1-l)*.6;t.beginPath(),t.arc(e.x,e.y,a,0,2*Math.PI),t.strokeStyle="#10b981",t.lineWidth=Math.max(1.5/n,.5),t.globalAlpha=o*j,t.stroke()}t.globalAlpha=j}if(m){let n=p-m;if(n<500){let r=n/500;t.beginPath(),t.arc(e.x,e.y,w+6+8*r,0,2*Math.PI),t.strokeStyle="#10b981",t.lineWidth=3*(1-r),t.globalAlpha=(1-r)*.4,t.stroke(),t.globalAlpha=j}}if(e.priority<=1&&n>.5){let r=Math.min(10,Math.max(4,12/n));t.font=`${r}px sans-serif`,t.textAlign="center",t.textBaseline="bottom",t.fillText(0===e.priority?"🔥🔥":"🔥",e.x,e.y-w-2)}if(n>.5){let r=Math.min(7,Math.max(3,10/n));t.font=`500 ${r}px 'Inter', system-ui, sans-serif`,t.textAlign="center",t.textBaseline="top",t.fillStyle=ta()?"#d4d4d8":"#3f3f46",t.globalAlpha=.85*j;let i=e.id;n>1.5?i=O(e.title||e.id,30):n>.9&&(i=O(e.title||e.id,18)),t.fillText(i,e.x,e.y+w+3);let l=e.collapsedCount;if(l&&l>0){let i=Math.min(5.5,Math.max(2.5,8/n));t.font=`400 ${i}px 'Inter', system-ui, sans-serif`,t.fillStyle=ta()?"#71717a":"#a1a1aa",t.fillText(`${l} task${1!==l?"s":""}`,e.x,e.y+w+3+r+1)}}let N=e$.current.get(e.id);if(N&&N>0&&n>.4){let r=Math.min(6,Math.max(3.5,8/n)),i=e.x+.75*w,l=e.y-.75*w,a=N>99?"99+":String(N);t.save(),t.globalAlpha=Math.min(j,.95),t.beginPath(),t.arc(i,l,r,0,2*Math.PI),t.fillStyle="#ef4444",t.fill(),t.strokeStyle=ta()?"#18181b":"#ffffff",t.lineWidth=Math.max(.8,1.2/n),t.stroke();let o=Math.min(7,Math.max(3,1.3*r));t.font=`600 ${o}px 'Inter', system-ui, sans-serif`,t.textAlign="center",t.textBaseline="middle",t.fillStyle="#ffffff",t.fillText(a,i,l+.3),t.restore()}let S=e_.current.get(e.id);if(S){let r=Math.max(4,10/n),i=e.x+.7*w,l=e.y+.7*w;if(t.save(),t.globalAlpha=1,S.avatar){let e=T(S.avatar,()=>eq.current());e?(t.save(),t.beginPath(),t.arc(i,l,r,0,2*Math.PI),t.clip(),t.drawImage(e,i-r,l-r,2*r,2*r),t.restore()):E(t,i,l,r,S.handle,n,ta())}else E(t,i,l,r,S.handle,n,ta());t.beginPath(),t.arc(i,l,r,0,2*Math.PI),t.strokeStyle=ta()?"#18181b":"#ffffff",t.lineWidth=Math.max(.8,1.2/n),t.stroke(),t.restore()}if(!S){let r=eW.current.get(e.id);if(r){let i=Math.max(4,10/n),l=e.x+.7*w,a=e.y+.7*w;if(t.save(),t.globalAlpha=1,r.avatar){let e=T(r.avatar,()=>eq.current());e?(t.save(),t.beginPath(),t.arc(l,a,i,0,2*Math.PI),t.clip(),t.drawImage(e,l-i,a-i,2*i,2*i),t.restore()):E(t,l,a,i,r.handle,n,ta())}else E(t,l,a,i,r.handle,n,ta());t.beginPath(),t.arc(l,a,i,0,2*Math.PI),t.strokeStyle=ta()?"#18181b":"#ffffff",t.lineWidth=Math.max(.8,1.2/n),t.stroke(),t.restore()}}t.restore()},[]),ts=(0,r.useCallback)((e,t,n)=>{let r=e.source,i=e.target;if(void 0===r.x||void 0===i.x)return;let l=Date.now(),a=1,o=1,s=e._spawnTime;if(s){let e=l-s;if(e<500){let t=e/500;a=L(t),o=1+(1-t)*1.5}}let c=1,d=e._removeTime;if(d){let e=l-d;if(!(e<400))return;c=1-L(e/400)}let u=a*c;if(u<=.01)return;let h=r.id||e.source,p=i.id||e.target,f="parent-child"===e.type,x=eO.current,m=x.size>0,g=m&&x.has(h)&&x.has(p),k=(f?m?g?.5:.05:.2:m?g?.8:.08:.35)*u;if(k<=.01)return;t.save(),t.globalAlpha=k,f?(t.strokeStyle=g?ta()?"#a1a1aa":"#71717a":(ta(),"#a1a1aa"),t.lineWidth=Math.max(.6,1.5/n)*o,t.setLineDash([4,3])):(t.strokeStyle=g?"#10b981":ta()?"#a1a1aa":"#d4d4d8",t.lineWidth=(g?Math.max(2,2.5/n):Math.max(.8,1.2/n))*o);let b=i.x-r.x,v=i.y-r.y,y=Math.sqrt(b*b+v*v),w=(r.x+i.x)/2+.15*v,j=(r.y+i.y)/2-.15*b;if(t.beginPath(),t.moveTo(r.x,r.y),t.quadraticCurveTo(w,j,i.x,i.y),t.stroke(),f&&t.setLineDash([]),s){let e=l-s;e<300&&(t.save(),t.globalAlpha=(1-e/300)*.5,t.strokeStyle="#10b981",t.lineWidth=(f?3:4)/n,t.beginPath(),t.moveTo(r.x,r.y),t.quadraticCurveTo(w,j,i.x,i.y),t.stroke(),t.restore())}if(!f){let e=C(i);if(y<e+1)return void t.restore();let l=Math.min(8,6/n),a=1-e/y,o=r.x+a*b,s=r.y+a*v,c=Math.atan2(v,b);t.fillStyle=g?"#10b981":ta()?"#a1a1aa":"#d4d4d8",t.beginPath(),t.moveTo(o,s),t.lineTo(o-l*Math.cos(c-Math.PI/7),s-l*Math.sin(c-Math.PI/7)),t.lineTo(o-l*Math.cos(c+Math.PI/7),s-l*Math.sin(c+Math.PI/7)),t.closePath(),t.fill()}t.restore()},[]),tc=(0,r.useCallback)((e,t)=>{if(!eP)return;let n=t>=.8?0:t<=.4?1:(.8-t)/.4;if(n<=.01)return;let r=e5.current;if(0===r.length)return;let i=new Map;for(let e of e2)null!=e.x&&null!=e.y&&i.set(e.id,{x:e.x,y:e.y});for(let l of(e.save(),r)){let r=0,a=0,o=0;for(let e of l.memberIds){let t=i.get(e);t&&(r+=t.x,a+=t.y,o++)}if(0===o)continue;let s=r/o,c=a/o,d=0;for(let e of l.memberIds){let t=i.get(e);if(t){let e=t.x-s,n=t.y-c,r=Math.sqrt(e*e+n*n);r>d&&(d=r)}}let u=d+30,h=f(l.prefix);e.beginPath(),e.arc(s,c,u,0,2*Math.PI),e.globalAlpha=.05*n,e.fillStyle=h,e.fill(),e.globalAlpha=.25*n,e.strokeStyle=h,e.lineWidth=1.5/t,e.setLineDash([8/t,4/t]),e.stroke(),e.setLineDash([]);let p=Math.min(24,Math.max(10,14/t)),x=Math.min(12,Math.max(5,8/t)),m=.35*p;e.font=`500 ${x}px 'Inter', system-ui, sans-serif`,e.textAlign="center",e.textBaseline="middle",e.globalAlpha=.45*n,e.fillStyle=ta()?"#a1a1aa":"#71717a",e.fillText(l.parentId,s,c-.5*p-m),e.font=`600 ${p}px 'Inter', system-ui, sans-serif`,e.globalAlpha=.85*n,e.fillStyle=ta()?"#d4d4d8":"#18181b";let g=l.title.length>40?l.title.slice(0,39)+"…":l.title;e.fillText(g,s,c+.15*p);let k=Math.min(14,Math.max(6,9/t));e.font=`400 ${k}px 'Inter', system-ui, sans-serif`,e.globalAlpha=.5*n,e.fillStyle="#71717a",e.fillText(`${l.memberIds.length} issue${1!==l.memberIds.length?"s":""}`,s,c+.15*p+.7*p)}e.restore()},[e2,t,eP]),td=(0,r.useCallback)((e,t,n)=>{let r=C(e)+5;n.fillStyle=t,n.beginPath(),n.arc(e.x,e.y,r,0,2*Math.PI),n.fill()},[]),tu=(0,r.useCallback)(()=>{},[]),th=(0,r.useCallback)(()=>{let e=eh.current,t=ed.current;if(!e||!t)return;let n=e.getContext("2d");if(!n)return;let r=1/0,i=-1/0,l=1/0,a=-1/0,o=!1;for(let e of e2)null!=e.x&&null!=e.y&&(o=!0,e.x<r&&(r=e.x),e.x>i&&(i=e.x),e.y<l&&(l=e.y),e.y>a&&(a=e.y));if(!o)return;let s=(i+=40)-(r-=40)||1,c=(a+=40)-(l-=40)||1,d=eM-16,u=eL-16,h=Math.min(d/s,u/c),f=8+(d-s*h)/2,x=8+(u-c*h)/2,m=window.devicePixelRatio||1;(e.width!==eM*m||e.height!==eL*m)&&(e.width=eM*m,e.height=eL*m,n.setTransform(m,0,0,m,0,0)),n.clearRect(0,0,eM,eL),n.fillStyle=ta()?"rgba(24, 24, 27, 0.92)":"rgba(250, 250, 250, 0.92)",n.beginPath(),n.roundRect(0,0,eM,eL,6),n.fill();let g=eO.current,k=g.size>0,b=eB.current?.id||eR.current?.id||null,v=eb.current,y=null!==v;for(let e of e4){let t=e.source,i=e.target;if(null==t.x||null==i.x)continue;let a=t.id||e.source,o=i.id||e.target,s=k&&g.has(a)&&g.has(o);n.globalAlpha=y?.03:k?s?.5:.04:.1,n.strokeStyle=s?"#10b981":ta()?"#71717a":"#a1a1aa",n.lineWidth=s?1:.5;let c=f+(t.x-r)*h,d=x+(t.y-l)*h,u=f+(i.x-r)*h,p=x+(i.y-l)*h;n.beginPath(),n.moveTo(c,d),n.lineTo(u,p),n.stroke()}for(let e of(n.globalAlpha=1,e2)){if(null==e.x||null==e.y)continue;let t=f+(e.x-r)*h,i=x+(e.y-l)*h,a=e.id===b,o=g.has(e.id),s=!0;if(y)switch(S){case"status":s=e.status===v;break;case"priority":s=String(e.priority)===v;break;case"type":s=e.issueType===v;break;case"owner":s=(e.createdBy||"Unassigned")===v;break;case"assignee":s=(e.assignee||"Unassigned")===v;break;case"prefix":s=p(e.prefix)===v}y&&!s?n.globalAlpha=.08:y&&s?n.globalAlpha=1:k&&!o?n.globalAlpha=.1:"closed"===e.status?n.globalAlpha=.35:n.globalAlpha=.85,n.fillStyle=M(e);let c="epic"===e.issueType?3:2;if(y&&s?c+=1:a?c=5:k&&o&&(c=4),a){let r=n.globalAlpha;n.globalAlpha=.4,n.fillStyle="#10b981",n.beginPath(),n.arc(t,i,c+2,0,2*Math.PI),n.fill(),n.globalAlpha=r,n.fillStyle=M(e)}n.fillRect(t-c/2,i-c/2,c,c)}n.globalAlpha=1;let w=e_.current;if(w.size>0)for(let e of e2){if(null==e.x||null==e.y)continue;let t=w.get(e.id);if(!t)continue;let i=f+(e.x-r)*h,a=x+(e.y-l)*h;if(n.save(),n.globalAlpha=1,t.avatar){let e=T(t.avatar,()=>eq.current());e?(n.save(),n.beginPath(),n.arc(i,a,5,0,2*Math.PI),n.clip(),n.drawImage(e,i-5,a-5,10,10),n.restore()):(n.beginPath(),n.arc(i,a,5,0,2*Math.PI),n.fillStyle=ta()?"#52525b":"#d4d4d8",n.fill())}else n.beginPath(),n.arc(i,a,5,0,2*Math.PI),n.fillStyle=ta()?"#52525b":"#d4d4d8",n.fill();n.beginPath(),n.arc(i,a,5,0,2*Math.PI),n.strokeStyle=ta()?"#18181b":"#ffffff",n.lineWidth=1,n.stroke(),n.restore()}let j=eW.current;if(j.size>0)for(let e of e2){if(null==e.x||null==e.y||w.get(e.id))continue;let t=j.get(e.id);if(!t)continue;let i=f+(e.x-r)*h,a=x+(e.y-l)*h;if(n.save(),n.globalAlpha=1,t.avatar){let e=T(t.avatar,()=>eq.current());e?(n.save(),n.beginPath(),n.arc(i,a,5,0,2*Math.PI),n.clip(),n.drawImage(e,i-5,a-5,10,10),n.restore()):(n.beginPath(),n.arc(i,a,5,0,2*Math.PI),n.fillStyle=ta()?"#52525b":"#d4d4d8",n.fill())}else n.beginPath(),n.arc(i,a,5,0,2*Math.PI),n.fillStyle=ta()?"#52525b":"#d4d4d8",n.fill();n.beginPath(),n.arc(i,a,5,0,2*Math.PI),n.strokeStyle=ta()?"#18181b":"#ffffff",n.lineWidth=1,n.stroke(),n.restore()}try{let e=t.screen2GraphCoords(0,0),i=t.screen2GraphCoords(ex.width,ex.height),a=f+(e.x-r)*h,o=x+(e.y-l)*h,s=(i.x-e.x)*h,c=(i.y-e.y)*h,d=Math.max(0,a),u=Math.max(0,o),p=Math.min(eM-d,s-(d-a)),m=Math.min(eL-u,c-(u-o));p>0&&m>0&&(n.fillStyle="rgba(16, 185, 129, 0.06)",n.fillRect(d,u,p,m),n.strokeStyle="rgba(16, 185, 129, 0.5)",n.lineWidth=1.5,n.strokeRect(d,u,p,m))}catch{}},[e2,e4,ex,eM,eL,8]);ef.current=th;let tp=(0,r.useCallback)(()=>{cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>{th()})},[th]);(0,r.useEffect)(()=>{if(!eT||0===t.length)return;let e=setInterval(()=>{th()},200);return()=>clearInterval(e)},[eT,t.length,th]),(0,r.useEffect)(()=>{let e,t=!0,n=!1,r=Date.now();return(e2.some(e=>e._spawnTime&&r-e._spawnTime<500||e._removeTime&&r-e._removeTime<400||e._changedAt&&r-e._changedAt<800)||e4.some(e=>e._spawnTime&&r-e._spawnTime<500||e._removeTime&&r-e._removeTime<400))&&!n&&(n=!0,e=requestAnimationFrame(function r(){if(!t)return;let i=Date.now();e2.some(e=>!!e._spawnTime&&!!(i-e._spawnTime<500)||!!e._removeTime&&!!(i-e._removeTime<400)||!!e._changedAt&&!!(i-e._changedAt<800))||e4.some(e=>!!e._spawnTime&&!!(i-e._spawnTime<500)||!!e._removeTime&&!!(i-e._removeTime<400))?(I(ed),e=requestAnimationFrame(r)):n=!1})),()=>{t=!1,cancelAnimationFrame(e)}},[e2,e4]);let tf=(0,r.useCallback)(e=>{let t=ed.current;if(!t)return;let n=e.currentTarget.getBoundingClientRect(),r=e.clientX-n.left,i=e.clientY-n.top,l=1/0,a=-1/0,o=1/0,s=-1/0;for(let e of e2)null!=e.x&&null!=e.y&&(e.x<l&&(l=e.x),e.x>a&&(a=e.x),e.y<o&&(o=e.y),e.y>s&&(s=e.y));let c=(a+=40)-(l-=40)||1,d=(s+=40)-(o-=40)||1,u=eM-16,h=eL-16,p=Math.min(u/c,h/d),f=l+(r-(8+(u-c*p)/2))/p,x=o+(i-(8+(h-d*p)/2))/p;t.centerAt(f,x,300)},[e2,eM,eL,8]),tx=(0,r.useCallback)((e,t)=>{if(Date.now()-eJ.current<100)return;if(!er)return void g(e,t);let n=Date.now(),r=ez.current;r&&r.nodeId===e.id&&n-r.time<300?(eN.current&&(clearTimeout(eN.current),eN.current=null),ez.current=null,ei?.(e,window.innerWidth/2,window.innerHeight/2)):(ez.current={nodeId:e.id,time:n},eN.current&&clearTimeout(eN.current),eN.current=setTimeout(()=>{eN.current=null,ez.current=null,g(e,t)},300))},[er,g,ei]);(0,r.useEffect)(()=>{let e=eu.current;if(!e)return;let t=t=>{let n=t.target.closest("button, [data-tutorial], .bead-tooltip");if(n&&n!==eu.current||2!==t.button)return;let r=ed.current;if(!r)return;let i=e.getBoundingClientRect(),l=r.screen2GraphCoords(t.clientX-i.left,t.clientY-i.top);for(let e of eZ.current)if(null!=e.x&&null!=e.y){let t=e.x-l.x,n=e.y-l.y;if(Math.sqrt(t*t+n*n)<=C(e))return}t.preventDefault(),t.stopPropagation(),ew({startX:t.clientX,startY:t.clientY,currentX:t.clientX,currentY:t.clientY,active:!1})},n=e=>{ej.current&&e.preventDefault()};return e.addEventListener("pointerdown",t,{capture:!0}),e.addEventListener("contextmenu",n),()=>{e.removeEventListener("pointerdown",t,{capture:!0}),e.removeEventListener("contextmenu",n)}},[]);let tm=(0,r.useCallback)((e,t)=>{let n=ek.current;if(n.size<2||!n.has(e.id))return;if(!e0.current){let e=new Map;for(let t of eZ.current)n.has(t.id)&&null!=t.x&&null!=t.y&&e.set(t.id,{x:t.x,y:t.y});e0.current=e}let r=e0.current.get(e.id);if(!r)return;let i=e.x-r.x,l=e.y-r.y;for(let[t,n]of e0.current){if(t===e.id)continue;let r=eZ.current.find(e=>e.id===t);r&&(r.fx=n.x+i,r.fy=n.y+l)}},[]),tg=(0,r.useCallback)(e=>{if(e0.current){for(let[e]of e0.current){let t=eZ.current.find(t=>t.id===e);t&&(t.fx=void 0,t.fy=void 0)}e0.current=null,e1.current=null}},[]);return(0,n.jsxs)("div",{ref:eu,className:"w-full h-full relative","data-tutorial":"graph",children:[(0,n.jsxs)("div",{className:"absolute top-3 left-3 sm:top-4 sm:left-4 z-10 flex flex-col gap-1.5 sm:gap-2",children:[et&&en&&(0,n.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 text-xs font-medium bg-emerald-50/90 dark:bg-emerald-950/90 backdrop-blur-sm rounded-lg border border-emerald-200 dark:border-emerald-800 shadow-sm text-emerald-700 dark:text-emerald-300",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-emerald-500 dark:text-emerald-400 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 3.75H6A2.25 2.25 0 003.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0120.25 6v1.5M16.5 20.25H18A2.25 2.25 0 0020.25 18v-1.5M7.5 20.25H6A2.25 2.25 0 013.75 18v-1.5"})}),(0,n.jsxs)("span",{className:"truncate max-w-[180px]",children:["Focused: ",(0,n.jsx)("span",{className:"font-semibold",children:t.find(e=>e.id===et)?.title||et})]}),(0,n.jsx)("button",{onClick:en,className:"ml-auto p-0.5 rounded hover:bg-emerald-200/50 dark:hover:bg-emerald-900/50 transition-colors flex-shrink-0",title:"Show full graph",children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex w-full items-start gap-1.5 sm:gap-2",children:(0,n.jsxs)("div",{className:"flex w-full bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm rounded-lg border border-zinc-200 dark:border-zinc-700 shadow-sm overflow-hidden","data-tutorial":"layouts",children:[(0,n.jsx)("button",{onClick:()=>eI("force"),className:`flex-1 flex items-center justify-center gap-1 px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors ${"force"===eD?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,children:(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"4",cy:"4",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"12",cy:"3",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"3",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"13",cy:"11",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("line",{x1:"4",y1:"4",x2:"8",y2:"8",strokeOpacity:"0.5"}),(0,n.jsx)("line",{x1:"12",y1:"3",x2:"8",y2:"8",strokeOpacity:"0.5"}),(0,n.jsx)("line",{x1:"3",y1:"12",x2:"8",y2:"8",strokeOpacity:"0.5"}),(0,n.jsx)("line",{x1:"13",y1:"11",x2:"8",y2:"8",strokeOpacity:"0.5"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Force"})]})}),(0,n.jsx)("div",{className:"w-px bg-zinc-200 dark:bg-zinc-700"}),(0,n.jsx)("button",{onClick:()=>eI("dag"),className:`flex-1 flex items-center justify-center gap-1 px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors ${"dag"===eD?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,children:(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"2.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"4",cy:"8",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"12",cy:"8",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"2",cy:"13.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"6",cy:"13.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"12",cy:"13.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("line",{x1:"8",y1:"4",x2:"4",y2:"6.5",strokeOpacity:"0.5"}),(0,n.jsx)("line",{x1:"8",y1:"4",x2:"12",y2:"6.5",strokeOpacity:"0.5"}),(0,n.jsx)("line",{x1:"4",y1:"9.5",x2:"2",y2:"12",strokeOpacity:"0.5"}),(0,n.jsx)("line",{x1:"4",y1:"9.5",x2:"6",y2:"12",strokeOpacity:"0.5"}),(0,n.jsx)("line",{x1:"12",y1:"9.5",x2:"12",y2:"12",strokeOpacity:"0.5"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"DAG"})]})}),(0,n.jsx)("div",{className:"w-px bg-zinc-200 dark:bg-zinc-700"}),(0,n.jsx)("button",{onClick:()=>eI("radial"),className:`flex-1 flex items-center justify-center gap-1 px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors ${"radial"===eD?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,children:(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"2",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"8",cy:"8",r:"5",fill:"none",strokeOpacity:"0.5"}),(0,n.jsx)("circle",{cx:"8",cy:"8",r:"7.5",fill:"none",strokeOpacity:"0.3"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Radial"})]})}),(0,n.jsx)("div",{className:"w-px bg-zinc-200 dark:bg-zinc-700"}),(0,n.jsx)("button",{onClick:()=>eI("cluster"),className:`flex-1 flex items-center justify-center gap-1 px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors ${"cluster"===eD?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,children:(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"3.5",cy:"4",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"6",cy:"6",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"3",cy:"7",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"11",cy:"10",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"13.5",cy:"11.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"11",cy:"13",r:"1.5",fill:"currentColor",stroke:"none"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Cluster"})]})}),(0,n.jsx)("div",{className:"w-px bg-zinc-200 dark:bg-zinc-700"}),(0,n.jsx)("button",{onClick:()=>eI("spread"),className:`flex-1 flex items-center justify-center gap-1 px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors ${"spread"===eD?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,children:(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"2",cy:"2",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"14",cy:"3",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"3",cy:"14",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"13",cy:"13",r:"1.5",fill:"currentColor",stroke:"none"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Spread"})]})})]})}),(0,n.jsx)("div",{className:"flex w-full items-start gap-1.5 sm:gap-2","data-tutorial":"view-controls",children:(0,n.jsxs)("div",{className:"flex w-full bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm rounded-lg border border-zinc-200 dark:border-zinc-700 shadow-sm overflow-hidden",children:[(U||V)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:H&&H.size>0?V:U,className:"flex-1 flex items-center justify-center gap-1 px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-zinc-800","data-tutorial":"btn-collapse",children:H&&H.size>0?(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Expand all"})]}):(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"})}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Collapse all"})]})}),(0,n.jsx)("div",{className:"w-px bg-zinc-200 dark:bg-zinc-700"})]}),(0,n.jsx)("button",{onClick:()=>eF(e=>!e),className:`flex-1 flex items-center justify-center gap-1 px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors ${eP?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,title:eP?"Hide cluster labels":"Show cluster labels","data-tutorial":"btn-clusters",children:(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"6",strokeDasharray:"2.5 2",strokeOpacity:eP?1:.5}),(0,n.jsx)("line",{x1:"5",y1:"8",x2:"11",y2:"8",strokeOpacity:eP?1:.4}),(0,n.jsx)("line",{x1:"6",y1:"10",x2:"10",y2:"10",strokeOpacity:eP?.6:.25,strokeWidth:"1"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Clusters"})]})}),(0,n.jsx)("div",{className:"w-px bg-zinc-200 dark:bg-zinc-700"}),(0,n.jsx)("button",{onClick:()=>K?.(),className:`flex-1 flex items-center justify-center gap-1 px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors ${X?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,title:X?"Auto-fit enabled: camera adjusts after updates":"Auto-fit disabled: camera stays fixed","data-tutorial":"btn-autofit",children:(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:[(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 3.75H6A2.25 2.25 0 003.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0120.25 6v1.5M20.25 16.5V18A2.25 2.25 0 0118 20.25h-1.5M3.75 16.5V18A2.25 2.25 0 006 20.25h1.5"}),(0,n.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Auto-fit"})]})}),(0,n.jsx)("div",{className:"w-px bg-zinc-200 dark:bg-zinc-700"}),(0,n.jsx)("button",{onClick:()=>Q?.(),className:`flex-1 flex items-center justify-center gap-1 px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors ${J?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,title:J?"Pulse enabled: ripple highlights most recent activity":"Pulse disabled: no activity highlight","data-tutorial":"btn-pulse",children:(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.07 4.93A10 10 0 014.93 19.07M4.93 4.93a10 10 0 0114.14 14.14",strokeOpacity:"0.5"}),(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.24 7.76a6 6 0 01.01 8.49M7.76 7.76a6 6 0 000 8.49",strokeOpacity:"0.7"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Pulse"})]})}),(0,n.jsx)("div",{className:"w-px bg-zinc-200 dark:bg-zinc-700"}),(0,n.jsx)("button",{onClick:()=>ee?.(),className:`flex-1 flex items-center justify-center gap-1 px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors ${Z?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,title:Z?"Particles enabled: flowing dots show dependency direction":"Particles disabled: improves performance on large graphs","data-tutorial":"btn-particles",children:(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:[(0,n.jsx)("circle",{cx:"5",cy:"12",r:"1.5",fill:"currentColor"}),(0,n.jsx)("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor"}),(0,n.jsx)("circle",{cx:"19",cy:"12",r:"1.5",fill:"currentColor"}),(0,n.jsx)("path",{strokeLinecap:"round",d:"M7 12h3m3 0h3",strokeOpacity:"0.4"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Particles"})]})})]})})]}),!$&&(0,n.jsxs)("div",{className:"absolute bottom-2 sm:bottom-4 z-10 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm rounded-lg border border-zinc-200 dark:border-zinc-700 shadow-sm px-2 sm:px-3 py-1.5 sm:py-2 text-xs text-zinc-400 dark:text-zinc-500 transition-[right] duration-300 ease-out","data-tutorial":"legend",style:{right:W?"calc(360px + 1rem)":"1rem",maxWidth:320},children:[e6&&(0,n.jsxs)("div",{className:"text-zinc-500 dark:text-zinc-400 mb-1.5","data-tutorial":"legend-stats",children:[(0,n.jsx)("strong",{className:"text-zinc-700 dark:text-zinc-300",children:e6.total})," issues"," · ",(0,n.jsx)("strong",{className:"text-zinc-700 dark:text-zinc-300",children:e6.edges})," deps"," · ",(0,n.jsx)("strong",{className:"text-emerald-600 dark:text-emerald-400",children:e6.prefixes.length}),1===e6.prefixes.length?" project":" projects",el&&el.size>0&&(0,n.jsx)("span",{className:"text-zinc-400 dark:text-zinc-500",children:" (filtered)"})]}),(0,n.jsx)("div",{className:"hidden sm:flex bg-zinc-100 dark:bg-zinc-800 rounded-md overflow-hidden mb-1.5","data-tutorial":"legend-color-mode",children:["status","priority","type","owner","assignee","prefix"].map(e=>(0,n.jsx)("button",{onClick:()=>Y?.(e),className:`flex-1 px-2 py-1 text-[10px] font-medium transition-colors ${q===e?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60"}`,children:i[e]},e))}),(0,n.jsxs)("div",{className:"hidden sm:flex flex-wrap gap-x-3 gap-y-1 mb-1.5","data-tutorial":"legend-items",children:["status"===q?(0,n.jsx)(n.Fragment,{children:["open","in_progress","blocked","deferred","closed"].map(e=>{let t=el?.has(e),r=el&&el.size>0;return(0,n.jsxs)("button",{onClick:()=>ea?.(e),onMouseEnter:()=>{eb.current=e,cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current())},onMouseLeave:()=>{eb.current=null,cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current())},title:`${a[e]} — click to filter`,className:`flex items-center gap-1 px-1 py-0.5 rounded transition-all cursor-pointer ${t?"bg-zinc-200/80 dark:bg-zinc-700/80 ring-1 ring-zinc-300 dark:ring-zinc-600":r?"opacity-40 hover:opacity-70":"hover:bg-zinc-100 dark:hover:bg-zinc-800"}`,children:[(0,n.jsx)("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:l[e]}}),(0,n.jsx)("span",{className:`${t?"text-zinc-800 dark:text-zinc-200 font-medium":"text-zinc-500 dark:text-zinc-400"}`,children:a[e]})]},e)})}):"priority"===q?(0,n.jsx)(n.Fragment,{children:[0,1,2,3,4].map(e=>{let t=String(e),r=el?.has(t),i=el&&el.size>0;return(0,n.jsxs)("button",{onClick:()=>ea?.(t),onMouseEnter:()=>{eb.current=t,cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current())},onMouseLeave:()=>{eb.current=null,cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current())},title:`${o[e]} — click to filter`,className:`flex items-center gap-1 px-1 py-0.5 rounded transition-all cursor-pointer ${r?"bg-zinc-200/80 dark:bg-zinc-700/80 ring-1 ring-zinc-300 dark:ring-zinc-600":i?"opacity-40 hover:opacity-70":"hover:bg-zinc-100 dark:hover:bg-zinc-800"}`,children:[(0,n.jsx)("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:s[e]}}),(0,n.jsx)("span",{className:`${r?"text-zinc-800 dark:text-zinc-200 font-medium":"text-zinc-500 dark:text-zinc-400"}`,children:o[e]})]},e)})}):"type"===q?(0,n.jsx)(n.Fragment,{children:["epic","task","bug","feature","chore"].map(e=>{let t=el?.has(e),r=el&&el.size>0;return(0,n.jsxs)("button",{onClick:()=>ea?.(e),onMouseEnter:()=>{eb.current=e,cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current())},onMouseLeave:()=>{eb.current=null,cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current())},title:`${h[e]} — click to filter`,className:`flex items-center gap-1 px-1 py-0.5 rounded transition-all cursor-pointer ${t?"bg-zinc-200/80 dark:bg-zinc-700/80 ring-1 ring-zinc-300 dark:ring-zinc-600":r?"opacity-40 hover:opacity-70":"hover:bg-zinc-100 dark:hover:bg-zinc-800"}`,children:[(0,n.jsx)("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:u[e]}}),(0,n.jsx)("span",{className:`${t?"text-zinc-800 dark:text-zinc-200 font-medium":"text-zinc-500 dark:text-zinc-400"}`,children:h[e]})]},e)})}):(0,n.jsx)(n.Fragment,{children:e8.map(({label:e,color:t})=>{let r=el?.has(e),i=el&&el.size>0;return(0,n.jsxs)("button",{onClick:()=>ea?.(e),onMouseEnter:()=>{eb.current=e,cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current())},onMouseLeave:()=>{eb.current=null,cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current())},title:`${e} — click to filter by ${q}`,className:`flex items-center gap-1 px-1 py-0.5 rounded transition-all cursor-pointer ${r?"bg-zinc-200/80 dark:bg-zinc-700/80 ring-1 ring-zinc-300 dark:ring-zinc-600":i?"opacity-40 hover:opacity-70":"hover:bg-zinc-100 dark:hover:bg-zinc-800"}`,children:[(0,n.jsx)("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:t}}),(0,n.jsx)("span",{className:`${r?"text-zinc-800 dark:text-zinc-200 font-medium":"text-zinc-500 dark:text-zinc-400"}`,children:e})]},e)})}),el&&el.size>0&&(0,n.jsx)("button",{onClick:()=>eo?.(),className:"text-[10px] text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-400 underline ml-auto",children:"Clear filters"})]}),(0,n.jsx)("div",{className:"hidden sm:flex flex-col gap-0.5 text-zinc-400 dark:text-zinc-500",children:(0,n.jsxs)("span",{children:["Size = importance · Ring = project","status"!==q&&` \xb7 Fill = ${i[q].toLowerCase()}`]})}),(0,n.jsx)("span",{className:"sm:hidden",children:"Tap a node for details"})]}),(0,n.jsxs)("div",{className:"hidden sm:block absolute bottom-4 left-4 z-10","data-tutorial":"minimap",style:{width:eM,height:eL},children:[(0,n.jsx)("canvas",{ref:eh,width:eM,height:eL,onClick:tf,className:"rounded-lg border border-zinc-200 dark:border-zinc-700 shadow-sm cursor-crosshair bg-white dark:bg-zinc-900",style:{width:eM,height:eL}}),(0,n.jsx)("div",{className:"absolute top-0 left-2 right-2 h-1.5 cursor-n-resize hover:bg-zinc-300/40 rounded-t-lg transition-colors",onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),eA.current={edge:"top",startX:e.clientX,startY:e.clientY,startW:eM,startH:eL};let t=e=>{if(!eA.current)return;let t=eA.current.startY-e.clientY,n=Math.max(80,Math.min(400,eA.current.startH+t));eS(e=>({...e,h:n}))},n=()=>{eA.current=null,window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",t),window.addEventListener("mouseup",n)}}),(0,n.jsx)("div",{className:"absolute top-2 right-0 bottom-2 w-1.5 cursor-e-resize hover:bg-zinc-300/40 rounded-r-lg transition-colors",onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),eA.current={edge:"right",startX:e.clientX,startY:e.clientY,startW:eM,startH:eL};let t=e=>{if(!eA.current)return;let t=e.clientX-eA.current.startX,n=Math.max(100,Math.min(500,eA.current.startW+t));eS(e=>({...e,w:n}))},n=()=>{eA.current=null,window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",t),window.addEventListener("mouseup",n)}}),(0,n.jsx)("div",{className:"absolute top-0 right-0 w-3 h-3 cursor-ne-resize hover:bg-zinc-300/40 rounded-tr-lg transition-colors",onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),eA.current={edge:"top-right",startX:e.clientX,startY:e.clientY,startW:eM,startH:eL};let t=e=>{if(!eA.current)return;let t=e.clientX-eA.current.startX,n=eA.current.startY-e.clientY;eS({w:Math.max(100,Math.min(500,eA.current.startW+t)),h:Math.max(80,Math.min(400,eA.current.startH+n))})},n=()=>{eA.current=null,window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",t),window.addEventListener("mouseup",n)}})]}),eT?(0,n.jsx)(eT,{ref:ed,graphData:tl,width:ex.width,height:ex.height,nodeCanvasObject:to,nodeCanvasObjectMode:P,nodePointerAreaPaint:td,onRenderFramePost:tc,linkCanvasObject:ts,linkCanvasObjectMode:P,linkDirectionalParticles:e=>Z&&"parent-child"!==e.type?2:0,linkDirectionalParticleSpeed:.004*!!Z,linkDirectionalParticleWidth:2.5*!!Z,linkDirectionalParticleColor:F,dagMode:"dag"===eD?"td":void 0,dagLevelDistance:150,onDagError:tu,d3AlphaDecay:.02,d3VelocityDecay:.3,cooldownTicks:300,warmupTicks:50,onNodeClick:tx,onNodeHover:tt,onNodeRightClick:tn,onBackgroundClick:b,onNodeDrag:tm,onNodeDragEnd:tg,onZoom:tp,backgroundColor:"transparent",autoPauseRedraw:!(J&&G)}):(0,n.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,n.jsx)("div",{className:"text-zinc-400 dark:text-zinc-500 text-sm animate-pulse-soft",children:"Loading graph engine..."})}),ey&&ey.active&&(0,n.jsx)("div",{style:{position:"absolute",left:Math.min(ey.startX,ey.currentX)-(eu.current?.getBoundingClientRect().left||0),top:Math.min(ey.startY,ey.currentY)-(eu.current?.getBoundingClientRect().top||0),width:Math.abs(ey.currentX-ey.startX),height:Math.abs(ey.currentY-ey.startY),border:"1.5px dashed #10b981",backgroundColor:"rgba(16, 185, 129, 0.08)",borderRadius:4,pointerEvents:"none",zIndex:5}})]})}),B=r.default.memo(R);function O(e,t){return e.length<=t?e:e.slice(0,t-1)+"…"}function $(){}function _(){}let W=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,H=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,U={};function V(e,t){return((t||U).jsx?H:W).test(e)}let q=/[ \t\n\f\r]/g;function Y(e){return""===e.replace(q,"")}class X{constructor(e,t){this.attribute=t,this.property=e}}X.prototype.attribute="",X.prototype.booleanish=!1,X.prototype.boolean=!1,X.prototype.commaOrSpaceSeparated=!1,X.prototype.commaSeparated=!1,X.prototype.defined=!1,X.prototype.mustUseProperty=!1,X.prototype.number=!1,X.prototype.overloadedBoolean=!1,X.prototype.property="",X.prototype.spaceSeparated=!1,X.prototype.space=void 0;let K=0,G=er(),J=er(),Q=er(),Z=er(),ee=er(),et=er(),en=er();function er(){return 2**++K}e.s(["boolean",0,G,"booleanish",0,J,"commaOrSpaceSeparated",0,en,"commaSeparated",0,et,"number",0,Z,"overloadedBoolean",0,Q,"spaceSeparated",0,ee],83954);var ei=e.i(83954);let el=Object.keys(ei);class ea extends X{constructor(e,t,n,r){let i=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",r),"number"==typeof n)for(;++i<el.length;){const e=el[i];!function(e,t,n){n&&(e[t]=n)}(this,el[i],(n&ei[e])===ei[e])}}}function eo(e){return e.toLowerCase()}ea.prototype.defined=!0;let es=/[A-Z]/g,ec=/-[a-z]/g,ed=/^data[-\w.:]+$/i;function eu(e){return"-"+e.toLowerCase()}function eh(e){return e.charAt(1).toUpperCase()}let ep={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};class ef{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function ex(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ef(n,r,t)}function em(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let l=new ea(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[eo(r)]=r,n[eo(l.attribute)]=r}return new ef(t,n,e.space)}ef.prototype.normal={},ef.prototype.property={},ef.prototype.space=void 0;let eg=em({properties:{ariaActiveDescendant:null,ariaAtomic:J,ariaAutoComplete:null,ariaBusy:J,ariaChecked:J,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:ee,ariaCurrent:null,ariaDescribedBy:ee,ariaDetails:null,ariaDisabled:J,ariaDropEffect:ee,ariaErrorMessage:null,ariaExpanded:J,ariaFlowTo:ee,ariaGrabbed:J,ariaHasPopup:null,ariaHidden:J,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ee,ariaLevel:Z,ariaLive:null,ariaModal:J,ariaMultiLine:J,ariaMultiSelectable:J,ariaOrientation:null,ariaOwns:ee,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:J,ariaReadOnly:J,ariaRelevant:null,ariaRequired:J,ariaRoleDescription:ee,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:J,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function ek(e,t){return t in e?e[t]:t}function eb(e,t){return ek(e,t.toLowerCase())}let ev=em({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:et,acceptCharset:ee,accessKey:ee,action:null,allow:null,allowFullScreen:G,allowPaymentRequest:G,allowUserMedia:G,alt:null,as:null,async:G,autoCapitalize:null,autoComplete:ee,autoFocus:G,autoPlay:G,blocking:ee,capture:null,charSet:null,checked:G,cite:null,className:ee,cols:Z,colSpan:null,content:null,contentEditable:J,controls:G,controlsList:ee,coords:Z|et,crossOrigin:null,data:null,dateTime:null,decoding:null,default:G,defer:G,dir:null,dirName:null,disabled:G,download:Q,draggable:J,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:G,formTarget:null,headers:ee,height:Z,hidden:Q,high:Z,href:null,hrefLang:null,htmlFor:ee,httpEquiv:ee,id:null,imageSizes:null,imageSrcSet:null,inert:G,inputMode:null,integrity:null,is:null,isMap:G,itemId:null,itemProp:ee,itemRef:ee,itemScope:G,itemType:ee,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:G,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:G,muted:G,name:null,nonce:null,noModule:G,noValidate:G,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:G,optimum:Z,pattern:null,ping:ee,placeholder:null,playsInline:G,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:G,referrerPolicy:null,rel:ee,required:G,reversed:G,rows:Z,rowSpan:Z,sandbox:ee,scope:null,scoped:G,seamless:G,selected:G,shadowRootClonable:G,shadowRootDelegatesFocus:G,shadowRootMode:null,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:J,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:G,useMap:null,value:J,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ee,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:G,declare:G,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:G,noHref:G,noShade:G,noWrap:G,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:J,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:G,disableRemotePlayback:G,prefix:null,property:null,results:Z,security:null,unselectable:null},space:"html",transform:eb}),ey=em({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:en,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:ee,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:G,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:et,g2:et,glyphName:et,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:en,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ee,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:en,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:en,rev:en,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:en,requiredFeatures:en,requiredFonts:en,requiredFormats:en,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:en,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:en,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:en,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ek}),ew=em({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),ej=em({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:eb}),ez=em({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),eN=ex([eg,ev,ew,ej,ez],"html"),eC=ex([eg,ey,ew,ej,ez],"svg");var eS=e.i(63185);let eM=eA("end"),eL=eA("start");function eA(e){return function(t){let n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function eT(e){return e&&"object"==typeof e?"position"in e||"type"in e?eD(e.position):"start"in e||"end"in e?eD(e):"line"in e||"column"in e?eE(e):"":""}function eE(e){return eI(e&&e.line)+":"+eI(e&&e.column)}function eD(e){return eE(e&&e.start)+"-"+eE(e&&e.end)}function eI(e){return e&&"number"==typeof e?e:1}class eP extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},l=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(l=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){const e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=eT(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=l&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}eP.prototype.file="",eP.prototype.name="",eP.prototype.reason="",eP.prototype.message="",eP.prototype.stack="",eP.prototype.column=void 0,eP.prototype.line=void 0,eP.prototype.ancestors=void 0,eP.prototype.cause=void 0,eP.prototype.fatal=void 0,eP.prototype.place=void 0,eP.prototype.ruleId=void 0,eP.prototype.source=void 0;let eF={}.hasOwnProperty,eR=new Map,eB=/[A-Z]/g,eO=new Set(["table","tbody","thead","tfoot","tr"]),e$=new Set(["td","th"]),e_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function eW(e,t,n){var r,i,l,a,o,s,c,d,u;let h,p,f,x,m,g,k,b,v,y,w;return"element"===t.type?(r=e,i=t,l=n,p=h=r.schema,"svg"===i.tagName.toLowerCase()&&"html"===h.space&&(r.schema=eC),r.ancestors.push(i),f=eq(r,i.tagName,!1),x=function(e,t){let n,r,i={};for(r in t.properties)if("children"!==r&&eF.call(t.properties,r)){let l=function(e,t,n){let r=function(e,t){let n=eo(t),r=t,i=X;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&ed.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(ec,eh);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ec.test(e)){let n=e.replace(es,eu);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=ea}return new i(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){var i;let t;if(Array.isArray(n)&&(n=r.commaSeparated?(t={},(""===(i=n)[i.length-1]?[...i,""]:i).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return(0,eS.default)(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new eP("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=e_+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,n={};for(t in e)eF.call(e,t)&&(n[function(e){let t=e.replace(eB,eX);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?ep[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(l){let[r,a]=l;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof a&&e$.has(t.tagName)?n=a:i[r]=a}}return n&&((i.style||(i.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),i}(r,i),m=eV(r,i),eO.has(i.tagName)&&(m=m.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&Y(e.value):Y(e))})),eH(r,x,f,i),eU(x,m),r.ancestors.pop(),r.schema=h,r.create(i,f,x,l)):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return $("ExpressionStatement"===n.type),e.evaluater.evaluateExpression(n.expression)}eY(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?(a=e,o=t,s=n,k=g=a.schema,"svg"===o.name&&"html"===g.space&&(a.schema=eC),a.ancestors.push(o),b=null===o.name?a.Fragment:eq(a,o.name,!0),v=function(e,t){let n={};for(let r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];$("ExpressionStatement"===t.type);let i=t.expression;$("ObjectExpression"===i.type);let l=i.properties[0];$("SpreadElement"===l.type),Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else eY(e,t.position);else{let i,l=r.name;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];$("ExpressionStatement"===t.type),i=e.evaluater.evaluateExpression(t.expression)}else eY(e,t.position);else i=null===r.value||r.value;n[l]=i}return n}(a,o),y=eV(a,o),eH(a,v,b,o),eU(v,y),a.ancestors.pop(),a.schema=g,a.create(o,b,v,s)):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);eY(e,t.position)}(e,t):"root"===t.type?(c=e,d=t,u=n,eU(w={},eV(c,d)),c.create(d,c.Fragment,w,u)):"text"===t.type?t.value:void 0}function eH(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function eU(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function eV(e,t){let n=[],r=-1,i=e.passKeys?new Map:eR;for(;++r<t.children.length;){let l,a=t.children[r];if(e.passKeys){let e="element"===a.type?a.tagName:"mdxJsxFlowElement"===a.type||"mdxJsxTextElement"===a.type?a.name:void 0;if(e){let t=i.get(e)||0;l=e+"-"+t,i.set(e,t+1)}}let o=eW(e,a,l);void 0!==o&&n.push(o)}return n}function eq(e,t,n){let r;if(n)if(t.includes(".")){let e,n=t.split("."),i=-1;for(;++i<n.length;){let t=V(n[i])?{type:"Identifier",name:n[i]}:{type:"Literal",value:n[i]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(i&&"Literal"===t.type),optional:!1}:t}$(e,"always a result"),r=e}else r=V(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){let t=r.value;return eF.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);eY(e)}function eY(e,t){let n=new eP("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=e_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function eX(e){return"-"+e.toLowerCase()}let eK={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},eG={};function eJ(e,t){let n=t||eG;return eQ(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function eQ(e,t,n){var r;if((r=e)&&"object"==typeof r){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return eZ(e.children,t,n)}return Array.isArray(e)?eZ(e,t,n):""}function eZ(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=eQ(e[i],t,n);return r.join("")}function e0(e,t,n,r){let i,l=e.length,a=0;if(t=t<0?-t>l?0:l+t:t>l?l:t,n=n>0?n:0,r.length<1e4)(i=Array.from(r)).unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);a<r.length;)(i=r.slice(a,a+1e4)).unshift(t,0),e.splice(...i),a+=1e4,t+=1e4}function e1(e,t){return e.length>0?(e0(e,e.length,0,t),e):t}let e5={}.hasOwnProperty;function e2(e){let t={},n=-1;for(;++n<e.length;)!function(e,t){let n;for(n in t){let r,i=(e5.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];if(l)for(r in l){e5.call(i,r)||(i[r]=[]);let e=l[r];!function(e,t){let n=-1,r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);e0(e,0,0,r)}(i[r],Array.isArray(e)?e:e?[e]:[])}}}(t,e[n]);return t}let e4=ta(/[A-Za-z]/),e3=ta(/[\dA-Za-z]/),e6=ta(/[#-'*+\--9=?A-Z^-~]/);function e8(e){return null!==e&&(e<32||127===e)}let e7=ta(/\d/),e9=ta(/[\dA-Fa-f]/),te=ta(/[!-/:-@[-`{-~]/);function tt(e){return null!==e&&e<-2}function tn(e){return null!==e&&(e<0||32===e)}function tr(e){return -2===e||-1===e||32===e}let ti=ta(/\p{P}|\p{S}/u),tl=ta(/\s/);function ta(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function to(e,t,n,r){let i=r?r-1:1/0,l=0;return function(r){return tr(r)?(e.enter(n),function r(a){return tr(a)&&l++<i?(e.consume(a),r):(e.exit(n),t(a))}(r)):t(r)}}let ts={tokenize:function(e){let t,n=e.attempt(this.parser.constructs.contentInitial,function(t){return null===t?void e.consume(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),to(e,n,"linePrefix"))},function(n){return e.enter("paragraph"),function n(r){let i=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=i),t=i,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return tt(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},tc={tokenize:function(e){let t,n,r,i=this,l=[],a=0;return o;function o(t){if(a<l.length){let n=l[a];return i.containerState=n[1],e.attempt(n[0].continuation,s,c)(t)}return c(t)}function s(e){if(a++,i.containerState._closeFlow){let n;i.containerState._closeFlow=void 0,t&&g();let r=i.events.length,l=r;for(;l--;)if("exit"===i.events[l][0]&&"chunkFlow"===i.events[l][1].type){n=i.events[l][1].end;break}m(a);let o=r;for(;o<i.events.length;)i.events[o][1].end={...n},o++;return e0(i.events,l+1,0,i.events.slice(r)),i.events.length=o,c(e)}return o(e)}function c(n){if(a===l.length){if(!t)return h(n);if(t.currentConstruct&&t.currentConstruct.concrete)return f(n);i.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(td,d,u)(n)}function d(e){return t&&g(),m(a),h(e)}function u(e){return i.parser.lazy[i.now().line]=a!==l.length,r=i.now().offset,f(e)}function h(t){return i.containerState={},e.attempt(td,p,f)(t)}function p(e){return a++,l.push([i.currentConstruct,i.containerState]),h(e)}function f(r){if(null===r){t&&g(),m(0),e.consume(r);return}return t=t||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){x(e.exit("chunkFlow"),!0),m(0),e.consume(n);return}return tt(n)?(e.consume(n),x(e.exit("chunkFlow")),a=0,i.interrupt=void 0,o):(e.consume(n),t)}(r)}function x(e,l){let o=i.sliceStream(e);if(l&&o.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(o),i.parser.lazy[e.start.line]){let e,n,l=t.events.length;for(;l--;)if(t.events[l][1].start.offset<r&&(!t.events[l][1].end||t.events[l][1].end.offset>r))return;let o=i.events.length,s=o;for(;s--;)if("exit"===i.events[s][0]&&"chunkFlow"===i.events[s][1].type){if(e){n=i.events[s][1].end;break}e=!0}for(m(a),l=o;l<i.events.length;)i.events[l][1].end={...n},l++;e0(i.events,s+1,0,i.events.slice(o)),i.events.length=l}}function m(t){let n=l.length;for(;n-- >t;){let t=l[n];i.containerState=t[1],t[0].exit.call(i,e)}l.length=t}function g(){t.write([null]),n=void 0,t=void 0,i.containerState._closeFlow=void 0}}},td={tokenize:function(e,t,n){return to(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},tu={partial:!0,tokenize:function(e,t,n){return function(t){return tr(t)?to(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||tt(e)?t(e):n(e)}}};class th{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?1/0:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),1/0);return n&&tp(this.left,n),r.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),tp(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),tp(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let t=this.left.splice(e,1/0);tp(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);tp(this.left,t.reverse())}}}function tp(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function tf(e){let t,n,r,i,l,a,o,s={},c=-1,d=new th(e);for(;++c<d.length;){for(;c in s;)c=s[c];if(t=d.get(c),c&&"chunkFlow"===t[1].type&&"listItemPrefix"===d.get(c-1)[1].type&&((r=0)<(a=t[1]._tokenizer.events).length&&"lineEndingBlank"===a[r][1].type&&(r+=2),r<a.length&&"content"===a[r][1].type))for(;++r<a.length&&"content"!==a[r][1].type;)"chunkText"===a[r][1].type&&(a[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(s,function(e,t){let n,r,i=e.get(t)[1],l=e.get(t)[2],a=t-1,o=[],s=i._tokenizer;!s&&(s=l.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let c=s.events,d=[],u={},h=-1,p=i,f=0,x=0,m=[0];for(;p;){for(;e.get(++a)[1]!==p;);o.push(a),!p._tokenizer&&(n=l.sliceStream(p),p.next||n.push(null),r&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(n),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),r=p,p=p.next}for(p=i;++h<c.length;)"exit"===c[h][0]&&"enter"===c[h-1][0]&&c[h][1].type===c[h-1][1].type&&c[h][1].start.line!==c[h][1].end.line&&(x=h+1,m.push(x),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):m.pop(),h=m.length;h--;){let t=c.slice(m[h],m[h+1]),n=o.pop();d.push([n,n+t.length-1]),e.splice(n,2,t)}for(d.reverse(),h=-1;++h<d.length;)u[f+d[h][0]]=f+d[h][1],f+=d[h][1]-d[h][0]-1;return u}(d,c)),c=s[c],o=!0);else if(t[1]._container){for(r=c,n=void 0;r--;)if("lineEnding"===(i=d.get(r))[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(n&&(d.get(n)[1].type="lineEndingBlank"),i[1].type="lineEnding",n=r);else if("linePrefix"===i[1].type||"listItemIndent"===i[1].type);else break;n&&(t[1].end={...d.get(n)[1].start},(l=d.slice(n,c)).unshift(t),d.splice(n,c-n+1,l))}}return e0(e,0,1/0,d.slice(0)),!o}let tx={resolve:function(e){return tf(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?i(t):tt(t)?e.check(tm,l,i)(t):(e.consume(t),r)}function i(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function l(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},tm={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),to(e,i,"linePrefix")};function i(i){if(null===i||tt(i))return n(i);let l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&"linePrefix"===l[1].type&&l[2].sliceSerialize(l[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}},tg={tokenize:function(e){let t=this,n=e.attempt(tu,function(r){return null===r?void e.consume(r):(e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n)},e.attempt(this.parser.constructs.flowInitial,r,to(e,e.attempt(this.parser.constructs.flow,r,e.attempt(tx,r)),"linePrefix")));return n;function r(r){return null===r?void e.consume(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n)}}},tk={resolveAll:tw()},tb=ty("string"),tv=ty("text");function ty(e){return{resolveAll:tw("text"===e?tj:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,l,a);return l;function l(e){return s(e)?i(e):a(e)}function a(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),o)}function o(e){return s(e)?(t.exit("data"),i(e)):(t.consume(e),o)}function s(e){if(null===e)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function tw(e){return function(t,n){let r,i=-1;for(;++i<=t.length;)void 0===r?t[i]&&"data"===t[i][1].type&&(r=i,i++):t[i]&&"data"===t[i][1].type||(i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),i=r+2),r=void 0);return e?e(t,n):t}}function tj(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r,i=e[n-1][1],l=t.sliceStream(i),a=l.length,o=-1,s=0;for(;a--;){let e=l[a];if("string"==typeof e){for(o=e.length;32===e.charCodeAt(o-1);)s++,o--;if(o)break;o=-1}else if(-2===e)r=!0,s++;else if(-1===e);else{a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let l={type:n===e.length||r||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:i.start._bufferIndex+o,_index:i.start._index+a,line:i.end.line,column:i.end.column-s,offset:i.end.offset-s},end:{...i.end}};i.end={...l.start},i.start.offset===i.end.offset?Object.assign(i,l):(e.splice(n,0,["enter",l,t],["exit",l,t]),n+=2)}n++}return e}function tz(e){return null===e||tn(e)||tl(e)?1:ti(e)?2:void 0}function tN(e,t,n){let r=[],i=-1;for(;++i<e.length;){let l=e[i].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}let tC={name:"attention",resolveAll:function(e,t){let n,r,i,l,a,o,s,c,d=-1;for(;++d<e.length;)if("enter"===e[d][0]&&"attentionSequence"===e[d][1].type&&e[d][1]._close){for(n=d;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[d][1]).charCodeAt(0)){if((e[n][1]._close||e[d][1]._open)&&(e[d][1].end.offset-e[d][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[d][1].end.offset-e[d][1].start.offset)%3))continue;o=e[n][1].end.offset-e[n][1].start.offset>1&&e[d][1].end.offset-e[d][1].start.offset>1?2:1;let u={...e[n][1].end},h={...e[d][1].start};tS(u,-o),tS(h,o),l={type:o>1?"strongSequence":"emphasisSequence",start:u,end:{...e[n][1].end}},a={type:o>1?"strongSequence":"emphasisSequence",start:{...e[d][1].start},end:h},i={type:o>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[d][1].start}},r={type:o>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[n][1].end={...l.start},e[d][1].start={...a.end},s=[],e[n][1].end.offset-e[n][1].start.offset&&(s=e1(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),s=e1(s,[["enter",r,t],["enter",l,t],["exit",l,t],["enter",i,t]]),s=e1(s,tN(t.parser.constructs.insideSpan.null,e.slice(n+1,d),t)),s=e1(s,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[d][1].end.offset-e[d][1].start.offset?(c=2,s=e1(s,[["enter",e[d][1],t],["exit",e[d][1],t]])):c=0,e0(e,n-1,d-n+3,s),d=n+s.length-c-2;break}}for(d=-1;++d<e.length;)"attentionSequence"===e[d][1].type&&(e[d][1].type="data");return e},tokenize:function(e,t){let n,r=this.parser.constructs.attentionMarkers.null,i=this.previous,l=tz(i);return function(a){return n=a,e.enter("attentionSequence"),function a(o){if(o===n)return e.consume(o),a;let s=e.exit("attentionSequence"),c=tz(o),d=!c||2===c&&l||r.includes(o),u=!l||2===l&&c||r.includes(i);return s._open=!!(42===n?d:d&&(l||!u)),s._close=!!(42===n?u:u&&(c||!d)),t(o)}(a)}}};function tS(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let tM={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return tr(t)?to(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):i(t)};function i(r){return e.attempt(tM,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),i}return n(t)};function i(n){return tr(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}},tL={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return te(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},tA=document.createElement("i");function tT(e){let t="&"+e+";";tA.innerHTML=t;let n=tA.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let tE={name:"characterReference",tokenize:function(e,t,n){let r,i,l=this,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),o};function o(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),r=31,i=e3,c(t))}function s(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,i=e9,c):(e.enter("characterReferenceValue"),r=7,i=e7,c(t))}function c(o){if(59===o&&a){let r=e.exit("characterReferenceValue");return i!==e3||tT(l.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(o),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(o)}return i(o)&&a++<r?(e.consume(o),c):n(o)}}},tD={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},tI={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r,i=this,l={partial:!0,tokenize:function(e,t,n){let l=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a};function a(t){return e.enter("codeFencedFence"),tr(t)?to(e,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):s(t)}function s(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(i){return i===r?(l++,e.consume(i),t):l>=o?(e.exit("codeFencedFenceSequence"),tr(i)?to(e,c,"whitespace")(i):c(i)):n(i)}(t)):n(t)}function c(r){return null===r||tt(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},a=0,o=0;return function(t){var l;let c;return l=t,a=(c=i.events[i.events.length-1])&&"linePrefix"===c[1].type?c[2].sliceSerialize(c[1],!0).length:0,r=l,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(i){return i===r?(o++,e.consume(i),t):o<3?n(i):(e.exit("codeFencedFenceSequence"),tr(i)?to(e,s,"whitespace")(i):s(i))}(l)};function s(l){return null===l||tt(l)?(e.exit("codeFencedFence"),i.interrupt?t(l):e.check(tD,d,f)(l)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||tt(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),s(i)):tr(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),to(e,c,"whitespace")(i)):96===i&&i===r?n(i):(e.consume(i),t)}(l))}function c(t){return null===t||tt(t)?s(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||tt(i)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),s(i)):96===i&&i===r?n(i):(e.consume(i),t)}(t))}function d(t){return e.attempt(l,f,u)(t)}function u(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),h}function h(t){return a>0&&tr(t)?to(e,p,"linePrefix",a+1)(t):p(t)}function p(t){return null===t||tt(t)?e.check(tD,d,f)(t):(e.enter("codeFlowValue"),function t(n){return null===n||tt(n)?(e.exit("codeFlowValue"),p(n)):(e.consume(n),t)}(t))}function f(n){return e.exit("codeFenced"),t(n)}}},tP={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),to(e,i,"linePrefix",5)(t)};function i(t){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?function t(n){return null===n?l(n):tt(n)?e.attempt(tF,t,l)(n):(e.enter("codeFlowValue"),function n(r){return null===r||tt(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function l(n){return e.exit("codeIndented"),t(n)}}},tF={partial:!0,tokenize:function(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):tt(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):to(e,l,"linePrefix",5)(t)}function l(e){let l=r.events[r.events.length-1];return l&&"linePrefix"===l[1].type&&l[2].sliceSerialize(l[1],!0).length>=4?t(e):tt(e)?i(e):n(e)}}};function tR(e,t,n,r,i,l,a,o,s){let c=s||1/0,d=0;return function(t){return 60===t?(e.enter(r),e.enter(i),e.enter(l),e.consume(t),e.exit(l),u):null===t||32===t||41===t||e8(t)?n(t):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),f(t))};function u(n){return 62===n?(e.enter(l),e.consume(n),e.exit(l),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),h(n))}function h(t){return 62===t?(e.exit("chunkString"),e.exit(o),u(t)):null===t||60===t||tt(t)?n(t):(e.consume(t),92===t?p:h)}function p(t){return 60===t||62===t||92===t?(e.consume(t),h):h(t)}function f(i){return!d&&(null===i||41===i||tn(i))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(i)):d<c&&40===i?(e.consume(i),d++,f):41===i?(e.consume(i),d--,f):null===i||32===i||40===i||e8(i)?n(i):(e.consume(i),92===i?x:f)}function x(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function tB(e,t,n,r,i,l){let a,o=this,s=0;return function(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(l),c};function c(u){return s>999||null===u||91===u||93===u&&!a||94===u&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?n(u):93===u?(e.exit(l),e.enter(i),e.consume(u),e.exit(i),e.exit(r),t):tt(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(u))}function d(t){return null===t||91===t||93===t||tt(t)||s++>999?(e.exit("chunkString"),c(t)):(e.consume(t),a||(a=!tr(t)),92===t?u:d)}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,d):d(t)}}function tO(e,t,n,r,i,l){let a;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),a=40===t?41:t,o):n(t)};function o(n){return n===a?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(l),s(n))}function s(t){return t===a?(e.exit(l),o(a)):null===t?n(t):tt(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),to(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===a||null===t||tt(t)?(e.exit("chunkString"),s(t)):(e.consume(t),92===t?d:c)}function d(t){return t===a||92===t?(e.consume(t),c):c(t)}}function t$(e,t){let n;return function r(i){return tt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):tr(i)?to(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function t_(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let tW={partial:!0,tokenize:function(e,t,n){return function(t){return tn(t)?t$(e,r)(t):n(t)};function r(t){return tO(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return tr(t)?to(e,l,"whitespace")(t):l(t)}function l(e){return null===e||tt(e)?t(e):n(e)}}},tH=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],tU=["pre","script","style","textarea"],tV={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(tu,t,n)}}},tq={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return tt(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},tY={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&e0(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,i,l,a=e.length,o=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(i){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){o=2;break}}else"labelEnd"===n.type&&(i=a);let s={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[i][1].end}},d={type:"labelText",start:{...e[r+o+2][1].end},end:{...e[i-2][1].start}};return l=e1(l=[["enter",s,t],["enter",c,t]],e.slice(r+1,r+o+3)),l=e1(l,[["enter",d,t]]),l=e1(l,tN(t.parser.constructs.insideSpan.null,e.slice(r+o+4,i-3),t)),l=e1(l,[["exit",d,t],e[i-2],e[i-1],["exit",c,t]]),l=e1(l,e.slice(i+1)),l=e1(l,[["exit",s,t]]),e0(e,r,e.length,l),e},tokenize:function(e,t,n){let r,i,l=this,a=l.events.length;for(;a--;)if(("labelImage"===l.events[a][1].type||"labelLink"===l.events[a][1].type)&&!l.events[a][1]._balanced){r=l.events[a][1];break}return function(t){return r?r._inactive?d(t):(i=l.parser.defined.includes(t_(l.sliceSerialize({start:r.end,end:l.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),o):n(t)};function o(t){return 40===t?e.attempt(tX,c,i?c:d)(t):91===t?e.attempt(tK,c,i?s:d)(t):i?c(t):d(t)}function s(t){return e.attempt(tG,c,d)(t)}function c(e){return t(e)}function d(e){return r._balanced=!0,n(e)}}},tX={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return tn(t)?t$(e,i)(t):i(t)}function i(t){return 41===t?c(t):tR(e,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function l(t){return tn(t)?t$(e,o)(t):c(t)}function a(e){return n(e)}function o(t){return 34===t||39===t||40===t?tO(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function s(t){return tn(t)?t$(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},tK={tokenize:function(e,t,n){let r=this;return function(t){return tB.call(r,e,i,l,"reference","referenceMarker","referenceString")(t)};function i(e){return r.parser.defined.includes(t_(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function l(e){return n(e)}}},tG={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},tJ={name:"labelStartImage",resolveAll:tY.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),i};function i(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),l):n(t)}function l(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},tQ={name:"labelStartLink",resolveAll:tY.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),i};function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},tZ={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),to(e,t,"linePrefix")}}},t0={name:"thematicBreak",tokenize:function(e,t,n){let r,i=0;return function(l){var a;return e.enter("thematicBreak"),r=a=l,function l(a){return a===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),i++,t):(e.exit("thematicBreakSequence"),tr(n)?to(e,l,"whitespace")(n):l(n))}(a)):i>=3&&(null===a||tt(a))?(e.exit("thematicBreak"),t(a)):n(a)}(a)}}},t1={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(tu,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,to(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!tr(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(t2,t,i)(n))});function i(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,to(e,e.attempt(t1,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,i=r.events[r.events.length-1],l=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,a=0;return function(t){let i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:e7(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(t0,n,o)(t):o(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(i){return e7(i)&&++a<10?(e.consume(i),t):(!r.interrupt||a<2)&&(r.containerState.marker?i===r.containerState.marker:41===i||46===i)?(e.exit("listItemValue"),o(i)):n(i)}(t)}return n(t)};function o(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(tu,r.interrupt?n:s,e.attempt(t5,d,c))}function s(e){return r.containerState.initialBlankLine=!0,l++,d(e)}function c(t){return tr(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},t5={partial:!0,tokenize:function(e,t,n){let r=this;return to(e,function(e){let i=r.events[r.events.length-1];return!tr(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},t2={partial:!0,tokenize:function(e,t,n){let r=this;return to(e,function(e){let i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},t4={name:"setextUnderline",resolveTo:function(e,t){let n,r,i,l=e.length;for(;l--;)if("enter"===e[l][0]){if("content"===e[l][1].type){n=l;break}"paragraph"===e[l][1].type&&(r=l)}else"content"===e[l][1].type&&e.splice(l,1),i||"definition"!==e[l][1].type||(i=l);let a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",a,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=a,e.push(["exit",a,t]),e},tokenize:function(e,t,n){let r,i=this;return function(t){var a;let o,s=i.events.length;for(;s--;)if("lineEnding"!==i.events[s][1].type&&"linePrefix"!==i.events[s][1].type&&"content"!==i.events[s][1].type){o="paragraph"===i.events[s][1].type;break}return!i.parser.lazy[i.now().line]&&(i.interrupt||o)?(e.enter("setextHeadingLine"),r=t,a=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),tr(n)?to(e,l,"lineSuffix")(n):l(n))}(a)):n(t)};function l(r){return null===r||tt(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,t,n){let r,i=this;return function(t){var r;return e.enter("definition"),r=t,tB.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(r)};function l(t){return(r=t_(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return tn(t)?t$(e,o)(t):o(t)}function o(t){return tR(e,s,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function s(t){return e.attempt(tW,c,c)(t)}function c(t){return tr(t)?to(e,d,"whitespace")(t):d(t)}function d(l){return null===l||tt(l)?(e.exit("definition"),i.parser.defined.push(r),t(l)):n(l)}}}},"disable",0,{null:[]},"document",0,{42:t1,43:t1,45:t1,48:t1,49:t1,50:t1,51:t1,52:t1,53:t1,54:t1,55:t1,56:t1,57:t1,62:tM},"flow",0,{35:{name:"headingAtx",resolve:function(e,t){let n,r,i=e.length-2,l=3;return"whitespace"===e[3][1].type&&(l+=2),i-2>l&&"whitespace"===e[i][1].type&&(i-=2),"atxHeadingSequence"===e[i][1].type&&(l===i-1||i-4>l&&"whitespace"===e[i-2][1].type)&&(i-=l+1===i?2:4),i>l&&(n={type:"atxHeadingText",start:e[l][1].start,end:e[i][1].end},r={type:"chunkText",start:e[l][1].start,end:e[i][1].end,contentType:"text"},e0(e,l,i-l+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(i){var l;return e.enter("atxHeading"),l=i,e.enter("atxHeadingSequence"),function i(l){return 35===l&&r++<6?(e.consume(l),i):null===l||tn(l)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||tt(r)?(e.exit("atxHeading"),t(r)):tr(r)?to(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||tn(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(l)):n(l)}(l)}}},42:t0,45:[t4,t0],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){let r,i,l,a,o,s=this;return function(t){var n;return n=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),c};function c(a){return 33===a?(e.consume(a),d):47===a?(e.consume(a),i=!0,p):63===a?(e.consume(a),r=3,s.interrupt?t:E):e4(a)?(e.consume(a),l=String.fromCharCode(a),f):n(a)}function d(i){return 45===i?(e.consume(i),r=2,u):91===i?(e.consume(i),r=5,a=0,h):e4(i)?(e.consume(i),r=4,s.interrupt?t:E):n(i)}function u(r){return 45===r?(e.consume(r),s.interrupt?t:E):n(r)}function h(r){let i="CDATA[";return r===i.charCodeAt(a++)?(e.consume(r),a===i.length)?s.interrupt?t:z:h:n(r)}function p(t){return e4(t)?(e.consume(t),l=String.fromCharCode(t),f):n(t)}function f(a){if(null===a||47===a||62===a||tn(a)){let o=47===a,c=l.toLowerCase();return!o&&!i&&tU.includes(c)?(r=1,s.interrupt?t(a):z(a)):tH.includes(l.toLowerCase())?(r=6,o)?(e.consume(a),x):s.interrupt?t(a):z(a):(r=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(a):i?function t(n){return tr(n)?(e.consume(n),t):w(n)}(a):m(a))}return 45===a||e3(a)?(e.consume(a),l+=String.fromCharCode(a),f):n(a)}function x(r){return 62===r?(e.consume(r),s.interrupt?t:z):n(r)}function m(t){return 47===t?(e.consume(t),w):58===t||95===t||e4(t)?(e.consume(t),g):tr(t)?(e.consume(t),m):w(t)}function g(t){return 45===t||46===t||58===t||95===t||e3(t)?(e.consume(t),g):k(t)}function k(t){return 61===t?(e.consume(t),b):tr(t)?(e.consume(t),k):m(t)}function b(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,v):tr(t)?(e.consume(t),b):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||tn(n)?k(n):(e.consume(n),t)}(t)}function v(t){return t===o?(e.consume(t),o=null,y):null===t||tt(t)?n(t):(e.consume(t),v)}function y(e){return 47===e||62===e||tr(e)?m(e):n(e)}function w(t){return 62===t?(e.consume(t),j):n(t)}function j(t){return null===t||tt(t)?z(t):tr(t)?(e.consume(t),j):n(t)}function z(t){return 45===t&&2===r?(e.consume(t),M):60===t&&1===r?(e.consume(t),L):62===t&&4===r?(e.consume(t),D):63===t&&3===r?(e.consume(t),E):93===t&&5===r?(e.consume(t),T):tt(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(tV,I,N)(t)):null===t||tt(t)?(e.exit("htmlFlowData"),N(t)):(e.consume(t),z)}function N(t){return e.check(tq,C,I)(t)}function C(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),S}function S(t){return null===t||tt(t)?N(t):(e.enter("htmlFlowData"),z(t))}function M(t){return 45===t?(e.consume(t),E):z(t)}function L(t){return 47===t?(e.consume(t),l="",A):z(t)}function A(t){if(62===t){let n=l.toLowerCase();return tU.includes(n)?(e.consume(t),D):z(t)}return e4(t)&&l.length<8?(e.consume(t),l+=String.fromCharCode(t),A):z(t)}function T(t){return 93===t?(e.consume(t),E):z(t)}function E(t){return 62===t?(e.consume(t),D):45===t&&2===r?(e.consume(t),E):z(t)}function D(t){return null===t||tt(t)?(e.exit("htmlFlowData"),I(t)):(e.consume(t),D)}function I(n){return e.exit("htmlFlow"),t(n)}}},61:t4,95:t0,96:tI,126:tI},"flowInitial",0,{[-2]:tP,[-1]:tP,32:tP},"insideSpan",0,{null:[tC,tk]},"string",0,{38:tE,92:tL},"text",0,{[-5]:tZ,[-4]:tZ,[-3]:tZ,33:tJ,38:tE,42:tC,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i};function i(t){return e4(t)?(e.consume(t),l):64===t?n(t):o(t)}function l(t){return 43===t||45===t||46===t||e3(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,a):(43===n||45===n||46===n||e3(n))&&r++<32?(e.consume(n),t):(r=0,o(n))}(t)):o(t)}function a(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||e8(r)?n(r):(e.consume(r),a)}function o(t){return 64===t?(e.consume(t),s):e6(t)?(e.consume(t),o):n(t)}function s(i){return e3(i)?function i(l){return 46===l?(e.consume(l),r=0,s):62===l?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(l),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(l){if((45===l||e3(l))&&r++<63){let n=45===l?t:i;return e.consume(l),n}return n(l)}(l)}(i):n(i)}}},{name:"htmlText",tokenize:function(e,t,n){let r,i,l,a=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),o};function o(t){return 33===t?(e.consume(t),s):47===t?(e.consume(t),v):63===t?(e.consume(t),k):e4(t)?(e.consume(t),w):n(t)}function s(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),i=0,p):e4(t)?(e.consume(t),g):n(t)}function c(t){return 45===t?(e.consume(t),h):n(t)}function d(t){return null===t?n(t):45===t?(e.consume(t),u):tt(t)?(l=d,A(t)):(e.consume(t),d)}function u(t){return 45===t?(e.consume(t),h):d(t)}function h(e){return 62===e?L(e):45===e?u(e):d(e)}function p(t){let r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),i===r.length?f:p):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),x):tt(t)?(l=f,A(t)):(e.consume(t),f)}function x(t){return 93===t?(e.consume(t),m):f(t)}function m(t){return 62===t?L(t):93===t?(e.consume(t),m):f(t)}function g(t){return null===t||62===t?L(t):tt(t)?(l=g,A(t)):(e.consume(t),g)}function k(t){return null===t?n(t):63===t?(e.consume(t),b):tt(t)?(l=k,A(t)):(e.consume(t),k)}function b(e){return 62===e?L(e):k(e)}function v(t){return e4(t)?(e.consume(t),y):n(t)}function y(t){return 45===t||e3(t)?(e.consume(t),y):function t(n){return tt(n)?(l=t,A(n)):tr(n)?(e.consume(n),t):L(n)}(t)}function w(t){return 45===t||e3(t)?(e.consume(t),w):47===t||62===t||tn(t)?j(t):n(t)}function j(t){return 47===t?(e.consume(t),L):58===t||95===t||e4(t)?(e.consume(t),z):tt(t)?(l=j,A(t)):tr(t)?(e.consume(t),j):L(t)}function z(t){return 45===t||46===t||58===t||95===t||e3(t)?(e.consume(t),z):function t(n){return 61===n?(e.consume(n),N):tt(n)?(l=t,A(n)):tr(n)?(e.consume(n),t):j(n)}(t)}function N(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,C):tt(t)?(l=N,A(t)):tr(t)?(e.consume(t),N):(e.consume(t),S)}function C(t){return t===r?(e.consume(t),r=void 0,M):null===t?n(t):tt(t)?(l=C,A(t)):(e.consume(t),C)}function S(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||tn(t)?j(t):(e.consume(t),S)}function M(e){return 47===e||62===e||tn(e)?j(e):n(e)}function L(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function A(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),T}function T(t){return tr(t)?to(e,E,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):E(t)}function E(t){return e.enter("htmlTextData"),l(t)}}}],91:tQ,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return tt(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},tL],93:tY,95:tC,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,i=3;if(("lineEnding"===e[3][1].type||"space"===e[i][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=i;++t<r;)if("codeTextData"===e[t][1].type){e[i][1].type="codeTextPadding",e[r][1].type="codeTextPadding",i+=2,r-=2;break}}for(t=i-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,i,l=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),l++,t):(e.exit("codeTextSequence"),a(n))}(t)};function a(s){return null===s?n(s):32===s?(e.enter("space"),e.consume(s),e.exit("space"),a):96===s?(i=e.enter("codeTextSequence"),r=0,function n(a){return 96===a?(e.consume(a),r++,n):r===l?(e.exit("codeTextSequence"),e.exit("codeText"),t(a)):(i.type="codeTextData",o(a))}(s)):tt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):(e.enter("codeTextData"),o(s))}function o(t){return null===t||32===t||96===t||tt(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),o)}}}}],19210);var t3=e.i(19210);let t6=/[\0\t\n\r]/g;function t8(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let t7=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function t9(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return t8(n.slice(t?2:1),t?16:10)}return tT(n)||e}let ne={}.hasOwnProperty;function nt(e){return{line:e.line,column:e.column,offset:e.offset}}function nn(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+eT({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+eT({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+eT({start:t.start,end:t.end})+") is still open")}function nr(e){let t=this;t.parser=function(n){var r,i;let l,a,o,s;return"string"!=typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(i=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(g),autolinkProtocol:c,autolinkEmail:c,atxHeading:r(f),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:c,characterReference:c,codeFenced:r(p),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:r(p,i),codeText:r(function(){return{type:"inlineCode",value:""}},i),codeTextData:c,data:c,codeFlowValue:c,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(x),hardBreakTrailing:r(x),htmlFlow:r(m,i),htmlFlowData:c,htmlText:r(m,i),htmlTextData:c,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:i,link:r(g),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(k,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(k),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:r(f),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:a(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:a(),autolinkEmail:function(e){d.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){d.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:a(),characterEscapeValue:d,characterReferenceMarkerHexadecimal:h,characterReferenceMarkerNumeric:h,characterReferenceValue:function(e){let t,n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=t8(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=tT(n);let i=this.stack[this.stack.length-1];i.value+=t},characterReference:function(e){this.stack.pop().position.end=nt(e.end)},codeFenced:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:d,codeIndented:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:d,data:d,definition:a(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=t_(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:a(),hardBreakEscape:a(u),hardBreakTrailing:a(u),htmlFlow:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:d,htmlText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:d,image:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===n.type?n.children=e.children:n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=t.replace(t7,t9),n.identifier=t_(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=nt(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(c.call(this,e),d.call(this,e))},link:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=t_(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:a(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:a(),thematicBreak:a()}};!function e(t,n){let r=-1;for(;++r<n.length;){let i=n[r];Array.isArray(i)?e(t,i):function(e,t){let n;for(n in t)if(ne.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,i)}}(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},a={stack:[r],tokenStack:[],config:t,enter:l,exit:o,buffer:i,resume:s,data:n},c=[],d=-1;for(;++d<e.length;)("listOrdered"===e[d][1].type||"listUnordered"===e[d][1].type)&&("enter"===e[d][0]?c.push(d):d=function(e,t,n){let r,i,l,a,o=t-1,s=-1,c=!1;for(;++o<=n;){let t=e[o];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?s++:s--,a=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||a||s||l||(l=o),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!s&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===s&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let a=o;for(i=void 0;a--;){let t=e[a];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;i&&(e[i][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",i=a}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}l&&(!i||l<i)&&(r._spread=!0),r.end=Object.assign({},i?e[i][1].start:t[1].end),e.splice(i||o,0,["exit",r,t[2]]),o++,n++}if("listItemPrefix"===t[1].type){let i={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=i,e.splice(o,0,["enter",i,t[2]]),o++,n++,l=void 0,a=!0}}}return e[t][1]._spread=c,n}(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];ne.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||nn).call(a,void 0,e[0])}for(r.position={start:nt(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:nt(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r};function r(e,t){return function(n){l.call(this,e(n),n),t&&t.call(this,n)}}function i(){this.stack.push({type:"fragment",children:[]})}function l(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:nt(t.start),end:void 0}}function a(e){return function(t){e&&e.call(this,t),o.call(this,t)}}function o(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||nn).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+eT({start:e.start,end:e.end})+"): it’s not open");n.position.end=nt(e.end)}function s(){return eJ(this.stack.pop())}function c(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:nt(e.start),end:void 0},t.push(n)),this.stack.push(n)}function d(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=nt(e.end)}function u(){this.data.atHardBreak=!0}function h(e){this.data.characterReferenceType=e.type}function p(){return{type:"code",lang:null,meta:null,value:""}}function f(){return{type:"heading",depth:0,children:[]}}function x(){return{type:"break"}}function m(){return{type:"html",value:""}}function g(){return{type:"link",title:null,url:"",children:[]}}function k(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(i)(function(e){for(;!tf(e););return e}((function(e){let t={constructs:e2([t3,...(e||{}).extensions||[]]),content:n(ts),defined:[],document:n(tc),flow:n(tg),lazy:{},string:n(tb),text:n(tv)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},l=[],a=[],o=[],s={attempt:f(function(e,t){x(e,t.from)}),check:f(p),consume:function(e){tt(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,m()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=h(),c.events.push(["enter",n,c]),o.push(n),n},exit:function(e){let t=o.pop();return t.end=h(),c.events.push(["exit",t,c]),t},interrupt:f(p,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){i[e.line]=e.column,m()},events:[],now:h,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,i=[];for(;++r<e.length;){let l,a=e[r];if("string"==typeof a)l=a;else switch(a){case -5:l="\r";break;case -4:l="\n";break;case -3:l="\r\n";break;case -2:l=t?" ":" ";break;case -1:if(!t&&n)continue;l=" ";break;default:l=String.fromCharCode(a)}n=-2===a,i.push(l)}return i.join("")}(u(e),t)},sliceStream:u,write:function(e){return(a=e1(a,e),function(){let e;for(;r._index<a.length;){let n=a[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),d=d(t)}else d=d(n)}}(),null!==a[a.length-1])?[]:(x(t,0),c.events=tN(l,c.events,c),c.events)}},d=t.tokenize.call(c,s);return t.resolveAll&&l.push(t),c;function u(e){return function(e,t){let n,r=t.start._index,i=t.start._bufferIndex,l=t.end._index,a=t.end._bufferIndex;if(r===l)n=[e[r].slice(i,a)];else{if(n=e.slice(r,l),i>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(i):n.shift()}a>0&&n.push(e[l].slice(0,a))}return n}(a,e)}function h(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:l}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:l}}function p(e,t){t.restore()}function f(e,t){return function(n,i,l){var a;let d,u,p,f;return Array.isArray(n)?x(n):"tokenize"in n?x([n]):(a=n,function(e){let t=null!==e&&a[e],n=null!==e&&a.null;return x([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});function x(e){return(d=e,u=0,0===e.length)?l:g(e[u])}function g(e){return function(n){let i,l,a,d,u;return(i=h(),l=c.previous,a=c.currentConstruct,d=c.events.length,u=Array.from(o),f={from:d,restore:function(){r=i,c.previous=l,c.currentConstruct=a,c.events.length=d,o=u,m()}},p=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name))?b(n):e.tokenize.call(t?Object.assign(Object.create(c),t):c,s,k,b)(n)}}function k(t){return e(p,f),i}function b(e){return(f.restore(),++u<d.length)?g(d[u]):l}}}function x(e,t){e.resolveAll&&!l.includes(e)&&l.push(e),e.resolve&&e0(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function m(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}(t,e,n)}}})(i).document().write((a=1,o="",s=!0,function(e,t,n){let r,i,c,d,u,h=[];for(e=o+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),c=0,o="",s&&(65279===e.charCodeAt(0)&&c++,s=void 0);c<e.length;){if(t6.lastIndex=c,d=(r=t6.exec(e))&&void 0!==r.index?r.index:e.length,u=e.charCodeAt(d),!r){o=e.slice(c);break}if(10===u&&c===d&&l)h.push(-3),l=void 0;else switch(l&&(h.push(-5),l=void 0),c<d&&(h.push(e.slice(c,d)),a+=d-c),u){case 0:h.push(65533),a++;break;case 9:for(i=4*Math.ceil(a/4),h.push(-2);a++<i;)h.push(-1);break;case 10:h.push(-4),a=1;break;default:l=!0,a=1}c=d+1}return n&&(l&&h.push(-5),o&&h.push(o),h.push(null)),h})(n,r,!0))))}}let ni="object"==typeof self?self:globalThis,nl=e=>{var t;let n,r;return(t=new Map,n=(e,n)=>(t.set(n,e),e),r=i=>{if(t.has(i))return t.get(i);let[l,a]=e[i];switch(l){case 0:case -1:return n(a,i);case 1:{let e=n([],i);for(let t of a)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),i);case 4:{let{source:e,flags:t}=a;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of a)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of a)e.add(r(t));return e}case 7:{let{name:e,message:t}=a;return n(new ni[e](t),i)}case 8:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{let{buffer:e}=new Uint8Array(a);return n(new DataView(e),a)}}return n(new ni[l](a),i)})(0)},{toString:na}={},{keys:no}=Object,ns=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=na.call(e).slice(8,-1);switch(n){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},nc=([e,t])=>0===e&&("function"===t||"symbol"===t),nd=(e,{json:t,lossy:n}={})=>{var r,i,l;let a,o,s=[];return(r=!(t||n),i=!!t,l=new Map,a=(e,t)=>{let n=s.push(e)-1;return l.set(t,n),n},o=e=>{if(l.has(e))return l.get(e);let[t,n]=ns(e);switch(t){case 0:{let i=e;switch(n){case"bigint":t=8,i=e.toString();break;case"function":case"symbol":if(r)throw TypeError("unable to serialize "+n);i=null;break;case"undefined":return a([-1],e)}return a([t,i],e)}case 1:{if(n){let t=e;return"DataView"===n?t=new Uint8Array(e.buffer):"ArrayBuffer"===n&&(t=new Uint8Array(e)),a([n,[...t]],e)}let r=[],i=a([t,r],e);for(let t of e)r.push(o(t));return i}case 2:{if(n)switch(n){case"BigInt":return a([n,e.toString()],e);case"Boolean":case"Number":case"String":return a([n,e.valueOf()],e)}if(i&&"toJSON"in e)return o(e.toJSON());let l=[],s=a([t,l],e);for(let t of no(e))(r||!nc(ns(e[t])))&&l.push([o(t),o(e[t])]);return s}case 3:return a([t,e.toISOString()],e);case 4:{let{source:n,flags:r}=e;return a([t,{source:n,flags:r}],e)}case 5:{let n=[],i=a([t,n],e);for(let[t,i]of e)(r||!(nc(ns(t))||nc(ns(i))))&&n.push([o(t),o(i)]);return i}case 6:{let n=[],i=a([t,n],e);for(let t of e)(r||!nc(ns(t)))&&n.push(o(t));return i}}let{message:s}=e;return a([t,{name:n,message:s}],e)})(e),s},nu="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?nl(nd(e,t)):structuredClone(e):(e,t)=>nl(nd(e,t));function nh(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let l=e.charCodeAt(n),a="";if(37===l&&e3(e.charCodeAt(n+1))&&e3(e.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(a=String.fromCharCode(l));else if(l>55295&&l<57344){let t=e.charCodeAt(n+1);l<56320&&t>56319&&t<57344?(a=String.fromCharCode(l,t),i=1):a="�"}else a=String.fromCharCode(l);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function np(e,t){let n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function nf(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let nx=function(e){var t,n;if(null==e)return ng;if("function"==typeof e)return nm(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=nx(e[n]);return nm(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):(t=e,nm(function(e){let n;for(n in t)if(e[n]!==t[n])return!1;return!0}))}if("string"==typeof e){return n=e,nm(function(e){return e&&e.type===n})}throw Error("Expected function, string, or object as test")};function nm(e){return function(t,n,r){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function ng(){return!0}let nk=[];function nb(e,t,n,r){let i;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):i=t;let l=nx(i),a=r?-1:1;(function e(i,o,s){let c=i&&"object"==typeof i?i:{};if("string"==typeof c.type){let e="string"==typeof c.tagName?c.tagName:"string"==typeof c.name?c.name:void 0;Object.defineProperty(d,"name",{value:"node ("+i.type+(e?"<"+e+">":"")+")"})}return d;function d(){var c;let d,u,h,p=nk;if((!t||l(i,o,s[s.length-1]||void 0))&&!1===(p=Array.isArray(c=n(i,s))?c:"number"==typeof c?[!0,c]:null==c?nk:[c])[0])return p;if("children"in i&&i.children&&i.children&&"skip"!==p[0])for(u=(r?i.children.length:-1)+a,h=s.concat(i);u>-1&&u<i.children.length;){if(!1===(d=e(i.children[u],u,h)())[0])return d;u="number"==typeof d[1]?d[1]:u+a}return p}})(e,void 0,[])()}function nv(e,t,n,r){let i,l,a;"function"==typeof t&&"function"!=typeof n?(l=void 0,a=t,i=n):(l=t,a=n,i=r),nb(e,l,function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return a(e,r,n)},i)}function ny(e,t){let n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];let i=e.all(t),l=i[0];l&&"text"===l.type?l.value="["+l.value:i.unshift({type:"text",value:"["});let a=i[i.length-1];return a&&"text"===a.type?a.value+=r:i.push({type:"text",value:r}),i}function nw(e){let t=e.spread;return null==t?e.children.length>1:t}function nj(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;9===t||32===t;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}let nz={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l={type:"element",tagName:"pre",properties:{},children:[l=e.applyData(t,l)]},e.patch(t,l),l},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){let n,r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),l=nh(i.toLowerCase()),a=e.footnoteOrder.indexOf(i),o=e.footnoteCounts.get(i);void 0===o?(o=0,e.footnoteOrder.push(i),n=e.footnoteOrder.length):n=a+1,o+=1,e.footnoteCounts.set(i,o);let s={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+l,id:r+"fnref-"+l+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,s);let c={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ny(e,t);let i={src:nh(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(i.title=r.title);let l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,l),e.applyData(t,l)},image:function(e,t){let n={src:nh(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ny(e,t);let i={href:nh(r.url||"")};null!==r.title&&void 0!==r.title&&(i.title=r.title);let l={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)},link:function(e,t){let n={href:nh(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),i=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=nw(n[r])}return t}(n):nw(t),l={},a=[];if("boolean"==typeof t.checked){let e,n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let o=-1;for(;++o<r.length;){let e=r[o];(i||0!==o||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||i?a.push(e):a.push(...e.children)}let s=r[r.length-1];s&&(i||"element"!==s.type||"p"!==s.tagName)&&a.push({type:"text",value:"\n"});let c={type:"element",tagName:"li",properties:l,children:a};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){let n={},r=e.all(t),i=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++i<r.length;){let e=r[i];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=eL(t.children[1]),a=eM(t.children[t.children.length-1]);l&&a&&(r.position={start:l,end:a}),i.push(r)}let l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,i=0===(r?r.indexOf(t):1)?"th":"td",l=n&&"table"===n.type?n.align:void 0,a=l?l.length:t.children.length,o=-1,s=[];for(;++o<a;){let n=t.children[o],r={},a=l?l[o]:void 0;a&&(r.align=a);let c={type:"element",tagName:i,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),s.push(c)}let c={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,l=[];for(;r;)l.push(nj(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return l.push(nj(t.slice(i),i>0,!1)),l.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:nN,yaml:nN,definition:nN,footnoteDefinition:nN};function nN(){}let nC={}.hasOwnProperty,nS={};function nM(e,t){e.position&&(t.position=function(e){let t=eL(e),n=eM(e);if(t&&n)return{start:t,end:n}}(e))}function nL(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&i&&Object.assign(n.properties,nu(i)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function nA(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function nT(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function nE(e,t){let n,r,i,l,a=(n=t||nS,r=new Map,i=new Map,l={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r<n.length;){let i=l.one(n[r],e);if(i){if(r&&"break"===n[r-1].type&&(Array.isArray(i)||"text"!==i.type||(i.value=nT(i.value)),!Array.isArray(i)&&"element"===i.type)){let e=i.children[0];e&&"text"===e.type&&(e.value=nT(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t},applyData:nL,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...nz,...n.handlers},one:function(e,t){let n=e.type,r=l.handlers[n];if(nC.call(l.handlers,n)&&r)return r(l,e,t);if(l.options.passThrough&&l.options.passThrough.includes(n)){if("children"in e){let{children:t,...n}=e,r=nu(n);return r.children=l.all(e),r}return nu(e)}return(l.options.unknownHandler||function(e,t){let n=t.data||{},r="value"in t&&!(nC.call(n,"hProperties")||nC.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)})(l,e,t)},options:n,patch:nM,wrap:nA},nv(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),l),o=a.one(e,void 0),s=function(e){let t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||np,r=e.options.footnoteBackLabel||nf,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[],s=-1;for(;++s<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[s]);if(!i)continue;let l=e.all(i),a=String(i.identifier).toUpperCase(),c=nh(a.toLowerCase()),d=0,u=[],h=e.footnoteCounts.get(a);for(;void 0!==h&&++d<=h;){u.length>0&&u.push({type:"text",value:" "});let e="string"==typeof n?n:n(s,d);"string"==typeof e&&(e={type:"text",value:e}),u.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(s,d),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let p=l[l.length-1];if(p&&"element"===p.type&&"p"===p.tagName){let e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...u)}else l.push(...u);let f={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(l,!0)};e.patch(i,f),o.push(f)}if(0!==o.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...nu(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:"\n"}]}}(a),c=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return s&&($("children"in c),c.children.push({type:"text",value:"\n"},s)),c}function nD(e,t){return e&&"run"in e?async function(n,r){let i=nE(n,{file:r,...t});await e.run(i,r)}:function(n,r){return nE(n,{file:r,...e||t})}}function nI(e){if(e)throw e}var nP=e.i(75609);function nF(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let nR=function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');n_(e);let r=0,i=-1,l=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;l--;)if(47===e.codePointAt(l)){if(n){r=l+1;break}}else i<0&&(n=!0,i=l+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let a=-1,o=t.length-1;for(;l--;)if(47===e.codePointAt(l)){if(n){r=l+1;break}}else a<0&&(n=!0,a=l+1),o>-1&&(e.codePointAt(l)===t.codePointAt(o--)?o<0&&(i=l):(o=-1,i=a));return r===i?i=a:i<0&&(i=e.length),e.slice(r,i)},nB=function(e){let t;if(n_(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},nO=function(e){let t;n_(e);let n=e.length,r=-1,i=0,l=-1,a=0;for(;n--;){let o=e.codePointAt(n);if(47===o){if(t){i=n+1;break}continue}r<0&&(t=!0,r=n+1),46===o?l<0?l=n:1!==a&&(a=1):l>-1&&(a=-1)}return l<0||r<0||0===a||1===a&&l===r-1&&l===i+1?"":e.slice(l,r)},n$=function(...e){var t;let n,r,i,l=-1;for(;++l<e.length;)n_(e[l]),e[l]&&(i=void 0===i?e[l]:i+"/"+e[l]);return void 0===i?".":(n_(t=i),n=47===t.codePointAt(0),0!==(r=function(e,t){let n,r,i="",l=0,a=-1,o=0,s=-1;for(;++s<=e.length;){if(s<e.length)n=e.codePointAt(s);else if(47===n)break;else n=47;if(47===n){if(a===s-1||1===o);else if(a!==s-1&&2===o){if(i.length<2||2!==l||46!==i.codePointAt(i.length-1)||46!==i.codePointAt(i.length-2)){if(i.length>2){if((r=i.lastIndexOf("/"))!==i.length-1){r<0?(i="",l=0):l=(i=i.slice(0,r)).length-1-i.lastIndexOf("/"),a=s,o=0;continue}}else if(i.length>0){i="",l=0,a=s,o=0;continue}}t&&(i=i.length>0?i+"/..":"..",l=2)}else i.length>0?i+="/"+e.slice(a+1,s):i=e.slice(a+1,s),l=s-a-1;a=s,o=0}else 46===n&&o>-1?o++:o=-1}return i}(t,!n)).length||n||(r="."),r.length>0&&47===t.codePointAt(t.length-1)&&(r+="/"),n?"/"+r:r)};function n_(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function nW(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let nH=["history","path","basename","stem","extname","dirname"];class nU{constructor(e){let t,n;t=e?nW(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<nH.length;){const e=nH[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)nH.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?nR(this.path):void 0}set basename(e){nq(e,"basename"),nV(e,"basename"),this.path=n$(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?nB(this.path):void 0}set dirname(e){nY(this.basename,"dirname"),this.path=n$(e||"",this.basename)}get extname(){return"string"==typeof this.path?nO(this.path):void 0}set extname(e){if(nV(e,"extname"),nY(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=n$(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){nW(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!nW(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let t=e.pathname,n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){let e=t.codePointAt(n+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),nq(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?nR(this.path,this.extname):void 0}set stem(e){nq(e,"stem"),nV(e,"stem"),this.path=n$(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new eP(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function nV(e,t){if(e&&e.includes("/"))throw Error("`"+t+"` cannot be a path: did not expect `/`")}function nq(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function nY(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let nX=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},nK={}.hasOwnProperty;class nG extends nX{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);!function i(l,...a){let o=e[++n],s=-1;if(l)return void r(l);for(;++s<t.length;)(null===a[s]||void 0===a[s])&&(a[s]=t[s]);t=a,o?(function(e,t){let n;return function(...t){let l,a=e.length>t.length;a&&t.push(r);try{l=e.apply(this,t)}catch(e){if(a&&n)throw e;return r(e)}a||(l&&l.then&&"function"==typeof l.then?l.then(i,r):l instanceof Error?r(l):i(l))};function r(e,...i){n||(n=!0,t(e,...i))}function i(e){r(null,e)}})(o,i)(...a):r(null,...a)}(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){let e=new nG,t=-1;for(;++t<this.attachers.length;){let n=this.attachers[t];e.use(...n)}return e.data((0,nP.default)(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(n0("data",this.frozen),this.namespace[e]=t,this):nK.call(this.namespace,e)&&this.namespace[e]||void 0:e?(n0("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=n2(e),n=this.parser||this.Parser;return nQ("parse",n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),nQ("process",this.parser||this.Parser),nZ("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let l=n2(e),a=n.parse(l);function o(e,n){e||!n?i(e):r?r(n):($(t,"`done` is defined if `resolve` is not"),t(void 0,n))}n.run(a,l,function(e,t,r){var i,l;if(e||!t||!r)return o(e);let a=n.stringify(t,r);"string"==typeof(i=a)||(l=i)&&"object"==typeof l&&"byteLength"in l&&"byteOffset"in l?r.value=a:r.result=a,o(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),nQ("processSync",this.parser||this.Parser),nZ("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,nI(e),t=r}),n5("processSync","process",n),$(t,"we either bailed on an error or have a tree"),t}run(e,t,n){n1(e),this.freeze();let r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,l){$("function"!=typeof t,"`file` can’t be a `done` anymore, we checked");let a=n2(t);r.run(e,a,function(t,r,a){let o=r||e;t?l(t):i?i(o):($(n,"`done` is defined if `resolve` is not"),n(void 0,o,a))})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){nI(e),n=t,r=!0}),n5("runSync","run",r),$(n,"we either bailed on an error or have a tree"),n}stringify(e,t){this.freeze();let n=n2(t),r=this.compiler||this.Compiler;return nZ("stringify",r),n1(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(n0("use",this.frozen),null==e);else if("function"==typeof e)a(e,t);else if("object"==typeof e)Array.isArray(e)?l(e):i(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(e.plugins),e.settings&&(r.settings=(0,nP.default)(!0,r.settings,e.settings))}function l(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)a(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[t,...n]=e;a(t,n)}else i(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function a(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(-1===i)n.push([e,...t]);else if(t.length>0){let[r,...l]=t,a=n[i][1];nF(a)&&nF(r)&&(r=(0,nP.default)(!0,a,r)),n[i]=[e,r,...l]}}}}let nJ=new nG().freeze();function nQ(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function nZ(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function n0(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function n1(e){if(!nF(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function n5(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function n2(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new nU(e)}let n4=[],n3={allowDangerousHtml:!0},n6=/^(https?|ircs?|mailto|xmpp)$/i,n8=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function n7(e){var t;let r,i,l,a,o,s=(r=(t=e).rehypePlugins||n4,i=t.remarkPlugins||n4,l=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...n3}:n3,nJ().use(nr).use(i).use(nD,l).use(r)),c=(a=e.children||"",o=new nU,"string"==typeof a?o.value=a:_("Unexpected value `"+a+"` for `children` prop, expected `string`"),o);return function(e,t){let r=t.allowedElements,i=t.allowElement,l=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||n9;for(let e of n8)Object.hasOwn(t,e.from)&&_("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return r&&a&&_("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),nv(e,function(e,t,n){if("raw"===e.type&&n&&"number"==typeof t)return o?n.children.splice(t,1):n.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in eK)if(Object.hasOwn(eK,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=eK[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=c(String(n||""),t,e))}}if("element"===e.type){let l=r?!r.includes(e.tagName):!!a&&a.includes(e.tagName);if(!l&&i&&"number"==typeof t&&(l=!i(e,t,n)),l&&n&&"number"==typeof t)return s&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}),function(e,t){var n,r,i,l;let a;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let o=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=o,r=t.jsxDEV,a=function(e,t,i,l){let a=Array.isArray(i.children),o=eL(e);return r(t,i,l,a,{columnNumber:o?o.column-1:void 0,fileName:n,lineNumber:o?o.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");i=t.jsx,l=t.jsxs,a=function(e,t,n,r){let a=Array.isArray(n.children)?l:i;return r?a(t,n,r):a(t,n)}}let s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:o,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?eC:eN,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},c=eW(s,e,void 0);return c&&"string"!=typeof c?c:s.create(e,s.Fragment,{children:c||void 0},void 0)}(e,{Fragment:n.Fragment,components:l,ignoreInvalidStyle:!0,jsx:n.jsx,jsxs:n.jsxs,passKeys:!0,passNode:!0})}(s.runSync(s.parse(c),c),e)}function n9(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return -1===t||-1!==i&&t>i||-1!==n&&t>n||-1!==r&&t>r||n6.test(e.slice(0,t))?e:""}function re(e,t){let n=String(e);if("string"!=typeof t)throw TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}let rt="phrasing",rn=["autolink","link","image","label"];function rr(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ri(e){this.config.enter.autolinkProtocol.call(this,e)}function rl(e){this.config.exit.autolinkProtocol.call(this,e)}function ra(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];$("link"===t.type),t.url="http://"+this.sliceSerialize(e)}function ro(e){this.config.exit.autolinkEmail.call(this,e)}function rs(e){this.exit(e)}function rc(e){!function(e,t,n){let r=nx((n||{}).ignore||[]),i=function(e){let t=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){var i;let e=n[r];t.push(["string"==typeof(i=e[0])?RegExp(function(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(i),"g"):i,function(e){return"function"==typeof e?e:function(){return e}}(e[1])])}return t}(t),l=-1;for(;++l<i.length;)nb(e,"text",a);function a(e,t){let n,a=-1;for(;++a<t.length;){let e=t[a],i=n?n.children:void 0;if(r(e,i?i.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){let n=t[t.length-1],r=i[l][0],a=i[l][1],o=0,s=n.children.indexOf(e),c=!1,d=[];r.lastIndex=0;let u=r.exec(e.value);for(;u;){let n=u.index,i={index:u.index,input:u.input,stack:[...t,e]},l=a(...u,i);if("string"==typeof l&&(l=l.length>0?{type:"text",value:l}:void 0),!1===l?r.lastIndex=n+1:(o!==n&&d.push({type:"text",value:e.value.slice(o,n)}),Array.isArray(l)?d.push(...l):l&&d.push(l),o=n+u[0].length,c=!0),!r.global)break;u=r.exec(e.value)}return c?(o<e.value.length&&d.push({type:"text",value:e.value.slice(o)}),n.children.splice(s,1,...d)):d=[e],s+d.length}(e,t)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,rd],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,ru]],{ignore:["link","linkReference"]})}function rd(e,t,n,r,i){let l,a="";if(!rh(i))return!1;if(/^w/i.test(t)&&(n=t+n,t="",a="http://"),(l=n.split(".")).length<2||l[l.length-1]&&(/_/.test(l[l.length-1])||!/[a-zA-Z\d]/.test(l[l.length-1]))||l[l.length-2]&&(/_/.test(l[l.length-2])||!/[a-zA-Z\d]/.test(l[l.length-2])))return!1;let o=function(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),i=re(e,"("),l=re(e,")");for(;-1!==r&&i>l;)e+=n.slice(0,r+1),r=(n=n.slice(r+1)).indexOf(")"),l++;return[e,n]}(n+r);if(!o[0])return!1;let s={type:"link",title:null,url:a+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[s,{type:"text",value:o[1]}]:s}function ru(e,t,n,r){return!(!rh(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function rh(e,t){let n=e.input.charCodeAt(e.index-1);return(0===e.index||tl(n)||ti(n))&&(!t||47!==n)}function rp(){this.buffer()}function rf(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function rx(){this.buffer()}function rm(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function rg(e){let t=this.resume(),n=this.stack[this.stack.length-1];$("footnoteReference"===n.type),n.identifier=t_(this.sliceSerialize(e)).toLowerCase(),n.label=t}function rk(e){this.exit(e)}function rb(e){let t=this.resume(),n=this.stack[this.stack.length-1];$("footnoteDefinition"===n.type),n.identifier=t_(this.sliceSerialize(e)).toLowerCase(),n.label=t}function rv(e){this.exit(e)}function ry(e,t,n,r){let i=n.createTracker(r),l=i.move("[^"),a=n.enter("footnoteReference"),o=n.enter("reference");return l+=i.move(n.safe(n.associationId(e),{after:"]",before:l})),o(),a(),l+=i.move("]")}function rw(e,t,n){return 0===t?e:rj(e,t,n)}function rj(e,t,n){return(n?"":" ")+e}ry.peek=function(){return"["};let rz=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function rN(e){this.enter({type:"delete",children:[]},e)}function rC(e){this.exit(e)}function rS(e,t,n,r){let i=n.createTracker(r),l=n.enter("strikethrough"),a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),l(),a}function rM(e){return e.length}function rL(e){let t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:114*(82===t||114===t)}rS.peek=function(){return"~"};function rA(e,t,n){let r=e.value||"",i="`",l=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){let e,t=n.unsafe[l],i=n.compilePattern(t);if(t.atBreak)for(;e=i.exec(r);){let t=e.index;10===r.charCodeAt(t)&&13===r.charCodeAt(t-1)&&t--,r=r.slice(0,t)+" "+r.slice(e.index+1)}}return i+r+i}rA.peek=function(){return"`"};nx(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let rT=function(e,t,n,r){let i=function(e){let t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n),l=n.bulletCurrent||function(e){let t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}(n);t&&"list"===t.type&&t.ordered&&(l=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+l);let a=l.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(a=4*Math.ceil(a/4));let o=n.createTracker(r);o.move(l+" ".repeat(a-l.length)),o.shift(a);let s=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),function(e,t,n){return t?(n?"":" ".repeat(a))+e:(n?l:l+" ".repeat(a-l.length))+e});return s(),c};function rE(e){let t=e._align;$(t,"expected `_align` on table"),this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function rD(e){this.exit(e),this.data.inTable=void 0}function rI(e){this.enter({type:"tableRow",children:[]},e)}function rP(e){this.exit(e)}function rF(e){this.enter({type:"tableCell",children:[]},e)}function rR(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,rB));let n=this.stack[this.stack.length-1];$("inlineCode"===n.type),n.value=t,this.exit(e)}function rB(e,t){return"|"===t?t:e}function rO(e){let t=this.stack[this.stack.length-2];$("listItem"===t.type),t.checked="taskListCheckValueChecked"===e.type}function r$(e){let t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){let e=this.stack[this.stack.length-1];$("paragraph"===e.type);let n=e.children[0];if(n&&"text"===n.type){let r,i=t.children,l=-1;for(;++l<i.length;){let e=i[l];if("paragraph"===e.type){r=e;break}}r===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function r_(e,t,n,r){let i=e.children[0],l="boolean"==typeof e.checked&&i&&"paragraph"===i.type,a="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);l&&o.move(a);let s=rT(e,t,n,{...r,...o.current()});return l&&(s=s.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+a})),s}let rW={tokenize:function(e,t,n){let r=0;return function t(l){return(87===l||119===l)&&r<3?(r++,e.consume(l),t):46===l&&3===r?(e.consume(l),i):n(l)};function i(e){return null===e?n(e):t(e)}},partial:!0},rH={tokenize:function(e,t,n){let r,i,l;return a;function a(t){return 46===t||95===t?e.check(rV,s,o)(t):null===t||tn(t)||tl(t)||45!==t&&ti(t)?s(t):(l=!0,e.consume(t),a)}function o(t){return 95===t?r=!0:(i=r,r=void 0),e.consume(t),a}function s(e){return i||r||!l?n(e):t(e)}},partial:!0},rU={tokenize:function(e,t){let n=0,r=0;return i;function i(a){return 40===a?(n++,e.consume(a),i):41===a&&r<n?l(a):33===a||34===a||38===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||60===a||63===a||93===a||95===a||126===a?e.check(rV,t,l)(a):null===a||tn(a)||tl(a)?t(a):(e.consume(a),i)}function l(t){return 41===t&&r++,e.consume(t),i}},partial:!0},rV={tokenize:function(e,t,n){return r;function r(a){return 33===a||34===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||63===a||95===a||126===a?(e.consume(a),r):38===a?(e.consume(a),l):93===a?(e.consume(a),i):60===a||null===a||tn(a)||tl(a)?t(a):n(a)}function i(e){return null===e||40===e||91===e||tn(e)||tl(e)?t(e):r(e)}function l(t){return e4(t)?function t(i){return 59===i?(e.consume(i),r):e4(i)?(e.consume(i),t):n(i)}(t):n(t)}},partial:!0},rq={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return e3(e)?n(e):t(e)}},partial:!0},rY={name:"wwwAutolink",tokenize:function(e,t,n){let r=this;return function(t){return 87!==t&&119!==t||!rQ.call(r,r.previous)||r5(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(rW,e.attempt(rH,e.attempt(rU,i),n),n)(t))};function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:rQ},rX={name:"protocolAutolink",tokenize:function(e,t,n){let r=this,i="",l=!1;return function(t){return(72===t||104===t)&&rZ.call(r,r.previous)&&!r5(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(t),e.consume(t),a):n(t)};function a(t){if(e4(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),a;if(58===t){let n=i.toLowerCase();if("http"===n||"https"===n)return e.consume(t),o}return n(t)}function o(t){return 47===t?(e.consume(t),l)?s:(l=!0,o):n(t)}function s(t){return null===t||e8(t)||tn(t)||tl(t)||ti(t)?n(t):e.attempt(rH,e.attempt(rU,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:rZ},rK={name:"emailAutolink",tokenize:function(e,t,n){let r,i,l=this;return function(t){return!r1(t)||!r0.call(l,l.previous)||r5(l.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),function t(r){return r1(r)?(e.consume(r),t):64===r?(e.consume(r),a):n(r)}(t))};function a(t){return 46===t?e.check(rq,s,o)(t):45===t||95===t||e3(t)?(i=!0,e.consume(t),a):s(t)}function o(t){return e.consume(t),r=!0,a}function s(a){return i&&r&&e4(l.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(a)):n(a)}},previous:r0},rG={},rJ=48;for(;rJ<123;)rG[rJ]=rK,58==++rJ?rJ=65:91===rJ&&(rJ=97);function rQ(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||tn(e)}function rZ(e){return!e4(e)}function r0(e){return!(47===e||r1(e))}function r1(e){return 43===e||45===e||46===e||95===e||e3(e)}function r5(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}rG[43]=rK,rG[45]=rK,rG[46]=rK,rG[95]=rK,rG[72]=[rK,rX],rG[104]=[rK,rX],rG[87]=[rK,rY],rG[119]=[rK,rY];let r2={tokenize:function(e,t,n){let r=this;return to(e,function(e){let i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function r4(e,t,n){let r,i=this,l=i.events.length,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);for(;l--;){let e=i.events[l][1];if("labelImage"===e.type){r=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(l){if(!r||!r._balanced)return n(l);let o=t_(i.sliceSerialize({start:r.end,end:i.now()}));return 94===o.codePointAt(0)&&a.includes(o.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l)):n(l)}}function r3(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",l,t],["enter",a,t],["exit",a,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function r6(e,t,n){let r,i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),a=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),o};function o(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",s)}function s(o){if(a>999||93===o&&!r||null===o||91===o||tn(o))return n(o);if(93===o){e.exit("chunkString");let r=e.exit("gfmFootnoteCallString");return l.includes(t_(i.sliceSerialize(r)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(o)}return tn(o)||(r=!0),a++,e.consume(o),92===o?c:s}function c(t){return 91===t||92===t||93===t?(e.consume(t),a++,s):s(t)}}function r8(e,t,n){let r,i,l=this,a=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]),o=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),s};function s(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(o>999||93===t&&!i||null===t||91===t||tn(t))return n(t);if(93===t){e.exit("chunkString");let n=e.exit("gfmFootnoteDefinitionLabelString");return r=t_(l.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),u}return tn(t)||(i=!0),o++,e.consume(t),92===t?d:c}function d(t){return 91===t||92===t||93===t?(e.consume(t),o++,c):c(t)}function u(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a.includes(r)||a.push(r),to(e,h,"gfmFootnoteDefinitionWhitespace")):n(t)}function h(e){return t(e)}}function r7(e,t,n){return e.check(tu,t,e.attempt(r2,t,n))}function r9(e){e.exit("gfmFootnoteDefinition")}class ie{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let i=0;if(0!==n||0!==r.length){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length,n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}}function it(e,t,n){let r,i=this,l=0,a=0;return function(e){let t=i.events.length-1;for(;t>-1;){let e=i.events[t][1].type;if("lineEnding"===e||"linePrefix"===e)t--;else break}let r=t>-1?i.events[t][1].type:null,l="tableHead"===r||"tableRow"===r?k:o;return l===k&&i.parser.lazy[i.now().line]?n(e):l(e)};function o(t){var n;return e.enter("tableHead"),e.enter("tableRow"),124===(n=t)||(r=!0,a+=1),s(n)}function s(t){return null===t?n(t):tt(t)?a>1?(a=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),u):n(t):tr(t)?to(e,s,"whitespace")(t):(a+=1,r&&(r=!1,l+=1),124===t)?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),r=!0,s):(e.enter("data"),c(t))}function c(t){return null===t||124===t||tn(t)?(e.exit("data"),s(t)):(e.consume(t),92===t?d:c)}function d(t){return 92===t||124===t?(e.consume(t),c):c(t)}function u(t){return(i.interrupt=!1,i.parser.lazy[i.now().line])?n(t):(e.enter("tableDelimiterRow"),r=!1,tr(t))?to(e,h,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):h(t)}function h(t){return 45===t||58===t?f(t):124===t?(r=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),p):n(t)}function p(t){return tr(t)?to(e,f,"whitespace")(t):f(t)}function f(t){return 58===t?(a+=1,r=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),x):45===t?(a+=1,x(t)):null===t||tt(t)?g(t):n(t)}function x(t){return 45===t?(e.enter("tableDelimiterFiller"),function t(n){return 45===n?(e.consume(n),t):58===n?(r=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(n),e.exit("tableDelimiterMarker"),m):(e.exit("tableDelimiterFiller"),m(n))}(t)):n(t)}function m(t){return tr(t)?to(e,g,"whitespace")(t):g(t)}function g(i){if(124===i)return h(i);if(null===i||tt(i))return r&&l===a?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(i)):n(i);return n(i)}function k(t){return e.enter("tableRow"),b(t)}function b(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),b):null===n||tt(n)?(e.exit("tableRow"),t(n)):tr(n)?to(e,b,"whitespace")(n):(e.enter("data"),v(n))}function v(t){return null===t||124===t||tn(t)?(e.exit("data"),b(t)):(e.consume(t),92===t?y:v)}function y(t){return 92===t||124===t?(e.consume(t),v):v(t)}}function ir(e,t){let n,r,i,l=-1,a=!0,o=0,s=[0,0,0,0],c=[0,0,0,0],d=!1,u=0,h=new ie;for(;++l<e.length;){let p=e[l],f=p[1];"enter"===p[0]?"tableHead"===f.type?(d=!1,0!==u&&(il(h,t,u,n,r),r=void 0,u=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},h.add(l,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(a=!0,i=void 0,s=[0,0,0,0],c=[0,l+1,0,0],d&&(d=!1,r={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},h.add(l,0,[["enter",r,t]])),o="tableDelimiterRow"===f.type?2:r?3:1):o&&("data"===f.type||"tableDelimiterMarker"===f.type||"tableDelimiterFiller"===f.type)?(a=!1,0===c[2]&&(0!==s[1]&&(c[0]=c[1],i=ii(h,t,s,o,void 0,i),s=[0,0,0,0]),c[2]=l)):"tableCellDivider"===f.type&&(a?a=!1:(0!==s[1]&&(c[0]=c[1],i=ii(h,t,s,o,void 0,i)),c=[(s=c)[1],l,0,0])):"tableHead"===f.type?(d=!0,u=l):"tableRow"===f.type||"tableDelimiterRow"===f.type?(u=l,0!==s[1]?(c[0]=c[1],i=ii(h,t,s,o,l,i)):0!==c[1]&&(i=ii(h,t,c,o,l,i)),o=0):o&&("data"===f.type||"tableDelimiterMarker"===f.type||"tableDelimiterFiller"===f.type)&&(c[3]=l)}for(0!==u&&il(h,t,u,n,r),h.consume(t.events),l=-1;++l<t.events.length;){let e=t.events[l];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=function(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if("enter"===i[0])"tableContent"===i[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===i[1].type){if("tableDelimiterMarker"===e[t-1][1].type){let e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===i[1].type)break}else"enter"===i[0]&&"tableDelimiterRow"===i[1].type&&(n=!0);t+=1}return r}(t.events,l))}return e}function ii(e,t,n,r,i,l){0!==n[0]&&(l.end=Object.assign({},ia(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));let a=ia(t.events,n[1]);if(l={type:1===r?"tableHeader":2===r?"tableDelimiter":"tableData",start:Object.assign({},a),end:Object.assign({},a)},e.add(n[1],0,[["enter",l,t]]),0!==n[2]){let i=ia(t.events,n[2]),l=ia(t.events,n[3]),a={type:"tableContent",start:Object.assign({},i),end:Object.assign({},l)};if(e.add(n[2],0,[["enter",a,t]]),2!==r){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",a,t]])}return void 0!==i&&(l.end=Object.assign({},ia(t.events,i)),e.add(i,0,[["exit",l,t]]),l=void 0),l}function il(e,t,n,r,i){let l=[],a=ia(t.events,n);i&&(i.end=Object.assign({},a),l.push(["exit",i,t])),r.end=Object.assign({},a),l.push(["exit",r,t]),e.add(n+1,0,l)}function ia(e,t){let n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}let io={name:"tasklistCheck",tokenize:function(e,t,n){let r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i):n(t)};function i(t){return tn(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),l):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),l):n(t)}function l(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(t)}function a(r){return tt(r)?t(r):tr(r)?e.check({tokenize:is},t,n)(r):n(r)}}};function is(e,t,n){return to(e,function(e){return null===e?n(e):t(e)},"whitespace")}let ic={};function id(e){let t,n,r,i=e||ic,l=this.data(),a=l.micromarkExtensions||(l.micromarkExtensions=[]),o=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),s=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);a.push(e2([{text:rG},{document:{91:{name:"gfmFootnoteDefinition",tokenize:r8,continuation:{tokenize:r7},exit:r9}},text:{91:{name:"gfmFootnoteCall",tokenize:r6},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:r4,resolveTo:r3}}},(t=(i||{}).singleTilde,n={name:"strikethrough",tokenize:function(e,n,r){let i=this.previous,l=this.events,a=0;return function(o){return 126===i&&"characterEscape"!==l[l.length-1][1].type?r(o):(e.enter("strikethroughSequenceTemporary"),function l(o){let s=tz(i);if(126===o)return a>1?r(o):(e.consume(o),a++,l);if(a<2&&!t)return r(o);let c=e.exit("strikethroughSequenceTemporary"),d=tz(o);return c._open=!d||2===d&&!!s,c._close=!s||2===s&&!!d,n(o)}(o))}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";let i={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},l={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},a=[["enter",i,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",l,t]],o=t.parser.constructs.insideSpan.null;o&&e0(a,a.length,0,tN(o,e.slice(r+1,n),t)),e0(a,a.length,0,[["exit",l,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",i,t]]),e0(e,r-1,n-r+3,a),n=r+a.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}},null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}),{flow:{null:{name:"table",tokenize:it,resolveAll:ir}}},{text:{91:io}}])),o.push([{transforms:[rc],enter:{literalAutolink:rr,literalAutolinkEmail:ri,literalAutolinkHttp:ri,literalAutolinkWww:ri},exit:{literalAutolink:rs,literalAutolinkEmail:ro,literalAutolinkHttp:rl,literalAutolinkWww:ra}},{enter:{gfmFootnoteCallString:rp,gfmFootnoteCall:rf,gfmFootnoteDefinitionLabelString:rx,gfmFootnoteDefinition:rm},exit:{gfmFootnoteCallString:rg,gfmFootnoteCall:rk,gfmFootnoteDefinitionLabelString:rb,gfmFootnoteDefinition:rv}},{canContainEols:["delete"],enter:{strikethrough:rN},exit:{strikethrough:rC}},{enter:{table:rE,tableData:rF,tableHeader:rF,tableRow:rI},exit:{codeText:rR,table:rD,tableData:rP,tableHeader:rP,tableRow:rP}},{exit:{taskListCheckValueChecked:rO,taskListCheckValueUnchecked:rO,paragraph:r$}}]),s.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:rt,notInConstruct:rn},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:rt,notInConstruct:rn},{character:":",before:"[ps]",after:"\\/",inConstruct:rt,notInConstruct:rn}]},(r=!1,i&&i.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:function(e,t,n,i){let l=n.createTracker(i),a=l.move("[^"),o=n.enter("footnoteDefinition"),s=n.enter("label");return a+=l.move(n.safe(n.associationId(e),{before:a,after:"]"})),s(),a+=l.move("]:"),e.children&&e.children.length>0&&(l.shift(4),a+=l.move((r?"\n":" ")+n.indentLines(n.containerFlow(e,l.current()),r?rj:rw))),o(),a},footnoteReference:ry},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:rz}],handlers:{delete:rS}},function(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=rA(e,t,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r},table:function(e,t,n,r){return o(function(e,t,n){let r=e.children,i=-1,l=[],a=t.enter("table");for(;++i<r.length;)l[i]=s(r[i],t,n);return a(),l}(e,n,r),e.align)},tableCell:a,tableRow:function(e,t,n,r){let i=o([s(e,n,r)]);return i.slice(0,i.indexOf("\n"))}}};function a(e,t,n,r){let i=n.enter("tableCell"),a=n.enter("phrasing"),o=n.containerPhrasing(e,{...r,before:l,after:l});return a(),i(),o}function o(e,t){return function(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||rM,l=[],a=[],o=[],s=[],c=0,d=-1;for(;++d<e.length;){let t=[],r=[],l=-1;for(e[d].length>c&&(c=e[d].length);++l<e[d].length;){var u;let a=null==(u=e[d][l])?"":String(u);if(!1!==n.alignDelimiters){let e=i(a);r[l]=e,(void 0===s[l]||e>s[l])&&(s[l]=e)}t.push(a)}a[d]=t,o[d]=r}let h=-1;if("object"==typeof r&&"length"in r)for(;++h<c;)l[h]=rL(r[h]);else{let e=rL(r);for(;++h<c;)l[h]=e}h=-1;let p=[],f=[];for(;++h<c;){let e=l[h],t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let i=!1===n.alignDelimiters?1:Math.max(1,s[h]-t.length-r.length),a=t+"-".repeat(i)+r;!1!==n.alignDelimiters&&((i=t.length+i+r.length)>s[h]&&(s[h]=i),f[h]=i),p[h]=a}a.splice(1,0,p),o.splice(1,0,f),d=-1;let x=[];for(;++d<a.length;){let e=a[d],t=o[d];h=-1;let r=[];for(;++h<c;){let i=e[h]||"",a="",o="";if(!1!==n.alignDelimiters){let e=s[h]-(t[h]||0),n=l[h];114===n?a=" ".repeat(e):99===n?e%2?(a=" ".repeat(e/2+.5),o=" ".repeat(e/2-.5)):o=a=" ".repeat(e/2):o=" ".repeat(e)}!1===n.delimiterStart||h||r.push("|"),!1!==n.padding&&(!1!==n.alignDelimiters||""!==i)&&(!1!==n.delimiterStart||h)&&r.push(" "),!1!==n.alignDelimiters&&r.push(a),r.push(i),!1!==n.alignDelimiters&&r.push(o),!1!==n.padding&&r.push(" "),(!1!==n.delimiterEnd||h!==c-1)&&r.push("|")}x.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return x.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function s(e,t,n){let r=e.children,i=-1,l=[],o=t.enter("tableRow");for(;++i<r.length;)l[i]=a(r[i],e,t,n);return o(),l}}(i),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:r_}}]})}var iu=e.i(24411);function ih(e){let t=new Date(e),n=Math.floor((new Date().getTime()-t.getTime())/1e3);if(n<60)return"just now";let r=Math.floor(n/60);if(r<60)return`${r}m ago`;let i=Math.floor(r/60);if(i<24)return`${i}h ago`;let l=Math.floor(i/24);return l<7?`${l}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function ip(e,t){let n=[];return n.push(`[${p(e.prefix)}] ${e.id}`),t&&n.push(t),n.push(""),n.push(e.description||""),n.join("\n")}let ix="heartbeads-settings",im={elevenLabsVoiceId:"UgBBYS2sOqTuMpoF3BR0",elevenLabsModel:"eleven_flash_v2_5"};function ig(){try{let e=localStorage.getItem(ix);if(!e)return{...im};return{...im,...JSON.parse(e)}}catch{return{...im}}}function ik(){let e=ig();return!!e.elevenLabsApiKey&&e.elevenLabsApiKey.trim().length>0}let ib=new Map;function iv(e){return e.replace(/\s+/g," ").trim().toLowerCase()}let iy=null,iw=null,ij=null;function iz(e){iy&&(iy.playbackRate=e)}function iN(){iy&&(iy.pause(),iy.currentTime=0,iy.onended=null,iy.onerror=null,iy.ontimeupdate=null,iy=null),iw&&(URL.revokeObjectURL(iw),iw=null),ij=null}function iC(e,t){ij=null;let n=URL.createObjectURL(e);iw=n;let r=new Audio(n);iy=r,t("playing"),r.onended=()=>{iN(),t("idle")},r.onerror=()=>{iN(),t("error","Audio playback failed")},r.play()}async function iS(e,t){let n;iN();let r=ig();if(!r.elevenLabsApiKey)return void t("error","No API key configured");let i=r.elevenLabsVoiceId,l=(o=r.elevenLabsModel,`${i}:${o}:${e}`),a=((n=ib.get(l))&&(ib.delete(l),ib.set(l,n)),n);if(a)return void iC(a.blob,t);t("loading");try{var o;let n=await fetch(`https://api.elevenlabs.io/v1/text-to-speech/${i}/with-timestamps?output_format=mp3_44100_128`,{method:"POST",headers:{"Content-Type":"application/json","xi-api-key":r.elevenLabsApiKey},body:JSON.stringify({text:e,model_id:r.elevenLabsModel})});if(!n.ok){let e=await n.text().catch(()=>n.statusText);throw Error(`ElevenLabs API error (${n.status}): ${e}`)}let{audio_base64:a,alignment:s}=await n.json(),c=atob(a),d=new Uint8Array(c.length);for(let e=0;e<c.length;e++)d[e]=c.charCodeAt(e);let u=new Blob([d],{type:"audio/mpeg"}),h={blob:u,alignment:{characters:s.characters,characterStartTimesSeconds:s.character_start_times_seconds,characterEndTimesSeconds:s.character_end_times_seconds},strippedText:e};if(ib.size>=10){let e=ib.keys().next().value;e&&ib.delete(e)}ib.set(l,h),iC(u,t)}catch(e){iN(),t("error",e instanceof Error?e.message:"TTS failed")}}async function iM(e,t){iN();let n=function(e){let t=iv(e);if(!t)return null;for(let e of ib.values()){let n=iv(e.strippedText).indexOf(t);if(-1===n)continue;let{strippedText:r,alignment:i}=e,l=[],a=0,o=!1;for(let e=0;e<r.length;e++)/\s/.test(r[e])?(!o&&a>0?(l.push(a),a++):l.push(-1),o=!0):(l.push(a),a++,o=!1);let s=n+t.length-1,c=-1,d=-1;for(let e=0;e<l.length;e++)l[e]===n&&-1===c&&(c=e),l[e]===s&&(d=e);if(-1===c||-1===d)continue;let u=i.characterStartTimesSeconds.length;if(0===u)continue;let h=Math.min(c,u-1),p=Math.min(d,i.characterEndTimesSeconds.length-1);if(!(h<0)&&!(p<0))return{blob:e.blob,startTime:i.characterStartTimesSeconds[h],endTime:i.characterEndTimesSeconds[p]}}return null}(e);if(n){let{blob:e,startTime:r,endTime:i}=n,l=URL.createObjectURL(e);iw=l;let a=new Audio(l);iy=a,ij=i,a.onended=()=>{iN(),t("idle")},a.onerror=()=>{iN(),t("error","Audio playback failed")},a.ontimeupdate=()=>{null!==ij&&a.currentTime>=ij&&(iN(),t("idle"))},a.currentTime=r,t("playing"),await a.play();return}await iS(e,t)}function iL(){let[e,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=window.matchMedia("(max-width: 768px)");t(e.matches);let n=e=>t(e.matches);return e.addEventListener("change",n),()=>e.removeEventListener("change",n)},[]),e}let iA=[{label:"Normal",value:1},{label:"1.25x",value:1.25},{label:"1.5x",value:1.5},{label:"1.75x",value:1.75},{label:"2x",value:2}];function iT({node:e,onClose:t,repoUrl:i,onOpenSettings:l}){let[a,o]=(0,r.useState)(!1),[s,c]=(0,r.useState)("idle"),[d,u]=(0,r.useState)(null),[h,p]=(0,r.useState)(1),[f,x]=(0,r.useState)(!1),[m,g]=(0,r.useState)(""),[k,b]=(0,r.useState)(!1),v=(0,r.useRef)(null),y=(0,r.useRef)(null),w=iL(),[j,z]=(0,r.useState)(null),N=(0,r.useRef)(null),C=(0,r.useRef)(!1),S=(0,r.useCallback)((e,t)=>{c(e),t&&u(t)},[]),M=(0,r.useCallback)(()=>{if(!ik())return void l?.();let t=(e.description||"").replace(/```[\s\S]*?```/g,"").replace(/`([^`]+)`/g,"$1").replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/^#{1,6}\s+/gm,"").replace(/(\*{1,3}|_{1,3})(.*?)\1/g,"$2").replace(/~~(.*?)~~/g,"$1").replace(/^[-*_]{3,}\s*$/gm,"").replace(/^>\s+/gm,"").replace(/^[\s]*[-*+]\s+/gm,"").replace(/^[\s]*\d+\.\s+/gm,"").replace(/<[^>]+>/g,"").replace(/\n{3,}/g,"\n\n").trim();t&&(u(null),iS(t,S))},[e.description,l,S]),L=(0,r.useCallback)(()=>{iN(),c("idle"),x(!1),b(!1)},[]),A=(0,r.useCallback)(()=>{iy&&!iy.paused&&iy.pause(),c("paused")},[]),T=(0,r.useCallback)(()=>{iy&&iy.paused&&iy.currentTime>0&&iy.play(),c("playing")},[]),E=(0,r.useCallback)(e=>{let t=Math.max(.25,Math.min(4,e));p(t),iz(t),x(!1),b(!1)},[]);(0,r.useEffect)(()=>{"playing"===s&&iz(h)},[s,h]),(0,r.useEffect)(()=>{if(!f)return;let e=e=>{y.current&&!y.current.contains(e.target)&&v.current&&!v.current.contains(e.target)&&(x(!1),b(!1))},t=setTimeout(()=>window.addEventListener("mousedown",e),50);return()=>{clearTimeout(t),window.removeEventListener("mousedown",e)}},[f]);let D=(0,r.useCallback)(()=>{setTimeout(()=>{let e=window.getSelection();if(!e||e.isCollapsed)return;let t=e.toString().trim();if(!(t.length<3))try{let n=e.getRangeAt(0).getBoundingClientRect();z({text:t,x:n.left+n.width/2,y:n.top-8})}catch{}},10)},[]);(0,r.useEffect)(()=>{if(w)return;let e=()=>{if(C.current)return;let e=window.getSelection();e&&!e.isCollapsed&&e.toString().trim()||z(null)};return document.addEventListener("selectionchange",e),()=>document.removeEventListener("selectionchange",e)},[w]);let I=(0,r.useCallback)(()=>{if(!j)return;let e=j.text;if(e.trim()){if(!ik()){l?.(),z(null);return}C.current=!0,u(null),z(null),iM(e,S),setTimeout(()=>{C.current=!1},100)}},[j,l,S]);return((0,r.useEffect)(()=>()=>{iN(),x(!1),z(null)},[]),e.description)?(0,iu.createPortal)((0,n.jsxs)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/40 backdrop-blur-sm",onClick:t,children:[(0,n.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-xl shadow-2xl w-[90vw] max-w-2xl max-h-[80vh] flex flex-col",onClick:e=>e.stopPropagation(),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,n.jsx)("span",{className:"text-xs font-mono font-semibold text-emerald-600 dark:text-emerald-400 shrink-0",children:e.id}),(0,n.jsx)("span",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100 truncate",children:e.title})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,n.jsx)("button",{onClick:()=>{e.description&&navigator.clipboard.writeText(ip(e,i)).then(()=>{o(!0),setTimeout(()=>o(!1),1500)})},className:"p-1 text-zinc-400 dark:text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors",title:"Copy description",children:a?(0,n.jsx)("svg",{className:"w-4 h-4 text-emerald-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}):(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 0 1-.75.75H9.75a.75.75 0 0 1-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 0 1 1.927-.184"})})}),"loading"===s?(0,n.jsx)("button",{disabled:!0,className:"p-1 text-zinc-300 cursor-wait",title:"Loading audio...",children:(0,n.jsxs)("svg",{className:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:4}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}):"playing"===s?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:A,className:"p-1 text-emerald-500 hover:text-amber-500 hover:bg-amber-50 rounded transition-colors",title:"Pause",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25v13.5m-7.5-13.5v13.5"})})}),(0,n.jsx)("button",{onClick:L,className:"p-1 text-zinc-400 hover:text-red-500 hover:bg-red-50 rounded transition-colors",title:"Stop",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"})})})]}):"paused"===s?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:T,className:"p-1 text-amber-500 hover:text-emerald-500 hover:bg-emerald-50 rounded transition-colors",title:"Resume",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 010 1.972l-11.54 6.347a1.125 1.125 0 01-1.667-.986V5.653z"})})}),(0,n.jsx)("button",{onClick:L,className:"p-1 text-zinc-400 hover:text-red-500 hover:bg-red-50 rounded transition-colors",title:"Stop",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"})})})]}):(0,n.jsx)("button",{onClick:M,className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors",title:"Read aloud",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 010 12.728M16.463 8.288a5.25 5.25 0 010 7.424M6.75 8.25l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.009 9.009 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z"})})}),("playing"===s||"loading"===s||"paused"===s)&&(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("button",{ref:v,onClick:()=>x(e=>!e),className:"px-1.5 py-0.5 text-[11px] font-mono font-medium rounded text-zinc-500 hover:text-zinc-700 hover:bg-zinc-100 transition-colors",title:"Playback speed",children:1===h?"1x":`${h}x`}),f&&(0,n.jsxs)("div",{ref:y,className:"absolute right-0 top-full mt-1 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-700 rounded-lg shadow-lg overflow-hidden z-[110]",style:{minWidth:150},onClick:e=>e.stopPropagation(),children:[iA.map(e=>(0,n.jsxs)("button",{onClick:()=>E(e.value),className:`w-full px-3 py-2 text-xs text-left flex items-center justify-between hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors ${h===e.value?"text-emerald-600 dark:text-emerald-400 font-medium":"text-zinc-700 dark:text-zinc-300"}`,children:[(0,n.jsx)("span",{children:e.label}),h===e.value&&(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-emerald-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})})]},e.value)),(0,n.jsx)("div",{className:"border-t border-zinc-100 dark:border-zinc-800"}),k?(0,n.jsxs)("div",{className:"px-3 py-2 flex items-center gap-2",children:[(0,n.jsx)("input",{type:"number",min:.25,max:4,step:.25,value:m,onChange:e=>g(e.target.value),onKeyDown:e=>{if("Enter"===e.key){let e=parseFloat(m);!isNaN(e)&&e>=.25&&e<=4&&E(e)}"Escape"===e.key&&(b(!1),x(!1))},onBlur:()=>{let e=parseFloat(m);!isNaN(e)&&e>=.25&&e<=4?E(e):b(!1)},autoFocus:!0,className:"w-16 rounded border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 px-2 py-1 text-xs text-zinc-900 dark:text-zinc-100 focus:outline-none focus:ring-1 focus:ring-emerald-500"}),(0,n.jsx)("span",{className:"text-[11px] text-zinc-400 dark:text-zinc-400",children:"x"})]}):(0,n.jsxs)("button",{onClick:()=>{b(!0),g(String(h))},className:`w-full px-3 py-2 text-xs text-left flex items-center justify-between hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors ${!iA.some(e=>e.value===h)?"text-emerald-600 dark:text-emerald-400 font-medium":"text-zinc-700 dark:text-zinc-300"}`,children:[(0,n.jsxs)("span",{children:["Custom",iA.some(e=>e.value===h)?"...":` (${h}x)`]}),!iA.some(e=>e.value===h)&&(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-emerald-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})})]})]})]}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-zinc-400 dark:text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})]}),d&&(0,n.jsxs)("div",{className:"px-5 py-2 text-xs text-red-500 bg-red-50 dark:bg-red-950 border-b border-red-100 dark:border-red-800 flex items-center justify-between",children:[(0,n.jsx)("span",{children:d}),(0,n.jsx)("button",{onClick:()=>u(null),className:"text-red-400 hover:text-red-600 ml-2",children:(0,n.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsxs)("div",{className:"flex-1 overflow-y-auto px-5 py-4 custom-scrollbar description-markdown text-sm text-zinc-700 dark:text-zinc-300 leading-relaxed",onMouseUp:w?void 0:D,children:[(0,n.jsx)(n7,{remarkPlugins:[id],children:e.description}),e.acceptanceCriteria&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"border-t border-zinc-200 dark:border-zinc-700 my-4"}),(0,n.jsx)("h4",{className:"text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider mb-2",children:"Acceptance Criteria"}),(0,n.jsx)("pre",{className:"bg-zinc-50 dark:bg-zinc-800 rounded-lg p-3 border border-zinc-100 dark:border-zinc-800 overflow-x-auto",children:(0,n.jsx)("code",{className:"text-[11px] font-mono text-zinc-600 dark:text-zinc-300 whitespace-pre-wrap break-all",children:e.acceptanceCriteria})})]})]})]}),j&&!w&&(0,n.jsx)("div",{ref:N,className:"fixed z-[110] flex items-center gap-1.5 px-2.5 py-1.5 bg-zinc-800 text-white text-xs rounded-lg shadow-lg select-none",style:{left:j.x,top:j.y,transform:"translate(-50%, -100%)",pointerEvents:"auto"},onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:(0,n.jsxs)("button",{onClick:I,className:"flex items-center gap-1 hover:text-emerald-300 transition-colors",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 010 12.728M16.463 8.288a5.25 5.25 0 010 7.424M6.75 8.25l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.009 9.009 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z"})}),(0,n.jsx)("span",{children:"Read aloud"})]})})]}),document.body):null}function iE({className:e="w-3 h-3",filled:t=!1}){return t?(0,n.jsx)("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M11.645 20.91l-.007-.003-.022-.012a15.247 15.247 0 01-.383-.218 25.18 25.18 0 01-4.244-3.17C4.688 15.36 2.25 12.174 2.25 8.25 2.25 5.322 4.714 3 7.688 3A5.5 5.5 0 0112 5.052 5.5 5.5 0 0116.313 3c2.973 0 5.437 2.322 5.437 5.25 0 3.925-2.438 7.111-4.739 9.256a25.175 25.175 0 01-4.244 3.17 15.247 15.247 0 01-.383.219l-.022.012-.007.004-.003.001a.752.752 0 01-.704 0l-.003-.001z"})}):(0,n.jsx)("svg",{className:e,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12z"})})}function iD({node:e,allNodes:t,onNodeNavigate:i,comments:c,onPostComment:u,onDeleteComment:h,onLikeComment:p,onReplyComment:f,isAuthenticated:g,currentDid:k,repoUrls:b,onOpenSettings:v,onProfileClick:y}){var w;let j,z,[N,C]=(0,r.useState)(null),[S,M]=(0,r.useState)(""),[L,A]=(0,r.useState)(!1),[T,E]=(0,r.useState)(!1),[D,I]=(0,r.useState)(!1),P=e=>{C(e.uri),M("")},F=()=>{C(null),M("")},R=async()=>{if(S.trim()&&N&&f){A(!0);try{let e=t=>{for(let n of t){if(n.uri===N)return n;let t=e(n.replies);if(t)return t}},t=c?e(c):void 0;t&&await f(t,S.trim()),C(null),M("")}catch(e){console.error("Failed to post reply:",e)}finally{A(!1)}}};if(!e)return(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,n.jsx)("div",{className:"w-12 h-12 rounded-full bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center mb-4",children:(0,n.jsx)("svg",{className:"w-6 h-6 text-zinc-400 dark:text-zinc-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 15l-2 5L9 9l11 4-5 2zm0 0l5 5M7.188 2.239l.777 2.897M5.136 7.965l-2.898-.777M13.95 4.05l-2.122 2.122m-5.657 5.656l-2.12 2.122"})})}),(0,n.jsx)("p",{className:"text-sm text-zinc-500 dark:text-zinc-400 leading-relaxed",children:"Click a node to see details"}),(0,n.jsx)("p",{className:"text-xs text-zinc-400 dark:text-zinc-500 mt-1",children:"Hover to highlight connections"})]});let B=d[e.issueType]||"📋",O=l[e.status]||l.open,$=a[e.status]||e.status,_=o[e.priority]||`P${e.priority}`,W=s[e.priority]||"#a1a1aa",H=x[e.prefix]||e.prefix,U=m[e.prefix]||"#a1a1aa",V=b?.[e.prefix],q=e.blockerIds.map(e=>t.find(t=>t.id===e)).filter(Boolean),Y=e.dependentIds.map(e=>t.find(t=>t.id===e)).filter(Boolean),X=e=>{try{let t=new Date(e),n=t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),r=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!1});return`${n} at ${r}`}catch{return e}};return(0,n.jsxs)("div",{className:"animate-fade-in",children:[(0,n.jsxs)("div",{className:"flex items-start gap-3 mb-4",children:[(0,n.jsx)("span",{className:"text-2xl mt-0.5",children:B}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("div",{className:"flex items-center gap-2",children:(0,n.jsx)("span",{className:"text-xs font-mono font-semibold text-emerald-600 dark:text-emerald-400",children:e.id})}),(0,n.jsx)("h3",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100 mt-1 leading-snug",children:e.title})]})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 mb-4",children:[(0,n.jsxs)("span",{className:"status-badge",style:{backgroundColor:O+"18",color:O,border:`1px solid ${O}30`},children:[(0,n.jsx)("span",{className:"w-1.5 h-1.5 rounded-full mr-1.5",style:{backgroundColor:O}}),$]}),(0,n.jsx)("span",{className:"status-badge",style:{backgroundColor:W+"15",color:W,border:`1px solid ${W}25`},children:_}),V?(0,n.jsxs)("a",{href:V,target:"_blank",rel:"noopener noreferrer",className:"status-badge hover:opacity-80 transition-opacity",style:{backgroundColor:U+"15",color:U,border:`1px solid ${U}25`,textDecoration:"none"},children:[H,(0,n.jsx)("svg",{className:"w-2.5 h-2.5 ml-1 opacity-50",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"})})]}):(0,n.jsx)("span",{className:"status-badge",style:{backgroundColor:U+"15",color:U,border:`1px solid ${U}25`},children:H})]}),e.labels.length>0&&(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-4",children:e.labels.map(e=>(0,n.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-[11px] font-medium bg-zinc-100 dark:bg-zinc-800 text-zinc-600 dark:text-zinc-400 border border-zinc-200/60 dark:border-zinc-700/60",children:e},e))}),V&&(0,n.jsx)("div",{className:"mb-4",children:(0,n.jsxs)("a",{href:V,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-[11px] text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"currentColor",children:(0,n.jsx)("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),V.replace(/^https?:\/\//,"")]})}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-3 mb-4",children:[(0,n.jsx)(iP,{label:"Blocks",value:e.blockerCount,color:e.blockerCount>0?"#f59e0b":void 0}),(0,n.jsx)(iP,{label:"Blocked by",value:e.dependentCount,color:e.dependentCount>0?"#ef4444":void 0})]}),(0,n.jsxs)("div",{className:"space-y-1.5 mb-4 text-xs text-zinc-500 dark:text-zinc-400",children:[(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{children:"Created"}),(0,n.jsx)("span",{className:"text-zinc-700 dark:text-zinc-300 font-medium",children:X(e.createdAt)})]}),(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{children:"Updated"}),(0,n.jsx)("span",{className:"text-zinc-700 dark:text-zinc-300 font-medium",children:X(e.updatedAt)})]}),e.closedAt&&(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{children:"Closed"}),(0,n.jsx)("span",{className:"text-zinc-700 dark:text-zinc-300 font-medium",children:X(e.closedAt)})]}),e.closeReason&&(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{children:"Reason"}),(0,n.jsx)("span",{className:"text-zinc-700 dark:text-zinc-300 font-medium ml-2 text-right",children:(w=e.closeReason,j=V||"https://github.com/GainForest/heartbeads",1===(z=w.split(/\b([0-9a-f]{7,40})\b/)).length?w:z.map((e,t)=>/^[0-9a-f]{7,40}$/.test(e)?(0,n.jsx)("a",{href:`${j}/commit/${e}`,target:"_blank",rel:"noopener noreferrer",className:"font-mono text-emerald-600 dark:text-emerald-400 hover:text-emerald-700 dark:hover:text-emerald-300 underline decoration-emerald-300 hover:decoration-emerald-500 cursor-pointer transition-colors",children:e},t):(0,n.jsx)("span",{children:e},t)))})]}),(e.createdBy||e.owner||e.assignee)&&(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{children:"Created by"}),(0,n.jsx)("button",{onClick:()=>y?.(e.createdBy||e.owner||e.assignee||""),className:"text-zinc-700 dark:text-zinc-300 font-medium truncate ml-2 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:e.createdBy||e.owner||e.assignee})]}),(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{children:"Assignee"}),e.assignee?(0,n.jsx)("button",{onClick:()=>y?.(e.assignee),className:"text-zinc-700 dark:text-zinc-300 font-medium truncate ml-2 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:e.assignee}):(0,n.jsx)("span",{className:"text-zinc-400 dark:text-zinc-500 italic ml-2",children:"No assignee"})]}),null!=e.estimatedMinutes&&(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{children:"Estimate"}),(0,n.jsxs)("span",{className:"text-zinc-700 dark:text-zinc-300 font-medium",children:["⏱ ",e.estimatedMinutes,"m"]})]})]}),e.description&&(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,n.jsx)("h4",{className:"text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider",children:"Description"}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("button",{onClick:()=>{if(!e.description)return;let t=b?.[e.prefix];navigator.clipboard.writeText(ip(e,t)).then(()=>{I(!0),setTimeout(()=>I(!1),1500)})},className:"text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors",title:"Copy description",children:D?(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-emerald-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}):(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 0 1-.75.75H9.75a.75.75 0 0 1-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 0 1 1.927-.184"})})}),(0,n.jsx)("button",{onClick:()=>E(!0),className:"text-[10px] text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors",children:"View in window"})]})]}),(0,n.jsx)("div",{className:"text-xs text-zinc-600 dark:text-zinc-300 leading-relaxed bg-zinc-50 dark:bg-zinc-800 rounded-lg p-3 max-h-40 overflow-y-auto custom-scrollbar border border-zinc-100 dark:border-zinc-800 description-markdown",children:(0,n.jsx)(n7,{remarkPlugins:[id],children:e.description})})]}),T&&e.description&&(0,n.jsx)(iT,{node:e,onClose:()=>E(!1),repoUrl:b?.[e.prefix],onOpenSettings:v}),e.acceptanceCriteria&&(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h4",{className:"text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider mb-2",children:"Acceptance Criteria"}),(0,n.jsx)("pre",{className:"text-[11px] font-mono bg-zinc-50 dark:bg-zinc-800 rounded-lg p-3 border border-zinc-100 dark:border-zinc-800 overflow-x-auto whitespace-pre-wrap break-all",children:(0,n.jsx)("code",{children:e.acceptanceCriteria})})]}),q.length>0&&(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsxs)("h4",{className:"text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider mb-2",children:["Blocks (",q.length,")"]}),(0,n.jsx)("div",{className:"space-y-1",children:q.map(e=>(0,n.jsx)(iF,{node:e,onClick:()=>i(e.id)},e.id))})]}),Y.length>0&&(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsxs)("h4",{className:"text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider mb-2",children:["Blocked by (",Y.length,")"]}),(0,n.jsx)("div",{className:"space-y-1",children:Y.map(e=>(0,n.jsx)(iF,{node:e,onClick:()=>i(e.id)},e.id))})]}),(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsxs)("h4",{className:"text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider mb-2",children:["Comments"," ",c&&c.length>0&&(0,n.jsx)("span",{className:"ml-1 px-1.5 py-0.5 bg-emerald-50 dark:bg-emerald-950 text-emerald-600 dark:text-emerald-400 rounded-full text-[10px] font-medium",children:c.length})]}),c&&c.length>0?(0,n.jsx)("div",{className:"space-y-1",children:c.map(e=>(0,n.jsx)(iR,{comment:e,currentDid:k,isAuthenticated:g,onDelete:h,onLike:p,onStartReply:P,replyingToUri:N,replyText:S,onReplyTextChange:M,onSubmitReply:R,onCancelReply:F,isSubmittingReply:L,depth:0},e.uri))}):(0,n.jsx)("p",{className:"text-xs text-zinc-400 dark:text-zinc-500 italic",children:"No comments yet"}),g&&u?(0,n.jsx)(iB,{onSubmit:u}):g?null:(0,n.jsx)("p",{className:"text-xs text-zinc-400 dark:text-zinc-500 mt-2",children:"Sign in to leave a comment"})]})]})}function iI({replyingTo:e,replyText:t,onTextChange:r,onSubmit:i,onCancel:l,isSubmitting:a}){return(0,n.jsxs)("div",{className:"mt-2 ml-4 pl-3 border-l border-emerald-200 space-y-1.5",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] text-zinc-400 dark:text-zinc-500",children:[(0,n.jsx)("span",{children:"Replying to"}),(0,n.jsx)("a",{href:`https://www.impactindexer.org/data?did=${e.did}`,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-zinc-600 dark:text-zinc-400 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:e.displayName||e.handle})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("input",{type:"text",value:t,onChange:e=>r(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||i()},placeholder:"Write a reply...",disabled:a,autoFocus:!0,className:"flex-1 px-2 py-1 text-xs bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-700 rounded placeholder-zinc-400 dark:placeholder-zinc-500 focus:outline-none focus:border-emerald-400 disabled:opacity-50"}),(0,n.jsx)("button",{onClick:i,disabled:!t.trim()||a,className:"px-2 py-1 text-[10px] font-medium text-emerald-600 dark:text-emerald-400 hover:text-emerald-700 dark:hover:text-emerald-300 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:a?"...":"Reply"}),(0,n.jsx)("button",{onClick:l,disabled:a,className:"px-2 py-1 text-[10px] text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 disabled:opacity-50 transition-colors",children:"Cancel"})]})]})}function iP({label:e,value:t,color:r}){return(0,n.jsxs)("div",{className:"bg-zinc-50 dark:bg-zinc-800 rounded-lg p-3 border border-zinc-100 dark:border-zinc-800",children:[(0,n.jsx)("div",{className:"text-xl font-bold",style:{color:r||"#3f3f46"},children:t}),(0,n.jsx)("div",{className:"text-[10px] text-zinc-400 dark:text-zinc-500 uppercase tracking-wider mt-0.5",children:e})]})}function iF({node:e,onClick:t}){let r=l[e.status]||l.open;return(0,n.jsxs)("button",{onClick:t,className:"w-full flex items-center gap-2 px-2.5 py-1.5 rounded-md hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors text-left group border border-transparent hover:border-zinc-200 dark:hover:border-zinc-700",children:[(0,n.jsx)("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:r}}),(0,n.jsx)("span",{className:"text-xs font-mono text-emerald-600 dark:text-emerald-400 group-hover:text-emerald-700 dark:group-hover:text-emerald-300 shrink-0",children:e.id}),(0,n.jsx)("span",{className:"text-xs text-zinc-500 dark:text-zinc-400 truncate",children:e.title})]})}function iR({comment:e,currentDid:t,isAuthenticated:i,onDelete:l,onLike:a,onStartReply:o,replyingToUri:s,replyText:c,onReplyTextChange:d,onSubmitReply:u,onCancelReply:h,isSubmittingReply:p,depth:f}){let[x,m]=(0,r.useState)(!1),[g,k]=(0,r.useState)(!1),b=t&&t===e.did,v=!!t&&e.likes.some(e=>e.did===t),y=s===e.uri,w=async()=>{if(l&&!x){m(!0);try{await l(e)}catch(e){console.error("Failed to delete comment:",e)}finally{m(!1)}}},j=async()=>{if(a&&!g){k(!0);try{await a(e)}catch(e){console.error("Failed to toggle like:",e)}finally{k(!1)}}};return(0,n.jsxs)("div",{className:`${f>0?"ml-4 pl-3 border-l border-zinc-100 dark:border-zinc-800":""}`,children:[(0,n.jsxs)("div",{className:"py-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,n.jsx)("div",{className:"shrink-0 w-4 h-4 rounded-full bg-zinc-100 dark:bg-zinc-800 overflow-hidden",children:e.avatar?(0,n.jsx)("img",{src:e.avatar,alt:"",className:"w-full h-full object-cover"}):(0,n.jsx)("div",{className:"w-full h-full flex items-center justify-center text-[8px] font-medium text-zinc-400 dark:text-zinc-500",children:(e.handle||e.did).charAt(0).toUpperCase()})}),(0,n.jsx)("a",{href:`https://www.impactindexer.org/data?did=${e.did}`,target:"_blank",rel:"noopener noreferrer",className:"text-xs font-medium text-zinc-600 dark:text-zinc-400 truncate hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:e.displayName||e.handle||e.did.slice(0,16)+"..."}),(0,n.jsx)("span",{className:"text-[10px] text-zinc-300 dark:text-zinc-600 shrink-0",children:ih(e.createdAt)})]}),(0,n.jsx)("p",{className:"text-xs text-zinc-500 dark:text-zinc-400 leading-relaxed whitespace-pre-wrap break-words",children:e.text}),(0,n.jsxs)("div",{className:"flex items-center gap-2 mt-1 text-[10px]",children:[(0,n.jsxs)("button",{onClick:j,disabled:!i||g,className:`flex items-center gap-0.5 transition-colors ${v?"text-rose-500":"text-zinc-300 hover:text-rose-500"} disabled:opacity-50`,children:[(0,n.jsx)(iE,{className:"w-3 h-3",filled:v}),e.likes.length>0&&(0,n.jsx)("span",{children:e.likes.length})]}),(0,n.jsx)("button",{onClick:()=>o(e),disabled:!i,className:`transition-colors disabled:opacity-50 ${y?"text-emerald-500 dark:text-emerald-400":"text-zinc-300 dark:text-zinc-600 hover:text-zinc-500 dark:hover:text-zinc-400"}`,children:"reply"}),b&&l&&(0,n.jsx)("button",{onClick:w,disabled:x,className:"ml-auto shrink-0 text-zinc-300 dark:text-zinc-600 hover:text-red-400 disabled:opacity-50 transition-colors",children:x?"...":"delete"})]})]}),y&&(0,n.jsx)(iI,{replyingTo:e,replyText:c,onTextChange:d,onSubmit:u,onCancel:h,isSubmitting:p}),e.replies.length>0&&(0,n.jsx)("div",{children:e.replies.map(e=>(0,n.jsx)(iR,{comment:e,currentDid:t,isAuthenticated:i,onDelete:l,onLike:a,onStartReply:o,replyingToUri:s,replyText:c,onReplyTextChange:d,onSubmitReply:u,onCancelReply:h,isSubmittingReply:p,depth:f+1},e.uri))})]})}function iB({onSubmit:e}){let[t,i]=(0,r.useState)(""),[l,a]=(0,r.useState)(!1),o=async()=>{if(t.trim()&&!l){a(!0);try{await e(t.trim()),i("")}catch(e){console.error("Failed to post comment:",e)}finally{a(!1)}}};return(0,n.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,n.jsx)("textarea",{value:t,onChange:e=>i(e.target.value),placeholder:"Leave a comment...",rows:2,className:"w-full px-2.5 py-1.5 text-xs border border-zinc-200 dark:border-zinc-700 rounded-md bg-zinc-50 dark:bg-zinc-800 text-zinc-700 dark:text-zinc-300 placeholder-zinc-400 dark:placeholder-zinc-500 resize-none focus:outline-none focus:ring-1 focus:ring-emerald-500 focus:border-emerald-500"}),(0,n.jsx)("button",{onClick:o,disabled:!t.trim()||l,className:"px-3 py-1 text-xs font-medium text-white bg-emerald-500 rounded-md hover:bg-emerald-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:l?"Sending...":"Comment"})]})}var iO=e.i(63398);function i$({onViewProfile:e}){let{isAuthenticated:t,isLoading:i,session:l,login:a,logout:o}=(0,iO.useAuth)(),[s,c]=(0,r.useState)(!1),[d,u]=(0,r.useState)(!1),[h,p]=(0,r.useState)(""),[f,x]=(0,r.useState)(!1),[m,g]=(0,r.useState)(""),k=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!d)return;let e=e=>{k.current&&!k.current.contains(e.target)&&u(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[d]);let b=async e=>{if(e.preventDefault(),h.trim()){x(!0),g("");try{await a(h.trim())}catch(e){g(e instanceof Error?e.message:"Login failed"),x(!1)}}},v=async()=>{u(!1),await o()};return i?(0,n.jsx)("div",{className:"w-4 h-4 rounded-full border-2 border-zinc-200 border-t-zinc-400 animate-spin"}):t&&l?(0,n.jsxs)("div",{className:"relative",ref:k,children:[(0,n.jsxs)("button",{onClick:()=>u(e=>!e),className:"flex items-center gap-2 px-3 py-1.5 rounded-full hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors cursor-pointer",children:[l.avatar?(0,n.jsx)("img",{src:l.avatar,alt:l.handle,width:24,height:24,className:"rounded-full"}):(0,n.jsx)("div",{className:"w-6 h-6 rounded-full bg-emerald-100 dark:bg-emerald-950 flex items-center justify-center text-[11px] text-emerald-700 dark:text-emerald-400 font-medium",children:(l.displayName||l.handle).charAt(0).toUpperCase()}),(0,n.jsx)("span",{className:"text-sm text-zinc-600 dark:text-zinc-400 max-w-[100px] truncate",children:l.displayName||l.handle})]}),d&&(0,n.jsxs)("div",{className:"absolute right-0 top-full mt-2 w-44 bg-white dark:bg-zinc-900 rounded-xl shadow-xl border border-zinc-100 dark:border-zinc-700 py-2 z-50",children:[(0,n.jsxs)("button",{onClick:()=>{e?(e(l.handle),u(!1)):window.open(l.did?`https://www.impactindexer.org/data?did=${l.did}`:"#","_blank")},className:"block w-full text-left px-3 py-1.5 text-xs text-zinc-400 dark:text-zinc-400 truncate hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors cursor-pointer",children:["@",l.handle]}),(0,n.jsx)("div",{className:"h-px bg-zinc-100 dark:border-zinc-800 my-1"}),(0,n.jsxs)("button",{onClick:v,className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-zinc-600 dark:text-zinc-400 hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors cursor-pointer",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 9V5.25A2.25 2.25 0 0 1 10.5 3h6a2.25 2.25 0 0 1 2.25 2.25v13.5A2.25 2.25 0 0 1 16.5 21h-6a2.25 2.25 0 0 1-2.25-2.25V15m-3 0-3-3m0 0 3-3m-3 3H15"})}),"Sign out"]})]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:()=>c(!0),className:"px-4 py-1.5 text-sm font-medium text-zinc-600 dark:text-zinc-400 rounded-full hover:text-zinc-900 dark:hover:text-zinc-100 hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors cursor-pointer whitespace-nowrap",children:"Sign in"}),s&&(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[20vh]",onClick:()=>c(!1),children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/20 backdrop-blur-sm"}),(0,n.jsxs)("div",{className:"relative w-full max-w-sm mx-4 bg-white dark:bg-zinc-900 rounded-xl shadow-lg border border-zinc-200 dark:border-zinc-700 p-6",onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-zinc-900 dark:text-zinc-100 mb-1",children:"Sign in with ATProto"}),(0,n.jsx)("p",{className:"text-sm text-zinc-400 dark:text-zinc-400 mb-5",children:"Enter your Bluesky handle to connect."}),(0,n.jsxs)("form",{onSubmit:b,children:[(0,n.jsx)("label",{htmlFor:"auth-handle",className:"block text-sm text-zinc-600 dark:text-zinc-400 mb-1.5",children:"Handle"}),(0,n.jsx)("input",{id:"auth-handle",type:"text",value:h,onChange:e=>p(e.target.value),placeholder:"alice.bsky.social",disabled:f,autoFocus:!0,className:"w-full px-3 py-2 text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-lg placeholder:text-zinc-300 dark:placeholder:text-zinc-500 focus:outline-none focus:ring-2 focus:ring-emerald-500/30 focus:border-emerald-400 disabled:opacity-50 disabled:cursor-not-allowed text-zinc-900 dark:text-zinc-100"}),(0,n.jsx)("p",{className:"text-xs text-zinc-300 dark:text-zinc-500 mt-1.5",children:"Just a username? We'll add .bsky.social for you."}),m&&(0,n.jsx)("p",{className:"text-sm text-red-500 mt-2",children:m}),(0,n.jsxs)("div",{className:"flex gap-2 mt-5",children:[(0,n.jsx)("button",{type:"button",onClick:()=>c(!1),disabled:f,className:"flex-1 px-3 py-2 text-sm text-zinc-600 dark:text-zinc-400 bg-zinc-50 dark:bg-zinc-800 rounded-lg hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Cancel"}),(0,n.jsx)("button",{type:"submit",disabled:f||!h.trim(),className:"flex-1 px-3 py-2 text-sm text-white bg-emerald-600 rounded-lg hover:bg-emerald-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:f?"Connecting...":"Connect"})]})]})]})]})]})}var i_=e.i(17528);function iW({node:e,x:t,y:i,onClose:l,onSubmit:a,isAuthenticated:o,existingComments:s}){let[c,d]=(0,r.useState)(""),[u,h]=(0,r.useState)(!1),p=(0,r.useRef)(null),f=(0,r.useRef)(null),[x,g]=(0,r.useState)({x:0,y:0}),[k,b]=(0,r.useState)(!1),v=iL();(0,r.useEffect)(()=>{if(!p.current)return;let e=p.current.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight,l=t+14,a=i-e.height-14;l+e.width>n-16&&(l=n-e.width-16),l<16&&(l=16),a<16&&(a=i+28),a+e.height>r-16&&(a=r-e.height-16),g({x:l,y:a}),b(!0)},[t,i]),(0,r.useEffect)(()=>{if(o){let e=setTimeout(()=>f.current?.focus(),100);return()=>clearTimeout(e)}},[o]),(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[l]),(0,r.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&l()},t=setTimeout(()=>{window.addEventListener("mousedown",e)},50);return()=>{clearTimeout(t),window.removeEventListener("mousedown",e)}},[l]);let y=(0,r.useCallback)(async()=>{if(c.trim()&&!u){h(!0);try{await a(c.trim()),d("")}catch(e){console.error("Failed to post comment:",e)}finally{h(!1)}}},[c,u,a]),w=(0,r.useCallback)(e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),y())},[y]),j=m[e.prefix]||"#a1a1aa",z=s?.length||0,N=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"mb-3",children:[(0,n.jsx)("span",{className:"text-xs font-mono text-emerald-600 dark:text-emerald-400",children:e.id}),(0,n.jsx)("h3",{className:"text-sm font-semibold text-zinc-800 dark:text-zinc-200 leading-tight mt-0.5",children:e.title})]}),z>0&&s&&(0,n.jsxs)("div",{className:"mb-3 pb-3 border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-blue-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 20.25c4.97 0 9-3.694 9-8.25s-4.03-8.25-9-8.25S3 7.444 3 12c0 2.104.859 4.023 2.273 5.48.432.447.74 1.04.586 1.641a4.483 4.483 0 01-.923 1.785A5.969 5.969 0 006 21c1.282 0 2.47-.402 3.445-1.087.81.22 1.668.337 2.555.337z"})}),(0,n.jsxs)("span",{className:"text-[10px] font-medium text-zinc-500 dark:text-zinc-400 uppercase tracking-wider",children:[z," comment",1!==z?"s":""]})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[s.slice(0,2).map(e=>(0,n.jsxs)("div",{className:"flex gap-1.5",children:[(0,n.jsx)("div",{className:"shrink-0 w-4 h-4 rounded-full bg-zinc-100 dark:bg-zinc-800 overflow-hidden mt-0.5",children:e.avatar?(0,n.jsx)("img",{src:e.avatar,alt:"",className:"w-full h-full object-cover"}):(0,n.jsx)("div",{className:"w-full h-full flex items-center justify-center text-[7px] font-medium text-zinc-400 dark:text-zinc-500",children:(e.handle||e.did).charAt(0).toUpperCase()})}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("a",{href:`https://www.impactindexer.org/data?did=${e.did}`,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] font-medium text-zinc-500 dark:text-zinc-400 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:e.displayName||e.handle}),(0,n.jsx)("p",{className:"text-[11px] text-zinc-500 dark:text-zinc-400 line-clamp-2 leading-tight",children:e.text})]})]},e.uri)),z>2&&(0,n.jsxs)("p",{className:"text-[10px] text-zinc-400 dark:text-zinc-500 italic",children:["+",z-2," more — see detail panel"]})]})]}),o?(0,n.jsxs)("div",{children:[(0,n.jsx)("textarea",{ref:f,value:c,onChange:e=>d(e.target.value),onKeyDown:w,placeholder:"Leave a comment...",rows:3,className:"w-full px-2.5 py-2 text-xs border border-zinc-200 dark:border-zinc-700 rounded-md bg-zinc-50 dark:bg-zinc-800 text-zinc-700 dark:text-zinc-300 placeholder-zinc-400 dark:placeholder-zinc-500 resize-none focus:outline-none focus:ring-1 focus:ring-emerald-500 focus:border-emerald-500"}),(0,n.jsxs)("div",{className:"flex items-center justify-between mt-2",children:[(0,n.jsxs)("span",{className:"text-[10px] text-zinc-300 dark:text-zinc-600",children:["u">typeof navigator&&navigator.platform?.includes("Mac")?"⌘":"Ctrl","+Enter to send"]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("button",{onClick:l,className:"px-2.5 py-1 text-[11px] text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors",children:"Cancel"}),(0,n.jsx)("button",{onClick:y,disabled:!c.trim()||u,className:"px-3 py-1 text-[11px] font-medium text-white bg-emerald-500 rounded-md hover:bg-emerald-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:u?(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsxs)("svg",{className:"w-3 h-3 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Sending"]}):"Send"})]})]})]}):(0,n.jsxs)("div",{className:"text-center py-3",children:[(0,n.jsx)("svg",{className:"w-5 h-5 text-zinc-300 dark:text-zinc-600 mx-auto mb-1.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})}),(0,n.jsx)("p",{className:"text-xs text-zinc-400 dark:text-zinc-500",children:"Sign in to comment"})]})]});return v?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"fixed inset-0 z-[99] bg-black/20",onClick:l}),(0,n.jsxs)("div",{className:"fixed inset-x-0 bottom-0 z-[100] bg-white dark:bg-zinc-900 rounded-t-2xl shadow-2xl animate-slide-up-sheet",children:[(0,n.jsx)("div",{className:"w-10 h-1 bg-zinc-300 dark:bg-zinc-600 rounded-full mx-auto mt-3 mb-1"}),(0,n.jsx)("div",{className:"px-4 pb-6 pt-2",children:N}),(0,n.jsx)("div",{className:"h-[env(safe-area-inset-bottom)]"})]})]}):(0,n.jsxs)("div",{ref:p,style:{position:"fixed",left:x.x,top:x.y,width:320,zIndex:100,opacity:+!!k,transform:k?"translateY(0)":"translateY(4px)",transition:"opacity 0.2s ease, transform 0.2s ease"},className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-700 rounded-lg overflow-hidden",onContextMenu:e=>e.preventDefault(),children:[(0,n.jsx)("style",{children:`
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,69090,(e,t,n)=>{"use strict";var r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,l=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g;function u(e){return e?e.replace(d,""):""}t.exports=function(e,t){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,d=1;function h(e){var t=e.match(i);t&&(n+=t.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function p(){var e={line:n,column:d};return function(t){return t.position=new f(e),m(l),t}}function f(e){this.start=e,this.end={line:n,column:d},this.source=t.source}function x(r){var i=Error(t.source+":"+n+":"+d+": "+r);if(i.reason=r,i.filename=t.source,i.line=n,i.column=d,i.source=e,t.silent);else throw i}function m(t){var n=t.exec(e);if(n){var r=n[0];return h(r),e=e.slice(r.length),n}}function g(e){var t;for(e=e||[];t=k();)!1!==t&&e.push(t);return e}function k(){var t=p();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return x("End of comment missing");var r=e.slice(2,n-2);return d+=2,h(r),e=e.slice(n),d+=2,t({type:"comment",comment:r})}}f.prototype.content=e,m(l);var b,v=[];for(g(v);b=function(){var e=p(),t=m(a);if(t){if(k(),!m(o))return x("property missing ':'");var n=m(s),i=e({type:"declaration",property:u(t[0].replace(r,"")),value:n?u(n[0].replace(r,"")):""});return m(c),i}}();)!1!==b&&(v.push(b),g(v));return v}},59596,(e,t,n)=>{"use strict";var r=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;let r=(0,i.default)(e),l="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;let{property:r,value:i}=e;l?t(r,i,e):i&&((n=n||{})[r]=i)}),n};let i=r(e.r(69090))},51521,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.camelCase=void 0;var r=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,l=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(e,t){return t.toUpperCase()},c=function(e,t){return"".concat(t,"-")};n.camelCase=function(e,t){var n;return(void 0===t&&(t={}),!(n=e)||l.test(n)||r.test(n))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(o,c):e.replace(a,c)).replace(i,s))}},63185,(e,t,n)=>{"use strict";var r=(e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(e.r(59596)),i=e.r(51521);function l(e,t){var n={};return e&&"string"==typeof e&&(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}l.default=l,t.exports=l},75609,(e,t,n)=>{"use strict";var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,l=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},s=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),l=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!l)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){l&&"__proto__"===t.name?l(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},d=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;else if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,l,a,u=arguments[0],h=1,p=arguments.length,f=!1;for("boolean"==typeof u&&(f=u,u=arguments[1]||{},h=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});h<p;++h)if(t=arguments[h],null!=t)for(n in t)r=d(u,n),u!==(i=d(t,n))&&(f&&i&&(s(i)||(l=o(i)))?(l?(l=!1,a=r&&o(r)?r:[]):a=r&&s(r)?r:{},c(u,{name:n,newValue:e(f,a,i)})):void 0!==i&&c(u,{name:n,newValue:i}));return u}},31713,e=>{"use strict";var t=e.i(66083),n=e.i(94607),r=e.i(14189);let i={status:"Status",priority:"Priority",type:"Type",owner:"Owner",assignee:"Assignee",prefix:"Prefix"},l={open:"#10b981",in_progress:"#f59e0b",blocked:"#ef4444",deferred:"#8b5cf6",closed:"#a1a1aa"},a={open:"Open",in_progress:"In Progress",blocked:"Blocked",deferred:"Deferred",closed:"Closed"},o={0:"P0 - Critical",1:"P1 - High",2:"P2 - Medium",3:"P3 - Low",4:"P4 - Backlog"},s={0:"#ef4444",1:"#f97316",2:"#3b82f6",3:"#a1a1aa",4:"#d4d4d8"},c=["#d20f39","#179299","#fe640b","#1e66f5","#40a02b","#8839ef","#df8e1d","#209fb5","#ea76cb","#04a5e5","#e64553","#7287fd","#dd7878","#dc8a78","#862d2d","#bf4040","#d27979","#931f1f","#d22d2d","#e06c6c","#a11212","#e61919","#ed5e5e","#86592d","#bf8040","#d2a679","#93591f","#d2802d","#e0a66c","#a15912","#e68019","#eda65e","#86862d","#bfbf40","#d2d279","#93931f","#d2d22d","#e0e06c","#a1a112","#e6e619","#eded5e","#59862d","#80bf40","#a6d279","#59931f","#80d22d","#a6e06c","#59a112","#80e619","#a6ed5e","#2d862d","#40bf40","#79d279","#1f931f","#2dd22d","#6ce06c","#12a112","#19e619","#5eed5e","#2d8659","#40bf80","#79d2a6","#1f9359","#2dd280","#6ce0a6","#12a159","#19e680","#5eeda6","#2d8686","#40bfbf","#79d2d2","#1f9393","#2dd2d2","#6ce0e0","#12a1a1","#19e6e6","#5eeded","#2d5986","#4080bf","#79a6d2","#1f5993","#2d80d2","#6ca6e0","#1259a1","#1980e6"],d={bug:"🐛",feature:"✨",task:"📝",epic:"🎯",chore:"🔧"},u={epic:"#8839ef",task:"#1e66f5",bug:"#d20f39",feature:"#40a02b",chore:"#acb0be"},h={epic:"Epic",task:"Task",bug:"Bug",feature:"Feature",chore:"Chore"};function p(e){return e.split(/[-_]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function f(e){if(!e)return"#acb0be";let t=0x811c9dc5;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=0x1000193*t>>>0;return c[t%c.length]}let x=new Proxy({},{get:(e,t)=>p(t),has:()=>!0}),m=new Proxy({},{get:(e,t)=>(function(e){let t=0x811c9dc5;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=0x1000193*t>>>0;let n=t%360;return`hsl(${n}, 65%, 55%)`})(t),has:()=>!0});function g(e){let t="object"==typeof e.source?e.source.id:e.source,n="object"==typeof e.target?e.target.id:e.target;return`${t}->${n}:${e.type}`}function k(e,t){if(!e)return{addedNodeIds:new Set(t.graphData.nodes.map(e=>e.id)),removedNodeIds:new Set,changedNodes:new Map,addedLinkKeys:new Set(t.graphData.links.map(g)),removedLinkKeys:new Set,hasChanges:!0};let n=new Map(e.graphData.nodes.map(e=>[e.id,e])),r=new Map(t.graphData.nodes.map(e=>[e.id,e])),i=new Set,l=new Set,a=new Map;for(let[e,t]of r)if(n.has(e)){let r=n.get(e),i=[];r.status!==t.status&&i.push({field:"status",from:r.status,to:t.status}),r.priority!==t.priority&&i.push({field:"priority",from:String(r.priority),to:String(t.priority)}),r.title!==t.title&&i.push({field:"title",from:r.title,to:t.title}),(r.owner||"")!==(t.owner||"")&&i.push({field:"owner",from:r.owner||"",to:t.owner||""}),(r.assignee||"")!==(t.assignee||"")&&i.push({field:"assignee",from:r.assignee||"",to:t.assignee||""}),i.length>0&&a.set(e,i)}else i.add(e);for(let e of n.keys())r.has(e)||l.add(e);let o=new Set(e.graphData.links.map(g)),s=new Set(t.graphData.links.map(g)),c=new Set,d=new Set;for(let e of s)o.has(e)||c.add(e);for(let e of o)s.has(e)||d.add(e);let u=i.size>0||l.size>0||a.size>0||c.size>0||d.size>0;return{addedNodeIds:i,removedNodeIds:l,changedNodes:a,addedLinkKeys:c,removedLinkKeys:d,hasChanges:u}}var b=e.i(40708);function v(e){return function(){return e}}function y(e){return(e()-.5)*1e-6}function w(e){return e.x+e.vx}function j(e){return e.y+e.vy}function z(e){var t,n,r,i=1,l=1;function a(){for(var e,a,s,c,d,u,h,p=t.length,f=0;f<l;++f)for(e=0,a=(0,b.quadtree)(t,w,j).visitAfter(o);e<p;++e)h=(u=n[(s=t[e]).index])*u,c=s.x+s.vx,d=s.y+s.vy,a.visit(x);function x(e,t,n,l,a){var o=e.data,p=e.r,f=u+p;if(o){if(o.index>s.index){var x=c-o.x-o.vx,m=d-o.y-o.vy,g=x*x+m*m;g<f*f&&(0===x&&(g+=(x=y(r))*x),0===m&&(g+=(m=y(r))*m),g=(f-(g=Math.sqrt(g)))/g*i,s.vx+=(x*=g)*(f=(p*=p)/(h+p)),s.vy+=(m*=g)*f,o.vx-=x*(f=1-f),o.vy-=m*f)}return}return t>c+f||l<c-f||n>d+f||a<d-f}}function o(e){if(e.data)return e.r=n[e.data.index];for(var t=e.r=0;t<4;++t)e[t]&&e[t].r>e.r&&(e.r=e[t].r)}function s(){if(t){var r,i,l=t.length;for(r=0,n=Array(l);r<l;++r)n[(i=t[r]).index]=+e(i,r,t)}}return"function"!=typeof e&&(e=v(null==e?1:+e)),a.initialize=function(e,n){t=e,r=n,s()},a.iterations=function(e){return arguments.length?(l=+e,a):l},a.strength=function(e){return arguments.length?(i=+e,a):i},a.radius=function(t){return arguments.length?(e="function"==typeof t?t:v(+t),s(),a):e},a}let N=null;function C(e){let t=e.blockerCount+e.dependentCount;return"epic"===e.issueType&&(t+=3),5+17*Math.min(t/6,1)}let S="status";function M(e){switch(S){case"priority":return s[e.priority]||s[2];case"type":return u[e.issueType]||u.task;case"owner":return f(e.createdBy);case"assignee":return f(e.assignee);case"prefix":return f(e.prefix);default:return l[e.status]||l.open}}function L(e){return 1-(1-e)*(1-e)}let A=new Map;function T(e,t){let n=A.get(e);if("loading"===n||"failed"===n)return null;if(n)return n;A.set(e,"loading");let r=new Image;return r.onload=()=>{A.set(e,r),t()},r.onerror=()=>{A.set(e,"failed")},r.src=e,null}function E(e,t,n,r,i,l,a){e.beginPath(),e.arc(t,n,r,0,2*Math.PI),e.fillStyle=a?"#3f3f46":"#e4e4e7",e.fill();let o=i.replace("@","").charAt(0).toUpperCase(),s=Math.min(7,Math.max(3,1.3*r));e.font=`600 ${s}px 'Inter', system-ui, sans-serif`,e.textAlign="center",e.textBaseline="middle",e.fillStyle="#71717a",e.fillText(o,t,n+.3)}function D(e,t){let n=new Set([e]),r=[{id:e,depth:0}];for(;r.length>0;){let{id:e,depth:i}=r.shift();if(!(i>=2))for(let l of t){let t="object"==typeof l.source?l.source.id:l.source,a="object"==typeof l.target?l.target.id:l.target;t!==e||n.has(a)||(n.add(a),r.push({id:a,depth:i+1})),a!==e||n.has(t)||(n.add(t),r.push({id:t,depth:i+1}))}}return n}function I(e){let t=e.current;if(!t)return;let n=t.zoom();"number"!=typeof n||isNaN(n)||(t.zoom(1.000001*n,0),requestAnimationFrame(()=>{e.current&&e.current.zoom(n,0)}))}let P=()=>"replace",F=()=>"#10b981",R=(0,r.forwardRef)(function({nodes:t,links:c,selectedNode:d,selectedNodeIds:x,onSelectedNodeIdsChange:m,onNodeClick:g,onNodeHover:k,onBackgroundClick:b,onNodeRightClick:y,commentedNodeIds:w,claimedNodeAvatars:j,assigneeNodeAvatars:A,onAvatarHover:R,onAvatarClick:B,timelineActive:$,stats:_,sidebarOpen:W,collapsedEpicIds:H,onCollapseAll:U,onExpandAll:V,colorMode:q="status",onColorModeChange:Y,autoFit:K=!0,onAutoFitToggle:X,pulseNodeId:G,showPulse:J=!0,onShowPulseToggle:Q,showParticles:Z=!0,onShowParticlesToggle:ee,focusedEpicId:et,onExitFocusedEpic:en,isMobile:er,onNodeDoubleTap:ei,activeLegendFilters:el,onToggleLegendFilter:ea,onClearLegendFilters:eo,theme:es},ec){let ed=(0,r.useRef)(null),eu=(0,r.useRef)(null),eh=(0,r.useRef)(null),ep=(0,r.useRef)(0),ef=(0,r.useRef)(()=>{}),[ex,em]=(0,r.useState)({width:800,height:600}),eg=(0,r.useRef)(!1),ek=(0,r.useRef)(new Set),eb=(0,r.useRef)(null),ev=(0,r.useRef)(es),[ey,ew]=(0,r.useState)(null),ej=(0,r.useRef)(null),ez=(0,r.useRef)(null),eN=(0,r.useRef)(null);(0,r.useEffect)(()=>()=>{eN.current&&clearTimeout(eN.current)},[]);let[eC,eS]=(0,r.useState)({w:160,h:120}),eM=eC.w,eL=eC.h,eA=(0,r.useRef)(null),[eT,eE]=(0,r.useState)(N);(0,r.useEffect)(()=>{N||e.A(1878).then(e=>{N=e.default||e,eE(()=>N)})},[]);let[eD,eI]=(0,r.useState)("dag"),[eP,eF]=(0,r.useState)(!0),eR=(0,r.useRef)(d),eB=(0,r.useRef)(null),eO=(0,r.useRef)(new Set),e$=(0,r.useRef)(w||new Map),e_=(0,r.useRef)(j||new Map),eW=(0,r.useRef)(A||new Map),eH=(0,r.useRef)(q),eU=(0,r.useRef)(G||null),eV=(0,r.useRef)(J),eq=(0,r.useRef)(()=>{});eq.current=()=>I(ed);let eY=(0,r.useRef)(R);eY.current=R;let eK=(0,r.useRef)(B);(0,r.useEffect)(()=>{eK.current=B},[B]);let eX=(0,r.useRef)(m);(0,r.useEffect)(()=>{eX.current=m},[m]);let eG=(0,r.useRef)(null),eJ=(0,r.useRef)(0),eQ=(0,r.useRef)({x:0,y:0}),eZ=(0,r.useRef)(t),e0=(0,r.useRef)(null),e1=(0,r.useRef)(null),e5=(0,r.useRef)([]),{viewNodes:e2,viewLinks:e4,preFilterNodes:e3}=(0,r.useMemo)(()=>{let e=t,n=c;if(et){let t=new Map;for(let e of n){let n="object"==typeof e.source?e.source.id:e.source,r="object"==typeof e.target?e.target.id:e.target;"parent-child"===e.type&&t.set(r,n)}let r=new Set(e.map(e=>e.id));for(let n of e)if(!t.has(n.id)&&n.id.includes(".")){let e=n.id.split(".")[0];r.has(e)&&t.set(n.id,e)}let i=new Set;for(let[e,n]of(i.add(et),t))n===et&&i.add(e);for(let e of n){let t="object"==typeof e.source?e.source.id:e.source,n="object"==typeof e.target?e.target.id:e.target;"parent-child"!==e.type&&(i.has(t)&&r.has(n)&&i.add(n),i.has(n)&&r.has(t)&&i.add(t))}e=e.filter(e=>i.has(e.id)),n=n.filter(e=>{let t="object"==typeof e.source?e.source.id:e.source,n="object"==typeof e.target?e.target.id:e.target;return i.has(t)&&i.has(n)})}if(H&&H.size>0){let t=new Map;for(let e of n){let n="object"==typeof e.source?e.source.id:e.source,r="object"==typeof e.target?e.target.id:e.target;"parent-child"===e.type&&t.set(r,n)}let r=new Set(e.map(e=>e.id));for(let n of e)if(!t.has(n.id)&&n.id.includes(".")){let e=n.id.split(".")[0];r.has(e)&&t.set(n.id,e)}let i=new Set;for(let[e,n]of t)H.has(n)&&i.add(e);if(i.size>0){let r=new Map;for(let e of i)r.set(e,t.get(e));let l=new Map,a=new Map,o=new Map;for(let[t,n]of r){l.set(n,(l.get(n)||0)+1);let r=e.find(e=>e.id===t);r&&(a.set(n,(a.get(n)||0)+r.blockerCount),o.set(n,(o.get(n)||0)+r.dependentCount))}let s=e.filter(e=>!i.has(e.id)).map(e=>({...e,blockerCount:e.blockerCount+(a.get(e.id)||0),dependentCount:e.dependentCount+(o.get(e.id)||0),collapsedCount:l.get(e.id)||0})),c=[],d=new Set;for(let e of n){let t="object"==typeof e.source?e.source.id:e.source,n="object"==typeof e.target?e.target.id:e.target;if("parent-child"===e.type&&i.has(n)||(t=r.get(t)||t)===(n=r.get(n)||n))continue;let l=`${t}->${n}:${e.type}`;d.has(l)||(d.add(l),c.push({source:t,target:n,type:e.type}))}e=s,n=c}}let r=[...e];if(el&&el.size>0){let t=new Set(e.filter(e=>{switch(q){case"status":return el.has(e.status);case"priority":return el.has(String(e.priority));case"type":return el.has(e.issueType);case"owner":return el.has(e.createdBy||"Unassigned");case"assignee":return el.has(e.assignee||"Unassigned");case"prefix":return el.has(p(e.prefix));default:return!0}}).map(e=>e.id));e=e.filter(e=>t.has(e.id)),n=n.filter(e=>{let n="object"==typeof e.source?e.source.id:e.source,r="object"==typeof e.target?e.target.id:e.target;return t.has(n)&&t.has(r)})}return{viewNodes:e,viewLinks:n,preFilterNodes:r}},[t,c,H,et,el,q]);eZ.current=e2;let e6=(0,r.useMemo)(()=>_&&el&&0!==el.size?{total:e2.length,edges:e4.length,prefixes:[...new Set(e2.map(e=>e.prefix))]}:_,[_,el,e2,e4]);(0,r.useEffect)(()=>{let e=new Map;for(let t of c){let n="object"==typeof t.source?t.source.id:t.source,r="object"==typeof t.target?t.target.id:t.target;"parent-child"===t.type&&e.set(r,n)}let n=new Set(t.map(e=>e.id));for(let r of t)if(!e.has(r.id)&&r.id.includes(".")){let t=r.id.split(".")[0];n.has(t)&&e.set(r.id,t)}let r=new Map;for(let[t,n]of e){let e=r.get(n)||[];e.push(t),r.set(n,e)}let i=new Map(t.map(e=>[e.id,e])),l=[];for(let[e,t]of r){let n=i.get(e);n&&l.push({parentId:e,title:n.title||e,prefix:n.prefix,memberIds:[e,...t]})}e5.current=l},[t,c]);let e8=(0,r.useMemo)(()=>{if("status"===q||"priority"===q||"type"===q)return[];let e=new Map;for(let t of e3)switch(q){case"owner":{let n=t.createdBy||void 0;e.set(n||"Unassigned",f(n));break}case"assignee":{let n=t.assignee||void 0;e.set(n||"Unassigned",f(n));break}case"prefix":e.set(p(t.prefix),f(t.prefix))}return Array.from(e.entries()).sort(([e],[t])=>"Unassigned"===e?1:"Unassigned"===t?-1:e.localeCompare(t)).map(([e,t])=>({label:e,color:t}))},[q,e3]),e7=(0,r.useRef)(e4);(0,r.useEffect)(()=>{e7.current=e4},[e4]),(0,r.useEffect)(()=>{eR.current=d;let e=eB.current||d;e?eO.current=D(e.id,e4):eO.current=new Set,I(ed),cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current())},[d,e4]),(0,r.useEffect)(()=>{ek.current=x||new Set,I(ed),cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current())},[x]),(0,r.useEffect)(()=>{e$.current=w||new Map,I(ed)},[w]),(0,r.useEffect)(()=>{e_.current=j||new Map,I(ed)},[j]),(0,r.useEffect)(()=>{eW.current=A||new Map,I(ed)},[A]),(0,r.useEffect)(()=>{eH.current=q,S=q,I(ed),ep.current=requestAnimationFrame(()=>ef.current())},[q]),(0,r.useEffect)(()=>{eU.current=G||null,eV.current=J,I(ed)},[G,J]),(0,r.useEffect)(()=>{ev.current=es,I(ed),ep.current=requestAnimationFrame(()=>ef.current())},[es]),(0,r.useEffect)(()=>{ej.current=ey},[ey]),(0,r.useEffect)(()=>{if(!ey)return;let e=e=>{let t=ej.current;if(!t)return;let n=e.clientX-t.startX,r=e.clientY-t.startY,i=t.active||Math.abs(n)>5||Math.abs(r)>5;ew(t=>t?{...t,currentX:e.clientX,currentY:e.clientY,active:i}:null)},t=e=>{let t=ej.current;if(!t)return void ew(null);if(t.active){let n=ed.current;if(n){let r=eu.current?.getBoundingClientRect();if(r){let i=n.screen2GraphCoords(Math.min(t.startX,e.clientX)-r.left,Math.min(t.startY,e.clientY)-r.top),l=n.screen2GraphCoords(Math.max(t.startX,e.clientX)-r.left,Math.max(t.startY,e.clientY)-r.top),a=new Set;for(let e of eZ.current)null!=e.x&&null!=e.y&&e.x>=i.x&&e.x<=l.x&&e.y>=i.y&&e.y<=l.y&&a.add(e.id);a.size>0&&eX.current?.(a)}}}ew(null)};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t)}},[!!ey]),(0,r.useEffect)(()=>{let e=eu.current;if(!e)return;let t=t=>{let n;eQ.current={x:t.clientX,y:t.clientY};let r=ed.current,i=eY.current;if(!r||!i)return;let l=e_.current;if(0===l.size&&0===eW.current.size){eG.current&&(eG.current=null,i(null));return}let a=e.getBoundingClientRect(),o=t.clientX-a.left,s=t.clientY-a.top;try{n=r.screen2GraphCoords(o,s)}catch{return}let c=Math.max(4,10/(r.zoom()||1));for(let r of eZ.current){if(null==r.x||null==r.y)continue;let a=l.get(r.id);if(!a)continue;let o=C(r),s=r.x+.7*o,d=r.y+.7*o,u=n.x-s,h=n.y-d;if(u*u+h*h<=c*c){eG.current!==r.id&&(eG.current=r.id,i({handle:a.handle,avatar:a.avatar,claimedAt:a.claimedAt,did:a.did,x:t.clientX,y:t.clientY,nodeId:r.id,nodeClosed:"closed"===r.status})),e.style.cursor="pointer";return}}let d=eW.current;if(d.size>0)for(let r of eZ.current){if(null==r.x||null==r.y||l.get(r.id))continue;let a=d.get(r.id);if(!a)continue;let o=C(r),s=r.x+.7*o,u=r.y+.7*o,h=n.x-s,p=n.y-u;if(h*h+p*p<=c*c){eG.current!==r.id&&(eG.current=r.id,i({handle:a.handle,avatar:a.avatar,claimedAt:a.updatedAt,did:void 0,x:t.clientX,y:t.clientY,isAssignee:!0,nodeId:r.id,nodeClosed:"closed"===r.status})),e.style.cursor="pointer";return}}eG.current&&(eG.current=null,i(null)),e.style.cursor=""},n=t=>{let n=ed.current,r=eK.current;if(!n||!r)return;let i=e_.current,l=eW.current;if((!i||0===i.size)&&(!l||0===l.size))return;let a=e.getBoundingClientRect(),o=t.clientX-a.left,s=t.clientY-a.top,{x:c,y:d}=n.screen2GraphCoords(o,s),u=Math.max(4,10/(n.zoom()||1));if(i)for(let e of eZ.current){if(null==e.x||null==e.y)continue;let n=i.get(e.id);if(!n)continue;let l=C(e),a=e.x+.7*l,o=e.y+.7*l,s=c-a,h=d-o;if(s*s+h*h<=u*u){t.stopPropagation(),eJ.current=Date.now(),r({handle:n.handle,avatar:n.avatar,did:n.did,nodeId:e.id});return}}if(l)for(let e of eZ.current){if(null==e.x||null==e.y||i?.has(e.id))continue;let n=l.get(e.id);if(!n)continue;let a=C(e),o=e.x+.7*a,s=e.y+.7*a,h=c-o,p=d-s;if(h*h+p*p<=u*u){t.stopPropagation(),eJ.current=Date.now(),r({handle:n.handle,avatar:n.avatar,did:void 0,nodeId:e.id,isAssignee:!0});return}}};return e.addEventListener("mousemove",t),e.addEventListener("click",n),()=>{e.removeEventListener("mousemove",t),e.removeEventListener("click",n)}},[]),(0,r.useEffect)(()=>{let e=()=>{if(eu.current){let e=eu.current.getBoundingClientRect();em({width:e.width,height:e.height})}};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&ek.current.size>0&&eX.current?.(new Set)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);let e9=(0,r.useCallback)(e=>{let t=ed.current;if(!t)return;let n=e2.find(t=>t.id===e.id);n&&void 0!==n.x&&void 0!==n.y&&(t.centerAt(n.x,n.y,500),t.zoom(2.5,500),g(e))},[g,e2]),te=(0,r.useCallback)(e=>{let t=ed.current;if(!t)return;let n=e2.find(t=>t.id===e);n&&void 0!==n.x&&void 0!==n.y&&(t.centerAt(n.x,n.y,500),t.zoom(2.5,500))},[e2]);(0,r.useImperativeHandle)(ec,()=>({focusNode:e9,zoomToNode:te}),[e9,te]);let tt=(0,r.useCallback)(e=>{let t=e||null;eB.current=t;let n=t||eR.current;n?eO.current=D(n.id,e7.current):eO.current=new Set,I(ed),cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current()),k(t,eQ.current.x,eQ.current.y)},[k]),tn=(0,r.useCallback)((e,t)=>{t.preventDefault(),y?.(e,t)},[y]);(0,r.useEffect)(()=>{let e,t=ed.current;if(!t||0===e2.length)return;let n=()=>{t.d3Force("radial",null),t.d3Force("x",null),t.d3Force("y",null)},r=()=>{e2.forEach(e=>{delete e.fx,delete e.fy})};if("dag"===eD)n(),t.d3Force("charge")?.strength(-250).distanceMax(500),t.d3Force("link")?.distance(120).strength(.3),t.d3Force("center")?.strength(.015),t.d3Force("collision",z().radius(e=>C(e)+8).strength(.8));else if("radial"===eD){n(),r();let e=new Map;for(let t of e4){if("parent-child"===t.type)continue;let n="object"==typeof t.target?t.target.id:t.target,r="object"==typeof t.source?t.source.id:t.source;e.has(n)||e.set(n,[]),e.get(n).push(r)}let i=new Map,l=[];e2.forEach(t=>{e.has(t.id)||(i.set(t.id,0),l.push(t.id))});let a=0;for(;a<l.length;){let e=l[a++],t=i.get(e);for(let n of e4){if("parent-child"===n.type)continue;let r="object"==typeof n.source?n.source.id:n.source,a="object"==typeof n.target?n.target.id:n.target;r!==e||i.has(a)||(i.set(a,t+1),l.push(a))}}e2.forEach(e=>{e._depth=i.get(e.id)??0}),Array.from(i.values());let o=Math.max(200,4*e2.length);t.d3Force("charge")?.strength(-300).distanceMax(800),t.d3Force("link")?.distance(150).strength(.15),t.d3Force("center")?.strength(0),t.d3Force("radial",(function(e,t,n){var r,i,l,a=v(.1);function o(e){for(var a=0,o=r.length;a<o;++a){var s=r[a],c=s.x-t||1e-6,d=s.y-n||1e-6,u=Math.sqrt(c*c+d*d),h=(l[a]-u)*i[a]*e/u;s.vx+=c*h,s.vy+=d*h}}function s(){if(r){var t,n=r.length;for(t=0,i=Array(n),l=Array(n);t<n;++t)l[t]=+e(r[t],t,r),i[t]=isNaN(l[t])?0:+a(r[t],t,r)}}return"function"!=typeof e&&(e=v(+e)),null==t&&(t=0),null==n&&(n=0),o.initialize=function(e){r=e,s()},o.strength=function(e){return arguments.length?(a="function"==typeof e?e:v(+e),s(),o):a},o.radius=function(t){return arguments.length?(e="function"==typeof t?t:v(+t),s(),o):e},o.x=function(e){return arguments.length?(t=+e,o):t},o.y=function(e){return arguments.length?(n=+e,o):n},o})(e=>(e._depth||0)*o,0,0).strength(.8)),t.d3Force("x",null),t.d3Force("y",null),t.d3Force("collision",z().radius(e=>C(e)+10).strength(.9))}else if("cluster"===eD){n(),r();let e=[...new Set(e2.map(e=>e.prefix))],i=Math.max(400,5*e2.length,150*e.length),l=new Map;e.forEach((t,n)=>{let r=2*Math.PI*n/e.length-Math.PI/2;l.set(t,{x:Math.cos(r)*i,y:Math.sin(r)*i})}),t.d3Force("charge")?.strength(-200).distanceMax(600),t.d3Force("link")?.distance(100).strength(.15),t.d3Force("center")?.strength(0),t.d3Force("x",(function(e){var t,n,r,i=v(.1);function l(e){for(var i,l=0,a=t.length;l<a;++l)i=t[l],i.vx+=(r[l]-i.x)*n[l]*e}function a(){if(t){var l,a=t.length;for(l=0,n=Array(a),r=Array(a);l<a;++l)n[l]=isNaN(r[l]=+e(t[l],l,t))?0:+i(t[l],l,t)}}return"function"!=typeof e&&(e=v(null==e?0:+e)),l.initialize=function(e){t=e,a()},l.strength=function(e){return arguments.length?(i="function"==typeof e?e:v(+e),a(),l):i},l.x=function(t){return arguments.length?(e="function"==typeof t?t:v(+t),a(),l):e},l})(e=>l.get(e.prefix)?.x||0).strength(.5)),t.d3Force("y",(function(e){var t,n,r,i=v(.1);function l(e){for(var i,l=0,a=t.length;l<a;++l)i=t[l],i.vy+=(r[l]-i.y)*n[l]*e}function a(){if(t){var l,a=t.length;for(l=0,n=Array(a),r=Array(a);l<a;++l)n[l]=isNaN(r[l]=+e(t[l],l,t))?0:+i(t[l],l,t)}}return"function"!=typeof e&&(e=v(null==e?0:+e)),l.initialize=function(e){t=e,a()},l.strength=function(e){return arguments.length?(i="function"==typeof e?e:v(+e),a(),l):i},l.y=function(t){return arguments.length?(e="function"==typeof t?t:v(+t),a(),l):e},l})(e=>l.get(e.prefix)?.y||0).strength(.5)),t.d3Force("collision",z().radius(e=>C(e)+10).strength(.9))}else"spread"===eD?(n(),r(),t.d3Force("charge")?.strength(-300).distanceMax(500),t.d3Force("link")?.distance(180).strength(.4),t.d3Force("center")?.strength(.02),t.d3Force("collision",z().radius(e=>C(e)+8).strength(.8))):(n(),r(),t.d3Force("charge")?.strength(-180).distanceMax(400),t.d3Force("link")?.distance(e=>((e.source?.blockerCount||0)+(e.source?.dependentCount||0)+((e.target?.blockerCount||0)+(e.target?.dependentCount||0)))/2>4?90:120).strength(.6),t.d3Force("center")?.strength(.03),t.d3Force("collision",z().radius(e=>C(e)+6).strength(.7)));return t.d3ReheatSimulation(),K&&(e=setTimeout(()=>{ed.current&&ed.current.zoomToFit(400,60)},eg.current?600:1e3)),eg.current=!0,()=>{e&&clearTimeout(e)}},[eD,e2,e4,K]);let tr=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(tr.current||!eT||0===t.length)return;tr.current=!0;let e=setTimeout(()=>{eI("force")},15);return()=>clearTimeout(e)},[eT,t.length]),(0,r.useEffect)(()=>{if(!$&&K&&ed.current&&t.length>0){let e=setTimeout(()=>{ed.current.zoomToFit(400,60)},800);return()=>clearTimeout(e)}},[t.length,$,K]);let ti=(0,r.useRef)(void 0);(0,r.useEffect)(()=>{if(void 0===ti.current){ti.current=et??null;return}ti.current=et??null;let e=ed.current;if(!e)return;let t=setTimeout(()=>{e.zoomToFit(400,60)},100);return()=>clearTimeout(t)},[et]);let tl=(0,r.useMemo)(()=>{let e=Math.sqrt(e2.length)||1;return e2.forEach((t,n)=>{if(null==t.x&&null==t.y){let r=n*Math.PI*(3-Math.sqrt(5)),i=300*Math.sqrt(.5+n)/e;t.x=i*Math.cos(r),t.y=i*Math.sin(r)}}),{nodes:e2,links:e4}},[e2,e4]),ta=()=>"dark"===ev.current,to=(0,r.useCallback)((e,t,n)=>{let r=C(e),i=M(e),a=f(e.prefix),o=eR.current?.id===e.id,s=eB.current?.id===e.id,c=ek.current.has(e.id),d=eO.current,u=d.has(e.id),h=d.size>0,p=Date.now(),x=1,m=e._spawnTime;if(m){var g;let e=p-m;e<500&&(x=1+2.70158*Math.pow((g=e/500)-1,3)+1.70158*Math.pow(g-1,2))}let k=1,b=1,v=e._removeTime;if(v){let e=p-v;if(e<400){let t=e/400;k=1-L(t),b=1-t}else k=0,b=0}let y=x*k;if(y<=.01)return;let w=r*y,j=(ek.current.size>0&&!c?.25:h&&!u?.15:"closed"===e.status?.5:1)*b;if(j<=.01)return;t.save(),t.globalAlpha=j,(u&&h||c)&&(t.shadowColor="#10b981",t.shadowBlur=o?20:c?14:s?16:10),n>.3&&(t.beginPath(),t.arc(e.x,e.y,w+2,0,2*Math.PI),t.strokeStyle=a,t.lineWidth=2,t.stroke()),t.beginPath(),t.arc(e.x,e.y,w,0,2*Math.PI),t.fillStyle=i,t.fill(),t.strokeStyle=o?"#10b981":c?"#34d399":s?"#3f3f46":"#e4e4e7",t.lineWidth=o?2.5:c||s?2:1,t.stroke(),t.shadowBlur=0;let z=e._changedAt;if(z){let n=p-z;if(n<800){let r=n/800,i=l[e.status]||"#a1a1aa";t.beginPath(),t.arc(e.x,e.y,w+4+20*r,0,2*Math.PI),t.strokeStyle=i,t.lineWidth=2*(1-r),t.globalAlpha=(1-r)*.6,t.stroke(),t.globalAlpha=j}}if(eV.current&&eU.current===e.id){let r=w+Math.max(25,30/n);for(let i=0;i<3;i++){let l=(p+500*i)%2e3/2e3,a=w+2/n+l*(r-w),o=(1-l)*.6;t.beginPath(),t.arc(e.x,e.y,a,0,2*Math.PI),t.strokeStyle="#10b981",t.lineWidth=Math.max(1.5/n,.5),t.globalAlpha=o*j,t.stroke()}t.globalAlpha=j}if(m){let n=p-m;if(n<500){let r=n/500;t.beginPath(),t.arc(e.x,e.y,w+6+8*r,0,2*Math.PI),t.strokeStyle="#10b981",t.lineWidth=3*(1-r),t.globalAlpha=(1-r)*.4,t.stroke(),t.globalAlpha=j}}if(e.priority<=1&&n>.5){let r=Math.min(10,Math.max(4,12/n));t.font=`${r}px sans-serif`,t.textAlign="center",t.textBaseline="bottom",t.fillText(0===e.priority?"🔥🔥":"🔥",e.x,e.y-w-2)}if(n>.5){let r=Math.min(7,Math.max(3,10/n));t.font=`500 ${r}px 'Inter', system-ui, sans-serif`,t.textAlign="center",t.textBaseline="top",t.fillStyle=ta()?"#d4d4d8":"#3f3f46",t.globalAlpha=.85*j;let i=e.id;n>1.5?i=O(e.title||e.id,30):n>.9&&(i=O(e.title||e.id,18)),t.fillText(i,e.x,e.y+w+3);let l=e.collapsedCount;if(l&&l>0){let i=Math.min(5.5,Math.max(2.5,8/n));t.font=`400 ${i}px 'Inter', system-ui, sans-serif`,t.fillStyle=ta()?"#71717a":"#a1a1aa",t.fillText(`${l} task${1!==l?"s":""}`,e.x,e.y+w+3+r+1)}}let N=e$.current.get(e.id);if(N&&N>0&&n>.4){let r=Math.min(6,Math.max(3.5,8/n)),i=e.x+.75*w,l=e.y-.75*w,a=N>99?"99+":String(N);t.save(),t.globalAlpha=Math.min(j,.95),t.beginPath(),t.arc(i,l,r,0,2*Math.PI),t.fillStyle="#ef4444",t.fill(),t.strokeStyle=ta()?"#18181b":"#ffffff",t.lineWidth=Math.max(.8,1.2/n),t.stroke();let o=Math.min(7,Math.max(3,1.3*r));t.font=`600 ${o}px 'Inter', system-ui, sans-serif`,t.textAlign="center",t.textBaseline="middle",t.fillStyle="#ffffff",t.fillText(a,i,l+.3),t.restore()}let S=e_.current.get(e.id);if(S){let r=Math.max(4,10/n),i=e.x+.7*w,l=e.y+.7*w;if(t.save(),t.globalAlpha=1,S.avatar){let e=T(S.avatar,()=>eq.current());e?(t.save(),t.beginPath(),t.arc(i,l,r,0,2*Math.PI),t.clip(),t.drawImage(e,i-r,l-r,2*r,2*r),t.restore()):E(t,i,l,r,S.handle,n,ta())}else E(t,i,l,r,S.handle,n,ta());t.beginPath(),t.arc(i,l,r,0,2*Math.PI),t.strokeStyle=ta()?"#18181b":"#ffffff",t.lineWidth=Math.max(.8,1.2/n),t.stroke(),t.restore()}if(!S){let r=eW.current.get(e.id);if(r){let i=Math.max(4,10/n),l=e.x+.7*w,a=e.y+.7*w;if(t.save(),t.globalAlpha=1,r.avatar){let e=T(r.avatar,()=>eq.current());e?(t.save(),t.beginPath(),t.arc(l,a,i,0,2*Math.PI),t.clip(),t.drawImage(e,l-i,a-i,2*i,2*i),t.restore()):E(t,l,a,i,r.handle,n,ta())}else E(t,l,a,i,r.handle,n,ta());t.beginPath(),t.arc(l,a,i,0,2*Math.PI),t.strokeStyle=ta()?"#18181b":"#ffffff",t.lineWidth=Math.max(.8,1.2/n),t.stroke(),t.restore()}}t.restore()},[]),ts=(0,r.useCallback)((e,t,n)=>{let r=e.source,i=e.target;if(void 0===r.x||void 0===i.x)return;let l=Date.now(),a=1,o=1,s=e._spawnTime;if(s){let e=l-s;if(e<500){let t=e/500;a=L(t),o=1+(1-t)*1.5}}let c=1,d=e._removeTime;if(d){let e=l-d;if(!(e<400))return;c=1-L(e/400)}let u=a*c;if(u<=.01)return;let h=r.id||e.source,p=i.id||e.target,f="parent-child"===e.type,x=eO.current,m=x.size>0,g=m&&x.has(h)&&x.has(p),k=(f?m?g?.5:.05:.2:m?g?.8:.08:.35)*u;if(k<=.01)return;t.save(),t.globalAlpha=k,f?(t.strokeStyle=g?ta()?"#a1a1aa":"#71717a":(ta(),"#a1a1aa"),t.lineWidth=Math.max(.6,1.5/n)*o,t.setLineDash([4,3])):(t.strokeStyle=g?"#10b981":ta()?"#a1a1aa":"#d4d4d8",t.lineWidth=(g?Math.max(2,2.5/n):Math.max(.8,1.2/n))*o);let b=i.x-r.x,v=i.y-r.y,y=Math.sqrt(b*b+v*v),w=(r.x+i.x)/2+.15*v,j=(r.y+i.y)/2-.15*b;if(t.beginPath(),t.moveTo(r.x,r.y),t.quadraticCurveTo(w,j,i.x,i.y),t.stroke(),f&&t.setLineDash([]),s){let e=l-s;e<300&&(t.save(),t.globalAlpha=(1-e/300)*.5,t.strokeStyle="#10b981",t.lineWidth=(f?3:4)/n,t.beginPath(),t.moveTo(r.x,r.y),t.quadraticCurveTo(w,j,i.x,i.y),t.stroke(),t.restore())}if(!f){let e=C(i);if(y<e+1)return void t.restore();let l=Math.min(8,6/n),a=1-e/y,o=r.x+a*b,s=r.y+a*v,c=Math.atan2(v,b);t.fillStyle=g?"#10b981":ta()?"#a1a1aa":"#d4d4d8",t.beginPath(),t.moveTo(o,s),t.lineTo(o-l*Math.cos(c-Math.PI/7),s-l*Math.sin(c-Math.PI/7)),t.lineTo(o-l*Math.cos(c+Math.PI/7),s-l*Math.sin(c+Math.PI/7)),t.closePath(),t.fill()}t.restore()},[]),tc=(0,r.useCallback)((e,t)=>{if(!eP)return;let n=t>=.8?0:t<=.4?1:(.8-t)/.4;if(n<=.01)return;let r=e5.current;if(0===r.length)return;let i=new Map;for(let e of e2)null!=e.x&&null!=e.y&&i.set(e.id,{x:e.x,y:e.y});for(let l of(e.save(),r)){let r=0,a=0,o=0;for(let e of l.memberIds){let t=i.get(e);t&&(r+=t.x,a+=t.y,o++)}if(0===o)continue;let s=r/o,c=a/o,d=0;for(let e of l.memberIds){let t=i.get(e);if(t){let e=t.x-s,n=t.y-c,r=Math.sqrt(e*e+n*n);r>d&&(d=r)}}let u=d+30,h=f(l.prefix);e.beginPath(),e.arc(s,c,u,0,2*Math.PI),e.globalAlpha=.05*n,e.fillStyle=h,e.fill(),e.globalAlpha=.25*n,e.strokeStyle=h,e.lineWidth=1.5/t,e.setLineDash([8/t,4/t]),e.stroke(),e.setLineDash([]);let p=Math.min(24,Math.max(10,14/t)),x=Math.min(12,Math.max(5,8/t)),m=.35*p;e.font=`500 ${x}px 'Inter', system-ui, sans-serif`,e.textAlign="center",e.textBaseline="middle",e.globalAlpha=.45*n,e.fillStyle=ta()?"#a1a1aa":"#71717a",e.fillText(l.parentId,s,c-.5*p-m),e.font=`600 ${p}px 'Inter', system-ui, sans-serif`,e.globalAlpha=.85*n,e.fillStyle=ta()?"#d4d4d8":"#18181b";let g=l.title.length>40?l.title.slice(0,39)+"…":l.title;e.fillText(g,s,c+.15*p);let k=Math.min(14,Math.max(6,9/t));e.font=`400 ${k}px 'Inter', system-ui, sans-serif`,e.globalAlpha=.5*n,e.fillStyle="#71717a",e.fillText(`${l.memberIds.length} issue${1!==l.memberIds.length?"s":""}`,s,c+.15*p+.7*p)}e.restore()},[e2,t,eP]),td=(0,r.useCallback)((e,t,n)=>{let r=C(e)+5;n.fillStyle=t,n.beginPath(),n.arc(e.x,e.y,r,0,2*Math.PI),n.fill()},[]),tu=(0,r.useCallback)(()=>{},[]),th=(0,r.useCallback)(()=>{let e=eh.current,t=ed.current;if(!e||!t)return;let n=e.getContext("2d");if(!n)return;let r=1/0,i=-1/0,l=1/0,a=-1/0,o=!1;for(let e of e2)null!=e.x&&null!=e.y&&(o=!0,e.x<r&&(r=e.x),e.x>i&&(i=e.x),e.y<l&&(l=e.y),e.y>a&&(a=e.y));if(!o)return;let s=(i+=40)-(r-=40)||1,c=(a+=40)-(l-=40)||1,d=eM-16,u=eL-16,h=Math.min(d/s,u/c),f=8+(d-s*h)/2,x=8+(u-c*h)/2,m=window.devicePixelRatio||1;(e.width!==eM*m||e.height!==eL*m)&&(e.width=eM*m,e.height=eL*m,n.setTransform(m,0,0,m,0,0)),n.clearRect(0,0,eM,eL),n.fillStyle=ta()?"rgba(24, 24, 27, 0.92)":"rgba(250, 250, 250, 0.92)",n.beginPath(),n.roundRect(0,0,eM,eL,6),n.fill();let g=eO.current,k=g.size>0,b=eB.current?.id||eR.current?.id||null,v=eb.current,y=null!==v;for(let e of e4){let t=e.source,i=e.target;if(null==t.x||null==i.x)continue;let a=t.id||e.source,o=i.id||e.target,s=k&&g.has(a)&&g.has(o);n.globalAlpha=y?.03:k?s?.5:.04:.1,n.strokeStyle=s?"#10b981":ta()?"#71717a":"#a1a1aa",n.lineWidth=s?1:.5;let c=f+(t.x-r)*h,d=x+(t.y-l)*h,u=f+(i.x-r)*h,p=x+(i.y-l)*h;n.beginPath(),n.moveTo(c,d),n.lineTo(u,p),n.stroke()}for(let e of(n.globalAlpha=1,e2)){if(null==e.x||null==e.y)continue;let t=f+(e.x-r)*h,i=x+(e.y-l)*h,a=e.id===b,o=g.has(e.id),s=!0;if(y)switch(S){case"status":s=e.status===v;break;case"priority":s=String(e.priority)===v;break;case"type":s=e.issueType===v;break;case"owner":s=(e.createdBy||"Unassigned")===v;break;case"assignee":s=(e.assignee||"Unassigned")===v;break;case"prefix":s=p(e.prefix)===v}y&&!s?n.globalAlpha=.08:y&&s?n.globalAlpha=1:k&&!o?n.globalAlpha=.1:"closed"===e.status?n.globalAlpha=.35:n.globalAlpha=.85,n.fillStyle=M(e);let c="epic"===e.issueType?3:2;if(y&&s?c+=1:a?c=5:k&&o&&(c=4),a){let r=n.globalAlpha;n.globalAlpha=.4,n.fillStyle="#10b981",n.beginPath(),n.arc(t,i,c+2,0,2*Math.PI),n.fill(),n.globalAlpha=r,n.fillStyle=M(e)}n.fillRect(t-c/2,i-c/2,c,c)}n.globalAlpha=1;let w=e_.current;if(w.size>0)for(let e of e2){if(null==e.x||null==e.y)continue;let t=w.get(e.id);if(!t)continue;let i=f+(e.x-r)*h,a=x+(e.y-l)*h;if(n.save(),n.globalAlpha=1,t.avatar){let e=T(t.avatar,()=>eq.current());e?(n.save(),n.beginPath(),n.arc(i,a,5,0,2*Math.PI),n.clip(),n.drawImage(e,i-5,a-5,10,10),n.restore()):(n.beginPath(),n.arc(i,a,5,0,2*Math.PI),n.fillStyle=ta()?"#52525b":"#d4d4d8",n.fill())}else n.beginPath(),n.arc(i,a,5,0,2*Math.PI),n.fillStyle=ta()?"#52525b":"#d4d4d8",n.fill();n.beginPath(),n.arc(i,a,5,0,2*Math.PI),n.strokeStyle=ta()?"#18181b":"#ffffff",n.lineWidth=1,n.stroke(),n.restore()}let j=eW.current;if(j.size>0)for(let e of e2){if(null==e.x||null==e.y||w.get(e.id))continue;let t=j.get(e.id);if(!t)continue;let i=f+(e.x-r)*h,a=x+(e.y-l)*h;if(n.save(),n.globalAlpha=1,t.avatar){let e=T(t.avatar,()=>eq.current());e?(n.save(),n.beginPath(),n.arc(i,a,5,0,2*Math.PI),n.clip(),n.drawImage(e,i-5,a-5,10,10),n.restore()):(n.beginPath(),n.arc(i,a,5,0,2*Math.PI),n.fillStyle=ta()?"#52525b":"#d4d4d8",n.fill())}else n.beginPath(),n.arc(i,a,5,0,2*Math.PI),n.fillStyle=ta()?"#52525b":"#d4d4d8",n.fill();n.beginPath(),n.arc(i,a,5,0,2*Math.PI),n.strokeStyle=ta()?"#18181b":"#ffffff",n.lineWidth=1,n.stroke(),n.restore()}try{let e=t.screen2GraphCoords(0,0),i=t.screen2GraphCoords(ex.width,ex.height),a=f+(e.x-r)*h,o=x+(e.y-l)*h,s=(i.x-e.x)*h,c=(i.y-e.y)*h,d=Math.max(0,a),u=Math.max(0,o),p=Math.min(eM-d,s-(d-a)),m=Math.min(eL-u,c-(u-o));p>0&&m>0&&(n.fillStyle="rgba(16, 185, 129, 0.06)",n.fillRect(d,u,p,m),n.strokeStyle="rgba(16, 185, 129, 0.5)",n.lineWidth=1.5,n.strokeRect(d,u,p,m))}catch{}},[e2,e4,ex,eM,eL,8]);ef.current=th;let tp=(0,r.useCallback)(()=>{cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>{th()})},[th]);(0,r.useEffect)(()=>{if(!eT||0===t.length)return;let e=setInterval(()=>{th()},200);return()=>clearInterval(e)},[eT,t.length,th]),(0,r.useEffect)(()=>{let e,t=!0,n=!1,r=Date.now();return(e2.some(e=>e._spawnTime&&r-e._spawnTime<500||e._removeTime&&r-e._removeTime<400||e._changedAt&&r-e._changedAt<800)||e4.some(e=>e._spawnTime&&r-e._spawnTime<500||e._removeTime&&r-e._removeTime<400))&&!n&&(n=!0,e=requestAnimationFrame(function r(){if(!t)return;let i=Date.now();e2.some(e=>!!e._spawnTime&&!!(i-e._spawnTime<500)||!!e._removeTime&&!!(i-e._removeTime<400)||!!e._changedAt&&!!(i-e._changedAt<800))||e4.some(e=>!!e._spawnTime&&!!(i-e._spawnTime<500)||!!e._removeTime&&!!(i-e._removeTime<400))?(I(ed),e=requestAnimationFrame(r)):n=!1})),()=>{t=!1,cancelAnimationFrame(e)}},[e2,e4]);let tf=(0,r.useCallback)(e=>{let t=ed.current;if(!t)return;let n=e.currentTarget.getBoundingClientRect(),r=e.clientX-n.left,i=e.clientY-n.top,l=1/0,a=-1/0,o=1/0,s=-1/0;for(let e of e2)null!=e.x&&null!=e.y&&(e.x<l&&(l=e.x),e.x>a&&(a=e.x),e.y<o&&(o=e.y),e.y>s&&(s=e.y));let c=(a+=40)-(l-=40)||1,d=(s+=40)-(o-=40)||1,u=eM-16,h=eL-16,p=Math.min(u/c,h/d),f=l+(r-(8+(u-c*p)/2))/p,x=o+(i-(8+(h-d*p)/2))/p;t.centerAt(f,x,300)},[e2,eM,eL,8]),tx=(0,r.useCallback)((e,t)=>{if(Date.now()-eJ.current<200)return;if(!er)return void g(e,t);let n=Date.now(),r=ez.current;r&&r.nodeId===e.id&&n-r.time<300?(eN.current&&(clearTimeout(eN.current),eN.current=null),ez.current=null,ei?.(e,window.innerWidth/2,window.innerHeight/2)):(ez.current={nodeId:e.id,time:n},eN.current&&clearTimeout(eN.current),eN.current=setTimeout(()=>{eN.current=null,ez.current=null,g(e,t)},300))},[er,g,ei]);(0,r.useEffect)(()=>{let e=eu.current;if(!e)return;let t=t=>{let n=t.target.closest("button, [data-tutorial], .bead-tooltip");if(n&&n!==eu.current||2!==t.button)return;let r=ed.current;if(!r)return;let i=e.getBoundingClientRect(),l=r.screen2GraphCoords(t.clientX-i.left,t.clientY-i.top);for(let e of eZ.current)if(null!=e.x&&null!=e.y){let t=e.x-l.x,n=e.y-l.y;if(Math.sqrt(t*t+n*n)<=C(e))return}t.preventDefault(),t.stopPropagation(),ew({startX:t.clientX,startY:t.clientY,currentX:t.clientX,currentY:t.clientY,active:!1})},n=e=>{ej.current&&e.preventDefault()};return e.addEventListener("pointerdown",t,{capture:!0}),e.addEventListener("contextmenu",n),()=>{e.removeEventListener("pointerdown",t,{capture:!0}),e.removeEventListener("contextmenu",n)}},[]);let tm=(0,r.useCallback)((e,t)=>{let n=ek.current;if(n.size<2||!n.has(e.id))return;if(!e0.current){let e=new Map;for(let t of eZ.current)n.has(t.id)&&null!=t.x&&null!=t.y&&e.set(t.id,{x:t.x,y:t.y});e0.current=e}let r=e0.current.get(e.id);if(!r)return;let i=e.x-r.x,l=e.y-r.y;for(let[t,n]of e0.current){if(t===e.id)continue;let r=eZ.current.find(e=>e.id===t);r&&(r.fx=n.x+i,r.fy=n.y+l)}},[]),tg=(0,r.useCallback)(e=>{if(e0.current){for(let[e]of e0.current){let t=eZ.current.find(t=>t.id===e);t&&(t.fx=void 0,t.fy=void 0)}e0.current=null,e1.current=null}},[]);return(0,n.jsxs)("div",{ref:eu,className:"w-full h-full relative","data-tutorial":"graph",children:[(0,n.jsxs)("div",{className:"absolute top-3 left-3 sm:top-4 sm:left-4 z-10 flex flex-col gap-1.5 sm:gap-2",children:[et&&en&&(0,n.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 text-xs font-medium bg-emerald-50/90 dark:bg-emerald-950/90 backdrop-blur-sm rounded-lg border border-emerald-200 dark:border-emerald-800 shadow-sm text-emerald-700 dark:text-emerald-300",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-emerald-500 dark:text-emerald-400 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 3.75H6A2.25 2.25 0 003.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0120.25 6v1.5M16.5 20.25H18A2.25 2.25 0 0020.25 18v-1.5M7.5 20.25H6A2.25 2.25 0 013.75 18v-1.5"})}),(0,n.jsxs)("span",{className:"truncate max-w-[180px]",children:["Focused: ",(0,n.jsx)("span",{className:"font-semibold",children:t.find(e=>e.id===et)?.title||et})]}),(0,n.jsx)("button",{onClick:en,className:"ml-auto p-0.5 rounded hover:bg-emerald-200/50 dark:hover:bg-emerald-900/50 transition-colors flex-shrink-0",title:"Show full graph",children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex w-full items-start gap-1.5 sm:gap-2",children:(0,n.jsxs)("div",{className:"flex w-full bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm rounded-lg border border-zinc-200 dark:border-zinc-700 shadow-sm overflow-hidden","data-tutorial":"layouts",children:[(0,n.jsx)("button",{onClick:()=>eI("force"),className:`flex-1 flex items-center justify-center gap-1 px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors ${"force"===eD?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,children:(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"4",cy:"4",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"12",cy:"3",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"3",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"13",cy:"11",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("line",{x1:"4",y1:"4",x2:"8",y2:"8",strokeOpacity:"0.5"}),(0,n.jsx)("line",{x1:"12",y1:"3",x2:"8",y2:"8",strokeOpacity:"0.5"}),(0,n.jsx)("line",{x1:"3",y1:"12",x2:"8",y2:"8",strokeOpacity:"0.5"}),(0,n.jsx)("line",{x1:"13",y1:"11",x2:"8",y2:"8",strokeOpacity:"0.5"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Force"})]})}),(0,n.jsx)("div",{className:"w-px bg-zinc-200 dark:bg-zinc-700"}),(0,n.jsx)("button",{onClick:()=>eI("dag"),className:`flex-1 flex items-center justify-center gap-1 px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors ${"dag"===eD?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,children:(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"2.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"4",cy:"8",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"12",cy:"8",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"2",cy:"13.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"6",cy:"13.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"12",cy:"13.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("line",{x1:"8",y1:"4",x2:"4",y2:"6.5",strokeOpacity:"0.5"}),(0,n.jsx)("line",{x1:"8",y1:"4",x2:"12",y2:"6.5",strokeOpacity:"0.5"}),(0,n.jsx)("line",{x1:"4",y1:"9.5",x2:"2",y2:"12",strokeOpacity:"0.5"}),(0,n.jsx)("line",{x1:"4",y1:"9.5",x2:"6",y2:"12",strokeOpacity:"0.5"}),(0,n.jsx)("line",{x1:"12",y1:"9.5",x2:"12",y2:"12",strokeOpacity:"0.5"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"DAG"})]})}),(0,n.jsx)("div",{className:"w-px bg-zinc-200 dark:bg-zinc-700"}),(0,n.jsx)("button",{onClick:()=>eI("radial"),className:`flex-1 flex items-center justify-center gap-1 px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors ${"radial"===eD?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,children:(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"2",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"8",cy:"8",r:"5",fill:"none",strokeOpacity:"0.5"}),(0,n.jsx)("circle",{cx:"8",cy:"8",r:"7.5",fill:"none",strokeOpacity:"0.3"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Radial"})]})}),(0,n.jsx)("div",{className:"w-px bg-zinc-200 dark:bg-zinc-700"}),(0,n.jsx)("button",{onClick:()=>eI("cluster"),className:`flex-1 flex items-center justify-center gap-1 px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors ${"cluster"===eD?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,children:(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"3.5",cy:"4",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"6",cy:"6",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"3",cy:"7",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"11",cy:"10",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"13.5",cy:"11.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"11",cy:"13",r:"1.5",fill:"currentColor",stroke:"none"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Cluster"})]})}),(0,n.jsx)("div",{className:"w-px bg-zinc-200 dark:bg-zinc-700"}),(0,n.jsx)("button",{onClick:()=>eI("spread"),className:`flex-1 flex items-center justify-center gap-1 px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors ${"spread"===eD?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,children:(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"2",cy:"2",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"14",cy:"3",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"3",cy:"14",r:"1.5",fill:"currentColor",stroke:"none"}),(0,n.jsx)("circle",{cx:"13",cy:"13",r:"1.5",fill:"currentColor",stroke:"none"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Spread"})]})})]})}),(0,n.jsx)("div",{className:"flex w-full items-start gap-1.5 sm:gap-2","data-tutorial":"view-controls",children:(0,n.jsxs)("div",{className:"flex w-full bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm rounded-lg border border-zinc-200 dark:border-zinc-700 shadow-sm overflow-hidden",children:[(U||V)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:H&&H.size>0?V:U,className:"flex-1 flex items-center justify-center gap-1 px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-zinc-800","data-tutorial":"btn-collapse",children:H&&H.size>0?(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Expand all"})]}):(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"})}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Collapse all"})]})}),(0,n.jsx)("div",{className:"w-px bg-zinc-200 dark:bg-zinc-700"})]}),(0,n.jsx)("button",{onClick:()=>eF(e=>!e),className:`flex-1 flex items-center justify-center gap-1 px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors ${eP?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,title:eP?"Hide cluster labels":"Show cluster labels","data-tutorial":"btn-clusters",children:(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"6",strokeDasharray:"2.5 2",strokeOpacity:eP?1:.5}),(0,n.jsx)("line",{x1:"5",y1:"8",x2:"11",y2:"8",strokeOpacity:eP?1:.4}),(0,n.jsx)("line",{x1:"6",y1:"10",x2:"10",y2:"10",strokeOpacity:eP?.6:.25,strokeWidth:"1"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Clusters"})]})}),(0,n.jsx)("div",{className:"w-px bg-zinc-200 dark:bg-zinc-700"}),(0,n.jsx)("button",{onClick:()=>X?.(),className:`flex-1 flex items-center justify-center gap-1 px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors ${K?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,title:K?"Auto-fit enabled: camera adjusts after updates":"Auto-fit disabled: camera stays fixed","data-tutorial":"btn-autofit",children:(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:[(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 3.75H6A2.25 2.25 0 003.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0120.25 6v1.5M20.25 16.5V18A2.25 2.25 0 0118 20.25h-1.5M3.75 16.5V18A2.25 2.25 0 006 20.25h1.5"}),(0,n.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Auto-fit"})]})}),(0,n.jsx)("div",{className:"w-px bg-zinc-200 dark:bg-zinc-700"}),(0,n.jsx)("button",{onClick:()=>Q?.(),className:`flex-1 flex items-center justify-center gap-1 px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors ${J?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,title:J?"Pulse enabled: ripple highlights most recent activity":"Pulse disabled: no activity highlight","data-tutorial":"btn-pulse",children:(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.07 4.93A10 10 0 014.93 19.07M4.93 4.93a10 10 0 0114.14 14.14",strokeOpacity:"0.5"}),(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.24 7.76a6 6 0 01.01 8.49M7.76 7.76a6 6 0 000 8.49",strokeOpacity:"0.7"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Pulse"})]})}),(0,n.jsx)("div",{className:"w-px bg-zinc-200 dark:bg-zinc-700"}),(0,n.jsx)("button",{onClick:()=>ee?.(),className:`flex-1 flex items-center justify-center gap-1 px-3 py-1.5 text-xs font-medium whitespace-nowrap transition-colors ${Z?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,title:Z?"Particles enabled: flowing dots show dependency direction":"Particles disabled: improves performance on large graphs","data-tutorial":"btn-particles",children:(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:[(0,n.jsx)("circle",{cx:"5",cy:"12",r:"1.5",fill:"currentColor"}),(0,n.jsx)("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor"}),(0,n.jsx)("circle",{cx:"19",cy:"12",r:"1.5",fill:"currentColor"}),(0,n.jsx)("path",{strokeLinecap:"round",d:"M7 12h3m3 0h3",strokeOpacity:"0.4"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Particles"})]})})]})})]}),!$&&(0,n.jsxs)("div",{className:"absolute bottom-2 sm:bottom-4 z-10 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm rounded-lg border border-zinc-200 dark:border-zinc-700 shadow-sm px-2 sm:px-3 py-1.5 sm:py-2 text-xs text-zinc-400 dark:text-zinc-500 transition-[right] duration-300 ease-out","data-tutorial":"legend",style:{right:W?"calc(360px + 1rem)":"1rem",maxWidth:320},children:[e6&&(0,n.jsxs)("div",{className:"text-zinc-500 dark:text-zinc-400 mb-1.5","data-tutorial":"legend-stats",children:[(0,n.jsx)("strong",{className:"text-zinc-700 dark:text-zinc-300",children:e6.total})," issues"," · ",(0,n.jsx)("strong",{className:"text-zinc-700 dark:text-zinc-300",children:e6.edges})," deps"," · ",(0,n.jsx)("strong",{className:"text-emerald-600 dark:text-emerald-400",children:e6.prefixes.length}),1===e6.prefixes.length?" project":" projects",el&&el.size>0&&(0,n.jsx)("span",{className:"text-zinc-400 dark:text-zinc-500",children:" (filtered)"})]}),(0,n.jsx)("div",{className:"hidden sm:flex bg-zinc-100 dark:bg-zinc-800 rounded-md overflow-hidden mb-1.5","data-tutorial":"legend-color-mode",children:["status","priority","type","owner","assignee","prefix"].map(e=>(0,n.jsx)("button",{onClick:()=>Y?.(e),className:`flex-1 px-2 py-1 text-[10px] font-medium transition-colors ${q===e?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60"}`,children:i[e]},e))}),(0,n.jsxs)("div",{className:"hidden sm:flex flex-wrap gap-x-3 gap-y-1 mb-1.5","data-tutorial":"legend-items",children:["status"===q?(0,n.jsx)(n.Fragment,{children:["open","in_progress","blocked","deferred","closed"].map(e=>{let t=el?.has(e),r=el&&el.size>0;return(0,n.jsxs)("button",{onClick:()=>ea?.(e),onMouseEnter:()=>{eb.current=e,cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current())},onMouseLeave:()=>{eb.current=null,cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current())},title:`${a[e]} — click to filter`,className:`flex items-center gap-1 px-1 py-0.5 rounded transition-all cursor-pointer ${t?"bg-zinc-200/80 dark:bg-zinc-700/80 ring-1 ring-zinc-300 dark:ring-zinc-600":r?"opacity-40 hover:opacity-70":"hover:bg-zinc-100 dark:hover:bg-zinc-800"}`,children:[(0,n.jsx)("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:l[e]}}),(0,n.jsx)("span",{className:`${t?"text-zinc-800 dark:text-zinc-200 font-medium":"text-zinc-500 dark:text-zinc-400"}`,children:a[e]})]},e)})}):"priority"===q?(0,n.jsx)(n.Fragment,{children:[0,1,2,3,4].map(e=>{let t=String(e),r=el?.has(t),i=el&&el.size>0;return(0,n.jsxs)("button",{onClick:()=>ea?.(t),onMouseEnter:()=>{eb.current=t,cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current())},onMouseLeave:()=>{eb.current=null,cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current())},title:`${o[e]} — click to filter`,className:`flex items-center gap-1 px-1 py-0.5 rounded transition-all cursor-pointer ${r?"bg-zinc-200/80 dark:bg-zinc-700/80 ring-1 ring-zinc-300 dark:ring-zinc-600":i?"opacity-40 hover:opacity-70":"hover:bg-zinc-100 dark:hover:bg-zinc-800"}`,children:[(0,n.jsx)("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:s[e]}}),(0,n.jsx)("span",{className:`${r?"text-zinc-800 dark:text-zinc-200 font-medium":"text-zinc-500 dark:text-zinc-400"}`,children:o[e]})]},e)})}):"type"===q?(0,n.jsx)(n.Fragment,{children:["epic","task","bug","feature","chore"].map(e=>{let t=el?.has(e),r=el&&el.size>0;return(0,n.jsxs)("button",{onClick:()=>ea?.(e),onMouseEnter:()=>{eb.current=e,cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current())},onMouseLeave:()=>{eb.current=null,cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current())},title:`${h[e]} — click to filter`,className:`flex items-center gap-1 px-1 py-0.5 rounded transition-all cursor-pointer ${t?"bg-zinc-200/80 dark:bg-zinc-700/80 ring-1 ring-zinc-300 dark:ring-zinc-600":r?"opacity-40 hover:opacity-70":"hover:bg-zinc-100 dark:hover:bg-zinc-800"}`,children:[(0,n.jsx)("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:u[e]}}),(0,n.jsx)("span",{className:`${t?"text-zinc-800 dark:text-zinc-200 font-medium":"text-zinc-500 dark:text-zinc-400"}`,children:h[e]})]},e)})}):(0,n.jsx)(n.Fragment,{children:e8.map(({label:e,color:t})=>{let r=el?.has(e),i=el&&el.size>0;return(0,n.jsxs)("button",{onClick:()=>ea?.(e),onMouseEnter:()=>{eb.current=e,cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current())},onMouseLeave:()=>{eb.current=null,cancelAnimationFrame(ep.current),ep.current=requestAnimationFrame(()=>ef.current())},title:`${e} — click to filter by ${q}`,className:`flex items-center gap-1 px-1 py-0.5 rounded transition-all cursor-pointer ${r?"bg-zinc-200/80 dark:bg-zinc-700/80 ring-1 ring-zinc-300 dark:ring-zinc-600":i?"opacity-40 hover:opacity-70":"hover:bg-zinc-100 dark:hover:bg-zinc-800"}`,children:[(0,n.jsx)("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:t}}),(0,n.jsx)("span",{className:`${r?"text-zinc-800 dark:text-zinc-200 font-medium":"text-zinc-500 dark:text-zinc-400"}`,children:e})]},e)})}),el&&el.size>0&&(0,n.jsx)("button",{onClick:()=>eo?.(),className:"text-[10px] text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-400 underline ml-auto",children:"Clear filters"})]}),(0,n.jsx)("div",{className:"hidden sm:flex flex-col gap-0.5 text-zinc-400 dark:text-zinc-500",children:(0,n.jsxs)("span",{children:["Size = importance · Ring = project","status"!==q&&` \xb7 Fill = ${i[q].toLowerCase()}`]})}),(0,n.jsx)("span",{className:"sm:hidden",children:"Tap a node for details"})]}),(0,n.jsxs)("div",{className:"hidden sm:block absolute bottom-4 left-4 z-10","data-tutorial":"minimap",style:{width:eM,height:eL},children:[(0,n.jsx)("canvas",{ref:eh,width:eM,height:eL,onClick:tf,className:"rounded-lg border border-zinc-200 dark:border-zinc-700 shadow-sm cursor-crosshair bg-white dark:bg-zinc-900",style:{width:eM,height:eL}}),(0,n.jsx)("div",{className:"absolute top-0 left-2 right-2 h-1.5 cursor-n-resize hover:bg-zinc-300/40 rounded-t-lg transition-colors",onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),eA.current={edge:"top",startX:e.clientX,startY:e.clientY,startW:eM,startH:eL};let t=e=>{if(!eA.current)return;let t=eA.current.startY-e.clientY,n=Math.max(80,Math.min(400,eA.current.startH+t));eS(e=>({...e,h:n}))},n=()=>{eA.current=null,window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",t),window.addEventListener("mouseup",n)}}),(0,n.jsx)("div",{className:"absolute top-2 right-0 bottom-2 w-1.5 cursor-e-resize hover:bg-zinc-300/40 rounded-r-lg transition-colors",onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),eA.current={edge:"right",startX:e.clientX,startY:e.clientY,startW:eM,startH:eL};let t=e=>{if(!eA.current)return;let t=e.clientX-eA.current.startX,n=Math.max(100,Math.min(500,eA.current.startW+t));eS(e=>({...e,w:n}))},n=()=>{eA.current=null,window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",t),window.addEventListener("mouseup",n)}}),(0,n.jsx)("div",{className:"absolute top-0 right-0 w-3 h-3 cursor-ne-resize hover:bg-zinc-300/40 rounded-tr-lg transition-colors",onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),eA.current={edge:"top-right",startX:e.clientX,startY:e.clientY,startW:eM,startH:eL};let t=e=>{if(!eA.current)return;let t=e.clientX-eA.current.startX,n=eA.current.startY-e.clientY;eS({w:Math.max(100,Math.min(500,eA.current.startW+t)),h:Math.max(80,Math.min(400,eA.current.startH+n))})},n=()=>{eA.current=null,window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",t),window.addEventListener("mouseup",n)}})]}),eT?(0,n.jsx)(eT,{ref:ed,graphData:tl,width:ex.width,height:ex.height,nodeCanvasObject:to,nodeCanvasObjectMode:P,nodePointerAreaPaint:td,onRenderFramePost:tc,linkCanvasObject:ts,linkCanvasObjectMode:P,linkDirectionalParticles:e=>Z&&"parent-child"!==e.type?2:0,linkDirectionalParticleSpeed:.004*!!Z,linkDirectionalParticleWidth:2.5*!!Z,linkDirectionalParticleColor:F,dagMode:"dag"===eD?"td":void 0,dagLevelDistance:150,onDagError:tu,d3AlphaDecay:.02,d3VelocityDecay:.3,cooldownTicks:300,warmupTicks:50,onNodeClick:tx,onNodeHover:tt,onNodeRightClick:tn,onBackgroundClick:b,onNodeDrag:tm,onNodeDragEnd:tg,onZoom:tp,backgroundColor:"transparent",autoPauseRedraw:!(J&&G)}):(0,n.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,n.jsx)("div",{className:"text-zinc-400 dark:text-zinc-500 text-sm animate-pulse-soft",children:"Loading graph engine..."})}),ey&&ey.active&&(0,n.jsx)("div",{style:{position:"absolute",left:Math.min(ey.startX,ey.currentX)-(eu.current?.getBoundingClientRect().left||0),top:Math.min(ey.startY,ey.currentY)-(eu.current?.getBoundingClientRect().top||0),width:Math.abs(ey.currentX-ey.startX),height:Math.abs(ey.currentY-ey.startY),border:"1.5px dashed #10b981",backgroundColor:"rgba(16, 185, 129, 0.08)",borderRadius:4,pointerEvents:"none",zIndex:5}})]})}),B=r.default.memo(R);function O(e,t){return e.length<=t?e:e.slice(0,t-1)+"…"}function $(){}function _(){}let W=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,H=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,U={};function V(e,t){return((t||U).jsx?H:W).test(e)}let q=/[ \t\n\f\r]/g;function Y(e){return""===e.replace(q,"")}class K{constructor(e,t){this.attribute=t,this.property=e}}K.prototype.attribute="",K.prototype.booleanish=!1,K.prototype.boolean=!1,K.prototype.commaOrSpaceSeparated=!1,K.prototype.commaSeparated=!1,K.prototype.defined=!1,K.prototype.mustUseProperty=!1,K.prototype.number=!1,K.prototype.overloadedBoolean=!1,K.prototype.property="",K.prototype.spaceSeparated=!1,K.prototype.space=void 0;let X=0,G=er(),J=er(),Q=er(),Z=er(),ee=er(),et=er(),en=er();function er(){return 2**++X}e.s(["boolean",0,G,"booleanish",0,J,"commaOrSpaceSeparated",0,en,"commaSeparated",0,et,"number",0,Z,"overloadedBoolean",0,Q,"spaceSeparated",0,ee],83954);var ei=e.i(83954);let el=Object.keys(ei);class ea extends K{constructor(e,t,n,r){let i=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",r),"number"==typeof n)for(;++i<el.length;){const e=el[i];!function(e,t,n){n&&(e[t]=n)}(this,el[i],(n&ei[e])===ei[e])}}}function eo(e){return e.toLowerCase()}ea.prototype.defined=!0;let es=/[A-Z]/g,ec=/-[a-z]/g,ed=/^data[-\w.:]+$/i;function eu(e){return"-"+e.toLowerCase()}function eh(e){return e.charAt(1).toUpperCase()}let ep={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};class ef{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function ex(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ef(n,r,t)}function em(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let l=new ea(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[eo(r)]=r,n[eo(l.attribute)]=r}return new ef(t,n,e.space)}ef.prototype.normal={},ef.prototype.property={},ef.prototype.space=void 0;let eg=em({properties:{ariaActiveDescendant:null,ariaAtomic:J,ariaAutoComplete:null,ariaBusy:J,ariaChecked:J,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:ee,ariaCurrent:null,ariaDescribedBy:ee,ariaDetails:null,ariaDisabled:J,ariaDropEffect:ee,ariaErrorMessage:null,ariaExpanded:J,ariaFlowTo:ee,ariaGrabbed:J,ariaHasPopup:null,ariaHidden:J,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ee,ariaLevel:Z,ariaLive:null,ariaModal:J,ariaMultiLine:J,ariaMultiSelectable:J,ariaOrientation:null,ariaOwns:ee,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:J,ariaReadOnly:J,ariaRelevant:null,ariaRequired:J,ariaRoleDescription:ee,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:J,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function ek(e,t){return t in e?e[t]:t}function eb(e,t){return ek(e,t.toLowerCase())}let ev=em({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:et,acceptCharset:ee,accessKey:ee,action:null,allow:null,allowFullScreen:G,allowPaymentRequest:G,allowUserMedia:G,alt:null,as:null,async:G,autoCapitalize:null,autoComplete:ee,autoFocus:G,autoPlay:G,blocking:ee,capture:null,charSet:null,checked:G,cite:null,className:ee,cols:Z,colSpan:null,content:null,contentEditable:J,controls:G,controlsList:ee,coords:Z|et,crossOrigin:null,data:null,dateTime:null,decoding:null,default:G,defer:G,dir:null,dirName:null,disabled:G,download:Q,draggable:J,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:G,formTarget:null,headers:ee,height:Z,hidden:Q,high:Z,href:null,hrefLang:null,htmlFor:ee,httpEquiv:ee,id:null,imageSizes:null,imageSrcSet:null,inert:G,inputMode:null,integrity:null,is:null,isMap:G,itemId:null,itemProp:ee,itemRef:ee,itemScope:G,itemType:ee,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:G,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:G,muted:G,name:null,nonce:null,noModule:G,noValidate:G,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:G,optimum:Z,pattern:null,ping:ee,placeholder:null,playsInline:G,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:G,referrerPolicy:null,rel:ee,required:G,reversed:G,rows:Z,rowSpan:Z,sandbox:ee,scope:null,scoped:G,seamless:G,selected:G,shadowRootClonable:G,shadowRootDelegatesFocus:G,shadowRootMode:null,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:J,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:G,useMap:null,value:J,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ee,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:G,declare:G,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:G,noHref:G,noShade:G,noWrap:G,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:J,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:G,disableRemotePlayback:G,prefix:null,property:null,results:Z,security:null,unselectable:null},space:"html",transform:eb}),ey=em({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:en,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:ee,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:G,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:et,g2:et,glyphName:et,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:en,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ee,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:en,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:en,rev:en,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:en,requiredFeatures:en,requiredFonts:en,requiredFormats:en,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:en,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:en,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:en,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ek}),ew=em({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),ej=em({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:eb}),ez=em({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),eN=ex([eg,ev,ew,ej,ez],"html"),eC=ex([eg,ey,ew,ej,ez],"svg");var eS=e.i(63185);let eM=eA("end"),eL=eA("start");function eA(e){return function(t){let n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function eT(e){return e&&"object"==typeof e?"position"in e||"type"in e?eD(e.position):"start"in e||"end"in e?eD(e):"line"in e||"column"in e?eE(e):"":""}function eE(e){return eI(e&&e.line)+":"+eI(e&&e.column)}function eD(e){return eE(e&&e.start)+"-"+eE(e&&e.end)}function eI(e){return e&&"number"==typeof e?e:1}class eP extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},l=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(l=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){const e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=eT(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=l&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}eP.prototype.file="",eP.prototype.name="",eP.prototype.reason="",eP.prototype.message="",eP.prototype.stack="",eP.prototype.column=void 0,eP.prototype.line=void 0,eP.prototype.ancestors=void 0,eP.prototype.cause=void 0,eP.prototype.fatal=void 0,eP.prototype.place=void 0,eP.prototype.ruleId=void 0,eP.prototype.source=void 0;let eF={}.hasOwnProperty,eR=new Map,eB=/[A-Z]/g,eO=new Set(["table","tbody","thead","tfoot","tr"]),e$=new Set(["td","th"]),e_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function eW(e,t,n){var r,i,l,a,o,s,c,d,u;let h,p,f,x,m,g,k,b,v,y,w;return"element"===t.type?(r=e,i=t,l=n,p=h=r.schema,"svg"===i.tagName.toLowerCase()&&"html"===h.space&&(r.schema=eC),r.ancestors.push(i),f=eq(r,i.tagName,!1),x=function(e,t){let n,r,i={};for(r in t.properties)if("children"!==r&&eF.call(t.properties,r)){let l=function(e,t,n){let r=function(e,t){let n=eo(t),r=t,i=K;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&ed.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(ec,eh);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ec.test(e)){let n=e.replace(es,eu);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=ea}return new i(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){var i;let t;if(Array.isArray(n)&&(n=r.commaSeparated?(t={},(""===(i=n)[i.length-1]?[...i,""]:i).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return(0,eS.default)(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new eP("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=e_+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,n={};for(t in e)eF.call(e,t)&&(n[function(e){let t=e.replace(eB,eK);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?ep[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(l){let[r,a]=l;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof a&&e$.has(t.tagName)?n=a:i[r]=a}}return n&&((i.style||(i.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),i}(r,i),m=eV(r,i),eO.has(i.tagName)&&(m=m.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&Y(e.value):Y(e))})),eH(r,x,f,i),eU(x,m),r.ancestors.pop(),r.schema=h,r.create(i,f,x,l)):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return $("ExpressionStatement"===n.type),e.evaluater.evaluateExpression(n.expression)}eY(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?(a=e,o=t,s=n,k=g=a.schema,"svg"===o.name&&"html"===g.space&&(a.schema=eC),a.ancestors.push(o),b=null===o.name?a.Fragment:eq(a,o.name,!0),v=function(e,t){let n={};for(let r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];$("ExpressionStatement"===t.type);let i=t.expression;$("ObjectExpression"===i.type);let l=i.properties[0];$("SpreadElement"===l.type),Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else eY(e,t.position);else{let i,l=r.name;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];$("ExpressionStatement"===t.type),i=e.evaluater.evaluateExpression(t.expression)}else eY(e,t.position);else i=null===r.value||r.value;n[l]=i}return n}(a,o),y=eV(a,o),eH(a,v,b,o),eU(v,y),a.ancestors.pop(),a.schema=g,a.create(o,b,v,s)):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);eY(e,t.position)}(e,t):"root"===t.type?(c=e,d=t,u=n,eU(w={},eV(c,d)),c.create(d,c.Fragment,w,u)):"text"===t.type?t.value:void 0}function eH(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function eU(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function eV(e,t){let n=[],r=-1,i=e.passKeys?new Map:eR;for(;++r<t.children.length;){let l,a=t.children[r];if(e.passKeys){let e="element"===a.type?a.tagName:"mdxJsxFlowElement"===a.type||"mdxJsxTextElement"===a.type?a.name:void 0;if(e){let t=i.get(e)||0;l=e+"-"+t,i.set(e,t+1)}}let o=eW(e,a,l);void 0!==o&&n.push(o)}return n}function eq(e,t,n){let r;if(n)if(t.includes(".")){let e,n=t.split("."),i=-1;for(;++i<n.length;){let t=V(n[i])?{type:"Identifier",name:n[i]}:{type:"Literal",value:n[i]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(i&&"Literal"===t.type),optional:!1}:t}$(e,"always a result"),r=e}else r=V(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){let t=r.value;return eF.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);eY(e)}function eY(e,t){let n=new eP("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=e_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function eK(e){return"-"+e.toLowerCase()}let eX={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},eG={};function eJ(e,t){let n=t||eG;return eQ(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function eQ(e,t,n){var r;if((r=e)&&"object"==typeof r){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return eZ(e.children,t,n)}return Array.isArray(e)?eZ(e,t,n):""}function eZ(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=eQ(e[i],t,n);return r.join("")}function e0(e,t,n,r){let i,l=e.length,a=0;if(t=t<0?-t>l?0:l+t:t>l?l:t,n=n>0?n:0,r.length<1e4)(i=Array.from(r)).unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);a<r.length;)(i=r.slice(a,a+1e4)).unshift(t,0),e.splice(...i),a+=1e4,t+=1e4}function e1(e,t){return e.length>0?(e0(e,e.length,0,t),e):t}let e5={}.hasOwnProperty;function e2(e){let t={},n=-1;for(;++n<e.length;)!function(e,t){let n;for(n in t){let r,i=(e5.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];if(l)for(r in l){e5.call(i,r)||(i[r]=[]);let e=l[r];!function(e,t){let n=-1,r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);e0(e,0,0,r)}(i[r],Array.isArray(e)?e:e?[e]:[])}}}(t,e[n]);return t}let e4=ta(/[A-Za-z]/),e3=ta(/[\dA-Za-z]/),e6=ta(/[#-'*+\--9=?A-Z^-~]/);function e8(e){return null!==e&&(e<32||127===e)}let e7=ta(/\d/),e9=ta(/[\dA-Fa-f]/),te=ta(/[!-/:-@[-`{-~]/);function tt(e){return null!==e&&e<-2}function tn(e){return null!==e&&(e<0||32===e)}function tr(e){return -2===e||-1===e||32===e}let ti=ta(/\p{P}|\p{S}/u),tl=ta(/\s/);function ta(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function to(e,t,n,r){let i=r?r-1:1/0,l=0;return function(r){return tr(r)?(e.enter(n),function r(a){return tr(a)&&l++<i?(e.consume(a),r):(e.exit(n),t(a))}(r)):t(r)}}let ts={tokenize:function(e){let t,n=e.attempt(this.parser.constructs.contentInitial,function(t){return null===t?void e.consume(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),to(e,n,"linePrefix"))},function(n){return e.enter("paragraph"),function n(r){let i=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=i),t=i,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return tt(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},tc={tokenize:function(e){let t,n,r,i=this,l=[],a=0;return o;function o(t){if(a<l.length){let n=l[a];return i.containerState=n[1],e.attempt(n[0].continuation,s,c)(t)}return c(t)}function s(e){if(a++,i.containerState._closeFlow){let n;i.containerState._closeFlow=void 0,t&&g();let r=i.events.length,l=r;for(;l--;)if("exit"===i.events[l][0]&&"chunkFlow"===i.events[l][1].type){n=i.events[l][1].end;break}m(a);let o=r;for(;o<i.events.length;)i.events[o][1].end={...n},o++;return e0(i.events,l+1,0,i.events.slice(r)),i.events.length=o,c(e)}return o(e)}function c(n){if(a===l.length){if(!t)return h(n);if(t.currentConstruct&&t.currentConstruct.concrete)return f(n);i.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(td,d,u)(n)}function d(e){return t&&g(),m(a),h(e)}function u(e){return i.parser.lazy[i.now().line]=a!==l.length,r=i.now().offset,f(e)}function h(t){return i.containerState={},e.attempt(td,p,f)(t)}function p(e){return a++,l.push([i.currentConstruct,i.containerState]),h(e)}function f(r){if(null===r){t&&g(),m(0),e.consume(r);return}return t=t||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){x(e.exit("chunkFlow"),!0),m(0),e.consume(n);return}return tt(n)?(e.consume(n),x(e.exit("chunkFlow")),a=0,i.interrupt=void 0,o):(e.consume(n),t)}(r)}function x(e,l){let o=i.sliceStream(e);if(l&&o.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(o),i.parser.lazy[e.start.line]){let e,n,l=t.events.length;for(;l--;)if(t.events[l][1].start.offset<r&&(!t.events[l][1].end||t.events[l][1].end.offset>r))return;let o=i.events.length,s=o;for(;s--;)if("exit"===i.events[s][0]&&"chunkFlow"===i.events[s][1].type){if(e){n=i.events[s][1].end;break}e=!0}for(m(a),l=o;l<i.events.length;)i.events[l][1].end={...n},l++;e0(i.events,s+1,0,i.events.slice(o)),i.events.length=l}}function m(t){let n=l.length;for(;n-- >t;){let t=l[n];i.containerState=t[1],t[0].exit.call(i,e)}l.length=t}function g(){t.write([null]),n=void 0,t=void 0,i.containerState._closeFlow=void 0}}},td={tokenize:function(e,t,n){return to(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},tu={partial:!0,tokenize:function(e,t,n){return function(t){return tr(t)?to(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||tt(e)?t(e):n(e)}}};class th{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?1/0:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),1/0);return n&&tp(this.left,n),r.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),tp(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),tp(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let t=this.left.splice(e,1/0);tp(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);tp(this.left,t.reverse())}}}function tp(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function tf(e){let t,n,r,i,l,a,o,s={},c=-1,d=new th(e);for(;++c<d.length;){for(;c in s;)c=s[c];if(t=d.get(c),c&&"chunkFlow"===t[1].type&&"listItemPrefix"===d.get(c-1)[1].type&&((r=0)<(a=t[1]._tokenizer.events).length&&"lineEndingBlank"===a[r][1].type&&(r+=2),r<a.length&&"content"===a[r][1].type))for(;++r<a.length&&"content"!==a[r][1].type;)"chunkText"===a[r][1].type&&(a[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(s,function(e,t){let n,r,i=e.get(t)[1],l=e.get(t)[2],a=t-1,o=[],s=i._tokenizer;!s&&(s=l.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let c=s.events,d=[],u={},h=-1,p=i,f=0,x=0,m=[0];for(;p;){for(;e.get(++a)[1]!==p;);o.push(a),!p._tokenizer&&(n=l.sliceStream(p),p.next||n.push(null),r&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(n),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),r=p,p=p.next}for(p=i;++h<c.length;)"exit"===c[h][0]&&"enter"===c[h-1][0]&&c[h][1].type===c[h-1][1].type&&c[h][1].start.line!==c[h][1].end.line&&(x=h+1,m.push(x),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):m.pop(),h=m.length;h--;){let t=c.slice(m[h],m[h+1]),n=o.pop();d.push([n,n+t.length-1]),e.splice(n,2,t)}for(d.reverse(),h=-1;++h<d.length;)u[f+d[h][0]]=f+d[h][1],f+=d[h][1]-d[h][0]-1;return u}(d,c)),c=s[c],o=!0);else if(t[1]._container){for(r=c,n=void 0;r--;)if("lineEnding"===(i=d.get(r))[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(n&&(d.get(n)[1].type="lineEndingBlank"),i[1].type="lineEnding",n=r);else if("linePrefix"===i[1].type||"listItemIndent"===i[1].type);else break;n&&(t[1].end={...d.get(n)[1].start},(l=d.slice(n,c)).unshift(t),d.splice(n,c-n+1,l))}}return e0(e,0,1/0,d.slice(0)),!o}let tx={resolve:function(e){return tf(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?i(t):tt(t)?e.check(tm,l,i)(t):(e.consume(t),r)}function i(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function l(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},tm={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),to(e,i,"linePrefix")};function i(i){if(null===i||tt(i))return n(i);let l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&"linePrefix"===l[1].type&&l[2].sliceSerialize(l[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}},tg={tokenize:function(e){let t=this,n=e.attempt(tu,function(r){return null===r?void e.consume(r):(e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n)},e.attempt(this.parser.constructs.flowInitial,r,to(e,e.attempt(this.parser.constructs.flow,r,e.attempt(tx,r)),"linePrefix")));return n;function r(r){return null===r?void e.consume(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n)}}},tk={resolveAll:tw()},tb=ty("string"),tv=ty("text");function ty(e){return{resolveAll:tw("text"===e?tj:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,l,a);return l;function l(e){return s(e)?i(e):a(e)}function a(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),o)}function o(e){return s(e)?(t.exit("data"),i(e)):(t.consume(e),o)}function s(e){if(null===e)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function tw(e){return function(t,n){let r,i=-1;for(;++i<=t.length;)void 0===r?t[i]&&"data"===t[i][1].type&&(r=i,i++):t[i]&&"data"===t[i][1].type||(i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),i=r+2),r=void 0);return e?e(t,n):t}}function tj(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r,i=e[n-1][1],l=t.sliceStream(i),a=l.length,o=-1,s=0;for(;a--;){let e=l[a];if("string"==typeof e){for(o=e.length;32===e.charCodeAt(o-1);)s++,o--;if(o)break;o=-1}else if(-2===e)r=!0,s++;else if(-1===e);else{a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let l={type:n===e.length||r||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:i.start._bufferIndex+o,_index:i.start._index+a,line:i.end.line,column:i.end.column-s,offset:i.end.offset-s},end:{...i.end}};i.end={...l.start},i.start.offset===i.end.offset?Object.assign(i,l):(e.splice(n,0,["enter",l,t],["exit",l,t]),n+=2)}n++}return e}function tz(e){return null===e||tn(e)||tl(e)?1:ti(e)?2:void 0}function tN(e,t,n){let r=[],i=-1;for(;++i<e.length;){let l=e[i].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}let tC={name:"attention",resolveAll:function(e,t){let n,r,i,l,a,o,s,c,d=-1;for(;++d<e.length;)if("enter"===e[d][0]&&"attentionSequence"===e[d][1].type&&e[d][1]._close){for(n=d;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[d][1]).charCodeAt(0)){if((e[n][1]._close||e[d][1]._open)&&(e[d][1].end.offset-e[d][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[d][1].end.offset-e[d][1].start.offset)%3))continue;o=e[n][1].end.offset-e[n][1].start.offset>1&&e[d][1].end.offset-e[d][1].start.offset>1?2:1;let u={...e[n][1].end},h={...e[d][1].start};tS(u,-o),tS(h,o),l={type:o>1?"strongSequence":"emphasisSequence",start:u,end:{...e[n][1].end}},a={type:o>1?"strongSequence":"emphasisSequence",start:{...e[d][1].start},end:h},i={type:o>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[d][1].start}},r={type:o>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[n][1].end={...l.start},e[d][1].start={...a.end},s=[],e[n][1].end.offset-e[n][1].start.offset&&(s=e1(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),s=e1(s,[["enter",r,t],["enter",l,t],["exit",l,t],["enter",i,t]]),s=e1(s,tN(t.parser.constructs.insideSpan.null,e.slice(n+1,d),t)),s=e1(s,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[d][1].end.offset-e[d][1].start.offset?(c=2,s=e1(s,[["enter",e[d][1],t],["exit",e[d][1],t]])):c=0,e0(e,n-1,d-n+3,s),d=n+s.length-c-2;break}}for(d=-1;++d<e.length;)"attentionSequence"===e[d][1].type&&(e[d][1].type="data");return e},tokenize:function(e,t){let n,r=this.parser.constructs.attentionMarkers.null,i=this.previous,l=tz(i);return function(a){return n=a,e.enter("attentionSequence"),function a(o){if(o===n)return e.consume(o),a;let s=e.exit("attentionSequence"),c=tz(o),d=!c||2===c&&l||r.includes(o),u=!l||2===l&&c||r.includes(i);return s._open=!!(42===n?d:d&&(l||!u)),s._close=!!(42===n?u:u&&(c||!d)),t(o)}(a)}}};function tS(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let tM={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return tr(t)?to(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):i(t)};function i(r){return e.attempt(tM,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),i}return n(t)};function i(n){return tr(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}},tL={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return te(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},tA=document.createElement("i");function tT(e){let t="&"+e+";";tA.innerHTML=t;let n=tA.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let tE={name:"characterReference",tokenize:function(e,t,n){let r,i,l=this,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),o};function o(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),r=31,i=e3,c(t))}function s(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,i=e9,c):(e.enter("characterReferenceValue"),r=7,i=e7,c(t))}function c(o){if(59===o&&a){let r=e.exit("characterReferenceValue");return i!==e3||tT(l.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(o),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(o)}return i(o)&&a++<r?(e.consume(o),c):n(o)}}},tD={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},tI={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r,i=this,l={partial:!0,tokenize:function(e,t,n){let l=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a};function a(t){return e.enter("codeFencedFence"),tr(t)?to(e,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):s(t)}function s(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(i){return i===r?(l++,e.consume(i),t):l>=o?(e.exit("codeFencedFenceSequence"),tr(i)?to(e,c,"whitespace")(i):c(i)):n(i)}(t)):n(t)}function c(r){return null===r||tt(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},a=0,o=0;return function(t){var l;let c;return l=t,a=(c=i.events[i.events.length-1])&&"linePrefix"===c[1].type?c[2].sliceSerialize(c[1],!0).length:0,r=l,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(i){return i===r?(o++,e.consume(i),t):o<3?n(i):(e.exit("codeFencedFenceSequence"),tr(i)?to(e,s,"whitespace")(i):s(i))}(l)};function s(l){return null===l||tt(l)?(e.exit("codeFencedFence"),i.interrupt?t(l):e.check(tD,d,f)(l)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||tt(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),s(i)):tr(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),to(e,c,"whitespace")(i)):96===i&&i===r?n(i):(e.consume(i),t)}(l))}function c(t){return null===t||tt(t)?s(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||tt(i)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),s(i)):96===i&&i===r?n(i):(e.consume(i),t)}(t))}function d(t){return e.attempt(l,f,u)(t)}function u(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),h}function h(t){return a>0&&tr(t)?to(e,p,"linePrefix",a+1)(t):p(t)}function p(t){return null===t||tt(t)?e.check(tD,d,f)(t):(e.enter("codeFlowValue"),function t(n){return null===n||tt(n)?(e.exit("codeFlowValue"),p(n)):(e.consume(n),t)}(t))}function f(n){return e.exit("codeFenced"),t(n)}}},tP={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),to(e,i,"linePrefix",5)(t)};function i(t){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?function t(n){return null===n?l(n):tt(n)?e.attempt(tF,t,l)(n):(e.enter("codeFlowValue"),function n(r){return null===r||tt(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function l(n){return e.exit("codeIndented"),t(n)}}},tF={partial:!0,tokenize:function(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):tt(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):to(e,l,"linePrefix",5)(t)}function l(e){let l=r.events[r.events.length-1];return l&&"linePrefix"===l[1].type&&l[2].sliceSerialize(l[1],!0).length>=4?t(e):tt(e)?i(e):n(e)}}};function tR(e,t,n,r,i,l,a,o,s){let c=s||1/0,d=0;return function(t){return 60===t?(e.enter(r),e.enter(i),e.enter(l),e.consume(t),e.exit(l),u):null===t||32===t||41===t||e8(t)?n(t):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),f(t))};function u(n){return 62===n?(e.enter(l),e.consume(n),e.exit(l),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),h(n))}function h(t){return 62===t?(e.exit("chunkString"),e.exit(o),u(t)):null===t||60===t||tt(t)?n(t):(e.consume(t),92===t?p:h)}function p(t){return 60===t||62===t||92===t?(e.consume(t),h):h(t)}function f(i){return!d&&(null===i||41===i||tn(i))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(i)):d<c&&40===i?(e.consume(i),d++,f):41===i?(e.consume(i),d--,f):null===i||32===i||40===i||e8(i)?n(i):(e.consume(i),92===i?x:f)}function x(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function tB(e,t,n,r,i,l){let a,o=this,s=0;return function(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(l),c};function c(u){return s>999||null===u||91===u||93===u&&!a||94===u&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?n(u):93===u?(e.exit(l),e.enter(i),e.consume(u),e.exit(i),e.exit(r),t):tt(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(u))}function d(t){return null===t||91===t||93===t||tt(t)||s++>999?(e.exit("chunkString"),c(t)):(e.consume(t),a||(a=!tr(t)),92===t?u:d)}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,d):d(t)}}function tO(e,t,n,r,i,l){let a;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),a=40===t?41:t,o):n(t)};function o(n){return n===a?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(l),s(n))}function s(t){return t===a?(e.exit(l),o(a)):null===t?n(t):tt(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),to(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===a||null===t||tt(t)?(e.exit("chunkString"),s(t)):(e.consume(t),92===t?d:c)}function d(t){return t===a||92===t?(e.consume(t),c):c(t)}}function t$(e,t){let n;return function r(i){return tt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):tr(i)?to(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function t_(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let tW={partial:!0,tokenize:function(e,t,n){return function(t){return tn(t)?t$(e,r)(t):n(t)};function r(t){return tO(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return tr(t)?to(e,l,"whitespace")(t):l(t)}function l(e){return null===e||tt(e)?t(e):n(e)}}},tH=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],tU=["pre","script","style","textarea"],tV={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(tu,t,n)}}},tq={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return tt(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},tY={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&e0(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,i,l,a=e.length,o=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(i){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){o=2;break}}else"labelEnd"===n.type&&(i=a);let s={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[i][1].end}},d={type:"labelText",start:{...e[r+o+2][1].end},end:{...e[i-2][1].start}};return l=e1(l=[["enter",s,t],["enter",c,t]],e.slice(r+1,r+o+3)),l=e1(l,[["enter",d,t]]),l=e1(l,tN(t.parser.constructs.insideSpan.null,e.slice(r+o+4,i-3),t)),l=e1(l,[["exit",d,t],e[i-2],e[i-1],["exit",c,t]]),l=e1(l,e.slice(i+1)),l=e1(l,[["exit",s,t]]),e0(e,r,e.length,l),e},tokenize:function(e,t,n){let r,i,l=this,a=l.events.length;for(;a--;)if(("labelImage"===l.events[a][1].type||"labelLink"===l.events[a][1].type)&&!l.events[a][1]._balanced){r=l.events[a][1];break}return function(t){return r?r._inactive?d(t):(i=l.parser.defined.includes(t_(l.sliceSerialize({start:r.end,end:l.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),o):n(t)};function o(t){return 40===t?e.attempt(tK,c,i?c:d)(t):91===t?e.attempt(tX,c,i?s:d)(t):i?c(t):d(t)}function s(t){return e.attempt(tG,c,d)(t)}function c(e){return t(e)}function d(e){return r._balanced=!0,n(e)}}},tK={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return tn(t)?t$(e,i)(t):i(t)}function i(t){return 41===t?c(t):tR(e,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function l(t){return tn(t)?t$(e,o)(t):c(t)}function a(e){return n(e)}function o(t){return 34===t||39===t||40===t?tO(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function s(t){return tn(t)?t$(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},tX={tokenize:function(e,t,n){let r=this;return function(t){return tB.call(r,e,i,l,"reference","referenceMarker","referenceString")(t)};function i(e){return r.parser.defined.includes(t_(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function l(e){return n(e)}}},tG={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},tJ={name:"labelStartImage",resolveAll:tY.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),i};function i(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),l):n(t)}function l(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},tQ={name:"labelStartLink",resolveAll:tY.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),i};function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},tZ={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),to(e,t,"linePrefix")}}},t0={name:"thematicBreak",tokenize:function(e,t,n){let r,i=0;return function(l){var a;return e.enter("thematicBreak"),r=a=l,function l(a){return a===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),i++,t):(e.exit("thematicBreakSequence"),tr(n)?to(e,l,"whitespace")(n):l(n))}(a)):i>=3&&(null===a||tt(a))?(e.exit("thematicBreak"),t(a)):n(a)}(a)}}},t1={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(tu,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,to(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!tr(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(t2,t,i)(n))});function i(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,to(e,e.attempt(t1,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,i=r.events[r.events.length-1],l=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,a=0;return function(t){let i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:e7(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(t0,n,o)(t):o(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(i){return e7(i)&&++a<10?(e.consume(i),t):(!r.interrupt||a<2)&&(r.containerState.marker?i===r.containerState.marker:41===i||46===i)?(e.exit("listItemValue"),o(i)):n(i)}(t)}return n(t)};function o(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(tu,r.interrupt?n:s,e.attempt(t5,d,c))}function s(e){return r.containerState.initialBlankLine=!0,l++,d(e)}function c(t){return tr(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},t5={partial:!0,tokenize:function(e,t,n){let r=this;return to(e,function(e){let i=r.events[r.events.length-1];return!tr(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},t2={partial:!0,tokenize:function(e,t,n){let r=this;return to(e,function(e){let i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},t4={name:"setextUnderline",resolveTo:function(e,t){let n,r,i,l=e.length;for(;l--;)if("enter"===e[l][0]){if("content"===e[l][1].type){n=l;break}"paragraph"===e[l][1].type&&(r=l)}else"content"===e[l][1].type&&e.splice(l,1),i||"definition"!==e[l][1].type||(i=l);let a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",a,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=a,e.push(["exit",a,t]),e},tokenize:function(e,t,n){let r,i=this;return function(t){var a;let o,s=i.events.length;for(;s--;)if("lineEnding"!==i.events[s][1].type&&"linePrefix"!==i.events[s][1].type&&"content"!==i.events[s][1].type){o="paragraph"===i.events[s][1].type;break}return!i.parser.lazy[i.now().line]&&(i.interrupt||o)?(e.enter("setextHeadingLine"),r=t,a=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),tr(n)?to(e,l,"lineSuffix")(n):l(n))}(a)):n(t)};function l(r){return null===r||tt(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,t,n){let r,i=this;return function(t){var r;return e.enter("definition"),r=t,tB.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(r)};function l(t){return(r=t_(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return tn(t)?t$(e,o)(t):o(t)}function o(t){return tR(e,s,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function s(t){return e.attempt(tW,c,c)(t)}function c(t){return tr(t)?to(e,d,"whitespace")(t):d(t)}function d(l){return null===l||tt(l)?(e.exit("definition"),i.parser.defined.push(r),t(l)):n(l)}}}},"disable",0,{null:[]},"document",0,{42:t1,43:t1,45:t1,48:t1,49:t1,50:t1,51:t1,52:t1,53:t1,54:t1,55:t1,56:t1,57:t1,62:tM},"flow",0,{35:{name:"headingAtx",resolve:function(e,t){let n,r,i=e.length-2,l=3;return"whitespace"===e[3][1].type&&(l+=2),i-2>l&&"whitespace"===e[i][1].type&&(i-=2),"atxHeadingSequence"===e[i][1].type&&(l===i-1||i-4>l&&"whitespace"===e[i-2][1].type)&&(i-=l+1===i?2:4),i>l&&(n={type:"atxHeadingText",start:e[l][1].start,end:e[i][1].end},r={type:"chunkText",start:e[l][1].start,end:e[i][1].end,contentType:"text"},e0(e,l,i-l+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(i){var l;return e.enter("atxHeading"),l=i,e.enter("atxHeadingSequence"),function i(l){return 35===l&&r++<6?(e.consume(l),i):null===l||tn(l)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||tt(r)?(e.exit("atxHeading"),t(r)):tr(r)?to(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||tn(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(l)):n(l)}(l)}}},42:t0,45:[t4,t0],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){let r,i,l,a,o,s=this;return function(t){var n;return n=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),c};function c(a){return 33===a?(e.consume(a),d):47===a?(e.consume(a),i=!0,p):63===a?(e.consume(a),r=3,s.interrupt?t:E):e4(a)?(e.consume(a),l=String.fromCharCode(a),f):n(a)}function d(i){return 45===i?(e.consume(i),r=2,u):91===i?(e.consume(i),r=5,a=0,h):e4(i)?(e.consume(i),r=4,s.interrupt?t:E):n(i)}function u(r){return 45===r?(e.consume(r),s.interrupt?t:E):n(r)}function h(r){let i="CDATA[";return r===i.charCodeAt(a++)?(e.consume(r),a===i.length)?s.interrupt?t:z:h:n(r)}function p(t){return e4(t)?(e.consume(t),l=String.fromCharCode(t),f):n(t)}function f(a){if(null===a||47===a||62===a||tn(a)){let o=47===a,c=l.toLowerCase();return!o&&!i&&tU.includes(c)?(r=1,s.interrupt?t(a):z(a)):tH.includes(l.toLowerCase())?(r=6,o)?(e.consume(a),x):s.interrupt?t(a):z(a):(r=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(a):i?function t(n){return tr(n)?(e.consume(n),t):w(n)}(a):m(a))}return 45===a||e3(a)?(e.consume(a),l+=String.fromCharCode(a),f):n(a)}function x(r){return 62===r?(e.consume(r),s.interrupt?t:z):n(r)}function m(t){return 47===t?(e.consume(t),w):58===t||95===t||e4(t)?(e.consume(t),g):tr(t)?(e.consume(t),m):w(t)}function g(t){return 45===t||46===t||58===t||95===t||e3(t)?(e.consume(t),g):k(t)}function k(t){return 61===t?(e.consume(t),b):tr(t)?(e.consume(t),k):m(t)}function b(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,v):tr(t)?(e.consume(t),b):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||tn(n)?k(n):(e.consume(n),t)}(t)}function v(t){return t===o?(e.consume(t),o=null,y):null===t||tt(t)?n(t):(e.consume(t),v)}function y(e){return 47===e||62===e||tr(e)?m(e):n(e)}function w(t){return 62===t?(e.consume(t),j):n(t)}function j(t){return null===t||tt(t)?z(t):tr(t)?(e.consume(t),j):n(t)}function z(t){return 45===t&&2===r?(e.consume(t),M):60===t&&1===r?(e.consume(t),L):62===t&&4===r?(e.consume(t),D):63===t&&3===r?(e.consume(t),E):93===t&&5===r?(e.consume(t),T):tt(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(tV,I,N)(t)):null===t||tt(t)?(e.exit("htmlFlowData"),N(t)):(e.consume(t),z)}function N(t){return e.check(tq,C,I)(t)}function C(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),S}function S(t){return null===t||tt(t)?N(t):(e.enter("htmlFlowData"),z(t))}function M(t){return 45===t?(e.consume(t),E):z(t)}function L(t){return 47===t?(e.consume(t),l="",A):z(t)}function A(t){if(62===t){let n=l.toLowerCase();return tU.includes(n)?(e.consume(t),D):z(t)}return e4(t)&&l.length<8?(e.consume(t),l+=String.fromCharCode(t),A):z(t)}function T(t){return 93===t?(e.consume(t),E):z(t)}function E(t){return 62===t?(e.consume(t),D):45===t&&2===r?(e.consume(t),E):z(t)}function D(t){return null===t||tt(t)?(e.exit("htmlFlowData"),I(t)):(e.consume(t),D)}function I(n){return e.exit("htmlFlow"),t(n)}}},61:t4,95:t0,96:tI,126:tI},"flowInitial",0,{[-2]:tP,[-1]:tP,32:tP},"insideSpan",0,{null:[tC,tk]},"string",0,{38:tE,92:tL},"text",0,{[-5]:tZ,[-4]:tZ,[-3]:tZ,33:tJ,38:tE,42:tC,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i};function i(t){return e4(t)?(e.consume(t),l):64===t?n(t):o(t)}function l(t){return 43===t||45===t||46===t||e3(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,a):(43===n||45===n||46===n||e3(n))&&r++<32?(e.consume(n),t):(r=0,o(n))}(t)):o(t)}function a(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||e8(r)?n(r):(e.consume(r),a)}function o(t){return 64===t?(e.consume(t),s):e6(t)?(e.consume(t),o):n(t)}function s(i){return e3(i)?function i(l){return 46===l?(e.consume(l),r=0,s):62===l?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(l),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(l){if((45===l||e3(l))&&r++<63){let n=45===l?t:i;return e.consume(l),n}return n(l)}(l)}(i):n(i)}}},{name:"htmlText",tokenize:function(e,t,n){let r,i,l,a=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),o};function o(t){return 33===t?(e.consume(t),s):47===t?(e.consume(t),v):63===t?(e.consume(t),k):e4(t)?(e.consume(t),w):n(t)}function s(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),i=0,p):e4(t)?(e.consume(t),g):n(t)}function c(t){return 45===t?(e.consume(t),h):n(t)}function d(t){return null===t?n(t):45===t?(e.consume(t),u):tt(t)?(l=d,A(t)):(e.consume(t),d)}function u(t){return 45===t?(e.consume(t),h):d(t)}function h(e){return 62===e?L(e):45===e?u(e):d(e)}function p(t){let r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),i===r.length?f:p):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),x):tt(t)?(l=f,A(t)):(e.consume(t),f)}function x(t){return 93===t?(e.consume(t),m):f(t)}function m(t){return 62===t?L(t):93===t?(e.consume(t),m):f(t)}function g(t){return null===t||62===t?L(t):tt(t)?(l=g,A(t)):(e.consume(t),g)}function k(t){return null===t?n(t):63===t?(e.consume(t),b):tt(t)?(l=k,A(t)):(e.consume(t),k)}function b(e){return 62===e?L(e):k(e)}function v(t){return e4(t)?(e.consume(t),y):n(t)}function y(t){return 45===t||e3(t)?(e.consume(t),y):function t(n){return tt(n)?(l=t,A(n)):tr(n)?(e.consume(n),t):L(n)}(t)}function w(t){return 45===t||e3(t)?(e.consume(t),w):47===t||62===t||tn(t)?j(t):n(t)}function j(t){return 47===t?(e.consume(t),L):58===t||95===t||e4(t)?(e.consume(t),z):tt(t)?(l=j,A(t)):tr(t)?(e.consume(t),j):L(t)}function z(t){return 45===t||46===t||58===t||95===t||e3(t)?(e.consume(t),z):function t(n){return 61===n?(e.consume(n),N):tt(n)?(l=t,A(n)):tr(n)?(e.consume(n),t):j(n)}(t)}function N(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,C):tt(t)?(l=N,A(t)):tr(t)?(e.consume(t),N):(e.consume(t),S)}function C(t){return t===r?(e.consume(t),r=void 0,M):null===t?n(t):tt(t)?(l=C,A(t)):(e.consume(t),C)}function S(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||tn(t)?j(t):(e.consume(t),S)}function M(e){return 47===e||62===e||tn(e)?j(e):n(e)}function L(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function A(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),T}function T(t){return tr(t)?to(e,E,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):E(t)}function E(t){return e.enter("htmlTextData"),l(t)}}}],91:tQ,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return tt(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},tL],93:tY,95:tC,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,i=3;if(("lineEnding"===e[3][1].type||"space"===e[i][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=i;++t<r;)if("codeTextData"===e[t][1].type){e[i][1].type="codeTextPadding",e[r][1].type="codeTextPadding",i+=2,r-=2;break}}for(t=i-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,i,l=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),l++,t):(e.exit("codeTextSequence"),a(n))}(t)};function a(s){return null===s?n(s):32===s?(e.enter("space"),e.consume(s),e.exit("space"),a):96===s?(i=e.enter("codeTextSequence"),r=0,function n(a){return 96===a?(e.consume(a),r++,n):r===l?(e.exit("codeTextSequence"),e.exit("codeText"),t(a)):(i.type="codeTextData",o(a))}(s)):tt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):(e.enter("codeTextData"),o(s))}function o(t){return null===t||32===t||96===t||tt(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),o)}}}}],19210);var t3=e.i(19210);let t6=/[\0\t\n\r]/g;function t8(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let t7=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function t9(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return t8(n.slice(t?2:1),t?16:10)}return tT(n)||e}let ne={}.hasOwnProperty;function nt(e){return{line:e.line,column:e.column,offset:e.offset}}function nn(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+eT({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+eT({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+eT({start:t.start,end:t.end})+") is still open")}function nr(e){let t=this;t.parser=function(n){var r,i;let l,a,o,s;return"string"!=typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(i=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(g),autolinkProtocol:c,autolinkEmail:c,atxHeading:r(f),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:c,characterReference:c,codeFenced:r(p),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:r(p,i),codeText:r(function(){return{type:"inlineCode",value:""}},i),codeTextData:c,data:c,codeFlowValue:c,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(x),hardBreakTrailing:r(x),htmlFlow:r(m,i),htmlFlowData:c,htmlText:r(m,i),htmlTextData:c,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:i,link:r(g),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(k,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(k),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:r(f),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:a(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:a(),autolinkEmail:function(e){d.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){d.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:a(),characterEscapeValue:d,characterReferenceMarkerHexadecimal:h,characterReferenceMarkerNumeric:h,characterReferenceValue:function(e){let t,n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=t8(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=tT(n);let i=this.stack[this.stack.length-1];i.value+=t},characterReference:function(e){this.stack.pop().position.end=nt(e.end)},codeFenced:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:d,codeIndented:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:d,data:d,definition:a(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=t_(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:a(),hardBreakEscape:a(u),hardBreakTrailing:a(u),htmlFlow:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:d,htmlText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:d,image:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===n.type?n.children=e.children:n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=t.replace(t7,t9),n.identifier=t_(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=nt(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(c.call(this,e),d.call(this,e))},link:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=t_(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:a(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:a(),thematicBreak:a()}};!function e(t,n){let r=-1;for(;++r<n.length;){let i=n[r];Array.isArray(i)?e(t,i):function(e,t){let n;for(n in t)if(ne.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,i)}}(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},a={stack:[r],tokenStack:[],config:t,enter:l,exit:o,buffer:i,resume:s,data:n},c=[],d=-1;for(;++d<e.length;)("listOrdered"===e[d][1].type||"listUnordered"===e[d][1].type)&&("enter"===e[d][0]?c.push(d):d=function(e,t,n){let r,i,l,a,o=t-1,s=-1,c=!1;for(;++o<=n;){let t=e[o];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?s++:s--,a=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||a||s||l||(l=o),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!s&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===s&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let a=o;for(i=void 0;a--;){let t=e[a];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;i&&(e[i][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",i=a}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}l&&(!i||l<i)&&(r._spread=!0),r.end=Object.assign({},i?e[i][1].start:t[1].end),e.splice(i||o,0,["exit",r,t[2]]),o++,n++}if("listItemPrefix"===t[1].type){let i={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=i,e.splice(o,0,["enter",i,t[2]]),o++,n++,l=void 0,a=!0}}}return e[t][1]._spread=c,n}(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];ne.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||nn).call(a,void 0,e[0])}for(r.position={start:nt(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:nt(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r};function r(e,t){return function(n){l.call(this,e(n),n),t&&t.call(this,n)}}function i(){this.stack.push({type:"fragment",children:[]})}function l(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:nt(t.start),end:void 0}}function a(e){return function(t){e&&e.call(this,t),o.call(this,t)}}function o(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||nn).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+eT({start:e.start,end:e.end})+"): it’s not open");n.position.end=nt(e.end)}function s(){return eJ(this.stack.pop())}function c(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:nt(e.start),end:void 0},t.push(n)),this.stack.push(n)}function d(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=nt(e.end)}function u(){this.data.atHardBreak=!0}function h(e){this.data.characterReferenceType=e.type}function p(){return{type:"code",lang:null,meta:null,value:""}}function f(){return{type:"heading",depth:0,children:[]}}function x(){return{type:"break"}}function m(){return{type:"html",value:""}}function g(){return{type:"link",title:null,url:"",children:[]}}function k(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(i)(function(e){for(;!tf(e););return e}((function(e){let t={constructs:e2([t3,...(e||{}).extensions||[]]),content:n(ts),defined:[],document:n(tc),flow:n(tg),lazy:{},string:n(tb),text:n(tv)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},l=[],a=[],o=[],s={attempt:f(function(e,t){x(e,t.from)}),check:f(p),consume:function(e){tt(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,m()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=h(),c.events.push(["enter",n,c]),o.push(n),n},exit:function(e){let t=o.pop();return t.end=h(),c.events.push(["exit",t,c]),t},interrupt:f(p,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){i[e.line]=e.column,m()},events:[],now:h,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,i=[];for(;++r<e.length;){let l,a=e[r];if("string"==typeof a)l=a;else switch(a){case -5:l="\r";break;case -4:l="\n";break;case -3:l="\r\n";break;case -2:l=t?" ":" ";break;case -1:if(!t&&n)continue;l=" ";break;default:l=String.fromCharCode(a)}n=-2===a,i.push(l)}return i.join("")}(u(e),t)},sliceStream:u,write:function(e){return(a=e1(a,e),function(){let e;for(;r._index<a.length;){let n=a[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),d=d(t)}else d=d(n)}}(),null!==a[a.length-1])?[]:(x(t,0),c.events=tN(l,c.events,c),c.events)}},d=t.tokenize.call(c,s);return t.resolveAll&&l.push(t),c;function u(e){return function(e,t){let n,r=t.start._index,i=t.start._bufferIndex,l=t.end._index,a=t.end._bufferIndex;if(r===l)n=[e[r].slice(i,a)];else{if(n=e.slice(r,l),i>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(i):n.shift()}a>0&&n.push(e[l].slice(0,a))}return n}(a,e)}function h(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:l}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:l}}function p(e,t){t.restore()}function f(e,t){return function(n,i,l){var a;let d,u,p,f;return Array.isArray(n)?x(n):"tokenize"in n?x([n]):(a=n,function(e){let t=null!==e&&a[e],n=null!==e&&a.null;return x([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});function x(e){return(d=e,u=0,0===e.length)?l:g(e[u])}function g(e){return function(n){let i,l,a,d,u;return(i=h(),l=c.previous,a=c.currentConstruct,d=c.events.length,u=Array.from(o),f={from:d,restore:function(){r=i,c.previous=l,c.currentConstruct=a,c.events.length=d,o=u,m()}},p=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name))?b(n):e.tokenize.call(t?Object.assign(Object.create(c),t):c,s,k,b)(n)}}function k(t){return e(p,f),i}function b(e){return(f.restore(),++u<d.length)?g(d[u]):l}}}function x(e,t){e.resolveAll&&!l.includes(e)&&l.push(e),e.resolve&&e0(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function m(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}(t,e,n)}}})(i).document().write((a=1,o="",s=!0,function(e,t,n){let r,i,c,d,u,h=[];for(e=o+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),c=0,o="",s&&(65279===e.charCodeAt(0)&&c++,s=void 0);c<e.length;){if(t6.lastIndex=c,d=(r=t6.exec(e))&&void 0!==r.index?r.index:e.length,u=e.charCodeAt(d),!r){o=e.slice(c);break}if(10===u&&c===d&&l)h.push(-3),l=void 0;else switch(l&&(h.push(-5),l=void 0),c<d&&(h.push(e.slice(c,d)),a+=d-c),u){case 0:h.push(65533),a++;break;case 9:for(i=4*Math.ceil(a/4),h.push(-2);a++<i;)h.push(-1);break;case 10:h.push(-4),a=1;break;default:l=!0,a=1}c=d+1}return n&&(l&&h.push(-5),o&&h.push(o),h.push(null)),h})(n,r,!0))))}}let ni="object"==typeof self?self:globalThis,nl=e=>{var t;let n,r;return(t=new Map,n=(e,n)=>(t.set(n,e),e),r=i=>{if(t.has(i))return t.get(i);let[l,a]=e[i];switch(l){case 0:case -1:return n(a,i);case 1:{let e=n([],i);for(let t of a)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),i);case 4:{let{source:e,flags:t}=a;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of a)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of a)e.add(r(t));return e}case 7:{let{name:e,message:t}=a;return n(new ni[e](t),i)}case 8:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{let{buffer:e}=new Uint8Array(a);return n(new DataView(e),a)}}return n(new ni[l](a),i)})(0)},{toString:na}={},{keys:no}=Object,ns=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=na.call(e).slice(8,-1);switch(n){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},nc=([e,t])=>0===e&&("function"===t||"symbol"===t),nd=(e,{json:t,lossy:n}={})=>{var r,i,l;let a,o,s=[];return(r=!(t||n),i=!!t,l=new Map,a=(e,t)=>{let n=s.push(e)-1;return l.set(t,n),n},o=e=>{if(l.has(e))return l.get(e);let[t,n]=ns(e);switch(t){case 0:{let i=e;switch(n){case"bigint":t=8,i=e.toString();break;case"function":case"symbol":if(r)throw TypeError("unable to serialize "+n);i=null;break;case"undefined":return a([-1],e)}return a([t,i],e)}case 1:{if(n){let t=e;return"DataView"===n?t=new Uint8Array(e.buffer):"ArrayBuffer"===n&&(t=new Uint8Array(e)),a([n,[...t]],e)}let r=[],i=a([t,r],e);for(let t of e)r.push(o(t));return i}case 2:{if(n)switch(n){case"BigInt":return a([n,e.toString()],e);case"Boolean":case"Number":case"String":return a([n,e.valueOf()],e)}if(i&&"toJSON"in e)return o(e.toJSON());let l=[],s=a([t,l],e);for(let t of no(e))(r||!nc(ns(e[t])))&&l.push([o(t),o(e[t])]);return s}case 3:return a([t,e.toISOString()],e);case 4:{let{source:n,flags:r}=e;return a([t,{source:n,flags:r}],e)}case 5:{let n=[],i=a([t,n],e);for(let[t,i]of e)(r||!(nc(ns(t))||nc(ns(i))))&&n.push([o(t),o(i)]);return i}case 6:{let n=[],i=a([t,n],e);for(let t of e)(r||!nc(ns(t)))&&n.push(o(t));return i}}let{message:s}=e;return a([t,{name:n,message:s}],e)})(e),s},nu="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?nl(nd(e,t)):structuredClone(e):(e,t)=>nl(nd(e,t));function nh(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let l=e.charCodeAt(n),a="";if(37===l&&e3(e.charCodeAt(n+1))&&e3(e.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(a=String.fromCharCode(l));else if(l>55295&&l<57344){let t=e.charCodeAt(n+1);l<56320&&t>56319&&t<57344?(a=String.fromCharCode(l,t),i=1):a="�"}else a=String.fromCharCode(l);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function np(e,t){let n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function nf(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let nx=function(e){var t,n;if(null==e)return ng;if("function"==typeof e)return nm(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=nx(e[n]);return nm(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):(t=e,nm(function(e){let n;for(n in t)if(e[n]!==t[n])return!1;return!0}))}if("string"==typeof e){return n=e,nm(function(e){return e&&e.type===n})}throw Error("Expected function, string, or object as test")};function nm(e){return function(t,n,r){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function ng(){return!0}let nk=[];function nb(e,t,n,r){let i;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):i=t;let l=nx(i),a=r?-1:1;(function e(i,o,s){let c=i&&"object"==typeof i?i:{};if("string"==typeof c.type){let e="string"==typeof c.tagName?c.tagName:"string"==typeof c.name?c.name:void 0;Object.defineProperty(d,"name",{value:"node ("+i.type+(e?"<"+e+">":"")+")"})}return d;function d(){var c;let d,u,h,p=nk;if((!t||l(i,o,s[s.length-1]||void 0))&&!1===(p=Array.isArray(c=n(i,s))?c:"number"==typeof c?[!0,c]:null==c?nk:[c])[0])return p;if("children"in i&&i.children&&i.children&&"skip"!==p[0])for(u=(r?i.children.length:-1)+a,h=s.concat(i);u>-1&&u<i.children.length;){if(!1===(d=e(i.children[u],u,h)())[0])return d;u="number"==typeof d[1]?d[1]:u+a}return p}})(e,void 0,[])()}function nv(e,t,n,r){let i,l,a;"function"==typeof t&&"function"!=typeof n?(l=void 0,a=t,i=n):(l=t,a=n,i=r),nb(e,l,function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return a(e,r,n)},i)}function ny(e,t){let n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];let i=e.all(t),l=i[0];l&&"text"===l.type?l.value="["+l.value:i.unshift({type:"text",value:"["});let a=i[i.length-1];return a&&"text"===a.type?a.value+=r:i.push({type:"text",value:r}),i}function nw(e){let t=e.spread;return null==t?e.children.length>1:t}function nj(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;9===t||32===t;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}let nz={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l={type:"element",tagName:"pre",properties:{},children:[l=e.applyData(t,l)]},e.patch(t,l),l},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){let n,r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),l=nh(i.toLowerCase()),a=e.footnoteOrder.indexOf(i),o=e.footnoteCounts.get(i);void 0===o?(o=0,e.footnoteOrder.push(i),n=e.footnoteOrder.length):n=a+1,o+=1,e.footnoteCounts.set(i,o);let s={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+l,id:r+"fnref-"+l+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,s);let c={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ny(e,t);let i={src:nh(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(i.title=r.title);let l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,l),e.applyData(t,l)},image:function(e,t){let n={src:nh(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ny(e,t);let i={href:nh(r.url||"")};null!==r.title&&void 0!==r.title&&(i.title=r.title);let l={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)},link:function(e,t){let n={href:nh(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),i=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=nw(n[r])}return t}(n):nw(t),l={},a=[];if("boolean"==typeof t.checked){let e,n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let o=-1;for(;++o<r.length;){let e=r[o];(i||0!==o||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||i?a.push(e):a.push(...e.children)}let s=r[r.length-1];s&&(i||"element"!==s.type||"p"!==s.tagName)&&a.push({type:"text",value:"\n"});let c={type:"element",tagName:"li",properties:l,children:a};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){let n={},r=e.all(t),i=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++i<r.length;){let e=r[i];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=eL(t.children[1]),a=eM(t.children[t.children.length-1]);l&&a&&(r.position={start:l,end:a}),i.push(r)}let l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,i=0===(r?r.indexOf(t):1)?"th":"td",l=n&&"table"===n.type?n.align:void 0,a=l?l.length:t.children.length,o=-1,s=[];for(;++o<a;){let n=t.children[o],r={},a=l?l[o]:void 0;a&&(r.align=a);let c={type:"element",tagName:i,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),s.push(c)}let c={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,l=[];for(;r;)l.push(nj(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return l.push(nj(t.slice(i),i>0,!1)),l.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:nN,yaml:nN,definition:nN,footnoteDefinition:nN};function nN(){}let nC={}.hasOwnProperty,nS={};function nM(e,t){e.position&&(t.position=function(e){let t=eL(e),n=eM(e);if(t&&n)return{start:t,end:n}}(e))}function nL(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&i&&Object.assign(n.properties,nu(i)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function nA(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function nT(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function nE(e,t){let n,r,i,l,a=(n=t||nS,r=new Map,i=new Map,l={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r<n.length;){let i=l.one(n[r],e);if(i){if(r&&"break"===n[r-1].type&&(Array.isArray(i)||"text"!==i.type||(i.value=nT(i.value)),!Array.isArray(i)&&"element"===i.type)){let e=i.children[0];e&&"text"===e.type&&(e.value=nT(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t},applyData:nL,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...nz,...n.handlers},one:function(e,t){let n=e.type,r=l.handlers[n];if(nC.call(l.handlers,n)&&r)return r(l,e,t);if(l.options.passThrough&&l.options.passThrough.includes(n)){if("children"in e){let{children:t,...n}=e,r=nu(n);return r.children=l.all(e),r}return nu(e)}return(l.options.unknownHandler||function(e,t){let n=t.data||{},r="value"in t&&!(nC.call(n,"hProperties")||nC.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)})(l,e,t)},options:n,patch:nM,wrap:nA},nv(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),l),o=a.one(e,void 0),s=function(e){let t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||np,r=e.options.footnoteBackLabel||nf,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[],s=-1;for(;++s<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[s]);if(!i)continue;let l=e.all(i),a=String(i.identifier).toUpperCase(),c=nh(a.toLowerCase()),d=0,u=[],h=e.footnoteCounts.get(a);for(;void 0!==h&&++d<=h;){u.length>0&&u.push({type:"text",value:" "});let e="string"==typeof n?n:n(s,d);"string"==typeof e&&(e={type:"text",value:e}),u.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(s,d),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let p=l[l.length-1];if(p&&"element"===p.type&&"p"===p.tagName){let e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...u)}else l.push(...u);let f={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(l,!0)};e.patch(i,f),o.push(f)}if(0!==o.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...nu(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:"\n"}]}}(a),c=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return s&&($("children"in c),c.children.push({type:"text",value:"\n"},s)),c}function nD(e,t){return e&&"run"in e?async function(n,r){let i=nE(n,{file:r,...t});await e.run(i,r)}:function(n,r){return nE(n,{file:r,...e||t})}}function nI(e){if(e)throw e}var nP=e.i(75609);function nF(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let nR=function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');n_(e);let r=0,i=-1,l=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;l--;)if(47===e.codePointAt(l)){if(n){r=l+1;break}}else i<0&&(n=!0,i=l+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let a=-1,o=t.length-1;for(;l--;)if(47===e.codePointAt(l)){if(n){r=l+1;break}}else a<0&&(n=!0,a=l+1),o>-1&&(e.codePointAt(l)===t.codePointAt(o--)?o<0&&(i=l):(o=-1,i=a));return r===i?i=a:i<0&&(i=e.length),e.slice(r,i)},nB=function(e){let t;if(n_(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},nO=function(e){let t;n_(e);let n=e.length,r=-1,i=0,l=-1,a=0;for(;n--;){let o=e.codePointAt(n);if(47===o){if(t){i=n+1;break}continue}r<0&&(t=!0,r=n+1),46===o?l<0?l=n:1!==a&&(a=1):l>-1&&(a=-1)}return l<0||r<0||0===a||1===a&&l===r-1&&l===i+1?"":e.slice(l,r)},n$=function(...e){var t;let n,r,i,l=-1;for(;++l<e.length;)n_(e[l]),e[l]&&(i=void 0===i?e[l]:i+"/"+e[l]);return void 0===i?".":(n_(t=i),n=47===t.codePointAt(0),0!==(r=function(e,t){let n,r,i="",l=0,a=-1,o=0,s=-1;for(;++s<=e.length;){if(s<e.length)n=e.codePointAt(s);else if(47===n)break;else n=47;if(47===n){if(a===s-1||1===o);else if(a!==s-1&&2===o){if(i.length<2||2!==l||46!==i.codePointAt(i.length-1)||46!==i.codePointAt(i.length-2)){if(i.length>2){if((r=i.lastIndexOf("/"))!==i.length-1){r<0?(i="",l=0):l=(i=i.slice(0,r)).length-1-i.lastIndexOf("/"),a=s,o=0;continue}}else if(i.length>0){i="",l=0,a=s,o=0;continue}}t&&(i=i.length>0?i+"/..":"..",l=2)}else i.length>0?i+="/"+e.slice(a+1,s):i=e.slice(a+1,s),l=s-a-1;a=s,o=0}else 46===n&&o>-1?o++:o=-1}return i}(t,!n)).length||n||(r="."),r.length>0&&47===t.codePointAt(t.length-1)&&(r+="/"),n?"/"+r:r)};function n_(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function nW(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let nH=["history","path","basename","stem","extname","dirname"];class nU{constructor(e){let t,n;t=e?nW(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<nH.length;){const e=nH[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)nH.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?nR(this.path):void 0}set basename(e){nq(e,"basename"),nV(e,"basename"),this.path=n$(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?nB(this.path):void 0}set dirname(e){nY(this.basename,"dirname"),this.path=n$(e||"",this.basename)}get extname(){return"string"==typeof this.path?nO(this.path):void 0}set extname(e){if(nV(e,"extname"),nY(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=n$(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){nW(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!nW(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let t=e.pathname,n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){let e=t.codePointAt(n+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),nq(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?nR(this.path,this.extname):void 0}set stem(e){nq(e,"stem"),nV(e,"stem"),this.path=n$(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new eP(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function nV(e,t){if(e&&e.includes("/"))throw Error("`"+t+"` cannot be a path: did not expect `/`")}function nq(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function nY(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let nK=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},nX={}.hasOwnProperty;class nG extends nK{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);!function i(l,...a){let o=e[++n],s=-1;if(l)return void r(l);for(;++s<t.length;)(null===a[s]||void 0===a[s])&&(a[s]=t[s]);t=a,o?(function(e,t){let n;return function(...t){let l,a=e.length>t.length;a&&t.push(r);try{l=e.apply(this,t)}catch(e){if(a&&n)throw e;return r(e)}a||(l&&l.then&&"function"==typeof l.then?l.then(i,r):l instanceof Error?r(l):i(l))};function r(e,...i){n||(n=!0,t(e,...i))}function i(e){r(null,e)}})(o,i)(...a):r(null,...a)}(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){let e=new nG,t=-1;for(;++t<this.attachers.length;){let n=this.attachers[t];e.use(...n)}return e.data((0,nP.default)(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(n0("data",this.frozen),this.namespace[e]=t,this):nX.call(this.namespace,e)&&this.namespace[e]||void 0:e?(n0("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=n2(e),n=this.parser||this.Parser;return nQ("parse",n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),nQ("process",this.parser||this.Parser),nZ("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let l=n2(e),a=n.parse(l);function o(e,n){e||!n?i(e):r?r(n):($(t,"`done` is defined if `resolve` is not"),t(void 0,n))}n.run(a,l,function(e,t,r){var i,l;if(e||!t||!r)return o(e);let a=n.stringify(t,r);"string"==typeof(i=a)||(l=i)&&"object"==typeof l&&"byteLength"in l&&"byteOffset"in l?r.value=a:r.result=a,o(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),nQ("processSync",this.parser||this.Parser),nZ("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,nI(e),t=r}),n5("processSync","process",n),$(t,"we either bailed on an error or have a tree"),t}run(e,t,n){n1(e),this.freeze();let r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,l){$("function"!=typeof t,"`file` can’t be a `done` anymore, we checked");let a=n2(t);r.run(e,a,function(t,r,a){let o=r||e;t?l(t):i?i(o):($(n,"`done` is defined if `resolve` is not"),n(void 0,o,a))})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){nI(e),n=t,r=!0}),n5("runSync","run",r),$(n,"we either bailed on an error or have a tree"),n}stringify(e,t){this.freeze();let n=n2(t),r=this.compiler||this.Compiler;return nZ("stringify",r),n1(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(n0("use",this.frozen),null==e);else if("function"==typeof e)a(e,t);else if("object"==typeof e)Array.isArray(e)?l(e):i(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(e.plugins),e.settings&&(r.settings=(0,nP.default)(!0,r.settings,e.settings))}function l(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)a(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[t,...n]=e;a(t,n)}else i(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function a(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(-1===i)n.push([e,...t]);else if(t.length>0){let[r,...l]=t,a=n[i][1];nF(a)&&nF(r)&&(r=(0,nP.default)(!0,a,r)),n[i]=[e,r,...l]}}}}let nJ=new nG().freeze();function nQ(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function nZ(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function n0(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function n1(e){if(!nF(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function n5(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function n2(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new nU(e)}let n4=[],n3={allowDangerousHtml:!0},n6=/^(https?|ircs?|mailto|xmpp)$/i,n8=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function n7(e){var t;let r,i,l,a,o,s=(r=(t=e).rehypePlugins||n4,i=t.remarkPlugins||n4,l=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...n3}:n3,nJ().use(nr).use(i).use(nD,l).use(r)),c=(a=e.children||"",o=new nU,"string"==typeof a?o.value=a:_("Unexpected value `"+a+"` for `children` prop, expected `string`"),o);return function(e,t){let r=t.allowedElements,i=t.allowElement,l=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||n9;for(let e of n8)Object.hasOwn(t,e.from)&&_("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return r&&a&&_("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),nv(e,function(e,t,n){if("raw"===e.type&&n&&"number"==typeof t)return o?n.children.splice(t,1):n.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in eX)if(Object.hasOwn(eX,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=eX[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=c(String(n||""),t,e))}}if("element"===e.type){let l=r?!r.includes(e.tagName):!!a&&a.includes(e.tagName);if(!l&&i&&"number"==typeof t&&(l=!i(e,t,n)),l&&n&&"number"==typeof t)return s&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}),function(e,t){var n,r,i,l;let a;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let o=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=o,r=t.jsxDEV,a=function(e,t,i,l){let a=Array.isArray(i.children),o=eL(e);return r(t,i,l,a,{columnNumber:o?o.column-1:void 0,fileName:n,lineNumber:o?o.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");i=t.jsx,l=t.jsxs,a=function(e,t,n,r){let a=Array.isArray(n.children)?l:i;return r?a(t,n,r):a(t,n)}}let s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:o,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?eC:eN,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},c=eW(s,e,void 0);return c&&"string"!=typeof c?c:s.create(e,s.Fragment,{children:c||void 0},void 0)}(e,{Fragment:n.Fragment,components:l,ignoreInvalidStyle:!0,jsx:n.jsx,jsxs:n.jsxs,passKeys:!0,passNode:!0})}(s.runSync(s.parse(c),c),e)}function n9(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return -1===t||-1!==i&&t>i||-1!==n&&t>n||-1!==r&&t>r||n6.test(e.slice(0,t))?e:""}function re(e,t){let n=String(e);if("string"!=typeof t)throw TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}let rt="phrasing",rn=["autolink","link","image","label"];function rr(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ri(e){this.config.enter.autolinkProtocol.call(this,e)}function rl(e){this.config.exit.autolinkProtocol.call(this,e)}function ra(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];$("link"===t.type),t.url="http://"+this.sliceSerialize(e)}function ro(e){this.config.exit.autolinkEmail.call(this,e)}function rs(e){this.exit(e)}function rc(e){!function(e,t,n){let r=nx((n||{}).ignore||[]),i=function(e){let t=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){var i;let e=n[r];t.push(["string"==typeof(i=e[0])?RegExp(function(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(i),"g"):i,function(e){return"function"==typeof e?e:function(){return e}}(e[1])])}return t}(t),l=-1;for(;++l<i.length;)nb(e,"text",a);function a(e,t){let n,a=-1;for(;++a<t.length;){let e=t[a],i=n?n.children:void 0;if(r(e,i?i.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){let n=t[t.length-1],r=i[l][0],a=i[l][1],o=0,s=n.children.indexOf(e),c=!1,d=[];r.lastIndex=0;let u=r.exec(e.value);for(;u;){let n=u.index,i={index:u.index,input:u.input,stack:[...t,e]},l=a(...u,i);if("string"==typeof l&&(l=l.length>0?{type:"text",value:l}:void 0),!1===l?r.lastIndex=n+1:(o!==n&&d.push({type:"text",value:e.value.slice(o,n)}),Array.isArray(l)?d.push(...l):l&&d.push(l),o=n+u[0].length,c=!0),!r.global)break;u=r.exec(e.value)}return c?(o<e.value.length&&d.push({type:"text",value:e.value.slice(o)}),n.children.splice(s,1,...d)):d=[e],s+d.length}(e,t)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,rd],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,ru]],{ignore:["link","linkReference"]})}function rd(e,t,n,r,i){let l,a="";if(!rh(i))return!1;if(/^w/i.test(t)&&(n=t+n,t="",a="http://"),(l=n.split(".")).length<2||l[l.length-1]&&(/_/.test(l[l.length-1])||!/[a-zA-Z\d]/.test(l[l.length-1]))||l[l.length-2]&&(/_/.test(l[l.length-2])||!/[a-zA-Z\d]/.test(l[l.length-2])))return!1;let o=function(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),i=re(e,"("),l=re(e,")");for(;-1!==r&&i>l;)e+=n.slice(0,r+1),r=(n=n.slice(r+1)).indexOf(")"),l++;return[e,n]}(n+r);if(!o[0])return!1;let s={type:"link",title:null,url:a+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[s,{type:"text",value:o[1]}]:s}function ru(e,t,n,r){return!(!rh(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function rh(e,t){let n=e.input.charCodeAt(e.index-1);return(0===e.index||tl(n)||ti(n))&&(!t||47!==n)}function rp(){this.buffer()}function rf(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function rx(){this.buffer()}function rm(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function rg(e){let t=this.resume(),n=this.stack[this.stack.length-1];$("footnoteReference"===n.type),n.identifier=t_(this.sliceSerialize(e)).toLowerCase(),n.label=t}function rk(e){this.exit(e)}function rb(e){let t=this.resume(),n=this.stack[this.stack.length-1];$("footnoteDefinition"===n.type),n.identifier=t_(this.sliceSerialize(e)).toLowerCase(),n.label=t}function rv(e){this.exit(e)}function ry(e,t,n,r){let i=n.createTracker(r),l=i.move("[^"),a=n.enter("footnoteReference"),o=n.enter("reference");return l+=i.move(n.safe(n.associationId(e),{after:"]",before:l})),o(),a(),l+=i.move("]")}function rw(e,t,n){return 0===t?e:rj(e,t,n)}function rj(e,t,n){return(n?"":" ")+e}ry.peek=function(){return"["};let rz=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function rN(e){this.enter({type:"delete",children:[]},e)}function rC(e){this.exit(e)}function rS(e,t,n,r){let i=n.createTracker(r),l=n.enter("strikethrough"),a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),l(),a}function rM(e){return e.length}function rL(e){let t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:114*(82===t||114===t)}rS.peek=function(){return"~"};function rA(e,t,n){let r=e.value||"",i="`",l=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){let e,t=n.unsafe[l],i=n.compilePattern(t);if(t.atBreak)for(;e=i.exec(r);){let t=e.index;10===r.charCodeAt(t)&&13===r.charCodeAt(t-1)&&t--,r=r.slice(0,t)+" "+r.slice(e.index+1)}}return i+r+i}rA.peek=function(){return"`"};nx(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let rT=function(e,t,n,r){let i=function(e){let t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n),l=n.bulletCurrent||function(e){let t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}(n);t&&"list"===t.type&&t.ordered&&(l=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+l);let a=l.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(a=4*Math.ceil(a/4));let o=n.createTracker(r);o.move(l+" ".repeat(a-l.length)),o.shift(a);let s=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),function(e,t,n){return t?(n?"":" ".repeat(a))+e:(n?l:l+" ".repeat(a-l.length))+e});return s(),c};function rE(e){let t=e._align;$(t,"expected `_align` on table"),this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function rD(e){this.exit(e),this.data.inTable=void 0}function rI(e){this.enter({type:"tableRow",children:[]},e)}function rP(e){this.exit(e)}function rF(e){this.enter({type:"tableCell",children:[]},e)}function rR(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,rB));let n=this.stack[this.stack.length-1];$("inlineCode"===n.type),n.value=t,this.exit(e)}function rB(e,t){return"|"===t?t:e}function rO(e){let t=this.stack[this.stack.length-2];$("listItem"===t.type),t.checked="taskListCheckValueChecked"===e.type}function r$(e){let t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){let e=this.stack[this.stack.length-1];$("paragraph"===e.type);let n=e.children[0];if(n&&"text"===n.type){let r,i=t.children,l=-1;for(;++l<i.length;){let e=i[l];if("paragraph"===e.type){r=e;break}}r===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function r_(e,t,n,r){let i=e.children[0],l="boolean"==typeof e.checked&&i&&"paragraph"===i.type,a="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);l&&o.move(a);let s=rT(e,t,n,{...r,...o.current()});return l&&(s=s.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+a})),s}let rW={tokenize:function(e,t,n){let r=0;return function t(l){return(87===l||119===l)&&r<3?(r++,e.consume(l),t):46===l&&3===r?(e.consume(l),i):n(l)};function i(e){return null===e?n(e):t(e)}},partial:!0},rH={tokenize:function(e,t,n){let r,i,l;return a;function a(t){return 46===t||95===t?e.check(rV,s,o)(t):null===t||tn(t)||tl(t)||45!==t&&ti(t)?s(t):(l=!0,e.consume(t),a)}function o(t){return 95===t?r=!0:(i=r,r=void 0),e.consume(t),a}function s(e){return i||r||!l?n(e):t(e)}},partial:!0},rU={tokenize:function(e,t){let n=0,r=0;return i;function i(a){return 40===a?(n++,e.consume(a),i):41===a&&r<n?l(a):33===a||34===a||38===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||60===a||63===a||93===a||95===a||126===a?e.check(rV,t,l)(a):null===a||tn(a)||tl(a)?t(a):(e.consume(a),i)}function l(t){return 41===t&&r++,e.consume(t),i}},partial:!0},rV={tokenize:function(e,t,n){return r;function r(a){return 33===a||34===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||63===a||95===a||126===a?(e.consume(a),r):38===a?(e.consume(a),l):93===a?(e.consume(a),i):60===a||null===a||tn(a)||tl(a)?t(a):n(a)}function i(e){return null===e||40===e||91===e||tn(e)||tl(e)?t(e):r(e)}function l(t){return e4(t)?function t(i){return 59===i?(e.consume(i),r):e4(i)?(e.consume(i),t):n(i)}(t):n(t)}},partial:!0},rq={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return e3(e)?n(e):t(e)}},partial:!0},rY={name:"wwwAutolink",tokenize:function(e,t,n){let r=this;return function(t){return 87!==t&&119!==t||!rQ.call(r,r.previous)||r5(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(rW,e.attempt(rH,e.attempt(rU,i),n),n)(t))};function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:rQ},rK={name:"protocolAutolink",tokenize:function(e,t,n){let r=this,i="",l=!1;return function(t){return(72===t||104===t)&&rZ.call(r,r.previous)&&!r5(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(t),e.consume(t),a):n(t)};function a(t){if(e4(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),a;if(58===t){let n=i.toLowerCase();if("http"===n||"https"===n)return e.consume(t),o}return n(t)}function o(t){return 47===t?(e.consume(t),l)?s:(l=!0,o):n(t)}function s(t){return null===t||e8(t)||tn(t)||tl(t)||ti(t)?n(t):e.attempt(rH,e.attempt(rU,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:rZ},rX={name:"emailAutolink",tokenize:function(e,t,n){let r,i,l=this;return function(t){return!r1(t)||!r0.call(l,l.previous)||r5(l.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),function t(r){return r1(r)?(e.consume(r),t):64===r?(e.consume(r),a):n(r)}(t))};function a(t){return 46===t?e.check(rq,s,o)(t):45===t||95===t||e3(t)?(i=!0,e.consume(t),a):s(t)}function o(t){return e.consume(t),r=!0,a}function s(a){return i&&r&&e4(l.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(a)):n(a)}},previous:r0},rG={},rJ=48;for(;rJ<123;)rG[rJ]=rX,58==++rJ?rJ=65:91===rJ&&(rJ=97);function rQ(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||tn(e)}function rZ(e){return!e4(e)}function r0(e){return!(47===e||r1(e))}function r1(e){return 43===e||45===e||46===e||95===e||e3(e)}function r5(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}rG[43]=rX,rG[45]=rX,rG[46]=rX,rG[95]=rX,rG[72]=[rX,rK],rG[104]=[rX,rK],rG[87]=[rX,rY],rG[119]=[rX,rY];let r2={tokenize:function(e,t,n){let r=this;return to(e,function(e){let i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function r4(e,t,n){let r,i=this,l=i.events.length,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);for(;l--;){let e=i.events[l][1];if("labelImage"===e.type){r=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(l){if(!r||!r._balanced)return n(l);let o=t_(i.sliceSerialize({start:r.end,end:i.now()}));return 94===o.codePointAt(0)&&a.includes(o.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l)):n(l)}}function r3(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",l,t],["enter",a,t],["exit",a,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function r6(e,t,n){let r,i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),a=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),o};function o(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",s)}function s(o){if(a>999||93===o&&!r||null===o||91===o||tn(o))return n(o);if(93===o){e.exit("chunkString");let r=e.exit("gfmFootnoteCallString");return l.includes(t_(i.sliceSerialize(r)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(o)}return tn(o)||(r=!0),a++,e.consume(o),92===o?c:s}function c(t){return 91===t||92===t||93===t?(e.consume(t),a++,s):s(t)}}function r8(e,t,n){let r,i,l=this,a=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]),o=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),s};function s(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(o>999||93===t&&!i||null===t||91===t||tn(t))return n(t);if(93===t){e.exit("chunkString");let n=e.exit("gfmFootnoteDefinitionLabelString");return r=t_(l.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),u}return tn(t)||(i=!0),o++,e.consume(t),92===t?d:c}function d(t){return 91===t||92===t||93===t?(e.consume(t),o++,c):c(t)}function u(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a.includes(r)||a.push(r),to(e,h,"gfmFootnoteDefinitionWhitespace")):n(t)}function h(e){return t(e)}}function r7(e,t,n){return e.check(tu,t,e.attempt(r2,t,n))}function r9(e){e.exit("gfmFootnoteDefinition")}class ie{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let i=0;if(0!==n||0!==r.length){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length,n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}}function it(e,t,n){let r,i=this,l=0,a=0;return function(e){let t=i.events.length-1;for(;t>-1;){let e=i.events[t][1].type;if("lineEnding"===e||"linePrefix"===e)t--;else break}let r=t>-1?i.events[t][1].type:null,l="tableHead"===r||"tableRow"===r?k:o;return l===k&&i.parser.lazy[i.now().line]?n(e):l(e)};function o(t){var n;return e.enter("tableHead"),e.enter("tableRow"),124===(n=t)||(r=!0,a+=1),s(n)}function s(t){return null===t?n(t):tt(t)?a>1?(a=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),u):n(t):tr(t)?to(e,s,"whitespace")(t):(a+=1,r&&(r=!1,l+=1),124===t)?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),r=!0,s):(e.enter("data"),c(t))}function c(t){return null===t||124===t||tn(t)?(e.exit("data"),s(t)):(e.consume(t),92===t?d:c)}function d(t){return 92===t||124===t?(e.consume(t),c):c(t)}function u(t){return(i.interrupt=!1,i.parser.lazy[i.now().line])?n(t):(e.enter("tableDelimiterRow"),r=!1,tr(t))?to(e,h,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):h(t)}function h(t){return 45===t||58===t?f(t):124===t?(r=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),p):n(t)}function p(t){return tr(t)?to(e,f,"whitespace")(t):f(t)}function f(t){return 58===t?(a+=1,r=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),x):45===t?(a+=1,x(t)):null===t||tt(t)?g(t):n(t)}function x(t){return 45===t?(e.enter("tableDelimiterFiller"),function t(n){return 45===n?(e.consume(n),t):58===n?(r=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(n),e.exit("tableDelimiterMarker"),m):(e.exit("tableDelimiterFiller"),m(n))}(t)):n(t)}function m(t){return tr(t)?to(e,g,"whitespace")(t):g(t)}function g(i){if(124===i)return h(i);if(null===i||tt(i))return r&&l===a?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(i)):n(i);return n(i)}function k(t){return e.enter("tableRow"),b(t)}function b(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),b):null===n||tt(n)?(e.exit("tableRow"),t(n)):tr(n)?to(e,b,"whitespace")(n):(e.enter("data"),v(n))}function v(t){return null===t||124===t||tn(t)?(e.exit("data"),b(t)):(e.consume(t),92===t?y:v)}function y(t){return 92===t||124===t?(e.consume(t),v):v(t)}}function ir(e,t){let n,r,i,l=-1,a=!0,o=0,s=[0,0,0,0],c=[0,0,0,0],d=!1,u=0,h=new ie;for(;++l<e.length;){let p=e[l],f=p[1];"enter"===p[0]?"tableHead"===f.type?(d=!1,0!==u&&(il(h,t,u,n,r),r=void 0,u=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},h.add(l,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(a=!0,i=void 0,s=[0,0,0,0],c=[0,l+1,0,0],d&&(d=!1,r={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},h.add(l,0,[["enter",r,t]])),o="tableDelimiterRow"===f.type?2:r?3:1):o&&("data"===f.type||"tableDelimiterMarker"===f.type||"tableDelimiterFiller"===f.type)?(a=!1,0===c[2]&&(0!==s[1]&&(c[0]=c[1],i=ii(h,t,s,o,void 0,i),s=[0,0,0,0]),c[2]=l)):"tableCellDivider"===f.type&&(a?a=!1:(0!==s[1]&&(c[0]=c[1],i=ii(h,t,s,o,void 0,i)),c=[(s=c)[1],l,0,0])):"tableHead"===f.type?(d=!0,u=l):"tableRow"===f.type||"tableDelimiterRow"===f.type?(u=l,0!==s[1]?(c[0]=c[1],i=ii(h,t,s,o,l,i)):0!==c[1]&&(i=ii(h,t,c,o,l,i)),o=0):o&&("data"===f.type||"tableDelimiterMarker"===f.type||"tableDelimiterFiller"===f.type)&&(c[3]=l)}for(0!==u&&il(h,t,u,n,r),h.consume(t.events),l=-1;++l<t.events.length;){let e=t.events[l];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=function(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if("enter"===i[0])"tableContent"===i[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===i[1].type){if("tableDelimiterMarker"===e[t-1][1].type){let e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===i[1].type)break}else"enter"===i[0]&&"tableDelimiterRow"===i[1].type&&(n=!0);t+=1}return r}(t.events,l))}return e}function ii(e,t,n,r,i,l){0!==n[0]&&(l.end=Object.assign({},ia(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));let a=ia(t.events,n[1]);if(l={type:1===r?"tableHeader":2===r?"tableDelimiter":"tableData",start:Object.assign({},a),end:Object.assign({},a)},e.add(n[1],0,[["enter",l,t]]),0!==n[2]){let i=ia(t.events,n[2]),l=ia(t.events,n[3]),a={type:"tableContent",start:Object.assign({},i),end:Object.assign({},l)};if(e.add(n[2],0,[["enter",a,t]]),2!==r){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",a,t]])}return void 0!==i&&(l.end=Object.assign({},ia(t.events,i)),e.add(i,0,[["exit",l,t]]),l=void 0),l}function il(e,t,n,r,i){let l=[],a=ia(t.events,n);i&&(i.end=Object.assign({},a),l.push(["exit",i,t])),r.end=Object.assign({},a),l.push(["exit",r,t]),e.add(n+1,0,l)}function ia(e,t){let n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}let io={name:"tasklistCheck",tokenize:function(e,t,n){let r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i):n(t)};function i(t){return tn(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),l):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),l):n(t)}function l(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(t)}function a(r){return tt(r)?t(r):tr(r)?e.check({tokenize:is},t,n)(r):n(r)}}};function is(e,t,n){return to(e,function(e){return null===e?n(e):t(e)},"whitespace")}let ic={};function id(e){let t,n,r,i=e||ic,l=this.data(),a=l.micromarkExtensions||(l.micromarkExtensions=[]),o=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),s=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);a.push(e2([{text:rG},{document:{91:{name:"gfmFootnoteDefinition",tokenize:r8,continuation:{tokenize:r7},exit:r9}},text:{91:{name:"gfmFootnoteCall",tokenize:r6},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:r4,resolveTo:r3}}},(t=(i||{}).singleTilde,n={name:"strikethrough",tokenize:function(e,n,r){let i=this.previous,l=this.events,a=0;return function(o){return 126===i&&"characterEscape"!==l[l.length-1][1].type?r(o):(e.enter("strikethroughSequenceTemporary"),function l(o){let s=tz(i);if(126===o)return a>1?r(o):(e.consume(o),a++,l);if(a<2&&!t)return r(o);let c=e.exit("strikethroughSequenceTemporary"),d=tz(o);return c._open=!d||2===d&&!!s,c._close=!s||2===s&&!!d,n(o)}(o))}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";let i={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},l={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},a=[["enter",i,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",l,t]],o=t.parser.constructs.insideSpan.null;o&&e0(a,a.length,0,tN(o,e.slice(r+1,n),t)),e0(a,a.length,0,[["exit",l,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",i,t]]),e0(e,r-1,n-r+3,a),n=r+a.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}},null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}),{flow:{null:{name:"table",tokenize:it,resolveAll:ir}}},{text:{91:io}}])),o.push([{transforms:[rc],enter:{literalAutolink:rr,literalAutolinkEmail:ri,literalAutolinkHttp:ri,literalAutolinkWww:ri},exit:{literalAutolink:rs,literalAutolinkEmail:ro,literalAutolinkHttp:rl,literalAutolinkWww:ra}},{enter:{gfmFootnoteCallString:rp,gfmFootnoteCall:rf,gfmFootnoteDefinitionLabelString:rx,gfmFootnoteDefinition:rm},exit:{gfmFootnoteCallString:rg,gfmFootnoteCall:rk,gfmFootnoteDefinitionLabelString:rb,gfmFootnoteDefinition:rv}},{canContainEols:["delete"],enter:{strikethrough:rN},exit:{strikethrough:rC}},{enter:{table:rE,tableData:rF,tableHeader:rF,tableRow:rI},exit:{codeText:rR,table:rD,tableData:rP,tableHeader:rP,tableRow:rP}},{exit:{taskListCheckValueChecked:rO,taskListCheckValueUnchecked:rO,paragraph:r$}}]),s.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:rt,notInConstruct:rn},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:rt,notInConstruct:rn},{character:":",before:"[ps]",after:"\\/",inConstruct:rt,notInConstruct:rn}]},(r=!1,i&&i.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:function(e,t,n,i){let l=n.createTracker(i),a=l.move("[^"),o=n.enter("footnoteDefinition"),s=n.enter("label");return a+=l.move(n.safe(n.associationId(e),{before:a,after:"]"})),s(),a+=l.move("]:"),e.children&&e.children.length>0&&(l.shift(4),a+=l.move((r?"\n":" ")+n.indentLines(n.containerFlow(e,l.current()),r?rj:rw))),o(),a},footnoteReference:ry},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:rz}],handlers:{delete:rS}},function(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=rA(e,t,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r},table:function(e,t,n,r){return o(function(e,t,n){let r=e.children,i=-1,l=[],a=t.enter("table");for(;++i<r.length;)l[i]=s(r[i],t,n);return a(),l}(e,n,r),e.align)},tableCell:a,tableRow:function(e,t,n,r){let i=o([s(e,n,r)]);return i.slice(0,i.indexOf("\n"))}}};function a(e,t,n,r){let i=n.enter("tableCell"),a=n.enter("phrasing"),o=n.containerPhrasing(e,{...r,before:l,after:l});return a(),i(),o}function o(e,t){return function(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||rM,l=[],a=[],o=[],s=[],c=0,d=-1;for(;++d<e.length;){let t=[],r=[],l=-1;for(e[d].length>c&&(c=e[d].length);++l<e[d].length;){var u;let a=null==(u=e[d][l])?"":String(u);if(!1!==n.alignDelimiters){let e=i(a);r[l]=e,(void 0===s[l]||e>s[l])&&(s[l]=e)}t.push(a)}a[d]=t,o[d]=r}let h=-1;if("object"==typeof r&&"length"in r)for(;++h<c;)l[h]=rL(r[h]);else{let e=rL(r);for(;++h<c;)l[h]=e}h=-1;let p=[],f=[];for(;++h<c;){let e=l[h],t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let i=!1===n.alignDelimiters?1:Math.max(1,s[h]-t.length-r.length),a=t+"-".repeat(i)+r;!1!==n.alignDelimiters&&((i=t.length+i+r.length)>s[h]&&(s[h]=i),f[h]=i),p[h]=a}a.splice(1,0,p),o.splice(1,0,f),d=-1;let x=[];for(;++d<a.length;){let e=a[d],t=o[d];h=-1;let r=[];for(;++h<c;){let i=e[h]||"",a="",o="";if(!1!==n.alignDelimiters){let e=s[h]-(t[h]||0),n=l[h];114===n?a=" ".repeat(e):99===n?e%2?(a=" ".repeat(e/2+.5),o=" ".repeat(e/2-.5)):o=a=" ".repeat(e/2):o=" ".repeat(e)}!1===n.delimiterStart||h||r.push("|"),!1!==n.padding&&(!1!==n.alignDelimiters||""!==i)&&(!1!==n.delimiterStart||h)&&r.push(" "),!1!==n.alignDelimiters&&r.push(a),r.push(i),!1!==n.alignDelimiters&&r.push(o),!1!==n.padding&&r.push(" "),(!1!==n.delimiterEnd||h!==c-1)&&r.push("|")}x.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return x.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function s(e,t,n){let r=e.children,i=-1,l=[],o=t.enter("tableRow");for(;++i<r.length;)l[i]=a(r[i],e,t,n);return o(),l}}(i),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:r_}}]})}var iu=e.i(24411);function ih(e){let t=new Date(e),n=Math.floor((new Date().getTime()-t.getTime())/1e3);if(n<60)return"just now";let r=Math.floor(n/60);if(r<60)return`${r}m ago`;let i=Math.floor(r/60);if(i<24)return`${i}h ago`;let l=Math.floor(i/24);return l<7?`${l}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function ip(e,t){let n=[];return n.push(`[${p(e.prefix)}] ${e.id}`),t&&n.push(t),n.push(""),n.push(e.description||""),n.join("\n")}let ix="heartbeads-settings",im={elevenLabsVoiceId:"UgBBYS2sOqTuMpoF3BR0",elevenLabsModel:"eleven_flash_v2_5"};function ig(){try{let e=localStorage.getItem(ix);if(!e)return{...im};return{...im,...JSON.parse(e)}}catch{return{...im}}}function ik(){let e=ig();return!!e.elevenLabsApiKey&&e.elevenLabsApiKey.trim().length>0}let ib=new Map;function iv(e){return e.replace(/\s+/g," ").trim().toLowerCase()}let iy=null,iw=null,ij=null;function iz(e){iy&&(iy.playbackRate=e)}function iN(){iy&&(iy.pause(),iy.currentTime=0,iy.onended=null,iy.onerror=null,iy.ontimeupdate=null,iy=null),iw&&(URL.revokeObjectURL(iw),iw=null),ij=null}function iC(e,t){ij=null;let n=URL.createObjectURL(e);iw=n;let r=new Audio(n);iy=r,t("playing"),r.onended=()=>{iN(),t("idle")},r.onerror=()=>{iN(),t("error","Audio playback failed")},r.play()}async function iS(e,t){let n;iN();let r=ig();if(!r.elevenLabsApiKey)return void t("error","No API key configured");let i=r.elevenLabsVoiceId,l=(o=r.elevenLabsModel,`${i}:${o}:${e}`),a=((n=ib.get(l))&&(ib.delete(l),ib.set(l,n)),n);if(a)return void iC(a.blob,t);t("loading");try{var o;let n=await fetch(`https://api.elevenlabs.io/v1/text-to-speech/${i}/with-timestamps?output_format=mp3_44100_128`,{method:"POST",headers:{"Content-Type":"application/json","xi-api-key":r.elevenLabsApiKey},body:JSON.stringify({text:e,model_id:r.elevenLabsModel})});if(!n.ok){let e=await n.text().catch(()=>n.statusText);throw Error(`ElevenLabs API error (${n.status}): ${e}`)}let{audio_base64:a,alignment:s}=await n.json(),c=atob(a),d=new Uint8Array(c.length);for(let e=0;e<c.length;e++)d[e]=c.charCodeAt(e);let u=new Blob([d],{type:"audio/mpeg"}),h={blob:u,alignment:{characters:s.characters,characterStartTimesSeconds:s.character_start_times_seconds,characterEndTimesSeconds:s.character_end_times_seconds},strippedText:e};if(ib.size>=10){let e=ib.keys().next().value;e&&ib.delete(e)}ib.set(l,h),iC(u,t)}catch(e){iN(),t("error",e instanceof Error?e.message:"TTS failed")}}async function iM(e,t){iN();let n=function(e){let t=iv(e);if(!t)return null;for(let e of ib.values()){let n=iv(e.strippedText).indexOf(t);if(-1===n)continue;let{strippedText:r,alignment:i}=e,l=[],a=0,o=!1;for(let e=0;e<r.length;e++)/\s/.test(r[e])?(!o&&a>0?(l.push(a),a++):l.push(-1),o=!0):(l.push(a),a++,o=!1);let s=n+t.length-1,c=-1,d=-1;for(let e=0;e<l.length;e++)l[e]===n&&-1===c&&(c=e),l[e]===s&&(d=e);if(-1===c||-1===d)continue;let u=i.characterStartTimesSeconds.length;if(0===u)continue;let h=Math.min(c,u-1),p=Math.min(d,i.characterEndTimesSeconds.length-1);if(!(h<0)&&!(p<0))return{blob:e.blob,startTime:i.characterStartTimesSeconds[h],endTime:i.characterEndTimesSeconds[p]}}return null}(e);if(n){let{blob:e,startTime:r,endTime:i}=n,l=URL.createObjectURL(e);iw=l;let a=new Audio(l);iy=a,ij=i,a.onended=()=>{iN(),t("idle")},a.onerror=()=>{iN(),t("error","Audio playback failed")},a.ontimeupdate=()=>{null!==ij&&a.currentTime>=ij&&(iN(),t("idle"))},a.currentTime=r,t("playing"),await a.play();return}await iS(e,t)}function iL(){let[e,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=window.matchMedia("(max-width: 768px)");t(e.matches);let n=e=>t(e.matches);return e.addEventListener("change",n),()=>e.removeEventListener("change",n)},[]),e}let iA=[{label:"Normal",value:1},{label:"1.25x",value:1.25},{label:"1.5x",value:1.5},{label:"1.75x",value:1.75},{label:"2x",value:2}];function iT({node:e,onClose:t,repoUrl:i,onOpenSettings:l,onNavigate:a,navigationLabel:o}){let[s,c]=(0,r.useState)(!1),[d,u]=(0,r.useState)("idle"),[h,p]=(0,r.useState)(null),[f,x]=(0,r.useState)(1),[m,g]=(0,r.useState)(!1),[k,b]=(0,r.useState)(""),[v,y]=(0,r.useState)(!1),w=(0,r.useRef)(null),j=(0,r.useRef)(null),z=iL(),[N,C]=(0,r.useState)(null),S=(0,r.useRef)(null),M=(0,r.useRef)(!1),L=(0,r.useCallback)((e,t)=>{u(e),t&&p(t)},[]),A=(0,r.useCallback)(()=>{if(!ik())return void l?.();let t=(e.description||"").replace(/```[\s\S]*?```/g,"").replace(/`([^`]+)`/g,"$1").replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/^#{1,6}\s+/gm,"").replace(/(\*{1,3}|_{1,3})(.*?)\1/g,"$2").replace(/~~(.*?)~~/g,"$1").replace(/^[-*_]{3,}\s*$/gm,"").replace(/^>\s+/gm,"").replace(/^[\s]*[-*+]\s+/gm,"").replace(/^[\s]*\d+\.\s+/gm,"").replace(/<[^>]+>/g,"").replace(/\n{3,}/g,"\n\n").trim();t&&(p(null),iS(t,L))},[e.description,l,L]),T=(0,r.useCallback)(()=>{iN(),u("idle"),g(!1),y(!1)},[]),E=(0,r.useCallback)(()=>{iy&&!iy.paused&&iy.pause(),u("paused")},[]),D=(0,r.useCallback)(()=>{iy&&iy.paused&&iy.currentTime>0&&iy.play(),u("playing")},[]),I=(0,r.useCallback)(e=>{let t=Math.max(.25,Math.min(4,e));x(t),iz(t),g(!1),y(!1)},[]);(0,r.useEffect)(()=>{"playing"===d&&iz(f)},[d,f]),(0,r.useEffect)(()=>{if(!m)return;let e=e=>{j.current&&!j.current.contains(e.target)&&w.current&&!w.current.contains(e.target)&&(g(!1),y(!1))},t=setTimeout(()=>window.addEventListener("mousedown",e),50);return()=>{clearTimeout(t),window.removeEventListener("mousedown",e)}},[m]);let P=(0,r.useCallback)(()=>{setTimeout(()=>{let e=window.getSelection();if(!e||e.isCollapsed)return;let t=e.toString().trim();if(!(t.length<3))try{let n=e.getRangeAt(0).getBoundingClientRect();C({text:t,x:n.left+n.width/2,y:n.top-8})}catch{}},10)},[]);(0,r.useEffect)(()=>{if(z)return;let e=()=>{if(M.current)return;let e=window.getSelection();e&&!e.isCollapsed&&e.toString().trim()||C(null)};return document.addEventListener("selectionchange",e),()=>document.removeEventListener("selectionchange",e)},[z]);let F=(0,r.useCallback)(()=>{if(!N)return;let e=N.text;if(e.trim()){if(!ik()){l?.(),C(null);return}M.current=!0,p(null),C(null),iM(e,L),setTimeout(()=>{M.current=!1},100)}},[N,l,L]);return((0,r.useEffect)(()=>()=>{iN(),g(!1),C(null)},[]),(0,r.useEffect)(()=>{let e=e=>{let n=e.target?.tagName;!("INPUT"===n||"TEXTAREA"===n||e.target?.isContentEditable)&&("Escape"===e.key?(e.preventDefault(),t()):"ArrowLeft"===e.key&&a?(e.preventDefault(),a("prev")):"ArrowRight"===e.key&&a&&(e.preventDefault(),a("next")))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,a]),e.description)?(0,iu.createPortal)((0,n.jsxs)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/40 backdrop-blur-sm",onClick:t,children:[(0,n.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-xl shadow-2xl w-[90vw] max-w-2xl max-h-[80vh] flex flex-col",onClick:e=>e.stopPropagation(),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,n.jsx)("span",{className:"text-xs font-mono font-semibold text-emerald-600 dark:text-emerald-400 shrink-0",children:e.id}),(0,n.jsx)("span",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100 truncate",children:e.title})]}),a&&(0,n.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,n.jsx)("button",{onClick:()=>a("prev"),className:"p-1 text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 rounded hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",title:"Previous (←)",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})})}),o&&(0,n.jsx)("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500 font-mono tabular-nums min-w-[3ch] text-center",children:o}),(0,n.jsx)("button",{onClick:()=>a("next"),className:"p-1 text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 rounded hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",title:"Next (→)",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})})})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,n.jsx)("button",{onClick:()=>{e.description&&navigator.clipboard.writeText(ip(e,i)).then(()=>{c(!0),setTimeout(()=>c(!1),1500)})},className:"p-1 text-zinc-400 dark:text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors",title:"Copy description",children:s?(0,n.jsx)("svg",{className:"w-4 h-4 text-emerald-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}):(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 0 1-.75.75H9.75a.75.75 0 0 1-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 0 1 1.927-.184"})})}),"loading"===d?(0,n.jsx)("button",{disabled:!0,className:"p-1 text-zinc-300 cursor-wait",title:"Loading audio...",children:(0,n.jsxs)("svg",{className:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:4}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}):"playing"===d?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:E,className:"p-1 text-emerald-500 hover:text-amber-500 hover:bg-amber-50 rounded transition-colors",title:"Pause",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25v13.5m-7.5-13.5v13.5"})})}),(0,n.jsx)("button",{onClick:T,className:"p-1 text-zinc-400 hover:text-red-500 hover:bg-red-50 rounded transition-colors",title:"Stop",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"})})})]}):"paused"===d?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:D,className:"p-1 text-amber-500 hover:text-emerald-500 hover:bg-emerald-50 rounded transition-colors",title:"Resume",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 010 1.972l-11.54 6.347a1.125 1.125 0 01-1.667-.986V5.653z"})})}),(0,n.jsx)("button",{onClick:T,className:"p-1 text-zinc-400 hover:text-red-500 hover:bg-red-50 rounded transition-colors",title:"Stop",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"})})})]}):(0,n.jsx)("button",{onClick:A,className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors",title:"Read aloud",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 010 12.728M16.463 8.288a5.25 5.25 0 010 7.424M6.75 8.25l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.009 9.009 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z"})})}),("playing"===d||"loading"===d||"paused"===d)&&(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("button",{ref:w,onClick:()=>g(e=>!e),className:"px-1.5 py-0.5 text-[11px] font-mono font-medium rounded text-zinc-500 hover:text-zinc-700 hover:bg-zinc-100 transition-colors",title:"Playback speed",children:1===f?"1x":`${f}x`}),m&&(0,n.jsxs)("div",{ref:j,className:"absolute right-0 top-full mt-1 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-700 rounded-lg shadow-lg overflow-hidden z-[110]",style:{minWidth:150},onClick:e=>e.stopPropagation(),children:[iA.map(e=>(0,n.jsxs)("button",{onClick:()=>I(e.value),className:`w-full px-3 py-2 text-xs text-left flex items-center justify-between hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors ${f===e.value?"text-emerald-600 dark:text-emerald-400 font-medium":"text-zinc-700 dark:text-zinc-300"}`,children:[(0,n.jsx)("span",{children:e.label}),f===e.value&&(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-emerald-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})})]},e.value)),(0,n.jsx)("div",{className:"border-t border-zinc-100 dark:border-zinc-800"}),v?(0,n.jsxs)("div",{className:"px-3 py-2 flex items-center gap-2",children:[(0,n.jsx)("input",{type:"number",min:.25,max:4,step:.25,value:k,onChange:e=>b(e.target.value),onKeyDown:e=>{if("Enter"===e.key){let e=parseFloat(k);!isNaN(e)&&e>=.25&&e<=4&&I(e)}"Escape"===e.key&&(y(!1),g(!1))},onBlur:()=>{let e=parseFloat(k);!isNaN(e)&&e>=.25&&e<=4?I(e):y(!1)},autoFocus:!0,className:"w-16 rounded border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 px-2 py-1 text-xs text-zinc-900 dark:text-zinc-100 focus:outline-none focus:ring-1 focus:ring-emerald-500"}),(0,n.jsx)("span",{className:"text-[11px] text-zinc-400 dark:text-zinc-400",children:"x"})]}):(0,n.jsxs)("button",{onClick:()=>{y(!0),b(String(f))},className:`w-full px-3 py-2 text-xs text-left flex items-center justify-between hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors ${!iA.some(e=>e.value===f)?"text-emerald-600 dark:text-emerald-400 font-medium":"text-zinc-700 dark:text-zinc-300"}`,children:[(0,n.jsxs)("span",{children:["Custom",iA.some(e=>e.value===f)?"...":` (${f}x)`]}),!iA.some(e=>e.value===f)&&(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-emerald-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})})]})]})]}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-zinc-400 dark:text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})]}),h&&(0,n.jsxs)("div",{className:"px-5 py-2 text-xs text-red-500 bg-red-50 dark:bg-red-950 border-b border-red-100 dark:border-red-800 flex items-center justify-between",children:[(0,n.jsx)("span",{children:h}),(0,n.jsx)("button",{onClick:()=>p(null),className:"text-red-400 hover:text-red-600 ml-2",children:(0,n.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsxs)("div",{className:"flex-1 overflow-y-auto px-5 py-4 custom-scrollbar description-markdown text-sm text-zinc-700 dark:text-zinc-300 leading-relaxed",onMouseUp:z?void 0:P,children:[(0,n.jsx)(n7,{remarkPlugins:[id],children:e.description}),e.acceptanceCriteria&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"border-t border-zinc-200 dark:border-zinc-700 my-4"}),(0,n.jsx)("h4",{className:"text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider mb-2",children:"Acceptance Criteria"}),(0,n.jsx)("pre",{className:"bg-zinc-50 dark:bg-zinc-800 rounded-lg p-3 border border-zinc-100 dark:border-zinc-800 overflow-x-auto",children:(0,n.jsx)("code",{className:"text-[11px] font-mono text-zinc-600 dark:text-zinc-300 whitespace-pre-wrap break-all",children:e.acceptanceCriteria})})]})]})]}),N&&!z&&(0,n.jsx)("div",{ref:S,className:"fixed z-[110] flex items-center gap-1.5 px-2.5 py-1.5 bg-zinc-800 text-white text-xs rounded-lg shadow-lg select-none",style:{left:N.x,top:N.y,transform:"translate(-50%, -100%)",pointerEvents:"auto"},onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:(0,n.jsxs)("button",{onClick:F,className:"flex items-center gap-1 hover:text-emerald-300 transition-colors",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 010 12.728M16.463 8.288a5.25 5.25 0 010 7.424M6.75 8.25l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.009 9.009 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z"})}),(0,n.jsx)("span",{children:"Read aloud"})]})})]}),document.body):null}function iE({className:e="w-3 h-3",filled:t=!1}){return t?(0,n.jsx)("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:"M11.645 20.91l-.007-.003-.022-.012a15.247 15.247 0 01-.383-.218 25.18 25.18 0 01-4.244-3.17C4.688 15.36 2.25 12.174 2.25 8.25 2.25 5.322 4.714 3 7.688 3A5.5 5.5 0 0112 5.052 5.5 5.5 0 0116.313 3c2.973 0 5.437 2.322 5.437 5.25 0 3.925-2.438 7.111-4.739 9.256a25.175 25.175 0 01-4.244 3.17 15.247 15.247 0 01-.383.219l-.022.012-.007.004-.003.001a.752.752 0 01-.704 0l-.003-.001z"})}):(0,n.jsx)("svg",{className:e,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12z"})})}function iD({node:e,allNodes:t,onNodeNavigate:i,comments:c,onPostComment:u,onDeleteComment:h,onLikeComment:p,onReplyComment:f,isAuthenticated:g,currentDid:k,repoUrls:b,onOpenSettings:v,onProfileClick:y}){var w;let j,z,[N,C]=(0,r.useState)(null),[S,M]=(0,r.useState)(""),[L,A]=(0,r.useState)(!1),[T,E]=(0,r.useState)(!1),[D,I]=(0,r.useState)(!1),P=e=>{C(e.uri),M("")},F=()=>{C(null),M("")},R=async()=>{if(S.trim()&&N&&f){A(!0);try{let e=t=>{for(let n of t){if(n.uri===N)return n;let t=e(n.replies);if(t)return t}},t=c?e(c):void 0;t&&await f(t,S.trim()),C(null),M("")}catch(e){console.error("Failed to post reply:",e)}finally{A(!1)}}};if(!e)return(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,n.jsx)("div",{className:"w-12 h-12 rounded-full bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center mb-4",children:(0,n.jsx)("svg",{className:"w-6 h-6 text-zinc-400 dark:text-zinc-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 15l-2 5L9 9l11 4-5 2zm0 0l5 5M7.188 2.239l.777 2.897M5.136 7.965l-2.898-.777M13.95 4.05l-2.122 2.122m-5.657 5.656l-2.12 2.122"})})}),(0,n.jsx)("p",{className:"text-sm text-zinc-500 dark:text-zinc-400 leading-relaxed",children:"Click a node to see details"}),(0,n.jsx)("p",{className:"text-xs text-zinc-400 dark:text-zinc-500 mt-1",children:"Hover to highlight connections"})]});let B=d[e.issueType]||"📋",O=l[e.status]||l.open,$=a[e.status]||e.status,_=o[e.priority]||`P${e.priority}`,W=s[e.priority]||"#a1a1aa",H=x[e.prefix]||e.prefix,U=m[e.prefix]||"#a1a1aa",V=b?.[e.prefix],q=e.blockerIds.map(e=>t.find(t=>t.id===e)).filter(Boolean),Y=e.dependentIds.map(e=>t.find(t=>t.id===e)).filter(Boolean),K=e=>{try{let t=new Date(e),n=t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),r=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!1});return`${n} at ${r}`}catch{return e}};return(0,n.jsxs)("div",{className:"animate-fade-in",children:[(0,n.jsxs)("div",{className:"flex items-start gap-3 mb-4",children:[(0,n.jsx)("span",{className:"text-2xl mt-0.5",children:B}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("div",{className:"flex items-center gap-2",children:(0,n.jsx)("span",{className:"text-xs font-mono font-semibold text-emerald-600 dark:text-emerald-400",children:e.id})}),(0,n.jsx)("h3",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100 mt-1 leading-snug",children:e.title})]})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 mb-4",children:[(0,n.jsxs)("span",{className:"status-badge",style:{backgroundColor:O+"18",color:O,border:`1px solid ${O}30`},children:[(0,n.jsx)("span",{className:"w-1.5 h-1.5 rounded-full mr-1.5",style:{backgroundColor:O}}),$]}),(0,n.jsx)("span",{className:"status-badge",style:{backgroundColor:W+"15",color:W,border:`1px solid ${W}25`},children:_}),V?(0,n.jsxs)("a",{href:V,target:"_blank",rel:"noopener noreferrer",className:"status-badge hover:opacity-80 transition-opacity",style:{backgroundColor:U+"15",color:U,border:`1px solid ${U}25`,textDecoration:"none"},children:[H,(0,n.jsx)("svg",{className:"w-2.5 h-2.5 ml-1 opacity-50",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"})})]}):(0,n.jsx)("span",{className:"status-badge",style:{backgroundColor:U+"15",color:U,border:`1px solid ${U}25`},children:H})]}),e.labels.length>0&&(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-4",children:e.labels.map(e=>(0,n.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-[11px] font-medium bg-zinc-100 dark:bg-zinc-800 text-zinc-600 dark:text-zinc-400 border border-zinc-200/60 dark:border-zinc-700/60",children:e},e))}),V&&(0,n.jsx)("div",{className:"mb-4",children:(0,n.jsxs)("a",{href:V,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-[11px] text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"currentColor",children:(0,n.jsx)("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),V.replace(/^https?:\/\//,"")]})}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-3 mb-4",children:[(0,n.jsx)(iP,{label:"Blocks",value:e.blockerCount,color:e.blockerCount>0?"#f59e0b":void 0}),(0,n.jsx)(iP,{label:"Blocked by",value:e.dependentCount,color:e.dependentCount>0?"#ef4444":void 0})]}),(0,n.jsxs)("div",{className:"space-y-1.5 mb-4 text-xs text-zinc-500 dark:text-zinc-400",children:[(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{children:"Created"}),(0,n.jsx)("span",{className:"text-zinc-700 dark:text-zinc-300 font-medium",children:K(e.createdAt)})]}),(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{children:"Updated"}),(0,n.jsx)("span",{className:"text-zinc-700 dark:text-zinc-300 font-medium",children:K(e.updatedAt)})]}),e.closedAt&&(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{children:"Closed"}),(0,n.jsx)("span",{className:"text-zinc-700 dark:text-zinc-300 font-medium",children:K(e.closedAt)})]}),e.closeReason&&(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{children:"Reason"}),(0,n.jsx)("span",{className:"text-zinc-700 dark:text-zinc-300 font-medium ml-2 text-right",children:(w=e.closeReason,j=V||"https://github.com/GainForest/heartbeads",1===(z=w.split(/\b([0-9a-f]{7,40})\b/)).length?w:z.map((e,t)=>/^[0-9a-f]{7,40}$/.test(e)?(0,n.jsx)("a",{href:`${j}/commit/${e}`,target:"_blank",rel:"noopener noreferrer",className:"font-mono text-emerald-600 dark:text-emerald-400 hover:text-emerald-700 dark:hover:text-emerald-300 underline decoration-emerald-300 hover:decoration-emerald-500 cursor-pointer transition-colors",children:e},t):(0,n.jsx)("span",{children:e},t)))})]}),(e.createdBy||e.owner||e.assignee)&&(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{children:"Created by"}),(0,n.jsx)("button",{onClick:()=>y?.(e.createdBy||e.owner||e.assignee||""),className:"text-zinc-700 dark:text-zinc-300 font-medium truncate ml-2 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:e.createdBy||e.owner||e.assignee})]}),(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{children:"Assignee"}),e.assignee?(0,n.jsx)("button",{onClick:()=>y?.(e.assignee),className:"text-zinc-700 dark:text-zinc-300 font-medium truncate ml-2 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:e.assignee}):(0,n.jsx)("span",{className:"text-zinc-400 dark:text-zinc-500 italic ml-2",children:"No assignee"})]}),null!=e.estimatedMinutes&&(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{children:"Estimate"}),(0,n.jsxs)("span",{className:"text-zinc-700 dark:text-zinc-300 font-medium",children:["⏱ ",e.estimatedMinutes,"m"]})]})]}),e.description&&(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,n.jsx)("h4",{className:"text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider",children:"Description"}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("button",{onClick:()=>{if(!e.description)return;let t=b?.[e.prefix];navigator.clipboard.writeText(ip(e,t)).then(()=>{I(!0),setTimeout(()=>I(!1),1500)})},className:"text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors",title:"Copy description",children:D?(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-emerald-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}):(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 0 1-.75.75H9.75a.75.75 0 0 1-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 0 1 1.927-.184"})})}),(0,n.jsx)("button",{onClick:()=>E(!0),className:"text-[10px] text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors",children:"View in window"})]})]}),(0,n.jsx)("div",{className:"text-xs text-zinc-600 dark:text-zinc-300 leading-relaxed bg-zinc-50 dark:bg-zinc-800 rounded-lg p-3 max-h-40 overflow-y-auto custom-scrollbar border border-zinc-100 dark:border-zinc-800 description-markdown",children:(0,n.jsx)(n7,{remarkPlugins:[id],children:e.description})})]}),T&&e.description&&(0,n.jsx)(iT,{node:e,onClose:()=>E(!1),repoUrl:b?.[e.prefix],onOpenSettings:v}),e.acceptanceCriteria&&(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h4",{className:"text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider mb-2",children:"Acceptance Criteria"}),(0,n.jsx)("pre",{className:"text-[11px] font-mono bg-zinc-50 dark:bg-zinc-800 rounded-lg p-3 border border-zinc-100 dark:border-zinc-800 overflow-x-auto whitespace-pre-wrap break-all",children:(0,n.jsx)("code",{children:e.acceptanceCriteria})})]}),q.length>0&&(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsxs)("h4",{className:"text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider mb-2",children:["Blocks (",q.length,")"]}),(0,n.jsx)("div",{className:"space-y-1",children:q.map(e=>(0,n.jsx)(iF,{node:e,onClick:()=>i(e.id)},e.id))})]}),Y.length>0&&(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsxs)("h4",{className:"text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider mb-2",children:["Blocked by (",Y.length,")"]}),(0,n.jsx)("div",{className:"space-y-1",children:Y.map(e=>(0,n.jsx)(iF,{node:e,onClick:()=>i(e.id)},e.id))})]}),(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsxs)("h4",{className:"text-xs font-semibold text-zinc-500 dark:text-zinc-400 uppercase tracking-wider mb-2",children:["Comments"," ",c&&c.length>0&&(0,n.jsx)("span",{className:"ml-1 px-1.5 py-0.5 bg-emerald-50 dark:bg-emerald-950 text-emerald-600 dark:text-emerald-400 rounded-full text-[10px] font-medium",children:c.length})]}),c&&c.length>0?(0,n.jsx)("div",{className:"space-y-1",children:c.map(e=>(0,n.jsx)(iR,{comment:e,currentDid:k,isAuthenticated:g,onDelete:h,onLike:p,onStartReply:P,replyingToUri:N,replyText:S,onReplyTextChange:M,onSubmitReply:R,onCancelReply:F,isSubmittingReply:L,depth:0},e.uri))}):(0,n.jsx)("p",{className:"text-xs text-zinc-400 dark:text-zinc-500 italic",children:"No comments yet"}),g&&u?(0,n.jsx)(iB,{onSubmit:u}):g?null:(0,n.jsx)("p",{className:"text-xs text-zinc-400 dark:text-zinc-500 mt-2",children:"Sign in to leave a comment"})]})]})}function iI({replyingTo:e,replyText:t,onTextChange:r,onSubmit:i,onCancel:l,isSubmitting:a}){return(0,n.jsxs)("div",{className:"mt-2 ml-4 pl-3 border-l border-emerald-200 space-y-1.5",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] text-zinc-400 dark:text-zinc-500",children:[(0,n.jsx)("span",{children:"Replying to"}),(0,n.jsx)("a",{href:`https://www.impactindexer.org/data?did=${e.did}`,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-zinc-600 dark:text-zinc-400 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:e.displayName||e.handle})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("input",{type:"text",value:t,onChange:e=>r(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||i()},placeholder:"Write a reply...",disabled:a,autoFocus:!0,className:"flex-1 px-2 py-1 text-xs bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-700 rounded placeholder-zinc-400 dark:placeholder-zinc-500 focus:outline-none focus:border-emerald-400 disabled:opacity-50"}),(0,n.jsx)("button",{onClick:i,disabled:!t.trim()||a,className:"px-2 py-1 text-[10px] font-medium text-emerald-600 dark:text-emerald-400 hover:text-emerald-700 dark:hover:text-emerald-300 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:a?"...":"Reply"}),(0,n.jsx)("button",{onClick:l,disabled:a,className:"px-2 py-1 text-[10px] text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 disabled:opacity-50 transition-colors",children:"Cancel"})]})]})}function iP({label:e,value:t,color:r}){return(0,n.jsxs)("div",{className:"bg-zinc-50 dark:bg-zinc-800 rounded-lg p-3 border border-zinc-100 dark:border-zinc-800",children:[(0,n.jsx)("div",{className:"text-xl font-bold",style:{color:r||"#3f3f46"},children:t}),(0,n.jsx)("div",{className:"text-[10px] text-zinc-400 dark:text-zinc-500 uppercase tracking-wider mt-0.5",children:e})]})}function iF({node:e,onClick:t}){let r=l[e.status]||l.open;return(0,n.jsxs)("button",{onClick:t,className:"w-full flex items-center gap-2 px-2.5 py-1.5 rounded-md hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors text-left group border border-transparent hover:border-zinc-200 dark:hover:border-zinc-700",children:[(0,n.jsx)("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:r}}),(0,n.jsx)("span",{className:"text-xs font-mono text-emerald-600 dark:text-emerald-400 group-hover:text-emerald-700 dark:group-hover:text-emerald-300 shrink-0",children:e.id}),(0,n.jsx)("span",{className:"text-xs text-zinc-500 dark:text-zinc-400 truncate",children:e.title})]})}function iR({comment:e,currentDid:t,isAuthenticated:i,onDelete:l,onLike:a,onStartReply:o,replyingToUri:s,replyText:c,onReplyTextChange:d,onSubmitReply:u,onCancelReply:h,isSubmittingReply:p,depth:f}){let[x,m]=(0,r.useState)(!1),[g,k]=(0,r.useState)(!1),b=t&&t===e.did,v=!!t&&e.likes.some(e=>e.did===t),y=s===e.uri,w=async()=>{if(l&&!x){m(!0);try{await l(e)}catch(e){console.error("Failed to delete comment:",e)}finally{m(!1)}}},j=async()=>{if(a&&!g){k(!0);try{await a(e)}catch(e){console.error("Failed to toggle like:",e)}finally{k(!1)}}};return(0,n.jsxs)("div",{className:`${f>0?"ml-4 pl-3 border-l border-zinc-100 dark:border-zinc-800":""}`,children:[(0,n.jsxs)("div",{className:"py-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,n.jsx)("div",{className:"shrink-0 w-4 h-4 rounded-full bg-zinc-100 dark:bg-zinc-800 overflow-hidden",children:e.avatar?(0,n.jsx)("img",{src:e.avatar,alt:"",className:"w-full h-full object-cover"}):(0,n.jsx)("div",{className:"w-full h-full flex items-center justify-center text-[8px] font-medium text-zinc-400 dark:text-zinc-500",children:(e.handle||e.did).charAt(0).toUpperCase()})}),(0,n.jsx)("a",{href:`https://www.impactindexer.org/data?did=${e.did}`,target:"_blank",rel:"noopener noreferrer",className:"text-xs font-medium text-zinc-600 dark:text-zinc-400 truncate hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:e.displayName||e.handle||e.did.slice(0,16)+"..."}),(0,n.jsx)("span",{className:"text-[10px] text-zinc-300 dark:text-zinc-600 shrink-0",children:ih(e.createdAt)})]}),(0,n.jsx)("p",{className:"text-xs text-zinc-500 dark:text-zinc-400 leading-relaxed whitespace-pre-wrap break-words",children:e.text}),(0,n.jsxs)("div",{className:"flex items-center gap-2 mt-1 text-[10px]",children:[(0,n.jsxs)("button",{onClick:j,disabled:!i||g,className:`flex items-center gap-0.5 transition-colors ${v?"text-rose-500":"text-zinc-300 hover:text-rose-500"} disabled:opacity-50`,children:[(0,n.jsx)(iE,{className:"w-3 h-3",filled:v}),e.likes.length>0&&(0,n.jsx)("span",{children:e.likes.length})]}),(0,n.jsx)("button",{onClick:()=>o(e),disabled:!i,className:`transition-colors disabled:opacity-50 ${y?"text-emerald-500 dark:text-emerald-400":"text-zinc-300 dark:text-zinc-600 hover:text-zinc-500 dark:hover:text-zinc-400"}`,children:"reply"}),b&&l&&(0,n.jsx)("button",{onClick:w,disabled:x,className:"ml-auto shrink-0 text-zinc-300 dark:text-zinc-600 hover:text-red-400 disabled:opacity-50 transition-colors",children:x?"...":"delete"})]})]}),y&&(0,n.jsx)(iI,{replyingTo:e,replyText:c,onTextChange:d,onSubmit:u,onCancel:h,isSubmitting:p}),e.replies.length>0&&(0,n.jsx)("div",{children:e.replies.map(e=>(0,n.jsx)(iR,{comment:e,currentDid:t,isAuthenticated:i,onDelete:l,onLike:a,onStartReply:o,replyingToUri:s,replyText:c,onReplyTextChange:d,onSubmitReply:u,onCancelReply:h,isSubmittingReply:p,depth:f+1},e.uri))})]})}function iB({onSubmit:e}){let[t,i]=(0,r.useState)(""),[l,a]=(0,r.useState)(!1),o=async()=>{if(t.trim()&&!l){a(!0);try{await e(t.trim()),i("")}catch(e){console.error("Failed to post comment:",e)}finally{a(!1)}}};return(0,n.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,n.jsx)("textarea",{value:t,onChange:e=>i(e.target.value),placeholder:"Leave a comment...",rows:2,className:"w-full px-2.5 py-1.5 text-xs border border-zinc-200 dark:border-zinc-700 rounded-md bg-zinc-50 dark:bg-zinc-800 text-zinc-700 dark:text-zinc-300 placeholder-zinc-400 dark:placeholder-zinc-500 resize-none focus:outline-none focus:ring-1 focus:ring-emerald-500 focus:border-emerald-500"}),(0,n.jsx)("button",{onClick:o,disabled:!t.trim()||l,className:"px-3 py-1 text-xs font-medium text-white bg-emerald-500 rounded-md hover:bg-emerald-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:l?"Sending...":"Comment"})]})}var iO=e.i(63398);function i$({onViewProfile:e}){let{isAuthenticated:t,isLoading:i,session:l,login:a,logout:o}=(0,iO.useAuth)(),[s,c]=(0,r.useState)(!1),[d,u]=(0,r.useState)(!1),[h,p]=(0,r.useState)(""),[f,x]=(0,r.useState)(!1),[m,g]=(0,r.useState)(""),k=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!d)return;let e=e=>{k.current&&!k.current.contains(e.target)&&u(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[d]);let b=async e=>{if(e.preventDefault(),h.trim()){x(!0),g("");try{await a(h.trim())}catch(e){g(e instanceof Error?e.message:"Login failed"),x(!1)}}},v=async()=>{u(!1),await o()};return i?(0,n.jsx)("div",{className:"w-4 h-4 rounded-full border-2 border-zinc-200 border-t-zinc-400 animate-spin"}):t&&l?(0,n.jsxs)("div",{className:"relative",ref:k,children:[(0,n.jsxs)("button",{onClick:()=>u(e=>!e),className:"flex items-center gap-2 px-3 py-1.5 rounded-full hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors cursor-pointer",children:[l.avatar?(0,n.jsx)("img",{src:l.avatar,alt:l.handle,width:24,height:24,className:"rounded-full"}):(0,n.jsx)("div",{className:"w-6 h-6 rounded-full bg-emerald-100 dark:bg-emerald-950 flex items-center justify-center text-[11px] text-emerald-700 dark:text-emerald-400 font-medium",children:(l.displayName||l.handle).charAt(0).toUpperCase()}),(0,n.jsx)("span",{className:"text-sm text-zinc-600 dark:text-zinc-400 max-w-[100px] truncate",children:l.displayName||l.handle})]}),d&&(0,n.jsxs)("div",{className:"absolute right-0 top-full mt-2 w-44 bg-white dark:bg-zinc-900 rounded-xl shadow-xl border border-zinc-100 dark:border-zinc-700 py-2 z-50",children:[(0,n.jsxs)("button",{onClick:()=>{e?(e(l.handle),u(!1)):window.open(l.did?`https://www.impactindexer.org/data?did=${l.did}`:"#","_blank")},className:"block w-full text-left px-3 py-1.5 text-xs text-zinc-400 dark:text-zinc-400 truncate hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors cursor-pointer",children:["@",l.handle]}),(0,n.jsx)("div",{className:"h-px bg-zinc-100 dark:border-zinc-800 my-1"}),(0,n.jsxs)("button",{onClick:v,className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-zinc-600 dark:text-zinc-400 hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors cursor-pointer",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 9V5.25A2.25 2.25 0 0 1 10.5 3h6a2.25 2.25 0 0 1 2.25 2.25v13.5A2.25 2.25 0 0 1 16.5 21h-6a2.25 2.25 0 0 1-2.25-2.25V15m-3 0-3-3m0 0 3-3m-3 3H15"})}),"Sign out"]})]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:()=>c(!0),className:"px-4 py-1.5 text-sm font-medium text-zinc-600 dark:text-zinc-400 rounded-full hover:text-zinc-900 dark:hover:text-zinc-100 hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors cursor-pointer whitespace-nowrap",children:"Sign in"}),s&&(0,n.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[20vh]",onClick:()=>c(!1),children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/20 backdrop-blur-sm"}),(0,n.jsxs)("div",{className:"relative w-full max-w-sm mx-4 bg-white dark:bg-zinc-900 rounded-xl shadow-lg border border-zinc-200 dark:border-zinc-700 p-6",onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-zinc-900 dark:text-zinc-100 mb-1",children:"Sign in with ATProto"}),(0,n.jsx)("p",{className:"text-sm text-zinc-400 dark:text-zinc-400 mb-5",children:"Enter your Bluesky handle to connect."}),(0,n.jsxs)("form",{onSubmit:b,children:[(0,n.jsx)("label",{htmlFor:"auth-handle",className:"block text-sm text-zinc-600 dark:text-zinc-400 mb-1.5",children:"Handle"}),(0,n.jsx)("input",{id:"auth-handle",type:"text",value:h,onChange:e=>p(e.target.value),placeholder:"alice.bsky.social",disabled:f,autoFocus:!0,className:"w-full px-3 py-2 text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-lg placeholder:text-zinc-300 dark:placeholder:text-zinc-500 focus:outline-none focus:ring-2 focus:ring-emerald-500/30 focus:border-emerald-400 disabled:opacity-50 disabled:cursor-not-allowed text-zinc-900 dark:text-zinc-100"}),(0,n.jsx)("p",{className:"text-xs text-zinc-300 dark:text-zinc-500 mt-1.5",children:"Just a username? We'll add .bsky.social for you."}),m&&(0,n.jsx)("p",{className:"text-sm text-red-500 mt-2",children:m}),(0,n.jsxs)("div",{className:"flex gap-2 mt-5",children:[(0,n.jsx)("button",{type:"button",onClick:()=>c(!1),disabled:f,className:"flex-1 px-3 py-2 text-sm text-zinc-600 dark:text-zinc-400 bg-zinc-50 dark:bg-zinc-800 rounded-lg hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Cancel"}),(0,n.jsx)("button",{type:"submit",disabled:f||!h.trim(),className:"flex-1 px-3 py-2 text-sm text-white bg-emerald-600 rounded-lg hover:bg-emerald-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:f?"Connecting...":"Connect"})]})]})]})]})]})}var i_=e.i(17528);function iW({node:e,x:t,y:i,onClose:l,onSubmit:a,isAuthenticated:o,existingComments:s}){let[c,d]=(0,r.useState)(""),[u,h]=(0,r.useState)(!1),p=(0,r.useRef)(null),f=(0,r.useRef)(null),[x,g]=(0,r.useState)({x:0,y:0}),[k,b]=(0,r.useState)(!1),v=iL();(0,r.useEffect)(()=>{if(!p.current)return;let e=p.current.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight,l=t+14,a=i-e.height-14;l+e.width>n-16&&(l=n-e.width-16),l<16&&(l=16),a<16&&(a=i+28),a+e.height>r-16&&(a=r-e.height-16),g({x:l,y:a}),b(!0)},[t,i]),(0,r.useEffect)(()=>{if(o){let e=setTimeout(()=>f.current?.focus(),100);return()=>clearTimeout(e)}},[o]),(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[l]),(0,r.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&l()},t=setTimeout(()=>{window.addEventListener("mousedown",e)},50);return()=>{clearTimeout(t),window.removeEventListener("mousedown",e)}},[l]);let y=(0,r.useCallback)(async()=>{if(c.trim()&&!u){h(!0);try{await a(c.trim()),d("")}catch(e){console.error("Failed to post comment:",e)}finally{h(!1)}}},[c,u,a]),w=(0,r.useCallback)(e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),y())},[y]),j=m[e.prefix]||"#a1a1aa",z=s?.length||0,N=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"mb-3",children:[(0,n.jsx)("span",{className:"text-xs font-mono text-emerald-600 dark:text-emerald-400",children:e.id}),(0,n.jsx)("h3",{className:"text-sm font-semibold text-zinc-800 dark:text-zinc-200 leading-tight mt-0.5",children:e.title})]}),z>0&&s&&(0,n.jsxs)("div",{className:"mb-3 pb-3 border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-blue-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 20.25c4.97 0 9-3.694 9-8.25s-4.03-8.25-9-8.25S3 7.444 3 12c0 2.104.859 4.023 2.273 5.48.432.447.74 1.04.586 1.641a4.483 4.483 0 01-.923 1.785A5.969 5.969 0 006 21c1.282 0 2.47-.402 3.445-1.087.81.22 1.668.337 2.555.337z"})}),(0,n.jsxs)("span",{className:"text-[10px] font-medium text-zinc-500 dark:text-zinc-400 uppercase tracking-wider",children:[z," comment",1!==z?"s":""]})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[s.slice(0,2).map(e=>(0,n.jsxs)("div",{className:"flex gap-1.5",children:[(0,n.jsx)("div",{className:"shrink-0 w-4 h-4 rounded-full bg-zinc-100 dark:bg-zinc-800 overflow-hidden mt-0.5",children:e.avatar?(0,n.jsx)("img",{src:e.avatar,alt:"",className:"w-full h-full object-cover"}):(0,n.jsx)("div",{className:"w-full h-full flex items-center justify-center text-[7px] font-medium text-zinc-400 dark:text-zinc-500",children:(e.handle||e.did).charAt(0).toUpperCase()})}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("a",{href:`https://www.impactindexer.org/data?did=${e.did}`,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] font-medium text-zinc-500 dark:text-zinc-400 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:e.displayName||e.handle}),(0,n.jsx)("p",{className:"text-[11px] text-zinc-500 dark:text-zinc-400 line-clamp-2 leading-tight",children:e.text})]})]},e.uri)),z>2&&(0,n.jsxs)("p",{className:"text-[10px] text-zinc-400 dark:text-zinc-500 italic",children:["+",z-2," more — see detail panel"]})]})]}),o?(0,n.jsxs)("div",{children:[(0,n.jsx)("textarea",{ref:f,value:c,onChange:e=>d(e.target.value),onKeyDown:w,placeholder:"Leave a comment...",rows:3,className:"w-full px-2.5 py-2 text-xs border border-zinc-200 dark:border-zinc-700 rounded-md bg-zinc-50 dark:bg-zinc-800 text-zinc-700 dark:text-zinc-300 placeholder-zinc-400 dark:placeholder-zinc-500 resize-none focus:outline-none focus:ring-1 focus:ring-emerald-500 focus:border-emerald-500"}),(0,n.jsxs)("div",{className:"flex items-center justify-between mt-2",children:[(0,n.jsxs)("span",{className:"text-[10px] text-zinc-300 dark:text-zinc-600",children:["u">typeof navigator&&navigator.platform?.includes("Mac")?"⌘":"Ctrl","+Enter to send"]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("button",{onClick:l,className:"px-2.5 py-1 text-[11px] text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors",children:"Cancel"}),(0,n.jsx)("button",{onClick:y,disabled:!c.trim()||u,className:"px-3 py-1 text-[11px] font-medium text-white bg-emerald-500 rounded-md hover:bg-emerald-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:u?(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsxs)("svg",{className:"w-3 h-3 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Sending"]}):"Send"})]})]})]}):(0,n.jsxs)("div",{className:"text-center py-3",children:[(0,n.jsx)("svg",{className:"w-5 h-5 text-zinc-300 dark:text-zinc-600 mx-auto mb-1.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})}),(0,n.jsx)("p",{className:"text-xs text-zinc-400 dark:text-zinc-500",children:"Sign in to comment"})]})]});return v?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"fixed inset-0 z-[99] bg-black/20",onClick:l}),(0,n.jsxs)("div",{className:"fixed inset-x-0 bottom-0 z-[100] bg-white dark:bg-zinc-900 rounded-t-2xl shadow-2xl animate-slide-up-sheet",children:[(0,n.jsx)("div",{className:"w-10 h-1 bg-zinc-300 dark:bg-zinc-600 rounded-full mx-auto mt-3 mb-1"}),(0,n.jsx)("div",{className:"px-4 pb-6 pt-2",children:N}),(0,n.jsx)("div",{className:"h-[env(safe-area-inset-bottom)]"})]})]}):(0,n.jsxs)("div",{ref:p,style:{position:"fixed",left:x.x,top:x.y,width:320,zIndex:100,opacity:+!!k,transform:k?"translateY(0)":"translateY(4px)",transition:"opacity 0.2s ease, transform 0.2s ease"},className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-700 rounded-lg overflow-hidden",onContextMenu:e=>e.preventDefault(),children:[(0,n.jsx)("style",{children:`
2
2
  .comment-tooltip-shadow {
3
3
  box-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.08);
4
4
  }
5
- `}),(0,n.jsxs)("div",{className:"comment-tooltip-shadow p-[18px_20px]",children:[(0,n.jsx)("div",{className:"rounded-sm mb-2.5",style:{width:24,height:2,background:j,opacity:.6}}),N]})]})}function iH({node:e,x:t,y:i,onShowDescription:l,onAddComment:a,onClaimTask:o,onUnclaimTask:s,onCollapseEpic:c,onUncollapseEpic:d,onFocusEpic:u,onExitFocusEpic:h,onClose:p}){let f=(0,r.useRef)(null),[x,m]=(0,r.useState)({x:0,y:0}),[g,k]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(!f.current)return;let e=f.current.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight,l=t+4,a=i+4;l+e.width>n-16&&(l=n-e.width-16),l<16&&(l=16),a+e.height>r-16&&(a=r-e.height-16),a<16&&(a=16),m({x:l,y:a}),k(!0)},[t,i]),(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&p()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[p]),(0,r.useEffect)(()=>{let e=e=>{f.current&&!f.current.contains(e.target)&&p()},t=setTimeout(()=>window.addEventListener("mousedown",e),50);return()=>{clearTimeout(t),window.removeEventListener("mousedown",e)}},[p]),(0,n.jsx)("div",{ref:f,style:{position:"fixed",left:x.x,top:x.y,zIndex:100,opacity:+!!g,transform:g?"translateY(0)":"translateY(2px)",transition:"opacity 0.15s ease, transform 0.15s ease"},onContextMenu:e=>e.preventDefault(),children:(0,n.jsxs)("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-700 rounded-lg overflow-hidden",style:{minWidth:180,boxShadow:"0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.06)"},children:[e.description&&(0,n.jsxs)("button",{onClick:l,className:"w-full px-3 py-2.5 text-xs text-zinc-700 dark:text-zinc-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 flex items-center gap-2 transition-colors border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400 dark:text-zinc-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),"Show description"]}),(0,n.jsxs)("button",{onClick:a,className:`w-full px-3 py-2.5 text-xs text-zinc-700 dark:text-zinc-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 flex items-center gap-2 transition-colors${o||s||c||d||u||h?" border-b border-zinc-100 dark:border-zinc-800":""}`,children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400 dark:text-zinc-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 20.25c4.97 0 9-3.694 9-8.25s-4.03-8.25-9-8.25S3 7.444 3 12c0 2.104.859 4.023 2.273 5.48.432.447.74 1.04.586 1.641a4.483 4.483 0 01-.923 1.785A5.969 5.969 0 006 21c1.282 0 2.47-.402 3.445-1.087.81.22 1.668.337 2.555.337z"})}),"Add comment"]}),o&&(0,n.jsxs)("button",{onClick:o,className:`w-full px-3 py-2.5 text-xs text-zinc-700 dark:text-zinc-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 flex items-center gap-2 transition-colors${c||d||u||h?" border-b border-zinc-100 dark:border-zinc-800":""}`,children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400 dark:text-zinc-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})}),"Claim task"]}),s&&(0,n.jsxs)("button",{onClick:s,className:`w-full px-3 py-2.5 text-xs text-red-500 hover:bg-red-50 dark:hover:bg-red-950 flex items-center gap-2 transition-colors${c||d||u||h?" border-b border-zinc-100 dark:border-zinc-800":""}`,children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-red-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M22 10.5h-6m-2.25-4.125a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zM4 19.235v-.11a6.375 6.375 0 0112.75 0v.109A12.318 12.318 0 0110.374 21c-2.331 0-4.512-.645-6.374-1.766z"})}),"Unclaim task"]}),c&&(0,n.jsxs)("button",{onClick:c,className:`w-full px-3 py-2.5 text-xs text-zinc-700 dark:text-zinc-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 flex items-center gap-2 transition-colors${u||h?" border-b border-zinc-100 dark:border-zinc-800":""}`,children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400 dark:text-zinc-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"})}),"Collapse epic"]}),d&&(0,n.jsxs)("button",{onClick:d,className:`w-full px-3 py-2.5 text-xs text-zinc-700 dark:text-zinc-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 flex items-center gap-2 transition-colors${u||h?" border-b border-zinc-100 dark:border-zinc-800":""}`,children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400 dark:text-zinc-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})}),"Uncollapse epic"]}),u&&(0,n.jsxs)("button",{onClick:u,className:"w-full px-3 py-2.5 text-xs text-zinc-700 dark:text-zinc-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 flex items-center gap-2 transition-colors",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400 dark:text-zinc-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 3.75H6A2.25 2.25 0 003.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0120.25 6v1.5M16.5 20.25H18A2.25 2.25 0 0020.25 18v-1.5M7.5 20.25H6A2.25 2.25 0 013.75 18v-1.5"})}),"Focus on epic"]}),h&&(0,n.jsxs)("button",{onClick:h,className:"w-full px-3 py-2.5 text-xs text-emerald-600 dark:text-emerald-400 hover:bg-emerald-50 dark:hover:bg-emerald-950 flex items-center gap-2 transition-colors",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-emerald-500 dark:text-emerald-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})}),"Show full graph"]})]})})}function iU({node:e,x:t,y:i,prefixColor:l,allNodes:a,theme:c}){let d="dark"===c?{bg:"#18181b",border:"#3f3f46",borderLight:"#27272a",shadow:"rgba(0,0,0,0.3)",text:"#f4f4f5",textMuted:"#a1a1aa",textDim:"#71717a"}:{bg:"#FFFFFF",border:"#E5E7EB",borderLight:"#F3F4F6",shadow:"rgba(0,0,0,0.08)",text:"#131316",textMuted:"#737680",textDim:"#7F818B"},u=(0,r.useRef)(null),[h,f]=(0,r.useState)({x:0,y:0});(0,r.useEffect)(()=>{if(!u.current)return;let e=u.current.getBoundingClientRect(),n=t+14,r=i-e.height-14;n+e.width>window.innerWidth-16&&(n=t-e.width-14),n<16&&(n=16),r<16&&(r=i+14+8),r+e.height>window.innerHeight-16&&(r=window.innerHeight-e.height-16),f({x:n,y:r})},[t,i]);let x=e.dependentIds.map(e=>{let t=a.find(t=>t.id===e);return t?{id:e,title:t.title}:{id:e,title:e}}).filter(Boolean),m=o[e.priority]||`P${e.priority}`,g=s[e.priority]||"#a1a1aa",k={fontSize:10,fontWeight:600,letterSpacing:1.5,textTransform:"uppercase",color:"dark"===c?"#71717a":"#7F818B",marginBottom:3},b={fontSize:12,color:"dark"===c?"#a1a1aa":"#737680",lineHeight:1.45};return(0,n.jsxs)("div",{ref:u,className:"bead-tooltip",style:{position:"fixed",left:h.x,top:h.y,width:280,zIndex:100,pointerEvents:"none",background:d.bg,border:`1px solid ${d.border}`,boxShadow:`0 8px 32px ${d.shadow}, 0 2px 8px ${d.shadow}`,borderRadius:8,padding:"16px 18px",animation:"beadTooltipFade 0.2s ease"},children:[(0,n.jsx)("div",{style:{width:24,height:2,background:l,opacity:.5,marginBottom:8,borderRadius:1}}),(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:6},children:[(0,n.jsx)("span",{style:{fontSize:10,fontWeight:600,color:l,letterSpacing:.5,textTransform:"uppercase"},children:p(e.prefix)}),(0,n.jsx)("span",{style:{fontSize:10,fontFamily:"monospace",color:d.textDim},children:e.id})]}),(0,n.jsx)("div",{style:{fontSize:14,fontWeight:600,color:d.text,lineHeight:1.25,marginBottom:12,overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:e.title}),e.labels.length>0&&(0,n.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginBottom:10},children:[e.labels.slice(0,3).map(e=>(0,n.jsx)("span",{style:{fontSize:10,fontWeight:500,color:"dark"===c?"#a1a1aa":"#52525b",backgroundColor:"dark"===c?"#27272a":"#f4f4f5",border:"dark"===c?"1px solid #3f3f46":"1px solid #e4e4e7",borderRadius:9999,padding:"1px 7px",lineHeight:"16px"},children:e},e)),e.labels.length>3&&(0,n.jsxs)("span",{style:{fontSize:10,color:"#a1a1aa",lineHeight:"18px"},children:["+",e.labels.length-3," more"]})]}),(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[null!=e.estimatedMinutes&&(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:k,children:"Estimate"}),(0,n.jsxs)("div",{style:b,children:["⏱ ",e.estimatedMinutes,"m"]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:k,children:"Created"}),(0,n.jsx)("div",{style:b,children:ih(e.createdAt)})]}),e.owner&&(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:k,children:"Owner"}),(0,n.jsx)("div",{style:b,children:e.owner})]}),(e.assignee||e.createdBy)&&(0,n.jsxs)("div",{children:[e.assignee&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:k,children:"Assignee"}),(0,n.jsx)("div",{style:b,children:e.assignee})]}),e.createdBy&&!e.assignee&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:k,children:"Created by"}),(0,n.jsx)("div",{style:b,children:e.createdBy})]}),e.createdBy&&e.assignee&&e.createdBy!==e.assignee&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:{...k,marginTop:4},children:"Created by"}),(0,n.jsx)("div",{style:b,children:e.createdBy})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:k,children:"Blocked by"}),0===x.length?(0,n.jsx)("div",{style:{...b,color:"#10b981"},children:"None"}):(0,n.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:3},children:x.map(e=>(0,n.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,n.jsx)("span",{style:{fontSize:10,fontFamily:"monospace",color:d.textDim,flexShrink:0},children:e.id}),(0,n.jsx)("span",{style:{fontSize:12,color:d.textMuted,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title})]},e.id))})]}),(0,n.jsxs)("div",{style:{borderTop:`1px solid ${d.borderLight}`,paddingTop:8},children:[(0,n.jsx)("div",{style:k,children:"Priority"}),(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,n.jsx)("div",{style:{width:8,height:8,borderRadius:"50%",background:g,flexShrink:0}}),(0,n.jsx)("span",{style:b,children:m})]})]})]})]})}function iV({isOpen:e,onClose:t,allComments:i,onNodeNavigate:l,isAuthenticated:a,currentDid:o,onLikeComment:s,onDeleteComment:c,onReplyComment:d,onPostComment:u,prefixes:h}){let[p,f]=(0,r.useState)(null),[x,m]=(0,r.useState)(""),[g,k]=(0,r.useState)(!1),[b,v]=(0,r.useState)(""),y=(e,t)=>{for(let n of e){if(n.uri===t)return n;let e=y(n.replies,t);if(e)return e}return null},w=async()=>{if(!x.trim()||!p||!d)return;let e=y(i,p);if(e){k(!0);try{await d(e,x.trim()),f(null),m("")}catch(e){console.error("Failed to post reply:",e)}finally{k(!1)}}},j=(0,r.useMemo)(()=>{if(!b.trim())return i;let e=RegExp("^"+b.trim().replace(/[.+^()|[\]\\]/g,"\\$&").replace(/\*/g,".*")+"$","i");return i.filter(t=>e.test(t.nodeId))},[i,b]);return(0,n.jsxs)("aside",{className:`hidden md:flex absolute top-0 right-0 h-full w-[360px] bg-white dark:bg-zinc-900 border-l border-zinc-200 dark:border-zinc-700 flex-col shadow-xl z-30 transform transition-transform duration-300 ease-out ${e?"translate-x-0":"translate-x-full"}`,children:[(0,n.jsxs)("div",{className:"shrink-0 px-5 py-3 border-b border-zinc-100 dark:border-zinc-800 flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h2",{className:"text-xs font-semibold text-zinc-400 uppercase tracking-wider",children:"All Comments"}),(b?j.length:i.length)>0&&(0,n.jsx)("span",{className:"px-1.5 py-0.5 bg-emerald-50 dark:bg-emerald-950 text-emerald-600 dark:text-emerald-400 rounded-full text-[10px] font-medium",children:b?j.length:i.length})]}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors rounded-full hover:bg-zinc-100 dark:hover:bg-zinc-800",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsxs)("div",{className:"shrink-0 px-5 py-2 border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("input",{type:"text",value:b,onChange:e=>v(e.target.value),placeholder:"Filter by target (e.g. beads-map-*)",className:"w-full pl-7 pr-7 py-1.5 text-xs border border-zinc-200 dark:border-zinc-700 rounded-md bg-zinc-50 dark:bg-zinc-800 text-zinc-700 dark:text-zinc-300 placeholder-zinc-400 dark:placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-emerald-500 focus:border-emerald-500"}),(0,n.jsx)("svg",{className:"absolute left-2 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 01-.659 1.591l-5.432 5.432a2.25 2.25 0 00-.659 1.591v2.927a2.25 2.25 0 01-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 00-.659-1.591L3.659 7.409A2.25 2.25 0 013 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0112 3z"})}),b&&(0,n.jsx)("button",{onClick:()=>v(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300",children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),h&&h.length>1&&!b&&(0,n.jsx)("div",{className:"flex flex-wrap gap-1 mt-1.5",children:h.map(e=>(0,n.jsxs)("button",{onClick:()=>v(e+"-*"),className:"px-1.5 py-0.5 text-[10px] font-mono bg-zinc-100 dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 rounded hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors",children:[e,"-*"]},e))})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar px-5 py-3",children:0===j.length&&b?(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,n.jsxs)("p",{className:"text-xs text-zinc-400 dark:text-zinc-500",children:["No comments matching “",b,"”"]}),(0,n.jsx)("button",{onClick:()=>v(""),className:"text-[10px] text-emerald-600 dark:text-emerald-400 hover:underline mt-1",children:"Clear filter"})]}):0===j.length?(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,n.jsx)("svg",{className:"w-8 h-8 text-zinc-200 dark:text-zinc-700 mb-3",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 011.037-.443 48.282 48.282 0 005.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z"})}),(0,n.jsx)("p",{className:"text-xs text-zinc-400 dark:text-zinc-500",children:"No comments yet"}),(0,n.jsx)("p",{className:"text-[10px] text-zinc-300 dark:text-zinc-600 mt-1",children:"Right-click a node to leave a comment"})]}):(0,n.jsx)("div",{className:"space-y-0",children:j.filter(e=>!e.replyTo).map(e=>(0,n.jsx)(iq,{comment:e,currentDid:o,isAuthenticated:a,onNodeNavigate:l,onLike:s,onDelete:c,onStartReply:e=>f(e.uri),replyingToUri:p,replyText:x,onReplyTextChange:m,onSubmitReply:w,onCancelReply:()=>{f(null),m("")},isSubmittingReply:g,depth:0,prefixes:h},e.uri))})}),(0,n.jsxs)("div",{className:"shrink-0 px-5 py-3 border-t border-zinc-100 dark:border-zinc-800 bg-zinc-50/50 dark:bg-zinc-800/50",children:[a?(0,n.jsx)(iX,{prefixes:h||[],onSubmit:u}):(0,n.jsx)("div",{className:"text-[10px] text-zinc-400 dark:text-zinc-500",children:"Sign in to comment"}),(0,n.jsx)("div",{className:"text-[10px] text-zinc-400 dark:text-zinc-500 mt-2",children:b?(0,n.jsxs)(n.Fragment,{children:[j.length," of ",i.length," comments matching “",b,"”"]}):(0,n.jsxs)(n.Fragment,{children:[i.length," comment",1!==i.length?"s":""," across all issues"]})})]})]})}function iq({comment:e,currentDid:t,isAuthenticated:i,onNodeNavigate:l,onLike:a,onDelete:o,onStartReply:s,replyingToUri:c,replyText:d,onReplyTextChange:u,onSubmitReply:h,onCancelReply:p,isSubmittingReply:f,depth:x,prefixes:m}){let[g,k]=(0,r.useState)(!1),[b,v]=(0,r.useState)(!1),y=t&&t===e.did,w=!!t&&e.likes.some(e=>e.did===t),j=c===e.uri,z=async()=>{if(a&&!g){k(!0);try{await a(e)}catch(e){console.error("Failed to toggle like:",e)}finally{k(!1)}}},N=async()=>{if(o&&!b){v(!0);try{await o(e)}catch(e){console.error("Failed to delete comment:",e)}finally{v(!1)}}};return(0,n.jsxs)("div",{className:`${x>0?"ml-4 pl-3 border-l border-zinc-100 dark:border-zinc-800":""}`,children:[(0,n.jsxs)("div",{className:`py-3 ${0===x?"border-b border-zinc-50 dark:border-zinc-800":""}`,children:[0===x&&(m?.includes(e.nodeId)?(0,n.jsxs)("span",{className:"inline-flex items-center px-1.5 py-0.5 mb-1.5 rounded text-[10px] font-mono bg-blue-50 dark:bg-blue-950 text-blue-600 dark:text-blue-400",children:["📢 ",e.nodeId]}):(0,n.jsx)("button",{onClick:()=>l(e.nodeId),className:"inline-flex items-center px-1.5 py-0.5 mb-1.5 rounded text-[10px] font-mono bg-emerald-50 dark:bg-emerald-950 text-emerald-600 dark:text-emerald-400 hover:bg-emerald-100 dark:hover:bg-emerald-900 transition-colors",children:e.nodeId})),(0,n.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,n.jsx)("div",{className:"shrink-0 w-4 h-4 rounded-full bg-zinc-100 dark:bg-zinc-800 overflow-hidden",children:e.avatar?(0,n.jsx)("img",{src:e.avatar,alt:"",className:"w-full h-full object-cover"}):(0,n.jsx)("div",{className:"w-full h-full flex items-center justify-center text-[8px] font-medium text-zinc-400 dark:text-zinc-500",children:(e.handle||e.did).charAt(0).toUpperCase()})}),(0,n.jsx)("a",{href:`https://www.impactindexer.org/data?did=${e.did}`,target:"_blank",rel:"noopener noreferrer",className:"text-xs font-medium text-zinc-600 dark:text-zinc-400 truncate hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:e.displayName||e.handle||e.did.slice(0,16)+"..."}),(0,n.jsx)("span",{className:"text-[10px] text-zinc-300 dark:text-zinc-600 shrink-0",children:ih(e.createdAt)})]}),(0,n.jsx)("p",{className:"text-xs text-zinc-500 dark:text-zinc-400 leading-relaxed whitespace-pre-wrap break-words",children:e.text}),(0,n.jsxs)("div",{className:"flex items-center gap-2 mt-1 text-[10px]",children:[(0,n.jsxs)("button",{onClick:z,disabled:!i||g,className:`flex items-center gap-0.5 transition-colors ${w?"text-rose-500":"text-zinc-300 dark:text-zinc-600 hover:text-rose-500"} disabled:opacity-50`,children:[(0,n.jsx)(iE,{className:"w-3 h-3",filled:w}),e.likes.length>0&&(0,n.jsx)("span",{children:e.likes.length})]}),(0,n.jsx)("button",{onClick:()=>s(e),disabled:!i,className:`transition-colors disabled:opacity-50 ${j?"text-emerald-500 dark:text-emerald-400":"text-zinc-300 dark:text-zinc-600 hover:text-zinc-500 dark:hover:text-zinc-400"}`,children:"reply"}),y&&o&&(0,n.jsx)("button",{onClick:N,disabled:b,className:"ml-auto text-zinc-300 dark:text-zinc-600 hover:text-red-400 disabled:opacity-50 transition-colors",children:b?"...":"delete"})]})]}),j&&(0,n.jsx)(iY,{replyingTo:e,replyText:d,onTextChange:u,onSubmit:h,onCancel:p,isSubmitting:f}),e.replies.length>0&&(0,n.jsx)("div",{children:e.replies.map(e=>(0,n.jsx)(iq,{comment:e,currentDid:t,isAuthenticated:i,onNodeNavigate:l,onLike:a,onDelete:o,onStartReply:s,replyingToUri:c,replyText:d,onReplyTextChange:u,onSubmitReply:h,onCancelReply:p,isSubmittingReply:f,depth:x+1,prefixes:m},e.uri))})]})}function iY({replyingTo:e,replyText:t,onTextChange:r,onSubmit:i,onCancel:l,isSubmitting:a}){return(0,n.jsxs)("div",{className:"mt-2 ml-4 pl-3 border-l border-emerald-200 space-y-1.5",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] text-zinc-400 dark:text-zinc-500",children:[(0,n.jsx)("span",{children:"Replying to"}),(0,n.jsx)("a",{href:`https://www.impactindexer.org/data?did=${e.did}`,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-zinc-600 dark:text-zinc-400 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:e.displayName||e.handle})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("input",{type:"text",value:t,onChange:e=>r(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||i()},placeholder:"Write a reply...",disabled:a,autoFocus:!0,className:"flex-1 px-2 py-1 text-xs bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-700 rounded placeholder-zinc-400 dark:placeholder-zinc-500 focus:outline-none focus:border-emerald-400 disabled:opacity-50"}),(0,n.jsx)("button",{onClick:i,disabled:!t.trim()||a,className:"px-2 py-1 text-[10px] font-medium text-emerald-600 dark:text-emerald-400 hover:text-emerald-700 dark:hover:text-emerald-300 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:a?"...":"Reply"}),(0,n.jsx)("button",{onClick:l,disabled:a,className:"px-2 py-1 text-[10px] text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 disabled:opacity-50 transition-colors",children:"Cancel"})]})]})}function iX({prefixes:e,onSubmit:t}){let[i,l]=(0,r.useState)(""),[a,o]=(0,r.useState)(e[0]||""),[s,c]=(0,r.useState)(!1);(0,r.useEffect)(()=>{1===e.length&&o(e[0])},[e]);let d=async()=>{if(i.trim()&&a&&t){c(!0);try{await t(a,i.trim()),l("")}catch(e){console.error("Failed to post comment:",e)}finally{c(!1)}}};return(0,n.jsxs)("div",{children:[e.length>1&&(0,n.jsx)("select",{value:a,onChange:e=>o(e.target.value),className:"w-full mb-2 px-2 py-1.5 text-xs border border-zinc-200 dark:border-zinc-700 rounded-md bg-white dark:bg-zinc-800 text-zinc-700 dark:text-zinc-300",children:e.map(e=>(0,n.jsx)("option",{value:e,children:e},e))}),(0,n.jsx)("textarea",{value:i,onChange:e=>l(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),d())},placeholder:"Write a comment...",rows:2,className:"w-full px-2.5 py-2 text-xs border border-zinc-200 dark:border-zinc-700 rounded-md bg-white dark:bg-zinc-800 text-zinc-700 dark:text-zinc-300 placeholder-zinc-400 dark:placeholder-zinc-500 resize-none focus:outline-none focus:ring-1 focus:ring-emerald-500"}),(0,n.jsxs)("div",{className:"flex items-center justify-between mt-1.5",children:[(0,n.jsxs)("span",{className:"text-[10px] text-zinc-300 dark:text-zinc-600",children:["u">typeof navigator&&navigator.platform?.includes("Mac")?"⌘":"Ctrl","+Enter to send",e.length<=1&&a&&(0,n.jsxs)(n.Fragment,{children:[" · posting to ",(0,n.jsx)("span",{className:"font-medium text-zinc-400",children:a})]})]}),(0,n.jsx)("button",{onClick:d,disabled:!i.trim()||!a||s,className:"px-3 py-1 text-[11px] font-medium text-white bg-emerald-500 rounded-md hover:bg-emerald-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:s?"Sending...":"Send"})]})]})}function iK({type:e,className:t}){let r=t||"w-3.5 h-3.5 shrink-0";switch(e){case"node-created":return(0,n.jsxs)("svg",{className:`${r} text-emerald-500`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,n.jsx)("line",{x1:"8",y1:"5",x2:"8",y2:"11"}),(0,n.jsx)("line",{x1:"5",y1:"8",x2:"11",y2:"8"})]});case"node-closed":return(0,n.jsxs)("svg",{className:`${r} text-zinc-400`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,n.jsx)("polyline",{points:"5.5,8 7.5,10 10.5,6"})]});case"node-status-changed":return(0,n.jsx)("svg",{className:`${r} text-amber-500`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,n.jsx)("path",{d:"M3 8h10M10 5l3 3-3 3"})});case"node-priority-changed":return(0,n.jsx)("svg",{className:`${r} text-amber-500`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,n.jsx)("path",{d:"M8 3v7M5 6l3-3 3 3M4 13h8"})});case"node-title-changed":return(0,n.jsx)("svg",{className:`${r} text-amber-500`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,n.jsx)("path",{d:"M3 4h10M3 8h6M3 12h8"})});case"node-owner-changed":return(0,n.jsxs)("svg",{className:`${r} text-amber-500`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"6",cy:"6",r:"2.5"}),(0,n.jsx)("path",{d:"M1.5 13c0-2 1.8-3.5 4.5-3.5M10 9l2 2 3-3"})]});case"node-assignee-changed":return(0,n.jsxs)("svg",{className:`${r} text-violet-500`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"6",cy:"6",r:"2.5"}),(0,n.jsx)("path",{d:"M1.5 13c0-2 1.8-3.5 4.5-3.5M10 8l2 2 2-2M12 10V5"})]});case"link-added":return(0,n.jsx)("svg",{className:`${r} text-blue-500`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,n.jsx)("path",{d:"M6.5 9.5l3-3M4 11a2.5 2.5 0 003.5 0l1-1M8.5 6a2.5 2.5 0 013.5 0l0 0"})});case"link-removed":return(0,n.jsxs)("svg",{className:`${r} text-red-400`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("path",{d:"M4 11a2.5 2.5 0 003.5 0l1-1M8.5 6a2.5 2.5 0 013.5 0l0 0"}),(0,n.jsx)("line",{x1:"3",y1:"3",x2:"13",y2:"13",strokeWidth:"1.5"})]});case"comment-added":case"reply-added":return(0,n.jsx)("svg",{className:`${r} text-blue-500`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,n.jsx)("path",{d:"M2 4.5a1.5 1.5 0 011.5-1.5h9A1.5 1.5 0 0114 4.5v5a1.5 1.5 0 01-1.5 1.5H5L2 14V4.5z"})});case"task-claimed":return(0,n.jsxs)("svg",{className:`${r} text-emerald-500`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"5.5",r:"2.5"}),(0,n.jsx)("path",{d:"M3 13.5c0-2.5 2.2-4.5 5-4.5s5 2 5 4.5"})]});case"task-unclaimed":return(0,n.jsxs)("svg",{className:`${r} text-red-400`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"5.5",r:"2.5"}),(0,n.jsx)("path",{d:"M3 13.5c0-2.5 2.2-4.5 5-4.5s5 2 5 4.5"}),(0,n.jsx)("line",{x1:"11",y1:"3",x2:"13",y2:"5"})]});case"like-added":return(0,n.jsx)("svg",{className:`${r} text-rose-400`,viewBox:"0 0 16 16",fill:"currentColor",children:(0,n.jsx)("path",{d:"M8 13.7l-.6-.5C4 10.2 2 8.3 2 6a3 3 0 016-1 3 3 0 016 1c0 2.3-2 4.2-5.4 7.2l-.6.5z"})})}}function iG(e){switch(e){case"node-created":case"task-claimed":return"bg-emerald-400";case"node-closed":return"bg-zinc-300";case"node-status-changed":case"node-priority-changed":case"node-title-changed":case"node-owner-changed":return"bg-amber-400";case"node-assignee-changed":return"bg-violet-400";case"link-added":case"comment-added":case"reply-added":return"bg-blue-400";case"link-removed":case"task-unclaimed":return"bg-red-300";case"like-added":return"bg-rose-300"}}function iJ(e){switch(e.type){case"node-created":{let t=e.meta?.issueType||"task";return`created a ${t}`}case"node-closed":return`closed this${e.detail&&"Closed"!==e.detail?` (${e.detail})`:""}`;case"node-status-changed":return e.detail?`changed status ${e.detail}`:"changed status";case"node-priority-changed":return`changed priority ${e.detail||""}`.trim();case"node-title-changed":return"updated the title";case"node-owner-changed":return`changed owner ${e.detail||""}`.trim();case"node-assignee-changed":{let t=e.meta?.to,n=e.meta?.from;if(t&&!n)return`assigned ${t}`;if(!t&&n)return`unassigned ${n}`;if(t)return`reassigned to ${t}`;return"changed assignee"}case"link-added":return`added a dependency on ${e.meta?.target||""}`;case"link-removed":return`removed dependency on ${e.meta?.target||""}`;case"comment-added":return e.detail?`commented: "${e.detail}"`:"commented";case"reply-added":return e.detail?`replied: "${e.detail}"`:"replied";case"task-claimed":return"claimed this task";case"task-unclaimed":return"unclaimed this task";case"like-added":return e.detail||"liked a comment";default:return e.detail||"updated"}}function iQ({event:e,onNodeClick:t,onHandleClick:r}){return(0,n.jsxs)("div",{className:"flex items-center gap-2 py-2 px-3 group hover:bg-zinc-50/60 dark:hover:bg-zinc-800/60 transition-colors",children:[(0,n.jsx)("div",{className:`w-1 h-1 rounded-full shrink-0 ${iG(e.type)}`}),(0,n.jsx)(iK,{type:e.type,className:"w-3 h-3 shrink-0"}),(0,n.jsxs)("div",{className:"flex-1 min-w-0 text-[11px] text-zinc-600 dark:text-zinc-400 truncate",children:[e.actor?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:()=>r?.(e.actor.handle),className:"font-medium text-zinc-800 dark:text-zinc-200 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:e.actor.handle})," "]}):t?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:()=>t(e.nodeId),className:"font-medium text-zinc-700 dark:text-zinc-300 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:e.nodeId})," "]}):null,(0,n.jsx)("span",{className:"text-zinc-500 dark:text-zinc-400",children:iJ(e)})]}),(0,n.jsx)("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500 shrink-0 tabular-nums opacity-0 group-hover:opacity-100 transition-opacity",children:ih(new Date(e.time).toISOString())})]})}function iZ({event:e,onNodeClick:t,onHandleClick:r}){return(0,n.jsxs)("div",{className:"flex gap-3 py-3 px-4 hover:bg-zinc-50/50 dark:hover:bg-zinc-800/50 transition-colors group",children:[(0,n.jsx)("div",{className:`w-0.5 self-stretch rounded-full shrink-0 ${iG(e.type)}`}),(0,n.jsx)("div",{className:"mt-0.5 shrink-0",children:e.actor?.avatar?(0,n.jsx)("img",{src:e.actor.avatar,alt:e.actor.handle,className:"w-7 h-7 rounded-full ring-1 ring-zinc-100 dark:ring-zinc-700"}):e.actor?(0,n.jsx)("div",{className:"w-7 h-7 rounded-full bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center text-[11px] font-medium text-zinc-500 dark:text-zinc-400",children:e.actor.handle.charAt(0).toUpperCase()}):(0,n.jsx)("div",{className:"w-7 h-7 rounded-full bg-zinc-50 dark:bg-zinc-800 flex items-center justify-center",children:(0,n.jsx)(iK,{type:e.type,className:"w-3.5 h-3.5"})})}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-baseline gap-1.5 text-[12px] leading-snug",children:[e.actor&&(0,n.jsx)("button",{onClick:()=>r?.(e.actor.handle),className:"font-semibold text-zinc-800 dark:text-zinc-200 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:e.actor.handle}),(0,n.jsx)("span",{className:"text-zinc-500 dark:text-zinc-400",children:iJ(e)})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5 mt-1",children:[t&&(0,n.jsx)("button",{onClick:()=>t(e.nodeId),className:"inline-flex items-center px-1.5 py-0.5 text-[10px] font-mono font-medium text-emerald-700 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-950 rounded-md hover:bg-emerald-100 dark:hover:bg-emerald-900 transition-colors",children:e.nodeId}),e.nodeTitle&&(0,n.jsx)("span",{className:"text-[11px] text-zinc-400 dark:text-zinc-500 truncate",children:e.nodeTitle})]})]}),(0,n.jsx)("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500 shrink-0 tabular-nums mt-0.5",children:ih(new Date(e.time).toISOString())})]})}function i0({event:e,variant:t="compact",onNodeClick:r,onHandleClick:i}){return"compact"===t?(0,n.jsx)(iQ,{event:e,onNodeClick:r,onHandleClick:i}):(0,n.jsx)(iZ,{event:e,onNodeClick:r,onHandleClick:i})}function i1({events:e,collapsed:t,compact:r,onToggleCollapse:i,onExpandPanel:l,onNodeClick:a,onHandleClick:o}){let s=e.filter(e=>Date.now()-e.time<3e5).length;return t?(0,n.jsxs)("button",{onClick:i,className:"group flex items-center gap-2 px-3 py-2 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm rounded-full border border-zinc-200/80 dark:border-zinc-700/80 shadow-sm hover:bg-white dark:hover:bg-zinc-900 hover:shadow-md transition-all",title:"Show activity feed",children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5 text-zinc-400 dark:text-zinc-500 group-hover:text-emerald-500 dark:group-hover:text-emerald-400 transition-colors",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,n.jsx)("polyline",{points:"8,4 8,8 11,10"})]}),(0,n.jsx)("span",{className:"text-xs text-zinc-500 dark:text-zinc-400 group-hover:text-zinc-700 dark:group-hover:text-zinc-200 transition-colors",children:"Activity"}),s>0&&(0,n.jsx)("span",{className:"text-[10px] font-medium text-white bg-emerald-500 rounded-full px-1.5 py-0.5 min-w-[18px] text-center leading-tight",children:s})]}):(0,n.jsxs)("div",{className:`${r?"w-60":"w-72"} bg-white/95 dark:bg-zinc-900/95 backdrop-blur-sm rounded-xl border border-zinc-200/80 dark:border-zinc-700/80 shadow-lg overflow-hidden`,children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-3.5 py-2.5 border-b border-zinc-100/80 dark:border-zinc-800/80",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),(0,n.jsx)("span",{className:"text-[11px] font-semibold text-zinc-600 dark:text-zinc-400",children:"Live Activity"})]}),(0,n.jsx)("button",{onClick:i,className:"text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors p-1 -mr-0.5 rounded-full hover:bg-zinc-100 dark:hover:bg-zinc-800",title:"Collapse",children:(0,n.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})})]}),(0,n.jsx)("div",{className:"py-0.5 max-h-[260px] overflow-y-auto custom-scrollbar",children:0===e.length?(0,n.jsxs)("div",{className:"py-6 text-center",children:[(0,n.jsxs)("svg",{className:"w-5 h-5 text-zinc-200 dark:text-zinc-700 mx-auto mb-1.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,n.jsx)("polyline",{points:"8,4 8,8 11,10"})]}),(0,n.jsx)("p",{className:"text-[11px] text-zinc-400 dark:text-zinc-500",children:"No activity yet"})]}):e.slice(0,r?3:6).map((e,t)=>(0,n.jsx)("div",{className:0===t?"bg-emerald-50/30 dark:bg-emerald-950/30":"",children:(0,n.jsx)(i0,{event:e,variant:"compact",onNodeClick:a,onHandleClick:o})},e.id))}),e.length>0&&(0,n.jsxs)("div",{className:"flex items-center justify-between px-3.5 py-2 border-t border-zinc-100/80 dark:border-zinc-800/80 bg-zinc-50/30 dark:bg-zinc-800/30",children:[(0,n.jsxs)("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500",children:[e.length," event",1!==e.length?"s":""]}),(0,n.jsxs)("button",{onClick:l,className:"text-[11px] text-emerald-600 dark:text-emerald-400 hover:text-emerald-700 dark:hover:text-emerald-300 transition-colors font-medium flex items-center gap-1",children:["See all",(0,n.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]})]})]})}function i5(e,t){let n=new Set(e.map(e=>e.id)),r=[...e];for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r.sort((e,t)=>t.time-e.time),r}let i2=[{key:"issues",label:"Issues",icon:"circle"},{key:"deps",label:"Deps",icon:"link"},{key:"comments",label:"Comments",icon:"chat"},{key:"claims",label:"Claims",icon:"user"},{key:"likes",label:"Likes",icon:"heart"}];function i4(e){let t=new Map,n=[];for(let r of e){let e=function(e){let t=Date.now()-e,n=t/36e5,r=t/864e5;return n<1?"Just now":n<24?"Today":r<2?"Yesterday":r<7?"This week":r<30?"This month":"Older"}(r.time);t.has(e)||(t.set(e,[]),n.push(e)),t.get(e).push(r)}return n.map(e=>({label:e,events:t.get(e)}))}function i3({events:e,isOpen:t,onClose:i,onNodeClick:l,onHandleClick:a}){let[o,s]=(0,r.useState)(""),[c,d]=(0,r.useState)(new Set(i2.map(e=>e.key))),[u,h]=(0,r.useState)(50);(0,r.useEffect)(()=>{h(50)},[e,c,o]);let p=e=>{d(t=>{let n=new Set(t);return n.has(e)?n.size>1&&n.delete(e):n.add(e),n})},f=(0,r.useMemo)(()=>{let t=e;if(t=t.filter(e=>c.has(function(e){switch(e){case"node-created":case"node-closed":case"node-status-changed":case"node-priority-changed":case"node-title-changed":case"node-owner-changed":case"node-assignee-changed":return"issues";case"link-added":case"link-removed":return"deps";case"comment-added":case"reply-added":return"comments";case"task-claimed":case"task-unclaimed":return"claims";case"like-added":return"likes"}}(e.type))),o.trim()){let e=o.trim().toLowerCase();t=t.filter(t=>t.nodeId.toLowerCase().includes(e)||t.nodeTitle&&t.nodeTitle.toLowerCase().includes(e)||t.actor?.handle&&t.actor.handle.toLowerCase().includes(e)||t.detail&&t.detail.toLowerCase().includes(e))}return t},[e,c,o]);(0,r.useMemo)(()=>i4(f),[f]);let x=(0,r.useMemo)(()=>f.slice(0,u),[f,u]),m=f.length>u,g=(0,r.useMemo)(()=>i4(x),[x]),k=c.size===i2.length;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("aside",{className:`hidden md:flex absolute top-0 right-0 h-full w-[360px] bg-white dark:bg-zinc-900 border-l border-zinc-200 dark:border-zinc-700 flex-col shadow-xl z-30 transform transition-transform duration-300 ease-out ${t?"translate-x-0":"translate-x-full"}`,children:[(0,n.jsxs)("div",{className:"shrink-0 px-5 py-3 border-b border-zinc-100 dark:border-zinc-800 flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h2",{className:"text-xs font-semibold text-zinc-400 uppercase tracking-wider",children:"Activity"}),e.length>0&&(0,n.jsx)("span",{className:"px-1.5 py-0.5 bg-emerald-50 dark:bg-emerald-950 text-emerald-600 dark:text-emerald-400 rounded-full text-[10px] font-medium",children:e.length})]}),(0,n.jsx)("button",{onClick:i,className:"p-1 text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors rounded-full hover:bg-zinc-100 dark:hover:bg-zinc-800",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"px-4 pt-3 pb-2 shrink-0",children:(0,n.jsxs)("div",{className:"flex items-center bg-zinc-50/80 dark:bg-zinc-800/80 rounded-full border border-zinc-200/60 dark:border-zinc-700/60 overflow-hidden",children:[(0,n.jsx)("div",{className:"pl-3 pr-1 text-zinc-400 dark:text-zinc-500",children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),(0,n.jsx)("input",{type:"text",value:o,onChange:e=>s(e.target.value),placeholder:"Search activity...",className:"flex-1 px-2 py-2 text-xs text-zinc-800 dark:text-zinc-200 bg-transparent outline-none placeholder:text-zinc-400 dark:placeholder:text-zinc-500"}),o&&(0,n.jsx)("button",{onClick:()=>s(""),className:"pr-3 text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300",children:(0,n.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})}),(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5 px-4 pb-3 shrink-0",children:i2.map(e=>{let t=c.has(e.key);return(0,n.jsx)("button",{onClick:()=>p(e.key),className:`px-2.5 py-1 text-[11px] font-medium rounded-full border transition-all ${t?"bg-emerald-50 dark:bg-emerald-950 text-emerald-700 dark:text-emerald-400 border-emerald-200 dark:border-emerald-800 shadow-sm":"bg-white dark:bg-zinc-900 text-zinc-400 dark:text-zinc-500 border-zinc-200 dark:border-zinc-700 hover:text-zinc-600 dark:hover:text-zinc-300 hover:border-zinc-300 dark:hover:border-zinc-600"}`,children:e.label},e.key)})}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar border-t border-zinc-100 dark:border-zinc-800",children:0===f.length?(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,n.jsx)("svg",{className:"w-8 h-8 text-zinc-200 dark:text-zinc-700 mb-3",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,n.jsx)("p",{className:"text-xs text-zinc-400 dark:text-zinc-500",children:o.trim()?"No activity matching your search":"No activity yet"}),o.trim()&&(0,n.jsx)("button",{onClick:()=>s(""),className:"text-[11px] text-emerald-600 dark:text-emerald-400 hover:text-emerald-700 dark:hover:text-emerald-300 mt-1.5",children:"Clear search"})]}):(0,n.jsxs)(n.Fragment,{children:[g.map(e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"sticky top-0 z-[1] px-4 py-1.5 bg-zinc-50/95 dark:bg-zinc-800/95 backdrop-blur-sm border-b border-zinc-100/60 dark:border-zinc-700/60",children:(0,n.jsx)("span",{className:"text-[10px] font-semibold text-zinc-400 uppercase tracking-wider",children:e.label})}),(0,n.jsx)("div",{className:"divide-y divide-zinc-50 dark:divide-zinc-800",children:e.events.map(e=>(0,n.jsx)(i0,{event:e,variant:"full",onNodeClick:l,onHandleClick:a},e.id))})]},e.label)),m&&(0,n.jsx)("div",{className:"flex justify-center py-3 border-t border-zinc-100/60 dark:border-zinc-700/60",children:(0,n.jsxs)("button",{onClick:()=>h(e=>e+50),className:"text-[11px] text-emerald-600 dark:text-emerald-400 hover:text-emerald-700 dark:hover:text-emerald-300 font-medium px-3 py-1.5 rounded-full hover:bg-emerald-50 dark:hover:bg-emerald-950 transition-colors",children:["Show ",Math.min(50,f.length-u)," more events"]})})]})}),(0,n.jsx)("div",{className:"shrink-0 px-5 py-2.5 border-t border-zinc-100 dark:border-zinc-800 bg-zinc-50/50 dark:bg-zinc-800/50",children:(0,n.jsxs)("div",{className:"text-[10px] text-zinc-400 dark:text-zinc-500",children:[m?`${u} of ${f.length} events`:`${f.length} event${1!==f.length?"s":""}`,!k&&" (filtered)",o.trim()&&` matching "${o.trim()}"`]})})]}),(0,n.jsx)("div",{className:`md:hidden fixed inset-x-0 bottom-0 z-20 transition-transform duration-300 ease-out ${t?"translate-y-0":"translate-y-full"}`,children:(0,n.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-t-2xl shadow-xl border-t border-zinc-200 dark:border-zinc-700 max-h-[60vh] flex flex-col",children:[(0,n.jsx)("div",{className:"flex justify-center pt-3 pb-1",children:(0,n.jsx)("div",{className:"w-8 h-1 bg-zinc-300 dark:bg-zinc-600 rounded-full"})}),(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 py-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:"Activity"}),e.length>0&&(0,n.jsx)("span",{className:"px-1.5 py-0.5 bg-emerald-50 dark:bg-emerald-950 text-emerald-600 dark:text-emerald-400 rounded-full text-[10px] font-medium",children:e.length})]}),(0,n.jsx)("button",{onClick:i,className:"p-1 text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5 px-5 pb-3",children:i2.map(e=>(0,n.jsx)("button",{onClick:()=>p(e.key),className:`px-2.5 py-1 text-[11px] font-medium rounded-full border transition-colors ${c.has(e.key)?"bg-emerald-50 dark:bg-emerald-950 text-emerald-700 dark:text-emerald-400 border-emerald-200 dark:border-emerald-800":"bg-white dark:bg-zinc-900 text-zinc-400 dark:text-zinc-500 border-zinc-200 dark:border-zinc-700"}`,children:e.label},e.key))}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar",children:0===f.length?(0,n.jsx)("div",{className:"py-8 text-center text-xs text-zinc-400 dark:text-zinc-500",children:"No activity matching filters"}):(0,n.jsxs)(n.Fragment,{children:[g.map(e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"sticky top-0 z-[1] px-5 py-1.5 bg-zinc-50/95 dark:bg-zinc-800/95 backdrop-blur-sm border-b border-zinc-100/60 dark:border-zinc-700/60",children:(0,n.jsx)("span",{className:"text-[10px] font-semibold text-zinc-400 uppercase tracking-wider",children:e.label})}),(0,n.jsx)("div",{className:"divide-y divide-zinc-50 dark:divide-zinc-800",children:e.events.map(e=>(0,n.jsx)(i0,{event:e,variant:"full",onNodeClick:l,onHandleClick:a},e.id))})]},e.label)),m&&(0,n.jsx)("div",{className:"flex justify-center py-3 border-t border-zinc-100/60 dark:border-zinc-700/60",children:(0,n.jsxs)("button",{onClick:()=>h(e=>e+50),className:"text-[11px] text-emerald-600 dark:text-emerald-400 hover:text-emerald-700 dark:hover:text-emerald-300 font-medium px-3 py-1.5 rounded-full hover:bg-emerald-50 dark:hover:bg-emerald-950 transition-colors",children:["Show ",Math.min(50,f.length-u)," more events"]})})]})})]})})]})}let i6=[{target:"graph",title:"The Dependency Graph",description:"Each circle is a task or issue. The flowing particles between them show the direction of dependencies — what needs to happen before something else can start. Bigger circles mean more connections.",padding:0},{target:"layouts",title:"Layout Modes",description:"Switch how the graph is arranged. Force is organic and physics-based. DAG gives you a clean top-down tree. Radial spreads nodes in rings. Cluster groups by project. Spread spaces everything out for screenshots."},{target:"btn-collapse",title:"Collapse / Expand",description:"Group all epic tasks into a single node, or expand them back out. Great for getting a high-level overview of your project when there are many tasks."},{target:"btn-clusters",title:"Cluster Labels",description:"Toggle transparent labels that show project prefixes behind groups of related nodes. Helps you see which project each cluster belongs to at a glance."},{target:"btn-autofit",title:"Auto-fit",description:"When enabled (green), the camera automatically re-centers and zooms to fit all nodes after every update. Turn it off to keep the camera fixed while you explore."},{target:"btn-pulse",title:"Pulse",description:"Highlights the most recently active node with emerald ripples. Useful for spotting which task just changed status or was just created."},{target:"legend-stats",title:"Project Stats",description:"A quick summary of your project: total issues, dependency count, and how many separate projects are tracked. When legend filters are active, these numbers update to reflect only the visible nodes."},{target:"legend-color-mode",title:"Color Mode Selector",description:"Switch what the node fill color represents. Status shows open/closed/blocked. Priority shows urgency. Type highlights epics, tasks, bugs, features, and chores. Owner, Assignee, and Prefix color by person or project. The ring around each node always shows which project it belongs to."},{target:"legend-items",title:"Legend",description:'Shows what each color means for the current color mode. Click any label to filter the graph — only matching nodes will be shown. Click more labels to combine filters (union). Click again to remove a filter, or use "Clear filters" to reset. The colored dots match the node fills in the graph.'},{target:"minimap",title:"Minimap",description:"A bird’s-eye view of your entire graph. Click anywhere to jump there. Drag the edges to resize it."},{target:"overlays",title:"Leaderboard & Activity",description:"These compact overlays live in the top-right corner. The activity feed shows recent changes — tasks created, statuses updated, priorities shifted. The leaderboard ranks contributors by closed issues, created issues, and comments. Click either to expand into a full sidebar."},{target:"graph",title:"Multi-Select & Group Drag",description:"Right-click and drag on the canvas background to draw a selection rectangle around multiple nodes. Shift-click individual nodes to toggle them in/out of the selection. Once selected, drag any selected node to move the entire group together. Press Escape to deselect all.",padding:0},{target:"graph",title:"Quick Navigation Shortcuts",description:"Press Shift+0 to instantly zoom to the most recently edited node (the pulsing one). Press Shift+1 through Shift+9 to jump to a node belonging to the corresponding leaderboard contributor — Shift+1 for #1, Shift+2 for #2, and so on. Great for quickly checking what your top contributors are working on.",padding:0},{target:"auth-section",title:"Sign In & Profiles",description:"Sign in with your Bluesky/ATProto account to comment, claim tasks, and like comments. Click any avatar on the graph to see that person’s profile — their stats, recent activity, and contributions. Click your own handle in the dropdown to view your profile."},{target:"btn-theme",title:"Dark Mode",description:"Toggle between light and dark themes. Your preference is saved and persists across sessions. The entire UI — canvas, panels, tooltips, and overlays — adapts to your chosen theme."},{target:"graph",title:"Interacting with Nodes",description:"Click a node to see its details, labels, assignee, and linked commits. Hover for a quick tooltip. Right-click for actions like viewing descriptions, commenting, claiming tasks, collapsing epics, or focusing on an epic’s subgraph. Avatars on nodes show who claimed or is assigned — hover for details like “einstein.climateai.org claimed beads-map-123”, click to open their profile.",padding:0},{target:"nav-replay",title:"Replay",description:"Step through your project’s history one event at a time. Watch issues appear and change status as they were created. Use the scrubber to jump to any point in time."},{target:"nav-comments",title:"Comments",description:"Opens a sidebar showing all conversations across your beads. See who said what, reply to threads, and like comments — all powered by the AT Protocol."},{target:"nav-activity",title:"Activity",description:'A real-time feed of changes for your local issues. See when tasks are created, statuses change, priorities shift, and dependencies are added. Use "Show more" to page through the full history. During timeline replay, the feed filters to only events up to the current point in time.'},{target:"nav-learn",title:"Learn",description:"Opens the help panel with keyboard shortcuts, feature documentation, and this interactive tutorial. Click it anytime to come back here."}];function i8({step:e,onNext:t,onEnd:i}){let[l,a]=(0,r.useState)(null),o=(0,r.useCallback)(()=>{if(null===e)return void a(null);let t=i6[e];if(!t)return void a(null);let n=document.querySelector(`[data-tutorial="${t.target}"]`);if(n){let e=n.getBoundingClientRect(),r=t.padding??8;a({left:e.left-r,top:e.top-r,width:e.width+2*r,height:e.height+2*r})}else a(null)},[e]);if((0,r.useEffect)(()=>{o();let e=()=>o();window.addEventListener("resize",e);let t=setTimeout(o,150);return()=>{window.removeEventListener("resize",e),clearTimeout(t)}},[o]),null===e)return null;let s=e===i6.length-1;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"fixed inset-0 z-[55] cursor-pointer",onClick:()=>{s?i():t()},children:(0,n.jsxs)("svg",{className:"absolute inset-0 w-full h-full",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("defs",{children:(0,n.jsxs)("mask",{id:"tutorial-mask",children:[(0,n.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),l&&(0,n.jsx)("rect",{x:l.left,y:l.top,width:l.width,height:l.height,rx:8,ry:8,fill:"black"})]})}),(0,n.jsx)("rect",{width:"100%",height:"100%",fill:"rgba(0,0,0,0.45)",mask:"url(#tutorial-mask)"})]})}),l&&(0,n.jsx)("div",{className:"fixed rounded-lg ring-2 ring-emerald-400/60 dark:ring-emerald-500/60 animate-pulse z-[56]",style:{left:l.left,top:l.top,width:l.width,height:l.height,pointerEvents:"none"}})]})}let i7="#d20f39",i9="#179299",le="#fe640b",lt="#1e66f5",ln="#40a02b",lr="#8839ef",li="#209fb5",ll="#ea76cb";function la({isOpen:e,onClose:t,tutorialStep:r=null,onStartTutorial:i,onNextStep:l,onPrevStep:a,onEndTutorial:o}){let s=null!==r,c=s?"Tutorial":"Welcome to Heartbeads",d=s?(0,n.jsx)(lo,{step:r,onNext:l,onPrev:a,onEnd:o}):(0,n.jsx)(ld,{onStartTutorial:i});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("aside",{className:`hidden md:flex absolute top-0 right-0 h-full w-[360px] bg-white dark:bg-zinc-900 border-l border-zinc-200 dark:border-zinc-700 flex-col shadow-xl transform transition-transform duration-300 ease-out ${e?"translate-x-0":"translate-x-full"} ${s?"z-[60]":"z-30"}`,children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-zinc-100 dark:border-zinc-800 shrink-0",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:c}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar",children:d})]}),(0,n.jsx)("div",{className:`md:hidden fixed inset-x-0 bottom-0 transform transition-transform duration-300 ease-out ${e?"translate-y-0":"translate-y-full"} ${s?"z-[60]":"z-20"}`,children:(0,n.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-t-2xl shadow-2xl border-t border-zinc-200 dark:border-zinc-700 max-h-[70vh] flex flex-col",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-zinc-100 dark:border-zinc-800 shrink-0",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:c}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar",children:d})]})})]})}function lo({step:e,onNext:t,onPrev:r,onEnd:i}){let l=i6[e],a=i6.length,o=e===a-1;return(0,n.jsxs)("div",{className:"px-5 py-4 flex flex-col min-h-[300px]",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,n.jsxs)("span",{className:"text-xs font-medium",style:{color:i9},children:[e+1," / ",a]}),(0,n.jsx)("div",{className:"flex gap-1",children:Array.from({length:a}).map((t,r)=>(0,n.jsx)("div",{className:"w-1.5 h-1.5 rounded-full transition-colors",style:{backgroundColor:r===e?ln:r<e?i9:"#dce0e8"}},r))})]}),(0,n.jsx)("h3",{className:"text-base font-semibold text-zinc-900 dark:text-zinc-100 mb-2",children:l.title}),(0,n.jsx)("p",{className:"text-[13px] text-zinc-600 dark:text-zinc-300 leading-relaxed mb-6",children:l.description}),(0,n.jsx)("div",{className:"flex-1"}),(0,n.jsxs)("div",{className:"flex items-center gap-2 pt-4 border-t border-zinc-100 dark:border-zinc-800",children:[0===e?(0,n.jsx)("button",{onClick:i,className:"px-4 py-2 text-sm font-medium text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 rounded-lg hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors",children:"Skip"}):(0,n.jsx)("button",{onClick:r,className:"px-4 py-2 text-sm font-medium rounded-lg hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors",style:{color:lt},children:"Back"}),(0,n.jsx)("div",{className:"flex-1"}),o?(0,n.jsx)("button",{onClick:i,className:"px-4 py-2 text-sm font-medium text-white rounded-lg bg-emerald-500 hover:bg-emerald-600 transition-colors",children:"Done"}):(0,n.jsx)("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-white rounded-lg bg-emerald-500 hover:bg-emerald-600 transition-colors",children:"Next"})]})]})}function ls({color:e,children:t}){return(0,n.jsxs)("li",{className:"flex gap-2.5 items-start",children:[(0,n.jsx)("span",{className:"w-1.5 h-1.5 rounded-full mt-[6px] shrink-0",style:{backgroundColor:e}}),(0,n.jsx)("span",{children:t})]})}function lc({children:e,color:t}){return(0,n.jsx)("h3",{className:"text-[11px] font-semibold uppercase tracking-widest mb-2 mt-5 first:mt-0",style:{color:t},children:e})}function ld({onStartTutorial:e}){return(0,n.jsxs)("div",{className:"px-5 py-4 text-[13px] text-zinc-600 dark:text-zinc-300 leading-relaxed",children:[e&&(0,n.jsxs)("button",{onClick:e,className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 mb-5 text-white text-sm font-medium rounded-lg bg-emerald-500 hover:bg-emerald-600 transition-colors",children:[(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18v-5.25m0 0a6.01 6.01 0 001.5-.189m-1.5.189a6.01 6.01 0 01-1.5-.189m3.75 7.478a12.06 12.06 0 01-4.5 0m3.75 2.383a14.406 14.406 0 01-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 10-7.517 0c.85.493 1.509 1.333 1.509 2.316V18"})}),"Take the guided tour"]}),(0,n.jsx)("p",{className:"text-zinc-900 dark:text-zinc-100 font-medium mb-1",children:"Your command center for AI coding tasks."}),(0,n.jsx)("p",{className:"mb-4 text-zinc-500 dark:text-zinc-400",children:"Heartbeads shows everything your AI agents are working on as a live, interactive graph — tasks, dependencies, who's doing what, and what's blocking progress."}),(0,n.jsx)(lc,{color:i7,children:"The graph"}),(0,n.jsxs)("p",{className:"mb-2",children:["Each ",(0,n.jsx)("strong",{children:"circle"})," is a task. ",(0,n.jsx)("strong",{children:"Flowing particles"})," ","stream between them to show dependency direction."]}),(0,n.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,n.jsxs)(ls,{color:i7,children:[(0,n.jsx)("strong",{children:"Bigger circles"})," — more connected, more important"]}),(0,n.jsxs)(ls,{color:i7,children:[(0,n.jsx)("strong",{children:"Solid lines + particles"})," — “blocks” (A must finish before B)"]}),(0,n.jsxs)(ls,{color:i7,children:[(0,n.jsx)("strong",{children:"Dashed lines"})," — parent-child grouping"]}),(0,n.jsxs)(ls,{color:i7,children:[(0,n.jsx)("strong",{children:"Colored ring"})," — which project it belongs to"]}),(0,n.jsxs)(ls,{color:i7,children:[(0,n.jsx)("strong",{children:"Avatars"})," — small profile pictures on nodes show who claimed or is assigned to that task"]}),(0,n.jsxs)(ls,{color:i7,children:[(0,n.jsx)("strong",{children:"Labels"})," — tags like “mobile”, “ux”, or “build” shown as pills in node details and hover tooltips"]})]}),(0,n.jsx)(lc,{color:lt,children:"Navigation"}),(0,n.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,n.jsxs)(ls,{color:lt,children:[(0,n.jsx)("strong",{children:"Click"})," a node to open its details"]}),(0,n.jsxs)(ls,{color:lt,children:[(0,n.jsx)("strong",{children:"Hover"})," for a quick summary"]}),(0,n.jsxs)(ls,{color:lt,children:[(0,n.jsx)("strong",{children:"Right-click"})," for actions — descriptions, comments, claims, collapse, or focus on an epic"]}),(0,n.jsxs)(ls,{color:lt,children:[(0,n.jsx)("strong",{children:"Scroll"})," to zoom, ",(0,n.jsx)("strong",{children:"drag"})," to pan"]})]}),(0,n.jsx)(lc,{color:lt,children:"Keyboard shortcuts"}),(0,n.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,n.jsxs)(ls,{color:lt,children:[(0,n.jsx)("strong",{children:"Cmd/Ctrl+F"})," — search by name, ID, owner, or commenter"]}),(0,n.jsxs)(ls,{color:lt,children:[(0,n.jsx)("strong",{children:"Shift+0"})," — zoom to the most recently edited node"]}),(0,n.jsxs)(ls,{color:lt,children:[(0,n.jsx)("strong",{children:"Shift+1-9"})," — zoom to a node from the #1-#9 leaderboard contributor"]}),(0,n.jsxs)(ls,{color:lt,children:[(0,n.jsx)("strong",{children:"Escape"})," — clear search or multi-selection"]})]}),(0,n.jsx)(lc,{color:i9,children:"Layouts"}),(0,n.jsx)("p",{className:"mb-2",children:"Top-left buttons rearrange the graph:"}),(0,n.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,n.jsxs)(ls,{color:i9,children:[(0,n.jsx)("strong",{children:"Force"})," — organic, physics-based"]}),(0,n.jsxs)(ls,{color:i9,children:[(0,n.jsx)("strong",{children:"DAG"})," — clean top-down tree"]}),(0,n.jsxs)(ls,{color:i9,children:[(0,n.jsx)("strong",{children:"Radial"})," — rings from center outward"]}),(0,n.jsxs)(ls,{color:i9,children:[(0,n.jsx)("strong",{children:"Cluster"})," — grouped by project"]}),(0,n.jsxs)(ls,{color:i9,children:[(0,n.jsx)("strong",{children:"Spread"})," — spaced out for screenshots"]})]}),(0,n.jsx)(lc,{color:le,children:"Color modes"}),(0,n.jsx)("p",{className:"mb-2",children:"Bottom-right panel — paint nodes by:"}),(0,n.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,n.jsxs)(ls,{color:le,children:[(0,n.jsx)("strong",{children:"Status"})," — open, in progress, blocked, closed"]}),(0,n.jsxs)(ls,{color:le,children:[(0,n.jsx)("strong",{children:"Priority"})," — P0 critical to P4 backlog"]}),(0,n.jsxs)(ls,{color:le,children:[(0,n.jsx)("strong",{children:"Type"})," — epic, task, bug, feature, or chore"]}),(0,n.jsxs)(ls,{color:le,children:[(0,n.jsx)("strong",{children:"Owner"})," — who created it"]}),(0,n.jsxs)(ls,{color:le,children:[(0,n.jsx)("strong",{children:"Assignee"})," — who's working on it"]}),(0,n.jsxs)(ls,{color:le,children:[(0,n.jsx)("strong",{children:"Prefix"})," — which project"]}),(0,n.jsxs)(ls,{color:le,children:[(0,n.jsx)("strong",{children:"Click to filter"})," — click any legend label to show only matching nodes. Combine multiple for a union view"]})]}),(0,n.jsx)(lc,{color:lr,children:"More"}),(0,n.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Collapse/Expand"})," — tidy up epics into single nodes"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Focus on epic"})," — right-click an epic to isolate its subgraph (children + dependencies). Click the banner or right-click again to return"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Clusters"})," — dashed circles grouping projects when zoomed out"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Replay"})," — step through your project's history"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Comments"})," — leave notes on tasks (sign in first)"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Activity feed"})," — compact overlay in top-right and full sidebar. Real-time local changes with pagination. During replay, filters to the current point in time"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Claim tasks"})," — right-click to mark as yours"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Minimap"})," — click to jump, drag edges to resize"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Auto-fit"})," — top-left toggle to lock/unlock automatic camera reframing"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Pulse"})," — the most recently active node pulses with emerald ripples. Toggle it on/off in view controls"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Copy"})," — clipboard icon copies task with project info"]})]}),(0,n.jsx)(lc,{color:ln,children:"Multi-select"}),(0,n.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,n.jsxs)(ls,{color:ln,children:[(0,n.jsx)("strong",{children:"Right-click + drag"})," — draw a rectangle on the canvas background to select multiple nodes"]}),(0,n.jsxs)(ls,{color:ln,children:[(0,n.jsx)("strong",{children:"Shift + click"})," — toggle individual nodes into or out of the selection"]}),(0,n.jsxs)(ls,{color:ln,children:[(0,n.jsx)("strong",{children:"Group drag"})," — drag any selected node to move them all together"]}),(0,n.jsxs)(ls,{color:ln,children:[(0,n.jsx)("strong",{children:"Escape"})," — clear the selection"]})]}),(0,n.jsx)(lc,{color:li,children:"Leaderboard & Profiles"}),(0,n.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,n.jsxs)(ls,{color:li,children:[(0,n.jsx)("strong",{children:"Leaderboard"})," — top-right overlay ranking contributors by closed, created, and commented issues. Click “See all” for the full sidebar"]}),(0,n.jsxs)(ls,{color:li,children:[(0,n.jsx)("strong",{children:"Profiles"})," — click any avatar on the graph to open their profile panel with stats and recent activity"]}),(0,n.jsxs)(ls,{color:li,children:[(0,n.jsx)("strong",{children:"Your profile"})," — click your handle in the sign-in dropdown to see your own stats"]})]}),(0,n.jsx)(lc,{color:ll,children:"Sharing & Settings"}),(0,n.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,n.jsxs)(ls,{color:ll,children:[(0,n.jsx)("strong",{children:"Shareable URLs"})," — the current view state is stored in the URL. Copy it to share a specific node, panel, color mode, or filter with anyone"]}),(0,n.jsxs)(ls,{color:ll,children:[(0,n.jsx)("strong",{children:"Text-to-speech"})," — open a task description and click the speaker icon to hear it read aloud. Select text for targeted playback. Adjust speed in settings"]}),(0,n.jsxs)(ls,{color:ll,children:[(0,n.jsx)("strong",{children:"Settings"})," — gear icon for TTS voice, playback speed, and dashboard access controls"]})]}),(0,n.jsx)(lc,{color:lr,children:"Appearance"}),(0,n.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Dark mode"})," — click the moon/sun icon in the header to toggle. Your preference is saved to localStorage and persists across sessions"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"System preference"})," — on first visit, heartbeads follows your OS dark/light setting automatically"]})]}),(0,n.jsxs)("div",{className:"mt-5 pt-4 border-t border-zinc-100 dark:border-zinc-800 text-xs text-zinc-400 dark:text-zinc-500",children:["Built with"," ",(0,n.jsx)("a",{href:"https://github.com/GainForest/beads",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 transition-colors",style:{color:ln},children:"beads"})," ","— open-source issue tracking for AI-native development. Heartbeads is built for the GainForest agentic workflow and open-sourced at"," ",(0,n.jsx)("a",{href:"https://github.com/daviddao/heartbeads",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 transition-colors",style:{color:ln},children:"github.com/daviddao/heartbeads"}),"."]})]})}function lu({entries:e,collapsed:t,compact:r,onToggleCollapse:i,onExpandPanel:l,onProfileClick:a}){return t?(0,n.jsxs)("button",{onClick:i,className:"flex items-center gap-2 px-3 py-1.5 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm rounded-full border border-zinc-200/80 dark:border-zinc-700/80 shadow-sm hover:shadow-md transition-all cursor-pointer",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-amber-500",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,n.jsx)("path",{d:"M4 2h8v5a4 4 0 01-8 0V2zM4 4H2a1 1 0 00-1 1v1a2 2 0 002 2h1M12 4h2a1 1 0 011 1v1a2 2 0 01-2 2h-1M6 12h4M8 10v2M5 14h6"})}),(0,n.jsx)("span",{className:"text-xs font-medium text-zinc-600 dark:text-zinc-400",children:"Leaderboard"}),e.length>0&&(0,n.jsx)("span",{className:"text-[10px] font-medium text-white bg-amber-500 rounded-full px-1.5 py-0.5 min-w-[18px] text-center",children:e.length})]}):(0,n.jsxs)("div",{className:`${r?"w-60":"w-72"} max-w-[calc(100vw-2rem)] bg-white/95 dark:bg-zinc-900/95 backdrop-blur-sm rounded-xl border border-zinc-200/80 dark:border-zinc-700/80 shadow-lg overflow-hidden`,children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-400"}),(0,n.jsx)("span",{className:"text-[11px] font-semibold text-zinc-700 dark:text-zinc-300 uppercase tracking-wider",children:"Leaderboard"})]}),(0,n.jsx)("button",{onClick:i,className:"p-1 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-lg transition-colors cursor-pointer",children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 15.75l7.5-7.5 7.5 7.5"})})})]}),(0,n.jsx)("div",{className:"max-h-[220px] overflow-y-auto",children:e.slice(0,3).map((e,t)=>(0,n.jsxs)("button",{onClick:()=>a(e.handle),className:"flex items-center gap-2.5 w-full px-3 py-2 hover:bg-zinc-50/60 dark:hover:bg-zinc-800/60 transition-colors text-left cursor-pointer",children:[(0,n.jsx)("span",{className:`text-[11px] font-bold tabular-nums w-4 text-center shrink-0 ${0===t?"text-amber-500":1===t?"text-zinc-400":2===t?"text-amber-700":"text-zinc-300 dark:text-zinc-500"}`,children:t+1}),e.avatar?(0,n.jsx)("img",{src:e.avatar,alt:e.handle,className:"w-6 h-6 rounded-full ring-1 ring-zinc-100 dark:ring-zinc-700 shrink-0"}):(0,n.jsx)("div",{className:"w-6 h-6 rounded-full bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center text-[10px] font-medium text-zinc-500 dark:text-zinc-400 shrink-0",children:e.handle.charAt(0).toUpperCase()}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("div",{className:"text-[11px] font-medium text-zinc-700 dark:text-zinc-300 truncate",children:e.handle}),(0,n.jsxs)("div",{className:"text-[10px] text-zinc-400 dark:text-zinc-400",children:[e.closedCount," closed · ",e.createdCount," created · ",e.commentCount," comments"]})]})]},e.handle))}),e.length>0&&(0,n.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-t border-zinc-100 dark:border-zinc-800",children:[(0,n.jsxs)("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-400",children:[e.length," contributors"]}),(0,n.jsx)("button",{onClick:l,className:"text-[10px] font-medium text-emerald-600 dark:text-emerald-400 hover:text-emerald-700 dark:hover:text-emerald-300 transition-colors cursor-pointer",children:"See all →"})]})]})}function lh({entries:e,isOpen:t,onClose:r,onProfileClick:i}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("aside",{className:`hidden md:flex absolute top-0 right-0 h-full w-[360px] bg-white dark:bg-zinc-900 border-l border-zinc-200 dark:border-zinc-700 flex-col shadow-xl z-30 transform transition-transform duration-300 ease-out ${t?"translate-x-0":"translate-x-full"}`,children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"text-[11px] font-semibold text-zinc-400 uppercase tracking-wider",children:"Leaderboard"}),(0,n.jsx)("span",{className:"text-[10px] font-medium text-white bg-amber-500 rounded-full px-1.5 py-0.5 min-w-[18px] text-center",children:e.length})]}),(0,n.jsx)("button",{onClick:r,className:"p-1.5 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-lg transition-colors cursor-pointer",children:(0,n.jsx)("svg",{className:"w-4 h-4 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[e.map((e,t)=>(0,n.jsxs)("button",{onClick:()=>i(e.handle),className:"flex items-center gap-3 w-full px-4 py-3 hover:bg-zinc-50/50 dark:hover:bg-zinc-800/50 transition-colors text-left group cursor-pointer",children:[(0,n.jsx)("span",{className:`text-sm font-bold tabular-nums w-6 text-center shrink-0 ${0===t?"text-amber-500":1===t?"text-zinc-400":2===t?"text-amber-700":"text-zinc-300 dark:text-zinc-500"}`,children:t+1}),e.avatar?(0,n.jsx)("img",{src:e.avatar,alt:e.handle,className:"w-9 h-9 rounded-full ring-1 ring-zinc-100 dark:ring-zinc-700 shrink-0"}):(0,n.jsx)("div",{className:"w-9 h-9 rounded-full bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center text-sm font-medium text-zinc-500 dark:text-zinc-400 shrink-0",children:e.handle.charAt(0).toUpperCase()}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("div",{className:"text-[13px] font-semibold text-zinc-800 dark:text-zinc-200 truncate group-hover:text-emerald-600 dark:group-hover:text-emerald-400 transition-colors",children:e.handle}),(0,n.jsxs)("div",{className:"flex items-center gap-3 mt-0.5",children:[(0,n.jsxs)("span",{className:"text-[11px] text-zinc-400",children:[(0,n.jsx)("span",{className:"font-medium text-zinc-600 dark:text-zinc-400",children:e.closedCount})," closed"]}),(0,n.jsxs)("span",{className:"text-[11px] text-zinc-400",children:[(0,n.jsx)("span",{className:"font-medium text-zinc-600 dark:text-zinc-400",children:e.createdCount})," created"]}),(0,n.jsxs)("span",{className:"text-[11px] text-zinc-400",children:[(0,n.jsx)("span",{className:"font-medium text-zinc-600 dark:text-zinc-400",children:e.commentCount})," comments"]})]})]}),(0,n.jsxs)("div",{className:"shrink-0 flex flex-col items-center",children:[(0,n.jsx)("span",{className:"text-lg font-bold text-zinc-700 dark:text-zinc-300",children:e.score}),(0,n.jsx)("span",{className:"text-[9px] text-zinc-400 uppercase",children:"pts"})]})]},e.handle)),0===e.length&&(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-zinc-300 dark:text-zinc-500",children:[(0,n.jsx)("svg",{className:"w-10 h-10 mb-3",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1",children:(0,n.jsx)("path",{d:"M4 2h8v5a4 4 0 01-8 0V2zM4 4H2a1 1 0 00-1 1v1a2 2 0 002 2h1M12 4h2a1 1 0 011 1v1a2 2 0 01-2 2h-1M6 12h4M8 10v2M5 14h6"})}),(0,n.jsx)("span",{className:"text-xs",children:"No contributors yet"})]})]}),(0,n.jsx)("div",{className:"px-4 py-2.5 border-t border-zinc-100 dark:border-zinc-800 text-[10px] text-zinc-400",children:"Score = closed×3 + created×1 + comments×1"})]}),(0,n.jsx)("div",{className:`md:hidden fixed inset-x-0 bottom-0 z-20 transition-transform duration-300 ease-out ${t?"translate-y-0":"translate-y-full"}`,children:(0,n.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-t-2xl shadow-xl border-t border-zinc-200 dark:border-zinc-700 max-h-[60vh] flex flex-col",children:[(0,n.jsx)("div",{className:"flex justify-center pt-3 pb-1",children:(0,n.jsx)("div",{className:"w-8 h-1 bg-zinc-300 dark:bg-zinc-600 rounded-full"})}),(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:"Leaderboard"}),(0,n.jsx)("span",{className:"text-[10px] font-medium text-white bg-amber-500 rounded-full px-1.5 py-0.5 min-w-[18px] text-center",children:e.length})]}),(0,n.jsx)("button",{onClick:r,className:"p-1.5 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-lg transition-colors cursor-pointer",children:(0,n.jsx)("svg",{className:"w-4 h-4 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[e.map((e,t)=>(0,n.jsxs)("button",{onClick:()=>i(e.handle),className:"flex items-center gap-2.5 w-full px-4 py-2.5 hover:bg-zinc-50/50 dark:hover:bg-zinc-800/50 transition-colors text-left group cursor-pointer",children:[(0,n.jsx)("span",{className:`text-xs font-bold tabular-nums w-5 text-center shrink-0 ${0===t?"text-amber-500":1===t?"text-zinc-400":2===t?"text-amber-700":"text-zinc-300 dark:text-zinc-500"}`,children:t+1}),e.avatar?(0,n.jsx)("img",{src:e.avatar,alt:e.handle,className:"w-7 h-7 rounded-full ring-1 ring-zinc-100 dark:ring-zinc-700 shrink-0"}):(0,n.jsx)("div",{className:"w-7 h-7 rounded-full bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center text-xs font-medium text-zinc-500 dark:text-zinc-400 shrink-0",children:e.handle.charAt(0).toUpperCase()}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("div",{className:"text-xs font-semibold text-zinc-800 dark:text-zinc-200 truncate group-hover:text-emerald-600 dark:group-hover:text-emerald-400 transition-colors",children:e.handle}),(0,n.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,n.jsxs)("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-400",children:[(0,n.jsx)("span",{className:"font-medium text-zinc-600 dark:text-zinc-400",children:e.closedCount})," closed"]}),(0,n.jsxs)("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-400",children:[(0,n.jsx)("span",{className:"font-medium text-zinc-600 dark:text-zinc-400",children:e.createdCount})," created"]}),(0,n.jsxs)("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-400",children:[(0,n.jsx)("span",{className:"font-medium text-zinc-600 dark:text-zinc-400",children:e.commentCount})," comments"]})]})]}),(0,n.jsxs)("div",{className:"shrink-0 flex flex-col items-center",children:[(0,n.jsx)("span",{className:"text-base font-bold text-zinc-700 dark:text-zinc-300",children:e.score}),(0,n.jsx)("span",{className:"text-[8px] text-zinc-400 dark:text-zinc-400 uppercase",children:"pts"})]})]},e.handle)),0===e.length&&(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-zinc-300 dark:text-zinc-500",children:[(0,n.jsx)("svg",{className:"w-8 h-8 mb-2",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1",children:(0,n.jsx)("path",{d:"M4 2h8v5a4 4 0 01-8 0V2zM4 4H2a1 1 0 00-1 1v1a2 2 0 002 2h1M12 4h2a1 1 0 011 1v1a2 2 0 01-2 2h-1M6 12h4M8 10v2M5 14h6"})}),(0,n.jsx)("span",{className:"text-[11px]",children:"No contributors yet"})]})]}),(0,n.jsx)("div",{className:"px-4 py-2 border-t border-zinc-100 dark:border-zinc-800 text-[9px] text-zinc-400 text-center",children:"Score = closed×3 + created×1 + comments×1"})]})})]})}function lp({isOpen:e,onClose:t}){let[i,l]=(0,r.useState)(""),[a,o]=(0,r.useState)(""),[s,c]=(0,r.useState)(""),[d,u]=(0,r.useState)(!1),[h,p]=(0,r.useState)(!1),[f,x]=(0,r.useState)(!1);(0,r.useEffect)(()=>{p(!0)},[]),(0,r.useEffect)(()=>{if(e){let e=ig();l(e.elevenLabsApiKey||""),o(e.elevenLabsVoiceId),c(e.elevenLabsModel),u(!1),fetch("/api/auth").then(e=>e.json()).then(e=>x(!0===e.protected)).catch(()=>x(!1))}},[e]),(0,r.useEffect)(()=>{if(!e)return;let n=e=>{"Escape"===e.key&&t()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[e,t]);let m=(0,r.useCallback)(async()=>{try{await fetch("/api/auth",{method:"DELETE"})}catch{}window.location.href="/login"},[]),g=(0,r.useCallback)(()=>{var e;let n;e={elevenLabsApiKey:i.trim()||void 0,elevenLabsVoiceId:a.trim()||"UgBBYS2sOqTuMpoF3BR0",elevenLabsModel:s||"eleven_flash_v2_5"},n={...ig(),...e},localStorage.setItem(ix,JSON.stringify(n)),t()},[i,a,s,t]);return e&&h?(0,iu.createPortal)((0,n.jsx)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center",style:{backgroundColor:"rgba(0,0,0,0.4)",backdropFilter:"blur(4px)"},onClick:t,children:(0,n.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-xl shadow-2xl w-[90vw] max-w-md flex flex-col",onClick:e=>e.stopPropagation(),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:"Settings"}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-zinc-400 dark:text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsxs)("div",{className:"px-5 py-4 space-y-4 overflow-y-auto max-h-[60vh]",children:[(0,n.jsx)("h3",{className:"text-[11px] font-semibold uppercase tracking-widest text-teal-600 dark:text-teal-400",children:"Text-to-Speech"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-xs font-medium text-zinc-700 dark:text-zinc-300 mb-1",children:"ElevenLabs API Key"}),(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("input",{type:d?"text":"password",value:i,onChange:e=>l(e.target.value),placeholder:"sk_...",className:"w-full rounded-lg border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-900 dark:text-zinc-100 placeholder:text-zinc-400 dark:placeholder:text-zinc-500 focus:outline-none focus:ring-2 focus:ring-emerald-500/30 focus:border-emerald-500 pr-10"}),(0,n.jsx)("button",{type:"button",onClick:()=>u(e=>!e),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-zinc-400 dark:text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors",title:d?"Hide key":"Show key",children:d?(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"})}):(0,n.jsxs)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:[(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}),(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})})]}),(0,n.jsxs)("p",{className:"mt-1 text-[11px] text-zinc-400 dark:text-zinc-400",children:["Get your key at"," ",(0,n.jsx)("a",{href:"https://elevenlabs.io/app/settings/api-keys",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 text-teal-500 hover:text-teal-600",children:"elevenlabs.io/app/settings"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-xs font-medium text-zinc-700 dark:text-zinc-300 mb-1",children:"Voice ID"}),(0,n.jsx)("input",{type:"text",value:a,onChange:e=>o(e.target.value),placeholder:"UgBBYS2sOqTuMpoF3BR0",className:"w-full rounded-lg border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-900 dark:text-zinc-100 placeholder:text-zinc-400 dark:placeholder:text-zinc-500 focus:outline-none focus:ring-2 focus:ring-emerald-500/30 focus:border-emerald-500"}),(0,n.jsxs)("p",{className:"mt-1 text-[11px] text-zinc-400 dark:text-zinc-400",children:["Default: Mark - Natural Conversations. Find voice IDs in the"," ",(0,n.jsx)("a",{href:"https://elevenlabs.io/app/voice-library",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 text-teal-500 hover:text-teal-600",children:"ElevenLabs Voice Library"}),"."]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-xs font-medium text-zinc-700 dark:text-zinc-300 mb-1",children:"Model"}),(0,n.jsxs)("select",{value:s,onChange:e=>c(e.target.value),className:"w-full rounded-lg border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-900 dark:text-zinc-100 focus:outline-none focus:ring-2 focus:ring-emerald-500/30 focus:border-emerald-500",children:[(0,n.jsx)("option",{value:"eleven_flash_v2_5",children:"Flash v2.5 (default, fastest & cheapest)"}),(0,n.jsx)("option",{value:"eleven_turbo_v2_5",children:"Turbo v2.5 (fast, good quality)"}),(0,n.jsx)("option",{value:"eleven_multilingual_v2",children:"Multilingual v2 (highest quality)"})]})]}),(0,n.jsxs)("div",{className:"border-t border-zinc-100 dark:border-zinc-800 pt-4",children:[(0,n.jsx)("h3",{className:"text-[11px] font-semibold uppercase tracking-widest text-teal-600 dark:text-teal-400 mb-2",children:"Public API"}),(0,n.jsxs)("p",{className:"text-xs text-zinc-500 dark:text-zinc-400 leading-relaxed",children:["Heartbeads exposes a read-only REST API for AI agents, CI/CD bots, and integrations."," ",f?"API requests require the dashboard password as a Bearer token. ":"No authentication required. ",(0,n.jsx)("a",{href:"/api/docs",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 text-teal-500 hover:text-teal-600",children:"View API documentation"})]})]}),f&&(0,n.jsxs)("div",{className:"border-t border-zinc-100 dark:border-zinc-800 pt-4",children:[(0,n.jsx)("h3",{className:"text-[11px] font-semibold uppercase tracking-widest text-teal-600 dark:text-teal-400 mb-2",children:"Dashboard Access"}),(0,n.jsxs)("p",{className:"text-xs text-zinc-500 dark:text-zinc-400 leading-relaxed mb-3",children:["This instance is password-protected. The"," ",(0,n.jsx)("span",{className:"font-medium text-zinc-600 dark:text-zinc-400",children:"Sign In"})," ","button in the navbar is for"," ",(0,n.jsx)("span",{className:"font-medium text-zinc-600 dark:text-zinc-400",children:"ATProto/Bluesky"})," ","— used for posting comments, likes, and claiming tasks. The dashboard password controls who can view the graph and access the API."]}),(0,n.jsxs)("button",{onClick:m,type:"button",className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-lg border border-zinc-200 dark:border-zinc-700 text-xs font-medium text-zinc-600 dark:text-zinc-400 hover:bg-zinc-50 dark:hover:bg-zinc-800 hover:border-zinc-300 dark:hover:border-zinc-600 transition-colors",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})}),"Lock dashboard"]})]})]}),(0,n.jsxs)("div",{className:"flex items-center justify-end gap-2 px-5 py-3.5 border-t border-zinc-100 dark:border-zinc-800",children:[(0,n.jsx)("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 rounded-lg hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors",children:"Cancel"}),(0,n.jsx)("button",{onClick:g,className:"px-4 py-2 text-sm font-medium text-white rounded-lg bg-emerald-500 hover:bg-emerald-600 transition-colors",children:"Save"})]})]})}),document.body):null}function lf({node:e,onShowDescription:t,onAddComment:i,onClaimTask:l,onUnclaimTask:a,onCollapseEpic:o,onUncollapseEpic:s,onFocusEpic:c,onExitFocusEpic:d,onClose:u}){return(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&u()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[u]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"fixed inset-0 z-[99] bg-black/30",onClick:u}),(0,n.jsxs)("div",{className:"fixed inset-x-0 bottom-0 z-[100] bg-white dark:bg-zinc-900 rounded-t-2xl shadow-2xl max-h-[70vh] overflow-y-auto animate-slide-up-sheet",children:[(0,n.jsx)("div",{className:"w-10 h-1 bg-zinc-300 dark:bg-zinc-700 rounded-full mx-auto mt-3 mb-2"}),(0,n.jsxs)("div",{className:"px-5 py-3 border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsx)("div",{className:"flex items-center gap-2",children:(0,n.jsx)("span",{className:"text-[11px] font-mono text-zinc-400 dark:text-zinc-400",children:e.id})}),(0,n.jsx)("div",{className:"text-sm font-medium text-zinc-700 dark:text-zinc-300 truncate mt-0.5",children:e.title})]}),(0,n.jsxs)("div",{className:"py-1",children:[t&&(0,n.jsxs)("button",{onClick:t,className:"w-full flex items-center gap-3 px-5 py-4 text-sm font-medium text-zinc-700 dark:text-zinc-300 active:bg-zinc-50 dark:active:bg-zinc-800 transition-colors",children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),"Show description"]}),(0,n.jsxs)("button",{onClick:i,className:"w-full flex items-center gap-3 px-5 py-4 text-sm font-medium text-zinc-700 dark:text-zinc-300 active:bg-zinc-50 dark:active:bg-zinc-800 transition-colors",children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 20.25c4.97 0 9-3.694 9-8.25s-4.03-8.25-9-8.25S3 7.444 3 12c0 2.104.859 4.023 2.273 5.48.432.447.74 1.04.586 1.641a4.483 4.483 0 01-.923 1.785A5.969 5.969 0 006 21c1.282 0 2.47-.402 3.445-1.087.81.22 1.668.337 2.555.337z"})}),"Add comment"]}),l&&(0,n.jsxs)("button",{onClick:l,className:"w-full flex items-center gap-3 px-5 py-4 text-sm font-medium text-zinc-700 dark:text-zinc-300 active:bg-zinc-50 dark:active:bg-zinc-800 transition-colors",children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})}),"Claim task"]}),a&&(0,n.jsxs)("button",{onClick:a,className:"w-full flex items-center gap-3 px-5 py-4 text-sm font-medium text-red-500 active:bg-red-50 dark:active:bg-red-950 transition-colors",children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-red-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M22 10.5h-6m-2.25-4.125a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zM4 19.235v-.11a6.375 6.375 0 0112.75 0v.109A12.318 12.318 0 0110.374 21c-2.331 0-4.512-.645-6.374-1.766z"})}),"Unclaim task"]}),o&&(0,n.jsxs)("button",{onClick:o,className:"w-full flex items-center gap-3 px-5 py-4 text-sm font-medium text-zinc-700 dark:text-zinc-300 active:bg-zinc-50 dark:active:bg-zinc-800 transition-colors",children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"})}),"Collapse epic"]}),s&&(0,n.jsxs)("button",{onClick:s,className:"w-full flex items-center gap-3 px-5 py-4 text-sm font-medium text-zinc-700 dark:text-zinc-300 active:bg-zinc-50 dark:active:bg-zinc-800 transition-colors",children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})}),"Uncollapse epic"]}),c&&(0,n.jsxs)("button",{onClick:c,className:"w-full flex items-center gap-3 px-5 py-4 text-sm font-medium text-zinc-700 dark:text-zinc-300 active:bg-zinc-50 dark:active:bg-zinc-800 transition-colors",children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 3.75H6A2.25 2.25 0 003.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0120.25 6v1.5M16.5 20.25H18A2.25 2.25 0 0020.25 18v-1.5M7.5 20.25H6A2.25 2.25 0 013.75 18v-1.5"})}),"Focus on epic"]}),d&&(0,n.jsxs)("button",{onClick:d,className:"w-full flex items-center gap-3 px-5 py-4 text-sm font-medium text-emerald-600 dark:text-emerald-400 active:bg-emerald-50 dark:active:bg-emerald-950 transition-colors",children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-emerald-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})}),"Show full graph"]})]}),(0,n.jsx)("div",{className:"border-t border-zinc-100 dark:border-zinc-800",children:(0,n.jsx)("button",{onClick:u,className:"w-full py-4 text-sm font-medium text-zinc-400 dark:text-zinc-400 active:bg-zinc-50 dark:active:bg-zinc-800 transition-colors",children:"Cancel"})}),(0,n.jsx)("div",{className:"h-[env(safe-area-inset-bottom)]"})]})]})}let lx={assigned:"📋",closed:"✅",commented:"💬",claimed:"🙋",liked:"❤️"},lm={assigned:"Assigned to",closed:"Closed",commented:"Commented on",claimed:"Claimed",liked:"Liked a comment on"};function lg({isOpen:e,onClose:t,profile:r,onNodeNavigate:i}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("aside",{className:`hidden md:flex absolute top-0 right-0 h-full w-[360px] bg-white dark:bg-zinc-900 border-l border-zinc-200 dark:border-zinc-700 flex-col shadow-xl dark:shadow-2xl dark:shadow-black/20 z-30 transform transition-transform duration-300 ease-out ${e?"translate-x-0":"translate-x-full"}`,children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-zinc-100 dark:border-zinc-800 shrink-0",children:[(0,n.jsx)("h2",{className:"text-xs font-semibold text-zinc-400 dark:text-zinc-400 uppercase tracking-wider",children:"Profile"}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-zinc-400 dark:text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 rounded-full hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar",children:r&&(0,n.jsx)(lk,{profile:r,onNodeNavigate:i})})]}),(0,n.jsx)("div",{className:`md:hidden fixed inset-x-0 bottom-0 transform transition-transform duration-300 ease-out z-20 ${e?"translate-y-0":"translate-y-full"}`,children:(0,n.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-t-2xl shadow-2xl border-t border-zinc-200 dark:border-zinc-700 max-h-[70vh] flex flex-col",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-zinc-100 dark:border-zinc-800 shrink-0",children:[(0,n.jsx)("h2",{className:"text-xs font-semibold text-zinc-400 dark:text-zinc-400 uppercase tracking-wider",children:"Profile"}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-zinc-400 dark:text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 rounded-full hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar",children:r&&(0,n.jsx)(lk,{profile:r,onNodeNavigate:i})})]})})]})}function lk({profile:e,onNodeNavigate:t}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"px-5 pt-4 pb-3 border-b border-zinc-100 dark:border-zinc-800",children:(0,n.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[e.avatar?(0,n.jsx)("img",{src:e.avatar,alt:e.handle,className:"w-12 h-12 rounded-full object-cover"}):(0,n.jsx)("div",{className:"w-12 h-12 rounded-full bg-zinc-200 dark:bg-zinc-800 flex items-center justify-center text-zinc-500 dark:text-zinc-400 text-lg font-semibold",children:e.handle.charAt(0).toUpperCase()}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:e.handle}),e.lastActiveAt&&(0,n.jsxs)("div",{className:"text-xs text-zinc-400 dark:text-zinc-400",children:["Active ",ih(e.lastActiveAt)]})]})]})}),(0,n.jsx)("div",{className:"px-5 py-3 border-b border-zinc-100 dark:border-zinc-800",children:(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,n.jsx)(lb,{label:"Assigned",value:e.assignedCount,color:"#1e66f5"}),(0,n.jsx)(lb,{label:"Closed",value:e.closedCount,color:"#40a02b"}),(0,n.jsx)(lb,{label:"Comments",value:e.commentCount,color:"#8839ef"}),(0,n.jsx)(lb,{label:"Likes given",value:e.likeCount,color:"#ea76cb"})]})}),(0,n.jsxs)("div",{className:"px-5 py-3 border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsx)("h3",{className:"text-[11px] font-semibold text-zinc-400 dark:text-zinc-400 uppercase tracking-wider mb-2",children:"Projects"}),0===e.projects.length?(0,n.jsx)("p",{className:"text-xs text-zinc-400 dark:text-zinc-400 italic",children:"No projects"}):(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.projects.map(e=>(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-full text-[11px] font-medium",style:{backgroundColor:e.color+"15",color:e.color,border:`1px solid ${e.color}25`},children:[(0,n.jsx)("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:e.color}}),e.prefixLabel,(0,n.jsxs)("span",{className:"text-zinc-400 font-normal",children:["(",e.count,")"]})]},e.prefix))})]}),(0,n.jsxs)("div",{className:"px-5 py-3",children:[(0,n.jsx)("h3",{className:"text-[11px] font-semibold text-zinc-400 dark:text-zinc-400 uppercase tracking-wider mb-2",children:"Recent Activity"}),0===e.recentActivity.length?(0,n.jsx)("p",{className:"text-xs text-zinc-400 dark:text-zinc-400 italic",children:"No activity"}):(0,n.jsx)("div",{className:"space-y-2",children:e.recentActivity.map((e,r)=>(0,n.jsxs)("div",{className:"flex items-start gap-2 text-xs",children:[(0,n.jsx)("span",{className:"mt-0.5",children:lx[e.type]}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsxs)("span",{className:"text-zinc-600 dark:text-zinc-400",children:[lm[e.type]," ",(0,n.jsx)("button",{onClick:()=>t(e.nodeId),className:"font-mono text-emerald-600 dark:text-emerald-400 hover:text-emerald-700 dark:hover:text-emerald-300 hover:underline",children:e.nodeId})]}),e.detail&&(0,n.jsx)("p",{className:"text-zinc-400 dark:text-zinc-400 truncate mt-0.5",children:e.detail}),(0,n.jsx)("div",{className:"text-zinc-300 dark:text-zinc-500 mt-0.5",children:ih(e.time)})]})]},r))})]})]})}function lb({label:e,value:t,color:r}){return(0,n.jsxs)("div",{className:"bg-zinc-50 dark:bg-zinc-800 rounded-lg px-3 py-2",children:[(0,n.jsx)("div",{className:"text-lg font-semibold",style:{color:r},children:t}),(0,n.jsx)("div",{className:"text-[11px] text-zinc-400 dark:text-zinc-400",children:e})]})}let lv=new Map,ly=new Map;async function lw(e){let t=lv.get(e);if(t)return t;let n=ly.get(e);if(n)return n;let r=(async()=>{try{let t=await fetch(`https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=${encodeURIComponent(e)}`);if(!t.ok)throw Error(`Profile fetch failed: ${t.status}`);let n=await t.json(),r={did:e,handle:n.handle||e,displayName:n.displayName||void 0,avatar:n.avatar||void 0};return lv.set(e,r),r}catch{let t={did:e,handle:e.slice(0,20)+"..."};return lv.set(e,t),t}finally{ly.delete(e)}})();return ly.set(e,r),r}let lj=t.default.env.INDEXER_URL||"https://hypergoat-app-production.up.railway.app/graphql",lz=`
5
+ `}),(0,n.jsxs)("div",{className:"comment-tooltip-shadow p-[18px_20px]",children:[(0,n.jsx)("div",{className:"rounded-sm mb-2.5",style:{width:24,height:2,background:j,opacity:.6}}),N]})]})}function iH({node:e,x:t,y:i,onShowDescription:l,onAddComment:a,onClaimTask:o,onUnclaimTask:s,onCollapseEpic:c,onUncollapseEpic:d,onFocusEpic:u,onExitFocusEpic:h,onClose:p}){let f=(0,r.useRef)(null),[x,m]=(0,r.useState)({x:0,y:0}),[g,k]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(!f.current)return;let e=f.current.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight,l=t+4,a=i+4;l+e.width>n-16&&(l=n-e.width-16),l<16&&(l=16),a+e.height>r-16&&(a=r-e.height-16),a<16&&(a=16),m({x:l,y:a}),k(!0)},[t,i]),(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&p()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[p]),(0,r.useEffect)(()=>{let e=e=>{f.current&&!f.current.contains(e.target)&&p()},t=setTimeout(()=>window.addEventListener("mousedown",e),50);return()=>{clearTimeout(t),window.removeEventListener("mousedown",e)}},[p]),(0,n.jsx)("div",{ref:f,style:{position:"fixed",left:x.x,top:x.y,zIndex:100,opacity:+!!g,transform:g?"translateY(0)":"translateY(2px)",transition:"opacity 0.15s ease, transform 0.15s ease"},onContextMenu:e=>e.preventDefault(),children:(0,n.jsxs)("div",{className:"bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-700 rounded-lg overflow-hidden",style:{minWidth:180,boxShadow:"0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.06)"},children:[e.description&&(0,n.jsxs)("button",{onClick:l,className:"w-full px-3 py-2.5 text-xs text-zinc-700 dark:text-zinc-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 flex items-center gap-2 transition-colors border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400 dark:text-zinc-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),"Show description"]}),(0,n.jsxs)("button",{onClick:a,className:`w-full px-3 py-2.5 text-xs text-zinc-700 dark:text-zinc-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 flex items-center gap-2 transition-colors${o||s||c||d||u||h?" border-b border-zinc-100 dark:border-zinc-800":""}`,children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400 dark:text-zinc-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 20.25c4.97 0 9-3.694 9-8.25s-4.03-8.25-9-8.25S3 7.444 3 12c0 2.104.859 4.023 2.273 5.48.432.447.74 1.04.586 1.641a4.483 4.483 0 01-.923 1.785A5.969 5.969 0 006 21c1.282 0 2.47-.402 3.445-1.087.81.22 1.668.337 2.555.337z"})}),"Add comment"]}),o&&(0,n.jsxs)("button",{onClick:o,className:`w-full px-3 py-2.5 text-xs text-zinc-700 dark:text-zinc-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 flex items-center gap-2 transition-colors${c||d||u||h?" border-b border-zinc-100 dark:border-zinc-800":""}`,children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400 dark:text-zinc-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})}),"Claim task"]}),s&&(0,n.jsxs)("button",{onClick:s,className:`w-full px-3 py-2.5 text-xs text-red-500 hover:bg-red-50 dark:hover:bg-red-950 flex items-center gap-2 transition-colors${c||d||u||h?" border-b border-zinc-100 dark:border-zinc-800":""}`,children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-red-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M22 10.5h-6m-2.25-4.125a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zM4 19.235v-.11a6.375 6.375 0 0112.75 0v.109A12.318 12.318 0 0110.374 21c-2.331 0-4.512-.645-6.374-1.766z"})}),"Unclaim task"]}),c&&(0,n.jsxs)("button",{onClick:c,className:`w-full px-3 py-2.5 text-xs text-zinc-700 dark:text-zinc-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 flex items-center gap-2 transition-colors${u||h?" border-b border-zinc-100 dark:border-zinc-800":""}`,children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400 dark:text-zinc-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"})}),"Collapse epic"]}),d&&(0,n.jsxs)("button",{onClick:d,className:`w-full px-3 py-2.5 text-xs text-zinc-700 dark:text-zinc-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 flex items-center gap-2 transition-colors${u||h?" border-b border-zinc-100 dark:border-zinc-800":""}`,children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400 dark:text-zinc-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})}),"Uncollapse epic"]}),u&&(0,n.jsxs)("button",{onClick:u,className:"w-full px-3 py-2.5 text-xs text-zinc-700 dark:text-zinc-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 flex items-center gap-2 transition-colors",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400 dark:text-zinc-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 3.75H6A2.25 2.25 0 003.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0120.25 6v1.5M16.5 20.25H18A2.25 2.25 0 0020.25 18v-1.5M7.5 20.25H6A2.25 2.25 0 013.75 18v-1.5"})}),"Focus on epic"]}),h&&(0,n.jsxs)("button",{onClick:h,className:"w-full px-3 py-2.5 text-xs text-emerald-600 dark:text-emerald-400 hover:bg-emerald-50 dark:hover:bg-emerald-950 flex items-center gap-2 transition-colors",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-emerald-500 dark:text-emerald-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})}),"Show full graph"]})]})})}function iU({node:e,x:t,y:i,prefixColor:l,allNodes:a,theme:c}){let d="dark"===c?{bg:"#18181b",border:"#3f3f46",borderLight:"#27272a",shadow:"rgba(0,0,0,0.3)",text:"#f4f4f5",textMuted:"#a1a1aa",textDim:"#71717a"}:{bg:"#FFFFFF",border:"#E5E7EB",borderLight:"#F3F4F6",shadow:"rgba(0,0,0,0.08)",text:"#131316",textMuted:"#737680",textDim:"#7F818B"},u=(0,r.useRef)(null),[h,f]=(0,r.useState)({x:0,y:0});(0,r.useEffect)(()=>{if(!u.current)return;let e=u.current.getBoundingClientRect(),n=t+14,r=i-e.height-14;n+e.width>window.innerWidth-16&&(n=t-e.width-14),n<16&&(n=16),r<16&&(r=i+14+8),r+e.height>window.innerHeight-16&&(r=window.innerHeight-e.height-16),f({x:n,y:r})},[t,i]);let x=e.dependentIds.map(e=>{let t=a.find(t=>t.id===e);return t?{id:e,title:t.title}:{id:e,title:e}}).filter(Boolean),m=o[e.priority]||`P${e.priority}`,g=s[e.priority]||"#a1a1aa",k={fontSize:10,fontWeight:600,letterSpacing:1.5,textTransform:"uppercase",color:"dark"===c?"#71717a":"#7F818B",marginBottom:3},b={fontSize:12,color:"dark"===c?"#a1a1aa":"#737680",lineHeight:1.45};return(0,n.jsxs)("div",{ref:u,className:"bead-tooltip",style:{position:"fixed",left:h.x,top:h.y,width:280,zIndex:100,pointerEvents:"none",background:d.bg,border:`1px solid ${d.border}`,boxShadow:`0 8px 32px ${d.shadow}, 0 2px 8px ${d.shadow}`,borderRadius:8,padding:"16px 18px",animation:"beadTooltipFade 0.2s ease"},children:[(0,n.jsx)("div",{style:{width:24,height:2,background:l,opacity:.5,marginBottom:8,borderRadius:1}}),(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:6},children:[(0,n.jsx)("span",{style:{fontSize:10,fontWeight:600,color:l,letterSpacing:.5,textTransform:"uppercase"},children:p(e.prefix)}),(0,n.jsx)("span",{style:{fontSize:10,fontFamily:"monospace",color:d.textDim},children:e.id})]}),(0,n.jsx)("div",{style:{fontSize:14,fontWeight:600,color:d.text,lineHeight:1.25,marginBottom:12,overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:e.title}),e.labels.length>0&&(0,n.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginBottom:10},children:[e.labels.slice(0,3).map(e=>(0,n.jsx)("span",{style:{fontSize:10,fontWeight:500,color:"dark"===c?"#a1a1aa":"#52525b",backgroundColor:"dark"===c?"#27272a":"#f4f4f5",border:"dark"===c?"1px solid #3f3f46":"1px solid #e4e4e7",borderRadius:9999,padding:"1px 7px",lineHeight:"16px"},children:e},e)),e.labels.length>3&&(0,n.jsxs)("span",{style:{fontSize:10,color:"#a1a1aa",lineHeight:"18px"},children:["+",e.labels.length-3," more"]})]}),(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[null!=e.estimatedMinutes&&(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:k,children:"Estimate"}),(0,n.jsxs)("div",{style:b,children:["⏱ ",e.estimatedMinutes,"m"]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:k,children:"Created"}),(0,n.jsx)("div",{style:b,children:ih(e.createdAt)})]}),e.owner&&(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:k,children:"Owner"}),(0,n.jsx)("div",{style:b,children:e.owner})]}),(e.assignee||e.createdBy)&&(0,n.jsxs)("div",{children:[e.assignee&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:k,children:"Assignee"}),(0,n.jsx)("div",{style:b,children:e.assignee})]}),e.createdBy&&!e.assignee&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:k,children:"Created by"}),(0,n.jsx)("div",{style:b,children:e.createdBy})]}),e.createdBy&&e.assignee&&e.createdBy!==e.assignee&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:{...k,marginTop:4},children:"Created by"}),(0,n.jsx)("div",{style:b,children:e.createdBy})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:k,children:"Blocked by"}),0===x.length?(0,n.jsx)("div",{style:{...b,color:"#10b981"},children:"None"}):(0,n.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:3},children:x.map(e=>(0,n.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,n.jsx)("span",{style:{fontSize:10,fontFamily:"monospace",color:d.textDim,flexShrink:0},children:e.id}),(0,n.jsx)("span",{style:{fontSize:12,color:d.textMuted,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title})]},e.id))})]}),(0,n.jsxs)("div",{style:{borderTop:`1px solid ${d.borderLight}`,paddingTop:8},children:[(0,n.jsx)("div",{style:k,children:"Priority"}),(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,n.jsx)("div",{style:{width:8,height:8,borderRadius:"50%",background:g,flexShrink:0}}),(0,n.jsx)("span",{style:b,children:m})]})]})]})]})}function iV({isOpen:e,onClose:t,allComments:i,onNodeNavigate:l,isAuthenticated:a,currentDid:o,onLikeComment:s,onDeleteComment:c,onReplyComment:d,onPostComment:u,prefixes:h}){let[p,f]=(0,r.useState)(null),[x,m]=(0,r.useState)(""),[g,k]=(0,r.useState)(!1),[b,v]=(0,r.useState)(""),y=(e,t)=>{for(let n of e){if(n.uri===t)return n;let e=y(n.replies,t);if(e)return e}return null},w=async()=>{if(!x.trim()||!p||!d)return;let e=y(i,p);if(e){k(!0);try{await d(e,x.trim()),f(null),m("")}catch(e){console.error("Failed to post reply:",e)}finally{k(!1)}}},j=(0,r.useMemo)(()=>{if(!b.trim())return i;let e=RegExp("^"+b.trim().replace(/[.+^()|[\]\\]/g,"\\$&").replace(/\*/g,".*")+"$","i");return i.filter(t=>e.test(t.nodeId))},[i,b]),z=(0,n.jsxs)("div",{className:"shrink-0 px-5 py-2 border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("input",{type:"text",value:b,onChange:e=>v(e.target.value),placeholder:"Filter by target (e.g. beads-map-*)",className:"w-full pl-7 pr-7 py-1.5 text-xs border border-zinc-200 dark:border-zinc-700 rounded-md bg-zinc-50 dark:bg-zinc-800 text-zinc-700 dark:text-zinc-300 placeholder-zinc-400 dark:placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-emerald-500 focus:border-emerald-500"}),(0,n.jsx)("svg",{className:"absolute left-2 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 01-.659 1.591l-5.432 5.432a2.25 2.25 0 00-.659 1.591v2.927a2.25 2.25 0 01-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 00-.659-1.591L3.659 7.409A2.25 2.25 0 013 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0112 3z"})}),b&&(0,n.jsx)("button",{onClick:()=>v(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300",children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),h&&h.length>1&&!b&&(0,n.jsx)("div",{className:"flex flex-wrap gap-1 mt-1.5",children:h.map(e=>(0,n.jsxs)("button",{onClick:()=>v(e+"-*"),className:"px-1.5 py-0.5 text-[10px] font-mono bg-zinc-100 dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 rounded hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors",children:[e,"-*"]},e))})]}),N=(0,n.jsx)("div",{className:"space-y-0",children:0===j.length&&b?(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,n.jsxs)("p",{className:"text-xs text-zinc-400 dark:text-zinc-500",children:["No comments matching “",b,"”"]}),(0,n.jsx)("button",{onClick:()=>v(""),className:"text-[10px] text-emerald-600 dark:text-emerald-400 hover:underline mt-1",children:"Clear filter"})]}):0===j.length?(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,n.jsx)("svg",{className:"w-8 h-8 text-zinc-200 dark:text-zinc-700 mb-3",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 011.037-.443 48.282 48.282 0 005.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z"})}),(0,n.jsx)("p",{className:"text-xs text-zinc-400 dark:text-zinc-500",children:"No comments yet"}),(0,n.jsx)("p",{className:"text-[10px] text-zinc-300 dark:text-zinc-600 mt-1",children:"Right-click a node to leave a comment"})]}):(0,n.jsx)(n.Fragment,{children:j.filter(e=>!e.replyTo).map(e=>(0,n.jsx)(iq,{comment:e,currentDid:o,isAuthenticated:a,onNodeNavigate:l,onLike:s,onDelete:c,onStartReply:e=>f(e.uri),replyingToUri:p,replyText:x,onReplyTextChange:m,onSubmitReply:w,onCancelReply:()=>{f(null),m("")},isSubmittingReply:g,depth:0,prefixes:h},e.uri))})}),C=(0,n.jsxs)("div",{className:"shrink-0 px-5 py-3 border-t border-zinc-100 dark:border-zinc-800 bg-zinc-50/50 dark:bg-zinc-800/50",children:[a?(0,n.jsx)(iK,{prefixes:h||[],onSubmit:u}):(0,n.jsx)("div",{className:"text-[10px] text-zinc-400 dark:text-zinc-500",children:"Sign in to comment"}),(0,n.jsx)("div",{className:"text-[10px] text-zinc-400 dark:text-zinc-500 mt-2",children:b?(0,n.jsxs)(n.Fragment,{children:[j.length," of ",i.length," comments matching “",b,"”"]}):(0,n.jsxs)(n.Fragment,{children:[i.length," comment",1!==i.length?"s":""," across all issues"]})})]});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("aside",{className:`hidden md:flex absolute top-0 right-0 h-full w-[360px] bg-white dark:bg-zinc-900 border-l border-zinc-200 dark:border-zinc-700 flex-col shadow-xl z-30 transform transition-transform duration-300 ease-out ${e?"translate-x-0":"translate-x-full"}`,children:[(0,n.jsxs)("div",{className:"shrink-0 px-5 py-3 border-b border-zinc-100 dark:border-zinc-800 flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h2",{className:"text-xs font-semibold text-zinc-400 uppercase tracking-wider",children:"All Comments"}),(b?j.length:i.length)>0&&(0,n.jsx)("span",{className:"px-1.5 py-0.5 bg-emerald-50 dark:bg-emerald-950 text-emerald-600 dark:text-emerald-400 rounded-full text-[10px] font-medium",children:b?j.length:i.length})]}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors rounded-full hover:bg-zinc-100 dark:hover:bg-zinc-800",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),z,(0,n.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar px-5 py-3",children:N}),C]}),(0,n.jsx)("div",{className:`md:hidden fixed inset-x-0 bottom-0 transform transition-transform duration-300 ease-out z-20 ${e?"translate-y-0":"translate-y-full"}`,children:(0,n.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-t-2xl shadow-2xl border-t border-zinc-200 dark:border-zinc-700 max-h-[70vh] flex flex-col",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-zinc-100 dark:border-zinc-800 shrink-0",children:[(0,n.jsx)("h2",{className:"text-xs font-semibold text-zinc-400 dark:text-zinc-400 uppercase tracking-wider",children:"All Comments"}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 rounded-full hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),z,(0,n.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar px-5 py-3",children:N}),C]})})]})}function iq({comment:e,currentDid:t,isAuthenticated:i,onNodeNavigate:l,onLike:a,onDelete:o,onStartReply:s,replyingToUri:c,replyText:d,onReplyTextChange:u,onSubmitReply:h,onCancelReply:p,isSubmittingReply:f,depth:x,prefixes:m}){let[g,k]=(0,r.useState)(!1),[b,v]=(0,r.useState)(!1),y=t&&t===e.did,w=!!t&&e.likes.some(e=>e.did===t),j=c===e.uri,z=async()=>{if(a&&!g){k(!0);try{await a(e)}catch(e){console.error("Failed to toggle like:",e)}finally{k(!1)}}},N=async()=>{if(o&&!b){v(!0);try{await o(e)}catch(e){console.error("Failed to delete comment:",e)}finally{v(!1)}}};return(0,n.jsxs)("div",{className:`${x>0?"ml-4 pl-3 border-l border-zinc-100 dark:border-zinc-800":""}`,children:[(0,n.jsxs)("div",{className:`py-3 ${0===x?"border-b border-zinc-50 dark:border-zinc-800":""}`,children:[0===x&&(m?.includes(e.nodeId)?(0,n.jsxs)("span",{className:"inline-flex items-center px-1.5 py-0.5 mb-1.5 rounded text-[10px] font-mono bg-blue-50 dark:bg-blue-950 text-blue-600 dark:text-blue-400",children:["📢 ",e.nodeId]}):(0,n.jsx)("button",{onClick:()=>l(e.nodeId),className:"inline-flex items-center px-1.5 py-0.5 mb-1.5 rounded text-[10px] font-mono bg-emerald-50 dark:bg-emerald-950 text-emerald-600 dark:text-emerald-400 hover:bg-emerald-100 dark:hover:bg-emerald-900 transition-colors",children:e.nodeId})),(0,n.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,n.jsx)("div",{className:"shrink-0 w-4 h-4 rounded-full bg-zinc-100 dark:bg-zinc-800 overflow-hidden",children:e.avatar?(0,n.jsx)("img",{src:e.avatar,alt:"",className:"w-full h-full object-cover"}):(0,n.jsx)("div",{className:"w-full h-full flex items-center justify-center text-[8px] font-medium text-zinc-400 dark:text-zinc-500",children:(e.handle||e.did).charAt(0).toUpperCase()})}),(0,n.jsx)("a",{href:`https://www.impactindexer.org/data?did=${e.did}`,target:"_blank",rel:"noopener noreferrer",className:"text-xs font-medium text-zinc-600 dark:text-zinc-400 truncate hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:e.displayName||e.handle||e.did.slice(0,16)+"..."}),(0,n.jsx)("span",{className:"text-[10px] text-zinc-300 dark:text-zinc-600 shrink-0",children:ih(e.createdAt)})]}),(0,n.jsx)("p",{className:"text-xs text-zinc-500 dark:text-zinc-400 leading-relaxed whitespace-pre-wrap break-words",children:e.text}),(0,n.jsxs)("div",{className:"flex items-center gap-2 mt-1 text-[10px]",children:[(0,n.jsxs)("button",{onClick:z,disabled:!i||g,className:`flex items-center gap-0.5 transition-colors ${w?"text-rose-500":"text-zinc-300 dark:text-zinc-600 hover:text-rose-500"} disabled:opacity-50`,children:[(0,n.jsx)(iE,{className:"w-3 h-3",filled:w}),e.likes.length>0&&(0,n.jsx)("span",{children:e.likes.length})]}),(0,n.jsx)("button",{onClick:()=>s(e),disabled:!i,className:`transition-colors disabled:opacity-50 ${j?"text-emerald-500 dark:text-emerald-400":"text-zinc-300 dark:text-zinc-600 hover:text-zinc-500 dark:hover:text-zinc-400"}`,children:"reply"}),y&&o&&(0,n.jsx)("button",{onClick:N,disabled:b,className:"ml-auto text-zinc-300 dark:text-zinc-600 hover:text-red-400 disabled:opacity-50 transition-colors",children:b?"...":"delete"})]})]}),j&&(0,n.jsx)(iY,{replyingTo:e,replyText:d,onTextChange:u,onSubmit:h,onCancel:p,isSubmitting:f}),e.replies.length>0&&(0,n.jsx)("div",{children:e.replies.map(e=>(0,n.jsx)(iq,{comment:e,currentDid:t,isAuthenticated:i,onNodeNavigate:l,onLike:a,onDelete:o,onStartReply:s,replyingToUri:c,replyText:d,onReplyTextChange:u,onSubmitReply:h,onCancelReply:p,isSubmittingReply:f,depth:x+1,prefixes:m},e.uri))})]})}function iY({replyingTo:e,replyText:t,onTextChange:r,onSubmit:i,onCancel:l,isSubmitting:a}){return(0,n.jsxs)("div",{className:"mt-2 ml-4 pl-3 border-l border-emerald-200 space-y-1.5",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] text-zinc-400 dark:text-zinc-500",children:[(0,n.jsx)("span",{children:"Replying to"}),(0,n.jsx)("a",{href:`https://www.impactindexer.org/data?did=${e.did}`,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-zinc-600 dark:text-zinc-400 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:e.displayName||e.handle})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("input",{type:"text",value:t,onChange:e=>r(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||i()},placeholder:"Write a reply...",disabled:a,autoFocus:!0,className:"flex-1 px-2 py-1 text-xs bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-700 rounded placeholder-zinc-400 dark:placeholder-zinc-500 focus:outline-none focus:border-emerald-400 disabled:opacity-50"}),(0,n.jsx)("button",{onClick:i,disabled:!t.trim()||a,className:"px-2 py-1 text-[10px] font-medium text-emerald-600 dark:text-emerald-400 hover:text-emerald-700 dark:hover:text-emerald-300 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:a?"...":"Reply"}),(0,n.jsx)("button",{onClick:l,disabled:a,className:"px-2 py-1 text-[10px] text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 disabled:opacity-50 transition-colors",children:"Cancel"})]})]})}function iK({prefixes:e,onSubmit:t}){let[i,l]=(0,r.useState)(""),[a,o]=(0,r.useState)(e[0]||""),[s,c]=(0,r.useState)(!1);(0,r.useEffect)(()=>{1===e.length&&o(e[0])},[e]);let d=async()=>{if(i.trim()&&a&&t){c(!0);try{await t(a,i.trim()),l("")}catch(e){console.error("Failed to post comment:",e)}finally{c(!1)}}};return(0,n.jsxs)("div",{children:[e.length>1&&(0,n.jsx)("select",{value:a,onChange:e=>o(e.target.value),className:"w-full mb-2 px-2 py-1.5 text-xs border border-zinc-200 dark:border-zinc-700 rounded-md bg-white dark:bg-zinc-800 text-zinc-700 dark:text-zinc-300",children:e.map(e=>(0,n.jsx)("option",{value:e,children:e},e))}),(0,n.jsx)("textarea",{value:i,onChange:e=>l(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),d())},placeholder:"Write a comment...",rows:2,className:"w-full px-2.5 py-2 text-xs border border-zinc-200 dark:border-zinc-700 rounded-md bg-white dark:bg-zinc-800 text-zinc-700 dark:text-zinc-300 placeholder-zinc-400 dark:placeholder-zinc-500 resize-none focus:outline-none focus:ring-1 focus:ring-emerald-500"}),(0,n.jsxs)("div",{className:"flex items-center justify-between mt-1.5",children:[(0,n.jsxs)("span",{className:"text-[10px] text-zinc-300 dark:text-zinc-600",children:["u">typeof navigator&&navigator.platform?.includes("Mac")?"⌘":"Ctrl","+Enter to send",e.length<=1&&a&&(0,n.jsxs)(n.Fragment,{children:[" · posting to ",(0,n.jsx)("span",{className:"font-medium text-zinc-400",children:a})]})]}),(0,n.jsx)("button",{onClick:d,disabled:!i.trim()||!a||s,className:"px-3 py-1 text-[11px] font-medium text-white bg-emerald-500 rounded-md hover:bg-emerald-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:s?"Sending...":"Send"})]})]})}function iX({type:e,className:t}){let r=t||"w-3.5 h-3.5 shrink-0";switch(e){case"node-created":return(0,n.jsxs)("svg",{className:`${r} text-emerald-500`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,n.jsx)("line",{x1:"8",y1:"5",x2:"8",y2:"11"}),(0,n.jsx)("line",{x1:"5",y1:"8",x2:"11",y2:"8"})]});case"node-closed":return(0,n.jsxs)("svg",{className:`${r} text-zinc-400`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,n.jsx)("polyline",{points:"5.5,8 7.5,10 10.5,6"})]});case"node-status-changed":return(0,n.jsx)("svg",{className:`${r} text-amber-500`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,n.jsx)("path",{d:"M3 8h10M10 5l3 3-3 3"})});case"node-priority-changed":return(0,n.jsx)("svg",{className:`${r} text-amber-500`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,n.jsx)("path",{d:"M8 3v7M5 6l3-3 3 3M4 13h8"})});case"node-title-changed":return(0,n.jsx)("svg",{className:`${r} text-amber-500`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,n.jsx)("path",{d:"M3 4h10M3 8h6M3 12h8"})});case"node-owner-changed":return(0,n.jsxs)("svg",{className:`${r} text-amber-500`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"6",cy:"6",r:"2.5"}),(0,n.jsx)("path",{d:"M1.5 13c0-2 1.8-3.5 4.5-3.5M10 9l2 2 3-3"})]});case"node-assignee-changed":return(0,n.jsxs)("svg",{className:`${r} text-violet-500`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"6",cy:"6",r:"2.5"}),(0,n.jsx)("path",{d:"M1.5 13c0-2 1.8-3.5 4.5-3.5M10 8l2 2 2-2M12 10V5"})]});case"link-added":return(0,n.jsx)("svg",{className:`${r} text-blue-500`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,n.jsx)("path",{d:"M6.5 9.5l3-3M4 11a2.5 2.5 0 003.5 0l1-1M8.5 6a2.5 2.5 0 013.5 0l0 0"})});case"link-removed":return(0,n.jsxs)("svg",{className:`${r} text-red-400`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("path",{d:"M4 11a2.5 2.5 0 003.5 0l1-1M8.5 6a2.5 2.5 0 013.5 0l0 0"}),(0,n.jsx)("line",{x1:"3",y1:"3",x2:"13",y2:"13",strokeWidth:"1.5"})]});case"comment-added":case"reply-added":return(0,n.jsx)("svg",{className:`${r} text-blue-500`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,n.jsx)("path",{d:"M2 4.5a1.5 1.5 0 011.5-1.5h9A1.5 1.5 0 0114 4.5v5a1.5 1.5 0 01-1.5 1.5H5L2 14V4.5z"})});case"task-claimed":return(0,n.jsxs)("svg",{className:`${r} text-emerald-500`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"5.5",r:"2.5"}),(0,n.jsx)("path",{d:"M3 13.5c0-2.5 2.2-4.5 5-4.5s5 2 5 4.5"})]});case"task-unclaimed":return(0,n.jsxs)("svg",{className:`${r} text-red-400`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"5.5",r:"2.5"}),(0,n.jsx)("path",{d:"M3 13.5c0-2.5 2.2-4.5 5-4.5s5 2 5 4.5"}),(0,n.jsx)("line",{x1:"11",y1:"3",x2:"13",y2:"5"})]});case"like-added":return(0,n.jsx)("svg",{className:`${r} text-rose-400`,viewBox:"0 0 16 16",fill:"currentColor",children:(0,n.jsx)("path",{d:"M8 13.7l-.6-.5C4 10.2 2 8.3 2 6a3 3 0 016-1 3 3 0 016 1c0 2.3-2 4.2-5.4 7.2l-.6.5z"})})}}function iG(e){switch(e){case"node-created":case"task-claimed":return"bg-emerald-400";case"node-closed":return"bg-zinc-300";case"node-status-changed":case"node-priority-changed":case"node-title-changed":case"node-owner-changed":return"bg-amber-400";case"node-assignee-changed":return"bg-violet-400";case"link-added":case"comment-added":case"reply-added":return"bg-blue-400";case"link-removed":case"task-unclaimed":return"bg-red-300";case"like-added":return"bg-rose-300"}}function iJ(e){switch(e.type){case"node-created":{let t=e.meta?.issueType||"task";return`created a ${t}`}case"node-closed":return`closed this${e.detail&&"Closed"!==e.detail?` (${e.detail})`:""}`;case"node-status-changed":return e.detail?`changed status ${e.detail}`:"changed status";case"node-priority-changed":return`changed priority ${e.detail||""}`.trim();case"node-title-changed":return"updated the title";case"node-owner-changed":return`changed owner ${e.detail||""}`.trim();case"node-assignee-changed":{let t=e.meta?.to,n=e.meta?.from;if(t&&!n)return`assigned ${t}`;if(!t&&n)return`unassigned ${n}`;if(t)return`reassigned to ${t}`;return"changed assignee"}case"link-added":return`added a dependency on ${e.meta?.target||""}`;case"link-removed":return`removed dependency on ${e.meta?.target||""}`;case"comment-added":return e.detail?`commented: "${e.detail}"`:"commented";case"reply-added":return e.detail?`replied: "${e.detail}"`:"replied";case"task-claimed":return"claimed this task";case"task-unclaimed":return"unclaimed this task";case"like-added":return e.detail||"liked a comment";default:return e.detail||"updated"}}function iQ({event:e,onNodeClick:t,onHandleClick:r}){return(0,n.jsxs)("div",{className:"flex items-center gap-2 py-2 px-3 group hover:bg-zinc-50/60 dark:hover:bg-zinc-800/60 transition-colors",children:[(0,n.jsx)("div",{className:`w-1 h-1 rounded-full shrink-0 ${iG(e.type)}`}),(0,n.jsx)(iX,{type:e.type,className:"w-3 h-3 shrink-0"}),(0,n.jsxs)("div",{className:"flex-1 min-w-0 text-[11px] text-zinc-600 dark:text-zinc-400 truncate",children:[e.actor?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:()=>r?.(e.actor.handle),className:"font-medium text-zinc-800 dark:text-zinc-200 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:e.actor.handle})," "]}):t?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:()=>t(e.nodeId),className:"font-medium text-zinc-700 dark:text-zinc-300 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:e.nodeId})," "]}):null,(0,n.jsx)("span",{className:"text-zinc-500 dark:text-zinc-400",children:iJ(e)})]}),(0,n.jsx)("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500 shrink-0 tabular-nums opacity-0 group-hover:opacity-100 transition-opacity",children:ih(new Date(e.time).toISOString())})]})}function iZ({event:e,onNodeClick:t,onHandleClick:r}){return(0,n.jsxs)("div",{className:"flex gap-3 py-3 px-4 hover:bg-zinc-50/50 dark:hover:bg-zinc-800/50 transition-colors group",children:[(0,n.jsx)("div",{className:`w-0.5 self-stretch rounded-full shrink-0 ${iG(e.type)}`}),(0,n.jsx)("div",{className:"mt-0.5 shrink-0",children:e.actor?.avatar?(0,n.jsx)("img",{src:e.actor.avatar,alt:e.actor.handle,className:"w-7 h-7 rounded-full ring-1 ring-zinc-100 dark:ring-zinc-700"}):e.actor?(0,n.jsx)("div",{className:"w-7 h-7 rounded-full bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center text-[11px] font-medium text-zinc-500 dark:text-zinc-400",children:e.actor.handle.charAt(0).toUpperCase()}):(0,n.jsx)("div",{className:"w-7 h-7 rounded-full bg-zinc-50 dark:bg-zinc-800 flex items-center justify-center",children:(0,n.jsx)(iX,{type:e.type,className:"w-3.5 h-3.5"})})}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-baseline gap-1.5 text-[12px] leading-snug",children:[e.actor&&(0,n.jsx)("button",{onClick:()=>r?.(e.actor.handle),className:"font-semibold text-zinc-800 dark:text-zinc-200 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:e.actor.handle}),(0,n.jsx)("span",{className:"text-zinc-500 dark:text-zinc-400",children:iJ(e)})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5 mt-1",children:[t&&(0,n.jsx)("button",{onClick:()=>t(e.nodeId),className:"inline-flex items-center px-1.5 py-0.5 text-[10px] font-mono font-medium text-emerald-700 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-950 rounded-md hover:bg-emerald-100 dark:hover:bg-emerald-900 transition-colors",children:e.nodeId}),e.nodeTitle&&(0,n.jsx)("span",{className:"text-[11px] text-zinc-400 dark:text-zinc-500 truncate",children:e.nodeTitle})]})]}),(0,n.jsx)("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500 shrink-0 tabular-nums mt-0.5",children:ih(new Date(e.time).toISOString())})]})}function i0({event:e,variant:t="compact",onNodeClick:r,onHandleClick:i}){return"compact"===t?(0,n.jsx)(iQ,{event:e,onNodeClick:r,onHandleClick:i}):(0,n.jsx)(iZ,{event:e,onNodeClick:r,onHandleClick:i})}function i1({events:e,collapsed:t,compact:r,onToggleCollapse:i,onExpandPanel:l,onNodeClick:a,onHandleClick:o}){let s=e.filter(e=>Date.now()-e.time<3e5).length;return t?(0,n.jsxs)("button",{onClick:i,className:"group flex items-center gap-2 px-3 py-2 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm rounded-full border border-zinc-200/80 dark:border-zinc-700/80 shadow-sm hover:bg-white dark:hover:bg-zinc-900 hover:shadow-md transition-all",title:"Show activity feed",children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5 text-zinc-400 dark:text-zinc-500 group-hover:text-emerald-500 dark:group-hover:text-emerald-400 transition-colors",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,n.jsx)("polyline",{points:"8,4 8,8 11,10"})]}),(0,n.jsx)("span",{className:"text-xs text-zinc-500 dark:text-zinc-400 group-hover:text-zinc-700 dark:group-hover:text-zinc-200 transition-colors",children:"Activity"}),s>0&&(0,n.jsx)("span",{className:"text-[10px] font-medium text-white bg-emerald-500 rounded-full px-1.5 py-0.5 min-w-[18px] text-center leading-tight",children:s})]}):(0,n.jsxs)("div",{className:`${r?"w-60":"w-72"} bg-white/95 dark:bg-zinc-900/95 backdrop-blur-sm rounded-xl border border-zinc-200/80 dark:border-zinc-700/80 shadow-lg overflow-hidden`,children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-3.5 py-2.5 border-b border-zinc-100/80 dark:border-zinc-800/80",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),(0,n.jsx)("span",{className:"text-[11px] font-semibold text-zinc-600 dark:text-zinc-400",children:"Live Activity"})]}),(0,n.jsx)("button",{onClick:i,className:"text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors p-1 -mr-0.5 rounded-full hover:bg-zinc-100 dark:hover:bg-zinc-800",title:"Collapse",children:(0,n.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})})]}),(0,n.jsx)("div",{className:"py-0.5 max-h-[260px] overflow-y-auto custom-scrollbar",children:0===e.length?(0,n.jsxs)("div",{className:"py-6 text-center",children:[(0,n.jsxs)("svg",{className:"w-5 h-5 text-zinc-200 dark:text-zinc-700 mx-auto mb-1.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,n.jsx)("polyline",{points:"8,4 8,8 11,10"})]}),(0,n.jsx)("p",{className:"text-[11px] text-zinc-400 dark:text-zinc-500",children:"No activity yet"})]}):e.slice(0,r?3:6).map((e,t)=>(0,n.jsx)("div",{className:0===t?"bg-emerald-50/30 dark:bg-emerald-950/30":"",children:(0,n.jsx)(i0,{event:e,variant:"compact",onNodeClick:a,onHandleClick:o})},e.id))}),e.length>0&&(0,n.jsxs)("div",{className:"flex items-center justify-between px-3.5 py-2 border-t border-zinc-100/80 dark:border-zinc-800/80 bg-zinc-50/30 dark:bg-zinc-800/30",children:[(0,n.jsxs)("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500",children:[e.length," event",1!==e.length?"s":""]}),(0,n.jsxs)("button",{onClick:l,className:"text-[11px] text-emerald-600 dark:text-emerald-400 hover:text-emerald-700 dark:hover:text-emerald-300 transition-colors font-medium flex items-center gap-1",children:["See all",(0,n.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]})]})]})}function i5(e,t){let n=new Set(e.map(e=>e.id)),r=[...e];for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r.sort((e,t)=>t.time-e.time),r}let i2=[{key:"issues",label:"Issues",icon:"circle"},{key:"deps",label:"Deps",icon:"link"},{key:"comments",label:"Comments",icon:"chat"},{key:"claims",label:"Claims",icon:"user"},{key:"likes",label:"Likes",icon:"heart"}];function i4(e){let t=new Map,n=[];for(let r of e){let e=function(e){let t=Date.now()-e,n=t/36e5,r=t/864e5;return n<1?"Just now":n<24?"Today":r<2?"Yesterday":r<7?"This week":r<30?"This month":"Older"}(r.time);t.has(e)||(t.set(e,[]),n.push(e)),t.get(e).push(r)}return n.map(e=>({label:e,events:t.get(e)}))}function i3({events:e,isOpen:t,onClose:i,onNodeClick:l,onHandleClick:a}){let[o,s]=(0,r.useState)(""),[c,d]=(0,r.useState)(new Set(i2.map(e=>e.key))),[u,h]=(0,r.useState)(50);(0,r.useEffect)(()=>{h(50)},[e,c,o]);let p=e=>{d(t=>{let n=new Set(t);return n.has(e)?n.size>1&&n.delete(e):n.add(e),n})},f=(0,r.useMemo)(()=>{let t=e;if(t=t.filter(e=>c.has(function(e){switch(e){case"node-created":case"node-closed":case"node-status-changed":case"node-priority-changed":case"node-title-changed":case"node-owner-changed":case"node-assignee-changed":return"issues";case"link-added":case"link-removed":return"deps";case"comment-added":case"reply-added":return"comments";case"task-claimed":case"task-unclaimed":return"claims";case"like-added":return"likes"}}(e.type))),o.trim()){let e=o.trim().toLowerCase();t=t.filter(t=>t.nodeId.toLowerCase().includes(e)||t.nodeTitle&&t.nodeTitle.toLowerCase().includes(e)||t.actor?.handle&&t.actor.handle.toLowerCase().includes(e)||t.detail&&t.detail.toLowerCase().includes(e))}return t},[e,c,o]);(0,r.useMemo)(()=>i4(f),[f]);let x=(0,r.useMemo)(()=>f.slice(0,u),[f,u]),m=f.length>u,g=(0,r.useMemo)(()=>i4(x),[x]),k=c.size===i2.length;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("aside",{className:`hidden md:flex absolute top-0 right-0 h-full w-[360px] bg-white dark:bg-zinc-900 border-l border-zinc-200 dark:border-zinc-700 flex-col shadow-xl z-30 transform transition-transform duration-300 ease-out ${t?"translate-x-0":"translate-x-full"}`,children:[(0,n.jsxs)("div",{className:"shrink-0 px-5 py-3 border-b border-zinc-100 dark:border-zinc-800 flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h2",{className:"text-xs font-semibold text-zinc-400 uppercase tracking-wider",children:"Activity"}),e.length>0&&(0,n.jsx)("span",{className:"px-1.5 py-0.5 bg-emerald-50 dark:bg-emerald-950 text-emerald-600 dark:text-emerald-400 rounded-full text-[10px] font-medium",children:e.length})]}),(0,n.jsx)("button",{onClick:i,className:"p-1 text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors rounded-full hover:bg-zinc-100 dark:hover:bg-zinc-800",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"px-4 pt-3 pb-2 shrink-0",children:(0,n.jsxs)("div",{className:"flex items-center bg-zinc-50/80 dark:bg-zinc-800/80 rounded-full border border-zinc-200/60 dark:border-zinc-700/60 overflow-hidden",children:[(0,n.jsx)("div",{className:"pl-3 pr-1 text-zinc-400 dark:text-zinc-500",children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),(0,n.jsx)("input",{type:"text",value:o,onChange:e=>s(e.target.value),placeholder:"Search activity...",className:"flex-1 px-2 py-2 text-xs text-zinc-800 dark:text-zinc-200 bg-transparent outline-none placeholder:text-zinc-400 dark:placeholder:text-zinc-500"}),o&&(0,n.jsx)("button",{onClick:()=>s(""),className:"pr-3 text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300",children:(0,n.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})}),(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5 px-4 pb-3 shrink-0",children:i2.map(e=>{let t=c.has(e.key);return(0,n.jsx)("button",{onClick:()=>p(e.key),className:`px-2.5 py-1 text-[11px] font-medium rounded-full border transition-all ${t?"bg-emerald-50 dark:bg-emerald-950 text-emerald-700 dark:text-emerald-400 border-emerald-200 dark:border-emerald-800 shadow-sm":"bg-white dark:bg-zinc-900 text-zinc-400 dark:text-zinc-500 border-zinc-200 dark:border-zinc-700 hover:text-zinc-600 dark:hover:text-zinc-300 hover:border-zinc-300 dark:hover:border-zinc-600"}`,children:e.label},e.key)})}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar border-t border-zinc-100 dark:border-zinc-800",children:0===f.length?(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,n.jsx)("svg",{className:"w-8 h-8 text-zinc-200 dark:text-zinc-700 mb-3",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,n.jsx)("p",{className:"text-xs text-zinc-400 dark:text-zinc-500",children:o.trim()?"No activity matching your search":"No activity yet"}),o.trim()&&(0,n.jsx)("button",{onClick:()=>s(""),className:"text-[11px] text-emerald-600 dark:text-emerald-400 hover:text-emerald-700 dark:hover:text-emerald-300 mt-1.5",children:"Clear search"})]}):(0,n.jsxs)(n.Fragment,{children:[g.map(e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"sticky top-0 z-[1] px-4 py-1.5 bg-zinc-50/95 dark:bg-zinc-800/95 backdrop-blur-sm border-b border-zinc-100/60 dark:border-zinc-700/60",children:(0,n.jsx)("span",{className:"text-[10px] font-semibold text-zinc-400 uppercase tracking-wider",children:e.label})}),(0,n.jsx)("div",{className:"divide-y divide-zinc-50 dark:divide-zinc-800",children:e.events.map(e=>(0,n.jsx)(i0,{event:e,variant:"full",onNodeClick:l,onHandleClick:a},e.id))})]},e.label)),m&&(0,n.jsx)("div",{className:"flex justify-center py-3 border-t border-zinc-100/60 dark:border-zinc-700/60",children:(0,n.jsxs)("button",{onClick:()=>h(e=>e+50),className:"text-[11px] text-emerald-600 dark:text-emerald-400 hover:text-emerald-700 dark:hover:text-emerald-300 font-medium px-3 py-1.5 rounded-full hover:bg-emerald-50 dark:hover:bg-emerald-950 transition-colors",children:["Show ",Math.min(50,f.length-u)," more events"]})})]})}),(0,n.jsx)("div",{className:"shrink-0 px-5 py-2.5 border-t border-zinc-100 dark:border-zinc-800 bg-zinc-50/50 dark:bg-zinc-800/50",children:(0,n.jsxs)("div",{className:"text-[10px] text-zinc-400 dark:text-zinc-500",children:[m?`${u} of ${f.length} events`:`${f.length} event${1!==f.length?"s":""}`,!k&&" (filtered)",o.trim()&&` matching "${o.trim()}"`]})})]}),(0,n.jsx)("div",{className:`md:hidden fixed inset-x-0 bottom-0 z-20 transition-transform duration-300 ease-out ${t?"translate-y-0":"translate-y-full"}`,children:(0,n.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-t-2xl shadow-xl border-t border-zinc-200 dark:border-zinc-700 max-h-[60vh] flex flex-col",children:[(0,n.jsx)("div",{className:"flex justify-center pt-3 pb-1",children:(0,n.jsx)("div",{className:"w-8 h-1 bg-zinc-300 dark:bg-zinc-600 rounded-full"})}),(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 py-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:"Activity"}),e.length>0&&(0,n.jsx)("span",{className:"px-1.5 py-0.5 bg-emerald-50 dark:bg-emerald-950 text-emerald-600 dark:text-emerald-400 rounded-full text-[10px] font-medium",children:e.length})]}),(0,n.jsx)("button",{onClick:i,className:"p-1 text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5 px-5 pb-3",children:i2.map(e=>(0,n.jsx)("button",{onClick:()=>p(e.key),className:`px-2.5 py-1 text-[11px] font-medium rounded-full border transition-colors ${c.has(e.key)?"bg-emerald-50 dark:bg-emerald-950 text-emerald-700 dark:text-emerald-400 border-emerald-200 dark:border-emerald-800":"bg-white dark:bg-zinc-900 text-zinc-400 dark:text-zinc-500 border-zinc-200 dark:border-zinc-700"}`,children:e.label},e.key))}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar",children:0===f.length?(0,n.jsx)("div",{className:"py-8 text-center text-xs text-zinc-400 dark:text-zinc-500",children:"No activity matching filters"}):(0,n.jsxs)(n.Fragment,{children:[g.map(e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"sticky top-0 z-[1] px-5 py-1.5 bg-zinc-50/95 dark:bg-zinc-800/95 backdrop-blur-sm border-b border-zinc-100/60 dark:border-zinc-700/60",children:(0,n.jsx)("span",{className:"text-[10px] font-semibold text-zinc-400 uppercase tracking-wider",children:e.label})}),(0,n.jsx)("div",{className:"divide-y divide-zinc-50 dark:divide-zinc-800",children:e.events.map(e=>(0,n.jsx)(i0,{event:e,variant:"full",onNodeClick:l,onHandleClick:a},e.id))})]},e.label)),m&&(0,n.jsx)("div",{className:"flex justify-center py-3 border-t border-zinc-100/60 dark:border-zinc-700/60",children:(0,n.jsxs)("button",{onClick:()=>h(e=>e+50),className:"text-[11px] text-emerald-600 dark:text-emerald-400 hover:text-emerald-700 dark:hover:text-emerald-300 font-medium px-3 py-1.5 rounded-full hover:bg-emerald-50 dark:hover:bg-emerald-950 transition-colors",children:["Show ",Math.min(50,f.length-u)," more events"]})})]})})]})})]})}let i6=[{target:"graph",title:"The Dependency Graph",description:"Each circle is a task or issue. The flowing particles between them show the direction of dependencies — what needs to happen before something else can start. Bigger circles mean more connections.",padding:0},{target:"layouts",title:"Layout Modes",description:"Switch how the graph is arranged. Force is organic and physics-based. DAG gives you a clean top-down tree. Radial spreads nodes in rings. Cluster groups by project. Spread spaces everything out for screenshots."},{target:"btn-collapse",title:"Collapse / Expand",description:"Group all epic tasks into a single node, or expand them back out. Great for getting a high-level overview of your project when there are many tasks."},{target:"btn-clusters",title:"Cluster Labels",description:"Toggle transparent labels that show project prefixes behind groups of related nodes. Helps you see which project each cluster belongs to at a glance."},{target:"btn-autofit",title:"Auto-fit",description:"When enabled (green), the camera automatically re-centers and zooms to fit all nodes after every update. Turn it off to keep the camera fixed while you explore."},{target:"btn-pulse",title:"Pulse",description:"Highlights the most recently active node with emerald ripples. Useful for spotting which task just changed status or was just created."},{target:"legend-stats",title:"Project Stats",description:"A quick summary of your project: total issues, dependency count, and how many separate projects are tracked. When legend filters are active, these numbers update to reflect only the visible nodes."},{target:"legend-color-mode",title:"Color Mode Selector",description:"Switch what the node fill color represents. Status shows open/closed/blocked. Priority shows urgency. Type highlights epics, tasks, bugs, features, and chores. Owner, Assignee, and Prefix color by person or project. The ring around each node always shows which project it belongs to."},{target:"legend-items",title:"Legend",description:'Shows what each color means for the current color mode. Click any label to filter the graph — only matching nodes will be shown. Click more labels to combine filters (union). Click again to remove a filter, or use "Clear filters" to reset. The colored dots match the node fills in the graph.'},{target:"minimap",title:"Minimap",description:"A bird’s-eye view of your entire graph. Click anywhere to jump there. Drag the edges to resize it."},{target:"overlays",title:"Leaderboard & Activity",description:"These compact overlays live in the top-right corner. The activity feed shows recent changes — tasks created, statuses updated, priorities shifted. The leaderboard ranks contributors by closed issues, created issues, and comments. Click either to expand into a full sidebar."},{target:"graph",title:"Multi-Select & Group Drag",description:"Right-click and drag on the canvas background to draw a selection rectangle around multiple nodes. Shift-click individual nodes to toggle them in/out of the selection. Once selected, drag any selected node to move the entire group together. Press Escape to deselect all.",padding:0},{target:"graph",title:"Quick Navigation Shortcuts",description:"Press Shift+0 to instantly zoom to the most recently edited node (the pulsing one). Press Shift+1 through Shift+9 to jump to a node belonging to the corresponding leaderboard contributor — Shift+1 for #1, Shift+2 for #2, and so on. Great for quickly checking what your top contributors are working on.",padding:0},{target:"auth-section",title:"Sign In & Profiles",description:"Sign in with your Bluesky/ATProto account to comment, claim tasks, and like comments. Click any avatar on the graph to see that person’s profile — their stats, recent activity, and contributions. Click your own handle in the dropdown to view your profile."},{target:"btn-theme",title:"Dark Mode",description:"Toggle between light and dark themes. Your preference is saved and persists across sessions. The entire UI — canvas, panels, tooltips, and overlays — adapts to your chosen theme."},{target:"graph",title:"Interacting with Nodes",description:"Click a node to see its details, labels, assignee, and linked commits. Hover for a quick tooltip. Right-click for actions like viewing descriptions, commenting, claiming tasks, collapsing epics, or focusing on an epic’s subgraph. Avatars on nodes show who claimed or is assigned — hover for details like “einstein.climateai.org claimed beads-map-123”, click to open their profile.",padding:0},{target:"nav-replay",title:"Replay",description:"Step through your project’s history one event at a time. Watch issues appear and change status as they were created. Use the scrubber to jump to any point in time."},{target:"nav-comments",title:"Comments",description:"Opens a sidebar showing all conversations across your beads. See who said what, reply to threads, and like comments — all powered by the AT Protocol."},{target:"nav-activity",title:"Activity",description:'A real-time feed of changes for your local issues. See when tasks are created, statuses change, priorities shift, and dependencies are added. Use "Show more" to page through the full history. During timeline replay, the feed filters to only events up to the current point in time.'},{target:"nav-learn",title:"Learn",description:"Opens the help panel with keyboard shortcuts, feature documentation, and this interactive tutorial. Click it anytime to come back here."}];function i8({step:e,onNext:t,onEnd:i}){let[l,a]=(0,r.useState)(null),o=(0,r.useCallback)(()=>{if(null===e)return void a(null);let t=i6[e];if(!t)return void a(null);let n=document.querySelector(`[data-tutorial="${t.target}"]`);if(n){let e=n.getBoundingClientRect(),r=t.padding??8;a({left:e.left-r,top:e.top-r,width:e.width+2*r,height:e.height+2*r})}else a(null)},[e]);if((0,r.useEffect)(()=>{o();let e=()=>o();window.addEventListener("resize",e);let t=setTimeout(o,150);return()=>{window.removeEventListener("resize",e),clearTimeout(t)}},[o]),null===e)return null;let s=e===i6.length-1;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"fixed inset-0 z-[55] cursor-pointer",onClick:()=>{s?i():t()},children:(0,n.jsxs)("svg",{className:"absolute inset-0 w-full h-full",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("defs",{children:(0,n.jsxs)("mask",{id:"tutorial-mask",children:[(0,n.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),l&&(0,n.jsx)("rect",{x:l.left,y:l.top,width:l.width,height:l.height,rx:8,ry:8,fill:"black"})]})}),(0,n.jsx)("rect",{width:"100%",height:"100%",fill:"rgba(0,0,0,0.45)",mask:"url(#tutorial-mask)"})]})}),l&&(0,n.jsx)("div",{className:"fixed rounded-lg ring-2 ring-emerald-400/60 dark:ring-emerald-500/60 animate-pulse z-[56]",style:{left:l.left,top:l.top,width:l.width,height:l.height,pointerEvents:"none"}})]})}let i7="#d20f39",i9="#179299",le="#fe640b",lt="#1e66f5",ln="#40a02b",lr="#8839ef",li="#209fb5",ll="#ea76cb";function la({isOpen:e,onClose:t,tutorialStep:r=null,onStartTutorial:i,onNextStep:l,onPrevStep:a,onEndTutorial:o}){let s=null!==r,c=s?"Tutorial":"Welcome to Heartbeads",d=s?(0,n.jsx)(lo,{step:r,onNext:l,onPrev:a,onEnd:o}):(0,n.jsx)(ld,{onStartTutorial:i});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("aside",{className:`hidden md:flex absolute top-0 right-0 h-full w-[360px] bg-white dark:bg-zinc-900 border-l border-zinc-200 dark:border-zinc-700 flex-col shadow-xl transform transition-transform duration-300 ease-out ${e?"translate-x-0":"translate-x-full"} ${s?"z-[60]":"z-30"}`,children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-zinc-100 dark:border-zinc-800 shrink-0",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:c}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar",children:d})]}),(0,n.jsx)("div",{className:`md:hidden fixed inset-x-0 bottom-0 transform transition-transform duration-300 ease-out ${e?"translate-y-0":"translate-y-full"} ${s?"z-[60]":"z-20"}`,children:(0,n.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-t-2xl shadow-2xl border-t border-zinc-200 dark:border-zinc-700 max-h-[70vh] flex flex-col",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-zinc-100 dark:border-zinc-800 shrink-0",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:c}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar",children:d})]})})]})}function lo({step:e,onNext:t,onPrev:r,onEnd:i}){let l=i6[e],a=i6.length,o=e===a-1;return(0,n.jsxs)("div",{className:"px-5 py-4 flex flex-col min-h-[300px]",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,n.jsxs)("span",{className:"text-xs font-medium",style:{color:i9},children:[e+1," / ",a]}),(0,n.jsx)("div",{className:"flex gap-1",children:Array.from({length:a}).map((t,r)=>(0,n.jsx)("div",{className:"w-1.5 h-1.5 rounded-full transition-colors",style:{backgroundColor:r===e?ln:r<e?i9:"#dce0e8"}},r))})]}),(0,n.jsx)("h3",{className:"text-base font-semibold text-zinc-900 dark:text-zinc-100 mb-2",children:l.title}),(0,n.jsx)("p",{className:"text-[13px] text-zinc-600 dark:text-zinc-300 leading-relaxed mb-6",children:l.description}),(0,n.jsx)("div",{className:"flex-1"}),(0,n.jsxs)("div",{className:"flex items-center gap-2 pt-4 border-t border-zinc-100 dark:border-zinc-800",children:[0===e?(0,n.jsx)("button",{onClick:i,className:"px-4 py-2 text-sm font-medium text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 rounded-lg hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors",children:"Skip"}):(0,n.jsx)("button",{onClick:r,className:"px-4 py-2 text-sm font-medium rounded-lg hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors",style:{color:lt},children:"Back"}),(0,n.jsx)("div",{className:"flex-1"}),o?(0,n.jsx)("button",{onClick:i,className:"px-4 py-2 text-sm font-medium text-white rounded-lg bg-emerald-500 hover:bg-emerald-600 transition-colors",children:"Done"}):(0,n.jsx)("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-white rounded-lg bg-emerald-500 hover:bg-emerald-600 transition-colors",children:"Next"})]})]})}function ls({color:e,children:t}){return(0,n.jsxs)("li",{className:"flex gap-2.5 items-start",children:[(0,n.jsx)("span",{className:"w-1.5 h-1.5 rounded-full mt-[6px] shrink-0",style:{backgroundColor:e}}),(0,n.jsx)("span",{children:t})]})}function lc({children:e,color:t}){return(0,n.jsx)("h3",{className:"text-[11px] font-semibold uppercase tracking-widest mb-2 mt-5 first:mt-0",style:{color:t},children:e})}function ld({onStartTutorial:e}){return(0,n.jsxs)("div",{className:"px-5 py-4 text-[13px] text-zinc-600 dark:text-zinc-300 leading-relaxed",children:[e&&(0,n.jsxs)("button",{onClick:e,className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 mb-5 text-white text-sm font-medium rounded-lg bg-emerald-500 hover:bg-emerald-600 transition-colors",children:[(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18v-5.25m0 0a6.01 6.01 0 001.5-.189m-1.5.189a6.01 6.01 0 01-1.5-.189m3.75 7.478a12.06 12.06 0 01-4.5 0m3.75 2.383a14.406 14.406 0 01-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 10-7.517 0c.85.493 1.509 1.333 1.509 2.316V18"})}),"Take the guided tour"]}),(0,n.jsx)("p",{className:"text-zinc-900 dark:text-zinc-100 font-medium mb-1",children:"Your command center for AI coding tasks."}),(0,n.jsx)("p",{className:"mb-4 text-zinc-500 dark:text-zinc-400",children:"Heartbeads shows everything your AI agents are working on as a live, interactive graph — tasks, dependencies, who's doing what, and what's blocking progress."}),(0,n.jsx)(lc,{color:i7,children:"The graph"}),(0,n.jsxs)("p",{className:"mb-2",children:["Each ",(0,n.jsx)("strong",{children:"circle"})," is a task. ",(0,n.jsx)("strong",{children:"Flowing particles"})," ","stream between them to show dependency direction."]}),(0,n.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,n.jsxs)(ls,{color:i7,children:[(0,n.jsx)("strong",{children:"Bigger circles"})," — more connected, more important"]}),(0,n.jsxs)(ls,{color:i7,children:[(0,n.jsx)("strong",{children:"Solid lines + particles"})," — “blocks” (A must finish before B)"]}),(0,n.jsxs)(ls,{color:i7,children:[(0,n.jsx)("strong",{children:"Dashed lines"})," — parent-child grouping"]}),(0,n.jsxs)(ls,{color:i7,children:[(0,n.jsx)("strong",{children:"Colored ring"})," — which project it belongs to"]}),(0,n.jsxs)(ls,{color:i7,children:[(0,n.jsx)("strong",{children:"Avatars"})," — small profile pictures on nodes show who claimed or is assigned to that task"]}),(0,n.jsxs)(ls,{color:i7,children:[(0,n.jsx)("strong",{children:"Labels"})," — tags like “mobile”, “ux”, or “build” shown as pills in node details and hover tooltips"]})]}),(0,n.jsx)(lc,{color:lt,children:"Navigation"}),(0,n.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,n.jsxs)(ls,{color:lt,children:[(0,n.jsx)("strong",{children:"Click"})," a node to open its details"]}),(0,n.jsxs)(ls,{color:lt,children:[(0,n.jsx)("strong",{children:"Hover"})," for a quick summary"]}),(0,n.jsxs)(ls,{color:lt,children:[(0,n.jsx)("strong",{children:"Right-click"})," for actions — descriptions, comments, claims, collapse, or focus on an epic"]}),(0,n.jsxs)(ls,{color:lt,children:[(0,n.jsx)("strong",{children:"Scroll"})," to zoom, ",(0,n.jsx)("strong",{children:"drag"})," to pan"]})]}),(0,n.jsx)(lc,{color:lt,children:"Keyboard shortcuts"}),(0,n.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,n.jsxs)(ls,{color:lt,children:[(0,n.jsx)("strong",{children:"Cmd/Ctrl+F"})," — search by name, ID, owner, or commenter"]}),(0,n.jsxs)(ls,{color:lt,children:[(0,n.jsx)("strong",{children:"Shift+0"})," — zoom to the most recently edited node"]}),(0,n.jsxs)(ls,{color:lt,children:[(0,n.jsx)("strong",{children:"Shift+1-9"})," — zoom to a node from the #1-#9 leaderboard contributor"]}),(0,n.jsxs)(ls,{color:lt,children:[(0,n.jsx)("strong",{children:"Escape"})," — clear search or multi-selection"]})]}),(0,n.jsx)(lc,{color:i9,children:"Layouts"}),(0,n.jsx)("p",{className:"mb-2",children:"Top-left buttons rearrange the graph:"}),(0,n.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,n.jsxs)(ls,{color:i9,children:[(0,n.jsx)("strong",{children:"Force"})," — organic, physics-based"]}),(0,n.jsxs)(ls,{color:i9,children:[(0,n.jsx)("strong",{children:"DAG"})," — clean top-down tree"]}),(0,n.jsxs)(ls,{color:i9,children:[(0,n.jsx)("strong",{children:"Radial"})," — rings from center outward"]}),(0,n.jsxs)(ls,{color:i9,children:[(0,n.jsx)("strong",{children:"Cluster"})," — grouped by project"]}),(0,n.jsxs)(ls,{color:i9,children:[(0,n.jsx)("strong",{children:"Spread"})," — spaced out for screenshots"]})]}),(0,n.jsx)(lc,{color:le,children:"Color modes"}),(0,n.jsx)("p",{className:"mb-2",children:"Bottom-right panel — paint nodes by:"}),(0,n.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,n.jsxs)(ls,{color:le,children:[(0,n.jsx)("strong",{children:"Status"})," — open, in progress, blocked, closed"]}),(0,n.jsxs)(ls,{color:le,children:[(0,n.jsx)("strong",{children:"Priority"})," — P0 critical to P4 backlog"]}),(0,n.jsxs)(ls,{color:le,children:[(0,n.jsx)("strong",{children:"Type"})," — epic, task, bug, feature, or chore"]}),(0,n.jsxs)(ls,{color:le,children:[(0,n.jsx)("strong",{children:"Owner"})," — who created it"]}),(0,n.jsxs)(ls,{color:le,children:[(0,n.jsx)("strong",{children:"Assignee"})," — who's working on it"]}),(0,n.jsxs)(ls,{color:le,children:[(0,n.jsx)("strong",{children:"Prefix"})," — which project"]}),(0,n.jsxs)(ls,{color:le,children:[(0,n.jsx)("strong",{children:"Click to filter"})," — click any legend label to show only matching nodes. Combine multiple for a union view"]})]}),(0,n.jsx)(lc,{color:lr,children:"More"}),(0,n.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Collapse/Expand"})," — tidy up epics into single nodes"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Focus on epic"})," — right-click an epic to isolate its subgraph (children + dependencies). Click the banner or right-click again to return"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Clusters"})," — dashed circles grouping projects when zoomed out"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Replay"})," — step through your project's history"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Comments"})," — leave notes on tasks (sign in first)"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Activity feed"})," — compact overlay in top-right and full sidebar. Real-time local changes with pagination. During replay, filters to the current point in time"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Claim tasks"})," — right-click to mark as yours"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Minimap"})," — click to jump, drag edges to resize"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Auto-fit"})," — top-left toggle to lock/unlock automatic camera reframing"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Pulse"})," — the most recently active node pulses with emerald ripples. Toggle it on/off in view controls"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Copy"})," — clipboard icon copies task with project info"]})]}),(0,n.jsx)(lc,{color:ln,children:"Multi-select"}),(0,n.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,n.jsxs)(ls,{color:ln,children:[(0,n.jsx)("strong",{children:"Right-click + drag"})," — draw a rectangle on the canvas background to select multiple nodes"]}),(0,n.jsxs)(ls,{color:ln,children:[(0,n.jsx)("strong",{children:"Shift + click"})," — toggle individual nodes into or out of the selection"]}),(0,n.jsxs)(ls,{color:ln,children:[(0,n.jsx)("strong",{children:"Group drag"})," — drag any selected node to move them all together"]}),(0,n.jsxs)(ls,{color:ln,children:[(0,n.jsx)("strong",{children:"Escape"})," — clear the selection"]})]}),(0,n.jsx)(lc,{color:li,children:"Leaderboard & Profiles"}),(0,n.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,n.jsxs)(ls,{color:li,children:[(0,n.jsx)("strong",{children:"Leaderboard"})," — top-right overlay ranking contributors by closed, created, and commented issues. Click “See all” for the full sidebar"]}),(0,n.jsxs)(ls,{color:li,children:[(0,n.jsx)("strong",{children:"Profiles"})," — click any avatar on the graph to open their profile panel with stats and recent activity"]}),(0,n.jsxs)(ls,{color:li,children:[(0,n.jsx)("strong",{children:"Your profile"})," — click your handle in the sign-in dropdown to see your own stats"]})]}),(0,n.jsx)(lc,{color:ll,children:"Sharing & Settings"}),(0,n.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,n.jsxs)(ls,{color:ll,children:[(0,n.jsx)("strong",{children:"Shareable URLs"})," — the current view state is stored in the URL. Copy it to share a specific node, panel, color mode, or filter with anyone"]}),(0,n.jsxs)(ls,{color:ll,children:[(0,n.jsx)("strong",{children:"Text-to-speech"})," — open a task description and click the speaker icon to hear it read aloud. Select text for targeted playback. Adjust speed in settings"]}),(0,n.jsxs)(ls,{color:ll,children:[(0,n.jsx)("strong",{children:"Settings"})," — gear icon for TTS voice, playback speed, and dashboard access controls"]})]}),(0,n.jsx)(lc,{color:lr,children:"Appearance"}),(0,n.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"Dark mode"})," — click the moon/sun icon in the header to toggle. Your preference is saved to localStorage and persists across sessions"]}),(0,n.jsxs)(ls,{color:lr,children:[(0,n.jsx)("strong",{children:"System preference"})," — on first visit, heartbeads follows your OS dark/light setting automatically"]})]}),(0,n.jsxs)("div",{className:"mt-5 pt-4 border-t border-zinc-100 dark:border-zinc-800 text-xs text-zinc-400 dark:text-zinc-500",children:["Built with"," ",(0,n.jsx)("a",{href:"https://github.com/GainForest/beads",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 transition-colors",style:{color:ln},children:"beads"})," ","— open-source issue tracking for AI-native development. Heartbeads is built for the GainForest agentic workflow and open-sourced at"," ",(0,n.jsx)("a",{href:"https://github.com/daviddao/heartbeads",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 transition-colors",style:{color:ln},children:"github.com/daviddao/heartbeads"}),"."]})]})}function lu({entries:e,collapsed:t,compact:r,onToggleCollapse:i,onExpandPanel:l,onProfileClick:a}){return t?(0,n.jsxs)("button",{onClick:i,className:"flex items-center gap-2 px-3 py-1.5 bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm rounded-full border border-zinc-200/80 dark:border-zinc-700/80 shadow-sm hover:shadow-md transition-all cursor-pointer",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-amber-500",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,n.jsx)("path",{d:"M4 2h8v5a4 4 0 01-8 0V2zM4 4H2a1 1 0 00-1 1v1a2 2 0 002 2h1M12 4h2a1 1 0 011 1v1a2 2 0 01-2 2h-1M6 12h4M8 10v2M5 14h6"})}),(0,n.jsx)("span",{className:"text-xs font-medium text-zinc-600 dark:text-zinc-400",children:"Leaderboard"}),e.length>0&&(0,n.jsx)("span",{className:"text-[10px] font-medium text-white bg-amber-500 rounded-full px-1.5 py-0.5 min-w-[18px] text-center",children:e.length})]}):(0,n.jsxs)("div",{className:`${r?"w-60":"w-72"} max-w-[calc(100vw-2rem)] bg-white/95 dark:bg-zinc-900/95 backdrop-blur-sm rounded-xl border border-zinc-200/80 dark:border-zinc-700/80 shadow-lg overflow-hidden`,children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-400"}),(0,n.jsx)("span",{className:"text-[11px] font-semibold text-zinc-700 dark:text-zinc-300 uppercase tracking-wider",children:"Leaderboard"})]}),(0,n.jsx)("button",{onClick:i,className:"p-1 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-lg transition-colors cursor-pointer",children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 15.75l7.5-7.5 7.5 7.5"})})})]}),(0,n.jsx)("div",{className:"max-h-[220px] overflow-y-auto",children:e.slice(0,3).map((e,t)=>(0,n.jsxs)("button",{onClick:()=>a(e.handle),className:"flex items-center gap-2.5 w-full px-3 py-2 hover:bg-zinc-50/60 dark:hover:bg-zinc-800/60 transition-colors text-left cursor-pointer",children:[(0,n.jsx)("span",{className:`text-[11px] font-bold tabular-nums w-4 text-center shrink-0 ${0===t?"text-amber-500":1===t?"text-zinc-400":2===t?"text-amber-700":"text-zinc-300 dark:text-zinc-500"}`,children:t+1}),e.avatar?(0,n.jsx)("img",{src:e.avatar,alt:e.handle,className:"w-6 h-6 rounded-full ring-1 ring-zinc-100 dark:ring-zinc-700 shrink-0"}):(0,n.jsx)("div",{className:"w-6 h-6 rounded-full bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center text-[10px] font-medium text-zinc-500 dark:text-zinc-400 shrink-0",children:e.handle.charAt(0).toUpperCase()}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("div",{className:"text-[11px] font-medium text-zinc-700 dark:text-zinc-300 truncate",children:e.handle}),(0,n.jsxs)("div",{className:"text-[10px] text-zinc-400 dark:text-zinc-400",children:[e.closedCount," closed · ",e.createdCount," created · ",e.commentCount," comments"]})]})]},e.handle))}),e.length>0&&(0,n.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-t border-zinc-100 dark:border-zinc-800",children:[(0,n.jsxs)("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-400",children:[e.length," contributors"]}),(0,n.jsx)("button",{onClick:l,className:"text-[10px] font-medium text-emerald-600 dark:text-emerald-400 hover:text-emerald-700 dark:hover:text-emerald-300 transition-colors cursor-pointer",children:"See all →"})]})]})}function lh({entries:e,isOpen:t,onClose:r,onProfileClick:i}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("aside",{className:`hidden md:flex absolute top-0 right-0 h-full w-[360px] bg-white dark:bg-zinc-900 border-l border-zinc-200 dark:border-zinc-700 flex-col shadow-xl z-30 transform transition-transform duration-300 ease-out ${t?"translate-x-0":"translate-x-full"}`,children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"text-[11px] font-semibold text-zinc-400 uppercase tracking-wider",children:"Leaderboard"}),(0,n.jsx)("span",{className:"text-[10px] font-medium text-white bg-amber-500 rounded-full px-1.5 py-0.5 min-w-[18px] text-center",children:e.length})]}),(0,n.jsx)("button",{onClick:r,className:"p-1.5 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-lg transition-colors cursor-pointer",children:(0,n.jsx)("svg",{className:"w-4 h-4 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[e.map((e,t)=>(0,n.jsxs)("button",{onClick:()=>i(e.handle),className:"flex items-center gap-3 w-full px-4 py-3 hover:bg-zinc-50/50 dark:hover:bg-zinc-800/50 transition-colors text-left group cursor-pointer",children:[(0,n.jsx)("span",{className:`text-sm font-bold tabular-nums w-6 text-center shrink-0 ${0===t?"text-amber-500":1===t?"text-zinc-400":2===t?"text-amber-700":"text-zinc-300 dark:text-zinc-500"}`,children:t+1}),e.avatar?(0,n.jsx)("img",{src:e.avatar,alt:e.handle,className:"w-9 h-9 rounded-full ring-1 ring-zinc-100 dark:ring-zinc-700 shrink-0"}):(0,n.jsx)("div",{className:"w-9 h-9 rounded-full bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center text-sm font-medium text-zinc-500 dark:text-zinc-400 shrink-0",children:e.handle.charAt(0).toUpperCase()}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("div",{className:"text-[13px] font-semibold text-zinc-800 dark:text-zinc-200 truncate group-hover:text-emerald-600 dark:group-hover:text-emerald-400 transition-colors",children:e.handle}),(0,n.jsxs)("div",{className:"flex items-center gap-3 mt-0.5",children:[(0,n.jsxs)("span",{className:"text-[11px] text-zinc-400",children:[(0,n.jsx)("span",{className:"font-medium text-zinc-600 dark:text-zinc-400",children:e.closedCount})," closed"]}),(0,n.jsxs)("span",{className:"text-[11px] text-zinc-400",children:[(0,n.jsx)("span",{className:"font-medium text-zinc-600 dark:text-zinc-400",children:e.createdCount})," created"]}),(0,n.jsxs)("span",{className:"text-[11px] text-zinc-400",children:[(0,n.jsx)("span",{className:"font-medium text-zinc-600 dark:text-zinc-400",children:e.commentCount})," comments"]})]})]}),(0,n.jsxs)("div",{className:"shrink-0 flex flex-col items-center",children:[(0,n.jsx)("span",{className:"text-lg font-bold text-zinc-700 dark:text-zinc-300",children:e.score}),(0,n.jsx)("span",{className:"text-[9px] text-zinc-400 uppercase",children:"pts"})]})]},e.handle)),0===e.length&&(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-zinc-300 dark:text-zinc-500",children:[(0,n.jsx)("svg",{className:"w-10 h-10 mb-3",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1",children:(0,n.jsx)("path",{d:"M4 2h8v5a4 4 0 01-8 0V2zM4 4H2a1 1 0 00-1 1v1a2 2 0 002 2h1M12 4h2a1 1 0 011 1v1a2 2 0 01-2 2h-1M6 12h4M8 10v2M5 14h6"})}),(0,n.jsx)("span",{className:"text-xs",children:"No contributors yet"})]})]}),(0,n.jsx)("div",{className:"px-4 py-2.5 border-t border-zinc-100 dark:border-zinc-800 text-[10px] text-zinc-400",children:"Score = closed×3 + created×1 + comments×1"})]}),(0,n.jsx)("div",{className:`md:hidden fixed inset-x-0 bottom-0 z-20 transition-transform duration-300 ease-out ${t?"translate-y-0":"translate-y-full"}`,children:(0,n.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-t-2xl shadow-xl border-t border-zinc-200 dark:border-zinc-700 max-h-[60vh] flex flex-col",children:[(0,n.jsx)("div",{className:"flex justify-center pt-3 pb-1",children:(0,n.jsx)("div",{className:"w-8 h-1 bg-zinc-300 dark:bg-zinc-600 rounded-full"})}),(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:"Leaderboard"}),(0,n.jsx)("span",{className:"text-[10px] font-medium text-white bg-amber-500 rounded-full px-1.5 py-0.5 min-w-[18px] text-center",children:e.length})]}),(0,n.jsx)("button",{onClick:r,className:"p-1.5 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-lg transition-colors cursor-pointer",children:(0,n.jsx)("svg",{className:"w-4 h-4 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[e.map((e,t)=>(0,n.jsxs)("button",{onClick:()=>i(e.handle),className:"flex items-center gap-2.5 w-full px-4 py-2.5 hover:bg-zinc-50/50 dark:hover:bg-zinc-800/50 transition-colors text-left group cursor-pointer",children:[(0,n.jsx)("span",{className:`text-xs font-bold tabular-nums w-5 text-center shrink-0 ${0===t?"text-amber-500":1===t?"text-zinc-400":2===t?"text-amber-700":"text-zinc-300 dark:text-zinc-500"}`,children:t+1}),e.avatar?(0,n.jsx)("img",{src:e.avatar,alt:e.handle,className:"w-7 h-7 rounded-full ring-1 ring-zinc-100 dark:ring-zinc-700 shrink-0"}):(0,n.jsx)("div",{className:"w-7 h-7 rounded-full bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center text-xs font-medium text-zinc-500 dark:text-zinc-400 shrink-0",children:e.handle.charAt(0).toUpperCase()}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("div",{className:"text-xs font-semibold text-zinc-800 dark:text-zinc-200 truncate group-hover:text-emerald-600 dark:group-hover:text-emerald-400 transition-colors",children:e.handle}),(0,n.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,n.jsxs)("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-400",children:[(0,n.jsx)("span",{className:"font-medium text-zinc-600 dark:text-zinc-400",children:e.closedCount})," closed"]}),(0,n.jsxs)("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-400",children:[(0,n.jsx)("span",{className:"font-medium text-zinc-600 dark:text-zinc-400",children:e.createdCount})," created"]}),(0,n.jsxs)("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-400",children:[(0,n.jsx)("span",{className:"font-medium text-zinc-600 dark:text-zinc-400",children:e.commentCount})," comments"]})]})]}),(0,n.jsxs)("div",{className:"shrink-0 flex flex-col items-center",children:[(0,n.jsx)("span",{className:"text-base font-bold text-zinc-700 dark:text-zinc-300",children:e.score}),(0,n.jsx)("span",{className:"text-[8px] text-zinc-400 dark:text-zinc-400 uppercase",children:"pts"})]})]},e.handle)),0===e.length&&(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-zinc-300 dark:text-zinc-500",children:[(0,n.jsx)("svg",{className:"w-8 h-8 mb-2",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1",children:(0,n.jsx)("path",{d:"M4 2h8v5a4 4 0 01-8 0V2zM4 4H2a1 1 0 00-1 1v1a2 2 0 002 2h1M12 4h2a1 1 0 011 1v1a2 2 0 01-2 2h-1M6 12h4M8 10v2M5 14h6"})}),(0,n.jsx)("span",{className:"text-[11px]",children:"No contributors yet"})]})]}),(0,n.jsx)("div",{className:"px-4 py-2 border-t border-zinc-100 dark:border-zinc-800 text-[9px] text-zinc-400 text-center",children:"Score = closed×3 + created×1 + comments×1"})]})})]})}function lp({isOpen:e,onClose:t}){let[i,l]=(0,r.useState)(""),[a,o]=(0,r.useState)(""),[s,c]=(0,r.useState)(""),[d,u]=(0,r.useState)(!1),[h,p]=(0,r.useState)(!1),[f,x]=(0,r.useState)(!1);(0,r.useEffect)(()=>{p(!0)},[]),(0,r.useEffect)(()=>{if(e){let e=ig();l(e.elevenLabsApiKey||""),o(e.elevenLabsVoiceId),c(e.elevenLabsModel),u(!1),fetch("/api/auth").then(e=>e.json()).then(e=>x(!0===e.protected)).catch(()=>x(!1))}},[e]),(0,r.useEffect)(()=>{if(!e)return;let n=e=>{"Escape"===e.key&&t()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[e,t]);let m=(0,r.useCallback)(async()=>{try{await fetch("/api/auth",{method:"DELETE"})}catch{}window.location.href="/login"},[]),g=(0,r.useCallback)(()=>{var e;let n;e={elevenLabsApiKey:i.trim()||void 0,elevenLabsVoiceId:a.trim()||"UgBBYS2sOqTuMpoF3BR0",elevenLabsModel:s||"eleven_flash_v2_5"},n={...ig(),...e},localStorage.setItem(ix,JSON.stringify(n)),t()},[i,a,s,t]);return e&&h?(0,iu.createPortal)((0,n.jsx)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center",style:{backgroundColor:"rgba(0,0,0,0.4)",backdropFilter:"blur(4px)"},onClick:t,children:(0,n.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-xl shadow-2xl w-[90vw] max-w-md flex flex-col",onClick:e=>e.stopPropagation(),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:"Settings"}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-zinc-400 dark:text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsxs)("div",{className:"px-5 py-4 space-y-4 overflow-y-auto max-h-[60vh]",children:[(0,n.jsx)("h3",{className:"text-[11px] font-semibold uppercase tracking-widest text-teal-600 dark:text-teal-400",children:"Text-to-Speech"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-xs font-medium text-zinc-700 dark:text-zinc-300 mb-1",children:"ElevenLabs API Key"}),(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("input",{type:d?"text":"password",value:i,onChange:e=>l(e.target.value),placeholder:"sk_...",className:"w-full rounded-lg border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-900 dark:text-zinc-100 placeholder:text-zinc-400 dark:placeholder:text-zinc-500 focus:outline-none focus:ring-2 focus:ring-emerald-500/30 focus:border-emerald-500 pr-10"}),(0,n.jsx)("button",{type:"button",onClick:()=>u(e=>!e),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-zinc-400 dark:text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors",title:d?"Hide key":"Show key",children:d?(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"})}):(0,n.jsxs)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:[(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}),(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})})]}),(0,n.jsxs)("p",{className:"mt-1 text-[11px] text-zinc-400 dark:text-zinc-400",children:["Get your key at"," ",(0,n.jsx)("a",{href:"https://elevenlabs.io/app/settings/api-keys",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 text-teal-500 hover:text-teal-600",children:"elevenlabs.io/app/settings"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-xs font-medium text-zinc-700 dark:text-zinc-300 mb-1",children:"Voice ID"}),(0,n.jsx)("input",{type:"text",value:a,onChange:e=>o(e.target.value),placeholder:"UgBBYS2sOqTuMpoF3BR0",className:"w-full rounded-lg border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-900 dark:text-zinc-100 placeholder:text-zinc-400 dark:placeholder:text-zinc-500 focus:outline-none focus:ring-2 focus:ring-emerald-500/30 focus:border-emerald-500"}),(0,n.jsxs)("p",{className:"mt-1 text-[11px] text-zinc-400 dark:text-zinc-400",children:["Default: Mark - Natural Conversations. Find voice IDs in the"," ",(0,n.jsx)("a",{href:"https://elevenlabs.io/app/voice-library",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 text-teal-500 hover:text-teal-600",children:"ElevenLabs Voice Library"}),"."]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-xs font-medium text-zinc-700 dark:text-zinc-300 mb-1",children:"Model"}),(0,n.jsxs)("select",{value:s,onChange:e=>c(e.target.value),className:"w-full rounded-lg border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-800 px-3 py-2 text-sm text-zinc-900 dark:text-zinc-100 focus:outline-none focus:ring-2 focus:ring-emerald-500/30 focus:border-emerald-500",children:[(0,n.jsx)("option",{value:"eleven_flash_v2_5",children:"Flash v2.5 (default, fastest & cheapest)"}),(0,n.jsx)("option",{value:"eleven_turbo_v2_5",children:"Turbo v2.5 (fast, good quality)"}),(0,n.jsx)("option",{value:"eleven_multilingual_v2",children:"Multilingual v2 (highest quality)"})]})]}),(0,n.jsxs)("div",{className:"border-t border-zinc-100 dark:border-zinc-800 pt-4",children:[(0,n.jsx)("h3",{className:"text-[11px] font-semibold uppercase tracking-widest text-teal-600 dark:text-teal-400 mb-2",children:"Public API"}),(0,n.jsxs)("p",{className:"text-xs text-zinc-500 dark:text-zinc-400 leading-relaxed",children:["Heartbeads exposes a read-only REST API for AI agents, CI/CD bots, and integrations."," ",f?"API requests require the dashboard password as a Bearer token. ":"No authentication required. ",(0,n.jsx)("a",{href:"/api/docs",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 text-teal-500 hover:text-teal-600",children:"View API documentation"})]})]}),f&&(0,n.jsxs)("div",{className:"border-t border-zinc-100 dark:border-zinc-800 pt-4",children:[(0,n.jsx)("h3",{className:"text-[11px] font-semibold uppercase tracking-widest text-teal-600 dark:text-teal-400 mb-2",children:"Dashboard Access"}),(0,n.jsxs)("p",{className:"text-xs text-zinc-500 dark:text-zinc-400 leading-relaxed mb-3",children:["This instance is password-protected. The"," ",(0,n.jsx)("span",{className:"font-medium text-zinc-600 dark:text-zinc-400",children:"Sign In"})," ","button in the navbar is for"," ",(0,n.jsx)("span",{className:"font-medium text-zinc-600 dark:text-zinc-400",children:"ATProto/Bluesky"})," ","— used for posting comments, likes, and claiming tasks. The dashboard password controls who can view the graph and access the API."]}),(0,n.jsxs)("button",{onClick:m,type:"button",className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-lg border border-zinc-200 dark:border-zinc-700 text-xs font-medium text-zinc-600 dark:text-zinc-400 hover:bg-zinc-50 dark:hover:bg-zinc-800 hover:border-zinc-300 dark:hover:border-zinc-600 transition-colors",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})}),"Lock dashboard"]})]})]}),(0,n.jsxs)("div",{className:"flex items-center justify-end gap-2 px-5 py-3.5 border-t border-zinc-100 dark:border-zinc-800",children:[(0,n.jsx)("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 rounded-lg hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors",children:"Cancel"}),(0,n.jsx)("button",{onClick:g,className:"px-4 py-2 text-sm font-medium text-white rounded-lg bg-emerald-500 hover:bg-emerald-600 transition-colors",children:"Save"})]})]})}),document.body):null}function lf({node:e,onShowDescription:t,onAddComment:i,onClaimTask:l,onUnclaimTask:a,onCollapseEpic:o,onUncollapseEpic:s,onFocusEpic:c,onExitFocusEpic:d,onClose:u}){return(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&u()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[u]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"fixed inset-0 z-[99] bg-black/30",onClick:u}),(0,n.jsxs)("div",{className:"fixed inset-x-0 bottom-0 z-[100] bg-white dark:bg-zinc-900 rounded-t-2xl shadow-2xl max-h-[70vh] overflow-y-auto animate-slide-up-sheet",children:[(0,n.jsx)("div",{className:"w-10 h-1 bg-zinc-300 dark:bg-zinc-700 rounded-full mx-auto mt-3 mb-2"}),(0,n.jsxs)("div",{className:"px-5 py-3 border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsx)("div",{className:"flex items-center gap-2",children:(0,n.jsx)("span",{className:"text-[11px] font-mono text-zinc-400 dark:text-zinc-400",children:e.id})}),(0,n.jsx)("div",{className:"text-sm font-medium text-zinc-700 dark:text-zinc-300 truncate mt-0.5",children:e.title})]}),(0,n.jsxs)("div",{className:"py-1",children:[t&&(0,n.jsxs)("button",{onClick:t,className:"w-full flex items-center gap-3 px-5 py-4 text-sm font-medium text-zinc-700 dark:text-zinc-300 active:bg-zinc-50 dark:active:bg-zinc-800 transition-colors",children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),"Show description"]}),(0,n.jsxs)("button",{onClick:i,className:"w-full flex items-center gap-3 px-5 py-4 text-sm font-medium text-zinc-700 dark:text-zinc-300 active:bg-zinc-50 dark:active:bg-zinc-800 transition-colors",children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 20.25c4.97 0 9-3.694 9-8.25s-4.03-8.25-9-8.25S3 7.444 3 12c0 2.104.859 4.023 2.273 5.48.432.447.74 1.04.586 1.641a4.483 4.483 0 01-.923 1.785A5.969 5.969 0 006 21c1.282 0 2.47-.402 3.445-1.087.81.22 1.668.337 2.555.337z"})}),"Add comment"]}),l&&(0,n.jsxs)("button",{onClick:l,className:"w-full flex items-center gap-3 px-5 py-4 text-sm font-medium text-zinc-700 dark:text-zinc-300 active:bg-zinc-50 dark:active:bg-zinc-800 transition-colors",children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})}),"Claim task"]}),a&&(0,n.jsxs)("button",{onClick:a,className:"w-full flex items-center gap-3 px-5 py-4 text-sm font-medium text-red-500 active:bg-red-50 dark:active:bg-red-950 transition-colors",children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-red-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M22 10.5h-6m-2.25-4.125a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zM4 19.235v-.11a6.375 6.375 0 0112.75 0v.109A12.318 12.318 0 0110.374 21c-2.331 0-4.512-.645-6.374-1.766z"})}),"Unclaim task"]}),o&&(0,n.jsxs)("button",{onClick:o,className:"w-full flex items-center gap-3 px-5 py-4 text-sm font-medium text-zinc-700 dark:text-zinc-300 active:bg-zinc-50 dark:active:bg-zinc-800 transition-colors",children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"})}),"Collapse epic"]}),s&&(0,n.jsxs)("button",{onClick:s,className:"w-full flex items-center gap-3 px-5 py-4 text-sm font-medium text-zinc-700 dark:text-zinc-300 active:bg-zinc-50 dark:active:bg-zinc-800 transition-colors",children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})}),"Uncollapse epic"]}),c&&(0,n.jsxs)("button",{onClick:c,className:"w-full flex items-center gap-3 px-5 py-4 text-sm font-medium text-zinc-700 dark:text-zinc-300 active:bg-zinc-50 dark:active:bg-zinc-800 transition-colors",children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 3.75H6A2.25 2.25 0 003.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0120.25 6v1.5M16.5 20.25H18A2.25 2.25 0 0020.25 18v-1.5M7.5 20.25H6A2.25 2.25 0 013.75 18v-1.5"})}),"Focus on epic"]}),d&&(0,n.jsxs)("button",{onClick:d,className:"w-full flex items-center gap-3 px-5 py-4 text-sm font-medium text-emerald-600 dark:text-emerald-400 active:bg-emerald-50 dark:active:bg-emerald-950 transition-colors",children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-emerald-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})}),"Show full graph"]})]}),(0,n.jsx)("div",{className:"border-t border-zinc-100 dark:border-zinc-800",children:(0,n.jsx)("button",{onClick:u,className:"w-full py-4 text-sm font-medium text-zinc-400 dark:text-zinc-400 active:bg-zinc-50 dark:active:bg-zinc-800 transition-colors",children:"Cancel"})}),(0,n.jsx)("div",{className:"h-[env(safe-area-inset-bottom)]"})]})]})}let lx={assigned:"📋",closed:"✅",commented:"💬",claimed:"🙋",liked:"❤️"},lm={assigned:"Assigned to",closed:"Closed",commented:"Commented on",claimed:"Claimed",liked:"Liked a comment on"};function lg({isOpen:e,onClose:t,profile:r,onNodeNavigate:i}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("aside",{className:`hidden md:flex absolute top-0 right-0 h-full w-[360px] bg-white dark:bg-zinc-900 border-l border-zinc-200 dark:border-zinc-700 flex-col shadow-xl dark:shadow-2xl dark:shadow-black/20 z-30 transform transition-transform duration-300 ease-out ${e?"translate-x-0":"translate-x-full"}`,children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-zinc-100 dark:border-zinc-800 shrink-0",children:[(0,n.jsx)("h2",{className:"text-xs font-semibold text-zinc-400 dark:text-zinc-400 uppercase tracking-wider",children:"Profile"}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-zinc-400 dark:text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 rounded-full hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar",children:r&&(0,n.jsx)(lk,{profile:r,onNodeNavigate:i})})]}),(0,n.jsx)("div",{className:`md:hidden fixed inset-x-0 bottom-0 transform transition-transform duration-300 ease-out z-20 ${e?"translate-y-0":"translate-y-full"}`,children:(0,n.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-t-2xl shadow-2xl border-t border-zinc-200 dark:border-zinc-700 max-h-[70vh] flex flex-col",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-zinc-100 dark:border-zinc-800 shrink-0",children:[(0,n.jsx)("h2",{className:"text-xs font-semibold text-zinc-400 dark:text-zinc-400 uppercase tracking-wider",children:"Profile"}),(0,n.jsx)("button",{onClick:t,className:"p-1 text-zinc-400 dark:text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 rounded-full hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar",children:r&&(0,n.jsx)(lk,{profile:r,onNodeNavigate:i})})]})})]})}function lk({profile:e,onNodeNavigate:t}){let r=0===e.assignedCount&&0===e.closedCount&&0===e.claimedCount&&0===e.commentCount&&0===e.likeCount&&0===e.projects.length&&0===e.recentActivity.length;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"px-5 pt-4 pb-3 border-b border-zinc-100 dark:border-zinc-800",children:(0,n.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[e.avatar?(0,n.jsx)("img",{src:e.avatar,alt:e.handle,className:"w-12 h-12 rounded-full object-cover"}):(0,n.jsx)("div",{className:"w-12 h-12 rounded-full bg-zinc-200 dark:bg-zinc-800 flex items-center justify-center text-zinc-500 dark:text-zinc-400 text-lg font-semibold",children:e.handle.charAt(0).toUpperCase()}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:e.handle}),e.lastActiveAt&&(0,n.jsxs)("div",{className:"text-xs text-zinc-400 dark:text-zinc-400",children:["Active ",ih(e.lastActiveAt)]})]})]})}),r?(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,n.jsx)("p",{className:"text-sm text-zinc-400 dark:text-zinc-500",children:"No activity yet"}),(0,n.jsx)("p",{className:"text-xs text-zinc-300 dark:text-zinc-600 mt-1",children:"This user hasn't contributed to any projects yet"})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"px-5 py-3 border-b border-zinc-100 dark:border-zinc-800",children:(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,n.jsx)(lb,{label:"Assigned",value:e.assignedCount,color:"#1e66f5"}),(0,n.jsx)(lb,{label:"Closed",value:e.closedCount,color:"#40a02b"}),(0,n.jsx)(lb,{label:"Comments",value:e.commentCount,color:"#8839ef"}),(0,n.jsx)(lb,{label:"Likes given",value:e.likeCount,color:"#ea76cb"})]})}),(0,n.jsxs)("div",{className:"px-5 py-3 border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsx)("h3",{className:"text-[11px] font-semibold text-zinc-400 dark:text-zinc-400 uppercase tracking-wider mb-2",children:"Projects"}),0===e.projects.length?(0,n.jsx)("p",{className:"text-xs text-zinc-400 dark:text-zinc-400 italic",children:"No projects"}):(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.projects.map(e=>(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-full text-[11px] font-medium",style:{backgroundColor:e.color+"15",color:e.color,border:`1px solid ${e.color}25`},children:[(0,n.jsx)("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:e.color}}),e.prefixLabel,(0,n.jsxs)("span",{className:"text-zinc-400 font-normal",children:["(",e.count,")"]})]},e.prefix))})]}),(0,n.jsxs)("div",{className:"px-5 py-3",children:[(0,n.jsx)("h3",{className:"text-[11px] font-semibold text-zinc-400 dark:text-zinc-400 uppercase tracking-wider mb-2",children:"Recent Activity"}),0===e.recentActivity.length?(0,n.jsx)("p",{className:"text-xs text-zinc-400 dark:text-zinc-400 italic",children:"No activity"}):(0,n.jsx)("div",{className:"space-y-2",children:e.recentActivity.map((e,r)=>(0,n.jsxs)("div",{className:"flex items-start gap-2 text-xs",children:[(0,n.jsx)("span",{className:"mt-0.5",children:lx[e.type]}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsxs)("span",{className:"text-zinc-600 dark:text-zinc-400",children:[lm[e.type]," ",(0,n.jsx)("button",{onClick:()=>t(e.nodeId),className:"font-mono text-emerald-600 dark:text-emerald-400 hover:text-emerald-700 dark:hover:text-emerald-300 hover:underline",children:e.nodeId})]}),e.detail&&(0,n.jsx)("p",{className:"text-zinc-400 dark:text-zinc-400 truncate mt-0.5",children:e.detail}),(0,n.jsx)("div",{className:"text-zinc-300 dark:text-zinc-500 mt-0.5",children:ih(e.time)})]})]},r))})]})]})]})}function lb({label:e,value:t,color:r}){return(0,n.jsxs)("div",{className:"bg-zinc-50 dark:bg-zinc-800 rounded-lg px-3 py-2",children:[(0,n.jsx)("div",{className:"text-lg font-semibold",style:{color:r},children:t}),(0,n.jsx)("div",{className:"text-[11px] text-zinc-400 dark:text-zinc-400",children:e})]})}let lv=new Map,ly=new Map;async function lw(e){let t=lv.get(e);if(t)return t;let n=ly.get(e);if(n)return n;let r=(async()=>{try{let t=await fetch(`https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=${encodeURIComponent(e)}`);if(!t.ok)throw Error(`Profile fetch failed: ${t.status}`);let n=await t.json(),r={did:e,handle:n.handle||e,displayName:n.displayName||void 0,avatar:n.avatar||void 0};return lv.set(e,r),r}catch{let t={did:e,handle:e.slice(0,20)+"..."};return lv.set(e,t),t}finally{ly.delete(e)}})();return ly.set(e,r),r}let lj=t.default.env.INDEXER_URL||"https://hypergoat-app-production.up.railway.app/graphql",lz=`
6
6
  query FetchRecords($collection: String!, $first: Int, $after: String) {
7
7
  records(collection: $collection, first: $first, after: $after) {
8
8
  edges {
@@ -21,4 +21,4 @@
21
21
  }
22
22
  }
23
23
  }
24
- `;async function lN(e){let t,n=[],r=!0,i=0;for(;r&&i<5;){let l=await fetch(lj,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:lz,variables:{collection:e,first:100,after:t}})});if(!l.ok)throw Error(`Indexer fetch failed: ${l.status}`);let a=await l.json();if(a.errors?.length)throw Error(a.errors[0].message);let o=a.data?.records;if(!o)break;for(let e of o.edges)n.push(e.node);r=o.pageInfo.hasNextPage,t=o.pageInfo.endCursor,i++}return n}async function lC(){let[e,t]=await Promise.all([lN("org.impactindexer.review.comment"),lN("org.impactindexer.review.like")]),n=e.filter(e=>{let t=e.value.subject;return t?.uri&&"string"==typeof t.uri&&t.uri.startsWith("beads:")}),r=new Map;for(let e of t){let t=e.value.subject;if(t?.uri&&"string"==typeof t.uri&&t.uri.startsWith("at://")){let n=r.get(t.uri)||[];n.push(e),r.set(t.uri,n)}}let i=new Set;for(let e of n)i.add(e.did);for(let e of t)i.add(e.did);let l=new Map((await Promise.all([...i].map(e=>lw(e)))).map(e=>[e.did,e])),a=[];for(let e of n){let t=e.value,n=t.subject.uri.replace(/^beads:/,""),i=t.text||"",o=t.createdAt||"",s=t.replyTo||void 0,c=l.get(e.did),d=(r.get(e.uri)||[]).map(e=>{let t=l.get(e.did),n=e.value;return{did:e.did,handle:t?.handle||e.did.slice(0,20)+"...",displayName:t?.displayName,avatar:t?.avatar,createdAt:n.createdAt||"",uri:e.uri,rkey:e.rkey}}),u={did:e.did,handle:c?.handle||e.did.slice(0,20)+"...",displayName:c?.displayName,avatar:c?.avatar,text:i,createdAt:o,uri:e.uri,rkey:e.rkey,nodeId:n,replyTo:s,likes:d,replies:[]};a.push(u)}let o=new Map;for(let e of a)o.set(e.uri,e);let s=[];for(let e of a){if(e.replyTo){let t=o.get(e.replyTo);if(t){t.replies.push(e);continue}}s.push(e)}s.sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()),!function e(t){for(let n of t)n.replies.sort((e,t)=>new Date(e.createdAt).getTime()-new Date(t.createdAt).getTime()),e(n.replies)}(s);let c=new Map;for(let e of s){let t=c.get(e.nodeId)||[];t.push(e),c.set(e.nodeId,t)}let d=new Map;for(let e of a)d.set(e.nodeId,(d.get(e.nodeId)||0)+1);return{commentsByNode:c,commentedNodeIds:d,allComments:[...a].sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime())}}let lS="node",lM="profile",lL="panel",lA="epic",lT="color",lE="collapsed",lD="filters",lI="selected",lP="replay",lF=new Set(["comments","activity","help","leaderboard"]),lR=new Set(["status","priority","type","owner","assignee","prefix"]);function lB(){let e=new URLSearchParams(window.location.search),t=e.get(lL),n=e.get(lT),r=e.get(lE),i=e.get(lD),l=e.get(lI),a=e.get(lP);return{node:e.get(lS)||null,profile:e.get(lM)||null,panel:t&&lF.has(t)?t:null,epic:e.get(lA)||null,color:n&&lR.has(n)?n:"status",collapsed:r?new Set(r.split(",").filter(Boolean)):new Set,filters:i?new Set(i.split(",").filter(Boolean)):new Set,selected:l?new Set(l.split(",").filter(Boolean)):new Set,replay:"1"===a}}function lO(e){let t=new URLSearchParams(window.location.search),n=(e,n)=>{n?t.set(e,n):t.delete(e)};"node"in e&&n(lS,e.node),"profile"in e&&n(lM,e.profile),"panel"in e&&n(lL,e.panel),"epic"in e&&n(lA,e.epic),"color"in e&&n(lT,"status"===e.color?null:e.color),"collapsed"in e&&n(lE,e.collapsed&&e.collapsed.size>0?[...e.collapsed].join(","):null),"filters"in e&&n(lD,e.filters&&e.filters.size>0?[...e.filters].join(","):null),"selected"in e&&n(lI,e.selected&&e.selected.size>0?[...e.selected].join(","):null),"replay"in e&&n(lP,e.replay?"1":null),"node"in e&&e.node&&(t.delete(lM),t.delete(lL)),"profile"in e&&e.profile&&(t.delete(lS),t.delete(lL)),"panel"in e&&e.panel&&(t.delete(lS),t.delete(lM));let r=t.toString(),i=r?`?${r}`:window.location.pathname;window.history.replaceState(null,"",i)}function l$({totalSteps:e,currentStep:t,currentTime:i,isPlaying:l,speed:a,onStepChange:o,onPlayPause:s,onSpeedChange:c}){let d=(0,r.useCallback)(e=>{o(Number(e.target.value))},[o]),u=(0,r.useCallback)(()=>{c(1===a?2:2===a?4:1)},[a,c]),h=e>1;return(0,n.jsx)("div",{className:"bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm rounded-lg border border-zinc-200 dark:border-zinc-700 shadow-sm px-3 py-2 min-w-[280px] max-w-[480px]",children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("button",{onClick:s,disabled:!h,className:`shrink-0 w-6 h-6 flex items-center justify-center rounded transition-colors ${l?"text-emerald-500 hover:text-emerald-600":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200"} disabled:opacity-40 disabled:cursor-not-allowed`,children:l?(0,n.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"currentColor",children:[(0,n.jsx)("rect",{x:"3",y:"2",width:"3.5",height:"12",rx:"1"}),(0,n.jsx)("rect",{x:"9.5",y:"2",width:"3.5",height:"12",rx:"1"})]}):(0,n.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"currentColor",children:(0,n.jsx)("path",{d:"M4 2l10 6-10 6V2z"})})}),(0,n.jsx)("input",{type:"range",min:0,max:Math.max(e-1,0),value:t,onChange:d,disabled:!h,className:"timeline-slider flex-1 h-4 disabled:opacity-40"}),(0,n.jsxs)("span",{className:"shrink-0 text-xs text-zinc-500 dark:text-zinc-400 font-medium text-right whitespace-nowrap",children:[(0,n.jsxs)("span",{className:"text-zinc-400 dark:text-zinc-500",children:[t+1,"/",e]})," ",new Date(i).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]}),(0,n.jsxs)("button",{onClick:u,className:`shrink-0 px-1.5 py-0.5 text-[10px] font-semibold rounded transition-colors ${a>1?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 border border-zinc-200 dark:border-zinc-700 hover:text-zinc-700 dark:hover:text-zinc-200"}`,children:[a,"x"]})]})})}function l_(e,t,n){let r=Date.now(),i=new Map(e.graphData.nodes.map(e=>[e.id,e])),l=new Set(e.graphData.links.map(g)),a=t.graphData.nodes.map(e=>{let l=i.get(e.id);if(!l){let n=function(e,t,n){for(let r of t){let t="object"==typeof r.source?r.source.id:r.source,i="object"==typeof r.target?r.target.id:r.target;if(t===e&&n.has(i)){let e=n.get(i);if(null!=e.x&&null!=e.y)return{x:e.x,y:e.y}}if(i===e&&n.has(t)){let e=n.get(t);if(null!=e.x&&null!=e.y)return{x:e.x,y:e.y}}}return null}(e.id,t.graphData.links,i);return{...e,_spawnTime:r,x:n?n.x+(Math.random()-.5)*40:void 0,y:n?n.y+(Math.random()-.5)*40:void 0}}let a={...e,x:l.x,y:l.y,fx:l.fx,fy:l.fy};if(n.changedNodes.has(e.id)){let t=n.changedNodes.get(e.id).find(e=>"status"===e.field);t&&(a._changedAt=r,a._prevStatus=t.from)}return a});for(let e of n.removedNodeIds){let t=i.get(e);t&&a.push({...t,_removeTime:r})}let o=t.graphData.links.map(e=>{let t=g(e);return l.has(t)?e:{...e,_spawnTime:r}});for(let t of n.removedLinkKeys){let n=e.graphData.links.find(e=>g(e)===t);n&&o.push({source:"object"==typeof n.source?n.source.id:n.source,target:"object"==typeof n.target?n.target.id:n.target,type:n.type,_removeTime:r})}return{...t,graphData:{nodes:a,links:o}}}let lW={open:"bg-emerald-500",in_progress:"bg-amber-500",blocked:"bg-red-500",deferred:"bg-violet-500",closed:"bg-zinc-400"};function lH(){let e,t,i,l,a,o,s,c,d,u,h,[x,m]=(0,r.useState)(null),[g,b]=(0,r.useState)(!0),[v,y]=(0,r.useState)(null),[w,j]=(0,r.useState)(null),[z,N]=(0,r.useState)(new Set),[C,S]=(0,r.useState)(new Set),[M,L]=(0,r.useState)(null),[A,T]=(0,r.useState)("status"),[E,D]=(0,r.useState)(new Set),[I,P]=(0,r.useState)("Beads"),[F,R]=(0,r.useState)(0),[O,$]=(0,r.useState)({}),{isAuthenticated:_,session:W}=(0,iO.useAuth)(),{theme:H,toggleTheme:U}=function(){let[e,t]=(0,r.useState)("light"),[n,i]=(0,r.useState)(!1);(0,r.useEffect)(()=>{i(!0);let e=localStorage.getItem("heartbeads-theme")||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");t(e),document.documentElement.classList.toggle("dark","dark"===e)},[]);let l=(0,r.useCallback)(e=>{t(e),localStorage.setItem("heartbeads-theme",e),document.documentElement.classList.toggle("dark","dark"===e)},[]),a=(0,r.useCallback)(()=>{l("dark"===e?"light":"dark")},[e,l]);return{theme:e,setTheme:l,toggleTheme:a,mounted:n}}(),{commentsByNode:V,commentedNodeIds:q,allComments:Y,refetch:X}=function(){let[e,t]=(0,r.useState)(new Map),[n,i]=(0,r.useState)(new Map),[l,a]=(0,r.useState)([]),[o,s]=(0,r.useState)(!0),[c,d]=(0,r.useState)(null),u=(0,r.useRef)(!1),h=(0,r.useCallback)(async()=>{try{s(!0),d(null);let e=await lC();u.current||(t(e.commentsByNode),i(e.commentedNodeIds),a(e.allComments))}catch(e){if(!u.current){let t=e instanceof Error?e.message:"Failed to fetch comments";console.error("Failed to fetch beads comments:",e),d(t)}}finally{u.current||s(!1)}},[]);return(0,r.useEffect)(()=>(u.current=!1,h(),()=>{u.current=!0}),[h]),{commentsByNode:e,commentedNodeIds:n,allComments:l,isLoading:o,error:c,refetch:h}}(),K=(e=(0,r.useRef)(lB()),t=(0,r.useCallback)(e=>{lO({node:e,profile:null,panel:null})},[]),i=(0,r.useCallback)(e=>{lO({profile:e,node:null,panel:null})},[]),l=(0,r.useCallback)(e=>{lO({panel:e,node:null,profile:null})},[]),a=(0,r.useCallback)(e=>{lO({epic:e})},[]),o=(0,r.useCallback)(e=>{lO({color:e})},[]),s=(0,r.useCallback)(e=>{lO({collapsed:e})},[]),c=(0,r.useCallback)(e=>{lO({filters:e})},[]),d=(0,r.useCallback)(e=>{lO({selected:e})},[]),u=(0,r.useCallback)(e=>{lO({replay:e})},[]),h=(0,r.useCallback)(()=>{window.history.replaceState(null,"",window.location.pathname)},[]),{...(0,r.useMemo)(()=>lB(),[]),initial:e.current,setNode:t,setProfile:i,setPanel:l,setEpic:a,setColor:o,setCollapsed:s,setFilters:c,setSelected:d,setReplay:u,clear:h}),[G,J]=(0,r.useState)(new Map),[Q,Z]=(0,r.useState)(new Set),[ee,et]=(0,r.useState)(!1),[en,er]=(0,r.useState)(0),[ei,el]=(0,r.useState)(!1),[ea,eo]=(0,r.useState)(1),[es,ec]=(0,r.useState)(null);(0,r.useEffect)(()=>{D(new Set)},[A]);let ed=(0,r.useMemo)(()=>x?new Set(x.graphData.nodes.map(e=>e.id)):new Set,[x]),eu=(0,r.useMemo)(()=>{let e=new Map;if(Y)for(let t of Y){if(!ed.has(t.nodeId)||e.has(t.nodeId)||Q.has(t.nodeId))continue;let n=t.text.trim();n.startsWith("@")&&-1===n.indexOf(" ")&&e.set(t.nodeId,{avatar:t.avatar,handle:t.handle,claimedAt:t.createdAt,did:t.did,rkey:t.rkey})}for(let[t,n]of G)e.has(t)||Q.has(t)||e.set(t,n);return e},[Y,G,Q,ed]),eh=(0,r.useMemo)(()=>{let e=new Map;if(!x||ee&&!es)return e;let t=new Map;for(let e of ee&&es?es.graphData.nodes:x.graphData.nodes)e.assignee&&e.assignee.includes(".")&&(eu.has(e.id)||(t.has(e.assignee)||t.set(e.assignee,[]),t.get(e.assignee).push(e)));for(let[n,r]of t){r.sort((e,t)=>{let n=t.updatedAt.localeCompare(e.updatedAt);return 0!==n?n:"closed"!==e.status&&"closed"===t.status?-1:"closed"===e.status&&"closed"!==t.status?1:e.id.localeCompare(t.id)});let t=r[0];e.set(t.id,{handle:n,avatar:void 0,updatedAt:t.updatedAt})}return e},[x,eu,ee,es]),[ep,ef]=(0,r.useState)(new Map);(0,r.useEffect)(()=>{if(0===eh.size)return;let e=new AbortController,t=[];for(let[,e]of eh)ep.has(e.handle)||t.push(e.handle);if(0===t.length)return;let n=[];for(let e=0;e<t.length;e+=5)n.push(t.slice(e,e+5));async function r(t){let n=t.map(async t=>{try{let n=await fetch(`https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=${encodeURIComponent(t)}`,{signal:e.signal});if(!n.ok)return null;let r=await n.json();return{handle:t,avatar:r.avatar}}catch(e){return null}}),r=await Promise.allSettled(n),i=new Map;for(let e of r)"fulfilled"===e.status&&e.value&&e.value.avatar&&i.set(e.value.handle,e.value.avatar);return i}return(async()=>{for(let e of n){let t=await r(e);t.size>0&&ef(e=>new Map([...e,...t]))}})(),()=>e.abort()},[eh]);let ex=(0,r.useMemo)(()=>{let e=new Map(eh);for(let[t,n]of e){let r=ep.get(n.handle);r&&e.set(t,{...n,avatar:r})}return e},[eh,ep]),em=(0,r.useMemo)(()=>{if(!x)return[];let e=x.graphData.nodes,t=new Map,n=e=>{if(!e)return null;let n=t.get(e);return n||(n={handle:e,createdCount:0,closedCount:0,commentCount:0},t.set(e,n)),n};for(let t of e){let e=t.createdBy||t.owner||t.assignee;if(e){let t=n(e);t&&t.createdCount++}if("closed"===t.status&&t.assignee){let e=n(t.assignee);e&&e.closedCount++}}if(Y){for(let e of Y)if(ed.has(e.nodeId)&&!(e.text.startsWith("@")&&-1===e.text.trim().indexOf(" "))){let t=n(e.handle);t&&(t.commentCount++,e.avatar&&!t.avatar&&(t.avatar=e.avatar),e.did&&!t.did&&(t.did=e.did))}}for(let[,e]of ex){let n=t.get(e.handle);n&&e.avatar&&!n.avatar&&(n.avatar=e.avatar)}for(let[e,n]of ep){let r=t.get(e);r&&!r.avatar&&(r.avatar=n)}let r=[];for(let e of t.values()){let t=3*e.closedCount+e.createdCount+e.commentCount;t>0&&r.push({...e,score:t})}return r.sort((e,t)=>t.score-e.score),r},[x,Y,ex,ep,ed]),[eg,ek]=(0,r.useState)(!1),[eb,ev]=(0,r.useState)(null),[ey,ew]=(0,r.useState)([]),[ej,ez]=(0,r.useState)(!1),[eN,eC]=(0,r.useState)(!0),[eS,eM]=(0,r.useState)(!1),[eL,eA]=(0,r.useState)(null),[eT,eE]=(0,r.useState)(!1),[eD,eI]=(0,r.useState)(!0),eP=iL(),eF=(0,r.useRef)(!1);(0,r.useEffect)(()=>{eF.current=eP},[eP]);let[eR,eB]=(0,r.useState)(!1),[eO,e$]=(0,r.useState)(null);(0,r.useEffect)(()=>{eI(eP),eC(eP)},[eP]),(0,r.useEffect)(()=>{if(!x)return;let e=Y?Y.filter(e=>ed.has(e.nodeId)):null,t=function(e,t,n){let r=[],i=new Set;function l(e){i.has(e.id)||(i.add(e.id),r.push(e))}for(let t of e){if(t.createdAt){let e=new Date(t.createdAt).getTime();isNaN(e)||l({id:`node-created:${t.id}:${e}`,type:"node-created",time:e,nodeId:t.id,nodeTitle:t.title,actor:t.createdBy?{handle:t.createdBy}:t.owner?{handle:t.owner}:t.assignee?{handle:t.assignee}:void 0,detail:t.issueType,meta:{issueType:t.issueType,prefix:t.prefix}})}if(t.closedAt){let e=new Date(t.closedAt).getTime();isNaN(e)||l({id:`node-closed:${t.id}:${e}`,type:"node-closed",time:e,nodeId:t.id,nodeTitle:t.title,actor:t.owner?{handle:t.owner}:t.createdBy?{handle:t.createdBy}:t.assignee?{handle:t.assignee}:void 0,detail:t.closeReason||"Closed",meta:{prefix:t.prefix}})}}for(let n of t)if(n.createdAt){let t=new Date(n.createdAt).getTime();if(!isNaN(t)){let r="object"==typeof n.source?n.source.id:n.source,i="object"==typeof n.target?n.target.id:n.target,a=e.find(e=>e.id===r);l({id:`link-added:${r}->${i}:${t}`,type:"link-added",time:t,nodeId:r,actor:a?.assignee?{handle:a.assignee}:void 0,detail:`${n.type} ${i}`,meta:{linkType:n.type,target:i}})}}if(n)for(let e of n){let t=new Date(e.createdAt).getTime();if(isNaN(t))continue;let n={handle:e.handle,avatar:e.avatar,did:e.did};for(let r of(l(e.text.startsWith("@")&&-1===e.text.trim().indexOf(" ")?{id:`task-claimed:${e.nodeId}:${t}`,type:"task-claimed",time:t,nodeId:e.nodeId,actor:n,detail:e.text}:e.replyTo?{id:`reply-added:${e.nodeId}:${e.rkey}`,type:"reply-added",time:t,nodeId:e.nodeId,actor:n,detail:e.text.length>80?e.text.slice(0,80)+"...":e.text}:{id:`comment-added:${e.nodeId}:${e.rkey}`,type:"comment-added",time:t,nodeId:e.nodeId,actor:n,detail:e.text.length>80?e.text.slice(0,80)+"...":e.text}),e.likes)){let t=new Date(r.createdAt).getTime();isNaN(t)||l({id:`like-added:${e.nodeId}:${r.rkey}`,type:"like-added",time:t,nodeId:e.nodeId,actor:{handle:r.handle,avatar:r.avatar,did:r.did},detail:`Liked comment by ${e.handle}`})}}return r.sort((e,t)=>t.time-e.time),r}(x.graphData.nodes,x.graphData.links,e);ew(e=>i5(e,t))},[x,Y,ed]),(0,r.useEffect)(()=>{if(0===ey.length)return;let e=new Map;if(Y)for(let t of Y)for(let n of(t.avatar&&t.handle&&e.set(t.handle,t.avatar),t.likes))n.avatar&&n.handle&&e.set(n.handle,n.avatar);let t=!1,n=new Map;for(let[r,i]of e)ep.has(r)||(n.set(r,i),t=!0);let r=new Set;for(let e of ey)if(e.actor&&!e.actor.avatar&&e.actor.handle){let t=e.actor.handle;if(ep.has(t)||n.has(t))continue;t.includes(".")&&!t.includes("@")&&r.add(t)}if(t&&0===r.size)return void ef(e=>new Map([...e,...n]));if(0===r.size){let e=!1,t=new Map([...ep,...n]),r=ey.map(n=>{if(n.actor&&!n.actor.avatar&&n.actor.handle){let r=t.get(n.actor.handle);if(r)return e=!0,{...n,actor:{...n.actor,avatar:r}}}return n});e&&ew(r);return}let i=new AbortController,l=[...r];return(async()=>{let e=new Map(n);for(let t=0;t<l.length;t+=5){let n=l.slice(t,t+5).map(async e=>{try{let t=await fetch(`https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=${encodeURIComponent(e)}`,{signal:i.signal});if(!t.ok)return null;let n=await t.json();return n.avatar?{handle:e,avatar:n.avatar}:null}catch{return null}});for(let t of(await Promise.allSettled(n)))"fulfilled"===t.status&&t.value&&e.set(t.value.handle,t.value.avatar)}e.size>0&&ef(t=>new Map([...t,...e]))})(),()=>i.abort()},[ey,ep,Y]);let[e_,eW]=(0,r.useState)(null),[eH,eU]=(0,r.useState)(null),[eV,eq]=(0,r.useState)(null),[eY,eX]=(0,r.useState)(!1),[eK,eG]=(0,r.useState)(null),[eJ,eQ]=(0,r.useState)(null),[eZ,e0]=(0,r.useState)(!1),[e1,e5]=(0,r.useState)(""),[e2,e4]=(0,r.useState)(0),[e3,e6]=(0,r.useState)(!0),[e8,e7]=(0,r.useState)(!0),[e9,te]=(0,r.useState)(!0),tt=(0,r.useRef)(null),tn=(0,r.useRef)(null),tr=(0,r.useRef)(null),ti=(0,r.useRef)(!1);(0,r.useEffect)(()=>{let e=null,t=null,n=null,r=!0;return!function i(){(e=new EventSource("/api/beads/stream")).onmessage=e=>{if(r)try{let t=JSON.parse(e.data);if(t.error){y(t.error),b(!1);return}let n=tr.current,r=k(n,t);if(!n){tr.current=t,m(t),b(!1);return}if(!r.hasChanges)return;let i=function(e,t){let n=[],r=Date.now(),i=new Map(t.map(e=>[e.id,e]));for(let t of e.addedNodeIds){let e=i.get(t);n.push({id:`node-created:${t}:${r}`,type:"node-created",time:r,nodeId:t,nodeTitle:e?.title,actor:e?.assignee?{handle:e.assignee}:void 0,detail:e?.issueType||"task",meta:e?{issueType:e.issueType,prefix:e.prefix}:void 0})}for(let t of e.removedNodeIds){let e=i.get(t);n.push({id:`node-closed:${t}:${r}`,type:"node-closed",time:r,nodeId:t,actor:e?.assignee?{handle:e.assignee}:void 0,detail:"Removed"})}for(let[t,l]of e.changedNodes){let e=i.get(t);for(let i of l){let l;switch(i.field){case"status":default:l="node-status-changed";break;case"priority":l="node-priority-changed";break;case"title":l="node-title-changed";break;case"owner":l="node-owner-changed";break;case"assignee":l="node-assignee-changed"}n.push({id:`${l}:${t}:${r}:${i.field}`,type:l,time:r,nodeId:t,nodeTitle:e?.title,actor:e?.assignee?{handle:e.assignee}:void 0,detail:`${i.from} \u2192 ${i.to}`,meta:{field:i.field,from:i.from,to:i.to}})}}for(let t of e.addedLinkKeys){let e=t.match(/^(.+)->(.+):(.+)$/);if(e){let[,l,a,o]=e,s=i.get(l);n.push({id:`link-added:${t}:${r}`,type:"link-added",time:r,nodeId:l,actor:s?.assignee?{handle:s.assignee}:void 0,detail:`${o} ${a}`,meta:{linkType:o,target:a}})}}for(let t of e.removedLinkKeys){let e=t.match(/^(.+)->(.+):(.+)$/);if(e){let[,i,l,a]=e;n.push({id:`link-removed:${t}:${r}`,type:"link-removed",time:r,nodeId:i,detail:`${a} ${l}`,meta:{linkType:a,target:l}})}}return n}(r,t.graphData.nodes);i.length>0&&ew(e=>i5(e,i));let l=l_(n,t,r);tr.current=l,m(l)}catch(e){console.error("Failed to parse SSE message:",e)}},e.onerror=()=>{e?.readyState===EventSource.CLOSED&&(t=setTimeout(i,5e3))},n=setTimeout(()=>{r&&(tr.current||fetch("/api/beads").then(e=>e.json()).then(e=>{r&&!tr.current&&(tr.current=e,m(e),b(!1))}).catch(()=>{}))},5e3)}(),()=>{r=!1,e?.close(),t&&clearTimeout(t),n&&clearTimeout(n)}},[]),(0,r.useEffect)(()=>{fetch("/api/config").then(e=>e.json()).then(e=>{e.name&&P(e.name),e.repoCount&&R(e.repoCount),e.repoUrls&&$(e.repoUrls)}).catch(()=>{})},[]),(0,r.useEffect)(()=>{if(!x||ti.current)return;ti.current=!0;let e=K.initial;if(e.node){let t=x.graphData.nodes.find(t=>t.id===e.node);t&&j(t)}e.profile&&ev(e.profile),"comments"===e.panel&&ek(!0),"activity"===e.panel&&ez(!0),"help"===e.panel&&eM(!0),"leaderboard"===e.panel&&eE(!0),e.epic&&L(e.epic),e.color&&"status"!==e.color&&T(e.color),e.collapsed.size>0&&S(e.collapsed),e.filters.size>0&&D(e.filters),e.selected.size>0&&N(e.selected),e.replay&&et(!0)},[x]),(0,r.useEffect)(()=>{if(!x)return;let e=setTimeout(()=>{let e=Date.now(),t=x.graphData.nodes.filter(t=>!t._removeTime||e-t._removeTime<600),n=x.graphData.links.filter(t=>!t._removeTime||e-t._removeTime<600);(t.length!==x.graphData.nodes.length||n.length!==x.graphData.links.length)&&m(e=>e?{...e,graphData:{nodes:t,links:n}}:e)},700);return()=>clearTimeout(e)},[x]),(0,r.useEffect)(()=>{ti.current&&(w?K.setNode(w.id):eb?K.setProfile(eb):eg?K.setPanel("comments"):ej?K.setPanel("activity"):eS?K.setPanel("help"):eT?K.setPanel("leaderboard"):K.setNode(null))},[w,eb,eg,ej,eS,eT]),(0,r.useEffect)(()=>{ti.current&&K.setEpic(M)},[M]),(0,r.useEffect)(()=>{ti.current&&K.setColor(A)},[A]),(0,r.useEffect)(()=>{ti.current&&K.setCollapsed(C)},[C]),(0,r.useEffect)(()=>{ti.current&&K.setFilters(E)},[E]),(0,r.useEffect)(()=>{ti.current&&K.setSelected(z)},[z]),(0,r.useEffect)(()=>{ti.current&&K.setReplay(ee)},[ee]);let tl=(0,r.useMemo)(()=>x?function(e,t){let n=[];for(let t of e){let e=new Date(t.createdAt).getTime();if(isNaN(e)||n.push({time:e,type:"node-created",id:t.id}),t.closedAt){let e=new Date(t.closedAt).getTime();isNaN(e)||n.push({time:e,type:"node-closed",id:t.id})}}n.sort((e,t)=>e.time-t.time);let r=n.length>0?n[0].time:Date.now(),i=n.length>0?n[n.length-1].time:Date.now();return{events:n,minTime:r,maxTime:i}}(x.graphData.nodes,x.graphData.links):null,[x]),ta=(0,r.useMemo)(()=>{if(!ee||!tl)return ey;if(-1===en)return[];if(0===tl.events.length)return ey;let e=tl.events[en];if(!e)return ey;let t=e.time;return ey.filter(e=>e.time<=t)},[ey,ee,tl,en]),to=(0,r.useMemo)(()=>{if(!ee||!tl||!es)return em;if(-1===en)return[];if(0===tl.events.length)return em;let e=tl.events[en];if(!e)return em;let t=e.time,n=es.graphData.nodes,r=new Map,i=e=>{if(!e)return null;let t=r.get(e);return t||(t={handle:e,createdCount:0,closedCount:0,commentCount:0},r.set(e,t)),t};for(let e of n){let t=e.createdBy||e.owner||e.assignee;if(t){let e=i(t);e&&e.createdCount++}if("closed"===e.status&&e.assignee){let t=i(e.assignee);t&&t.closedCount++}}if(Y){for(let e of Y)if(!(!ed.has(e.nodeId)||new Date(e.createdAt).getTime()>t)&&!(e.text.startsWith("@")&&-1===e.text.trim().indexOf(" "))){let t=i(e.handle);t&&(t.commentCount++,e.avatar&&!t.avatar&&(t.avatar=e.avatar),e.did&&!t.did&&(t.did=e.did))}}for(let[,e]of ex){let t=r.get(e.handle);t&&e.avatar&&!t.avatar&&(t.avatar=e.avatar)}for(let[e,t]of ep){let n=r.get(e);n&&!n.avatar&&(n.avatar=t)}let l=[];for(let e of r.values()){let t=3*e.closedCount+e.createdCount+e.commentCount;t>0&&l.push({...e,score:t})}return l.sort((e,t)=>t.score-e.score),l},[em,ee,tl,en,es,Y,ex,ep,ed]),ts=(0,r.useMemo)(()=>{let e,t;if(!eb||!x)return null;let n=ee&&es?es.graphData.nodes:x.graphData.nodes,r=ee&&tl&&en>=0?tl.events[en]?.time:void 0,i=Y?Y.filter(e=>ed.has(e.nodeId)):[],l=r?i.filter(e=>new Date(e.createdAt).getTime()<=r):i;if(eu){for(let[,n]of eu)if(n.handle===eb){e=e||n.avatar,t=t||n.did;break}}if(ex){for(let[,t]of ex)if(t.handle===eb){e=e||t.avatar;break}}for(let n of l)if(n.handle===eb){e=e||n.avatar,t=t||n.did;break}let a=n.filter(e=>e.assignee===eb),o=a.length,s=n.filter(e=>"closed"===e.status&&(e.assignee===eb||e.createdBy===eb)).length,c=0;if(eu)for(let[,e]of eu)e.handle===eb&&c++;let d=l.filter(e=>e.handle===eb),u=d.filter(e=>!(e.text.startsWith("@")&&-1===e.text.trim().indexOf(" "))).length,h=0;for(let e of l)for(let t of e.likes)t.handle===eb&&h++;let m=new Map;for(let e of n)(e.assignee===eb||e.createdBy===eb)&&m.set(e.prefix,(m.get(e.prefix)||0)+1);let g=Array.from(m.entries()).sort((e,t)=>t[1]-e[1]).map(([e,t])=>({prefix:e,prefixLabel:p(e),color:f(e),count:t})),k=[];for(let e of a)k.push({type:"assigned",nodeId:e.id,nodeTitle:e.title,time:e.updatedAt});for(let e of n)"closed"===e.status&&e.closedAt&&(e.assignee===eb||e.createdBy===eb)&&k.push({type:"closed",nodeId:e.id,nodeTitle:e.title,time:e.closedAt});for(let e of d)e.text.startsWith("@")&&-1===e.text.trim().indexOf(" ")||k.push({type:"commented",nodeId:e.nodeId,nodeTitle:n.find(t=>t.id===e.nodeId)?.title||e.nodeId,time:e.createdAt,detail:e.text.slice(0,60)+(e.text.length>60?"...":"")});for(let e of l)e.handle===eb&&e.text.startsWith("@")&&-1===e.text.trim().indexOf(" ")&&k.push({type:"claimed",nodeId:e.nodeId,nodeTitle:n.find(t=>t.id===e.nodeId)?.title||e.nodeId,time:e.createdAt});for(let e of l)for(let t of e.likes)t.handle===eb&&k.push({type:"liked",nodeId:e.nodeId,nodeTitle:n.find(t=>t.id===e.nodeId)?.title||e.nodeId,time:t.createdAt});k.sort((e,t)=>new Date(t.time).getTime()-new Date(e.time).getTime());let b=k.slice(0,20),v=b.length>0?b[0].time:void 0;return{handle:eb,avatar:e,did:t,assignedCount:o,closedCount:s,claimedCount:c,commentCount:u,likeCount:h,projects:g,recentActivity:b,lastActiveAt:v}},[eb,x,eu,ex,Y,ee,es,tl,en,ed]),tc=(0,r.useCallback)(()=>{et(e=>{let t=!e;return t&&er(-1),el(!1),ec(null),t})},[]);(0,r.useEffect)(()=>{if(!ei||!ee||!tl)return;let e=setInterval(()=>{er(e=>{let t=e+1;return t>=tl.events.length?(el(!1),e):t})},2e3/ea);return()=>clearInterval(e)},[ei,ee,ea,tl]),(0,r.useEffect)(()=>{if(!ee||!x||!tl)return;if(-1===en)return void ec(e=>{let t={...x,graphData:{nodes:[],links:[]}};if(!e)return t;let n=k(e,t);return n.hasChanges?l_(e,t,n):e});if(0===tl.events.length)return;let e=tl.events[en];if(!e)return;let t=function(e,t,n){let r=new Set,i=[];for(let t of e){let e=new Date(t.createdAt).getTime();if(isNaN(e)||e>n)continue;r.add(t.id);let l=t.status;if(t.closedAt){let e=new Date(t.closedAt).getTime();!isNaN(e)&&e<=n?l="closed":"closed"===t.status&&(l="open")}l!==t.status?i.push({...t,status:l}):i.push(t)}let l=[];for(let e of t){let t="object"==typeof e.source?e.source.id:e.source,n="object"==typeof e.target?e.target.id:e.target;r.has(t)&&r.has(n)&&l.push({...e,source:t,target:n})}return{nodes:i,links:l}}(x.graphData.nodes,x.graphData.links,e.time),n={...x,graphData:{nodes:t.nodes,links:t.links}};ec(e=>{if(!e)return n;let t=k(e,n);return t.hasChanges?l_(e,n,t):e})},[ee,x,tl,en]);let td=(0,r.useCallback)((e,t)=>{if(t?.shiftKey){N(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),j(null);return}j(t=>t?.id===e.id?null:e),N(new Set),ek(!1),ez(!1),eM(!1),ev(null),eE(!1),eA(null),eB(!1),e$(null)},[]),tu=(0,r.useCallback)((e,t,n)=>{eF.current||eQ(e?{node:e,x:t,y:n}:null)},[]),th=(0,r.useCallback)(e=>{ev(e.handle),j(null),ek(!1),ez(!1),eM(!1),eE(!1),eA(null),eG(null)},[]),tp=(0,r.useCallback)(e=>{S(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),tf=(0,r.useMemo)(()=>{if(!x)return new Set;let{nodes:e,links:t}=x.graphData,n=new Set;for(let e of t)if("parent-child"===e.type){let t="object"==typeof e.source?e.source.id:e.source;n.add(t)}let r=new Set(e.map(e=>e.id));for(let t of e)if(t.id.includes(".")){let e=t.id.split(".")[0];r.has(e)&&n.add(e)}return n},[x]),tx=(0,r.useCallback)(()=>{S(new Set(tf))},[tf]),tm=(0,r.useCallback)(()=>{S(new Set)},[]),tg=(0,r.useCallback)(e=>{L(e)},[]),tk=(0,r.useCallback)(()=>{L(null)},[]),tb=(0,r.useCallback)(()=>{eM(!0),j(null),ek(!1),ez(!1),eE(!1),eA(0)},[]),tv=(0,r.useCallback)(()=>{eA(e=>null===e?null:e>=i6.length-1?e:e+1)},[]),ty=(0,r.useCallback)(()=>{eA(e=>null===e||e<=0?e:e-1)},[]),tw=(0,r.useCallback)(()=>{eA(null)},[]),tj=(0,r.useCallback)(()=>{j(null),N(new Set),eW(null),eU(null),e$(null),ev(null),eE(!1)},[]),tz=(0,r.useCallback)((e,t)=>{eF.current||(eU(null),eQ(null),e.description||_||"epic"===e.issueType?eW({node:e,x:t.clientX,y:t.clientY}):eU({node:e,x:t.clientX,y:t.clientY}))},[_]),tN=(0,r.useCallback)(e=>{eU(null),eQ(null),e$({node:e})},[]),tC=(0,r.useCallback)(async(e,t)=>{let n=await fetch("/api/records",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({collection:"org.impactindexer.review.comment",record:{$type:"org.impactindexer.review.comment",subject:{uri:`beads:${e}`,type:"record"},text:t,createdAt:new Date().toISOString()}})});if(!n.ok)throw Error((await n.json()).error||"Failed to post comment");await X()},[X]),tS=(0,r.useCallback)(async e=>{if(!W?.handle)return;let t=W.avatar;if(!t&&W.did)try{let e=await fetch(`https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=${encodeURIComponent(W.did)}`);e.ok&&(t=(await e.json()).avatar)}catch{}J(n=>{let r=new Map(n);return r.set(e,{avatar:t,claimedAt:new Date().toISOString(),handle:W.handle}),r}),await tC(e,`@${W.handle}`),setTimeout(()=>X(),3e3)},[W?.handle,W?.did,W?.avatar,tC,X]),tM=(0,r.useCallback)(async e=>{let t=await fetch(`/api/records?collection=${encodeURIComponent("org.impactindexer.review.comment")}&rkey=${encodeURIComponent(e.rkey)}`,{method:"DELETE"});if(!t.ok)throw Error((await t.json()).error||"Failed to delete comment");await X()},[X]),tL=(0,r.useCallback)(async e=>{let t=eu.get(e);t&&(Z(t=>new Set(t).add(e)),J(t=>{let n=new Map(t);return n.delete(e),n}),t.rkey?(await tM({rkey:t.rkey}),Z(t=>{let n=new Set(t);return n.delete(e),n})):setTimeout(async()=>{await X(),Z(t=>{let n=new Set(t);return n.delete(e),n})},3e3))},[eu,tM,X]),tA=(0,r.useCallback)(async e=>{let t=e.likes.find(e=>e.did===W?.did);if(t){let e=await fetch(`/api/records?collection=${encodeURIComponent("org.impactindexer.review.like")}&rkey=${encodeURIComponent(t.rkey)}`,{method:"DELETE"});if(!e.ok)throw Error((await e.json()).error||"Failed to unlike")}else{let t=await fetch("/api/records",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({collection:"org.impactindexer.review.like",record:{subject:{uri:e.uri,type:"record"},createdAt:new Date().toISOString()}})});if(!t.ok)throw Error((await t.json()).error||"Failed to like")}await X()},[W?.did,X]),tT=(0,r.useCallback)(async(e,t)=>{let n=await fetch("/api/records",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({collection:"org.impactindexer.review.comment",record:{subject:{uri:`beads:${e.nodeId}`,type:"record"},text:t,replyTo:e.uri,createdAt:new Date().toISOString()}})});if(!n.ok)throw Error((await n.json()).error||"Failed to post reply");await X()},[X]),tE=(0,r.useCallback)(e=>{if(!x)return;let t=x.graphData.nodes.find(t=>t.id===e);t&&j(t)},[x]),tD=(0,r.useMemo)(()=>{let e=new Map;if(!Y)return e;let t=new Map;for(let e of Y)t.has(e.nodeId)||t.set(e.nodeId,new Set),t.get(e.nodeId).add(e.handle),e.displayName&&t.get(e.nodeId).add(e.displayName);for(let[n,r]of t)e.set(n,Array.from(r).join(" "));return e},[Y]),tI=(0,r.useMemo)(()=>{if(!x||!e1.trim())return[];let e=e1.toLowerCase();return x.graphData.nodes.filter(t=>{let n=tD.get(t.id)||"";return`${t.id} ${t.title} ${t.prefix} ${t.owner||""} ${t.assignee||""} ${t.createdBy||""} ${n}`.toLowerCase().includes(e)}).slice(0,8)},[e1,x,tD]);(0,r.useEffect)(()=>{e4(0)},[e1]);let tP=(0,r.useCallback)(e=>{tt.current?.focusNode(e),e0(!1),e5(""),e4(0)},[]),tF=(0,r.useCallback)(e=>{for(let[t,n]of eu)if(n.handle===e)return t;for(let[t,n]of ex)if(n.handle===e)return t;if(x){let t=x.graphData.nodes.filter(t=>t.assignee===e&&"closed"!==t.status).sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt));if(t.length>0)return t[0].id}return null},[eu,ex,x]);(0,r.useEffect)(()=>{let e=e=>{let t=e.target?.tagName;if("INPUT"===t||"TEXTAREA"===t||e.target?.isContentEditable)return;if((e.ctrlKey||e.metaKey)&&"f"===e.key&&(e.preventDefault(),e0(!0),setTimeout(()=>tn.current?.focus(),50)),"Escape"===e.key&&eZ&&(e0(!1),e5(""),e4(0)),e.shiftKey&&"Digit0"===e.code){e.preventDefault();let t=ta.length>0?ta[0].nodeId:null;if(t&&x){let e=x.graphData.nodes.find(e=>e.id===t);e&&tt.current?.focusNode(e)}}let n=e.code.match(/^Digit([1-9])$/);if(e.shiftKey&&n){e.preventDefault();let t=to[parseInt(n[1],10)-1];if(!t||!x)return;let r=tF(t.handle);if(r){let e=x.graphData.nodes.find(e=>e.id===r);e&&tt.current?.focusNode(e)}}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[eZ,ta,x,to,tF]);let tR=(0,r.useCallback)(e=>{"ArrowDown"===e.key?(e.preventDefault(),e4(e=>Math.min(e+1,tI.length-1))):"ArrowUp"===e.key?(e.preventDefault(),e4(e=>Math.max(e-1,0))):"Enter"===e.key&&tI.length>0&&(e.preventDefault(),tP(tI[e2]))},[tI,e2,tP]);return g?(0,n.jsxs)("div",{className:"h-screen flex flex-col items-center justify-center bg-white dark:bg-zinc-900 text-zinc-800 dark:text-zinc-200 px-6 select-none",children:[(0,n.jsxs)("div",{className:"relative w-full max-w-sm mb-8",children:[(0,n.jsx)("svg",{viewBox:"0 0 400 40",fill:"none",className:"w-full text-zinc-200 dark:text-zinc-700","aria-hidden":"true",children:(0,n.jsx)("line",{x1:"0",y1:"20",x2:"400",y2:"20",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:"4 6",opacity:"0.6"})}),(0,n.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,n.jsx)("div",{className:"bg-white dark:bg-zinc-900 px-4",children:(0,n.jsx)(i_.BeadsLogo,{className:"w-10 h-10 text-emerald-500"})})})]}),(0,n.jsx)("p",{className:"text-sm text-zinc-500 dark:text-zinc-400 font-light animate-fade-in",children:"Warming up the heartbeat..."}),(0,n.jsx)("p",{className:"text-xs text-zinc-400 dark:text-zinc-500 mt-1.5 animate-fade-in",style:{animationDelay:"0.1s"},children:"Discovering issues and mapping dependencies"})]}):v?(0,n.jsx)("div",{className:"h-screen flex items-center justify-center bg-white",children:(0,n.jsxs)("div",{className:"max-w-sm text-center",children:[(0,n.jsx)("div",{className:"w-14 h-14 mx-auto mb-4 bg-red-50 rounded-full flex items-center justify-center",children:(0,n.jsx)("svg",{className:"w-7 h-7 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,n.jsx)("h2",{className:"text-lg font-semibold text-zinc-900 mb-1",children:"Unable to load data"}),(0,n.jsx)("p",{className:"text-sm text-zinc-500 mb-4",children:v}),(0,n.jsxs)("button",{onClick:()=>window.location.reload(),className:"inline-flex items-center gap-2 px-4 py-2 bg-emerald-600 text-white text-sm rounded-lg hover:bg-emerald-700 transition-colors",children:[(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Try Again"]})]})}):x?(0,n.jsxs)("div",{className:"h-screen flex flex-col overflow-hidden bg-white dark:bg-black",children:[(0,n.jsx)("header",{className:"sticky top-0 z-50 shrink-0 bg-white/95 dark:bg-black/95 backdrop-blur-sm border-b border-zinc-200/80 dark:border-zinc-800/80",children:(0,n.jsxs)("div",{className:"px-3 sm:px-6 h-14 flex items-center",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 shrink-0 group",children:[(0,n.jsx)(i_.BeadsLogo,{className:"w-8 h-8 text-emerald-500 transition-transform group-hover:scale-105"}),(0,n.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,n.jsx)("h1",{className:"text-[15px] font-semibold text-zinc-900 dark:text-zinc-100 tracking-tight",children:I}),(0,n.jsx)("span",{className:"font-normal text-zinc-400 text-[15px] hidden sm:inline",children:"Heartbeads"}),(0,n.jsxs)("span",{className:"text-[10px] text-zinc-400 bg-zinc-100 dark:bg-zinc-800 rounded-full px-1.5 py-0.5 font-medium hidden sm:inline",children:["v","0.6.2"]})]})]}),(0,n.jsx)("div",{className:"flex-1 flex justify-center px-2 sm:px-4",children:(0,n.jsx)("div",{className:"relative w-full max-w-md","data-tutorial":"search",children:eZ?(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsxs)("div",{className:"flex items-center bg-white dark:bg-zinc-900 rounded-full border border-zinc-200 dark:border-zinc-700 shadow-sm overflow-hidden",children:[(0,n.jsx)("div",{className:"pl-3 pr-1 text-zinc-400 dark:text-zinc-500",children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),(0,n.jsx)("input",{ref:tn,type:"text",value:e1,onChange:e=>e5(e.target.value),onKeyDown:tR,placeholder:"Search issues...",className:"flex-1 px-2 py-1.5 text-xs text-zinc-800 dark:text-zinc-200 bg-transparent outline-none placeholder:text-zinc-400 dark:placeholder:text-zinc-500",autoFocus:!0}),(0,n.jsx)("button",{onClick:()=>{e0(!1),e5(""),e4(0)},className:"px-2 py-1.5 text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300",children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),e1.trim()&&(0,n.jsxs)("div",{className:"absolute top-full left-0 right-0 mt-2 bg-white dark:bg-zinc-900 rounded-xl border border-zinc-100 dark:border-zinc-800 shadow-xl overflow-hidden max-h-72 overflow-y-auto z-50",children:[0===tI.length?(0,n.jsx)("div",{className:"px-3 py-3 text-xs text-zinc-400 dark:text-zinc-500 text-center",children:"No matching issues"}):tI.map((e,t)=>(0,n.jsxs)("button",{onClick:()=>tP(e),onMouseEnter:()=>e4(t),className:`w-full text-left px-3 py-2 text-xs transition-colors flex items-start gap-2.5 ${t===e2?"bg-emerald-50 dark:bg-emerald-950":"hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,children:[(0,n.jsx)("div",{className:"shrink-0 mt-1",children:(0,n.jsx)("div",{className:`w-2 h-2 rounded-full ${lW[e.status]||"bg-zinc-400"}`})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("span",{className:"font-medium text-zinc-600 dark:text-zinc-400 shrink-0",children:e.id}),e.priority<=1&&(0,n.jsx)("span",{className:"text-[10px]",children:0===e.priority?"🔥🔥":"🔥"})]}),(0,n.jsx)("div",{className:"text-zinc-400 dark:text-zinc-500 truncate mt-0.5",children:e.title})]}),(0,n.jsx)("span",{className:"shrink-0 text-[10px] text-zinc-400 dark:text-zinc-500 bg-zinc-100 dark:bg-zinc-800 rounded px-1 py-0.5 mt-0.5",children:e.prefix})]},e.id)),tI.length>0&&(0,n.jsxs)("div",{className:"px-3 py-1.5 text-[10px] text-zinc-400 dark:text-zinc-500 border-t border-zinc-100 dark:border-zinc-800 bg-zinc-50/50 dark:bg-zinc-800/50 flex items-center justify-between",children:[(0,n.jsxs)("span",{children:[tI.length," result",1!==tI.length?"s":""]}),(0,n.jsxs)("span",{children:[(0,n.jsx)("kbd",{className:"px-1 py-0.5 bg-white dark:bg-zinc-800 rounded border border-zinc-200 dark:border-zinc-700 text-[9px] font-mono",children:"Enter"})," ","to focus"]})]})]})]}):(0,n.jsxs)("button",{onClick:()=>{e0(!0),setTimeout(()=>tn.current?.focus(),50)},className:"w-full flex items-center gap-2 px-3.5 py-1.5 text-sm text-zinc-400 rounded-full bg-zinc-50/80 dark:bg-zinc-800/80 border border-zinc-200/60 dark:border-zinc-700/60 hover:text-zinc-500 dark:hover:text-zinc-300 hover:border-zinc-300 dark:hover:border-zinc-600 hover:bg-zinc-100/50 dark:hover:bg-zinc-700/50 transition-all",title:"Search issues (Ctrl+F)",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),(0,n.jsx)("span",{className:"flex-1 text-left",children:"Search issues..."}),(0,n.jsxs)("kbd",{className:"hidden sm:inline-block px-1 py-0.5 bg-zinc-100 dark:bg-zinc-700 rounded border border-zinc-200 dark:border-zinc-600 text-[9px] font-mono text-zinc-400 dark:text-zinc-500",children:["u">typeof navigator&&navigator.platform?.includes("Mac")?"⌘":"Ctrl","F"]})]})})}),(0,n.jsx)("button",{onClick:()=>eB(!0),className:"md:hidden p-2 text-zinc-500 hover:text-zinc-700 hover:bg-zinc-50 dark:text-zinc-400 dark:hover:text-zinc-200 dark:hover:bg-zinc-800 rounded-full transition-colors shrink-0","aria-label":"Open menu",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})})}),(0,n.jsxs)("div",{className:"hidden md:flex items-center gap-1 shrink-0","data-tutorial":"nav-pills",children:[(0,n.jsxs)("button",{onClick:tc,"data-tutorial":"nav-replay",className:`flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-full transition-colors ${ee?"text-emerald-700 bg-emerald-50 dark:text-emerald-400 dark:bg-emerald-950":"text-zinc-500 hover:text-zinc-900 hover:bg-zinc-50 dark:text-zinc-400 dark:hover:text-zinc-100 dark:hover:bg-zinc-800"}`,children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,n.jsx)("polyline",{points:"8,4 8,8 11,10"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Replay"})]}),(0,n.jsxs)("button",{onClick:()=>{ek(e=>!e),eg||(j(null),ez(!1),eM(!1),ev(null),eE(!1),eA(null))},"data-tutorial":"nav-comments",className:`flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-full transition-colors ${eg?"text-emerald-700 bg-emerald-50 dark:text-emerald-400 dark:bg-emerald-950":"text-zinc-500 hover:text-zinc-900 hover:bg-zinc-50 dark:text-zinc-400 dark:hover:text-zinc-100 dark:hover:bg-zinc-800"}`,children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 011.037-.443 48.282 48.282 0 005.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z"})}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Comments"})]}),(0,n.jsxs)("button",{onClick:()=>{ez(e=>!e),ej||(j(null),ek(!1),eM(!1),ev(null),eE(!1),eA(null))},"data-tutorial":"nav-activity",className:`flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-full transition-colors ${ej?"text-emerald-700 bg-emerald-50 dark:text-emerald-400 dark:bg-emerald-950":"text-zinc-500 hover:text-zinc-900 hover:bg-zinc-50 dark:text-zinc-400 dark:hover:text-zinc-100 dark:hover:bg-zinc-800"}`,children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,n.jsx)("polyline",{points:"8,4 8,8 11,10"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Activity"})]}),(0,n.jsxs)("button",{onClick:()=>{eM(e=>!e),eS||(j(null),ek(!1),ez(!1),ev(null),eE(!1))},"data-tutorial":"nav-learn",className:`flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-full transition-colors ${eS?"text-emerald-700 bg-emerald-50 dark:text-emerald-400 dark:bg-emerald-950":"text-zinc-500 hover:text-zinc-900 hover:bg-zinc-50 dark:text-zinc-400 dark:hover:text-zinc-100 dark:hover:bg-zinc-800"}`,children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18v-5.25m0 0a6.01 6.01 0 001.5-.189m-1.5.189a6.01 6.01 0 01-1.5-.189m3.75 7.478a12.06 12.06 0 01-4.5 0m3.75 2.383a14.406 14.406 0 01-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 10-7.517 0c.85.493 1.509 1.333 1.509 2.316V18"})}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Learn"})]}),(0,n.jsx)("div",{className:"w-px h-5 bg-zinc-200 dark:bg-zinc-700 mx-2"}),(0,n.jsxs)("span",{"data-tutorial":"auth-section",className:"flex items-center",children:[(0,n.jsx)("button",{onClick:()=>eX(!0),className:"p-1.5 text-zinc-400 hover:text-zinc-600 dark:text-zinc-500 dark:hover:text-zinc-300 rounded-full hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",title:"Settings",children:(0,n.jsxs)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:[(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 010 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 010-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28z"}),(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),(0,n.jsx)("button",{onClick:U,className:"p-1.5 text-zinc-400 hover:text-zinc-600 dark:text-zinc-500 dark:hover:text-zinc-300 rounded-full hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",title:"dark"===H?"Switch to light mode":"Switch to dark mode","data-tutorial":"btn-theme",children:"dark"===H?(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z"})}):(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z"})})}),(0,n.jsx)(i$,{onViewProfile:e=>{ev(e),j(null),ek(!1),ez(!1),eM(!1),eE(!1),eA(null)}})]})]})]})}),eR&&(0,n.jsxs)("div",{className:"md:hidden fixed inset-0 z-[60]",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-[2px]",onClick:()=>eB(!1)}),(0,n.jsxs)("div",{className:"absolute top-0 right-0 h-full w-72 bg-white dark:bg-zinc-900 shadow-2xl flex flex-col animate-slide-in-right",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsx)("span",{className:"text-sm font-semibold text-zinc-700 dark:text-zinc-100",children:"Menu"}),(0,n.jsx)("button",{onClick:()=>eB(!1),className:"p-1.5 text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 rounded-full hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsxs)("nav",{className:"flex-1 overflow-y-auto py-2",children:[(0,n.jsxs)("button",{onClick:()=>{tc(),eB(!1)},className:`w-full flex items-center gap-3 px-5 py-3.5 text-sm font-medium transition-colors ${ee?"text-emerald-700 bg-emerald-50 dark:text-emerald-400 dark:bg-emerald-950":"text-zinc-600 dark:text-zinc-400 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,children:[(0,n.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,n.jsx)("polyline",{points:"8,4 8,8 11,10"})]}),"Replay"]}),(0,n.jsxs)("button",{onClick:()=>{ek(e=>!e),eg||(j(null),ez(!1),eM(!1),eE(!1),eA(null)),eB(!1)},className:`w-full flex items-center gap-3 px-5 py-3.5 text-sm font-medium transition-colors ${eg?"text-emerald-700 bg-emerald-50 dark:text-emerald-400 dark:bg-emerald-950":"text-zinc-600 dark:text-zinc-400 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,children:[(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 011.037-.443 48.282 48.282 0 005.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z"})}),"Comments"]}),(0,n.jsxs)("button",{onClick:()=>{ez(e=>!e),ej||(j(null),ek(!1),eM(!1),eE(!1),eA(null)),eB(!1)},className:`w-full flex items-center gap-3 px-5 py-3.5 text-sm font-medium transition-colors ${ej?"text-emerald-700 bg-emerald-50 dark:text-emerald-400 dark:bg-emerald-950":"text-zinc-600 dark:text-zinc-400 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,children:[(0,n.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,n.jsx)("polyline",{points:"8,4 8,8 11,10"})]}),"Activity"]}),(0,n.jsxs)("button",{onClick:()=>{eM(e=>!e),eS||(j(null),ek(!1),ez(!1),eE(!1)),eB(!1)},className:`w-full flex items-center gap-3 px-5 py-3.5 text-sm font-medium transition-colors ${eS?"text-emerald-700 bg-emerald-50 dark:text-emerald-400 dark:bg-emerald-950":"text-zinc-600 dark:text-zinc-400 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,children:[(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18v-5.25m0 0a6.01 6.01 0 001.5-.189m-1.5.189a6.01 6.01 0 01-1.5-.189m3.75 7.478a12.06 12.06 0 01-4.5 0m3.75 2.383a14.406 14.406 0 01-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 10-7.517 0c.85.493 1.509 1.333 1.509 2.316V18"})}),"Learn"]}),(0,n.jsx)("div",{className:"h-px bg-zinc-100 dark:bg-zinc-800 mx-4 my-2"}),(0,n.jsxs)("button",{onClick:()=>{eX(!0),eB(!1)},className:"w-full flex items-center gap-3 px-5 py-3.5 text-sm font-medium text-zinc-600 dark:text-zinc-400 hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors",children:[(0,n.jsxs)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:[(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 010 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 010-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28z"}),(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),"Settings"]}),(0,n.jsx)("div",{className:"px-5 py-3.5",children:(0,n.jsx)(i$,{onViewProfile:e=>{ev(e),j(null),ek(!1),ez(!1),eM(!1),eE(!1),eA(null),eB(!1)}})})]})]})]}),(0,n.jsxs)("div",{className:"flex-1 flex overflow-hidden relative",children:[(0,n.jsxs)("div",{className:"flex-1 relative bg-zinc-50/50 dark:bg-black",children:[(0,n.jsx)("div",{className:"absolute inset-0 opacity-[0.03] dark:opacity-[0.06]",style:{backgroundImage:"radial-gradient(circle, currentColor 1px, transparent 1px)",backgroundSize:"24px 24px"}}),(0,n.jsx)(B,{ref:tt,nodes:ee&&es?es.graphData.nodes:x.graphData.nodes,links:ee&&es?es.graphData.links:x.graphData.links,selectedNode:w,selectedNodeIds:z,onSelectedNodeIdsChange:N,onNodeClick:td,onNodeHover:tu,onBackgroundClick:tj,onNodeRightClick:tz,commentedNodeIds:q,claimedNodeAvatars:eu,assigneeNodeAvatars:ex,onAvatarHover:eG,onAvatarClick:th,timelineActive:ee,stats:x.stats,sidebarOpen:!!w||eg||ej||eS||!!eb||eT,collapsedEpicIds:C,onCollapseAll:tx,onExpandAll:tm,focusedEpicId:M,onExitFocusedEpic:tk,colorMode:A,onColorModeChange:T,activeLegendFilters:E,onToggleLegendFilter:e=>D(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),onClearLegendFilters:()=>D(new Set),autoFit:e3,onAutoFitToggle:()=>e6(e=>!e),pulseNodeId:ta.length>0?ta[0].nodeId:null,showPulse:e8,onShowPulseToggle:()=>e7(e=>!e),showParticles:e9,onShowParticlesToggle:()=>te(e=>!e),isMobile:eP,onNodeDoubleTap:tN,theme:H}),ee&&tl&&tl.events.length>0&&(0,n.jsx)("div",{className:"absolute bottom-4 z-10 transition-[right] duration-300 ease-out",style:{right:w||eg||ej?"calc(360px + 1rem)":"1rem"},children:(0,n.jsx)(l$,{totalSteps:tl.events.length,currentStep:Math.max(en,0),currentTime:en>=0?tl.events[en]?.time??tl.minTime:tl.minTime,isPlaying:ei,speed:ea,onStepChange:er,onPlayPause:()=>el(e=>!e),onSpeedChange:eo})}),!w&&!eg&&!ej&&!eS&&!eb&&!eT&&(0,n.jsxs)("div",{className:"absolute top-3 right-3 sm:top-4 sm:right-4 z-10 flex flex-col items-end gap-2","data-tutorial":"overlays",children:[(0,n.jsx)(i1,{events:ta,collapsed:eN,compact:eP,onToggleCollapse:()=>eC(e=>!e),onExpandPanel:()=>{ez(!0),j(null),ek(!1),eM(!1),eE(!1)},onNodeClick:e=>{let t=x?.graphData.nodes.find(t=>t.id===e);t&&tP(t)},onHandleClick:e=>{ev(e),j(null),ek(!1),eM(!1),eE(!1)}}),(0,n.jsx)(lu,{entries:to,collapsed:eD,compact:eP,onToggleCollapse:()=>eI(e=>!e),onExpandPanel:()=>{eE(!0),j(null),ek(!1),ez(!1),eM(!1),ev(null)},onProfileClick:e=>{ev(e),j(null),ek(!1),ez(!1),eM(!1),eE(!1);let t=tF(e);t&&tt.current?.zoomToNode(t)}})]}),e_&&(0,n.jsx)(iH,{node:e_.node,x:e_.x,y:e_.y,onShowDescription:()=>{eq(e_.node),eW(null)},onAddComment:()=>{eU({node:e_.node,x:e_.x,y:e_.y}),eW(null)},onClaimTask:_&&!eu.has(e_.node.id)?()=>{tS(e_.node.id),eW(null)}:void 0,onUnclaimTask:(()=>{if(!_)return;let e=eu.get(e_.node.id);if(e&&(e.did===W?.did||!e.did))return()=>{tL(e_.node.id),eW(null)}})(),onCollapseEpic:"epic"!==e_.node.issueType||C.has(e_.node.id)?void 0:()=>{tp(e_.node.id),eW(null)},onUncollapseEpic:"epic"===e_.node.issueType&&C.has(e_.node.id)?()=>{tp(e_.node.id),eW(null)}:void 0,onFocusEpic:"epic"!==e_.node.issueType||M?void 0:()=>{tg(e_.node.id),eW(null)},onExitFocusEpic:"epic"===e_.node.issueType&&M===e_.node.id?()=>{tk(),eW(null)}:void 0,onClose:()=>eW(null)}),eO&&(0,n.jsx)(lf,{node:eO.node,onShowDescription:eO.node.description?()=>{eq(eO.node),e$(null)}:void 0,onAddComment:()=>{eU({node:eO.node,x:window.innerWidth/2,y:window.innerHeight/2}),e$(null)},onClaimTask:_&&!eu.has(eO.node.id)?()=>{tS(eO.node.id),e$(null)}:void 0,onUnclaimTask:(()=>{if(!_)return;let e=eu.get(eO.node.id);if(e&&(e.did===W?.did||!e.did))return()=>{tL(eO.node.id),e$(null)}})(),onCollapseEpic:"epic"!==eO.node.issueType||C.has(eO.node.id)?void 0:()=>{tp(eO.node.id),e$(null)},onUncollapseEpic:"epic"===eO.node.issueType&&C.has(eO.node.id)?()=>{tp(eO.node.id),e$(null)}:void 0,onFocusEpic:"epic"!==eO.node.issueType||M?void 0:()=>{tg(eO.node.id),e$(null)},onExitFocusEpic:"epic"===eO.node.issueType&&M===eO.node.id?()=>{tk(),e$(null)}:void 0,onClose:()=>e$(null)}),eH&&(0,n.jsx)(iW,{node:eH.node,x:eH.x,y:eH.y,onClose:()=>eU(null),onSubmit:async e=>{await tC(eH.node.id,e),eU(null)},isAuthenticated:_,existingComments:V.get(eH.node.id)}),eV&&(0,n.jsx)(iT,{node:eV,onClose:()=>eq(null),repoUrl:O[eV.prefix],onOpenSettings:()=>eX(!0)}),(0,n.jsx)(lp,{isOpen:eY,onClose:()=>eX(!1)}),eJ&&!eK&&!eP&&(0,n.jsx)(iU,{node:eJ.node,x:eJ.x,y:eJ.y,prefixColor:f(eJ.node.prefix),allNodes:ee&&es?es.graphData.nodes:x.graphData.nodes,theme:H}),eK&&!eP&&(0,n.jsx)("div",{style:{position:"fixed",left:eK.x+12,top:eK.y-8,zIndex:90,pointerEvents:"none"},children:(0,n.jsxs)("div",{className:"flex items-center gap-2 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-700 rounded-lg shadow-lg px-2.5 py-2",children:[eK.avatar?(0,n.jsx)("img",{src:eK.avatar,alt:"",className:"w-6 h-6 rounded-full shrink-0"}):(0,n.jsx)("div",{className:"w-6 h-6 rounded-full bg-zinc-200 dark:bg-zinc-700 flex items-center justify-center text-[10px] font-medium text-zinc-500 dark:text-zinc-400 shrink-0",children:eK.handle.charAt(0).toUpperCase()}),(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsxs)("span",{className:"text-xs text-zinc-700 dark:text-zinc-300 whitespace-nowrap",children:[(0,n.jsx)("span",{className:"font-semibold text-zinc-800 dark:text-zinc-200",children:eK.handle})," ",eK.isAssignee?eK.nodeClosed?"closed":"is assigned to":eK.nodeClosed?"closed":"claimed"," ",(0,n.jsx)("span",{className:"font-mono text-emerald-700 dark:text-emerald-400",children:eK.nodeId})]}),(0,n.jsx)("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500",children:ih(eK.claimedAt)})]})]})})]}),(0,n.jsxs)("aside",{className:`hidden md:flex absolute top-0 right-0 h-full w-[360px] bg-white dark:bg-zinc-900 border-l border-zinc-200 dark:border-zinc-700 flex-col shadow-xl z-30 transform transition-transform duration-300 ease-out ${w?"translate-x-0":"translate-x-full"}`,children:[(0,n.jsxs)("div",{className:"shrink-0 px-5 py-3 border-b border-zinc-100 dark:border-zinc-800 flex items-center justify-between",children:[(0,n.jsx)("h2",{className:"text-xs font-semibold text-zinc-400 uppercase tracking-wider",children:"Node Detail"}),(0,n.jsx)("button",{onClick:()=>{j(null)},className:"p-1 text-zinc-400 hover:text-zinc-600 dark:text-zinc-500 dark:hover:text-zinc-300 dark:hover:bg-zinc-800 transition-colors rounded-full hover:bg-zinc-100",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar px-5 py-4 space-y-5",children:(0,n.jsx)(iD,{node:w,allNodes:x.graphData.nodes,onNodeNavigate:tE,comments:w?V.get(w.id):void 0,onPostComment:w?e=>tC(w.id,e):void 0,onDeleteComment:tM,onLikeComment:tA,onReplyComment:tT,isAuthenticated:_,currentDid:W?.did,repoUrls:O,onOpenSettings:()=>eX(!0),onProfileClick:e=>{ev(e),j(null)}})})]}),(0,n.jsx)("div",{className:`md:hidden fixed inset-x-0 bottom-0 z-20 transform transition-transform duration-300 ease-out ${w?"translate-y-0":"translate-y-full"}`,children:(0,n.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-t-2xl border-t border-zinc-200 dark:border-zinc-700 shadow-lg max-h-[60vh] flex flex-col",children:[(0,n.jsxs)("div",{className:"shrink-0 flex items-center justify-between px-4 pt-3 pb-2",children:[(0,n.jsx)("div",{className:"w-8 h-1 bg-zinc-300 dark:bg-zinc-600 rounded-full mx-auto"}),(0,n.jsx)("button",{onClick:()=>j(null),className:"absolute right-3 top-3 p-1 text-zinc-400 hover:text-zinc-600 dark:text-zinc-500 dark:hover:text-zinc-300 dark:hover:bg-zinc-800",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar px-4 pb-6 space-y-4",children:(0,n.jsx)(iD,{node:w,allNodes:x.graphData.nodes,onNodeNavigate:tE,comments:w?V.get(w.id):void 0,onPostComment:w?e=>tC(w.id,e):void 0,onDeleteComment:tM,onLikeComment:tA,onReplyComment:tT,isAuthenticated:_,currentDid:W?.did,repoUrls:O,onOpenSettings:()=>eX(!0),onProfileClick:e=>{ev(e),j(null)}})})]})}),(0,n.jsx)(iV,{isOpen:eg,onClose:()=>ek(!1),allComments:Y.filter(e=>ed.has(e.nodeId)),onNodeNavigate:e=>{tE(e),ek(!1)},isAuthenticated:_,currentDid:W?.did,onLikeComment:tA,onDeleteComment:tM,onReplyComment:tT,onPostComment:tC,prefixes:x?.stats?.prefixes||[]}),(0,n.jsx)(i3,{events:ta,isOpen:ej,onClose:()=>ez(!1),onNodeClick:e=>{let t=x?.graphData.nodes.find(t=>t.id===e);t&&(tP(t),ez(!1))},onHandleClick:e=>{ev(e),ez(!1),j(null),ek(!1),eM(!1),eE(!1)}}),(0,n.jsx)(lh,{entries:to,isOpen:eT,onClose:()=>eE(!1),onProfileClick:e=>{ev(e),eE(!1),j(null),ek(!1),ez(!1),eM(!1);let t=tF(e);t&&tt.current?.zoomToNode(t)}}),(0,n.jsx)(la,{isOpen:eS,onClose:()=>{eM(!1),eA(null)},tutorialStep:eL,onStartTutorial:tb,onNextStep:tv,onPrevStep:ty,onEndTutorial:tw}),(0,n.jsx)(lg,{isOpen:!!eb,onClose:()=>ev(null),profile:ts,onNodeNavigate:e=>{let t=x?.graphData.nodes.find(t=>t.id===e);t&&(ev(null),td(t),tt.current?.focusNode(t))}})]}),(0,n.jsx)(i8,{step:eL,onNext:tv,onPrev:ty,onEnd:tw})]}):null}e.s(["default",()=>lH],31713)}]);
24
+ `;async function lN(e){let t,n=[],r=!0,i=0;for(;r&&i<5;){let l=await fetch(lj,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:lz,variables:{collection:e,first:100,after:t}})});if(!l.ok)throw Error(`Indexer fetch failed: ${l.status}`);let a=await l.json();if(a.errors?.length)throw Error(a.errors[0].message);let o=a.data?.records;if(!o)break;for(let e of o.edges)n.push(e.node);r=o.pageInfo.hasNextPage,t=o.pageInfo.endCursor,i++}return n}async function lC(){let[e,t]=await Promise.all([lN("org.impactindexer.review.comment"),lN("org.impactindexer.review.like")]),n=e.filter(e=>{let t=e.value.subject;return t?.uri&&"string"==typeof t.uri&&t.uri.startsWith("beads:")}),r=new Map;for(let e of t){let t=e.value.subject;if(t?.uri&&"string"==typeof t.uri&&t.uri.startsWith("at://")){let n=r.get(t.uri)||[];n.push(e),r.set(t.uri,n)}}let i=new Set;for(let e of n)i.add(e.did);for(let e of t)i.add(e.did);let l=new Map((await Promise.all([...i].map(e=>lw(e)))).map(e=>[e.did,e])),a=[];for(let e of n){let t=e.value,n=t.subject.uri.replace(/^beads:/,""),i=t.text||"",o=t.createdAt||"",s=t.replyTo||void 0,c=l.get(e.did),d=(r.get(e.uri)||[]).map(e=>{let t=l.get(e.did),n=e.value;return{did:e.did,handle:t?.handle||e.did.slice(0,20)+"...",displayName:t?.displayName,avatar:t?.avatar,createdAt:n.createdAt||"",uri:e.uri,rkey:e.rkey}}),u={did:e.did,handle:c?.handle||e.did.slice(0,20)+"...",displayName:c?.displayName,avatar:c?.avatar,text:i,createdAt:o,uri:e.uri,rkey:e.rkey,nodeId:n,replyTo:s,likes:d,replies:[]};a.push(u)}let o=new Map;for(let e of a)o.set(e.uri,e);let s=[];for(let e of a){if(e.replyTo){let t=o.get(e.replyTo);if(t){t.replies.push(e);continue}}s.push(e)}s.sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()),!function e(t){for(let n of t)n.replies.sort((e,t)=>new Date(e.createdAt).getTime()-new Date(t.createdAt).getTime()),e(n.replies)}(s);let c=new Map;for(let e of s){let t=c.get(e.nodeId)||[];t.push(e),c.set(e.nodeId,t)}let d=new Map;for(let e of a)d.set(e.nodeId,(d.get(e.nodeId)||0)+1);return{commentsByNode:c,commentedNodeIds:d,allComments:[...a].sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime())}}let lS="node",lM="profile",lL="panel",lA="epic",lT="color",lE="collapsed",lD="filters",lI="selected",lP="replay",lF=new Set(["comments","activity","help","leaderboard"]),lR=new Set(["status","priority","type","owner","assignee","prefix"]);function lB(){let e=new URLSearchParams(window.location.search),t=e.get(lL),n=e.get(lT),r=e.get(lE),i=e.get(lD),l=e.get(lI),a=e.get(lP);return{node:e.get(lS)||null,profile:e.get(lM)||null,panel:t&&lF.has(t)?t:null,epic:e.get(lA)||null,color:n&&lR.has(n)?n:"status",collapsed:r?new Set(r.split(",").filter(Boolean)):new Set,filters:i?new Set(i.split(",").filter(Boolean)):new Set,selected:l?new Set(l.split(",").filter(Boolean)):new Set,replay:"1"===a}}function lO(e){let t=new URLSearchParams(window.location.search),n=(e,n)=>{n?t.set(e,n):t.delete(e)};"node"in e&&n(lS,e.node),"profile"in e&&n(lM,e.profile),"panel"in e&&n(lL,e.panel),"epic"in e&&n(lA,e.epic),"color"in e&&n(lT,"status"===e.color?null:e.color),"collapsed"in e&&n(lE,e.collapsed&&e.collapsed.size>0?[...e.collapsed].join(","):null),"filters"in e&&n(lD,e.filters&&e.filters.size>0?[...e.filters].join(","):null),"selected"in e&&n(lI,e.selected&&e.selected.size>0?[...e.selected].join(","):null),"replay"in e&&n(lP,e.replay?"1":null),"node"in e&&e.node&&(t.delete(lM),t.delete(lL)),"profile"in e&&e.profile&&(t.delete(lS),t.delete(lL)),"panel"in e&&e.panel&&(t.delete(lS),t.delete(lM));let r=t.toString(),i=r?`?${r}`:window.location.pathname;window.history.replaceState(null,"",i)}function l$({totalSteps:e,currentStep:t,currentTime:i,isPlaying:l,speed:a,onStepChange:o,onPlayPause:s,onSpeedChange:c}){let d=(0,r.useCallback)(e=>{o(Number(e.target.value))},[o]),u=(0,r.useCallback)(()=>{c(1===a?2:2===a?4:1)},[a,c]),h=e>1;return(0,n.jsx)("div",{className:"bg-white/90 dark:bg-zinc-900/90 backdrop-blur-sm rounded-lg border border-zinc-200 dark:border-zinc-700 shadow-sm px-3 py-2 min-w-[280px] max-w-[480px]",children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("button",{onClick:s,disabled:!h,className:`shrink-0 w-6 h-6 flex items-center justify-center rounded transition-colors ${l?"text-emerald-500 hover:text-emerald-600":"text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200"} disabled:opacity-40 disabled:cursor-not-allowed`,children:l?(0,n.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"currentColor",children:[(0,n.jsx)("rect",{x:"3",y:"2",width:"3.5",height:"12",rx:"1"}),(0,n.jsx)("rect",{x:"9.5",y:"2",width:"3.5",height:"12",rx:"1"})]}):(0,n.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"currentColor",children:(0,n.jsx)("path",{d:"M4 2l10 6-10 6V2z"})})}),(0,n.jsx)("input",{type:"range",min:0,max:Math.max(e-1,0),value:t,onChange:d,disabled:!h,className:"timeline-slider flex-1 h-4 disabled:opacity-40"}),(0,n.jsxs)("span",{className:"shrink-0 text-xs text-zinc-500 dark:text-zinc-400 font-medium text-right whitespace-nowrap",children:[(0,n.jsxs)("span",{className:"text-zinc-400 dark:text-zinc-500",children:[t+1,"/",e]})," ",new Date(i).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]}),(0,n.jsxs)("button",{onClick:u,className:`shrink-0 px-1.5 py-0.5 text-[10px] font-semibold rounded transition-colors ${a>1?"bg-emerald-500 text-white":"text-zinc-500 dark:text-zinc-400 border border-zinc-200 dark:border-zinc-700 hover:text-zinc-700 dark:hover:text-zinc-200"}`,children:[a,"x"]})]})})}function l_(e,t,n){let r=Date.now(),i=new Map(e.graphData.nodes.map(e=>[e.id,e])),l=new Set(e.graphData.links.map(g)),a=t.graphData.nodes.map(e=>{let l=i.get(e.id);if(!l){let n=function(e,t,n){for(let r of t){let t="object"==typeof r.source?r.source.id:r.source,i="object"==typeof r.target?r.target.id:r.target;if(t===e&&n.has(i)){let e=n.get(i);if(null!=e.x&&null!=e.y)return{x:e.x,y:e.y}}if(i===e&&n.has(t)){let e=n.get(t);if(null!=e.x&&null!=e.y)return{x:e.x,y:e.y}}}return null}(e.id,t.graphData.links,i);return{...e,_spawnTime:r,x:n?n.x+(Math.random()-.5)*40:void 0,y:n?n.y+(Math.random()-.5)*40:void 0}}let a={...e,x:l.x,y:l.y,fx:l.fx,fy:l.fy};if(n.changedNodes.has(e.id)){let t=n.changedNodes.get(e.id).find(e=>"status"===e.field);t&&(a._changedAt=r,a._prevStatus=t.from)}return a});for(let e of n.removedNodeIds){let t=i.get(e);t&&a.push({...t,_removeTime:r})}let o=t.graphData.links.map(e=>{let t=g(e);return l.has(t)?e:{...e,_spawnTime:r}});for(let t of n.removedLinkKeys){let n=e.graphData.links.find(e=>g(e)===t);n&&o.push({source:"object"==typeof n.source?n.source.id:n.source,target:"object"==typeof n.target?n.target.id:n.target,type:n.type,_removeTime:r})}return{...t,graphData:{nodes:a,links:o}}}let lW={open:"bg-emerald-500",in_progress:"bg-amber-500",blocked:"bg-red-500",deferred:"bg-violet-500",closed:"bg-zinc-400"};function lH(){let e,t,i,l,a,o,s,c,d,u,h,[x,m]=(0,r.useState)(null),[g,b]=(0,r.useState)(!0),[v,y]=(0,r.useState)(null),[w,j]=(0,r.useState)(null),[z,N]=(0,r.useState)(new Set),[C,S]=(0,r.useState)(new Set),[M,L]=(0,r.useState)(null),[A,T]=(0,r.useState)("status"),[E,D]=(0,r.useState)(new Set),[I,P]=(0,r.useState)("Beads"),[F,R]=(0,r.useState)(0),[O,$]=(0,r.useState)({}),{isAuthenticated:_,session:W}=(0,iO.useAuth)(),{theme:H,toggleTheme:U}=function(){let[e,t]=(0,r.useState)("light"),[n,i]=(0,r.useState)(!1);(0,r.useEffect)(()=>{i(!0);let e=localStorage.getItem("heartbeads-theme")||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");t(e),document.documentElement.classList.toggle("dark","dark"===e)},[]);let l=(0,r.useCallback)(e=>{t(e),localStorage.setItem("heartbeads-theme",e),document.documentElement.classList.toggle("dark","dark"===e)},[]),a=(0,r.useCallback)(()=>{l("dark"===e?"light":"dark")},[e,l]);return{theme:e,setTheme:l,toggleTheme:a,mounted:n}}(),{commentsByNode:V,commentedNodeIds:q,allComments:Y,refetch:K}=function(){let[e,t]=(0,r.useState)(new Map),[n,i]=(0,r.useState)(new Map),[l,a]=(0,r.useState)([]),[o,s]=(0,r.useState)(!0),[c,d]=(0,r.useState)(null),u=(0,r.useRef)(!1),h=(0,r.useCallback)(async()=>{try{s(!0),d(null);let e=await lC();u.current||(t(e.commentsByNode),i(e.commentedNodeIds),a(e.allComments))}catch(e){if(!u.current){let t=e instanceof Error?e.message:"Failed to fetch comments";console.error("Failed to fetch beads comments:",e),d(t)}}finally{u.current||s(!1)}},[]);return(0,r.useEffect)(()=>(u.current=!1,h(),()=>{u.current=!0}),[h]),{commentsByNode:e,commentedNodeIds:n,allComments:l,isLoading:o,error:c,refetch:h}}(),X=(e=(0,r.useRef)(lB()),t=(0,r.useCallback)(e=>{lO({node:e,profile:null,panel:null})},[]),i=(0,r.useCallback)(e=>{lO({profile:e,node:null,panel:null})},[]),l=(0,r.useCallback)(e=>{lO({panel:e,node:null,profile:null})},[]),a=(0,r.useCallback)(e=>{lO({epic:e})},[]),o=(0,r.useCallback)(e=>{lO({color:e})},[]),s=(0,r.useCallback)(e=>{lO({collapsed:e})},[]),c=(0,r.useCallback)(e=>{lO({filters:e})},[]),d=(0,r.useCallback)(e=>{lO({selected:e})},[]),u=(0,r.useCallback)(e=>{lO({replay:e})},[]),h=(0,r.useCallback)(()=>{window.history.replaceState(null,"",window.location.pathname)},[]),{...(0,r.useMemo)(()=>lB(),[]),initial:e.current,setNode:t,setProfile:i,setPanel:l,setEpic:a,setColor:o,setCollapsed:s,setFilters:c,setSelected:d,setReplay:u,clear:h}),[G,J]=(0,r.useState)(new Map),[Q,Z]=(0,r.useState)(new Set),[ee,et]=(0,r.useState)(!1),[en,er]=(0,r.useState)(0),[ei,el]=(0,r.useState)(!1),[ea,eo]=(0,r.useState)(1),[es,ec]=(0,r.useState)(null);(0,r.useEffect)(()=>{D(new Set)},[A]);let ed=(0,r.useMemo)(()=>x?new Set(x.graphData.nodes.map(e=>e.id)):new Set,[x]),eu=(0,r.useMemo)(()=>{let e=new Map;if(Y)for(let t of Y){if(!ed.has(t.nodeId)||e.has(t.nodeId)||Q.has(t.nodeId))continue;let n=t.text.trim();n.startsWith("@")&&-1===n.indexOf(" ")&&e.set(t.nodeId,{avatar:t.avatar,handle:t.handle,claimedAt:t.createdAt,did:t.did,rkey:t.rkey})}for(let[t,n]of G)e.has(t)||Q.has(t)||e.set(t,n);return e},[Y,G,Q,ed]),eh=(0,r.useMemo)(()=>{let e=new Map;if(!x||ee&&!es)return e;let t=new Map;for(let e of ee&&es?es.graphData.nodes:x.graphData.nodes)e.assignee&&e.assignee.includes(".")&&(eu.has(e.id)||(t.has(e.assignee)||t.set(e.assignee,[]),t.get(e.assignee).push(e)));for(let[n,r]of t){r.sort((e,t)=>{let n=t.updatedAt.localeCompare(e.updatedAt);return 0!==n?n:"closed"!==e.status&&"closed"===t.status?-1:"closed"===e.status&&"closed"!==t.status?1:e.id.localeCompare(t.id)});let t=r[0];e.set(t.id,{handle:n,avatar:void 0,updatedAt:t.updatedAt})}return e},[x,eu,ee,es]),[ep,ef]=(0,r.useState)(new Map);(0,r.useEffect)(()=>{if(0===eh.size)return;let e=new AbortController,t=[];for(let[,e]of eh)ep.has(e.handle)||t.push(e.handle);if(0===t.length)return;let n=[];for(let e=0;e<t.length;e+=5)n.push(t.slice(e,e+5));async function r(t){let n=t.map(async t=>{try{let n=await fetch(`https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=${encodeURIComponent(t)}`,{signal:e.signal});if(!n.ok)return null;let r=await n.json();return{handle:t,avatar:r.avatar}}catch(e){return null}}),r=await Promise.allSettled(n),i=new Map;for(let e of r)"fulfilled"===e.status&&e.value&&e.value.avatar&&i.set(e.value.handle,e.value.avatar);return i}return(async()=>{for(let e of n){let t=await r(e);t.size>0&&ef(e=>new Map([...e,...t]))}})(),()=>e.abort()},[eh]);let ex=(0,r.useMemo)(()=>{let e=new Map(eh);for(let[t,n]of e){let r=ep.get(n.handle);r&&e.set(t,{...n,avatar:r})}return e},[eh,ep]),em=(0,r.useMemo)(()=>{if(!x)return[];let e=x.graphData.nodes,t=new Map,n=e=>{if(!e)return null;let n=t.get(e);return n||(n={handle:e,createdCount:0,closedCount:0,commentCount:0},t.set(e,n)),n};for(let t of e){let e=t.createdBy||t.owner||t.assignee;if(e){let t=n(e);t&&t.createdCount++}if("closed"===t.status&&t.assignee){let e=n(t.assignee);e&&e.closedCount++}}if(Y){for(let e of Y)if(ed.has(e.nodeId)&&!(e.text.startsWith("@")&&-1===e.text.trim().indexOf(" "))){let t=n(e.handle);t&&(t.commentCount++,e.avatar&&!t.avatar&&(t.avatar=e.avatar),e.did&&!t.did&&(t.did=e.did))}}for(let[,e]of ex){let n=t.get(e.handle);n&&e.avatar&&!n.avatar&&(n.avatar=e.avatar)}for(let[e,n]of ep){let r=t.get(e);r&&!r.avatar&&(r.avatar=n)}let r=[];for(let e of t.values()){let t=3*e.closedCount+e.createdCount+e.commentCount;t>0&&r.push({...e,score:t})}return r.sort((e,t)=>t.score-e.score),r},[x,Y,ex,ep,ed]),[eg,ek]=(0,r.useState)(!1),[eb,ev]=(0,r.useState)(null),[ey,ew]=(0,r.useState)([]),[ej,ez]=(0,r.useState)(!1),[eN,eC]=(0,r.useState)(!0),[eS,eM]=(0,r.useState)(!1),[eL,eA]=(0,r.useState)(null),[eT,eE]=(0,r.useState)(!1),[eD,eI]=(0,r.useState)(!0),eP=iL(),eF=(0,r.useRef)(!1);(0,r.useEffect)(()=>{eF.current=eP},[eP]);let[eR,eB]=(0,r.useState)(!1),[eO,e$]=(0,r.useState)(null);(0,r.useEffect)(()=>{eI(eP),eC(eP)},[eP]),(0,r.useEffect)(()=>{if(!x)return;let e=Y?Y.filter(e=>ed.has(e.nodeId)):null,t=function(e,t,n){let r=[],i=new Set;function l(e){i.has(e.id)||(i.add(e.id),r.push(e))}for(let t of e){if(t.createdAt){let e=new Date(t.createdAt).getTime();isNaN(e)||l({id:`node-created:${t.id}:${e}`,type:"node-created",time:e,nodeId:t.id,nodeTitle:t.title,actor:t.createdBy?{handle:t.createdBy}:t.owner?{handle:t.owner}:t.assignee?{handle:t.assignee}:void 0,detail:t.issueType,meta:{issueType:t.issueType,prefix:t.prefix}})}if(t.closedAt){let e=new Date(t.closedAt).getTime();isNaN(e)||l({id:`node-closed:${t.id}:${e}`,type:"node-closed",time:e,nodeId:t.id,nodeTitle:t.title,actor:t.owner?{handle:t.owner}:t.createdBy?{handle:t.createdBy}:t.assignee?{handle:t.assignee}:void 0,detail:t.closeReason||"Closed",meta:{prefix:t.prefix}})}}for(let n of t)if(n.createdAt){let t=new Date(n.createdAt).getTime();if(!isNaN(t)){let r="object"==typeof n.source?n.source.id:n.source,i="object"==typeof n.target?n.target.id:n.target,a=e.find(e=>e.id===r);l({id:`link-added:${r}->${i}:${t}`,type:"link-added",time:t,nodeId:r,actor:a?.assignee?{handle:a.assignee}:void 0,detail:`${n.type} ${i}`,meta:{linkType:n.type,target:i}})}}if(n)for(let e of n){let t=new Date(e.createdAt).getTime();if(isNaN(t))continue;let n={handle:e.handle,avatar:e.avatar,did:e.did};for(let r of(l(e.text.startsWith("@")&&-1===e.text.trim().indexOf(" ")?{id:`task-claimed:${e.nodeId}:${t}`,type:"task-claimed",time:t,nodeId:e.nodeId,actor:n,detail:e.text}:e.replyTo?{id:`reply-added:${e.nodeId}:${e.rkey}`,type:"reply-added",time:t,nodeId:e.nodeId,actor:n,detail:e.text.length>80?e.text.slice(0,80)+"...":e.text}:{id:`comment-added:${e.nodeId}:${e.rkey}`,type:"comment-added",time:t,nodeId:e.nodeId,actor:n,detail:e.text.length>80?e.text.slice(0,80)+"...":e.text}),e.likes)){let t=new Date(r.createdAt).getTime();isNaN(t)||l({id:`like-added:${e.nodeId}:${r.rkey}`,type:"like-added",time:t,nodeId:e.nodeId,actor:{handle:r.handle,avatar:r.avatar,did:r.did},detail:`Liked comment by ${e.handle}`})}}return r.sort((e,t)=>t.time-e.time),r}(x.graphData.nodes,x.graphData.links,e);ew(e=>i5(e,t))},[x,Y,ed]),(0,r.useEffect)(()=>{if(0===ey.length)return;let e=new Map;if(Y)for(let t of Y)for(let n of(t.avatar&&t.handle&&e.set(t.handle,t.avatar),t.likes))n.avatar&&n.handle&&e.set(n.handle,n.avatar);let t=!1,n=new Map;for(let[r,i]of e)ep.has(r)||(n.set(r,i),t=!0);let r=new Set;for(let e of ey)if(e.actor&&!e.actor.avatar&&e.actor.handle){let t=e.actor.handle;if(ep.has(t)||n.has(t))continue;t.includes(".")&&!t.includes("@")&&r.add(t)}if(t&&0===r.size)return void ef(e=>new Map([...e,...n]));if(0===r.size){let e=!1,t=new Map([...ep,...n]),r=ey.map(n=>{if(n.actor&&!n.actor.avatar&&n.actor.handle){let r=t.get(n.actor.handle);if(r)return e=!0,{...n,actor:{...n.actor,avatar:r}}}return n});e&&ew(r);return}let i=new AbortController,l=[...r];return(async()=>{let e=new Map(n);for(let t=0;t<l.length;t+=5){let n=l.slice(t,t+5).map(async e=>{try{let t=await fetch(`https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=${encodeURIComponent(e)}`,{signal:i.signal});if(!t.ok)return null;let n=await t.json();return n.avatar?{handle:e,avatar:n.avatar}:null}catch{return null}});for(let t of(await Promise.allSettled(n)))"fulfilled"===t.status&&t.value&&e.set(t.value.handle,t.value.avatar)}e.size>0&&ef(t=>new Map([...t,...e]))})(),()=>i.abort()},[ey,ep,Y]);let[e_,eW]=(0,r.useState)(null),[eH,eU]=(0,r.useState)(null),[eV,eq]=(0,r.useState)(null),eY=(0,r.useMemo)(()=>{if(!eV||!x)return[];let e=eV.id,t=x.graphData.nodes,n=x.graphData.links,r=e=>"string"==typeof e?e:e?.id,i=new Map,l=new Map;for(let e of n){if(e._removeTime)continue;let t=r(e.source),n=r(e.target);t&&n&&(i.has(t)||i.set(t,new Set),i.has(n)||i.set(n,new Set),i.get(t).add(n),i.get(n).add(t),l.has(n)||l.set(n,new Set),l.get(n).add(t))}let a=new Set,o=[e];for(a.add(e);o.length>0;){let e=o.shift();for(let t of i.get(e)||[])a.has(t)||(a.add(t),o.push(t))}if(a.size<=1)return[];let s=(e,t)=>{let n=e.split("."),r=t.split(".");if(n[0]!==r[0])return e.localeCompare(t);for(let e=1;e<Math.max(n.length,r.length);e++){let t=e<n.length?parseInt(n[e],10):-1,i=e<r.length?parseInt(r[e],10):-1;if(t!==i)return t-i}return 0},c=new Map;for(let e of a)c.set(e,0);for(let e of a)for(let t of l.get(e)||[])a.has(t)&&c.set(e,(c.get(e)||0)+1);let d=new Map;for(let e of a)for(let t of l.get(e)||[])a.has(t)&&(d.has(t)||d.set(t,new Set),d.get(t).add(e));let u=[],h=Array.from(a).filter(e=>0===(c.get(e)||0)).sort(s);for(;h.length>0;){let e=h.shift();for(let t of(u.push(e),d.get(e)||[])){let e=(c.get(t)||1)-1;if(c.set(t,e),0===e){let e=h.findIndex(e=>s(e,t)>0);-1===e?h.push(t):h.splice(e,0,t)}}}if(u.length<a.size){let e=new Set(u),t=Array.from(a).filter(t=>!e.has(t)).sort(s);u.push(...t)}let p=new Map(t.map(e=>[e.id,e]));return u.map(e=>p.get(e)).filter(e=>null!=e&&!!e.description)},[eV,x]),eK=(0,r.useCallback)(e=>{let t;if(!eV||eY.length<=1)return;let n=eY.findIndex(e=>e.id===eV.id);-1!==n&&(t="next"===e?(n+1)%eY.length:(n-1+eY.length)%eY.length,eq(eY[t]))},[eV,eY]),eX=(0,r.useMemo)(()=>{if(!eV||eY.length<=1)return;let e=eY.findIndex(e=>e.id===eV.id);if(-1!==e)return`${e+1}/${eY.length}`},[eV,eY]),[eG,eJ]=(0,r.useState)(!1),[eQ,eZ]=(0,r.useState)(null),[e0,e1]=(0,r.useState)(null),[e5,e2]=(0,r.useState)(!1),[e4,e3]=(0,r.useState)(""),[e6,e8]=(0,r.useState)(0),[e7,e9]=(0,r.useState)(!0),[te,tt]=(0,r.useState)(!0),[tn,tr]=(0,r.useState)(!0),ti=(0,r.useRef)(null),tl=(0,r.useRef)(null),ta=(0,r.useRef)(null),to=(0,r.useRef)(!1);(0,r.useEffect)(()=>{let e=null,t=null,n=null,r=!0;return!function i(){(e=new EventSource("/api/beads/stream")).onmessage=e=>{if(r)try{let t=JSON.parse(e.data);if(t.error){y(t.error),b(!1);return}let n=ta.current,r=k(n,t);if(!n){ta.current=t,m(t),b(!1);return}if(!r.hasChanges)return;let i=function(e,t){let n=[],r=Date.now(),i=new Map(t.map(e=>[e.id,e]));for(let t of e.addedNodeIds){let e=i.get(t);n.push({id:`node-created:${t}:${r}`,type:"node-created",time:r,nodeId:t,nodeTitle:e?.title,actor:e?.assignee?{handle:e.assignee}:void 0,detail:e?.issueType||"task",meta:e?{issueType:e.issueType,prefix:e.prefix}:void 0})}for(let t of e.removedNodeIds){let e=i.get(t);n.push({id:`node-closed:${t}:${r}`,type:"node-closed",time:r,nodeId:t,actor:e?.assignee?{handle:e.assignee}:void 0,detail:"Removed"})}for(let[t,l]of e.changedNodes){let e=i.get(t);for(let i of l){let l;switch(i.field){case"status":default:l="node-status-changed";break;case"priority":l="node-priority-changed";break;case"title":l="node-title-changed";break;case"owner":l="node-owner-changed";break;case"assignee":l="node-assignee-changed"}n.push({id:`${l}:${t}:${r}:${i.field}`,type:l,time:r,nodeId:t,nodeTitle:e?.title,actor:e?.assignee?{handle:e.assignee}:void 0,detail:`${i.from} \u2192 ${i.to}`,meta:{field:i.field,from:i.from,to:i.to}})}}for(let t of e.addedLinkKeys){let e=t.match(/^(.+)->(.+):(.+)$/);if(e){let[,l,a,o]=e,s=i.get(l);n.push({id:`link-added:${t}:${r}`,type:"link-added",time:r,nodeId:l,actor:s?.assignee?{handle:s.assignee}:void 0,detail:`${o} ${a}`,meta:{linkType:o,target:a}})}}for(let t of e.removedLinkKeys){let e=t.match(/^(.+)->(.+):(.+)$/);if(e){let[,i,l,a]=e;n.push({id:`link-removed:${t}:${r}`,type:"link-removed",time:r,nodeId:i,detail:`${a} ${l}`,meta:{linkType:a,target:l}})}}return n}(r,t.graphData.nodes);i.length>0&&ew(e=>i5(e,i));let l=l_(n,t,r);ta.current=l,m(l)}catch(e){console.error("Failed to parse SSE message:",e)}},e.onerror=()=>{e?.readyState===EventSource.CLOSED&&(t=setTimeout(i,5e3))},n=setTimeout(()=>{r&&(ta.current||fetch("/api/beads").then(e=>e.json()).then(e=>{r&&!ta.current&&(ta.current=e,m(e),b(!1))}).catch(()=>{}))},5e3)}(),()=>{r=!1,e?.close(),t&&clearTimeout(t),n&&clearTimeout(n)}},[]),(0,r.useEffect)(()=>{fetch("/api/config").then(e=>e.json()).then(e=>{e.name&&P(e.name),e.repoCount&&R(e.repoCount),e.repoUrls&&$(e.repoUrls)}).catch(()=>{})},[]),(0,r.useEffect)(()=>{if(!x||to.current)return;to.current=!0;let e=X.initial;if(e.node){let t=x.graphData.nodes.find(t=>t.id===e.node);t&&j(t)}e.profile&&ev(e.profile),"comments"===e.panel&&ek(!0),"activity"===e.panel&&ez(!0),"help"===e.panel&&eM(!0),"leaderboard"===e.panel&&eE(!0),e.epic&&L(e.epic),e.color&&"status"!==e.color&&T(e.color),e.collapsed.size>0&&S(e.collapsed),e.filters.size>0&&D(e.filters),e.selected.size>0&&N(e.selected),e.replay&&et(!0)},[x]),(0,r.useEffect)(()=>{if(!x)return;let e=setTimeout(()=>{let e=Date.now(),t=x.graphData.nodes.filter(t=>!t._removeTime||e-t._removeTime<600),n=x.graphData.links.filter(t=>!t._removeTime||e-t._removeTime<600);(t.length!==x.graphData.nodes.length||n.length!==x.graphData.links.length)&&m(e=>e?{...e,graphData:{nodes:t,links:n}}:e)},700);return()=>clearTimeout(e)},[x]),(0,r.useEffect)(()=>{to.current&&(w?X.setNode(w.id):eb?X.setProfile(eb):eg?X.setPanel("comments"):ej?X.setPanel("activity"):eS?X.setPanel("help"):eT?X.setPanel("leaderboard"):X.setNode(null))},[w,eb,eg,ej,eS,eT]),(0,r.useEffect)(()=>{to.current&&X.setEpic(M)},[M]),(0,r.useEffect)(()=>{to.current&&X.setColor(A)},[A]),(0,r.useEffect)(()=>{to.current&&X.setCollapsed(C)},[C]),(0,r.useEffect)(()=>{to.current&&X.setFilters(E)},[E]),(0,r.useEffect)(()=>{to.current&&X.setSelected(z)},[z]),(0,r.useEffect)(()=>{to.current&&X.setReplay(ee)},[ee]);let ts=(0,r.useMemo)(()=>x?function(e,t){let n=[];for(let t of e){let e=new Date(t.createdAt).getTime();if(isNaN(e)||n.push({time:e,type:"node-created",id:t.id}),t.closedAt){let e=new Date(t.closedAt).getTime();isNaN(e)||n.push({time:e,type:"node-closed",id:t.id})}}n.sort((e,t)=>e.time-t.time);let r=n.length>0?n[0].time:Date.now(),i=n.length>0?n[n.length-1].time:Date.now();return{events:n,minTime:r,maxTime:i}}(x.graphData.nodes,x.graphData.links):null,[x]),tc=(0,r.useMemo)(()=>{if(!ee||!ts)return ey;if(-1===en)return[];if(0===ts.events.length)return ey;let e=ts.events[en];if(!e)return ey;let t=e.time;return ey.filter(e=>e.time<=t)},[ey,ee,ts,en]),td=(0,r.useMemo)(()=>{if(!ee||!ts||!es)return em;if(-1===en)return[];if(0===ts.events.length)return em;let e=ts.events[en];if(!e)return em;let t=e.time,n=es.graphData.nodes,r=new Map,i=e=>{if(!e)return null;let t=r.get(e);return t||(t={handle:e,createdCount:0,closedCount:0,commentCount:0},r.set(e,t)),t};for(let e of n){let t=e.createdBy||e.owner||e.assignee;if(t){let e=i(t);e&&e.createdCount++}if("closed"===e.status&&e.assignee){let t=i(e.assignee);t&&t.closedCount++}}if(Y){for(let e of Y)if(!(!ed.has(e.nodeId)||new Date(e.createdAt).getTime()>t)&&!(e.text.startsWith("@")&&-1===e.text.trim().indexOf(" "))){let t=i(e.handle);t&&(t.commentCount++,e.avatar&&!t.avatar&&(t.avatar=e.avatar),e.did&&!t.did&&(t.did=e.did))}}for(let[,e]of ex){let t=r.get(e.handle);t&&e.avatar&&!t.avatar&&(t.avatar=e.avatar)}for(let[e,t]of ep){let n=r.get(e);n&&!n.avatar&&(n.avatar=t)}let l=[];for(let e of r.values()){let t=3*e.closedCount+e.createdCount+e.commentCount;t>0&&l.push({...e,score:t})}return l.sort((e,t)=>t.score-e.score),l},[em,ee,ts,en,es,Y,ex,ep,ed]),tu=(0,r.useMemo)(()=>{let e,t;if(!eb||!x)return null;let n=ee&&es?es.graphData.nodes:x.graphData.nodes,r=ee&&ts&&en>=0?ts.events[en]?.time:void 0,i=Y?Y.filter(e=>ed.has(e.nodeId)):[],l=r?i.filter(e=>new Date(e.createdAt).getTime()<=r):i;if(eu){for(let[,n]of eu)if(n.handle===eb){e=e||n.avatar,t=t||n.did;break}}if(ex){for(let[,t]of ex)if(t.handle===eb){e=e||t.avatar;break}}for(let n of l)if(n.handle===eb){e=e||n.avatar,t=t||n.did;break}let a=n.filter(e=>e.assignee===eb),o=a.length,s=n.filter(e=>"closed"===e.status&&(e.assignee===eb||e.createdBy===eb)).length,c=0;if(eu)for(let[,e]of eu)e.handle===eb&&c++;let d=l.filter(e=>e.handle===eb),u=d.filter(e=>!(e.text.startsWith("@")&&-1===e.text.trim().indexOf(" "))).length,h=0;for(let e of l)for(let t of e.likes)t.handle===eb&&h++;let m=new Map;for(let e of n)(e.assignee===eb||e.createdBy===eb)&&m.set(e.prefix,(m.get(e.prefix)||0)+1);let g=Array.from(m.entries()).sort((e,t)=>t[1]-e[1]).map(([e,t])=>({prefix:e,prefixLabel:p(e),color:f(e),count:t})),k=[];for(let e of a)k.push({type:"assigned",nodeId:e.id,nodeTitle:e.title,time:e.updatedAt});for(let e of n)"closed"===e.status&&e.closedAt&&(e.assignee===eb||e.createdBy===eb)&&k.push({type:"closed",nodeId:e.id,nodeTitle:e.title,time:e.closedAt});for(let e of d)e.text.startsWith("@")&&-1===e.text.trim().indexOf(" ")||k.push({type:"commented",nodeId:e.nodeId,nodeTitle:n.find(t=>t.id===e.nodeId)?.title||e.nodeId,time:e.createdAt,detail:e.text.slice(0,60)+(e.text.length>60?"...":"")});for(let e of l)e.handle===eb&&e.text.startsWith("@")&&-1===e.text.trim().indexOf(" ")&&k.push({type:"claimed",nodeId:e.nodeId,nodeTitle:n.find(t=>t.id===e.nodeId)?.title||e.nodeId,time:e.createdAt});for(let e of l)for(let t of e.likes)t.handle===eb&&k.push({type:"liked",nodeId:e.nodeId,nodeTitle:n.find(t=>t.id===e.nodeId)?.title||e.nodeId,time:t.createdAt});k.sort((e,t)=>new Date(t.time).getTime()-new Date(e.time).getTime());let b=k.slice(0,20),v=b.length>0?b[0].time:void 0;return{handle:eb,avatar:e,did:t,assignedCount:o,closedCount:s,claimedCount:c,commentCount:u,likeCount:h,projects:g,recentActivity:b,lastActiveAt:v}},[eb,x,eu,ex,Y,ee,es,ts,en,ed]),th=(0,r.useCallback)(()=>{et(e=>{let t=!e;return t&&er(-1),el(!1),ec(null),t})},[]);(0,r.useEffect)(()=>{if(!ei||!ee||!ts)return;let e=setInterval(()=>{er(e=>{let t=e+1;return t>=ts.events.length?(el(!1),e):t})},2e3/ea);return()=>clearInterval(e)},[ei,ee,ea,ts]),(0,r.useEffect)(()=>{if(!ee||!x||!ts)return;if(-1===en)return void ec(e=>{let t={...x,graphData:{nodes:[],links:[]}};if(!e)return t;let n=k(e,t);return n.hasChanges?l_(e,t,n):e});if(0===ts.events.length)return;let e=ts.events[en];if(!e)return;let t=function(e,t,n){let r=new Set,i=[];for(let t of e){let e=new Date(t.createdAt).getTime();if(isNaN(e)||e>n)continue;r.add(t.id);let l=t.status;if(t.closedAt){let e=new Date(t.closedAt).getTime();!isNaN(e)&&e<=n?l="closed":"closed"===t.status&&(l="open")}l!==t.status?i.push({...t,status:l}):i.push(t)}let l=[];for(let e of t){let t="object"==typeof e.source?e.source.id:e.source,n="object"==typeof e.target?e.target.id:e.target;r.has(t)&&r.has(n)&&l.push({...e,source:t,target:n})}return{nodes:i,links:l}}(x.graphData.nodes,x.graphData.links,e.time),n={...x,graphData:{nodes:t.nodes,links:t.links}};ec(e=>{if(!e)return n;let t=k(e,n);return t.hasChanges?l_(e,n,t):e})},[ee,x,ts,en]);let tp=(0,r.useCallback)((e,t)=>{if((t?.metaKey||t?.ctrlKey)&&e.description){eq(e),ek(!1),ev(null);return}if(t?.shiftKey){N(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),j(null);return}j(t=>t?.id===e.id?null:e),N(new Set),ek(!1),ez(!1),eM(!1),ev(null),eE(!1),eA(null),eB(!1),e$(null)},[]),tf=(0,r.useCallback)((e,t,n)=>{eF.current||e1(e?{node:e,x:t,y:n}:null)},[]),tx=(0,r.useCallback)(e=>{ev(e.handle),j(null),ek(!1),ez(!1),eM(!1),eE(!1),eA(null),eZ(null)},[]),tm=(0,r.useCallback)(e=>{S(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),tg=(0,r.useMemo)(()=>{if(!x)return new Set;let{nodes:e,links:t}=x.graphData,n=new Set;for(let e of t)if("parent-child"===e.type){let t="object"==typeof e.source?e.source.id:e.source;n.add(t)}let r=new Set(e.map(e=>e.id));for(let t of e)if(t.id.includes(".")){let e=t.id.split(".")[0];r.has(e)&&n.add(e)}return n},[x]),tk=(0,r.useCallback)(()=>{S(new Set(tg))},[tg]),tb=(0,r.useCallback)(()=>{S(new Set)},[]),tv=(0,r.useCallback)(e=>{L(e)},[]),ty=(0,r.useCallback)(()=>{L(null)},[]),tw=(0,r.useCallback)(()=>{eM(!0),j(null),ek(!1),ez(!1),eE(!1),eA(0)},[]),tj=(0,r.useCallback)(()=>{eA(e=>null===e?null:e>=i6.length-1?e:e+1)},[]),tz=(0,r.useCallback)(()=>{eA(e=>null===e||e<=0?e:e-1)},[]),tN=(0,r.useCallback)(()=>{eA(null)},[]),tC=(0,r.useCallback)(()=>{j(null),N(new Set),eW(null),eU(null),e$(null),ev(null),eE(!1)},[]),tS=(0,r.useCallback)((e,t)=>{eF.current||(eU(null),e1(null),e.description||_||"epic"===e.issueType?eW({node:e,x:t.clientX,y:t.clientY}):eU({node:e,x:t.clientX,y:t.clientY}))},[_]),tM=(0,r.useCallback)(e=>{eU(null),e1(null),e$({node:e})},[]),tL=(0,r.useCallback)(async(e,t)=>{let n=await fetch("/api/records",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({collection:"org.impactindexer.review.comment",record:{$type:"org.impactindexer.review.comment",subject:{uri:`beads:${e}`,type:"record"},text:t,createdAt:new Date().toISOString()}})});if(!n.ok)throw Error((await n.json()).error||"Failed to post comment");await K()},[K]),tA=(0,r.useCallback)(async e=>{if(!W?.handle)return;let t=W.avatar;if(!t&&W.did)try{let e=await fetch(`https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=${encodeURIComponent(W.did)}`);e.ok&&(t=(await e.json()).avatar)}catch{}J(n=>{let r=new Map(n);return r.set(e,{avatar:t,claimedAt:new Date().toISOString(),handle:W.handle}),r}),await tL(e,`@${W.handle}`),setTimeout(()=>K(),3e3)},[W?.handle,W?.did,W?.avatar,tL,K]),tT=(0,r.useCallback)(async e=>{let t=await fetch(`/api/records?collection=${encodeURIComponent("org.impactindexer.review.comment")}&rkey=${encodeURIComponent(e.rkey)}`,{method:"DELETE"});if(!t.ok)throw Error((await t.json()).error||"Failed to delete comment");await K()},[K]),tE=(0,r.useCallback)(async e=>{let t=eu.get(e);t&&(Z(t=>new Set(t).add(e)),J(t=>{let n=new Map(t);return n.delete(e),n}),t.rkey?(await tT({rkey:t.rkey}),Z(t=>{let n=new Set(t);return n.delete(e),n})):setTimeout(async()=>{await K(),Z(t=>{let n=new Set(t);return n.delete(e),n})},3e3))},[eu,tT,K]),tD=(0,r.useCallback)(async e=>{let t=e.likes.find(e=>e.did===W?.did);if(t){let e=await fetch(`/api/records?collection=${encodeURIComponent("org.impactindexer.review.like")}&rkey=${encodeURIComponent(t.rkey)}`,{method:"DELETE"});if(!e.ok)throw Error((await e.json()).error||"Failed to unlike")}else{let t=await fetch("/api/records",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({collection:"org.impactindexer.review.like",record:{subject:{uri:e.uri,type:"record"},createdAt:new Date().toISOString()}})});if(!t.ok)throw Error((await t.json()).error||"Failed to like")}await K()},[W?.did,K]),tI=(0,r.useCallback)(async(e,t)=>{let n=await fetch("/api/records",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({collection:"org.impactindexer.review.comment",record:{subject:{uri:`beads:${e.nodeId}`,type:"record"},text:t,replyTo:e.uri,createdAt:new Date().toISOString()}})});if(!n.ok)throw Error((await n.json()).error||"Failed to post reply");await K()},[K]),tP=(0,r.useCallback)(e=>{if(!x)return;let t=x.graphData.nodes.find(t=>t.id===e);t&&j(t)},[x]),tF=(0,r.useMemo)(()=>{let e=new Map;if(!Y)return e;let t=new Map;for(let e of Y)t.has(e.nodeId)||t.set(e.nodeId,new Set),t.get(e.nodeId).add(e.handle),e.displayName&&t.get(e.nodeId).add(e.displayName);for(let[n,r]of t)e.set(n,Array.from(r).join(" "));return e},[Y]),tR=(0,r.useMemo)(()=>{if(!x||!e4.trim())return[];let e=e4.toLowerCase();return x.graphData.nodes.filter(t=>{let n=tF.get(t.id)||"";return`${t.id} ${t.title} ${t.prefix} ${t.owner||""} ${t.assignee||""} ${t.createdBy||""} ${n}`.toLowerCase().includes(e)}).slice(0,8)},[e4,x,tF]);(0,r.useEffect)(()=>{e8(0)},[e4]);let tB=(0,r.useCallback)(e=>{ti.current?.focusNode(e),e2(!1),e3(""),e8(0)},[]),tO=(0,r.useCallback)(e=>{for(let[t,n]of eu)if(n.handle===e)return t;for(let[t,n]of ex)if(n.handle===e)return t;if(x){let t=x.graphData.nodes.filter(t=>t.assignee===e&&"closed"!==t.status).sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt));if(t.length>0)return t[0].id}return null},[eu,ex,x]);(0,r.useEffect)(()=>{let e=e=>{let t=e.target?.tagName;if("INPUT"===t||"TEXTAREA"===t||e.target?.isContentEditable)return;if((e.ctrlKey||e.metaKey)&&"f"===e.key&&(e.preventDefault(),e2(!0),setTimeout(()=>tl.current?.focus(),50)),"Escape"===e.key&&e5&&(e2(!1),e3(""),e8(0)),e.shiftKey&&"Digit0"===e.code){e.preventDefault();let t=tc.length>0?tc[0].nodeId:null;if(t&&x){let e=x.graphData.nodes.find(e=>e.id===t);e&&ti.current?.focusNode(e)}}let n=e.code.match(/^Digit([1-9])$/);if(e.shiftKey&&n){e.preventDefault();let t=td[parseInt(n[1],10)-1];if(!t||!x)return;let r=tO(t.handle);if(r){let e=x.graphData.nodes.find(e=>e.id===r);e&&ti.current?.focusNode(e)}}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[e5,tc,x,td,tO]);let t$=(0,r.useCallback)(e=>{"ArrowDown"===e.key?(e.preventDefault(),e8(e=>Math.min(e+1,tR.length-1))):"ArrowUp"===e.key?(e.preventDefault(),e8(e=>Math.max(e-1,0))):"Enter"===e.key&&tR.length>0&&(e.preventDefault(),tB(tR[e6]))},[tR,e6,tB]);return g?(0,n.jsxs)("div",{className:"h-screen flex flex-col items-center justify-center bg-white dark:bg-zinc-900 text-zinc-800 dark:text-zinc-200 px-6 select-none",children:[(0,n.jsxs)("div",{className:"relative w-full max-w-sm mb-8",children:[(0,n.jsx)("svg",{viewBox:"0 0 400 40",fill:"none",className:"w-full text-zinc-200 dark:text-zinc-700","aria-hidden":"true",children:(0,n.jsx)("line",{x1:"0",y1:"20",x2:"400",y2:"20",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:"4 6",opacity:"0.6"})}),(0,n.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,n.jsx)("div",{className:"bg-white dark:bg-zinc-900 px-4",children:(0,n.jsx)(i_.BeadsLogo,{className:"w-10 h-10 text-emerald-500"})})})]}),(0,n.jsx)("p",{className:"text-sm text-zinc-500 dark:text-zinc-400 font-light animate-fade-in",children:"Warming up the heartbeat..."}),(0,n.jsx)("p",{className:"text-xs text-zinc-400 dark:text-zinc-500 mt-1.5 animate-fade-in",style:{animationDelay:"0.1s"},children:"Discovering issues and mapping dependencies"})]}):v?(0,n.jsx)("div",{className:"h-screen flex items-center justify-center bg-white",children:(0,n.jsxs)("div",{className:"max-w-sm text-center",children:[(0,n.jsx)("div",{className:"w-14 h-14 mx-auto mb-4 bg-red-50 rounded-full flex items-center justify-center",children:(0,n.jsx)("svg",{className:"w-7 h-7 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,n.jsx)("h2",{className:"text-lg font-semibold text-zinc-900 mb-1",children:"Unable to load data"}),(0,n.jsx)("p",{className:"text-sm text-zinc-500 mb-4",children:v}),(0,n.jsxs)("button",{onClick:()=>window.location.reload(),className:"inline-flex items-center gap-2 px-4 py-2 bg-emerald-600 text-white text-sm rounded-lg hover:bg-emerald-700 transition-colors",children:[(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Try Again"]})]})}):x?(0,n.jsxs)("div",{className:"h-screen flex flex-col overflow-hidden bg-white dark:bg-black",children:[(0,n.jsx)("header",{className:"sticky top-0 z-50 shrink-0 bg-white/95 dark:bg-black/95 backdrop-blur-sm border-b border-zinc-200/80 dark:border-zinc-800/80",children:(0,n.jsxs)("div",{className:"px-3 sm:px-6 h-14 flex items-center",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 shrink-0 group",children:[(0,n.jsx)(i_.BeadsLogo,{className:"w-8 h-8 text-emerald-500 transition-transform group-hover:scale-105"}),(0,n.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,n.jsx)("h1",{className:"text-[15px] font-semibold text-zinc-900 dark:text-zinc-100 tracking-tight",children:I}),(0,n.jsx)("span",{className:"font-normal text-zinc-400 text-[15px] hidden sm:inline",children:"Heartbeads"}),(0,n.jsxs)("span",{className:"text-[10px] text-zinc-400 bg-zinc-100 dark:bg-zinc-800 rounded-full px-1.5 py-0.5 font-medium hidden sm:inline",children:["v","0.6.4"]})]})]}),(0,n.jsx)("div",{className:"flex-1 flex justify-center px-2 sm:px-4",children:(0,n.jsx)("div",{className:"relative w-full max-w-md","data-tutorial":"search",children:e5?(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsxs)("div",{className:"flex items-center bg-white dark:bg-zinc-900 rounded-full border border-zinc-200 dark:border-zinc-700 shadow-sm overflow-hidden",children:[(0,n.jsx)("div",{className:"pl-3 pr-1 text-zinc-400 dark:text-zinc-500",children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),(0,n.jsx)("input",{ref:tl,type:"text",value:e4,onChange:e=>e3(e.target.value),onKeyDown:t$,placeholder:"Search issues...",className:"flex-1 px-2 py-1.5 text-xs text-zinc-800 dark:text-zinc-200 bg-transparent outline-none placeholder:text-zinc-400 dark:placeholder:text-zinc-500",autoFocus:!0}),(0,n.jsx)("button",{onClick:()=>{e2(!1),e3(""),e8(0)},className:"px-2 py-1.5 text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300",children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),e4.trim()&&(0,n.jsxs)("div",{className:"absolute top-full left-0 right-0 mt-2 bg-white dark:bg-zinc-900 rounded-xl border border-zinc-100 dark:border-zinc-800 shadow-xl overflow-hidden max-h-72 overflow-y-auto z-50",children:[0===tR.length?(0,n.jsx)("div",{className:"px-3 py-3 text-xs text-zinc-400 dark:text-zinc-500 text-center",children:"No matching issues"}):tR.map((e,t)=>(0,n.jsxs)("button",{onClick:()=>tB(e),onMouseEnter:()=>e8(t),className:`w-full text-left px-3 py-2 text-xs transition-colors flex items-start gap-2.5 ${t===e6?"bg-emerald-50 dark:bg-emerald-950":"hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,children:[(0,n.jsx)("div",{className:"shrink-0 mt-1",children:(0,n.jsx)("div",{className:`w-2 h-2 rounded-full ${lW[e.status]||"bg-zinc-400"}`})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("span",{className:"font-medium text-zinc-600 dark:text-zinc-400 shrink-0",children:e.id}),e.priority<=1&&(0,n.jsx)("span",{className:"text-[10px]",children:0===e.priority?"🔥🔥":"🔥"})]}),(0,n.jsx)("div",{className:"text-zinc-400 dark:text-zinc-500 truncate mt-0.5",children:e.title})]}),(0,n.jsx)("span",{className:"shrink-0 text-[10px] text-zinc-400 dark:text-zinc-500 bg-zinc-100 dark:bg-zinc-800 rounded px-1 py-0.5 mt-0.5",children:e.prefix})]},e.id)),tR.length>0&&(0,n.jsxs)("div",{className:"px-3 py-1.5 text-[10px] text-zinc-400 dark:text-zinc-500 border-t border-zinc-100 dark:border-zinc-800 bg-zinc-50/50 dark:bg-zinc-800/50 flex items-center justify-between",children:[(0,n.jsxs)("span",{children:[tR.length," result",1!==tR.length?"s":""]}),(0,n.jsxs)("span",{children:[(0,n.jsx)("kbd",{className:"px-1 py-0.5 bg-white dark:bg-zinc-800 rounded border border-zinc-200 dark:border-zinc-700 text-[9px] font-mono",children:"Enter"})," ","to focus"]})]})]})]}):(0,n.jsxs)("button",{onClick:()=>{e2(!0),setTimeout(()=>tl.current?.focus(),50)},className:"w-full flex items-center gap-2 px-3.5 py-1.5 text-sm text-zinc-400 rounded-full bg-zinc-50/80 dark:bg-zinc-800/80 border border-zinc-200/60 dark:border-zinc-700/60 hover:text-zinc-500 dark:hover:text-zinc-300 hover:border-zinc-300 dark:hover:border-zinc-600 hover:bg-zinc-100/50 dark:hover:bg-zinc-700/50 transition-all",title:"Search issues (Ctrl+F)",children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),(0,n.jsx)("span",{className:"flex-1 text-left",children:"Search issues..."}),(0,n.jsxs)("kbd",{className:"hidden sm:inline-block px-1 py-0.5 bg-zinc-100 dark:bg-zinc-700 rounded border border-zinc-200 dark:border-zinc-600 text-[9px] font-mono text-zinc-400 dark:text-zinc-500",children:["u">typeof navigator&&navigator.platform?.includes("Mac")?"⌘":"Ctrl","F"]})]})})}),(0,n.jsx)("button",{onClick:()=>eB(!0),className:"md:hidden p-2 text-zinc-500 hover:text-zinc-700 hover:bg-zinc-50 dark:text-zinc-400 dark:hover:text-zinc-200 dark:hover:bg-zinc-800 rounded-full transition-colors shrink-0","aria-label":"Open menu",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})})}),(0,n.jsxs)("div",{className:"hidden md:flex items-center gap-1 shrink-0","data-tutorial":"nav-pills",children:[(0,n.jsxs)("button",{onClick:th,"data-tutorial":"nav-replay",className:`flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-full transition-colors ${ee?"text-emerald-700 bg-emerald-50 dark:text-emerald-400 dark:bg-emerald-950":"text-zinc-500 hover:text-zinc-900 hover:bg-zinc-50 dark:text-zinc-400 dark:hover:text-zinc-100 dark:hover:bg-zinc-800"}`,children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,n.jsx)("polyline",{points:"8,4 8,8 11,10"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Replay"})]}),(0,n.jsxs)("button",{onClick:()=>{ek(e=>!e),eg||(j(null),ez(!1),eM(!1),ev(null),eE(!1),eA(null))},"data-tutorial":"nav-comments",className:`flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-full transition-colors ${eg?"text-emerald-700 bg-emerald-50 dark:text-emerald-400 dark:bg-emerald-950":"text-zinc-500 hover:text-zinc-900 hover:bg-zinc-50 dark:text-zinc-400 dark:hover:text-zinc-100 dark:hover:bg-zinc-800"}`,children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 011.037-.443 48.282 48.282 0 005.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z"})}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Comments"})]}),(0,n.jsxs)("button",{onClick:()=>{ez(e=>!e),ej||(j(null),ek(!1),eM(!1),ev(null),eE(!1),eA(null))},"data-tutorial":"nav-activity",className:`flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-full transition-colors ${ej?"text-emerald-700 bg-emerald-50 dark:text-emerald-400 dark:bg-emerald-950":"text-zinc-500 hover:text-zinc-900 hover:bg-zinc-50 dark:text-zinc-400 dark:hover:text-zinc-100 dark:hover:bg-zinc-800"}`,children:[(0,n.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,n.jsx)("polyline",{points:"8,4 8,8 11,10"})]}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Activity"})]}),(0,n.jsxs)("button",{onClick:()=>{eM(e=>!e),eS||(j(null),ek(!1),ez(!1),ev(null),eE(!1))},"data-tutorial":"nav-learn",className:`flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-full transition-colors ${eS?"text-emerald-700 bg-emerald-50 dark:text-emerald-400 dark:bg-emerald-950":"text-zinc-500 hover:text-zinc-900 hover:bg-zinc-50 dark:text-zinc-400 dark:hover:text-zinc-100 dark:hover:bg-zinc-800"}`,children:[(0,n.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18v-5.25m0 0a6.01 6.01 0 001.5-.189m-1.5.189a6.01 6.01 0 01-1.5-.189m3.75 7.478a12.06 12.06 0 01-4.5 0m3.75 2.383a14.406 14.406 0 01-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 10-7.517 0c.85.493 1.509 1.333 1.509 2.316V18"})}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Learn"})]}),(0,n.jsx)("div",{className:"w-px h-5 bg-zinc-200 dark:bg-zinc-700 mx-2"}),(0,n.jsxs)("span",{"data-tutorial":"auth-section",className:"flex items-center",children:[(0,n.jsx)("button",{onClick:()=>eJ(!0),className:"p-1.5 text-zinc-400 hover:text-zinc-600 dark:text-zinc-500 dark:hover:text-zinc-300 rounded-full hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",title:"Settings",children:(0,n.jsxs)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:[(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 010 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 010-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28z"}),(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),(0,n.jsx)("button",{onClick:U,className:"p-1.5 text-zinc-400 hover:text-zinc-600 dark:text-zinc-500 dark:hover:text-zinc-300 rounded-full hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",title:"dark"===H?"Switch to light mode":"Switch to dark mode","data-tutorial":"btn-theme",children:"dark"===H?(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z"})}):(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z"})})}),(0,n.jsx)(i$,{onViewProfile:e=>{ev(e),j(null),ek(!1),ez(!1),eM(!1),eE(!1),eA(null)}})]})]})]})}),eR&&(0,n.jsxs)("div",{className:"md:hidden fixed inset-0 z-[60]",children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-[2px]",onClick:()=>eB(!1)}),(0,n.jsxs)("div",{className:"absolute top-0 right-0 h-full w-72 bg-white dark:bg-zinc-900 shadow-2xl flex flex-col animate-slide-in-right",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 border-b border-zinc-100 dark:border-zinc-800",children:[(0,n.jsx)("span",{className:"text-sm font-semibold text-zinc-700 dark:text-zinc-100",children:"Menu"}),(0,n.jsx)("button",{onClick:()=>eB(!1),className:"p-1.5 text-zinc-400 dark:text-zinc-500 hover:text-zinc-600 dark:hover:text-zinc-300 rounded-full hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsxs)("nav",{className:"flex-1 overflow-y-auto py-2",children:[(0,n.jsxs)("button",{onClick:()=>{th(),eB(!1)},className:`w-full flex items-center gap-3 px-5 py-3.5 text-sm font-medium transition-colors ${ee?"text-emerald-700 bg-emerald-50 dark:text-emerald-400 dark:bg-emerald-950":"text-zinc-600 dark:text-zinc-400 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,children:[(0,n.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,n.jsx)("polyline",{points:"8,4 8,8 11,10"})]}),"Replay"]}),(0,n.jsxs)("button",{onClick:()=>{ek(e=>!e),eg||(j(null),ez(!1),eM(!1),eE(!1),eA(null)),eB(!1)},className:`w-full flex items-center gap-3 px-5 py-3.5 text-sm font-medium transition-colors ${eg?"text-emerald-700 bg-emerald-50 dark:text-emerald-400 dark:bg-emerald-950":"text-zinc-600 dark:text-zinc-400 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,children:[(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 011.037-.443 48.282 48.282 0 005.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z"})}),"Comments"]}),(0,n.jsxs)("button",{onClick:()=>{ez(e=>!e),ej||(j(null),ek(!1),eM(!1),eE(!1),eA(null)),eB(!1)},className:`w-full flex items-center gap-3 px-5 py-3.5 text-sm font-medium transition-colors ${ej?"text-emerald-700 bg-emerald-50 dark:text-emerald-400 dark:bg-emerald-950":"text-zinc-600 dark:text-zinc-400 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,children:[(0,n.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,n.jsx)("polyline",{points:"8,4 8,8 11,10"})]}),"Activity"]}),(0,n.jsxs)("button",{onClick:()=>{eM(e=>!e),eS||(j(null),ek(!1),ez(!1),eE(!1)),eB(!1)},className:`w-full flex items-center gap-3 px-5 py-3.5 text-sm font-medium transition-colors ${eS?"text-emerald-700 bg-emerald-50 dark:text-emerald-400 dark:bg-emerald-950":"text-zinc-600 dark:text-zinc-400 hover:bg-zinc-50 dark:hover:bg-zinc-800"}`,children:[(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18v-5.25m0 0a6.01 6.01 0 001.5-.189m-1.5.189a6.01 6.01 0 01-1.5-.189m3.75 7.478a12.06 12.06 0 01-4.5 0m3.75 2.383a14.406 14.406 0 01-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 10-7.517 0c.85.493 1.509 1.333 1.509 2.316V18"})}),"Learn"]}),(0,n.jsx)("div",{className:"h-px bg-zinc-100 dark:bg-zinc-800 mx-4 my-2"}),(0,n.jsxs)("button",{onClick:()=>{eJ(!0),eB(!1)},className:"w-full flex items-center gap-3 px-5 py-3.5 text-sm font-medium text-zinc-600 dark:text-zinc-400 hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors",children:[(0,n.jsxs)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:[(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 010 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 010-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28z"}),(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),"Settings"]}),(0,n.jsx)("div",{className:"px-5 py-3.5",children:(0,n.jsx)(i$,{onViewProfile:e=>{ev(e),j(null),ek(!1),ez(!1),eM(!1),eE(!1),eA(null),eB(!1)}})})]})]})]}),(0,n.jsxs)("div",{className:"flex-1 flex overflow-hidden relative",children:[(0,n.jsxs)("div",{className:"flex-1 relative bg-zinc-50/50 dark:bg-black",children:[(0,n.jsx)("div",{className:"absolute inset-0 opacity-[0.03] dark:opacity-[0.06]",style:{backgroundImage:"radial-gradient(circle, currentColor 1px, transparent 1px)",backgroundSize:"24px 24px"}}),(0,n.jsx)(B,{ref:ti,nodes:ee&&es?es.graphData.nodes:x.graphData.nodes,links:ee&&es?es.graphData.links:x.graphData.links,selectedNode:w,selectedNodeIds:z,onSelectedNodeIdsChange:N,onNodeClick:tp,onNodeHover:tf,onBackgroundClick:tC,onNodeRightClick:tS,commentedNodeIds:q,claimedNodeAvatars:eu,assigneeNodeAvatars:ex,onAvatarHover:eZ,onAvatarClick:tx,timelineActive:ee,stats:x.stats,sidebarOpen:!!w||eg||ej||eS||!!eb||eT,collapsedEpicIds:C,onCollapseAll:tk,onExpandAll:tb,focusedEpicId:M,onExitFocusedEpic:ty,colorMode:A,onColorModeChange:T,activeLegendFilters:E,onToggleLegendFilter:e=>D(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),onClearLegendFilters:()=>D(new Set),autoFit:e7,onAutoFitToggle:()=>e9(e=>!e),pulseNodeId:tc.length>0?tc[0].nodeId:null,showPulse:te,onShowPulseToggle:()=>tt(e=>!e),showParticles:tn,onShowParticlesToggle:()=>tr(e=>!e),isMobile:eP,onNodeDoubleTap:tM,theme:H}),ee&&ts&&ts.events.length>0&&(0,n.jsx)("div",{className:"absolute bottom-4 z-10 transition-[right] duration-300 ease-out",style:{right:w||eg||ej?"calc(360px + 1rem)":"1rem"},children:(0,n.jsx)(l$,{totalSteps:ts.events.length,currentStep:Math.max(en,0),currentTime:en>=0?ts.events[en]?.time??ts.minTime:ts.minTime,isPlaying:ei,speed:ea,onStepChange:er,onPlayPause:()=>el(e=>!e),onSpeedChange:eo})}),!w&&!eg&&!ej&&!eS&&!eb&&!eT&&(0,n.jsxs)("div",{className:"absolute top-3 right-3 sm:top-4 sm:right-4 z-10 flex flex-col items-end gap-2","data-tutorial":"overlays",children:[(0,n.jsx)(i1,{events:tc,collapsed:eN,compact:eP,onToggleCollapse:()=>eC(e=>!e),onExpandPanel:()=>{ez(!0),j(null),ek(!1),eM(!1),eE(!1)},onNodeClick:e=>{let t=x?.graphData.nodes.find(t=>t.id===e);t&&tB(t)},onHandleClick:e=>{ev(e),j(null),ek(!1),eM(!1),eE(!1)}}),(0,n.jsx)(lu,{entries:td,collapsed:eD,compact:eP,onToggleCollapse:()=>eI(e=>!e),onExpandPanel:()=>{eE(!0),j(null),ek(!1),ez(!1),eM(!1),ev(null)},onProfileClick:e=>{ev(e),j(null),ek(!1),ez(!1),eM(!1),eE(!1);let t=tO(e);t&&ti.current?.zoomToNode(t)}})]}),e_&&(0,n.jsx)(iH,{node:e_.node,x:e_.x,y:e_.y,onShowDescription:()=>{eq(e_.node),eW(null)},onAddComment:()=>{eU({node:e_.node,x:e_.x,y:e_.y}),eW(null)},onClaimTask:_&&!eu.has(e_.node.id)?()=>{tA(e_.node.id),eW(null)}:void 0,onUnclaimTask:(()=>{if(!_)return;let e=eu.get(e_.node.id);if(e&&(e.did===W?.did||!e.did))return()=>{tE(e_.node.id),eW(null)}})(),onCollapseEpic:"epic"!==e_.node.issueType||C.has(e_.node.id)?void 0:()=>{tm(e_.node.id),eW(null)},onUncollapseEpic:"epic"===e_.node.issueType&&C.has(e_.node.id)?()=>{tm(e_.node.id),eW(null)}:void 0,onFocusEpic:"epic"!==e_.node.issueType||M?void 0:()=>{tv(e_.node.id),eW(null)},onExitFocusEpic:"epic"===e_.node.issueType&&M===e_.node.id?()=>{ty(),eW(null)}:void 0,onClose:()=>eW(null)}),eO&&(0,n.jsx)(lf,{node:eO.node,onShowDescription:eO.node.description?()=>{eq(eO.node),e$(null)}:void 0,onAddComment:()=>{eU({node:eO.node,x:window.innerWidth/2,y:window.innerHeight/2}),e$(null)},onClaimTask:_&&!eu.has(eO.node.id)?()=>{tA(eO.node.id),e$(null)}:void 0,onUnclaimTask:(()=>{if(!_)return;let e=eu.get(eO.node.id);if(e&&(e.did===W?.did||!e.did))return()=>{tE(eO.node.id),e$(null)}})(),onCollapseEpic:"epic"!==eO.node.issueType||C.has(eO.node.id)?void 0:()=>{tm(eO.node.id),e$(null)},onUncollapseEpic:"epic"===eO.node.issueType&&C.has(eO.node.id)?()=>{tm(eO.node.id),e$(null)}:void 0,onFocusEpic:"epic"!==eO.node.issueType||M?void 0:()=>{tv(eO.node.id),e$(null)},onExitFocusEpic:"epic"===eO.node.issueType&&M===eO.node.id?()=>{ty(),e$(null)}:void 0,onClose:()=>e$(null)}),eH&&(0,n.jsx)(iW,{node:eH.node,x:eH.x,y:eH.y,onClose:()=>eU(null),onSubmit:async e=>{await tL(eH.node.id,e),eU(null)},isAuthenticated:_,existingComments:V.get(eH.node.id)}),eV&&(0,n.jsx)(iT,{node:eV,onClose:()=>eq(null),repoUrl:O[eV.prefix],onOpenSettings:()=>eJ(!0),onNavigate:eY.length>1?eK:void 0,navigationLabel:eX}),(0,n.jsx)(lp,{isOpen:eG,onClose:()=>eJ(!1)}),e0&&!eQ&&!eP&&(0,n.jsx)(iU,{node:e0.node,x:e0.x,y:e0.y,prefixColor:f(e0.node.prefix),allNodes:ee&&es?es.graphData.nodes:x.graphData.nodes,theme:H}),eQ&&!eP&&(0,n.jsx)("div",{style:{position:"fixed",left:eQ.x+12,top:eQ.y-8,zIndex:90,pointerEvents:"none"},children:(0,n.jsxs)("div",{className:"flex items-center gap-2 bg-white dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-700 rounded-lg shadow-lg px-2.5 py-2",children:[eQ.avatar?(0,n.jsx)("img",{src:eQ.avatar,alt:"",className:"w-6 h-6 rounded-full shrink-0"}):(0,n.jsx)("div",{className:"w-6 h-6 rounded-full bg-zinc-200 dark:bg-zinc-700 flex items-center justify-center text-[10px] font-medium text-zinc-500 dark:text-zinc-400 shrink-0",children:eQ.handle.charAt(0).toUpperCase()}),(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsxs)("span",{className:"text-xs text-zinc-700 dark:text-zinc-300 whitespace-nowrap",children:[(0,n.jsx)("span",{className:"font-semibold text-zinc-800 dark:text-zinc-200",children:eQ.handle})," ",eQ.isAssignee?eQ.nodeClosed?"closed":"is assigned to":eQ.nodeClosed?"closed":"claimed"," ",(0,n.jsx)("span",{className:"font-mono text-emerald-700 dark:text-emerald-400",children:eQ.nodeId})]}),(0,n.jsx)("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500",children:ih(eQ.claimedAt)})]})]})})]}),(0,n.jsxs)("aside",{className:`hidden md:flex absolute top-0 right-0 h-full w-[360px] bg-white dark:bg-zinc-900 border-l border-zinc-200 dark:border-zinc-700 flex-col shadow-xl z-30 transform transition-transform duration-300 ease-out ${w?"translate-x-0":"translate-x-full"}`,children:[(0,n.jsxs)("div",{className:"shrink-0 px-5 py-3 border-b border-zinc-100 dark:border-zinc-800 flex items-center justify-between",children:[(0,n.jsx)("h2",{className:"text-xs font-semibold text-zinc-400 uppercase tracking-wider",children:"Node Detail"}),(0,n.jsx)("button",{onClick:()=>{j(null)},className:"p-1 text-zinc-400 hover:text-zinc-600 dark:text-zinc-500 dark:hover:text-zinc-300 dark:hover:bg-zinc-800 transition-colors rounded-full hover:bg-zinc-100",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar px-5 py-4 space-y-5",children:(0,n.jsx)(iD,{node:w,allNodes:x.graphData.nodes,onNodeNavigate:tP,comments:w?V.get(w.id):void 0,onPostComment:w?e=>tL(w.id,e):void 0,onDeleteComment:tT,onLikeComment:tD,onReplyComment:tI,isAuthenticated:_,currentDid:W?.did,repoUrls:O,onOpenSettings:()=>eJ(!0),onProfileClick:e=>{ev(e),j(null)}})})]}),(0,n.jsx)("div",{className:`md:hidden fixed inset-x-0 bottom-0 z-20 transform transition-transform duration-300 ease-out ${w?"translate-y-0":"translate-y-full"}`,children:(0,n.jsxs)("div",{className:"bg-white dark:bg-zinc-900 rounded-t-2xl border-t border-zinc-200 dark:border-zinc-700 shadow-lg max-h-[60vh] flex flex-col",children:[(0,n.jsxs)("div",{className:"shrink-0 flex items-center justify-between px-4 pt-3 pb-2",children:[(0,n.jsx)("div",{className:"w-8 h-1 bg-zinc-300 dark:bg-zinc-600 rounded-full mx-auto"}),(0,n.jsx)("button",{onClick:()=>j(null),className:"absolute right-3 top-3 p-1 text-zinc-400 hover:text-zinc-600 dark:text-zinc-500 dark:hover:text-zinc-300 dark:hover:bg-zinc-800",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar px-4 pb-6 space-y-4",children:(0,n.jsx)(iD,{node:w,allNodes:x.graphData.nodes,onNodeNavigate:tP,comments:w?V.get(w.id):void 0,onPostComment:w?e=>tL(w.id,e):void 0,onDeleteComment:tT,onLikeComment:tD,onReplyComment:tI,isAuthenticated:_,currentDid:W?.did,repoUrls:O,onOpenSettings:()=>eJ(!0),onProfileClick:e=>{ev(e),j(null)}})})]})}),(0,n.jsx)(iV,{isOpen:eg,onClose:()=>ek(!1),allComments:Y.filter(e=>ed.has(e.nodeId)),onNodeNavigate:e=>{tP(e),ek(!1)},isAuthenticated:_,currentDid:W?.did,onLikeComment:tD,onDeleteComment:tT,onReplyComment:tI,onPostComment:tL,prefixes:x?.stats?.prefixes||[]}),(0,n.jsx)(i3,{events:tc,isOpen:ej,onClose:()=>ez(!1),onNodeClick:e=>{let t=x?.graphData.nodes.find(t=>t.id===e);t&&(tB(t),ez(!1))},onHandleClick:e=>{ev(e),ez(!1),j(null),ek(!1),eM(!1),eE(!1)}}),(0,n.jsx)(lh,{entries:td,isOpen:eT,onClose:()=>eE(!1),onProfileClick:e=>{ev(e),eE(!1),j(null),ek(!1),ez(!1),eM(!1);let t=tO(e);t&&ti.current?.zoomToNode(t)}}),(0,n.jsx)(la,{isOpen:eS,onClose:()=>{eM(!1),eA(null)},tutorialStep:eL,onStartTutorial:tw,onNextStep:tj,onPrevStep:tz,onEndTutorial:tN}),(0,n.jsx)(lg,{isOpen:!!eb,onClose:()=>ev(null),profile:tu,onNodeNavigate:e=>{let t=x?.graphData.nodes.find(t=>t.id===e);t&&(ev(null),tp(t),ti.current?.focusNode(t))}})]}),(0,n.jsx)(i8,{step:eL,onNext:tj,onPrev:tz,onEnd:tN})]}):null}e.s(["default",()=>lH],31713)}]);