kanban-lite 1.0.21 → 1.0.23

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 (44) hide show
  1. package/{CLAUDE.md → AGENTS.md} +13 -0
  2. package/CHANGELOG.md +68 -0
  3. package/README.md +10 -0
  4. package/dist/cli.js +168 -102
  5. package/dist/extension.js +178 -104
  6. package/dist/mcp-server.js +145 -95
  7. package/dist/sdk/index.cjs +126 -93
  8. package/dist/sdk/index.mjs +126 -93
  9. package/dist/sdk/sdk/KanbanSDK.d.ts +39 -7
  10. package/dist/sdk/shared/config.d.ts +4 -0
  11. package/dist/sdk/shared/types.d.ts +4 -0
  12. package/dist/standalone-webview/index.js +58 -58
  13. package/dist/standalone-webview/index.js.map +1 -1
  14. package/dist/standalone-webview/style.css +1 -1
  15. package/dist/standalone.js +606 -364
  16. package/dist/webview/index.js +57 -57
  17. package/dist/webview/index.js.map +1 -1
  18. package/dist/webview/style.css +1 -1
  19. package/docs/plans/2026-02-26-settings-tabs-design.md +40 -0
  20. package/docs/plans/2026-02-26-settings-tabs.md +166 -0
  21. package/docs/plans/2026-02-27-zoom-settings-design.md +82 -0
  22. package/docs/plans/2026-02-27-zoom-settings.md +395 -0
  23. package/docs/sdk.md +3 -6
  24. package/package.json +1 -1
  25. package/src/cli/index.ts +12 -2
  26. package/src/extension/KanbanPanel.ts +25 -5
  27. package/src/mcp-server/index.ts +20 -2
  28. package/src/sdk/KanbanSDK.ts +64 -7
  29. package/src/sdk/__tests__/KanbanSDK.test.ts +17 -1
  30. package/src/sdk/__tests__/metadata.test.ts +3 -1
  31. package/src/sdk/__tests__/multi-board.test.ts +2 -0
  32. package/src/sdk/parser.ts +50 -83
  33. package/src/shared/config.ts +14 -2
  34. package/src/shared/types.ts +4 -0
  35. package/src/standalone/__tests__/server.integration.test.ts +2 -2
  36. package/src/standalone/index.ts +7 -4
  37. package/src/standalone/server.ts +31 -6
  38. package/src/webview/App.tsx +42 -3
  39. package/src/webview/assets/main.css +31 -2
  40. package/src/webview/components/KanbanBoard.tsx +35 -3
  41. package/src/webview/components/KanbanColumn.tsx +40 -4
  42. package/src/webview/components/SettingsPanel.tsx +179 -77
  43. package/src/webview/components/Toolbar.tsx +127 -32
  44. package/src/webview/store/index.ts +26 -28
