@ehfuse/taskbox 0.5.237 → 0.5.238

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/index.esm.js CHANGED
@@ -38,7 +38,7 @@ use chrome, FireFox or Internet Explorer 11`)}var r=e("safe-buffer"),t=e("random
38
38
  `).replace(/<[^>]+>/g,"").replace(/&nbsp;/gi," ").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&#39;/gi,"'").replace(/&amp;/gi,"&").replace(/\n{3,}/g,`
39
39
 
40
40
  `).trim():"";function O3(e){let p=[`[\uC5C5\uBB34] ${e.title}`],b=Yr(e.start_date),c=Yr(e.due_date);(b||c)&&p.push(`\uAE30\uAC04: ${b&&c?`${b} ~ ${c}`:b||c}`),e.manager_name&&p.push(`\uCC45\uC784\uC790: ${e.manager_name}`);let o=ir(e).name;o&&p.push(`\uC0C1\uD0DC: ${o}`);let s=dh(e.content);s&&p.push("",s);let r=String(e.note??"").trim();return r&&p.push("",`\uBE44\uACE0: ${r}`),p.join(`
41
- `)}function hh(e){navigator.clipboard.writeText(e).then(()=>R3("\uC5C5\uBB34 \uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>E3("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uB0B4\uC6A9\uC744 \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD574 \uC8FC\uC138\uC694."))}function Ci(e,p){let b=O3(e);if(p&&typeof navigator.share=="function"){navigator.share({text:b}).catch(c=>{c?.name!=="AbortError"&&hh(b)});return}hh(b)}import{Fragment as F3,jsx as jt,jsxs as ph}from"react/jsx-runtime";function mh({task:e,myAccountSeq:p=0,onToggleCompleted:b,onChangeTitle:c,onChangeIcon:o,onChangeIconColor:s,onClose:r,appBarMode:t=!1,activityItems:n,activityLoading:l,onLoadActivity:i,onPrint:a}){let f=It(),[d,u]=Oc(!1),[g,m]=Oc(null),[v,k]=Oc(null),B=e.is_notice?bt(e.icon||Gt):null,A=!!e.is_notice,L=!!e.is_event,O=A&&p>0&&(e.author_account_seq??0)===p,D=!zn(e,p),j=!L&&(A?O:(e.author_account_seq??0)===p||(e.manager_account_seq??0)===p);return ph(F3,{children:[ph(Bi,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[t&&r?jt(hs,{"aria-label":"\uB4A4\uB85C",onClick:r,sx:{color:"#37352f",ml:-1},children:jt(D3,{})}):null,j&&!t?jt(Ua,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${qr(e.completed_time)} \uC644\uB8CC`:"",arrow:!0,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:jt(Bi,{sx:{display:"flex",flexShrink:0,mr:1.5},children:jt(vn,{onClick:z=>k({anchorEl:z.currentTarget,nextCompleted:!e.completed}),children:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC\uD558\uAE30"})})}):null,t||!B?null:jt(Bi,{sx:{display:"flex",px:.5,color:e.icon_color||(A?"#e5484d":"#1e3a8a")},children:jt(B,{sx:{fontSize:20}})}),g!==null?jt(Bi,{component:"input",autoFocus:!0,spellCheck:!1,value:g,onChange:z=>m(z.target.value),onBlur:()=>{g.trim()&&g.trim()!==e.title&&c(e.seq,g.trim()),m(null)},onKeyDown:z=>{z.key==="Enter"&&z.target.blur(),z.key==="Escape"&&m(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0}}):t?jt(Bi,{sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:A?"\uACF5\uC9C0":L?"\uC77C\uC815":e.is_bug?"\uC624\uB958":"\uC5C5\uBB34"}):jt(Bi,{onClick:D?void 0:()=>m(e.title),sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:D?"default":"text",textDecoration:e.completed?"line-through":"none"},children:e.title}),i?jt(Ua,{title:"\uD65C\uB3D9",arrow:!0,children:jt(hs,{"aria-label":"\uD65C\uB3D9",onClick:()=>u(!0),sx:{color:"#6b7280"},children:jt(j3,{sx:{fontSize:20}})})}):null,jt(Ua,{title:f?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:jt(hs,{"aria-label":f?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>Ci(e,f),sx:{color:"#6b7280"},children:f?jt(P3,{sx:{fontSize:20}}):jt(N3,{sx:{fontSize:20}})})}),a?jt(Ua,{title:"\uC778\uC1C4",arrow:!0,children:jt(hs,{"aria-label":"\uC778\uC1C4",onClick:()=>a(e),sx:{color:"#6b7280"},children:jt(L3,{sx:{fontSize:20}})})}):null,r&&!t?jt(hs,{"aria-label":"\uB2EB\uAE30",onClick:r,sx:{color:"#6b7280"},children:jt(A3,{})}):null]}),jt(Mt,{open:!!v,anchorEl:v?.anchorEl??null,title:v?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:v?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>k(null),onConfirm:()=>{v&&b(e.seq,v.nextCompleted),k(null)}}),jt(Wa,{open:d,taskSeq:e.seq,items:n,loading:l,onLoad:i,onClose:()=>u(!1)})]})}import{useState as hn}from"react";import{Box as $t,Button as Ii,ButtonBase as Z3,Checkbox as J3,Divider as Go,Menu as Lc,MenuItem as Fc}from"@mui/material";import Q3 from"@mui/icons-material/ExpandLess";import e4 from"@mui/icons-material/ExpandMore";import t4 from"@mui/icons-material/ConfirmationNumberOutlined";import _h from"@mui/icons-material/Check";import r4 from"@mui/icons-material/DirectionsRunOutlined";import n4 from"@mui/icons-material/SpeedOutlined";import zc from"@mui/icons-material/CheckCircle";import o4 from"@mui/icons-material/CheckCircleOutlineOutlined";import qc from"@mui/icons-material/CheckCircleOutlined";import kh from"@mui/icons-material/AccessTimeOutlined";import i4 from"@mui/icons-material/AutorenewOutlined";import s4 from"@mui/icons-material/LabelOutlined";import a4 from"@mui/icons-material/PersonOutlineOutlined";import l4 from"@mui/icons-material/SubjectOutlined";import c4 from"@mui/icons-material/StickyNote2Outlined";import u4 from"@mui/icons-material/PanToolAltOutlined";import Sh from"@mui/icons-material/LockOutlined";import Th from"@mui/icons-material/PublicOutlined";import Ch from"@mui/icons-material/Group";import f4 from"@mui/icons-material/Repeat";import d4 from"@mui/icons-material/EventOutlined";import{Box as z3}from"@mui/material";import{jsx as q3}from"react/jsx-runtime";function gh({size:e=40}){return q3(z3,{sx:{boxSizing:"border-box",width:e,height:e,borderRadius:"50%",border:"4px solid rgba(28, 64, 125, 0.14)",borderTopColor:"#1c407d",animation:"taskbox-content-loading-spin 0.75s linear infinite","@keyframes taskbox-content-loading-spin":{to:{transform:"rotate(360deg)"}}}})}import{ConfirmDialog as Bh,InfoAlert as h4}from"@ehfuse/alerts";import{DatePicker as p4}from"@ehfuse/mui-datetime-picker";import{useState as $3}from"react";import{TextField as H3}from"@ehfuse/mui-form-controls";import{jsx as W3}from"react/jsx-runtime";function bh({value:e,onCommit:p,onDraftChange:b,readOnly:c=!1}){let[o,s]=$3(null);return W3(H3,{value:o??e,placeholder:c?"":"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",slotProps:{input:{readOnly:c}},onChange:r=>{s(r.target.value),b?.(r.target.value)},onBlur:()=>{o!==null&&o.trim()!==e&&p(o),s(null)},onKeyDown:r=>{r.key==="Enter"&&r.target.blur(),r.key==="Escape"&&s(null)},sx:{mt:1}})}import{useMemo as Pc,useState as Nc}from"react";import{Box as yr,Button as vh,IconButton as U3}from"@mui/material";import V3 from"@mui/icons-material/AccountTreeOutlined";import K3 from"@mui/icons-material/Add";import G3 from"@mui/icons-material/Close";import Y3 from"@mui/icons-material/NextPlanOutlined";function Ko(e){return e.relations??[]}function yP(e,p,b){return Ko(e).some(c=>c.type===b&&c.task_seq===p.seq)||Ko(p).some(c=>c.type===b&&c.task_seq===e.seq)}function yh(e){return`${e.created_time??""}|${String(e.seq).padStart(12,"0")}`}function Ac(e,p){let b=new Map(p.map(d=>[d.seq,d]));b.set(e.seq,e);let c=new Map,o=(d,u)=>{c.has(d)||c.set(d,new Set),c.has(u)||c.set(u,new Set),c.get(d).add(u),c.get(u).add(d)};for(let d of b.values())for(let u of Ko(d))u.type==="follow_up"&&b.has(u.task_seq)&&o(d.seq,u.task_seq);let s=new Set([e.seq]),r=[e.seq];for(;r.length>0;){let d=r.shift();for(let u of c.get(d)??[])s.has(u)||(s.add(u),r.push(u))}let t=[...s].map(d=>b.get(d)).filter(d=>!!d).sort((d,u)=>yh(d).localeCompare(yh(u))),n=new Set;for(let d of Ko(e))d.type==="related"&&n.add(d.task_seq);for(let d of b.values())d.seq!==e.seq&&Ko(d).some(u=>u.type==="related"&&u.task_seq===e.seq)&&n.add(d.seq);let l=[...n].map(d=>b.get(d)).filter(d=>d!==void 0&&d.seq!==e.seq),i=[...b.values()].filter(d=>d.seq!==e.seq&&Ko(d).some(u=>u.type==="duplicate_of"&&u.task_seq===e.seq)),a=Ko(e).find(d=>d.type==="duplicate_of")?.task_seq,f=a?b.get(a)??null:null;return{lineage:t,related:l,duplicates:i,duplicateOf:f}}function Dc(e,p){let b=Ac(e,p);return(b.lineage.length>=2?b.lineage.length-1:0)+b.related.length+b.duplicates.length+(b.duplicateOf?1:0)}function xh(e,p){return Dc(e,p)>0}import{Fragment as X3,jsx as qt,jsxs as dn}from"react/jsx-runtime";function jc({item:e,caption:p,onOpen:b,onUnlink:c}){let o=e.is_notice||e.is_event?bt(e.icon||(e.is_notice?Gt:or)):null;return dn(yr,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-relation-unlink":{opacity:1}},children:[p?qt(yr,{component:"span",sx:{flexShrink:0,px:.6,py:.1,borderRadius:.75,fontSize:11.5,fontWeight:500,color:"#8a6d1d",bgcolor:"#faf1d7"},children:p}):null,o?qt(o,{sx:{fontSize:16,flexShrink:0,color:e.icon_color||"#1e3a8a"}}):null,dn(yr,{component:"span",onClick:b,sx:{flex:1,minWidth:0,fontSize:14,color:e.completed?"#9a9a97":"#37352f",textDecoration:e.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...b?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[e.ticket_no?`${e.ticket_no} `:"",e.title]}),qt(Rt,{option:ir(e),small:!0}),c?qt(U3,{className:"taskbox-relation-unlink",size:"small","aria-label":"\uC5F0\uACB0 \uD574\uC81C",onClick:c,sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:qt(G3,{sx:{fontSize:15}})}):null]})}function wh({task:e,tasks:p,readOnly:b=!1,onOpenTask:c,onLink:o,onUnlink:s,onCreateFollowUp:r}){let[t,n]=Nc(!1),[l,i]=Nc(null),[a,f]=Nc(null),d=Pc(()=>Ac(e,p),[e,p]),u=d.lineage.length>=2,g=Pc(()=>Dc(e,p),[e,p]),m=Pc(()=>{let k=new Set;for(let B of d.lineage)k.add(B.seq);for(let B of d.related)k.add(B.seq);for(let B of d.duplicates)k.add(B.seq);return d.duplicateOf&&k.add(d.duplicateOf.seq),[...k]},[d]),v=(k,B,A)=>{f({anchorEl:k,targetSeq:B,type:A})};return dn(en,{icon:qt(V3,{sx:{fontSize:19,display:"block"}}),title:dn(X3,{children:["\uAD00\uB828 \uC5C5\uBB34",g>0?qt(yr,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:g}):null]}),titleExtra:b?null:dn(yr,{sx:{ml:"auto",display:"flex",alignItems:"center",gap:.5},children:[r?qt(vh,{size:"small",color:"inherit",startIcon:qt(Y3,{sx:{fontSize:16}}),onClick:k=>i(k.currentTarget),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uD6C4\uC18D \uC5C5\uBB34"}):null,o?qt(vh,{size:"small",color:"inherit",startIcon:qt(K3,{sx:{fontSize:16}}),onClick:()=>n(!0),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uC5F0\uACB0"}):null]}),children:[dn(yr,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:[u?qt(yr,{sx:{mb:d.related.length||d.duplicates.length||d.duplicateOf?1:0},children:d.lineage.map((k,B)=>{let A=k.seq===e.seq,L=B===d.lineage.length-1;return dn(yr,{sx:{display:"flex",gap:1},children:[dn(yr,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:14,flexShrink:0,pt:1.1},children:[qt(yr,{sx:{width:A?9:7,height:A?9:7,borderRadius:"50%",bgcolor:A?"#2f80ed":k.completed?"#9a9a97":"#c9c8c5",flexShrink:0}}),L?null:qt(yr,{sx:{width:"2px",flex:1,bgcolor:"#e6e6e3"}})]}),dn(yr,{sx:{flex:1,minWidth:0,pb:L?0:.5},children:[dn(yr,{sx:{display:"flex",alignItems:"center",gap:.75},children:[dn(yr,{component:"span",onClick:!A&&c?()=>c(k.seq):void 0,sx:{minWidth:0,fontSize:14,fontWeight:A?600:400,color:A?"#2f80ed":k.completed?"#9a9a97":"#37352f",textDecoration:k.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...!A&&c?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[k.ticket_no?`${k.ticket_no} `:"",k.title]}),qt(Rt,{option:ir(k),small:!0})]}),qt(yr,{sx:{fontSize:12,color:"#9a9a97"},children:k.completed&&k.completed_time?`${k.completed_time} \uC644\uB8CC`:k.created_time??""})]})]},k.seq)})}):null,d.duplicateOf?qt(jc,{item:d.duplicateOf,caption:"\uC6D0\uBCF8",onOpen:c?()=>c(d.duplicateOf.seq):void 0,onUnlink:!b&&s?k=>v(k.currentTarget,d.duplicateOf.seq,"duplicate_of"):void 0}):null,d.duplicates.map(k=>qt(jc,{item:k,caption:"\uC911\uBCF5",onOpen:c?()=>c(k.seq):void 0,onUnlink:!b&&s?B=>v(B.currentTarget,k.seq,"duplicate_of"):void 0},`dup-${k.seq}`)),d.related.map(k=>qt(jc,{item:k,onOpen:c?()=>c(k.seq):void 0,onUnlink:!b&&s?B=>v(B.currentTarget,k.seq,"related"):void 0},`rel-${k.seq}`)),g===0?qt(yr,{sx:{px:1.25,py:.75,fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]}),o?qt(Ea,{open:t,task:e,tasks:p,excludeSeqs:m,onClose:()=>n(!1),onSubmit:(k,B)=>o(e.seq,k,B)}):null,qt(Mt,{open:!!l,anchorEl:l,title:"\uC774 \uC5C5\uBB34\uC5D0\uC11C \uC774\uC5B4\uC9C0\uB294 \uD6C4\uC18D \uC5C5\uBB34\uB97C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>i(null),onConfirm:()=>{r?.(e.seq),i(null)}}),qt(Mt,{open:!!a,anchorEl:a?.anchorEl??null,title:"\uC774 \uC5C5\uBB34\uC640\uC758 \uC5F0\uACB0\uC744 \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uD574\uC81C",onCancel:()=>f(null),onConfirm:()=>{a&&s?.(e.seq,a.targetSeq,a.type),f(null)}})]})}import{Fragment as Mr,jsx as xe,jsxs as Lt}from"react/jsx-runtime";function So({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return xe($t,{component:"span",sx:{color:"#9a9a97"},children:e})}function Ih({task:e,customTabs:p,statusOptions:b,avatarSrcByName:c,onChangeStatus:o,onChangeLabels:s,onAddLabelOption:r,onChangeProject:t,onAddProject:n,onChangeDate:l,onChangeReminder:i,onMemberEdit:a,onChangePriority:f,onChangeVisibility:d,onChangeRepeat:u,departments:g=[],onChangeEventTime:m,onChangeEventPlace:v,onChangeEventAddress:k,onChangeNote:B,onChangeNoteDraft:A,onChangeContent:L,contentLoading:O=!1,onChangeContentHeight:D,onAddChecklistItem:j,onToggleChecklistItem:z,onRemoveChecklistItem:N,onUpdateChecklistItem:S,onReorderChecklist:T,onConvertChecklistToTask:E,onOpenChecklistTask:h,onLinkChecklistTask:y,resolveChecklistTask:w,relatedTasksPool:x,onOpenRelatedTask:_,onLinkRelatedTask:C,onUnlinkRelatedTask:P,onCreateFollowUpTask:q,onAddAttachments:$,onRemoveAttachment:W,onPreview:R,onDownload:H,onUpdateComment:M,onRemoveComment:I,onToggleCommentReaction:F,currentUserName:U="",myAccountSeq:Y=0,noticeAdmin:V=!1,hideProject:G=!1,hideLabel:te=!1,showTitle:X=!1,onChangeTitle:K,onToggleCompleted:ee,onChangeIcon:Q,onChangeIconColor:oe,employees:se=[],onAckConfirm:ce,onRequestConfirm:ne,onChangeBugField:ae,sprints:be=[],sprintProject:ve=!1,hideSprint:Le=!1,onChangeSprint:Ie,onChangeStoryPoints:le,onChangeResolution:Pe,onClaimTask:Me,onVerifyBug:ke}){let[Oe,we]=hn(null),[ye,Xe]=hn(null),[Te,fe]=hn(null),[Re,_e]=hn(!1),Se={[ln]:Re?{maxHeight:120,opacity:1,overflow:"hidden",transition:"max-height 0.25s ease, opacity 0.2s ease"}:{minHeight:0,maxHeight:0,opacity:0,overflow:"hidden",pointerEvents:"none",transition:"max-height 0.25s ease, opacity 0.2s ease"}},[ot,je]=hn(null),[Ae,yt]=hn(null),[ze,Fe]=hn(null),[ft,Ve]=hn(null),[De,Pt]=hn(null),[Ue,re]=hn(null),[ue,de]=hn(null),me=!!e.is_notice,He=!!e.is_event,Be=!!e.is_bug,Ne=!!Me&&Ys(e,Y),dt=!!Me&&Xs(e,Y),$e=!!ke&&Be&&!!e.completed&&Y>0&&(e.author_account_seq??0)===Y&&!(e.acks??[]).some(Z=>Z.account_seq===Y),Ee=!zn(e,Y),ut=!e.is_event&&(e.is_notice?Y>0&&(e.author_account_seq??0)===Y:(e.author_account_seq??0)===Y||(e.manager_account_seq??0)===Y),rt=e.is_notice||e.is_event?bt(e.icon||(e.is_notice?Gt:or)):null,et=me?!Gs(e,Y):Ee,mt=Ne||dt?Lt(vn,{onClick:Z=>de(Z.currentTarget),children:[xe(u4,{sx:{fontSize:16,mr:.5}}),"\uAC00\uC838\uAC00\uAE30"]}):null,At=me?La(e,se):"",ht=me?Yd(e,se,Y):null,_t=me?null:la(e,Y),Ft=!!(_t&&_t.total>0||me&&ht),Qt=!me,J=Lt(Mr,{children:[xe(at,{icon:xe(a4,{sx:{fontSize:17}}),label:"\uC791\uC131\uC790",sx:[In(9),Se??null,...He?[]:[Xt(1)]],children:e.created_by?Lt(Mr,{children:[xe(Tr,{names:[e.created_by],size:20,avatarSrcByName:c}),e.created_by]}):xe(So,{})}),xe(at,{icon:xe(kh,{sx:{fontSize:17}}),label:"\uC791\uC131\uC77C\uC2DC",sx:[In(11),Se??null,...He?[]:[Xt(2)]],children:e.created_time?qr(e.created_time):xe(So,{})})]});return Lt(Mr,{children:[X?Lt($t,{sx:{px:2,pt:2,pb:.5,display:"flex",alignItems:"flex-start",gap:1},children:[ut?xe(J3,{checked:e.completed,icon:xe(o4,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:xe(zc,{sx:{fontSize:22,color:"#2f80ed"}}),onChange:(Z,ge)=>{ye||Xe({anchorEl:Z.currentTarget,nextCompleted:ge})},sx:{p:0,mt:.25}}):null,rt?xe($t,{sx:{display:"flex",p:0,mt:.25,color:e.icon_color||(me?"#e5484d":"#1e3a8a")},children:xe(rt,{sx:{fontSize:20}})}):null,xe($t,{sx:{flex:1,minWidth:0},children:Oe!==null?xe($t,{component:"input",autoFocus:!0,spellCheck:!1,value:Oe,onChange:Z=>we(Z.target.value),onBlur:()=>{Oe.trim()&&Oe.trim()!==e.title&&K(e.seq,Oe.trim()),we(null)},onKeyDown:Z=>{Z.key==="Enter"&&Z.target.blur(),Z.key==="Escape"&&we(null)},sx:{width:"100%",border:"none",outline:"none",font:"inherit",fontSize:19,fontWeight:600,color:"#37352f",p:0,m:0}}):xe($t,{onClick:()=>we(e.title),sx:{fontSize:19,fontWeight:600,color:"#37352f",lineHeight:1.35,cursor:"text",textDecoration:e.completed?"line-through":"none",userSelect:"text"},children:e.title})}),xe(Mt,{open:!!ye,anchorEl:ye?.anchorEl??null,title:ye?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:ye?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>Xe(null),onConfirm:()=>{ye&&ee(e.seq,ye.nextCompleted),Xe(null)}})]}):null,Lt($t,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:0,[ln]:{pb:0,"& > :last-child":{mb:0}}},children:[xe(Ba,{hideProject:G,pinColumns:!0,values:{tabKey:e.tab_key??"",managerName:e.manager_name,receiverNames:e.receiver_names,startDate:e.start_date,dueDate:e.due_date,reminder:e.reminder,priority:e.priority,eventTime:e.event_time??"",eventPlace:e.event_place??"",eventAddress:e.event_address??""},customTabs:p,avatarSrcByName:c,hideDueDate:!He&&!!e.repeat_rule,hideReminder:!!e.repeat_rule,notice:me,event:He,readOnly:Ee,targetSummary:At,onChangeProject:Z=>t(e.seq,Z),onAddProject:n,onChangeStartDate:Z=>l(e.seq,"start_date",Z),onChangeDueDate:Z=>l(e.seq,"due_date",Z),onChangeReminder:Z=>i(e.seq,Z),onChangePriority:Z=>f(e.seq,Z),onChangeEventTime:Z=>m?.(e.seq,Z),onChangeEventPlace:Z=>v?.(e.seq,Z),onChangeEventAddress:Z=>k?.(e.seq,Z),onMemberEdit:Z=>a(e,Z,null),narrowCollapsedSx:Se,reminderLocked:e.completed,managerAction:mt,leading:Lt(Mr,{children:[$e||mt&&(me||He)?Lt($t,{sx:{gridColumn:"1 / -1",display:"flex",justifyContent:"flex-start",gap:2,px:2,py:1.5},children:[me||He?mt:null,$e?Lt(Mr,{children:[xe(Ii,{variant:"contained",size:"large",onClick:()=>ke?.(e.seq,!0),sx:{bgcolor:"#2f80ed"},children:"\uAC80\uC99D\uC644\uB8CC"}),xe(Ii,{variant:"outlined",size:"large",color:"error",onClick:()=>ke?.(e.seq,!1),children:"\uC7AC\uC624\uD508"})]}):null]}):null,Be&&e.ticket_no?xe(at,{icon:xe(t4,{sx:{fontSize:17}}),label:"\uD2F0\uCF13",sx:Xt(1),children:xe($t,{component:"span",sx:{fontVariantNumeric:"tabular-nums"},children:e.ticket_no})}):null,He?null:xe($t,{sx:Be&&e.ticket_no||Qt||Ft?Xt(Be&&e.ticket_no?2:1):{gridColumn:"1 / -1"},children:xe(at,{icon:xe(i4,{sx:{fontSize:17}}),label:"\uC0C1\uD0DC",onClick:Ee||e.completed?void 0:Z=>je(Z),children:xe(Rt,{option:ir(e)})})}),me?null:(()=>{let Z=nn(e),ge=Z==="all"?xe(Th,{sx:{fontSize:17,color:"#2f80ed"}}):Z==="group"?xe(Ch,{sx:{fontSize:17,color:"#d9730d"}}):xe(Sh,{sx:{fontSize:17}}),he=Z==="all"?"\uC804\uCCB4\uACF5\uAC1C":Z==="group"?`\uBD80\uC11C\uACF5\uAC1C \xB7 ${g.find(ie=>ie.seq===(e.visibility_group_seq??0))?.name??"\uBD80\uC11C"}`:"\uBE44\uACF5\uAC1C";return xe($t,{sx:He?void 0:Xt(Be?1:2),children:xe(at,{icon:ge,label:"\uACF5\uAC1C",onClick:Ee||!d?void 0:ie=>yt(ie),children:he})})})(),!me&&!Be?xe($t,{sx:He?void 0:Xt(1),children:xe(at,{icon:xe(f4,{sx:{fontSize:17,...e.repeat_rule?{color:"#2f80ed"}:{}}}),label:"\uBC18\uBCF5",onClick:Ee||!u?void 0:Z=>Fe(Z),children:e.repeat_rule?_a(e.repeat_rule):xe(So,{label:"\uC5C6\uC74C"})})}):null,!me&&!Be&&e.repeat_rule?xe($t,{sx:He?void 0:Xt(2),children:xe(at,{icon:xe(d4,{sx:{fontSize:17}}),label:"\uBC18\uBCF5 \uC885\uB8CC",onClick:Ee||!u?void 0:Z=>Ve(Z),children:e.repeat_until?`${e.repeat_until}\uAE4C\uC9C0`:xe(So,{})})}):null,_t&&_t.total>0?xe($t,{sx:He?void 0:Xt(2),children:xe(at,{icon:xe(qc,{sx:{fontSize:17}}),label:"\uD655\uC778",children:_t.canConfirm?xe(Ii,{size:"small",variant:"contained",onClick:()=>ce?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):Lt(Ii,{size:"small",variant:"outlined",color:"inherit",startIcon:_t.myTime?xe(zc,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:Z=>fe({anchorEl:Z.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:[_t.count," / ",_t.total]})})}):null,me&&ht?xe($t,{sx:Xt(2),children:xe(at,{icon:xe(qc,{sx:{fontSize:17}}),label:"\uD655\uC778",children:xe($t,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,minWidth:0},children:ht.canAck?xe(Ii,{size:"small",variant:"contained",onClick:()=>ce?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):xe(Ii,{size:"small",variant:"outlined",color:"inherit",startIcon:ht.acked?xe(zc,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:Z=>fe({anchorEl:Z.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:ht.total>0&&ht.count>=ht.total?"\uC644\uB8CC":Lt(Mr,{children:[ht.count,xe($t,{component:"span",sx:{mx:.4},children:"/"}),ht.total]})})})})}):null,ve&&!Le&&!He&&!me?Lt(Mr,{children:[xe(at,{icon:xe(r4,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:Ee?void 0:Z=>Pt(Z),sx:Xt(1),children:(e.sprint_seq??0)>0?be.find(Z=>Z.seq===e.sprint_seq)?.name??"\uC0AD\uC81C\uB41C \uC2A4\uD504\uB9B0\uD2B8":xe(So,{label:"\uBBF8\uBC30\uC815"})}),xe(at,{icon:xe(n4,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",sx:Xt(2),children:xe(to,{value:(e.story_points??0)>0?String(e.story_points):"",placeholder:"\uBBF8\uCD94\uC815",readOnly:Ee,onCommit:Z=>le?.(e.seq,Number(Z.replace(/[^0-9.]/g,""))||0)})})]}):null,He||te?null:xe($t,{sx:[{gridColumn:"1 / -1"},Se??null],children:xe(at,{icon:xe(s4,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:Ee?void 0:Z=>re(Z),children:(e.label_keys??[]).length>0?xe(mo,{labelKeys:e.label_keys??[],labelOptions:b}):xe(So,{})})}),He?null:J]}),trailing:Lt(Mr,{children:[Be?xe(Ia,{values:{repro:e.bug_repro??"",device:e.bug_device??"",where:e.bug_where??"",version:e.bug_version??"",resolution:e.resolution??""},readOnly:Ee,showResolution:!!e.completed,onChangeRepro:Z=>ae?.(e.seq,"bug_repro",Z),onChangeDevice:Z=>ae?.(e.seq,"bug_device",Z),onChangeWhere:Z=>ae?.(e.seq,"bug_where",Z),onChangeVersion:Z=>ae?.(e.seq,"bug_version",Z),onChangeResolution:Z=>Pe?.(e.seq,Z)}):null,He?J:null,e.completed?Lt(Mr,{children:[xe(at,{icon:xe(qc,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC790",sx:[In(10),Se??null,...He?[]:[Xt(1)]],children:e.completed_by?Lt(Mr,{children:[xe(Tr,{names:[e.completed_by],size:20,avatarSrcByName:c}),e.completed_by]}):xe(So,{})}),xe(at,{icon:xe(kh,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC77C\uC2DC",sx:[In(12),Se??null,...He?[]:[Xt(2)]],children:e.completed_time?qr(e.completed_time):xe(So,{})})]}):null]})}),Lt($t,{sx:{display:"none",[ln]:{display:"block",mt:1.5,mb:0}},children:[xe(Go,{sx:{borderColor:"#e6e6e3"}}),xe(Z3,{onClick:()=>_e(Z=>!Z),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:.5,pt:1.25,pb:1.25,fontSize:13.5,bgcolor:"#f4f4f2",color:"#37352f","&:active":{opacity:.6}},children:Re?Lt(Mr,{children:["\uC811\uAE30 ",xe(Q3,{sx:{fontSize:18}})]}):Lt(Mr,{children:["\uC815\uBCF4 \uB354\uBCF4\uAE30 ",xe(e4,{sx:{fontSize:18}})]})})]}),Lt($t,{children:[xe(Go,{sx:{my:1.5,borderColor:"#e6e6e3",[ln]:{mt:0,mb:1.25}}}),xe(en,{icon:xe(l4,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:xe($t,{sx:{userSelect:"text"},children:O?xe($t,{sx:{minHeight:e.content_height||180,display:"flex",alignItems:"center",justifyContent:"center"},children:xe(gh,{})}):xe(Ma,{syncKey:e.seq,value:e.content??"",height:e.content_height??0,onChangeHeight:D?Z=>D(e.seq,Z):void 0,readOnly:Ee,onChange:Z=>L(e.seq,Z)})})}),e.is_bug?null:Lt(Mr,{children:[xe(Go,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(en,{icon:xe(c4,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:xe($t,{sx:{userSelect:"text"},children:xe(bh,{value:e.note,readOnly:et,onCommit:Z=>B(e.seq,Z),onDraftChange:A?Z=>A(e.seq,Z):void 0})})})]}),He?null:Lt(Mr,{children:[xe(Go,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(Ra,{taskSeq:e.seq,checklist:e.checklist??[],removeLocked:et,onAdd:j,onToggle:z,onRemove:N,onUpdate:S,onReorder:T,onConvertToTask:E,onOpenLinkedTask:h,resolveLinkedTask:w,myAccountSeq:Y,linkCandidates:x,linkBaseTask:e,onLinkExistingTask:y})]}),x&&!He&&!me&&xh(e,x)?Lt(Mr,{children:[xe(Go,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(wh,{task:e,tasks:x,readOnly:Ee,onOpenTask:_,onLink:C,onUnlink:P,onCreateFollowUp:q})]}):null,xe(Go,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(Pa,{taskSeq:e.seq,attachments:e.attachments??[],removeLocked:et,onAdd:$,onRemove:W,onPreview:R?Z=>R({...Z,taskSeq:e.seq}):void 0,onDownload:H?Z=>H({...Z,taskSeq:e.seq}):void 0})]}),xe(Go,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(ch,{taskSeq:e.seq,comments:e.comments??[],currentUserName:U,myAccountSeq:Y,avatarSrcByName:c,onUpdate:M,onRemove:I,onToggleReaction:F,onPreview:R?Z=>R({...Z,taskSeq:e.seq}):void 0,onDownload:H?Z=>H({...Z,taskSeq:e.seq}):void 0})]}),xe(li,{anchorEl:ot,value:e.status,options:me?Ki:Be?Ao:Gi,onSelect:Z=>o(e.seq,Z),onClose:()=>je(null)}),xe(Lc,{transitionDuration:0,anchorEl:ze,open:!!ze,onClose:()=>Fe(null),children:[{value:"",label:"\uC5C6\uC74C"},...ss].map(Z=>xe(Fc,{selected:(e.repeat_rule??"")===Z.value,onClick:()=>{Fe(null),(async()=>{let ge=e.repeat_rule??"";if(Z.value===ge)return;if(Z.value===""){await Bh({title:"\uBC18\uBCF5 \uD574\uC81C",message:"\uC774\uD6C4 \uBC18\uBCF5 \uD68C\uCC28\uB97C \uBAA8\uB450 \uC0AD\uC81C\uD558\uACE0 \uBC18\uBCF5\uC744 \uD574\uC81C\uD560\uAE4C\uC694? (\uC9C0\uB09C \uD68C\uCC28\uB294 \uB0A8\uC2B5\uB2C8\uB2E4)"})&&u?.(e.seq,"","");return}let he=String(e.due_date??"").slice(0,10);if(!he){h4(e.is_event?"\uBC18\uBCF5\uD558\uB824\uBA74 \uC77C\uC815 \uB0A0\uC9DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.":"\uBC18\uBCF5\uD558\uB824\uBA74 \uB9C8\uAC10\uC77C\uC2DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.");return}ge&&!await Bh({title:"\uBC18\uBCF5 \uBCC0\uACBD",message:"\uC774\uD6C4 \uD68C\uCC28\uB97C \uC0C8 \uADDC\uCE59\uC73C\uB85C \uB2E4\uC2DC \uC0DD\uC131\uD560\uAE4C\uC694? \uC774\uD6C4 \uD68C\uCC28\uC758 \uB313\uAE00\xB7\uCCA8\uBD80\uB294 \uC0AC\uB77C\uC9D1\uB2C8\uB2E4."})||u?.(e.seq,Z.value,ka(he,Z.value))})()},sx:{fontSize:14,minWidth:140},children:Z.label},Z.value||"none"))}),xe(p4,{anchorEl:ft,open:!!ft,onClose:()=>Ve(null),selectedDate:e.repeat_until?new Date(`${e.repeat_until}T00:00:00`):new Date,onDateChange:Z=>{Ve(null);let ge=pe=>String(pe).padStart(2,"0"),he=`${Z.getFullYear()}-${ge(Z.getMonth()+1)}-${ge(Z.getDate())}`,ie=e.repeat_rule??"";ie&&u?.(e.seq,ie,he)}}),xe(Lc,{transitionDuration:0,anchorEl:Ae,open:!!Ae,onClose:()=>yt(null),children:[{key:"involved",label:"\uBE44\uACF5\uAC1C",icon:xe(Sh,{sx:{fontSize:17,color:"#57564f"}}),selected:nn(e)==="involved",onPick:()=>d?.(e.seq,"involved",0)},{key:"all",label:"\uC804\uCCB4\uACF5\uAC1C",icon:xe(Th,{sx:{fontSize:17,color:"#2f80ed"}}),selected:nn(e)==="all",onPick:()=>d?.(e.seq,"all",0)},...g.map(Z=>({key:`group-${Z.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${Z.name}`,icon:xe(Ch,{sx:{fontSize:17,color:"#d9730d"}}),selected:nn(e)==="group"&&(e.visibility_group_seq??0)===Z.seq,onPick:()=>d?.(e.seq,"group",Z.seq)}))].map(Z=>Lt(Fc,{selected:Z.selected,onClick:()=>{Z.onPick(),yt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[Z.icon,Z.label,Z.selected?xe(_h,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},Z.key))}),xe(Lc,{transitionDuration:0,anchorEl:De,open:!!De,onClose:()=>Pt(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...be.filter(Z=>`custom-${Z.group_seq}`===String(e.tab_key??"")).map(Z=>({seq:Z.seq,label:Jr(Z)}))].map(Z=>Lt(Fc,{onClick:()=>{Ie?.(e.seq,Z.seq),Pt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[Z.label,(e.sprint_seq??0)===Z.seq?xe(_h,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},Z.seq))}),xe(aa,{anchorEl:Te?.anchorEl??null,open:!!Te?.open,acks:e.acks??[],total:ht?.total??_t?.total??0,pendingNames:ht?.pendingNames??_t?.pendingNames??[],avatarSrcByName:c,onRequestConfirm:ne&&(ht?ht.count<ht.total:_t&&_t.count<_t.total)?()=>{ne(e.seq),fe(Z=>Z?{...Z,open:!1}:null)}:void 0,onClose:()=>fe(Z=>Z?{...Z,open:!1}:null)}),xe(ja,{anchorEl:Ue,selectedKeys:e.label_keys??[],labelOptions:b,onToggle:Z=>s(e.seq,Vs(e.label_keys??[],Z)),onAddLabel:r,onClose:()=>re(null)}),xe(Mt,{open:!!ue,anchorEl:ue,title:Ne?"\uC774 \uC5C5\uBB34\uB97C \uAC00\uC838\uC640 \uCC45\uC784\uC790\uB97C \uB9E1\uC73C\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC774 \uC5C5\uBB34\uC758 \uCC45\uC784\uC790\uB97C \uB9E1\uC73C\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uAC00\uC838\uAC00\uAE30",onCancel:()=>de(null),onConfirm:()=>{Me?.(e.seq),de(null)}})]})}import{Fragment as w4,jsx as Er,jsxs as Dh}from"react/jsx-runtime";function ZN(){let e=new Date,p=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())} ${p(e.getHours())}:${p(e.getMinutes())}`}function JN({open:e,task:p,onClose:b,onAddComment:c,onSaveFields:o,presentation:s="auto",myAccountSeq:r=0,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:l,onChangeIconColor:i,activityItems:a,activityLoading:f,onLoadActivity:d,onPrint:u,...g}){let m=It(),v=Eh(null);p&&(v.current=p);let k=p??v.current,[B,A]=Rh(!1),[L,O]=Rh({}),D=Object.keys(L).length>0;Mh(()=>{O({})},[p?.seq,e]);let j=Eh(null);if(Mh(()=>{j.current?.scrollTo({top:0})},[p?.seq]),!k)return null;let z=m&&D?{...k,...L}:k,N=z.checklist??[],S=(x,_)=>{m?O(C=>({...C,...x})):_()},T=()=>{let x=L;O({});let _=k.seq,C=x.title===void 0?void 0:String(x.title).trim();if(o){let P={...x};C!==void 0&&(C?P.title=C:delete P.title),Object.keys(P).length>0&&o(_,P),Ah({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"});return}C&&n(_,C),x.icon!==void 0&&l(_,String(x.icon)),x.icon_color!==void 0&&i?.(_,String(x.icon_color)),x.status!==void 0&&g.onChangeStatus(_,x.status),x.label_keys!==void 0&&g.onChangeLabels(_,x.label_keys??[]),x.tab_key!==void 0&&g.onChangeProject(_,String(x.tab_key??"")),x.start_date!==void 0&&g.onChangeDate(_,"start_date",String(x.start_date??"")),x.due_date!==void 0&&g.onChangeDate(_,"due_date",String(x.due_date??"")),x.reminder!==void 0&&g.onChangeReminder(_,x.reminder),x.priority!==void 0&&g.onChangePriority(_,x.priority),x.event_time!==void 0&&g.onChangeEventTime?.(_,String(x.event_time??"")),x.event_place!==void 0&&g.onChangeEventPlace?.(_,String(x.event_place??"")),x.event_address!==void 0&&g.onChangeEventAddress?.(_,String(x.event_address??"")),x.content!==void 0&&g.onChangeContent(_,String(x.content??"")),x.note!==void 0&&g.onChangeNote(_,String(x.note??"")),x.visibility!==void 0&&g.onChangeVisibility?.(_,x.visibility,Number(x.visibility_group_seq??0)),Ah({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"})},E={...g,onChangeStatus:(x,_)=>S({status:_},()=>g.onChangeStatus(x,_)),onChangeLabels:(x,_)=>S({label_keys:_},()=>g.onChangeLabels(x,_)),onChangeProject:(x,_)=>S({tab_key:_},()=>g.onChangeProject(x,_)),onChangeDate:(x,_,C)=>S({[_]:C},()=>g.onChangeDate(x,_,C)),onChangeReminder:(x,_)=>S({reminder:_},()=>g.onChangeReminder(x,_)),onChangePriority:(x,_)=>S({priority:_},()=>g.onChangePriority(x,_)),onChangeEventTime:(x,_)=>S({event_time:_},()=>g.onChangeEventTime?.(x,_)),onChangeEventPlace:(x,_)=>S({event_place:_},()=>g.onChangeEventPlace?.(x,_)),onChangeEventAddress:(x,_)=>S({event_address:_},()=>g.onChangeEventAddress?.(x,_)),onChangeContent:(x,_)=>S({content:_},()=>g.onChangeContent(x,_)),onChangeNote:(x,_)=>S({note:_},()=>g.onChangeNote(x,_)),onMemberEdit:(x,_)=>g.onMemberEdit(x,_,m?C=>O(P=>({...P,...C})):null),onChangeNoteDraft:m?(x,_)=>S({note:_},()=>{}):void 0,onChangeVisibility:g.onChangeVisibility?(x,_,C)=>S({visibility:_,visibility_group_seq:C},()=>g.onChangeVisibility?.(x,_,C)):void 0,onAddChecklistItem:(x,_)=>S({checklist:[...N,{label:_,checked:!1}]},()=>g.onAddChecklistItem(x,_)),onToggleChecklistItem:(x,_,C)=>S({checklist:N.map((P,q)=>q===_?{...P,checked:C}:P)},()=>g.onToggleChecklistItem(x,_,C)),onRemoveChecklistItem:(x,_)=>S({checklist:N.filter((C,P)=>P!==_)},()=>g.onRemoveChecklistItem(x,_)),onUpdateChecklistItem:g.onUpdateChecklistItem?(x,_,C)=>S({checklist:N.map((P,q)=>q===_?{...P,label:C}:P)},()=>g.onUpdateChecklistItem?.(x,_,C)):void 0,onReorderChecklist:g.onReorderChecklist?(x,_)=>S({checklist:_},()=>g.onReorderChecklist?.(x,_)):void 0,onLinkChecklistTask:g.onLinkChecklistTask?(x,_,C)=>S({checklist:[...N,{label:C,checked:!1,task_seq:_}]},()=>g.onLinkChecklistTask?.(x,_,C)):void 0},h=Er(Ih,{...E,task:z,myAccountSeq:r,onChangeTitle:(x,_)=>S({title:_},()=>n(x,_)),onToggleCompleted:t,onChangeIcon:(x,_)=>S({icon:_},()=>l(x,_)),onChangeIconColor:(x,_)=>S({icon_color:_},()=>i?.(x,_)),showTitle:m}),y=Er(uh,{onSubmit:(x,_)=>c(z.seq,x,_)},z.seq);return m||s==="dialog"?Dh(w4,{children:[Er(v4,{open:e,onClose:b,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:z.is_notice?"\uACF5\uC9C0\uC0AC\uD56D":z.is_event?"\uC77C\uC815":z.is_bug?"\uC624\uB958":"\uC5C5\uBB34",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[...d?[{icon:Er(y4,{sx:{ml:2,color:"#6b7280"}}),tooltip:"\uD65C\uB3D9",onClick:()=>A(!0)}]:[],{icon:Er(b4,{sx:{ml:d?0:2,color:"#6b7280"}}),tooltip:"\uACF5\uC720\uD558\uAE30",onClick:()=>Ci(z,!0)},{icon:Er(m4,{variant:"contained",size:"small",disableElevation:!0,disabled:!D,onClick:D?T:void 0,sx:{ml:1,minWidth:0,px:1.5,py:.35,fontSize:14,fontWeight:600,bgcolor:"#2f80ed","&:hover":{bgcolor:"#2f80ed"},"&.Mui-disabled":{bgcolor:"#e6e6e3",color:"#9a9a97"}},children:"\uC800\uC7A5"}),tooltip:""}]},fullScreen:m,maxWidth:m?void 0:"md",width:m?void 0:720,mobilePresentation:m?"slide":void 0,tabs:{visible:!1},contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,contentBottomPadding:0,scrollPastLastSection:!1,overlayScrollbar:{enabled:!0,contentStyle:{minWidth:0}},actions:{visible:!0,showCancelButton:!1,left:y},sx:{DialogContent:{borderBottom:"none"}},dialogActionSx:{padding:"0 !important","@media (max-width:1023.95px)":{padding:"0 !important"},borderTop:"1px solid #37352f","& .left-actions":{flex:1,width:"100%",minWidth:0,"& > *":{flex:1,minWidth:0}},"& .right-actions":{display:"none"}},sections:[{id:"task-detail",title:"",showTitle:!1,children:Er(Va,{sx:{userSelect:"none",width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:h})}]},k.seq),Er(Wa,{open:B,taskSeq:z.seq,items:a,loading:f,onLoad:d,onClose:()=>A(!1)})]}):Er(g4,{anchor:"right",open:e,onClose:b,disableAutoFocus:!0,disableEnforceFocus:!0,sx:{zIndex:x=>x.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:Dh(Va,{sx:{display:"flex",flexDirection:"column",height:"100%",userSelect:"none"},children:[Er(mh,{task:z,myAccountSeq:r,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:l,onChangeIconColor:i,onClose:b,activityItems:a,activityLoading:f,onLoadActivity:d,onPrint:u}),Er(Oh,{sx:{borderColor:"#e6e6e3"}}),Er(Va,{sx:{flex:1,minHeight:0},children:Er(x4,{ref:j,style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:h})}),Er(Oh,{sx:{borderColor:"#37352f"}}),Er(Va,{sx:{flexShrink:0},children:y})]})})}import{useEffect as k4,useState as Yo}from"react";import{Box as Pr,Button as Hc,IconButton as Ph}from"@mui/material";import{FormDialog as S4}from"@ehfuse/mui-form-dialog";import T4 from"@mui/icons-material/EditOutlined";import{ErrorAlert as Nh}from"@ehfuse/alerts";import{ClearTextField as jh,DateTextField as Lh,LabelSelect as Fh}from"@ehfuse/mui-form-controls";var $c="custom-";function _4(e){return e.startsWith($c)}function tj(e){return e>0?`${$c}${e}`:""}function Mi(e){if(!_4(e))return 0;let p=Number(e.slice($c.length));return Number.isInteger(p)&&p>0?p:0}import{Fragment as B4,jsx as Zt,jsxs as To}from"react/jsx-runtime";var C4=[{value:"planning",label:"\uACC4\uD68D\uC911"},{value:"active",label:"\uC9C4\uD589\uC911"},{value:"closed",label:"\uC885\uB8CC"}];function zh(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):"-"}function fj({open:e,customTabs:p,sprints:b,onClose:c,onCreate:o,onUpdate:s,onChangeStatus:r,onRemove:t}){let n=p.filter(T=>T.useSprints&&!T.archived),[l,i]=Yo(""),[a,f]=Yo(""),[d,u]=Yo(""),[g,m]=Yo(""),[v,k]=Yo(""),[B,A]=Yo(!1),[L,O]=Yo(0);k4(()=>{e&&(i(n.length===1?n[0].key:""),f(""),u(""),m(""),k(""),O(0))},[e]);let D=()=>{f(""),u(""),m(""),k(""),O(0)},j=T=>{O(T.seq),i(`custom-${T.group_seq}`),f(T.name),u(T.goal),m(T.start_date),k(T.end_date)},z=async()=>{let T=Mi(l);if(!T){Nh("\uBAA9\uD45C\uB97C \uB9CC\uB4E4 \uD504\uB85C\uC81D\uD2B8\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}if(!a.trim()){Nh("\uBAA9\uD45C \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}A(!0);try{if(L>0){s(L,{name:a.trim(),goal:d.trim(),start_date:g,end_date:v}),D();return}await o({group_seq:T,name:a.trim(),goal:d.trim(),start_date:g,end_date:v})&&D()}finally{A(!1)}},N=new Map(p.map(T=>[Mi(T.key),T.label])),S=Zt(Pr,{children:n.length===0?Zt(Pr,{sx:{py:2,fontSize:14,color:"#787774"},children:'\uBAA9\uD45C\uB97C \uC0AC\uC6A9\uD558\uB294 \uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uD504\uB85C\uC81D\uD2B8 \uC218\uC815\uC5D0\uC11C "\uBAA9\uD45C(\uC2A4\uD504\uB9B0\uD2B8) \uC0AC\uC6A9"\uC744 \uBA3C\uC800 \uCF1C\uC138\uC694.'}):To(B4,{children:[To(Pr,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2.5,mt:1},children:[Zt(Fh,{label:"\uD504\uB85C\uC81D\uD2B8",size:"medium",value:l,options:n.map(T=>({value:T.key,label:T.label})),onChange:T=>i(String(T.target.value)),disabled:L>0}),Zt(jh,{label:"\uBAA9\uD45C \uC774\uB984",size:"medium",placeholder:"\uC608: 8\uC6D4 2\uC8FC\uCC28",value:a,onChange:T=>f(T.target.value)}),Zt(Lh,{size:"medium",label:"\uC2DC\uC791\uC77C",value:g,onChange:T=>m(T.target.value)}),Zt(Lh,{size:"medium",label:"\uC885\uB8CC\uC77C",value:v,onChange:T=>k(T.target.value)}),Zt(jh,{label:"\uC124\uBA85",size:"medium",placeholder:"\uC120\uD0DD \uC785\uB825",value:d,onChange:T=>u(T.target.value),sx:{gridColumn:"1 / -1"}})]}),To(Pr,{sx:{mt:1.5,display:"flex",justifyContent:"flex-end",gap:1},children:[L>0?Zt(Hc,{color:"inherit",onClick:D,disabled:B,children:"\uCDE8\uC18C"}):null,Zt(Hc,{variant:"contained",onClick:()=>{z()},disabled:B,children:L>0?"\uBAA9\uD45C \uC800\uC7A5":"\uBAA9\uD45C \uB9CC\uB4E4\uAE30"})]}),Zt(Pr,{sx:{mt:2,borderTop:"1px solid #e6e6e3"},children:b.length===0?Zt(Pr,{sx:{py:3,textAlign:"center",fontSize:14,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):b.map(T=>To(Pr,{sx:{display:"flex",flexDirection:"column",gap:1,py:1.75,borderBottom:"1px solid #f0efed"},children:[To(Pr,{sx:{minWidth:0},children:[To(Pr,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[Zt(Pr,{component:"span",sx:{fontSize:16,fontWeight:600,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:T.name}),Zt(Pr,{component:"span",sx:{flexShrink:0,px:1,py:.25,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:13,fontWeight:500},children:N.get(T.group_seq)??"\uC0AD\uC81C\uB41C \uD504\uB85C\uC81D\uD2B8"}),To(Pr,{component:"span",sx:{flexShrink:0,fontSize:14,color:"#57564f"},children:[zh(T.start_date)," ~ ",zh(T.end_date)]})]}),T.goal?Zt(Pr,{sx:{mt:.5,fontSize:14,color:"#787774",lineHeight:1.5},children:T.goal}):null]}),To(Pr,{sx:{display:"flex",alignItems:"center",gap:.5},children:[Zt(Fh,{label:"\uC0C1\uD0DC",showLabel:!1,size:"small",value:T.status,options:C4.map(E=>({value:E.value,label:E.label})),onChange:E=>r(T.seq,String(E.target.value)),sx:{width:104,flexShrink:0}}),Zt(Ph,{"aria-label":"\uBAA9\uD45C \uC218\uC815",onClick:()=>j(T),sx:{color:"#9a9a97","&:hover":{color:"#2563eb"}},children:Zt(T4,{sx:{fontSize:18}})}),Zt(Ph,{"aria-label":"\uBAA9\uD45C \uC0AD\uC81C",onClick:()=>t(T.seq),sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:Zt(Zr,{style:{width:16,height:16}})})]})]},T.seq))})]})});return Zt(S4,{open:e,onClose:c,maxWidth:"sm",title:"\uBAA9\uD45C \uAD00\uB9AC",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-manage",sections:[{id:"sprint-manage",showTitle:!1,children:S}],actions:{showCancelButton:!1,right:Zt(Hc,{variant:"contained",onClick:c,children:"\uB2EB\uAE30"})}})}import{useState as qh}from"react";import{Box as cr,Button as Wc,Divider as I4,IconButton as M4,TextField as E4}from"@mui/material";import{FormDialog as R4}from"@ehfuse/mui-form-dialog";import O4 from"@mui/icons-material/OpenInNewOutlined";import A4 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as D4}from"@ehfuse/alerts";import{jsx as Ot,jsxs as Xo}from"react/jsx-runtime";function wj({open:e,imports:p,onRegister:b,onRemove:c,onClose:o}){let[s,r]=qh(""),[t,n]=qh(!1),l=async()=>{let f=s.trim();if(f){n(!0);try{await b(f)&&r("")}finally{n(!1)}}},i=async f=>{await D4({title:"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",message:`"${f.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}" \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&c(f.seq)},a=Xo(cr,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[Xo(cr,{sx:{color:"#37352f",lineHeight:1.7},children:["\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC758 \uC77C\uC815\uC744 ",Ot("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uD568\uAED8 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.",Ot("br",{}),"\uD45C\uC2DC/\uC228\uAE40\uC740 \uC5C5\uBB34\uD568 \uC6B0\uC0C1\uB2E8\uC758 ",Ot("b",{children:"\uAD6C\uAE00 \uC77C\uC815"})," \uC2A4\uC704\uCE58\uB85C \uCF1C\uACE0 \uB055\uB2C8\uB2E4."]}),Ot(cr,{sx:{fontWeight:700,color:"#37352f",mt:.5},children:"\uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354"}),p.length>0?Ot(cr,{sx:{display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1},children:p.map((f,d)=>Xo(cr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:.75,borderTop:d>0?"1px solid #efefed":"none"},children:[Ot(A4,{sx:{fontSize:18,color:"#0f9d58",flexShrink:0}}),Ot(cr,{component:"span",sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),Ot(M4,{"aria-label":"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",size:"small",onClick:()=>{i(f)},sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:Ot(Zr,{sx:{fontSize:18}})})]},f.seq))}):Ot(cr,{sx:{color:"#9a9a97",px:.5},children:"\uC544\uC9C1 \uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}),Ot(I4,{sx:{my:1,borderColor:"#e6e6e3"}}),Ot(cr,{sx:{fontWeight:700,color:"#37352f"},children:"\uC0C8 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30"}),Xo(cr,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,mb:1,fontSize:15,lineHeight:1.8,display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[Ot(cr,{children:Xo(cr,{component:"span",children:["\uAD6C\uAE00 \uCE98\uB9B0\uB354(\uC6F9) > \uC67C\uCABD \uBAA9\uB85D\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354\uC5D0 \uB9C8\uC6B0\uC2A4\uB97C \uC62C\uB824 \u22EE > ",Ot("b",{children:"\uC124\uC815 \uBC0F \uACF5\uC720"}),"\uB97C \uC5FD\uB2C8\uB2E4."]})}),Ot(cr,{children:Xo(cr,{component:"span",children:[Ot("b",{children:"\uCE98\uB9B0\uB354 \uD1B5\uD569"})," \uC139\uC158\uC758 ",Ot("b",{children:'"iCal \uD615\uC2DD\uC758 \uBE44\uBC00 \uC8FC\uC18C"'})," \uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),Ot(cr,{children:Ot(cr,{component:"span",children:"\uBE44\uBC00 \uC8FC\uC18C\uB294 \uBCF8\uC778 \uC804\uC6A9\uC785\uB2C8\uB2E4. \uC11C\uBC84\uC5D0 \uC800\uC7A5\uB418\uBA70 \uB2E4\uB978 \uC9C1\uC6D0\uC5D0\uAC8C \uBCF4\uC774\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})}),Ot(cr,{children:Ot(cr,{component:"span",children:"\uC77C\uC815\uC740 \uC57D 10\uBD84 \uAC04\uACA9\uC73C\uB85C \uAC31\uC2E0\uB418\uACE0, \uBC18\uBCF5 \uC77C\uC815\uC740 \uC77C\uBC18\uC801\uC778 \uADDC\uCE59(\uB9E4\uC77C/\uB9E4\uC8FC/\uB9E4\uC6D4/\uB9E4\uB144)\uB9CC \uC9C0\uC6D0\uD569\uB2C8\uB2E4."})})]}),Xo(cr,{sx:{display:"flex",gap:2,alignItems:"center"},children:[Ot(E4,{value:s,onChange:f=>r(f.target.value),fullWidth:!0,label:"\uBE44\uBC00 iCal \uC8FC\uC18C",placeholder:"https://calendar.google.com/calendar/ical/\u2026/basic.ics",slotProps:{input:{spellCheck:!1}}}),Ot(Wc,{variant:"contained",disabled:!s.trim()||t,onClick:()=>{l()},sx:{flexShrink:0},children:t?"\uD655\uC778 \uC911\u2026":"\uB4F1\uB85D"})]})]});return Ot(R4,{open:e,onClose:o,width:680,title:"\uAD6C\uAE00 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-import",sections:[{id:"calendar-import",showTitle:!1,children:a}],actions:{showCancelButton:!1,left:Ot(Wc,{variant:"outlined",startIcon:Ot(O4,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:Ot(Wc,{variant:"contained",onClick:o,children:"\uB2EB\uAE30"})}})}import{Box as io,Button as ps,TextField as P4}from"@mui/material";import{FormDialog as N4}from"@ehfuse/mui-form-dialog";import j4 from"@mui/icons-material/ContentCopyOutlined";import $h from"@mui/icons-material/OpenInNewOutlined";import{InfoAlert as Hh}from"@ehfuse/alerts";import{Fragment as F4,jsx as Jt,jsxs as Zo}from"react/jsx-runtime";function L4(e){return`${window.location.origin}/api/v1/taskbox/calendar/${e}.ics`}function Mj({open:e,feed:p,feedTaskCount:b,buildFeedUrl:c,onSubscribe:o,onClose:s}){let r=c??L4,t=p.subscribed?r(p.token):"",n=()=>{navigator.clipboard.writeText(t).then(()=>Hh("\uD53C\uB4DC \uC8FC\uC18C\uB97C \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>Hh("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD558\uC138\uC694."))},l=()=>{let a=t.replace(/^https?:\/\//,"webcal://");window.open(`https://calendar.google.com/calendar/r?cid=${encodeURIComponent(a)}`,"_blank")},i=Zo(io,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[Zo(io,{sx:{color:"#37352f",lineHeight:1.7},children:["\uB0B4\uAC00 \uAD00\uC5EC\uD55C \uC5C5\uBB34\uB97C ",Jt("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4."]}),b===0?Zo(io,{sx:{color:"#8a6d1d",bgcolor:"#faf1d7",borderRadius:1,px:1.5,py:1.25,lineHeight:1.7},children:["\uC9C0\uAE08\uC740 \uCE98\uB9B0\uB354\uC5D0 \uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",Jt("br",{}),Jt("b",{children:"\uB9C8\uAC10\uC77C\uC2DC\uAC00 \uC788\uB294 \uB0B4 \uC5C5\uBB34 \uB610\uB294 \uBCF4\uB0B8\uC5C5\uBB34"}),"\uAC00 \uC0DD\uAE30\uBA74"," ",p.subscribed?"\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0 \uC790\uB3D9\uC73C\uB85C \uD45C\uC2DC\uB429\uB2C8\uB2E4.":"\uC5EC\uAE30\uC11C \uAD6C\uB3C5\uC744 \uC2DC\uC791\uD558\uC138\uC694."]}):p.subscribed&&p.enabled?Zo(F4,{children:[Jt(P4,{value:t,fullWidth:!0,label:"\uB0B4 \uD53C\uB4DC \uC8FC\uC18C",slotProps:{input:{readOnly:!0}}}),Zo(io,{sx:{display:"flex",gap:2},children:[Jt(ps,{variant:"outlined",startIcon:Jt(j4,{}),onClick:n,children:"\uC8FC\uC18C \uBCF5\uC0AC"}),Jt(ps,{variant:"contained",startIcon:Jt($h,{}),onClick:l,children:"Google \uCE98\uB9B0\uB354\uC5D0 \uCD94\uAC00"})]}),Zo(io,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,fontSize:15,lineHeight:1.8,display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[Jt(io,{children:Zo("span",{children:["\uBC84\uD2BC\uC774 \uB3D9\uC791\uD558\uC9C0 \uC54A\uC73C\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354 > \uB2E4\uB978 \uCE98\uB9B0\uB354 + > ",Jt("b",{children:"URL\uB85C \uCD94\uAC00"}),"\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),Jt(io,{children:Jt("span",{children:"\uAD6C\uAE00\uC774 \uD53C\uB4DC\uB97C \uC8FC\uAE30\uC801\uC73C\uB85C(\uC218 \uC2DC\uAC04 \uAC04\uACA9) \uAC00\uC838\uAC00\uBBC0\uB85C \uBCC0\uACBD\uC0AC\uD56D \uBC18\uC601\uC774 \uB2A6\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4."})}),Jt(io,{children:Jt("span",{children:"\uB0B4\uBCF4\uB0B4\uAE30\uB97C \uADF8\uB9CC\uD558\uB824\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uCD94\uAC00\uD55C \uCE98\uB9B0\uB354\uB97C \uC0AD\uC81C\uD558\uBA74 \uB429\uB2C8\uB2E4."})}),Jt(io,{children:Jt("span",{children:"\uC774 \uC8FC\uC18C\uB294 \uBCF8\uC778 \uC804\uC6A9\uC785\uB2C8\uB2E4. \uACF5\uC720\uD558\uBA74 \uB0B4 \uC5C5\uBB34 \uC77C\uC815\uC774 \uB178\uCD9C\uB429\uB2C8\uB2E4."})})]})]}):Jt(ps,{variant:"contained",onClick:o,sx:{alignSelf:"flex-start"},children:"\uAD6C\uB3C5 \uC2DC\uC791 (\uD53C\uB4DC \uBC1C\uAE09)"})]});return Jt(N4,{open:e,onClose:s,width:680,title:"\uAD6C\uAE00 \uCE98\uB9B0\uB354\uB85C \uB0B4\uBCF4\uB0B4\uAE30",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-subscribe",sections:[{id:"calendar-subscribe",showTitle:!1,children:i}],actions:{showCancelButton:!1,left:Jt(ps,{variant:"outlined",startIcon:Jt($h,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:Jt(ps,{variant:"contained",onClick:s,children:"\uB2EB\uAE30"})}})}import{useEffect as z4,useMemo as Uc,useState as Vc}from"react";import{Box as ms,Button as q4,Typography as $4}from"@mui/material";import{FormDialog as H4}from"@ehfuse/mui-form-dialog";import{SearchTextField as W4}from"@ehfuse/mui-form-controls";import{TreeView as U4}from"@ehfuse/tree-view";import{Fragment as Z4,jsx as pn,jsxs as J4}from"react/jsx-runtime";function Wh(e){return`${e.name}#${e.seq}`}function V4(e){return Number(e.slice(e.lastIndexOf("#")+1))||0}function K4(e){let p=[],b=c=>{for(let o of c.employees??[])p.push(o);for(let o of c.groups??[])b(o)};for(let c of e)b(c);return p}function G4(e,p){return p?[e.name,e.department,e.role_name,e.work_position].filter(Boolean).some(b=>String(b).toLowerCase().includes(p)):!0}function Y4(e){let p=[[e.name,e.role_name].filter(Boolean).join(" "),e.department].filter(Boolean).join(" / ");return{id:`emp:${e.seq}`,label:Wh(e),renderLabel:pn(ms,{component:"span",sx:{display:"inline-flex",alignItems:"baseline",gap:.75},children:pn(ms,{component:"span",sx:{fontWeight:400,color:"text.primary"},children:p})})}}function Uh(e,p){let b=(e.groups??[]).map(o=>Uh(o,p)).filter(o=>o!==null),c=(e.employees??[]).filter(o=>G4(o,p)).map(Y4);return b.length===0&&c.length===0?null:{id:`group:${e.key}`,label:e.name,children:[...b,...c]}}function X4({groups:e,allEmployees:p,initialSelectedSeqs:b,multiple:c,isMobile:o,onSelectionChange:s}){let[r,t]=Vc(""),n=Uc(()=>e.map(i=>Uh(i,r.trim().toLowerCase())).filter(i=>i!==null),[e,r]),l=Uc(()=>p.filter(i=>b.includes(i.seq)).map(Wh),[]);return J4(Z4,{children:[pn(ms,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:pn(W4,{size:"small",fullWidth:!0,placeholder:"\uC774\uB984, \uBD80\uC11C \uAC80\uC0C9",onSearch:t,onClear:()=>t(""),sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),pn(ms,{sx:o?{display:"flex",flexDirection:"column"}:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:pn(U4,{items:n,checkbox:!0,multiSelect:c,selectionMode:"child",showSearch:!1,defaultExpanded:!0,initialSelections:l,onChange:i=>s(i.map(V4).filter(a=>a>0)),styles:{border:"none",borderRadius:"0"}})})]})}function Lj({open:e,title:p="\uC9C1\uC6D0 \uC120\uD0DD",hint:b="",groups:c,multiple:o=!1,selectedSeqs:s,confirmText:r="\uD655\uC778",onConfirm:t,onClose:n}){let l=It(),[i,a]=Vc([]),[f,d]=Vc(0),u=Uc(()=>K4(c),[c]),g=s??[];z4(()=>{e&&(a(g),d(v=>v+1))},[e]);let m=()=>{let v=u.filter(k=>i.includes(k.seq));t(o?v:v.slice(0,1)),n()};return pn(H4,{open:e,onClose:n,title:`${p}${o&&i.length>0?` (${i.length}\uBA85)`:""}`,locale:"ko",fullScreen:l,mobilePresentation:l?"slide":"dialog",draggable:!0,width:"600px",tabs:{visible:!1},titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},scrollPastLastSection:!1,sectionContentPaddingTop:0,fontScale:{enabled:!0},fontScaleKey:"taskbox-employee-select",sections:[{id:"employee-select",title:"\uC9C1\uC6D0 \uC120\uD0DD",showTitle:!1,children:pn(ms,{sx:{...l?{}:{height:560},display:"flex",flexDirection:"column",border:"1px solid #cccccc",borderRadius:1,...l?{}:{overflow:"hidden"},userSelect:"none"},children:pn(X4,{groups:c,allEmployees:u,initialSelectedSeqs:g,multiple:o,isMobile:l,onSelectionChange:a},f)})}],dialogActionSx:{"@media (max-width:1023.95px)":{gap:"0.75rem !important","& .left-actions":{flex:1,minWidth:0},"& .right-actions":{flex:1}}},actions:{visible:!0,showCancelButton:!1,left:b?pn($4,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.35},children:b}):void 0,right:pn(q4,{variant:"contained",onClick:m,children:r})}})}import{useEffect as n6,useMemo as o6,useState as ru}from"react";import{Box as lo,Button as i6}from"@mui/material";import{FormDialog as s6}from"@ehfuse/mui-form-dialog";import{LabelSelect as nu}from"@ehfuse/mui-form-controls";import{Box as Ga}from"@mui/material";import{Bar as r5,BarChart as n5,CartesianGrid as o5,Cell as i5,ReferenceLine as s5,ResponsiveContainer as a5,Tooltip as l5,XAxis as c5,YAxis as u5}from"recharts";import{Box as Q4}from"@mui/material";import{jsx as e5}from"react/jsx-runtime";function Rr({text:e,height:p}){return e5(Q4,{sx:{display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",fontSize:14.5,color:"#9a9a97",...typeof p=="number"?{height:p,minHeight:120}:{position:"absolute",inset:0,pointerEvents:"none"}},children:e})}import{createElement as t5}from"react";var Ka="#2f80ed",Vh="#a9c9f5",Jo="#9a9a97",Kc="#2e9e6b",so="#3d7eff",Gc="#c3c8ce",gs="#f2a30f",bs={contentStyle:{fontSize:13.5,color:"#37352f",border:"1px solid #e6e6e3",borderRadius:6},labelStyle:{fontSize:13.5,color:"#37352f",fontWeight:700},itemStyle:{fontSize:13.5}},Ei={...bs,cursor:!1},Ri={wrapperStyle:{fontSize:13.5,paddingTop:10},formatter:e=>t5("span",{style:{paddingRight:14,color:"#37352f"}},e)};function tr(e){return{display:"flex",flexDirection:"column",minHeight:0,position:"relative",...typeof e=="string"?{flex:1}:{}}}var xr={flexShrink:0,mb:1.5,display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"};function On(e){return{"& *":{outline:"none"},userSelect:"none",...typeof e=="number"?{height:e,flexShrink:0}:{flex:1,minHeight:0}}}import{jsx as mn,jsxs as ys}from"react/jsx-runtime";function f5(e,p){let b=p.filter(c=>c.sprint_seq===e.seq&&!c.archived&&c.completed);return{points:b.reduce((c,o)=>c+(o.story_points??0),0),count:b.length}}function Kh({sprints:e,tasks:p,height:b=200}){let o=[...e].sort((i,a)=>`${i.start_date}|${i.seq}`.localeCompare(`${a.start_date}|${a.seq}`)).map(i=>({sprint:i,...f5(i,p)})),s=o.some(i=>i.points>0),r=s?"SP":"\uAC74",t=o.filter(i=>i.sprint.status==="closed").map(i=>s?i.points:i.count),n=t.length>0?Math.round(t.reduce((i,a)=>i+a,0)/t.length*10)/10:null,l=o.map(i=>({\uBAA9\uD45C:`${i.sprint.name}${i.sprint.status!=="closed"?" (\uC9C4\uD589\uC911)":""}`,\uC644\uB8CC:s?i.points:i.count,closed:i.sprint.status==="closed"}));return o.length===0?mn(Rr,{text:"\uD45C\uC2DC\uD560 \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:b}):ys(Ga,{sx:tr(b),children:[ys(Ga,{sx:{flexShrink:0,mb:1,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[ys("span",{children:["\uC644\uB8CC ",s?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uBAA9\uD45C\uBCC4"]}),n!==null?ys("span",{children:["\uD3C9\uADE0(\uC885\uB8CC \uBAA9\uD45C)"," ",mn(Ga,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:n}),r]}):null]}),mn(Ga,{sx:On(b),children:mn(a5,{width:"100%",height:"100%",children:ys(n5,{data:l,margin:{top:8,right:12,left:0,bottom:0},barCategoryGap:"28%",children:[mn(o5,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),mn(c5,{dataKey:"\uBAA9\uD45C",tick:{fontSize:13},tickMargin:6,interval:0}),mn(u5,{tick:{fontSize:13},width:40,allowDecimals:!1}),mn(l5,{...Ei,formatter:i=>`${Number(i??0)}${r}`}),n!==null?mn(s5,{y:n,stroke:Jo,strokeDasharray:"6 5",label:{value:`\uD3C9\uADE0 ${n}${r}`,position:"right",fontSize:13}}):null,mn(r5,{dataKey:"\uC644\uB8CC",radius:[4,4,0,0],children:l.map(i=>mn(i5,{fill:i.closed?Ka:Vh},i.\uBAA9\uD45C))})]})})})]})}import{useMemo as d5}from"react";import{Box as An}from"@mui/material";import{CartesianGrid as h5,Line as Gh,LineChart as p5,ResponsiveContainer as m5,Tooltip as g5,XAxis as b5,YAxis as y5}from"recharts";import{jsx as Nr,jsxs as Co}from"react/jsx-runtime";function Yh(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?new Date(`${e}T00:00:00`):null}function x5(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function v5(e){return e.slice(5).replace("-",".")}function Xh({sprint:e,tasks:p,todayStr:b,height:c=200,headerLeft:o}){let s=d5(()=>{let a=Yh(e.start_date),f=Yh(e.end_date);if(!a||!f||f<a||Math.round((f.getTime()-a.getTime())/864e5)+1>366)return null;let u=p.filter(D=>D.sprint_seq===e.seq&&!D.archived);if(u.length===0)return{empty:!0};let g=u.some(D=>(D.story_points??0)>0),m=D=>g?D.story_points??0:1,v=u.reduce((D,j)=>D+m(j),0),k=new Map;for(let D of u){if(!D.completed)continue;let j=(D.completed_time??"").slice(0,10),z=/^\d{4}-\d{2}-\d{2}$/.test(j)?j:e.start_date;k.set(z,(k.get(z)??0)+m(D))}let B=[];for(let D=new Date(a);D<=f;D.setDate(D.getDate()+1))B.push(x5(D));let A=v,L=v;return{empty:!1,data:B.map((D,j)=>{let z=B.length===1?0:v*(1-j/(B.length-1));return D<=b&&(A-=k.get(D)??0,L=Math.max(0,A)),{\uB0A0\uC9DC:v5(D),\uC774\uC0C1:Math.round(z*10)/10,\uB0A8\uC740\uB7C9:D<=b?Math.max(0,A):null}}),total:v,usePoints:g,last:L}},[e,p,b]);if(!s)return Co(An,{sx:tr(c),children:[o?Nr(An,{sx:xr,children:o}):null,Nr(Rr,{text:"\uBAA9\uD45C\uC758 \uC2DC\uC791\uC77C\xB7\uC885\uB8CC\uC77C\uC774 \uC788\uC5B4\uC57C \uBC88\uB2E4\uC6B4\uC744 \uADF8\uB9B4 \uC218 \uC788\uC2B5\uB2C8\uB2E4.",height:c})]});if(s.empty)return Co(An,{sx:tr(c),children:[o?Nr(An,{sx:xr,children:o}):null,Nr(Rr,{text:"\uBC30\uC815\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:c})]});let{data:r,total:t,usePoints:n,last:l}=s,i=n?"SP":"\uAC74";return Co(An,{sx:tr(c),children:[Co(An,{sx:xr,children:[o?Nr(An,{sx:{flexShrink:0},children:o}):null,Co(An,{sx:{flex:1,minWidth:220,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Co("span",{children:["\uB0A8\uC740 ",n?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uCD1D ",t]}),Co("span",{children:["\uD604\uC7AC"," ",Nr(An,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:l}),i," \uB0A8\uC74C"]})]})]}),Nr(An,{sx:On(c),children:Nr(m5,{width:"100%",height:"100%",children:Co(p5,{data:r,margin:{top:8,right:12,left:0,bottom:0},children:[Nr(h5,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Nr(b5,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),Nr(y5,{tick:{fontSize:13},width:40,allowDecimals:!1}),Nr(g5,{...bs,formatter:a=>`${Number(a??0)}${i}`}),Nr(Gh,{type:"linear",dataKey:"\uC774\uC0C1",stroke:Jo,strokeDasharray:"6 5",strokeWidth:1.5,dot:!1}),Nr(Gh,{type:"monotone",dataKey:"\uB0A8\uC740\uB7C9",stroke:Ka,strokeWidth:2.5,dot:!1,connectNulls:!1})]})})})]})}import{useMemo as np}from"react";import{Box as Dn}from"@mui/material";import{Area as Zc,AreaChart as S5,CartesianGrid as T5,Legend as C5,ResponsiveContainer as B5,Tooltip as I5,XAxis as M5,YAxis as E5}from"recharts";function ao(e){let p=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())}`}function Ya(e,p=new Date){let b=new Date(p);return b.setMonth(b.getMonth()-e),b}function iL(e=new Date){return{fromDate:ao(Ya(1,e)),toDate:ao(e)}}var Xc=864e5,xs=[0,1,2,3,5,8,13,21];function Qh(e){return!e.archived&&!e.linked_only&&!e.is_notice&&!e.is_event}function Yc(e){let p=String(e??"").trim(),b=/^(\d{4}-\d{2}-\d{2})(?:[ T](\d{2}:\d{2}))?/.exec(p);if(!b)return null;let c=new Date(`${b[1]}T${b[2]??"00:00"}:00`).getTime();return Number.isNaN(c)?null:c}function Oi(e){let p=String(e??"").trim();return/^\d{4}-\d{2}-\d{2}/.test(p)?p.slice(0,10):""}function w5(e){let p=Oi(e.created_time)||Oi(e.start_date)||Oi(e.completed_time);if(!p)return null;let b=Oi(e.start_date),c=b&&b>p?b:p,o=e.completed?Oi(e.completed_time)||p:"";return{created:p,started:c,done:o}}function ep(e,p){let b=/^\d{4}-\d{2}-\d{2}$/.test(p)?new Date(`${p}T00:00:00`):new Date,c=Math.max(2,Math.min(366,Math.round(e))),o=[];for(let s=c-1;s>=0;s-=1)o.push(ao(new Date(b.getTime()-s*Xc)));return o}function tp(e,p,b){let c=ep(p,b),o=e.filter(Qh).map(w5).filter(n=>n!==null),s=c.map(n=>{let l=0,i=0,a=0;for(let f of o)f.created>n||(f.done&&f.done<=n?l+=1:f.started<=n?i+=1:a+=1);return{day:n,done:l,inProgress:i,waiting:a}}),r=s[s.length-1],t=s.reduce((n,l)=>Math.max(n,l.done+l.inProgress+l.waiting),0);return{points:s,max:t,currentWip:r?.inProgress??0,currentTotal:r?r.done+r.inProgress+r.waiting:0,currentDone:r?.done??0}}function _5(e,p){if(e.length===0)return 0;let b=Math.min(e.length-1,Math.max(0,Math.ceil(e.length*p)-1));return e[b]}function Zh(e){if(e.length===0)return null;let p=[...e].sort((s,r)=>s-r),b=s=>Math.round(s*10)/10,c=Math.floor(p.length/2),o=p.length%2===1?p[c]:(p[c-1]+p[c])/2;return{count:p.length,median:b(o),average:b(p.reduce((s,r)=>s+r,0)/p.length),p85:b(_5(p,.85))}}function Jh(e){for(let p=xs.length-1;p>=0;p-=1)if(e>=xs[p])return p;return 0}function k5(){return xs.map((e,p)=>p===xs.length-1?`${e}\uC77C+`:`${e}~${xs[p+1]}\uC77C`)}function rp(e,p,b){let c=ep(p,b),o=c[0],s=c[c.length-1],r=k5(),t=r.map(()=>0),n=r.map(()=>0),l=[],i=[];for(let a of e){if(!Qh(a)||!a.completed)continue;let f=Oi(a.completed_time);if(!f||f<o||f>s)continue;let d=Yc(a.completed_time),u=Yc(a.created_time);if(d===null||u===null)continue;let g=Math.max(0,(d-u)/Xc);l.push(g),t[Jh(g)]+=1;let m=Yc(a.start_date);if(m===null||m>d)continue;let v=Math.max(0,(d-Math.max(m,u))/Xc);i.push(v),n[Jh(v)]+=1}return{labels:r,leadCounts:t,cycleCounts:n,lead:Zh(l),cycle:Zh(i)}}import{jsx as Or,jsxs as Bo}from"react/jsx-runtime";function R5(e){return e.slice(5).replace("-",".")}function op({tasks:e,todayStr:p,days:b=30,height:c=220,headerLeft:o}){let s=np(()=>tp(e,b,p),[e,b,p]),r=np(()=>s.points.map(n=>({\uB0A0\uC9DC:R5(n.day),\uC644\uB8CC:n.done,\uC9C4\uD589:n.inProgress,\uB300\uAE30:n.waiting})),[s]),t=Bo(Dn,{sx:xr,children:[o?Or(Dn,{sx:{flexShrink:0},children:o}):null,Bo(Dn,{sx:{flex:1,minWidth:220,display:"flex",flexDirection:"column",gap:.5},children:[Bo(Dn,{sx:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Bo("span",{children:["\uCD5C\uADFC ",s.points.length,"\uC77C \u2014 \uC811\uC218 ",s.currentTotal,"\uAC74 / \uC644\uB8CC ",s.currentDone,"\uAC74"]}),Bo("span",{children:["\uC9C4\uD589 \uC911"," ",Or(Dn,{component:"span",sx:{color:so,fontWeight:700},children:s.currentWip}),"\uAC74"]})]}),Or(Dn,{sx:{fontSize:13.5,color:"#37352f"},children:"\uB760\uAC00 \uB450\uAEBC\uC6CC\uC9C0\uBA74 \uC77C\uC774 \uC313\uC774\uB294 \uC911, \uC587\uC544\uC9C0\uBA74 \uCC98\uB9AC\uB418\uB294 \uC911\uC785\uB2C8\uB2E4."})]})]});return r.length===0||s.max===0?Bo(Dn,{sx:tr(c),children:[o?Or(Dn,{sx:xr,children:o}):null,Or(Rr,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC811\uC218\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:c})]}):Bo(Dn,{sx:tr(c),children:[t,Or(Dn,{sx:On(c),children:Or(B5,{width:"100%",height:"100%",children:Bo(S5,{data:r,margin:{top:8,right:12,left:0,bottom:4},children:[Or(T5,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Or(M5,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),Or(E5,{tick:{fontSize:13},width:40,allowDecimals:!1}),Or(I5,{...bs,formatter:n=>`${Number(n??0)}\uAC74`}),Or(C5,{...Ri}),Or(Zc,{type:"monotone",dataKey:"\uC644\uB8CC",stackId:"flow",stroke:Kc,fill:Kc,fillOpacity:.9}),Or(Zc,{type:"monotone",dataKey:"\uC9C4\uD589",stackId:"flow",stroke:so,fill:so,fillOpacity:.85}),Or(Zc,{type:"monotone",dataKey:"\uB300\uAE30",stackId:"flow",stroke:Gc,fill:Gc,fillOpacity:.9})]})})})]})}import{useMemo as ip}from"react";import{Box as jr}from"@mui/material";import{Bar as sp,BarChart as O5,CartesianGrid as A5,Legend as D5,ResponsiveContainer as P5,Tooltip as N5,XAxis as j5,YAxis as L5}from"recharts";import{jsx as ur,jsxs as tn}from"react/jsx-runtime";function ap({label:e,color:p,summary:b}){let c=tn(jr,{sx:{display:"flex",alignItems:"center",gap:.75},children:[ur(jr,{sx:{width:10,height:10,borderRadius:.5,bgcolor:p,flexShrink:0}}),ur(jr,{component:"span",sx:{fontWeight:700,color:"#37352f"},children:e})]});return b?tn(jr,{sx:{display:"contents"},children:[c,tn("span",{children:[b.count,"\uAC74"]}),tn("span",{children:["\uC911\uC559\uAC12"," ",ur(jr,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:b.median}),"\uC77C"]}),tn("span",{children:["\uD3C9\uADE0 ",b.average,"\uC77C"]}),tn("span",{children:["85% ",b.p85,"\uC77C \uC774\uB0B4"]})]}):tn(jr,{sx:{display:"contents"},children:[c,ur(jr,{component:"span",sx:{gridColumn:"span 4",color:"#9a9a97"},children:"\uD45C\uBCF8 \uC5C6\uC74C"})]})}function lp({tasks:e,todayStr:p,days:b=30,height:c=200,headerLeft:o}){let s=ip(()=>rp(e,b,p),[e,b,p]),r=ip(()=>s.labels.map((t,n)=>({\uAD6C\uAC04:t,\uB9AC\uB4DC\uD0C0\uC784:s.leadCounts[n],\uC0AC\uC774\uD074\uD0C0\uC784:s.cycleCounts[n]})),[s]);return s.lead?tn(jr,{sx:tr(c),children:[tn(jr,{sx:xr,children:[o?ur(jr,{sx:{flexShrink:0},children:o}):null,tn(jr,{sx:{flex:1,minWidth:260,display:"grid",gridTemplateColumns:"max-content max-content max-content max-content max-content",justifyContent:"start",alignItems:"center",columnGap:3,rowGap:.5,fontSize:14,color:"#000"},children:[ur(ap,{label:"\uB9AC\uB4DC\uD0C0\uC784(\uC791\uC131\u2192\uC644\uB8CC)",color:so,summary:s.lead}),ur(ap,{label:"\uC0AC\uC774\uD074\uD0C0\uC784(\uC2DC\uC791\u2192\uC644\uB8CC)",color:gs,summary:s.cycle})]})]}),ur(jr,{sx:On(c),children:ur(P5,{width:"100%",height:"100%",children:tn(O5,{data:r,margin:{top:8,right:12,left:0,bottom:4},barCategoryGap:"24%",children:[ur(A5,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),ur(j5,{dataKey:"\uAD6C\uAC04",tick:{fontSize:13},tickMargin:6,interval:0}),ur(L5,{tick:{fontSize:13},width:40,allowDecimals:!1}),ur(N5,{...Ei,formatter:t=>`${Number(t??0)}\uAC74`}),ur(D5,{...Ri}),ur(sp,{dataKey:"\uB9AC\uB4DC\uD0C0\uC784",fill:so,radius:[3,3,0,0]}),ur(sp,{dataKey:"\uC0AC\uC774\uD074\uD0C0\uC784",fill:gs,radius:[3,3,0,0]})]})})})]}):tn(jr,{sx:tr(c),children:[o?ur(jr,{sx:xr,children:o}):null,ur(Rr,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC644\uB8CC\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:c})]})}import{useMemo as hp}from"react";import{Box as Qo}from"@mui/material";import{Bar as Qc,BarChart as $5,CartesianGrid as H5,Cell as W5,Legend as U5,ReferenceLine as V5,ResponsiveContainer as K5,Tooltip as G5,XAxis as Y5,YAxis as X5}from"recharts";function F5(e,p){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(p))return null;let b=new Date(`${e}T00:00:00`).getTime(),c=new Date(`${p}T00:00:00`).getTime();return Number.isNaN(b)||Number.isNaN(c)?null:Math.round((c-b)/864e5)}function z5(e,p,b){let c=String(e.due_date??"").slice(0,10),o=F5(p,c);return o===null?"later":o<0?"overdue":o<=b?"soon":"later"}function cp(e,p){let{todayStr:b,soonDays:c=7,includeUnassigned:o=!0,limit:s}=p,r=new Map;for(let n of e){if(n.completed||n.archived||n.is_notice||n.is_event||n.linked_only)continue;let l=Number(n.manager_account_seq??0);if(!l&&!o)continue;let i=l?String(n.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",a=r.get(l)??{accountSeq:l,name:i,overdue:0,soon:0,later:0,total:0,points:0};a[z5(n,b,c)]+=1,a.total+=1,a.points+=Number(n.story_points??0)||0,r.set(l,a)}let t=[...r.values()].sort((n,l)=>n.accountSeq===0!=(l.accountSeq===0)?n.accountSeq===0?1:-1:n.overdue!==l.overdue?l.overdue-n.overdue:n.total!==l.total?l.total-n.total:n.name.localeCompare(l.name));return typeof s=="number"&&s>0?t.slice(0,s):t}function up(e,p){return p>0&&e.total>=p}function fp(e){let p=e.filter(b=>b.accountSeq>0);return p.length===0?0:p.reduce((b,c)=>b+c.total,0)/p.length}function Jc(e,p){let b=new Date(`${e}T00:00:00`);b.setDate(b.getDate()+p);let c=o=>String(o).padStart(2,"0");return`${b.getFullYear()}-${c(b.getMonth()+1)}-${c(b.getDate())}`}function q5(e){let p=new Date(`${e}T00:00:00`);if(Number.isNaN(p.getTime()))return e;let b=(p.getDay()+6)%7;return Jc(e,-b)}function dp(e,p){let{todayStr:b,includeUnassigned:c=!0,weeks:o=6,limit:s}=p,r=q5(b),t=Array.from({length:Math.max(1,o)},(d,u)=>{let g=Jc(r,u*7),m=Jc(g,6),[,v,k]=g.split("-");return{start:g,end:m,label:`${Number(v)}/${Number(k)}`,isCurrent:u===0}}),n=t[t.length-1].end,l=new Map;for(let d of e){if(d.completed||d.archived||d.is_notice||d.is_event||d.linked_only)continue;let u=Number(d.manager_account_seq??0);if(!u&&!c)continue;let g=u?String(d.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",m=l.get(u)??{accountSeq:u,name:g,overdue:0,byWeek:new Array(t.length).fill(0),noDue:0,total:0,beyond:0},v=String(d.due_date??"").slice(0,10);if(m.total+=1,!/^\d{4}-\d{2}-\d{2}$/.test(v))m.noDue+=1;else if(v<b)m.overdue+=1;else if(v>n)m.beyond+=1;else{let k=t.findIndex(B=>v>=B.start&&v<=B.end);k>=0?m.byWeek[k]+=1:m.beyond+=1}l.set(u,m)}let i=[...l.values()].sort((d,u)=>d.accountSeq===0!=(u.accountSeq===0)?d.accountSeq===0?1:-1:d.overdue!==u.overdue?u.overdue-d.overdue:d.total!==u.total?u.total-d.total:d.name.localeCompare(u.name)),a=typeof s=="number"&&s>0?i.slice(0,s):i,f=a.reduce((d,u)=>Math.max(d,u.overdue,u.noDue,...u.byWeek),0);return{weeks:t,rows:a,maxCell:f}}import{jsx as vr,jsxs as Ai}from"react/jsx-runtime";var pp="#e5484d";function mp({tasks:e,todayStr:p,soonDays:b=7,overloadThreshold:c=0,height:o=200,headerLeft:s}){let r=hp(()=>cp(e,{todayStr:p,soonDays:b}),[e,p,b]),t=hp(()=>fp(r),[r]),n=c>0?c:Math.max(3,Math.ceil(t*1.5)),l=r.filter(i=>i.accountSeq>0&&up(i,n)).length;return r.length===0?Ai(Qo,{sx:tr(o),children:[s?vr(Qo,{sx:xr,children:s}):null,vr(Rr,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:o})]}):Ai(Qo,{sx:tr(o),children:[Ai(Qo,{sx:xr,children:[s,Ai(Qo,{sx:{fontSize:13.5,color:"#37352f"},children:["1\uC778 \uD3C9\uADE0 ",vr("b",{children:t.toFixed(1)}),"\uAC74 \xB7 \uACFC\uBD80\uD558 \uAE30\uC900 ",vr("b",{children:n}),"\uAC74",l>0?Ai(Qo,{component:"span",sx:{ml:1,color:pp,fontWeight:700},children:["\uCD08\uACFC ",l,"\uBA85"]}):null]})]}),vr(Qo,{sx:On(o),children:vr(K5,{width:"100%",height:"100%",children:Ai($5,{data:r,layout:"vertical",margin:{top:4,right:16,bottom:4,left:8},barCategoryGap:r.length>8?4:10,children:[vr(H5,{strokeDasharray:"3 3",horizontal:!1,stroke:"#eceae6"}),vr(Y5,{type:"number",allowDecimals:!1,tick:{fontSize:12}}),vr(X5,{type:"category",dataKey:"name",width:84,tick:{fontSize:12},interval:0}),vr(G5,{...Ei,formatter:(i,a)=>[`${Number(i)||0}\uAC74`,String(a)]}),vr(U5,{...Ri}),t>0?vr(V5,{x:t,stroke:Jo,strokeDasharray:"4 4",label:{value:"\uD3C9\uADE0",position:"top",fontSize:11,fill:Jo}}):null,vr(Qc,{dataKey:"overdue",name:"\uC9C0\uC5F0",stackId:"load",fill:pp}),vr(Qc,{dataKey:"soon",name:`\uC784\uBC15(${b}\uC77C)`,stackId:"load",fill:gs}),vr(Qc,{dataKey:"later",name:"\uC5EC\uC720",stackId:"load",fill:so,radius:[0,3,3,0],children:r.map(i=>vr(W5,{},i.accountSeq))})]})})})]})}import{useMemo as Z5}from"react";import{Box as Hr,Tooltip as J5}from"@mui/material";import{OverlayScrollbar as Q5}from"@ehfuse/overlay-scrollbar";import{jsx as Ar,jsxs as Za}from"react/jsx-runtime";var gp="#e5484d",e6="#2f80ed",t6="#9a9a97",eu=30,r6=96,Xa=56;function tu({count:e,max:p,color:b,title:c}){let o=e>0&&p>0?.18+e/p*.72:0;return Ar(J5,{title:c,arrow:!0,disableInteractive:!0,placement:"top",children:Ar(Hr,{sx:{display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #ececea",borderBottom:"1px solid #ececea",bgcolor:o>0?`${b}${Math.round(o*255).toString(16).padStart(2,"0")}`:"transparent",color:o>.55?"#fff":"#37352f",fontSize:12.5,fontWeight:e>0?700:400,fontVariantNumeric:"tabular-nums"},children:e>0?e:""})})}function bp({tasks:e,todayStr:p,weeks:b=6,height:c=200}){let o=Z5(()=>dp(e,{todayStr:p,weeks:b}),[e,p,b]);if(o.rows.length===0)return Ar(Hr,{sx:tr(c),children:Ar(Rr,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:c})});let s=`${r6}px ${Xa}px repeat(${o.weeks.length}, minmax(${Xa}px, 1fr)) ${Xa}px ${Xa}px`,r={height:eu,display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #ececea",borderBottom:"1px solid #dcdad6",fontSize:12,fontWeight:700,color:"#37352f",bgcolor:"#f8f8f7",whiteSpace:"nowrap"};return Ar(Hr,{sx:tr(c),children:Ar(Q5,{style:{height:"100%"},thumb:{width:8},children:Za(Hr,{sx:{display:"grid",gridTemplateColumns:s,minWidth:"fit-content",height:"100%",gridTemplateRows:`${eu}px repeat(${o.rows.length}, minmax(${eu}px, 1fr))`},children:[Ar(Hr,{sx:{...r,justifyContent:"flex-start",pl:1},children:"\uB2F4\uB2F9\uC790"}),Ar(Hr,{sx:{...r,color:gp},children:"\uC9C0\uC5F0"}),o.weeks.map(t=>Ar(Hr,{sx:{...r,...t.isCurrent?{borderBottom:"2px solid #2f80ed"}:{}},children:t.label},t.start)),Ar(Hr,{sx:r,children:"\uB9C8\uAC10\uC5C6\uC74C"}),Ar(Hr,{sx:r,children:"\uD569\uACC4"}),o.rows.map(t=>Za(Hr,{sx:{display:"contents"},children:[Ar(Hr,{sx:{display:"flex",alignItems:"center",pl:1,borderRight:"1px solid #ececea",borderBottom:"1px solid #ececea",fontSize:13,color:t.accountSeq>0?"#37352f":"#9a9a97",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.name}),Ar(tu,{count:t.overdue,max:o.maxCell,color:gp,title:`${t.name} \xB7 \uC9C0\uC5F0 ${t.overdue}\uAC74`}),t.byWeek.map((n,l)=>Ar(tu,{count:n,max:o.maxCell,color:e6,title:`${t.name} \xB7 ${o.weeks[l].label} \uC8FC \uB9C8\uAC10 ${n}\uAC74`},o.weeks[l].start)),Ar(tu,{count:t.noDue,max:o.maxCell,color:t6,title:`${t.name} \xB7 \uB9C8\uAC10 \uBBF8\uC815 ${t.noDue}\uAC74`}),Za(Hr,{sx:{display:"flex",alignItems:"center",justifyContent:"center",borderBottom:"1px solid #ececea",fontSize:12.5,fontWeight:700,color:"#37352f",fontVariantNumeric:"tabular-nums"},children:[t.total,t.beyond>0?Za(Hr,{component:"span",sx:{ml:.25,fontSize:10.5,color:"#9a9a97"},children:["(+",t.beyond,")"]}):null]})]},t.accountSeq))]})})})}import{jsx as nr,jsxs as yp}from"react/jsx-runtime";var xp="min(560px, 62vh)",a6=`calc(${xp} - 4px)`,l6=[{value:"30",label:"\uCD5C\uADFC 30\uC77C"},{value:"60",label:"\uCD5C\uADFC 60\uC77C"},{value:"90",label:"\uCD5C\uADFC 90\uC77C"}];function tF({open:e,sprints:p,tasks:b,todayStr:c,showSprintCharts:o,initialSprintSeq:s=0,onClose:r}){let[t,n]=ru(0),[l,i]=ru(30);n6(()=>{if(!e)return;let B=p.find(L=>L.status==="active")??p[0],A=p.find(L=>L.seq===s)??B;n(A?.seq??0)},[e]);let a=o6(()=>p.find(B=>B.seq===t)??null,[p,t]),f={height:a6,boxSizing:"border-box",px:3,py:2.5,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden"},d=nr(nu,{label:"\uBAA9\uD45C",showLabel:!1,showEmptyOption:!1,value:t?String(t):"",options:p.map(B=>({value:String(B.seq),label:Jr(B)})),onChange:B=>n(Number(B.target.value)||0),sx:{width:280,flexShrink:0}}),[u,g]=ru("distribution"),m=nr(nu,{label:"\uBCF4\uAE30",showLabel:!1,showEmptyOption:!1,value:u,options:[{value:"distribution",label:"\uC9C0\uAE08 \uBD80\uD558(\uC9C0\uC5F0\xB7\uC784\uBC15\xB7\uC5EC\uC720)"},{value:"timeline",label:"\uC8FC\uBCC4 \uB9C8\uAC10 \uBC00\uC9D1"}],onChange:B=>g(B.target.value==="timeline"?"timeline":"distribution"),sx:{width:280,flexShrink:0}}),v=o??p.length>0,k=nr(nu,{label:"\uAE30\uAC04",showLabel:!1,showEmptyOption:!1,value:String(l),options:l6,onChange:B=>i(Number(B.target.value)||30),sx:{width:280,flexShrink:0}});return nr(s6,{open:e,onClose:r,maxWidth:"md",title:"\uC5C5\uBB34 \uCC28\uD2B8",locale:"ko",contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,sectionTitleGap:0,fixedHeight:xp,contentBottomPadding:0,scrollPastLastSection:!1,tabs:{visible:!0,switchContent:!0,fullWidth:!0},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-charts",sections:[...v?[{id:"velocity",tabTitle:"\uBCA8\uB85C\uC2DC\uD2F0",showTitle:!1,children:nr(lo,{sx:f,children:nr(Kh,{sprints:p,tasks:b,height:"100%"})})},{id:"burndown",tabTitle:"\uBC88\uB2E4\uC6B4",showTitle:!1,children:nr(lo,{sx:f,children:a?nr(Xh,{sprint:a,tasks:b,todayStr:c,height:"100%",headerLeft:d}):yp(lo,{sx:tr("100%"),children:[nr(lo,{sx:xr,children:d}),nr(Rr,{text:"\uBC88\uB2E4\uC6B4\uC744 \uBCFC \uBAA9\uD45C\uB97C \uC120\uD0DD\uD558\uC138\uC694.",height:"100%"})]})})},{id:"cumulative-flow",tabTitle:"\uB204\uC801\uD750\uB984\uB3C4",showTitle:!1,children:nr(lo,{sx:f,children:nr(op,{tasks:b,todayStr:c,days:l,height:"100%",headerLeft:k})})}]:[],{id:"workload",tabTitle:"\uC6CC\uD06C\uB85C\uB4DC",showTitle:!1,children:nr(lo,{sx:f,children:u==="timeline"?yp(lo,{sx:{display:"flex",flexDirection:"column",height:"100%",minHeight:0},children:[nr(lo,{sx:xr,children:m}),nr(bp,{tasks:b,todayStr:c,height:"100%"})]}):nr(mp,{tasks:b,todayStr:c,height:"100%",headerLeft:m})})},{id:"lead-time",tabTitle:"\uB9AC\uB4DC\uD0C0\uC784",showTitle:!1,children:nr(lo,{sx:f,children:nr(lp,{tasks:b,todayStr:c,days:l,height:"100%",headerLeft:k})})}],actions:{showCancelButton:!1,right:nr(i6,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}})}import{Checkbox as c6,Divider as u6,Menu as f6,MenuItem as ou}from"@mui/material";import{jsx as vs,jsxs as vp}from"react/jsx-runtime";function sF({anchorEl:e,candidates:p,selectedNames:b,avatarSrcByName:c,onToggle:o,onClear:s,onClose:r}){return vp(f6,{anchorEl:e,open:!!e,onClose:r,transitionDuration:0,children:[p.length===0?vs(ou,{disabled:!0,sx:{fontSize:14},children:"\uBAA9\uB85D\uC5D0 \uC9C0\uC815\uB41C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):p.map(t=>{let n=b.includes(t.name);return vp(ou,{onClick:()=>o(t),sx:{fontSize:14,minWidth:170,gap:1},children:[vs(c6,{size:"small",checked:n,sx:{p:0}}),vs(Tr,{names:[t.name],size:20,avatarSrcByName:c}),t.name]},`${t.accountSeq}-${t.name}`)}),vs(u6,{}),vs(ou,{disabled:b.length===0,onClick:s,sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{useState as d6}from"react";import{ButtonBase as h6,Menu as p6,MenuItem as m6}from"@mui/material";import g6 from"@mui/icons-material/KeyboardArrowDown";import b6 from"@mui/icons-material/Check";import{Fragment as y6,jsx as iu,jsxs as su}from"react/jsx-runtime";function pF({value:e,onChange:p,options:b}){let[c,o]=d6(null),s=b??Tl,r=Tl.find(t=>t.value===e)?.label??"";return su(y6,{children:[su(h6,{onClick:t=>o(t.currentTarget),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:1,fontSize:13.5,color:"#37352f","&:hover":{bgcolor:"#f2f2f0"}},children:[r,iu(g6,{sx:{fontSize:17,color:"#9a9a97"}})]}),iu(p6,{transitionDuration:0,anchorEl:c,open:!!c,onClose:()=>o(null),children:s.map(t=>su(m6,{selected:t.value===e,onClick:()=>{p(t.value),o(null)},sx:{fontSize:14,minWidth:140,justifyContent:"space-between",gap:1},children:[t.label,t.value===e?iu(b6,{sx:{fontSize:16,color:"#2f80ed"}}):null]},t.value))})]})}import{Box as au,ButtonBase as x6,Divider as v6,Popover as w6}from"@mui/material";import _6 from"@mui/icons-material/Check";import k6 from"@ehfuse/overlay-scrollbar";import{jsx as ei,jsxs as _p}from"react/jsx-runtime";var wp=["#1e3a8a","#2f80ed","#06b6d4","#0fa3a3","#2f9e5b","#84cc16","#e8a33d","#d9730d","#e5484d","#e255a1","#a355c0","#8a5a2b","#57564f","#111827"];function _F({anchorEl:e,value:p,color:b="",onSelect:c,onSelectColor:o,onClose:s}){return ei(w6,{transitionDuration:0,open:!!e,anchorEl:e,onClose:s,anchorOrigin:{vertical:"bottom",horizontal:"left"},marginThreshold:16,slotProps:{paper:{sx:{mt:1,maxHeight:"calc(100dvh - 96px)"}}},children:_p(au,{sx:{width:"min(492px, calc(100vw - 32px))"},children:[ei(k6,{style:{maxHeight:"min(432px, calc(100dvh - 240px))"},contentStyle:{minWidth:0,padding:10},thumb:{width:6},children:ei(na,{value:p||Ln,onChange:r=>{c(r),s()}})}),o?_p(au,{sx:{px:1.25,pb:1.25},children:[ei(v6,{sx:{mb:1,borderColor:"#efefed"}}),ei(au,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:wp.map(r=>{let t=(b||wp[0])===r;return ei(x6,{"aria-label":`\uC544\uC774\uCF58 \uC0C9 ${r}`,onClick:()=>o(r),sx:{width:26,height:26,borderRadius:"50%",bgcolor:r,display:"flex",alignItems:"center",justifyContent:"center"},children:t?ei(_6,{sx:{fontSize:15,color:"#ffffff"}}):null},r)})})]}):null]})})}import{Box as Ja,ButtonBase as S6}from"@mui/material";import{DateTextField as kp}from"@ehfuse/mui-form-controls";import{jsx as ws,jsxs as Sp}from"react/jsx-runtime";var T6=[{label:"1\uAC1C\uC6D4",months:1},{label:"3\uAC1C\uC6D4",months:3},{label:"6\uAC1C\uC6D4",months:6},{label:"1\uB144",months:12},{label:"\uC804\uCCB4",months:0}];function Tp({fromDate:e,toDate:p,onChange:b}){let c=s=>{if(s<=0){b("","");return}b(ao(Ya(s)),ao(new Date))},o=s=>s<=0?!e&&!p:!e||!p?!1:e===ao(Ya(s))&&p===ao(new Date);return Sp(Ja,{sx:{display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[ws(Ja,{sx:{display:"flex",alignItems:"center",gap:1.5},children:T6.map(s=>{let r=o(s.months);return ws(S6,{onClick:()=>c(s.months),sx:{px:1.25,py:.85,borderRadius:1,fontSize:13,fontWeight:r?500:400,border:"1px solid",borderColor:r?"#2f80ed":"#dedddb",color:r?"#2f80ed":"#37352f",bgcolor:r?"#eef6ff":"transparent","&:hover":{bgcolor:r?"#eef6ff":"#f7f7f5"}},children:s.label},s.label)})}),Sp(Ja,{sx:{display:"flex",alignItems:"center",gap:.5},children:[ws(kp,{value:e,size:"small",placeholder:"\uC2DC\uC791\uC77C",onChange:s=>b(s.target.value,p),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}}),ws(Ja,{component:"span",sx:{fontSize:13,color:"#9a9a97"},children:"~"}),ws(kp,{value:p,size:"small",placeholder:"\uC885\uB8CC\uC77C",onChange:s=>b(e,s.target.value),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}})]})]})}import{Popover as C6}from"@mui/material";import{jsx as Cp}from"react/jsx-runtime";function OF({anchorEl:e,fromDate:p,toDate:b,onChange:c,onClose:o}){return Cp(C6,{transitionDuration:0,anchorEl:e,open:!!e,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{p:1.5}}},children:Cp(Tp,{fromDate:p,toDate:b,onChange:c})})}import{Box as B6,ButtonBase as I6,Tab as M6,Tabs as E6}from"@mui/material";import R6 from"@mui/icons-material/Checklist";import O6 from"@mui/icons-material/Face";import A6 from"@mui/icons-material/Publish";import D6 from"@mui/icons-material/NotificationsOutlined";import P6 from"@mui/icons-material/BugReportOutlined";import N6 from"@mui/icons-material/DescriptionOutlined";import j6 from"@mui/icons-material/Inventory2Outlined";import{jsx as gn}from"react/jsx-runtime";function Bp(e,p){return p>0?`${e} (${p})`:e}var UF=[{id:"my",label:"\uC804\uCCB4",icon:gn(R6,{sx:{fontSize:18}})},{id:"notice",label:"\uACF5\uC9C0\uC0AC\uD56D",icon:gn(D6,{sx:{fontSize:18}})},{id:"mine",label:"\uB0B4 \uC5C5\uBB34",icon:gn(O6,{sx:{fontSize:18}})},{id:"sent",label:"\uBCF4\uB0B8 \uC5C5\uBB34",icon:gn(A6,{sx:{fontSize:18}})},{id:"bug",label:"\uC624\uB958",icon:gn(P6,{sx:{fontSize:18}})},{id:"archive",label:"\uBCF4\uAD00\uD568",icon:gn(j6,{sx:{fontSize:18}}),hideCount:!0},{id:"report",label:"\uBCF4\uACE0\uC11C",icon:gn(N6,{sx:{fontSize:18}}),hideCount:!0}];function L6(e){return{minHeight:46,minWidth:75,bgcolor:e.bg,color:e.color,borderRadius:"8px 8px 0 0",padding:"10px 18px",textTransform:"none",fontSize:14,fontWeight:500,border:`1px solid ${e.borderColor}`,borderBottom:"none","&:hover":{bgcolor:e.hoverBg},"&.Mui-selected":{bgcolor:e.selectedBg,color:e.selectedColor,border:`1px solid ${e.selectedBg}`,borderBottom:"none","&:hover":{bgcolor:e.selectedBg}},...e.sx}}function VF({items:e,activeTab:p,counts:b,onChange:c,compact:o=!1}){let s=nt(),r=L6(s.tabs),t=e;return o?gn(B6,{sx:{display:"flex",flexWrap:"wrap",gap:1.25},children:t.map(n=>{let l=p===n.id;return gn(I6,{onClick:()=>c(n.id),sx:{px:1.5,py:.75,borderRadius:1,fontSize:fr(13.5),fontWeight:500,whiteSpace:"nowrap",border:"1px solid",bgcolor:l?s.tabs.selectedBg:s.tabs.bg,color:l?s.tabs.selectedColor:s.tabs.color,borderColor:l?s.tabs.selectedBg:s.tabs.borderColor},children:Bp(n.label,n.hideCount?0:b[n.id]??0)},n.id)})}):gn(E6,{value:p,onChange:(n,l)=>c(l),sx:{minHeight:46,"& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:"12px",minHeight:46}},children:t.map(n=>gn(M6,{value:n.id,label:Bp(n.label,n.hideCount?0:b[n.id]??0),icon:n.icon,iconPosition:"start",sx:r},n.id))})}import{useEffect as F6,useMemo as z6,useState as lu}from"react";import{Divider as cu,ListItemIcon as Wr,Menu as uu,MenuItem as wr}from"@mui/material";import q6 from"@mui/icons-material/OpenInNewOutlined";import $6 from"@mui/icons-material/Check";import H6 from"@mui/icons-material/CheckCircleOutlined";import W6 from"@mui/icons-material/RadioButtonUnchecked";import U6 from"@mui/icons-material/SendOutlined";import V6 from"@mui/icons-material/EventOutlined";import K6 from"@mui/icons-material/PersonOutlineOutlined";import G6 from"@mui/icons-material/ViewKanbanOutlined";import Y6 from"@mui/icons-material/ContentCopyOutlined";import X6 from"@mui/icons-material/NextPlanOutlined";import Z6 from"@mui/icons-material/ContentPasteOutlined";import J6 from"@mui/icons-material/ShareOutlined";import Q6 from"@mui/icons-material/DirectionsRunOutlined";import Ip from"@mui/icons-material/ChevronRight";import e_ from"@mui/icons-material/ArchiveOutlined";import t_ from"@mui/icons-material/UnarchiveOutlined";import{ConfirmDialog as r_}from"@ehfuse/alerts";import{Fragment as n_,jsx as ct,jsxs as dr}from"react/jsx-runtime";function _z({target:e,onClose:p,customTabs:b,sprints:c=[],myAccountSeq:o=0,onOpenDetail:s,onToggleCompleted:r,onRequestConfirm:t,onChangeDueDate:n,onChangeReminder:l,onMemberEdit:i,onMoveProject:a,onDuplicate:f,onCreateFollowUp:d,onShare:u,onAssignSprint:g,onArchiveToggle:m,onDelete:v}){let k=It(),B=yn(),[A,L]=lu(null),[O,D]=lu(null),[j,z]=lu(null);F6(()=>{e||(L(null),D(null),z(null))},[e]);let N=e?.task??null,S=!!N?.is_notice,T=!!N?.is_event,E=N?!zn(N,o):!1,h=z6(()=>new Set(b.filter(x=>x.useSprints).map(x=>x.key)),[b]),y=async(x="one")=>{let _=N;if(p(),!_)return;await r_({title:"\uC5C5\uBB34 \uC0AD\uC81C",message:x==="series"?`"${_.title}" \uC758 \uC774 \uD68C\uCC28\uC640 \uC774\uD6C4 \uBC18\uBCF5 \uD68C\uCC28\uB97C \uBAA8\uB450 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`:`"${_.title}" \uC5C5\uBB34\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&v(_.seq,x)},w=()=>{N&&m(N.seq,!N.archived),p()};return dr(n_,{children:[dr(uu,{open:!!e,onClose:p,transitionDuration:0,anchorReference:k?"none":"anchorPosition",anchorPosition:!k&&e?{top:e.position.top,left:e.position.left}:void 0,slotProps:{paper:{sx:{minWidth:190,...k?{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxHeight:"70vh"}:{}}},list:k?{sx:{"& .MuiMenuItem-root":{py:1,minHeight:0}}}:void 0},children:[dr(wr,{onClick:()=>{N&&s(N),p()},sx:{fontSize:14},children:[ct(Wr,{children:ct(q6,{sx:{fontSize:19}})}),"\uC0C1\uC138 \uC5F4\uAE30"]}),dr(wr,{disabled:S?(N?.author_account_seq??0)!==o:(N?.author_account_seq??0)!==o&&(N?.manager_account_seq??0)!==o,onClick:()=>{N&&r(N.seq,!N.completed),p()},sx:{fontSize:14},children:[ct(Wr,{children:N?.completed?ct(W6,{sx:{fontSize:19}}):ct(H6,{sx:{fontSize:19}})}),N?.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC"]}),!S&&t?dr(wr,{disabled:!(N?.manager_account_seq??0)&&(N?.receiver_account_seqs??[]).length===0,onClick:()=>{N&&t(N),p()},sx:{fontSize:14},children:[ct(Wr,{children:ct(U6,{sx:{fontSize:19}})}),"\uD655\uC778 \uC694\uCCAD"]}):null,T?null:ct(cu,{}),T?null:dr(wr,{disabled:E,onClick:x=>{N&&L({anchorEl:x.currentTarget,task:N})},sx:{fontSize:14},children:[ct(Wr,{children:ct(V6,{sx:{fontSize:19}})}),"\uB9C8\uAC10\uC77C\uC2DC \uBCC0\uACBD"]}),!S&&!T&&i?dr(wr,{onClick:()=>{N&&i(N,"manager"),p()},sx:{fontSize:14},children:[ct(Wr,{children:ct(K6,{sx:{fontSize:19}})}),"\uCC45\uC784\uC790 \uBCC0\uACBD"]}):null,T?null:dr(wr,{disabled:E,onClick:x=>{N&&D({anchorEl:x.currentTarget,task:N})},sx:{fontSize:14},children:[ct(Wr,{children:ct(G6,{sx:{fontSize:19}})}),"\uD504\uB85C\uC81D\uD2B8 \uC774\uB3D9",ct(Ip,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}),ct(cu,{}),f?dr(wr,{disabled:E,onClick:()=>{N&&f(N.seq),p()},sx:{fontSize:14},children:[ct(Wr,{children:ct(Y6,{sx:{fontSize:19}})}),"\uBCF5\uC81C"]}):null,d&&N&&!N.is_event&&!N.is_notice?dr(wr,{onClick:()=>{N&&d(N.seq),p()},sx:{fontSize:14},children:[ct(Wr,{children:ct(X6,{sx:{fontSize:19}})}),"\uD6C4\uC18D \uC5C5\uBB34 \uB9CC\uB4E4\uAE30"]}):null,dr(wr,{onClick:()=>{N&&(u?u(N):Ci(N,k)),p()},sx:{fontSize:14},children:[ct(Wr,{children:k?ct(J6,{sx:{fontSize:19}}):ct(Z6,{sx:{fontSize:19}})}),k?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC"]}),N&&!N.is_notice&&!N.is_event&&h.has(String(N.tab_key??""))&&g?dr(wr,{onClick:x=>z(x.currentTarget),sx:{fontSize:14},children:[ct(Wr,{children:ct(Q6,{sx:{fontSize:19}})}),"\uBAA9\uD45C\uC5D0 \uB123\uAE30",ct(Ip,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}):null,dr(wr,{onClick:w,disabled:E||!N?.archived&&!(N&&Hs(N)),sx:{fontSize:14},children:[ct(Wr,{children:N?.archived?ct(t_,{sx:{fontSize:19}}):ct(e_,{sx:{fontSize:19}})}),N?.archived?"\uBCF4\uAD00 \uD574\uC81C":"\uBCF4\uAD00"]}),ct(cu,{}),dr(wr,{disabled:E,onClick:()=>{y("one")},sx:{fontSize:14,color:"#e5484d"},children:[ct(Wr,{children:ct(Zr,{sx:{fontSize:19,color:"#e5484d"}})}),(N?.repeat_group_key??0)>0?"\uC0AD\uC81C (\uC774 \uD68C\uCC28\uB9CC)":"\uC0AD\uC81C"]}),(N?.repeat_group_key??0)>0?dr(wr,{disabled:E,onClick:()=>{y("series")},sx:{fontSize:14,color:"#e5484d"},children:[ct(Wr,{children:ct(Zr,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC0AD\uC81C (\uC774\uD6C4 \uBC18\uBCF5 \uC804\uCCB4)"]}):null]}),ct(Xr,{anchorEl:A?.anchorEl??null,open:!!A,date:A?.task.due_date??"",reminder:A?.task.reminder??"none",hideReminder:!!A?.task.completed,centered:k,onClose:()=>{L(null),p()},onDateChange:x=>{A&&n(A.task.seq,x)},onReminderChange:x=>{A&&l?.(A.task.seq,x)}}),dr(uu,{transitionDuration:0,anchorEl:O?.anchorEl??null,open:!!O,onClose:()=>{D(null),p()},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...B,children:[ct(wr,{selected:!O?.task.tab_key,onClick:()=>{O&&a(O.task.seq,""),D(null),p()},sx:{fontSize:14,minWidth:170},children:"\uC5C6\uC74C"}),b.filter(x=>!x.archived).map(x=>ct(wr,{selected:O?.task.tab_key===x.key,onClick:()=>{O&&a(O.task.seq,x.key),D(null),p()},sx:{fontSize:14,minWidth:170},children:x.label},x.key))]}),ct(uu,{transitionDuration:0,anchorEl:j,open:!!j,onClose:()=>z(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...c.filter(x=>`custom-${x.group_seq}`===String(N?.tab_key??"")).map(x=>({seq:x.seq,label:Jr(x)}))].map(x=>dr(wr,{onClick:()=>{N&&g?.(N.seq,x.seq),z(null),p()},sx:{fontSize:14,minWidth:160,gap:1},children:[x.label,(N?.sprint_seq??0)===x.seq?ct($6,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},x.seq))})]})}import{Checkbox as o_,Divider as i_,Menu as s_,MenuItem as Mp}from"@mui/material";import{jsx as Qa,jsxs as Ep}from"react/jsx-runtime";function Bz({anchorEl:e,labelOptions:p,selectedKeys:b,onToggle:c,onClear:o,onClose:s}){return Ep(s_,{transitionDuration:0,anchorEl:e,open:!!e,onClose:s,children:[p.map(r=>{let t=b.includes(r.key);return Ep(Mp,{onClick:()=>c(r.key),sx:{fontSize:14,minWidth:190,gap:1},children:[Qa(o_,{size:"small",checked:t,sx:{p:0}}),Qa(Rt,{option:r})]},r.key)}),Qa(i_,{}),Qa(Mp,{disabled:b.length===0,onClick:()=>{o(),s()},sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{Divider as a_,Menu as l_,MenuItem as Rp}from"@mui/material";import c_ from"@mui/icons-material/Check";import u_ from"@mui/icons-material/SettingsOutlined";import{jsx as fu,jsxs as du}from"react/jsx-runtime";function Dz(e){let{anchorEl:p,sprints:b,value:c,onSelect:o,onManage:s,onClose:r}=e;return du(l_,{transitionDuration:0,anchorEl:p,open:!!p,onClose:r,children:[[{seq:0,label:"\uC804\uCCB4"},{seq:-1,label:"\uBBF8\uBC30\uC815 \uC5C5\uBB34"},...b.map(t=>({seq:t.seq,label:Jr(t)}))].map(t=>du(Rp,{onClick:()=>{o(t.seq),r()},sx:{fontSize:14,minWidth:180,gap:1},children:[t.label,c===t.seq?fu(c_,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},t.seq)),fu(a_,{}),du(Rp,{onClick:()=>{r(),s()},sx:{fontSize:14,gap:1},children:[fu(u_,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uAD00\uB9AC\u2026"]})]})}var f_={my:"tasks",mine:"tasks",sent:"tasks",notice:"notice",bug:"bug",archive:"archive",done:"done",report:"report"};function d_(e){return f_[e]??"tasks"}var Ap={list:"\uBAA9\uB85D",card:"\uD504\uB85C\uC81D\uD2B8",kanban:"\uC0C1\uD0DC",sprint:"\uBAA9\uD45C",calendar:"\uC8FC\uAC04",month:"\uC6D4\uAC04",agenda:"\uC544\uC820\uB2E4",timeline:"\uD0C0\uC784\uB77C\uC778"},Op=["list","calendar","month","card","kanban","sprint","timeline"],h_=["list","card"];function jz(e){let p=d_(e);switch(p){case"notice":return{kind:p,viewOptions:[],showCreate:!0,createLabel:"\uACF5\uC9C0\uC0AC\uD56D \uB4F1\uB85D",showGroupBy:!1,showSprintFilter:!1,showDateRange:!1,showHideCompleted:!0,forceFlatList:!0,columns:{notice:!0}};case"bug":return{kind:p,viewOptions:Op,showCreate:!0,createLabel:"\uC624\uB958 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:{bug:!0}};case"archive":return{kind:p,viewOptions:h_,showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"done":return{kind:p,viewOptions:["list"],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"report":return{kind:p,viewOptions:[],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{}};default:return{kind:p,viewOptions:Op,showCreate:!0,createLabel:"\uC5C5\uBB34 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:e==="mine"?{showRequest:!1,confirmMode:"action"}:e==="sent"?{confirmMode:"time"}:{}}}}import{useMemo as p_}from"react";import{useKeyboardState as m_}from"@ehfuse/keyboard-state";var Dp=[{key:"g l",view:"list"},{key:"g b",view:"card"},{key:"g k",view:"kanban"},{key:"g s",view:"sprint"},{key:"g c",view:"calendar"},{key:"g m",view:"month"},{key:"g t",view:"timeline"}];function $z(e,p={}){let{enabled:b=!0,views:c}=p,{onCreateTask:o,onFocusSearch:s,onToggleHelp:r,onChangeView:t,onRefresh:n,onEscape:l}=e,i=c?c.join(","):"",a=p_(()=>{let f=[];if(o&&f.push({key:"n",callback:o,options:{preventDefault:!0}}),s&&f.push({key:"/",callback:s,options:{preventDefault:!0}}),n&&f.push({key:"r",callback:n,options:{preventDefault:!0}}),r&&f.push({key:"shift+?",callback:r,options:{preventDefault:!0}}),l&&f.push({key:"escape",callback:l,options:{allowInEditable:!0}}),t)for(let d of Pp(i?i.split(","):void 0))f.push({key:d.key,callback:()=>t(d.view),options:{preventDefault:!0}});return f},[o,s,r,t,n,l,i]);m_(b?a:[])}function Pp(e){if(!e)return Dp;let p=new Set(e);return Dp.filter(b=>p.has(b.view))}function hu(e){return[{keys:"N",description:"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D"},{keys:"/",description:"\uAC80\uC0C9"},{keys:"R",description:"\uBAA9\uB85D \uC0C8\uB85C\uACE0\uCE68"},...Pp(e).map(p=>({keys:p.key.split(" ").map(b=>b.toUpperCase()).join(" \u2192 "),description:`${Ap[p.view]} \uBCF4\uAE30`})),{keys:"?",description:"\uB2E8\uCD95\uD0A4 \uB3C4\uC6C0\uB9D0"},{keys:"Esc",description:"\uB2EB\uAE30"}]}var Hz=hu();import{Box as _s,Button as g_}from"@mui/material";import b_ from"@mui/icons-material/ArrowRightAlt";import{FormDialog as y_}from"@ehfuse/mui-form-dialog";import{jsx as Io,jsxs as Np}from"react/jsx-runtime";function x_({keys:e}){return Io(_s,{sx:{display:"flex",alignItems:"center",gap:.5,justifyContent:"flex-end"},children:e.split(" \u2192 ").map((p,b)=>Np(_s,{sx:{display:"flex",alignItems:"center",gap:.5},children:[b>0?Io(b_,{sx:{fontSize:18,color:"#9a9a97"}}):null,Io(_s,{component:"span",sx:{minWidth:32,height:32,px:.75,display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:13.5,fontWeight:700,color:"#37352f",bgcolor:"#f4f4f2",border:"1px solid #e0dfdb",borderRadius:1,fontVariantNumeric:"tabular-nums"},children:p})]},`${p}-${b}`))})}function Yz({open:e,onClose:p,views:b}){let c=hu(b);return Io(y_,{open:e,onClose:p,maxWidth:"xs",title:"\uB2E8\uCD95\uD0A4",locale:"ko",titleIcons:{delete:{visible:!1}},tabs:{visible:!1},sections:[{id:"shortcuts",showTitle:!1,children:Io(_s,{sx:{display:"grid",gridTemplateColumns:"auto 1fr",columnGap:2,rowGap:1.25,alignItems:"center",fontSize:14,color:"#37352f"},children:c.map(o=>Np(_s,{sx:{display:"contents"},children:[Io(x_,{keys:o.keys}),Io("span",{children:o.description})]},o.keys))})}],actions:{showCancelButton:!1,right:Io(g_,{variant:"contained",onClick:p,children:"\uB2EB\uAE30"})}})}import{useEffect as v_,useState as pu}from"react";import{Box as hr,Button as Di,IconButton as jp,Switch as w_,Tooltip as __}from"@mui/material";import{FormDialog as k_}from"@ehfuse/mui-form-dialog";import S_ from"@mui/icons-material/EditOutlined";import{ErrorAlert as Lp}from"@ehfuse/alerts";import{ClearTextField as mu,LabelSelect as Pn}from"@ehfuse/mui-form-controls";import{jsx as Tt,jsxs as Lr}from"react/jsx-runtime";var Fp=[{value:"created",label:"\uC5C5\uBB34 \uB4F1\uB85D \uC2DC",hint:"\uC0C8 \uC5C5\uBB34\uAC00 \uB9CC\uB4E4\uC5B4\uC9C4 \uC9C1\uD6C4 \uD55C \uBC88"},{value:"status_changed",label:"\uC0C1\uD0DC \uBCC0\uACBD \uC2DC",hint:"\uC0C1\uD0DC\uAC00 \uC2E4\uC81C\uB85C \uBC14\uB010 \uC9C1\uD6C4"},{value:"overdue",label:"\uB9C8\uAC10 \uACBD\uACFC \uC2DC",hint:"\uB9C8\uAC10\uC774 \uC9C0\uB09C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uB97C \uC8FC\uAE30\uC801\uC73C\uB85C \uC810\uAC80"}],rl=[{value:"",label:"\uC9C0\uC815 \uC548 \uD568"},{value:"high",label:"\uB192\uC74C"},{value:"medium",label:"\uC911\uAC04"},{value:"low",label:"\uB0AE\uC74C"}];function el(){return{name:"",trigger:"created",enabled:!0,sort_no:0,condition:{},action:{}}}function tl(e){return xn.find(p=>p.key===e)?.name??e}function T_(e,p,b){let{condition:c,action:o}=e,s=[];if(c.group_seq){let l=p.find(i=>Mi(i.key)===c.group_seq);s.push(`\uD504\uB85C\uC81D\uD2B8=${l?.label??`#${c.group_seq}`}`)}c.is_bug===!0&&s.push("\uC624\uB958\uB9CC"),c.is_event===!0&&s.push("\uC77C\uC815\uB9CC"),c.priority&&s.push(`\uC911\uC694\uB3C4=${rl.find(l=>l.value===c.priority)?.label}`),c.label_key&&s.push(`\uB77C\uBCA8=${b.find(l=>l.key===c.label_key)?.name??c.label_key}`),c.status&&s.push(`\uC0C1\uD0DC=${tl(c.status)}`),c.from_status&&s.push(`${tl(c.from_status)}\uC5D0\uC11C`),c.to_status&&s.push(`${tl(c.to_status)}\uB85C`),c.manager_empty===!0&&s.push("\uCC45\uC784\uC790 \uC5C6\uC74C"),c.manager_empty===!1&&s.push("\uCC45\uC784\uC790 \uC788\uC74C"),typeof c.overdue_days=="number"&&s.push(`${c.overdue_days}\uC77C \uACBD\uACFC`);let r=[];o.set_status&&r.push(`\uC0C1\uD0DC \u2192 ${tl(o.set_status)}`),o.set_priority&&r.push(`\uC911\uC694\uB3C4 \u2192 ${rl.find(l=>l.value===o.set_priority)?.label}`),o.assign_manager_account_seq&&r.push(`\uCC45\uC784\uC790 \u2192 ${o.assign_manager_name||"\uC9C0\uC815"}`),o.add_receiver_account_seq&&r.push(`\uCC38\uC870\uC790 + ${o.add_receiver_name||"\uC9C0\uC815"}`),o.add_label_key&&r.push(`\uB77C\uBCA8 + ${b.find(l=>l.key===o.add_label_key)?.name??o.add_label_key}`),o.notify_account_seq&&r.push("\uC54C\uB9BC \uBC1C\uC1A1");let t=Fp.find(l=>l.value===e.trigger)?.label??e.trigger;return`${s.length>0?`${t} \xB7 ${s.join(", ")}`:t} \u2192 ${r.join(", ")||"\uB3D9\uC791 \uC5C6\uC74C"}`}function aq({open:e,rules:p,customTabs:b,statusOptions:c,onPickAccount:o,onClose:s,onCreate:r,onUpdate:t,onToggle:n,onRemove:l}){let[i,a]=pu(0),[f,d]=pu(el()),[u,g]=pu(!1);v_(()=>{e||(a(0),d(el()))},[e]);let m=i>0,v=f.trigger,k=(N,S)=>{d(T=>{let E={...T.condition};return S===""||S===void 0||S===null?delete E[N]:E[N]=S,{...T,condition:E}})},B=(N,S)=>{d(T=>{let E={...T.action};return S===""||S===void 0||S===null?delete E[N]:E[N]=S,{...T,action:E}})},A=async N=>{if(!o)return;let S=N==="manager"?f.action.assign_manager_account_seq:N==="receiver"?f.action.add_receiver_account_seq:f.action.notify_account_seq,T=await o(S??0);T&&d(E=>{let h={...E.action};return N==="manager"?(h.assign_manager_account_seq=T.accountSeq,h.assign_manager_name=T.name):N==="receiver"?(h.add_receiver_account_seq=T.accountSeq,h.add_receiver_name=T.name):h.notify_account_seq=T.accountSeq,{...E,action:h}})},L=async()=>{if(!f.name.trim()){Lp({message:"\uADDC\uCE59 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694."});return}if(Object.keys(f.action).length===0){Lp({message:"\uADDC\uCE59\uC774 \uD560 \uB3D9\uC791\uC744 \uD558\uB098 \uC774\uC0C1 \uC9C0\uC815\uD558\uC138\uC694."});return}g(!0);let N=m?await t(i,f):await r(f);g(!1),N&&(a(0),d(el()))},O=[{value:"",label:"\uC9C0\uC815 \uC548 \uD568"},...c.map(N=>({value:N.key,label:N.name}))],D=[{value:"",label:"\uC9C0\uC815 \uC548 \uD568"},...xn.map(N=>({value:N.key,label:N.name}))],j=[{value:"0",label:"\uC804\uCCB4"},...b.filter(N=>!N.archived).map(N=>({value:String(Mi(N.key)),label:N.label}))],z=(N,S)=>S?N||`\uACC4\uC815 #${S}`:"\uC120\uD0DD \uC548 \uD568";return Tt(k_,{open:e,onClose:s,maxWidth:"md",title:"\uC790\uB3D9\uD654 \uADDC\uCE59",locale:"ko",titleIcons:{delete:{visible:!1}},sections:[{id:"form",title:m?"\uADDC\uCE59 \uC218\uC815":"\uC0C8 \uADDC\uCE59",children:Lr(hr,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[Lr(hr,{sx:{display:"flex",gap:1.5,flexWrap:"wrap"},children:[Tt(mu,{label:"\uADDC\uCE59 \uC774\uB984",value:f.name,onChange:N=>d(S=>({...S,name:N.target.value})),sx:{flex:"1 1 240px"}}),Tt(Pn,{label:"\uBC1C\uB3D9 \uC2DC\uC810",value:f.trigger,options:Fp.map(N=>({value:N.value,label:N.label})),onChange:N=>d(S=>({...S,trigger:N.target.value})),sx:{flex:"0 0 200px"}}),Tt(mu,{label:"\uC21C\uC11C",type:"number",value:String(f.sort_no),onChange:N=>d(S=>({...S,sort_no:Number(N.target.value)||0})),sx:{flex:"0 0 100px"}})]}),Lr(hr,{sx:{fontSize:13.5,fontWeight:700,color:"#37352f",mt:.5},children:["\uC870\uAC74 ",Tt(hr,{component:"span",sx:{fontWeight:400,color:"#787774"},children:"(\uC9C0\uC815\uD55C \uAC83\uB9CC, \uC804\uBD80 \uB9CC\uC871\uD574\uC57C \uC2E4\uD589)"})]}),Lr(hr,{sx:{display:"flex",gap:1.5,flexWrap:"wrap"},children:[Tt(Pn,{label:"\uD504\uB85C\uC81D\uD2B8",value:String(f.condition.group_seq??0),options:j,onChange:N=>k("group_seq",Number(N.target.value)||""),sx:{flex:"1 1 180px"}}),Tt(Pn,{label:"\uC911\uC694\uB3C4",value:f.condition.priority??"",options:rl,onChange:N=>k("priority",N.target.value),sx:{flex:"1 1 150px"}}),Tt(Pn,{label:"\uB77C\uBCA8",value:f.condition.label_key??"",options:O,onChange:N=>k("label_key",N.target.value),sx:{flex:"1 1 150px"}}),Tt(Pn,{label:"\uCC45\uC784\uC790",value:f.condition.manager_empty===void 0?"":f.condition.manager_empty?"empty":"assigned",options:[{value:"",label:"\uC9C0\uC815 \uC548 \uD568"},{value:"empty",label:"\uC5C6\uC744 \uB54C"},{value:"assigned",label:"\uC788\uC744 \uB54C"}],onChange:N=>k("manager_empty",N.target.value===""?"":N.target.value==="empty"),sx:{flex:"1 1 150px"}})]}),v==="status_changed"?Lr(hr,{sx:{display:"flex",gap:1.5,flexWrap:"wrap"},children:[Tt(Pn,{label:"\uC774 \uC0C1\uD0DC\uC5D0\uC11C",value:f.condition.from_status??"",options:D,onChange:N=>k("from_status",N.target.value),sx:{flex:"1 1 200px"}}),Tt(Pn,{label:"\uC774 \uC0C1\uD0DC\uB85C \uBC14\uB00C\uBA74",value:f.condition.to_status??"",options:D,onChange:N=>k("to_status",N.target.value),sx:{flex:"1 1 200px"}})]}):null,v==="overdue"?Tt(mu,{label:"\uB9C8\uAC10 \uD6C4 \uBA70\uCE60 \uC9C0\uB0AC\uC744 \uB54C\uBD80\uD130",type:"number",value:String(f.condition.overdue_days??0),onChange:N=>k("overdue_days",Math.max(0,Number(N.target.value)||0)),sx:{width:240}}):null,Lr(hr,{sx:{fontSize:13.5,fontWeight:700,color:"#37352f",mt:.5},children:["\uB3D9\uC791 ",Tt(hr,{component:"span",sx:{fontWeight:400,color:"#787774"},children:"(\uD558\uB098 \uC774\uC0C1 \uD544\uC694 \xB7 \uC774\uBBF8 \uADF8 \uAC12\uC774\uBA74 \uAC74\uB108\uB6F4\uB2E4)"})]}),Lr(hr,{sx:{display:"flex",gap:1.5,flexWrap:"wrap"},children:[Tt(Pn,{label:"\uC0C1\uD0DC \uBCC0\uACBD",value:f.action.set_status??"",options:D,onChange:N=>B("set_status",N.target.value),sx:{flex:"1 1 180px"}}),Tt(Pn,{label:"\uC911\uC694\uB3C4 \uBCC0\uACBD",value:f.action.set_priority??"",options:rl,onChange:N=>B("set_priority",N.target.value),sx:{flex:"1 1 150px"}}),Tt(Pn,{label:"\uB77C\uBCA8 \uCD94\uAC00",value:f.action.add_label_key??"",options:O,onChange:N=>B("add_label_key",N.target.value),sx:{flex:"1 1 150px"}})]}),o?Lr(hr,{sx:{display:"flex",gap:1,flexWrap:"wrap",alignItems:"center"},children:[Lr(Di,{variant:"outlined",size:"small",onClick:()=>{A("manager")},children:["\uCC45\uC784\uC790 \uC9C0\uC815: ",z(f.action.assign_manager_name,f.action.assign_manager_account_seq)]}),Lr(Di,{variant:"outlined",size:"small",onClick:()=>{A("receiver")},children:["\uCC38\uC870\uC790 \uCD94\uAC00: ",z(f.action.add_receiver_name,f.action.add_receiver_account_seq)]}),Lr(Di,{variant:"outlined",size:"small",onClick:()=>{A("notify")},children:["\uC54C\uB9BC \uB300\uC0C1: ",f.action.notify_account_seq?`\uACC4\uC815 #${f.action.notify_account_seq}`:"\uC120\uD0DD \uC548 \uD568"]})]}):null,Lr(hr,{sx:{display:"flex",gap:1,justifyContent:"flex-end"},children:[m?Tt(Di,{color:"inherit",onClick:()=>{a(0),d(el())},children:"\uCDE8\uC18C"}):null,Tt(Di,{variant:"contained",onClick:()=>{L()},disabled:u,children:m?"\uC218\uC815":"\uADDC\uCE59 \uCD94\uAC00"})]})]})},{id:"list",title:`\uB4F1\uB85D\uB41C \uADDC\uCE59 (${p.length})`,children:p.length===0?Tt(hr,{sx:{py:3,textAlign:"center",color:"#9a9a97",fontSize:14},children:"\uC544\uC9C1 \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uC704\uC5D0\uC11C \uB9CC\uB4E4\uC5B4 \uBCF4\uC138\uC694."}):Tt(hr,{sx:{display:"flex",flexDirection:"column"},children:p.map(N=>Lr(hr,{sx:{display:"flex",alignItems:"center",gap:1,py:1,borderBottom:"1px solid #ececea",opacity:N.enabled?1:.5},children:[Tt(__,{title:N.enabled?"\uC0AC\uC6A9 \uC911":"\uAEBC\uC9D0",arrow:!0,disableInteractive:!0,children:Tt(w_,{size:"small",checked:N.enabled,onChange:(S,T)=>n(N.seq,T)})}),Lr(hr,{sx:{flex:1,minWidth:0},children:[Tt(hr,{sx:{fontSize:14,fontWeight:600,color:"#37352f"},children:N.name}),Tt(hr,{sx:{fontSize:13,color:"#6f6f6c"},children:T_(N,b,c)})]}),Tt(jp,{size:"small",onClick:()=>{a(N.seq),d({name:N.name,trigger:N.trigger,enabled:N.enabled,sort_no:N.sort_no,condition:{...N.condition},action:{...N.action}})},children:Tt(S_,{sx:{fontSize:18}})}),Tt(jp,{size:"small",onClick:()=>l(N.seq),children:Tt(Zr,{sx:{fontSize:18}})})]},N.seq))})}],actions:{showCancelButton:!1,right:Tt(Di,{variant:"contained",onClick:s,children:"\uB2EB\uAE30"})}})}var C_={urgent:"\uAE34\uAE09",high:"\uB192\uC74C",normal:"\uC911\uAC04",low:"\uB0AE\uC74C"};function B_(e){return e.length===0?"":e.length<=2?e.join(", "):`${e[0]} \uC678 ${e.length-1}\uBA85`}function gu(e){let p=String(e??"").trim().slice(0,10);return/^\d{4}-\d{2}-\d{2}$/.test(p)?`${p.slice(2,4)}.${p.slice(5,7)}.${p.slice(8,10)}`:"-"}function Pi(e){let p=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())} ${p(e.getHours())}:${p(e.getMinutes())}`}function bu(e,p){let c=String(e.due_date??"").slice(11,16).trim()||String(e.estimated_time??"").trim(),o=gu(e.due_date),s=String(e.start_date??"").slice(11,16).trim(),r=gu(e.start_date),t=(e.receiver_names??[]).filter(Boolean).map(l=>String(l).trim()),n=(e.checklist??[]).length?`${(e.checklist??[]).filter(l=>l.checked).length}/${(e.checklist??[]).length}`:"";return{seq:Number(e.seq??0),title:String(e.title??"").trim(),statusName:ir(e).name,projectLabel:e.tab_key?p.get(String(e.tab_key))??"":"",managerName:String(e.manager_name??"").trim(),receiverNames:B_(t),receiverNamesFull:t.join(", "),startDate:r!=="-"&&s?`${r} ${s}`:r,dueDate:o!=="-"&&c?`${o} ${c}`:o,priorityName:C_[String(e.priority??"")]??"",checklist:n,note:String(e.note??"").trim(),completed:!!e.completed}}function Ct(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function I_(e,p){if(e===" ")return p*.3;let b=e.codePointAt(0)??0,c=b>=4352&&b<=4607||b>=12288&&b<=40959||b>=44032&&b<=55203||b>=63744&&b<=64255||b>=65280&&b<=65519;return p*(c?1:.55)}function nl(e,p){let b=0;for(let c of String(e??""))b+=I_(c,p);return b}function Ni(e,p){let b=String(e??"").trim();if(!b)return["-"];let c=[],o="";for(let s of b){if(s===`
41
+ `)}function hh(e){navigator.clipboard.writeText(e).then(()=>R3("\uC5C5\uBB34 \uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>E3("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uB0B4\uC6A9\uC744 \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD574 \uC8FC\uC138\uC694."))}function Ci(e,p){let b=O3(e);if(p&&typeof navigator.share=="function"){navigator.share({text:b}).catch(c=>{c?.name!=="AbortError"&&hh(b)});return}hh(b)}import{Fragment as F3,jsx as jt,jsxs as ph}from"react/jsx-runtime";function mh({task:e,myAccountSeq:p=0,onToggleCompleted:b,onChangeTitle:c,onChangeIcon:o,onChangeIconColor:s,onClose:r,appBarMode:t=!1,activityItems:n,activityLoading:l,onLoadActivity:i,onPrint:a}){let f=It(),[d,u]=Oc(!1),[g,m]=Oc(null),[v,k]=Oc(null),B=e.is_notice?bt(e.icon||Gt):null,A=!!e.is_notice,L=!!e.is_event,O=A&&p>0&&(e.author_account_seq??0)===p,D=!zn(e,p),j=!L&&(A?O:(e.author_account_seq??0)===p||(e.manager_account_seq??0)===p);return ph(F3,{children:[ph(Bi,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[t&&r?jt(hs,{"aria-label":"\uB4A4\uB85C",onClick:r,sx:{color:"#37352f",ml:-1},children:jt(D3,{})}):null,j&&!t?jt(Ua,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${qr(e.completed_time)} \uC644\uB8CC`:"",arrow:!0,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:jt(Bi,{sx:{display:"flex",flexShrink:0,mr:1.5},children:jt(vn,{onClick:z=>k({anchorEl:z.currentTarget,nextCompleted:!e.completed}),children:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC\uD558\uAE30"})})}):null,t||!B?null:jt(Bi,{sx:{display:"flex",px:.5,color:e.icon_color||(A?"#e5484d":"#1e3a8a")},children:jt(B,{sx:{fontSize:20}})}),g!==null?jt(Bi,{component:"input",autoFocus:!0,spellCheck:!1,value:g,onChange:z=>m(z.target.value),onBlur:()=>{g.trim()&&g.trim()!==e.title&&c(e.seq,g.trim()),m(null)},onKeyDown:z=>{z.key==="Enter"&&z.target.blur(),z.key==="Escape"&&m(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0}}):t?jt(Bi,{sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:A?"\uACF5\uC9C0":L?"\uC77C\uC815":e.is_bug?"\uC624\uB958":"\uC5C5\uBB34"}):jt(Bi,{onClick:D?void 0:()=>m(e.title),sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:D?"default":"text",textDecoration:e.completed?"line-through":"none"},children:e.title}),i?jt(Ua,{title:"\uD65C\uB3D9",arrow:!0,children:jt(hs,{"aria-label":"\uD65C\uB3D9",onClick:()=>u(!0),sx:{color:"#6b7280"},children:jt(j3,{sx:{fontSize:20}})})}):null,jt(Ua,{title:f?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:jt(hs,{"aria-label":f?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>Ci(e,f),sx:{color:"#6b7280"},children:f?jt(P3,{sx:{fontSize:20}}):jt(N3,{sx:{fontSize:20}})})}),a?jt(Ua,{title:"\uC778\uC1C4",arrow:!0,children:jt(hs,{"aria-label":"\uC778\uC1C4",onClick:()=>a(e),sx:{color:"#6b7280"},children:jt(L3,{sx:{fontSize:20}})})}):null,r&&!t?jt(hs,{"aria-label":"\uB2EB\uAE30",onClick:r,sx:{color:"#6b7280"},children:jt(A3,{})}):null]}),jt(Mt,{open:!!v,anchorEl:v?.anchorEl??null,title:v?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:v?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>k(null),onConfirm:()=>{v&&b(e.seq,v.nextCompleted),k(null)}}),jt(Wa,{open:d,taskSeq:e.seq,items:n,loading:l,onLoad:i,onClose:()=>u(!1)})]})}import{useState as hn}from"react";import{Box as $t,Button as Ii,ButtonBase as Z3,Checkbox as J3,Divider as Go,Menu as Lc,MenuItem as Fc}from"@mui/material";import Q3 from"@mui/icons-material/ExpandLess";import e4 from"@mui/icons-material/ExpandMore";import t4 from"@mui/icons-material/ConfirmationNumberOutlined";import _h from"@mui/icons-material/Check";import r4 from"@mui/icons-material/DirectionsRunOutlined";import n4 from"@mui/icons-material/SpeedOutlined";import zc from"@mui/icons-material/CheckCircle";import o4 from"@mui/icons-material/CheckCircleOutlineOutlined";import qc from"@mui/icons-material/CheckCircleOutlined";import kh from"@mui/icons-material/AccessTimeOutlined";import i4 from"@mui/icons-material/AutorenewOutlined";import s4 from"@mui/icons-material/LabelOutlined";import a4 from"@mui/icons-material/PersonOutlineOutlined";import l4 from"@mui/icons-material/SubjectOutlined";import c4 from"@mui/icons-material/StickyNote2Outlined";import u4 from"@mui/icons-material/PanToolAltOutlined";import Sh from"@mui/icons-material/LockOutlined";import Th from"@mui/icons-material/PublicOutlined";import Ch from"@mui/icons-material/Group";import f4 from"@mui/icons-material/Repeat";import d4 from"@mui/icons-material/EventOutlined";import{Box as z3}from"@mui/material";import{jsx as q3}from"react/jsx-runtime";function gh({size:e=40}){return q3(z3,{sx:{boxSizing:"border-box",width:e,height:e,borderRadius:"50%",border:"4px solid rgba(28, 64, 125, 0.14)",borderTopColor:"#1c407d",animation:"taskbox-content-loading-spin 0.75s linear infinite","@keyframes taskbox-content-loading-spin":{to:{transform:"rotate(360deg)"}}}})}import{ConfirmDialog as Bh,InfoAlert as h4}from"@ehfuse/alerts";import{DatePicker as p4}from"@ehfuse/mui-datetime-picker";import{useState as $3}from"react";import{TextField as H3}from"@ehfuse/mui-form-controls";import{jsx as W3}from"react/jsx-runtime";function bh({value:e,onCommit:p,onDraftChange:b,readOnly:c=!1}){let[o,s]=$3(null);return W3(H3,{value:o??e,placeholder:c?"":"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",slotProps:{input:{readOnly:c}},onChange:r=>{s(r.target.value),b?.(r.target.value)},onBlur:()=>{o!==null&&o.trim()!==e&&p(o),s(null)},onKeyDown:r=>{r.key==="Enter"&&r.target.blur(),r.key==="Escape"&&s(null)},sx:{mt:1}})}import{useMemo as Pc,useState as Nc}from"react";import{Box as yr,Button as vh,IconButton as U3}from"@mui/material";import V3 from"@mui/icons-material/AccountTreeOutlined";import K3 from"@mui/icons-material/Add";import G3 from"@mui/icons-material/Close";import Y3 from"@mui/icons-material/NextPlanOutlined";function Ko(e){return e.relations??[]}function yP(e,p,b){return Ko(e).some(c=>c.type===b&&c.task_seq===p.seq)||Ko(p).some(c=>c.type===b&&c.task_seq===e.seq)}function yh(e){return`${e.created_time??""}|${String(e.seq).padStart(12,"0")}`}function Ac(e,p){let b=new Map(p.map(d=>[d.seq,d]));b.set(e.seq,e);let c=new Map,o=(d,u)=>{c.has(d)||c.set(d,new Set),c.has(u)||c.set(u,new Set),c.get(d).add(u),c.get(u).add(d)};for(let d of b.values())for(let u of Ko(d))u.type==="follow_up"&&b.has(u.task_seq)&&o(d.seq,u.task_seq);let s=new Set([e.seq]),r=[e.seq];for(;r.length>0;){let d=r.shift();for(let u of c.get(d)??[])s.has(u)||(s.add(u),r.push(u))}let t=[...s].map(d=>b.get(d)).filter(d=>!!d).sort((d,u)=>yh(d).localeCompare(yh(u))),n=new Set;for(let d of Ko(e))d.type==="related"&&n.add(d.task_seq);for(let d of b.values())d.seq!==e.seq&&Ko(d).some(u=>u.type==="related"&&u.task_seq===e.seq)&&n.add(d.seq);let l=[...n].map(d=>b.get(d)).filter(d=>d!==void 0&&d.seq!==e.seq),i=[...b.values()].filter(d=>d.seq!==e.seq&&Ko(d).some(u=>u.type==="duplicate_of"&&u.task_seq===e.seq)),a=Ko(e).find(d=>d.type==="duplicate_of")?.task_seq,f=a?b.get(a)??null:null;return{lineage:t,related:l,duplicates:i,duplicateOf:f}}function Dc(e,p){let b=Ac(e,p);return(b.lineage.length>=2?b.lineage.length-1:0)+b.related.length+b.duplicates.length+(b.duplicateOf?1:0)}function xh(e,p){return Dc(e,p)>0}import{Fragment as X3,jsx as qt,jsxs as dn}from"react/jsx-runtime";function jc({item:e,caption:p,onOpen:b,onUnlink:c}){let o=e.is_notice||e.is_event?bt(e.icon||(e.is_notice?Gt:or)):null;return dn(yr,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-relation-unlink":{opacity:1}},children:[p?qt(yr,{component:"span",sx:{flexShrink:0,px:.6,py:.1,borderRadius:.75,fontSize:11.5,fontWeight:500,color:"#8a6d1d",bgcolor:"#faf1d7"},children:p}):null,o?qt(o,{sx:{fontSize:16,flexShrink:0,color:e.icon_color||"#1e3a8a"}}):null,dn(yr,{component:"span",onClick:b,sx:{flex:1,minWidth:0,fontSize:14,color:e.completed?"#9a9a97":"#37352f",textDecoration:e.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...b?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[e.ticket_no?`${e.ticket_no} `:"",e.title]}),qt(Rt,{option:ir(e),small:!0}),c?qt(U3,{className:"taskbox-relation-unlink",size:"small","aria-label":"\uC5F0\uACB0 \uD574\uC81C",onClick:c,sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:qt(G3,{sx:{fontSize:15}})}):null]})}function wh({task:e,tasks:p,readOnly:b=!1,onOpenTask:c,onLink:o,onUnlink:s,onCreateFollowUp:r}){let[t,n]=Nc(!1),[l,i]=Nc(null),[a,f]=Nc(null),d=Pc(()=>Ac(e,p),[e,p]),u=d.lineage.length>=2,g=Pc(()=>Dc(e,p),[e,p]),m=Pc(()=>{let k=new Set;for(let B of d.lineage)k.add(B.seq);for(let B of d.related)k.add(B.seq);for(let B of d.duplicates)k.add(B.seq);return d.duplicateOf&&k.add(d.duplicateOf.seq),[...k]},[d]),v=(k,B,A)=>{f({anchorEl:k,targetSeq:B,type:A})};return dn(en,{icon:qt(V3,{sx:{fontSize:19,display:"block"}}),title:dn(X3,{children:["\uAD00\uB828 \uC5C5\uBB34",g>0?qt(yr,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:g}):null]}),titleExtra:b?null:dn(yr,{sx:{ml:"auto",display:"flex",alignItems:"center",gap:.5},children:[r?qt(vh,{size:"small",color:"inherit",startIcon:qt(Y3,{sx:{fontSize:16}}),onClick:k=>i(k.currentTarget),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uD6C4\uC18D \uC5C5\uBB34"}):null,o?qt(vh,{size:"small",color:"inherit",startIcon:qt(K3,{sx:{fontSize:16}}),onClick:()=>n(!0),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uC5F0\uACB0"}):null]}),children:[dn(yr,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:[u?qt(yr,{sx:{mb:d.related.length||d.duplicates.length||d.duplicateOf?1:0},children:d.lineage.map((k,B)=>{let A=k.seq===e.seq,L=B===d.lineage.length-1;return dn(yr,{sx:{display:"flex",gap:1},children:[dn(yr,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:14,flexShrink:0,pt:1.1},children:[qt(yr,{sx:{width:A?9:7,height:A?9:7,borderRadius:"50%",bgcolor:A?"#2f80ed":k.completed?"#9a9a97":"#c9c8c5",flexShrink:0}}),L?null:qt(yr,{sx:{width:"2px",flex:1,bgcolor:"#e6e6e3"}})]}),dn(yr,{sx:{flex:1,minWidth:0,pb:L?0:.5},children:[dn(yr,{sx:{display:"flex",alignItems:"center",gap:.75},children:[dn(yr,{component:"span",onClick:!A&&c?()=>c(k.seq):void 0,sx:{minWidth:0,fontSize:14,fontWeight:A?600:400,color:A?"#2f80ed":k.completed?"#9a9a97":"#37352f",textDecoration:k.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...!A&&c?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[k.ticket_no?`${k.ticket_no} `:"",k.title]}),qt(Rt,{option:ir(k),small:!0})]}),qt(yr,{sx:{fontSize:12,color:"#9a9a97"},children:k.completed&&k.completed_time?`${k.completed_time} \uC644\uB8CC`:k.created_time??""})]})]},k.seq)})}):null,d.duplicateOf?qt(jc,{item:d.duplicateOf,caption:"\uC6D0\uBCF8",onOpen:c?()=>c(d.duplicateOf.seq):void 0,onUnlink:!b&&s?k=>v(k.currentTarget,d.duplicateOf.seq,"duplicate_of"):void 0}):null,d.duplicates.map(k=>qt(jc,{item:k,caption:"\uC911\uBCF5",onOpen:c?()=>c(k.seq):void 0,onUnlink:!b&&s?B=>v(B.currentTarget,k.seq,"duplicate_of"):void 0},`dup-${k.seq}`)),d.related.map(k=>qt(jc,{item:k,onOpen:c?()=>c(k.seq):void 0,onUnlink:!b&&s?B=>v(B.currentTarget,k.seq,"related"):void 0},`rel-${k.seq}`)),g===0?qt(yr,{sx:{px:1.25,py:.75,fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]}),o?qt(Ea,{open:t,task:e,tasks:p,excludeSeqs:m,onClose:()=>n(!1),onSubmit:(k,B)=>o(e.seq,k,B)}):null,qt(Mt,{open:!!l,anchorEl:l,title:"\uC774 \uC5C5\uBB34\uC5D0\uC11C \uC774\uC5B4\uC9C0\uB294 \uD6C4\uC18D \uC5C5\uBB34\uB97C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>i(null),onConfirm:()=>{r?.(e.seq),i(null)}}),qt(Mt,{open:!!a,anchorEl:a?.anchorEl??null,title:"\uC774 \uC5C5\uBB34\uC640\uC758 \uC5F0\uACB0\uC744 \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uD574\uC81C",onCancel:()=>f(null),onConfirm:()=>{a&&s?.(e.seq,a.targetSeq,a.type),f(null)}})]})}import{Fragment as Mr,jsx as xe,jsxs as Lt}from"react/jsx-runtime";function So({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return xe($t,{component:"span",sx:{color:"#9a9a97"},children:e})}function Ih({task:e,customTabs:p,statusOptions:b,avatarSrcByName:c,onChangeStatus:o,onChangeLabels:s,onAddLabelOption:r,onChangeProject:t,onAddProject:n,onChangeDate:l,onChangeReminder:i,onMemberEdit:a,onChangePriority:f,onChangeVisibility:d,onChangeRepeat:u,departments:g=[],onChangeEventTime:m,onChangeEventPlace:v,onChangeEventAddress:k,onChangeNote:B,onChangeNoteDraft:A,onChangeContent:L,contentLoading:O=!1,onChangeContentHeight:D,onAddChecklistItem:j,onToggleChecklistItem:z,onRemoveChecklistItem:N,onUpdateChecklistItem:S,onReorderChecklist:T,onConvertChecklistToTask:E,onOpenChecklistTask:h,onLinkChecklistTask:y,resolveChecklistTask:w,relatedTasksPool:x,onOpenRelatedTask:_,onLinkRelatedTask:C,onUnlinkRelatedTask:P,onCreateFollowUpTask:q,onAddAttachments:$,onRemoveAttachment:W,onPreview:R,onDownload:H,onUpdateComment:M,onRemoveComment:I,onToggleCommentReaction:F,currentUserName:U="",myAccountSeq:Y=0,noticeAdmin:V=!1,hideProject:G=!1,hideLabel:te=!1,showTitle:X=!1,onChangeTitle:K,onToggleCompleted:ee,onChangeIcon:Q,onChangeIconColor:oe,employees:se=[],onAckConfirm:ce,onRequestConfirm:ne,onChangeBugField:ae,sprints:be=[],sprintProject:ve=!1,hideSprint:Le=!1,onChangeSprint:Ie,onChangeStoryPoints:le,onChangeResolution:Pe,onClaimTask:Me,onVerifyBug:ke}){let[Oe,we]=hn(null),[ye,Xe]=hn(null),[Te,fe]=hn(null),[Re,_e]=hn(!1),Se={[ln]:Re?{maxHeight:120,opacity:1,overflow:"hidden",transition:"max-height 0.25s ease, opacity 0.2s ease"}:{minHeight:0,maxHeight:0,opacity:0,overflow:"hidden",pointerEvents:"none",transition:"max-height 0.25s ease, opacity 0.2s ease"}},[ot,je]=hn(null),[Ae,yt]=hn(null),[ze,Fe]=hn(null),[ft,Ve]=hn(null),[De,Pt]=hn(null),[Ue,re]=hn(null),[ue,de]=hn(null),me=!!e.is_notice,He=!!e.is_event,Be=!!e.is_bug,Ne=!!Me&&Ys(e,Y),dt=!!Me&&Xs(e,Y),$e=!!ke&&Be&&!!e.completed&&Y>0&&(e.author_account_seq??0)===Y&&!(e.acks??[]).some(Z=>Z.account_seq===Y),Ee=!zn(e,Y),ut=!e.is_event&&(e.is_notice?Y>0&&(e.author_account_seq??0)===Y:(e.author_account_seq??0)===Y||(e.manager_account_seq??0)===Y),rt=e.is_notice||e.is_event?bt(e.icon||(e.is_notice?Gt:or)):null,et=me?!Gs(e,Y):Ee,mt=Ne||dt?Lt(vn,{onClick:Z=>de(Z.currentTarget),children:[xe(u4,{sx:{fontSize:16,mr:.5}}),"\uAC00\uC838\uAC00\uAE30"]}):null,At=me?La(e,se):"",ht=me?Yd(e,se,Y):null,_t=me?null:la(e,Y),Ft=!!(_t&&_t.total>0||me&&ht),Qt=!me,J=Lt(Mr,{children:[xe(at,{icon:xe(a4,{sx:{fontSize:17}}),label:"\uC791\uC131\uC790",sx:[In(9),Se??null,...He?[]:[Xt(1)]],children:e.created_by?Lt(Mr,{children:[xe(Tr,{names:[e.created_by],size:20,avatarSrcByName:c}),e.created_by]}):xe(So,{})}),xe(at,{icon:xe(kh,{sx:{fontSize:17}}),label:"\uC791\uC131\uC77C\uC2DC",sx:[In(11),Se??null,...He?[]:[Xt(2)]],children:e.created_time?qr(e.created_time):xe(So,{})})]});return Lt(Mr,{children:[X?Lt($t,{sx:{px:2,pt:2,pb:.5,display:"flex",alignItems:"flex-start",gap:1},children:[ut?xe(J3,{checked:e.completed,icon:xe(o4,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:xe(zc,{sx:{fontSize:22,color:"#2f80ed"}}),onChange:(Z,ge)=>{ye||Xe({anchorEl:Z.currentTarget,nextCompleted:ge})},sx:{p:0,mt:.25}}):null,rt?xe($t,{sx:{display:"flex",p:0,mt:.25,color:e.icon_color||(me?"#e5484d":"#1e3a8a")},children:xe(rt,{sx:{fontSize:20}})}):null,xe($t,{sx:{flex:1,minWidth:0},children:Oe!==null?xe($t,{component:"input",autoFocus:!0,spellCheck:!1,value:Oe,onChange:Z=>we(Z.target.value),onBlur:()=>{Oe.trim()&&Oe.trim()!==e.title&&K(e.seq,Oe.trim()),we(null)},onKeyDown:Z=>{Z.key==="Enter"&&Z.target.blur(),Z.key==="Escape"&&we(null)},sx:{width:"100%",border:"none",outline:"none",font:"inherit",fontSize:19,fontWeight:600,color:"#37352f",p:0,m:0}}):xe($t,{onClick:()=>we(e.title),sx:{fontSize:19,fontWeight:600,color:"#37352f",lineHeight:1.35,cursor:"text",textDecoration:e.completed?"line-through":"none",userSelect:"text"},children:e.title})}),xe(Mt,{open:!!ye,anchorEl:ye?.anchorEl??null,title:ye?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:ye?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>Xe(null),onConfirm:()=>{ye&&ee(e.seq,ye.nextCompleted),Xe(null)}})]}):null,Lt($t,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:0,[ln]:{pb:0,"& > :last-child":{mb:0}}},children:[xe(Ba,{hideProject:G,pinColumns:!0,values:{tabKey:e.tab_key??"",managerName:e.manager_name,receiverNames:e.receiver_names,startDate:e.start_date,dueDate:e.due_date,reminder:e.reminder,priority:e.priority,eventTime:e.event_time??"",eventPlace:e.event_place??"",eventAddress:e.event_address??""},customTabs:p,avatarSrcByName:c,hideDueDate:!He&&!!e.repeat_rule,hideReminder:!!e.repeat_rule,notice:me,event:He,readOnly:Ee,targetSummary:At,onChangeProject:Z=>t(e.seq,Z),onAddProject:n,onChangeStartDate:Z=>l(e.seq,"start_date",Z),onChangeDueDate:Z=>l(e.seq,"due_date",Z),onChangeReminder:Z=>i(e.seq,Z),onChangePriority:Z=>f(e.seq,Z),onChangeEventTime:Z=>m?.(e.seq,Z),onChangeEventPlace:Z=>v?.(e.seq,Z),onChangeEventAddress:Z=>k?.(e.seq,Z),onMemberEdit:Z=>a(e,Z,null),narrowCollapsedSx:Se,reminderLocked:e.completed,managerAction:mt,leading:Lt(Mr,{children:[$e||mt&&(me||He)?Lt($t,{sx:{gridColumn:"1 / -1",display:"flex",justifyContent:"flex-start",gap:2,px:2,py:1.5},children:[me||He?mt:null,$e?Lt(Mr,{children:[xe(Ii,{variant:"contained",size:"large",onClick:()=>ke?.(e.seq,!0),sx:{bgcolor:"#2f80ed"},children:"\uAC80\uC99D\uC644\uB8CC"}),xe(Ii,{variant:"outlined",size:"large",color:"error",onClick:()=>ke?.(e.seq,!1),children:"\uC7AC\uC624\uD508"})]}):null]}):null,Be&&e.ticket_no?xe(at,{icon:xe(t4,{sx:{fontSize:17}}),label:"\uD2F0\uCF13",sx:Xt(1),children:xe($t,{component:"span",sx:{fontVariantNumeric:"tabular-nums"},children:e.ticket_no})}):null,He?null:xe($t,{sx:Be&&e.ticket_no||Qt||Ft?Xt(Be&&e.ticket_no?2:1):{gridColumn:"1 / -1"},children:xe(at,{icon:xe(i4,{sx:{fontSize:17}}),label:"\uC0C1\uD0DC",onClick:Ee||e.completed?void 0:Z=>je(Z),children:xe(Rt,{option:ir(e)})})}),me?null:(()=>{let Z=nn(e),ge=Z==="all"?xe(Th,{sx:{fontSize:17,color:"#2f80ed"}}):Z==="group"?xe(Ch,{sx:{fontSize:17,color:"#d9730d"}}):xe(Sh,{sx:{fontSize:17}}),he=Z==="all"?"\uC804\uCCB4\uACF5\uAC1C":Z==="group"?`\uBD80\uC11C\uACF5\uAC1C \xB7 ${g.find(ie=>ie.seq===(e.visibility_group_seq??0))?.name??"\uBD80\uC11C"}`:"\uBE44\uACF5\uAC1C";return xe($t,{sx:He?void 0:Xt(Be?1:2),children:xe(at,{icon:ge,label:"\uACF5\uAC1C",onClick:Ee||!d?void 0:ie=>yt(ie),children:he})})})(),!me&&!Be?xe($t,{sx:He?void 0:Xt(1),children:xe(at,{icon:xe(f4,{sx:{fontSize:17,...e.repeat_rule?{color:"#2f80ed"}:{}}}),label:"\uBC18\uBCF5",onClick:Ee||!u?void 0:Z=>Fe(Z),children:e.repeat_rule?_a(e.repeat_rule):xe(So,{label:"\uC5C6\uC74C"})})}):null,!me&&!Be&&e.repeat_rule?xe($t,{sx:He?void 0:Xt(2),children:xe(at,{icon:xe(d4,{sx:{fontSize:17}}),label:"\uBC18\uBCF5 \uC885\uB8CC",onClick:Ee||!u?void 0:Z=>Ve(Z),children:e.repeat_until?`${e.repeat_until}\uAE4C\uC9C0`:xe(So,{})})}):null,_t&&_t.total>0?xe($t,{sx:He?void 0:Xt(2),children:xe(at,{icon:xe(qc,{sx:{fontSize:17}}),label:"\uD655\uC778",children:_t.canConfirm?xe(Ii,{size:"small",variant:"contained",onClick:()=>ce?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):Lt(Ii,{size:"small",variant:"outlined",color:"inherit",startIcon:_t.myTime?xe(zc,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:Z=>fe({anchorEl:Z.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:[_t.count," / ",_t.total]})})}):null,me&&ht?xe($t,{sx:Xt(2),children:xe(at,{icon:xe(qc,{sx:{fontSize:17}}),label:"\uD655\uC778",children:xe($t,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,minWidth:0},children:ht.canAck?xe(Ii,{size:"small",variant:"contained",onClick:()=>ce?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):xe(Ii,{size:"small",variant:"outlined",color:"inherit",startIcon:ht.acked?xe(zc,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:Z=>fe({anchorEl:Z.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:ht.total>0&&ht.count>=ht.total?"\uC644\uB8CC":Lt(Mr,{children:[ht.count,xe($t,{component:"span",sx:{mx:.4},children:"/"}),ht.total]})})})})}):null,ve&&!Le&&!He&&!me?Lt(Mr,{children:[xe(at,{icon:xe(r4,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:Ee?void 0:Z=>Pt(Z),sx:Xt(1),children:(e.sprint_seq??0)>0?be.find(Z=>Z.seq===e.sprint_seq)?.name??"\uC0AD\uC81C\uB41C \uC2A4\uD504\uB9B0\uD2B8":xe(So,{label:"\uBBF8\uBC30\uC815"})}),xe(at,{icon:xe(n4,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",sx:Xt(2),children:xe(to,{value:(e.story_points??0)>0?String(e.story_points):"",placeholder:"\uBBF8\uCD94\uC815",readOnly:Ee,onCommit:Z=>le?.(e.seq,Number(Z.replace(/[^0-9.]/g,""))||0)})})]}):null,He||te?null:xe($t,{sx:[{gridColumn:"1 / -1"},Se??null],children:xe(at,{icon:xe(s4,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:Ee?void 0:Z=>re(Z),children:(e.label_keys??[]).length>0?xe(mo,{labelKeys:e.label_keys??[],labelOptions:b}):xe(So,{})})}),He?null:J]}),trailing:Lt(Mr,{children:[Be?xe(Ia,{values:{repro:e.bug_repro??"",device:e.bug_device??"",where:e.bug_where??"",version:e.bug_version??"",resolution:e.resolution??""},readOnly:Ee,showResolution:!!e.completed,onChangeRepro:Z=>ae?.(e.seq,"bug_repro",Z),onChangeDevice:Z=>ae?.(e.seq,"bug_device",Z),onChangeWhere:Z=>ae?.(e.seq,"bug_where",Z),onChangeVersion:Z=>ae?.(e.seq,"bug_version",Z),onChangeResolution:Z=>Pe?.(e.seq,Z)}):null,He?J:null,e.completed?Lt(Mr,{children:[xe(at,{icon:xe(qc,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC790",sx:[In(10),Se??null,...He?[]:[Xt(1)]],children:e.completed_by?Lt(Mr,{children:[xe(Tr,{names:[e.completed_by],size:20,avatarSrcByName:c}),e.completed_by]}):xe(So,{})}),xe(at,{icon:xe(kh,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC77C\uC2DC",sx:[In(12),Se??null,...He?[]:[Xt(2)]],children:e.completed_time?qr(e.completed_time):xe(So,{})})]}):null]})}),Lt($t,{sx:{display:"none",[ln]:{display:"block",mt:1.5,mb:0}},children:[xe(Go,{sx:{borderColor:"#e6e6e3"}}),xe(Z3,{onClick:()=>_e(Z=>!Z),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:.5,pt:1.25,pb:1.25,fontSize:13.5,bgcolor:"#f4f4f2",color:"#37352f","&:active":{opacity:.6}},children:Re?Lt(Mr,{children:["\uC811\uAE30 ",xe(Q3,{sx:{fontSize:18}})]}):Lt(Mr,{children:["\uC815\uBCF4 \uB354\uBCF4\uAE30 ",xe(e4,{sx:{fontSize:18}})]})})]}),Lt($t,{children:[xe(Go,{sx:{my:1.5,borderColor:"#e6e6e3",[ln]:{mt:0,mb:1.25}}}),xe(en,{icon:xe(l4,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:xe($t,{sx:{userSelect:"text"},children:O?xe($t,{sx:{minHeight:e.content_height||180,display:"flex",alignItems:"center",justifyContent:"center"},children:xe(gh,{})}):xe(Ma,{syncKey:e.seq,value:e.content??"",height:e.content_height??0,onChangeHeight:D?Z=>D(e.seq,Z):void 0,readOnly:Ee,onChange:Z=>L(e.seq,Z)})})}),e.is_bug?null:Lt(Mr,{children:[xe(Go,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(en,{icon:xe(c4,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:xe($t,{sx:{userSelect:"text"},children:xe(bh,{value:e.note,readOnly:et,onCommit:Z=>B(e.seq,Z),onDraftChange:A?Z=>A(e.seq,Z):void 0})})})]}),He?null:Lt(Mr,{children:[xe(Go,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(Ra,{taskSeq:e.seq,checklist:e.checklist??[],removeLocked:et,onAdd:j,onToggle:z,onRemove:N,onUpdate:S,onReorder:T,onConvertToTask:E,onOpenLinkedTask:h,resolveLinkedTask:w,myAccountSeq:Y,linkCandidates:x,linkBaseTask:e,onLinkExistingTask:y})]}),x&&!He&&!me&&xh(e,x)?Lt(Mr,{children:[xe(Go,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(wh,{task:e,tasks:x,readOnly:Ee,onOpenTask:_,onLink:C,onUnlink:P,onCreateFollowUp:q})]}):null,xe(Go,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(Pa,{taskSeq:e.seq,attachments:e.attachments??[],removeLocked:et,onAdd:$,onRemove:W,onPreview:R?Z=>R({...Z,taskSeq:e.seq}):void 0,onDownload:H?Z=>H({...Z,taskSeq:e.seq}):void 0})]}),xe(Go,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(ch,{taskSeq:e.seq,comments:e.comments??[],currentUserName:U,myAccountSeq:Y,avatarSrcByName:c,onUpdate:M,onRemove:I,onToggleReaction:F,onPreview:R?Z=>R({...Z,taskSeq:e.seq}):void 0,onDownload:H?Z=>H({...Z,taskSeq:e.seq}):void 0})]}),xe(li,{anchorEl:ot,value:e.status,options:me?Ki:Be?Ao:Gi,onSelect:Z=>o(e.seq,Z),onClose:()=>je(null)}),xe(Lc,{transitionDuration:0,anchorEl:ze,open:!!ze,onClose:()=>Fe(null),children:[{value:"",label:"\uC5C6\uC74C"},...ss].map(Z=>xe(Fc,{selected:(e.repeat_rule??"")===Z.value,onClick:()=>{Fe(null),(async()=>{let ge=e.repeat_rule??"";if(Z.value===ge)return;if(Z.value===""){await Bh({title:"\uBC18\uBCF5 \uD574\uC81C",message:"\uC774\uD6C4 \uBC18\uBCF5 \uD68C\uCC28\uB97C \uBAA8\uB450 \uC0AD\uC81C\uD558\uACE0 \uBC18\uBCF5\uC744 \uD574\uC81C\uD560\uAE4C\uC694? (\uC9C0\uB09C \uD68C\uCC28\uB294 \uB0A8\uC2B5\uB2C8\uB2E4)"})&&u?.(e.seq,"","");return}let he=String(e.due_date??"").slice(0,10);if(!he){h4(e.is_event?"\uBC18\uBCF5\uD558\uB824\uBA74 \uC77C\uC815 \uB0A0\uC9DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.":"\uBC18\uBCF5\uD558\uB824\uBA74 \uB9C8\uAC10\uC77C\uC2DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.");return}ge&&!await Bh({title:"\uBC18\uBCF5 \uBCC0\uACBD",message:"\uC774\uD6C4 \uD68C\uCC28\uB97C \uC0C8 \uADDC\uCE59\uC73C\uB85C \uB2E4\uC2DC \uC0DD\uC131\uD560\uAE4C\uC694? \uC774\uD6C4 \uD68C\uCC28\uC758 \uB313\uAE00\xB7\uCCA8\uBD80\uB294 \uC0AC\uB77C\uC9D1\uB2C8\uB2E4."})||u?.(e.seq,Z.value,ka(he,Z.value))})()},sx:{fontSize:14,minWidth:140},children:Z.label},Z.value||"none"))}),xe(p4,{anchorEl:ft,open:!!ft,onClose:()=>Ve(null),selectedDate:e.repeat_until?new Date(`${e.repeat_until}T00:00:00`):new Date,onDateChange:Z=>{Ve(null);let ge=pe=>String(pe).padStart(2,"0"),he=`${Z.getFullYear()}-${ge(Z.getMonth()+1)}-${ge(Z.getDate())}`,ie=e.repeat_rule??"";ie&&u?.(e.seq,ie,he)}}),xe(Lc,{transitionDuration:0,anchorEl:Ae,open:!!Ae,onClose:()=>yt(null),children:[{key:"involved",label:"\uBE44\uACF5\uAC1C",icon:xe(Sh,{sx:{fontSize:17,color:"#57564f"}}),selected:nn(e)==="involved",onPick:()=>d?.(e.seq,"involved",0)},{key:"all",label:"\uC804\uCCB4\uACF5\uAC1C",icon:xe(Th,{sx:{fontSize:17,color:"#2f80ed"}}),selected:nn(e)==="all",onPick:()=>d?.(e.seq,"all",0)},...g.map(Z=>({key:`group-${Z.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${Z.name}`,icon:xe(Ch,{sx:{fontSize:17,color:"#d9730d"}}),selected:nn(e)==="group"&&(e.visibility_group_seq??0)===Z.seq,onPick:()=>d?.(e.seq,"group",Z.seq)}))].map(Z=>Lt(Fc,{selected:Z.selected,onClick:()=>{Z.onPick(),yt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[Z.icon,Z.label,Z.selected?xe(_h,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},Z.key))}),xe(Lc,{transitionDuration:0,anchorEl:De,open:!!De,onClose:()=>Pt(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...be.filter(Z=>`custom-${Z.group_seq}`===String(e.tab_key??"")).map(Z=>({seq:Z.seq,label:Jr(Z)}))].map(Z=>Lt(Fc,{onClick:()=>{Ie?.(e.seq,Z.seq),Pt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[Z.label,(e.sprint_seq??0)===Z.seq?xe(_h,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},Z.seq))}),xe(aa,{anchorEl:Te?.anchorEl??null,open:!!Te?.open,acks:e.acks??[],total:ht?.total??_t?.total??0,pendingNames:ht?.pendingNames??_t?.pendingNames??[],avatarSrcByName:c,onRequestConfirm:ne&&(ht?ht.count<ht.total:_t&&_t.count<_t.total)?()=>{ne(e.seq),fe(Z=>Z?{...Z,open:!1}:null)}:void 0,onClose:()=>fe(Z=>Z?{...Z,open:!1}:null)}),xe(ja,{anchorEl:Ue,selectedKeys:e.label_keys??[],labelOptions:b,onToggle:Z=>s(e.seq,Vs(e.label_keys??[],Z)),onAddLabel:r,onClose:()=>re(null)}),xe(Mt,{open:!!ue,anchorEl:ue,title:Ne?"\uC774 \uC5C5\uBB34\uB97C \uAC00\uC838\uC640 \uCC45\uC784\uC790\uB97C \uB9E1\uC73C\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC774 \uC5C5\uBB34\uC758 \uCC45\uC784\uC790\uB97C \uB9E1\uC73C\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uAC00\uC838\uAC00\uAE30",onCancel:()=>de(null),onConfirm:()=>{Me?.(e.seq),de(null)}})]})}import{Fragment as w4,jsx as Er,jsxs as Dh}from"react/jsx-runtime";function ZN(){let e=new Date,p=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())} ${p(e.getHours())}:${p(e.getMinutes())}`}function JN({open:e,task:p,onClose:b,onAddComment:c,onSaveFields:o,presentation:s="auto",myAccountSeq:r=0,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:l,onChangeIconColor:i,activityItems:a,activityLoading:f,onLoadActivity:d,onPrint:u,...g}){let m=It(),v=Eh(null);p&&(v.current=p);let k=p??v.current,[B,A]=Rh(!1),[L,O]=Rh({}),D=Object.keys(L).length>0;Mh(()=>{O({})},[p?.seq,e]);let j=Eh(null);if(Mh(()=>{j.current?.scrollTo({top:0})},[p?.seq]),!k)return null;let z=m&&D?{...k,...L}:k,N=z.checklist??[],S=(x,_)=>{m?O(C=>({...C,...x})):_()},T=()=>{let x=L;O({});let _=k.seq,C=x.title===void 0?void 0:String(x.title).trim();if(o){let P={...x};C!==void 0&&(C?P.title=C:delete P.title),Object.keys(P).length>0&&o(_,P),Ah({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"});return}C&&n(_,C),x.icon!==void 0&&l(_,String(x.icon)),x.icon_color!==void 0&&i?.(_,String(x.icon_color)),x.status!==void 0&&g.onChangeStatus(_,x.status),x.label_keys!==void 0&&g.onChangeLabels(_,x.label_keys??[]),x.tab_key!==void 0&&g.onChangeProject(_,String(x.tab_key??"")),x.start_date!==void 0&&g.onChangeDate(_,"start_date",String(x.start_date??"")),x.due_date!==void 0&&g.onChangeDate(_,"due_date",String(x.due_date??"")),x.reminder!==void 0&&g.onChangeReminder(_,x.reminder),x.priority!==void 0&&g.onChangePriority(_,x.priority),x.event_time!==void 0&&g.onChangeEventTime?.(_,String(x.event_time??"")),x.event_place!==void 0&&g.onChangeEventPlace?.(_,String(x.event_place??"")),x.event_address!==void 0&&g.onChangeEventAddress?.(_,String(x.event_address??"")),x.content!==void 0&&g.onChangeContent(_,String(x.content??"")),x.note!==void 0&&g.onChangeNote(_,String(x.note??"")),x.visibility!==void 0&&g.onChangeVisibility?.(_,x.visibility,Number(x.visibility_group_seq??0)),Ah({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"})},E={...g,onChangeStatus:(x,_)=>S({status:_},()=>g.onChangeStatus(x,_)),onChangeLabels:(x,_)=>S({label_keys:_},()=>g.onChangeLabels(x,_)),onChangeProject:(x,_)=>S({tab_key:_},()=>g.onChangeProject(x,_)),onChangeDate:(x,_,C)=>S({[_]:C},()=>g.onChangeDate(x,_,C)),onChangeReminder:(x,_)=>S({reminder:_},()=>g.onChangeReminder(x,_)),onChangePriority:(x,_)=>S({priority:_},()=>g.onChangePriority(x,_)),onChangeEventTime:(x,_)=>S({event_time:_},()=>g.onChangeEventTime?.(x,_)),onChangeEventPlace:(x,_)=>S({event_place:_},()=>g.onChangeEventPlace?.(x,_)),onChangeEventAddress:(x,_)=>S({event_address:_},()=>g.onChangeEventAddress?.(x,_)),onChangeContent:(x,_)=>S({content:_},()=>g.onChangeContent(x,_)),onChangeNote:(x,_)=>S({note:_},()=>g.onChangeNote(x,_)),onMemberEdit:(x,_)=>g.onMemberEdit(x,_,m?C=>O(P=>({...P,...C})):null),onChangeNoteDraft:m?(x,_)=>S({note:_},()=>{}):void 0,onChangeVisibility:g.onChangeVisibility?(x,_,C)=>S({visibility:_,visibility_group_seq:C},()=>g.onChangeVisibility?.(x,_,C)):void 0,onAddChecklistItem:(x,_)=>S({checklist:[...N,{label:_,checked:!1}]},()=>g.onAddChecklistItem(x,_)),onToggleChecklistItem:(x,_,C)=>S({checklist:N.map((P,q)=>q===_?{...P,checked:C}:P)},()=>g.onToggleChecklistItem(x,_,C)),onRemoveChecklistItem:(x,_)=>S({checklist:N.filter((C,P)=>P!==_)},()=>g.onRemoveChecklistItem(x,_)),onUpdateChecklistItem:g.onUpdateChecklistItem?(x,_,C)=>S({checklist:N.map((P,q)=>q===_?{...P,label:C}:P)},()=>g.onUpdateChecklistItem?.(x,_,C)):void 0,onReorderChecklist:g.onReorderChecklist?(x,_)=>S({checklist:_},()=>g.onReorderChecklist?.(x,_)):void 0,onLinkChecklistTask:g.onLinkChecklistTask?(x,_,C)=>S({checklist:[...N,{label:C,checked:!1,task_seq:_}]},()=>g.onLinkChecklistTask?.(x,_,C)):void 0},h=Er(Ih,{...E,task:z,myAccountSeq:r,onChangeTitle:(x,_)=>S({title:_},()=>n(x,_)),onToggleCompleted:t,onChangeIcon:(x,_)=>S({icon:_},()=>l(x,_)),onChangeIconColor:(x,_)=>S({icon_color:_},()=>i?.(x,_)),showTitle:m}),y=Er(uh,{onSubmit:(x,_)=>c(z.seq,x,_)},z.seq);return m||s==="dialog"?Dh(w4,{children:[Er(v4,{open:e,onClose:b,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:z.is_notice?"\uACF5\uC9C0\uC0AC\uD56D":z.is_event?"\uC77C\uC815":z.is_bug?"\uC624\uB958":"\uC5C5\uBB34",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[...d?[{icon:Er(y4,{sx:{ml:2,color:"#6b7280"}}),tooltip:"\uD65C\uB3D9",onClick:()=>A(!0)}]:[],{icon:Er(b4,{sx:{ml:d?0:2,color:"#6b7280"}}),tooltip:"\uACF5\uC720\uD558\uAE30",onClick:()=>Ci(z,!0)},{icon:Er(m4,{variant:"contained",size:"small",disableElevation:!0,disabled:!D,onClick:D?T:void 0,sx:{ml:1,minWidth:0,px:1.5,py:.35,fontSize:14,fontWeight:600,bgcolor:"#2f80ed","&:hover":{bgcolor:"#2f80ed"},"&.Mui-disabled":{bgcolor:"#e6e6e3",color:"#9a9a97"}},children:"\uC800\uC7A5"}),tooltip:""}]},fullScreen:m,maxWidth:m?void 0:"md",width:m?void 0:720,mobilePresentation:m?"slide":void 0,tabs:{visible:!1},contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,contentBottomPadding:0,scrollPastLastSection:!1,overlayScrollbar:{enabled:!0,contentStyle:{minWidth:0}},actions:{visible:!0,showCancelButton:!1,left:y},sx:{DialogContent:{borderBottom:"none"}},dialogActionSx:{padding:"0 !important","@media (max-width:1023.95px)":{padding:"0 !important"},borderTop:"1px solid #37352f","& .left-actions":{flex:1,width:"100%",minWidth:0,"& > *":{flex:1,minWidth:0}},"& .right-actions":{display:"none"}},sections:[{id:"task-detail",title:"",showTitle:!1,children:Er(Va,{sx:{userSelect:"none",width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:h})}]},k.seq),Er(Wa,{open:B,taskSeq:z.seq,items:a,loading:f,onLoad:d,onClose:()=>A(!1)})]}):Er(g4,{anchor:"right",open:e,onClose:b,disableAutoFocus:!0,disableEnforceFocus:!0,sx:{zIndex:x=>x.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:Dh(Va,{sx:{display:"flex",flexDirection:"column",height:"100%",userSelect:"none"},children:[Er(mh,{task:z,myAccountSeq:r,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:l,onChangeIconColor:i,onClose:b,activityItems:a,activityLoading:f,onLoadActivity:d,onPrint:u}),Er(Oh,{sx:{borderColor:"#e6e6e3"}}),Er(Va,{sx:{flex:1,minHeight:0},children:Er(x4,{ref:j,style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:h})}),Er(Oh,{sx:{borderColor:"#37352f"}}),Er(Va,{sx:{flexShrink:0},children:y})]})})}import{useEffect as k4,useState as Yo}from"react";import{Box as Pr,Button as Hc,IconButton as Ph}from"@mui/material";import{FormDialog as S4}from"@ehfuse/mui-form-dialog";import T4 from"@mui/icons-material/EditOutlined";import{ErrorAlert as Nh}from"@ehfuse/alerts";import{ClearTextField as jh,DateTextField as Lh,LabelSelect as Fh}from"@ehfuse/mui-form-controls";var $c="custom-";function _4(e){return e.startsWith($c)}function tj(e){return e>0?`${$c}${e}`:""}function Mi(e){if(!_4(e))return 0;let p=Number(e.slice($c.length));return Number.isInteger(p)&&p>0?p:0}import{Fragment as B4,jsx as Zt,jsxs as To}from"react/jsx-runtime";var C4=[{value:"planning",label:"\uACC4\uD68D\uC911"},{value:"active",label:"\uC9C4\uD589\uC911"},{value:"closed",label:"\uC885\uB8CC"}];function zh(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):"-"}function fj({open:e,customTabs:p,sprints:b,onClose:c,onCreate:o,onUpdate:s,onChangeStatus:r,onRemove:t}){let n=p.filter(T=>T.useSprints&&!T.archived),[l,i]=Yo(""),[a,f]=Yo(""),[d,u]=Yo(""),[g,m]=Yo(""),[v,k]=Yo(""),[B,A]=Yo(!1),[L,O]=Yo(0);k4(()=>{e&&(i(n.length===1?n[0].key:""),f(""),u(""),m(""),k(""),O(0))},[e]);let D=()=>{f(""),u(""),m(""),k(""),O(0)},j=T=>{O(T.seq),i(`custom-${T.group_seq}`),f(T.name),u(T.goal),m(T.start_date),k(T.end_date)},z=async()=>{let T=Mi(l);if(!T){Nh("\uBAA9\uD45C\uB97C \uB9CC\uB4E4 \uD504\uB85C\uC81D\uD2B8\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}if(!a.trim()){Nh("\uBAA9\uD45C \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}A(!0);try{if(L>0){s(L,{name:a.trim(),goal:d.trim(),start_date:g,end_date:v}),D();return}await o({group_seq:T,name:a.trim(),goal:d.trim(),start_date:g,end_date:v})&&D()}finally{A(!1)}},N=new Map(p.map(T=>[Mi(T.key),T.label])),S=Zt(Pr,{children:n.length===0?Zt(Pr,{sx:{py:2,fontSize:14,color:"#787774"},children:'\uBAA9\uD45C\uB97C \uC0AC\uC6A9\uD558\uB294 \uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uD504\uB85C\uC81D\uD2B8 \uC218\uC815\uC5D0\uC11C "\uBAA9\uD45C(\uC2A4\uD504\uB9B0\uD2B8) \uC0AC\uC6A9"\uC744 \uBA3C\uC800 \uCF1C\uC138\uC694.'}):To(B4,{children:[To(Pr,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2.5,mt:1},children:[Zt(Fh,{label:"\uD504\uB85C\uC81D\uD2B8",size:"medium",value:l,options:n.map(T=>({value:T.key,label:T.label})),onChange:T=>i(String(T.target.value)),disabled:L>0}),Zt(jh,{label:"\uBAA9\uD45C \uC774\uB984",size:"medium",placeholder:"\uC608: 8\uC6D4 2\uC8FC\uCC28",value:a,onChange:T=>f(T.target.value)}),Zt(Lh,{size:"medium",label:"\uC2DC\uC791\uC77C",value:g,onChange:T=>m(T.target.value)}),Zt(Lh,{size:"medium",label:"\uC885\uB8CC\uC77C",value:v,onChange:T=>k(T.target.value)}),Zt(jh,{label:"\uC124\uBA85",size:"medium",placeholder:"\uC120\uD0DD \uC785\uB825",value:d,onChange:T=>u(T.target.value),sx:{gridColumn:"1 / -1"}})]}),To(Pr,{sx:{mt:1.5,display:"flex",justifyContent:"flex-end",gap:1},children:[L>0?Zt(Hc,{color:"inherit",onClick:D,disabled:B,children:"\uCDE8\uC18C"}):null,Zt(Hc,{variant:"contained",onClick:()=>{z()},disabled:B,children:L>0?"\uBAA9\uD45C \uC800\uC7A5":"\uBAA9\uD45C \uB9CC\uB4E4\uAE30"})]}),Zt(Pr,{sx:{mt:2,borderTop:"1px solid #e6e6e3"},children:b.length===0?Zt(Pr,{sx:{py:3,textAlign:"center",fontSize:14,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):b.map(T=>To(Pr,{sx:{display:"flex",flexDirection:"column",gap:1,py:1.75,borderBottom:"1px solid #f0efed"},children:[To(Pr,{sx:{minWidth:0},children:[To(Pr,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[Zt(Pr,{component:"span",sx:{fontSize:16,fontWeight:600,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:T.name}),Zt(Pr,{component:"span",sx:{flexShrink:0,px:1,py:.25,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:13,fontWeight:500},children:N.get(T.group_seq)??"\uC0AD\uC81C\uB41C \uD504\uB85C\uC81D\uD2B8"}),To(Pr,{component:"span",sx:{flexShrink:0,fontSize:14,color:"#57564f"},children:[zh(T.start_date)," ~ ",zh(T.end_date)]})]}),T.goal?Zt(Pr,{sx:{mt:.5,fontSize:14,color:"#787774",lineHeight:1.5},children:T.goal}):null]}),To(Pr,{sx:{display:"flex",alignItems:"center",gap:.5},children:[Zt(Fh,{label:"\uC0C1\uD0DC",showLabel:!1,size:"small",value:T.status,options:C4.map(E=>({value:E.value,label:E.label})),onChange:E=>r(T.seq,String(E.target.value)),sx:{width:104,flexShrink:0}}),Zt(Ph,{"aria-label":"\uBAA9\uD45C \uC218\uC815",onClick:()=>j(T),sx:{color:"#9a9a97","&:hover":{color:"#2563eb"}},children:Zt(T4,{sx:{fontSize:18}})}),Zt(Ph,{"aria-label":"\uBAA9\uD45C \uC0AD\uC81C",onClick:()=>t(T.seq),sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:Zt(Zr,{style:{width:16,height:16}})})]})]},T.seq))})]})});return Zt(S4,{open:e,onClose:c,maxWidth:"sm",title:"\uBAA9\uD45C \uAD00\uB9AC",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-manage",sections:[{id:"sprint-manage",showTitle:!1,children:S}],actions:{showCancelButton:!1,right:Zt(Hc,{variant:"contained",onClick:c,children:"\uB2EB\uAE30"})}})}import{useState as qh}from"react";import{Box as cr,Button as Wc,Divider as I4,IconButton as M4,TextField as E4}from"@mui/material";import{FormDialog as R4}from"@ehfuse/mui-form-dialog";import O4 from"@mui/icons-material/OpenInNewOutlined";import A4 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as D4}from"@ehfuse/alerts";import{jsx as Ot,jsxs as Xo}from"react/jsx-runtime";function wj({open:e,imports:p,onRegister:b,onRemove:c,onClose:o}){let[s,r]=qh(""),[t,n]=qh(!1),l=async()=>{let f=s.trim();if(f){n(!0);try{await b(f)&&r("")}finally{n(!1)}}},i=async f=>{await D4({title:"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",message:`"${f.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}" \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&c(f.seq)},a=Xo(cr,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[Xo(cr,{sx:{color:"#37352f",lineHeight:1.7},children:["\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC758 \uC77C\uC815\uC744 ",Ot("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uD568\uAED8 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.",Ot("br",{}),"\uD45C\uC2DC/\uC228\uAE40\uC740 \uC5C5\uBB34\uD568 \uC6B0\uC0C1\uB2E8\uC758 ",Ot("b",{children:"\uAD6C\uAE00 \uC77C\uC815"})," \uC2A4\uC704\uCE58\uB85C \uCF1C\uACE0 \uB055\uB2C8\uB2E4."]}),Ot(cr,{sx:{fontWeight:700,color:"#37352f",mt:.5},children:"\uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354"}),p.length>0?Ot(cr,{sx:{display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1},children:p.map((f,d)=>Xo(cr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:.75,borderTop:d>0?"1px solid #efefed":"none"},children:[Ot(A4,{sx:{fontSize:18,color:"#0f9d58",flexShrink:0}}),Ot(cr,{component:"span",sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),Ot(M4,{"aria-label":"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",size:"small",onClick:()=>{i(f)},sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:Ot(Zr,{sx:{fontSize:18}})})]},f.seq))}):Ot(cr,{sx:{color:"#9a9a97",px:.5},children:"\uC544\uC9C1 \uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}),Ot(I4,{sx:{my:1,borderColor:"#e6e6e3"}}),Ot(cr,{sx:{fontWeight:700,color:"#37352f"},children:"\uC0C8 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30"}),Xo(cr,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,mb:1,fontSize:15,lineHeight:1.8,display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[Ot(cr,{children:Xo(cr,{component:"span",children:["\uAD6C\uAE00 \uCE98\uB9B0\uB354(\uC6F9) > \uC67C\uCABD \uBAA9\uB85D\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354\uC5D0 \uB9C8\uC6B0\uC2A4\uB97C \uC62C\uB824 \u22EE > ",Ot("b",{children:"\uC124\uC815 \uBC0F \uACF5\uC720"}),"\uB97C \uC5FD\uB2C8\uB2E4."]})}),Ot(cr,{children:Xo(cr,{component:"span",children:[Ot("b",{children:"\uCE98\uB9B0\uB354 \uD1B5\uD569"})," \uC139\uC158\uC758 ",Ot("b",{children:'"iCal \uD615\uC2DD\uC758 \uBE44\uBC00 \uC8FC\uC18C"'})," \uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),Ot(cr,{children:Ot(cr,{component:"span",children:"\uBE44\uBC00 \uC8FC\uC18C\uB294 \uBCF8\uC778 \uC804\uC6A9\uC785\uB2C8\uB2E4. \uC11C\uBC84\uC5D0 \uC800\uC7A5\uB418\uBA70 \uB2E4\uB978 \uC9C1\uC6D0\uC5D0\uAC8C \uBCF4\uC774\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})}),Ot(cr,{children:Ot(cr,{component:"span",children:"\uC77C\uC815\uC740 \uC57D 10\uBD84 \uAC04\uACA9\uC73C\uB85C \uAC31\uC2E0\uB418\uACE0, \uBC18\uBCF5 \uC77C\uC815\uC740 \uC77C\uBC18\uC801\uC778 \uADDC\uCE59(\uB9E4\uC77C/\uB9E4\uC8FC/\uB9E4\uC6D4/\uB9E4\uB144)\uB9CC \uC9C0\uC6D0\uD569\uB2C8\uB2E4."})})]}),Xo(cr,{sx:{display:"flex",gap:2,alignItems:"center"},children:[Ot(E4,{value:s,onChange:f=>r(f.target.value),fullWidth:!0,label:"\uBE44\uBC00 iCal \uC8FC\uC18C",placeholder:"https://calendar.google.com/calendar/ical/\u2026/basic.ics",slotProps:{input:{spellCheck:!1}}}),Ot(Wc,{variant:"contained",disabled:!s.trim()||t,onClick:()=>{l()},sx:{flexShrink:0},children:t?"\uD655\uC778 \uC911\u2026":"\uB4F1\uB85D"})]})]});return Ot(R4,{open:e,onClose:o,width:680,title:"\uAD6C\uAE00 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-import",sections:[{id:"calendar-import",showTitle:!1,children:a}],actions:{showCancelButton:!1,left:Ot(Wc,{variant:"outlined",startIcon:Ot(O4,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:Ot(Wc,{variant:"contained",onClick:o,children:"\uB2EB\uAE30"})}})}import{Box as io,Button as ps,TextField as P4}from"@mui/material";import{FormDialog as N4}from"@ehfuse/mui-form-dialog";import j4 from"@mui/icons-material/ContentCopyOutlined";import $h from"@mui/icons-material/OpenInNewOutlined";import{InfoAlert as Hh}from"@ehfuse/alerts";import{Fragment as F4,jsx as Jt,jsxs as Zo}from"react/jsx-runtime";function L4(e){return`${window.location.origin}/api/v1/taskbox/calendar/${e}.ics`}function Mj({open:e,feed:p,feedTaskCount:b,buildFeedUrl:c,onSubscribe:o,onClose:s}){let r=c??L4,t=p.subscribed?r(p.token):"",n=()=>{navigator.clipboard.writeText(t).then(()=>Hh("\uD53C\uB4DC \uC8FC\uC18C\uB97C \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>Hh("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD558\uC138\uC694."))},l=()=>{let a=t.replace(/^https?:\/\//,"webcal://");window.open(`https://calendar.google.com/calendar/r?cid=${encodeURIComponent(a)}`,"_blank")},i=Zo(io,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[Zo(io,{sx:{color:"#37352f",lineHeight:1.7},children:["\uB0B4\uAC00 \uAD00\uC5EC\uD55C \uC5C5\uBB34\uB97C ",Jt("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4."]}),b===0?Zo(io,{sx:{color:"#8a6d1d",bgcolor:"#faf1d7",borderRadius:1,px:1.5,py:1.25,lineHeight:1.7},children:["\uC9C0\uAE08\uC740 \uCE98\uB9B0\uB354\uC5D0 \uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",Jt("br",{}),Jt("b",{children:"\uB9C8\uAC10\uC77C\uC2DC\uAC00 \uC788\uB294 \uB0B4 \uC5C5\uBB34 \uB610\uB294 \uBCF4\uB0B8\uC5C5\uBB34"}),"\uAC00 \uC0DD\uAE30\uBA74"," ",p.subscribed?"\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0 \uC790\uB3D9\uC73C\uB85C \uD45C\uC2DC\uB429\uB2C8\uB2E4.":"\uC5EC\uAE30\uC11C \uAD6C\uB3C5\uC744 \uC2DC\uC791\uD558\uC138\uC694."]}):p.subscribed&&p.enabled?Zo(F4,{children:[Jt(P4,{value:t,fullWidth:!0,label:"\uB0B4 \uD53C\uB4DC \uC8FC\uC18C",slotProps:{input:{readOnly:!0}}}),Zo(io,{sx:{display:"flex",gap:2},children:[Jt(ps,{variant:"outlined",startIcon:Jt(j4,{}),onClick:n,children:"\uC8FC\uC18C \uBCF5\uC0AC"}),Jt(ps,{variant:"contained",startIcon:Jt($h,{}),onClick:l,children:"Google \uCE98\uB9B0\uB354\uC5D0 \uCD94\uAC00"})]}),Zo(io,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,fontSize:15,lineHeight:1.8,display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[Jt(io,{children:Zo("span",{children:["\uBC84\uD2BC\uC774 \uB3D9\uC791\uD558\uC9C0 \uC54A\uC73C\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354 > \uB2E4\uB978 \uCE98\uB9B0\uB354 + > ",Jt("b",{children:"URL\uB85C \uCD94\uAC00"}),"\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),Jt(io,{children:Jt("span",{children:"\uAD6C\uAE00\uC774 \uD53C\uB4DC\uB97C \uC8FC\uAE30\uC801\uC73C\uB85C(\uC218 \uC2DC\uAC04 \uAC04\uACA9) \uAC00\uC838\uAC00\uBBC0\uB85C \uBCC0\uACBD\uC0AC\uD56D \uBC18\uC601\uC774 \uB2A6\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4."})}),Jt(io,{children:Jt("span",{children:"\uB0B4\uBCF4\uB0B4\uAE30\uB97C \uADF8\uB9CC\uD558\uB824\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uCD94\uAC00\uD55C \uCE98\uB9B0\uB354\uB97C \uC0AD\uC81C\uD558\uBA74 \uB429\uB2C8\uB2E4."})}),Jt(io,{children:Jt("span",{children:"\uC774 \uC8FC\uC18C\uB294 \uBCF8\uC778 \uC804\uC6A9\uC785\uB2C8\uB2E4. \uACF5\uC720\uD558\uBA74 \uB0B4 \uC5C5\uBB34 \uC77C\uC815\uC774 \uB178\uCD9C\uB429\uB2C8\uB2E4."})})]})]}):Jt(ps,{variant:"contained",onClick:o,sx:{alignSelf:"flex-start"},children:"\uAD6C\uB3C5 \uC2DC\uC791 (\uD53C\uB4DC \uBC1C\uAE09)"})]});return Jt(N4,{open:e,onClose:s,width:680,title:"\uAD6C\uAE00 \uCE98\uB9B0\uB354\uB85C \uB0B4\uBCF4\uB0B4\uAE30",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-subscribe",sections:[{id:"calendar-subscribe",showTitle:!1,children:i}],actions:{showCancelButton:!1,left:Jt(ps,{variant:"outlined",startIcon:Jt($h,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:Jt(ps,{variant:"contained",onClick:s,children:"\uB2EB\uAE30"})}})}import{useEffect as z4,useMemo as Uc,useState as Vc}from"react";import{Box as ms,Button as q4,Typography as $4}from"@mui/material";import{FormDialog as H4}from"@ehfuse/mui-form-dialog";import{SearchTextField as W4}from"@ehfuse/mui-form-controls";import{TreeView as U4}from"@ehfuse/tree-view";import{Fragment as Z4,jsx as pn,jsxs as J4}from"react/jsx-runtime";function Wh(e){return`${e.name}#${e.seq}`}function V4(e){return Number(e.slice(e.lastIndexOf("#")+1))||0}function K4(e){let p=[],b=c=>{for(let o of c.employees??[])p.push(o);for(let o of c.groups??[])b(o)};for(let c of e)b(c);return p}function G4(e,p){return p?[e.name,e.department,e.role_name,e.work_position].filter(Boolean).some(b=>String(b).toLowerCase().includes(p)):!0}function Y4(e){let p=[[e.name,e.role_name].filter(Boolean).join(" "),e.department].filter(Boolean).join(" / ");return{id:`emp:${e.seq}`,label:Wh(e),renderLabel:pn(ms,{component:"span",sx:{display:"inline-flex",alignItems:"baseline",gap:.75},children:pn(ms,{component:"span",sx:{fontWeight:400,color:"text.primary"},children:p})})}}function Uh(e,p){let b=(e.groups??[]).map(o=>Uh(o,p)).filter(o=>o!==null),c=(e.employees??[]).filter(o=>G4(o,p)).map(Y4);return b.length===0&&c.length===0?null:{id:`group:${e.key}`,label:e.name,children:[...b,...c]}}function X4({groups:e,allEmployees:p,initialSelectedSeqs:b,multiple:c,isMobile:o,onSelectionChange:s}){let[r,t]=Vc(""),n=Uc(()=>e.map(i=>Uh(i,r.trim().toLowerCase())).filter(i=>i!==null),[e,r]),l=Uc(()=>p.filter(i=>b.includes(i.seq)).map(Wh),[]);return J4(Z4,{children:[pn(ms,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:pn(W4,{size:"small",fullWidth:!0,placeholder:"\uC774\uB984, \uBD80\uC11C \uAC80\uC0C9",onSearch:t,onClear:()=>t(""),sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),pn(ms,{sx:o?{display:"flex",flexDirection:"column"}:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:pn(U4,{items:n,checkbox:!0,multiSelect:c,selectionMode:"child",showSearch:!1,defaultExpanded:!0,initialSelections:l,onChange:i=>s(i.map(V4).filter(a=>a>0)),styles:{border:"none",borderRadius:"0"}})})]})}function Lj({open:e,title:p="\uC9C1\uC6D0 \uC120\uD0DD",hint:b="",groups:c,multiple:o=!1,selectedSeqs:s,confirmText:r="\uD655\uC778",onConfirm:t,onClose:n}){let l=It(),[i,a]=Vc([]),[f,d]=Vc(0),u=Uc(()=>K4(c),[c]),g=s??[];z4(()=>{e&&(a(g),d(v=>v+1))},[e]);let m=()=>{let v=u.filter(k=>i.includes(k.seq));t(o?v:v.slice(0,1)),n()};return pn(H4,{open:e,onClose:n,title:`${p}${o&&i.length>0?` (${i.length}\uBA85)`:""}`,locale:"ko",fullScreen:l,mobilePresentation:l?"slide":"dialog",draggable:!0,width:"600px",tabs:{visible:!1},titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},scrollPastLastSection:!1,sectionContentPaddingTop:0,fontScale:{enabled:!0},fontScaleKey:"taskbox-employee-select",sections:[{id:"employee-select",title:"\uC9C1\uC6D0 \uC120\uD0DD",showTitle:!1,children:pn(ms,{sx:{...l?{}:{height:560},display:"flex",flexDirection:"column",border:"1px solid #cccccc",borderRadius:1,...l?{}:{overflow:"hidden"},userSelect:"none"},children:pn(X4,{groups:c,allEmployees:u,initialSelectedSeqs:g,multiple:o,isMobile:l,onSelectionChange:a},f)})}],dialogActionSx:{"@media (max-width:1023.95px)":{gap:"0.75rem !important","& .left-actions":{flex:1,minWidth:0},"& .right-actions":{flex:1}}},actions:{visible:!0,showCancelButton:!1,left:b?pn($4,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.35},children:b}):void 0,right:pn(q4,{variant:"contained",onClick:m,children:r})}})}import{useEffect as n6,useMemo as o6,useState as ru}from"react";import{Box as lo,Button as i6}from"@mui/material";import{FormDialog as s6}from"@ehfuse/mui-form-dialog";import{LabelSelect as nu}from"@ehfuse/mui-form-controls";import{Box as Ga}from"@mui/material";import{Bar as r5,BarChart as n5,CartesianGrid as o5,Cell as i5,ReferenceLine as s5,ResponsiveContainer as a5,Tooltip as l5,XAxis as c5,YAxis as u5}from"recharts";import{Box as Q4}from"@mui/material";import{jsx as e5}from"react/jsx-runtime";function Rr({text:e,height:p}){return e5(Q4,{sx:{display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",fontSize:14.5,color:"#9a9a97",...typeof p=="number"?{height:p,minHeight:120}:{position:"absolute",inset:0,pointerEvents:"none"}},children:e})}import{createElement as t5}from"react";var Ka="#2f80ed",Vh="#a9c9f5",Jo="#9a9a97",Kc="#2e9e6b",so="#3d7eff",Gc="#c3c8ce",gs="#f2a30f",bs={contentStyle:{fontSize:13.5,color:"#37352f",border:"1px solid #e6e6e3",borderRadius:6},labelStyle:{fontSize:13.5,color:"#37352f",fontWeight:700},itemStyle:{fontSize:13.5}},Ei={...bs,cursor:!1},Ri={wrapperStyle:{fontSize:13.5,paddingTop:10},formatter:e=>t5("span",{style:{paddingRight:14,color:"#37352f"}},e)};function tr(e){return{display:"flex",flexDirection:"column",minHeight:0,position:"relative",...typeof e=="string"?{flex:1}:{}}}var xr={flexShrink:0,mb:1.5,display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"};function On(e){return{"& *":{outline:"none"},userSelect:"none",...typeof e=="number"?{height:e,flexShrink:0}:{flex:1,minHeight:0}}}import{jsx as mn,jsxs as ys}from"react/jsx-runtime";function f5(e,p){let b=p.filter(c=>c.sprint_seq===e.seq&&!c.archived&&c.completed);return{points:b.reduce((c,o)=>c+(o.story_points??0),0),count:b.length}}function Kh({sprints:e,tasks:p,height:b=200}){let o=[...e].sort((i,a)=>`${i.start_date}|${i.seq}`.localeCompare(`${a.start_date}|${a.seq}`)).map(i=>({sprint:i,...f5(i,p)})),s=o.some(i=>i.points>0),r=s?"SP":"\uAC74",t=o.filter(i=>i.sprint.status==="closed").map(i=>s?i.points:i.count),n=t.length>0?Math.round(t.reduce((i,a)=>i+a,0)/t.length*10)/10:null,l=o.map(i=>({\uBAA9\uD45C:`${i.sprint.name}${i.sprint.status!=="closed"?" (\uC9C4\uD589\uC911)":""}`,\uC644\uB8CC:s?i.points:i.count,closed:i.sprint.status==="closed"}));return o.length===0?mn(Rr,{text:"\uD45C\uC2DC\uD560 \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:b}):ys(Ga,{sx:tr(b),children:[ys(Ga,{sx:{flexShrink:0,mb:1,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[ys("span",{children:["\uC644\uB8CC ",s?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uBAA9\uD45C\uBCC4"]}),n!==null?ys("span",{children:["\uD3C9\uADE0(\uC885\uB8CC \uBAA9\uD45C)"," ",mn(Ga,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:n}),r]}):null]}),mn(Ga,{sx:On(b),children:mn(a5,{width:"100%",height:"100%",children:ys(n5,{data:l,margin:{top:8,right:12,left:0,bottom:0},barCategoryGap:"28%",children:[mn(o5,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),mn(c5,{dataKey:"\uBAA9\uD45C",tick:{fontSize:13},tickMargin:6,interval:0}),mn(u5,{tick:{fontSize:13},width:40,allowDecimals:!1}),mn(l5,{...Ei,formatter:i=>`${Number(i??0)}${r}`}),n!==null?mn(s5,{y:n,stroke:Jo,strokeDasharray:"6 5",label:{value:`\uD3C9\uADE0 ${n}${r}`,position:"right",fontSize:13}}):null,mn(r5,{dataKey:"\uC644\uB8CC",radius:[4,4,0,0],children:l.map(i=>mn(i5,{fill:i.closed?Ka:Vh},i.\uBAA9\uD45C))})]})})})]})}import{useMemo as d5}from"react";import{Box as An}from"@mui/material";import{CartesianGrid as h5,Line as Gh,LineChart as p5,ResponsiveContainer as m5,Tooltip as g5,XAxis as b5,YAxis as y5}from"recharts";import{jsx as Nr,jsxs as Co}from"react/jsx-runtime";function Yh(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?new Date(`${e}T00:00:00`):null}function x5(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function v5(e){return e.slice(5).replace("-",".")}function Xh({sprint:e,tasks:p,todayStr:b,height:c=200,headerLeft:o}){let s=d5(()=>{let a=Yh(e.start_date),f=Yh(e.end_date);if(!a||!f||f<a||Math.round((f.getTime()-a.getTime())/864e5)+1>366)return null;let u=p.filter(D=>D.sprint_seq===e.seq&&!D.archived);if(u.length===0)return{empty:!0};let g=u.some(D=>(D.story_points??0)>0),m=D=>g?D.story_points??0:1,v=u.reduce((D,j)=>D+m(j),0),k=new Map;for(let D of u){if(!D.completed)continue;let j=(D.completed_time??"").slice(0,10),z=/^\d{4}-\d{2}-\d{2}$/.test(j)?j:e.start_date;k.set(z,(k.get(z)??0)+m(D))}let B=[];for(let D=new Date(a);D<=f;D.setDate(D.getDate()+1))B.push(x5(D));let A=v,L=v;return{empty:!1,data:B.map((D,j)=>{let z=B.length===1?0:v*(1-j/(B.length-1));return D<=b&&(A-=k.get(D)??0,L=Math.max(0,A)),{\uB0A0\uC9DC:v5(D),\uC774\uC0C1:Math.round(z*10)/10,\uB0A8\uC740\uB7C9:D<=b?Math.max(0,A):null}}),total:v,usePoints:g,last:L}},[e,p,b]);if(!s)return Co(An,{sx:tr(c),children:[o?Nr(An,{sx:xr,children:o}):null,Nr(Rr,{text:"\uBAA9\uD45C\uC758 \uC2DC\uC791\uC77C\xB7\uC885\uB8CC\uC77C\uC774 \uC788\uC5B4\uC57C \uBC88\uB2E4\uC6B4\uC744 \uADF8\uB9B4 \uC218 \uC788\uC2B5\uB2C8\uB2E4.",height:c})]});if(s.empty)return Co(An,{sx:tr(c),children:[o?Nr(An,{sx:xr,children:o}):null,Nr(Rr,{text:"\uBC30\uC815\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:c})]});let{data:r,total:t,usePoints:n,last:l}=s,i=n?"SP":"\uAC74";return Co(An,{sx:tr(c),children:[Co(An,{sx:xr,children:[o?Nr(An,{sx:{flexShrink:0},children:o}):null,Co(An,{sx:{flex:1,minWidth:220,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Co("span",{children:["\uB0A8\uC740 ",n?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uCD1D ",t]}),Co("span",{children:["\uD604\uC7AC"," ",Nr(An,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:l}),i," \uB0A8\uC74C"]})]})]}),Nr(An,{sx:On(c),children:Nr(m5,{width:"100%",height:"100%",children:Co(p5,{data:r,margin:{top:8,right:12,left:0,bottom:0},children:[Nr(h5,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Nr(b5,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),Nr(y5,{tick:{fontSize:13},width:40,allowDecimals:!1}),Nr(g5,{...bs,formatter:a=>`${Number(a??0)}${i}`}),Nr(Gh,{type:"linear",dataKey:"\uC774\uC0C1",stroke:Jo,strokeDasharray:"6 5",strokeWidth:1.5,dot:!1}),Nr(Gh,{type:"monotone",dataKey:"\uB0A8\uC740\uB7C9",stroke:Ka,strokeWidth:2.5,dot:!1,connectNulls:!1})]})})})]})}import{useMemo as np}from"react";import{Box as Dn}from"@mui/material";import{Area as Zc,AreaChart as S5,CartesianGrid as T5,Legend as C5,ResponsiveContainer as B5,Tooltip as I5,XAxis as M5,YAxis as E5}from"recharts";function ao(e){let p=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())}`}function Ya(e,p=new Date){let b=new Date(p);return b.setMonth(b.getMonth()-e),b}function iL(e=new Date){return{fromDate:ao(Ya(1,e)),toDate:ao(e)}}var Xc=864e5,xs=[0,1,2,3,5,8,13,21];function Qh(e){return!e.archived&&!e.linked_only&&!e.is_notice&&!e.is_event}function Yc(e){let p=String(e??"").trim(),b=/^(\d{4}-\d{2}-\d{2})(?:[ T](\d{2}:\d{2}))?/.exec(p);if(!b)return null;let c=new Date(`${b[1]}T${b[2]??"00:00"}:00`).getTime();return Number.isNaN(c)?null:c}function Oi(e){let p=String(e??"").trim();return/^\d{4}-\d{2}-\d{2}/.test(p)?p.slice(0,10):""}function w5(e){let p=Oi(e.created_time)||Oi(e.start_date)||Oi(e.completed_time);if(!p)return null;let b=Oi(e.start_date),c=b&&b>p?b:p,o=e.completed?Oi(e.completed_time)||p:"";return{created:p,started:c,done:o}}function ep(e,p){let b=/^\d{4}-\d{2}-\d{2}$/.test(p)?new Date(`${p}T00:00:00`):new Date,c=Math.max(2,Math.min(366,Math.round(e))),o=[];for(let s=c-1;s>=0;s-=1)o.push(ao(new Date(b.getTime()-s*Xc)));return o}function tp(e,p,b){let c=ep(p,b),o=e.filter(Qh).map(w5).filter(n=>n!==null),s=c.map(n=>{let l=0,i=0,a=0;for(let f of o)f.created>n||(f.done&&f.done<=n?l+=1:f.started<=n?i+=1:a+=1);return{day:n,done:l,inProgress:i,waiting:a}}),r=s[s.length-1],t=s.reduce((n,l)=>Math.max(n,l.done+l.inProgress+l.waiting),0);return{points:s,max:t,currentWip:r?.inProgress??0,currentTotal:r?r.done+r.inProgress+r.waiting:0,currentDone:r?.done??0}}function _5(e,p){if(e.length===0)return 0;let b=Math.min(e.length-1,Math.max(0,Math.ceil(e.length*p)-1));return e[b]}function Zh(e){if(e.length===0)return null;let p=[...e].sort((s,r)=>s-r),b=s=>Math.round(s*10)/10,c=Math.floor(p.length/2),o=p.length%2===1?p[c]:(p[c-1]+p[c])/2;return{count:p.length,median:b(o),average:b(p.reduce((s,r)=>s+r,0)/p.length),p85:b(_5(p,.85))}}function Jh(e){for(let p=xs.length-1;p>=0;p-=1)if(e>=xs[p])return p;return 0}function k5(){return xs.map((e,p)=>p===xs.length-1?`${e}\uC77C+`:`${e}~${xs[p+1]}\uC77C`)}function rp(e,p,b){let c=ep(p,b),o=c[0],s=c[c.length-1],r=k5(),t=r.map(()=>0),n=r.map(()=>0),l=[],i=[];for(let a of e){if(!Qh(a)||!a.completed)continue;let f=Oi(a.completed_time);if(!f||f<o||f>s)continue;let d=Yc(a.completed_time),u=Yc(a.created_time);if(d===null||u===null)continue;let g=Math.max(0,(d-u)/Xc);l.push(g),t[Jh(g)]+=1;let m=Yc(a.start_date);if(m===null||m>d)continue;let v=Math.max(0,(d-Math.max(m,u))/Xc);i.push(v),n[Jh(v)]+=1}return{labels:r,leadCounts:t,cycleCounts:n,lead:Zh(l),cycle:Zh(i)}}import{jsx as Or,jsxs as Bo}from"react/jsx-runtime";function R5(e){return e.slice(5).replace("-",".")}function op({tasks:e,todayStr:p,days:b=30,height:c=220,headerLeft:o}){let s=np(()=>tp(e,b,p),[e,b,p]),r=np(()=>s.points.map(n=>({\uB0A0\uC9DC:R5(n.day),\uC644\uB8CC:n.done,\uC9C4\uD589:n.inProgress,\uB300\uAE30:n.waiting})),[s]),t=Bo(Dn,{sx:xr,children:[o?Or(Dn,{sx:{flexShrink:0},children:o}):null,Bo(Dn,{sx:{flex:1,minWidth:220,display:"flex",flexDirection:"column",gap:.5},children:[Bo(Dn,{sx:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Bo("span",{children:["\uCD5C\uADFC ",s.points.length,"\uC77C \u2014 \uC811\uC218 ",s.currentTotal,"\uAC74 / \uC644\uB8CC ",s.currentDone,"\uAC74"]}),Bo("span",{children:["\uC9C4\uD589 \uC911"," ",Or(Dn,{component:"span",sx:{color:so,fontWeight:700},children:s.currentWip}),"\uAC74"]})]}),Or(Dn,{sx:{fontSize:13.5,color:"#37352f"},children:"\uB760\uAC00 \uB450\uAEBC\uC6CC\uC9C0\uBA74 \uC77C\uC774 \uC313\uC774\uB294 \uC911, \uC587\uC544\uC9C0\uBA74 \uCC98\uB9AC\uB418\uB294 \uC911\uC785\uB2C8\uB2E4."})]})]});return r.length===0||s.max===0?Bo(Dn,{sx:tr(c),children:[o?Or(Dn,{sx:xr,children:o}):null,Or(Rr,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC811\uC218\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:c})]}):Bo(Dn,{sx:tr(c),children:[t,Or(Dn,{sx:On(c),children:Or(B5,{width:"100%",height:"100%",children:Bo(S5,{data:r,margin:{top:8,right:12,left:0,bottom:4},children:[Or(T5,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Or(M5,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),Or(E5,{tick:{fontSize:13},width:40,allowDecimals:!1}),Or(I5,{...bs,formatter:n=>`${Number(n??0)}\uAC74`}),Or(C5,{...Ri}),Or(Zc,{type:"monotone",dataKey:"\uC644\uB8CC",stackId:"flow",stroke:Kc,fill:Kc,fillOpacity:.9}),Or(Zc,{type:"monotone",dataKey:"\uC9C4\uD589",stackId:"flow",stroke:so,fill:so,fillOpacity:.85}),Or(Zc,{type:"monotone",dataKey:"\uB300\uAE30",stackId:"flow",stroke:Gc,fill:Gc,fillOpacity:.9})]})})})]})}import{useMemo as ip}from"react";import{Box as jr}from"@mui/material";import{Bar as sp,BarChart as O5,CartesianGrid as A5,Legend as D5,ResponsiveContainer as P5,Tooltip as N5,XAxis as j5,YAxis as L5}from"recharts";import{jsx as ur,jsxs as tn}from"react/jsx-runtime";function ap({label:e,color:p,summary:b}){let c=tn(jr,{sx:{display:"flex",alignItems:"center",gap:.75},children:[ur(jr,{sx:{width:10,height:10,borderRadius:.5,bgcolor:p,flexShrink:0}}),ur(jr,{component:"span",sx:{fontWeight:700,color:"#37352f"},children:e})]});return b?tn(jr,{sx:{display:"contents"},children:[c,tn("span",{children:[b.count,"\uAC74"]}),tn("span",{children:["\uC911\uC559\uAC12"," ",ur(jr,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:b.median}),"\uC77C"]}),tn("span",{children:["\uD3C9\uADE0 ",b.average,"\uC77C"]}),tn("span",{children:["85% ",b.p85,"\uC77C \uC774\uB0B4"]})]}):tn(jr,{sx:{display:"contents"},children:[c,ur(jr,{component:"span",sx:{gridColumn:"span 4",color:"#9a9a97"},children:"\uD45C\uBCF8 \uC5C6\uC74C"})]})}function lp({tasks:e,todayStr:p,days:b=30,height:c=200,headerLeft:o}){let s=ip(()=>rp(e,b,p),[e,b,p]),r=ip(()=>s.labels.map((t,n)=>({\uAD6C\uAC04:t,\uB9AC\uB4DC\uD0C0\uC784:s.leadCounts[n],\uC0AC\uC774\uD074\uD0C0\uC784:s.cycleCounts[n]})),[s]);return s.lead?tn(jr,{sx:tr(c),children:[tn(jr,{sx:xr,children:[o?ur(jr,{sx:{flexShrink:0},children:o}):null,tn(jr,{sx:{flex:1,minWidth:260,display:"grid",gridTemplateColumns:"max-content max-content max-content max-content max-content",justifyContent:"start",alignItems:"center",columnGap:3,rowGap:.5,fontSize:14,color:"#000"},children:[ur(ap,{label:"\uB9AC\uB4DC\uD0C0\uC784(\uC791\uC131\u2192\uC644\uB8CC)",color:so,summary:s.lead}),ur(ap,{label:"\uC0AC\uC774\uD074\uD0C0\uC784(\uC2DC\uC791\u2192\uC644\uB8CC)",color:gs,summary:s.cycle})]})]}),ur(jr,{sx:On(c),children:ur(P5,{width:"100%",height:"100%",children:tn(O5,{data:r,margin:{top:8,right:12,left:0,bottom:4},barCategoryGap:"24%",children:[ur(A5,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),ur(j5,{dataKey:"\uAD6C\uAC04",tick:{fontSize:13},tickMargin:6,interval:0}),ur(L5,{tick:{fontSize:13},width:40,allowDecimals:!1}),ur(N5,{...Ei,formatter:t=>`${Number(t??0)}\uAC74`}),ur(D5,{...Ri}),ur(sp,{dataKey:"\uB9AC\uB4DC\uD0C0\uC784",fill:so,radius:[3,3,0,0]}),ur(sp,{dataKey:"\uC0AC\uC774\uD074\uD0C0\uC784",fill:gs,radius:[3,3,0,0]})]})})})]}):tn(jr,{sx:tr(c),children:[o?ur(jr,{sx:xr,children:o}):null,ur(Rr,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC644\uB8CC\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:c})]})}import{useMemo as hp}from"react";import{Box as Qo}from"@mui/material";import{Bar as Qc,BarChart as $5,CartesianGrid as H5,Cell as W5,Legend as U5,ReferenceLine as V5,ResponsiveContainer as K5,Tooltip as G5,XAxis as Y5,YAxis as X5}from"recharts";function F5(e,p){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(p))return null;let b=new Date(`${e}T00:00:00`).getTime(),c=new Date(`${p}T00:00:00`).getTime();return Number.isNaN(b)||Number.isNaN(c)?null:Math.round((c-b)/864e5)}function z5(e,p,b){let c=String(e.due_date??"").slice(0,10),o=F5(p,c);return o===null?"later":o<0?"overdue":o<=b?"soon":"later"}function cp(e,p){let{todayStr:b,soonDays:c=7,includeUnassigned:o=!0,limit:s}=p,r=new Map;for(let n of e){if(n.completed||n.archived||n.is_notice||n.is_event||n.linked_only)continue;let l=Number(n.manager_account_seq??0);if(!l&&!o)continue;let i=l?String(n.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",a=r.get(l)??{accountSeq:l,name:i,overdue:0,soon:0,later:0,total:0,points:0};a[z5(n,b,c)]+=1,a.total+=1,a.points+=Number(n.story_points??0)||0,r.set(l,a)}let t=[...r.values()].sort((n,l)=>n.accountSeq===0!=(l.accountSeq===0)?n.accountSeq===0?1:-1:n.overdue!==l.overdue?l.overdue-n.overdue:n.total!==l.total?l.total-n.total:n.name.localeCompare(l.name));return typeof s=="number"&&s>0?t.slice(0,s):t}function up(e,p){return p>0&&e.total>=p}function fp(e){let p=e.filter(b=>b.accountSeq>0);return p.length===0?0:p.reduce((b,c)=>b+c.total,0)/p.length}function Jc(e,p){let b=new Date(`${e}T00:00:00`);b.setDate(b.getDate()+p);let c=o=>String(o).padStart(2,"0");return`${b.getFullYear()}-${c(b.getMonth()+1)}-${c(b.getDate())}`}function q5(e){let p=new Date(`${e}T00:00:00`);if(Number.isNaN(p.getTime()))return e;let b=(p.getDay()+6)%7;return Jc(e,-b)}function dp(e,p){let{todayStr:b,includeUnassigned:c=!0,weeks:o=6,limit:s}=p,r=q5(b),t=Array.from({length:Math.max(1,o)},(d,u)=>{let g=Jc(r,u*7),m=Jc(g,6),[,v,k]=g.split("-");return{start:g,end:m,label:`${Number(v)}/${Number(k)}`,isCurrent:u===0}}),n=t[t.length-1].end,l=new Map;for(let d of e){if(d.completed||d.archived||d.is_notice||d.is_event||d.linked_only)continue;let u=Number(d.manager_account_seq??0);if(!u&&!c)continue;let g=u?String(d.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",m=l.get(u)??{accountSeq:u,name:g,overdue:0,byWeek:new Array(t.length).fill(0),noDue:0,total:0,beyond:0},v=String(d.due_date??"").slice(0,10);if(m.total+=1,!/^\d{4}-\d{2}-\d{2}$/.test(v))m.noDue+=1;else if(v<b)m.overdue+=1;else if(v>n)m.beyond+=1;else{let k=t.findIndex(B=>v>=B.start&&v<=B.end);k>=0?m.byWeek[k]+=1:m.beyond+=1}l.set(u,m)}let i=[...l.values()].sort((d,u)=>d.accountSeq===0!=(u.accountSeq===0)?d.accountSeq===0?1:-1:d.overdue!==u.overdue?u.overdue-d.overdue:d.total!==u.total?u.total-d.total:d.name.localeCompare(u.name)),a=typeof s=="number"&&s>0?i.slice(0,s):i,f=a.reduce((d,u)=>Math.max(d,u.overdue,u.noDue,...u.byWeek),0);return{weeks:t,rows:a,maxCell:f}}import{jsx as vr,jsxs as Ai}from"react/jsx-runtime";var pp="#e5484d";function mp({tasks:e,todayStr:p,soonDays:b=7,overloadThreshold:c=0,height:o=200,headerLeft:s}){let r=hp(()=>cp(e,{todayStr:p,soonDays:b}),[e,p,b]),t=hp(()=>fp(r),[r]),n=c>0?c:Math.max(3,Math.ceil(t*1.5)),l=r.filter(i=>i.accountSeq>0&&up(i,n)).length;return r.length===0?Ai(Qo,{sx:tr(o),children:[s?vr(Qo,{sx:xr,children:s}):null,vr(Rr,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:o})]}):Ai(Qo,{sx:tr(o),children:[Ai(Qo,{sx:xr,children:[s,Ai(Qo,{sx:{fontSize:13.5,color:"#37352f"},children:["1\uC778 \uD3C9\uADE0 ",vr("b",{children:t.toFixed(1)}),"\uAC74 \xB7 \uACFC\uBD80\uD558 \uAE30\uC900 ",vr("b",{children:n}),"\uAC74",l>0?Ai(Qo,{component:"span",sx:{ml:1,color:pp,fontWeight:700},children:["\uCD08\uACFC ",l,"\uBA85"]}):null]})]}),vr(Qo,{sx:On(o),children:vr(K5,{width:"100%",height:"100%",children:Ai($5,{data:r,layout:"vertical",margin:{top:4,right:16,bottom:4,left:8},barCategoryGap:r.length>8?4:10,children:[vr(H5,{strokeDasharray:"3 3",horizontal:!1,stroke:"#eceae6"}),vr(Y5,{type:"number",allowDecimals:!1,tick:{fontSize:12}}),vr(X5,{type:"category",dataKey:"name",width:84,tick:{fontSize:12},interval:0}),vr(G5,{...Ei,formatter:(i,a)=>[`${Number(i)||0}\uAC74`,String(a)]}),vr(U5,{...Ri}),t>0?vr(V5,{x:t,stroke:Jo,strokeDasharray:"4 4",label:{value:"\uD3C9\uADE0",position:"top",fontSize:11,fill:Jo}}):null,vr(Qc,{dataKey:"overdue",name:"\uC9C0\uC5F0",stackId:"load",fill:pp}),vr(Qc,{dataKey:"soon",name:`\uC784\uBC15(${b}\uC77C)`,stackId:"load",fill:gs}),vr(Qc,{dataKey:"later",name:"\uC5EC\uC720",stackId:"load",fill:so,radius:[0,3,3,0],children:r.map(i=>vr(W5,{},i.accountSeq))})]})})})]})}import{useMemo as Z5}from"react";import{Box as Hr,Tooltip as J5}from"@mui/material";import{OverlayScrollbar as Q5}from"@ehfuse/overlay-scrollbar";import{jsx as Ar,jsxs as Za}from"react/jsx-runtime";var gp="#e5484d",e6="#2f80ed",t6="#9a9a97",eu=30,r6=96,Xa=56;function tu({count:e,max:p,color:b,title:c}){let o=e>0&&p>0?.18+e/p*.72:0;return Ar(J5,{title:c,arrow:!0,disableInteractive:!0,placement:"top",children:Ar(Hr,{sx:{display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #ececea",borderBottom:"1px solid #ececea",bgcolor:o>0?`${b}${Math.round(o*255).toString(16).padStart(2,"0")}`:"transparent",color:o>.55?"#fff":"#37352f",fontSize:12.5,fontWeight:e>0?700:400,fontVariantNumeric:"tabular-nums"},children:e>0?e:""})})}function bp({tasks:e,todayStr:p,weeks:b=6,height:c=200}){let o=Z5(()=>dp(e,{todayStr:p,weeks:b}),[e,p,b]);if(o.rows.length===0)return Ar(Hr,{sx:tr(c),children:Ar(Rr,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:c})});let s=`${r6}px ${Xa}px repeat(${o.weeks.length}, minmax(${Xa}px, 1fr)) ${Xa}px ${Xa}px`,r={height:eu,display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #ececea",borderBottom:"1px solid #dcdad6",fontSize:12,fontWeight:700,color:"#37352f",bgcolor:"#f8f8f7",whiteSpace:"nowrap"};return Ar(Hr,{sx:tr(c),children:Ar(Q5,{style:{height:"100%"},thumb:{width:8},children:Za(Hr,{sx:{display:"grid",gridTemplateColumns:s,minWidth:"fit-content",height:"100%",gridTemplateRows:`${eu}px repeat(${o.rows.length}, minmax(${eu}px, 1fr))`},children:[Ar(Hr,{sx:{...r,justifyContent:"flex-start",pl:1},children:"\uB2F4\uB2F9\uC790"}),Ar(Hr,{sx:{...r,color:gp},children:"\uC9C0\uC5F0"}),o.weeks.map(t=>Ar(Hr,{sx:{...r,...t.isCurrent?{borderBottom:"2px solid #2f80ed"}:{}},children:t.label},t.start)),Ar(Hr,{sx:r,children:"\uB9C8\uAC10\uC5C6\uC74C"}),Ar(Hr,{sx:r,children:"\uD569\uACC4"}),o.rows.map(t=>Za(Hr,{sx:{display:"contents"},children:[Ar(Hr,{sx:{display:"flex",alignItems:"center",pl:1,borderRight:"1px solid #ececea",borderBottom:"1px solid #ececea",fontSize:13,color:t.accountSeq>0?"#37352f":"#9a9a97",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.name}),Ar(tu,{count:t.overdue,max:o.maxCell,color:gp,title:`${t.name} \xB7 \uC9C0\uC5F0 ${t.overdue}\uAC74`}),t.byWeek.map((n,l)=>Ar(tu,{count:n,max:o.maxCell,color:e6,title:`${t.name} \xB7 ${o.weeks[l].label} \uC8FC \uB9C8\uAC10 ${n}\uAC74`},o.weeks[l].start)),Ar(tu,{count:t.noDue,max:o.maxCell,color:t6,title:`${t.name} \xB7 \uB9C8\uAC10 \uBBF8\uC815 ${t.noDue}\uAC74`}),Za(Hr,{sx:{display:"flex",alignItems:"center",justifyContent:"center",borderBottom:"1px solid #ececea",fontSize:12.5,fontWeight:700,color:"#37352f",fontVariantNumeric:"tabular-nums"},children:[t.total,t.beyond>0?Za(Hr,{component:"span",sx:{ml:.25,fontSize:10.5,color:"#9a9a97"},children:["(+",t.beyond,")"]}):null]})]},t.accountSeq))]})})})}import{jsx as nr,jsxs as yp}from"react/jsx-runtime";var xp="min(560px, 62vh)",a6=`calc(${xp} - 4px)`,l6=[{value:"30",label:"\uCD5C\uADFC 30\uC77C"},{value:"60",label:"\uCD5C\uADFC 60\uC77C"},{value:"90",label:"\uCD5C\uADFC 90\uC77C"}];function tF({open:e,sprints:p,tasks:b,todayStr:c,showSprintCharts:o,initialSprintSeq:s=0,onClose:r}){let[t,n]=ru(0),[l,i]=ru(30);n6(()=>{if(!e)return;let B=p.find(L=>L.status==="active")??p[0],A=p.find(L=>L.seq===s)??B;n(A?.seq??0)},[e]);let a=o6(()=>p.find(B=>B.seq===t)??null,[p,t]),f={height:a6,boxSizing:"border-box",px:3,py:2.5,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden"},d=nr(nu,{label:"\uBAA9\uD45C",showLabel:!1,showEmptyOption:!1,value:t?String(t):"",options:p.map(B=>({value:String(B.seq),label:Jr(B)})),onChange:B=>n(Number(B.target.value)||0),sx:{width:280,flexShrink:0}}),[u,g]=ru("distribution"),m=nr(nu,{label:"\uBCF4\uAE30",showLabel:!1,showEmptyOption:!1,value:u,options:[{value:"distribution",label:"\uC9C0\uAE08 \uBD80\uD558(\uC9C0\uC5F0\xB7\uC784\uBC15\xB7\uC5EC\uC720)"},{value:"timeline",label:"\uC8FC\uBCC4 \uB9C8\uAC10 \uBC00\uC9D1"}],onChange:B=>g(B.target.value==="timeline"?"timeline":"distribution"),sx:{width:280,flexShrink:0}}),v=o??p.length>0,k=nr(nu,{label:"\uAE30\uAC04",showLabel:!1,showEmptyOption:!1,value:String(l),options:l6,onChange:B=>i(Number(B.target.value)||30),sx:{width:280,flexShrink:0}});return nr(s6,{open:e,onClose:r,maxWidth:"md",title:"\uC5C5\uBB34 \uCC28\uD2B8",locale:"ko",contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,sectionTitleGap:0,fixedHeight:xp,contentBottomPadding:0,scrollPastLastSection:!1,tabs:{visible:!0,switchContent:!0,fullWidth:!0},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-charts",sections:[...v?[{id:"velocity",tabTitle:"\uBCA8\uB85C\uC2DC\uD2F0",showTitle:!1,children:nr(lo,{sx:f,children:nr(Kh,{sprints:p,tasks:b,height:"100%"})})},{id:"burndown",tabTitle:"\uBC88\uB2E4\uC6B4",showTitle:!1,children:nr(lo,{sx:f,children:a?nr(Xh,{sprint:a,tasks:b,todayStr:c,height:"100%",headerLeft:d}):yp(lo,{sx:tr("100%"),children:[nr(lo,{sx:xr,children:d}),nr(Rr,{text:"\uBC88\uB2E4\uC6B4\uC744 \uBCFC \uBAA9\uD45C\uB97C \uC120\uD0DD\uD558\uC138\uC694.",height:"100%"})]})})},{id:"cumulative-flow",tabTitle:"\uB204\uC801\uD750\uB984\uB3C4",showTitle:!1,children:nr(lo,{sx:f,children:nr(op,{tasks:b,todayStr:c,days:l,height:"100%",headerLeft:k})})}]:[],{id:"workload",tabTitle:"\uC6CC\uD06C\uB85C\uB4DC",showTitle:!1,children:nr(lo,{sx:f,children:u==="timeline"?yp(lo,{sx:{display:"flex",flexDirection:"column",height:"100%",minHeight:0},children:[nr(lo,{sx:xr,children:m}),nr(bp,{tasks:b,todayStr:c,height:"100%"})]}):nr(mp,{tasks:b,todayStr:c,height:"100%",headerLeft:m})})},{id:"lead-time",tabTitle:"\uB9AC\uB4DC\uD0C0\uC784",showTitle:!1,children:nr(lo,{sx:f,children:nr(lp,{tasks:b,todayStr:c,days:l,height:"100%",headerLeft:k})})}],actions:{showCancelButton:!1,right:nr(i6,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}})}import{Checkbox as c6,Divider as u6,Menu as f6,MenuItem as ou}from"@mui/material";import{jsx as vs,jsxs as vp}from"react/jsx-runtime";function sF({anchorEl:e,candidates:p,selectedNames:b,avatarSrcByName:c,onToggle:o,onClear:s,onClose:r}){return vp(f6,{anchorEl:e,open:!!e,onClose:r,transitionDuration:0,children:[p.length===0?vs(ou,{disabled:!0,sx:{fontSize:14},children:"\uBAA9\uB85D\uC5D0 \uC9C0\uC815\uB41C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):p.map(t=>{let n=b.includes(t.name);return vp(ou,{onClick:()=>o(t),sx:{fontSize:14,minWidth:170,gap:1},children:[vs(c6,{size:"small",checked:n,sx:{p:0}}),vs(Tr,{names:[t.name],size:20,avatarSrcByName:c}),t.name]},`${t.accountSeq}-${t.name}`)}),vs(u6,{}),vs(ou,{disabled:b.length===0,onClick:s,sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{useState as d6}from"react";import{ButtonBase as h6,Menu as p6,MenuItem as m6}from"@mui/material";import g6 from"@mui/icons-material/KeyboardArrowDown";import b6 from"@mui/icons-material/Check";import{Fragment as y6,jsx as iu,jsxs as su}from"react/jsx-runtime";function pF({value:e,onChange:p,options:b}){let[c,o]=d6(null),s=b??Tl,r=Tl.find(t=>t.value===e)?.label??"";return su(y6,{children:[su(h6,{onClick:t=>o(t.currentTarget),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:1,fontSize:13.5,color:"#37352f","&:hover":{bgcolor:"#f2f2f0"}},children:[r,iu(g6,{sx:{fontSize:17,color:"#9a9a97"}})]}),iu(p6,{transitionDuration:0,anchorEl:c,open:!!c,onClose:()=>o(null),children:s.map(t=>su(m6,{selected:t.value===e,onClick:()=>{p(t.value),o(null)},sx:{fontSize:14,minWidth:140,justifyContent:"space-between",gap:1},children:[t.label,t.value===e?iu(b6,{sx:{fontSize:16,color:"#2f80ed"}}):null]},t.value))})]})}import{Box as au,ButtonBase as x6,Divider as v6,Popover as w6}from"@mui/material";import _6 from"@mui/icons-material/Check";import k6 from"@ehfuse/overlay-scrollbar";import{jsx as ei,jsxs as _p}from"react/jsx-runtime";var wp=["#1e3a8a","#2f80ed","#06b6d4","#0fa3a3","#2f9e5b","#84cc16","#e8a33d","#d9730d","#e5484d","#e255a1","#a355c0","#8a5a2b","#57564f","#111827"];function _F({anchorEl:e,value:p,color:b="",onSelect:c,onSelectColor:o,onClose:s}){return ei(w6,{transitionDuration:0,open:!!e,anchorEl:e,onClose:s,anchorOrigin:{vertical:"bottom",horizontal:"left"},marginThreshold:16,slotProps:{paper:{sx:{mt:1,maxHeight:"calc(100dvh - 96px)"}}},children:_p(au,{sx:{width:"min(492px, calc(100vw - 32px))"},children:[ei(k6,{style:{maxHeight:"min(432px, calc(100dvh - 240px))"},contentStyle:{minWidth:0,padding:10},thumb:{width:6},children:ei(na,{value:p||Ln,onChange:r=>{c(r),s()}})}),o?_p(au,{sx:{px:1.25,pb:1.25},children:[ei(v6,{sx:{mb:1,borderColor:"#efefed"}}),ei(au,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:wp.map(r=>{let t=(b||wp[0])===r;return ei(x6,{"aria-label":`\uC544\uC774\uCF58 \uC0C9 ${r}`,onClick:()=>o(r),sx:{width:26,height:26,borderRadius:"50%",bgcolor:r,display:"flex",alignItems:"center",justifyContent:"center"},children:t?ei(_6,{sx:{fontSize:15,color:"#ffffff"}}):null},r)})})]}):null]})})}import{Box as Ja,ButtonBase as S6}from"@mui/material";import{DateTextField as kp}from"@ehfuse/mui-form-controls";import{jsx as ws,jsxs as Sp}from"react/jsx-runtime";var T6=[{label:"1\uAC1C\uC6D4",months:1},{label:"3\uAC1C\uC6D4",months:3},{label:"6\uAC1C\uC6D4",months:6},{label:"1\uB144",months:12},{label:"\uC804\uCCB4",months:0}];function Tp({fromDate:e,toDate:p,onChange:b}){let c=s=>{if(s<=0){b("","");return}b(ao(Ya(s)),ao(new Date))},o=s=>s<=0?!e&&!p:!e||!p?!1:e===ao(Ya(s))&&p===ao(new Date);return Sp(Ja,{sx:{display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[ws(Ja,{sx:{display:"flex",alignItems:"center",gap:1.5},children:T6.map(s=>{let r=o(s.months);return ws(S6,{onClick:()=>c(s.months),sx:{px:1.25,py:.85,borderRadius:1,fontSize:13,fontWeight:r?500:400,border:"1px solid",borderColor:r?"#2f80ed":"#dedddb",color:r?"#2f80ed":"#37352f",bgcolor:r?"#eef6ff":"transparent","&:hover":{bgcolor:r?"#eef6ff":"#f7f7f5"}},children:s.label},s.label)})}),Sp(Ja,{sx:{display:"flex",alignItems:"center",gap:.5},children:[ws(kp,{value:e,size:"small",placeholder:"\uC2DC\uC791\uC77C",onChange:s=>b(s.target.value,p),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}}),ws(Ja,{component:"span",sx:{fontSize:13,color:"#9a9a97"},children:"~"}),ws(kp,{value:p,size:"small",placeholder:"\uC885\uB8CC\uC77C",onChange:s=>b(e,s.target.value),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}})]})]})}import{Popover as C6}from"@mui/material";import{jsx as Cp}from"react/jsx-runtime";function OF({anchorEl:e,fromDate:p,toDate:b,onChange:c,onClose:o}){return Cp(C6,{transitionDuration:0,anchorEl:e,open:!!e,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{p:1.5}}},children:Cp(Tp,{fromDate:p,toDate:b,onChange:c})})}import{Box as B6,ButtonBase as I6,Tab as M6,Tabs as E6}from"@mui/material";import R6 from"@mui/icons-material/Checklist";import O6 from"@mui/icons-material/Face";import A6 from"@mui/icons-material/Publish";import D6 from"@mui/icons-material/NotificationsOutlined";import P6 from"@mui/icons-material/BugReportOutlined";import N6 from"@mui/icons-material/DescriptionOutlined";import j6 from"@mui/icons-material/Inventory2Outlined";import{jsx as gn}from"react/jsx-runtime";function Bp(e,p){return p>0?`${e} (${p})`:e}var UF=[{id:"my",label:"\uC804\uCCB4",icon:gn(R6,{sx:{fontSize:18}})},{id:"notice",label:"\uACF5\uC9C0\uC0AC\uD56D",icon:gn(D6,{sx:{fontSize:18}})},{id:"mine",label:"\uB0B4 \uC5C5\uBB34",icon:gn(O6,{sx:{fontSize:18}})},{id:"sent",label:"\uBCF4\uB0B8 \uC5C5\uBB34",icon:gn(A6,{sx:{fontSize:18}})},{id:"bug",label:"\uC624\uB958",icon:gn(P6,{sx:{fontSize:18}})},{id:"archive",label:"\uBCF4\uAD00\uD568",icon:gn(j6,{sx:{fontSize:18}}),hideCount:!0},{id:"report",label:"\uBCF4\uACE0\uC11C",icon:gn(N6,{sx:{fontSize:18}}),hideCount:!0}];function L6(e){return{minHeight:46,minWidth:75,bgcolor:e.bg,color:e.color,borderRadius:"8px 8px 0 0",padding:"10px 18px",textTransform:"none",fontSize:14,fontWeight:500,border:`1px solid ${e.borderColor}`,borderBottom:"none","&:hover":{bgcolor:e.hoverBg},"&.Mui-selected":{bgcolor:e.selectedBg,color:e.selectedColor,border:`1px solid ${e.selectedBg}`,borderBottom:"none","&:hover":{bgcolor:e.selectedBg}},...e.sx}}function VF({items:e,activeTab:p,counts:b,onChange:c,compact:o=!1}){let s=nt(),r=L6(s.tabs),t=e;return o?gn(B6,{sx:{display:"flex",flexWrap:"wrap",gap:1.25},children:t.map(n=>{let l=p===n.id;return gn(I6,{onClick:()=>c(n.id),sx:{px:1.5,py:.75,borderRadius:1,fontSize:fr(13.5),fontWeight:500,whiteSpace:"nowrap",border:"1px solid",bgcolor:l?s.tabs.selectedBg:s.tabs.bg,color:l?s.tabs.selectedColor:s.tabs.color,borderColor:l?s.tabs.selectedBg:s.tabs.borderColor},children:Bp(n.label,n.hideCount?0:b[n.id]??0)},n.id)})}):gn(E6,{value:p,onChange:(n,l)=>c(l),sx:{minHeight:46,"& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:"12px",minHeight:46}},children:t.map(n=>gn(M6,{value:n.id,label:Bp(n.label,n.hideCount?0:b[n.id]??0),icon:n.icon,iconPosition:"start",sx:r},n.id))})}import{useEffect as F6,useMemo as z6,useState as lu}from"react";import{Divider as cu,ListItemIcon as Wr,Menu as uu,MenuItem as wr}from"@mui/material";import q6 from"@mui/icons-material/OpenInNewOutlined";import $6 from"@mui/icons-material/Check";import H6 from"@mui/icons-material/CheckCircleOutlined";import W6 from"@mui/icons-material/RadioButtonUnchecked";import U6 from"@mui/icons-material/SendOutlined";import V6 from"@mui/icons-material/EventOutlined";import K6 from"@mui/icons-material/PersonOutlineOutlined";import G6 from"@mui/icons-material/ViewKanbanOutlined";import Y6 from"@mui/icons-material/ContentCopyOutlined";import X6 from"@mui/icons-material/NextPlanOutlined";import Z6 from"@mui/icons-material/ContentPasteOutlined";import J6 from"@mui/icons-material/ShareOutlined";import Q6 from"@mui/icons-material/DirectionsRunOutlined";import Ip from"@mui/icons-material/ChevronRight";import e_ from"@mui/icons-material/ArchiveOutlined";import t_ from"@mui/icons-material/UnarchiveOutlined";import{ConfirmDialog as r_}from"@ehfuse/alerts";import{Fragment as n_,jsx as ct,jsxs as dr}from"react/jsx-runtime";function _z({target:e,onClose:p,customTabs:b,sprints:c=[],myAccountSeq:o=0,onOpenDetail:s,onToggleCompleted:r,onRequestConfirm:t,onChangeDueDate:n,onChangeReminder:l,onMemberEdit:i,onMoveProject:a,onDuplicate:f,onCreateFollowUp:d,onShare:u,onAssignSprint:g,onArchiveToggle:m,onDelete:v}){let k=It(),B=yn(),[A,L]=lu(null),[O,D]=lu(null),[j,z]=lu(null);F6(()=>{e||(L(null),D(null),z(null))},[e]);let N=e?.task??null,S=!!N?.is_notice,T=!!N?.is_event,E=N?!zn(N,o):!1,h=z6(()=>new Set(b.filter(x=>x.useSprints).map(x=>x.key)),[b]),y=async(x="one")=>{let _=N;if(p(),!_)return;await r_({title:"\uC5C5\uBB34 \uC0AD\uC81C",message:x==="series"?`"${_.title}" \uC758 \uC774 \uD68C\uCC28\uC640 \uC774\uD6C4 \uBC18\uBCF5 \uD68C\uCC28\uB97C \uBAA8\uB450 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`:`"${_.title}" \uC5C5\uBB34\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&v(_.seq,x)},w=()=>{N&&m(N.seq,!N.archived),p()};return dr(n_,{children:[dr(uu,{open:!!e,onClose:p,transitionDuration:0,anchorReference:k?"none":"anchorPosition",anchorPosition:!k&&e?{top:e.position.top,left:e.position.left}:void 0,slotProps:{paper:{sx:{minWidth:190,...k?{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxHeight:"70vh"}:{}}},list:k?{sx:{"& .MuiMenuItem-root":{py:1,minHeight:0}}}:void 0},children:[dr(wr,{onClick:()=>{N&&s(N),p()},sx:{fontSize:14},children:[ct(Wr,{children:ct(q6,{sx:{fontSize:19}})}),"\uC0C1\uC138 \uC5F4\uAE30"]}),dr(wr,{disabled:S?(N?.author_account_seq??0)!==o:(N?.author_account_seq??0)!==o&&(N?.manager_account_seq??0)!==o,onClick:()=>{N&&r(N.seq,!N.completed),p()},sx:{fontSize:14},children:[ct(Wr,{children:N?.completed?ct(W6,{sx:{fontSize:19}}):ct(H6,{sx:{fontSize:19}})}),N?.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC"]}),!S&&t?dr(wr,{disabled:!(N?.manager_account_seq??0)&&(N?.receiver_account_seqs??[]).length===0,onClick:()=>{N&&t(N),p()},sx:{fontSize:14},children:[ct(Wr,{children:ct(U6,{sx:{fontSize:19}})}),"\uD655\uC778 \uC694\uCCAD"]}):null,T?null:ct(cu,{}),T?null:dr(wr,{disabled:E,onClick:x=>{N&&L({anchorEl:x.currentTarget,task:N})},sx:{fontSize:14},children:[ct(Wr,{children:ct(V6,{sx:{fontSize:19}})}),"\uB9C8\uAC10\uC77C\uC2DC \uBCC0\uACBD"]}),!S&&!T&&i?dr(wr,{onClick:()=>{N&&i(N,"manager"),p()},sx:{fontSize:14},children:[ct(Wr,{children:ct(K6,{sx:{fontSize:19}})}),"\uCC45\uC784\uC790 \uBCC0\uACBD"]}):null,T?null:dr(wr,{disabled:E,onClick:x=>{N&&D({anchorEl:x.currentTarget,task:N})},sx:{fontSize:14},children:[ct(Wr,{children:ct(G6,{sx:{fontSize:19}})}),"\uD504\uB85C\uC81D\uD2B8 \uC774\uB3D9",ct(Ip,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}),ct(cu,{}),f?dr(wr,{disabled:E,onClick:()=>{N&&f(N.seq),p()},sx:{fontSize:14},children:[ct(Wr,{children:ct(Y6,{sx:{fontSize:19}})}),"\uBCF5\uC81C"]}):null,d&&N&&!N.is_event&&!N.is_notice?dr(wr,{onClick:()=>{N&&d(N.seq),p()},sx:{fontSize:14},children:[ct(Wr,{children:ct(X6,{sx:{fontSize:19}})}),"\uD6C4\uC18D \uC5C5\uBB34 \uB9CC\uB4E4\uAE30"]}):null,dr(wr,{onClick:()=>{N&&(u?u(N):Ci(N,k)),p()},sx:{fontSize:14},children:[ct(Wr,{children:k?ct(J6,{sx:{fontSize:19}}):ct(Z6,{sx:{fontSize:19}})}),k?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC"]}),N&&!N.is_notice&&!N.is_event&&h.has(String(N.tab_key??""))&&g?dr(wr,{onClick:x=>z(x.currentTarget),sx:{fontSize:14},children:[ct(Wr,{children:ct(Q6,{sx:{fontSize:19}})}),"\uBAA9\uD45C\uC5D0 \uB123\uAE30",ct(Ip,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}):null,dr(wr,{onClick:w,disabled:E||!N?.archived&&!(N&&Hs(N)),sx:{fontSize:14},children:[ct(Wr,{children:N?.archived?ct(t_,{sx:{fontSize:19}}):ct(e_,{sx:{fontSize:19}})}),N?.archived?"\uBCF4\uAD00 \uD574\uC81C":"\uBCF4\uAD00"]}),ct(cu,{}),dr(wr,{disabled:E,onClick:()=>{y("one")},sx:{fontSize:14,color:"#e5484d"},children:[ct(Wr,{children:ct(Zr,{sx:{fontSize:19,color:"#e5484d"}})}),(N?.repeat_group_key??0)>0?"\uC0AD\uC81C (\uC774 \uD68C\uCC28\uB9CC)":"\uC0AD\uC81C"]}),(N?.repeat_group_key??0)>0?dr(wr,{disabled:E,onClick:()=>{y("series")},sx:{fontSize:14,color:"#e5484d"},children:[ct(Wr,{children:ct(Zr,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC0AD\uC81C (\uC774\uD6C4 \uBC18\uBCF5 \uC804\uCCB4)"]}):null]}),ct(Xr,{anchorEl:A?.anchorEl??null,open:!!A,date:A?.task.due_date??"",reminder:A?.task.reminder??"none",hideReminder:!!A?.task.completed,centered:k,onClose:()=>{L(null),p()},onDateChange:x=>{A&&n(A.task.seq,x)},onReminderChange:x=>{A&&l?.(A.task.seq,x)}}),dr(uu,{transitionDuration:0,anchorEl:O?.anchorEl??null,open:!!O,onClose:()=>{D(null),p()},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...B,children:[ct(wr,{selected:!O?.task.tab_key,onClick:()=>{O&&a(O.task.seq,""),D(null),p()},sx:{fontSize:14,minWidth:170},children:"\uC5C6\uC74C"}),b.filter(x=>!x.archived).map(x=>ct(wr,{selected:O?.task.tab_key===x.key,onClick:()=>{O&&a(O.task.seq,x.key),D(null),p()},sx:{fontSize:14,minWidth:170},children:x.label},x.key))]}),ct(uu,{transitionDuration:0,anchorEl:j,open:!!j,onClose:()=>z(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...c.filter(x=>`custom-${x.group_seq}`===String(N?.tab_key??"")).map(x=>({seq:x.seq,label:Jr(x)}))].map(x=>dr(wr,{onClick:()=>{N&&g?.(N.seq,x.seq),z(null),p()},sx:{fontSize:14,minWidth:160,gap:1},children:[x.label,(N?.sprint_seq??0)===x.seq?ct($6,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},x.seq))})]})}import{Checkbox as o_,Divider as i_,Menu as s_,MenuItem as Mp}from"@mui/material";import{jsx as Qa,jsxs as Ep}from"react/jsx-runtime";function Bz({anchorEl:e,labelOptions:p,selectedKeys:b,onToggle:c,onClear:o,onClose:s}){return Ep(s_,{transitionDuration:0,anchorEl:e,open:!!e,onClose:s,children:[p.map(r=>{let t=b.includes(r.key);return Ep(Mp,{onClick:()=>c(r.key),sx:{fontSize:14,minWidth:190,gap:1},children:[Qa(o_,{size:"small",checked:t,sx:{p:0}}),Qa(Rt,{option:r})]},r.key)}),Qa(i_,{}),Qa(Mp,{disabled:b.length===0,onClick:()=>{o(),s()},sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{Divider as a_,Menu as l_,MenuItem as Rp}from"@mui/material";import c_ from"@mui/icons-material/Check";import u_ from"@mui/icons-material/SettingsOutlined";import{jsx as fu,jsxs as du}from"react/jsx-runtime";function Dz(e){let{anchorEl:p,sprints:b,value:c,onSelect:o,onManage:s,onClose:r}=e;return du(l_,{transitionDuration:0,anchorEl:p,open:!!p,onClose:r,children:[[{seq:0,label:"\uC804\uCCB4"},{seq:-1,label:"\uBBF8\uBC30\uC815 \uC5C5\uBB34"},...b.map(t=>({seq:t.seq,label:Jr(t)}))].map(t=>du(Rp,{onClick:()=>{o(t.seq),r()},sx:{fontSize:14,minWidth:180,gap:1},children:[t.label,c===t.seq?fu(c_,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},t.seq)),fu(a_,{}),du(Rp,{onClick:()=>{r(),s()},sx:{fontSize:14,gap:1},children:[fu(u_,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uAD00\uB9AC\u2026"]})]})}var f_={my:"tasks",mine:"tasks",sent:"tasks",notice:"notice",bug:"bug",archive:"archive",done:"done",report:"report"};function d_(e){return f_[e]??"tasks"}var Ap={list:"\uBAA9\uB85D",card:"\uD504\uB85C\uC81D\uD2B8",kanban:"\uC0C1\uD0DC",sprint:"\uBAA9\uD45C",calendar:"\uC8FC\uAC04",month:"\uC6D4\uAC04",agenda:"\uC544\uC820\uB2E4",timeline:"\uD0C0\uC784\uB77C\uC778"},Op=["list","calendar","month","card","kanban","sprint","timeline"],h_=["list","card"];function jz(e){let p=d_(e);switch(p){case"notice":return{kind:p,viewOptions:[],showCreate:!0,createLabel:"\uACF5\uC9C0\uC0AC\uD56D \uB4F1\uB85D",showGroupBy:!1,showSprintFilter:!1,showDateRange:!1,showHideCompleted:!0,forceFlatList:!0,columns:{notice:!0}};case"bug":return{kind:p,viewOptions:Op,showCreate:!0,createLabel:"\uC624\uB958 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:{bug:!0}};case"archive":return{kind:p,viewOptions:h_,showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"done":return{kind:p,viewOptions:["list"],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"report":return{kind:p,viewOptions:[],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{}};default:return{kind:p,viewOptions:Op,showCreate:!0,createLabel:"\uC5C5\uBB34 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:e==="mine"?{showRequest:!1,confirmMode:"action"}:e==="sent"?{confirmMode:"time"}:{}}}}import{useMemo as p_}from"react";import{useKeyboardState as m_}from"@ehfuse/keyboard-state";var Dp=[{key:"g l",view:"list"},{key:"g b",view:"card"},{key:"g k",view:"kanban"},{key:"g s",view:"sprint"},{key:"g c",view:"calendar"},{key:"g m",view:"month"},{key:"g t",view:"timeline"}];function $z(e,p={}){let{enabled:b=!0,views:c}=p,{onCreateTask:o,onFocusSearch:s,onToggleHelp:r,onChangeView:t,onRefresh:n,onEscape:l}=e,i=c?c.join(","):"",a=p_(()=>{let f=[];if(o&&f.push({key:"n",callback:o,options:{preventDefault:!0}}),s&&f.push({key:"/",callback:s,options:{preventDefault:!0}}),n&&f.push({key:"r",callback:n,options:{preventDefault:!0}}),r&&f.push({key:"shift+?",callback:r,options:{preventDefault:!0}}),l&&f.push({key:"escape",callback:l,options:{allowInEditable:!0}}),t)for(let d of Pp(i?i.split(","):void 0))f.push({key:d.key,callback:()=>t(d.view),options:{preventDefault:!0}});return f},[o,s,r,t,n,l,i]);m_(b?a:[])}function Pp(e){if(!e)return Dp;let p=new Set(e);return Dp.filter(b=>p.has(b.view))}function hu(e){return[{keys:"N",description:"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D"},{keys:"/",description:"\uAC80\uC0C9"},{keys:"R",description:"\uBAA9\uB85D \uC0C8\uB85C\uACE0\uCE68"},...Pp(e).map(p=>({keys:p.key.split(" ").map(b=>b.toUpperCase()).join(" \u2192 "),description:`${Ap[p.view]} \uBCF4\uAE30`})),{keys:"?",description:"\uB2E8\uCD95\uD0A4 \uB3C4\uC6C0\uB9D0"},{keys:"Esc",description:"\uB2EB\uAE30"}]}var Hz=hu();import{Box as _s,Button as g_}from"@mui/material";import b_ from"@mui/icons-material/ArrowRightAlt";import{FormDialog as y_}from"@ehfuse/mui-form-dialog";import{jsx as Io,jsxs as Np}from"react/jsx-runtime";function x_({keys:e}){return Io(_s,{sx:{display:"flex",alignItems:"center",gap:.5,justifyContent:"flex-end"},children:e.split(" \u2192 ").map((p,b)=>Np(_s,{sx:{display:"flex",alignItems:"center",gap:.5},children:[b>0?Io(b_,{sx:{fontSize:18,color:"#9a9a97"}}):null,Io(_s,{component:"span",sx:{minWidth:32,height:32,px:.75,display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:13.5,fontWeight:700,color:"#37352f",bgcolor:"#f4f4f2",border:"1px solid #e0dfdb",borderRadius:1,fontVariantNumeric:"tabular-nums"},children:p})]},`${p}-${b}`))})}function Yz({open:e,onClose:p,views:b}){let c=hu(b);return Io(y_,{open:e,onClose:p,maxWidth:"xs",title:"\uB2E8\uCD95\uD0A4",locale:"ko",titleIcons:{delete:{visible:!1}},tabs:{visible:!1},sections:[{id:"shortcuts",showTitle:!1,children:Io(_s,{sx:{display:"grid",gridTemplateColumns:"auto 1fr",columnGap:2,rowGap:1.25,alignItems:"center",fontSize:14,color:"#37352f"},children:c.map(o=>Np(_s,{sx:{display:"contents"},children:[Io(x_,{keys:o.keys}),Io("span",{children:o.description})]},o.keys))})}],actions:{showCancelButton:!1,right:Io(g_,{variant:"contained",onClick:p,children:"\uB2EB\uAE30"})}})}import{useEffect as v_,useState as pu}from"react";import{Box as hr,Button as Di,IconButton as jp,Switch as w_,Tooltip as __}from"@mui/material";import{FormDialog as k_}from"@ehfuse/mui-form-dialog";import S_ from"@mui/icons-material/EditOutlined";import{ErrorAlert as Lp}from"@ehfuse/alerts";import{ClearTextField as mu,LabelSelect as Pn}from"@ehfuse/mui-form-controls";import{jsx as Tt,jsxs as Lr}from"react/jsx-runtime";var Fp=[{value:"created",label:"\uC5C5\uBB34 \uB4F1\uB85D \uC2DC",hint:"\uC0C8 \uC5C5\uBB34\uAC00 \uB9CC\uB4E4\uC5B4\uC9C4 \uC9C1\uD6C4 \uD55C \uBC88"},{value:"status_changed",label:"\uC0C1\uD0DC \uBCC0\uACBD \uC2DC",hint:"\uC0C1\uD0DC\uAC00 \uC2E4\uC81C\uB85C \uBC14\uB010 \uC9C1\uD6C4"},{value:"overdue",label:"\uB9C8\uAC10 \uACBD\uACFC \uC2DC",hint:"\uB9C8\uAC10\uC774 \uC9C0\uB09C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uB97C \uC8FC\uAE30\uC801\uC73C\uB85C \uC810\uAC80"}],rl=[{value:"",label:"\uC9C0\uC815 \uC548 \uD568"},{value:"high",label:"\uB192\uC74C"},{value:"medium",label:"\uC911\uAC04"},{value:"low",label:"\uB0AE\uC74C"}];function el(){return{name:"",trigger:"created",enabled:!0,sort_no:0,condition:{},action:{}}}function tl(e){return xn.find(p=>p.key===e)?.name??e}function T_(e,p,b){let{condition:c,action:o}=e,s=[];if(c.group_seq){let l=p.find(i=>Mi(i.key)===c.group_seq);s.push(`\uD504\uB85C\uC81D\uD2B8=${l?.label??`#${c.group_seq}`}`)}c.is_bug===!0&&s.push("\uC624\uB958\uB9CC"),c.is_event===!0&&s.push("\uC77C\uC815\uB9CC"),c.priority&&s.push(`\uC911\uC694\uB3C4=${rl.find(l=>l.value===c.priority)?.label}`),c.label_key&&s.push(`\uB77C\uBCA8=${b.find(l=>l.key===c.label_key)?.name??c.label_key}`),c.status&&s.push(`\uC0C1\uD0DC=${tl(c.status)}`),c.from_status&&s.push(`${tl(c.from_status)}\uC5D0\uC11C`),c.to_status&&s.push(`${tl(c.to_status)}\uB85C`),c.manager_empty===!0&&s.push("\uCC45\uC784\uC790 \uC5C6\uC74C"),c.manager_empty===!1&&s.push("\uCC45\uC784\uC790 \uC788\uC74C"),typeof c.overdue_days=="number"&&s.push(`${c.overdue_days}\uC77C \uACBD\uACFC`);let r=[];o.set_status&&r.push(`\uC0C1\uD0DC \u2192 ${tl(o.set_status)}`),o.set_priority&&r.push(`\uC911\uC694\uB3C4 \u2192 ${rl.find(l=>l.value===o.set_priority)?.label}`),o.assign_manager_account_seq&&r.push(`\uCC45\uC784\uC790 \u2192 ${o.assign_manager_name||"\uC9C0\uC815"}`),o.add_receiver_account_seq&&r.push(`\uCC38\uC870\uC790 + ${o.add_receiver_name||"\uC9C0\uC815"}`),o.add_label_key&&r.push(`\uB77C\uBCA8 + ${b.find(l=>l.key===o.add_label_key)?.name??o.add_label_key}`),o.notify_account_seq&&r.push("\uC54C\uB9BC \uBC1C\uC1A1");let t=Fp.find(l=>l.value===e.trigger)?.label??e.trigger;return`${s.length>0?`${t} \xB7 ${s.join(", ")}`:t} \u2192 ${r.join(", ")||"\uB3D9\uC791 \uC5C6\uC74C"}`}function aq({open:e,rules:p,customTabs:b,statusOptions:c,onPickAccount:o,onClose:s,onCreate:r,onUpdate:t,onToggle:n,onRemove:l}){let[i,a]=pu(0),[f,d]=pu(el()),[u,g]=pu(!1);v_(()=>{e||(a(0),d(el()))},[e]);let m=i>0,v=f.trigger,k=(N,S)=>{d(T=>{let E={...T.condition};return S===""||S===void 0||S===null?delete E[N]:E[N]=S,{...T,condition:E}})},B=(N,S)=>{d(T=>{let E={...T.action};return S===""||S===void 0||S===null?delete E[N]:E[N]=S,{...T,action:E}})},A=async N=>{if(!o)return;let S=N==="manager"?f.action.assign_manager_account_seq:N==="receiver"?f.action.add_receiver_account_seq:f.action.notify_account_seq,T=await o(S??0);T&&d(E=>{let h={...E.action};return N==="manager"?(h.assign_manager_account_seq=T.accountSeq,h.assign_manager_name=T.name):N==="receiver"?(h.add_receiver_account_seq=T.accountSeq,h.add_receiver_name=T.name):h.notify_account_seq=T.accountSeq,{...E,action:h}})},L=async()=>{if(!f.name.trim()){Lp({message:"\uADDC\uCE59 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694."});return}if(Object.keys(f.action).length===0){Lp({message:"\uADDC\uCE59\uC774 \uD560 \uB3D9\uC791\uC744 \uD558\uB098 \uC774\uC0C1 \uC9C0\uC815\uD558\uC138\uC694."});return}g(!0);let N=m?await t(i,f):await r(f);g(!1),N&&(a(0),d(el()))},O=[{value:"",label:"\uC9C0\uC815 \uC548 \uD568"},...c.map(N=>({value:N.key,label:N.name}))],D=[{value:"",label:"\uC9C0\uC815 \uC548 \uD568"},...xn.map(N=>({value:N.key,label:N.name}))],j=[{value:"0",label:"\uC804\uCCB4"},...b.filter(N=>!N.archived).map(N=>({value:String(Mi(N.key)),label:N.label}))],z=(N,S)=>S?N||`\uACC4\uC815 #${S}`:"\uC120\uD0DD \uC548 \uD568";return Tt(k_,{open:e,onClose:s,maxWidth:"md",title:"\uC790\uB3D9\uD654 \uADDC\uCE59",locale:"ko",titleIcons:{delete:{visible:!1}},tabs:{visible:!0,switchContent:!0,fullWidth:!0},sections:[{id:"form",tabTitle:m?"\uADDC\uCE59 \uC218\uC815":"\uC0C8 \uADDC\uCE59",showTitle:!1,title:"",children:Lr(hr,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[Lr(hr,{sx:{display:"flex",gap:1.5,flexWrap:"wrap",alignItems:"flex-start"},children:[Tt(mu,{label:"\uADDC\uCE59 \uC774\uB984",value:f.name,onChange:N=>d(S=>({...S,name:N.target.value})),sx:{flex:"1 1 240px"}}),Tt(Pn,{label:"\uBC1C\uB3D9 \uC2DC\uC810",value:f.trigger,options:Fp.map(N=>({value:N.value,label:N.label})),onChange:N=>d(S=>({...S,trigger:N.target.value})),sx:{flex:"0 0 200px"}}),Tt(mu,{label:"\uC21C\uC11C",type:"number",value:String(f.sort_no),onChange:N=>d(S=>({...S,sort_no:Number(N.target.value)||0})),sx:{flex:"0 0 100px"}})]}),Lr(hr,{sx:{fontSize:13.5,fontWeight:700,color:"#37352f",mt:.5},children:["\uC870\uAC74 ",Tt(hr,{component:"span",sx:{fontWeight:400,color:"#787774"},children:"(\uC9C0\uC815\uD55C \uAC83\uB9CC, \uC804\uBD80 \uB9CC\uC871\uD574\uC57C \uC2E4\uD589)"})]}),Lr(hr,{sx:{display:"flex",gap:1.5,flexWrap:"wrap",alignItems:"flex-start"},children:[Tt(Pn,{label:"\uD504\uB85C\uC81D\uD2B8",value:String(f.condition.group_seq??0),options:j,onChange:N=>k("group_seq",Number(N.target.value)||""),sx:{flex:"1 1 180px"}}),Tt(Pn,{label:"\uC911\uC694\uB3C4",value:f.condition.priority??"",options:rl,onChange:N=>k("priority",N.target.value),sx:{flex:"1 1 150px"}}),Tt(Pn,{label:"\uB77C\uBCA8",value:f.condition.label_key??"",options:O,onChange:N=>k("label_key",N.target.value),sx:{flex:"1 1 150px"}}),Tt(Pn,{label:"\uCC45\uC784\uC790",value:f.condition.manager_empty===void 0?"":f.condition.manager_empty?"empty":"assigned",options:[{value:"",label:"\uC9C0\uC815 \uC548 \uD568"},{value:"empty",label:"\uC5C6\uC744 \uB54C"},{value:"assigned",label:"\uC788\uC744 \uB54C"}],onChange:N=>k("manager_empty",N.target.value===""?"":N.target.value==="empty"),sx:{flex:"1 1 150px"}})]}),v==="status_changed"?Lr(hr,{sx:{display:"flex",gap:1.5,flexWrap:"wrap",alignItems:"flex-start"},children:[Tt(Pn,{label:"\uC774 \uC0C1\uD0DC\uC5D0\uC11C",value:f.condition.from_status??"",options:D,onChange:N=>k("from_status",N.target.value),sx:{flex:"1 1 200px"}}),Tt(Pn,{label:"\uC774 \uC0C1\uD0DC\uB85C \uBC14\uB00C\uBA74",value:f.condition.to_status??"",options:D,onChange:N=>k("to_status",N.target.value),sx:{flex:"1 1 200px"}})]}):null,v==="overdue"?Tt(mu,{label:"\uB9C8\uAC10 \uD6C4 \uBA70\uCE60 \uC9C0\uB0AC\uC744 \uB54C\uBD80\uD130",type:"number",value:String(f.condition.overdue_days??0),onChange:N=>k("overdue_days",Math.max(0,Number(N.target.value)||0)),sx:{width:240}}):null,Lr(hr,{sx:{fontSize:13.5,fontWeight:700,color:"#37352f",mt:.5},children:["\uB3D9\uC791 ",Tt(hr,{component:"span",sx:{fontWeight:400,color:"#787774"},children:"(\uD558\uB098 \uC774\uC0C1 \uD544\uC694 \xB7 \uC774\uBBF8 \uADF8 \uAC12\uC774\uBA74 \uAC74\uB108\uB6F4\uB2E4)"})]}),Lr(hr,{sx:{display:"flex",gap:1.5,flexWrap:"wrap",alignItems:"flex-start"},children:[Tt(Pn,{label:"\uC0C1\uD0DC \uBCC0\uACBD",value:f.action.set_status??"",options:D,onChange:N=>B("set_status",N.target.value),sx:{flex:"1 1 180px"}}),Tt(Pn,{label:"\uC911\uC694\uB3C4 \uBCC0\uACBD",value:f.action.set_priority??"",options:rl,onChange:N=>B("set_priority",N.target.value),sx:{flex:"1 1 150px"}}),Tt(Pn,{label:"\uB77C\uBCA8 \uCD94\uAC00",value:f.action.add_label_key??"",options:O,onChange:N=>B("add_label_key",N.target.value),sx:{flex:"1 1 150px"}})]}),o?Lr(hr,{sx:{display:"flex",gap:1,flexWrap:"wrap",alignItems:"flex-start"},children:[Lr(Di,{variant:"outlined",size:"small",onClick:()=>{A("manager")},children:["\uCC45\uC784\uC790 \uC9C0\uC815: ",z(f.action.assign_manager_name,f.action.assign_manager_account_seq)]}),Lr(Di,{variant:"outlined",size:"small",onClick:()=>{A("receiver")},children:["\uCC38\uC870\uC790 \uCD94\uAC00: ",z(f.action.add_receiver_name,f.action.add_receiver_account_seq)]}),Lr(Di,{variant:"outlined",size:"small",onClick:()=>{A("notify")},children:["\uC54C\uB9BC \uB300\uC0C1: ",f.action.notify_account_seq?`\uACC4\uC815 #${f.action.notify_account_seq}`:"\uC120\uD0DD \uC548 \uD568"]})]}):null,Lr(hr,{sx:{display:"flex",gap:1,justifyContent:"flex-end"},children:[m?Tt(Di,{color:"inherit",onClick:()=>{a(0),d(el())},children:"\uCDE8\uC18C"}):null,Tt(Di,{variant:"contained",onClick:()=>{L()},disabled:u,children:m?"\uC218\uC815":"\uADDC\uCE59 \uCD94\uAC00"})]})]})},{id:"list",tabTitle:`\uB4F1\uB85D\uB41C \uADDC\uCE59 (${p.length})`,showTitle:!1,title:"",children:p.length===0?Tt(hr,{sx:{py:3,textAlign:"center",color:"#9a9a97",fontSize:14},children:"\uC544\uC9C1 \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uC704\uC5D0\uC11C \uB9CC\uB4E4\uC5B4 \uBCF4\uC138\uC694."}):Tt(hr,{sx:{display:"flex",flexDirection:"column"},children:p.map(N=>Lr(hr,{sx:{display:"flex",alignItems:"center",gap:1,py:1,borderBottom:"1px solid #ececea",opacity:N.enabled?1:.5},children:[Tt(__,{title:N.enabled?"\uC0AC\uC6A9 \uC911":"\uAEBC\uC9D0",arrow:!0,disableInteractive:!0,children:Tt(w_,{size:"small",checked:N.enabled,onChange:(S,T)=>n(N.seq,T)})}),Lr(hr,{sx:{flex:1,minWidth:0},children:[Tt(hr,{sx:{fontSize:14,fontWeight:600,color:"#37352f"},children:N.name}),Tt(hr,{sx:{fontSize:13,color:"#6f6f6c"},children:T_(N,b,c)})]}),Tt(jp,{size:"small",onClick:()=>{a(N.seq),d({name:N.name,trigger:N.trigger,enabled:N.enabled,sort_no:N.sort_no,condition:{...N.condition},action:{...N.action}})},children:Tt(S_,{sx:{fontSize:18}})}),Tt(jp,{size:"small",onClick:()=>l(N.seq),children:Tt(Zr,{sx:{fontSize:18}})})]},N.seq))})}],actions:{showCancelButton:!1,right:Tt(Di,{variant:"contained",onClick:s,children:"\uB2EB\uAE30"})}})}var C_={urgent:"\uAE34\uAE09",high:"\uB192\uC74C",normal:"\uC911\uAC04",low:"\uB0AE\uC74C"};function B_(e){return e.length===0?"":e.length<=2?e.join(", "):`${e[0]} \uC678 ${e.length-1}\uBA85`}function gu(e){let p=String(e??"").trim().slice(0,10);return/^\d{4}-\d{2}-\d{2}$/.test(p)?`${p.slice(2,4)}.${p.slice(5,7)}.${p.slice(8,10)}`:"-"}function Pi(e){let p=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())} ${p(e.getHours())}:${p(e.getMinutes())}`}function bu(e,p){let c=String(e.due_date??"").slice(11,16).trim()||String(e.estimated_time??"").trim(),o=gu(e.due_date),s=String(e.start_date??"").slice(11,16).trim(),r=gu(e.start_date),t=(e.receiver_names??[]).filter(Boolean).map(l=>String(l).trim()),n=(e.checklist??[]).length?`${(e.checklist??[]).filter(l=>l.checked).length}/${(e.checklist??[]).length}`:"";return{seq:Number(e.seq??0),title:String(e.title??"").trim(),statusName:ir(e).name,projectLabel:e.tab_key?p.get(String(e.tab_key))??"":"",managerName:String(e.manager_name??"").trim(),receiverNames:B_(t),receiverNamesFull:t.join(", "),startDate:r!=="-"&&s?`${r} ${s}`:r,dueDate:o!=="-"&&c?`${o} ${c}`:o,priorityName:C_[String(e.priority??"")]??"",checklist:n,note:String(e.note??"").trim(),completed:!!e.completed}}function Ct(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function I_(e,p){if(e===" ")return p*.3;let b=e.codePointAt(0)??0,c=b>=4352&&b<=4607||b>=12288&&b<=40959||b>=44032&&b<=55203||b>=63744&&b<=64255||b>=65280&&b<=65519;return p*(c?1:.55)}function nl(e,p){let b=0;for(let c of String(e??""))b+=I_(c,p);return b}function Ni(e,p){let b=String(e??"").trim();if(!b)return["-"];let c=[],o="";for(let s of b){if(s===`
42
42
  `){o&&c.push(o),o="";continue}let r=`${o}${s}`;if(r.length>p&&o){c.push(o),o=s;continue}o=r}return o&&c.push(o),c.length>0?c:["-"]}function ti(e,p,b){let c=String(e??"").replace(/\s+/g," ").trim();if(!c)return"";if(nl(c,b)<=p)return c;let o=nl("\u2026",b),s="",r=0;for(let t of c){let n=nl(t,b);if(r+n+o>p)break;s+=t,r+=n}return`${s}\u2026`}var Ss=595.28,Ts=841.89,Cs=841.89,Bs=595.28,_r=28,rn=96,Ur=44,M_="'Malgun Gothic','\uB9D1\uC740 \uACE0\uB515','Apple SD Gothic Neo','Noto Sans KR',sans-serif",E_="'Batang','\uBC14\uD0D5','AppleMyungjo','Noto Serif KR',serif",ks="#cbd5e1",R_=[`text { font-family: ${M_}; fill: #000000; }`,`.doc-title { font-family: ${E_}; font-size: 20px; font-weight: 700; }`,".doc-sub { font-size: 10.5px; fill: #333333; }",".doc-meta { font-size: 9.5px; fill: #333333; }",".th { font-size: 9.5px; font-weight: 700; fill: #000000; }",".td { font-size: 9px; }",".td.done { fill: #555555; }",".gt { font-size: 10px; font-weight: 700; fill: #000000; }",".label { font-size: 9px; fill: #333333; }",".value { font-size: 10px; }",".section { font-size: 11.5px; font-weight: 700; fill: #000000; }",".pageno { font-size: 9px; fill: #333333; }",`.head { fill: #eef2f7; stroke: ${ks}; stroke-width: 0.5; }`,`.group { fill: #f8fafc; stroke: ${ks}; stroke-width: 0.5; }`,`.frame { fill: none; stroke: ${ks}; stroke-width: 0.5; }`,`.hline { stroke: ${ks}; stroke-width: 0.5; }`,`.vline { stroke: ${ks}; stroke-width: 0.5; }`,".bar { fill: #bfdbfe; stroke: #60a5fa; stroke-width: 0.6; }",".bar.done { fill: #e5e7eb; stroke: #cbd5e1; }",".bar.overdue { fill: #fecaca; stroke: #f87171; }"].join("");function co(e,p,b){let c=b-_r;return[`<text x="${_r}" y="46" class="doc-title">${Ct(e.documentTitle)}</text>`,`<text x="${_r}" y="66" class="doc-sub">${Ct(e.subtitle)}</text>`,`<text x="${c}" y="42" class="doc-meta" text-anchor="end">${Ct(e.facilityName)}</text>`,`<text x="${c}" y="58" class="doc-meta" text-anchor="end">\uCD9C\uB825 ${Ct(Pi(e.printedAt))}${e.printedBy?` \xB7 ${Ct(e.printedBy)}`:""}</text>`,p?`<text x="${c}" y="74" class="doc-meta" text-anchor="end">${Ct(p)}</text>`:""].join("")}function uo(e){let{width:p,height:b,body:c,pageIndex:o,pageCount:s}=e;return[`<svg xmlns="http://www.w3.org/2000/svg" width="${p}" height="${b}" viewBox="0 0 ${p} ${b}">`,`<style>${R_}</style>`,`<rect x="0" y="0" width="${p}" height="${b}" fill="#ffffff" />`,c,`<text x="${p/2}" y="${b-22}" class="pageno" text-anchor="middle">${o+1} / ${s}</text>`,"</svg>"].join("")}var xu=Cs,qp=Bs,fo=_r,Is=xu-_r,Es=22,ri=20,ni=22,Ms=5,$p=rn,Hp=Ur,zp=qp-46,Rs=[{key:"title",label:"\uC81C\uBAA9",width:250,align:"start"},{key:"status",label:"\uC0C1\uD0DC",width:56,align:"middle"},{key:"start",label:"\uC2DC\uC791",width:86,align:"middle"},{key:"due",label:"\uB9C8\uAC10",width:86,align:"middle"},{key:"manager",label:"\uCC45\uC784\uC790",width:62,align:"middle"},{key:"receivers",label:"\uCC38\uC870\uC790",width:122,align:"start"},{key:"priority",label:"\uC911\uC694\uB3C4",width:52,align:"middle"},{key:"project",label:"\uD504\uB85C\uC81D\uD2B8",width:72,align:"middle"}],yu=Rs.reduce((e,p,b)=>(e.push(b===0?fo:e[b-1]+Rs[b-1].width),e),[]);function O_(e){let p=[],b=[],c=$p+Es,o=(s,r)=>{p.push(b),b=[],c=Hp+Es,s&&(b.push({kind:"group",label:s,count:r,continued:!0}),c+=ni)};for(let s of e){s.label&&(c+ni+ri>zp&&o("",0),b.push({kind:"group",label:s.label,count:s.rows.length,continued:!1}),c+=ni);for(let r of s.rows)c+ri>zp&&o(s.label,s.rows.length),b.push({kind:"row",completed:r.completed,values:Rs.map(t=>{switch(t.key){case"title":return r.title;case"status":return r.statusName;case"project":return r.projectLabel||"\uAE30\uBCF8";case"manager":return r.managerName||"-";case"receivers":return r.receiverNames||"-";case"start":return r.startDate;case"due":return r.dueDate;default:return r.priorityName||"-"}})}),c+=ri}return p.push(b),p.filter((s,r)=>r===0||s.length>0)}function A_(e,p){let b=[];b.push(`<rect x="${fo}" y="${p}" width="${Is-fo}" height="${Es}" class="head" />`),Rs.forEach((o,s)=>{let r=yu[s],t=o.align==="middle"?r+o.width/2:r+Ms;b.push(`<text x="${t}" y="${p+Es-7}" class="th" text-anchor="${o.align}">${Ct(o.label)}</text>`)});let c=p+Es;for(let o of e){if(o.kind==="group"){b.push(`<rect x="${fo}" y="${c}" width="${Is-fo}" height="${ni}" class="group" />`,`<text x="${fo+Ms}" y="${c+ni-7}" class="gt">${Ct(o.continued?`${o.label} (\uC774\uC5B4\uC11C)`:o.label)}</text>`,`<text x="${Is-Ms}" y="${c+ni-7}" class="gt" text-anchor="end">${o.count}\uAC74</text>`),c+=ni;continue}Rs.forEach((s,r)=>{let t=yu[r],n=s.align==="middle"?t+s.width/2:t+Ms;b.push(`<text x="${n}" y="${c+ri-6}" class="${o.completed?"td done":"td"}" text-anchor="${s.align}">${Ct(ti(o.values[r]??"",s.width-Ms*2,9))}</text>`)}),b.push(`<line x1="${fo}" y1="${c+ri}" x2="${Is}" y2="${c+ri}" class="hline" />`),c+=ri}return yu.slice(1).forEach(o=>{b.push(`<line x1="${o}" y1="${p}" x2="${o}" y2="${c}" class="vline" />`)}),b.push(`<rect x="${fo}" y="${p}" width="${Is-fo}" height="${c-p}" class="frame" />`),b.join("")}async function D_(e,p){let b=O_(p),c=p.reduce((o,s)=>o+s.rows.length,0);return b.map((o,s)=>{let r=s===0?$p:Hp,t=[s===0?co(e,`\uC804\uCCB4 ${c}\uAC74`,xu):"",A_(o,r)].join("");return uo({width:xu,height:qp,body:t,pageIndex:s,pageCount:b.length})})}var wu=Ss,Wp=Ts,Nn=_r,ol=wu-_r,P_=Wp-46,Up=22,N_=68,j_=(ol-Nn)/2,L_=14,vu=58;function ji(e){switch(e.kind){case"title":return 34;case"props":return Math.ceil(e.pairs.length/2)*Up+10;case"section":return 26;default:return L_}}function F_(e){let p=[{kind:"title",text:e.title,ticket:e.ticketNo}];return p.push({kind:"props",pairs:e.properties}),p.push({kind:"section",text:"\uB0B4\uC6A9"}),(e.content.trim()?e.content.split(`
43
43
  `).flatMap(c=>c.trim()?Ni(c,vu):[""]):["(\uB0B4\uC6A9 \uC5C6\uC74C)"]).forEach(c=>p.push({kind:"line",text:c,muted:!e.content.trim()})),e.checklist.length>0&&(p.push({kind:"section",text:`\uD560\uC77C (${e.checklist.filter(c=>c.checked).length}/${e.checklist.length})`}),e.checklist.forEach(c=>{Ni(c.label,vu-3).forEach((o,s)=>p.push({kind:s===0?"check":"line",text:o,checked:c.checked}))})),e.includeComments&&e.comments.length>0&&(p.push({kind:"section",text:`\uB313\uAE00 (${e.comments.length})`}),e.comments.forEach(c=>{p.push({kind:"line",text:`${c.author} \xB7 ${c.time}`,muted:!0}),Ni(c.text,vu).forEach(o=>p.push({kind:"line",text:o}))})),p}function z_(e){let p=[],b=[],c=rn;for(let o of e){let s=ji(o);c+s>P_&&(p.push(b),b=[],c=Ur),b.push(o),c+=s}return p.push(b),p}function q_(e,p){switch(e.kind){case"title":{let b=e.ticket?`<text x="${ol}" y="${p+16}" class="doc-meta" text-anchor="end">${Ct(e.ticket)}</text>`:"";return{markup:`<text x="${Nn}" y="${p+16}" class="section" style="font-size:14px">${Ct(e.text)}</text>${b}<line x1="${Nn}" y1="${p+24}" x2="${ol}" y2="${p+24}" class="hline" />`,nextY:p+ji(e)}}case"props":{let b=[];return e.pairs.forEach((c,o)=>{let s=o%2,r=Math.floor(o/2),t=Nn+s*j_,n=p+r*Up;b.push(`<text x="${t}" y="${n+14}" class="label">${Ct(c.label)}</text>`,`<text x="${t+N_}" y="${n+14}" class="value">${Ct(Ni(c.value||"-",26)[0]??"-")}</text>`)}),{markup:b.join(""),nextY:p+ji(e)}}case"section":return{markup:`<text x="${Nn}" y="${p+16}" class="section">${Ct(e.text)}</text><line x1="${Nn}" y1="${p+21}" x2="${ol}" y2="${p+21}" class="hline" />`,nextY:p+ji(e)};case"check":return{markup:`<text x="${Nn}" y="${p+10}" class="td">${e.checked?"\u2611":"\u2610"}</text><text x="${Nn+14}" y="${p+10}" class="${e.checked?"td done":"td"}">${Ct(e.text)}</text>`,nextY:p+ji(e)};default:return{markup:`<text x="${Nn}" y="${p+10}" class="${e.muted?"td done":"td"}">${Ct(e.text)}</text>`,nextY:p+ji(e)}}}async function $_(e,p){let b=z_(F_(p));return b.map((c,o)=>{let s=o===0?rn:Ur,r=[o===0?co(e,"",wu):`<text x="${Nn}" y="${Ur-12}" class="doc-meta">${Ct(`${p.title} (\uC774\uC5B4\uC11C)`)}</text>`];for(let t of c){let n=q_(t,s);r.push(n.markup),s=n.nextY}return uo({width:wu,height:Wp,body:r.join(""),pageIndex:o,pageCount:b.length})})}var ku=Cs,Gp=Bs,il=_r,Os=ku-_r,Vp=Gp-46,Kp=210,Mo=20,_u=24;function Eo(e){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))return null;let p=new Date(`${e}T00:00:00`);return Number.isNaN(p.getTime())?null:p}function Yp(e,p){return Math.round((p.getTime()-e.getTime())/864e5)}function H_(e,p){let b=[];e.forEach(r=>{let t=Eo(r.startDate),n=Eo(r.dueDate);t&&b.push(t),n&&b.push(n)});let c=Eo(p)??new Date;if(b.length===0)return{start:c,days:30};let o=new Date(Math.min(...b.map(r=>r.getTime()))),s=new Date(Math.max(...b.map(r=>r.getTime())));return o.setDate(o.getDate()-1),s.setDate(s.getDate()+1),{start:o,days:Math.max(7,Yp(o,s)+1)}}async function W_(e,p,b){let c=H_(p,b),o=il+Kp,r=(Os-o)/c.days,t=Eo(b),n=d=>o+Yp(c.start,d)*r,l=Math.max(1,Math.floor((Vp-rn-_u)/Mo)),i=Math.max(1,Math.floor((Vp-Ur-_u)/Mo)),a=[],f=0;for(;f<p.length||a.length===0;){let d=a.length===0?l:i;if(a.push(p.slice(f,f+d)),f+=d,f>=p.length)break}return a.map((d,u)=>{let g=u===0?rn:Ur,m=[u===0?co(e,`\uC804\uCCB4 ${p.length}\uAC74`,ku):""],v=g+_u;m.push(`<line x1="${il}" y1="${v}" x2="${Os}" y2="${v}" class="vline" />`);for(let k=0;k<c.days;k+=1){let B=new Date(c.start);if(B.setDate(B.getDate()+k),B.getDay()!==0&&k!==0)continue;let A=o+k*r;m.push(`<line x1="${A}" y1="${v}" x2="${A}" y2="${v+d.length*Mo}" class="hline" />`,`<text x="${A+2}" y="${v-6}" class="label">${B.getMonth()+1}.${B.getDate()}</text>`)}if(t&&t>=c.start){let k=n(t);k>=o&&k<=Os&&m.push(`<line x1="${k}" y1="${v}" x2="${k}" y2="${v+d.length*Mo}" stroke="#f87171" stroke-width="0.8" />`)}return d.forEach((k,B)=>{let A=v+B*Mo,L=ti(k.title,Kp-64,9);m.push(`<text x="${il}" y="${A+14}" class="${k.completed?"td done":"td"}">${Ct(L)}</text>`,`<text x="${o-6}" y="${A+14}" class="label" text-anchor="end">${Ct(k.managerName)}</text>`,`<line x1="${il}" y1="${A+Mo}" x2="${Os}" y2="${A+Mo}" class="hline" />`);let O=Eo(k.startDate)??Eo(k.dueDate),D=Eo(k.dueDate)??Eo(k.startDate);if(!O||!D)return;let j=n(O),z=Math.max(j+r*.8,n(D)+r*.8),N=k.completed?"bar done":k.overdue?"bar overdue":"bar";m.push(`<rect x="${j}" y="${A+5}" width="${Math.max(3,Math.min(z,Os)-j)}" height="${Mo-10}" rx="2" class="${N}" />`)}),uo({width:ku,height:Gp,body:m.join(""),pageIndex:u,pageCount:a.length})})}function U_(e,p,b,c){return{title:e.title,managerName:e.managerName,startDate:String(p??"").slice(0,10),dueDate:String(b??"").slice(0,10),completed:e.completed,overdue:!e.completed&&!!b&&String(b).slice(0,10)<c}}var Su=Ss,Zp=Ts,Li=_r,sl=Su-_r,Xp=Zp-46,Fi=30,zi=18,Jp=12;function V_(e){let p=[],b=[],c=rn,o=(s,r)=>{p.push(b),b=[],c=Ur,s&&(b.push({kind:"column",label:s,summary:r,continued:!0,gapBefore:!1}),c+=Fi)};for(let s of e){let r=b.length>0,t=r?Jp:0;if(c+t+Fi+zi>Xp?(o("",""),b.push({kind:"column",label:s.label,summary:s.summary,continued:!1,gapBefore:!1}),c+=Fi):(b.push({kind:"column",label:s.label,summary:s.summary,continued:!1,gapBefore:r}),c+=t+Fi),s.items.length===0){b.push({kind:"empty"}),c+=zi;continue}for(let n of s.items)c+zi>Xp&&o(s.label,s.summary),b.push({kind:"item",title:n.title,meta:n.meta,completed:n.completed}),c+=zi}return p.push(b),p}async function K_(e,p,b){let c=V_(p);return c.map((o,s)=>{let r=s===0?rn:Ur,t=[s===0?co(e,b,Su):""];for(let n of o){if(n.kind==="column"){n.gapBefore&&(r+=Jp),t.push(`<rect x="${Li}" y="${r}" width="${sl-Li}" height="${Fi-6}" class="group" />`,`<text x="${Li+6}" y="${r+16}" class="gt">${Ct(n.continued?`${n.label} (\uC774\uC5B4\uC11C)`:n.label)}</text>`,`<text x="${sl-6}" y="${r+16}" class="label" text-anchor="end">${Ct(n.summary)}</text>`),r+=Fi;continue}if(n.kind==="empty"){t.push(`<text x="${Li+12}" y="${r+12}" class="td done">(\uC5C5\uBB34 \uC5C6\uC74C)</text>`),r+=zi;continue}t.push(`<text x="${Li+12}" y="${r+12}" class="${n.completed?"td done":"td"}">${Ct(ti(n.title,sl-Li-12-120,9))}</text>`,`<text x="${sl-6}" y="${r+12}" class="label" text-anchor="end">${Ct(n.meta)}</text>`),r+=zi}return uo({width:Su,height:Zp,body:t.join(""),pageIndex:s,pageCount:c.length})})}var G_=[{header:"\uADF8\uB8F9",width:16},{header:"\uC81C\uBAA9",width:44},{header:"\uC0C1\uD0DC",width:10},{header:"\uD504\uB85C\uC81D\uD2B8",width:14},{header:"\uCC45\uC784\uC790",width:10},{header:"\uCC38\uC870\uC790",width:22},{header:"\uC2DC\uC791",width:12},{header:"\uB9C8\uAC10",width:14},{header:"\uC911\uC694\uB3C4",width:8},{header:"\uD560\uC77C",width:8},{header:"\uBE44\uACE0",width:30}],Y_="FFEEF2F7",al="FFCBD5E1";function X_(e){return e.replace(/[\\/:*?"<>|]/g,"_").trim()||"\uC5C5\uBB34\uBAA9\uB85D"}async function Z_(e,p){let b=await Promise.resolve().then(()=>lm(em(),1)),c=new b.Workbook,o=c.addWorksheet("\uC5C5\uBB34\uBAA9\uB85D",{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0,fitToWidth:1,fitToHeight:0}});o.columns=G_.map(i=>({header:i.header,width:i.width})),o.spliceRows(1,0,[`${e.documentTitle}`],[`${e.subtitle} \xB7 ${e.facilityName} \xB7 \uCD9C\uB825 ${Pi(e.printedAt)}${e.printedBy?` \xB7 ${e.printedBy}`:""}`]),o.getRow(1).font={bold:!0,size:14},o.getRow(2).font={size:10,color:{argb:"FF6B7280"}};let s=o.getRow(3);s.font={bold:!0,size:10},s.eachCell(i=>{i.fill={type:"pattern",pattern:"solid",fgColor:{argb:Y_}},i.alignment={vertical:"middle",horizontal:"center"}}),p.forEach(i=>{i.rows.forEach(a=>{let f=o.addRow([i.label,a.title,a.statusName,a.projectLabel||"\uAE30\uBCF8",a.managerName,a.receiverNamesFull,a.startDate==="-"?"":a.startDate,a.dueDate==="-"?"":a.dueDate,a.priorityName,a.checklist,a.note]);f.font={size:10,color:{argb:a.completed?"FF9CA3AF":"FF111827"}},f.alignment={vertical:"middle",wrapText:!1}})});let r=o.rowCount;for(let i=3;i<=r;i+=1)o.getRow(i).eachCell({includeEmpty:!0},a=>{a.border={top:{style:"thin",color:{argb:al}},left:{style:"thin",color:{argb:al}},bottom:{style:"thin",color:{argb:al}},right:{style:"thin",color:{argb:al}}}});o.views=[{state:"frozen",ySplit:3}];let t=await c.xlsx.writeBuffer(),n=new Blob([t],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),l=Pi(e.printedAt).replace(/[: ]/g,"").slice(0,13);return{blob:n,fileName:`${X_(e.documentTitle)}_${l}.xlsx`}}function J_(e){return String(e??"").replace(/<br\s*\/?>(?=.)/gi,`
44
44
  `).replace(/<\/(p|div|li|h[1-6])>/gi,`