clitrigger 0.2.67 → 0.2.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AnalyticsPanel-DQ9grCp0.js → AnalyticsPanel-Dr9Zypd4.js} +1 -1
- package/dist/client/assets/{CalendarGrid-Fk99r9nq.js → CalendarGrid-BRVf7WJK.js} +1 -1
- package/dist/client/assets/{DiscussionDetail-HcG3ohsQ.js → DiscussionDetail-DetjETsr.js} +4 -4
- package/dist/client/assets/{DiscussionForm-BZfnK2EV.js → DiscussionForm-Bi4L47Ly.js} +1 -1
- package/dist/client/assets/{EmptyState-GADfcNs7.js → EmptyState--9RqKIk6.js} +1 -1
- package/dist/client/assets/{FloatingComposerController-5A3GJtK4-CTCqYxNF.js → FloatingComposerController-5A3GJtK4-85zrcVy6.js} +1 -1
- package/dist/client/assets/{LogViewer-Di7SxByZ.js → LogViewer-BDuckIDB.js} +1 -1
- package/dist/client/assets/{MarkdownContent-WshMOH5P.js → MarkdownContent-CwGbW814.js} +1 -1
- package/dist/client/assets/{PersonalAgenda-DrfVGibs.js → PersonalAgenda-JNpWPEDQ.js} +3 -3
- package/dist/client/assets/{PlannerPageEditor-B2m5SwtT.js → PlannerPageEditor-9_jJ-l98.js} +3 -3
- package/dist/client/assets/ProjectDetail-DwN6S3uf.js +183 -0
- package/dist/client/assets/{ProjectList-D2tf2Kfp.js → ProjectList-LeZ7mrEM.js} +1 -1
- package/dist/client/assets/{ReviewQueue-UrhgwrGk.js → ReviewQueue-DzTHqZdO.js} +1 -1
- package/dist/client/assets/{TaskGraph-Bp62pL5V.js → TaskGraph-BrHxqYJn.js} +1 -1
- package/dist/client/assets/{VaultLayout-ClyLfQdP.js → VaultLayout-DftlF-Gd.js} +1 -1
- package/dist/client/assets/{folder-git-2-CntWBh-U.js → folder-git-2-DocDG5LN.js} +1 -1
- package/dist/client/assets/index--CryAcdA.js +427 -0
- package/dist/client/assets/index-xIZH9sMw.css +32 -0
- package/dist/client/assets/{rotate-ccw-DRnyCt5y.js → rotate-ccw-CY6Wl56G.js} +1 -1
- package/dist/client/assets/{style-DcT-60Dn.js → style-D7Mv0Jex.js} +1 -1
- package/dist/client/assets/{with-selector-QmxTx8WM.js → with-selector-bSOP5zTp.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/services/cli-adapters.js +1 -1
- package/dist/server/services/cli-adapters.js.map +1 -1
- package/dist/server/services/cli-status.d.ts.map +1 -1
- package/dist/server/services/cli-status.js +12 -1
- package/dist/server/services/cli-status.js.map +1 -1
- package/package.json +1 -1
- package/dist/client/assets/ProjectDetail-B96iIeaz.js +0 -183
- package/dist/client/assets/index-DB7C6wx1.js +0 -427
- package/dist/client/assets/index-gug7OXWO.css +0 -32
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{c as es,o as X,p as H,q as Dt,s as _t,a as Pe,r as n,j as t,Z as ts,d as ss,u as as,g as os,
|
|
1
|
+
import{c as es,o as X,p as H,q as Dt,s as _t,a as Pe,r as n,j as t,Z as ts,d as ss,u as as,g as os,be as rs,v as jt,U as ae,B as ns,P as Oe,$ as ze,aO as Ye,X as fe,L as ls,aU as cs,aP as is,M as Et,aD as It}from"./index--CryAcdA.js";import{y as pe,f as ds,j as vt,u as us,g as ms,H as xs,h as ps,i as gs,D as bt,C as hs,a as fs,d as ys,c as js,I as vs,e as bs,s as ks}from"./CalendarGrid-BRVf7WJK.js";import{C as Ns,R as kt}from"./rotate-ccw-CY6Wl56G.js";import{F as Cs}from"./folder-git-2-DocDG5LN.js";/**
|
|
2
2
|
* @license lucide-react v1.8.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const ws=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],Ss=es("folder-input",ws);function Ds(){return X("/api/personal-items")}function _s(s){return H("/api/personal-items",s)}function We(s,u){return _t(`/api/personal-items/${s}`,u)}function Es(s){return Dt(`/api/personal-items/${s}`)}function Is(s){return H("/api/personal-items/bulk-delete",s)}function $s(s,u){return H(`/api/personal-items/${s}/images`,{images:u})}function Ts(s,u){return Dt(`/api/personal-items/${s}/images/${u}`)}function Nt(s,u){return`/api/personal-items/${s}/images/${u}`}function Ms(s,u){return X(`/api/agenda?from=${encodeURIComponent(s)}&to=${encodeURIComponent(u)}`)}function Ls(s,u){return X(`/api/agenda/jira?from=${encodeURIComponent(s)}&to=${encodeURIComponent(u)}`)}function zs(){return X("/api/agenda/jira-config")}function qe(s){return _t("/api/agenda/jira-config",s)}function Ps(){return X("/api/agenda/jira-test")}function Fs(){return X("/api/agenda/jira/statuses")}function Rs(){return X("/api/agenda/jira/dismissed")}function Ks(s){return H("/api/agenda/jira/dismiss",{key:s})}function As(s){return H("/api/agenda/jira/undismiss",{key:s})}function Ct(s){return H("/api/agenda/jira/import",{key:s.key,summary:s.summary,duedate:s.duedate,url:s.url})}function Js(s,u){return H(`/api/personal-items/${s}/move-to-planner`,{project_id:u})}function Hs(s,u){return H("/api/agenda/jira/import-to-planner",{project_id:u,key:s.key,summary:s.summary,duedate:s.duedate,url:s.url})}function Le({projects:s,onMove:u,title:I}){const{t:i}=Pe(),[x,y]=n.useState(!1),[v,R]=n.useState(!1),[k,P]=n.useState({top:0,left:0}),m=n.useRef(null),M=n.useRef(null),p=n.useCallback(()=>{if(!m.current)return;const j=m.current.getBoundingClientRect(),g=window.innerWidth,T=window.innerHeight;let N=j.bottom+4;const b=M.current;if(b){const w=b.offsetWidth,h=b.offsetHeight;let D=j.right-w;D<8&&(D=8),D+w>g-8&&(D=g-8-w),N+h>T-8&&(N=j.top-h-4),P({top:N,left:D}),R(!0)}else P({top:N,left:Math.max(8,j.right-180)})},[]);return n.useEffect(()=>{if(!x){R(!1);return}p();const j=requestAnimationFrame(p),g=T=>{var b,w;const N=T.target;(b=m.current)!=null&&b.contains(N)||(w=M.current)!=null&&w.contains(N)||y(!1)};return document.addEventListener("mousedown",g),window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{cancelAnimationFrame(j),document.removeEventListener("mousedown",g),window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[x,p]),t.jsxs(t.Fragment,{children:[t.jsx("button",{ref:m,onClick:j=>{j.stopPropagation(),y(g=>!g)},className:"opacity-0 group-hover:opacity-100 transition-opacity mt-0.5",title:I,children:t.jsx(Ss,{size:14,style:{color:"var(--color-text-muted)"}})}),x&&ts.createPortal(t.jsxs("div",{ref:M,className:"fixed z-tooltip min-w-[180px] max-h-[280px] overflow-auto rounded-xl py-1 shadow-elevated",style:{top:k.top,left:k.left,opacity:v?1:0,backgroundColor:"var(--color-bg-card)",border:"1px solid var(--color-border)"},children:[t.jsx("div",{className:"px-3 py-1 text-2xs uppercase tracking-wider",style:{color:"var(--color-text-muted)"},children:I}),s.length===0&&t.jsx("div",{className:"px-3 py-1.5 text-xs",style:{color:"var(--color-text-muted)"},children:i("agenda.noProjects")}),s.map(j=>t.jsx("button",{onClick:g=>{g.stopPropagation(),y(!1),u(j.id)},className:"block w-full px-3 py-1.5 text-xs text-left hover:bg-warm-100 rounded-md transition-colors truncate",style:{color:"var(--color-text-primary)"},title:j.name,children:j.name},j.id))]}),document.body)]})}function J(s){if(!s)return[];try{const u=JSON.parse(s);return Array.isArray(u)?u.filter(I=>typeof I=="string"):[]}catch{return[]}}const wt=[210,145,35,320,265,0,175,95];function ge(s){let u=0;for(let i=0;i<s.length;i++)u=u*31+s.charCodeAt(i)>>>0;const I=wt[u%wt.length];return{bg:`hsla(${I}, 60%, 50%, 0.18)`,fg:`hsl(${I}, 65%, 70%)`}}const z={bg:"rgba(38,132,255,0.18)",fg:"rgb(101,164,255)"};function he(s){switch(s){case"jira":return z;case"personal":return{bg:"hsla(238, 70%, 60%, 0.18)",fg:"hsl(238, 70%, 72%)"};case"schedule":return{bg:"hsla(160, 60%, 45%, 0.18)",fg:"hsl(160, 60%, 62%)"};case"planner":return{bg:"hsla(35, 80%, 55%, 0.20)",fg:"hsl(35, 85%, 66%)"}}}const St={personal:0,schedule:1,planner:2,jira:3},Bs={bg:"hsla(145, 60%, 48%, 0.18)",fg:"hsl(145, 60%, 66%)"},Xe={bg:"hsla(218, 32%, 56%, 0.20)",fg:"hsl(218, 36%, 78%)"};let Os=0;function Vs(){const{t:s,lang:u}=Pe(),{confirm:I}=ss(),i=as(),[x,y]=n.useState("month"),[v,R]=n.useState({key:"date",dir:"asc"}),[k,P]=n.useState(()=>new Date),[m,M]=n.useState([]),[p,j]=n.useState({personal:[],schedules:[],planner:[]}),[g,T]=n.useState([]),[N,b]=n.useState([]),[w,h]=n.useState(!1),[D,Y]=n.useState(null),[K,G]=n.useState(null),[V,B]=n.useState(!1),[ye,oe]=n.useState(!1),[O,je]=n.useState([]),[f,Q]=n.useState({personal:!0,schedule:!0,planner:!0,jira:!0}),[Z,ee]=n.useState(!0),[$,re]=n.useState(()=>pe(new Date)),[A,te]=n.useState(null),[Fe,ne]=n.useState(!1),[_,F]=n.useState(!1),[c,U]=n.useState(null),[le,Re]=n.useState(""),[ve,Ke]=n.useState(""),[W,Ae]=n.useState(""),[se,be]=n.useState(""),[ke,Je]=n.useState(!1),[q,Ne]=n.useState([]),[Ce,we]=n.useState(""),[Se,ce]=n.useState([]),[Ge,ie]=n.useState([]),[Ve,He]=n.useState(null),Qe=n.useRef(null),[C,Ze]=n.useState(null),et=260,tt=760,st=n.useRef(null),[Be,$t]=n.useState(()=>{const e=parseInt(localStorage.getItem("agendaPanelWidth")||"",10);return Number.isFinite(e)&&e>=et&&e<=tt?e:320});n.useEffect(()=>{try{localStorage.setItem("agendaPanelWidth",String(Be))}catch{}},[Be]);const at=64,ot=280,Tt=6,[de,Mt]=n.useState(()=>{const e=parseInt(localStorage.getItem("agendaCellHeight")||"",10);return Number.isFinite(e)&&e>=at&&e<=ot?e:92});n.useEffect(()=>{try{localStorage.setItem("agendaCellHeight",String(Math.round(de)))}catch{}},[de]);const Lt=e=>{e.preventDefault();const a=e.clientY,r=de,o=d=>{Mt(Math.min(ot,Math.max(at,r+(d.clientY-a)/Tt)))},l=()=>{window.removeEventListener("pointermove",o),window.removeEventListener("pointerup",l),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="ns-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",o),window.addEventListener("pointerup",l)},zt=e=>{e.preventDefault();const a=o=>{var d;const l=(d=st.current)==null?void 0:d.getBoundingClientRect();l&&$t(Math.min(tt,Math.max(et,l.right-o.clientX)))},r=()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",r),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",a),window.addEventListener("pointerup",r)},{rangeStart:De,rangeEnd:_e,gridDays:Pt,cols:Ft,dimOutOfMonth:Rt}=ds(x,k),S=n.useCallback(async()=>{ee(!0);try{const[e,a]=await Promise.all([Ds(),Ms(De,_e)]);M(e),j(a)}catch{}finally{ee(!1)}try{const{issues:e}=await Ls(De,_e);T(e),Y(null)}catch(e){T([]),Y(e instanceof Error?e.message:"Jira fetch failed")}try{const{keys:e}=await Rs();b(e)}catch{}},[De,_e]);n.useEffect(()=>{S()},[S]),n.useEffect(()=>{zs().then(G).catch(()=>G(null))},[]);const Ee=!!(K!=null&&K.enabled&&K.hasToken);n.useEffect(()=>{os().then(je).catch(()=>je([]))},[]);const rt=(e,a)=>Js(e.id,a).then(S),nt=(e,a)=>Hs(e,a).then(S),lt=e=>Ks(e).then(S),Kt=e=>As(e).then(S);n.useEffect(()=>{x==="day"&&re(pe(k))},[x,k]);const L=n.useCallback(e=>!C||J(e.tags).includes(C),[C]),Ie=n.useMemo(()=>{const e=new Map,a=(o,l)=>{const d=e.get(o)??[];d.push(l),e.set(o,d)},r=o=>{const l=new Date(o+"T00:00");return l.setDate(l.getDate()+1),pe(l)};for(const o of f.personal?m:[]){if(!o.start_at||!L(o))continue;const l=o.start_at.slice(0,10),d=(o.end_at||o.start_at).slice(0,10);if(!(x==="month"&&d>l))if(x==="month"||d<=l)a(l,{kind:"personal",id:o.id,title:o.title,done:o.status==="done"});else for(let E=l;E<=d;E=r(E))a(E,{kind:"personal",id:o.id,title:o.title,done:o.status==="done"})}for(const o of C||!f.schedule?[]:p.schedules){if(!o.at)continue;const l=vt(o.at),d=new Date(o.at).toTimeString().slice(0,5);a(l,{kind:"schedule",id:o.id,title:`${o.project_name} · ${o.title}`,time:d,projectId:o.project_id,deepLinkTab:"schedules"})}for(const o of C||!f.planner?[]:p.planner){const l=o.due_date.slice(0,10);a(l,{kind:"planner",id:o.id,title:`${o.project_name} · ${o.title}`,done:o.status==="done",projectId:o.project_id,deepLinkTab:"planner"})}for(const o of C||!f.jira?[]:g)o.duedate&&a(o.duedate.slice(0,10),{kind:"jira",id:o.key,title:`${o.key} · ${o.summary}`,url:o.url});return e},[m,p,g,C,L,f,x]),At=n.useMemo(()=>{const e=new Map;for(const[a,r]of Ie)e.set(a,r.map(o=>({key:`${o.kind}-${o.id}`,title:o.title,time:o.time,prefix:o.kind!=="personal"?"· ":void 0,bg:he(o.kind).bg,fg:o.done?"var(--color-text-muted)":he(o.kind).fg,done:o.done,payload:o,draggable:o.kind==="personal"})));return e},[Ie]),Jt=n.useMemo(()=>{if(!f.personal)return[];const e=he("personal");return m.filter(a=>{if(!a.start_at||!L(a))return!1;const r=a.start_at.slice(0,10);return(a.end_at||a.start_at).slice(0,10)>r}).map(a=>({key:`personal-bar-${a.id}`,title:a.title,startKey:a.start_at.slice(0,10),endKey:(a.end_at||a.start_at).slice(0,10),bg:e.bg,fg:a.status==="done"?"var(--color-text-muted)":e.fg,done:a.status==="done",payload:a}))},[m,L,f.personal]),ct=n.useMemo(()=>m.filter(e=>!e.start_at&&L(e)),[m,L]),it=n.useMemo(()=>{const e=new Set;for(const a of m)for(const r of J(a.tags))e.add(r);return Array.from(e).sort()},[m]),dt=n.useMemo(()=>{const e=[];for(const o of f.personal?m:[])L(o)&&e.push({kind:"personal",id:o.id,title:o.title,dateKey:o.start_at?o.start_at.slice(0,10):null,endKey:o.end_at&&o.start_at&&o.end_at.slice(0,10)>o.start_at.slice(0,10)?o.end_at.slice(0,10):null,time:null,status:o.status,item:o});for(const o of C||!f.schedule?[]:p.schedules)e.push({kind:"schedule",id:o.id,title:`${o.project_name} · ${o.title}`,dateKey:o.at?vt(o.at):null,time:o.at?new Date(o.at).toTimeString().slice(0,5):null,projectId:o.project_id,deepLinkTab:"schedules"});for(const o of C||!f.planner?[]:p.planner)e.push({kind:"planner",id:o.id,title:`${o.project_name} · ${o.title}`,dateKey:o.due_date.slice(0,10),time:null,status:o.status,projectId:o.project_id,deepLinkTab:"planner"});for(const o of C||!f.jira?[]:g)e.push({kind:"jira",id:o.key,title:`${o.key} · ${o.summary}`,dateKey:o.duedate?o.duedate.slice(0,10):null,time:null,status:o.status,url:o.url});const a=(o,l)=>{if(!o.dateKey&&!l.dateKey)return 0;if(!o.dateKey)return 1;if(!l.dateKey)return-1;const d=o.dateKey<l.dateKey?-1:o.dateKey>l.dateKey?1:0;return d!==0?d:(o.time||"").localeCompare(l.time||"")},r=v.dir==="asc"?1:-1;return e.sort((o,l)=>{let d=0;if(v.key==="kind")d=St[o.kind]-St[l.kind];else if(v.key==="status"){const E=o.status||"",Oe=l.status||"";if(!E&&!Oe)d=0;else if(E)if(Oe)d=E.localeCompare(Oe);else return-1;else return 1}else return a(o,l)*r;return d!==0?d*r:a(o,l)}),e},[m,p,g,C,L,f,v]),Ht=us(),Bt=pe(new Date),Ot=k.getMonth(),Ut=x==="month"?Math.max(1,Math.floor((de-28)/18)):99,ut=e=>P(a=>ks(a,x,e)),Wt=()=>{P(new Date),re(pe(new Date))},qt=ms(k,x,u),$e=e=>{U(null),Re(""),Ke(""),Ae(e??$),be(e??$),Je(!1),Ne(C?[C]:[]),we(""),ce([]),ie([]),ne(!0)},ue=e=>{U(e),Re(e.title),Ke(e.description??""),Ae(e.start_at?e.start_at.slice(0,10):""),be(e.end_at||e.start_at?(e.end_at||e.start_at).slice(0,10):""),Je(e.status==="done"),Ne(J(e.tags)),we(""),ce([]);try{ie(e.images?JSON.parse(e.images):[])}catch{ie([])}ne(!0)},mt=e=>{const a=e.trim();a&&(Ne(r=>r.includes(a)?r:[...r,a]),we(""))},xt=e=>Ne(a=>a.filter(r=>r!==e)),Te=()=>{ne(!1),U(null),F(!1),ce([]),ie([])},me=n.useCallback(e=>{const a=Array.from(e).filter(r=>r.type.startsWith("image/"));for(const r of a){const o=new FileReader;o.onload=()=>{const l=o.result,d=`pending-${++Os}`;ce(E=>[...E,{id:d,name:r.name,data:l,preview:l}])},o.readAsDataURL(r)}},[]),Xt=n.useCallback(e=>{var o;const a=(o=e.clipboardData)==null?void 0:o.items;if(!a)return;const r=[];for(let l=0;l<a.length;l++)if(a[l].type.startsWith("image/")){const d=a[l].getAsFile();d&&r.push(d)}r.length!==0&&(e.preventDefault(),me(r))},[me]),Yt=n.useCallback(e=>{var a;e.preventDefault(),e.stopPropagation(),(a=e.dataTransfer)!=null&&a.files&&me(e.dataTransfer.files)},[me]),Gt=e=>ce(a=>a.filter(r=>r.id!==e)),Vt=e=>{c&&Ts(c.id,e),ie(a=>a.filter(r=>r.id!==e))},Qt=Ge.length+Se.length,pt=!!(le.trim()||ve.trim()),gt=async()=>{if(!pt)return;const e=le.trim()||ve.trim().split(`
|
|
7
|
-
`)[0].slice(0,80)||s("agenda.untitled"),a=W||null,r=W?se&&se>=W?se:W:null,o=q.length?q:null,l={title:e,description:ve.trim()||void 0,start_at:a,end_at:r,tags:o};let d;c?(await We(c.id,{...l,status:ke?"done":"pending"}),d=c.id):d=(await _s(l)).id,Se.length>0&&await $s(d,Se.map(E=>({name:E.name,data:E.data}))),Te(),S()},ht=async e=>{await We(e.id,{status:e.status==="done"?"pending":"done"}),S()},ft=(e,a,r)=>{M(o=>o.map(l=>l.id===e?{...l,start_at:a,end_at:r}:l)),We(e,{start_at:a,end_at:r}).then(S)},Me=async e=>await I({message:s("agenda.confirmDelete"),danger:!0})?(await Es(e.id),S(),!0):!1,xe=(e,a)=>{a.preventDefault(),a.stopPropagation(),te({x:a.clientX,y:a.clientY,dateKey:"",item:e})},Zt=e=>{if(e.kind==="personal"){const a=m.find(r=>r.id===e.id);a&&ue(a)}else e.kind==="jira"?e.url&&window.open(e.url,"_blank","noopener,noreferrer"):e.projectId&&e.deepLinkTab&&i(`/projects/${e.projectId}?tab=${e.deepLinkTab}`)},yt=n.useMemo(()=>{const e=Ie.get($)??[];return!f.personal||x!=="month"?e:[...m.filter(r=>{if(!r.start_at||!L(r))return!1;const o=r.start_at.slice(0,10),l=(r.end_at||r.start_at).slice(0,10);return l>o&&o<=$&&l>=$}).map(r=>({kind:"personal",id:r.id,title:r.title,done:r.status==="done"})),...e]},[Ie,$,m,L,f.personal,x]);return t.jsxs("div",{ref:st,className:"flex h-full overflow-hidden",children:[t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden min-w-0",children:[t.jsxs("div",{className:"px-6 pt-6 pb-3 flex items-center justify-between flex-wrap gap-3",children:[t.jsxs("div",{children:[t.jsxs("h1",{className:"text-xl font-semibold flex items-center gap-2",style:{color:"var(--color-text-primary)"},children:[t.jsx(rs,{size:20}),s("agenda.title")]}),t.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--color-text-muted)"},children:s("agenda.subtitle")})]}),t.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t.jsx("div",{className:"flex gap-0.5 p-0.5 rounded-lg",style:{backgroundColor:"var(--color-bg-tertiary)"},children:["month","week","day","table"].map(e=>t.jsx("button",{onClick:()=>y(e),className:"px-2.5 py-1 text-xs rounded-md transition-all",style:x===e?{backgroundColor:"var(--color-bg-card)",color:"var(--color-text-primary)",fontWeight:600}:{color:"var(--color-text-tertiary)"},children:s(`agenda.view.${e}`)},e))}),t.jsx("button",{onClick:()=>ut(-1),className:"btn-ghost p-1.5","aria-label":"prev",children:t.jsx(Ns,{size:16})}),t.jsx("span",{className:"text-sm font-medium min-w-[140px] text-center",style:{color:"var(--color-text-primary)"},children:qt}),t.jsx("button",{onClick:()=>ut(1),className:"btn-ghost p-1.5","aria-label":"next",children:t.jsx(jt,{size:16})}),t.jsx("button",{onClick:Wt,className:"btn-ghost text-xs px-2.5 py-1.5",children:s("agenda.today")}),t.jsx(xs,{title:s("agenda.refresh"),body:s("agenda.refreshHelp"),children:t.jsx("button",{onClick:S,className:"btn-ghost p-1.5","aria-label":"refresh",children:t.jsx(kt,{size:14,className:Z?"animate-spin":""})})}),t.jsx("button",{onClick:()=>oe(!0),className:"btn-ghost p-1.5",title:s("agenda.cleanup"),"aria-label":"cleanup-memos",children:t.jsx(ae,{size:14})}),t.jsx("button",{onClick:()=>B(!0),className:"btn-ghost p-1.5",title:s("agenda.jira.settings"),"aria-label":"jira-settings",children:t.jsx(ns,{size:14})})]})]}),t.jsxs("div",{className:"px-6 pb-3 flex items-center gap-1.5 flex-wrap",children:[[{key:"personal",label:s("agenda.source.personal"),color:"var(--color-accent)"},{key:"schedule",label:s("agenda.source.schedule"),color:"var(--color-text-muted)"},{key:"planner",label:s("agenda.source.planner"),color:"var(--color-text-muted)"},...Ee?[{key:"jira",label:s("agenda.source.jira"),color:z.fg}]:[]].map(e=>{const a=f[e.key];return t.jsxs("button",{onClick:()=>Q(r=>({...r,[e.key]:!r[e.key]})),className:"text-2xs px-2 py-0.5 rounded-full flex items-center gap-1 transition-opacity",style:{backgroundColor:"var(--color-bg-secondary)",color:a?"var(--color-text-secondary)":"var(--color-text-muted)",opacity:a?1:.5},children:[t.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:e.color,opacity:a?1:.4}}),e.label]},e.key)}),Ee&&D&&t.jsx("span",{className:"text-2xs px-2 py-0.5 rounded-full cursor-help",style:{backgroundColor:"var(--color-status-error, #f87171)",color:"#fff"},title:D,children:s("agenda.jira.error")})]}),it.length>0&&t.jsxs("div",{className:"px-6 pb-3 flex items-center gap-1.5 flex-wrap",children:[t.jsx("button",{onClick:()=>Ze(null),className:"text-2xs px-2 py-0.5 rounded-full transition-colors",style:C?{backgroundColor:"var(--color-bg-secondary)",color:"var(--color-text-muted)"}:{backgroundColor:"var(--color-accent)",color:"#fff"},children:s("agenda.tags.all")}),it.map(e=>{const a=ge(e),r=C===e;return t.jsxs("button",{onClick:()=>Ze(r?null:e),className:"text-2xs px-2 py-0.5 rounded-full transition-colors",style:{backgroundColor:a.bg,color:a.fg,outline:r?`1px solid ${a.fg}`:"none"},children:["#",e]},e)})]}),t.jsxs("div",{className:"flex-1 overflow-auto px-6 pb-6",children:[x!=="table"&&t.jsx(ps,{view:x,gridDays:Pt,cols:Ft,dimOutOfMonth:Rt,monthIdx:Ot,todayKey:Bt,selectedDate:$,chipsByDay:At,maxChips:Ut,weekdayLabels:Ht,addItemLabel:s("agenda.addItem"),onSelectDate:re,onQuickAdd:$e,onChipClick:e=>Zt(e.payload),onCellContextMenu:(e,a)=>{a.preventDefault(),te({x:a.clientX,y:a.clientY,dateKey:e})},onChipContextMenu:(e,a)=>{const r=e.payload;if(r.kind!=="personal")return;const o=m.find(l=>l.id===r.id);o&&xe(o,a)},bars:Jt,onBarClick:e=>ue(e.payload),onBarContextMenu:(e,a)=>xe(e.payload,a),onBarDrag:(e,a,r)=>ft(e.payload.id,a,r),onChipDrag:(e,a,r)=>{const o=e.payload;o.kind==="personal"&&ft(o.id,a,r)},monthCellHeight:de}),x==="month"&&t.jsx("div",{onPointerDown:Lt,title:s("agenda.resizeCalendar"),className:"mt-1 h-3 flex items-center justify-center cursor-ns-resize group/handle",children:t.jsx("div",{className:"w-16 h-1 rounded-full transition-colors group-hover/handle:bg-accent/50",style:{backgroundColor:"var(--color-border)"}})}),x==="table"&&t.jsxs("div",{className:"rounded-xl overflow-hidden",style:{border:"1px solid var(--color-border)"},onContextMenu:e=>{gs(e)||(e.preventDefault(),te({x:e.clientX,y:e.clientY,dateKey:""}))},children:[t.jsxs("div",{className:"grid items-center px-3 py-2 text-2xs uppercase tracking-wider",style:{gridTemplateColumns:"1fr 150px 96px 72px",backgroundColor:"var(--color-bg-secondary)",color:"var(--color-text-muted)"},children:[t.jsx("span",{children:s("agenda.table.name")}),[["date","agenda.table.date"],["kind","agenda.table.kind"],["status","agenda.table.status"]].map(([e,a])=>{const r=v.key===e;return t.jsxs("button",{onClick:()=>R(o=>({key:e,dir:o.key===e&&o.dir==="asc"?"desc":"asc"})),className:"flex items-center gap-1 uppercase tracking-wider text-left hover:opacity-80 transition-opacity",style:{color:r?"var(--color-text-secondary)":"inherit"},children:[t.jsx("span",{children:s(a)}),t.jsx("span",{style:{opacity:r?1:0},children:v.dir==="asc"?"▲":"▼"})]},e)})]}),dt.length===0&&t.jsx("div",{className:"px-3 py-6 text-xs text-center",style:{color:"var(--color-text-muted)"},children:s("agenda.dayEmpty")}),dt.map(e=>{const a=l=>new Date(l+"T00:00").toLocaleDateString(u,{year:"numeric",month:"short",day:"numeric"}),r=e.dateKey?a(e.dateKey)+(e.endKey?` ~ ${a(e.endKey)}`:e.time?` ${e.time}`:""):"—",o=()=>{e.kind==="personal"&&e.item?ue(e.item):e.kind==="jira"&&e.url?window.open(e.url,"_blank","noopener"):e.projectId&&i(`/projects/${e.projectId}?tab=${e.deepLinkTab}`)};return t.jsxs("div",{onClick:o,onContextMenu:e.item?l=>xe(e.item,l):void 0,className:"grid items-center px-3 py-2.5 text-sm cursor-pointer transition-colors hover:bg-theme-hover",style:{gridTemplateColumns:"1fr 150px 96px 72px",borderTop:"1px solid var(--color-border)"},children:[t.jsxs("span",{className:"flex items-center gap-1.5 min-w-0 pr-2",children:[t.jsx("span",{className:"truncate",style:{color:"var(--color-text-primary)",textDecoration:e.status==="done"?"line-through":"none"},title:e.title,children:e.title}),e.item&&J(e.item.tags).slice(0,3).map(l=>{const d=ge(l);return t.jsxs("span",{className:"text-2xs px-1.5 py-0.5 rounded-full flex-shrink-0",style:{backgroundColor:d.bg,color:d.fg},children:["#",l]},l)})]}),t.jsx("span",{className:"text-xs",style:{color:"var(--color-text-secondary)"},children:r}),t.jsx("span",{className:"text-2xs",children:t.jsx("span",{className:"px-1.5 py-0.5 rounded-full font-medium",style:{backgroundColor:he(e.kind).bg,color:he(e.kind).fg},children:s(`agenda.kind.${e.kind}`)})}),t.jsx("span",{className:"text-2xs truncate",children:(()=>{if(e.kind==="jira")return e.status?t.jsx("span",{className:"px-1.5 py-0.5 rounded-full font-medium",style:{backgroundColor:Xe.bg,color:Xe.fg},children:e.status}):t.jsx("span",{style:{color:"var(--color-text-muted)"},children:"—"});if(!e.status)return t.jsx("span",{style:{color:"var(--color-text-muted)"},children:"—"});const l=e.status==="done",d=l?Bs:Xe;return t.jsx("span",{className:"px-1.5 py-0.5 rounded-full font-medium",style:{backgroundColor:d.bg,color:d.fg},children:s(l?"agenda.status.done":"agenda.status.pending")})})()})]},`${e.kind}-${e.id}`)})]})]})]}),t.jsx("div",{onPointerDown:zt,className:"w-1.5 flex-shrink-0 cursor-col-resize hover:bg-accent/40 transition-colors",style:{backgroundColor:"var(--color-border)"},title:s("agenda.resizePanel")}),t.jsxs("div",{className:"flex-shrink-0 flex flex-col overflow-hidden",style:{width:Be},children:[t.jsxs("div",{className:"px-4 pt-5 pb-3 flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold",style:{color:"var(--color-text-primary)"},children:new Date($+"T00:00").toLocaleDateString(u,{month:"long",day:"numeric",weekday:"short"})}),t.jsxs("button",{onClick:()=>$e($),className:"btn-ghost text-xs px-2 py-1 flex items-center gap-1",children:[t.jsx(Ue,{size:14}),s("agenda.add")]})]}),t.jsxs("div",{className:"flex-1 overflow-auto px-4 pb-6 flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[yt.length===0&&t.jsx("p",{className:"text-xs py-2",style:{color:"var(--color-text-muted)"},children:s("agenda.dayEmpty")}),yt.map(e=>{if(e.kind==="personal"){const a=m.find(r=>r.id===e.id);return t.jsxs("div",{onContextMenu:r=>xe(a,r),className:"group flex items-start gap-2 rounded-lg px-2.5 py-2",style:{backgroundColor:"var(--color-bg-secondary)"},children:[t.jsx("button",{onClick:()=>ht(a),className:"mt-0.5 flex-shrink-0",title:s("agenda.toggleDone"),children:t.jsx("span",{className:"w-4 h-4 rounded-md border flex items-center justify-center",style:{borderColor:"var(--color-border)",color:"var(--color-accent)"},children:a.status==="done"&&t.jsx(ze,{size:12})})}),t.jsxs("button",{onClick:()=>ue(a),className:"flex-1 text-left min-w-0",children:[t.jsxs("div",{className:"text-sm truncate",style:{color:"var(--color-text-primary)",textDecoration:a.status==="done"?"line-through":"none"},children:[e.time&&t.jsx("span",{className:"text-2xs mr-1",style:{color:"var(--color-text-muted)"},children:e.time}),a.title]}),a.description&&t.jsx("div",{className:"text-2xs truncate",style:{color:"var(--color-text-muted)"},children:a.description}),J(a.tags).length>0&&t.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:J(a.tags).map(r=>{const o=ge(r);return t.jsxs("span",{className:"text-2xs px-1.5 py-0.5 rounded-full",style:{backgroundColor:o.bg,color:o.fg},children:["#",r]},r)})})]}),t.jsx(Le,{projects:O,onMove:r=>rt(a,r),title:s("agenda.moveToPlanner")}),t.jsx("button",{onClick:()=>Me(a),className:"opacity-0 group-hover:opacity-100 transition-opacity mt-0.5",title:s("agenda.delete"),children:t.jsx(ae,{size:14,style:{color:"var(--color-text-muted)"}})})]},e.id)}if(e.kind==="jira"){const a=g.find(r=>r.key===e.id);return t.jsxs("div",{className:"group flex items-start gap-2 rounded-lg px-2.5 py-2",style:{backgroundColor:z.bg,border:`1px solid ${z.bg}`},children:[t.jsx(Ye,{size:14,className:"mt-0.5 flex-shrink-0",style:{color:z.fg}}),t.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm truncate",style:{color:"var(--color-text-primary)"},title:e.title,children:e.title}),t.jsx("div",{className:"text-2xs",style:{color:z.fg},children:"Jira"})]}),a&&t.jsx(Le,{projects:O,onMove:r=>nt(a,r),title:s("agenda.importToPlanner")}),a&&t.jsx("button",{onClick:()=>Ct(a).then(S),className:"opacity-0 group-hover:opacity-100 transition-opacity mt-0.5",title:s("agenda.jira.import"),children:t.jsx(bt,{size:14,style:{color:"var(--color-text-muted)"}})}),t.jsx("button",{onClick:()=>lt(e.id),className:"opacity-0 group-hover:opacity-100 transition-opacity mt-0.5",title:s("agenda.jira.dismiss"),children:t.jsx(fe,{size:14,style:{color:"var(--color-text-muted)"}})})]},`jira-${e.id}`)}return t.jsxs(ls,{to:`/projects/${e.projectId}?tab=${e.deepLinkTab}`,className:"flex items-start gap-2 rounded-lg px-2.5 py-2 hover:opacity-80 transition-opacity",style:{backgroundColor:"var(--color-bg-secondary)",border:"1px dashed var(--color-border)"},children:[e.kind==="schedule"?t.jsx(hs,{size:14,className:"mt-0.5 flex-shrink-0",style:{color:"var(--color-text-muted)"}}):t.jsx(Cs,{size:14,className:"mt-0.5 flex-shrink-0",style:{color:"var(--color-text-muted)"}}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"text-sm truncate",style:{color:"var(--color-text-secondary)"},children:[e.time&&t.jsx("span",{className:"text-2xs mr-1",style:{color:"var(--color-text-muted)"},children:e.time}),e.title]}),t.jsx("div",{className:"text-2xs",style:{color:"var(--color-text-muted)"},children:e.kind==="schedule"?s("agenda.fromSchedule"):s("agenda.fromPlanner")})]})]},`${e.kind}-${e.id}`)})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[t.jsx("h3",{className:"text-2xs uppercase tracking-wider",style:{color:"var(--color-text-muted)"},children:s("agenda.backlog")}),t.jsxs("button",{onClick:()=>$e(""),className:"btn-ghost text-2xs px-1.5 py-0.5 flex items-center gap-1",children:[t.jsx(Ue,{size:12}),s("agenda.memo")]})]}),t.jsxs("div",{className:"flex flex-col gap-1.5",children:[ct.length===0&&t.jsx("p",{className:"text-xs py-1",style:{color:"var(--color-text-muted)"},children:s("agenda.backlogEmpty")}),ct.map(e=>t.jsxs("div",{onContextMenu:a=>xe(e,a),className:"group flex items-start gap-2 rounded-lg px-2.5 py-2",style:{backgroundColor:"var(--color-bg-secondary)"},children:[t.jsx("button",{onClick:()=>ht(e),className:"mt-0.5 flex-shrink-0",children:t.jsx("span",{className:"w-4 h-4 rounded-md border flex items-center justify-center",style:{borderColor:"var(--color-border)",color:"var(--color-accent)"},children:e.status==="done"&&t.jsx(ze,{size:12})})}),t.jsxs("button",{onClick:()=>ue(e),className:"flex-1 text-left min-w-0",children:[t.jsx("div",{className:"text-sm truncate",style:{color:"var(--color-text-primary)",textDecoration:e.status==="done"?"line-through":"none"},children:e.title}),e.description&&t.jsx("div",{className:"text-2xs truncate",style:{color:"var(--color-text-muted)"},children:e.description}),J(e.tags).length>0&&t.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:J(e.tags).map(a=>{const r=ge(a);return t.jsxs("span",{className:"text-2xs px-1.5 py-0.5 rounded-full",style:{backgroundColor:r.bg,color:r.fg},children:["#",a]},a)})})]}),t.jsx(Le,{projects:O,onMove:a=>rt(e,a),title:s("agenda.moveToPlanner")}),t.jsx("button",{onClick:()=>Me(e),className:"opacity-0 group-hover:opacity-100 transition-opacity mt-0.5",children:t.jsx(ae,{size:14,style:{color:"var(--color-text-muted)"}})})]},e.id))]})]}),Ee&&f.jira&&!C&&g.some(e=>!e.duedate)&&t.jsxs("div",{children:[t.jsx("h3",{className:"text-2xs uppercase tracking-wider mb-1.5",style:{color:z.fg},children:s("agenda.jira.noDue")}),t.jsx("div",{className:"flex flex-col gap-1.5",children:g.filter(e=>!e.duedate).map(e=>t.jsxs("div",{className:"group flex items-start gap-2 rounded-lg px-2.5 py-2",style:{backgroundColor:z.bg},children:[t.jsx(Ye,{size:14,className:"mt-0.5 flex-shrink-0",style:{color:z.fg}}),t.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"text-sm truncate",style:{color:"var(--color-text-primary)"},title:`${e.key} · ${e.summary}`,children:[e.key," · ",e.summary]}),t.jsx("div",{className:"text-2xs",style:{color:z.fg},children:e.status||"Jira"})]}),t.jsx(Le,{projects:O,onMove:a=>nt(e,a),title:s("agenda.importToPlanner")}),t.jsx("button",{onClick:()=>Ct(e).then(S),className:"opacity-0 group-hover:opacity-100 transition-opacity mt-0.5",title:s("agenda.jira.import"),children:t.jsx(bt,{size:14,style:{color:"var(--color-text-muted)"}})}),t.jsx("button",{onClick:()=>lt(e.key),className:"opacity-0 group-hover:opacity-100 transition-opacity mt-0.5",title:s("agenda.jira.dismiss"),children:t.jsx(fe,{size:14,style:{color:"var(--color-text-muted)"}})})]},`jira-nd-${e.key}`))})]}),Ee&&f.jira&&!C&&N.length>0&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>h(e=>!e),className:"text-2xs uppercase tracking-wider mb-1.5 flex items-center gap-1 hover:opacity-80",style:{color:"var(--color-text-muted)"},children:[s("agenda.jira.dismissedTitle")," (",N.length,")",t.jsx(jt,{size:12,style:{transform:w?"rotate(90deg)":"none",transition:"transform 0.15s"}})]}),w&&t.jsx("div",{className:"flex flex-col gap-1",children:N.map(e=>t.jsxs("div",{className:"group flex items-center gap-2 rounded-lg px-2.5 py-1.5",style:{backgroundColor:"var(--color-bg-secondary)"},children:[t.jsx("span",{className:"flex-1 text-2xs font-mono truncate",style:{color:"var(--color-text-muted)"},children:e}),t.jsx("button",{onClick:()=>Kt(e),className:"opacity-0 group-hover:opacity-100 transition-opacity",title:s("agenda.jira.restore"),children:t.jsx(kt,{size:12,style:{color:"var(--color-text-muted)"}})})]},`jira-dismissed-${e}`))})]})]})]}),A&&t.jsx(fs,{x:A.x,y:A.y,onClose:()=>te(null),children:A.item?t.jsxs("button",{type:"button",className:ys,onClick:()=>Me(A.item),children:[t.jsx(ae,{size:14}),s("agenda.delete")]}):t.jsxs("button",{type:"button",className:js,onClick:()=>$e(A.dateKey),children:[t.jsx(Ue,{size:14}),s("agenda.memo")]})}),Fe&&t.jsx("div",{className:"fixed inset-0 z-tooltip flex items-center justify-center p-6",style:{backgroundColor:"rgba(0,0,0,0.4)"},onClick:Te,children:t.jsxs("div",{className:`rounded-2xl shadow-xl flex flex-col ${_?"w-[94vw] h-[92vh] max-w-[1200px]":"w-full max-w-3xl"}`,style:{backgroundColor:"var(--color-bg-card)",maxHeight:_?"92vh":"88vh"},onClick:e=>e.stopPropagation(),children:[t.jsxs("div",{className:"flex items-center justify-between px-5 pt-4",children:[t.jsx("button",{onClick:()=>F(e=>!e),className:"btn-ghost p-1.5",title:s(_?"agenda.collapse":"agenda.expand"),children:_?t.jsx(cs,{size:16}):t.jsx(is,{size:16})}),t.jsx("span",{className:"text-2xs uppercase tracking-wider",style:{color:"var(--color-text-muted)"},children:s(c?"agenda.editTitle":"agenda.addTitle")})]}),t.jsx("div",{className:"flex-1 min-h-0 overflow-auto px-5 pt-2 pb-3",children:t.jsxs("div",{className:`flex flex-col gap-3 h-full ${_?"max-w-[820px] mx-auto w-full pt-2":""}`,children:[t.jsx("input",{autoFocus:!0,value:le,onChange:e=>Re(e.target.value),onKeyDown:e=>{e.key==="Enter"&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),gt())},placeholder:s("agenda.titlePlaceholder"),className:`input-field font-semibold ${_?"text-2xl":"text-lg"}`}),t.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t.jsx("input",{type:"date",value:W,onChange:e=>{const a=e.target.value;Ae(a),a&&(!se||se<a)&&be(a)},className:"input-field w-auto"}),t.jsx("span",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:"~"}),t.jsx("input",{type:"date",value:se,min:W||void 0,onChange:e=>be(e.target.value),disabled:!W,className:"input-field w-auto disabled:opacity-40"}),c&&t.jsxs("button",{onClick:()=>Je(e=>!e),className:"btn-ghost text-xs px-2.5 py-1.5 flex items-center gap-1.5",style:ke?{color:"var(--color-accent)"}:void 0,children:[t.jsx("span",{className:"w-4 h-4 rounded-md border flex items-center justify-center",style:{borderColor:"var(--color-border)"},children:ke&&t.jsx(ze,{size:12})}),s(ke?"agenda.status.done":"agenda.status.pending")]})]}),t.jsx("p",{className:"text-2xs",style:{color:"var(--color-text-muted)"},children:s("agenda.dateHint")}),t.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap rounded-lg px-2 py-1.5",style:{border:"1px solid var(--color-border)"},children:[q.map(e=>{const a=ge(e);return t.jsxs("span",{className:"text-2xs px-1.5 py-0.5 rounded-full flex items-center gap-1",style:{backgroundColor:a.bg,color:a.fg},children:["#",e,t.jsx("button",{onClick:()=>xt(e),className:"hover:opacity-70",title:s("agenda.delete"),children:"×"})]},e)}),t.jsx("input",{value:Ce,onChange:e=>we(e.target.value),onKeyDown:e=>{e.key==="Enter"||e.key===","?(e.preventDefault(),mt(Ce)):e.key==="Backspace"&&!Ce&&q.length&&xt(q[q.length-1])},onBlur:()=>mt(Ce),placeholder:q.length?"":s("agenda.tags.placeholder"),className:"flex-1 min-w-[80px] bg-transparent border-none outline-none text-sm",style:{color:"var(--color-text-primary)"}})]}),t.jsx("textarea",{value:ve,onChange:e=>Ke(e.target.value),onPaste:Xt,onDrop:Yt,onDragOver:e=>{e.preventDefault(),e.stopPropagation()},placeholder:s("agenda.descPlaceholder"),className:"input-field flex-1 min-h-[280px] resize-y leading-relaxed"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("button",{type:"button",onClick:()=>{var e;return(e=Qe.current)==null?void 0:e.click()},className:"inline-flex items-center gap-1 px-2 py-1 rounded-md text-xs btn-ghost",children:[t.jsx(vs,{size:14}),s("plannerForm.addImage")]}),t.jsx("span",{className:"text-2xs",style:{color:"var(--color-text-muted)"},children:s("plannerForm.pasteHint")})]}),t.jsx("input",{ref:Qe,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{e.target.files&&me(e.target.files),e.target.value=""}}),Qt>0&&t.jsxs("div",{className:"flex flex-wrap gap-2",children:[Ge.map(e=>t.jsxs("div",{className:"relative group",children:[t.jsx("img",{src:c?Nt(c.id,e.id):"",alt:e.originalName,onClick:()=>c&&He(Nt(c.id,e.id)),className:"h-20 w-20 object-cover rounded-lg cursor-zoom-in",style:{border:"1px solid var(--color-border)"}}),t.jsx("button",{type:"button",onClick:()=>Vt(e.id),className:"absolute -top-1.5 -right-1.5 h-5 w-5 rounded-full bg-status-error text-white flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(fe,{size:12})})]},e.id)),Se.map(e=>t.jsxs("div",{className:"relative group",children:[t.jsx("img",{src:e.preview,alt:e.name,onClick:()=>He(e.preview),className:"h-20 w-20 object-cover rounded-lg cursor-zoom-in",style:{border:"1px solid var(--color-border)"}}),t.jsx("button",{type:"button",onClick:()=>Gt(e.id),className:"absolute -top-1.5 -right-1.5 h-5 w-5 rounded-full bg-status-error text-white flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(fe,{size:12})})]},e.id))]})]})}),t.jsxs("div",{className:"flex justify-end gap-2 px-5 py-4 border-t",style:{borderColor:"var(--color-border)"},children:[c&&t.jsxs("button",{onClick:async()=>{await Me(c)&&Te()},className:"btn-ghost text-sm mr-auto flex items-center gap-1.5",style:{color:"var(--color-status-error, #f87171)"},children:[t.jsx(ae,{size:14}),s("agenda.delete")]}),t.jsx("button",{onClick:Te,className:"btn-ghost text-sm",children:s("agenda.cancel")}),t.jsx("button",{onClick:gt,disabled:!pt,className:"btn-primary text-sm disabled:opacity-40",children:s("agenda.save")})]})]})}),Ve&&t.jsx(bs,{src:Ve,onClose:()=>He(null)}),V&&t.jsx(Ws,{initial:K,onClose:()=>B(!1),onSaved:e=>{G(e),B(!1),S()}}),ye&&t.jsx(Us,{items:m,defaultFrom:De,defaultTo:_e,onClose:()=>oe(!1),onDone:()=>{oe(!1),S()}})]})}function Us({items:s,defaultFrom:u,defaultTo:I,onClose:i,onDone:x}){const{t:y}=Pe(),[v,R]=n.useState(u),[k,P]=n.useState(I),[m,M]=n.useState(!1),[p,j]=n.useState(!1),[g,T]=n.useState(!1),N=n.useCallback(h=>{if(m&&h.status!=="done")return!1;if(!h.start_at)return p;if(!v||!k)return!1;const D=h.start_at.slice(0,10),Y=(h.end_at||h.start_at).slice(0,10);return D<=k&&Y>=v},[v,k,m,p]),b=n.useMemo(()=>s.filter(N).length,[s,N]),w=async()=>{if(b!==0){T(!0);try{await Is({from:v,to:k,done_only:m,include_backlog:p}),x()}catch{T(!1)}}};return t.jsx(Et,{open:!0,onClose:i,size:"md",children:t.jsxs("div",{className:"bg-theme-card border border-theme-border rounded-2xl shadow-elevated flex flex-col overflow-hidden",style:{maxHeight:"90vh"},children:[t.jsxs("div",{className:"px-6 pt-6 pb-2",children:[t.jsxs("h3",{className:"text-base font-semibold flex items-center gap-2",style:{color:"var(--color-text-primary)"},children:[t.jsx(ae,{size:16}),y("agenda.cleanup.title")]}),t.jsx("p",{className:"text-xs mt-1",style:{color:"var(--color-text-muted)"},children:y("agenda.cleanup.subtitle")})]}),t.jsxs("div",{className:"px-6 overflow-auto flex flex-col gap-4 py-2",children:[t.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-medium mb-1",style:{color:"var(--color-text-secondary)"},children:y("agenda.cleanup.from")}),t.jsx("input",{type:"date",value:v,onChange:h=>R(h.target.value),className:"input-field w-auto"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-medium mb-1",style:{color:"var(--color-text-secondary)"},children:y("agenda.cleanup.to")}),t.jsx("input",{type:"date",value:k,onChange:h=>P(h.target.value),className:"input-field w-auto"})]})]}),t.jsxs("label",{className:"flex items-center gap-2 text-sm",style:{color:"var(--color-text-secondary)"},children:[t.jsx("input",{type:"checkbox",checked:m,onChange:h=>M(h.target.checked),className:"rounded-md"}),y("agenda.cleanup.doneOnly")]}),t.jsxs("label",{className:"flex items-center gap-2 text-sm",style:{color:"var(--color-text-secondary)"},children:[t.jsx("input",{type:"checkbox",checked:p,onChange:h=>j(h.target.checked),className:"rounded-md"}),y("agenda.cleanup.includeBacklog")]}),t.jsx("div",{className:"text-sm rounded-lg px-3 py-2",style:{backgroundColor:"var(--color-bg-secondary)",color:b>0?"var(--color-text-primary)":"var(--color-text-muted)"},children:b>0?`${y("agenda.cleanup.previewLabel")}: ${b}${y("agenda.cleanup.unit")}`:y("agenda.cleanup.none")})]}),t.jsxs("div",{className:"flex justify-end gap-2 px-6 py-4 border-t",style:{borderColor:"var(--color-border)"},children:[t.jsx("button",{onClick:i,className:"btn-ghost text-sm",children:y("agenda.cancel")}),t.jsxs(It,{variant:"danger",onClick:w,disabled:g||b===0,className:"text-sm",children:[y("agenda.cleanup.confirm"),b>0?` (${b})`:""]})]})]})})}function Ws({initial:s,onClose:u,onSaved:I}){const{t:i}=Pe(),[x,y]=n.useState(!!(s!=null&&s.enabled)),[v,R]=n.useState((s==null?void 0:s.base_url)??""),[k,P]=n.useState((s==null?void 0:s.email)??""),[m,M]=n.useState(""),[p,j]=n.useState((s==null?void 0:s.assignee_me)??!0),[g,T]=n.useState((s==null?void 0:s.include_done)??!1),[N,b]=n.useState((s==null?void 0:s.projects)??""),[w,h]=n.useState((s==null?void 0:s.statuses)??[]),[D,Y]=n.useState([]),[K,G]=n.useState(!1),[V,B]=n.useState(null),[ye,oe]=n.useState(""),[O,je]=n.useState((s==null?void 0:s.extra_jql)??""),[f,Q]=n.useState(!1),[Z,ee]=n.useState(null),$=()=>({enabled:x,base_url:v.trim(),email:k.trim(),api_token:m||void 0,assignee_me:p,include_done:g,projects:N.trim(),statuses:w,extra_jql:O.trim()}),re=c=>h(U=>U.includes(c)?U.filter(le=>le!==c):[...U,c]),A=async()=>{G(!0),B(null);try{await qe($());const c=await Fs();c.error?B(c.error):Y(c.statuses)}catch(c){B(c instanceof Error?c.message:i("agenda.jira.statusesNeedConn"))}finally{G(!1)}},te=async()=>{Q(!0),ee(null);try{await qe($());const c=await Ps();ee(c.ok?{ok:!0,text:c.user??""}:{ok:!1,text:c.error||"failed"})}catch(c){ee({ok:!1,text:c instanceof Error?c.message:"failed"})}finally{Q(!1)}},Fe=async()=>{Q(!0);try{I(await qe($()))}catch{Q(!1)}},ne="https://id.atlassian.com/manage-profile/security/api-tokens",_="block text-xs font-medium mb-1",F="mt-1 text-2xs leading-relaxed";return t.jsx(Et,{open:!0,onClose:u,size:"md",children:t.jsxs("div",{className:"bg-theme-card border border-theme-border rounded-2xl shadow-elevated flex flex-col overflow-hidden",style:{maxHeight:"90vh"},children:[t.jsxs("div",{className:"px-6 pt-6 pb-2",children:[t.jsx("h3",{className:"text-base font-semibold",style:{color:"var(--color-text-primary)"},children:i("agenda.jira.settings")}),t.jsx("p",{className:"text-xs mt-1",style:{color:"var(--color-text-muted)"},children:i("agenda.jira.subtitle")})]}),t.jsxs("div",{className:"px-6 overflow-auto flex flex-col gap-4 py-2",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm",style:{color:"var(--color-text-secondary)"},children:[t.jsx("input",{type:"checkbox",checked:x,onChange:c=>y(c.target.checked),className:"rounded-md"}),i("agenda.jira.enable")]}),t.jsxs("div",{children:[t.jsx("label",{className:_,style:{color:"var(--color-text-secondary)"},children:i("agenda.jira.baseUrlLabel")}),t.jsx("input",{value:v,onChange:c=>R(c.target.value),placeholder:"https://회사이름.atlassian.net",className:"input-field text-sm font-mono"}),t.jsx("p",{className:F,style:{color:"var(--color-text-muted)"},children:i("agenda.jira.baseUrlHint")})]}),t.jsxs("div",{children:[t.jsx("label",{className:_,style:{color:"var(--color-text-secondary)"},children:i("agenda.jira.emailLabel")}),t.jsx("input",{value:k,onChange:c=>P(c.target.value),placeholder:"you@company.com",className:"input-field text-sm"}),t.jsx("p",{className:F,style:{color:"var(--color-text-muted)"},children:i("agenda.jira.emailHint")})]}),t.jsxs("div",{children:[t.jsx("label",{className:_,style:{color:"var(--color-text-secondary)"},children:i("agenda.jira.tokenLabel")}),t.jsx("input",{type:"password",value:m,onChange:c=>M(c.target.value),placeholder:s!=null&&s.hasToken?i("agenda.jira.tokenSaved"):i("agenda.jira.tokenPlaceholder"),className:"input-field text-sm font-mono"}),t.jsxs("a",{href:ne,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 mt-1.5 text-xs",style:{color:"var(--color-accent)"},children:[t.jsx(Ye,{size:12}),i("agenda.jira.tokenLink")]}),t.jsxs("div",{className:"mt-1.5 text-2xs leading-relaxed rounded-lg px-2.5 py-2",style:{backgroundColor:"var(--color-bg-secondary)",color:"var(--color-text-muted)"},children:[t.jsx("div",{children:i("agenda.jira.tokenStep1")}),t.jsx("div",{children:i("agenda.jira.tokenStep2")}),t.jsx("div",{children:i("agenda.jira.tokenStep3")})]})]}),t.jsxs("div",{className:"pt-2 border-t",style:{borderColor:"var(--color-border)"},children:[t.jsx("label",{className:_,style:{color:"var(--color-text-secondary)"},children:i("agenda.jira.criteria")}),t.jsx("p",{className:F,style:{color:"var(--color-text-muted)",marginBottom:8},children:i("agenda.jira.criteriaHint")}),t.jsxs("label",{className:"flex items-center gap-2 text-sm mb-2",style:{color:"var(--color-text-secondary)"},children:[t.jsx("input",{type:"checkbox",checked:p,onChange:c=>j(c.target.checked),className:"rounded-md"}),i("agenda.jira.assigneeMe")]}),t.jsxs("label",{className:"flex items-center gap-2 text-sm mb-3",style:{color:"var(--color-text-secondary)",opacity:w.length?.4:1},children:[t.jsx("input",{type:"checkbox",checked:g,disabled:w.length>0,onChange:c=>T(c.target.checked),className:"rounded-md"}),i("agenda.jira.includeDone")]}),t.jsx("label",{className:_,style:{color:"var(--color-text-secondary)"},children:i("agenda.jira.projects")}),t.jsx("input",{value:N,onChange:c=>b(c.target.value),placeholder:"ABC, DEF",className:"input-field text-sm font-mono"}),t.jsx("p",{className:F,style:{color:"var(--color-text-muted)"},children:i("agenda.jira.projectsHint")}),t.jsxs("div",{className:"mt-3",children:[t.jsxs("div",{className:"flex items-center justify-between mb-1",children:[t.jsx("label",{className:_,style:{color:"var(--color-text-secondary)",marginBottom:0},children:i("agenda.jira.statuses")}),t.jsx(It,{onClick:A,disabled:K,className:"text-2xs px-2 py-0.5 rounded-md",style:{borderColor:"var(--color-border)",color:"var(--color-accent)"},children:i(K?"agenda.jira.statusesLoading":"agenda.jira.statusesLoad")})]}),t.jsx("p",{className:F,style:{color:"var(--color-text-muted)",marginBottom:6},children:i("agenda.jira.statusesHint")}),D.length>0&&t.jsx("input",{value:ye,onChange:c=>oe(c.target.value),placeholder:i("agenda.jira.statusesSearch"),className:"input-field text-sm mb-2"}),D.length===0?t.jsx("p",{className:"text-2xs",style:{color:V?"var(--color-status-error, #f87171)":"var(--color-text-muted)"},children:V||i("agenda.jira.statusesEmpty")}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"max-h-40 overflow-auto rounded-lg border flex flex-col",style:{borderColor:"var(--color-border)"},children:D.filter(c=>c.name.toLowerCase().includes(ye.trim().toLowerCase())).map(c=>t.jsxs("label",{className:"flex items-center gap-2 text-sm px-2.5 py-1.5 cursor-pointer",style:{color:"var(--color-text-secondary)"},children:[t.jsx("input",{type:"checkbox",checked:w.includes(c.name),onChange:()=>re(c.name),className:"rounded-md"}),t.jsx("span",{children:c.name}),c.category&&t.jsx("span",{className:"text-2xs ml-auto",style:{color:"var(--color-text-muted)"},children:c.category})]},c.name))}),V&&t.jsx("p",{className:"text-2xs mt-1",style:{color:"var(--color-status-error, #f87171)"},children:V})]})]}),t.jsx("label",{className:_+" mt-3",style:{color:"var(--color-text-secondary)"},children:i("agenda.jira.extraJql")}),t.jsx("textarea",{value:O,onChange:c=>je(c.target.value),placeholder:"labels = urgent AND priority >= High",rows:2,className:"input-field text-sm font-mono resize-y"}),t.jsx("p",{className:F,style:{color:"var(--color-text-muted)"},children:i("agenda.jira.extraJqlHint")})]}),Z&&t.jsxs("p",{className:"text-xs flex items-center gap-1",style:{color:Z.ok?"var(--color-status-success, #4ade80)":"var(--color-status-error, #f87171)"},children:[Z.ok?t.jsx(ze,{size:12}):t.jsx(fe,{size:12}),Z.text]})]}),t.jsxs("div",{className:"flex justify-between items-center px-6 py-4 border-t",style:{borderColor:"var(--color-border)"},children:[t.jsx("button",{onClick:te,disabled:f,className:"btn-ghost text-sm disabled:opacity-40",children:i("agenda.jira.test")}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("button",{onClick:u,className:"btn-ghost text-sm",children:i("agenda.cancel")}),t.jsx("button",{onClick:Fe,disabled:f,className:"btn-primary text-sm disabled:opacity-40",children:i("agenda.save")})]})]})]})})}export{Vs as default};
|
|
6
|
+
*/const ws=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],Ss=es("folder-input",ws);function Ds(){return X("/api/personal-items")}function _s(s){return H("/api/personal-items",s)}function We(s,u){return _t(`/api/personal-items/${s}`,u)}function Es(s){return Dt(`/api/personal-items/${s}`)}function Is(s){return H("/api/personal-items/bulk-delete",s)}function $s(s,u){return H(`/api/personal-items/${s}/images`,{images:u})}function Ts(s,u){return Dt(`/api/personal-items/${s}/images/${u}`)}function Nt(s,u){return`/api/personal-items/${s}/images/${u}`}function Ms(s,u){return X(`/api/agenda?from=${encodeURIComponent(s)}&to=${encodeURIComponent(u)}`)}function Ls(s,u){return X(`/api/agenda/jira?from=${encodeURIComponent(s)}&to=${encodeURIComponent(u)}`)}function zs(){return X("/api/agenda/jira-config")}function qe(s){return _t("/api/agenda/jira-config",s)}function Ps(){return X("/api/agenda/jira-test")}function Fs(){return X("/api/agenda/jira/statuses")}function Rs(){return X("/api/agenda/jira/dismissed")}function Ks(s){return H("/api/agenda/jira/dismiss",{key:s})}function As(s){return H("/api/agenda/jira/undismiss",{key:s})}function Ct(s){return H("/api/agenda/jira/import",{key:s.key,summary:s.summary,duedate:s.duedate,url:s.url})}function Js(s,u){return H(`/api/personal-items/${s}/move-to-planner`,{project_id:u})}function Hs(s,u){return H("/api/agenda/jira/import-to-planner",{project_id:u,key:s.key,summary:s.summary,duedate:s.duedate,url:s.url})}function Le({projects:s,onMove:u,title:I}){const{t:i}=Pe(),[x,y]=n.useState(!1),[v,R]=n.useState(!1),[k,P]=n.useState({top:0,left:0}),m=n.useRef(null),M=n.useRef(null),p=n.useCallback(()=>{if(!m.current)return;const j=m.current.getBoundingClientRect(),g=window.innerWidth,T=window.innerHeight;let N=j.bottom+4;const b=M.current;if(b){const w=b.offsetWidth,h=b.offsetHeight;let D=j.right-w;D<8&&(D=8),D+w>g-8&&(D=g-8-w),N+h>T-8&&(N=j.top-h-4),P({top:N,left:D}),R(!0)}else P({top:N,left:Math.max(8,j.right-180)})},[]);return n.useEffect(()=>{if(!x){R(!1);return}p();const j=requestAnimationFrame(p),g=T=>{var b,w;const N=T.target;(b=m.current)!=null&&b.contains(N)||(w=M.current)!=null&&w.contains(N)||y(!1)};return document.addEventListener("mousedown",g),window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{cancelAnimationFrame(j),document.removeEventListener("mousedown",g),window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[x,p]),t.jsxs(t.Fragment,{children:[t.jsx("button",{ref:m,onClick:j=>{j.stopPropagation(),y(g=>!g)},className:"opacity-0 group-hover:opacity-100 transition-opacity mt-0.5",title:I,children:t.jsx(Ss,{size:14,style:{color:"var(--color-text-muted)"}})}),x&&ts.createPortal(t.jsxs("div",{ref:M,className:"fixed z-tooltip min-w-[180px] max-h-[280px] overflow-auto rounded-xl py-1 shadow-elevated",style:{top:k.top,left:k.left,opacity:v?1:0,backgroundColor:"var(--color-bg-card)",border:"1px solid var(--color-border)"},children:[t.jsx("div",{className:"px-3 py-1 text-2xs uppercase tracking-wider",style:{color:"var(--color-text-muted)"},children:I}),s.length===0&&t.jsx("div",{className:"px-3 py-1.5 text-xs",style:{color:"var(--color-text-muted)"},children:i("agenda.noProjects")}),s.map(j=>t.jsx("button",{onClick:g=>{g.stopPropagation(),y(!1),u(j.id)},className:"block w-full px-3 py-1.5 text-xs text-left hover:bg-warm-100 rounded-md transition-colors truncate",style:{color:"var(--color-text-primary)"},title:j.name,children:j.name},j.id))]}),document.body)]})}function J(s){if(!s)return[];try{const u=JSON.parse(s);return Array.isArray(u)?u.filter(I=>typeof I=="string"):[]}catch{return[]}}const wt=[210,145,35,320,265,0,175,95];function ge(s){let u=0;for(let i=0;i<s.length;i++)u=u*31+s.charCodeAt(i)>>>0;const I=wt[u%wt.length];return{bg:`hsla(${I}, 60%, 50%, 0.18)`,fg:`hsl(${I}, 65%, 70%)`}}const z={bg:"rgba(38,132,255,0.18)",fg:"rgb(101,164,255)"};function he(s){switch(s){case"jira":return z;case"personal":return{bg:"hsla(238, 70%, 60%, 0.18)",fg:"hsl(238, 70%, 72%)"};case"schedule":return{bg:"hsla(160, 60%, 45%, 0.18)",fg:"hsl(160, 60%, 62%)"};case"planner":return{bg:"hsla(35, 80%, 55%, 0.20)",fg:"hsl(35, 85%, 66%)"}}}const St={personal:0,schedule:1,planner:2,jira:3},Bs={bg:"hsla(145, 60%, 48%, 0.18)",fg:"hsl(145, 60%, 66%)"},Xe={bg:"hsla(218, 32%, 56%, 0.20)",fg:"hsl(218, 36%, 78%)"};let Us=0;function Vs(){const{t:s,lang:u}=Pe(),{confirm:I}=ss(),i=as(),[x,y]=n.useState("month"),[v,R]=n.useState({key:"date",dir:"asc"}),[k,P]=n.useState(()=>new Date),[m,M]=n.useState([]),[p,j]=n.useState({personal:[],schedules:[],planner:[]}),[g,T]=n.useState([]),[N,b]=n.useState([]),[w,h]=n.useState(!1),[D,Y]=n.useState(null),[K,G]=n.useState(null),[V,B]=n.useState(!1),[ye,oe]=n.useState(!1),[U,je]=n.useState([]),[f,Q]=n.useState({personal:!0,schedule:!0,planner:!0,jira:!0}),[Z,ee]=n.useState(!0),[$,re]=n.useState(()=>pe(new Date)),[A,te]=n.useState(null),[Fe,ne]=n.useState(!1),[_,F]=n.useState(!1),[c,O]=n.useState(null),[le,Re]=n.useState(""),[ve,Ke]=n.useState(""),[W,Ae]=n.useState(""),[se,be]=n.useState(""),[ke,Je]=n.useState(!1),[q,Ne]=n.useState([]),[Ce,we]=n.useState(""),[Se,ce]=n.useState([]),[Ge,ie]=n.useState([]),[Ve,He]=n.useState(null),Qe=n.useRef(null),[C,Ze]=n.useState(null),et=260,tt=760,st=n.useRef(null),[Be,$t]=n.useState(()=>{const e=parseInt(localStorage.getItem("agendaPanelWidth")||"",10);return Number.isFinite(e)&&e>=et&&e<=tt?e:320});n.useEffect(()=>{try{localStorage.setItem("agendaPanelWidth",String(Be))}catch{}},[Be]);const at=64,ot=280,Tt=6,[de,Mt]=n.useState(()=>{const e=parseInt(localStorage.getItem("agendaCellHeight")||"",10);return Number.isFinite(e)&&e>=at&&e<=ot?e:92});n.useEffect(()=>{try{localStorage.setItem("agendaCellHeight",String(Math.round(de)))}catch{}},[de]);const Lt=e=>{e.preventDefault();const a=e.clientY,r=de,o=d=>{Mt(Math.min(ot,Math.max(at,r+(d.clientY-a)/Tt)))},l=()=>{window.removeEventListener("pointermove",o),window.removeEventListener("pointerup",l),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="ns-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",o),window.addEventListener("pointerup",l)},zt=e=>{e.preventDefault();const a=o=>{var d;const l=(d=st.current)==null?void 0:d.getBoundingClientRect();l&&$t(Math.min(tt,Math.max(et,l.right-o.clientX)))},r=()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",r),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",a),window.addEventListener("pointerup",r)},{rangeStart:De,rangeEnd:_e,gridDays:Pt,cols:Ft,dimOutOfMonth:Rt}=ds(x,k),S=n.useCallback(async()=>{ee(!0);try{const[e,a]=await Promise.all([Ds(),Ms(De,_e)]);M(e),j(a)}catch{}finally{ee(!1)}try{const{issues:e}=await Ls(De,_e);T(e),Y(null)}catch(e){T([]),Y(e instanceof Error?e.message:"Jira fetch failed")}try{const{keys:e}=await Rs();b(e)}catch{}},[De,_e]);n.useEffect(()=>{S()},[S]),n.useEffect(()=>{zs().then(G).catch(()=>G(null))},[]);const Ee=!!(K!=null&&K.enabled&&K.hasToken);n.useEffect(()=>{os().then(je).catch(()=>je([]))},[]);const rt=(e,a)=>Js(e.id,a).then(S),nt=(e,a)=>Hs(e,a).then(S),lt=e=>Ks(e).then(S),Kt=e=>As(e).then(S);n.useEffect(()=>{x==="day"&&re(pe(k))},[x,k]);const L=n.useCallback(e=>!C||J(e.tags).includes(C),[C]),Ie=n.useMemo(()=>{const e=new Map,a=(o,l)=>{const d=e.get(o)??[];d.push(l),e.set(o,d)},r=o=>{const l=new Date(o+"T00:00");return l.setDate(l.getDate()+1),pe(l)};for(const o of f.personal?m:[]){if(!o.start_at||!L(o))continue;const l=o.start_at.slice(0,10),d=(o.end_at||o.start_at).slice(0,10);if(!(x==="month"&&d>l))if(x==="month"||d<=l)a(l,{kind:"personal",id:o.id,title:o.title,done:o.status==="done"});else for(let E=l;E<=d;E=r(E))a(E,{kind:"personal",id:o.id,title:o.title,done:o.status==="done"})}for(const o of C||!f.schedule?[]:p.schedules){if(!o.at)continue;const l=vt(o.at),d=new Date(o.at).toTimeString().slice(0,5);a(l,{kind:"schedule",id:o.id,title:`${o.project_name} · ${o.title}`,time:d,projectId:o.project_id,deepLinkTab:"schedules"})}for(const o of C||!f.planner?[]:p.planner){const l=o.due_date.slice(0,10);a(l,{kind:"planner",id:o.id,title:`${o.project_name} · ${o.title}`,done:o.status==="done",projectId:o.project_id,deepLinkTab:"planner"})}for(const o of C||!f.jira?[]:g)o.duedate&&a(o.duedate.slice(0,10),{kind:"jira",id:o.key,title:`${o.key} · ${o.summary}`,url:o.url});return e},[m,p,g,C,L,f,x]),At=n.useMemo(()=>{const e=new Map;for(const[a,r]of Ie)e.set(a,r.map(o=>({key:`${o.kind}-${o.id}`,title:o.title,time:o.time,prefix:o.kind!=="personal"?"· ":void 0,bg:he(o.kind).bg,fg:o.done?"var(--color-text-muted)":he(o.kind).fg,done:o.done,payload:o,draggable:o.kind==="personal"})));return e},[Ie]),Jt=n.useMemo(()=>{if(!f.personal)return[];const e=he("personal");return m.filter(a=>{if(!a.start_at||!L(a))return!1;const r=a.start_at.slice(0,10);return(a.end_at||a.start_at).slice(0,10)>r}).map(a=>({key:`personal-bar-${a.id}`,title:a.title,startKey:a.start_at.slice(0,10),endKey:(a.end_at||a.start_at).slice(0,10),bg:e.bg,fg:a.status==="done"?"var(--color-text-muted)":e.fg,done:a.status==="done",payload:a}))},[m,L,f.personal]),ct=n.useMemo(()=>m.filter(e=>!e.start_at&&L(e)),[m,L]),it=n.useMemo(()=>{const e=new Set;for(const a of m)for(const r of J(a.tags))e.add(r);return Array.from(e).sort()},[m]),dt=n.useMemo(()=>{const e=[];for(const o of f.personal?m:[])L(o)&&e.push({kind:"personal",id:o.id,title:o.title,dateKey:o.start_at?o.start_at.slice(0,10):null,endKey:o.end_at&&o.start_at&&o.end_at.slice(0,10)>o.start_at.slice(0,10)?o.end_at.slice(0,10):null,time:null,status:o.status,item:o});for(const o of C||!f.schedule?[]:p.schedules)e.push({kind:"schedule",id:o.id,title:`${o.project_name} · ${o.title}`,dateKey:o.at?vt(o.at):null,time:o.at?new Date(o.at).toTimeString().slice(0,5):null,projectId:o.project_id,deepLinkTab:"schedules"});for(const o of C||!f.planner?[]:p.planner)e.push({kind:"planner",id:o.id,title:`${o.project_name} · ${o.title}`,dateKey:o.due_date.slice(0,10),time:null,status:o.status,projectId:o.project_id,deepLinkTab:"planner"});for(const o of C||!f.jira?[]:g)e.push({kind:"jira",id:o.key,title:`${o.key} · ${o.summary}`,dateKey:o.duedate?o.duedate.slice(0,10):null,time:null,status:o.status,url:o.url});const a=(o,l)=>{if(!o.dateKey&&!l.dateKey)return 0;if(!o.dateKey)return 1;if(!l.dateKey)return-1;const d=o.dateKey<l.dateKey?-1:o.dateKey>l.dateKey?1:0;return d!==0?d:(o.time||"").localeCompare(l.time||"")},r=v.dir==="asc"?1:-1;return e.sort((o,l)=>{let d=0;if(v.key==="kind")d=St[o.kind]-St[l.kind];else if(v.key==="status"){const E=o.status||"",Ue=l.status||"";if(!E&&!Ue)d=0;else if(E)if(Ue)d=E.localeCompare(Ue);else return-1;else return 1}else return a(o,l)*r;return d!==0?d*r:a(o,l)}),e},[m,p,g,C,L,f,v]),Ht=us(),Bt=pe(new Date),Ut=k.getMonth(),Ot=x==="month"?Math.max(1,Math.floor((de-28)/18)):99,ut=e=>P(a=>ks(a,x,e)),Wt=()=>{P(new Date),re(pe(new Date))},qt=ms(k,x,u),$e=e=>{O(null),Re(""),Ke(""),Ae(e??$),be(e??$),Je(!1),Ne(C?[C]:[]),we(""),ce([]),ie([]),ne(!0)},ue=e=>{O(e),Re(e.title),Ke(e.description??""),Ae(e.start_at?e.start_at.slice(0,10):""),be(e.end_at||e.start_at?(e.end_at||e.start_at).slice(0,10):""),Je(e.status==="done"),Ne(J(e.tags)),we(""),ce([]);try{ie(e.images?JSON.parse(e.images):[])}catch{ie([])}ne(!0)},mt=e=>{const a=e.trim();a&&(Ne(r=>r.includes(a)?r:[...r,a]),we(""))},xt=e=>Ne(a=>a.filter(r=>r!==e)),Te=()=>{ne(!1),O(null),F(!1),ce([]),ie([])},me=n.useCallback(e=>{const a=Array.from(e).filter(r=>r.type.startsWith("image/"));for(const r of a){const o=new FileReader;o.onload=()=>{const l=o.result,d=`pending-${++Us}`;ce(E=>[...E,{id:d,name:r.name,data:l,preview:l}])},o.readAsDataURL(r)}},[]),Xt=n.useCallback(e=>{var o;const a=(o=e.clipboardData)==null?void 0:o.items;if(!a)return;const r=[];for(let l=0;l<a.length;l++)if(a[l].type.startsWith("image/")){const d=a[l].getAsFile();d&&r.push(d)}r.length!==0&&(e.preventDefault(),me(r))},[me]),Yt=n.useCallback(e=>{var a;e.preventDefault(),e.stopPropagation(),(a=e.dataTransfer)!=null&&a.files&&me(e.dataTransfer.files)},[me]),Gt=e=>ce(a=>a.filter(r=>r.id!==e)),Vt=e=>{c&&Ts(c.id,e),ie(a=>a.filter(r=>r.id!==e))},Qt=Ge.length+Se.length,pt=!!(le.trim()||ve.trim()),gt=async()=>{if(!pt)return;const e=le.trim()||ve.trim().split(`
|
|
7
|
+
`)[0].slice(0,80)||s("agenda.untitled"),a=W||null,r=W?se&&se>=W?se:W:null,o=q.length?q:null,l={title:e,description:ve.trim()||void 0,start_at:a,end_at:r,tags:o};let d;c?(await We(c.id,{...l,status:ke?"done":"pending"}),d=c.id):d=(await _s(l)).id,Se.length>0&&await $s(d,Se.map(E=>({name:E.name,data:E.data}))),Te(),S()},ht=async e=>{await We(e.id,{status:e.status==="done"?"pending":"done"}),S()},ft=(e,a,r)=>{M(o=>o.map(l=>l.id===e?{...l,start_at:a,end_at:r}:l)),We(e,{start_at:a,end_at:r}).then(S)},Me=async e=>await I({message:s("agenda.confirmDelete"),danger:!0})?(await Es(e.id),S(),!0):!1,xe=(e,a)=>{a.preventDefault(),a.stopPropagation(),te({x:a.clientX,y:a.clientY,dateKey:"",item:e})},Zt=e=>{if(e.kind==="personal"){const a=m.find(r=>r.id===e.id);a&&ue(a)}else e.kind==="jira"?e.url&&window.open(e.url,"_blank","noopener,noreferrer"):e.projectId&&e.deepLinkTab&&i(`/projects/${e.projectId}?tab=${e.deepLinkTab}`)},yt=n.useMemo(()=>{const e=Ie.get($)??[];return!f.personal||x!=="month"?e:[...m.filter(r=>{if(!r.start_at||!L(r))return!1;const o=r.start_at.slice(0,10),l=(r.end_at||r.start_at).slice(0,10);return l>o&&o<=$&&l>=$}).map(r=>({kind:"personal",id:r.id,title:r.title,done:r.status==="done"})),...e]},[Ie,$,m,L,f.personal,x]);return t.jsxs("div",{ref:st,className:"flex h-full overflow-hidden",children:[t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden min-w-0",children:[t.jsxs("div",{className:"px-6 pt-6 pb-3 flex items-center justify-between flex-wrap gap-3",children:[t.jsxs("div",{children:[t.jsxs("h1",{className:"text-xl font-semibold flex items-center gap-2",style:{color:"var(--color-text-primary)"},children:[t.jsx(rs,{size:20}),s("agenda.title")]}),t.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--color-text-muted)"},children:s("agenda.subtitle")})]}),t.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t.jsx("div",{className:"flex gap-0.5 p-0.5 rounded-lg",style:{backgroundColor:"var(--color-bg-tertiary)"},children:["month","week","day","table"].map(e=>t.jsx("button",{onClick:()=>y(e),className:"px-2.5 py-1 text-xs rounded-md transition-all",style:x===e?{backgroundColor:"var(--color-bg-card)",color:"var(--color-text-primary)",fontWeight:600}:{color:"var(--color-text-tertiary)"},children:s(`agenda.view.${e}`)},e))}),t.jsx("button",{onClick:()=>ut(-1),className:"btn-ghost p-1.5","aria-label":"prev",children:t.jsx(Ns,{size:16})}),t.jsx("span",{className:"text-sm font-medium min-w-[140px] text-center",style:{color:"var(--color-text-primary)"},children:qt}),t.jsx("button",{onClick:()=>ut(1),className:"btn-ghost p-1.5","aria-label":"next",children:t.jsx(jt,{size:16})}),t.jsx("button",{onClick:Wt,className:"btn-ghost text-xs px-2.5 py-1.5",children:s("agenda.today")}),t.jsx(xs,{title:s("agenda.refresh"),body:s("agenda.refreshHelp"),children:t.jsx("button",{onClick:S,className:"btn-ghost p-1.5","aria-label":"refresh",children:t.jsx(kt,{size:14,className:Z?"animate-spin":""})})}),t.jsx("button",{onClick:()=>oe(!0),className:"btn-ghost p-1.5",title:s("agenda.cleanup"),"aria-label":"cleanup-memos",children:t.jsx(ae,{size:14})}),t.jsx("button",{onClick:()=>B(!0),className:"btn-ghost p-1.5",title:s("agenda.jira.settings"),"aria-label":"jira-settings",children:t.jsx(ns,{size:14})})]})]}),t.jsxs("div",{className:"px-6 pb-3 flex items-center gap-1.5 flex-wrap",children:[[{key:"personal",label:s("agenda.source.personal"),color:"var(--color-accent)"},{key:"schedule",label:s("agenda.source.schedule"),color:"var(--color-text-muted)"},{key:"planner",label:s("agenda.source.planner"),color:"var(--color-text-muted)"},...Ee?[{key:"jira",label:s("agenda.source.jira"),color:z.fg}]:[]].map(e=>{const a=f[e.key];return t.jsxs("button",{onClick:()=>Q(r=>({...r,[e.key]:!r[e.key]})),className:"text-2xs px-2 py-0.5 rounded-full flex items-center gap-1 transition-opacity",style:{backgroundColor:"var(--color-bg-secondary)",color:a?"var(--color-text-secondary)":"var(--color-text-muted)",opacity:a?1:.5},children:[t.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:e.color,opacity:a?1:.4}}),e.label]},e.key)}),Ee&&D&&t.jsx("span",{className:"text-2xs px-2 py-0.5 rounded-full cursor-help",style:{backgroundColor:"var(--color-status-error, #f87171)",color:"#fff"},title:D,children:s("agenda.jira.error")})]}),it.length>0&&t.jsxs("div",{className:"px-6 pb-3 flex items-center gap-1.5 flex-wrap",children:[t.jsx("button",{onClick:()=>Ze(null),className:"text-2xs px-2 py-0.5 rounded-full transition-colors",style:C?{backgroundColor:"var(--color-bg-secondary)",color:"var(--color-text-muted)"}:{backgroundColor:"var(--color-accent)",color:"#fff"},children:s("agenda.tags.all")}),it.map(e=>{const a=ge(e),r=C===e;return t.jsxs("button",{onClick:()=>Ze(r?null:e),className:"text-2xs px-2 py-0.5 rounded-full transition-colors",style:{backgroundColor:a.bg,color:a.fg,outline:r?`1px solid ${a.fg}`:"none"},children:["#",e]},e)})]}),t.jsxs("div",{className:"flex-1 overflow-auto px-6 pb-6",children:[x!=="table"&&t.jsx(ps,{view:x,gridDays:Pt,cols:Ft,dimOutOfMonth:Rt,monthIdx:Ut,todayKey:Bt,selectedDate:$,chipsByDay:At,maxChips:Ot,weekdayLabels:Ht,addItemLabel:s("agenda.addItem"),onSelectDate:re,onQuickAdd:$e,onChipClick:e=>Zt(e.payload),onCellContextMenu:(e,a)=>{a.preventDefault(),te({x:a.clientX,y:a.clientY,dateKey:e})},onChipContextMenu:(e,a)=>{const r=e.payload;if(r.kind!=="personal")return;const o=m.find(l=>l.id===r.id);o&&xe(o,a)},bars:Jt,onBarClick:e=>ue(e.payload),onBarContextMenu:(e,a)=>xe(e.payload,a),onBarDrag:(e,a,r)=>ft(e.payload.id,a,r),onChipDrag:(e,a,r)=>{const o=e.payload;o.kind==="personal"&&ft(o.id,a,r)},monthCellHeight:de}),x==="month"&&t.jsx("div",{onPointerDown:Lt,title:s("agenda.resizeCalendar"),className:"mt-1 h-3 flex items-center justify-center cursor-ns-resize group/handle",children:t.jsx("div",{className:"w-16 h-1 rounded-full transition-colors group-hover/handle:bg-accent/50",style:{backgroundColor:"var(--color-border)"}})}),x==="table"&&t.jsxs("div",{className:"rounded-xl overflow-hidden",style:{border:"1px solid var(--color-border)"},onContextMenu:e=>{gs(e)||(e.preventDefault(),te({x:e.clientX,y:e.clientY,dateKey:""}))},children:[t.jsxs("div",{className:"grid items-center px-3 py-2 text-2xs uppercase tracking-wider",style:{gridTemplateColumns:"1fr 150px 96px 72px",backgroundColor:"var(--color-bg-secondary)",color:"var(--color-text-muted)"},children:[t.jsx("span",{children:s("agenda.table.name")}),[["date","agenda.table.date"],["kind","agenda.table.kind"],["status","agenda.table.status"]].map(([e,a])=>{const r=v.key===e;return t.jsxs("button",{onClick:()=>R(o=>({key:e,dir:o.key===e&&o.dir==="asc"?"desc":"asc"})),className:"flex items-center gap-1 uppercase tracking-wider text-left hover:opacity-80 transition-opacity",style:{color:r?"var(--color-text-secondary)":"inherit"},children:[t.jsx("span",{children:s(a)}),t.jsx("span",{style:{opacity:r?1:0},children:v.dir==="asc"?"▲":"▼"})]},e)})]}),dt.length===0&&t.jsx("div",{className:"px-3 py-6 text-xs text-center",style:{color:"var(--color-text-muted)"},children:s("agenda.dayEmpty")}),dt.map(e=>{const a=l=>new Date(l+"T00:00").toLocaleDateString(u,{year:"numeric",month:"short",day:"numeric"}),r=e.dateKey?a(e.dateKey)+(e.endKey?` ~ ${a(e.endKey)}`:e.time?` ${e.time}`:""):"—",o=()=>{e.kind==="personal"&&e.item?ue(e.item):e.kind==="jira"&&e.url?window.open(e.url,"_blank","noopener"):e.projectId&&i(`/projects/${e.projectId}?tab=${e.deepLinkTab}`)};return t.jsxs("div",{onClick:o,onContextMenu:e.item?l=>xe(e.item,l):void 0,className:"grid items-center px-3 py-2.5 text-sm cursor-pointer transition-colors hover:bg-theme-hover",style:{gridTemplateColumns:"1fr 150px 96px 72px",borderTop:"1px solid var(--color-border)"},children:[t.jsxs("span",{className:"flex items-center gap-1.5 min-w-0 pr-2",children:[t.jsx("span",{className:"truncate",style:{color:"var(--color-text-primary)",textDecoration:e.status==="done"?"line-through":"none"},title:e.title,children:e.title}),e.item&&J(e.item.tags).slice(0,3).map(l=>{const d=ge(l);return t.jsxs("span",{className:"text-2xs px-1.5 py-0.5 rounded-full flex-shrink-0",style:{backgroundColor:d.bg,color:d.fg},children:["#",l]},l)})]}),t.jsx("span",{className:"text-xs",style:{color:"var(--color-text-secondary)"},children:r}),t.jsx("span",{className:"text-2xs",children:t.jsx("span",{className:"px-1.5 py-0.5 rounded-full font-medium",style:{backgroundColor:he(e.kind).bg,color:he(e.kind).fg},children:s(`agenda.kind.${e.kind}`)})}),t.jsx("span",{className:"text-2xs truncate",children:(()=>{if(e.kind==="jira")return e.status?t.jsx("span",{className:"px-1.5 py-0.5 rounded-full font-medium",style:{backgroundColor:Xe.bg,color:Xe.fg},children:e.status}):t.jsx("span",{style:{color:"var(--color-text-muted)"},children:"—"});if(!e.status)return t.jsx("span",{style:{color:"var(--color-text-muted)"},children:"—"});const l=e.status==="done",d=l?Bs:Xe;return t.jsx("span",{className:"px-1.5 py-0.5 rounded-full font-medium",style:{backgroundColor:d.bg,color:d.fg},children:s(l?"agenda.status.done":"agenda.status.pending")})})()})]},`${e.kind}-${e.id}`)})]})]})]}),t.jsx("div",{onPointerDown:zt,className:"w-1.5 flex-shrink-0 cursor-col-resize hover:bg-accent/40 transition-colors",style:{backgroundColor:"var(--color-border)"},title:s("agenda.resizePanel")}),t.jsxs("div",{className:"flex-shrink-0 flex flex-col overflow-hidden",style:{width:Be},children:[t.jsxs("div",{className:"px-4 pt-5 pb-3 flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold",style:{color:"var(--color-text-primary)"},children:new Date($+"T00:00").toLocaleDateString(u,{month:"long",day:"numeric",weekday:"short"})}),t.jsxs("button",{onClick:()=>$e($),className:"btn-ghost text-xs px-2 py-1 flex items-center gap-1",children:[t.jsx(Oe,{size:14}),s("agenda.add")]})]}),t.jsxs("div",{className:"flex-1 overflow-auto px-4 pb-6 flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[yt.length===0&&t.jsx("p",{className:"text-xs py-2",style:{color:"var(--color-text-muted)"},children:s("agenda.dayEmpty")}),yt.map(e=>{if(e.kind==="personal"){const a=m.find(r=>r.id===e.id);return t.jsxs("div",{onContextMenu:r=>xe(a,r),className:"group flex items-start gap-2 rounded-lg px-2.5 py-2",style:{backgroundColor:"var(--color-bg-secondary)"},children:[t.jsx("button",{onClick:()=>ht(a),className:"mt-0.5 flex-shrink-0",title:s("agenda.toggleDone"),children:t.jsx("span",{className:"w-4 h-4 rounded-md border flex items-center justify-center",style:{borderColor:"var(--color-border)",color:"var(--color-accent)"},children:a.status==="done"&&t.jsx(ze,{size:12})})}),t.jsxs("button",{onClick:()=>ue(a),className:"flex-1 text-left min-w-0",children:[t.jsxs("div",{className:"text-sm truncate",style:{color:"var(--color-text-primary)",textDecoration:a.status==="done"?"line-through":"none"},children:[e.time&&t.jsx("span",{className:"text-2xs mr-1",style:{color:"var(--color-text-muted)"},children:e.time}),a.title]}),a.description&&t.jsx("div",{className:"text-2xs truncate",style:{color:"var(--color-text-muted)"},children:a.description}),J(a.tags).length>0&&t.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:J(a.tags).map(r=>{const o=ge(r);return t.jsxs("span",{className:"text-2xs px-1.5 py-0.5 rounded-full",style:{backgroundColor:o.bg,color:o.fg},children:["#",r]},r)})})]}),t.jsx(Le,{projects:U,onMove:r=>rt(a,r),title:s("agenda.moveToPlanner")}),t.jsx("button",{onClick:()=>Me(a),className:"opacity-0 group-hover:opacity-100 transition-opacity mt-0.5",title:s("agenda.delete"),children:t.jsx(ae,{size:14,style:{color:"var(--color-text-muted)"}})})]},e.id)}if(e.kind==="jira"){const a=g.find(r=>r.key===e.id);return t.jsxs("div",{className:"group flex items-start gap-2 rounded-lg px-2.5 py-2",style:{backgroundColor:z.bg,border:`1px solid ${z.bg}`},children:[t.jsx(Ye,{size:14,className:"mt-0.5 flex-shrink-0",style:{color:z.fg}}),t.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm truncate",style:{color:"var(--color-text-primary)"},title:e.title,children:e.title}),t.jsx("div",{className:"text-2xs",style:{color:z.fg},children:"Jira"})]}),a&&t.jsx(Le,{projects:U,onMove:r=>nt(a,r),title:s("agenda.importToPlanner")}),a&&t.jsx("button",{onClick:()=>Ct(a).then(S),className:"opacity-0 group-hover:opacity-100 transition-opacity mt-0.5",title:s("agenda.jira.import"),children:t.jsx(bt,{size:14,style:{color:"var(--color-text-muted)"}})}),t.jsx("button",{onClick:()=>lt(e.id),className:"opacity-0 group-hover:opacity-100 transition-opacity mt-0.5",title:s("agenda.jira.dismiss"),children:t.jsx(fe,{size:14,style:{color:"var(--color-text-muted)"}})})]},`jira-${e.id}`)}return t.jsxs(ls,{to:`/projects/${e.projectId}?tab=${e.deepLinkTab}`,className:"flex items-start gap-2 rounded-lg px-2.5 py-2 hover:opacity-80 transition-opacity",style:{backgroundColor:"var(--color-bg-secondary)",border:"1px dashed var(--color-border)"},children:[e.kind==="schedule"?t.jsx(hs,{size:14,className:"mt-0.5 flex-shrink-0",style:{color:"var(--color-text-muted)"}}):t.jsx(Cs,{size:14,className:"mt-0.5 flex-shrink-0",style:{color:"var(--color-text-muted)"}}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"text-sm truncate",style:{color:"var(--color-text-secondary)"},children:[e.time&&t.jsx("span",{className:"text-2xs mr-1",style:{color:"var(--color-text-muted)"},children:e.time}),e.title]}),t.jsx("div",{className:"text-2xs",style:{color:"var(--color-text-muted)"},children:e.kind==="schedule"?s("agenda.fromSchedule"):s("agenda.fromPlanner")})]})]},`${e.kind}-${e.id}`)})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[t.jsx("h3",{className:"text-2xs uppercase tracking-wider",style:{color:"var(--color-text-muted)"},children:s("agenda.backlog")}),t.jsxs("button",{onClick:()=>$e(""),className:"btn-ghost text-2xs px-1.5 py-0.5 flex items-center gap-1",children:[t.jsx(Oe,{size:12}),s("agenda.memo")]})]}),t.jsxs("div",{className:"flex flex-col gap-1.5",children:[ct.length===0&&t.jsx("p",{className:"text-xs py-1",style:{color:"var(--color-text-muted)"},children:s("agenda.backlogEmpty")}),ct.map(e=>t.jsxs("div",{onContextMenu:a=>xe(e,a),className:"group flex items-start gap-2 rounded-lg px-2.5 py-2",style:{backgroundColor:"var(--color-bg-secondary)"},children:[t.jsx("button",{onClick:()=>ht(e),className:"mt-0.5 flex-shrink-0",children:t.jsx("span",{className:"w-4 h-4 rounded-md border flex items-center justify-center",style:{borderColor:"var(--color-border)",color:"var(--color-accent)"},children:e.status==="done"&&t.jsx(ze,{size:12})})}),t.jsxs("button",{onClick:()=>ue(e),className:"flex-1 text-left min-w-0",children:[t.jsx("div",{className:"text-sm truncate",style:{color:"var(--color-text-primary)",textDecoration:e.status==="done"?"line-through":"none"},children:e.title}),e.description&&t.jsx("div",{className:"text-2xs truncate",style:{color:"var(--color-text-muted)"},children:e.description}),J(e.tags).length>0&&t.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:J(e.tags).map(a=>{const r=ge(a);return t.jsxs("span",{className:"text-2xs px-1.5 py-0.5 rounded-full",style:{backgroundColor:r.bg,color:r.fg},children:["#",a]},a)})})]}),t.jsx(Le,{projects:U,onMove:a=>rt(e,a),title:s("agenda.moveToPlanner")}),t.jsx("button",{onClick:()=>Me(e),className:"opacity-0 group-hover:opacity-100 transition-opacity mt-0.5",children:t.jsx(ae,{size:14,style:{color:"var(--color-text-muted)"}})})]},e.id))]})]}),Ee&&f.jira&&!C&&g.some(e=>!e.duedate)&&t.jsxs("div",{children:[t.jsx("h3",{className:"text-2xs uppercase tracking-wider mb-1.5",style:{color:z.fg},children:s("agenda.jira.noDue")}),t.jsx("div",{className:"flex flex-col gap-1.5",children:g.filter(e=>!e.duedate).map(e=>t.jsxs("div",{className:"group flex items-start gap-2 rounded-lg px-2.5 py-2",style:{backgroundColor:z.bg},children:[t.jsx(Ye,{size:14,className:"mt-0.5 flex-shrink-0",style:{color:z.fg}}),t.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"text-sm truncate",style:{color:"var(--color-text-primary)"},title:`${e.key} · ${e.summary}`,children:[e.key," · ",e.summary]}),t.jsx("div",{className:"text-2xs",style:{color:z.fg},children:e.status||"Jira"})]}),t.jsx(Le,{projects:U,onMove:a=>nt(e,a),title:s("agenda.importToPlanner")}),t.jsx("button",{onClick:()=>Ct(e).then(S),className:"opacity-0 group-hover:opacity-100 transition-opacity mt-0.5",title:s("agenda.jira.import"),children:t.jsx(bt,{size:14,style:{color:"var(--color-text-muted)"}})}),t.jsx("button",{onClick:()=>lt(e.key),className:"opacity-0 group-hover:opacity-100 transition-opacity mt-0.5",title:s("agenda.jira.dismiss"),children:t.jsx(fe,{size:14,style:{color:"var(--color-text-muted)"}})})]},`jira-nd-${e.key}`))})]}),Ee&&f.jira&&!C&&N.length>0&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>h(e=>!e),className:"text-2xs uppercase tracking-wider mb-1.5 flex items-center gap-1 hover:opacity-80",style:{color:"var(--color-text-muted)"},children:[s("agenda.jira.dismissedTitle")," (",N.length,")",t.jsx(jt,{size:12,style:{transform:w?"rotate(90deg)":"none",transition:"transform 0.15s"}})]}),w&&t.jsx("div",{className:"flex flex-col gap-1",children:N.map(e=>t.jsxs("div",{className:"group flex items-center gap-2 rounded-lg px-2.5 py-1.5",style:{backgroundColor:"var(--color-bg-secondary)"},children:[t.jsx("span",{className:"flex-1 text-2xs font-mono truncate",style:{color:"var(--color-text-muted)"},children:e}),t.jsx("button",{onClick:()=>Kt(e),className:"opacity-0 group-hover:opacity-100 transition-opacity",title:s("agenda.jira.restore"),children:t.jsx(kt,{size:12,style:{color:"var(--color-text-muted)"}})})]},`jira-dismissed-${e}`))})]})]})]}),A&&t.jsx(fs,{x:A.x,y:A.y,onClose:()=>te(null),children:A.item?t.jsxs("button",{type:"button",className:ys,onClick:()=>Me(A.item),children:[t.jsx(ae,{size:14}),s("agenda.delete")]}):t.jsxs("button",{type:"button",className:js,onClick:()=>$e(A.dateKey),children:[t.jsx(Oe,{size:14}),s("agenda.memo")]})}),Fe&&t.jsx("div",{className:"fixed inset-0 z-tooltip flex items-center justify-center p-6",style:{backgroundColor:"rgba(0,0,0,0.4)"},onClick:Te,children:t.jsxs("div",{className:`rounded-2xl shadow-xl flex flex-col ${_?"w-[94vw] h-[92vh] max-w-[1200px]":"w-full max-w-3xl"}`,style:{backgroundColor:"var(--color-bg-card)",maxHeight:_?"92vh":"88vh"},onClick:e=>e.stopPropagation(),children:[t.jsxs("div",{className:"flex items-center justify-between px-5 pt-4",children:[t.jsx("button",{onClick:()=>F(e=>!e),className:"btn-ghost p-1.5",title:s(_?"agenda.collapse":"agenda.expand"),children:_?t.jsx(cs,{size:16}):t.jsx(is,{size:16})}),t.jsx("span",{className:"text-2xs uppercase tracking-wider",style:{color:"var(--color-text-muted)"},children:s(c?"agenda.editTitle":"agenda.addTitle")})]}),t.jsx("div",{className:"flex-1 min-h-0 overflow-auto px-5 pt-2 pb-3",children:t.jsxs("div",{className:`flex flex-col gap-3 h-full ${_?"max-w-[820px] mx-auto w-full pt-2":""}`,children:[t.jsx("input",{autoFocus:!0,value:le,onChange:e=>Re(e.target.value),onKeyDown:e=>{e.key==="Enter"&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),gt())},placeholder:s("agenda.titlePlaceholder"),className:`input-field font-semibold ${_?"text-2xl":"text-lg"}`}),t.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t.jsx("input",{type:"date",value:W,onChange:e=>{const a=e.target.value;Ae(a),a&&(!se||se<a)&&be(a)},className:"input-field w-auto"}),t.jsx("span",{className:"text-sm",style:{color:"var(--color-text-muted)"},children:"~"}),t.jsx("input",{type:"date",value:se,min:W||void 0,onChange:e=>be(e.target.value),disabled:!W,className:"input-field w-auto disabled:opacity-40"}),c&&t.jsxs("button",{onClick:()=>Je(e=>!e),className:"btn-ghost text-xs px-2.5 py-1.5 flex items-center gap-1.5",style:ke?{color:"var(--color-accent)"}:void 0,children:[t.jsx("span",{className:"w-4 h-4 rounded-md border flex items-center justify-center",style:{borderColor:"var(--color-border)"},children:ke&&t.jsx(ze,{size:12})}),s(ke?"agenda.status.done":"agenda.status.pending")]})]}),t.jsx("p",{className:"text-2xs",style:{color:"var(--color-text-muted)"},children:s("agenda.dateHint")}),t.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap rounded-lg px-2 py-1.5",style:{border:"1px solid var(--color-border)"},children:[q.map(e=>{const a=ge(e);return t.jsxs("span",{className:"text-2xs px-1.5 py-0.5 rounded-full flex items-center gap-1",style:{backgroundColor:a.bg,color:a.fg},children:["#",e,t.jsx("button",{onClick:()=>xt(e),className:"hover:opacity-70",title:s("agenda.delete"),children:"×"})]},e)}),t.jsx("input",{value:Ce,onChange:e=>we(e.target.value),onKeyDown:e=>{e.key==="Enter"||e.key===","?(e.preventDefault(),mt(Ce)):e.key==="Backspace"&&!Ce&&q.length&&xt(q[q.length-1])},onBlur:()=>mt(Ce),placeholder:q.length?"":s("agenda.tags.placeholder"),className:"flex-1 min-w-[80px] bg-transparent border-none outline-none text-sm",style:{color:"var(--color-text-primary)"}})]}),t.jsx("textarea",{value:ve,onChange:e=>Ke(e.target.value),onPaste:Xt,onDrop:Yt,onDragOver:e=>{e.preventDefault(),e.stopPropagation()},placeholder:s("agenda.descPlaceholder"),className:"input-field flex-1 min-h-[280px] resize-y leading-relaxed"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("button",{type:"button",onClick:()=>{var e;return(e=Qe.current)==null?void 0:e.click()},className:"inline-flex items-center gap-1 px-2 py-1 rounded-md text-xs btn-ghost",children:[t.jsx(vs,{size:14}),s("plannerForm.addImage")]}),t.jsx("span",{className:"text-2xs",style:{color:"var(--color-text-muted)"},children:s("plannerForm.pasteHint")})]}),t.jsx("input",{ref:Qe,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{e.target.files&&me(e.target.files),e.target.value=""}}),Qt>0&&t.jsxs("div",{className:"flex flex-wrap gap-2",children:[Ge.map(e=>t.jsxs("div",{className:"relative group",children:[t.jsx("img",{src:c?Nt(c.id,e.id):"",alt:e.originalName,onClick:()=>c&&He(Nt(c.id,e.id)),className:"h-20 w-20 object-cover rounded-lg cursor-zoom-in",style:{border:"1px solid var(--color-border)"}}),t.jsx("button",{type:"button",onClick:()=>Vt(e.id),className:"absolute -top-1.5 -right-1.5 h-5 w-5 rounded-full bg-status-error text-white flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(fe,{size:12})})]},e.id)),Se.map(e=>t.jsxs("div",{className:"relative group",children:[t.jsx("img",{src:e.preview,alt:e.name,onClick:()=>He(e.preview),className:"h-20 w-20 object-cover rounded-lg cursor-zoom-in",style:{border:"1px solid var(--color-border)"}}),t.jsx("button",{type:"button",onClick:()=>Gt(e.id),className:"absolute -top-1.5 -right-1.5 h-5 w-5 rounded-full bg-status-error text-white flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(fe,{size:12})})]},e.id))]})]})}),t.jsxs("div",{className:"flex justify-end gap-2 px-5 py-4 border-t",style:{borderColor:"var(--color-border)"},children:[c&&t.jsxs("button",{onClick:async()=>{await Me(c)&&Te()},className:"btn-ghost text-sm mr-auto flex items-center gap-1.5",style:{color:"var(--color-status-error, #f87171)"},children:[t.jsx(ae,{size:14}),s("agenda.delete")]}),t.jsx("button",{onClick:Te,className:"btn-ghost text-sm",children:s("agenda.cancel")}),t.jsx("button",{onClick:gt,disabled:!pt,className:"btn-primary text-sm disabled:opacity-40",children:s("agenda.save")})]})]})}),Ve&&t.jsx(bs,{src:Ve,onClose:()=>He(null)}),V&&t.jsx(Ws,{initial:K,onClose:()=>B(!1),onSaved:e=>{G(e),B(!1),S()}}),ye&&t.jsx(Os,{items:m,defaultFrom:De,defaultTo:_e,onClose:()=>oe(!1),onDone:()=>{oe(!1),S()}})]})}function Os({items:s,defaultFrom:u,defaultTo:I,onClose:i,onDone:x}){const{t:y}=Pe(),[v,R]=n.useState(u),[k,P]=n.useState(I),[m,M]=n.useState(!1),[p,j]=n.useState(!1),[g,T]=n.useState(!1),N=n.useCallback(h=>{if(m&&h.status!=="done")return!1;if(!h.start_at)return p;if(!v||!k)return!1;const D=h.start_at.slice(0,10),Y=(h.end_at||h.start_at).slice(0,10);return D<=k&&Y>=v},[v,k,m,p]),b=n.useMemo(()=>s.filter(N).length,[s,N]),w=async()=>{if(b!==0){T(!0);try{await Is({from:v,to:k,done_only:m,include_backlog:p}),x()}catch{T(!1)}}};return t.jsx(Et,{open:!0,onClose:i,size:"md",children:t.jsxs("div",{className:"bg-theme-card border border-theme-border rounded-2xl shadow-elevated flex flex-col overflow-hidden",style:{maxHeight:"90vh"},children:[t.jsxs("div",{className:"px-6 pt-6 pb-2",children:[t.jsxs("h3",{className:"text-base font-semibold flex items-center gap-2",style:{color:"var(--color-text-primary)"},children:[t.jsx(ae,{size:16}),y("agenda.cleanup.title")]}),t.jsx("p",{className:"text-xs mt-1",style:{color:"var(--color-text-muted)"},children:y("agenda.cleanup.subtitle")})]}),t.jsxs("div",{className:"px-6 overflow-auto flex flex-col gap-4 py-2",children:[t.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-medium mb-1",style:{color:"var(--color-text-secondary)"},children:y("agenda.cleanup.from")}),t.jsx("input",{type:"date",value:v,onChange:h=>R(h.target.value),className:"input-field w-auto"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs font-medium mb-1",style:{color:"var(--color-text-secondary)"},children:y("agenda.cleanup.to")}),t.jsx("input",{type:"date",value:k,onChange:h=>P(h.target.value),className:"input-field w-auto"})]})]}),t.jsxs("label",{className:"flex items-center gap-2 text-sm",style:{color:"var(--color-text-secondary)"},children:[t.jsx("input",{type:"checkbox",checked:m,onChange:h=>M(h.target.checked),className:"rounded-md"}),y("agenda.cleanup.doneOnly")]}),t.jsxs("label",{className:"flex items-center gap-2 text-sm",style:{color:"var(--color-text-secondary)"},children:[t.jsx("input",{type:"checkbox",checked:p,onChange:h=>j(h.target.checked),className:"rounded-md"}),y("agenda.cleanup.includeBacklog")]}),t.jsx("div",{className:"text-sm rounded-lg px-3 py-2",style:{backgroundColor:"var(--color-bg-secondary)",color:b>0?"var(--color-text-primary)":"var(--color-text-muted)"},children:b>0?`${y("agenda.cleanup.previewLabel")}: ${b}${y("agenda.cleanup.unit")}`:y("agenda.cleanup.none")})]}),t.jsxs("div",{className:"flex justify-end gap-2 px-6 py-4 border-t",style:{borderColor:"var(--color-border)"},children:[t.jsx("button",{onClick:i,className:"btn-ghost text-sm",children:y("agenda.cancel")}),t.jsxs(It,{variant:"danger",onClick:w,disabled:g||b===0,className:"text-sm",children:[y("agenda.cleanup.confirm"),b>0?` (${b})`:""]})]})]})})}function Ws({initial:s,onClose:u,onSaved:I}){const{t:i}=Pe(),[x,y]=n.useState(!!(s!=null&&s.enabled)),[v,R]=n.useState((s==null?void 0:s.base_url)??""),[k,P]=n.useState((s==null?void 0:s.email)??""),[m,M]=n.useState(""),[p,j]=n.useState((s==null?void 0:s.assignee_me)??!0),[g,T]=n.useState((s==null?void 0:s.include_done)??!1),[N,b]=n.useState((s==null?void 0:s.projects)??""),[w,h]=n.useState((s==null?void 0:s.statuses)??[]),[D,Y]=n.useState([]),[K,G]=n.useState(!1),[V,B]=n.useState(null),[ye,oe]=n.useState(""),[U,je]=n.useState((s==null?void 0:s.extra_jql)??""),[f,Q]=n.useState(!1),[Z,ee]=n.useState(null),$=()=>({enabled:x,base_url:v.trim(),email:k.trim(),api_token:m||void 0,assignee_me:p,include_done:g,projects:N.trim(),statuses:w,extra_jql:U.trim()}),re=c=>h(O=>O.includes(c)?O.filter(le=>le!==c):[...O,c]),A=async()=>{G(!0),B(null);try{await qe($());const c=await Fs();c.error?B(c.error):Y(c.statuses)}catch(c){B(c instanceof Error?c.message:i("agenda.jira.statusesNeedConn"))}finally{G(!1)}},te=async()=>{Q(!0),ee(null);try{await qe($());const c=await Ps();ee(c.ok?{ok:!0,text:c.user??""}:{ok:!1,text:c.error||"failed"})}catch(c){ee({ok:!1,text:c instanceof Error?c.message:"failed"})}finally{Q(!1)}},Fe=async()=>{Q(!0);try{I(await qe($()))}catch{Q(!1)}},ne="https://id.atlassian.com/manage-profile/security/api-tokens",_="block text-xs font-medium mb-1",F="mt-1 text-2xs leading-relaxed";return t.jsx(Et,{open:!0,onClose:u,size:"md",children:t.jsxs("div",{className:"bg-theme-card border border-theme-border rounded-2xl shadow-elevated flex flex-col overflow-hidden",style:{maxHeight:"90vh"},children:[t.jsxs("div",{className:"px-6 pt-6 pb-2",children:[t.jsx("h3",{className:"text-base font-semibold",style:{color:"var(--color-text-primary)"},children:i("agenda.jira.settings")}),t.jsx("p",{className:"text-xs mt-1",style:{color:"var(--color-text-muted)"},children:i("agenda.jira.subtitle")})]}),t.jsxs("div",{className:"px-6 overflow-auto flex flex-col gap-4 py-2",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm",style:{color:"var(--color-text-secondary)"},children:[t.jsx("input",{type:"checkbox",checked:x,onChange:c=>y(c.target.checked),className:"rounded-md"}),i("agenda.jira.enable")]}),t.jsxs("div",{children:[t.jsx("label",{className:_,style:{color:"var(--color-text-secondary)"},children:i("agenda.jira.baseUrlLabel")}),t.jsx("input",{value:v,onChange:c=>R(c.target.value),placeholder:"https://회사이름.atlassian.net",className:"input-field text-sm font-mono"}),t.jsx("p",{className:F,style:{color:"var(--color-text-muted)"},children:i("agenda.jira.baseUrlHint")})]}),t.jsxs("div",{children:[t.jsx("label",{className:_,style:{color:"var(--color-text-secondary)"},children:i("agenda.jira.emailLabel")}),t.jsx("input",{value:k,onChange:c=>P(c.target.value),placeholder:"you@company.com",className:"input-field text-sm"}),t.jsx("p",{className:F,style:{color:"var(--color-text-muted)"},children:i("agenda.jira.emailHint")})]}),t.jsxs("div",{children:[t.jsx("label",{className:_,style:{color:"var(--color-text-secondary)"},children:i("agenda.jira.tokenLabel")}),t.jsx("input",{type:"password",value:m,onChange:c=>M(c.target.value),placeholder:s!=null&&s.hasToken?i("agenda.jira.tokenSaved"):i("agenda.jira.tokenPlaceholder"),className:"input-field text-sm font-mono"}),t.jsxs("a",{href:ne,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 mt-1.5 text-xs",style:{color:"var(--color-accent)"},children:[t.jsx(Ye,{size:12}),i("agenda.jira.tokenLink")]}),t.jsxs("div",{className:"mt-1.5 text-2xs leading-relaxed rounded-lg px-2.5 py-2",style:{backgroundColor:"var(--color-bg-secondary)",color:"var(--color-text-muted)"},children:[t.jsx("div",{children:i("agenda.jira.tokenStep1")}),t.jsx("div",{children:i("agenda.jira.tokenStep2")}),t.jsx("div",{children:i("agenda.jira.tokenStep3")})]})]}),t.jsxs("div",{className:"pt-2 border-t",style:{borderColor:"var(--color-border)"},children:[t.jsx("label",{className:_,style:{color:"var(--color-text-secondary)"},children:i("agenda.jira.criteria")}),t.jsx("p",{className:F,style:{color:"var(--color-text-muted)",marginBottom:8},children:i("agenda.jira.criteriaHint")}),t.jsxs("label",{className:"flex items-center gap-2 text-sm mb-2",style:{color:"var(--color-text-secondary)"},children:[t.jsx("input",{type:"checkbox",checked:p,onChange:c=>j(c.target.checked),className:"rounded-md"}),i("agenda.jira.assigneeMe")]}),t.jsxs("label",{className:"flex items-center gap-2 text-sm mb-3",style:{color:"var(--color-text-secondary)",opacity:w.length?.4:1},children:[t.jsx("input",{type:"checkbox",checked:g,disabled:w.length>0,onChange:c=>T(c.target.checked),className:"rounded-md"}),i("agenda.jira.includeDone")]}),t.jsx("label",{className:_,style:{color:"var(--color-text-secondary)"},children:i("agenda.jira.projects")}),t.jsx("input",{value:N,onChange:c=>b(c.target.value),placeholder:"ABC, DEF",className:"input-field text-sm font-mono"}),t.jsx("p",{className:F,style:{color:"var(--color-text-muted)"},children:i("agenda.jira.projectsHint")}),t.jsxs("div",{className:"mt-3",children:[t.jsxs("div",{className:"flex items-center justify-between mb-1",children:[t.jsx("label",{className:_,style:{color:"var(--color-text-secondary)",marginBottom:0},children:i("agenda.jira.statuses")}),t.jsx(It,{onClick:A,disabled:K,className:"text-2xs px-2 py-0.5 rounded-md",style:{borderColor:"var(--color-border)",color:"var(--color-accent)"},children:i(K?"agenda.jira.statusesLoading":"agenda.jira.statusesLoad")})]}),t.jsx("p",{className:F,style:{color:"var(--color-text-muted)",marginBottom:6},children:i("agenda.jira.statusesHint")}),D.length>0&&t.jsx("input",{value:ye,onChange:c=>oe(c.target.value),placeholder:i("agenda.jira.statusesSearch"),className:"input-field text-sm mb-2"}),D.length===0?t.jsx("p",{className:"text-2xs",style:{color:V?"var(--color-status-error, #f87171)":"var(--color-text-muted)"},children:V||i("agenda.jira.statusesEmpty")}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"max-h-40 overflow-auto rounded-lg border flex flex-col",style:{borderColor:"var(--color-border)"},children:D.filter(c=>c.name.toLowerCase().includes(ye.trim().toLowerCase())).map(c=>t.jsxs("label",{className:"flex items-center gap-2 text-sm px-2.5 py-1.5 cursor-pointer",style:{color:"var(--color-text-secondary)"},children:[t.jsx("input",{type:"checkbox",checked:w.includes(c.name),onChange:()=>re(c.name),className:"rounded-md"}),t.jsx("span",{children:c.name}),c.category&&t.jsx("span",{className:"text-2xs ml-auto",style:{color:"var(--color-text-muted)"},children:c.category})]},c.name))}),V&&t.jsx("p",{className:"text-2xs mt-1",style:{color:"var(--color-status-error, #f87171)"},children:V})]})]}),t.jsx("label",{className:_+" mt-3",style:{color:"var(--color-text-secondary)"},children:i("agenda.jira.extraJql")}),t.jsx("textarea",{value:U,onChange:c=>je(c.target.value),placeholder:"labels = urgent AND priority >= High",rows:2,className:"input-field text-sm font-mono resize-y"}),t.jsx("p",{className:F,style:{color:"var(--color-text-muted)"},children:i("agenda.jira.extraJqlHint")})]}),Z&&t.jsxs("p",{className:"text-xs flex items-center gap-1",style:{color:Z.ok?"var(--color-status-success, #4ade80)":"var(--color-status-error, #f87171)"},children:[Z.ok?t.jsx(ze,{size:12}):t.jsx(fe,{size:12}),Z.text]})]}),t.jsxs("div",{className:"flex justify-between items-center px-6 py-4 border-t",style:{borderColor:"var(--color-border)"},children:[t.jsx("button",{onClick:te,disabled:f,className:"btn-ghost text-sm disabled:opacity-40",children:i("agenda.jira.test")}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("button",{onClick:u,className:"btn-ghost text-sm",children:i("agenda.cancel")}),t.jsx("button",{onClick:Fe,disabled:f,className:"btn-primary text-sm disabled:opacity-40",children:i("agenda.save")})]})]})]})})}export{Vs as default};
|