@@ -1,4 +1,4 @@
1
- var Jr=Object.defineProperty;var Xr=(t,e,s)=>e in t?Jr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var K=(t,e,s)=>Xr(t,typeof e!="symbol"?e+"":e,s);import{r as f,R as Oe,F as Jt,P as nt,C as ft,a as Fe,b as ot,T as we,c as je,E as es,d as mt,X as oe,e as ts,f as rs,B as Xt,I as er,Q as tr,g as rr,L as sr,h as nr,i as or,M as ss,H as ns,j as os,k as at,S as ar,U as lr,l as ir,Z as as,m as me,W as ls,n as is,o as cs,p as ds,q as us,s as ps,t as hs}from"./icons-Bv4jE7zW.js";import{r as gs}from"./react-vendor-DTa8ZTpE.js";var cr={exports:{}},Ye={};/**
1
+ var es=Object.defineProperty;var ts=(e,t,s)=>t in e?es(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var q=(e,t,s)=>ts(e,typeof t!="symbol"?t+"":t,s);import{r as f,R as Qe,F as cr,P as ht,C as Nt,a as fe,b as gt,T as Ce,c as $e,E as rs,d as Ct,X as ie,e as ss,f as ns,B as dr,I as ur,Q as pr,g as hr,L as gr,h as xr,i as fr,M as os,H as as,j as ls,k as xt,S as mr,U as br,l as St,Z as is,m as me,W as cs,n as ds,o as us,p as ps,q as hs,s as gs,t as xs}from"./icons-Bv4jE7zW.js";import{r as fs}from"./react-vendor-DTa8ZTpE.js";var vr={exports:{}},at={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,81 +6,81 @@ var Jr=Object.defineProperty;var Xr=(t,e,s)=>e in t?Jr(t,e,{enumerable:!0,config
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var xs=f,fs=Symbol.for("react.element"),ms=Symbol.for("react.fragment"),bs=Object.prototype.hasOwnProperty,vs=xs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ks={key:!0,ref:!0,__self:!0,__source:!0};function dr(t,e,s){var n,o={},i=null,l=null;s!==void 0&&(i=""+s),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(l=e.ref);for(n in e)bs.call(e,n)&&!ks.hasOwnProperty(n)&&(o[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)o[n]===void 0&&(o[n]=e[n]);return{$$typeof:fs,type:t,key:i,ref:l,props:o,_owner:vs.current}}Ye.Fragment=ms;Ye.jsx=dr;Ye.jsxs=dr;cr.exports=Ye;var r=cr.exports;const Re=new WebSocket(`ws://${window.location.host}/ws`),lt=[];let bt=!1;Re.addEventListener("open",()=>{bt=!0;for(const t of lt)Re.send(t);lt.length=0});Re.addEventListener("message",t=>{try{const e=JSON.parse(t.data);window.postMessage(e,"*")}catch{}});Re.addEventListener("close",()=>{bt=!1});let it=null;try{const t=sessionStorage.getItem("kanban-standalone-state");t&&(it=JSON.parse(t))}catch{}function ys(t){const e=document.createElement("input");e.type="file",e.multiple=!0,e.style.display="none",document.body.appendChild(e);const s=()=>{e.remove()};e.onchange=async()=>{if(!e.files||e.files.length===0){s();return}const n=[];for(const o of Array.from(e.files)){const i=await o.arrayBuffer(),l=new Uint8Array(i);let a="";for(let u=0;u<l.length;u++)a+=String.fromCharCode(l[u]);n.push({name:o.name,data:btoa(a)})}try{await fetch("/api/upload-attachment",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({featureId:t,files:n})})}catch(o){console.error("Failed to upload attachment:",o)}s()},e.click()}function ws(t,e){const s=`/api/attachment?featureId=${encodeURIComponent(t)}&filename=${encodeURIComponent(e)}`;window.open(s,"_blank")}window.acquireVsCodeApi=()=>({postMessage(t){const e=t;if(e.type==="addAttachment"){ys(e.featureId);return}if(e.type==="openAttachment"){ws(e.featureId,e.attachment);return}if(e.type==="toggleTheme"){const n=document.body.classList.contains("vscode-dark");He(!n);return}const s=JSON.stringify(t);bt?Re.send(s):lt.push(s)},getState(){return it},setState(t){it=t;try{sessionStorage.setItem("kanban-standalone-state",JSON.stringify(t))}catch{}}});const ct=window.matchMedia("(prefers-color-scheme: dark)");function He(t){document.body.classList.toggle("vscode-dark",t),document.body.classList.toggle("vscode-light",!t)}ct.addEventListener("change",t=>He(t.matches));document.body?He(ct.matches):document.addEventListener("DOMContentLoaded",()=>He(ct.matches));var ur,Et=gs;ur=Et.createRoot,Et.hydrateRoot;const js="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function ke(t,e,s){const n=s[0];if(e!=null&&t>=e)throw new Error(t+" >= "+e);if(t.slice(-1)===n||e&&e.slice(-1)===n)throw new Error("trailing zero");if(e){let l=0;for(;(t[l]||n)===e[l];)l++;if(l>0)return e.slice(0,l)+ke(t.slice(l),e.slice(l),s)}const o=t?s.indexOf(t[0]):0,i=e!=null?s.indexOf(e[0]):s.length;if(i-o>1){const l=Math.round(.5*(o+i));return s[l]}else return e&&e.length>1?e.slice(0,1):s[o]+ke(t.slice(1),null,s)}function pr(t){if(t.length!==hr(t[0]))throw new Error("invalid integer part of order key: "+t)}function hr(t){if(t>="a"&&t<="z")return t.charCodeAt(0)-97+2;if(t>="A"&&t<="Z")return 90-t.charCodeAt(0)+2;throw new Error("invalid order key head: "+t)}function $e(t){const e=hr(t[0]);if(e>t.length)throw new Error("invalid order key: "+t);return t.slice(0,e)}function At(t,e){if(t==="A"+e[0].repeat(26))throw new Error("invalid order key: "+t);const s=$e(t);if(t.slice(s.length).slice(-1)===e[0])throw new Error("invalid order key: "+t)}function $t(t,e){pr(t);const[s,...n]=t.split("");let o=!0;for(let i=n.length-1;o&&i>=0;i--){const l=e.indexOf(n[i])+1;l===e.length?n[i]=e[0]:(n[i]=e[l],o=!1)}if(o){if(s==="Z")return"a"+e[0];if(s==="z")return null;const i=String.fromCharCode(s.charCodeAt(0)+1);return i>"a"?n.push(e[0]):n.pop(),i+n.join("")}else return s+n.join("")}function Ns(t,e){pr(t);const[s,...n]=t.split("");let o=!0;for(let i=n.length-1;o&&i>=0;i--){const l=e.indexOf(n[i])-1;l===-1?n[i]=e.slice(-1):(n[i]=e[l],o=!1)}if(o){if(s==="a")return"Z"+e.slice(-1);if(s==="A")return null;const i=String.fromCharCode(s.charCodeAt(0)-1);return i<"Z"?n.push(e.slice(-1)):n.pop(),i+n.join("")}else return s+n.join("")}function zs(t,e,s=js){if(t!=null&&At(t,s),e!=null&&At(e,s),t!=null&&e!=null&&t>=e)throw new Error(t+" >= "+e);if(t==null){if(e==null)return"a"+s[0];const u=$e(e),c=e.slice(u.length);if(u==="A"+s[0].repeat(26))return u+ke("",c,s);if(u<e)return u;const d=Ns(u,s);if(d==null)throw new Error("cannot decrement any more");return d}if(e==null){const u=$e(t),c=t.slice(u.length),d=$t(u,s);return d??u+ke(c,null,s)}const n=$e(t),o=t.slice(n.length),i=$e(e),l=e.slice(i.length);if(n===i)return n+ke(o,l,s);const a=$t(n,s);if(a==null)throw new Error("cannot increment any more");return a<e?a:n+ke(o,null,s)}const Lt=t=>{let e;const s=new Set,n=(c,d)=>{const g=typeof c=="function"?c(e):c;if(!Object.is(g,e)){const x=e;e=d??(typeof g!="object"||g===null)?g:Object.assign({},e,g),s.forEach(p=>p(e,x))}},o=()=>e,a={setState:n,getState:o,getInitialState:()=>u,subscribe:c=>(s.add(c),()=>s.delete(c))},u=e=t(n,o,a);return a},Cs=t=>t?Lt(t):Lt,Ss=t=>t;function Ds(t,e=Ss){const s=Oe.useSyncExternalStore(t.subscribe,Oe.useCallback(()=>e(t.getState()),[t,e]),Oe.useCallback(()=>e(t.getInitialState()),[t,e]));return Oe.useDebugValue(s),s}const Rt=t=>{const e=Cs(t),s=n=>Ds(e,n);return Object.assign(s,e),s},Ts=t=>t?Rt(t):Rt,Ms=()=>typeof document<"u"?document.body.classList.contains("vscode-dark")||document.body.classList.contains("vscode-high-contrast"):!1,Es=t=>{const e=new Date;return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()},As=t=>{const e=new Date,s=new Date(e);s.setDate(e.getDate()-e.getDay()),s.setHours(0,0,0,0);const n=new Date(s);return n.setDate(s.getDate()+7),t>=s&&t<n},$s=t=>{const e=new Date;return e.setHours(0,0,0,0),t<e};function Ls(t){const e={},s=t.replace(/meta\.([a-zA-Z0-9_.]+):\s*(\S+)/g,(n,o,i)=>(e[o]=i,"")).trim();return{metaFilter:e,plainText:s}}const q=Ts((t,e)=>({features:[],columns:[],boards:[],currentBoard:"default",isDarkMode:Ms(),searchQuery:"",priorityFilter:"all",assigneeFilter:"all",labelFilter:"all",dueDateFilter:"all",sortOrder:"order",layout:"horizontal",workspace:null,cardSettings:{showPriorityBadges:!0,showAssignee:!0,showDueDate:!0,showLabels:!0,showBuildWithAI:!0,showFileName:!1,compactMode:!1,markdownEditorMode:!1,showDeletedColumn:!1,defaultPriority:"medium",defaultStatus:"backlog"},settingsOpen:!1,labelDefs:{},setWorkspace:s=>t({workspace:s}),setLabelDefs:s=>t({labelDefs:s}),setFeatures:s=>t({features:s}),setColumns:s=>t({columns:s}),setBoards:s=>t({boards:s}),setCurrentBoard:s=>t({currentBoard:s}),setIsDarkMode:s=>t({isDarkMode:s}),setCardSettings:s=>t({cardSettings:s}),setSettingsOpen:s=>t({settingsOpen:s}),setSearchQuery:s=>t({searchQuery:s}),setPriorityFilter:s=>t({priorityFilter:s}),setAssigneeFilter:s=>t({assigneeFilter:s}),setLabelFilter:s=>t({labelFilter:s}),setDueDateFilter:s=>t({dueDateFilter:s}),setSortOrder:s=>t({sortOrder:s}),setLayout:s=>t({layout:s}),toggleLayout:()=>t(s=>({layout:s.layout==="horizontal"?"vertical":"horizontal"})),clearAllFilters:()=>t({searchQuery:"",priorityFilter:"all",assigneeFilter:"all",labelFilter:"all",dueDateFilter:"all",sortOrder:"order"}),addFeature:s=>t(n=>({features:[...n.features,s]})),updateFeature:(s,n)=>t(o=>({features:o.features.map(i=>i.id===s?{...i,...n}:i)})),removeFeature:s=>t(n=>({features:n.features.filter(o=>o.id!==s)})),getFeaturesByStatus:s=>{const{features:n}=e();return n.filter(o=>o.status===s).sort((o,i)=>o.order<i.order?-1:o.order>i.order?1:0)},getFilteredFeaturesByStatus:s=>{const{features:n,searchQuery:o,priorityFilter:i,assigneeFilter:l,labelFilter:a,dueDateFilter:u,sortOrder:c}=e();return n.filter(d=>{var g;if(d.status!==s||i!=="all"&&d.priority!==i)return!1;if(l!=="all"){if(l==="unassigned"){if(d.assignee)return!1}else if(d.assignee!==l)return!1}if(a!=="all"){if(a.startsWith("group:")){const x=a.slice(6),{labelDefs:p}=e(),h=Object.entries(p).filter(([,m])=>m.group===x).map(([m])=>m);if(!d.labels.some(m=>h.includes(m)))return!1}else if(!d.labels.includes(a))return!1}if(u!=="all")if(u==="no-date"){if(d.dueDate)return!1}else if(d.dueDate){const x=new Date(d.dueDate);if(u==="overdue"&&!$s(x)||u==="today"&&!Es(x)||u==="this-week"&&!As(x))return!1}else return!1;if(o){const{metaFilter:x,plainText:p}=Ls(o);if(Object.keys(x).length>0&&!Object.entries(x).every(([m,y])=>{if(!d.metadata)return!1;const k=m.split(".").reduce((N,M)=>N!=null&&typeof N=="object"?N[M]:void 0,d.metadata);return k!=null&&String(k).toLowerCase().includes(y.toLowerCase())}))return!1;if(p){const h=p.toLowerCase();if(!(d.content.toLowerCase().includes(h)||d.id.toLowerCase().includes(h)||((g=d.assignee)==null?void 0:g.toLowerCase().includes(h))||d.labels.some(y=>y.toLowerCase().includes(h))))return!1}}return!0}).sort((d,g)=>c==="created:asc"?d.created.localeCompare(g.created):c==="created:desc"?g.created.localeCompare(d.created):c==="modified:asc"?d.modified.localeCompare(g.modified):c==="modified:desc"?g.modified.localeCompare(d.modified):d.order<g.order?-1:d.order>g.order?1:0)},getUniqueAssignees:()=>{const{features:s}=e(),n=new Set;return s.forEach(o=>{o.assignee&&n.add(o.assignee)}),Array.from(n).sort()},getUniqueLabels:()=>{const{features:s}=e(),n=new Set;return s.forEach(o=>{o.labels.forEach(i=>n.add(i))}),Array.from(n).sort()},hasActiveFilters:()=>{const{searchQuery:s,priorityFilter:n,assigneeFilter:o,labelFilter:i,dueDateFilter:l,sortOrder:a}=e();return s!==""||n!=="all"||o!=="all"||i!=="all"||l!=="all"||a!=="order"}}));function vt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var be=vt();function gr(t){be=t}var xe={exec:()=>null};function P(t,e=""){let s=typeof t=="string"?t:t.source,n={replace:(o,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(J.caret,"$1"),s=s.replace(o,l),n},getRegex:()=>new RegExp(s,e)};return n}var Rs=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),J={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Fs=/^(?:[ \t]*(?:\n|$))+/,Bs=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Is=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Be=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ps=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,kt=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,xr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,fr=P(xr).replace(/bull/g,kt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Os=P(xr).replace(/bull/g,kt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),yt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,_s=/^[^\n]+/,wt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ks=P(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",wt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),qs=P(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,kt).getRegex(),Je="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",jt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Us=P("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",jt).replace("tag",Je).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),mr=P(yt).replace("hr",Be).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Je).getRegex(),Hs=P(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",mr).getRegex(),Nt={blockquote:Hs,code:Bs,def:Ks,fences:Is,heading:Ps,hr:Be,html:Us,lheading:fr,list:qs,newline:Fs,paragraph:mr,table:xe,text:_s},Ft=P("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Be).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Je).getRegex(),Gs={...Nt,lheading:Os,table:Ft,paragraph:P(yt).replace("hr",Be).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ft).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Je).getRegex()},Ws={...Nt,html:P(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",jt).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:xe,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:P(yt).replace("hr",Be).replace("heading",` *#{1,6} *[^
10
- ]`).replace("lheading",fr).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Zs=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Vs=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br=/^( {2,}|\\)\n(?!\s*$)/,Qs=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Xe=/[\p{P}\p{S}]/u,zt=/[\s\p{P}\p{S}]/u,vr=/[^\s\p{P}\p{S}]/u,Ys=P(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,zt).getRegex(),kr=/(?!~)[\p{P}\p{S}]/u,Js=/(?!~)[\s\p{P}\p{S}]/u,Xs=/(?:[^\s\p{P}\p{S}]|~)/u,yr=/(?![*_])[\p{P}\p{S}]/u,en=/(?![*_])[\s\p{P}\p{S}]/u,tn=/(?:[^\s\p{P}\p{S}]|[*_])/u,rn=P(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Rs?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),wr=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,sn=P(wr,"u").replace(/punct/g,Xe).getRegex(),nn=P(wr,"u").replace(/punct/g,kr).getRegex(),jr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",on=P(jr,"gu").replace(/notPunctSpace/g,vr).replace(/punctSpace/g,zt).replace(/punct/g,Xe).getRegex(),an=P(jr,"gu").replace(/notPunctSpace/g,Xs).replace(/punctSpace/g,Js).replace(/punct/g,kr).getRegex(),ln=P("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,vr).replace(/punctSpace/g,zt).replace(/punct/g,Xe).getRegex(),cn=P(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,yr).getRegex(),dn="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",un=P(dn,"gu").replace(/notPunctSpace/g,tn).replace(/punctSpace/g,en).replace(/punct/g,yr).getRegex(),pn=P(/\\(punct)/,"gu").replace(/punct/g,Xe).getRegex(),hn=P(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),gn=P(jt).replace("(?:-->|$)","-->").getRegex(),xn=P("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",gn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ge=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,fn=P(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Ge).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Nr=P(/^!?\[(label)\]\[(ref)\]/).replace("label",Ge).replace("ref",wt).getRegex(),zr=P(/^!?\[(ref)\](?:\[\])?/).replace("ref",wt).getRegex(),mn=P("reflink|nolink(?!\\()","g").replace("reflink",Nr).replace("nolink",zr).getRegex(),Bt=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ct={_backpedal:xe,anyPunctuation:pn,autolink:hn,blockSkip:rn,br,code:Vs,del:xe,delLDelim:xe,delRDelim:xe,emStrongLDelim:sn,emStrongRDelimAst:on,emStrongRDelimUnd:ln,escape:Zs,link:fn,nolink:zr,punctuation:Ys,reflink:Nr,reflinkSearch:mn,tag:xn,text:Qs,url:xe},bn={...Ct,link:P(/^!?\[(label)\]\((.*?)\)/).replace("label",Ge).getRegex(),reflink:P(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ge).getRegex()},dt={...Ct,emStrongRDelimAst:an,emStrongLDelim:nn,delLDelim:cn,delRDelim:un,url:P(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Bt).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:P(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Bt).getRegex()},vn={...dt,br:P(br).replace("{2,}","*").getRegex(),text:P(dt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},_e={normal:Nt,gfm:Gs,pedantic:Ws},De={normal:Ct,gfm:dt,breaks:vn,pedantic:bn},kn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},It=t=>kn[t];function ne(t,e){if(e){if(J.escapeTest.test(t))return t.replace(J.escapeReplace,It)}else if(J.escapeTestNoEncode.test(t))return t.replace(J.escapeReplaceNoEncode,It);return t}function Pt(t){try{t=encodeURI(t).replace(J.percentDecode,"%")}catch{return null}return t}function Ot(t,e){var i;let s=t.replace(J.findPipe,(l,a,u)=>{let c=!1,d=a;for(;--d>=0&&u[d]==="\\";)c=!c;return c?"|":" |"}),n=s.split(J.splitPipe),o=0;if(n[0].trim()||n.shift(),n.length>0&&!((i=n.at(-1))!=null&&i.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;o<n.length;o++)n[o]=n[o].trim().replace(J.slashPipe,"|");return n}function Te(t,e,s){let n=t.length;if(n===0)return"";let o=0;for(;o<n&&t.charAt(n-o-1)===e;)o++;return t.slice(0,n-o)}function yn(t,e){if(t.indexOf(e[1])===-1)return-1;let s=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])s++;else if(t[n]===e[1]&&(s--,s<0))return n;return s>0?-2:-1}function wn(t,e=0){let s=e,n="";for(let o of t)if(o===" "){let i=4-s%4;n+=" ".repeat(i),s+=i}else n+=o,s++;return n}function _t(t,e,s,n,o){let i=e.href,l=e.title||null,a=t[1].replace(o.other.outputLinkReplace,"$1");n.state.inLink=!0;let u={type:t[0].charAt(0)==="!"?"image":"link",raw:s,href:i,title:l,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,u}function jn(t,e,s){let n=t.match(s.other.indentCodeCompensation);if(n===null)return e;let o=n[1];return e.split(`
9
+ */var ms=f,bs=Symbol.for("react.element"),vs=Symbol.for("react.fragment"),ks=Object.prototype.hasOwnProperty,ys=ms.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ws={key:!0,ref:!0,__self:!0,__source:!0};function kr(e,t,s){var n,o={},i=null,l=null;s!==void 0&&(i=""+s),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(l=t.ref);for(n in t)ks.call(t,n)&&!ws.hasOwnProperty(n)&&(o[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)o[n]===void 0&&(o[n]=t[n]);return{$$typeof:bs,type:e,key:i,ref:l,props:o,_owner:ys.current}}at.Fragment=vs;at.jsx=kr;at.jsxs=kr;vr.exports=at;var r=vr.exports;const Ue=new WebSocket(`ws://${window.location.host}/ws`),ft=[];let Dt=!1;Ue.addEventListener("open",()=>{Dt=!0;for(const e of ft)Ue.send(e);ft.length=0});Ue.addEventListener("message",e=>{try{const t=JSON.parse(e.data);window.postMessage(t,"*")}catch{}});Ue.addEventListener("close",()=>{Dt=!1});let mt=null;try{const e=sessionStorage.getItem("kanban-standalone-state");e&&(mt=JSON.parse(e))}catch{}function js(e){const t=document.createElement("input");t.type="file",t.multiple=!0,t.style.display="none",document.body.appendChild(t);const s=()=>{t.remove()};t.onchange=async()=>{if(!t.files||t.files.length===0){s();return}const n=[];for(const o of Array.from(t.files)){const i=await o.arrayBuffer(),l=new Uint8Array(i);let a="";for(let p=0;p<l.length;p++)a+=String.fromCharCode(l[p]);n.push({name:o.name,data:btoa(a)})}try{await fetch("/api/upload-attachment",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({featureId:e,files:n})})}catch(o){console.error("Failed to upload attachment:",o)}s()},t.click()}function zs(e,t){const s=`/api/attachment?featureId=${encodeURIComponent(e)}&filename=${encodeURIComponent(t)}`;window.open(s,"_blank")}window.acquireVsCodeApi=()=>({postMessage(e){const t=e;if(t.type==="addAttachment"){js(t.featureId);return}if(t.type==="openAttachment"){zs(t.featureId,t.attachment);return}if(t.type==="toggleTheme"){const n=document.body.classList.contains("vscode-dark");et(!n);return}const s=JSON.stringify(e);Dt?Ue.send(s):ft.push(s)},getState(){return mt},setState(e){mt=e;try{sessionStorage.setItem("kanban-standalone-state",JSON.stringify(e))}catch{}}});const bt=window.matchMedia("(prefers-color-scheme: dark)");function et(e){document.body.classList.toggle("vscode-dark",e),document.body.classList.toggle("vscode-light",!e)}bt.addEventListener("change",e=>et(e.matches));document.body?et(bt.matches):document.addEventListener("DOMContentLoaded",()=>et(bt.matches));var yr,_t=fs;yr=_t.createRoot,_t.hydrateRoot;const Ns="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function Te(e,t,s){const n=s[0];if(t!=null&&e>=t)throw new Error(e+" >= "+t);if(e.slice(-1)===n||t&&t.slice(-1)===n)throw new Error("trailing zero");if(t){let l=0;for(;(e[l]||n)===t[l];)l++;if(l>0)return t.slice(0,l)+Te(e.slice(l),t.slice(l),s)}const o=e?s.indexOf(e[0]):0,i=t!=null?s.indexOf(t[0]):s.length;if(i-o>1){const l=Math.round(.5*(o+i));return s[l]}else return t&&t.length>1?t.slice(0,1):s[o]+Te(e.slice(1),null,s)}function wr(e){if(e.length!==jr(e[0]))throw new Error("invalid integer part of order key: "+e)}function jr(e){if(e>="a"&&e<="z")return e.charCodeAt(0)-97+2;if(e>="A"&&e<="Z")return 90-e.charCodeAt(0)+2;throw new Error("invalid order key head: "+e)}function Ze(e){const t=jr(e[0]);if(t>e.length)throw new Error("invalid order key: "+e);return e.slice(0,t)}function Kt(e,t){if(e==="A"+t[0].repeat(26))throw new Error("invalid order key: "+e);const s=Ze(e);if(e.slice(s.length).slice(-1)===t[0])throw new Error("invalid order key: "+e)}function Zt(e,t){wr(e);const[s,...n]=e.split("");let o=!0;for(let i=n.length-1;o&&i>=0;i--){const l=t.indexOf(n[i])+1;l===t.length?n[i]=t[0]:(n[i]=t[l],o=!1)}if(o){if(s==="Z")return"a"+t[0];if(s==="z")return null;const i=String.fromCharCode(s.charCodeAt(0)+1);return i>"a"?n.push(t[0]):n.pop(),i+n.join("")}else return s+n.join("")}function Cs(e,t){wr(e);const[s,...n]=e.split("");let o=!0;for(let i=n.length-1;o&&i>=0;i--){const l=t.indexOf(n[i])-1;l===-1?n[i]=t.slice(-1):(n[i]=t[l],o=!1)}if(o){if(s==="a")return"Z"+t.slice(-1);if(s==="A")return null;const i=String.fromCharCode(s.charCodeAt(0)-1);return i<"Z"?n.push(t.slice(-1)):n.pop(),i+n.join("")}else return s+n.join("")}function Ss(e,t,s=Ns){if(e!=null&&Kt(e,s),t!=null&&Kt(t,s),e!=null&&t!=null&&e>=t)throw new Error(e+" >= "+t);if(e==null){if(t==null)return"a"+s[0];const p=Ze(t),c=t.slice(p.length);if(p==="A"+s[0].repeat(26))return p+Te("",c,s);if(p<t)return p;const u=Cs(p,s);if(u==null)throw new Error("cannot decrement any more");return u}if(t==null){const p=Ze(e),c=e.slice(p.length),u=Zt(p,s);return u??p+Te(c,null,s)}const n=Ze(e),o=e.slice(n.length),i=Ze(t),l=t.slice(i.length);if(n===i)return n+Te(o,l,s);const a=Zt(n,s);if(a==null)throw new Error("cannot increment any more");return a<t?a:n+Te(o,null,s)}const qt=e=>{let t;const s=new Set,n=(c,u)=>{const g=typeof c=="function"?c(t):c;if(!Object.is(g,t)){const h=t;t=u??(typeof g!="object"||g===null)?g:Object.assign({},t,g),s.forEach(d=>d(t,h))}},o=()=>t,a={setState:n,getState:o,getInitialState:()=>p,subscribe:c=>(s.add(c),()=>s.delete(c))},p=t=e(n,o,a);return a},Ds=e=>e?qt(e):qt,Ms=e=>e;function Ts(e,t=Ms){const s=Qe.useSyncExternalStore(e.subscribe,Qe.useCallback(()=>t(e.getState()),[e,t]),Qe.useCallback(()=>t(e.getInitialState()),[e,t]));return Qe.useDebugValue(s),s}const Ut=e=>{const t=Ds(e),s=n=>Ts(t,n);return Object.assign(s,t),s},Es=e=>e?Ut(e):Ut,$s=()=>typeof document<"u"?document.body.classList.contains("vscode-dark")||document.body.classList.contains("vscode-high-contrast"):!1,As=e=>{const t=new Date;return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()},Ls=e=>{const t=new Date,s=new Date(t);s.setDate(t.getDate()-t.getDay()),s.setHours(0,0,0,0);const n=new Date(s);return n.setDate(s.getDate()+7),e>=s&&e<n},Rs=e=>{const t=new Date;return t.setHours(0,0,0,0),e<t};function Fs(e){const t={},s=e.replace(/meta\.([a-zA-Z0-9_.]+):\s*(\S+)/g,(n,o,i)=>(t[o]=i,"")).trim();return{metaFilter:t,plainText:s}}const _=Es((e,t)=>({features:[],columns:[],boards:[],currentBoard:"default",isDarkMode:$s(),searchQuery:"",priorityFilter:"all",assigneeFilter:"all",labelFilter:[],dueDateFilter:"all",columnSorts:{},layout:"horizontal",workspace:null,cardSettings:{showPriorityBadges:!0,showAssignee:!0,showDueDate:!0,showLabels:!0,showBuildWithAI:!0,showFileName:!1,compactMode:!1,markdownEditorMode:!1,showDeletedColumn:!1,defaultPriority:"medium",defaultStatus:"backlog",boardZoom:100,cardZoom:100},settingsOpen:!1,labelDefs:{},setWorkspace:s=>e({workspace:s}),setLabelDefs:s=>e({labelDefs:s}),setFeatures:s=>e({features:s}),setColumns:s=>e({columns:s}),setBoards:s=>e({boards:s}),setCurrentBoard:s=>e({currentBoard:s}),setIsDarkMode:s=>e({isDarkMode:s}),setCardSettings:s=>e(n=>({cardSettings:{...s,boardZoom:s.boardZoom??n.cardSettings.boardZoom,cardZoom:s.cardZoom??n.cardSettings.cardZoom}})),setSettingsOpen:s=>e({settingsOpen:s}),setSearchQuery:s=>e({searchQuery:s}),setPriorityFilter:s=>e({priorityFilter:s}),setAssigneeFilter:s=>e({assigneeFilter:s}),setLabelFilter:s=>e({labelFilter:s}),setDueDateFilter:s=>e({dueDateFilter:s}),setColumnSort:(s,n)=>e(o=>({columnSorts:n==="order"?Object.fromEntries(Object.entries(o.columnSorts).filter(([i])=>i!==s)):{...o.columnSorts,[s]:n}})),setLayout:s=>e({layout:s}),toggleLayout:()=>e(s=>({layout:s.layout==="horizontal"?"vertical":"horizontal"})),clearAllFilters:()=>e({searchQuery:"",priorityFilter:"all",assigneeFilter:"all",labelFilter:[],dueDateFilter:"all",columnSorts:{}}),addFeature:s=>e(n=>({features:[...n.features,s]})),updateFeature:(s,n)=>e(o=>({features:o.features.map(i=>i.id===s?{...i,...n}:i)})),removeFeature:s=>e(n=>({features:n.features.filter(o=>o.id!==s)})),getFeaturesByStatus:s=>{const{features:n}=t();return n.filter(o=>o.status===s).sort((o,i)=>o.order<i.order?-1:o.order>i.order?1:0)},getFilteredFeaturesByStatus:s=>{const{features:n,searchQuery:o,priorityFilter:i,assigneeFilter:l,labelFilter:a,dueDateFilter:p,columnSorts:c}=t(),u=c[s]||"order";return n.filter(g=>{var h;if(g.status!==s||i!=="all"&&g.priority!==i)return!1;if(l!=="all"){if(l==="unassigned"){if(g.assignee)return!1}else if(g.assignee!==l)return!1}if(a.length>0&&!g.labels.some(d=>a.includes(d)))return!1;if(p!=="all")if(p==="no-date"){if(g.dueDate)return!1}else if(g.dueDate){const d=new Date(g.dueDate);if(p==="overdue"&&!Rs(d)||p==="today"&&!As(d)||p==="this-week"&&!Ls(d))return!1}else return!1;if(o){const{metaFilter:d,plainText:x}=Fs(o);if(Object.keys(d).length>0&&!Object.entries(d).every(([v,k])=>{if(!g.metadata)return!1;const z=v.split(".").reduce((E,y)=>E!=null&&typeof E=="object"?E[y]:void 0,g.metadata);return z!=null&&String(z).toLowerCase().includes(k.toLowerCase())}))return!1;if(x){const m=x.toLowerCase();if(!(g.content.toLowerCase().includes(m)||g.id.toLowerCase().includes(m)||((h=g.assignee)==null?void 0:h.toLowerCase().includes(m))||g.labels.some(k=>k.toLowerCase().includes(m))))return!1}}return!0}).sort((g,h)=>u==="created:asc"?g.created.localeCompare(h.created):u==="created:desc"?h.created.localeCompare(g.created):u==="modified:asc"?g.modified.localeCompare(h.modified):u==="modified:desc"?h.modified.localeCompare(g.modified):g.order<h.order?-1:g.order>h.order?1:0)},getUniqueAssignees:()=>{const{features:s}=t(),n=new Set;return s.forEach(o=>{o.assignee&&n.add(o.assignee)}),Array.from(n).sort()},getUniqueLabels:()=>{const{features:s}=t(),n=new Set;return s.forEach(o=>{o.labels.forEach(i=>n.add(i))}),Array.from(n).sort()},hasActiveFilters:()=>{const{searchQuery:s,priorityFilter:n,assigneeFilter:o,labelFilter:i,dueDateFilter:l,columnSorts:a}=t();return s!==""||n!=="all"||o!=="all"||i.length>0||l!=="all"||Object.keys(a).length>0}}));function Mt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var De=Mt();function zr(e){De=e}var Ne={exec:()=>null};function O(e,t=""){let s=typeof e=="string"?e:e.source,n={replace:(o,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(ee.caret,"$1"),s=s.replace(o,l),n},getRegex:()=>new RegExp(s,t)};return n}var Bs=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ee={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Is=/^(?:[ \t]*(?:\n|$))+/,Ps=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Os=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,He=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,_s=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Tt=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Nr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Cr=O(Nr).replace(/bull/g,Tt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ks=O(Nr).replace(/bull/g,Tt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Et=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Zs=/^[^\n]+/,$t=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,qs=O(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",$t).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Us=O(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Tt).getRegex(),lt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",At=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Hs=O("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",At).replace("tag",lt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Sr=O(Et).replace("hr",He).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",lt).getRegex(),Gs=O(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Sr).getRegex(),Lt={blockquote:Gs,code:Ps,def:qs,fences:Os,heading:_s,hr:He,html:Hs,lheading:Cr,list:Us,newline:Is,paragraph:Sr,table:Ne,text:Zs},Ht=O("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",He).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",lt).getRegex(),Ws={...Lt,lheading:Ks,table:Ht,paragraph:O(Et).replace("hr",He).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ht).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",lt).getRegex()},Vs={...Lt,html:O(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",At).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ne,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:O(Et).replace("hr",He).replace("heading",` *#{1,6} *[^
10
+ ]`).replace("lheading",Cr).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Qs=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ys=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Dr=/^( {2,}|\\)\n(?!\s*$)/,Js=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,it=/[\p{P}\p{S}]/u,Rt=/[\s\p{P}\p{S}]/u,Mr=/[^\s\p{P}\p{S}]/u,Xs=O(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Rt).getRegex(),Tr=/(?!~)[\p{P}\p{S}]/u,en=/(?!~)[\s\p{P}\p{S}]/u,tn=/(?:[^\s\p{P}\p{S}]|~)/u,Er=/(?![*_])[\p{P}\p{S}]/u,rn=/(?![*_])[\s\p{P}\p{S}]/u,sn=/(?:[^\s\p{P}\p{S}]|[*_])/u,nn=O(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Bs?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),$r=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,on=O($r,"u").replace(/punct/g,it).getRegex(),an=O($r,"u").replace(/punct/g,Tr).getRegex(),Ar="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ln=O(Ar,"gu").replace(/notPunctSpace/g,Mr).replace(/punctSpace/g,Rt).replace(/punct/g,it).getRegex(),cn=O(Ar,"gu").replace(/notPunctSpace/g,tn).replace(/punctSpace/g,en).replace(/punct/g,Tr).getRegex(),dn=O("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Mr).replace(/punctSpace/g,Rt).replace(/punct/g,it).getRegex(),un=O(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Er).getRegex(),pn="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",hn=O(pn,"gu").replace(/notPunctSpace/g,sn).replace(/punctSpace/g,rn).replace(/punct/g,Er).getRegex(),gn=O(/\\(punct)/,"gu").replace(/punct/g,it).getRegex(),xn=O(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),fn=O(At).replace("(?:-->|$)","-->").getRegex(),mn=O("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",fn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),tt=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,bn=O(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",tt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Lr=O(/^!?\[(label)\]\[(ref)\]/).replace("label",tt).replace("ref",$t).getRegex(),Rr=O(/^!?\[(ref)\](?:\[\])?/).replace("ref",$t).getRegex(),vn=O("reflink|nolink(?!\\()","g").replace("reflink",Lr).replace("nolink",Rr).getRegex(),Gt=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ft={_backpedal:Ne,anyPunctuation:gn,autolink:xn,blockSkip:nn,br:Dr,code:Ys,del:Ne,delLDelim:Ne,delRDelim:Ne,emStrongLDelim:on,emStrongRDelimAst:ln,emStrongRDelimUnd:dn,escape:Qs,link:bn,nolink:Rr,punctuation:Xs,reflink:Lr,reflinkSearch:vn,tag:mn,text:Js,url:Ne},kn={...Ft,link:O(/^!?\[(label)\]\((.*?)\)/).replace("label",tt).getRegex(),reflink:O(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",tt).getRegex()},vt={...Ft,emStrongRDelimAst:cn,emStrongLDelim:an,delLDelim:un,delRDelim:hn,url:O(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Gt).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:O(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Gt).getRegex()},yn={...vt,br:O(Dr).replace("{2,}","*").getRegex(),text:O(vt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ye={normal:Lt,gfm:Ws,pedantic:Vs},Be={normal:Ft,gfm:vt,breaks:yn,pedantic:kn},wn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Wt=e=>wn[e];function le(e,t){if(t){if(ee.escapeTest.test(e))return e.replace(ee.escapeReplace,Wt)}else if(ee.escapeTestNoEncode.test(e))return e.replace(ee.escapeReplaceNoEncode,Wt);return e}function Vt(e){try{e=encodeURI(e).replace(ee.percentDecode,"%")}catch{return null}return e}function Qt(e,t){var i;let s=e.replace(ee.findPipe,(l,a,p)=>{let c=!1,u=a;for(;--u>=0&&p[u]==="\\";)c=!c;return c?"|":" |"}),n=s.split(ee.splitPipe),o=0;if(n[0].trim()||n.shift(),n.length>0&&!((i=n.at(-1))!=null&&i.trim())&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;o<n.length;o++)n[o]=n[o].trim().replace(ee.slashPipe,"|");return n}function Ie(e,t,s){let n=e.length;if(n===0)return"";let o=0;for(;o<n&&e.charAt(n-o-1)===t;)o++;return e.slice(0,n-o)}function jn(e,t){if(e.indexOf(t[1])===-1)return-1;let s=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])s++;else if(e[n]===t[1]&&(s--,s<0))return n;return s>0?-2:-1}function zn(e,t=0){let s=t,n="";for(let o of e)if(o===" "){let i=4-s%4;n+=" ".repeat(i),s+=i}else n+=o,s++;return n}function Yt(e,t,s,n,o){let i=t.href,l=t.title||null,a=e[1].replace(o.other.outputLinkReplace,"$1");n.state.inLink=!0;let p={type:e[0].charAt(0)==="!"?"image":"link",raw:s,href:i,title:l,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,p}function Nn(e,t,s){let n=e.match(s.other.indentCodeCompensation);if(n===null)return t;let o=n[1];return t.split(`
11
11
  `).map(i=>{let l=i.match(s.other.beginningSpace);if(l===null)return i;let[a]=l;return a.length>=o.length?i.slice(o.length):i}).join(`
12
- `)}var We=class{constructor(t){K(this,"options");K(this,"rules");K(this,"lexer");this.options=t||be}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let s=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?s:Te(s,`
13
- `)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let s=e[0],n=jn(s,e[3]||"",this.rules);return{type:"code",raw:s,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let s=e[2].trim();if(this.rules.other.endingHash.test(s)){let n=Te(s,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(s=n.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Te(e[0],`
14
- `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let s=Te(e[0],`
12
+ `)}var rt=class{constructor(e){q(this,"options");q(this,"rules");q(this,"lexer");this.options=e||De}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let s=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?s:Ie(s,`
13
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let s=t[0],n=Nn(s,t[3]||"",this.rules);return{type:"code",raw:s,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let s=t[2].trim();if(this.rules.other.endingHash.test(s)){let n=Ie(s,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(s=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Ie(t[0],`
14
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let s=Ie(t[0],`
15
15
  `).split(`
16
- `),n="",o="",i=[];for(;s.length>0;){let l=!1,a=[],u;for(u=0;u<s.length;u++)if(this.rules.other.blockquoteStart.test(s[u]))a.push(s[u]),l=!0;else if(!l)a.push(s[u]);else break;s=s.slice(u);let c=a.join(`
17
- `),d=c.replace(this.rules.other.blockquoteSetextReplace,`
16
+ `),n="",o="",i=[];for(;s.length>0;){let l=!1,a=[],p;for(p=0;p<s.length;p++)if(this.rules.other.blockquoteStart.test(s[p]))a.push(s[p]),l=!0;else if(!l)a.push(s[p]);else break;s=s.slice(p);let c=a.join(`
17
+ `),u=c.replace(this.rules.other.blockquoteSetextReplace,`
18
18
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
19
19
  ${c}`:c,o=o?`${o}
20
- ${d}`:d;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,i,!0),this.lexer.state.top=g,s.length===0)break;let x=i.at(-1);if((x==null?void 0:x.type)==="code")break;if((x==null?void 0:x.type)==="blockquote"){let p=x,h=p.raw+`
20
+ ${u}`:u;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,i,!0),this.lexer.state.top=g,s.length===0)break;let h=i.at(-1);if((h==null?void 0:h.type)==="code")break;if((h==null?void 0:h.type)==="blockquote"){let d=h,x=d.raw+`
21
21
  `+s.join(`
22
- `),m=this.blockquote(h);i[i.length-1]=m,n=n.substring(0,n.length-p.raw.length)+m.raw,o=o.substring(0,o.length-p.text.length)+m.text;break}else if((x==null?void 0:x.type)==="list"){let p=x,h=p.raw+`
22
+ `),m=this.blockquote(x);i[i.length-1]=m,n=n.substring(0,n.length-d.raw.length)+m.raw,o=o.substring(0,o.length-d.text.length)+m.text;break}else if((h==null?void 0:h.type)==="list"){let d=h,x=d.raw+`
23
23
  `+s.join(`
24
- `),m=this.list(h);i[i.length-1]=m,n=n.substring(0,n.length-x.raw.length)+m.raw,o=o.substring(0,o.length-p.raw.length)+m.raw,s=h.substring(i.at(-1).raw.length).split(`
25
- `);continue}}return{type:"blockquote",raw:n,tokens:i,text:o}}}list(t){var s,n;let e=this.rules.block.list.exec(t);if(e){let o=e[1].trim(),i=o.length>1,l={type:"list",raw:"",ordered:i,start:i?+o.slice(0,-1):"",loose:!1,items:[]};o=i?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`,this.options.pedantic&&(o=i?o:"[*+-]");let a=this.rules.other.listItemRegex(o),u=!1;for(;t;){let d=!1,g="",x="";if(!(e=a.exec(t))||this.rules.block.hr.test(t))break;g=e[0],t=t.substring(g.length);let p=wn(e[2].split(`
26
- `,1)[0],e[1].length),h=t.split(`
27
- `,1)[0],m=!p.trim(),y=0;if(this.options.pedantic?(y=2,x=p.trimStart()):m?y=e[1].length+1:(y=p.search(this.rules.other.nonSpaceChar),y=y>4?1:y,x=p.slice(y),y+=e[1].length),m&&this.rules.other.blankLine.test(h)&&(g+=h+`
28
- `,t=t.substring(h.length+1),d=!0),!d){let k=this.rules.other.nextBulletRegex(y),N=this.rules.other.hrRegex(y),M=this.rules.other.fencesBeginRegex(y),w=this.rules.other.headingBeginRegex(y),C=this.rules.other.htmlBeginRegex(y),b=this.rules.other.blockquoteBeginRegex(y);for(;t;){let L=t.split(`
29
- `,1)[0],F;if(h=L,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),F=h):F=h.replace(this.rules.other.tabCharGlobal," "),M.test(h)||w.test(h)||C.test(h)||b.test(h)||k.test(h)||N.test(h))break;if(F.search(this.rules.other.nonSpaceChar)>=y||!h.trim())x+=`
30
- `+F.slice(y);else{if(m||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||M.test(p)||w.test(p)||N.test(p))break;x+=`
31
- `+h}m=!h.trim(),g+=L+`
32
- `,t=t.substring(L.length+1),p=F.slice(y)}}l.loose||(u?l.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(u=!0)),l.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(x),loose:!1,text:x,tokens:[]}),l.raw+=g}let c=l.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;l.raw=l.raw.trimEnd();for(let d of l.items){if(this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]),d.task){if(d.text=d.text.replace(this.rules.other.listReplaceTask,""),((s=d.tokens[0])==null?void 0:s.type)==="text"||((n=d.tokens[0])==null?void 0:n.type)==="paragraph"){d.tokens[0].raw=d.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),d.tokens[0].text=d.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let x=this.lexer.inlineQueue.length-1;x>=0;x--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[x].src)){this.lexer.inlineQueue[x].src=this.lexer.inlineQueue[x].src.replace(this.rules.other.listReplaceTask,"");break}}let g=this.rules.other.listTaskCheckbox.exec(d.raw);if(g){let x={type:"checkbox",raw:g[0]+" ",checked:g[0]!=="[ ]"};d.checked=x.checked,l.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=x.raw+d.tokens[0].raw,d.tokens[0].text=x.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(x)):d.tokens.unshift({type:"paragraph",raw:x.raw,text:x.raw,tokens:[x]}):d.tokens.unshift(x)}}if(!l.loose){let g=d.tokens.filter(p=>p.type==="space"),x=g.length>0&&g.some(p=>this.rules.other.anyLine.test(p.raw));l.loose=x}}if(l.loose)for(let d of l.items){d.loose=!0;for(let g of d.tokens)g.type==="text"&&(g.type="paragraph")}return l}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let s=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:s,raw:e[0],href:n,title:o}}}table(t){var l;let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let s=Ot(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(l=e[3])!=null&&l.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
33
- `):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(s.length===n.length){for(let a of n)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<s.length;a++)i.header.push({text:s[a],tokens:this.lexer.inline(s[a]),header:!0,align:i.align[a]});for(let a of o)i.rows.push(Ot(a,i.header.length).map((u,c)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:i.align[c]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let s=e[1].charAt(e[1].length-1)===`
34
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:s,tokens:this.lexer.inline(s)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let i=Te(s.slice(0,-1),"\\");if((s.length-i.length)%2===0)return}else{let i=yn(e[2],"()");if(i===-2)return;if(i>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let n=e[2],o="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(n);i&&(n=i[1],o=i[3])}else o=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?n=n.slice(1):n=n.slice(1,-1)),_t(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let s;if((s=this.rules.inline.reflink.exec(t))||(s=this.rules.inline.nolink.exec(t))){let n=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=e[n.toLowerCase()];if(!o){let i=s[0].charAt(0);return{type:"text",raw:i,text:i}}return _t(s,o,s[0],this.lexer,this.rules)}}emStrong(t,e,s=""){let n=this.rules.inline.emStrongLDelim.exec(t);if(!(!n||n[3]&&s.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!s||this.rules.inline.punctuation.exec(s))){let o=[...n[0]].length-1,i,l,a=o,u=0,c=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*t.length+o);(n=c.exec(e))!=null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(l=[...i].length,n[3]||n[4]){a+=l;continue}else if((n[5]||n[6])&&o%3&&!((o+l)%3)){u+=l;continue}if(a-=l,a>0)continue;l=Math.min(l,l+a+u);let d=[...n[0]][0].length,g=t.slice(0,o+n.index+d+l);if(Math.min(o,l)%2){let p=g.slice(1,-1);return{type:"em",raw:g,text:p,tokens:this.lexer.inlineTokens(p)}}let x=g.slice(2,-2);return{type:"strong",raw:g,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let s=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(s),o=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return n&&o&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:e[0],text:s}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,s=""){let n=this.rules.inline.delLDelim.exec(t);if(n&&(!n[1]||!s||this.rules.inline.punctuation.exec(s))){let o=[...n[0]].length-1,i,l,a=o,u=this.rules.inline.delRDelim;for(u.lastIndex=0,e=e.slice(-1*t.length+o);(n=u.exec(e))!=null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i||(l=[...i].length,l!==o))continue;if(n[3]||n[4]){a+=l;continue}if(a-=l,a>0)continue;l=Math.min(l,l+a);let c=[...n[0]][0].length,d=t.slice(0,o+n.index+c+l),g=d.slice(o,-o);return{type:"del",raw:d,text:g,tokens:this.lexer.inlineTokens(g)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let s,n;return e[2]==="@"?(s=e[1],n="mailto:"+s):(s=e[1],n=s),{type:"link",raw:e[0],text:s,href:n,tokens:[{type:"text",raw:s,text:s}]}}}url(t){var s;let e;if(e=this.rules.inline.url.exec(t)){let n,o;if(e[2]==="@")n=e[0],o="mailto:"+n;else{let i;do i=e[0],e[0]=((s=this.rules.inline._backpedal.exec(e[0]))==null?void 0:s[0])??"";while(i!==e[0]);n=e[0],e[1]==="www."?o="http://"+e[0]:o=e[0]}return{type:"link",raw:e[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let s=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:s}}}},te=class ut{constructor(e){K(this,"tokens");K(this,"options");K(this,"state");K(this,"inlineQueue");K(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||be,this.options.tokenizer=this.options.tokenizer||new We,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let s={other:J,block:_e.normal,inline:De.normal};this.options.pedantic?(s.block=_e.pedantic,s.inline=De.pedantic):this.options.gfm&&(s.block=_e.gfm,this.options.breaks?s.inline=De.breaks:s.inline=De.gfm),this.tokenizer.rules=s}static get rules(){return{block:_e,inline:De}}static lex(e,s){return new ut(s).lex(e)}static lexInline(e,s){return new ut(s).inlineTokens(e)}lex(e){e=e.replace(J.carriageReturn,`
35
- `),this.blockTokens(e,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){let n=this.inlineQueue[s];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,s=[],n=!1){var o,i,l;for(this.options.pedantic&&(e=e.replace(J.tabCharGlobal," ").replace(J.spaceLine,""));e;){let a;if((i=(o=this.options.extensions)==null?void 0:o.block)!=null&&i.some(c=>(a=c.call({lexer:this},e,s))?(e=e.substring(a.raw.length),s.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);let c=s.at(-1);a.raw.length===1&&c!==void 0?c.raw+=`
36
- `:s.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);let c=s.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
24
+ `),m=this.list(x);i[i.length-1]=m,n=n.substring(0,n.length-h.raw.length)+m.raw,o=o.substring(0,o.length-d.raw.length)+m.raw,s=x.substring(i.at(-1).raw.length).split(`
25
+ `);continue}}return{type:"blockquote",raw:n,tokens:i,text:o}}}list(e){var s,n;let t=this.rules.block.list.exec(e);if(t){let o=t[1].trim(),i=o.length>1,l={type:"list",raw:"",ordered:i,start:i?+o.slice(0,-1):"",loose:!1,items:[]};o=i?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`,this.options.pedantic&&(o=i?o:"[*+-]");let a=this.rules.other.listItemRegex(o),p=!1;for(;e;){let u=!1,g="",h="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;g=t[0],e=e.substring(g.length);let d=zn(t[2].split(`
26
+ `,1)[0],t[1].length),x=e.split(`
27
+ `,1)[0],m=!d.trim(),v=0;if(this.options.pedantic?(v=2,h=d.trimStart()):m?v=t[1].length+1:(v=d.search(this.rules.other.nonSpaceChar),v=v>4?1:v,h=d.slice(v),v+=t[1].length),m&&this.rules.other.blankLine.test(x)&&(g+=x+`
28
+ `,e=e.substring(x.length+1),u=!0),!u){let k=this.rules.other.nextBulletRegex(v),z=this.rules.other.hrRegex(v),E=this.rules.other.fencesBeginRegex(v),y=this.rules.other.headingBeginRegex(v),D=this.rules.other.htmlBeginRegex(v),N=this.rules.other.blockquoteBeginRegex(v);for(;e;){let B=e.split(`
29
+ `,1)[0],I;if(x=B,this.options.pedantic?(x=x.replace(this.rules.other.listReplaceNesting," "),I=x):I=x.replace(this.rules.other.tabCharGlobal," "),E.test(x)||y.test(x)||D.test(x)||N.test(x)||k.test(x)||z.test(x))break;if(I.search(this.rules.other.nonSpaceChar)>=v||!x.trim())h+=`
30
+ `+I.slice(v);else{if(m||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||E.test(d)||y.test(d)||z.test(d))break;h+=`
31
+ `+x}m=!x.trim(),g+=B+`
32
+ `,e=e.substring(B.length+1),d=I.slice(v)}}l.loose||(p?l.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(p=!0)),l.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),l.raw+=g}let c=l.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;l.raw=l.raw.trimEnd();for(let u of l.items){if(this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]),u.task){if(u.text=u.text.replace(this.rules.other.listReplaceTask,""),((s=u.tokens[0])==null?void 0:s.type)==="text"||((n=u.tokens[0])==null?void 0:n.type)==="paragraph"){u.tokens[0].raw=u.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),u.tokens[0].text=u.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}}let g=this.rules.other.listTaskCheckbox.exec(u.raw);if(g){let h={type:"checkbox",raw:g[0]+" ",checked:g[0]!=="[ ]"};u.checked=h.checked,l.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=h.raw+u.tokens[0].raw,u.tokens[0].text=h.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(h)):u.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):u.tokens.unshift(h)}}if(!l.loose){let g=u.tokens.filter(d=>d.type==="space"),h=g.length>0&&g.some(d=>this.rules.other.anyLine.test(d.raw));l.loose=h}}if(l.loose)for(let u of l.items){u.loose=!0;for(let g of u.tokens)g.type==="text"&&(g.type="paragraph")}return l}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let s=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:s,raw:t[0],href:n,title:o}}}table(e){var l;let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let s=Qt(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(l=t[3])!=null&&l.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
33
+ `):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(s.length===n.length){for(let a of n)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<s.length;a++)i.header.push({text:s[a],tokens:this.lexer.inline(s[a]),header:!0,align:i.align[a]});for(let a of o)i.rows.push(Qt(a,i.header.length).map((p,c)=>({text:p,tokens:this.lexer.inline(p),header:!1,align:i.align[c]})));return i}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let s=t[1].charAt(t[1].length-1)===`
34
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:s,tokens:this.lexer.inline(s)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let s=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let i=Ie(s.slice(0,-1),"\\");if((s.length-i.length)%2===0)return}else{let i=jn(t[2],"()");if(i===-2)return;if(i>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let n=t[2],o="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(n);i&&(n=i[1],o=i[3])}else o=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?n=n.slice(1):n=n.slice(1,-1)),Yt(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){let n=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=t[n.toLowerCase()];if(!o){let i=s[0].charAt(0);return{type:"text",raw:i,text:i}}return Yt(s,o,s[0],this.lexer,this.rules)}}emStrong(e,t,s=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!(!n||n[3]&&s.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!s||this.rules.inline.punctuation.exec(s))){let o=[...n[0]].length-1,i,l,a=o,p=0,c=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+o);(n=c.exec(t))!=null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(l=[...i].length,n[3]||n[4]){a+=l;continue}else if((n[5]||n[6])&&o%3&&!((o+l)%3)){p+=l;continue}if(a-=l,a>0)continue;l=Math.min(l,l+a+p);let u=[...n[0]][0].length,g=e.slice(0,o+n.index+u+l);if(Math.min(o,l)%2){let d=g.slice(1,-1);return{type:"em",raw:g,text:d,tokens:this.lexer.inlineTokens(d)}}let h=g.slice(2,-2);return{type:"strong",raw:g,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let s=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(s),o=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return n&&o&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:t[0],text:s}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,s=""){let n=this.rules.inline.delLDelim.exec(e);if(n&&(!n[1]||!s||this.rules.inline.punctuation.exec(s))){let o=[...n[0]].length-1,i,l,a=o,p=this.rules.inline.delRDelim;for(p.lastIndex=0,t=t.slice(-1*e.length+o);(n=p.exec(t))!=null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i||(l=[...i].length,l!==o))continue;if(n[3]||n[4]){a+=l;continue}if(a-=l,a>0)continue;l=Math.min(l,l+a);let c=[...n[0]][0].length,u=e.slice(0,o+n.index+c+l),g=u.slice(o,-o);return{type:"del",raw:u,text:g,tokens:this.lexer.inlineTokens(g)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let s,n;return t[2]==="@"?(s=t[1],n="mailto:"+s):(s=t[1],n=s),{type:"link",raw:t[0],text:s,href:n,tokens:[{type:"text",raw:s,text:s}]}}}url(e){var s;let t;if(t=this.rules.inline.url.exec(e)){let n,o;if(t[2]==="@")n=t[0],o="mailto:"+n;else{let i;do i=t[0],t[0]=((s=this.rules.inline._backpedal.exec(t[0]))==null?void 0:s[0])??"";while(i!==t[0]);n=t[0],t[1]==="www."?o="http://"+t[0]:o=t[0]}return{type:"link",raw:t[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let s=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:s}}}},oe=class kt{constructor(t){q(this,"tokens");q(this,"options");q(this,"state");q(this,"inlineQueue");q(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||De,this.options.tokenizer=this.options.tokenizer||new rt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let s={other:ee,block:Ye.normal,inline:Be.normal};this.options.pedantic?(s.block=Ye.pedantic,s.inline=Be.pedantic):this.options.gfm&&(s.block=Ye.gfm,this.options.breaks?s.inline=Be.breaks:s.inline=Be.gfm),this.tokenizer.rules=s}static get rules(){return{block:Ye,inline:Be}}static lex(t,s){return new kt(s).lex(t)}static lexInline(t,s){return new kt(s).inlineTokens(t)}lex(t){t=t.replace(ee.carriageReturn,`
35
+ `),this.blockTokens(t,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){let n=this.inlineQueue[s];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,s=[],n=!1){var o,i,l;for(this.options.pedantic&&(t=t.replace(ee.tabCharGlobal," ").replace(ee.spaceLine,""));t;){let a;if((i=(o=this.options.extensions)==null?void 0:o.block)!=null&&i.some(c=>(a=c.call({lexer:this},t,s))?(t=t.substring(a.raw.length),s.push(a),!0):!1))continue;if(a=this.tokenizer.space(t)){t=t.substring(a.raw.length);let c=s.at(-1);a.raw.length===1&&c!==void 0?c.raw+=`
36
+ `:s.push(a);continue}if(a=this.tokenizer.code(t)){t=t.substring(a.raw.length);let c=s.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
37
37
  `)?"":`
38
38
  `)+a.raw,c.text+=`
39
- `+a.text,this.inlineQueue.at(-1).src=c.text):s.push(a);continue}if(a=this.tokenizer.fences(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.heading(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.hr(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.blockquote(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.list(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.html(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.def(e)){e=e.substring(a.raw.length);let c=s.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
39
+ `+a.text,this.inlineQueue.at(-1).src=c.text):s.push(a);continue}if(a=this.tokenizer.fences(t)){t=t.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.heading(t)){t=t.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.hr(t)){t=t.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.blockquote(t)){t=t.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.list(t)){t=t.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.html(t)){t=t.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.def(t)){t=t.substring(a.raw.length);let c=s.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
40
40
  `)?"":`
41
41
  `)+a.raw,c.text+=`
42
- `+a.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title},s.push(a));continue}if(a=this.tokenizer.table(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.lheading(e)){e=e.substring(a.raw.length),s.push(a);continue}let u=e;if((l=this.options.extensions)!=null&&l.startBlock){let c=1/0,d=e.slice(1),g;this.options.extensions.startBlock.forEach(x=>{g=x.call({lexer:this},d),typeof g=="number"&&g>=0&&(c=Math.min(c,g))}),c<1/0&&c>=0&&(u=e.substring(0,c+1))}if(this.state.top&&(a=this.tokenizer.paragraph(u))){let c=s.at(-1);n&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=(c.raw.endsWith(`
42
+ `+a.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title},s.push(a));continue}if(a=this.tokenizer.table(t)){t=t.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.lheading(t)){t=t.substring(a.raw.length),s.push(a);continue}let p=t;if((l=this.options.extensions)!=null&&l.startBlock){let c=1/0,u=t.slice(1),g;this.options.extensions.startBlock.forEach(h=>{g=h.call({lexer:this},u),typeof g=="number"&&g>=0&&(c=Math.min(c,g))}),c<1/0&&c>=0&&(p=t.substring(0,c+1))}if(this.state.top&&(a=this.tokenizer.paragraph(p))){let c=s.at(-1);n&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=(c.raw.endsWith(`
43
43
  `)?"":`
44
44
  `)+a.raw,c.text+=`
45
- `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):s.push(a),n=u.length!==e.length,e=e.substring(a.raw.length);continue}if(a=this.tokenizer.text(e)){e=e.substring(a.raw.length);let c=s.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
45
+ `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):s.push(a),n=p.length!==t.length,t=t.substring(a.raw.length);continue}if(a=this.tokenizer.text(t)){t=t.substring(a.raw.length);let c=s.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
46
46
  `)?"":`
47
47
  `)+a.raw,c.text+=`
48
- `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):s.push(a);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,s}inline(e,s=[]){return this.inlineQueue.push({src:e,tokens:s}),s}inlineTokens(e,s=[]){var u,c,d,g,x;let n=e,o=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)p.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,o.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=o[2]?o[2].length:0,n=n.slice(0,o.index+i)+"["+"a".repeat(o[0].length-i-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((c=(u=this.options.hooks)==null?void 0:u.emStrongMask)==null?void 0:c.call({lexer:this},n))??n;let l=!1,a="";for(;e;){l||(a=""),l=!1;let p;if((g=(d=this.options.extensions)==null?void 0:d.inline)!=null&&g.some(m=>(p=m.call({lexer:this},e,s))?(e=e.substring(p.raw.length),s.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),s.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),s.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),s.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let m=s.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):s.push(p);continue}if(p=this.tokenizer.emStrong(e,n,a)){e=e.substring(p.raw.length),s.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),s.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),s.push(p);continue}if(p=this.tokenizer.del(e,n,a)){e=e.substring(p.raw.length),s.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),s.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),s.push(p);continue}let h=e;if((x=this.options.extensions)!=null&&x.startInline){let m=1/0,y=e.slice(1),k;this.options.extensions.startInline.forEach(N=>{k=N.call({lexer:this},y),typeof k=="number"&&k>=0&&(m=Math.min(m,k))}),m<1/0&&m>=0&&(h=e.substring(0,m+1))}if(p=this.tokenizer.inlineText(h)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(a=p.raw.slice(-1)),l=!0;let m=s.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):s.push(p);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return s}},Ze=class{constructor(t){K(this,"options");K(this,"parser");this.options=t||be}space(t){return""}code({text:t,lang:e,escaped:s}){var i;let n=(i=(e||"").match(J.notSpaceStart))==null?void 0:i[0],o=t.replace(J.endingNewline,"")+`
49
- `;return n?'<pre><code class="language-'+ne(n)+'">'+(s?o:ne(o,!0))+`</code></pre>
50
- `:"<pre><code>"+(s?o:ne(o,!0))+`</code></pre>
51
- `}blockquote({tokens:t}){return`<blockquote>
52
- ${this.parser.parse(t)}</blockquote>
53
- `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
54
- `}hr(t){return`<hr>
55
- `}list(t){let e=t.ordered,s=t.start,n="";for(let l=0;l<t.items.length;l++){let a=t.items[l];n+=this.listitem(a)}let o=e?"ol":"ul",i=e&&s!==1?' start="'+s+'"':"";return"<"+o+i+`>
48
+ `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):s.push(a);continue}if(t){let c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,s}inline(t,s=[]){return this.inlineQueue.push({src:t,tokens:s}),s}inlineTokens(t,s=[]){var p,c,u,g,h;let n=t,o=null;if(this.tokens.links){let d=Object.keys(this.tokens.links);if(d.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)d.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,o.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=o[2]?o[2].length:0,n=n.slice(0,o.index+i)+"["+"a".repeat(o[0].length-i-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((c=(p=this.options.hooks)==null?void 0:p.emStrongMask)==null?void 0:c.call({lexer:this},n))??n;let l=!1,a="";for(;t;){l||(a=""),l=!1;let d;if((g=(u=this.options.extensions)==null?void 0:u.inline)!=null&&g.some(m=>(d=m.call({lexer:this},t,s))?(t=t.substring(d.raw.length),s.push(d),!0):!1))continue;if(d=this.tokenizer.escape(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.tag(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.link(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(d.raw.length);let m=s.at(-1);d.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=d.raw,m.text+=d.text):s.push(d);continue}if(d=this.tokenizer.emStrong(t,n,a)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.codespan(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.br(t)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.del(t,n,a)){t=t.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.autolink(t)){t=t.substring(d.raw.length),s.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(t))){t=t.substring(d.raw.length),s.push(d);continue}let x=t;if((h=this.options.extensions)!=null&&h.startInline){let m=1/0,v=t.slice(1),k;this.options.extensions.startInline.forEach(z=>{k=z.call({lexer:this},v),typeof k=="number"&&k>=0&&(m=Math.min(m,k))}),m<1/0&&m>=0&&(x=t.substring(0,m+1))}if(d=this.tokenizer.inlineText(x)){t=t.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(a=d.raw.slice(-1)),l=!0;let m=s.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=d.raw,m.text+=d.text):s.push(d);continue}if(t){let m="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return s}},st=class{constructor(e){q(this,"options");q(this,"parser");this.options=e||De}space(e){return""}code({text:e,lang:t,escaped:s}){var i;let n=(i=(t||"").match(ee.notSpaceStart))==null?void 0:i[0],o=e.replace(ee.endingNewline,"")+`
49
+ `;return n?'<pre><code class="language-'+le(n)+'">'+(s?o:le(o,!0))+`</code></pre>
50
+ `:"<pre><code>"+(s?o:le(o,!0))+`</code></pre>
51
+ `}blockquote({tokens:e}){return`<blockquote>
52
+ ${this.parser.parse(e)}</blockquote>
53
+ `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
54
+ `}hr(e){return`<hr>
55
+ `}list(e){let t=e.ordered,s=e.start,n="";for(let l=0;l<e.items.length;l++){let a=e.items[l];n+=this.listitem(a)}let o=t?"ol":"ul",i=t&&s!==1?' start="'+s+'"':"";return"<"+o+i+`>
56
56
  `+n+"</"+o+`>
57
- `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
58
- `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
59
- `}table(t){let e="",s="";for(let o=0;o<t.header.length;o++)s+=this.tablecell(t.header[o]);e+=this.tablerow({text:s});let n="";for(let o=0;o<t.rows.length;o++){let i=t.rows[o];s="";for(let l=0;l<i.length;l++)s+=this.tablecell(i[l]);n+=this.tablerow({text:s})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
57
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
58
+ `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
59
+ `}table(e){let t="",s="";for(let o=0;o<e.header.length;o++)s+=this.tablecell(e.header[o]);t+=this.tablerow({text:s});let n="";for(let o=0;o<e.rows.length;o++){let i=e.rows[o];s="";for(let l=0;l<i.length;l++)s+=this.tablecell(i[l]);n+=this.tablerow({text:s})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
60
60
  <thead>
61
- `+e+`</thead>
61
+ `+t+`</thead>
62
62
  `+n+`</table>
63
- `}tablerow({text:t}){return`<tr>
64
- ${t}</tr>
65
- `}tablecell(t){let e=this.parser.parseInline(t.tokens),s=t.header?"th":"td";return(t.align?`<${s} align="${t.align}">`:`<${s}>`)+e+`</${s}>
66
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${ne(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:s}){let n=this.parser.parseInline(s),o=Pt(t);if(o===null)return n;t=o;let i='<a href="'+t+'"';return e&&(i+=' title="'+ne(e)+'"'),i+=">"+n+"</a>",i}image({href:t,title:e,text:s,tokens:n}){n&&(s=this.parser.parseInline(n,this.parser.textRenderer));let o=Pt(t);if(o===null)return ne(s);t=o;let i=`<img src="${t}" alt="${ne(s)}"`;return e&&(i+=` title="${ne(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:ne(t.text)}},St=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},re=class pt{constructor(e){K(this,"options");K(this,"renderer");K(this,"textRenderer");this.options=e||be,this.options.renderer=this.options.renderer||new Ze,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new St}static parse(e,s){return new pt(s).parse(e)}static parseInline(e,s){return new pt(s).parseInline(e)}parse(e){var n,o;let s="";for(let i=0;i<e.length;i++){let l=e[i];if((o=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&o[l.type]){let u=l,c=this.options.extensions.renderers[u.type].call({parser:this},u);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(u.type)){s+=c||"";continue}}let a=l;switch(a.type){case"space":{s+=this.renderer.space(a);break}case"hr":{s+=this.renderer.hr(a);break}case"heading":{s+=this.renderer.heading(a);break}case"code":{s+=this.renderer.code(a);break}case"table":{s+=this.renderer.table(a);break}case"blockquote":{s+=this.renderer.blockquote(a);break}case"list":{s+=this.renderer.list(a);break}case"checkbox":{s+=this.renderer.checkbox(a);break}case"html":{s+=this.renderer.html(a);break}case"def":{s+=this.renderer.def(a);break}case"paragraph":{s+=this.renderer.paragraph(a);break}case"text":{s+=this.renderer.text(a);break}default:{let u='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return s}parseInline(e,s=this.renderer){var o,i;let n="";for(let l=0;l<e.length;l++){let a=e[l];if((i=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&i[a.type]){let c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){n+=c||"";continue}}let u=a;switch(u.type){case"escape":{n+=s.text(u);break}case"html":{n+=s.html(u);break}case"link":{n+=s.link(u);break}case"image":{n+=s.image(u);break}case"checkbox":{n+=s.checkbox(u);break}case"strong":{n+=s.strong(u);break}case"em":{n+=s.em(u);break}case"codespan":{n+=s.codespan(u);break}case"br":{n+=s.br(u);break}case"del":{n+=s.del(u);break}case"text":{n+=s.text(u);break}default:{let c='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return n}},Ue,Le=(Ue=class{constructor(t){K(this,"options");K(this,"block");this.options=t||be}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?te.lex:te.lexInline}provideParser(){return this.block?re.parse:re.parseInline}},K(Ue,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),K(Ue,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Ue),Cr=class{constructor(...t){K(this,"defaults",vt());K(this,"options",this.setOptions);K(this,"parse",this.parseMarkdown(!0));K(this,"parseInline",this.parseMarkdown(!1));K(this,"Parser",re);K(this,"Renderer",Ze);K(this,"TextRenderer",St);K(this,"Lexer",te);K(this,"Tokenizer",We);K(this,"Hooks",Le);this.use(...t)}walkTokens(t,e){var n,o;let s=[];for(let i of t)switch(s=s.concat(e.call(this,i)),i.type){case"table":{let l=i;for(let a of l.header)s=s.concat(this.walkTokens(a.tokens,e));for(let a of l.rows)for(let u of a)s=s.concat(this.walkTokens(u.tokens,e));break}case"list":{let l=i;s=s.concat(this.walkTokens(l.items,e));break}default:{let l=i;(o=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&o[l.type]?this.defaults.extensions.childTokens[l.type].forEach(a=>{let u=l[a].flat(1/0);s=s.concat(this.walkTokens(u,e))}):l.tokens&&(s=s.concat(this.walkTokens(l.tokens,e)))}}return s}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(s=>{let n={...s};if(n.async=this.defaults.async||n.async||!1,s.extensions&&(s.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let i=e.renderers[o.name];i?e.renderers[o.name]=function(...l){let a=o.renderer.apply(this,l);return a===!1&&(a=i.apply(this,l)),a}:e.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[o.level];i?i.unshift(o.tokenizer):e[o.level]=[o.tokenizer],o.start&&(o.level==="block"?e.startBlock?e.startBlock.push(o.start):e.startBlock=[o.start]:o.level==="inline"&&(e.startInline?e.startInline.push(o.start):e.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(e.childTokens[o.name]=o.childTokens)}),n.extensions=e),s.renderer){let o=this.defaults.renderer||new Ze(this.defaults);for(let i in s.renderer){if(!(i in o))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,a=s.renderer[l],u=o[l];o[l]=(...c)=>{let d=a.apply(o,c);return d===!1&&(d=u.apply(o,c)),d||""}}n.renderer=o}if(s.tokenizer){let o=this.defaults.tokenizer||new We(this.defaults);for(let i in s.tokenizer){if(!(i in o))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let l=i,a=s.tokenizer[l],u=o[l];o[l]=(...c)=>{let d=a.apply(o,c);return d===!1&&(d=u.apply(o,c)),d}}n.tokenizer=o}if(s.hooks){let o=this.defaults.hooks||new Le;for(let i in s.hooks){if(!(i in o))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let l=i,a=s.hooks[l],u=o[l];Le.passThroughHooks.has(i)?o[l]=c=>{if(this.defaults.async&&Le.passThroughHooksRespectAsync.has(i))return(async()=>{let g=await a.call(o,c);return u.call(o,g)})();let d=a.call(o,c);return u.call(o,d)}:o[l]=(...c)=>{if(this.defaults.async)return(async()=>{let g=await a.apply(o,c);return g===!1&&(g=await u.apply(o,c)),g})();let d=a.apply(o,c);return d===!1&&(d=u.apply(o,c)),d}}n.hooks=o}if(s.walkTokens){let o=this.defaults.walkTokens,i=s.walkTokens;n.walkTokens=function(l){let a=[];return a.push(i.call(this,l)),o&&(a=a.concat(o.call(this,l))),a}}this.defaults={...this.defaults,...n}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return te.lex(t,e??this.defaults)}parser(t,e){return re.parse(t,e??this.defaults)}parseMarkdown(t){return(e,s)=>{let n={...s},o={...this.defaults,...n},i=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&n.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=t),o.async)return(async()=>{let l=o.hooks?await o.hooks.preprocess(e):e,a=await(o.hooks?await o.hooks.provideLexer():t?te.lex:te.lexInline)(l,o),u=o.hooks?await o.hooks.processAllTokens(a):a;o.walkTokens&&await Promise.all(this.walkTokens(u,o.walkTokens));let c=await(o.hooks?await o.hooks.provideParser():t?re.parse:re.parseInline)(u,o);return o.hooks?await o.hooks.postprocess(c):c})().catch(i);try{o.hooks&&(e=o.hooks.preprocess(e));let l=(o.hooks?o.hooks.provideLexer():t?te.lex:te.lexInline)(e,o);o.hooks&&(l=o.hooks.processAllTokens(l)),o.walkTokens&&this.walkTokens(l,o.walkTokens);let a=(o.hooks?o.hooks.provideParser():t?re.parse:re.parseInline)(l,o);return o.hooks&&(a=o.hooks.postprocess(a)),a}catch(l){return i(l)}}}onError(t,e){return s=>{if(s.message+=`
67
- Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error occurred:</p><pre>"+ne(s.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(s);throw s}}},fe=new Cr;function _(t,e){return fe.parse(t,e)}_.options=_.setOptions=function(t){return fe.setOptions(t),_.defaults=fe.defaults,gr(_.defaults),_};_.getDefaults=vt;_.defaults=be;_.use=function(...t){return fe.use(...t),_.defaults=fe.defaults,gr(_.defaults),_};_.walkTokens=function(t,e){return fe.walkTokens(t,e)};_.parseInline=fe.parseInline;_.Parser=re;_.parser=re.parse;_.Renderer=Ze;_.TextRenderer=St;_.Lexer=te;_.lexer=te.lex;_.Tokenizer=We;_.Hooks=Le;_.parse=_;_.options;_.setOptions;_.use;_.walkTokens;_.parseInline;re.parse;te.lex;function Sr(t){const e=t.match(/^#\s+(.+)$/m);return e?e[1].trim():t.split(`
68
- `).map(n=>n.trim()).find(n=>n.length>0)||"Untitled"}const Dt="deleted",rt={id:Dt,name:"Deleted",color:"#ef4444"},ht=[{name:"red",hex:"#e11d48"},{name:"orange",hex:"#ea580c"},{name:"amber",hex:"#d97706"},{name:"yellow",hex:"#ca8a04"},{name:"lime",hex:"#65a30d"},{name:"green",hex:"#16a34a"},{name:"teal",hex:"#0d9488"},{name:"cyan",hex:"#0891b2"},{name:"blue",hex:"#2563eb"},{name:"indigo",hex:"#4f46e5"},{name:"violet",hex:"#7c3aed"},{name:"pink",hex:"#db2777"}];function Dr(t){var e,s,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(s=Dr(t[e]))&&(n&&(n+=" "),n+=s)}else for(s in t)t[s]&&(n&&(n+=" "),n+=s);return n}function Nn(){for(var t,e,s=0,n="",o=arguments.length;s<o;s++)(t=arguments[s])&&(e=Dr(t))&&(n&&(n+=" "),n+=e);return n}const Tt="-",zn=t=>{const e=Sn(t),{conflictingClassGroups:s,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:l=>{const a=l.split(Tt);return a[0]===""&&a.length!==1&&a.shift(),Tr(a,e)||Cn(l)},getConflictingClassGroupIds:(l,a)=>{const u=s[l]||[];return a&&n[l]?[...u,...n[l]]:u}}},Tr=(t,e)=>{var l;if(t.length===0)return e.classGroupId;const s=t[0],n=e.nextPart.get(s),o=n?Tr(t.slice(1),n):void 0;if(o)return o;if(e.validators.length===0)return;const i=t.join(Tt);return(l=e.validators.find(({validator:a})=>a(i)))==null?void 0:l.classGroupId},Kt=/^\[(.+)\]$/,Cn=t=>{if(Kt.test(t)){const e=Kt.exec(t)[1],s=e==null?void 0:e.substring(0,e.indexOf(":"));if(s)return"arbitrary.."+s}},Sn=t=>{const{theme:e,prefix:s}=t,n={nextPart:new Map,validators:[]};return Tn(Object.entries(t.classGroups),s).forEach(([i,l])=>{gt(l,n,i,e)}),n},gt=(t,e,s,n)=>{t.forEach(o=>{if(typeof o=="string"){const i=o===""?e:qt(e,o);i.classGroupId=s;return}if(typeof o=="function"){if(Dn(o)){gt(o(n),e,s,n);return}e.validators.push({validator:o,classGroupId:s});return}Object.entries(o).forEach(([i,l])=>{gt(l,qt(e,i),s,n)})})},qt=(t,e)=>{let s=t;return e.split(Tt).forEach(n=>{s.nextPart.has(n)||s.nextPart.set(n,{nextPart:new Map,validators:[]}),s=s.nextPart.get(n)}),s},Dn=t=>t.isThemeGetter,Tn=(t,e)=>e?t.map(([s,n])=>{const o=n.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([l,a])=>[e+l,a])):i);return[s,o]}):t,Mn=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,s=new Map,n=new Map;const o=(i,l)=>{s.set(i,l),e++,e>t&&(e=0,n=s,s=new Map)};return{get(i){let l=s.get(i);if(l!==void 0)return l;if((l=n.get(i))!==void 0)return o(i,l),l},set(i,l){s.has(i)?s.set(i,l):o(i,l)}}},Mr="!",En=t=>{const{separator:e,experimentalParseClassName:s}=t,n=e.length===1,o=e[0],i=e.length,l=a=>{const u=[];let c=0,d=0,g;for(let y=0;y<a.length;y++){let k=a[y];if(c===0){if(k===o&&(n||a.slice(y,y+i)===e)){u.push(a.slice(d,y)),d=y+i;continue}if(k==="/"){g=y;continue}}k==="["?c++:k==="]"&&c--}const x=u.length===0?a:a.substring(d),p=x.startsWith(Mr),h=p?x.substring(1):x,m=g&&g>d?g-d:void 0;return{modifiers:u,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:m}};return s?a=>s({className:a,parseClassName:l}):l},An=t=>{if(t.length<=1)return t;const e=[];let s=[];return t.forEach(n=>{n[0]==="["?(e.push(...s.sort(),n),s=[]):s.push(n)}),e.push(...s.sort()),e},$n=t=>({cache:Mn(t.cacheSize),parseClassName:En(t),...zn(t)}),Ln=/\s+/,Rn=(t,e)=>{const{parseClassName:s,getClassGroupId:n,getConflictingClassGroupIds:o}=e,i=[],l=t.trim().split(Ln);let a="";for(let u=l.length-1;u>=0;u-=1){const c=l[u],{modifiers:d,hasImportantModifier:g,baseClassName:x,maybePostfixModifierPosition:p}=s(c);let h=!!p,m=n(h?x.substring(0,p):x);if(!m){if(!h){a=c+(a.length>0?" "+a:a);continue}if(m=n(x),!m){a=c+(a.length>0?" "+a:a);continue}h=!1}const y=An(d).join(":"),k=g?y+Mr:y,N=k+m;if(i.includes(N))continue;i.push(N);const M=o(m,h);for(let w=0;w<M.length;++w){const C=M[w];i.push(k+C)}a=c+(a.length>0?" "+a:a)}return a};function Fn(){let t=0,e,s,n="";for(;t<arguments.length;)(e=arguments[t++])&&(s=Er(e))&&(n&&(n+=" "),n+=s);return n}const Er=t=>{if(typeof t=="string")return t;let e,s="";for(let n=0;n<t.length;n++)t[n]&&(e=Er(t[n]))&&(s&&(s+=" "),s+=e);return s};function Bn(t,...e){let s,n,o,i=l;function l(u){const c=e.reduce((d,g)=>g(d),t());return s=$n(c),n=s.cache.get,o=s.cache.set,i=a,a(u)}function a(u){const c=n(u);if(c)return c;const d=Rn(u,s);return o(u,d),d}return function(){return i(Fn.apply(null,arguments))}}const U=t=>{const e=s=>s[t]||[];return e.isThemeGetter=!0,e},Ar=/^\[(?:([a-z-]+):)?(.+)\]$/i,In=/^\d+\/\d+$/,Pn=new Set(["px","full","screen"]),On=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_n=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Kn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Un=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ie=t=>ye(t)||Pn.has(t)||In.test(t),de=t=>Ne(t,"length",Jn),ye=t=>!!t&&!Number.isNaN(Number(t)),st=t=>Ne(t,"number",ye),Me=t=>!!t&&Number.isInteger(Number(t)),Hn=t=>t.endsWith("%")&&ye(t.slice(0,-1)),R=t=>Ar.test(t),ue=t=>On.test(t),Gn=new Set(["length","size","percentage"]),Wn=t=>Ne(t,Gn,$r),Zn=t=>Ne(t,"position",$r),Vn=new Set(["image","url"]),Qn=t=>Ne(t,Vn,eo),Yn=t=>Ne(t,"",Xn),Ee=()=>!0,Ne=(t,e,s)=>{const n=Ar.exec(t);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):s(n[2]):!1},Jn=t=>_n.test(t)&&!Kn.test(t),$r=()=>!1,Xn=t=>qn.test(t),eo=t=>Un.test(t),to=()=>{const t=U("colors"),e=U("spacing"),s=U("blur"),n=U("brightness"),o=U("borderColor"),i=U("borderRadius"),l=U("borderSpacing"),a=U("borderWidth"),u=U("contrast"),c=U("grayscale"),d=U("hueRotate"),g=U("invert"),x=U("gap"),p=U("gradientColorStops"),h=U("gradientColorStopPositions"),m=U("inset"),y=U("margin"),k=U("opacity"),N=U("padding"),M=U("saturate"),w=U("scale"),C=U("sepia"),b=U("skew"),L=U("space"),F=U("translate"),v=()=>["auto","contain","none"],S=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto",R,e],z=()=>[R,e],A=()=>["",ie,de],W=()=>["auto",ye,R],ee=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],X=()=>["solid","dashed","dotted","double","none"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>["start","end","center","between","around","evenly","stretch"],H=()=>["","0",R],se=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>[ye,R];return{cacheSize:500,separator:":",theme:{colors:[Ee],spacing:[ie,de],blur:["none","",ue,R],brightness:Z(),borderColor:[t],borderRadius:["none","","full",ue,R],borderSpacing:z(),borderWidth:A(),contrast:Z(),grayscale:H(),hueRotate:Z(),invert:H(),gap:z(),gradientColorStops:[t],gradientColorStopPositions:[Hn,de],inset:E(),margin:E(),opacity:Z(),padding:z(),saturate:Z(),scale:Z(),sepia:H(),skew:Z(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",R]}],container:["container"],columns:[{columns:[ue]}],"break-after":[{"break-after":se()}],"break-before":[{"break-before":se()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ee(),R]}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:v()}],"overscroll-x":[{"overscroll-x":v()}],"overscroll-y":[{"overscroll-y":v()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Me,R]}],basis:[{basis:E()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",R]}],grow:[{grow:H()}],shrink:[{shrink:H()}],order:[{order:["first","last","none",Me,R]}],"grid-cols":[{"grid-cols":[Ee]}],"col-start-end":[{col:["auto",{span:["full",Me,R]},R]}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":[Ee]}],"row-start-end":[{row:["auto",{span:[Me,R]},R]}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",R]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",R]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...B()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...B(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...B(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[N]}],px:[{px:[N]}],py:[{py:[N]}],ps:[{ps:[N]}],pe:[{pe:[N]}],pt:[{pt:[N]}],pr:[{pr:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[L]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[L]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",R,e]}],"min-w":[{"min-w":[R,e,"min","max","fit"]}],"max-w":[{"max-w":[R,e,"none","full","min","max","fit","prose",{screen:[ue]},ue]}],h:[{h:[R,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[R,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[R,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[R,e,"auto","min","max","fit"]}],"font-size":[{text:["base",ue,de]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",st]}],"font-family":[{font:[Ee]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",R]}],"line-clamp":[{"line-clamp":["none",ye,st]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ie,R]}],"list-image":[{"list-image":["none",R]}],"list-style-type":[{list:["none","disc","decimal",R]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ie,de]}],"underline-offset":[{"underline-offset":["auto",ie,R]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",R]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",R]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ee(),Zn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Wn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Qn]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...X(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:X()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...X()]}],"outline-offset":[{"outline-offset":[ie,R]}],"outline-w":[{outline:[ie,de]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[ie,de]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",ue,Yn]}],"shadow-color":[{shadow:[Ee]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...Y(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Y()}],filter:[{filter:["","none"]}],blur:[{blur:[s]}],brightness:[{brightness:[n]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",ue,R]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[g]}],saturate:[{saturate:[M]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[s]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[M]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",R]}],duration:[{duration:Z()}],ease:[{ease:["linear","in","out","in-out",R]}],delay:[{delay:Z()}],animate:[{animate:["none","spin","ping","pulse","bounce",R]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[Me,R]}],"translate-x":[{"translate-x":[F]}],"translate-y":[{"translate-y":[F]}],"skew-x":[{"skew-x":[b]}],"skew-y":[{"skew-y":[b]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",R]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",R]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",R]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[ie,de,st]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},ro=Bn(to);function Q(...t){return ro(Nn(t))}function xt(t){if(!t)return"";const e=Date.now(),s=new Date(t).getTime();if(Number.isNaN(s))return"";let n=Math.max(0,Math.floor((e-s)/1e3));const o=Math.floor(n/(365*24*3600));n%=365*24*3600;const i=Math.floor(n/(30*24*3600));n%=30*24*3600;const l=Math.floor(n/(7*24*3600));n%=7*24*3600;const a=Math.floor(n/(24*3600));n%=24*3600;const u=Math.floor(n/3600);n%=3600;const c=Math.floor(n/60),d=n%60;return o>0?i>0?`${o}y${i}mo`:`${o}y`:i>0?`${i}mo`:l>0?a>0?`${l}w${a}d`:`${l}w`:a>0?u>0?`${a}d${u}h`:`${a}d`:u>0?c>0?`${u}h${c}m`:`${u}h`:c>0?d>0?`${c}m${d}s`:`${c}m`:`${d}s`}function Ve(t){if(!t)return"";const e=new Date(t);if(Number.isNaN(e.getTime()))return"";const s=n=>String(n).padStart(2,"0");return`${e.getFullYear()}-${s(e.getMonth()+1)}-${s(e.getDate())} ${s(e.getHours())}:${s(e.getMinutes())}:${s(e.getSeconds())}`}function Qe(t){if(!t)return"";const e=Date.now(),s=new Date(t).getTime();if(Number.isNaN(s))return"";let n=Math.max(0,Math.floor((e-s)/1e3));const o=Math.floor(n/(365*24*3600));n%=365*24*3600;const i=Math.floor(n/(30*24*3600));n%=30*24*3600;const l=Math.floor(n/(24*3600));n%=24*3600;const a=Math.floor(n/3600);n%=3600;const u=Math.floor(n/60),c=n%60,d=[];return o>0&&d.push(`${o} ${o===1?"year":"years"}`),i>0&&d.push(`${i} ${i===1?"month":"months"}`),l>0&&d.push(`${l} ${l===1?"day":"days"}`),a>0&&d.push(`${a} ${a===1?"hour":"hours"}`),u>0&&d.push(`${u} ${u===1?"min":"mins"}`),d.length===0?c>0?`${c} ${c===1?"sec":"secs"} ago`:"just now":`${d.slice(0,2).join(" ")} ago`}function so(t,e){const s=[];return t&&s.push(`Created at: ${Ve(t)} (${Qe(t)})`),e&&s.push(`Modified at: ${Ve(e)} (${Qe(e)})`),s.join(`
69
- `)}const Ut={critical:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",high:"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400",medium:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",low:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400"},Ht={critical:"Critical",high:"High",medium:"Med",low:"Low"};function no(t){const e=t.split(`
70
- `),s=e.findIndex(i=>/^#\s+/.test(i));return(s>=0?e.slice(s+1):e).join(`
71
- `).trim()}function oo(t){return _.parse(t,{async:!1,gfm:!0,breaks:!0})}function ao({feature:t,onClick:e,isDragging:s,isSelected:n}){const{cardSettings:o}=q(),i=q(p=>p.labelDefs),l=Sr(t.content),a=no(t.content),u=t.filePath&&t.filePath.split("/").pop()||"",c=p=>{if(!p)return null;const h=new Date(p),m=new Date,y=h.getTime()-m.getTime(),k=Math.ceil(y/(1e3*60*60*24));return k<0?{text:"Overdue",className:"text-red-500"}:k===0?{text:"Today",className:"text-orange-500"}:k===1?{text:"Tomorrow",className:"text-yellow-600 dark:text-yellow-400"}:k<=7?{text:`${k}d`,className:"text-zinc-500 dark:text-zinc-400"}:{text:h.toLocaleDateString("en-US",{month:"short",day:"numeric"}),className:"text-zinc-500 dark:text-zinc-400"}},d=t.status==="done"?null:c(t.dueDate),g=p=>{if(!p)return null;const h=new Date(p),y=new Date().getTime()-h.getTime(),k=Math.floor(y/(1e3*60)),N=Math.floor(y/(1e3*60*60)),M=Math.floor(y/(1e3*60*60*24));return k<1?"Just now":k<60?`${k}m ago`:N<24?`${N}h ago`:M===1?"1d ago":M<30?`${M}d ago`:M<365?`${Math.floor(M/30)}mo ago`:`${Math.floor(M/365)}y ago`},x=t.status==="done"?g(t.completedAt):null;return r.jsxs("div",{onClick:e,className:`group relative flex flex-col bg-white dark:bg-zinc-800 rounded-lg border ${n?"border-blue-500 dark:border-blue-400 ring-1 ring-blue-500 dark:ring-blue-400":"border-zinc-200 dark:border-zinc-700"} ${o.compactMode?"p-2 min-h-[4.5rem]":"p-3 min-h-[7rem]"} cursor-pointer hover:shadow-md transition-shadow ${s?"shadow-lg opacity-90":""}`,children:[r.jsxs("div",{className:"flex-1",children:[o.showFileName&&u&&r.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[r.jsx(Jt,{size:10,className:"shrink-0 text-zinc-400 dark:text-zinc-500"}),r.jsx("span",{className:"text-[10px] font-mono text-zinc-400 dark:text-zinc-500 truncate flex-1",children:u}),o.showPriorityBadges&&r.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded shrink-0 ${Ut[t.priority]}`,children:Ht[t.priority]})]}),r.jsxs("div",{className:`flex items-start gap-2 ${a||o.compactMode?"mb-1":"mb-2"}`,children:[r.jsx("h3",{className:"text-sm font-medium text-zinc-900 dark:text-zinc-100 line-clamp-2 flex-1",children:l}),o.showPriorityBadges&&!(o.showFileName&&u)&&r.jsx("span",{className:`text-xs font-medium px-1.5 py-0.5 rounded shrink-0 ${Ut[t.priority]}`,children:Ht[t.priority]})]}),a&&!o.compactMode&&r.jsx("div",{className:"text-xs text-zinc-500 dark:text-zinc-400 line-clamp-2 mb-2 card-inline-markdown",dangerouslySetInnerHTML:{__html:oo(a)}}),o.showLabels&&t.labels.length>0&&r.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[t.labels.slice(0,3).map(p=>{const h=i[p];return r.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${h?"":"bg-zinc-100 text-zinc-600 dark:bg-zinc-700 dark:text-zinc-300"}`,style:h?{backgroundColor:`${h.color}20`,color:h.color}:void 0,children:p},p)}),t.labels.length>3&&r.jsxs("span",{className:"text-xs text-zinc-400",children:["+",t.labels.length-3]})]})]}),r.jsxs("div",{className:"flex items-center justify-between text-xs mt-auto",children:[r.jsx("div",{className:"flex items-center gap-1",children:o.showAssignee&&t.assignee&&t.assignee!=="null"&&r.jsxs("div",{className:"flex items-center gap-1.5 text-zinc-500 dark:text-zinc-400",children:[r.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold bg-zinc-200 dark:bg-zinc-600 text-zinc-700 dark:text-zinc-300",children:t.assignee.split(/\s+/).map(p=>p[0]).join("").toUpperCase().slice(0,2)}),r.jsx("span",{children:t.assignee})]})}),t.attachments.length>0&&r.jsxs("div",{className:"flex items-center gap-1 text-zinc-400 dark:text-zinc-500",children:[r.jsx(nt,{size:12}),r.jsx("span",{children:t.attachments.length})]}),t.metadata&&Object.keys(t.metadata).length>0&&r.jsx("div",{className:"flex items-center gap-1 text-zinc-400 dark:text-zinc-500",children:r.jsx("span",{className:"text-[10px] font-mono",children:`{${Object.keys(t.metadata).length}}`})}),o.showDueDate&&d&&r.jsxs("div",{className:`flex items-center gap-1 ${d.className}`,children:[r.jsx(ft,{size:12}),r.jsx("span",{children:d.text})]}),x&&r.jsxs("div",{className:"flex items-center gap-1",style:{color:"var(--vscode-descriptionForeground)"},children:[r.jsx(Fe,{size:12}),r.jsx("span",{children:x})]}),r.jsxs("div",{className:"flex items-center gap-1 text-zinc-400 dark:text-zinc-500",title:so(t.created,t.modified),children:[r.jsx(ot,{size:12}),r.jsx("span",{children:xt(t.modified)})]})]})]})}function Gt({column:t,features:e,onFeatureClick:s,onAddFeature:n,onEditColumn:o,onRemoveColumn:i,onDragStart:l,onDragOver:a,onDragOverCard:u,onDrop:c,onDragEnd:d,draggedFeature:g,dropTarget:x,layout:p,isDeletedColumn:h,onPurgeColumn:m,selectedFeatureId:y}){const k=p==="vertical",N=x&&x.columnId===t.id,[M,w]=f.useState(!1),C=f.useRef(null);return f.useEffect(()=>{if(!M)return;const b=L=>{C.current&&!C.current.contains(L.target)&&w(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[M]),r.jsxs("div",{className:k?"flex flex-col bg-zinc-100 dark:bg-zinc-800 rounded-lg":"flex-shrink-0 w-72 h-full flex flex-col bg-zinc-100 dark:bg-zinc-800 rounded-lg",onDragOver:a,onDrop:b=>c(b,t.id),children:[r.jsxs("div",{className:"flex items-center justify-between w-full px-3 py-2 border-b border-zinc-200 dark:border-zinc-700",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:t.color}}),r.jsx("h3",{className:"text-sm font-medium text-zinc-900 dark:text-zinc-100",children:t.name}),r.jsx("span",{className:"text-xs text-zinc-500 dark:text-zinc-400 bg-zinc-200 dark:bg-zinc-700 px-1.5 py-0.5 rounded-full",children:e.length})]}),r.jsx("div",{className:"flex items-center gap-0.5",children:h?r.jsx("button",{type:"button",onClick:()=>{e.length!==0&&window.confirm(`Permanently delete all ${e.length} card${e.length===1?"":"s"} from disk?`)&&(m==null||m())},className:"p-1 rounded hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors",title:"Permanently delete all cards",children:r.jsx(we,{size:16,className:"text-red-500"})}):r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",onClick:()=>n(t.id),className:"p-1 rounded hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60 transition-colors",title:`Add to ${t.name}`,children:r.jsx(je,{size:16,className:"text-zinc-500"})}),r.jsxs("div",{className:"relative",ref:C,children:[r.jsx("button",{type:"button",onClick:()=>w(!M),className:"p-1 rounded hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60 transition-colors",title:"Column options",children:r.jsx(es,{size:16,className:"text-zinc-500"})}),M&&r.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg py-1 min-w-[140px]",children:[r.jsxs("button",{type:"button",onClick:()=>{w(!1),o(t.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[r.jsx(mt,{size:14}),"Edit List"]}),r.jsxs("button",{type:"button",onClick:()=>{w(!1),i(t.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-red-600 dark:text-red-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[r.jsx(we,{size:14}),"Remove List"]})]})]})]})})]}),r.jsxs("div",{className:k?"flex-1 p-2 flex flex-wrap gap-2":"flex-1 overflow-y-auto p-2 space-y-2 min-h-[200px]",children:[e.map((b,L)=>r.jsxs("div",{children:[N&&x.index===L&&r.jsx("div",{className:"h-0.5 bg-blue-500 rounded-full mx-1 mb-1"}),r.jsx("div",{draggable:!0,onDragStart:F=>l(F,b),onDragOver:F=>u(F,t.id,L),onDragEnd:d,className:`${k?"w-64":""} ${(g==null?void 0:g.id)===b.id?"opacity-40":""}`,children:r.jsx(ao,{feature:b,onClick:()=>s(b),isSelected:b.id===y})})]},b.id)),N&&x.index===e.length&&e.length>0&&r.jsx("div",{className:"h-0.5 bg-blue-500 rounded-full mx-1"}),e.length===0&&r.jsx("div",{className:k?"text-sm text-zinc-400 dark:text-zinc-500 py-4":"text-center py-8 text-sm text-zinc-400 dark:text-zinc-500",children:"No features"})]})]})}function lo({onFeatureClick:t,onAddFeature:e,onMoveFeature:s,onEditColumn:n,onRemoveColumn:o,onPurgeDeletedCards:i,selectedFeatureId:l}){const a=q(b=>b.columns),u=q(b=>b.cardSettings),c=q(b=>b.getFilteredFeaturesByStatus),d=q(b=>b.getFeaturesByStatus),g=q(b=>b.layout),[x,p]=f.useState(null),[h,m]=f.useState(null),y=f.useCallback((b,L)=>{p(L),b.dataTransfer.effectAllowed="move",b.dataTransfer.setData("text/plain",L.id)},[]),k=f.useCallback(b=>{b.preventDefault(),b.dataTransfer.dropEffect="move"},[]),N=f.useCallback((b,L,F)=>{b.preventDefault(),b.dataTransfer.dropEffect="move";const v=b.currentTarget.getBoundingClientRect(),S=v.top+v.height/2,E=b.clientY<S?F:F+1;m(z=>z&&z.columnId===L&&z.index===E?z:{columnId:L,index:E})},[]),M=f.useCallback((b,L)=>{if(b.preventDefault(),!x)return;const F=c(L);let v;if(h&&h.columnId===L?v=h.index:v=F.length,x.status===L){const A=F.findIndex(W=>W.id===x.id);if(A!==-1&&v>A&&v--,A===v){p(null),m(null);return}}const S=d(L).filter(A=>A.id!==x.id),E=F.filter(A=>A.id!==x.id);let z;if(E.length===0)z=S.length;else if(v>=E.length){const A=E[E.length-1];z=S.findIndex(ee=>ee.id===A.id)+1}else{const A=E[v];z=S.findIndex(W=>W.id===A.id)}s(x.id,L,z),p(null),m(null)},[x,h,c,d,s]),w=f.useCallback(()=>{p(null),m(null)},[]),C=g==="vertical";return r.jsx("div",{className:C?"h-full overflow-y-auto p-4":"h-full overflow-x-auto p-4",children:r.jsxs("div",{className:C?"flex flex-col gap-4":"flex gap-4 h-full min-w-max",children:[a.map(b=>r.jsx(Gt,{column:b,features:c(b.id),onFeatureClick:t,onAddFeature:e,onEditColumn:n,onRemoveColumn:o,onDragStart:y,onDragOver:k,onDragOverCard:N,onDrop:M,onDragEnd:w,draggedFeature:x,dropTarget:h,layout:g,selectedFeatureId:l},b.id)),u.showDeletedColumn&&r.jsx(Gt,{column:rt,features:c(rt.id),onFeatureClick:t,onAddFeature:e,onEditColumn:n,onRemoveColumn:o,onDragStart:y,onDragOver:k,onDragOverCard:N,onDrop:M,onDragEnd:w,draggedFeature:x,dropTarget:h,layout:g,isDeletedColumn:!0,onPurgeColumn:i,selectedFeatureId:l},rt.id)]})})}const io=["Mo","Tu","We","Th","Fr","Sa","Su"],co=["January","February","March","April","May","June","July","August","September","October","November","December"];function uo({value:t,onChange:e,placeholder:s="Due date"}){const[n,o]=f.useState(!1),i=new Date,l=t?new Date(t+"T00:00:00"):null,[a,u]=f.useState((l==null?void 0:l.getFullYear())??i.getFullYear()),[c,d]=f.useState((l==null?void 0:l.getMonth())??i.getMonth()),g=new Date(a,c+1,0).getDate(),x=(new Date(a,c,1).getDay()+6)%7,p=Array(x).fill(null);for(let w=1;w<=g;w++)p.push(w);const h=()=>{c===0?(d(11),u(w=>w-1)):d(w=>w-1)},m=()=>{c===11?(d(0),u(w=>w+1)):d(w=>w+1)},y=w=>{const C=String(c+1).padStart(2,"0"),b=String(w).padStart(2,"0");e(`${a}-${C}-${b}`),o(!1)},k=w=>w===i.getDate()&&c===i.getMonth()&&a===i.getFullYear(),N=w=>l!==null&&w===l.getDate()&&c===l.getMonth()&&a===l.getFullYear(),M=w=>new Date(w+"T00:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return r.jsxs("div",{className:"relative",children:[r.jsxs("button",{type:"button",onClick:()=>o(!n),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:t?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},onMouseEnter:w=>w.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:w=>w.currentTarget.style.background="transparent",children:[r.jsx("span",{children:t?M(t):s}),t&&r.jsx("span",{role:"button",onClick:w=>{w.stopPropagation(),e(""),o(!1)},className:"ml-0.5 hover:text-red-500 transition-colors",children:r.jsx(oe,{size:12})})]}),n&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>o(!1)}),r.jsxs("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg p-3 w-[252px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsx("button",{type:"button",onClick:h,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:w=>w.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:w=>w.currentTarget.style.background="transparent",children:r.jsx(ts,{size:14})}),r.jsxs("span",{className:"text-xs font-medium",style:{color:"var(--vscode-foreground)"},children:[co[c]," ",a]}),r.jsx("button",{type:"button",onClick:m,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:w=>w.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:w=>w.currentTarget.style.background="transparent",children:r.jsx(rs,{size:14})})]}),r.jsx("div",{className:"grid grid-cols-7 mb-1",children:io.map(w=>r.jsx("div",{className:"text-center text-[10px] font-medium py-1",style:{color:"var(--vscode-descriptionForeground)"},children:w},w))}),r.jsx("div",{className:"grid grid-cols-7",children:p.map((w,C)=>r.jsx("div",{className:"flex items-center justify-center",children:w?r.jsx("button",{type:"button",onClick:()=>y(w),className:Q("w-7 h-7 rounded-md text-[11px] transition-colors font-medium"),style:{background:N(w)?"var(--vscode-focusBorder)":k(w)?"var(--vscode-editor-selectionBackground)":void 0,color:N(w)?"var(--vscode-editor-background)":(k(w),"var(--vscode-foreground)")},onMouseEnter:b=>{N(w)||(b.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:b=>{!N(w)&&!k(w)?b.currentTarget.style.background="transparent":k(w)&&!N(w)&&(b.currentTarget.style.background="var(--vscode-editor-selectionBackground)")},children:w}):r.jsx("div",{className:"w-7 h-7"})},C))}),r.jsx("div",{className:"mt-2 pt-2 flex justify-center",style:{borderTop:"1px solid var(--vscode-panel-border)"},children:r.jsx("button",{type:"button",onClick:()=>{const w=String(i.getMonth()+1).padStart(2,"0"),C=String(i.getDate()).padStart(2,"0");e(`${i.getFullYear()}-${w}-${C}`),o(!1)},className:"text-[11px] font-medium transition-colors",style:{color:"var(--vscode-textLink-foreground)"},onMouseEnter:w=>w.currentTarget.style.color="var(--vscode-textLink-activeForeground)",onMouseLeave:w=>w.currentTarget.style.color="var(--vscode-textLink-foreground)",children:"Today"})})]})]})]})}function Lr(t,e,s,n){const o=t.selectionStart,i=t.selectionEnd,l=e.substring(o,i);let a=e.substring(0,o);const u=e.substring(i);let c=l,d=0;switch(n){case"heading":{const x=e.lastIndexOf(`
72
- `,o-1)+1,p=e.substring(x,o);p.startsWith("### ")?(a=e.substring(0,x)+p.slice(4),c=l,d=-4):p.startsWith("## ")?(a=e.substring(0,x)+"### "+p.slice(3),c=l,d=1):p.startsWith("# ")?(a=e.substring(0,x)+"## "+p.slice(2),c=l,d=1):(a=e.substring(0,x)+"# "+p,c=l,d=2);break}case"bold":c=l?`**${l}**`:"**bold**",d=l?4:2;break;case"italic":c=l?`_${l}_`:"_italic_",d=l?2:1;break;case"quote":{c=l?l.split(`
73
- `).map(p=>`> ${p}`).join(`
74
- `):"> ",d=l?c.length-l.length:2;break}case"code":l.includes(`
63
+ `}tablerow({text:e}){return`<tr>
64
+ ${e}</tr>
65
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),s=e.header?"th":"td";return(e.align?`<${s} align="${e.align}">`:`<${s}>`)+t+`</${s}>
66
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${le(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:s}){let n=this.parser.parseInline(s),o=Vt(e);if(o===null)return n;e=o;let i='<a href="'+e+'"';return t&&(i+=' title="'+le(t)+'"'),i+=">"+n+"</a>",i}image({href:e,title:t,text:s,tokens:n}){n&&(s=this.parser.parseInline(n,this.parser.textRenderer));let o=Vt(e);if(o===null)return le(s);e=o;let i=`<img src="${e}" alt="${le(s)}"`;return t&&(i+=` title="${le(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:le(e.text)}},Bt=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},ae=class yt{constructor(t){q(this,"options");q(this,"renderer");q(this,"textRenderer");this.options=t||De,this.options.renderer=this.options.renderer||new st,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Bt}static parse(t,s){return new yt(s).parse(t)}static parseInline(t,s){return new yt(s).parseInline(t)}parse(t){var n,o;let s="";for(let i=0;i<t.length;i++){let l=t[i];if((o=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&o[l.type]){let p=l,c=this.options.extensions.renderers[p.type].call({parser:this},p);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(p.type)){s+=c||"";continue}}let a=l;switch(a.type){case"space":{s+=this.renderer.space(a);break}case"hr":{s+=this.renderer.hr(a);break}case"heading":{s+=this.renderer.heading(a);break}case"code":{s+=this.renderer.code(a);break}case"table":{s+=this.renderer.table(a);break}case"blockquote":{s+=this.renderer.blockquote(a);break}case"list":{s+=this.renderer.list(a);break}case"checkbox":{s+=this.renderer.checkbox(a);break}case"html":{s+=this.renderer.html(a);break}case"def":{s+=this.renderer.def(a);break}case"paragraph":{s+=this.renderer.paragraph(a);break}case"text":{s+=this.renderer.text(a);break}default:{let p='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return s}parseInline(t,s=this.renderer){var o,i;let n="";for(let l=0;l<t.length;l++){let a=t[l];if((i=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&i[a.type]){let c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){n+=c||"";continue}}let p=a;switch(p.type){case"escape":{n+=s.text(p);break}case"html":{n+=s.html(p);break}case"link":{n+=s.link(p);break}case"image":{n+=s.image(p);break}case"checkbox":{n+=s.checkbox(p);break}case"strong":{n+=s.strong(p);break}case"em":{n+=s.em(p);break}case"codespan":{n+=s.codespan(p);break}case"br":{n+=s.br(p);break}case"del":{n+=s.del(p);break}case"text":{n+=s.text(p);break}default:{let c='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return n}},Xe,qe=(Xe=class{constructor(e){q(this,"options");q(this,"block");this.options=e||De}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?oe.lex:oe.lexInline}provideParser(){return this.block?ae.parse:ae.parseInline}},q(Xe,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),q(Xe,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Xe),Fr=class{constructor(...e){q(this,"defaults",Mt());q(this,"options",this.setOptions);q(this,"parse",this.parseMarkdown(!0));q(this,"parseInline",this.parseMarkdown(!1));q(this,"Parser",ae);q(this,"Renderer",st);q(this,"TextRenderer",Bt);q(this,"Lexer",oe);q(this,"Tokenizer",rt);q(this,"Hooks",qe);this.use(...e)}walkTokens(e,t){var n,o;let s=[];for(let i of e)switch(s=s.concat(t.call(this,i)),i.type){case"table":{let l=i;for(let a of l.header)s=s.concat(this.walkTokens(a.tokens,t));for(let a of l.rows)for(let p of a)s=s.concat(this.walkTokens(p.tokens,t));break}case"list":{let l=i;s=s.concat(this.walkTokens(l.items,t));break}default:{let l=i;(o=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&o[l.type]?this.defaults.extensions.childTokens[l.type].forEach(a=>{let p=l[a].flat(1/0);s=s.concat(this.walkTokens(p,t))}):l.tokens&&(s=s.concat(this.walkTokens(l.tokens,t)))}}return s}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(s=>{let n={...s};if(n.async=this.defaults.async||n.async||!1,s.extensions&&(s.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let i=t.renderers[o.name];i?t.renderers[o.name]=function(...l){let a=o.renderer.apply(this,l);return a===!1&&(a=i.apply(this,l)),a}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=t[o.level];i?i.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),n.extensions=t),s.renderer){let o=this.defaults.renderer||new st(this.defaults);for(let i in s.renderer){if(!(i in o))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,a=s.renderer[l],p=o[l];o[l]=(...c)=>{let u=a.apply(o,c);return u===!1&&(u=p.apply(o,c)),u||""}}n.renderer=o}if(s.tokenizer){let o=this.defaults.tokenizer||new rt(this.defaults);for(let i in s.tokenizer){if(!(i in o))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let l=i,a=s.tokenizer[l],p=o[l];o[l]=(...c)=>{let u=a.apply(o,c);return u===!1&&(u=p.apply(o,c)),u}}n.tokenizer=o}if(s.hooks){let o=this.defaults.hooks||new qe;for(let i in s.hooks){if(!(i in o))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let l=i,a=s.hooks[l],p=o[l];qe.passThroughHooks.has(i)?o[l]=c=>{if(this.defaults.async&&qe.passThroughHooksRespectAsync.has(i))return(async()=>{let g=await a.call(o,c);return p.call(o,g)})();let u=a.call(o,c);return p.call(o,u)}:o[l]=(...c)=>{if(this.defaults.async)return(async()=>{let g=await a.apply(o,c);return g===!1&&(g=await p.apply(o,c)),g})();let u=a.apply(o,c);return u===!1&&(u=p.apply(o,c)),u}}n.hooks=o}if(s.walkTokens){let o=this.defaults.walkTokens,i=s.walkTokens;n.walkTokens=function(l){let a=[];return a.push(i.call(this,l)),o&&(a=a.concat(o.call(this,l))),a}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return oe.lex(e,t??this.defaults)}parser(e,t){return ae.parse(e,t??this.defaults)}parseMarkdown(e){return(t,s)=>{let n={...s},o={...this.defaults,...n},i=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&n.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=e),o.async)return(async()=>{let l=o.hooks?await o.hooks.preprocess(t):t,a=await(o.hooks?await o.hooks.provideLexer():e?oe.lex:oe.lexInline)(l,o),p=o.hooks?await o.hooks.processAllTokens(a):a;o.walkTokens&&await Promise.all(this.walkTokens(p,o.walkTokens));let c=await(o.hooks?await o.hooks.provideParser():e?ae.parse:ae.parseInline)(p,o);return o.hooks?await o.hooks.postprocess(c):c})().catch(i);try{o.hooks&&(t=o.hooks.preprocess(t));let l=(o.hooks?o.hooks.provideLexer():e?oe.lex:oe.lexInline)(t,o);o.hooks&&(l=o.hooks.processAllTokens(l)),o.walkTokens&&this.walkTokens(l,o.walkTokens);let a=(o.hooks?o.hooks.provideParser():e?ae.parse:ae.parseInline)(l,o);return o.hooks&&(a=o.hooks.postprocess(a)),a}catch(l){return i(l)}}}onError(e,t){return s=>{if(s.message+=`
67
+ Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+le(s.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(s);throw s}}},Se=new Fr;function K(e,t){return Se.parse(e,t)}K.options=K.setOptions=function(e){return Se.setOptions(e),K.defaults=Se.defaults,zr(K.defaults),K};K.getDefaults=Mt;K.defaults=De;K.use=function(...e){return Se.use(...e),K.defaults=Se.defaults,zr(K.defaults),K};K.walkTokens=function(e,t){return Se.walkTokens(e,t)};K.parseInline=Se.parseInline;K.Parser=ae;K.parser=ae.parse;K.Renderer=st;K.TextRenderer=Bt;K.Lexer=oe;K.lexer=oe.lex;K.Tokenizer=rt;K.Hooks=qe;K.parse=K;K.options;K.setOptions;K.use;K.walkTokens;K.parseInline;ae.parse;oe.lex;function Br(e){const t=e.match(/^#\s+(.+)$/m);return t?t[1].trim():e.split(`
68
+ `).map(n=>n.trim()).find(n=>n.length>0)||"Untitled"}const It="deleted",Pe={id:It,name:"Deleted",color:"#ef4444"},wt=[{name:"red",hex:"#e11d48"},{name:"orange",hex:"#ea580c"},{name:"amber",hex:"#d97706"},{name:"yellow",hex:"#ca8a04"},{name:"lime",hex:"#65a30d"},{name:"green",hex:"#16a34a"},{name:"teal",hex:"#0d9488"},{name:"cyan",hex:"#0891b2"},{name:"blue",hex:"#2563eb"},{name:"indigo",hex:"#4f46e5"},{name:"violet",hex:"#7c3aed"},{name:"pink",hex:"#db2777"}];function Ir(e){var t,s,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(s=Ir(e[t]))&&(n&&(n+=" "),n+=s)}else for(s in e)e[s]&&(n&&(n+=" "),n+=s);return n}function Cn(){for(var e,t,s=0,n="",o=arguments.length;s<o;s++)(e=arguments[s])&&(t=Ir(e))&&(n&&(n+=" "),n+=t);return n}const Pt="-",Sn=e=>{const t=Mn(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:l=>{const a=l.split(Pt);return a[0]===""&&a.length!==1&&a.shift(),Pr(a,t)||Dn(l)},getConflictingClassGroupIds:(l,a)=>{const p=s[l]||[];return a&&n[l]?[...p,...n[l]]:p}}},Pr=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const s=e[0],n=t.nextPart.get(s),o=n?Pr(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Pt);return(l=t.validators.find(({validator:a})=>a(i)))==null?void 0:l.classGroupId},Jt=/^\[(.+)\]$/,Dn=e=>{if(Jt.test(e)){const t=Jt.exec(e)[1],s=t==null?void 0:t.substring(0,t.indexOf(":"));if(s)return"arbitrary.."+s}},Mn=e=>{const{theme:t,prefix:s}=e,n={nextPart:new Map,validators:[]};return En(Object.entries(e.classGroups),s).forEach(([i,l])=>{jt(l,n,i,t)}),n},jt=(e,t,s,n)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Xt(t,o);i.classGroupId=s;return}if(typeof o=="function"){if(Tn(o)){jt(o(n),t,s,n);return}t.validators.push({validator:o,classGroupId:s});return}Object.entries(o).forEach(([i,l])=>{jt(l,Xt(t,i),s,n)})})},Xt=(e,t)=>{let s=e;return t.split(Pt).forEach(n=>{s.nextPart.has(n)||s.nextPart.set(n,{nextPart:new Map,validators:[]}),s=s.nextPart.get(n)}),s},Tn=e=>e.isThemeGetter,En=(e,t)=>t?e.map(([s,n])=>{const o=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([l,a])=>[t+l,a])):i);return[s,o]}):e,$n=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=new Map,n=new Map;const o=(i,l)=>{s.set(i,l),t++,t>e&&(t=0,n=s,s=new Map)};return{get(i){let l=s.get(i);if(l!==void 0)return l;if((l=n.get(i))!==void 0)return o(i,l),l},set(i,l){s.has(i)?s.set(i,l):o(i,l)}}},Or="!",An=e=>{const{separator:t,experimentalParseClassName:s}=e,n=t.length===1,o=t[0],i=t.length,l=a=>{const p=[];let c=0,u=0,g;for(let v=0;v<a.length;v++){let k=a[v];if(c===0){if(k===o&&(n||a.slice(v,v+i)===t)){p.push(a.slice(u,v)),u=v+i;continue}if(k==="/"){g=v;continue}}k==="["?c++:k==="]"&&c--}const h=p.length===0?a:a.substring(u),d=h.startsWith(Or),x=d?h.substring(1):h,m=g&&g>u?g-u:void 0;return{modifiers:p,hasImportantModifier:d,baseClassName:x,maybePostfixModifierPosition:m}};return s?a=>s({className:a,parseClassName:l}):l},Ln=e=>{if(e.length<=1)return e;const t=[];let s=[];return e.forEach(n=>{n[0]==="["?(t.push(...s.sort(),n),s=[]):s.push(n)}),t.push(...s.sort()),t},Rn=e=>({cache:$n(e.cacheSize),parseClassName:An(e),...Sn(e)}),Fn=/\s+/,Bn=(e,t)=>{const{parseClassName:s,getClassGroupId:n,getConflictingClassGroupIds:o}=t,i=[],l=e.trim().split(Fn);let a="";for(let p=l.length-1;p>=0;p-=1){const c=l[p],{modifiers:u,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:d}=s(c);let x=!!d,m=n(x?h.substring(0,d):h);if(!m){if(!x){a=c+(a.length>0?" "+a:a);continue}if(m=n(h),!m){a=c+(a.length>0?" "+a:a);continue}x=!1}const v=Ln(u).join(":"),k=g?v+Or:v,z=k+m;if(i.includes(z))continue;i.push(z);const E=o(m,x);for(let y=0;y<E.length;++y){const D=E[y];i.push(k+D)}a=c+(a.length>0?" "+a:a)}return a};function In(){let e=0,t,s,n="";for(;e<arguments.length;)(t=arguments[e++])&&(s=_r(t))&&(n&&(n+=" "),n+=s);return n}const _r=e=>{if(typeof e=="string")return e;let t,s="";for(let n=0;n<e.length;n++)e[n]&&(t=_r(e[n]))&&(s&&(s+=" "),s+=t);return s};function Pn(e,...t){let s,n,o,i=l;function l(p){const c=t.reduce((u,g)=>g(u),e());return s=Rn(c),n=s.cache.get,o=s.cache.set,i=a,a(p)}function a(p){const c=n(p);if(c)return c;const u=Bn(p,s);return o(p,u),u}return function(){return i(In.apply(null,arguments))}}const V=e=>{const t=s=>s[e]||[];return t.isThemeGetter=!0,t},Kr=/^\[(?:([a-z-]+):)?(.+)\]$/i,On=/^\d+\/\d+$/,_n=new Set(["px","full","screen"]),Kn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Zn=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,qn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Un=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Hn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,de=e=>Ee(e)||_n.has(e)||On.test(e),he=e=>Ae(e,"length",eo),Ee=e=>!!e&&!Number.isNaN(Number(e)),ut=e=>Ae(e,"number",Ee),Oe=e=>!!e&&Number.isInteger(Number(e)),Gn=e=>e.endsWith("%")&&Ee(e.slice(0,-1)),F=e=>Kr.test(e),ge=e=>Kn.test(e),Wn=new Set(["length","size","percentage"]),Vn=e=>Ae(e,Wn,Zr),Qn=e=>Ae(e,"position",Zr),Yn=new Set(["image","url"]),Jn=e=>Ae(e,Yn,ro),Xn=e=>Ae(e,"",to),_e=()=>!0,Ae=(e,t,s)=>{const n=Kr.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):s(n[2]):!1},eo=e=>Zn.test(e)&&!qn.test(e),Zr=()=>!1,to=e=>Un.test(e),ro=e=>Hn.test(e),so=()=>{const e=V("colors"),t=V("spacing"),s=V("blur"),n=V("brightness"),o=V("borderColor"),i=V("borderRadius"),l=V("borderSpacing"),a=V("borderWidth"),p=V("contrast"),c=V("grayscale"),u=V("hueRotate"),g=V("invert"),h=V("gap"),d=V("gradientColorStops"),x=V("gradientColorStopPositions"),m=V("inset"),v=V("margin"),k=V("opacity"),z=V("padding"),E=V("saturate"),y=V("scale"),D=V("sepia"),N=V("skew"),B=V("space"),I=V("translate"),b=()=>["auto","contain","none"],w=()=>["auto","hidden","clip","visible","scroll"],S=()=>["auto",F,t],C=()=>[F,t],$=()=>["",de,he],G=()=>["auto",Ee,F],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Q=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],L=()=>["start","end","center","between","around","evenly","stretch"],H=()=>["","0",F],ne=()=>["auto","avoid","all","avoid-page","page","left","right","column"],X=()=>[Ee,F];return{cacheSize:500,separator:":",theme:{colors:[_e],spacing:[de,he],blur:["none","",ge,F],brightness:X(),borderColor:[e],borderRadius:["none","","full",ge,F],borderSpacing:C(),borderWidth:$(),contrast:X(),grayscale:H(),hueRotate:X(),invert:H(),gap:C(),gradientColorStops:[e],gradientColorStopPositions:[Gn,he],inset:S(),margin:S(),opacity:X(),padding:C(),saturate:X(),scale:X(),sepia:H(),skew:X(),space:C(),translate:C()},classGroups:{aspect:[{aspect:["auto","square","video",F]}],container:["container"],columns:[{columns:[ge]}],"break-after":[{"break-after":ne()}],"break-before":[{"break-before":ne()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...W(),F]}],overflow:[{overflow:w()}],"overflow-x":[{"overflow-x":w()}],"overflow-y":[{"overflow-y":w()}],overscroll:[{overscroll:b()}],"overscroll-x":[{"overscroll-x":b()}],"overscroll-y":[{"overscroll-y":b()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Oe,F]}],basis:[{basis:S()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",F]}],grow:[{grow:H()}],shrink:[{shrink:H()}],order:[{order:["first","last","none",Oe,F]}],"grid-cols":[{"grid-cols":[_e]}],"col-start-end":[{col:["auto",{span:["full",Oe,F]},F]}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":[_e]}],"row-start-end":[{row:["auto",{span:[Oe,F]},F]}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",F]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",F]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...L()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...L(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...L(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[z]}],px:[{px:[z]}],py:[{py:[z]}],ps:[{ps:[z]}],pe:[{pe:[z]}],pt:[{pt:[z]}],pr:[{pr:[z]}],pb:[{pb:[z]}],pl:[{pl:[z]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[B]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[B]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",F,t]}],"min-w":[{"min-w":[F,t,"min","max","fit"]}],"max-w":[{"max-w":[F,t,"none","full","min","max","fit","prose",{screen:[ge]},ge]}],h:[{h:[F,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[F,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[F,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[F,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ge,he]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ut]}],"font-family":[{font:[_e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",F]}],"line-clamp":[{"line-clamp":["none",Ee,ut]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",de,F]}],"list-image":[{"list-image":["none",F]}],"list-style-type":[{list:["none","disc","decimal",F]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",de,he]}],"underline-offset":[{"underline-offset":["auto",de,F]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",F]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",F]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),Qn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Vn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Jn]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[d]}],"gradient-via":[{via:[d]}],"gradient-to":[{to:[d]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...Q(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:Q()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...Q()]}],"outline-offset":[{"outline-offset":[de,F]}],"outline-w":[{outline:[de,he]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[de,he]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ge,Xn]}],"shadow-color":[{shadow:[_e]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[s]}],brightness:[{brightness:[n]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",ge,F]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[g]}],saturate:[{saturate:[E]}],sepia:[{sepia:[D]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[s]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[E]}],"backdrop-sepia":[{"backdrop-sepia":[D]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",F]}],duration:[{duration:X()}],ease:[{ease:["linear","in","out","in-out",F]}],delay:[{delay:X()}],animate:[{animate:["none","spin","ping","pulse","bounce",F]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[Oe,F]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",F]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",F]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",F]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[de,he,ut]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},no=Pn(so);function J(...e){return no(Cn(e))}function zt(e){if(!e)return"";const t=Date.now(),s=new Date(e).getTime();if(Number.isNaN(s))return"";let n=Math.max(0,Math.floor((t-s)/1e3));const o=Math.floor(n/(365*24*3600));n%=365*24*3600;const i=Math.floor(n/(30*24*3600));n%=30*24*3600;const l=Math.floor(n/(7*24*3600));n%=7*24*3600;const a=Math.floor(n/(24*3600));n%=24*3600;const p=Math.floor(n/3600);n%=3600;const c=Math.floor(n/60),u=n%60;return o>0?i>0?`${o}y${i}mo`:`${o}y`:i>0?`${i}mo`:l>0?a>0?`${l}w${a}d`:`${l}w`:a>0?p>0?`${a}d${p}h`:`${a}d`:p>0?c>0?`${p}h${c}m`:`${p}h`:c>0?u>0?`${c}m${u}s`:`${c}m`:`${u}s`}function nt(e){if(!e)return"";const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const s=n=>String(n).padStart(2,"0");return`${t.getFullYear()}-${s(t.getMonth()+1)}-${s(t.getDate())} ${s(t.getHours())}:${s(t.getMinutes())}:${s(t.getSeconds())}`}function ot(e){if(!e)return"";const t=Date.now(),s=new Date(e).getTime();if(Number.isNaN(s))return"";let n=Math.max(0,Math.floor((t-s)/1e3));const o=Math.floor(n/(365*24*3600));n%=365*24*3600;const i=Math.floor(n/(30*24*3600));n%=30*24*3600;const l=Math.floor(n/(24*3600));n%=24*3600;const a=Math.floor(n/3600);n%=3600;const p=Math.floor(n/60),c=n%60,u=[];return o>0&&u.push(`${o} ${o===1?"year":"years"}`),i>0&&u.push(`${i} ${i===1?"month":"months"}`),l>0&&u.push(`${l} ${l===1?"day":"days"}`),a>0&&u.push(`${a} ${a===1?"hour":"hours"}`),p>0&&u.push(`${p} ${p===1?"min":"mins"}`),u.length===0?c>0?`${c} ${c===1?"sec":"secs"} ago`:"just now":`${u.slice(0,2).join(" ")} ago`}function oo(e,t){const s=[];return e&&s.push(`Created at: ${nt(e)} (${ot(e)})`),t&&s.push(`Modified at: ${nt(t)} (${ot(t)})`),s.join(`
69
+ `)}const er={critical:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",high:"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400",medium:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",low:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400"},tr={critical:"Critical",high:"High",medium:"Med",low:"Low"};function ao(e){const t=e.split(`
70
+ `),s=t.findIndex(i=>/^#\s+/.test(i));return(s>=0?t.slice(s+1):t).join(`
71
+ `).trim()}function lo(e){return K.parse(e,{async:!1,gfm:!0,breaks:!0})}function io({feature:e,onClick:t,isDragging:s,isSelected:n}){const{cardSettings:o}=_(),i=_(d=>d.labelDefs),l=Br(e.content),a=ao(e.content),p=e.filePath&&e.filePath.split("/").pop()||"",c=d=>{if(!d)return null;const x=new Date(d),m=new Date,v=x.getTime()-m.getTime(),k=Math.ceil(v/(1e3*60*60*24));return k<0?{text:"Overdue",className:"text-red-500"}:k===0?{text:"Today",className:"text-orange-500"}:k===1?{text:"Tomorrow",className:"text-yellow-600 dark:text-yellow-400"}:k<=7?{text:`${k}d`,className:"text-zinc-500 dark:text-zinc-400"}:{text:x.toLocaleDateString("en-US",{month:"short",day:"numeric"}),className:"text-zinc-500 dark:text-zinc-400"}},u=e.status==="done"?null:c(e.dueDate),g=d=>{if(!d)return null;const x=new Date(d),v=new Date().getTime()-x.getTime(),k=Math.floor(v/(1e3*60)),z=Math.floor(v/(1e3*60*60)),E=Math.floor(v/(1e3*60*60*24));return k<1?"Just now":k<60?`${k}m ago`:z<24?`${z}h ago`:E===1?"1d ago":E<30?`${E}d ago`:E<365?`${Math.floor(E/30)}mo ago`:`${Math.floor(E/365)}y ago`},h=e.status==="done"?g(e.completedAt):null;return r.jsxs("div",{onClick:t,className:`group relative flex flex-col bg-white dark:bg-zinc-800 rounded-lg border ${n?"border-blue-500 dark:border-blue-400 ring-1 ring-blue-500 dark:ring-blue-400":"border-zinc-200 dark:border-zinc-700"} ${o.compactMode?"p-2 min-h-[4.5rem]":"p-3 min-h-[7rem]"} cursor-pointer hover:shadow-md transition-shadow ${s?"shadow-lg opacity-90":""}`,children:[r.jsxs("div",{className:"flex-1",children:[o.showFileName&&p&&r.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[r.jsx(cr,{size:10,className:"shrink-0 text-zinc-400 dark:text-zinc-500"}),r.jsx("span",{className:"text-[10px] font-mono text-zinc-400 dark:text-zinc-500 truncate flex-1",children:p}),o.showPriorityBadges&&r.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded shrink-0 ${er[e.priority]}`,children:tr[e.priority]})]}),r.jsxs("div",{className:`flex items-start gap-2 ${a||o.compactMode?"mb-1":"mb-2"}`,children:[r.jsx("h3",{className:"text-sm font-medium text-zinc-900 dark:text-zinc-100 line-clamp-2 flex-1",children:l}),o.showPriorityBadges&&!(o.showFileName&&p)&&r.jsx("span",{className:`text-xs font-medium px-1.5 py-0.5 rounded shrink-0 ${er[e.priority]}`,children:tr[e.priority]})]}),a&&!o.compactMode&&r.jsx("div",{className:"text-xs text-zinc-500 dark:text-zinc-400 line-clamp-2 mb-2 card-inline-markdown",dangerouslySetInnerHTML:{__html:lo(a)}}),o.showLabels&&e.labels.length>0&&r.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[e.labels.slice(0,3).map(d=>{const x=i[d];return r.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${x?"":"bg-zinc-100 text-zinc-600 dark:bg-zinc-700 dark:text-zinc-300"}`,style:x?{backgroundColor:`${x.color}20`,color:x.color}:void 0,children:d},d)}),e.labels.length>3&&r.jsxs("span",{className:"text-xs text-zinc-400",children:["+",e.labels.length-3]})]})]}),r.jsxs("div",{className:"flex items-center justify-between text-xs mt-auto",children:[r.jsx("div",{className:"flex items-center gap-1",children:o.showAssignee&&e.assignee&&e.assignee!=="null"&&r.jsxs("div",{className:"flex items-center gap-1.5 text-zinc-500 dark:text-zinc-400",children:[r.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold bg-zinc-200 dark:bg-zinc-600 text-zinc-700 dark:text-zinc-300",children:e.assignee.split(/\s+/).map(d=>d[0]).join("").toUpperCase().slice(0,2)}),r.jsx("span",{children:e.assignee})]})}),e.attachments.length>0&&r.jsxs("div",{className:"flex items-center gap-1 text-zinc-400 dark:text-zinc-500",children:[r.jsx(ht,{size:12}),r.jsx("span",{children:e.attachments.length})]}),e.metadata&&Object.keys(e.metadata).length>0&&r.jsx("div",{className:"flex items-center gap-1 text-zinc-400 dark:text-zinc-500",children:r.jsx("span",{className:"text-[10px] font-mono",children:`{${Object.keys(e.metadata).length}}`})}),o.showDueDate&&u&&r.jsxs("div",{className:`flex items-center gap-1 ${u.className}`,children:[r.jsx(Nt,{size:12}),r.jsx("span",{children:u.text})]}),h&&r.jsxs("div",{className:"flex items-center gap-1",style:{color:"var(--vscode-descriptionForeground)"},children:[r.jsx(fe,{size:12}),r.jsx("span",{children:h})]}),r.jsxs("div",{className:"flex items-center gap-1 text-zinc-400 dark:text-zinc-500",title:oo(e.created,e.modified),children:[r.jsx(gt,{size:12}),r.jsx("span",{children:zt(e.modified)})]})]})]})}const co=[{value:"order",label:"Board Order"},{value:"created:asc",label:"Created (oldest)"},{value:"created:desc",label:"Created (newest)"},{value:"modified:asc",label:"Modified (oldest)"},{value:"modified:desc",label:"Modified (newest)"}];function rr({column:e,features:t,onFeatureClick:s,onAddFeature:n,onEditColumn:o,onRemoveColumn:i,onCleanupColumn:l,onDragStart:a,onDragOver:p,onDragOverCard:c,onDrop:u,onDragEnd:g,draggedFeature:h,dropTarget:d,layout:x,isDeletedColumn:m,onPurgeColumn:v,selectedFeatureId:k,sort:z,onSortChange:E}){const y=x==="vertical",D=d&&d.columnId===e.id,[N,B]=f.useState(!1),I=f.useRef(null);return f.useEffect(()=>{if(!N)return;const b=w=>{I.current&&!I.current.contains(w.target)&&B(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[N]),r.jsxs("div",{className:y?"flex flex-col bg-zinc-100 dark:bg-zinc-800 rounded-lg":"flex-shrink-0 w-72 h-full flex flex-col bg-zinc-100 dark:bg-zinc-800 rounded-lg",onDragOver:p,onDrop:b=>u(b,e.id),children:[r.jsxs("div",{className:"flex items-center justify-between w-full px-3 py-2 border-b border-zinc-200 dark:border-zinc-700",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:e.color}}),r.jsx("h3",{className:"text-sm font-medium text-zinc-900 dark:text-zinc-100",children:e.name}),r.jsx("span",{className:"text-xs text-zinc-500 dark:text-zinc-400 bg-zinc-200 dark:bg-zinc-700 px-1.5 py-0.5 rounded-full",children:t.length})]}),r.jsx("div",{className:"flex items-center gap-0.5",children:m?r.jsx("button",{type:"button",onClick:()=>{t.length!==0&&window.confirm(`Permanently delete all ${t.length} card${t.length===1?"":"s"} from disk?`)&&(v==null||v())},className:"p-1 rounded hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors",title:"Permanently delete all cards",children:r.jsx(Ce,{size:16,className:"text-red-500"})}):r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",onClick:()=>n(e.id),className:"p-1 rounded hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60 transition-colors",title:`Add to ${e.name}`,children:r.jsx($e,{size:16,className:"text-zinc-500"})}),r.jsxs("div",{className:"relative",ref:I,children:[r.jsx("button",{type:"button",onClick:()=>B(!N),className:"p-1 rounded hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60 transition-colors",title:"Column options",children:r.jsx(rs,{size:16,className:"text-zinc-500"})}),N&&r.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg py-1 min-w-[170px]",children:[r.jsx("div",{className:"px-3 py-1 text-xs font-medium text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:"Sort by"}),co.map(b=>r.jsxs("button",{type:"button",onClick:()=>{E(b.value)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[r.jsx(fe,{size:14,className:z===b.value?"text-blue-500":"invisible"}),b.label]},b.value)),r.jsx("div",{className:"border-t border-zinc-200 dark:border-zinc-600 my-1"}),r.jsxs("button",{type:"button",onClick:()=>{B(!1),o(e.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[r.jsx(Ct,{size:14}),"Edit List"]}),r.jsxs("button",{type:"button",onClick:()=>{B(!1),i(e.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-red-600 dark:text-red-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[r.jsx(Ce,{size:14}),"Remove List"]}),r.jsxs("button",{type:"button",onClick:()=>{B(!1),l(e.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-orange-600 dark:text-orange-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[r.jsx(Ce,{size:14}),"Cleanup List"]})]})]})]})})]}),r.jsxs("div",{className:y?"flex-1 p-2 flex flex-wrap gap-2":"flex-1 overflow-y-auto p-2 space-y-2 min-h-[200px]",children:[t.map((b,w)=>r.jsxs("div",{children:[D&&d.index===w&&r.jsx("div",{className:"h-0.5 bg-blue-500 rounded-full mx-1 mb-1"}),r.jsx("div",{draggable:!0,"data-card-id":b.id,onDragStart:S=>a(S,b),onDragOver:S=>c(S,e.id,w),onDragEnd:g,className:`${y?"w-64":""} ${(h==null?void 0:h.id)===b.id?"opacity-40":""}`,children:r.jsx(io,{feature:b,onClick:()=>s(b),isSelected:b.id===k})})]},b.id)),D&&d.index===t.length&&t.length>0&&r.jsx("div",{className:"h-0.5 bg-blue-500 rounded-full mx-1"}),t.length===0&&r.jsx("div",{className:y?"text-sm text-zinc-400 dark:text-zinc-500 py-4":"text-center py-8 text-sm text-zinc-400 dark:text-zinc-500",children:"No features"})]})]})}function uo({onFeatureClick:e,onAddFeature:t,onMoveFeature:s,onEditColumn:n,onRemoveColumn:o,onCleanupColumn:i,onPurgeDeletedCards:l,selectedFeatureId:a}){const p=f.useRef(null);f.useEffect(()=>{if(!a)return;const w=p.current;w&&requestAnimationFrame(()=>{const S=w.querySelector(`[data-card-id="${a}"]`);if(!S)return;const C=w.getBoundingClientRect(),$=S.getBoundingClientRect();if(!($.left>=C.left&&$.right<=C.right)){const W=$.right-C.right;w.scrollBy({left:W+10,behavior:"smooth"})}})},[a]);const c=_(w=>w.columns),u=_(w=>w.cardSettings),g=_(w=>w.getFilteredFeaturesByStatus),h=_(w=>w.getFeaturesByStatus),d=_(w=>w.layout),x=_(w=>w.columnSorts),m=_(w=>w.setColumnSort),[v,k]=f.useState(null),[z,E]=f.useState(null),y=f.useCallback((w,S)=>{k(S),w.dataTransfer.effectAllowed="move",w.dataTransfer.setData("text/plain",S.id)},[]),D=f.useCallback(w=>{w.preventDefault(),w.dataTransfer.dropEffect="move"},[]),N=f.useCallback((w,S,C)=>{w.preventDefault(),w.dataTransfer.dropEffect="move";const $=w.currentTarget.getBoundingClientRect(),G=$.top+$.height/2,W=w.clientY<G?C:C+1;E(Q=>Q&&Q.columnId===S&&Q.index===W?Q:{columnId:S,index:W})},[]),B=f.useCallback((w,S)=>{if(w.preventDefault(),!v)return;const C=g(S);let $;if(z&&z.columnId===S?$=z.index:$=C.length,v.status===S){const U=C.findIndex(L=>L.id===v.id);if(U!==-1&&$>U&&$--,U===$){k(null),E(null);return}}const G=h(S).filter(U=>U.id!==v.id),W=C.filter(U=>U.id!==v.id);let Q;if(W.length===0)Q=G.length;else if($>=W.length){const U=W[W.length-1];Q=G.findIndex(H=>H.id===U.id)+1}else{const U=W[$];Q=G.findIndex(L=>L.id===U.id)}s(v.id,S,Q),k(null),E(null)},[v,z,g,h,s]),I=f.useCallback(()=>{k(null),E(null)},[]),b=d==="vertical";return r.jsx("div",{ref:p,className:b?"h-full overflow-y-auto p-4":"h-full overflow-x-auto p-4",children:r.jsxs("div",{className:b?"flex flex-col gap-4":"flex gap-4 h-full min-w-max",children:[c.map(w=>r.jsx(rr,{column:w,features:g(w.id),onFeatureClick:e,onAddFeature:t,onEditColumn:n,onRemoveColumn:o,onCleanupColumn:i,onDragStart:y,onDragOver:D,onDragOverCard:N,onDrop:B,onDragEnd:I,draggedFeature:v,dropTarget:z,layout:d,selectedFeatureId:a,sort:x[w.id]||"order",onSortChange:S=>m(w.id,S)},w.id)),u.showDeletedColumn&&r.jsx(rr,{column:Pe,features:g(Pe.id),onFeatureClick:e,onAddFeature:t,onEditColumn:n,onRemoveColumn:o,onCleanupColumn:i,onDragStart:y,onDragOver:D,onDragOverCard:N,onDrop:B,onDragEnd:I,draggedFeature:v,dropTarget:z,layout:d,isDeletedColumn:!0,onPurgeColumn:l,selectedFeatureId:a,sort:x[Pe.id]||"order",onSortChange:w=>m(Pe.id,w)},Pe.id)]})})}const po=["Mo","Tu","We","Th","Fr","Sa","Su"],ho=["January","February","March","April","May","June","July","August","September","October","November","December"];function go({value:e,onChange:t,placeholder:s="Due date"}){const[n,o]=f.useState(!1),i=new Date,l=e?new Date(e+"T00:00:00"):null,[a,p]=f.useState((l==null?void 0:l.getFullYear())??i.getFullYear()),[c,u]=f.useState((l==null?void 0:l.getMonth())??i.getMonth()),g=new Date(a,c+1,0).getDate(),h=(new Date(a,c,1).getDay()+6)%7,d=Array(h).fill(null);for(let y=1;y<=g;y++)d.push(y);const x=()=>{c===0?(u(11),p(y=>y-1)):u(y=>y-1)},m=()=>{c===11?(u(0),p(y=>y+1)):u(y=>y+1)},v=y=>{const D=String(c+1).padStart(2,"0"),N=String(y).padStart(2,"0");t(`${a}-${D}-${N}`),o(!1)},k=y=>y===i.getDate()&&c===i.getMonth()&&a===i.getFullYear(),z=y=>l!==null&&y===l.getDate()&&c===l.getMonth()&&a===l.getFullYear(),E=y=>new Date(y+"T00:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return r.jsxs("div",{className:"relative",children:[r.jsxs("button",{type:"button",onClick:()=>o(!n),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:e?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},onMouseEnter:y=>y.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:y=>y.currentTarget.style.background="transparent",children:[r.jsx("span",{children:e?E(e):s}),e&&r.jsx("span",{role:"button",onClick:y=>{y.stopPropagation(),t(""),o(!1)},className:"ml-0.5 hover:text-red-500 transition-colors",children:r.jsx(ie,{size:12})})]}),n&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>o(!1)}),r.jsxs("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg p-3 w-[252px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsx("button",{type:"button",onClick:x,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:y=>y.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:y=>y.currentTarget.style.background="transparent",children:r.jsx(ss,{size:14})}),r.jsxs("span",{className:"text-xs font-medium",style:{color:"var(--vscode-foreground)"},children:[ho[c]," ",a]}),r.jsx("button",{type:"button",onClick:m,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:y=>y.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:y=>y.currentTarget.style.background="transparent",children:r.jsx(ns,{size:14})})]}),r.jsx("div",{className:"grid grid-cols-7 mb-1",children:po.map(y=>r.jsx("div",{className:"text-center text-[10px] font-medium py-1",style:{color:"var(--vscode-descriptionForeground)"},children:y},y))}),r.jsx("div",{className:"grid grid-cols-7",children:d.map((y,D)=>r.jsx("div",{className:"flex items-center justify-center",children:y?r.jsx("button",{type:"button",onClick:()=>v(y),className:J("w-7 h-7 rounded-md text-[11px] transition-colors font-medium"),style:{background:z(y)?"var(--vscode-focusBorder)":k(y)?"var(--vscode-editor-selectionBackground)":void 0,color:z(y)?"var(--vscode-editor-background)":(k(y),"var(--vscode-foreground)")},onMouseEnter:N=>{z(y)||(N.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:N=>{!z(y)&&!k(y)?N.currentTarget.style.background="transparent":k(y)&&!z(y)&&(N.currentTarget.style.background="var(--vscode-editor-selectionBackground)")},children:y}):r.jsx("div",{className:"w-7 h-7"})},D))}),r.jsx("div",{className:"mt-2 pt-2 flex justify-center",style:{borderTop:"1px solid var(--vscode-panel-border)"},children:r.jsx("button",{type:"button",onClick:()=>{const y=String(i.getMonth()+1).padStart(2,"0"),D=String(i.getDate()).padStart(2,"0");t(`${i.getFullYear()}-${y}-${D}`),o(!1)},className:"text-[11px] font-medium transition-colors",style:{color:"var(--vscode-textLink-foreground)"},onMouseEnter:y=>y.currentTarget.style.color="var(--vscode-textLink-activeForeground)",onMouseLeave:y=>y.currentTarget.style.color="var(--vscode-textLink-foreground)",children:"Today"})})]})]})]})}function qr(e,t,s,n){const o=e.selectionStart,i=e.selectionEnd,l=t.substring(o,i);let a=t.substring(0,o);const p=t.substring(i);let c=l,u=0;switch(n){case"heading":{const h=t.lastIndexOf(`
72
+ `,o-1)+1,d=t.substring(h,o);d.startsWith("### ")?(a=t.substring(0,h)+d.slice(4),c=l,u=-4):d.startsWith("## ")?(a=t.substring(0,h)+"### "+d.slice(3),c=l,u=1):d.startsWith("# ")?(a=t.substring(0,h)+"## "+d.slice(2),c=l,u=1):(a=t.substring(0,h)+"# "+d,c=l,u=2);break}case"bold":c=l?`**${l}**`:"**bold**",u=l?4:2;break;case"italic":c=l?`_${l}_`:"_italic_",u=l?2:1;break;case"quote":{c=l?l.split(`
73
+ `).map(d=>`> ${d}`).join(`
74
+ `):"> ",u=l?c.length-l.length:2;break}case"code":l.includes(`
75
75
  `)?(c=`\`\`\`
76
76
  ${l}
77
- \`\`\``,d=4):(c=l?`\`${l}\``:"`code`",d=l?2:1);break;case"link":c=l?`[${l}](url)`:"[text](url)",d=l?l.length+3:1;break;case"ul":{c=l?l.split(`
78
- `).map(p=>`- ${p}`).join(`
79
- `):"- ",d=l?c.length-l.length:2;break}case"ol":{c=l?l.split(`
80
- `).map((p,h)=>`${h+1}. ${p}`).join(`
81
- `):"1. ",d=l?c.length-l.length:3;break}case"tasklist":{c=l?l.split(`
82
- `).map(p=>`- [ ] ${p}`).join(`
83
- `):"- [ ] ",d=l?c.length-l.length:6;break}}const g=a+c+u;s(g),requestAnimationFrame(()=>{t.focus();const x=o+(l?c.length:d);t.selectionStart=t.selectionEnd=x})}function V({icon:t,title:e,onClick:s,separator:n}){return r.jsxs(r.Fragment,{children:[n&&r.jsx("div",{className:"w-px h-4 mx-1",style:{background:"var(--vscode-panel-border)"}}),r.jsx("button",{type:"button",onClick:s,title:e,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:o=>o.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:o=>o.currentTarget.style.background="transparent",children:t})]})}const po=new Cr({gfm:!0,breaks:!0,renderer:{link({href:t,title:e,tokens:s}){const n=this.parser.parseInline(s),o=e?` title="${e}"`:"";return`<a href="${t}"${o} target="_blank" rel="noopener noreferrer">${n}</a>`}}});function Rr(t){const e=t.replace(new RegExp(`(?<!\\]\\(|"|'|<)(https?:\\/\\/[^\\s<>\\])"']+)`,"g"),"<$1>");return po.parse(e,{async:!1})}const Wt="kanban-comment-author";function Zt({initialContent:t="",onSubmit:e,onCancel:s,submitLabel:n="Comment"}){const[o,i]=f.useState(()=>localStorage.getItem(Wt)??""),[l,a]=f.useState(t),[u,c]=f.useState("write"),d=f.useRef(null),g=f.useRef(!0);f.useEffect(()=>{var k;if(g.current){g.current=!1;return}u==="write"&&((k=d.current)==null||k.focus())},[u]);const x=f.useMemo(()=>l.trim()?Rr(l):"",[l]),p=f.useCallback(k=>{d.current&&Lr(d.current,l,a,k)},[l]),h=()=>{const k=o.trim(),N=l.trim();!k||!N||(localStorage.setItem(Wt,k),e(k,N),t||(a(""),c("write")))},m=k=>{k.key==="Enter"&&(k.metaKey||k.ctrlKey)&&(k.preventDefault(),h()),(k.metaKey||k.ctrlKey)&&k.key==="b"&&(k.preventDefault(),p("bold")),(k.metaKey||k.ctrlKey)&&k.key==="i"&&(k.preventDefault(),p("italic")),(k.metaKey||k.ctrlKey)&&k.key==="k"&&(k.preventDefault(),p("link"))},y=o.trim().length>0&&l.trim().length>0;return r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsx("input",{type:"text",value:o,onChange:k=>i(k.target.value),placeholder:"Your name","aria-label":"Comment author name",className:"w-full rounded px-2 py-1 text-xs outline-none",style:{background:"var(--vscode-input-background)",color:"var(--vscode-foreground)",border:"1px solid var(--vscode-input-border, var(--vscode-panel-border))"}}),r.jsxs("div",{className:"flex flex-col rounded overflow-hidden",style:{border:"1px solid var(--vscode-input-border, var(--vscode-panel-border))"},children:[r.jsx("div",{className:"flex items-center",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:["write","preview"].map(k=>r.jsxs("button",{type:"button",onClick:()=>c(k),className:"px-3 py-1.5 text-xs font-medium transition-colors relative capitalize",style:{color:u===k?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)",background:"transparent"},children:[k,u===k&&r.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] rounded-t",style:{background:"var(--vscode-focusBorder)"}})]},k))}),u==="write"?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center px-1 py-0.5",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[r.jsx(V,{icon:r.jsx(Xt,{size:12}),title:"Bold (Cmd+B)",onClick:()=>p("bold")}),r.jsx(V,{icon:r.jsx(er,{size:12}),title:"Italic (Cmd+I)",onClick:()=>p("italic")}),r.jsx(V,{icon:r.jsx(tr,{size:12}),title:"Quote",onClick:()=>p("quote"),separator:!0}),r.jsx(V,{icon:r.jsx(rr,{size:12}),title:"Code",onClick:()=>p("code")}),r.jsx(V,{icon:r.jsx(sr,{size:12}),title:"Link (Cmd+K)",onClick:()=>p("link"),separator:!0}),r.jsx(V,{icon:r.jsx(nr,{size:12}),title:"Unordered list",onClick:()=>p("ul"),separator:!0}),r.jsx(V,{icon:r.jsx(or,{size:12}),title:"Ordered list",onClick:()=>p("ol")})]}),r.jsx("textarea",{ref:d,value:l,onChange:k=>a(k.target.value),onKeyDown:m,placeholder:"Add a comment... (Markdown supported)",className:"w-full px-2 py-1.5 text-xs resize-none outline-none",style:{background:"var(--vscode-input-background)",color:"var(--vscode-foreground)",minHeight:"120px"},rows:5})]}):x?r.jsx("div",{className:"px-2 py-1.5 text-xs comment-markdown",style:{background:"var(--vscode-input-background)",color:"var(--vscode-foreground)",minHeight:"120px"},dangerouslySetInnerHTML:{__html:x}}):r.jsx("div",{className:"px-2 py-1.5 text-xs",style:{background:"var(--vscode-input-background)",color:"var(--vscode-descriptionForeground)",minHeight:"120px"},children:"Nothing to preview"})]}),r.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[s&&r.jsx("button",{type:"button",onClick:s,className:"px-2.5 py-1 text-xs rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:k=>k.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:k=>k.currentTarget.style.background="transparent",children:"Cancel"}),r.jsx("button",{type:"button",onClick:h,disabled:!y,className:"px-2.5 py-1 text-xs font-medium rounded transition-colors disabled:opacity-30",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},title:`${n} (Cmd+Enter)`,children:n})]})]})}function ho({content:t}){const e=f.useMemo(()=>Rr(t),[t]);return r.jsx("div",{className:"comment-markdown",style:{color:"var(--vscode-foreground)"},dangerouslySetInnerHTML:{__html:e}})}function go(t){const e=Date.now(),s=new Date(t).getTime(),n=Math.floor((e-s)/1e3);if(n<60)return"just now";const o=Math.floor(n/60);if(o<60)return`${o}m ago`;const i=Math.floor(o/60);if(i<24)return`${i}h ago`;const l=Math.floor(i/24);return l<30?`${l}d ago`:new Date(t).toLocaleDateString()}function xo({comments:t,onAddComment:e,onUpdateComment:s,onDeleteComment:n}){const[o,i]=f.useState(null);return r.jsxs("div",{className:"flex flex-col",children:[t.length>0&&r.jsx("div",{className:"flex flex-col gap-2 px-4 py-3",children:t.map(l=>r.jsxs("div",{className:"rounded p-2 pl-3 text-xs group",style:{background:"var(--vscode-input-background)",borderLeft:"2px solid var(--vscode-textLink-foreground, #3b82f6)"},children:[r.jsxs("div",{className:"flex items-center justify-between mb-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"shrink-0 w-5 h-5 rounded-full flex items-center justify-center text-[9px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:l.author.split(/\s+/).filter(Boolean).map(a=>a[0]).join("").toUpperCase().slice(0,2)}),r.jsx("span",{className:"font-medium",style:{color:"var(--vscode-foreground)"},children:l.author}),r.jsx("span",{className:"text-[10px]",style:{color:"var(--vscode-descriptionForeground)"},children:go(l.created)})]}),r.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[r.jsx("button",{onClick:()=>i(l.id),className:"p-0.5 rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},title:"Edit",children:r.jsx(mt,{size:10})}),r.jsx("button",{onClick:()=>n(l.id),className:"p-0.5 rounded transition-colors hover:text-red-500",style:{color:"var(--vscode-descriptionForeground)"},title:"Delete",children:r.jsx(we,{size:10})})]})]}),o===l.id?r.jsx("div",{className:"mt-1",children:r.jsx(Zt,{initialContent:l.content,submitLabel:"Save",onSubmit:(a,u)=>{s(l.id,u),i(null)},onCancel:()=>i(null)})}):r.jsx(ho,{content:l.content})]},l.id))}),r.jsx("div",{className:"px-4 pb-3",children:r.jsx(Zt,{onSubmit:(l,a)=>e(l,a),submitLabel:"Comment"})})]})}function Fr({value:t,onChange:e,placeholder:s="Write markdown...",className:n,autoFocus:o,mode:i="create",comments:l,onAddComment:a,onUpdateComment:u,onDeleteComment:c}){const d=i==="edit",g=d?"Edit":"Write",[x,p]=f.useState(d?"preview":"write"),h=f.useRef(null),m=f.useMemo(()=>t.trim()?_.parse(t,{async:!1,gfm:!0,breaks:!0}):"",[t]);f.useEffect(()=>{x==="write"&&h.current&&h.current.focus()},[x]),f.useEffect(()=>{o&&h.current&&h.current.focus()},[o]);const y=f.useCallback(N=>{h.current&&Lr(h.current,t,e,N)},[t,e]),k=N=>{if(N.key==="Tab"){N.preventDefault();const M=N.currentTarget,w=M.selectionStart,C=M.selectionEnd,b=t.substring(0,w)+" "+t.substring(C);e(b),requestAnimationFrame(()=>{M.selectionStart=M.selectionEnd=w+2})}(N.metaKey||N.ctrlKey)&&N.key==="b"&&(N.preventDefault(),N.stopPropagation(),y("bold")),(N.metaKey||N.ctrlKey)&&N.key==="i"&&(N.preventDefault(),y("italic")),(N.metaKey||N.ctrlKey)&&N.key==="k"&&(N.preventDefault(),y("link"))};return r.jsxs("div",{className:Q("flex flex-col h-full",n),children:[r.jsxs("div",{className:"flex items-center shrink-0",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[(d?["preview","write"]:["write","preview"]).map(N=>r.jsxs("button",{type:"button",onClick:()=>p(N),className:"px-3 py-2 text-xs font-medium transition-colors relative",style:{color:x===N?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},children:[N==="write"?g:"Preview",x===N&&r.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] rounded-t",style:{background:"var(--vscode-focusBorder)"}})]},N)),l&&r.jsxs("button",{type:"button",onClick:()=>p("comments"),className:"px-3 py-2 text-xs font-medium transition-colors relative flex items-center gap-1.5",style:{color:x==="comments"?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},children:[r.jsx(ss,{size:12}),"Comments",l.length>0&&r.jsx("span",{className:"text-[10px] px-1 rounded-full",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:l.length}),x==="comments"&&r.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] rounded-t",style:{background:"var(--vscode-focusBorder)"}})]}),x==="write"&&r.jsxs("div",{className:"flex items-center ml-auto pr-2 gap-0.5",children:[r.jsx(V,{icon:r.jsx(ns,{size:14}),title:"Heading",onClick:()=>y("heading")}),r.jsx(V,{icon:r.jsx(Xt,{size:14}),title:"Bold (⌘B)",onClick:()=>y("bold")}),r.jsx(V,{icon:r.jsx(er,{size:14}),title:"Italic (⌘I)",onClick:()=>y("italic")}),r.jsx(V,{icon:r.jsx(tr,{size:14}),title:"Quote",onClick:()=>y("quote"),separator:!0}),r.jsx(V,{icon:r.jsx(rr,{size:14}),title:"Code",onClick:()=>y("code")}),r.jsx(V,{icon:r.jsx(sr,{size:14}),title:"Link (⌘K)",onClick:()=>y("link")}),r.jsx(V,{icon:r.jsx(nr,{size:14}),title:"Bulleted list",onClick:()=>y("ul"),separator:!0}),r.jsx(V,{icon:r.jsx(or,{size:14}),title:"Numbered list",onClick:()=>y("ol")}),r.jsx(V,{icon:r.jsx(os,{size:14}),title:"Task list",onClick:()=>y("tasklist")})]})]}),r.jsxs("div",{className:"flex-1 overflow-auto",children:[x==="write"&&r.jsx("textarea",{ref:h,value:t,onChange:N=>e(N.target.value),onKeyDown:k,placeholder:s,className:"markdown-editor-textarea",spellCheck:!1}),x==="preview"&&r.jsx("div",{className:"min-h-[200px]",children:m?r.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-4",dangerouslySetInnerHTML:{__html:m}}):r.jsx("p",{className:"p-4 text-sm italic",style:{color:"var(--vscode-descriptionForeground)"},children:"Nothing to preview"})}),x==="comments"&&l&&a&&u&&c&&r.jsx(xo,{comments:l,onAddComment:a,onUpdateComment:u,onDeleteComment:c})]})]})}const fo=[{value:"critical",label:"Critical",dot:"bg-red-500"},{value:"high",label:"High",dot:"bg-orange-500"},{value:"medium",label:"Medium",dot:"bg-yellow-500"},{value:"low",label:"Low",dot:"bg-green-500"}],mo=[{value:"backlog",label:"Backlog",dot:"bg-zinc-400"},{value:"todo",label:"To Do",dot:"bg-blue-400"},{value:"in-progress",label:"In Progress",dot:"bg-amber-400"},{value:"review",label:"Review",dot:"bg-purple-400"},{value:"done",label:"Done",dot:"bg-emerald-400"}];function Vt({value:t,options:e,onChange:s,className:n}){const[o,i]=f.useState(!1),l=e.find(a=>a.value===t);return r.jsxs("div",{className:Q("relative",n),children:[r.jsxs("button",{type:"button",onClick:()=>i(!o),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)"},onMouseEnter:a=>a.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:a=>a.currentTarget.style.background="transparent",children:[(l==null?void 0:l.dot)&&r.jsx("span",{className:Q("w-2 h-2 rounded-full shrink-0",l.dot)}),r.jsx("span",{children:l==null?void 0:l.label}),r.jsx(me,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),o&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>i(!1)}),r.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[140px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:e.map(a=>r.jsxs("button",{type:"button",onClick:()=>{s(a.value),i(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:a.value===t?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:u=>{a.value!==t&&(u.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:u=>{a.value!==t&&(u.currentTarget.style.background="transparent")},children:[a.dot&&r.jsx("span",{className:Q("w-2 h-2 rounded-full shrink-0",a.dot)}),r.jsx("span",{className:"flex-1 text-left",children:a.label}),a.value===t&&r.jsx(Fe,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},a.value))})]})]})}function bo({value:t,onChange:e}){const[s,n]=f.useState(!1),o=f.useRef(null),i=f.useRef(null),l=q(g=>g.features),a=f.useMemo(()=>{const g=new Set;return l.forEach(x=>{x.assignee&&g.add(x.assignee)}),Array.from(g).sort()},[l]),u=f.useMemo(()=>t.trim()?a.filter(g=>g.toLowerCase().includes(t.toLowerCase())&&g!==t):a,[t,a]),c=s&&u.length>0,d=t.trim()?t.trim().split(/\s+/).map(g=>g[0]).join("").toUpperCase().slice(0,2):null;return r.jsxs("div",{ref:i,className:"relative flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2 cursor-text",onClick:()=>{var g;return(g=o.current)==null?void 0:g.focus()},children:[d&&r.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:d}),r.jsx("input",{ref:o,type:"text",value:t,onChange:g=>e(g.target.value),onFocus:()=>n(!0),onBlur:()=>setTimeout(()=>n(!1),150),placeholder:"No assignee",className:"flex-1 bg-transparent border-none outline-none text-xs",style:{color:t?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})]}),c&&r.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 max-h-[160px] overflow-auto min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:u.map(g=>r.jsxs("button",{type:"button",onMouseDown:x=>{x.preventDefault(),e(g)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:x=>x.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:x=>x.currentTarget.style.background="transparent",children:[r.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:g.split(/\s+/).map(x=>x[0]).join("").toUpperCase().slice(0,2)}),r.jsx("span",{children:g})]},g))})]})}function vo({labels:t,onChange:e}){const[s,n]=f.useState(""),[o,i]=f.useState(!1),l=f.useRef(null),a=q(p=>p.features),u=q(p=>p.labelDefs),c=f.useMemo(()=>{const p=new Set;return a.forEach(h=>h.labels.forEach(m=>p.add(m))),Array.from(p).sort()},[a]),d=f.useMemo(()=>{const p=c.filter(h=>!t.includes(h));return s.trim()?p.filter(h=>h.toLowerCase().includes(s.toLowerCase())):p},[s,c,t]),g=o&&d.length>0,x=p=>{const h=(p||s).trim();h&&!t.includes(h)&&e([...t,h]),n("")};return r.jsxs("div",{className:"relative flex-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap cursor-text",onClick:()=>{var p;return(p=l.current)==null?void 0:p.focus()},children:[t.map(p=>{const h=u[p];return r.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:h?{backgroundColor:`${h.color}20`,color:h.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[p,r.jsx("button",{type:"button",onClick:m=>{m.stopPropagation(),e(t.filter(y=>y!==p))},className:"hover:text-red-500 transition-colors",children:r.jsx(oe,{size:9})})]},p)}),r.jsx("input",{ref:l,type:"text",value:s,onChange:p=>n(p.target.value),onFocus:()=>i(!0),onBlur:()=>setTimeout(()=>i(!1),150),onKeyDown:p=>{var h;p.key==="Enter"&&(p.preventDefault(),x()),p.key==="Backspace"&&!s&&t.length>0&&e(t.slice(0,-1)),p.key==="Escape"&&(n(""),(h=l.current)==null||h.blur())},placeholder:t.length===0?"Add labels...":"",className:"flex-1 min-w-[60px] bg-transparent border-none outline-none text-xs",style:{color:"var(--vscode-foreground)"}})]}),g&&r.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 max-h-[160px] overflow-auto min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:d.map(p=>{const h=u[p];return r.jsx("button",{type:"button",onMouseDown:m=>{m.preventDefault(),x(p)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:m=>m.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:m=>m.currentTarget.style.background="transparent",children:r.jsx("span",{className:"inline-block px-1.5 py-0.5 text-[10px] font-medium rounded",style:h?{backgroundColor:`${h.color}20`,color:h.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:p})},p)})})]})}function ko({actions:t,onChange:e}){const[s,n]=f.useState(""),o=f.useRef(null),i=l=>{const a=s.trim();a&&!t.includes(a)&&e([...t,a]),n("")};return r.jsx("div",{className:"relative flex-1",children:r.jsxs("label",{className:"flex items-center gap-1.5 flex-wrap cursor-text",children:[t.map(l=>r.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[l,r.jsx("button",{type:"button",onClick:a=>{a.stopPropagation(),e(t.filter(u=>u!==l))},className:"hover:text-red-500 transition-colors",children:r.jsx(oe,{size:9})})]},l)),r.jsx("input",{ref:o,type:"text",value:s,onChange:l=>n(l.target.value),onKeyDown:l=>{var a;(l.key==="Enter"||l.key===",")&&(l.preventDefault(),i()),l.key==="Backspace"&&!s&&t.length>0&&e(t.slice(0,-1)),l.key==="Escape"&&(n(""),(a=o.current)==null||a.blur())},placeholder:t.length===0?"Add actions...":"",className:"flex-1 min-w-[60px] bg-transparent border-none outline-none text-xs",style:{color:"var(--vscode-foreground)"}})]})})}function ve({label:t,icon:e,children:s}){return r.jsxs("div",{className:"flex items-center gap-3 px-4 py-[5px] transition-colors",onMouseEnter:n=>n.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:n=>n.currentTarget.style.background="transparent",children:[r.jsxs("div",{className:"flex items-center gap-2 w-[90px] shrink-0",children:[r.jsx("span",{style:{color:"var(--vscode-descriptionForeground)"},children:e}),r.jsx("span",{className:"text-[11px]",style:{color:"var(--vscode-descriptionForeground)"},children:t})]}),r.jsx("div",{className:"flex-1 min-w-0",children:s})]})}function yo({isOpen:t,...e}){return t?r.jsx(wo,{isOpen:t,...e}):null}function wo({isOpen:t,onClose:e,onCreate:s,initialStatus:n}){const{cardSettings:o}=q(),[i,l]=f.useState(""),[a,u]=f.useState(n??o.defaultStatus),[c,d]=f.useState(o.defaultPriority),[g,x]=f.useState(""),[p,h]=f.useState(""),[m,y]=f.useState([]),[k,N]=f.useState([]),[M,w]=f.useState(""),C=f.useRef(null);f.useEffect(()=>{const v=setTimeout(()=>{var S;return(S=C.current)==null?void 0:S.focus()},50);return()=>clearTimeout(v)},[]);const b=()=>{const v=M.trim(),S=i.trim(),E=S?`# ${S}${v?`
77
+ \`\`\``,u=4):(c=l?`\`${l}\``:"`code`",u=l?2:1);break;case"link":c=l?`[${l}](url)`:"[text](url)",u=l?l.length+3:1;break;case"ul":{c=l?l.split(`
78
+ `).map(d=>`- ${d}`).join(`
79
+ `):"- ",u=l?c.length-l.length:2;break}case"ol":{c=l?l.split(`
80
+ `).map((d,x)=>`${x+1}. ${d}`).join(`
81
+ `):"1. ",u=l?c.length-l.length:3;break}case"tasklist":{c=l?l.split(`
82
+ `).map(d=>`- [ ] ${d}`).join(`
83
+ `):"- [ ] ",u=l?c.length-l.length:6;break}}const g=a+c+p;s(g),requestAnimationFrame(()=>{e.focus();const h=o+(l?c.length:u);e.selectionStart=e.selectionEnd=h})}function Y({icon:e,title:t,onClick:s,separator:n}){return r.jsxs(r.Fragment,{children:[n&&r.jsx("div",{className:"w-px h-4 mx-1",style:{background:"var(--vscode-panel-border)"}}),r.jsx("button",{type:"button",onClick:s,title:t,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:o=>o.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:o=>o.currentTarget.style.background="transparent",children:e})]})}const xo=new Fr({gfm:!0,breaks:!0,renderer:{link({href:e,title:t,tokens:s}){const n=this.parser.parseInline(s),o=t?` title="${t}"`:"";return`<a href="${e}"${o} target="_blank" rel="noopener noreferrer">${n}</a>`}}});function Ur(e){const t=e.replace(new RegExp(`(?<!\\]\\(|"|'|<)(https?:\\/\\/[^\\s<>\\])"']+)`,"g"),"<$1>");return xo.parse(t,{async:!1})}const sr="kanban-comment-author";function nr({initialContent:e="",onSubmit:t,onCancel:s,submitLabel:n="Comment"}){const[o,i]=f.useState(()=>localStorage.getItem(sr)??""),[l,a]=f.useState(e),[p,c]=f.useState("write"),u=f.useRef(null),g=f.useRef(!0);f.useEffect(()=>{var k;if(g.current){g.current=!1;return}p==="write"&&((k=u.current)==null||k.focus())},[p]);const h=f.useMemo(()=>l.trim()?Ur(l):"",[l]),d=f.useCallback(k=>{u.current&&qr(u.current,l,a,k)},[l]),x=()=>{const k=o.trim(),z=l.trim();!k||!z||(localStorage.setItem(sr,k),t(k,z),e||(a(""),c("write")))},m=k=>{k.key==="Enter"&&(k.metaKey||k.ctrlKey)&&(k.preventDefault(),x()),(k.metaKey||k.ctrlKey)&&k.key==="b"&&(k.preventDefault(),d("bold")),(k.metaKey||k.ctrlKey)&&k.key==="i"&&(k.preventDefault(),d("italic")),(k.metaKey||k.ctrlKey)&&k.key==="k"&&(k.preventDefault(),d("link"))},v=o.trim().length>0&&l.trim().length>0;return r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsx("input",{type:"text",value:o,onChange:k=>i(k.target.value),placeholder:"Your name","aria-label":"Comment author name",className:"w-full rounded px-2 py-1 text-xs outline-none",style:{background:"var(--vscode-input-background)",color:"var(--vscode-foreground)",border:"1px solid var(--vscode-input-border, var(--vscode-panel-border))"}}),r.jsxs("div",{className:"flex flex-col rounded overflow-hidden",style:{border:"1px solid var(--vscode-input-border, var(--vscode-panel-border))"},children:[r.jsx("div",{className:"flex items-center",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:["write","preview"].map(k=>r.jsxs("button",{type:"button",onClick:()=>c(k),className:"px-3 py-1.5 text-xs font-medium transition-colors relative capitalize",style:{color:p===k?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)",background:"transparent"},children:[k,p===k&&r.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] rounded-t",style:{background:"var(--vscode-focusBorder)"}})]},k))}),p==="write"?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center px-1 py-0.5",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[r.jsx(Y,{icon:r.jsx(dr,{size:12}),title:"Bold (Cmd+B)",onClick:()=>d("bold")}),r.jsx(Y,{icon:r.jsx(ur,{size:12}),title:"Italic (Cmd+I)",onClick:()=>d("italic")}),r.jsx(Y,{icon:r.jsx(pr,{size:12}),title:"Quote",onClick:()=>d("quote"),separator:!0}),r.jsx(Y,{icon:r.jsx(hr,{size:12}),title:"Code",onClick:()=>d("code")}),r.jsx(Y,{icon:r.jsx(gr,{size:12}),title:"Link (Cmd+K)",onClick:()=>d("link"),separator:!0}),r.jsx(Y,{icon:r.jsx(xr,{size:12}),title:"Unordered list",onClick:()=>d("ul"),separator:!0}),r.jsx(Y,{icon:r.jsx(fr,{size:12}),title:"Ordered list",onClick:()=>d("ol")})]}),r.jsx("textarea",{ref:u,value:l,onChange:k=>a(k.target.value),onKeyDown:m,placeholder:"Add a comment... (Markdown supported)",className:"w-full px-2 py-1.5 text-xs resize-none outline-none",style:{background:"var(--vscode-input-background)",color:"var(--vscode-foreground)",minHeight:"120px"},rows:5})]}):h?r.jsx("div",{className:"px-2 py-1.5 text-xs comment-markdown",style:{background:"var(--vscode-input-background)",color:"var(--vscode-foreground)",minHeight:"120px"},dangerouslySetInnerHTML:{__html:h}}):r.jsx("div",{className:"px-2 py-1.5 text-xs",style:{background:"var(--vscode-input-background)",color:"var(--vscode-descriptionForeground)",minHeight:"120px"},children:"Nothing to preview"})]}),r.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[s&&r.jsx("button",{type:"button",onClick:s,className:"px-2.5 py-1 text-xs rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:k=>k.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:k=>k.currentTarget.style.background="transparent",children:"Cancel"}),r.jsx("button",{type:"button",onClick:x,disabled:!v,className:"px-2.5 py-1 text-xs font-medium rounded transition-colors disabled:opacity-30",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},title:`${n} (Cmd+Enter)`,children:n})]})]})}function fo({content:e}){const t=f.useMemo(()=>Ur(e),[e]);return r.jsx("div",{className:"comment-markdown",style:{color:"var(--vscode-foreground)"},dangerouslySetInnerHTML:{__html:t}})}function mo(e){const t=Date.now(),s=new Date(e).getTime(),n=Math.floor((t-s)/1e3);if(n<60)return"just now";const o=Math.floor(n/60);if(o<60)return`${o}m ago`;const i=Math.floor(o/60);if(i<24)return`${i}h ago`;const l=Math.floor(i/24);return l<30?`${l}d ago`:new Date(e).toLocaleDateString()}function bo({comments:e,onAddComment:t,onUpdateComment:s,onDeleteComment:n}){const[o,i]=f.useState(null);return r.jsxs("div",{className:"flex flex-col",children:[e.length>0&&r.jsx("div",{className:"flex flex-col gap-2 px-4 py-3",children:e.map(l=>r.jsxs("div",{className:"rounded p-2 pl-3 text-xs group",style:{background:"var(--vscode-input-background)",borderLeft:"2px solid var(--vscode-textLink-foreground, #3b82f6)"},children:[r.jsxs("div",{className:"flex items-center justify-between mb-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"shrink-0 w-5 h-5 rounded-full flex items-center justify-center text-[9px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:l.author.split(/\s+/).filter(Boolean).map(a=>a[0]).join("").toUpperCase().slice(0,2)}),r.jsx("span",{className:"font-medium",style:{color:"var(--vscode-foreground)"},children:l.author}),r.jsx("span",{className:"text-[10px]",style:{color:"var(--vscode-descriptionForeground)"},children:mo(l.created)})]}),r.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[r.jsx("button",{onClick:()=>i(l.id),className:"p-0.5 rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},title:"Edit",children:r.jsx(Ct,{size:10})}),r.jsx("button",{onClick:()=>n(l.id),className:"p-0.5 rounded transition-colors hover:text-red-500",style:{color:"var(--vscode-descriptionForeground)"},title:"Delete",children:r.jsx(Ce,{size:10})})]})]}),o===l.id?r.jsx("div",{className:"mt-1",children:r.jsx(nr,{initialContent:l.content,submitLabel:"Save",onSubmit:(a,p)=>{s(l.id,p),i(null)},onCancel:()=>i(null)})}):r.jsx(fo,{content:l.content})]},l.id))}),r.jsx("div",{className:"px-4 pb-3",children:r.jsx(nr,{onSubmit:(l,a)=>t(l,a),submitLabel:"Comment"})})]})}function Hr({value:e,onChange:t,placeholder:s="Write markdown...",className:n,autoFocus:o,mode:i="create",comments:l,onAddComment:a,onUpdateComment:p,onDeleteComment:c}){const u=i==="edit",g=u?"Edit":"Write",[h,d]=f.useState(u?"preview":"write"),x=f.useRef(null),m=f.useMemo(()=>e.trim()?K.parse(e,{async:!1,gfm:!0,breaks:!0}):"",[e]);f.useEffect(()=>{h==="write"&&x.current&&x.current.focus()},[h]),f.useEffect(()=>{o&&x.current&&x.current.focus()},[o]);const v=f.useCallback(z=>{x.current&&qr(x.current,e,t,z)},[e,t]),k=z=>{if(z.key==="Tab"){z.preventDefault();const E=z.currentTarget,y=E.selectionStart,D=E.selectionEnd,N=e.substring(0,y)+" "+e.substring(D);t(N),requestAnimationFrame(()=>{E.selectionStart=E.selectionEnd=y+2})}(z.metaKey||z.ctrlKey)&&z.key==="b"&&(z.preventDefault(),z.stopPropagation(),v("bold")),(z.metaKey||z.ctrlKey)&&z.key==="i"&&(z.preventDefault(),v("italic")),(z.metaKey||z.ctrlKey)&&z.key==="k"&&(z.preventDefault(),v("link"))};return r.jsxs("div",{className:J("flex flex-col h-full",n),children:[r.jsxs("div",{className:"flex items-center shrink-0",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[(u?["preview","write"]:["write","preview"]).map(z=>r.jsxs("button",{type:"button",onClick:()=>d(z),className:"px-3 py-2 text-xs font-medium transition-colors relative",style:{color:h===z?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},children:[z==="write"?g:"Preview",h===z&&r.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] rounded-t",style:{background:"var(--vscode-focusBorder)"}})]},z)),l&&r.jsxs("button",{type:"button",onClick:()=>d("comments"),className:"px-3 py-2 text-xs font-medium transition-colors relative flex items-center gap-1.5",style:{color:h==="comments"?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},children:[r.jsx(os,{size:12}),"Comments",l.length>0&&r.jsx("span",{className:"text-[10px] px-1 rounded-full",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:l.length}),h==="comments"&&r.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] rounded-t",style:{background:"var(--vscode-focusBorder)"}})]}),h==="write"&&r.jsxs("div",{className:"flex items-center ml-auto pr-2 gap-0.5",children:[r.jsx(Y,{icon:r.jsx(as,{size:14}),title:"Heading",onClick:()=>v("heading")}),r.jsx(Y,{icon:r.jsx(dr,{size:14}),title:"Bold (⌘B)",onClick:()=>v("bold")}),r.jsx(Y,{icon:r.jsx(ur,{size:14}),title:"Italic (⌘I)",onClick:()=>v("italic")}),r.jsx(Y,{icon:r.jsx(pr,{size:14}),title:"Quote",onClick:()=>v("quote"),separator:!0}),r.jsx(Y,{icon:r.jsx(hr,{size:14}),title:"Code",onClick:()=>v("code")}),r.jsx(Y,{icon:r.jsx(gr,{size:14}),title:"Link (⌘K)",onClick:()=>v("link")}),r.jsx(Y,{icon:r.jsx(xr,{size:14}),title:"Bulleted list",onClick:()=>v("ul"),separator:!0}),r.jsx(Y,{icon:r.jsx(fr,{size:14}),title:"Numbered list",onClick:()=>v("ol")}),r.jsx(Y,{icon:r.jsx(ls,{size:14}),title:"Task list",onClick:()=>v("tasklist")})]})]}),r.jsxs("div",{className:"flex-1 overflow-auto",children:[h==="write"&&r.jsx("textarea",{ref:x,value:e,onChange:z=>t(z.target.value),onKeyDown:k,placeholder:s,className:"markdown-editor-textarea",spellCheck:!1}),h==="preview"&&r.jsx("div",{className:"min-h-[200px]",children:m?r.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-4",dangerouslySetInnerHTML:{__html:m}}):r.jsx("p",{className:"p-4 text-sm italic",style:{color:"var(--vscode-descriptionForeground)"},children:"Nothing to preview"})}),h==="comments"&&l&&a&&p&&c&&r.jsx(bo,{comments:l,onAddComment:a,onUpdateComment:p,onDeleteComment:c})]})]})}const vo=[{value:"critical",label:"Critical",dot:"bg-red-500"},{value:"high",label:"High",dot:"bg-orange-500"},{value:"medium",label:"Medium",dot:"bg-yellow-500"},{value:"low",label:"Low",dot:"bg-green-500"}],ko=[{value:"backlog",label:"Backlog",dot:"bg-zinc-400"},{value:"todo",label:"To Do",dot:"bg-blue-400"},{value:"in-progress",label:"In Progress",dot:"bg-amber-400"},{value:"review",label:"Review",dot:"bg-purple-400"},{value:"done",label:"Done",dot:"bg-emerald-400"}];function or({value:e,options:t,onChange:s,className:n}){const[o,i]=f.useState(!1),l=t.find(a=>a.value===e);return r.jsxs("div",{className:J("relative",n),children:[r.jsxs("button",{type:"button",onClick:()=>i(!o),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)"},onMouseEnter:a=>a.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:a=>a.currentTarget.style.background="transparent",children:[(l==null?void 0:l.dot)&&r.jsx("span",{className:J("w-2 h-2 rounded-full shrink-0",l.dot)}),r.jsx("span",{children:l==null?void 0:l.label}),r.jsx(me,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),o&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>i(!1)}),r.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[140px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:t.map(a=>r.jsxs("button",{type:"button",onClick:()=>{s(a.value),i(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:a.value===e?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:p=>{a.value!==e&&(p.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:p=>{a.value!==e&&(p.currentTarget.style.background="transparent")},children:[a.dot&&r.jsx("span",{className:J("w-2 h-2 rounded-full shrink-0",a.dot)}),r.jsx("span",{className:"flex-1 text-left",children:a.label}),a.value===e&&r.jsx(fe,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},a.value))})]})]})}function yo({value:e,onChange:t}){const[s,n]=f.useState(!1),o=f.useRef(null),i=f.useRef(null),l=_(g=>g.features),a=f.useMemo(()=>{const g=new Set;return l.forEach(h=>{h.assignee&&g.add(h.assignee)}),Array.from(g).sort()},[l]),p=f.useMemo(()=>e.trim()?a.filter(g=>g.toLowerCase().includes(e.toLowerCase())&&g!==e):a,[e,a]),c=s&&p.length>0,u=e.trim()?e.trim().split(/\s+/).map(g=>g[0]).join("").toUpperCase().slice(0,2):null;return r.jsxs("div",{ref:i,className:"relative flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2 cursor-text",onClick:()=>{var g;return(g=o.current)==null?void 0:g.focus()},children:[u&&r.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:u}),r.jsx("input",{ref:o,type:"text",value:e,onChange:g=>t(g.target.value),onFocus:()=>n(!0),onBlur:()=>setTimeout(()=>n(!1),150),placeholder:"No assignee",className:"flex-1 bg-transparent border-none outline-none text-xs",style:{color:e?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})]}),c&&r.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 max-h-[160px] overflow-auto min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:p.map(g=>r.jsxs("button",{type:"button",onMouseDown:h=>{h.preventDefault(),t(g)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:h=>h.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:h=>h.currentTarget.style.background="transparent",children:[r.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:g.split(/\s+/).map(h=>h[0]).join("").toUpperCase().slice(0,2)}),r.jsx("span",{children:g})]},g))})]})}function wo({labels:e,onChange:t}){const[s,n]=f.useState(""),[o,i]=f.useState(!1),l=f.useRef(null),a=_(d=>d.features),p=_(d=>d.labelDefs),c=f.useMemo(()=>{const d=new Set;return a.forEach(x=>x.labels.forEach(m=>d.add(m))),Array.from(d).sort()},[a]),u=f.useMemo(()=>{const d=c.filter(x=>!e.includes(x));return s.trim()?d.filter(x=>x.toLowerCase().includes(s.toLowerCase())):d},[s,c,e]),g=o&&u.length>0,h=d=>{const x=(d||s).trim();x&&!e.includes(x)&&t([...e,x]),n("")};return r.jsxs("div",{className:"relative flex-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap cursor-text",onClick:()=>{var d;return(d=l.current)==null?void 0:d.focus()},children:[e.map(d=>{const x=p[d];return r.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:x?{backgroundColor:`${x.color}20`,color:x.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[d,r.jsx("button",{type:"button",onClick:m=>{m.stopPropagation(),t(e.filter(v=>v!==d))},className:"hover:text-red-500 transition-colors",children:r.jsx(ie,{size:9})})]},d)}),r.jsx("input",{ref:l,type:"text",value:s,onChange:d=>n(d.target.value),onFocus:()=>i(!0),onBlur:()=>setTimeout(()=>i(!1),150),onKeyDown:d=>{var x;d.key==="Enter"&&(d.preventDefault(),h()),d.key==="Backspace"&&!s&&e.length>0&&t(e.slice(0,-1)),d.key==="Escape"&&(n(""),(x=l.current)==null||x.blur())},placeholder:e.length===0?"Add labels...":"",className:"flex-1 min-w-[60px] bg-transparent border-none outline-none text-xs",style:{color:"var(--vscode-foreground)"}})]}),g&&r.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 max-h-[160px] overflow-auto min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:u.map(d=>{const x=p[d];return r.jsx("button",{type:"button",onMouseDown:m=>{m.preventDefault(),h(d)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:m=>m.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:m=>m.currentTarget.style.background="transparent",children:r.jsx("span",{className:"inline-block px-1.5 py-0.5 text-[10px] font-medium rounded",style:x?{backgroundColor:`${x.color}20`,color:x.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:d})},d)})})]})}function jo({actions:e,onChange:t}){const[s,n]=f.useState(""),o=f.useRef(null),i=l=>{const a=s.trim();a&&!e.includes(a)&&t([...e,a]),n("")};return r.jsx("div",{className:"relative flex-1",children:r.jsxs("label",{className:"flex items-center gap-1.5 flex-wrap cursor-text",children:[e.map(l=>r.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[l,r.jsx("button",{type:"button",onClick:a=>{a.stopPropagation(),t(e.filter(p=>p!==l))},className:"hover:text-red-500 transition-colors",children:r.jsx(ie,{size:9})})]},l)),r.jsx("input",{ref:o,type:"text",value:s,onChange:l=>n(l.target.value),onKeyDown:l=>{var a;(l.key==="Enter"||l.key===",")&&(l.preventDefault(),i()),l.key==="Backspace"&&!s&&e.length>0&&t(e.slice(0,-1)),l.key==="Escape"&&(n(""),(a=o.current)==null||a.blur())},placeholder:e.length===0?"Add actions...":"",className:"flex-1 min-w-[60px] bg-transparent border-none outline-none text-xs",style:{color:"var(--vscode-foreground)"}})]})})}function Me({label:e,icon:t,children:s}){return r.jsxs("div",{className:"flex items-center gap-3 px-4 py-[5px] transition-colors",onMouseEnter:n=>n.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:n=>n.currentTarget.style.background="transparent",children:[r.jsxs("div",{className:"flex items-center gap-2 w-[90px] shrink-0",children:[r.jsx("span",{style:{color:"var(--vscode-descriptionForeground)"},children:t}),r.jsx("span",{className:"text-[11px]",style:{color:"var(--vscode-descriptionForeground)"},children:e})]}),r.jsx("div",{className:"flex-1 min-w-0",children:s})]})}function zo({isOpen:e,...t}){return e?r.jsx(No,{isOpen:e,...t}):null}function No({isOpen:e,onClose:t,onCreate:s,initialStatus:n}){const{cardSettings:o}=_(),[i,l]=f.useState(""),[a,p]=f.useState(n??o.defaultStatus),[c,u]=f.useState(o.defaultPriority),[g,h]=f.useState(""),[d,x]=f.useState(""),[m,v]=f.useState([]),[k,z]=f.useState([]),[E,y]=f.useState(""),D=f.useRef(null);f.useEffect(()=>{const b=setTimeout(()=>{var w;return(w=D.current)==null?void 0:w.focus()},50);return()=>clearTimeout(b)},[]);const N=()=>{const b=E.trim(),w=i.trim(),S=w?`# ${w}${b?`
84
84
 
85
- ${v}`:""}`:v;s({status:a,priority:c,content:E,assignee:g.trim()||null,dueDate:p||null,labels:m,actions:k})},L=()=>{b(),e()},F=()=>{e()};return f.useEffect(()=>{const v=S=>{S.key==="Escape"&&F(),(S.metaKey||S.ctrlKey)&&S.key==="Enter"&&L(),(S.metaKey||S.ctrlKey)&&S.key==="s"&&(S.preventDefault(),L())};if(t)return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)}),r.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end",children:[r.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:F}),r.jsxs("div",{className:"relative h-full w-1/2 shadow-xl flex flex-col animate-in slide-in-from-right duration-200",style:{background:"var(--vscode-editor-background)",borderLeft:"1px solid var(--vscode-panel-border)"},children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[r.jsx("div",{className:"flex items-center gap-3",children:r.jsx("h2",{className:"font-medium",style:{color:"var(--vscode-foreground)"},children:"Create Feature"})}),r.jsx("button",{onClick:F,className:"p-1.5 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:v=>v.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:v=>v.currentTarget.style.background="transparent",children:r.jsx(oe,{size:18})})]}),r.jsxs("div",{className:"flex flex-col py-0.5",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[r.jsx(ve,{label:"Status",icon:r.jsx(at,{size:13}),children:r.jsx(Vt,{value:a,options:mo.map(v=>({value:v.value,label:v.label,dot:v.dot})),onChange:v=>u(v)})}),o.showPriorityBadges&&r.jsx(ve,{label:"Priority",icon:r.jsx(ar,{size:13}),children:r.jsx(Vt,{value:c,options:fo.map(v=>({value:v.value,label:v.label,dot:v.dot})),onChange:v=>d(v)})}),o.showAssignee&&r.jsx(ve,{label:"Assignee",icon:r.jsx(lr,{size:13}),children:r.jsx(bo,{value:g,onChange:x})}),o.showDueDate&&r.jsx(ve,{label:"Due date",icon:r.jsx(ft,{size:13}),children:r.jsx(uo,{value:p,onChange:h})}),o.showLabels&&r.jsx(ve,{label:"Labels",icon:r.jsx(ir,{size:13}),children:r.jsx(vo,{labels:m,onChange:y})}),r.jsx(ve,{label:"Actions",icon:r.jsx(as,{size:13}),children:r.jsx(ko,{actions:k,onChange:N})})]}),r.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[r.jsx("textarea",{ref:C,value:i,onChange:v=>l(v.target.value),placeholder:"Feature title...",className:"w-full text-lg font-medium bg-transparent border-none outline-none resize-none mb-4",style:{color:"var(--vscode-foreground)"},rows:1,onInput:v=>{const S=v.target;S.style.height="auto",S.style.height=S.scrollHeight+"px"},onKeyDown:v=>{v.key==="Enter"&&!v.shiftKey&&v.preventDefault()}}),r.jsx(Fr,{value:M,onChange:w,placeholder:"Add a description..."})]}),r.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderTop:"1px solid var(--vscode-panel-border)",background:"var(--vscode-sideBar-background, var(--vscode-editor-background))"},children:[r.jsxs("p",{className:"text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:[r.jsx("kbd",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--vscode-keybindingLabel-background, var(--vscode-badge-background))",color:"var(--vscode-keybindingLabel-foreground, var(--vscode-foreground))",border:"1px solid var(--vscode-keybindingLabel-border, var(--vscode-panel-border))"},children:"Esc"})," ","cancel ·"," ",r.jsx("kbd",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--vscode-keybindingLabel-background, var(--vscode-badge-background))",color:"var(--vscode-keybindingLabel-foreground, var(--vscode-foreground))",border:"1px solid var(--vscode-keybindingLabel-border, var(--vscode-panel-border))"},children:"⌘S"})," ","save"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:F,className:"px-3 py-1.5 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)",background:"transparent",border:"1px solid var(--vscode-panel-border)"},onMouseEnter:v=>v.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:v=>v.currentTarget.style.background="transparent",children:"Cancel"}),r.jsx("button",{type:"button",onClick:L,className:"px-3 py-1.5 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-button-foreground)",background:"var(--vscode-button-background)"},onMouseEnter:v=>v.currentTarget.style.background="var(--vscode-button-hoverBackground)",onMouseLeave:v=>v.currentTarget.style.background="var(--vscode-button-background)",children:"Save"})]})]})]})]})}const jo={critical:"Critical",high:"High",medium:"Medium",low:"Low"},No=["critical","high","medium","low"],zo={critical:"bg-red-500",high:"bg-orange-500",medium:"bg-yellow-500",low:"bg-green-500"},Co=[{agent:"claude",label:"Claude",color:"hover:bg-amber-100 dark:hover:bg-amber-900/30",activeColor:"bg-amber-700 text-white"},{agent:"codex",label:"Codex",color:"hover:bg-emerald-100 dark:hover:bg-emerald-900/30",activeColor:"bg-emerald-500 text-white"},{agent:"opencode",label:"OpenCode",color:"hover:bg-slate-100 dark:hover:bg-slate-700/30",activeColor:"bg-slate-500 text-white"}],So={claude:{bg:"bg-amber-700",hover:"hover:bg-amber-800",shadow:"shadow-sm",border:"border border-amber-800/50"},codex:{bg:"bg-emerald-600",hover:"hover:bg-emerald-700",shadow:"shadow-sm",border:"border border-emerald-700/50"},opencode:{bg:"bg-slate-600",hover:"hover:bg-slate-700",shadow:"shadow-sm",border:"border border-slate-700/50"}},Do={claude:[{permissionMode:"default",label:"Default",description:"With confirmations"},{permissionMode:"plan",label:"Plan",description:"Creates a plan first"},{permissionMode:"acceptEdits",label:"Auto-edit",description:"Auto-accepts file edits"},{permissionMode:"bypassPermissions",label:"Full Auto",description:"Bypasses all prompts"}],codex:[{permissionMode:"default",label:"Suggest",description:"Suggests changes"},{permissionMode:"acceptEdits",label:"Auto-edit",description:"Auto-accepts edits"},{permissionMode:"bypassPermissions",label:"Full Auto",description:"Full automation"}],opencode:[{permissionMode:"default",label:"Default",description:"Standard mode"}]};function To({value:t,options:e,onChange:s,className:n}){const[o,i]=f.useState(!1),l=e.find(a=>a.value===t);return r.jsxs("div",{className:Q("relative",n),children:[r.jsxs("button",{onClick:()=>i(!o),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-foreground)"},children:[(l==null?void 0:l.dot)&&r.jsx("span",{className:Q("w-2 h-2 rounded-full shrink-0",l.dot)}),r.jsx("span",{children:l==null?void 0:l.label}),r.jsx(me,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),o&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>i(!1)}),r.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[140px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:e.map(a=>r.jsxs("button",{onClick:()=>{s(a.value),i(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:a.value===t?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:u=>{a.value!==t&&(u.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:u=>{a.value!==t&&(u.currentTarget.style.background="transparent")},children:[a.dot&&r.jsx("span",{className:Q("w-2 h-2 rounded-full shrink-0",a.dot)}),r.jsx("span",{className:"flex-1 text-left",children:a.label}),a.value===t&&r.jsx(Fe,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},a.value))})]})]})}function Mo({value:t,onChange:e,onTransferToBoard:s}){const[n,o]=f.useState(!1),i=q(c=>c.columns),l=q(c=>c.boards),a=q(c=>c.currentBoard),u=l.filter(c=>c.id!==a);return r.jsxs("div",{className:"relative",children:[r.jsxs("button",{onClick:()=>o(!n),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-foreground)"},children:[(()=>{const c=i.find(d=>d.id===t);return c?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:c.color}}),r.jsx("span",{children:c.name})]}):r.jsx("span",{children:t})})(),r.jsx(me,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),n&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>o(!1)}),r.jsxs("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[180px] max-h-[320px] overflow-y-auto",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:[i.map(c=>r.jsxs("button",{onClick:()=>{e(c.id),o(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:c.id===t?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:d=>{c.id!==t&&(d.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:d=>{c.id!==t&&(d.currentTarget.style.background="transparent")},children:[r.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:c.color}}),r.jsx("span",{className:"flex-1 text-left",children:c.name}),c.id===t&&r.jsx(Fe,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},c.id)),u.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mx-2 my-1",style:{borderTop:"1px solid var(--vscode-panel-border)"}}),r.jsx("div",{className:"px-3 py-1 text-[10px] font-medium uppercase tracking-wider",style:{color:"var(--vscode-descriptionForeground)"},children:"Move to..."}),u.map(c=>r.jsxs("div",{children:[r.jsx("div",{className:"px-3 py-1 text-[10px] font-semibold",style:{color:"var(--vscode-descriptionForeground)"},children:c.name}),(c.columns||[]).map(d=>r.jsxs("button",{onClick:()=>{s(c.id,d.id),o(!1)},className:"w-full flex items-center gap-2 pl-5 pr-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:g=>{g.currentTarget.style.background="var(--vscode-list-hoverBackground)"},onMouseLeave:g=>{g.currentTarget.style.background="transparent"},children:[r.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:d.color}}),r.jsx("span",{className:"flex-1 text-left",children:d.name})]},`${c.id}-${d.id}`))]},c.id))]})]})]})]})}function pe({label:t,icon:e,children:s}){return r.jsxs("div",{className:"flex items-center gap-3 px-4 py-[5px] transition-colors vscode-hover-bg",children:[r.jsxs("div",{className:"flex items-center gap-2 w-[90px] shrink-0",children:[r.jsx("span",{style:{color:"var(--vscode-descriptionForeground)"},children:e}),r.jsx("span",{className:"text-[11px]",style:{color:"var(--vscode-descriptionForeground)"},children:t})]}),r.jsx("div",{className:"flex-1 min-w-0",children:s})]})}function Eo({onSelect:t}){const[e,s]=f.useState(!1),[n,o]=f.useState("claude"),i=Do[n],l=So[n];return r.jsxs("div",{className:"relative",children:[r.jsxs("button",{onClick:()=>s(!e),className:Q("flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium text-white rounded-md transition-colors",l.bg,l.hover,l.shadow,l.border),children:[r.jsx(ls,{size:13}),r.jsx("span",{children:"Build with AI"}),r.jsx("kbd",{className:"ml-0.5 text-[9px] opacity-60 font-mono",children:"⌘B"}),r.jsx(me,{size:11,className:Q("ml-0.5 opacity-60 transition-transform",e&&"rotate-180")})]}),e&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>s(!1)}),r.jsxs("div",{className:"absolute top-full right-0 mt-1 z-20 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-lg shadow-xl min-w-[260px] overflow-hidden",children:[r.jsx("div",{className:"flex",children:Co.map(a=>r.jsx("button",{onClick:()=>o(a.agent),className:Q("flex-1 px-3 py-2.5 text-xs font-medium transition-all",n===a.agent?a.activeColor:Q("text-zinc-600 dark:text-zinc-400",a.color)),children:a.label},a.agent))}),r.jsx("div",{className:"p-2 space-y-1",children:i.map(a=>r.jsxs("button",{onClick:()=>{t(n,a.permissionMode),s(!1)},className:"w-full text-left px-3 py-2.5 rounded-md hover:bg-zinc-100 dark:hover:bg-zinc-700/50 transition-colors",children:[r.jsx("div",{className:"text-xs font-medium text-zinc-900 dark:text-zinc-100",children:a.label}),r.jsx("div",{className:"text-[10px] text-zinc-500 dark:text-zinc-400 mt-0.5",children:a.description})]},a.permissionMode))})]})]})]})}function Ao({actions:t,onTriggerAction:e}){const[s,n]=f.useState(!1);return r.jsxs("div",{className:"relative",children:[r.jsxs("button",{onClick:()=>n(!s),className:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium rounded-md transition-colors vscode-hover-bg",style:{color:"var(--vscode-foreground)",border:"1px solid var(--vscode-widget-border, var(--vscode-contrastBorder, rgba(128,128,128,0.35)))"},children:[r.jsx("span",{children:"Run Action"}),r.jsx(me,{size:11,className:Q("opacity-60 transition-transform",s&&"rotate-180")})]}),s&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button","aria-label":"Close actions menu",className:"fixed inset-0 z-10 cursor-default",onClick:()=>n(!1)}),r.jsx("div",{className:"absolute top-full right-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[160px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:t.map(o=>r.jsx("button",{type:"button",onClick:()=>{n(!1),e(o)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:i=>{i.currentTarget.style.background="var(--vscode-list-hoverBackground)"},onMouseLeave:i=>{i.currentTarget.style.background="transparent"},children:o},o))})]})]})}function $o({metadata:t}){const[e,s]=f.useState(!1);if(!t||Object.keys(t).length===0)return null;const n=Object.keys(t);return r.jsxs("div",{className:"mt-3",children:[r.jsxs("button",{onClick:()=>s(!e),className:"flex items-center gap-1.5 text-xs font-medium text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-300",children:[r.jsx("span",{className:"text-[10px]",children:e?"▼":"▶"}),r.jsx("span",{children:"Metadata"}),r.jsxs("span",{className:"text-zinc-400 dark:text-zinc-500",children:["(",n.length,")"]})]}),!e&&r.jsx("div",{className:"flex flex-wrap gap-1 mt-1.5",children:n.map(o=>r.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-zinc-100 text-zinc-600 dark:bg-zinc-700 dark:text-zinc-300 font-mono",children:o},o))}),e&&r.jsx("div",{className:"mt-1.5 text-xs font-mono bg-zinc-50 dark:bg-zinc-900 rounded p-2 border border-zinc-200 dark:border-zinc-700",children:r.jsx(Br,{data:t,depth:0})})]})}function Br({data:t,depth:e}){return r.jsx("div",{style:{paddingLeft:e>0?12:0},children:Object.entries(t).map(([s,n])=>r.jsx("div",{className:"py-0.5",children:n&&typeof n=="object"&&!Array.isArray(n)?r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"text-zinc-500 dark:text-zinc-400",children:[s,":"]}),r.jsx(Br,{data:n,depth:e+1})]}):Array.isArray(n)?r.jsxs("div",{children:[r.jsxs("span",{className:"text-zinc-500 dark:text-zinc-400",children:[s,": "]}),r.jsxs("span",{className:"text-zinc-700 dark:text-zinc-300",children:["[",n.join(", "),"]"]})]}):r.jsxs("div",{children:[r.jsxs("span",{className:"text-zinc-500 dark:text-zinc-400",children:[s,": "]}),r.jsx("span",{className:"text-zinc-700 dark:text-zinc-300",children:String(n)})]})},s))})}function Lo({labels:t,onChange:e}){const[s,n]=f.useState(""),[o,i]=f.useState(!1),l=f.useRef(null),a=q(h=>h.features),u=q(h=>h.labelDefs),c=f.useMemo(()=>{const h=new Set;return a.forEach(m=>m.labels.forEach(y=>h.add(y))),Array.from(h).sort()},[a]),d=f.useMemo(()=>{const h=c.filter(m=>!t.includes(m));return s.trim()?h.filter(m=>m.toLowerCase().includes(s.toLowerCase())):h},[s,c,t]),g=o&&d.length>0,x=h=>{const m=(h||s).trim();m&&!t.includes(m)&&e([...t,m]),n("")},p=h=>{e(t.filter(m=>m!==h))};return r.jsxs("div",{className:"relative flex items-center gap-1.5 flex-wrap",children:[t.map(h=>{const m=u[h];return r.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:m?{backgroundColor:`${m.color}20`,color:m.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[h,r.jsx("button",{type:"button",onClick:()=>p(h),className:"hover:text-red-500 transition-colors",children:r.jsx(oe,{size:9})})]},h)}),r.jsx("button",{onClick:()=>{i(!0),setTimeout(()=>{var h;return(h=l.current)==null?void 0:h.focus()},0)},className:"inline-flex items-center gap-0.5 px-1 py-0.5 text-[10px] rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},children:r.jsx(je,{size:10})}),r.jsx("input",{ref:l,type:"text",value:s,onChange:h=>n(h.target.value),onFocus:()=>i(!0),onBlur:()=>setTimeout(()=>i(!1),150),onKeyDown:h=>{var m;h.key==="Enter"&&(h.preventDefault(),x()),h.key==="Backspace"&&!s&&t.length>0&&e(t.slice(0,-1)),h.key==="Escape"&&(n(""),(m=l.current)==null||m.blur())},placeholder:t.length===0?"Add labels...":"",className:"flex-1 min-w-[60px] bg-transparent border-none outline-none text-xs",style:{color:"var(--vscode-foreground)",display:o||s?"block":"none"}}),g&&r.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 max-h-[160px] overflow-auto min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:d.map(h=>{const m=u[h];return r.jsx("button",{type:"button",onMouseDown:y=>{y.preventDefault(),x(h)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:y=>y.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:y=>y.currentTarget.style.background="transparent",children:r.jsx("span",{className:"inline-block px-1.5 py-0.5 text-[10px] font-medium rounded",style:m?{backgroundColor:`${m.color}20`,color:m.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:h})},h)})})]})}function Ro({featureId:t,content:e,frontmatter:s,comments:n,contentVersion:o,onSave:i,onClose:l,onDelete:a,onPermanentDelete:u,onRestore:c,onOpenFile:d,onStartWithAI:g,onAddAttachment:x,onOpenAttachment:p,onRemoveAttachment:h,onAddComment:m,onUpdateComment:y,onDeleteComment:k,onTransferToBoard:N,onTriggerAction:M}){const{cardSettings:w}=q(),[C,b]=f.useState(s),[L,F]=f.useState(e),[v,S]=f.useState(!1),E=C.status===Dt,z=f.useRef(null),A=f.useRef(C),W=f.useRef(L);A.current=C,W.current=L;const ee=f.useCallback(()=>{i(W.current,A.current)},[i]);f.useEffect(()=>()=>{z.current&&clearTimeout(z.current)},[]),f.useEffect(()=>{F(e)},[t,o]),f.useEffect(()=>{b(s)},[s]);const X=f.useCallback(B=>{F(B),z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{i(B,A.current)},800)},[i]),Y=f.useCallback(B=>{b(H=>{const se={...H,...B};return z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{i(W.current,se)},800),se})},[i]);return f.useEffect(()=>{const B=H=>{(H.metaKey||H.ctrlKey)&&H.key==="s"&&(H.preventDefault(),z.current&&clearTimeout(z.current),ee()),(H.metaKey||H.ctrlKey)&&H.key==="b"&&w.showBuildWithAI&&(H.preventDefault(),g("claude","default")),H.key==="Escape"&&(z.current&&(clearTimeout(z.current),ee()),l())};return window.addEventListener("keydown",B),()=>window.removeEventListener("keydown",B)},[ee,l,g,w.showBuildWithAI]),r.jsxs("div",{className:"h-full flex flex-col",style:{background:"var(--vscode-editor-background)",borderLeft:"1px solid var(--vscode-panel-border)"},children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"text-xs font-mono",style:{color:"var(--vscode-descriptionForeground)"},children:t}),E?v?r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-xs",style:{color:"var(--vscode-errorForeground)"},children:"Permanently delete from disk?"}),r.jsx("button",{onClick:()=>{S(!1),u()},className:"px-2 py-1 text-xs font-medium rounded transition-colors text-white bg-red-600 hover:bg-red-700",children:"Yes"}),r.jsx("button",{onClick:()=>S(!1),className:"px-2 py-1 text-xs font-medium rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-foreground)"},children:"No"})]}):r.jsxs(r.Fragment,{children:[r.jsxs("button",{onClick:c,className:"p-1.5 px-2 rounded border transition-colors vscode-hover-bg flex items-center gap-1",style:{color:"var(--vscode-descriptionForeground)",borderColor:"var(--vscode-widget-border, var(--vscode-contrastBorder, rgba(128,128,128,0.35)))"},title:"Restore card",children:[r.jsx(at,{size:16}),r.jsx("span",{className:"text-xs",children:"RESTORE"})]}),r.jsxs("button",{onClick:()=>S(!0),className:"p-1.5 px-2 rounded border transition-colors vscode-hover-bg flex items-center gap-1",style:{color:"var(--vscode-errorForeground)",borderColor:"var(--vscode-widget-border, var(--vscode-contrastBorder, rgba(128,128,128,0.35)))"},title:"Permanently delete from disk",children:[r.jsx(we,{size:16}),r.jsx("span",{className:"text-xs",children:"PERMANENT DELETE"})]})]}):r.jsxs(r.Fragment,{children:[r.jsxs("button",{onClick:()=>{d(),l()},className:"p-1.5 px-2 rounded border transition-colors vscode-hover-bg flex items-center gap-1",style:{color:"var(--vscode-descriptionForeground)",borderColor:"var(--vscode-widget-border, var(--vscode-contrastBorder, rgba(128,128,128,0.35)))"},title:"Open .md file",children:[r.jsx(Jt,{size:16}),r.jsx("span",{className:"text-xs",children:"OPEN"})]}),r.jsxs("button",{onClick:a,className:"p-1.5 px-2 rounded border transition-colors vscode-hover-bg flex items-center gap-1",style:{color:"var(--vscode-descriptionForeground)",borderColor:"var(--vscode-widget-border, var(--vscode-contrastBorder, rgba(128,128,128,0.35)))"},title:"Move to deleted",children:[r.jsx(we,{size:16}),r.jsx("span",{className:"text-xs",children:"DELETE"})]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[C.actions&&C.actions.length>0&&M&&r.jsx(Ao,{actions:C.actions,onTriggerAction:M}),w.showBuildWithAI&&r.jsx(Eo,{onSelect:g}),r.jsx("button",{onClick:l,className:"p-1.5 rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},children:r.jsx(oe,{size:18})})]})]}),r.jsxs("div",{className:"flex flex-col py-0.5",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[r.jsx(pe,{label:"Status",icon:r.jsx(at,{size:13}),children:r.jsx(Mo,{value:C.status,onChange:B=>Y({status:B}),onTransferToBoard:N})}),w.showPriorityBadges&&r.jsx(pe,{label:"Priority",icon:r.jsx(ar,{size:13}),children:r.jsx(To,{value:C.priority,options:No.map(B=>({value:B,label:jo[B],dot:zo[B]})),onChange:B=>Y({priority:B})})}),w.showAssignee&&r.jsx(pe,{label:"Assignee",icon:r.jsx(lr,{size:13}),children:r.jsxs("div",{className:"flex items-center gap-2",children:[C.assignee&&r.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:C.assignee.split(/\s+/).filter(Boolean).map(B=>B[0]).join("").toUpperCase().slice(0,2)}),r.jsx("input",{type:"text",value:C.assignee||"",onChange:B=>Y({assignee:B.target.value||null}),placeholder:"No assignee",className:"bg-transparent border-none outline-none text-xs w-32",style:{color:C.assignee?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})]})}),w.showDueDate&&r.jsx(pe,{label:"Due date",icon:r.jsx(ft,{size:13}),children:r.jsx("input",{type:"date",value:C.dueDate||"",onChange:B=>Y({dueDate:B.target.value||null}),className:"bg-transparent border-none outline-none text-xs",style:{color:C.dueDate?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})}),w.showLabels&&r.jsx(pe,{label:"Labels",icon:r.jsx(ir,{size:13}),children:r.jsx(Lo,{labels:C.labels,onChange:B=>Y({labels:B})})}),r.jsx(pe,{label:"Attachments",icon:r.jsx(nt,{size:13}),children:r.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[C.attachments.map(B=>r.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[r.jsxs("button",{type:"button",onClick:()=>p(B),className:"inline-flex items-center gap-1 hover:underline",title:B,children:[r.jsx(nt,{size:9}),B]}),r.jsx("button",{type:"button",onClick:()=>h(B),className:"hover:text-red-500 transition-colors",children:r.jsx(oe,{size:9})})]},B)),r.jsx("button",{type:"button",onClick:x,className:"inline-flex items-center gap-0.5 px-1 py-0.5 text-[10px] rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},children:r.jsx(je,{size:10})})]})}),r.jsx(pe,{label:"Created",icon:r.jsx(ot,{size:13}),children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-xs",style:{color:"var(--vscode-foreground)"},children:Ve(C.created)}),r.jsx("span",{className:"text-[10px]",style:{color:"var(--vscode-descriptionForeground)"},title:Qe(C.created),children:xt(C.created)})]})}),r.jsx(pe,{label:"Modified",icon:r.jsx(ot,{size:13}),children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-xs",style:{color:"var(--vscode-foreground)"},children:Ve(C.modified)}),r.jsx("span",{className:"text-[10px]",style:{color:"var(--vscode-descriptionForeground)"},title:Qe(C.modified),children:xt(C.modified)})]})}),r.jsx("div",{className:"px-4 pb-2",children:r.jsx($o,{metadata:C.metadata})})]}),r.jsx(Fr,{value:L,onChange:X,placeholder:"Start writing...",className:"flex-1 min-h-0",mode:"edit",comments:n,onAddComment:m,onUpdateComment:y,onDeleteComment:k})]})}const Fo=[{value:"all",label:"All Priorities"},{value:"critical",label:"Critical"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}],Bo=[{value:"all",label:"All Dates"},{value:"overdue",label:"Overdue"},{value:"today",label:"Due Today"},{value:"this-week",label:"Due This Week"},{value:"no-date",label:"No Due Date"}],Ae="text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100";function Io({onOpenSettings:t,onAddColumn:e,onToggleTheme:s,onSwitchBoard:n,onCreateBoard:o}){var Ie;const{searchQuery:i,setSearchQuery:l,priorityFilter:a,setPriorityFilter:u,assigneeFilter:c,setAssigneeFilter:d,labelFilter:g,setLabelFilter:x,dueDateFilter:p,setDueDateFilter:h,sortOrder:m,setSortOrder:y,clearAllFilters:k,getUniqueAssignees:N,getUniqueLabels:M,hasActiveFilters:w,layout:C,toggleLayout:b,isDarkMode:L,cardSettings:F,boards:v,currentBoard:S}=q(),E=q(D=>D.labelDefs),z=N(),A=M(),W=w(),ee=f.useMemo(()=>{const D={};return A.forEach(ce=>{const ae=E[ce],Se=(ae==null?void 0:ae.group)||"Other";D[Se]||(D[Se]=[]),D[Se].push(ce)}),D},[A,E]),[X,Y]=f.useState(!1),[B,H]=f.useState(!1),[se,Z]=f.useState(""),ze=f.useRef(null),Ce=f.useRef(null);f.useEffect(()=>{const D=ce=>{ze.current&&!ze.current.contains(ce.target)&&(Y(!1),H(!1),Z(""))};return X&&document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[X]),f.useEffect(()=>{B&&Ce.current&&Ce.current.focus()},[B]);const et=((Ie=v.find(D=>D.id===S))==null?void 0:Ie.name)||S,tt=()=>{const D=se.trim();D&&(o(D),Z(""),H(!1),Y(!1))};return r.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900/50 flex-wrap",children:[r.jsxs("div",{className:"relative",ref:ze,children:[r.jsxs("button",{type:"button",onClick:()=>Y(!X),className:"flex items-center gap-1.5 px-2 py-1.5 text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md hover:bg-zinc-50 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[r.jsx("span",{className:"max-w-[120px] truncate",children:et}),r.jsx(me,{size:14,className:`text-zinc-400 transition-transform ${X?"rotate-180":""}`})]}),X&&r.jsxs("div",{className:"absolute top-full left-0 mt-1 min-w-[180px] bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg z-50 py-1",children:[v.map(D=>r.jsxs("button",{type:"button",onClick:()=>{n(D.id),Y(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[r.jsx(Fe,{size:14,className:D.id===S?"text-blue-500":"invisible"}),r.jsx("span",{className:"truncate",children:D.name})]},D.id)),r.jsx("div",{className:"border-t border-zinc-200 dark:border-zinc-600 my-1"}),B?r.jsx("div",{className:"px-3 py-1.5",children:r.jsx("input",{ref:Ce,type:"text",value:se,onChange:D=>Z(D.target.value),onKeyDown:D=>{D.key==="Enter"&&tt(),D.key==="Escape"&&(H(!1),Z(""))},placeholder:"Board name...",className:"w-full px-2 py-1 text-sm bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})}):r.jsxs("button",{type:"button",onClick:()=>H(!0),className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-blue-600 dark:text-blue-400 transition-colors",children:[r.jsx(je,{size:14}),r.jsx("span",{children:"New Board"})]})]})]}),r.jsxs("div",{className:"relative flex-1 min-w-[180px] max-w-xs",children:[r.jsx(is,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-zinc-400"}),r.jsx("input",{type:"text",value:i,onChange:D=>l(D.target.value),placeholder:"Search... (meta.field: value)",className:"w-full pl-8 pr-3 py-1.5 text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})]}),F.showPriorityBadges&&r.jsx("select",{value:a,onChange:D=>u(D.target.value),className:Ae,children:Fo.map(D=>r.jsx("option",{value:D.value,children:D.label},D.value))}),F.showAssignee&&r.jsxs("select",{value:c,onChange:D=>d(D.target.value),className:Ae,children:[r.jsx("option",{value:"all",children:"All Assignees"}),r.jsx("option",{value:"unassigned",children:"Unassigned"}),z.map(D=>r.jsx("option",{value:D,children:D},D))]}),F.showLabels&&r.jsxs("select",{value:g,onChange:D=>x(D.target.value),className:Ae,children:[r.jsx("option",{value:"all",children:"All Labels"}),Object.entries(ee).map(([D,ce])=>r.jsxs("optgroup",{label:D,children:[r.jsxs("option",{value:`group:${D}`,children:["All ",D]}),ce.map(ae=>r.jsx("option",{value:ae,children:ae},ae))]},D))]}),F.showDueDate&&r.jsx("select",{value:p,onChange:D=>h(D.target.value),className:Ae,children:Bo.map(D=>r.jsx("option",{value:D.value,children:D.label},D.value))}),r.jsxs("select",{value:m,onChange:D=>y(D.target.value),className:Ae,children:[r.jsx("option",{value:"order",children:"Board Order"}),r.jsx("option",{value:"created:asc",children:"Created (oldest)"}),r.jsx("option",{value:"created:desc",children:"Created (newest)"}),r.jsx("option",{value:"modified:asc",children:"Modified (oldest)"}),r.jsx("option",{value:"modified:desc",children:"Modified (newest)"})]}),W&&r.jsxs("button",{onClick:k,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Clear all filters",children:[r.jsx(oe,{size:14}),r.jsx("span",{children:"Clear"})]}),r.jsxs("button",{onClick:e,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Add new list",children:[r.jsx(je,{size:16}),r.jsx("span",{children:"Add List"})]}),r.jsx("button",{onClick:b,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:C==="horizontal"?"Switch to vertical layout":"Switch to horizontal layout",children:C==="horizontal"?r.jsx(cs,{size:16}):r.jsx(ds,{size:16})}),r.jsx("button",{onClick:s,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:L?"Switch to light theme":"Switch to dark theme",children:L?r.jsx(us,{size:16}):r.jsx(ps,{size:16})}),r.jsx("button",{onClick:t,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Open settings",children:r.jsx(hs,{size:16})}),r.jsxs("div",{className:"ml-auto text-xs text-zinc-400",children:["Press ",r.jsx("kbd",{className:"px-1.5 py-0.5 bg-zinc-200 dark:bg-zinc-700 rounded",children:"n"})," to add"]})]})}function Po({message:t,onUndo:e,onExpire:s,duration:n,index:o}){const[i,l]=f.useState(100);return f.useEffect(()=>{const u=50/n*100,c=setInterval(()=>{l(d=>{const g=d-u;return g<=0?(clearInterval(c),0):g})},50);return()=>clearInterval(c)},[n]),f.useEffect(()=>{i<=0&&s()},[i,s]),r.jsxs("div",{className:"fixed right-4 z-50 flex flex-col min-w-[320px] max-w-[420px] shadow-[0_4px_16px_rgba(0,0,0,0.4)] transition-[bottom] duration-200 ease-out",style:{bottom:`${24+o*52}px`,background:"var(--vscode-notifications-background)",color:"var(--vscode-notifications-foreground)",border:"1px solid var(--vscode-notifications-border, var(--vscode-widget-border))"},children:[r.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[r.jsx("span",{className:"text-[13px] leading-snug flex-1 truncate",children:t}),r.jsx("button",{onClick:e,className:"text-[13px] px-2 py-0.5 shrink-0",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},onMouseEnter:a=>a.currentTarget.style.background="var(--vscode-button-hoverBackground)",onMouseLeave:a=>a.currentTarget.style.background="var(--vscode-button-background)",children:"Undo"})]}),r.jsx("div",{className:"h-[2px] w-full",style:{background:"var(--vscode-widget-border)"},children:r.jsx("div",{className:"h-full transition-none",style:{width:`${i}%`,background:"var(--vscode-progressBar-background)"}})})]})}const Oo=[{value:"critical",label:"Critical",dot:"bg-red-500"},{value:"high",label:"High",dot:"bg-orange-500"},{value:"medium",label:"Medium",dot:"bg-yellow-500"},{value:"low",label:"Low",dot:"bg-green-500"}],_o=[{value:"backlog",label:"Backlog",dot:"bg-zinc-400"},{value:"todo",label:"To Do",dot:"bg-blue-400"},{value:"in-progress",label:"In Progress",dot:"bg-amber-400"},{value:"review",label:"Review",dot:"bg-purple-400"},{value:"done",label:"Done",dot:"bg-emerald-400"}];function Ko({isOpen:t,settings:e,workspace:s,onClose:n,onSave:o,onSetLabel:i,onRenameLabel:l,onDeleteLabel:a}){return t?r.jsx(Ho,{settings:e,workspace:s,onClose:n,onSave:o,onSetLabel:i,onRenameLabel:l,onDeleteLabel:a}):null}function qo({checked:t,onChange:e}){return r.jsx("button",{type:"button",onClick:()=>e(!t),className:Q("relative inline-flex h-5 w-9 items-center rounded-full transition-colors shrink-0"),style:{background:t?"var(--vscode-button-background)":"var(--vscode-badge-background, #6b7280)"},children:r.jsx("span",{className:"inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",style:{transform:t?"translateX(18px)":"translateX(3px)"}})})}function Ke({title:t,children:e}){return r.jsxs("div",{className:"py-3",children:[r.jsx("h3",{className:"px-4 pb-2 text-xs font-semibold uppercase tracking-wider",style:{color:"var(--vscode-descriptionForeground)"},children:t}),r.jsx("div",{children:e})]})}function ge({label:t,description:e,checked:s,onChange:n}){return r.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 transition-colors cursor-pointer",onClick:()=>n(!s),onMouseEnter:o=>o.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:o=>o.currentTarget.style.background="transparent",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:t}),e&&r.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--vscode-descriptionForeground)"},children:e})]}),r.jsx(qo,{checked:s,onChange:n})]})}function qe({label:t,value:e}){return r.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-1.5",children:[r.jsx("div",{className:"text-sm",style:{color:"var(--vscode-descriptionForeground)"},children:t}),r.jsx("div",{className:"text-xs font-mono truncate max-w-[60%] text-right",style:{color:"var(--vscode-foreground)",opacity:.7},title:e,children:e})]})}function Qt({label:t,value:e,options:s,onChange:n}){const[o,i]=f.useState(!1),l=s.find(a=>a.value===e);return r.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 transition-colors",onMouseEnter:a=>a.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:a=>a.currentTarget.style.background="transparent",children:[r.jsx("div",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:t}),r.jsxs("div",{className:"relative",children:[r.jsxs("button",{type:"button",onClick:()=>i(!o),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)"},children:[(l==null?void 0:l.dot)&&r.jsx("span",{className:Q("w-2 h-2 rounded-full shrink-0",l.dot)}),r.jsx("span",{children:l==null?void 0:l.label}),r.jsx(me,{size:12,style:{color:"var(--vscode-descriptionForeground)"}})]}),o&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>i(!1)}),r.jsx("div",{className:"absolute top-full right-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[140px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:s.map(a=>r.jsxs("button",{type:"button",onClick:()=>{n(a.value),i(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:a.value===e?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:u=>{a.value!==e&&(u.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:u=>{a.value!==e&&(u.currentTarget.style.background="transparent")},children:[a.dot&&r.jsx("span",{className:Q("w-2 h-2 rounded-full shrink-0",a.dot)}),r.jsx("span",{className:"flex-1 text-left",children:a.label})]},a.value))})]})]})]})}function Yt({value:t,onChange:e}){const[s,n]=f.useState(!1),[o,i]=f.useState("");return r.jsxs("div",{className:"relative",children:[r.jsx("button",{type:"button",onClick:()=>n(!s),className:"w-5 h-5 rounded-full border border-white/20 cursor-pointer shrink-0",style:{backgroundColor:t}}),s&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>n(!1)}),r.jsxs("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg p-2 min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:[r.jsx("div",{className:"grid grid-cols-6 gap-1.5 mb-2",children:ht.map(l=>r.jsx("button",{type:"button",onClick:()=>{e(l.hex),n(!1)},className:"w-6 h-6 rounded-full border-2 transition-transform hover:scale-110",style:{backgroundColor:l.hex,borderColor:t===l.hex?"white":"transparent"},title:l.name},l.name))}),r.jsxs("div",{className:"flex gap-1",children:[r.jsx("input",{type:"text",placeholder:"#hex",value:o,onChange:l=>i(l.target.value),className:"flex-1 px-2 py-1 text-xs rounded",style:{background:"var(--vscode-input-background)",color:"var(--vscode-input-foreground)",border:"1px solid var(--vscode-input-border, transparent)"}}),r.jsx("button",{type:"button",onClick:()=>{/^#[0-9a-fA-F]{6}$/.test(o)&&(e(o),n(!1),i(""))},className:"px-2 py-1 text-xs rounded",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},children:"OK"})]})]})]})]})}function Uo({onSetLabel:t,onRenameLabel:e,onDeleteLabel:s}){const n=q(v=>v.labelDefs),o=q(v=>v.features),[i,l]=f.useState(""),[a,u]=f.useState(ht[0].hex),[c,d]=f.useState(""),[g,x]=f.useState(null),[p,h]=f.useState(""),[m,y]=f.useState(null),k=f.useMemo(()=>{const v=new Map;for(const[S,E]of Object.entries(n))v.set(S,E);for(const S of o)for(const E of S.labels)v.has(E)||v.set(E,void 0);return v},[n,o]),N=f.useMemo(()=>{const v={};return k.forEach((E,z)=>{const A=(E==null?void 0:E.group)||"Other";v[A]||(v[A]=[]),v[A].push({name:z,def:E})}),Object.entries(v).sort(([E],[z])=>E==="Other"?1:z==="Other"?-1:E.localeCompare(z))},[k]),M=f.useMemo(()=>{const v=new Set;return Object.values(n).forEach(S=>{S.group&&v.add(S.group)}),Array.from(v).sort()},[n]),w=v=>o.filter(S=>S.labels.includes(v)).length,C=()=>{const v=i.trim();v&&(t==null||t(v,{color:a,group:c||void 0}),l(""),u(ht[0].hex),d(""))},b=v=>{const S=p.trim();S&&S!==v&&(e==null||e(v,S)),x(null),h("")},L=v=>{s==null||s(v),y(null)},F={background:"var(--vscode-input-background)",color:"var(--vscode-input-foreground)",border:"1px solid var(--vscode-input-border, transparent)"};return r.jsxs("div",{className:"px-4 space-y-3",children:[N.map(([v,S])=>r.jsxs("div",{children:[r.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1.5",style:{color:"var(--vscode-descriptionForeground)"},children:v}),r.jsx("div",{className:"space-y-1",children:S.map(({name:E,def:z})=>r.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded group/label transition-colors",onMouseEnter:A=>A.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:A=>A.currentTarget.style.background="transparent",children:[r.jsx(Yt,{value:(z==null?void 0:z.color)||"#6b7280",onChange:A=>t==null?void 0:t(E,{...z,color:A,group:z==null?void 0:z.group})}),g===E?r.jsx("input",{type:"text",value:p,onChange:A=>h(A.target.value),onKeyDown:A=>{A.key==="Enter"&&b(E),A.key==="Escape"&&(x(null),h(""))},onBlur:()=>b(E),autoFocus:!0,className:"flex-1 px-1.5 py-0.5 text-xs rounded min-w-0",style:F}):r.jsx("span",{className:"flex-1 text-xs truncate",style:{color:"var(--vscode-foreground)"},children:E}),(z==null?void 0:z.group)&&g!==E&&r.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full shrink-0",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:z.group}),m===E?r.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[r.jsxs("span",{className:"text-[10px]",style:{color:"var(--vscode-errorForeground, #f44)"},children:[w(E)," card",w(E)!==1?"s":""]}),r.jsx("button",{type:"button",onClick:()=>L(E),className:"px-1.5 py-0.5 text-[10px] rounded",style:{background:"var(--vscode-inputValidation-errorBackground, #5a1d1d)",color:"var(--vscode-errorForeground, #f44)"},children:"Delete"}),r.jsx("button",{type:"button",onClick:()=>y(null),className:"px-1.5 py-0.5 text-[10px] rounded",style:{color:"var(--vscode-descriptionForeground)"},children:"Cancel"})]}):r.jsxs("div",{className:"flex items-center gap-0.5 shrink-0 opacity-0 group-hover/label:opacity-100 transition-opacity",children:[r.jsx("button",{type:"button",onClick:()=>{x(E),h(E)},className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:A=>A.currentTarget.style.color="var(--vscode-foreground)",onMouseLeave:A=>A.currentTarget.style.color="var(--vscode-descriptionForeground)",title:"Rename label",children:r.jsx(mt,{size:12})}),r.jsx("button",{type:"button",onClick:()=>y(E),className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:A=>A.currentTarget.style.color="var(--vscode-errorForeground, #f44)",onMouseLeave:A=>A.currentTarget.style.color="var(--vscode-descriptionForeground)",title:"Delete label",children:r.jsx(we,{size:12})})]})]},E))})]},v)),r.jsxs("div",{className:"rounded-lg p-2 space-y-2",style:{background:"var(--vscode-input-background)",border:"1px solid var(--vscode-input-border, transparent)"},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Yt,{value:a,onChange:u}),r.jsx("input",{type:"text",placeholder:"New label name...",value:i,onChange:v=>l(v.target.value),onKeyDown:v=>{v.key==="Enter"&&C()},className:"flex-1 px-1.5 py-1 text-xs rounded bg-transparent min-w-0",style:{color:"var(--vscode-input-foreground)",outline:"none"}})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("input",{type:"text",placeholder:"Group (optional)",value:c,onChange:v=>d(v.target.value),onKeyDown:v=>{v.key==="Enter"&&C()},list:"label-groups",className:"flex-1 px-1.5 py-1 text-xs rounded",style:F}),r.jsx("datalist",{id:"label-groups",children:M.map(v=>r.jsx("option",{value:v},v))}),r.jsxs("button",{type:"button",onClick:C,disabled:!i.trim(),className:"flex items-center gap-1 px-2 py-1 text-xs rounded transition-colors disabled:opacity-40",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},children:[r.jsx(je,{size:12}),"Add"]})]})]})]})}function Ho({settings:t,workspace:e,onClose:s,onSave:n,onSetLabel:o,onRenameLabel:i,onDeleteLabel:l}){const[a,u]=f.useState(t);f.useEffect(()=>{u(t)},[t]);const c=d=>{const g={...a,...d};u(g),n(g)};return f.useEffect(()=>{const d=g=>{g.key==="Escape"&&(g.stopPropagation(),s())};return document.addEventListener("keydown",d,!0),()=>document.removeEventListener("keydown",d,!0)},[s]),r.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end",children:[r.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:s}),r.jsxs("div",{className:"relative h-full w-1/2 max-w-lg shadow-xl flex flex-col animate-in slide-in-from-right duration-200",style:{background:"var(--vscode-editor-background)",borderLeft:"1px solid var(--vscode-panel-border)"},children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[r.jsx("h2",{className:"font-medium",style:{color:"var(--vscode-foreground)"},children:"Settings"}),r.jsx("button",{onClick:s,className:"p-1.5 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:d=>d.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:d=>d.currentTarget.style.background="transparent",children:r.jsx(oe,{size:18})})]}),r.jsxs("div",{className:"flex-1 overflow-auto",children:[e&&r.jsxs(r.Fragment,{children:[r.jsxs(Ke,{title:"Workspace",children:[r.jsx(qe,{label:"Project Path",value:e.projectPath}),r.jsx(qe,{label:"Features Directory",value:e.featuresDirectory}),r.jsx(qe,{label:"Server Port",value:String(e.port)}),r.jsx(qe,{label:"Config Version",value:String(e.configVersion)})]}),r.jsx("div",{style:{borderTop:"1px solid var(--vscode-panel-border)"}})]}),r.jsxs(Ke,{title:"Card Display",children:[r.jsx(ge,{label:"Show Priority Badges",description:"Display priority indicators on feature cards",checked:a.showPriorityBadges,onChange:d=>c({showPriorityBadges:d})}),r.jsx(ge,{label:"Show Assignee",description:"Display assigned person on feature cards",checked:a.showAssignee,onChange:d=>c({showAssignee:d})}),r.jsx(ge,{label:"Show Due Date",description:"Display due dates on feature cards",checked:a.showDueDate,onChange:d=>c({showDueDate:d})}),r.jsx(ge,{label:"Show Labels",description:"Display labels on feature cards and in editors",checked:a.showLabels,onChange:d=>c({showLabels:d})}),r.jsx(ge,{label:"Show Filename",description:"Display the source markdown filename on cards",checked:a.showFileName,onChange:d=>c({showFileName:d})}),r.jsx(ge,{label:"Compact Mode",description:"Use compact card layout to show more features",checked:a.compactMode,onChange:d=>c({compactMode:d})}),r.jsx(ge,{label:"Show Deleted Column",description:"Display the Deleted column to manage soft-deleted cards",checked:a.showDeletedColumn,onChange:d=>c({showDeletedColumn:d})})]}),r.jsx("div",{style:{borderTop:"1px solid var(--vscode-panel-border)"}}),r.jsxs(Ke,{title:"Defaults",children:[r.jsx(Qt,{label:"Default Priority",value:a.defaultPriority,options:Oo,onChange:d=>c({defaultPriority:d})}),r.jsx(Qt,{label:"Default Status",value:a.defaultStatus,options:_o,onChange:d=>c({defaultStatus:d})})]}),r.jsx("div",{style:{borderTop:"1px solid var(--vscode-panel-border)"}}),r.jsx(Ke,{title:"Labels",children:r.jsx(Uo,{onSetLabel:o,onRenameLabel:i,onDeleteLabel:l})})]}),r.jsx("div",{className:"px-4 py-2",style:{borderTop:"1px solid var(--vscode-panel-border)"},children:r.jsx("p",{className:"text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:"Settings are saved automatically and apply to all connected clients."})})]})]})}const Go=["#6b7280","#3b82f6","#f59e0b","#8b5cf6","#22c55e","#ef4444","#ec4899","#14b8a6","#f97316","#06b6d4"];function Wo({isOpen:t,onClose:e,onSave:s,initial:n,title:o}){const[i,l]=f.useState((n==null?void 0:n.name)??""),[a,u]=f.useState((n==null?void 0:n.color)??"#3b82f6"),c=f.useRef(null);return f.useEffect(()=>{t&&(l((n==null?void 0:n.name)??""),u((n==null?void 0:n.color)??"#3b82f6"),setTimeout(()=>{var d;return(d=c.current)==null?void 0:d.focus()},50))},[t,n]),f.useEffect(()=>{if(!t)return;const d=g=>{g.key==="Escape"&&e(),g.key==="Enter"&&(g.ctrlKey||g.metaKey)&&i.trim()&&s({name:i.trim(),color:a})};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[t,e,s,i,a]),t?r.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[r.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:e}),r.jsxs("div",{className:"relative bg-white dark:bg-zinc-800 rounded-lg shadow-xl w-full max-w-sm mx-4 border border-zinc-200 dark:border-zinc-600",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-200 dark:border-zinc-700",children:[r.jsx("h2",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:o}),r.jsx("button",{type:"button",onClick:e,className:"p-1 rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:r.jsx(oe,{size:16,className:"text-zinc-500"})})]}),r.jsxs("div",{className:"px-4 py-4 space-y-4",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-zinc-600 dark:text-zinc-400 mb-1",children:"Name"}),r.jsx("input",{ref:c,type:"text",value:i,onChange:d=>l(d.target.value),placeholder:"List name...",className:"w-full px-3 py-1.5 text-sm bg-white dark:bg-zinc-700 border border-zinc-200 dark:border-zinc-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-zinc-600 dark:text-zinc-400 mb-1",children:"Color"}),r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[Go.map(d=>r.jsx("button",{type:"button",onClick:()=>u(d),className:`w-6 h-6 rounded-full border-2 transition-all ${a===d?"border-zinc-900 dark:border-white scale-110":"border-transparent hover:scale-110"}`,style:{backgroundColor:d},title:d},d)),r.jsx("input",{type:"color",value:a,onChange:d=>u(d.target.value),className:"w-6 h-6 rounded cursor-pointer border-0 p-0 bg-transparent",title:"Custom color"})]})]})]}),r.jsxs("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-zinc-200 dark:border-zinc-700",children:[r.jsx("button",{type:"button",onClick:e,className:"px-3 py-1.5 text-sm rounded-md text-zinc-600 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:"Cancel"}),r.jsx("button",{type:"button",onClick:()=>{i.trim()&&s({name:i.trim(),color:a})},disabled:!i.trim(),className:"px-3 py-1.5 text-sm rounded-md bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Save"})]})]})]}):null}const O=acquireVsCodeApi();function Zo(){const{columns:t,workspace:e,cardSettings:s,settingsOpen:n,setFeatures:o,setColumns:i,setBoards:l,setCurrentBoard:a,setIsDarkMode:u,setWorkspace:c,setCardSettings:d,setSettingsOpen:g,setLabelDefs:x}=q(),[p,h]=f.useState(!1),[m,y]=f.useState("backlog"),[k,N]=f.useState(!1),[M,w]=f.useState(null),C=f.useRef(0),[b,L]=f.useState(null),[F,v]=f.useState([]),S=f.useRef(F);f.useEffect(()=>{S.current=F},[F]);const E=f.useRef(0),z=f.useCallback(j=>{const{features:T}=q.getState(),$=T.find(I=>I.id===j);if(!$)return;const G=$.status;o(T.map(I=>I.id===j?{...I,status:Dt}:I)),(b==null?void 0:b.id)===j&&L(null);const he=String(E.current++);v(I=>[...I,{id:he,feature:$,originalStatus:G}])},[b,o]),A=f.useCallback(j=>{const T=S.current.find($=>$.id===j);T&&(O.postMessage({type:"deleteFeature",featureId:T.feature.id}),v($=>$.filter(G=>G.id!==j)))},[]),W=f.useCallback(j=>{const T=S.current.find(G=>G.id===j);if(!T)return;const{features:$}=q.getState();o($.map(G=>G.id===T.feature.id?{...G,status:T.originalStatus}:G)),v(G=>G.filter(he=>he.id!==j))},[o]),ee=f.useCallback(()=>{const j=S.current;j.length!==0&&W(j[j.length-1].id)},[W]);f.useEffect(()=>{let j=!1,T=null;const $=I=>{if(I.key==="Alt"){j=!0,T&&clearTimeout(T),T=setTimeout(()=>{j=!1},1e3);return}if(I.altKey&&(j=!1,T&&(clearTimeout(T),T=null)),I.key==="z"&&(I.ctrlKey||I.metaKey)&&!I.shiftKey&&S.current.length>0){I.preventDefault(),ee();return}if(!(I.target instanceof HTMLInputElement||I.target instanceof HTMLTextAreaElement||I.target instanceof HTMLSelectElement||I.target instanceof HTMLElement&&I.target.isContentEditable))switch(I.key){case"n":if(I.ctrlKey||I.metaKey||I.altKey||I.shiftKey)return;I.preventDefault(),y("backlog"),h(!0);break;case"Escape":p&&h(!1);break}},G=I=>{I.key==="Alt"&&j&&(j=!1,T&&(clearTimeout(T),T=null),O.postMessage({type:"focusMenuBar"}))},he=()=>{j=!1};return window.addEventListener("keydown",$),window.addEventListener("keyup",G),window.addEventListener("mousedown",he),()=>{window.removeEventListener("keydown",$),window.removeEventListener("keyup",G),window.removeEventListener("mousedown",he),T&&clearTimeout(T)}},[p,ee]),f.useEffect(()=>{const j=()=>{const $=document.body.classList.contains("vscode-dark")||document.body.classList.contains("vscode-high-contrast");u($),$?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")};j();const T=new MutationObserver(j);return T.observe(document.body,{attributes:!0,attributeFilter:["class"]}),()=>T.disconnect()},[u]),f.useEffect(()=>{const j=T=>{const $=T.data;if(!(!$||typeof $.type!="string"))switch($.type){case"init":o($.features),i($.columns),$.boards&&l($.boards),$.currentBoard&&a($.currentBoard),$.workspace&&c($.workspace),$.settings&&($.settings.markdownEditorMode&&b&&L(null),d($.settings)),$.labels&&x($.labels);break;case"featuresUpdated":o($.features);break;case"triggerCreateDialog":y("backlog"),h(!0);break;case"labelsUpdated":x($.labels);break;case"showSettings":d($.settings),g(!0);break;case"featureContent":{const{cardSettings:G}=q.getState();if(G.markdownEditorMode)break;C.current+=1,L({id:$.featureId,content:$.content,frontmatter:$.frontmatter,comments:$.comments||[],contentVersion:C.current});break}}};return window.addEventListener("message",j),O.postMessage({type:"ready"}),()=>window.removeEventListener("message",j)},[o,i,l,a,c,d,g,x]);const X=j=>{O.postMessage({type:"openFeature",featureId:j.id})},Y=(j,T)=>{b&&O.postMessage({type:"saveFeatureContent",featureId:b.id,content:j,frontmatter:T})},B=(j,T)=>{b&&(O.postMessage({type:"transferCard",featureId:b.id,toBoard:j,targetStatus:T}),L(null))},H=()=>{L(null),O.postMessage({type:"closeFeature"})},se=()=>{b&&z(b.id)},Z=()=>{b&&(O.postMessage({type:"permanentDeleteFeature",featureId:b.id}),L(null))},ze=()=>{b&&(O.postMessage({type:"restoreFeature",featureId:b.id}),L(null))},Ce=()=>{O.postMessage({type:"purgeDeletedCards"})},et=()=>{b&&O.postMessage({type:"openFile",featureId:b.id})},tt=(j,T)=>{O.postMessage({type:"startWithAI",agent:j,permissionMode:T})},Ie=()=>{b&&O.postMessage({type:"addAttachment",featureId:b.id})},D=j=>{b&&O.postMessage({type:"openAttachment",featureId:b.id,attachment:j})},ce=j=>{b&&O.postMessage({type:"removeAttachment",featureId:b.id,attachment:j})},ae=(j,T)=>{b&&O.postMessage({type:"addComment",featureId:b.id,author:j,content:T})},Se=(j,T)=>{b&&O.postMessage({type:"updateComment",featureId:b.id,commentId:j,content:T})},Ir=j=>{b&&O.postMessage({type:"deleteComment",featureId:b.id,commentId:j})},Pr=j=>{O.postMessage({type:"saveSettings",settings:j})},Or=()=>{w(null),N(!0)},_r=j=>{const T=t.find($=>$.id===j);T&&(w(T),N(!0))},Kr=j=>{!t.find(G=>G.id===j)||q.getState().features.filter(G=>G.status===j).length>0||O.postMessage({type:"removeColumn",columnId:j})},qr=j=>{M?O.postMessage({type:"editColumn",columnId:M.id,updates:j}):O.postMessage({type:"addColumn",column:j}),N(!1),w(null)},Ur=j=>{y(j),h(!0)},Hr=j=>{O.postMessage({type:"createFeature",data:j})},Gr=f.useCallback(j=>{if(!b)return;const T=`action-${Date.now()}`;O.postMessage({type:"triggerAction",featureId:b.id,action:j,callbackKey:T})},[b]),Wr=(j,T,$)=>{const{features:G}=q.getState();if(G.find(I=>I.id===j)){const I=G.filter(le=>le.status===T&&le.id!==j).sort((le,Mt)=>le.order<Mt.order?-1:le.order>Mt.order?1:0),Pe=Math.max(0,Math.min($,I.length)),Zr=Pe>0?I[Pe-1].order:null,Vr=Pe<I.length?I[Pe].order:null,Qr=zs(Zr,Vr),Yr=G.map(le=>le.id===j?{...le,status:T,order:Qr}:le);o(Yr)}O.postMessage({type:"moveFeature",featureId:j,newStatus:T,newOrder:$})};return t.length===0?r.jsx("div",{className:"h-full w-full flex items-center justify-center bg-[var(--vscode-editor-background)]",children:r.jsx("div",{className:"text-[var(--vscode-foreground)] opacity-60",children:"Loading..."})}):r.jsxs("div",{className:"h-full w-full flex flex-col bg-[var(--vscode-editor-background)]",children:[r.jsx(Io,{onOpenSettings:()=>O.postMessage({type:"openSettings"}),onAddColumn:Or,onToggleTheme:()=>O.postMessage({type:"toggleTheme"}),onSwitchBoard:j=>O.postMessage({type:"switchBoard",boardId:j}),onCreateBoard:j=>O.postMessage({type:"createBoard",name:j})}),r.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[r.jsx("div",{className:b?"w-1/2":"w-full",children:r.jsx(lo,{onFeatureClick:X,onAddFeature:Ur,onMoveFeature:Wr,onEditColumn:_r,onRemoveColumn:Kr,onPurgeDeletedCards:Ce,selectedFeatureId:b==null?void 0:b.id})}),b&&r.jsx("div",{className:"w-1/2",children:r.jsx(Ro,{featureId:b.id,content:b.content,frontmatter:b.frontmatter,comments:b.comments,contentVersion:b.contentVersion,onSave:Y,onClose:H,onDelete:se,onPermanentDelete:Z,onRestore:ze,onOpenFile:et,onStartWithAI:tt,onAddAttachment:Ie,onOpenAttachment:D,onRemoveAttachment:ce,onAddComment:ae,onUpdateComment:Se,onDeleteComment:Ir,onTransferToBoard:B,onTriggerAction:Gr})})]}),r.jsx(yo,{isOpen:p,onClose:()=>h(!1),onCreate:Hr,initialStatus:m}),r.jsx(Ko,{isOpen:n,settings:s,workspace:e,onClose:()=>g(!1),onSave:Pr,onSetLabel:(j,T)=>O.postMessage({type:"setLabel",name:j,definition:T}),onRenameLabel:(j,T)=>O.postMessage({type:"renameLabel",oldName:j,newName:T}),onDeleteLabel:j=>O.postMessage({type:"deleteLabel",name:j})}),r.jsx(Wo,{isOpen:k,onClose:()=>{N(!1),w(null)},onSave:qr,initial:M?{name:M.name,color:M.color}:void 0,title:M?"Edit List":"Add List"}),F.map((j,T)=>r.jsx(Po,{message:`Deleted "${Sr(j.feature.content)}"`,onUndo:()=>W(j.id),onExpire:()=>A(j.id),duration:5e3,index:T},j.id))]})}ur(document.getElementById("root")).render(r.jsx(f.StrictMode,{children:r.jsx(Zo,{})}));
85
+ ${b}`:""}`:b;s({status:a,priority:c,content:S,assignee:g.trim()||null,dueDate:d||null,labels:m,actions:k})},B=()=>{N(),t()},I=()=>{t()};return f.useEffect(()=>{const b=w=>{w.key==="Escape"&&I(),(w.metaKey||w.ctrlKey)&&w.key==="Enter"&&B(),(w.metaKey||w.ctrlKey)&&w.key==="s"&&(w.preventDefault(),B())};if(e)return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)}),r.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end",children:[r.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:I}),r.jsxs("div",{className:"relative h-full w-1/2 shadow-xl flex flex-col animate-in slide-in-from-right duration-200",style:{background:"var(--vscode-editor-background)",borderLeft:"1px solid var(--vscode-panel-border)"},children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[r.jsx("div",{className:"flex items-center gap-3",children:r.jsx("h2",{className:"font-medium",style:{color:"var(--vscode-foreground)"},children:"Create Feature"})}),r.jsx("button",{onClick:I,className:"p-1.5 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:b=>b.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:b=>b.currentTarget.style.background="transparent",children:r.jsx(ie,{size:18})})]}),r.jsxs("div",{className:"flex flex-col py-0.5",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[r.jsx(Me,{label:"Status",icon:r.jsx(xt,{size:13}),children:r.jsx(or,{value:a,options:ko.map(b=>({value:b.value,label:b.label,dot:b.dot})),onChange:b=>p(b)})}),o.showPriorityBadges&&r.jsx(Me,{label:"Priority",icon:r.jsx(mr,{size:13}),children:r.jsx(or,{value:c,options:vo.map(b=>({value:b.value,label:b.label,dot:b.dot})),onChange:b=>u(b)})}),o.showAssignee&&r.jsx(Me,{label:"Assignee",icon:r.jsx(br,{size:13}),children:r.jsx(yo,{value:g,onChange:h})}),o.showDueDate&&r.jsx(Me,{label:"Due date",icon:r.jsx(Nt,{size:13}),children:r.jsx(go,{value:d,onChange:x})}),o.showLabels&&r.jsx(Me,{label:"Labels",icon:r.jsx(St,{size:13}),children:r.jsx(wo,{labels:m,onChange:v})}),r.jsx(Me,{label:"Actions",icon:r.jsx(is,{size:13}),children:r.jsx(jo,{actions:k,onChange:z})})]}),r.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[r.jsx("textarea",{ref:D,value:i,onChange:b=>l(b.target.value),placeholder:"Feature title...",className:"w-full text-lg font-medium bg-transparent border-none outline-none resize-none mb-4",style:{color:"var(--vscode-foreground)"},rows:1,onInput:b=>{const w=b.target;w.style.height="auto",w.style.height=w.scrollHeight+"px"},onKeyDown:b=>{b.key==="Enter"&&!b.shiftKey&&b.preventDefault()}}),r.jsx(Hr,{value:E,onChange:y,placeholder:"Add a description..."})]}),r.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderTop:"1px solid var(--vscode-panel-border)",background:"var(--vscode-sideBar-background, var(--vscode-editor-background))"},children:[r.jsxs("p",{className:"text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:[r.jsx("kbd",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--vscode-keybindingLabel-background, var(--vscode-badge-background))",color:"var(--vscode-keybindingLabel-foreground, var(--vscode-foreground))",border:"1px solid var(--vscode-keybindingLabel-border, var(--vscode-panel-border))"},children:"Esc"})," ","cancel ·"," ",r.jsx("kbd",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--vscode-keybindingLabel-background, var(--vscode-badge-background))",color:"var(--vscode-keybindingLabel-foreground, var(--vscode-foreground))",border:"1px solid var(--vscode-keybindingLabel-border, var(--vscode-panel-border))"},children:"⌘S"})," ","save"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:I,className:"px-3 py-1.5 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)",background:"transparent",border:"1px solid var(--vscode-panel-border)"},onMouseEnter:b=>b.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:b=>b.currentTarget.style.background="transparent",children:"Cancel"}),r.jsx("button",{type:"button",onClick:B,className:"px-3 py-1.5 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-button-foreground)",background:"var(--vscode-button-background)"},onMouseEnter:b=>b.currentTarget.style.background="var(--vscode-button-hoverBackground)",onMouseLeave:b=>b.currentTarget.style.background="var(--vscode-button-background)",children:"Save"})]})]})]})]})}const Co={critical:"Critical",high:"High",medium:"Medium",low:"Low"},So=["critical","high","medium","low"],Do={critical:"bg-red-500",high:"bg-orange-500",medium:"bg-yellow-500",low:"bg-green-500"},Mo=[{agent:"claude",label:"Claude",color:"hover:bg-amber-100 dark:hover:bg-amber-900/30",activeColor:"bg-amber-700 text-white"},{agent:"codex",label:"Codex",color:"hover:bg-emerald-100 dark:hover:bg-emerald-900/30",activeColor:"bg-emerald-500 text-white"},{agent:"opencode",label:"OpenCode",color:"hover:bg-slate-100 dark:hover:bg-slate-700/30",activeColor:"bg-slate-500 text-white"}],To={claude:{bg:"bg-amber-700",hover:"hover:bg-amber-800",shadow:"shadow-sm",border:"border border-amber-800/50"},codex:{bg:"bg-emerald-600",hover:"hover:bg-emerald-700",shadow:"shadow-sm",border:"border border-emerald-700/50"},opencode:{bg:"bg-slate-600",hover:"hover:bg-slate-700",shadow:"shadow-sm",border:"border border-slate-700/50"}},Eo={claude:[{permissionMode:"default",label:"Default",description:"With confirmations"},{permissionMode:"plan",label:"Plan",description:"Creates a plan first"},{permissionMode:"acceptEdits",label:"Auto-edit",description:"Auto-accepts file edits"},{permissionMode:"bypassPermissions",label:"Full Auto",description:"Bypasses all prompts"}],codex:[{permissionMode:"default",label:"Suggest",description:"Suggests changes"},{permissionMode:"acceptEdits",label:"Auto-edit",description:"Auto-accepts edits"},{permissionMode:"bypassPermissions",label:"Full Auto",description:"Full automation"}],opencode:[{permissionMode:"default",label:"Default",description:"Standard mode"}]};function $o({value:e,options:t,onChange:s,className:n}){const[o,i]=f.useState(!1),l=t.find(a=>a.value===e);return r.jsxs("div",{className:J("relative",n),children:[r.jsxs("button",{onClick:()=>i(!o),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-foreground)"},children:[(l==null?void 0:l.dot)&&r.jsx("span",{className:J("w-2 h-2 rounded-full shrink-0",l.dot)}),r.jsx("span",{children:l==null?void 0:l.label}),r.jsx(me,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),o&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>i(!1)}),r.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[140px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:t.map(a=>r.jsxs("button",{onClick:()=>{s(a.value),i(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:a.value===e?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:p=>{a.value!==e&&(p.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:p=>{a.value!==e&&(p.currentTarget.style.background="transparent")},children:[a.dot&&r.jsx("span",{className:J("w-2 h-2 rounded-full shrink-0",a.dot)}),r.jsx("span",{className:"flex-1 text-left",children:a.label}),a.value===e&&r.jsx(fe,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},a.value))})]})]})}function Ao({value:e,onChange:t,onTransferToBoard:s}){const[n,o]=f.useState(!1),i=_(c=>c.columns),l=_(c=>c.boards),a=_(c=>c.currentBoard),p=l.filter(c=>c.id!==a);return r.jsxs("div",{className:"relative",children:[r.jsxs("button",{onClick:()=>o(!n),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-foreground)"},children:[(()=>{const c=i.find(u=>u.id===e);return c?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:c.color}}),r.jsx("span",{children:c.name})]}):r.jsx("span",{children:e})})(),r.jsx(me,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),n&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>o(!1)}),r.jsxs("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[180px] max-h-[320px] overflow-y-auto",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:[i.map(c=>r.jsxs("button",{onClick:()=>{t(c.id),o(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:c.id===e?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:u=>{c.id!==e&&(u.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:u=>{c.id!==e&&(u.currentTarget.style.background="transparent")},children:[r.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:c.color}}),r.jsx("span",{className:"flex-1 text-left",children:c.name}),c.id===e&&r.jsx(fe,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},c.id)),p.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mx-2 my-1",style:{borderTop:"1px solid var(--vscode-panel-border)"}}),r.jsx("div",{className:"px-3 py-1 text-[10px] font-medium uppercase tracking-wider",style:{color:"var(--vscode-descriptionForeground)"},children:"Move to..."}),p.map(c=>r.jsxs("div",{children:[r.jsx("div",{className:"px-3 py-1 text-[10px] font-semibold",style:{color:"var(--vscode-descriptionForeground)"},children:c.name}),(c.columns||[]).map(u=>r.jsxs("button",{onClick:()=>{s(c.id,u.id),o(!1)},className:"w-full flex items-center gap-2 pl-5 pr-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:g=>{g.currentTarget.style.background="var(--vscode-list-hoverBackground)"},onMouseLeave:g=>{g.currentTarget.style.background="transparent"},children:[r.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:u.color}}),r.jsx("span",{className:"flex-1 text-left",children:u.name})]},`${c.id}-${u.id}`))]},c.id))]})]})]})]})}function xe({label:e,icon:t,children:s}){return r.jsxs("div",{className:"flex items-center gap-3 px-4 py-[5px] transition-colors vscode-hover-bg",children:[r.jsxs("div",{className:"flex items-center gap-2 w-[90px] shrink-0",children:[r.jsx("span",{style:{color:"var(--vscode-descriptionForeground)"},children:t}),r.jsx("span",{className:"text-[11px]",style:{color:"var(--vscode-descriptionForeground)"},children:e})]}),r.jsx("div",{className:"flex-1 min-w-0",children:s})]})}function Lo({onSelect:e}){const[t,s]=f.useState(!1),[n,o]=f.useState("claude"),i=Eo[n],l=To[n];return r.jsxs("div",{className:"relative",children:[r.jsxs("button",{onClick:()=>s(!t),className:J("flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium text-white rounded-md transition-colors",l.bg,l.hover,l.shadow,l.border),children:[r.jsx(cs,{size:13}),r.jsx("span",{children:"Build with AI"}),r.jsx("kbd",{className:"ml-0.5 text-[9px] opacity-60 font-mono",children:"⌘B"}),r.jsx(me,{size:11,className:J("ml-0.5 opacity-60 transition-transform",t&&"rotate-180")})]}),t&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>s(!1)}),r.jsxs("div",{className:"absolute top-full right-0 mt-1 z-20 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-lg shadow-xl min-w-[260px] overflow-hidden",children:[r.jsx("div",{className:"flex",children:Mo.map(a=>r.jsx("button",{onClick:()=>o(a.agent),className:J("flex-1 px-3 py-2.5 text-xs font-medium transition-all",n===a.agent?a.activeColor:J("text-zinc-600 dark:text-zinc-400",a.color)),children:a.label},a.agent))}),r.jsx("div",{className:"p-2 space-y-1",children:i.map(a=>r.jsxs("button",{onClick:()=>{e(n,a.permissionMode),s(!1)},className:"w-full text-left px-3 py-2.5 rounded-md hover:bg-zinc-100 dark:hover:bg-zinc-700/50 transition-colors",children:[r.jsx("div",{className:"text-xs font-medium text-zinc-900 dark:text-zinc-100",children:a.label}),r.jsx("div",{className:"text-[10px] text-zinc-500 dark:text-zinc-400 mt-0.5",children:a.description})]},a.permissionMode))})]})]})]})}function Ro({actions:e,onTriggerAction:t}){const[s,n]=f.useState(!1);return r.jsxs("div",{className:"relative",children:[r.jsxs("button",{onClick:()=>n(!s),className:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium rounded-md transition-colors vscode-hover-bg",style:{color:"var(--vscode-foreground)",border:"1px solid var(--vscode-widget-border, var(--vscode-contrastBorder, rgba(128,128,128,0.35)))"},children:[r.jsx("span",{children:"Run Action"}),r.jsx(me,{size:11,className:J("opacity-60 transition-transform",s&&"rotate-180")})]}),s&&r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button","aria-label":"Close actions menu",className:"fixed inset-0 z-10 cursor-default",onClick:()=>n(!1)}),r.jsx("div",{className:"absolute top-full right-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[160px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:e.map(o=>r.jsx("button",{type:"button",onClick:()=>{n(!1),t(o)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:i=>{i.currentTarget.style.background="var(--vscode-list-hoverBackground)"},onMouseLeave:i=>{i.currentTarget.style.background="transparent"},children:o},o))})]})]})}function Fo({metadata:e}){const[t,s]=f.useState(!1);if(!e||Object.keys(e).length===0)return null;const n=Object.keys(e);return r.jsxs("div",{className:"mt-3",children:[r.jsxs("button",{onClick:()=>s(!t),className:"flex items-center gap-1.5 text-xs font-medium text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-300",children:[r.jsx("span",{className:"text-[10px]",children:t?"▼":"▶"}),r.jsx("span",{children:"Metadata"}),r.jsxs("span",{className:"text-zinc-400 dark:text-zinc-500",children:["(",n.length,")"]})]}),!t&&r.jsx("div",{className:"flex flex-wrap gap-1 mt-1.5",children:n.map(o=>r.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-zinc-100 text-zinc-600 dark:bg-zinc-700 dark:text-zinc-300 font-mono",children:o},o))}),t&&r.jsx("div",{className:"mt-1.5 text-xs font-mono bg-zinc-50 dark:bg-zinc-900 rounded p-2 border border-zinc-200 dark:border-zinc-700",children:r.jsx(Gr,{data:e,depth:0})})]})}function Gr({data:e,depth:t}){return r.jsx("div",{style:{paddingLeft:t>0?12:0},children:Object.entries(e).map(([s,n])=>r.jsx("div",{className:"py-0.5",children:n&&typeof n=="object"&&!Array.isArray(n)?r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"text-zinc-500 dark:text-zinc-400",children:[s,":"]}),r.jsx(Gr,{data:n,depth:t+1})]}):Array.isArray(n)?r.jsxs("div",{children:[r.jsxs("span",{className:"text-zinc-500 dark:text-zinc-400",children:[s,": "]}),r.jsxs("span",{className:"text-zinc-700 dark:text-zinc-300",children:["[",n.join(", "),"]"]})]}):r.jsxs("div",{children:[r.jsxs("span",{className:"text-zinc-500 dark:text-zinc-400",children:[s,": "]}),r.jsx("span",{className:"text-zinc-700 dark:text-zinc-300",children:String(n)})]})},s))})}function Bo({labels:e,onChange:t}){const[s,n]=f.useState(""),[o,i]=f.useState(!1),l=f.useRef(null),a=_(x=>x.features),p=_(x=>x.labelDefs),c=f.useMemo(()=>{const x=new Set;return a.forEach(m=>m.labels.forEach(v=>x.add(v))),Array.from(x).sort()},[a]),u=f.useMemo(()=>{const x=c.filter(m=>!e.includes(m));return s.trim()?x.filter(m=>m.toLowerCase().includes(s.toLowerCase())):x},[s,c,e]),g=o&&u.length>0,h=x=>{const m=(x||s).trim();m&&!e.includes(m)&&t([...e,m]),n("")},d=x=>{t(e.filter(m=>m!==x))};return r.jsxs("div",{className:"relative flex items-center gap-1.5 flex-wrap",children:[e.map(x=>{const m=p[x];return r.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:m?{backgroundColor:`${m.color}20`,color:m.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[x,r.jsx("button",{type:"button",onClick:()=>d(x),className:"hover:text-red-500 transition-colors",children:r.jsx(ie,{size:9})})]},x)}),r.jsx("button",{onClick:()=>{i(!0),setTimeout(()=>{var x;return(x=l.current)==null?void 0:x.focus()},0)},className:"inline-flex items-center gap-0.5 px-1 py-0.5 text-[10px] rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},children:r.jsx($e,{size:10})}),r.jsx("input",{ref:l,type:"text",value:s,onChange:x=>n(x.target.value),onFocus:()=>i(!0),onBlur:()=>setTimeout(()=>i(!1),150),onKeyDown:x=>{var m;x.key==="Enter"&&(x.preventDefault(),h()),x.key==="Backspace"&&!s&&e.length>0&&t(e.slice(0,-1)),x.key==="Escape"&&(n(""),(m=l.current)==null||m.blur())},placeholder:e.length===0?"Add labels...":"",className:"flex-1 min-w-[60px] bg-transparent border-none outline-none text-xs",style:{color:"var(--vscode-foreground)",display:o||s?"block":"none"}}),g&&r.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 max-h-[160px] overflow-auto min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:u.map(x=>{const m=p[x];return r.jsx("button",{type:"button",onMouseDown:v=>{v.preventDefault(),h(x)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:v=>v.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:v=>v.currentTarget.style.background="transparent",children:r.jsx("span",{className:"inline-block px-1.5 py-0.5 text-[10px] font-medium rounded",style:m?{backgroundColor:`${m.color}20`,color:m.color}:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:x})},x)})})]})}function Io({featureId:e,content:t,frontmatter:s,comments:n,contentVersion:o,onSave:i,onClose:l,onDelete:a,onPermanentDelete:p,onRestore:c,onOpenFile:u,onStartWithAI:g,onAddAttachment:h,onOpenAttachment:d,onRemoveAttachment:x,onAddComment:m,onUpdateComment:v,onDeleteComment:k,onTransferToBoard:z,onTriggerAction:E}){const{cardSettings:y}=_(),[D,N]=f.useState(s),[B,I]=f.useState(t),[b,w]=f.useState(!1),S=D.status===It,C=f.useRef(null),$=f.useRef(D),G=f.useRef(B);$.current=D,G.current=B;const W=f.useCallback(()=>{i(G.current,$.current)},[i]);f.useEffect(()=>()=>{C.current&&clearTimeout(C.current)},[]),f.useEffect(()=>{I(t)},[e,o]),f.useEffect(()=>{N(s)},[s]);const Q=f.useCallback(L=>{I(L),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{i(L,$.current)},800)},[i]),U=f.useCallback(L=>{N(H=>{const ne={...H,...L};return C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{i(G.current,ne)},800),ne})},[i]);return f.useEffect(()=>{const L=H=>{(H.metaKey||H.ctrlKey)&&H.key==="s"&&(H.preventDefault(),C.current&&clearTimeout(C.current),W()),(H.metaKey||H.ctrlKey)&&H.key==="b"&&y.showBuildWithAI&&(H.preventDefault(),g("claude","default")),H.key==="Escape"&&(C.current&&(clearTimeout(C.current),W()),l())};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[W,l,g,y.showBuildWithAI]),r.jsxs("div",{className:"h-full flex flex-col",style:{background:"var(--vscode-editor-background)",borderLeft:"1px solid var(--vscode-panel-border)"},children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"text-xs font-mono",style:{color:"var(--vscode-descriptionForeground)"},children:e}),S?b?r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"text-xs",style:{color:"var(--vscode-errorForeground)"},children:"Permanently delete from disk?"}),r.jsx("button",{onClick:()=>{w(!1),p()},className:"px-2 py-1 text-xs font-medium rounded transition-colors text-white bg-red-600 hover:bg-red-700",children:"Yes"}),r.jsx("button",{onClick:()=>w(!1),className:"px-2 py-1 text-xs font-medium rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-foreground)"},children:"No"})]}):r.jsxs(r.Fragment,{children:[r.jsxs("button",{onClick:c,className:"p-1.5 px-2 rounded border transition-colors vscode-hover-bg flex items-center gap-1",style:{color:"var(--vscode-descriptionForeground)",borderColor:"var(--vscode-widget-border, var(--vscode-contrastBorder, rgba(128,128,128,0.35)))"},title:"Restore card",children:[r.jsx(xt,{size:16}),r.jsx("span",{className:"text-xs",children:"RESTORE"})]}),r.jsxs("button",{onClick:()=>w(!0),className:"p-1.5 px-2 rounded border transition-colors vscode-hover-bg flex items-center gap-1",style:{color:"var(--vscode-errorForeground)",borderColor:"var(--vscode-widget-border, var(--vscode-contrastBorder, rgba(128,128,128,0.35)))"},title:"Permanently delete from disk",children:[r.jsx(Ce,{size:16}),r.jsx("span",{className:"text-xs",children:"PERMANENT DELETE"})]})]}):r.jsxs(r.Fragment,{children:[r.jsxs("button",{onClick:()=>{u(),l()},className:"p-1.5 px-2 rounded border transition-colors vscode-hover-bg flex items-center gap-1",style:{color:"var(--vscode-descriptionForeground)",borderColor:"var(--vscode-widget-border, var(--vscode-contrastBorder, rgba(128,128,128,0.35)))"},title:"Open .md file",children:[r.jsx(cr,{size:16}),r.jsx("span",{className:"text-xs",children:"OPEN"})]}),r.jsxs("button",{onClick:a,className:"p-1.5 px-2 rounded border transition-colors vscode-hover-bg flex items-center gap-1",style:{color:"var(--vscode-descriptionForeground)",borderColor:"var(--vscode-widget-border, var(--vscode-contrastBorder, rgba(128,128,128,0.35)))"},title:"Move to deleted",children:[r.jsx(Ce,{size:16}),r.jsx("span",{className:"text-xs",children:"DELETE"})]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[D.actions&&D.actions.length>0&&E&&r.jsx(Ro,{actions:D.actions,onTriggerAction:E}),y.showBuildWithAI&&r.jsx(Lo,{onSelect:g}),r.jsx("button",{onClick:l,className:"p-1.5 rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},children:r.jsx(ie,{size:18})})]})]}),r.jsxs("div",{className:"flex flex-col py-0.5",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[r.jsx(xe,{label:"Status",icon:r.jsx(xt,{size:13}),children:r.jsx(Ao,{value:D.status,onChange:L=>U({status:L}),onTransferToBoard:z})}),y.showPriorityBadges&&r.jsx(xe,{label:"Priority",icon:r.jsx(mr,{size:13}),children:r.jsx($o,{value:D.priority,options:So.map(L=>({value:L,label:Co[L],dot:Do[L]})),onChange:L=>U({priority:L})})}),y.showAssignee&&r.jsx(xe,{label:"Assignee",icon:r.jsx(br,{size:13}),children:r.jsxs("div",{className:"flex items-center gap-2",children:[D.assignee&&r.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:D.assignee.split(/\s+/).filter(Boolean).map(L=>L[0]).join("").toUpperCase().slice(0,2)}),r.jsx("input",{type:"text",value:D.assignee||"",onChange:L=>U({assignee:L.target.value||null}),placeholder:"No assignee",className:"bg-transparent border-none outline-none text-xs w-32",style:{color:D.assignee?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})]})}),y.showDueDate&&r.jsx(xe,{label:"Due date",icon:r.jsx(Nt,{size:13}),children:r.jsx("input",{type:"date",value:D.dueDate||"",onChange:L=>U({dueDate:L.target.value||null}),className:"bg-transparent border-none outline-none text-xs",style:{color:D.dueDate?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})}),y.showLabels&&r.jsx(xe,{label:"Labels",icon:r.jsx(St,{size:13}),children:r.jsx(Bo,{labels:D.labels,onChange:L=>U({labels:L})})}),r.jsx(xe,{label:"Attachments",icon:r.jsx(ht,{size:13}),children:r.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[D.attachments.map(L=>r.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[r.jsxs("button",{type:"button",onClick:()=>d(L),className:"inline-flex items-center gap-1 hover:underline",title:L,children:[r.jsx(ht,{size:9}),L]}),r.jsx("button",{type:"button",onClick:()=>x(L),className:"hover:text-red-500 transition-colors",children:r.jsx(ie,{size:9})})]},L)),r.jsx("button",{type:"button",onClick:h,className:"inline-flex items-center gap-0.5 px-1 py-0.5 text-[10px] rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},children:r.jsx($e,{size:10})})]})}),r.jsx(xe,{label:"Created",icon:r.jsx(gt,{size:13}),children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-xs",style:{color:"var(--vscode-foreground)"},children:nt(D.created)}),r.jsx("span",{className:"text-[10px]",style:{color:"var(--vscode-descriptionForeground)"},title:ot(D.created),children:zt(D.created)})]})}),r.jsx(xe,{label:"Modified",icon:r.jsx(gt,{size:13}),children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-xs",style:{color:"var(--vscode-foreground)"},children:nt(D.modified)}),r.jsx("span",{className:"text-[10px]",style:{color:"var(--vscode-descriptionForeground)"},title:ot(D.modified),children:zt(D.modified)})]})}),r.jsx("div",{className:"px-4 pb-2",children:r.jsx(Fo,{metadata:D.metadata})})]}),r.jsx(Hr,{value:B,onChange:Q,placeholder:"Start writing...",className:"flex-1 min-h-0",mode:"edit",comments:n,onAddComment:m,onUpdateComment:v,onDeleteComment:k})]})}const Po=[{value:"all",label:"All Priorities"},{value:"critical",label:"Critical"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}],Oo=[{value:"all",label:"All Dates"},{value:"overdue",label:"Overdue"},{value:"today",label:"Due Today"},{value:"this-week",label:"Due This Week"},{value:"no-date",label:"No Due Date"}],pt="text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100";function _o({onOpenSettings:e,onAddColumn:t,onToggleTheme:s,onSwitchBoard:n,onCreateBoard:o}){var Ve;const{searchQuery:i,setSearchQuery:l,priorityFilter:a,setPriorityFilter:p,assigneeFilter:c,setAssigneeFilter:u,labelFilter:g,setLabelFilter:h,dueDateFilter:d,setDueDateFilter:x,clearAllFilters:m,getUniqueAssignees:v,getUniqueLabels:k,hasActiveFilters:z,layout:E,toggleLayout:y,isDarkMode:D,cardSettings:N,boards:B,currentBoard:I}=_(),b=_(M=>M.labelDefs),w=v(),S=k(),C=z(),$=f.useMemo(()=>{const M={};return S.forEach(re=>{const te=b[re],se=(te==null?void 0:te.group)||"Other";M[se]||(M[se]=[]),M[se].push(re)}),M},[S,b]),[G,W]=f.useState(!1),[Q,U]=f.useState(!1),[L,H]=f.useState(""),ne=f.useRef(null),X=f.useRef(null),[be,Ge]=f.useState(!1),[ve,We]=f.useState(""),Le=f.useRef(null),Re=f.useMemo(()=>{if(!ve)return $;const M=ve.toLowerCase(),re={};return Object.entries($).forEach(([te,se])=>{const ue=se.filter(Fe=>Fe.toLowerCase().includes(M));ue.length>0&&(re[te]=ue)}),re},[$,ve]);f.useEffect(()=>{const M=re=>{ne.current&&!ne.current.contains(re.target)&&(W(!1),U(!1),H(""))};return G&&document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[G]),f.useEffect(()=>{const M=re=>{Le.current&&!Le.current.contains(re.target)&&(Ge(!1),We(""))};return be&&document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[be]),f.useEffect(()=>{Q&&X.current&&X.current.focus()},[Q]);const ct=((Ve=B.find(M=>M.id===I))==null?void 0:Ve.name)||I,dt=()=>{const M=L.trim();M&&(o(M),H(""),U(!1),W(!1))};return r.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900/50 flex-wrap",children:[r.jsxs("div",{className:"relative",ref:ne,children:[r.jsxs("button",{type:"button",onClick:()=>W(!G),className:"flex items-center gap-1.5 px-2 py-1.5 text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md hover:bg-zinc-50 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[r.jsx("span",{className:"max-w-[120px] truncate",children:ct}),r.jsx(me,{size:14,className:`text-zinc-400 transition-transform ${G?"rotate-180":""}`})]}),G&&r.jsxs("div",{className:"absolute top-full left-0 mt-1 min-w-[180px] bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg z-50 py-1",children:[B.map(M=>r.jsxs("button",{type:"button",onClick:()=>{n(M.id),W(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[r.jsx(fe,{size:14,className:M.id===I?"text-blue-500":"invisible"}),r.jsx("span",{className:"truncate",children:M.name})]},M.id)),r.jsx("div",{className:"border-t border-zinc-200 dark:border-zinc-600 my-1"}),Q?r.jsx("div",{className:"px-3 py-1.5",children:r.jsx("input",{ref:X,type:"text",value:L,onChange:M=>H(M.target.value),onKeyDown:M=>{M.key==="Enter"&&dt(),M.key==="Escape"&&(U(!1),H(""))},placeholder:"Board name...",className:"w-full px-2 py-1 text-sm bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})}):r.jsxs("button",{type:"button",onClick:()=>U(!0),className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-blue-600 dark:text-blue-400 transition-colors",children:[r.jsx($e,{size:14}),r.jsx("span",{children:"New Board"})]})]})]}),r.jsxs("div",{className:"relative flex-1 min-w-[180px] max-w-xs",children:[r.jsx(ds,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-zinc-400"}),r.jsx("input",{type:"text",value:i,onChange:M=>l(M.target.value),placeholder:"Search... (meta.field: value)",className:"w-full pl-8 pr-3 py-1.5 text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})]}),N.showPriorityBadges&&r.jsx("select",{value:a,onChange:M=>p(M.target.value),className:pt,children:Po.map(M=>r.jsx("option",{value:M.value,children:M.label},M.value))}),N.showAssignee&&r.jsxs("select",{value:c,onChange:M=>u(M.target.value),className:pt,children:[r.jsx("option",{value:"all",children:"All Assignees"}),r.jsx("option",{value:"unassigned",children:"Unassigned"}),w.map(M=>r.jsx("option",{value:M,children:M},M))]}),N.showLabels&&r.jsxs("div",{className:"relative",ref:Le,children:[r.jsxs("button",{type:"button",onClick:()=>Ge(!be),className:`flex items-center gap-1.5 text-sm bg-white dark:bg-zinc-800 border rounded-md px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 transition-colors ${g.length>0?"border-blue-500 dark:border-blue-400":"border-zinc-200 dark:border-zinc-600"}`,children:[r.jsx(St,{size:14,className:"text-zinc-400 shrink-0"}),r.jsx("span",{className:"max-w-[100px] truncate",children:g.length===0?"All Labels":g.length===1?g[0]:`${g.length} Labels`}),r.jsx(me,{size:14,className:`text-zinc-400 transition-transform ${be?"rotate-180":""}`})]}),be&&r.jsxs("div",{className:"absolute top-full left-0 mt-1 min-w-[200px] max-h-72 overflow-y-auto bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg z-50 py-1",children:[r.jsx("div",{className:"px-2 pb-1",children:r.jsx("input",{type:"text",value:ve,onChange:M=>We(M.target.value),placeholder:"Filter labels...",autoFocus:!0,className:"w-full px-2 py-1 text-sm bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})}),!ve&&r.jsxs("button",{type:"button",onClick:()=>h([]),className:`w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors ${g.length===0?"text-blue-600 dark:text-blue-400 font-medium":"text-zinc-900 dark:text-zinc-100"}`,children:[r.jsx("div",{className:`w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0 ${g.length===0?"border-blue-500 bg-blue-500":"border-zinc-300 dark:border-zinc-500"}`,children:g.length===0&&r.jsx(fe,{size:10,className:"text-white"})}),r.jsx("span",{children:"All Labels"})]}),Object.entries(Re).map(([M,re])=>r.jsxs("div",{children:[Object.keys(Re).length>1&&r.jsx("div",{className:"px-3 pt-1.5 pb-0.5 text-xs font-semibold text-zinc-400 dark:text-zinc-500 uppercase tracking-wide",children:M}),re.map(te=>{const se=b[te],ue=g.includes(te);return r.jsxs("button",{type:"button",onClick:()=>{h(ue?g.filter(Fe=>Fe!==te):[...g,te])},className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[r.jsx("div",{className:`w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0 ${ue?"border-blue-500 bg-blue-500":"border-zinc-300 dark:border-zinc-500"}`,children:ue&&r.jsx(fe,{size:10,className:"text-white"})}),(se==null?void 0:se.color)&&r.jsx("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{backgroundColor:se.color}}),r.jsx("span",{className:"truncate",children:te})]},te)})]},M)),Object.keys(Re).length===0&&r.jsx("div",{className:"px-3 py-2 text-sm text-zinc-400 dark:text-zinc-500",children:"No labels found"})]})]}),N.showDueDate&&r.jsx("select",{value:d,onChange:M=>x(M.target.value),className:pt,children:Oo.map(M=>r.jsx("option",{value:M.value,children:M.label},M.value))}),C&&r.jsxs("button",{onClick:m,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Clear all filters",children:[r.jsx(ie,{size:14}),r.jsx("span",{children:"Clear"})]}),r.jsxs("button",{onClick:t,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Add new list",children:[r.jsx($e,{size:16}),r.jsx("span",{children:"Add List"})]}),r.jsx("button",{onClick:y,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:E==="horizontal"?"Switch to vertical layout":"Switch to horizontal layout",children:E==="horizontal"?r.jsx(us,{size:16}):r.jsx(ps,{size:16})}),r.jsx("button",{onClick:s,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:D?"Switch to light theme":"Switch to dark theme",children:D?r.jsx(hs,{size:16}):r.jsx(gs,{size:16})}),r.jsx("button",{onClick:e,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Open settings",children:r.jsx(xs,{size:16})}),r.jsxs("div",{className:"ml-auto text-xs text-zinc-400",children:["Press ",r.jsx("kbd",{className:"px-1.5 py-0.5 bg-zinc-200 dark:bg-zinc-700 rounded",children:"n"})," to add"]})]})}function Ko({message:e,onUndo:t,onExpire:s,duration:n,index:o}){const[i,l]=f.useState(100);return f.useEffect(()=>{const p=50/n*100,c=setInterval(()=>{l(u=>{const g=u-p;return g<=0?(clearInterval(c),0):g})},50);return()=>clearInterval(c)},[n]),f.useEffect(()=>{i<=0&&s()},[i,s]),r.jsxs("div",{className:"fixed right-4 z-50 flex flex-col min-w-[320px] max-w-[420px] shadow-[0_4px_16px_rgba(0,0,0,0.4)] transition-[bottom] duration-200 ease-out",style:{bottom:`${24+o*52}px`,background:"var(--vscode-notifications-background)",color:"var(--vscode-notifications-foreground)",border:"1px solid var(--vscode-notifications-border, var(--vscode-widget-border))"},children:[r.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[r.jsx("span",{className:"text-[13px] leading-snug flex-1 truncate",children:e}),r.jsx("button",{onClick:t,className:"text-[13px] px-2 py-0.5 shrink-0",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},onMouseEnter:a=>a.currentTarget.style.background="var(--vscode-button-hoverBackground)",onMouseLeave:a=>a.currentTarget.style.background="var(--vscode-button-background)",children:"Undo"})]}),r.jsx("div",{className:"h-[2px] w-full",style:{background:"var(--vscode-widget-border)"},children:r.jsx("div",{className:"h-full transition-none",style:{width:`${i}%`,background:"var(--vscode-progressBar-background)"}})})]})}const Zo=[{value:"critical",label:"Critical",dot:"bg-red-500"},{value:"high",label:"High",dot:"bg-orange-500"},{value:"medium",label:"Medium",dot:"bg-yellow-500"},{value:"low",label:"Low",dot:"bg-green-500"}],qo=[{value:"backlog",label:"Backlog",dot:"bg-zinc-400"},{value:"todo",label:"To Do",dot:"bg-blue-400"},{value:"in-progress",label:"In Progress",dot:"bg-amber-400"},{value:"review",label:"Review",dot:"bg-purple-400"},{value:"done",label:"Done",dot:"bg-emerald-400"}];function Uo({isOpen:e,settings:t,workspace:s,onClose:n,onSave:o,onSetLabel:i,onRenameLabel:l,onDeleteLabel:a}){return e?r.jsx(Wo,{settings:t,workspace:s,onClose:n,onSave:o,onSetLabel:i,onRenameLabel:l,onDeleteLabel:a}):null}function Ho({checked:e,onChange:t}){return r.jsx("button",{type:"button",onClick:()=>t(!e),className:J("relative inline-flex h-5 w-9 items-center rounded-full transition-colors shrink-0"),style:{background:e?"var(--vscode-button-background)":"var(--vscode-badge-background, #6b7280)"},children:r.jsx("span",{className:"inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",style:{transform:e?"translateX(18px)":"translateX(3px)"}})})}function Ke({title:e,children:t}){return r.jsxs("div",{className:"py-3",children:[r.jsx("h3",{className:"px-4 pb-2 text-xs font-semibold uppercase tracking-wider",style:{color:"var(--vscode-descriptionForeground)"},children:e}),r.jsx("div",{children:t})]})}function ze({label:e,description:t,checked:s,onChange:n}){return r.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 transition-colors cursor-pointer",onClick:()=>n(!s),onMouseEnter:o=>o.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:o=>o.currentTarget.style.background="transparent",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:e}),t&&r.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--vscode-descriptionForeground)"},children:t})]}),r.jsx(Ho,{checked:s,onChange:n})]})}function Je({label:e,value:t}){return r.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-1.5",children:[r.jsx("div",{className:"text-sm",style:{color:"var(--vscode-descriptionForeground)"},children:e}),r.jsx("div",{className:"text-xs font-mono truncate max-w-[60%] text-right",style:{color:"var(--vscode-foreground)",opacity:.7},title:t,children:t})]})}function ar({label:e,value:t,options:s,onChange:n}){const[o,i]=f.useState(!1),l=s.find(a=>a.value===t);return r.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 transition-colors",onMouseEnter:a=>a.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:a=>a.currentTarget.style.background="transparent",children:[r.jsx("div",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:e}),r.jsxs("div",{className:"relative",children:[r.jsxs("button",{type:"button",onClick:()=>i(!o),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)"},children:[(l==null?void 0:l.dot)&&r.jsx("span",{className:J("w-2 h-2 rounded-full shrink-0",l.dot)}),r.jsx("span",{children:l==null?void 0:l.label}),r.jsx(me,{size:12,style:{color:"var(--vscode-descriptionForeground)"}})]}),o&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>i(!1)}),r.jsx("div",{className:"absolute top-full right-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[140px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:s.map(a=>r.jsxs("button",{type:"button",onClick:()=>{n(a.value),i(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:a.value===t?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:p=>{a.value!==t&&(p.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:p=>{a.value!==t&&(p.currentTarget.style.background="transparent")},children:[a.dot&&r.jsx("span",{className:J("w-2 h-2 rounded-full shrink-0",a.dot)}),r.jsx("span",{className:"flex-1 text-left",children:a.label})]},a.value))})]})]})]})}function lr({label:e,description:t,value:s,min:n,max:o,step:i,unit:l,onChange:a}){const p=(s-n)/(o-n)*100;return r.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 transition-colors",onMouseEnter:c=>c.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:c=>c.currentTarget.style.background="transparent",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:e}),t&&r.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--vscode-descriptionForeground)"},children:t})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r.jsx("input",{type:"range",min:n,max:o,step:i,value:s,onChange:c=>a(Number(c.target.value)),className:"settings-slider",style:{background:`linear-gradient(to right, var(--vscode-button-background) ${p}%, var(--vscode-badge-background, #6b7280) ${p}%)`}}),r.jsxs("span",{className:"text-xs font-mono w-12 text-right tabular-nums",style:{color:"var(--vscode-foreground)"},children:[s,l||"%"]})]})]})}function ir({value:e,onChange:t}){const[s,n]=f.useState(!1),[o,i]=f.useState("");return r.jsxs("div",{className:"relative",children:[r.jsx("button",{type:"button",onClick:()=>n(!s),className:"w-5 h-5 rounded-full border border-white/20 cursor-pointer shrink-0",style:{backgroundColor:e}}),s&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>n(!1)}),r.jsxs("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg p-2 min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:[r.jsx("div",{className:"grid grid-cols-6 gap-1.5 mb-2",children:wt.map(l=>r.jsx("button",{type:"button",onClick:()=>{t(l.hex),n(!1)},className:"w-6 h-6 rounded-full border-2 transition-transform hover:scale-110",style:{backgroundColor:l.hex,borderColor:e===l.hex?"white":"transparent"},title:l.name},l.name))}),r.jsxs("div",{className:"flex gap-1",children:[r.jsx("input",{type:"text",placeholder:"#hex",value:o,onChange:l=>i(l.target.value),className:"flex-1 px-2 py-1 text-xs rounded",style:{background:"var(--vscode-input-background)",color:"var(--vscode-input-foreground)",border:"1px solid var(--vscode-input-border, transparent)"}}),r.jsx("button",{type:"button",onClick:()=>{/^#[0-9a-fA-F]{6}$/.test(o)&&(t(o),n(!1),i(""))},className:"px-2 py-1 text-xs rounded",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},children:"OK"})]})]})]})]})}function Go({onSetLabel:e,onRenameLabel:t,onDeleteLabel:s}){const n=_(b=>b.labelDefs),o=_(b=>b.features),[i,l]=f.useState(""),[a,p]=f.useState(wt[0].hex),[c,u]=f.useState(""),[g,h]=f.useState(null),[d,x]=f.useState(""),[m,v]=f.useState(null),k=f.useMemo(()=>{const b=new Map;for(const[w,S]of Object.entries(n))b.set(w,S);for(const w of o)for(const S of w.labels)b.has(S)||b.set(S,void 0);return b},[n,o]),z=f.useMemo(()=>{const b={};return k.forEach((S,C)=>{const $=(S==null?void 0:S.group)||"Other";b[$]||(b[$]=[]),b[$].push({name:C,def:S})}),Object.entries(b).sort(([S],[C])=>S==="Other"?1:C==="Other"?-1:S.localeCompare(C))},[k]),E=f.useMemo(()=>{const b=new Set;return Object.values(n).forEach(w=>{w.group&&b.add(w.group)}),Array.from(b).sort()},[n]),y=b=>o.filter(w=>w.labels.includes(b)).length,D=()=>{const b=i.trim();b&&(e==null||e(b,{color:a,group:c||void 0}),l(""),p(wt[0].hex),u(""))},N=b=>{const w=d.trim();w&&w!==b&&(t==null||t(b,w)),h(null),x("")},B=b=>{s==null||s(b),v(null)},I={background:"var(--vscode-input-background)",color:"var(--vscode-input-foreground)",border:"1px solid var(--vscode-input-border, transparent)"};return r.jsxs("div",{className:"px-4 space-y-3",children:[z.map(([b,w])=>r.jsxs("div",{children:[r.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1.5",style:{color:"var(--vscode-descriptionForeground)"},children:b}),r.jsx("div",{className:"space-y-1",children:w.map(({name:S,def:C})=>r.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded group/label transition-colors",onMouseEnter:$=>$.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:$=>$.currentTarget.style.background="transparent",children:[r.jsx(ir,{value:(C==null?void 0:C.color)||"#6b7280",onChange:$=>e==null?void 0:e(S,{...C,color:$,group:C==null?void 0:C.group})}),g===S?r.jsx("input",{type:"text",value:d,onChange:$=>x($.target.value),onKeyDown:$=>{$.key==="Enter"&&N(S),$.key==="Escape"&&(h(null),x(""))},onBlur:()=>N(S),autoFocus:!0,className:"flex-1 px-1.5 py-0.5 text-xs rounded min-w-0",style:I}):r.jsx("span",{className:"flex-1 text-xs truncate",style:{color:"var(--vscode-foreground)"},children:S}),(C==null?void 0:C.group)&&g!==S&&r.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full shrink-0",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:C.group}),m===S?r.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[r.jsxs("span",{className:"text-[10px]",style:{color:"var(--vscode-errorForeground, #f44)"},children:[y(S)," card",y(S)!==1?"s":""]}),r.jsx("button",{type:"button",onClick:()=>B(S),className:"px-1.5 py-0.5 text-[10px] rounded",style:{background:"var(--vscode-inputValidation-errorBackground, #5a1d1d)",color:"var(--vscode-errorForeground, #f44)"},children:"Delete"}),r.jsx("button",{type:"button",onClick:()=>v(null),className:"px-1.5 py-0.5 text-[10px] rounded",style:{color:"var(--vscode-descriptionForeground)"},children:"Cancel"})]}):r.jsxs("div",{className:"flex items-center gap-0.5 shrink-0 opacity-0 group-hover/label:opacity-100 transition-opacity",children:[r.jsx("button",{type:"button",onClick:()=>{h(S),x(S)},className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:$=>$.currentTarget.style.color="var(--vscode-foreground)",onMouseLeave:$=>$.currentTarget.style.color="var(--vscode-descriptionForeground)",title:"Rename label",children:r.jsx(Ct,{size:12})}),r.jsx("button",{type:"button",onClick:()=>v(S),className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:$=>$.currentTarget.style.color="var(--vscode-errorForeground, #f44)",onMouseLeave:$=>$.currentTarget.style.color="var(--vscode-descriptionForeground)",title:"Delete label",children:r.jsx(Ce,{size:12})})]})]},S))})]},b)),r.jsxs("div",{className:"rounded-lg p-2 space-y-2",style:{background:"var(--vscode-input-background)",border:"1px solid var(--vscode-input-border, transparent)"},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ir,{value:a,onChange:p}),r.jsx("input",{type:"text",placeholder:"New label name...",value:i,onChange:b=>l(b.target.value),onKeyDown:b=>{b.key==="Enter"&&D()},className:"flex-1 px-1.5 py-1 text-xs rounded bg-transparent min-w-0",style:{color:"var(--vscode-input-foreground)",outline:"none"}})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("input",{type:"text",placeholder:"Group (optional)",value:c,onChange:b=>u(b.target.value),onKeyDown:b=>{b.key==="Enter"&&D()},list:"label-groups",className:"flex-1 px-1.5 py-1 text-xs rounded",style:I}),r.jsx("datalist",{id:"label-groups",children:E.map(b=>r.jsx("option",{value:b},b))}),r.jsxs("button",{type:"button",onClick:D,disabled:!i.trim(),className:"flex items-center gap-1 px-2 py-1 text-xs rounded transition-colors disabled:opacity-40",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},children:[r.jsx($e,{size:12}),"Add"]})]})]})]})}function Wo({settings:e,workspace:t,onClose:s,onSave:n,onSetLabel:o,onRenameLabel:i,onDeleteLabel:l}){const[a,p]=f.useState(e),[c,u]=f.useState("general");f.useEffect(()=>{p(e)},[e]);const g=h=>{const d={...a,...h};p(d),n(d)};return f.useEffect(()=>{const h=d=>{d.key==="Escape"&&(d.stopPropagation(),s())};return document.addEventListener("keydown",h,!0),()=>document.removeEventListener("keydown",h,!0)},[s]),r.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end",children:[r.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:s}),r.jsxs("div",{className:"relative h-full w-1/2 max-w-lg shadow-xl flex flex-col animate-in slide-in-from-right duration-200",style:{background:"var(--vscode-editor-background)",borderLeft:"1px solid var(--vscode-panel-border)"},children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[r.jsx("h2",{className:"font-medium",style:{color:"var(--vscode-foreground)"},children:"Settings"}),r.jsx("button",{onClick:s,className:"p-1.5 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:h=>h.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:h=>h.currentTarget.style.background="transparent",children:r.jsx(ie,{size:18})})]}),r.jsx("div",{className:"flex",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:["general","defaults","labels"].map(h=>r.jsxs("button",{type:"button",onClick:()=>u(h),className:"px-4 py-2.5 text-xs font-medium transition-colors relative",style:{color:c===h?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)",background:"transparent"},children:[h.charAt(0).toUpperCase()+h.slice(1),c===h&&r.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5",style:{background:"var(--vscode-button-background)"}})]},h))}),r.jsxs("div",{className:"flex-1 overflow-auto",children:[c==="general"&&r.jsxs(r.Fragment,{children:[t&&r.jsxs(r.Fragment,{children:[r.jsxs(Ke,{title:"Workspace",children:[r.jsx(Je,{label:"Project Path",value:t.projectPath}),r.jsx(Je,{label:"Features Directory",value:t.featuresDirectory}),r.jsx(Je,{label:"Server Port",value:String(t.port)}),r.jsx(Je,{label:"Config Version",value:String(t.configVersion)})]}),r.jsx("div",{style:{borderTop:"1px solid var(--vscode-panel-border)"}})]}),r.jsxs(Ke,{title:"Card Display",children:[r.jsx(ze,{label:"Show Priority Badges",description:"Display priority indicators on feature cards",checked:a.showPriorityBadges,onChange:h=>g({showPriorityBadges:h})}),r.jsx(ze,{label:"Show Assignee",description:"Display assigned person on feature cards",checked:a.showAssignee,onChange:h=>g({showAssignee:h})}),r.jsx(ze,{label:"Show Due Date",description:"Display due dates on feature cards",checked:a.showDueDate,onChange:h=>g({showDueDate:h})}),r.jsx(ze,{label:"Show Labels",description:"Display labels on feature cards and in editors",checked:a.showLabels,onChange:h=>g({showLabels:h})}),r.jsx(ze,{label:"Show Filename",description:"Display the source markdown filename on cards",checked:a.showFileName,onChange:h=>g({showFileName:h})}),r.jsx(ze,{label:"Compact Mode",description:"Use compact card layout to show more features",checked:a.compactMode,onChange:h=>g({compactMode:h})}),r.jsx(ze,{label:"Show Deleted Column",description:"Display the Deleted column to manage soft-deleted cards",checked:a.showDeletedColumn,onChange:h=>g({showDeletedColumn:h})})]}),r.jsx("div",{style:{borderTop:"1px solid var(--vscode-panel-border)"}}),r.jsxs(Ke,{title:"Zoom",children:[r.jsx(lr,{label:"Board Zoom",description:"Scale text size on the board view",value:a.boardZoom,min:75,max:150,step:5,onChange:h=>g({boardZoom:h})}),r.jsx(lr,{label:"Card Detail Zoom",description:"Scale text size in the card detail panel",value:a.cardZoom,min:75,max:150,step:5,onChange:h=>g({cardZoom:h})})]})]}),c==="defaults"&&r.jsxs(Ke,{title:"Defaults",children:[r.jsx(ar,{label:"Default Priority",value:a.defaultPriority,options:Zo,onChange:h=>g({defaultPriority:h})}),r.jsx(ar,{label:"Default Status",value:a.defaultStatus,options:qo,onChange:h=>g({defaultStatus:h})})]}),c==="labels"&&r.jsx(Ke,{title:"Labels",children:r.jsx(Go,{onSetLabel:o,onRenameLabel:i,onDeleteLabel:l})})]}),r.jsx("div",{className:"px-4 py-2",style:{borderTop:"1px solid var(--vscode-panel-border)"},children:r.jsx("p",{className:"text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:"Settings are saved automatically and apply to all connected clients."})})]})]})}const Vo=["#6b7280","#3b82f6","#f59e0b","#8b5cf6","#22c55e","#ef4444","#ec4899","#14b8a6","#f97316","#06b6d4"];function Qo({isOpen:e,onClose:t,onSave:s,initial:n,title:o}){const[i,l]=f.useState((n==null?void 0:n.name)??""),[a,p]=f.useState((n==null?void 0:n.color)??"#3b82f6"),c=f.useRef(null);return f.useEffect(()=>{e&&(l((n==null?void 0:n.name)??""),p((n==null?void 0:n.color)??"#3b82f6"),setTimeout(()=>{var u;return(u=c.current)==null?void 0:u.focus()},50))},[e,n]),f.useEffect(()=>{if(!e)return;const u=g=>{g.key==="Escape"&&t(),g.key==="Enter"&&(g.ctrlKey||g.metaKey)&&i.trim()&&s({name:i.trim(),color:a})};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[e,t,s,i,a]),e?r.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[r.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),r.jsxs("div",{className:"relative bg-white dark:bg-zinc-800 rounded-lg shadow-xl w-full max-w-sm mx-4 border border-zinc-200 dark:border-zinc-600",children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-200 dark:border-zinc-700",children:[r.jsx("h2",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:o}),r.jsx("button",{type:"button",onClick:t,className:"p-1 rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:r.jsx(ie,{size:16,className:"text-zinc-500"})})]}),r.jsxs("div",{className:"px-4 py-4 space-y-4",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-zinc-600 dark:text-zinc-400 mb-1",children:"Name"}),r.jsx("input",{ref:c,type:"text",value:i,onChange:u=>l(u.target.value),placeholder:"List name...",className:"w-full px-3 py-1.5 text-sm bg-white dark:bg-zinc-700 border border-zinc-200 dark:border-zinc-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-zinc-600 dark:text-zinc-400 mb-1",children:"Color"}),r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[Vo.map(u=>r.jsx("button",{type:"button",onClick:()=>p(u),className:`w-6 h-6 rounded-full border-2 transition-all ${a===u?"border-zinc-900 dark:border-white scale-110":"border-transparent hover:scale-110"}`,style:{backgroundColor:u},title:u},u)),r.jsx("input",{type:"color",value:a,onChange:u=>p(u.target.value),className:"w-6 h-6 rounded cursor-pointer border-0 p-0 bg-transparent",title:"Custom color"})]})]})]}),r.jsxs("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-zinc-200 dark:border-zinc-700",children:[r.jsx("button",{type:"button",onClick:t,className:"px-3 py-1.5 text-sm rounded-md text-zinc-600 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:"Cancel"}),r.jsx("button",{type:"button",onClick:()=>{i.trim()&&s({name:i.trim(),color:a})},disabled:!i.trim(),className:"px-3 py-1.5 text-sm rounded-md bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Save"})]})]})]}):null}const P=acquireVsCodeApi();function Yo(){const{columns:e,workspace:t,cardSettings:s,settingsOpen:n,setFeatures:o,setColumns:i,setBoards:l,setCurrentBoard:a,setIsDarkMode:p,setWorkspace:c,setCardSettings:u,setSettingsOpen:g,setLabelDefs:h}=_(),[d,x]=f.useState(!1),[m,v]=f.useState("backlog"),[k,z]=f.useState(!1),[E,y]=f.useState(null),D=f.useRef(0),[N,B]=f.useState(null),[I,b]=f.useState([]),w=f.useRef(I);f.useEffect(()=>{w.current=I},[I]);const S=f.useRef(0),C=f.useCallback(j=>{const{features:T}=_.getState(),A=T.find(R=>R.id===j);if(!A)return;const Z=A.status;o(T.map(R=>R.id===j?{...R,status:It}:R)),(N==null?void 0:N.id)===j&&B(null);const ke=String(S.current++);b(R=>[...R,{id:ke,feature:A,originalStatus:Z}])},[N,o]),$=f.useCallback(j=>{const T=w.current.find(A=>A.id===j);T&&(P.postMessage({type:"deleteFeature",featureId:T.feature.id}),b(A=>A.filter(Z=>Z.id!==j)))},[]),G=f.useCallback(j=>{const T=w.current.find(Z=>Z.id===j);if(!T)return;const{features:A}=_.getState();o(A.map(Z=>Z.id===T.feature.id?{...Z,status:T.originalStatus}:Z)),b(Z=>Z.filter(ke=>ke.id!==j))},[o]),W=f.useCallback(()=>{const j=w.current;j.length!==0&&G(j[j.length-1].id)},[G]);f.useEffect(()=>{let j=!1,T=null;const A=R=>{if(R.key==="Alt"){j=!0,T&&clearTimeout(T),T=setTimeout(()=>{j=!1},1e3);return}if(R.altKey&&(j=!1,T&&(clearTimeout(T),T=null)),R.key==="z"&&(R.ctrlKey||R.metaKey)&&!R.shiftKey&&w.current.length>0){R.preventDefault(),W();return}if((R.key==="="||R.key==="+"||R.key==="-")&&(R.ctrlKey||R.metaKey)){R.preventDefault();const ye=R.key==="-"?-5:5,{cardSettings:pe}=_.getState();if(R.shiftKey){const we=Math.max(75,Math.min(150,pe.cardZoom+ye));if(we!==pe.cardZoom){const je={...pe,cardZoom:we};u(je),P.postMessage({type:"saveSettings",settings:je})}}else{const we=Math.max(75,Math.min(150,pe.boardZoom+ye));if(we!==pe.boardZoom){const je={...pe,boardZoom:we};u(je),P.postMessage({type:"saveSettings",settings:je})}}return}if(!(R.target instanceof HTMLInputElement||R.target instanceof HTMLTextAreaElement||R.target instanceof HTMLSelectElement||R.target instanceof HTMLElement&&R.target.isContentEditable))switch(R.key){case"n":if(R.ctrlKey||R.metaKey||R.altKey||R.shiftKey)return;R.preventDefault(),v("backlog"),x(!0);break;case"Escape":d&&x(!1);break}},Z=R=>{R.key==="Alt"&&j&&(j=!1,T&&(clearTimeout(T),T=null),P.postMessage({type:"focusMenuBar"}))},ke=()=>{j=!1};return window.addEventListener("keydown",A),window.addEventListener("keyup",Z),window.addEventListener("mousedown",ke),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",Z),window.removeEventListener("mousedown",ke),T&&clearTimeout(T)}},[d,W,u]),f.useEffect(()=>{const j=()=>{const A=document.body.classList.contains("vscode-dark")||document.body.classList.contains("vscode-high-contrast");p(A),A?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")};j();const T=new MutationObserver(j);return T.observe(document.body,{attributes:!0,attributeFilter:["class"]}),()=>T.disconnect()},[p]),f.useEffect(()=>{const j=document.documentElement;j.style.setProperty("--board-zoom",String(s.boardZoom/100)),j.style.setProperty("--card-zoom",String(s.cardZoom/100))},[s.boardZoom,s.cardZoom]),f.useEffect(()=>{const j=T=>{const A=T.data;if(!(!A||typeof A.type!="string"))switch(A.type){case"init":o(A.features),i(A.columns),A.boards&&l(A.boards),A.currentBoard&&a(A.currentBoard),A.workspace&&c(A.workspace),A.settings&&(A.settings.markdownEditorMode&&N&&B(null),u(A.settings)),A.labels&&h(A.labels);break;case"featuresUpdated":o(A.features);break;case"triggerCreateDialog":v("backlog"),x(!0);break;case"labelsUpdated":h(A.labels);break;case"showSettings":u(A.settings),g(!0);break;case"featureContent":{const{cardSettings:Z}=_.getState();if(Z.markdownEditorMode)break;D.current+=1,B({id:A.featureId,content:A.content,frontmatter:A.frontmatter,comments:A.comments||[],contentVersion:D.current});break}}};return window.addEventListener("message",j),P.postMessage({type:"ready"}),()=>window.removeEventListener("message",j)},[o,i,l,a,c,u,g,h]);const Q=j=>{P.postMessage({type:"openFeature",featureId:j.id})},U=(j,T)=>{N&&P.postMessage({type:"saveFeatureContent",featureId:N.id,content:j,frontmatter:T})},L=(j,T)=>{N&&(P.postMessage({type:"transferCard",featureId:N.id,toBoard:j,targetStatus:T}),B(null))},H=()=>{B(null),P.postMessage({type:"closeFeature"})},ne=()=>{N&&C(N.id)},X=()=>{N&&(P.postMessage({type:"permanentDeleteFeature",featureId:N.id}),B(null))},be=()=>{N&&(P.postMessage({type:"restoreFeature",featureId:N.id}),B(null))},Ge=()=>{P.postMessage({type:"purgeDeletedCards"})},ve=()=>{N&&P.postMessage({type:"openFile",featureId:N.id})},We=(j,T)=>{P.postMessage({type:"startWithAI",agent:j,permissionMode:T})},Le=()=>{N&&P.postMessage({type:"addAttachment",featureId:N.id})},Re=j=>{N&&P.postMessage({type:"openAttachment",featureId:N.id,attachment:j})},ct=j=>{N&&P.postMessage({type:"removeAttachment",featureId:N.id,attachment:j})},dt=(j,T)=>{N&&P.postMessage({type:"addComment",featureId:N.id,author:j,content:T})},Ve=(j,T)=>{N&&P.postMessage({type:"updateComment",featureId:N.id,commentId:j,content:T})},M=j=>{N&&P.postMessage({type:"deleteComment",featureId:N.id,commentId:j})},re=j=>{P.postMessage({type:"saveSettings",settings:j})},te=()=>{y(null),z(!0)},se=j=>{const T=e.find(A=>A.id===j);T&&(y(T),z(!0))},ue=j=>{!e.find(Z=>Z.id===j)||_.getState().features.filter(Z=>Z.status===j).length>0||P.postMessage({type:"removeColumn",columnId:j})},Fe=j=>{!e.find(Z=>Z.id===j)||_.getState().features.filter(Z=>Z.status===j).length===0||P.postMessage({type:"cleanupColumn",columnId:j})},Wr=j=>{E?P.postMessage({type:"editColumn",columnId:E.id,updates:j}):P.postMessage({type:"addColumn",column:j}),z(!1),y(null)},Vr=j=>{v(j),x(!0)},Qr=j=>{P.postMessage({type:"createFeature",data:j})},Yr=f.useCallback(j=>{if(!N)return;const T=`action-${Date.now()}`;P.postMessage({type:"triggerAction",featureId:N.id,action:j,callbackKey:T})},[N]),Jr=(j,T,A)=>{const{features:Z}=_.getState();if(Z.find(R=>R.id===j)){const R=Z.filter(ce=>ce.status===T&&ce.id!==j).sort((ce,Ot)=>ce.order<Ot.order?-1:ce.order>Ot.order?1:0),ye=Math.max(0,Math.min(A,R.length)),pe=ye>0?R[ye-1].order:null,we=ye<R.length?R[ye].order:null,je=Ss(pe,we),Xr=Z.map(ce=>ce.id===j?{...ce,status:T,order:je}:ce);o(Xr)}P.postMessage({type:"moveFeature",featureId:j,newStatus:T,newOrder:A})};return e.length===0?r.jsx("div",{className:"h-full w-full flex items-center justify-center bg-[var(--vscode-editor-background)]",children:r.jsx("div",{className:"text-[var(--vscode-foreground)] opacity-60",children:"Loading..."})}):r.jsxs("div",{className:"h-full w-full flex flex-col bg-[var(--vscode-editor-background)]",children:[r.jsx(_o,{onOpenSettings:()=>P.postMessage({type:"openSettings"}),onAddColumn:te,onToggleTheme:()=>P.postMessage({type:"toggleTheme"}),onSwitchBoard:j=>P.postMessage({type:"switchBoard",boardId:j}),onCreateBoard:j=>P.postMessage({type:"createBoard",name:j})}),r.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[r.jsx("div",{className:`board-zoom-scope ${N?"w-1/2":"w-full"}`,children:r.jsx(uo,{onFeatureClick:Q,onAddFeature:Vr,onMoveFeature:Jr,onEditColumn:se,onRemoveColumn:ue,onCleanupColumn:Fe,onPurgeDeletedCards:Ge,selectedFeatureId:N==null?void 0:N.id})}),N&&r.jsx("div",{className:"w-1/2",style:{fontSize:"calc(1em * var(--card-zoom, 1))"},children:r.jsx(Io,{featureId:N.id,content:N.content,frontmatter:N.frontmatter,comments:N.comments,contentVersion:N.contentVersion,onSave:U,onClose:H,onDelete:ne,onPermanentDelete:X,onRestore:be,onOpenFile:ve,onStartWithAI:We,onAddAttachment:Le,onOpenAttachment:Re,onRemoveAttachment:ct,onAddComment:dt,onUpdateComment:Ve,onDeleteComment:M,onTransferToBoard:L,onTriggerAction:Yr})})]}),r.jsx(zo,{isOpen:d,onClose:()=>x(!1),onCreate:Qr,initialStatus:m}),r.jsx(Uo,{isOpen:n,settings:s,workspace:t,onClose:()=>g(!1),onSave:re,onSetLabel:(j,T)=>P.postMessage({type:"setLabel",name:j,definition:T}),onRenameLabel:(j,T)=>P.postMessage({type:"renameLabel",oldName:j,newName:T}),onDeleteLabel:j=>P.postMessage({type:"deleteLabel",name:j})}),r.jsx(Qo,{isOpen:k,onClose:()=>{z(!1),y(null)},onSave:Wr,initial:E?{name:E.name,color:E.color}:void 0,title:E?"Edit List":"Add List"}),I.map((j,T)=>r.jsx(Ko,{message:`Deleted "${Br(j.feature.content)}"`,onUndo:()=>G(j.id),onExpire:()=>$(j.id),duration:5e3,index:T},j.id))]})}yr(document.getElementById("root")).render(r.jsx(f.StrictMode,{children:r.jsx(Yo,{})}));
86
86
  //# sourceMappingURL=index.js.map