@ehfuse/taskbox 0.5.260 → 0.5.261

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 _5(e){let p=[`[\uC5C5\uBB34] ${e.title}`],b=fn(e.start_date),l=fn(e.due_date);(b||l)&&p.push(`\uAE30\uAC04: ${b&&l?`${b} ~ ${l}`:b||l}`),e.manager_name&&p.push(`\uCC45\uC784\uC790: ${e.manager_name}`);let i=cr(e).name;i&&p.push(`\uC0C1\uD0DC: ${i}`);let s=lp(e.content);s&&p.push("",s);let r=String(e.note??"").trim();return r&&p.push("",`\uBE44\uACE0: ${r}`),p.join(`
41
- `)}function cp(e){navigator.clipboard.writeText(e).then(()=>w5("\uC5C5\uBB34 \uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>v5("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uB0B4\uC6A9\uC744 \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD574 \uC8FC\uC138\uC694."))}function Yi(e,p){let b=_5(e);if(p&&typeof navigator.share=="function"){navigator.share({text:b}).catch(l=>{l?.name!=="AbortError"&&cp(b)});return}cp(b)}import{Fragment as E5,jsx as Bt,jsxs as up}from"react/jsx-runtime";function fp({task:e,myAccountSeq:p=0,onToggleCompleted:b,onChangeTitle:l,onChangeIcon:i,onChangeIconColor:s,onClose:r,appBarMode:t=!1,activityItems:n,activityLoading:c,onLoadActivity:o,onPrint:a,onDelete:f,canDelete:d}){let u=Nt(),[g,m]=zs(!1),[x,_]=zs(null),[B,O]=zs(null),[j,D]=zs(null),[P,L]=zs(null),q=!!e.is_notice,N=!!e.is_event,S=q?_t(e.icon||nr):N?_t(e.icon||lr):null,C=q&&p>0&&(e.author_account_seq??0)===p,M=!io(e,p),h=!!f&&(d??(p>0&&(e.author_account_seq??0)===p)),y=!N&&(q?C:(e.author_account_seq??0)===p||(e.manager_account_seq??0)===p);return up(E5,{children:[up(Xi,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[t&&r?Bt(Zi,{"aria-label":"\uB4A4\uB85C",onClick:r,sx:{color:"#37352f",ml:-1},children:Bt(T5,{})}):null,y&&!t?Bt(Ji,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${rn(e.completed_time)} \uC644\uB8CC`:"",arrow:!0,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:Bt(Xi,{sx:{display:"flex",flexShrink:0,mr:1},children:Bt(Pn,{onClick:v=>L({anchorEl:v.currentTarget,nextCompleted:!e.completed}),children:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC\uD558\uAE30"})})}):null,t||!S?null:N&&!M?Bt(Ji,{title:"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,enterDelay:400,disableInteractive:!0,children:Bt(k5,{onClick:v=>O(v.currentTarget),sx:{display:"flex",p:.5,borderRadius:1,color:e.icon_color||"#1e3a8a","&:hover":{bgcolor:"#f2f2f0"}},children:Bt(S,{sx:{fontSize:20}})})}):Bt(Xi,{sx:{display:"flex",px:.5,color:e.icon_color||(q?"#e5484d":"#1e3a8a")},children:Bt(S,{sx:{fontSize:20}})}),x!==null?Bt(Xi,{component:"input",autoFocus:!0,spellCheck:!1,value:x,onChange:v=>_(v.target.value),onBlur:()=>{x.trim()&&x.trim()!==e.title&&l(e.seq,x.trim()),_(null)},onKeyDown:v=>{v.key==="Enter"&&v.target.blur(),v.key==="Escape"&&_(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0}}):t?Bt(Xi,{sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:q?"\uACF5\uC9C0":N?"\uC77C\uC815":e.is_bug?"\uC624\uB958":"\uC5C5\uBB34"}):Bt(Xi,{onClick:M?void 0:()=>_(e.title),sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:M?"default":"text",textDecoration:e.completed?"line-through":"none"},children:e.title}),o?Bt(Ji,{title:"\uD65C\uB3D9",arrow:!0,children:Bt(Zi,{"aria-label":"\uD65C\uB3D9",onClick:()=>m(!0),sx:{color:"#6b7280"},children:Bt(I5,{sx:{fontSize:20}})})}):null,Bt(Ji,{title:u?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:Bt(Zi,{"aria-label":u?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>Yi(e,u),sx:{color:"#6b7280"},children:u?Bt(C5,{sx:{fontSize:20}}):Bt(B5,{sx:{fontSize:20}})})}),a?Bt(Ji,{title:"\uC778\uC1C4",arrow:!0,children:Bt(Zi,{"aria-label":"\uC778\uC1C4",onClick:()=>a(e),sx:{color:"#6b7280"},children:Bt(M5,{sx:{fontSize:20}})})}):null,h?Bt(Ji,{title:"\uC0AD\uC81C",arrow:!0,children:Bt(Zi,{"aria-label":"\uC0AD\uC81C",onClick:v=>D(v.currentTarget),sx:{color:"#6b7280","&:hover":{color:"#e5484d"}},children:Bt(ur,{sx:{fontSize:20}})})}):null,r&&!t?Bt(Zi,{"aria-label":"\uB2EB\uAE30",onClick:r,sx:{color:"#6b7280"},children:Bt(S5,{})}):null]}),Bt(At,{open:!!P,anchorEl:P?.anchorEl??null,title:P?.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:P?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>L(null),onConfirm:()=>{P&&b(e.seq,P.nextCompleted),L(null)}}),Bt(Lo,{anchorEl:B,value:e.icon??"",color:e.icon_color??"",onSelect:v=>{i(e.seq,v),O(null)},onSelectColor:s?v=>s(e.seq,v):void 0,onClose:()=>O(null)}),Bt(At,{open:!!j,anchorEl:j,title:"\uC774 \uC5C5\uBB34\uB97C \uD734\uC9C0\uD1B5\uC73C\uB85C \uBCF4\uB0B4\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uC0AD\uC81C",onCancel:()=>D(null),onConfirm:()=>{D(null),f?.(e)}}),Bt(Sl,{open:g,taskSeq:e.seq,items:n,loading:c,onLoad:o,onClose:()=>m(!1)})]})}import{useState as gn}from"react";import{Box as Zt,Button as Qi,ButtonBase as bp,Checkbox as F5,Divider as gi,Menu as Bu,MenuItem as Iu}from"@mui/material";import q5 from"@mui/icons-material/ExpandLess";import $5 from"@mui/icons-material/ExpandMore";import H5 from"@mui/icons-material/ConfirmationNumberOutlined";import yp from"@mui/icons-material/Check";import W5 from"@mui/icons-material/DirectionsRunOutlined";import U5 from"@mui/icons-material/SpeedOutlined";import Mu from"@mui/icons-material/CheckCircle";import V5 from"@mui/icons-material/CheckCircleOutlineOutlined";import Eu from"@mui/icons-material/CheckCircleOutlined";import xp from"@mui/icons-material/AccessTimeOutlined";import K5 from"@mui/icons-material/AutorenewOutlined";import G5 from"@mui/icons-material/LabelOutlined";import Y5 from"@mui/icons-material/PersonOutlineOutlined";import X5 from"@mui/icons-material/SubjectOutlined";import Z5 from"@mui/icons-material/StickyNote2Outlined";import J5 from"@mui/icons-material/PanToolAltOutlined";import vp from"@mui/icons-material/LockOutlined";import wp from"@mui/icons-material/PublicOutlined";import _p from"@mui/icons-material/Group";import Q5 from"@mui/icons-material/Repeat";import e4 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as kp,InfoAlert as t4}from"@ehfuse/alerts";import{DatePicker as r4}from"@ehfuse/mui-datetime-picker";import{useState as R5}from"react";import{TextField as O5}from"@ehfuse/mui-form-controls";import{jsx as A5}from"react/jsx-runtime";function dp({value:e,onCommit:p,onDraftChange:b,readOnly:l=!1}){let[i,s]=R5(null);return A5(O5,{value:i??e,placeholder:l?"":"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",slotProps:{input:{readOnly:l}},onChange:r=>{s(r.target.value),b?.(r.target.value)},onBlur:()=>{i!==null&&i.trim()!==e&&p(i),s(null)},onKeyDown:r=>{r.key==="Enter"&&r.target.blur(),r.key==="Escape"&&s(null)},sx:{mt:1}})}import{useMemo as Su,useState as Tu}from"react";import{Box as Rr,Button as mp,IconButton as D5}from"@mui/material";import P5 from"@mui/icons-material/AccountTreeOutlined";import N5 from"@mui/icons-material/LinkOutlined";import L5 from"@mui/icons-material/Close";import j5 from"@mui/icons-material/RedoOutlined";function mi(e){return e.relations??[]}function gj(e,p,b){return mi(e).some(l=>l.type===b&&l.task_seq===p.seq)||mi(p).some(l=>l.type===b&&l.task_seq===e.seq)}function hp(e){return`${e.created_time??""}|${String(e.seq).padStart(12,"0")}`}function _u(e,p){let b=new Map(p.map(d=>[d.seq,d]));b.set(e.seq,e);let l=new Map,i=(d,u)=>{l.has(d)||l.set(d,new Set),l.has(u)||l.set(u,new Set),l.get(d).add(u),l.get(u).add(d)};for(let d of b.values())for(let u of mi(d))u.type==="follow_up"&&b.has(u.task_seq)&&i(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 l.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)=>hp(d).localeCompare(hp(u))),n=new Set;for(let d of mi(e))d.type==="related"&&n.add(d.task_seq);for(let d of b.values())d.seq!==e.seq&&mi(d).some(u=>u.type==="related"&&u.task_seq===e.seq)&&n.add(d.seq);let c=[...n].map(d=>b.get(d)).filter(d=>d!==void 0&&d.seq!==e.seq),o=[...b.values()].filter(d=>d.seq!==e.seq&&mi(d).some(u=>u.type==="duplicate_of"&&u.task_seq===e.seq)),a=mi(e).find(d=>d.type==="duplicate_of")?.task_seq,f=a?b.get(a)??null:null;return{lineage:t,related:c,duplicates:o,duplicateOf:f}}function ku(e,p){let b=_u(e,p);return(b.lineage.length>=2?b.lineage.length-1:0)+b.related.length+b.duplicates.length+(b.duplicateOf?1:0)}function pp(e,p){return ku(e,p)>0}import{Fragment as z5,jsx as Xt,jsxs as Mn}from"react/jsx-runtime";function Cu({item:e,caption:p,onOpen:b,onUnlink:l}){let i=e.is_notice||e.is_event?_t(e.icon||(e.is_notice?nr:lr)):null;return Mn(Rr,{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?Xt(Rr,{component:"span",sx:{flexShrink:0,px:.6,py:.1,borderRadius:.75,fontSize:11.5,fontWeight:500,color:"#8a6d1d",bgcolor:"#faf1d7"},children:p}):null,i?Xt(i,{sx:{fontSize:16,flexShrink:0,color:e.icon_color||"#1e3a8a"}}):null,Mn(Rr,{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]}),Xt(Ot,{option:cr(e),small:!0}),l?Xt(D5,{className:"taskbox-relation-unlink",size:"small","aria-label":"\uC5F0\uACB0 \uD574\uC81C",onClick:l,sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:Xt(L5,{sx:{fontSize:15}})}):null]})}function gp({task:e,tasks:p,readOnly:b=!1,onOpenTask:l,onLink:i,onUnlink:s,onCreateFollowUp:r}){let[t,n]=Tu(!1),[c,o]=Tu(null),[a,f]=Tu(null),d=Su(()=>_u(e,p),[e,p]),u=d.lineage.length>=2,g=Su(()=>ku(e,p),[e,p]),m=Su(()=>{let _=new Set;for(let B of d.lineage)_.add(B.seq);for(let B of d.related)_.add(B.seq);for(let B of d.duplicates)_.add(B.seq);return d.duplicateOf&&_.add(d.duplicateOf.seq),[..._]},[d]),x=(_,B,O)=>{f({anchorEl:_,targetSeq:B,type:O})};return Mn(mn,{icon:Xt(P5,{sx:{fontSize:19,display:"block"}}),title:Mn(z5,{children:["\uAD00\uB828 \uC5C5\uBB34",g>0?Xt(Rr,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:g}):null]}),titleExtra:b?null:Mn(Rr,{sx:{ml:"auto",display:"flex",alignItems:"center",gap:.5},children:[r?Xt(mp,{size:"small",color:"inherit",startIcon:Xt(j5,{sx:{fontSize:16}}),onClick:_=>o(_.currentTarget),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uD6C4\uC18D \uC5C5\uBB34"}):null,i?Xt(mp,{size:"small",color:"inherit",startIcon:Xt(N5,{sx:{fontSize:16}}),onClick:()=>n(!0),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uC5F0\uACB0"}):null]}),children:[Mn(Rr,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:[u?Xt(Rr,{sx:{mb:d.related.length||d.duplicates.length||d.duplicateOf?1:0},children:d.lineage.map((_,B)=>{let O=_.seq===e.seq,j=B===d.lineage.length-1;return Mn(Rr,{sx:{display:"flex",gap:1},children:[Mn(Rr,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:14,flexShrink:0,pt:1.1},children:[Xt(Rr,{sx:{width:O?9:7,height:O?9:7,borderRadius:"50%",bgcolor:O?"#2f80ed":_.completed?"#9a9a97":"#c9c8c5",flexShrink:0}}),j?null:Xt(Rr,{sx:{width:"2px",flex:1,bgcolor:"#e6e6e3"}})]}),Mn(Rr,{sx:{flex:1,minWidth:0,pb:j?0:.5},children:[Mn(Rr,{sx:{display:"flex",alignItems:"center",gap:.75},children:[Mn(Rr,{component:"span",onClick:!O&&l?()=>l(_.seq):void 0,sx:{minWidth:0,fontSize:14,fontWeight:O?600:400,color:O?"#2f80ed":_.completed?"#9a9a97":"#37352f",textDecoration:_.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...!O&&l?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[_.ticket_no?`${_.ticket_no} `:"",_.title]}),Xt(Ot,{option:cr(_),small:!0})]}),Xt(Rr,{sx:{fontSize:12,color:"#9a9a97"},children:_.completed&&_.completed_time?`${_.completed_time} \uC644\uB8CC`:_.created_time??""})]})]},_.seq)})}):null,d.duplicateOf?Xt(Cu,{item:d.duplicateOf,caption:"\uC6D0\uBCF8",onOpen:l?()=>l(d.duplicateOf.seq):void 0,onUnlink:!b&&s?_=>x(_.currentTarget,d.duplicateOf.seq,"duplicate_of"):void 0}):null,d.duplicates.map(_=>Xt(Cu,{item:_,caption:"\uC911\uBCF5",onOpen:l?()=>l(_.seq):void 0,onUnlink:!b&&s?B=>x(B.currentTarget,_.seq,"duplicate_of"):void 0},`dup-${_.seq}`)),d.related.map(_=>Xt(Cu,{item:_,onOpen:l?()=>l(_.seq):void 0,onUnlink:!b&&s?B=>x(B.currentTarget,_.seq,"related"):void 0},`rel-${_.seq}`)),g===0?Xt(Rr,{sx:{px:1.25,py:.75,fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]}),i?Xt(fl,{open:t,task:e,tasks:p,excludeSeqs:m,onClose:()=>n(!1),onSubmit:(_,B)=>i(e.seq,_,B)}):null,Xt(At,{open:!!c,anchorEl:c,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:()=>o(null),onConfirm:()=>{r?.(e.seq),o(null)}}),Xt(At,{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 Fr,jsx as we,jsxs as Wt}from"react/jsx-runtime";function Uo({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return we(Zt,{component:"span",sx:{color:"#9a9a97"},children:e})}function Sp({task:e,customTabs:p,statusOptions:b,avatarSrcByName:l,onChangeStatus:i,onChangeLabels:s,onAddLabelOption:r,onChangeProject:t,onAddProject:n,onChangeDate:c,onChangeReminder:o,onMemberEdit:a,onChangePriority:f,onChangeVisibility:d,onChangeRepeat:u,departments:g=[],onChangeEventTime:m,onChangeEventPlace:x,onChangeEventAddress:_,onChangeNote:B,onChangeNoteDraft:O,onChangeContent:j,contentTemplates:D,onSaveContentTemplate:P,onRemoveContentTemplate:L,contentLoading:q=!1,onChangeContentHeight:N,onAddChecklistItem:S,onToggleChecklistItem:C,onRemoveChecklistItem:M,onUpdateChecklistItem:h,onReorderChecklist:y,onConvertChecklistToTask:v,onOpenChecklistTask:w,onLinkChecklistTask:k,resolveChecklistTask:T,relatedTasksPool:E,onOpenRelatedTask:F,onLinkRelatedTask:$,onUnlinkRelatedTask:U,onCreateFollowUpTask:A,onAddAttachments:W,onRemoveAttachment:R,onPreview:I,onDownload:z,onUpdateComment:V,onRemoveComment:Y,onToggleCommentReaction:K,currentUserName:H="",myAccountSeq:Z=0,noticeAdmin:J=!1,hideProject:G=!1,hideLabel:X=!1,showTitle:ee=!1,onChangeTitle:ne,onToggleCompleted:re,onChangeIcon:ie,onChangeIconColor:le,employees:me=[],onAckConfirm:ve,onRequestConfirm:_e,onChangeBugField:Pe,sprints:he=[],sprintProject:fe=!1,hideSprint:We=!1,onChangeSprint:Ne,onChangeStoryPoints:se,onChangeResolution:Be,onClaimTask:ye,onVerifyBug:xe}){let[Ue,Te]=gn(null),[ue,Ee]=gn(null),[ke,Ie]=gn(null),[lt,Le]=gn(null),[$e,Tt]=gn(!1),je={[Tn]:$e?{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"}},[Fe,xt]=gn(null),[Ze,He]=gn(null),[vt,Ye]=gn(null),[te,ce]=gn(null),[pe,Se]=gn(null),[Xe,Re]=gn(null),[De,yt]=gn(null),Ae=!!e.is_notice,Ce=!!e.is_event,tt=!!e.is_bug,st=!!ye&&Ca(e,Z),dt=!!ye&&Ba(e,Z),wt=!!xe&&tt&&!!e.completed&&Z>0&&(e.author_account_seq??0)===Z&&!(e.acks??[]).some(oe=>oe.account_seq===Z),pt=!io(e,Z),Ut=!e.is_event&&(e.is_notice?Z>0&&(e.author_account_seq??0)===Z:(e.author_account_seq??0)===Z||(e.manager_account_seq??0)===Z),qt=e.is_notice||e.is_event?_t(e.icon||(e.is_notice?nr:lr)):null,Pt=Ae?!Ta(e,Z):pt,Vt=st||dt?Wt(Pn,{onClick:oe=>yt(oe.currentTarget),children:[we(J5,{sx:{fontSize:16,mr:.5}}),"\uAC00\uC838\uAC00\uAE30"]}):null,Q=Ae?xl(e,me):"",ae=Ae?Wh(e,me,Z):null,ge=Ae?null:Fa(e,Z),be=!!(ge&&ge.total>0||Ae&&ae),Me=!Ae,ze=Wt(Fr,{children:[we(mt,{icon:we(Y5,{sx:{fontSize:17}}),label:"\uC791\uC131\uC790",sx:[Un(9),je??null,...Ce?[]:[er(1)]],children:e.created_by?Wt(Fr,{children:[we(Lr,{names:[e.created_by],size:20,avatarSrcByName:l}),e.created_by]}):we(Uo,{})}),we(mt,{icon:we(xp,{sx:{fontSize:17}}),label:"\uC791\uC131\uC77C\uC2DC",sx:[Un(11),je??null,...Ce?[]:[er(2)]],children:e.created_time?rn(e.created_time):we(Uo,{})})]});return Wt(Fr,{children:[ee?Wt(Zt,{sx:{px:2,pt:2,pb:.5,display:"flex",alignItems:"flex-start",gap:1},children:[Ut?we(F5,{checked:e.completed,icon:we(V5,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:we(Mu,{sx:{fontSize:22,color:"#2f80ed"}}),onChange:(oe,it)=>{ke||Ie({anchorEl:oe.currentTarget,nextCompleted:it})},sx:{p:0,mt:.25}}):null,qt?Ce&&!pt?we(bp,{onClick:oe=>Ee(oe.currentTarget),sx:{display:"flex",p:.25,mt:.1,borderRadius:1,color:e.icon_color||"#1e3a8a","&:hover":{bgcolor:"#f2f2f0"}},children:we(qt,{sx:{fontSize:20}})}):we(Zt,{sx:{display:"flex",p:0,mt:.25,color:e.icon_color||(Ae?"#e5484d":"#1e3a8a")},children:we(qt,{sx:{fontSize:20}})}):null,we(Zt,{sx:{flex:1,minWidth:0},children:Ue!==null?we(Zt,{component:"input",autoFocus:!0,spellCheck:!1,value:Ue,onChange:oe=>Te(oe.target.value),onBlur:()=>{Ue.trim()&&Ue.trim()!==e.title&&ne(e.seq,Ue.trim()),Te(null)},onKeyDown:oe=>{oe.key==="Enter"&&oe.target.blur(),oe.key==="Escape"&&Te(null)},sx:{width:"100%",border:"none",outline:"none",font:"inherit",fontSize:19,fontWeight:600,color:"#37352f",p:0,m:0}}):we(Zt,{onClick:()=>Te(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})}),we(At,{open:!!ke,anchorEl:ke?.anchorEl??null,title:ke?.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:ke?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>Ie(null),onConfirm:()=>{ke&&re(e.seq,ke.nextCompleted),Ie(null)}})]}):null,Wt(Zt,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:0,[Tn]:{pb:0,"& > :last-child":{mb:0}}},children:[we(il,{hideProject:G,pinColumns:!0,projectColumn:!Ce&&!X?2:"full",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:l,hideDueDate:!Ce&&!!e.repeat_rule,hideReminder:!!e.repeat_rule,notice:Ae,event:Ce,readOnly:pt,targetSummary:Q,onChangeProject:oe=>t(e.seq,oe),onAddProject:n,onChangeStartDate:oe=>c(e.seq,"start_date",oe),onChangeDueDate:oe=>c(e.seq,"due_date",oe),onChangeReminder:oe=>o(e.seq,oe),onChangePriority:oe=>f(e.seq,oe),onChangeEventTime:oe=>m?.(e.seq,oe),onChangeEventPlace:oe=>x?.(e.seq,oe),onChangeEventAddress:oe=>_?.(e.seq,oe),onMemberEdit:oe=>a(e,oe,null),narrowCollapsedSx:je,reminderLocked:e.completed,managerAction:Vt,leading:Wt(Fr,{children:[wt||Vt&&(Ae||Ce)?Wt(Zt,{sx:{gridColumn:"1 / -1",display:"flex",justifyContent:"flex-start",gap:2,px:2,py:1.5},children:[Ae||Ce?Vt:null,wt?Wt(Fr,{children:[we(Qi,{variant:"contained",size:"large",onClick:()=>xe?.(e.seq,!0),sx:{bgcolor:"#2f80ed"},children:"\uAC80\uC99D\uC644\uB8CC"}),we(Qi,{variant:"outlined",size:"large",color:"error",onClick:()=>xe?.(e.seq,!1),children:"\uC7AC\uC624\uD508"})]}):null]}):null,tt&&e.ticket_no?we(mt,{icon:we(H5,{sx:{fontSize:17}}),label:"\uD2F0\uCF13",sx:er(1),children:we(Zt,{component:"span",sx:{fontVariantNumeric:"tabular-nums"},children:e.ticket_no})}):null,Ce?null:we(Zt,{sx:tt&&e.ticket_no||Me||be?er(tt&&e.ticket_no?2:1):{gridColumn:"1 / -1"},children:we(mt,{icon:we(K5,{sx:{fontSize:17}}),label:"\uC0C1\uD0DC",onClick:pt||e.completed?void 0:oe=>xt(oe),children:we(Ot,{option:cr(e)})})}),Ae?null:(()=>{let oe=wn(e),it=oe==="all"?we(wp,{sx:{fontSize:17,color:"#2f80ed"}}):oe==="group"?we(_p,{sx:{fontSize:17,color:"#d9730d"}}):we(vp,{sx:{fontSize:17}}),Je=oe==="all"?"\uC804\uCCB4\uACF5\uAC1C":oe==="group"?`\uBD80\uC11C\uACF5\uAC1C \xB7 ${g.find(Ge=>Ge.seq===(e.visibility_group_seq??0))?.name??"\uBD80\uC11C"}`:"\uBE44\uACF5\uAC1C";return we(Zt,{sx:Ce?void 0:er(tt?1:2),children:we(mt,{icon:it,label:"\uACF5\uAC1C",onClick:pt||!d?void 0:Ge=>He(Ge),children:Je})})})(),!Ae&&!tt?we(Zt,{sx:Ce?void 0:er(1),children:we(mt,{icon:we(Q5,{sx:{fontSize:17,...e.repeat_rule?{color:"#2f80ed"}:{}}}),label:"\uBC18\uBCF5",onClick:pt||!u?void 0:oe=>Ye(oe),children:e.repeat_rule?el(e.repeat_rule):we(Uo,{label:"\uC5C6\uC74C"})})}):null,!Ae&&!tt&&e.repeat_rule?we(Zt,{sx:Ce?void 0:er(2),children:we(mt,{icon:we(e4,{sx:{fontSize:17}}),label:"\uBC18\uBCF5 \uC885\uB8CC",onClick:pt||!u?void 0:oe=>ce(oe),children:e.repeat_until?`${e.repeat_until}\uAE4C\uC9C0`:we(Uo,{})})}):null,ge&&ge.total>0?we(Zt,{sx:Ce?void 0:er(2),children:we(mt,{icon:we(Eu,{sx:{fontSize:17}}),label:"\uD655\uC778",children:ge.canConfirm?we(Qi,{size:"small",variant:"contained",onClick:()=>ve?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):Wt(Qi,{size:"small",variant:"outlined",color:"inherit",startIcon:ge.myTime?we(Mu,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:oe=>Le({anchorEl:oe.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:[ge.count," / ",ge.total]})})}):null,Ae&&ae?we(Zt,{sx:er(2),children:we(mt,{icon:we(Eu,{sx:{fontSize:17}}),label:"\uD655\uC778",children:we(Zt,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,minWidth:0},children:ae.canAck?we(Qi,{size:"small",variant:"contained",onClick:()=>ve?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):we(Qi,{size:"small",variant:"outlined",color:"inherit",startIcon:ae.acked?we(Mu,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:oe=>Le({anchorEl:oe.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:ae.total>0&&ae.count>=ae.total?"\uC644\uB8CC":Wt(Fr,{children:[ae.count,we(Zt,{component:"span",sx:{mx:.4},children:"/"}),ae.total]})})})})}):null,fe&&!We&&!Ce&&!Ae?Wt(Fr,{children:[we(mt,{icon:we(W5,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:pt?void 0:oe=>Se(oe),sx:er(1),children:(e.sprint_seq??0)>0?he.find(oe=>oe.seq===e.sprint_seq)?.name??"\uC0AD\uC81C\uB41C \uC2A4\uD504\uB9B0\uD2B8":we(Uo,{label:"\uBBF8\uBC30\uC815"})}),we(mt,{icon:we(U5,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",sx:er(2),children:we(xo,{value:(e.story_points??0)>0?String(e.story_points):"",placeholder:"\uBBF8\uCD94\uC815",readOnly:pt,onCommit:oe=>se?.(e.seq,Number(oe.replace(/[^0-9.]/g,""))||0)})})]}):null,Ce||X?null:we(Zt,{sx:[G?{gridColumn:"1 / -1"}:er(1),je??null],children:we(mt,{icon:we(G5,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:pt?void 0:oe=>Re(oe),children:(e.label_keys??[]).length>0?we(Do,{labelKeys:e.label_keys??[],labelOptions:b}):we(Uo,{})})})]}),afterProject:Ce?null:ze,trailing:Wt(Fr,{children:[tt?we(sl,{values:{repro:e.bug_repro??"",device:e.bug_device??"",where:e.bug_where??"",version:e.bug_version??"",resolution:e.resolution??""},readOnly:pt,showResolution:!!e.completed,onChangeRepro:oe=>Pe?.(e.seq,"bug_repro",oe),onChangeDevice:oe=>Pe?.(e.seq,"bug_device",oe),onChangeWhere:oe=>Pe?.(e.seq,"bug_where",oe),onChangeVersion:oe=>Pe?.(e.seq,"bug_version",oe),onChangeResolution:oe=>Be?.(e.seq,oe)}):null,Ce?ze:null,e.completed?Wt(Fr,{children:[we(mt,{icon:we(Eu,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC790",sx:[Un(10),je??null,...Ce?[]:[er(1)]],children:e.completed_by?Wt(Fr,{children:[we(Lr,{names:[e.completed_by],size:20,avatarSrcByName:l}),e.completed_by]}):we(Uo,{})}),we(mt,{icon:we(xp,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC77C\uC2DC",sx:[Un(12),je??null,...Ce?[]:[er(2)]],children:e.completed_time?rn(e.completed_time):we(Uo,{})})]}):null]})}),Wt(Zt,{sx:{display:"none",[Tn]:{display:"block",mt:1.5,mb:0}},children:[we(gi,{sx:{borderColor:"#e6e6e3"}}),we(bp,{onClick:()=>Tt(oe=>!oe),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:$e?Wt(Fr,{children:["\uC811\uAE30 ",we(q5,{sx:{fontSize:18}})]}):Wt(Fr,{children:["\uC815\uBCF4 \uB354\uBCF4\uAE30 ",we($5,{sx:{fontSize:18}})]})})]}),Wt(Zt,{children:[we(gi,{sx:{my:1.5,borderColor:"#e6e6e3",[Tn]:{mt:0,mb:1.25}}}),we(mn,{icon:we(X5,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",titleExtra:D&&!pt?we(ll,{content:e.content??"",templates:D,onApply:oe=>j?.(e.seq,oe),onSave:P,onRemove:L}):void 0,children:we(Zt,{sx:{userSelect:"text"},children:q?we(Zt,{sx:{minHeight:e.content_height||180,display:"flex",alignItems:"center",justifyContent:"center"},children:we(Na,{})}):we(cl,{syncKey:e.seq,value:e.content??"",height:e.content_height??0,onChangeHeight:N?oe=>N(e.seq,oe):void 0,readOnly:pt,onChange:oe=>j(e.seq,oe)})})}),e.is_bug?null:Wt(Fr,{children:[we(gi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(mn,{icon:we(Z5,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:we(Zt,{sx:{userSelect:"text"},children:we(dp,{value:e.note,readOnly:Pt,onCommit:oe=>B(e.seq,oe),onDraftChange:O?oe=>O(e.seq,oe):void 0})})})]}),Ce?null:Wt(Fr,{children:[we(gi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(dl,{taskSeq:e.seq,checklist:e.checklist??[],removeLocked:Pt,onAdd:S,onToggle:C,onRemove:M,onUpdate:h,onReorder:y,onConvertToTask:v,onOpenLinkedTask:w,resolveLinkedTask:T,myAccountSeq:Z,linkCandidates:E,linkBaseTask:e,onLinkExistingTask:k})]}),E&&!Ce&&!Ae&&pp(e,E)?Wt(Fr,{children:[we(gi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(gp,{task:e,tasks:E,readOnly:pt,onOpenTask:F,onLink:$,onUnlink:U,onCreateFollowUp:A})]}):null,we(gi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(gl,{taskSeq:e.seq,attachments:e.attachments??[],removeLocked:Pt,onAdd:W,onRemove:R,onPreview:I?oe=>I({...oe,taskSeq:e.seq}):void 0,onDownload:z?oe=>z({...oe,taskSeq:e.seq}):void 0})]}),we(gi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(ip,{taskSeq:e.seq,comments:e.comments??[],currentUserName:H,myAccountSeq:Z,avatarSrcByName:l,onUpdate:V,onRemove:Y,onToggleReaction:K,onPreview:I?oe=>I({...oe,taskSeq:e.seq}):void 0,onDownload:z?oe=>z({...oe,taskSeq:e.seq}):void 0})]}),we(Ri,{anchorEl:Fe,value:e.status,options:Ae?bs:tt?ti:ys,onSelect:oe=>i(e.seq,oe),onClose:()=>xt(null)}),we(Bu,{transitionDuration:0,anchorEl:vt,open:!!vt,onClose:()=>Ye(null),children:[{value:"",label:"\uC5C6\uC74C"},...Rs].map(oe=>we(Iu,{selected:(e.repeat_rule??"")===oe.value,onClick:()=>{Ye(null),(async()=>{let it=e.repeat_rule??"";if(oe.value===it)return;if(oe.value===""){await kp({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 Je=String(e.due_date??"").slice(0,10);if(!Je){t4(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}it&&!await kp({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,oe.value,tl(Je,oe.value))})()},sx:{fontSize:14,minWidth:140},children:oe.label},oe.value||"none"))}),we(r4,{anchorEl:te,open:!!te,onClose:()=>ce(null),selectedDate:e.repeat_until?new Date(`${e.repeat_until}T00:00:00`):new Date,onDateChange:oe=>{ce(null);let it=nt=>String(nt).padStart(2,"0"),Je=`${oe.getFullYear()}-${it(oe.getMonth()+1)}-${it(oe.getDate())}`,Ge=e.repeat_rule??"";Ge&&u?.(e.seq,Ge,Je)}}),we(Bu,{transitionDuration:0,anchorEl:Ze,open:!!Ze,onClose:()=>He(null),children:[{key:"involved",label:"\uBE44\uACF5\uAC1C",icon:we(vp,{sx:{fontSize:17,color:"#57564f"}}),selected:wn(e)==="involved",onPick:()=>d?.(e.seq,"involved",0)},{key:"all",label:"\uC804\uCCB4\uACF5\uAC1C",icon:we(wp,{sx:{fontSize:17,color:"#2f80ed"}}),selected:wn(e)==="all",onPick:()=>d?.(e.seq,"all",0)},...g.map(oe=>({key:`group-${oe.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${oe.name}`,icon:we(_p,{sx:{fontSize:17,color:"#d9730d"}}),selected:wn(e)==="group"&&(e.visibility_group_seq??0)===oe.seq,onPick:()=>d?.(e.seq,"group",oe.seq)}))].map(oe=>Wt(Iu,{selected:oe.selected,onClick:()=>{oe.onPick(),He(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[oe.icon,oe.label,oe.selected?we(yp,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},oe.key))}),we(Bu,{transitionDuration:0,anchorEl:pe,open:!!pe,onClose:()=>Se(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...he.filter(oe=>`custom-${oe.group_seq}`===String(e.tab_key??"")).map(oe=>({seq:oe.seq,label:hn(oe)}))].map(oe=>Wt(Iu,{onClick:()=>{Ne?.(e.seq,oe.seq),Se(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[oe.label,(e.sprint_seq??0)===oe.seq?we(yp,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},oe.seq))}),we(za,{anchorEl:lt?.anchorEl??null,open:!!lt?.open,acks:e.acks??[],total:ae?.total??ge?.total??0,pendingNames:ae?.pendingNames??ge?.pendingNames??[],avatarSrcByName:l,onRequestConfirm:_e&&(ae?ae.count<ae.total:ge&&ge.count<ge.total)?()=>{_e(e.seq),Le(oe=>oe?{...oe,open:!1}:null)}:void 0,onClose:()=>Le(oe=>oe?{...oe,open:!1}:null)}),we(yl,{anchorEl:Xe,selectedKeys:e.label_keys??[],labelOptions:b,onToggle:oe=>s(e.seq,ka(e.label_keys??[],oe)),onAddLabel:r,onClose:()=>Re(null)}),we(Lo,{anchorEl:ue,value:e.icon??"",color:e.icon_color??"",onSelect:oe=>{ie(e.seq,oe),Ee(null)},onSelectColor:le?oe=>le(e.seq,oe):void 0,onClose:()=>Ee(null)}),we(At,{open:!!De,anchorEl:De,title:st?"\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:()=>yt(null),onConfirm:()=>{ye?.(e.seq),yt(null)}})]})}import{Fragment as c4,jsx as qr,jsxs as Ep}from"react/jsx-runtime";function Zz(){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 Jz({open:e,task:p,onClose:b,onAddComment:l,onSaveFields:i,presentation:s="auto",myAccountSeq:r=0,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:c,onChangeIconColor:o,activityItems:a,activityLoading:f,onLoadActivity:d,onPrint:u,onDelete:g,canDelete:m,...x}){let _=Nt(),B=Cp(null);p&&(B.current=p);let O=p??B.current,[j,D]=Bp(!1),[P,L]=Bp({}),q=Object.keys(P).length>0;Tp(()=>{L({})},[p?.seq,e]);let N=Cp(null);if(Tp(()=>{N.current?.scrollTo({top:0})},[p?.seq]),!O)return null;let S=_&&q?{...O,...P}:O,C=S.checklist??[],M=(T,E)=>{_?L(F=>({...F,...T})):E()},h=()=>{let T=P;L({});let E=O.seq,F=T.title===void 0?void 0:String(T.title).trim();if(i){let $={...T};F!==void 0&&(F?$.title=F:delete $.title),Object.keys($).length>0&&i(E,$),Mp({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"});return}F&&n(E,F),T.icon!==void 0&&c(E,String(T.icon)),T.icon_color!==void 0&&o?.(E,String(T.icon_color)),T.status!==void 0&&x.onChangeStatus(E,T.status),T.label_keys!==void 0&&x.onChangeLabels(E,T.label_keys??[]),T.tab_key!==void 0&&x.onChangeProject(E,String(T.tab_key??"")),T.start_date!==void 0&&x.onChangeDate(E,"start_date",String(T.start_date??"")),T.due_date!==void 0&&x.onChangeDate(E,"due_date",String(T.due_date??"")),T.reminder!==void 0&&x.onChangeReminder(E,T.reminder),T.priority!==void 0&&x.onChangePriority(E,T.priority),T.event_time!==void 0&&x.onChangeEventTime?.(E,String(T.event_time??"")),T.event_place!==void 0&&x.onChangeEventPlace?.(E,String(T.event_place??"")),T.event_address!==void 0&&x.onChangeEventAddress?.(E,String(T.event_address??"")),T.content!==void 0&&x.onChangeContent(E,String(T.content??"")),T.note!==void 0&&x.onChangeNote(E,String(T.note??"")),T.visibility!==void 0&&x.onChangeVisibility?.(E,T.visibility,Number(T.visibility_group_seq??0)),Mp({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"})},y={...x,onChangeStatus:(T,E)=>M({status:E},()=>x.onChangeStatus(T,E)),onChangeLabels:(T,E)=>M({label_keys:E},()=>x.onChangeLabels(T,E)),onChangeProject:(T,E)=>M({tab_key:E},()=>x.onChangeProject(T,E)),onChangeDate:(T,E,F)=>M({[E]:F},()=>x.onChangeDate(T,E,F)),onChangeReminder:(T,E)=>M({reminder:E},()=>x.onChangeReminder(T,E)),onChangePriority:(T,E)=>M({priority:E},()=>x.onChangePriority(T,E)),onChangeEventTime:(T,E)=>M({event_time:E},()=>x.onChangeEventTime?.(T,E)),onChangeEventPlace:(T,E)=>M({event_place:E},()=>x.onChangeEventPlace?.(T,E)),onChangeEventAddress:(T,E)=>M({event_address:E},()=>x.onChangeEventAddress?.(T,E)),onChangeContent:(T,E)=>M({content:E},()=>x.onChangeContent(T,E)),onChangeNote:(T,E)=>M({note:E},()=>x.onChangeNote(T,E)),onMemberEdit:(T,E)=>x.onMemberEdit(T,E,_?F=>L($=>({...$,...F})):null),onChangeNoteDraft:_?(T,E)=>M({note:E},()=>{}):void 0,onChangeVisibility:x.onChangeVisibility?(T,E,F)=>M({visibility:E,visibility_group_seq:F},()=>x.onChangeVisibility?.(T,E,F)):void 0,onAddChecklistItem:(T,E)=>M({checklist:[...C,{label:E,checked:!1}]},()=>x.onAddChecklistItem(T,E)),onToggleChecklistItem:(T,E,F)=>M({checklist:C.map(($,U)=>U===E?{...$,checked:F}:$)},()=>x.onToggleChecklistItem(T,E,F)),onRemoveChecklistItem:(T,E)=>M({checklist:C.filter((F,$)=>$!==E)},()=>x.onRemoveChecklistItem(T,E)),onUpdateChecklistItem:x.onUpdateChecklistItem?(T,E,F)=>M({checklist:C.map(($,U)=>U===E?{...$,label:F}:$)},()=>x.onUpdateChecklistItem?.(T,E,F)):void 0,onReorderChecklist:x.onReorderChecklist?(T,E)=>M({checklist:E},()=>x.onReorderChecklist?.(T,E)):void 0,onLinkChecklistTask:x.onLinkChecklistTask?(T,E,F)=>M({checklist:[...C,{label:F,checked:!1,task_seq:E}]},()=>x.onLinkChecklistTask?.(T,E,F)):void 0},v=qr(Sp,{...y,task:S,myAccountSeq:r,onChangeTitle:(T,E)=>M({title:E},()=>n(T,E)),onToggleCompleted:t,onChangeIcon:(T,E)=>M({icon:E},()=>c(T,E)),onChangeIconColor:(T,E)=>M({icon_color:E},()=>o?.(T,E)),showTitle:_}),w=qr(sp,{onSubmit:(T,E)=>l(S.seq,T,E)},S.seq);return _||s==="dialog"?Ep(c4,{children:[qr(l4,{open:e,onClose:b,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:S.is_notice?"\uACF5\uC9C0\uC0AC\uD56D":S.is_event?"\uC77C\uC815":S.is_bug?"\uC624\uB958":"\uC5C5\uBB34",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[...d?[{icon:qr(s4,{sx:{color:"#6b7280"}}),tooltip:"\uD65C\uB3D9",onClick:()=>D(!0)}]:[],{icon:qr(i4,{sx:{color:"#6b7280"}}),tooltip:"\uACF5\uC720\uD558\uAE30",onClick:()=>Yi(S,!0)},..._?[{raw:!0,icon:qr(n4,{variant:"contained",size:"small",disableElevation:!0,disabled:!q,onClick:q?h:void 0,sx:{ml:1.5,height:32,minWidth:64,px:1.75,py:0,borderRadius:1,fontSize:14,fontWeight:600,bgcolor:"#2f80ed","&:hover":{bgcolor:"#2f80ed"},"&.Mui-disabled":{bgcolor:"#f2f2f0",color:"#c9c8c5"}},children:"\uC800\uC7A5\uD558\uAE30"})}]:[]]},fullScreen:_,maxWidth:_?void 0:"md",width:_?void 0:720,mobilePresentation:_?"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:w},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:qr(Tl,{sx:{userSelect:"none",width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:v})}]},O.seq),qr(Sl,{open:j,taskSeq:S.seq,items:a,loading:f,onLoad:d,onClose:()=>D(!1)})]}):qr(o4,{anchor:"right",open:e,onClose:b,"aria-label":"\uC5C5\uBB34 \uC0C1\uC138",disableAutoFocus:!0,disableEnforceFocus:!0,sx:{zIndex:T=>T.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:Ep(Tl,{sx:{display:"flex",flexDirection:"column",height:"100%",userSelect:"none"},children:[qr(fp,{task:S,myAccountSeq:r,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:c,onChangeIconColor:o,onClose:b,activityItems:a,activityLoading:f,onLoadActivity:d,onPrint:u,onDelete:g,canDelete:m}),qr(Ip,{sx:{borderColor:"#e6e6e3"}}),qr(Tl,{sx:{flex:1,minHeight:0},children:qr(a4,{ref:N,style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:v})}),qr(Ip,{sx:{borderColor:"#37352f"}}),qr(Tl,{sx:{flexShrink:0},children:w})]})})}import{useEffect as y4,useState as So}from"react";import{Box as $r,Button as Du,IconButton as Ap}from"@mui/material";import{FormDialog as Dp}from"@ehfuse/mui-form-dialog";import x4 from"@mui/icons-material/Add";import v4 from"@mui/icons-material/DirectionsRunOutlined";import w4 from"@mui/icons-material/EditOutlined";import{ErrorAlert as Pp}from"@ehfuse/alerts";import{ClearTextField as Np,DateTextField as Lp,LabelSelect as jp}from"@ehfuse/mui-form-controls";import{useEffect as u4,useState as Rp}from"react";import{Box as ko,Button as f4,FormControlLabel as Ru,Radio as Ou,RadioGroup as d4}from"@mui/material";import{FormDialog as h4}from"@ehfuse/mui-form-dialog";import{LabelSelect as p4}from"@ehfuse/mui-form-controls";import m4 from"@ehfuse/overlay-scrollbar";import{Fragment as g4,jsx as Or,jsxs as es}from"react/jsx-runtime";function Op({open:e,sprint:p,remainingTasks:b,sprints:l,onClose:i,onConfirm:s}){let r=l.filter(f=>f.seq!==p?.seq&&f.group_seq===(p?.group_seq??0)&&f.status!=="closed"),[t,n]=Rp("backlog"),[c,o]=Rp(0);u4(()=>{e&&(n(r.length>0?"move":"backlog"),o(r[0]?.seq??0))},[e]);let a=b.length>0;return Or(h4,{open:e,onClose:i,maxWidth:"sm",title:"\uBAA9\uD45C \uB9C8\uAC10",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-close",tabs:{visible:!1},actions:{showCancelButton:!0,right:Or(f4,{variant:"contained",onClick:()=>s({mode:a?t:"keep",moveToSprintSeq:t==="move"?c:0,taskSeqs:b.map(f=>f.seq)}),disabled:a&&t==="move"&&!(c>0),children:"\uB9C8\uAC10"})},sections:[{id:"sprint-close",title:"",showTitle:!1,children:es(ko,{sx:{display:"flex",flexDirection:"column",gap:2},children:[es(ko,{sx:{fontSize:18,color:"#37352f"},children:[Or(ko,{component:"span",sx:{fontWeight:600},children:p?.name??""})," \uBAA9\uD45C\uB97C \uB9C8\uAC10\uD569\uB2C8\uB2E4."]}),a?es(g4,{children:[es(ko,{sx:{fontSize:15,color:"#6f6f6c"},children:["\uB05D\uB098\uC9C0 \uC54A\uC740 \uC5C5\uBB34\uAC00"," ",b.length,"\uAC74 \uC788\uC2B5\uB2C8\uB2E4. \uC5B4\uB5BB\uAC8C \uD560\uAE4C\uC694?"]}),Or(ko,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:Or(m4,{style:{maxHeight:220},thumb:{width:6},children:b.map(f=>es(ko,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,borderBottom:"1px solid #f2f2f0","&:last-of-type":{borderBottom:"none"}},children:[Or(ko,{sx:{flex:1,minWidth:0,fontSize:16,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f.title}),Or(Ot,{option:cr(f)})]},f.seq))})}),es(d4,{value:t,onChange:(f,d)=>n(d),children:[r.length>0?Or(Ru,{value:"move",control:Or(Ou,{size:"small"}),label:"\uB2E4\uC74C \uBAA9\uD45C\uB85C \uC774\uC6D4",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}}):null,t==="move"&&r.length>0?Or(ko,{sx:{pl:4,pb:1},children:Or(p4,{size:"small",label:"",fullWidth:!0,value:String(c),options:r.map(f=>({value:String(f.seq),label:f.name})),onChange:f=>o(Number(f.target.value)||0)})}):null,Or(Ru,{value:"backlog",control:Or(Ou,{size:"small"}),label:"\uBBF8\uBC30\uC815(\uBC31\uB85C\uADF8)\uC73C\uB85C \uBE7C\uAE30",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}}),Or(Ru,{value:"keep",control:Or(Ou,{size:"small"}),label:"\uC774 \uBAA9\uD45C\uC5D0 \uADF8\uB300\uB85C \uB450\uAE30",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}})]})]}):Or(ko,{sx:{fontSize:15,color:"#6f6f6c"},children:"\uB0A8\uC740 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uC774\uB300\uB85C \uB9C8\uAC10\uD558\uBA74 \uBAA9\uD45C\uAC00 \uC885\uB8CC\uB429\uB2C8\uB2E4."})]})}]})}var Au="custom-";function b4(e){return e.startsWith(Au)}function uF(e){return e>0?`${Au}${e}`:""}function Vo(e){if(!b4(e))return 0;let p=Number(e.slice(Au.length));return Number.isInteger(p)&&p>0?p:0}import{Fragment as Fp,jsx as jt,jsxs as Ko}from"react/jsx-runtime";var _4=[{value:"planning",label:"\uACC4\uD68D\uC911"},{value:"active",label:"\uC9C4\uD589\uC911"},{value:"closed",label:"\uC885\uB8CC"}];function zp(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):"-"}function kF({open:e,customTabs:p,sprints:b,onClose:l,onCreate:i,onUpdate:s,onChangeStatus:r,tasks:t=[],onCloseSprint:n,onRemove:c}){let o=p.filter(E=>E.useSprints&&!E.archived),[a,f]=So(""),[d,u]=So(""),[g,m]=So(""),[x,_]=So(""),[B,O]=So(""),[j,D]=So(!1),[P,L]=So(!1),[q,N]=So(null),S=q?t.filter(E=>(E.sprint_seq??0)===q.seq&&!E.completed):[],[C,M]=So(0);y4(()=>{e&&(f(o.length===1?o[0].key:""),u(""),m(""),_(""),O(""),M(0))},[e]);let h=()=>{u(""),m(""),_(""),O(""),M(0),L(!1)},y=E=>{M(E.seq),f(`custom-${E.group_seq}`),u(E.name),m(E.goal),_(E.start_date),O(E.end_date)},v=C>0||P,w=async()=>{let E=Vo(a);if(!E){Pp("\uBAA9\uD45C\uB97C \uB9CC\uB4E4 \uD504\uB85C\uC81D\uD2B8\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}if(!d.trim()){Pp("\uBAA9\uD45C \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}D(!0);try{if(C>0){s(C,{name:d.trim(),goal:g.trim(),start_date:x,end_date:B}),h();return}await i({group_seq:E,name:d.trim(),goal:g.trim(),start_date:x,end_date:B})&&h()}finally{D(!1)}},k=new Map(p.map(E=>[Vo(E.key),E.label])),T=jt($r,{children:o.length===0?jt($r,{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.'}):jt(Fp,{children:jt($r,{children:b.length===0?Ko($r,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[jt(v4,{sx:{fontSize:48,color:"#d9d9d6"}}),jt($r,{sx:{fontSize:13.5},children:"\uB4F1\uB85D\uB41C \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):b.map(E=>Ko($r,{sx:{display:"flex",flexDirection:"column",gap:1,"&:not(:last-of-type)::after":{content:'""',display:"block",my:1.75,borderBottom:"1px solid #f0efed"}},children:[Ko($r,{sx:{minWidth:0},children:[Ko($r,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[jt($r,{component:"span",sx:{fontSize:18,fontWeight:600,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:E.name}),jt($r,{component:"span",sx:{flexShrink:0,px:1,py:.25,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:13,fontWeight:500},children:k.get(E.group_seq)??"\uC0AD\uC81C\uB41C \uD504\uB85C\uC81D\uD2B8"}),Ko($r,{component:"span",sx:{flexShrink:0,fontSize:14,color:"#57564f"},children:[zp(E.start_date)," ~"," ",zp(E.end_date)]})]}),E.goal?jt($r,{sx:{mt:.5,fontSize:14,color:"#787774",lineHeight:1.5},children:E.goal}):null]}),Ko($r,{sx:{display:"flex",alignItems:"center",gap:.5},children:[jt(jp,{label:"\uC0C1\uD0DC",showLabel:!1,size:"small",value:E.status,options:_4.map(F=>({value:F.value,label:F.label})),onChange:F=>{let $=String(F.target.value);if($==="closed"&&n){N(E);return}r(E.seq,$)},sx:{width:104,flexShrink:0}}),jt(Ap,{"aria-label":"\uBAA9\uD45C \uC218\uC815",onClick:()=>y(E),sx:{color:"#9a9a97","&:hover":{color:"#2563eb"}},children:jt(w4,{sx:{fontSize:18}})}),jt(Ap,{"aria-label":"\uBAA9\uD45C \uC0AD\uC81C",onClick:()=>c(E.seq),sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:jt(ur,{style:{width:16,height:16}})})]})]},E.seq))})})});return Ko(Fp,{children:[jt(Dp,{open:e,onClose:l,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:T}],sectionContentPaddingTop:0,actions:{showCancelButton:!0,left:o.length>0?jt(Du,{startIcon:jt(x4,{}),onClick:()=>{h(),L(!0)},sx:{color:"#2563eb"},children:"\uC0C8 \uBAA9\uD45C"}):void 0,right:jt(Du,{variant:"contained",onClick:l,children:"\uD655\uC778"})}}),jt(Op,{open:q!==null,sprint:q,remainingTasks:S,sprints:b,onClose:()=>N(null),onConfirm:E=>{q&&n?.(q.seq,E),N(null)}}),jt(Dp,{open:v,onClose:()=>{L(!1),h()},maxWidth:"sm",title:C>0?"\uBAA9\uD45C \uC218\uC815":"\uC0C8 \uBAA9\uD45C",locale:"ko",backdropClick:!1,tabs:{visible:!1},titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-form",sections:[{id:"sprint-form",title:"",showTitle:!1,children:jt($r,{sx:{pt:1},children:Ko($r,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2.5,mt:1},children:[jt(jp,{label:"\uD504\uB85C\uC81D\uD2B8",size:"medium",value:a,options:o.map(E=>({value:E.key,label:E.label})),onChange:E=>f(String(E.target.value)),disabled:C>0}),jt(Np,{label:"\uBAA9\uD45C \uC774\uB984",size:"medium",placeholder:"\uC608: 8\uC6D4 2\uC8FC\uCC28",value:d,onChange:E=>u(E.target.value)}),jt(Lp,{size:"medium",label:"\uC2DC\uC791\uC77C",value:x,onChange:E=>_(E.target.value)}),jt(Lp,{size:"medium",label:"\uC885\uB8CC\uC77C",value:B,onChange:E=>O(E.target.value)}),jt(Np,{label:"\uC124\uBA85",size:"medium",placeholder:"\uC120\uD0DD \uC785\uB825",value:g,onChange:E=>m(E.target.value),sx:{gridColumn:"1 / -1"}})]})})}],actions:{showCancelButton:!0,right:jt(Du,{variant:"contained",onClick:()=>{w()},disabled:j,children:C>0?"\uC218\uC815":"\uBAA9\uD45C \uB9CC\uB4E4\uAE30"})}})]})}import{useState as qp}from"react";import{Box as xr,Button as Pu,Divider as k4,IconButton as S4,TextField as T4}from"@mui/material";import{FormDialog as C4}from"@ehfuse/mui-form-dialog";import B4 from"@mui/icons-material/OpenInNewOutlined";import I4 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as M4}from"@ehfuse/alerts";import{jsx as zt,jsxs as bi}from"react/jsx-runtime";function AF({open:e,imports:p,onRegister:b,onRemove:l,onClose:i}){let[s,r]=qp(""),[t,n]=qp(!1),c=async()=>{let f=s.trim();if(f){n(!0);try{await b(f)&&r("")}finally{n(!1)}}},o=async f=>{await M4({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?`})&&l(f.seq)},a=bi(xr,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[bi(xr,{sx:{color:"#37352f",lineHeight:1.7},children:["\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC758 \uC77C\uC815\uC744 ",zt("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uD568\uAED8 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.",zt("br",{}),"\uD45C\uC2DC/\uC228\uAE40\uC740 \uC5C5\uBB34\uD568 \uC6B0\uC0C1\uB2E8\uC758 ",zt("b",{children:"\uAD6C\uAE00 \uC77C\uC815"})," \uC2A4\uC704\uCE58\uB85C \uCF1C\uACE0 \uB055\uB2C8\uB2E4."]}),zt(xr,{sx:{fontWeight:700,color:"#37352f",mt:.5},children:"\uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354"}),p.length>0?zt(xr,{sx:{display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1},children:p.map((f,d)=>bi(xr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:.75,borderTop:d>0?"1px solid #efefed":"none"},children:[zt(I4,{sx:{fontSize:18,color:"#0f9d58",flexShrink:0}}),zt(xr,{component:"span",sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),zt(S4,{"aria-label":"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",size:"small",onClick:()=>{o(f)},sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:zt(ur,{sx:{fontSize:18}})})]},f.seq))}):zt(xr,{sx:{color:"#9a9a97",px:.5},children:"\uC544\uC9C1 \uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}),zt(k4,{sx:{my:1,borderColor:"#e6e6e3"}}),zt(xr,{sx:{fontWeight:700,color:"#37352f"},children:"\uC0C8 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30"}),bi(xr,{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:[zt(xr,{children:bi(xr,{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 > ",zt("b",{children:"\uC124\uC815 \uBC0F \uACF5\uC720"}),"\uB97C \uC5FD\uB2C8\uB2E4."]})}),zt(xr,{children:bi(xr,{component:"span",children:[zt("b",{children:"\uCE98\uB9B0\uB354 \uD1B5\uD569"})," \uC139\uC158\uC758 ",zt("b",{children:'"iCal \uD615\uC2DD\uC758 \uBE44\uBC00 \uC8FC\uC18C"'})," \uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),zt(xr,{children:zt(xr,{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."})}),zt(xr,{children:zt(xr,{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."})})]}),bi(xr,{sx:{display:"flex",gap:2,alignItems:"center"},children:[zt(T4,{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}}}),zt(Pu,{variant:"contained",disabled:!s.trim()||t,onClick:()=>{c()},sx:{flexShrink:0},children:t?"\uD655\uC778 \uC911\u2026":"\uB4F1\uB85D"})]})]});return zt(C4,{open:e,onClose:i,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:zt(Pu,{variant:"outlined",startIcon:zt(B4,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:zt(Pu,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})}})}import{Box as To,Button as Fs,TextField as E4}from"@mui/material";import{FormDialog as R4}from"@ehfuse/mui-form-dialog";import O4 from"@mui/icons-material/ContentCopyOutlined";import $p from"@mui/icons-material/OpenInNewOutlined";import{InfoAlert as Hp}from"@ehfuse/alerts";import{Fragment as D4,jsx as ir,jsxs as yi}from"react/jsx-runtime";function A4(e){return`${window.location.origin}/api/v1/taskbox/calendar/${e}.ics`}function qF({open:e,feed:p,feedTaskCount:b,buildFeedUrl:l,onSubscribe:i,onClose:s}){let r=l??A4,t=p.subscribed?r(p.token):"",n=()=>{navigator.clipboard.writeText(t).then(()=>Hp("\uD53C\uB4DC \uC8FC\uC18C\uB97C \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>Hp("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD558\uC138\uC694."))},c=()=>{let a=t.replace(/^https?:\/\//,"webcal://");window.open(`https://calendar.google.com/calendar/r?cid=${encodeURIComponent(a)}`,"_blank")},o=yi(To,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[yi(To,{sx:{color:"#37352f",lineHeight:1.7},children:["\uB0B4\uAC00 \uAD00\uC5EC\uD55C \uC5C5\uBB34\uB97C ",ir("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4."]}),b===0?yi(To,{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.",ir("br",{}),ir("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?yi(D4,{children:[ir(E4,{value:t,fullWidth:!0,label:"\uB0B4 \uD53C\uB4DC \uC8FC\uC18C",slotProps:{input:{readOnly:!0}}}),yi(To,{sx:{display:"flex",gap:2},children:[ir(Fs,{variant:"outlined",startIcon:ir(O4,{}),onClick:n,children:"\uC8FC\uC18C \uBCF5\uC0AC"}),ir(Fs,{variant:"contained",startIcon:ir($p,{}),onClick:c,children:"Google \uCE98\uB9B0\uB354\uC5D0 \uCD94\uAC00"})]}),yi(To,{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:[ir(To,{children:yi("span",{children:["\uBC84\uD2BC\uC774 \uB3D9\uC791\uD558\uC9C0 \uC54A\uC73C\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354 > \uB2E4\uB978 \uCE98\uB9B0\uB354 + > ",ir("b",{children:"URL\uB85C \uCD94\uAC00"}),"\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),ir(To,{children:ir("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."})}),ir(To,{children:ir("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."})}),ir(To,{children:ir("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."})})]})]}):ir(Fs,{variant:"contained",onClick:i,sx:{alignSelf:"flex-start"},children:"\uAD6C\uB3C5 \uC2DC\uC791 (\uD53C\uB4DC \uBC1C\uAE09)"})]});return ir(R4,{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:o}],actions:{showCancelButton:!1,left:ir(Fs,{variant:"outlined",startIcon:ir($p,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:ir(Fs,{variant:"contained",onClick:s,children:"\uB2EB\uAE30"})}})}import{useEffect as P4,useMemo as Nu,useState as Lu}from"react";import{Box as qs,Button as N4,Typography as L4}from"@mui/material";import{FormDialog as j4}from"@ehfuse/mui-form-dialog";import{SearchTextField as z4}from"@ehfuse/mui-form-controls";import{TreeView as F4}from"@ehfuse/tree-view";import{Fragment as V4,jsx as En,jsxs as K4}from"react/jsx-runtime";function Wp(e){return`${e.name}#${e.seq}`}function q4(e){return Number(e.slice(e.lastIndexOf("#")+1))||0}function $4(e){let p=[],b=l=>{for(let i of l.employees??[])p.push(i);for(let i of l.groups??[])b(i)};for(let l of e)b(l);return p}function H4(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 W4(e){let p=[[e.name,e.role_name].filter(Boolean).join(" "),e.department].filter(Boolean).join(" / ");return{id:`emp:${e.seq}`,label:Wp(e),renderLabel:En(qs,{component:"span",sx:{display:"inline-flex",alignItems:"baseline",gap:.75},children:En(qs,{component:"span",sx:{fontWeight:400,color:"text.primary"},children:p})})}}function Up(e,p){let b=(e.groups??[]).map(i=>Up(i,p)).filter(i=>i!==null),l=(e.employees??[]).filter(i=>H4(i,p)).map(W4);return b.length===0&&l.length===0?null:{id:`group:${e.key}`,label:e.name,children:[...b,...l]}}function U4({groups:e,allEmployees:p,initialSelectedSeqs:b,multiple:l,isMobile:i,onSelectionChange:s}){let[r,t]=Lu(""),n=Nu(()=>e.map(o=>Up(o,r.trim().toLowerCase())).filter(o=>o!==null),[e,r]),c=Nu(()=>p.filter(o=>b.includes(o.seq)).map(Wp),[]);return K4(V4,{children:[En(qs,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:En(z4,{size:"small",fullWidth:!0,placeholder:"\uC774\uB984, \uBD80\uC11C \uAC80\uC0C9",onSearch:t,onClear:()=>t(""),sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),En(qs,{sx:i?{display:"flex",flexDirection:"column"}:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:En(F4,{items:n,checkbox:!0,multiSelect:l,selectionMode:"child",showSearch:!1,defaultExpanded:!0,initialSelections:c,onChange:o=>s(o.map(q4).filter(a=>a>0)),styles:{border:"none",borderRadius:"0"}})})]})}function XF({open:e,title:p="\uC9C1\uC6D0 \uC120\uD0DD",hint:b="",groups:l,multiple:i=!1,selectedSeqs:s,confirmText:r="\uD655\uC778",onConfirm:t,onClose:n}){let c=Nt(),[o,a]=Lu([]),[f,d]=Lu(0),u=Nu(()=>$4(l),[l]),g=s??[];P4(()=>{e&&(a(g),d(x=>x+1))},[e]);let m=()=>{let x=u.filter(_=>o.includes(_.seq));t(i?x:x.slice(0,1)),n()};return En(j4,{open:e,onClose:n,title:`${p}${i&&o.length>0?` (${o.length}\uBA85)`:""}`,locale:"ko",fullScreen:c,mobilePresentation:c?"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:En(qs,{sx:{...c?{}:{height:560},display:"flex",flexDirection:"column",border:"1px solid #cccccc",borderRadius:1,...c?{}:{overflow:"hidden"},userSelect:"none"},children:En(U4,{groups:l,allEmployees:u,initialSelectedSeqs:g,multiple:i,isMobile:c,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?En(L4,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.35},children:b}):void 0,right:En(N4,{variant:"contained",onClick:m,children:r})}})}import{useEffect as bk,useMemo as Cm,useState as Gs}from"react";import{Box as Io,Button as Bm}from"@mui/material";import{FormDialog as yk}from"@ehfuse/mui-form-dialog";import{LabelSelect as Ku}from"@ehfuse/mui-form-controls";import xk from"@mui/icons-material/SpeedOutlined";import{useEffect as G4,useState as Y4}from"react";import{Box as Xr,Button as X4}from"@mui/material";import{FormDialog as Z4}from"@ehfuse/mui-form-dialog";import{LabelSelect as J4,NumberField as Vp}from"@ehfuse/mui-form-controls";import Q4 from"@ehfuse/overlay-scrollbar";import{jsx as Hr,jsxs as $s}from"react/jsx-runtime";var e6=[{value:"count",label:"\uBBF8\uC644\uB8CC \uAC74\uC218"},{value:"points",label:"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8"}];function Kp({open:e,capacity:p,employees:b,onClose:l,onSave:i}){let[s,r]=Y4(p??ro);G4(()=>{e&&r(p??ro)},[e,p]);let t=s.basis==="points"?"SP":"\uAC74",n=(c,o)=>{let a=Math.max(0,Math.floor(Number(o)||0));r(f=>{let d={...f.by_account};return a>0?d[c]=a:delete d[c],{...f,by_account:d}})};return Hr(Z4,{open:e,onClose:l,maxWidth:"sm",title:"\uC778\uC6D0 \uC6A9\uB7C9",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-workload-capacity",tabs:{visible:!1},actions:{showCancelButton:!0,right:Hr(X4,{variant:"contained",onClick:()=>{i(s)},children:"\uC800\uC7A5"})},sectionContentPaddingTop:0,sections:[{id:"capacity",title:"",showTitle:!1,children:$s(Xr,{sx:{display:"flex",flexDirection:"column",gap:2},children:[Hr(Xr,{sx:{fontSize:15,color:"#37352f"},children:"\uD55C \uC0AC\uB78C\uC774 \uB3D9\uC2DC\uC5D0 \uC548\uC744 \uC218 \uC788\uB294 \uC591\uC744 \uC815\uD569\uB2C8\uB2E4. \uC774 \uAC12\uC744 \uB118\uAE30\uBA74 \uC6CC\uD06C\uB85C\uB4DC \uCC28\uD2B8\uC5D0\uC11C \uBD89\uAC8C \uD45C\uC2DC\uB429\uB2C8\uB2E4. 0 \uC73C\uB85C \uB450\uBA74 \uC6A9\uB7C9\uC744 \uC4F0\uC9C0 \uC54A\uACE0 \uD300 \uD3C9\uADE0\uC744 \uAE30\uC900\uC73C\uB85C \uBD05\uB2C8\uB2E4."}),$s(Xr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Hr(Xr,{sx:{width:104,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uC138\uB294 \uB2E8\uC704"}),Hr(J4,{size:"medium",fullWidth:!0,label:"",value:s.basis,options:e6,onChange:c=>r(o=>({...o,basis:c.target.value}))})]}),$s(Xr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Hr(Xr,{sx:{width:104,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uAE30\uBCF8 \uC6A9\uB7C9"}),Hr(Vp,{size:"medium",fullWidth:!0,min:0,max:999,thousandSeparator:!1,align:"right",suffix:t,value:s.default_capacity,onValueChange:c=>r(o=>({...o,default_capacity:Math.max(0,Math.floor(Number(c)||0))}))})]}),Hr(Xr,{sx:{pl:"119px",mt:-1.25,fontSize:13.5,color:"#37352f"},children:`\uC804\uC6D0 \uACF5\uD1B5 \uAE30\uC900(${t}) \xB7 0 = \uC6A9\uB7C9 \uC548 \uC500`}),Hr(Xr,{sx:{fontSize:16,fontWeight:700,color:"#37352f"},children:"\uC0AC\uB78C\uBCC4 \uC608\uC678"}),b.length===0?Hr(Xr,{sx:{fontSize:15,color:"#787774"},children:"\uC9C1\uC6D0 \uBAA9\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uAE30\uBCF8 \uC6A9\uB7C9\uB9CC \uC801\uC6A9\uB429\uB2C8\uB2E4."}):Hr(Xr,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:Hr(Q4,{style:{maxHeight:260},thumb:{width:6},children:b.filter(c=>Number(c.account_seq)>0).map(c=>$s(Xr,{sx:{display:"flex",alignItems:"center",gap:1.5,px:2,py:1,borderBottom:"1px solid #f2f2f0","&:last-of-type":{borderBottom:"none"}},children:[$s(Xr,{sx:{flex:1,minWidth:0,fontSize:16,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[c.name,c.department?Hr(Xr,{component:"span",sx:{ml:1,fontSize:14,color:"#787774"},children:c.department}):null]}),Hr(Xr,{sx:{width:132,flexShrink:0},children:Hr(Vp,{size:"small",fullWidth:!0,min:0,max:999,thousandSeparator:!1,align:"right",suffix:t,clearWhenZero:!0,value:s.by_account[Number(c.account_seq)]??0,onValueChange:o=>n(Number(c.account_seq),String(o??""))})})]},c.account_seq))})})]})}]})}import{Box as Bl}from"@mui/material";import{Bar as o6,BarChart as i6,CartesianGrid as s6,Cell as a6,ReferenceLine as l6,ResponsiveContainer as c6,Tooltip as u6,XAxis as f6,YAxis as d6}from"recharts";import{Box as t6}from"@mui/material";import{jsx as r6}from"react/jsx-runtime";function Wr({text:e,height:p}){return r6(t6,{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 n6}from"react";var Cl="#2f80ed",Gp="#a9c9f5",xi="#9a9a97",ju="#2e9e6b",Yn="#3d7eff",zu="#c3c8ce",Hs="#f2a30f",Ws={contentStyle:{fontSize:13.5,color:"#37352f",border:"1px solid #e6e6e3",borderRadius:6},labelStyle:{fontSize:13.5,color:"#37352f",fontWeight:700},itemStyle:{fontSize:13.5}},ts={...Ws,cursor:!1},rs={wrapperStyle:{fontSize:13.5,paddingTop:10},formatter:e=>n6("span",{style:{paddingRight:14,color:"#37352f"}},e)};function dr(e){return{display:"flex",flexDirection:"column",minHeight:0,position:"relative",...typeof e=="string"?{flex:1}:{}}}var Ar={flexShrink:0,mb:1.5,display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"};function Xn(e){return{"& *":{outline:"none"},userSelect:"none",...typeof e=="number"?{height:e,flexShrink:0}:{flex:1,minHeight:0}}}import{jsx as Rn,jsxs as Us}from"react/jsx-runtime";function h6(e,p){let b=p.filter(l=>l.sprint_seq===e.seq&&!l.archived&&l.completed);return{points:b.reduce((l,i)=>l+(i.story_points??0),0),count:b.length}}function Yp({sprints:e,tasks:p,height:b=200}){let i=[...e].sort((o,a)=>`${o.start_date}|${o.seq}`.localeCompare(`${a.start_date}|${a.seq}`)).map(o=>({sprint:o,...h6(o,p)})),s=i.some(o=>o.points>0),r=s?"SP":"\uAC74",t=i.filter(o=>o.sprint.status==="closed").map(o=>s?o.points:o.count),n=t.length>0?Math.round(t.reduce((o,a)=>o+a,0)/t.length*10)/10:null,c=i.map(o=>({\uBAA9\uD45C:`${o.sprint.name}${o.sprint.status!=="closed"?" (\uC9C4\uD589\uC911)":""}`,\uC644\uB8CC:s?o.points:o.count,closed:o.sprint.status==="closed"}));return i.length===0?Rn(Wr,{text:"\uD45C\uC2DC\uD560 \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:b}):Us(Bl,{sx:dr(b),children:[Us(Bl,{sx:{flexShrink:0,mb:1,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Us("span",{children:["\uC644\uB8CC ",s?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uBAA9\uD45C\uBCC4"]}),n!==null?Us("span",{children:["\uD3C9\uADE0(\uC885\uB8CC \uBAA9\uD45C)"," ",Rn(Bl,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:n}),r]}):null]}),Rn(Bl,{sx:Xn(b),children:Rn(c6,{width:"100%",height:"100%",children:Us(i6,{data:c,margin:{top:8,right:12,left:0,bottom:0},barCategoryGap:"28%",children:[Rn(s6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Rn(f6,{dataKey:"\uBAA9\uD45C",tick:{fontSize:13},tickMargin:6,interval:0}),Rn(d6,{tick:{fontSize:13},width:40,allowDecimals:!1}),Rn(u6,{...ts,formatter:o=>`${Number(o??0)}${r}`}),n!==null?Rn(l6,{y:n,stroke:xi,strokeDasharray:"6 5",label:{value:`\uD3C9\uADE0 ${n}${r}`,position:"right",fontSize:13}}):null,Rn(o6,{dataKey:"\uC644\uB8CC",radius:[4,4,0,0],children:c.map(o=>Rn(a6,{fill:o.closed?Cl:Gp},o.\uBAA9\uD45C))})]})})})]})}import{useMemo as p6}from"react";import{Box as Zn}from"@mui/material";import{CartesianGrid as m6,Line as Xp,LineChart as g6,ResponsiveContainer as b6,Tooltip as y6,XAxis as x6,YAxis as v6}from"recharts";import{jsx as Zr,jsxs as Go}from"react/jsx-runtime";function Zp(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?new Date(`${e}T00:00:00`):null}function w6(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function _6(e){return e.slice(5).replace("-",".")}function Jp({sprint:e,tasks:p,todayStr:b,height:l=200,headerLeft:i}){let s=p6(()=>{let a=Zp(e.start_date),f=Zp(e.end_date);if(!a||!f||f<a||Math.round((f.getTime()-a.getTime())/864e5)+1>366)return null;let u=p.filter(P=>P.sprint_seq===e.seq&&!P.archived);if(u.length===0)return{empty:!0};let g=u.some(P=>(P.story_points??0)>0),m=P=>g?P.story_points??0:1,x=u.reduce((P,L)=>P+m(L),0),_=new Map;for(let P of u){if(!P.completed)continue;let L=(P.completed_time??"").slice(0,10),q=/^\d{4}-\d{2}-\d{2}$/.test(L)?L:e.start_date;_.set(q,(_.get(q)??0)+m(P))}let B=[];for(let P=new Date(a);P<=f;P.setDate(P.getDate()+1))B.push(w6(P));let O=x,j=x;return{empty:!1,data:B.map((P,L)=>{let q=B.length===1?0:x*(1-L/(B.length-1));return P<=b&&(O-=_.get(P)??0,j=Math.max(0,O)),{\uB0A0\uC9DC:_6(P),\uC774\uC0C1:Math.round(q*10)/10,\uB0A8\uC740\uB7C9:P<=b?Math.max(0,O):null}}),total:x,usePoints:g,last:j}},[e,p,b]);if(!s)return Go(Zn,{sx:dr(l),children:[i?Zr(Zn,{sx:Ar,children:i}):null,Zr(Wr,{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:l})]});if(s.empty)return Go(Zn,{sx:dr(l),children:[i?Zr(Zn,{sx:Ar,children:i}):null,Zr(Wr,{text:"\uBC30\uC815\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]});let{data:r,total:t,usePoints:n,last:c}=s,o=n?"SP":"\uAC74";return Go(Zn,{sx:dr(l),children:[Go(Zn,{sx:Ar,children:[i?Zr(Zn,{sx:{flexShrink:0},children:i}):null,Go(Zn,{sx:{flex:1,minWidth:220,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Go("span",{children:["\uB0A8\uC740 ",n?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uCD1D ",t]}),Go("span",{children:["\uD604\uC7AC"," ",Zr(Zn,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:c}),o," \uB0A8\uC74C"]})]})]}),Zr(Zn,{sx:Xn(l),children:Zr(b6,{width:"100%",height:"100%",children:Go(g6,{data:r,margin:{top:8,right:12,left:0,bottom:0},children:[Zr(m6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Zr(x6,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),Zr(v6,{tick:{fontSize:13},width:40,allowDecimals:!1}),Zr(y6,{...Ws,formatter:a=>`${Number(a??0)}${o}`}),Zr(Xp,{type:"linear",dataKey:"\uC774\uC0C1",stroke:xi,strokeDasharray:"6 5",strokeWidth:1.5,dot:!1}),Zr(Xp,{type:"monotone",dataKey:"\uB0A8\uC740\uB7C9",stroke:Cl,strokeWidth:2.5,dot:!1,connectNulls:!1})]})})})]})}import{useMemo as im}from"react";import{Box as Jn}from"@mui/material";import{Area as $u,AreaChart as C6,CartesianGrid as B6,Legend as I6,ResponsiveContainer as M6,Tooltip as E6,XAxis as R6,YAxis as O6}from"recharts";function Co(e){let p=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())}`}function Il(e,p=new Date){let b=new Date(p);return b.setMonth(b.getMonth()-e),b}function Tq(e=new Date){return{fromDate:Co(Il(1,e)),toDate:Co(e)}}var qu=864e5,Vs=[0,1,2,3,5,8,13,21];function tm(e){return!e.archived&&!e.linked_only&&!e.is_notice&&!e.is_event}function Fu(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 l=new Date(`${b[1]}T${b[2]??"00:00"}:00`).getTime();return Number.isNaN(l)?null:l}function ns(e){let p=String(e??"").trim();return/^\d{4}-\d{2}-\d{2}/.test(p)?p.slice(0,10):""}function k6(e){let p=ns(e.created_time)||ns(e.start_date)||ns(e.completed_time);if(!p)return null;let b=ns(e.start_date),l=b&&b>p?b:p,i=e.completed?ns(e.completed_time)||p:"";return{created:p,started:l,done:i}}function rm(e,p){let b=/^\d{4}-\d{2}-\d{2}$/.test(p)?new Date(`${p}T00:00:00`):new Date,l=Math.max(2,Math.min(366,Math.round(e))),i=[];for(let s=l-1;s>=0;s-=1)i.push(Co(new Date(b.getTime()-s*qu)));return i}function nm(e,p,b){let l=rm(p,b),i=e.filter(tm).map(k6).filter(n=>n!==null),s=l.map(n=>{let c=0,o=0,a=0;for(let f of i)f.created>n||(f.done&&f.done<=n?c+=1:f.started<=n?o+=1:a+=1);return{day:n,done:c,inProgress:o,waiting:a}}),r=s[s.length-1],t=s.reduce((n,c)=>Math.max(n,c.done+c.inProgress+c.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 S6(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 Qp(e){if(e.length===0)return null;let p=[...e].sort((s,r)=>s-r),b=s=>Math.round(s*10)/10,l=Math.floor(p.length/2),i=p.length%2===1?p[l]:(p[l-1]+p[l])/2;return{count:p.length,median:b(i),average:b(p.reduce((s,r)=>s+r,0)/p.length),p85:b(S6(p,.85))}}function em(e){for(let p=Vs.length-1;p>=0;p-=1)if(e>=Vs[p])return p;return 0}function T6(){return Vs.map((e,p)=>p===Vs.length-1?`${e}\uC77C+`:`${e}~${Vs[p+1]}\uC77C`)}function om(e,p,b){let l=rm(p,b),i=l[0],s=l[l.length-1],r=T6(),t=r.map(()=>0),n=r.map(()=>0),c=[],o=[];for(let a of e){if(!tm(a)||!a.completed)continue;let f=ns(a.completed_time);if(!f||f<i||f>s)continue;let d=Fu(a.completed_time),u=Fu(a.created_time);if(d===null||u===null)continue;let g=Math.max(0,(d-u)/qu);c.push(g),t[em(g)]+=1;let m=Fu(a.start_date);if(m===null||m>d)continue;let x=Math.max(0,(d-Math.max(m,u))/qu);o.push(x),n[em(x)]+=1}return{labels:r,leadCounts:t,cycleCounts:n,lead:Qp(c),cycle:Qp(o)}}import{jsx as Ur,jsxs as Yo}from"react/jsx-runtime";function A6(e){return e.slice(5).replace("-",".")}function sm({tasks:e,todayStr:p,days:b=30,height:l=220,headerLeft:i}){let s=im(()=>nm(e,b,p),[e,b,p]),r=im(()=>s.points.map(n=>({\uB0A0\uC9DC:A6(n.day),\uC644\uB8CC:n.done,\uC9C4\uD589:n.inProgress,\uB300\uAE30:n.waiting})),[s]),t=Yo(Jn,{sx:Ar,children:[i?Ur(Jn,{sx:{flexShrink:0},children:i}):null,Yo(Jn,{sx:{flex:1,minWidth:220,display:"flex",flexDirection:"column",gap:.5},children:[Yo(Jn,{sx:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Yo("span",{children:["\uCD5C\uADFC ",s.points.length,"\uC77C \u2014 \uC811\uC218 ",s.currentTotal,"\uAC74 / \uC644\uB8CC ",s.currentDone,"\uAC74"]}),Yo("span",{children:["\uC9C4\uD589 \uC911"," ",Ur(Jn,{component:"span",sx:{color:Yn,fontWeight:700},children:s.currentWip}),"\uAC74"]})]}),Ur(Jn,{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?Yo(Jn,{sx:dr(l),children:[i?Ur(Jn,{sx:Ar,children:i}):null,Ur(Wr,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC811\uC218\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]}):Yo(Jn,{sx:dr(l),children:[t,Ur(Jn,{sx:Xn(l),children:Ur(M6,{width:"100%",height:"100%",children:Yo(C6,{data:r,margin:{top:8,right:12,left:0,bottom:4},children:[Ur(B6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Ur(R6,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),Ur(O6,{tick:{fontSize:13},width:40,allowDecimals:!1}),Ur(E6,{...Ws,formatter:n=>`${Number(n??0)}\uAC74`}),Ur(I6,{...rs}),Ur($u,{type:"monotone",dataKey:"\uC644\uB8CC",stackId:"flow",stroke:ju,fill:ju,fillOpacity:.9}),Ur($u,{type:"monotone",dataKey:"\uC9C4\uD589",stackId:"flow",stroke:Yn,fill:Yn,fillOpacity:.85}),Ur($u,{type:"monotone",dataKey:"\uB300\uAE30",stackId:"flow",stroke:zu,fill:zu,fillOpacity:.9})]})})})]})}import{useMemo as am}from"react";import{Box as Jr}from"@mui/material";import{Bar as lm,BarChart as D6,CartesianGrid as P6,Legend as N6,ResponsiveContainer as L6,Tooltip as j6,XAxis as z6,YAxis as F6}from"recharts";import{jsx as vr,jsxs as bn}from"react/jsx-runtime";function cm({label:e,color:p,summary:b}){let l=bn(Jr,{sx:{display:"flex",alignItems:"center",gap:.75},children:[vr(Jr,{sx:{width:10,height:10,borderRadius:.5,bgcolor:p,flexShrink:0}}),vr(Jr,{component:"span",sx:{fontWeight:700,color:"#37352f"},children:e})]});return b?bn(Jr,{sx:{display:"contents"},children:[l,bn("span",{children:[b.count,"\uAC74"]}),bn("span",{children:["\uC911\uC559\uAC12"," ",vr(Jr,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:b.median}),"\uC77C"]}),bn("span",{children:["\uD3C9\uADE0 ",b.average,"\uC77C"]}),bn("span",{children:["85% ",b.p85,"\uC77C \uC774\uB0B4"]})]}):bn(Jr,{sx:{display:"contents"},children:[l,vr(Jr,{component:"span",sx:{gridColumn:"span 4",color:"#9a9a97"},children:"\uD45C\uBCF8 \uC5C6\uC74C"})]})}function um({tasks:e,todayStr:p,days:b=30,height:l=200,headerLeft:i}){let s=am(()=>om(e,b,p),[e,b,p]),r=am(()=>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?bn(Jr,{sx:dr(l),children:[bn(Jr,{sx:Ar,children:[i?vr(Jr,{sx:{flexShrink:0},children:i}):null,bn(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:[vr(cm,{label:"\uB9AC\uB4DC\uD0C0\uC784(\uC791\uC131\u2192\uC644\uB8CC)",color:Yn,summary:s.lead}),vr(cm,{label:"\uC0AC\uC774\uD074\uD0C0\uC784(\uC2DC\uC791\u2192\uC644\uB8CC)",color:Hs,summary:s.cycle})]})]}),vr(Jr,{sx:Xn(l),children:vr(L6,{width:"100%",height:"100%",children:bn(D6,{data:r,margin:{top:8,right:12,left:0,bottom:4},barCategoryGap:"24%",children:[vr(P6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),vr(z6,{dataKey:"\uAD6C\uAC04",tick:{fontSize:13},tickMargin:6,interval:0}),vr(F6,{tick:{fontSize:13},width:40,allowDecimals:!1}),vr(j6,{...ts,formatter:t=>`${Number(t??0)}\uAC74`}),vr(N6,{...rs}),vr(lm,{dataKey:"\uB9AC\uB4DC\uD0C0\uC784",fill:Yn,radius:[3,3,0,0]}),vr(lm,{dataKey:"\uC0AC\uC774\uD074\uD0C0\uC784",fill:Hs,radius:[3,3,0,0]})]})})})]}):bn(Jr,{sx:dr(l),children:[i?vr(Jr,{sx:Ar,children:i}):null,vr(Wr,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC644\uB8CC\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]})}import{useMemo as pm}from"react";import{Box as vi}from"@mui/material";import{Bar as Wu,BarChart as U6,CartesianGrid as V6,Cell as K6,Legend as G6,ReferenceLine as mm,ResponsiveContainer as Y6,Tooltip as X6,XAxis as Z6,YAxis as J6}from"recharts";function q6(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(),l=new Date(`${p}T00:00:00`).getTime();return Number.isNaN(b)||Number.isNaN(l)?null:Math.round((l-b)/864e5)}function $6(e,p,b){let l=String(e.due_date??"").slice(0,10),i=q6(p,l);return i===null?"later":i<0?"overdue":i<=b?"soon":"later"}function Ml(e,p){let{todayStr:b,soonDays:l=7,includeUnassigned:i=!0,limit:s,capacity:r}=p,t=r??ro,n=new Map;for(let o of e){if(o.completed||o.archived||o.is_notice||o.is_event||o.linked_only)continue;let a=Number(o.manager_account_seq??0);if(!a&&!i)continue;let f=a?String(o.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",d=n.get(a)??{accountSeq:a,name:f,overdue:0,soon:0,later:0,total:0,points:0,capacity:0,load:0,ratio:0};d[$6(o,b,l)]+=1,d.total+=1,d.points+=Number(o.story_points??0)||0,n.set(a,d)}for(let o of n.values())o.capacity=H6(o.accountSeq,t),o.load=t.basis==="points"?o.points:o.total,o.ratio=o.capacity>0?o.load/o.capacity:0;let c=[...n.values()].sort((o,a)=>o.accountSeq===0!=(a.accountSeq===0)?o.accountSeq===0?1:-1:o.overdue!==a.overdue?a.overdue-o.overdue:o.total!==a.total?a.total-o.total:o.name.localeCompare(a.name));return typeof s=="number"&&s>0?c.slice(0,s):c}function El(e,p){return e.filter(b=>b.completed||b.archived||b.is_notice||b.is_event||b.linked_only?!1:Number(b.manager_account_seq??0)===p).sort((b,l)=>{let i=String(b.due_date??"").slice(0,10),s=String(l.due_date??"").slice(0,10);return!i!=!s?i?-1:1:i!==s?i.localeCompare(s):String(b.title??"").localeCompare(String(l.title??""))})}function H6(e,p){if(!(e>0))return 0;let b=Math.max(0,Math.floor(Number(p.by_account?.[e])||0));return b>0?b:Math.max(0,Math.floor(Number(p.default_capacity)||0))}function Rl(e){return e.capacity>0&&e.load>e.capacity}function fm(e,p){return p>0&&e.total>=p}function dm(e){let p=e.filter(b=>b.accountSeq>0);return p.length===0?0:p.reduce((b,l)=>b+l.total,0)/p.length}function Hu(e,p){let b=new Date(`${e}T00:00:00`);b.setDate(b.getDate()+p);let l=i=>String(i).padStart(2,"0");return`${b.getFullYear()}-${l(b.getMonth()+1)}-${l(b.getDate())}`}function W6(e){let p=new Date(`${e}T00:00:00`);if(Number.isNaN(p.getTime()))return e;let b=(p.getDay()+6)%7;return Hu(e,-b)}function hm(e,p){let{todayStr:b,includeUnassigned:l=!0,weeks:i=6,limit:s}=p,r=W6(b),t=Array.from({length:Math.max(1,i)},(d,u)=>{let g=Hu(r,u*7),m=Hu(g,6),[,x,_]=g.split("-");return{start:g,end:m,label:`${Number(x)}/${Number(_)}`,isCurrent:u===0}}),n=t[t.length-1].end,c=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&&!l)continue;let g=u?String(d.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",m=c.get(u)??{accountSeq:u,name:g,overdue:0,byWeek:new Array(t.length).fill(0),noDue:0,total:0,beyond:0},x=String(d.due_date??"").slice(0,10);if(m.total+=1,!/^\d{4}-\d{2}-\d{2}$/.test(x))m.noDue+=1;else if(x<b)m.overdue+=1;else if(x>n)m.beyond+=1;else{let _=t.findIndex(B=>x>=B.start&&x<=B.end);_>=0?m.byWeek[_]+=1:m.beyond+=1}c.set(u,m)}let o=[...c.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?o.slice(0,s):o,f=a.reduce((d,u)=>Math.max(d,u.overdue,u.noDue,...u.byWeek),0);return{weeks:t,rows:a,maxCell:f}}import{Fragment as gm,jsx as wr,jsxs as Xo}from"react/jsx-runtime";var Ks="#e5484d";function bm({tasks:e,todayStr:p,soonDays:b=7,overloadThreshold:l=0,capacity:i=ro,height:s=200,headerLeft:r,selectedAccountSeq:t=0,onSelectPerson:n}){let c=pm(()=>Ml(e,{todayStr:p,soonDays:b,capacity:i}),[e,p,b,i]),o=pm(()=>dm(c),[c]),a=l>0?l:Math.max(3,Math.ceil(o*1.5)),f=i.default_capacity>0||Object.keys(i.by_account).length>0,d=i.basis==="points"?"SP":"\uAC74",u=c.filter(g=>g.accountSeq>0&&(f?Rl(g):fm(g,a))).length;return c.length===0?Xo(vi,{sx:dr(s),children:[r?wr(vi,{sx:Ar,children:r}):null,wr(Wr,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:s})]}):Xo(vi,{sx:dr(s),children:[Xo(vi,{sx:Ar,children:[r,Xo(vi,{sx:{fontSize:13.5,color:"#37352f"},children:["1\uC778 \uD3C9\uADE0 ",wr("b",{children:o.toFixed(1)}),"\uAC74 \xB7"," ",f?Xo(gm,{children:["\uC6A9\uB7C9 ",wr("b",{children:i.default_capacity||"\uAC1C\uC778\uBCC4"}),i.default_capacity?d:""]}):Xo(gm,{children:["\uACFC\uBD80\uD558 \uAE30\uC900 ",wr("b",{children:a}),"\uAC74"]}),u>0?Xo(vi,{component:"span",sx:{ml:1,color:Ks,fontWeight:700},children:["\uCD08\uACFC ",u,"\uBA85"]}):null]})]}),wr(vi,{sx:Xn(s),children:wr(Y6,{width:"100%",height:"100%",children:Xo(U6,{data:c,layout:"vertical",onClick:n?g=>{let m=c.find(x=>x.name===String(g?.activeLabel??""));m&&n(m.accountSeq===t?0:m.accountSeq)}:void 0,style:n?{cursor:"pointer"}:void 0,margin:{top:4,right:16,bottom:4,left:8},barCategoryGap:c.length>8?4:10,children:[wr(V6,{strokeDasharray:"3 3",horizontal:!1,stroke:"#eceae6"}),wr(Z6,{type:"number",allowDecimals:!1,tick:{fontSize:12}}),wr(J6,{type:"category",dataKey:"name",width:84,tick:{fontSize:12},interval:0}),wr(X6,{...ts,formatter:(g,m)=>[`${Number(g)||0}\uAC74`,String(m)],labelFormatter:g=>{let m=c.find(x=>x.name===g);return!m||!(m.capacity>0)?String(g):`${g} \u2014 \uC6A9\uB7C9 ${m.capacity}${d} \uC911 ${m.load} (${Math.round(m.ratio*100)}%)`}}),wr(G6,{...rs}),o>0?wr(mm,{x:o,stroke:xi,strokeDasharray:"4 4",label:{value:"\uD3C9\uADE0",position:"top",fontSize:11,fill:xi}}):null,i.default_capacity>0?wr(mm,{x:i.default_capacity,stroke:Ks,strokeDasharray:"2 3",label:{value:"\uC6A9\uB7C9",position:"top",fontSize:11,fill:Ks}}):null,wr(Wu,{dataKey:"overdue",name:"\uC9C0\uC5F0",stackId:"load",fill:Ks}),wr(Wu,{dataKey:"soon",name:`\uC784\uBC15(${b}\uC77C)`,stackId:"load",fill:Hs}),wr(Wu,{dataKey:"later",name:"\uC5EC\uC720",stackId:"load",fill:Yn,radius:[0,3,3,0],children:c.map(g=>wr(K6,{fill:f&&Rl(g)?Ks:Yn,fillOpacity:f&&Rl(g)?.45:1,stroke:g.accountSeq===t?"#37352f":void 0,strokeWidth:g.accountSeq===t?1.5:0},g.accountSeq))})]})})})]})}import{useEffect as sk,useState as ak}from"react";import{Box as lk,Button as ck}from"@mui/material";import{FormDialog as uk}from"@ehfuse/mui-form-dialog";import{useState as Q6}from"react";import{Box as hr,Button as ek,Menu as tk,MenuItem as rk}from"@mui/material";import nk from"@mui/icons-material/PersonOutlineOutlined";import ok from"@ehfuse/overlay-scrollbar";import{jsx as Sr,jsxs as Bo}from"react/jsx-runtime";var ym=56,xm=68,vm=96;function ik(e){let p=String(e.due_date??"").slice(0,10);return p?p.slice(5).replace("-","/"):"-"}function wm(e,p){let b=String(e.due_date??"").slice(0,10);return!!b&&b<p}function _m({tasks:e,row:p,todayStr:b,employees:l,rows:i,height:s=200,hideSummary:r=!1,onChangeManager:t,onOpenTask:n}){let[c,o]=Q6(null),a=El(e,p.accountSeq),f=d=>i.find(u=>u.accountSeq===d)?.total??0;return Bo(hr,{sx:{display:"flex",flexDirection:"column",minHeight:0,height:s},children:[r?null:Bo(hr,{sx:{display:"flex",alignItems:"center",gap:1,px:.5,pb:.75,fontSize:14,color:"#37352f"},children:[Sr(hr,{component:"span",sx:{fontWeight:700},children:p.name}),Bo(hr,{component:"span",children:["\uBBF8\uC644\uB8CC ",a.length,"\uAC74"]}),p.capacity>0?Bo(hr,{component:"span",sx:{color:p.load>p.capacity?"#e5484d":"#787774"},children:["\xB7 \uC6A9\uB7C9 ",p.capacity," \uC911 ",p.load]}):null]}),Bo(hr,{sx:{flex:1,minHeight:0,display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:[Bo(hr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,flexShrink:0,bgcolor:"#fafaf9",borderBottom:"1px solid #e6e6e3",fontSize:13.5,fontWeight:600,color:"#37352f"},children:[Sr(hr,{sx:{width:ym,flexShrink:0},children:"\uB9C8\uAC10"}),Sr(hr,{sx:{flex:1,minWidth:0},children:"\uC5C5\uBB34"}),Sr(hr,{sx:{width:xm,flexShrink:0,textAlign:"center"},children:"\uC911\uC694\uB3C4"}),t?Sr(hr,{sx:{width:vm,flexShrink:0,textAlign:"center"},children:"\uCC45\uC784\uC790"}):null]}),Sr(hr,{sx:{flex:1,minHeight:0},children:Sr(ok,{style:{height:"100%"},thumb:{width:6},children:a.length===0?Sr(hr,{sx:{p:2,fontSize:14,color:"#9a9a97"},children:"\uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):a.map(d=>Bo(hr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1.5,borderBottom:"1px solid #f2f2f0"},children:[Sr(hr,{sx:{width:ym,flexShrink:0,fontSize:13.5,color:wm(d,b)?"#e5484d":"#787774",fontWeight:wm(d,b)?700:400},children:ik(d)}),Sr(hr,{onClick:n?()=>n(d.seq):void 0,sx:{flex:1,minWidth:0,fontSize:14.5,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...n?{cursor:"pointer","&:hover":{textDecoration:"underline"}}:{}},children:d.title}),Sr(hr,{sx:{width:xm,flexShrink:0,display:"flex",justifyContent:"center"},children:Sr(Nr,{priority:d.priority})}),t?Sr(hr,{sx:{width:vm,flexShrink:0,display:"flex",justifyContent:"center"},children:Sr(ek,{size:"small",variant:"outlined",startIcon:Sr(nk,{sx:{fontSize:17}}),onClick:u=>o({el:u.currentTarget,taskSeq:d.seq}),children:"\uC62E\uAE30\uAE30"})}):null]},d.seq))})})]}),Sr(tk,{anchorEl:c?.el??null,open:!!c,onClose:()=>o(null),transitionDuration:0,children:l.filter(d=>Number(d.account_seq)>0&&Number(d.account_seq)!==p.accountSeq).map(d=>Bo(rk,{onClick:()=>{c&&t&&t(c.taskSeq,Number(d.account_seq),d.name),o(null)},sx:{fontSize:14,minWidth:200},children:[Sr(hr,{sx:{flex:1},children:d.name}),Bo(hr,{component:"span",sx:{ml:2,fontSize:13,color:"#787774"},children:[f(Number(d.account_seq)),"\uAC74"]})]},d.account_seq))})]})}import{jsx as Ol}from"react/jsx-runtime";function km({open:e,row:p,rows:b,tasks:l,todayStr:i,employees:s,onClose:r,onChangeManager:t,onOpenTask:n}){let[c,o]=ak(p);sk(()=>{p&&o(p)},[p]);let a=p??c,f=a?El(l,a.accountSeq).length:0;return Ol(uk,{open:e,onClose:r,maxWidth:"sm",title:a?`${a.name} \uC5C5\uBB34 (${f})`:"\uC5C5\uBB34",locale:"ko",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-workload-person",tabs:{visible:!1},actions:{showCancelButton:!1,right:Ol(ck,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})},sections:[{id:"person-tasks",title:"",showTitle:!1,children:Ol(lk,{sx:{minHeight:0},children:a?Ol(_m,{tasks:l,row:a,rows:b,todayStr:i,employees:s,height:"min(420px, 52vh)",hideSummary:!0,onChangeManager:t,onOpenTask:n}):null})}]})}import{useMemo as fk}from"react";import{Box as sn,Tooltip as dk}from"@mui/material";import{OverlayScrollbar as hk}from"@ehfuse/overlay-scrollbar";import{jsx as Vr,jsxs as Dl}from"react/jsx-runtime";var Sm="#e5484d",pk="#2f80ed",mk="#9a9a97",Uu=30,gk=96,Al=56;function Vu({count:e,max:p,color:b,title:l}){let i=e>0&&p>0?.18+e/p*.72:0;return Vr(dk,{title:l,arrow:!0,disableInteractive:!0,placement:"top",children:Vr(sn,{sx:{display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #ececea",borderBottom:"1px solid #ececea",bgcolor:i>0?`${b}${Math.round(i*255).toString(16).padStart(2,"0")}`:"transparent",color:i>.55?"#fff":"#37352f",fontSize:12.5,fontWeight:e>0?700:400,fontVariantNumeric:"tabular-nums"},children:e>0?e:""})})}function Tm({tasks:e,todayStr:p,weeks:b=6,height:l=200}){let i=fk(()=>hm(e,{todayStr:p,weeks:b}),[e,p,b]);if(i.rows.length===0)return Vr(sn,{sx:dr(l),children:Vr(Wr,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})});let s=`${gk}px ${Al}px repeat(${i.weeks.length}, minmax(${Al}px, 1fr)) ${Al}px ${Al}px`,r={height:Uu,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 Vr(sn,{sx:dr(l),children:Vr(hk,{style:{height:"100%"},thumb:{width:8},children:Dl(sn,{sx:{display:"grid",gridTemplateColumns:s,minWidth:"fit-content",height:"100%",gridTemplateRows:`${Uu}px repeat(${i.rows.length}, minmax(${Uu}px, 1fr))`},children:[Vr(sn,{sx:{...r,justifyContent:"flex-start",pl:1},children:"\uB2F4\uB2F9\uC790"}),Vr(sn,{sx:{...r,color:Sm},children:"\uC9C0\uC5F0"}),i.weeks.map(t=>Vr(sn,{sx:{...r,...t.isCurrent?{borderBottom:"2px solid #2f80ed"}:{}},children:t.label},t.start)),Vr(sn,{sx:r,children:"\uB9C8\uAC10\uC5C6\uC74C"}),Vr(sn,{sx:r,children:"\uD569\uACC4"}),i.rows.map(t=>Dl(sn,{sx:{display:"contents"},children:[Vr(sn,{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}),Vr(Vu,{count:t.overdue,max:i.maxCell,color:Sm,title:`${t.name} \xB7 \uC9C0\uC5F0 ${t.overdue}\uAC74`}),t.byWeek.map((n,c)=>Vr(Vu,{count:n,max:i.maxCell,color:pk,title:`${t.name} \xB7 ${i.weeks[c].label} \uC8FC \uB9C8\uAC10 ${n}\uAC74`},i.weeks[c].start)),Vr(Vu,{count:t.noDue,max:i.maxCell,color:mk,title:`${t.name} \xB7 \uB9C8\uAC10 \uBBF8\uC815 ${t.noDue}\uAC74`}),Dl(sn,{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?Dl(sn,{component:"span",sx:{ml:.25,fontSize:10.5,color:"#9a9a97"},children:["(+",t.beyond,")"]}):null]})]},t.accountSeq))]})})})}import{Fragment as Im,jsx as Jt,jsxs as Pl}from"react/jsx-runtime";var Mm="min(560px, 62vh)",vk=`calc(${Mm} - 4px)`,wk=[{value:"30",label:"\uCD5C\uADFC 30\uC77C"},{value:"60",label:"\uCD5C\uADFC 60\uC77C"},{value:"90",label:"\uCD5C\uADFC 90\uC77C"}];function H$({open:e,sprints:p,tasks:b,todayStr:l,showSprintCharts:i,capacity:s=ro,capacityEmployees:r=[],onSaveCapacity:t,onChangeTaskManager:n,onOpenTask:c,initialSprintSeq:o=0,onClose:a}){let[f,d]=Gs(0),[u,g]=Gs(30);bk(()=>{if(!e)return;let y=p.find(w=>w.status==="active")??p[0],v=p.find(w=>w.seq===o)??y;d(v?.seq??0)},[e]);let m=Cm(()=>p.find(y=>y.seq===f)??null,[p,f]),x={height:vk,boxSizing:"border-box",px:3,py:2.5,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden"},_=Jt(Ku,{label:"\uBAA9\uD45C",showLabel:!1,showEmptyOption:!1,value:f?String(f):"",options:p.map(y=>({value:String(y.seq),label:hn(y)})),onChange:y=>d(Number(y.target.value)||0),sx:{width:280,flexShrink:0}}),[B,O]=Gs("distribution"),j=Jt(Ku,{label:"\uBCF4\uAE30",showLabel:!1,showEmptyOption:!1,value:B,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:y=>O(y.target.value==="timeline"?"timeline":"distribution"),sx:{width:280,flexShrink:0}}),[D,P]=Gs(!1),[L,q]=Gs(0),N=Cm(()=>Ml(b,{todayStr:l,capacity:s}),[b,l,s]),S=N.find(y=>y.accountSeq===L)??null,C=Pl(Im,{children:[j,t?Jt(Bm,{size:"small",variant:"outlined",startIcon:Jt(xk,{sx:{fontSize:18}}),onClick:()=>P(!0),sx:{flexShrink:0},children:"\uC6A9\uB7C9"}):null]}),M=i??p.length>0,h=Jt(Ku,{label:"\uAE30\uAC04",showLabel:!1,showEmptyOption:!1,value:String(u),options:wk,onChange:y=>g(Number(y.target.value)||30),sx:{width:280,flexShrink:0}});return Pl(Im,{children:[Jt(yk,{open:e,onClose:a,maxWidth:"md",title:"\uC5C5\uBB34 \uCC28\uD2B8",locale:"ko",contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,sectionTitleGap:0,fixedHeight:Mm,contentBottomPadding:0,scrollPastLastSection:!1,tabs:{visible:!0,switchContent:!0,fullWidth:!0},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-charts",sections:[...M?[{id:"velocity",tabTitle:"\uBCA8\uB85C\uC2DC\uD2F0",showTitle:!1,children:Jt(Io,{sx:x,children:Jt(Yp,{sprints:p,tasks:b,height:"100%"})})},{id:"burndown",tabTitle:"\uBC88\uB2E4\uC6B4",showTitle:!1,children:Jt(Io,{sx:x,children:m?Jt(Jp,{sprint:m,tasks:b,todayStr:l,height:"100%",headerLeft:_}):Pl(Io,{sx:dr("100%"),children:[Jt(Io,{sx:Ar,children:_}),Jt(Wr,{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:Jt(Io,{sx:x,children:Jt(sm,{tasks:b,todayStr:l,days:u,height:"100%",headerLeft:h})})}]:[],{id:"workload",tabTitle:"\uC6CC\uD06C\uB85C\uB4DC",showTitle:!1,children:Jt(Io,{sx:x,children:B==="timeline"?Pl(Io,{sx:{display:"flex",flexDirection:"column",height:"100%",minHeight:0},children:[Jt(Io,{sx:Ar,children:C}),Jt(Tm,{tasks:b,todayStr:l,height:"100%"})]}):Jt(bm,{tasks:b,todayStr:l,height:"100%",capacity:s,headerLeft:C,selectedAccountSeq:L,onSelectPerson:n?q:void 0})})},{id:"lead-time",tabTitle:"\uB9AC\uB4DC\uD0C0\uC784",showTitle:!1,children:Jt(Io,{sx:x,children:Jt(um,{tasks:b,todayStr:l,days:u,height:"100%",headerLeft:h})})}],actions:{showCancelButton:!1,right:Jt(Bm,{variant:"contained",onClick:a,children:"\uB2EB\uAE30"})}}),Jt(km,{open:L>0,row:S,rows:N,tasks:b,todayStr:l,employees:r,onClose:()=>q(0),onChangeManager:n,onOpenTask:c}),t?Jt(Kp,{open:D,capacity:s,employees:r,onClose:()=>P(!1),onSave:async y=>{await t(y),P(!1)}}):null]})}import{Checkbox as _k,Divider as kk,Menu as Sk,MenuItem as Gu}from"@mui/material";import{jsx as Ys,jsxs as Em}from"react/jsx-runtime";function G$({anchorEl:e,candidates:p,selectedNames:b,avatarSrcByName:l,onToggle:i,onClear:s,onClose:r}){return Em(Sk,{anchorEl:e,open:!!e,onClose:r,transitionDuration:0,children:[p.length===0?Ys(Gu,{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 Em(Gu,{onClick:()=>i(t),sx:{fontSize:14,minWidth:170,gap:1},children:[Ys(_k,{size:"small",checked:n,sx:{p:0}}),Ys(Lr,{names:[t.name],size:20,avatarSrcByName:l}),t.name]},`${t.accountSeq}-${t.name}`)}),Ys(kk,{}),Ys(Gu,{disabled:b.length===0,onClick:s,sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{useState as Tk}from"react";import{ButtonBase as Ck,Menu as Bk,MenuItem as Ik}from"@mui/material";import Mk from"@mui/icons-material/KeyboardArrowDown";import Ek from"@mui/icons-material/Check";import{Fragment as Rk,jsx as Yu,jsxs as Xu}from"react/jsx-runtime";function rH({value:e,onChange:p,options:b}){let[l,i]=Tk(null),s=b??dc,r=dc.find(t=>t.value===e)?.label??"";return Xu(Rk,{children:[Xu(Ck,{onClick:t=>i(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,Yu(Mk,{sx:{fontSize:17,color:"#9a9a97"}})]}),Yu(Bk,{transitionDuration:0,anchorEl:l,open:!!l,onClose:()=>i(null),children:s.map(t=>Xu(Ik,{selected:t.value===e,onClick:()=>{p(t.value),i(null)},sx:{fontSize:14,minWidth:140,justifyContent:"space-between",gap:1},children:[t.label,t.value===e?Yu(Ek,{sx:{fontSize:16,color:"#2f80ed"}}):null]},t.value))})]})}import{Box as Nl,ButtonBase as Ok}from"@mui/material";import{DateTextField as Rm}from"@ehfuse/mui-form-controls";import{jsx as Xs,jsxs as Om}from"react/jsx-runtime";var Ak=[{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 Am({fromDate:e,toDate:p,onChange:b}){let l=s=>{if(s<=0){b("","");return}b(Co(Il(s)),Co(new Date))},i=s=>s<=0?!e&&!p:!e||!p?!1:e===Co(Il(s))&&p===Co(new Date);return Om(Nl,{sx:{display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[Xs(Nl,{sx:{display:"flex",alignItems:"center",gap:1.5},children:Ak.map(s=>{let r=i(s.months);return Xs(Ok,{onClick:()=>l(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)})}),Om(Nl,{sx:{display:"flex",alignItems:"center",gap:.5},children:[Xs(Rm,{value:e,size:"small",placeholder:"\uC2DC\uC791\uC77C",onChange:s=>b(s.target.value,p),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}}),Xs(Nl,{component:"span",sx:{fontSize:13,color:"#9a9a97"},children:"~"}),Xs(Rm,{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 Dk}from"@mui/material";import{jsx as Dm}from"react/jsx-runtime";function dH({anchorEl:e,fromDate:p,toDate:b,onChange:l,onClose:i}){return Dm(Dk,{transitionDuration:0,anchorEl:e,open:!!e,onClose:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{p:1.5}}},children:Dm(Am,{fromDate:p,toDate:b,onChange:l})})}import{Box as Pk,ButtonBase as Nk,Tab as Lk,Tabs as jk}from"@mui/material";import zk from"@mui/icons-material/Checklist";import Fk from"@mui/icons-material/Face";import qk from"@mui/icons-material/Publish";import $k from"@mui/icons-material/NotificationsOutlined";import Hk from"@mui/icons-material/BugReportOutlined";import Wk from"@mui/icons-material/DescriptionOutlined";import Uk from"@mui/icons-material/Inventory2Outlined";import{jsx as On}from"react/jsx-runtime";function Pm(e,p){return p>0?`${e} (${p})`:e}var TH=[{id:"my",label:"\uC804\uCCB4",icon:On(zk,{sx:{fontSize:18}})},{id:"mine",label:"\uB0B4 \uC5C5\uBB34",icon:On(Fk,{sx:{fontSize:18}})},{id:"sent",label:"\uBCF4\uB0B8 \uC5C5\uBB34",icon:On(qk,{sx:{fontSize:18}})},{id:"bug",label:"\uC624\uB958",icon:On(Hk,{sx:{fontSize:18}})},{id:"notice",label:"\uACF5\uC9C0\uC0AC\uD56D",icon:On($k,{sx:{fontSize:18}})},{id:"archive",label:"\uBCF4\uAD00\uD568",icon:On(Uk,{sx:{fontSize:18}}),hideCount:!0},{id:"report",label:"\uBCF4\uACE0\uC11C",icon:On(Wk,{sx:{fontSize:18}}),hideCount:!0}];function Vk(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 CH({items:e,activeTab:p,counts:b,onChange:l,compact:i=!1}){let s=ct(),r=Vk(s.tabs),t=e;return i?On(Pk,{sx:{display:"flex",flexWrap:"wrap",gap:1.25},children:t.map(n=>{let c=p===n.id;return On(Nk,{onClick:()=>l(n.id),sx:{px:1.5,py:.75,borderRadius:1,fontSize:kr(13.5),fontWeight:500,whiteSpace:"nowrap",border:"1px solid",bgcolor:c?s.tabs.selectedBg:s.tabs.bg,color:c?s.tabs.selectedColor:s.tabs.color,borderColor:c?s.tabs.selectedBg:s.tabs.borderColor},children:Pm(n.label,n.hideCount?0:b[n.id]??0)},n.id)})}):On(jk,{value:p,onChange:(n,c)=>l(c),sx:{minHeight:46,"& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:"12px",minHeight:46}},children:t.map(n=>On(Lk,{value:n.id,label:Pm(n.label,n.hideCount?0:b[n.id]??0),icon:n.icon,iconPosition:"start",sx:r},n.id))})}import{useEffect as Kk,useMemo as Gk,useState as Zu}from"react";import{Divider as Ll,ListItemIcon as Kr,Menu as Ju,MenuItem as _r}from"@mui/material";import Yk from"@mui/icons-material/OpenInNewOutlined";import Xk from"@mui/icons-material/RestoreFromTrashOutlined";import Zk from"@mui/icons-material/Check";import Jk from"@mui/icons-material/CheckCircleOutlined";import Qk from"@mui/icons-material/RadioButtonUnchecked";import e8 from"@mui/icons-material/SendOutlined";import t8 from"@mui/icons-material/EventOutlined";import r8 from"@mui/icons-material/PersonOutlineOutlined";import n8 from"@mui/icons-material/ViewKanbanOutlined";import o8 from"@mui/icons-material/ContentCopyOutlined";import i8 from"@mui/icons-material/NextPlanOutlined";import s8 from"@mui/icons-material/ContentPasteOutlined";import a8 from"@mui/icons-material/ShareOutlined";import l8 from"@mui/icons-material/DirectionsRunOutlined";import Nm from"@mui/icons-material/ChevronRight";import c8 from"@mui/icons-material/ArchiveOutlined";import u8 from"@mui/icons-material/UnarchiveOutlined";import{ConfirmDialog as Lm}from"@ehfuse/alerts";import{Fragment as jm,jsx as ut,jsxs as pr}from"react/jsx-runtime";function nW({target:e,onClose:p,customTabs:b,sprints:l=[],myAccountSeq:i=0,onOpenDetail:s,onToggleCompleted:r,onRequestConfirm:t,onChangeDueDate:n,onChangeReminder:c,onMemberEdit:o,onMoveProject:a,onDuplicate:f,onCreateFollowUp:d,onShare:u,onAssignSprint:g,onArchiveToggle:m,onDelete:x,onRestore:_,onPurge:B}){let O=Nt(),j=Dn(),[D,P]=Zu(null),[L,q]=Zu(null),[N,S]=Zu(null);Kk(()=>{e||(P(null),q(null),S(null))},[e]);let C=e?.task??null,M=!!C?.is_notice,h=!!C?.is_event,y=C?!io(C,i):!1,v=!!C?.deleted,w=Gk(()=>new Set(b.filter(F=>F.useSprints).map(F=>F.key)),[b]),k=async(F="one")=>{let $=C;if(p(),!$)return;await Lm({title:"\uC5C5\uBB34 \uC0AD\uC81C",message:F==="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?`})&&x($.seq,F)},T=async()=>{let F=C;if(p(),!F)return;await Lm({title:"\uC601\uAD6C \uC0AD\uC81C",message:`"${F.title}" \uC5C5\uBB34\uB97C \uC601\uAD6C\uD788 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C? \uB418\uB3CC\uB9B4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.`})&&B?.(F.seq)},E=()=>{C&&m(C.seq,!C.archived),p()};return pr(jm,{children:[pr(Ju,{open:!!e,onClose:p,transitionDuration:0,anchorReference:O?"none":"anchorPosition",anchorPosition:!O&&e?{top:e.position.top,left:e.position.left}:void 0,slotProps:{paper:{sx:{minWidth:190,...O?{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxHeight:"70vh"}:{}}},list:O?{sx:{"& .MuiMenuItem-root":{py:1,minHeight:0}}}:void 0},children:[pr(_r,{onClick:()=>{C&&s(C),p()},sx:{fontSize:14},children:[ut(Kr,{children:ut(Yk,{sx:{fontSize:19}})}),"\uC0C1\uC138 \uC5F4\uAE30"]}),v?ut(Ll,{}):null,v&&_?pr(_r,{onClick:()=>{C&&_(C.seq),p()},sx:{fontSize:14},children:[ut(Kr,{children:ut(Xk,{sx:{fontSize:19}})}),"\uBCF5\uC6D0"]}):null,v&&B?pr(_r,{onClick:()=>{T()},sx:{fontSize:14,color:"#e5484d"},children:[ut(Kr,{children:ut(ur,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC601\uAD6C \uC0AD\uC81C"]}):null,v?null:pr(jm,{children:[pr(_r,{disabled:M?(C?.author_account_seq??0)!==i:(C?.author_account_seq??0)!==i&&(C?.manager_account_seq??0)!==i,onClick:()=>{C&&r(C.seq,!C.completed),p()},sx:{fontSize:14},children:[ut(Kr,{children:C?.completed?ut(Qk,{sx:{fontSize:19}}):ut(Jk,{sx:{fontSize:19}})}),C?.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC"]}),!M&&t?pr(_r,{disabled:!(C?.manager_account_seq??0)&&(C?.receiver_account_seqs??[]).length===0,onClick:()=>{C&&t(C),p()},sx:{fontSize:14},children:[ut(Kr,{children:ut(e8,{sx:{fontSize:19}})}),"\uD655\uC778 \uC694\uCCAD"]}):null,h?null:ut(Ll,{}),h?null:pr(_r,{disabled:y,onClick:F=>{C&&P({anchorEl:F.currentTarget,task:C})},sx:{fontSize:14},children:[ut(Kr,{children:ut(t8,{sx:{fontSize:19}})}),"\uB9C8\uAC10\uC77C\uC2DC \uBCC0\uACBD"]}),!M&&!h&&o?pr(_r,{onClick:()=>{C&&o(C,"manager"),p()},sx:{fontSize:14},children:[ut(Kr,{children:ut(r8,{sx:{fontSize:19}})}),"\uCC45\uC784\uC790 \uBCC0\uACBD"]}):null,h?null:pr(_r,{disabled:y,onClick:F=>{C&&q({anchorEl:F.currentTarget,task:C})},sx:{fontSize:14},children:[ut(Kr,{children:ut(n8,{sx:{fontSize:19}})}),"\uD504\uB85C\uC81D\uD2B8 \uC774\uB3D9",ut(Nm,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}),ut(Ll,{}),f?pr(_r,{disabled:y,onClick:()=>{C&&f(C.seq),p()},sx:{fontSize:14},children:[ut(Kr,{children:ut(o8,{sx:{fontSize:19}})}),"\uBCF5\uC81C"]}):null,d&&C&&!C.is_event&&!C.is_notice?pr(_r,{onClick:()=>{C&&d(C.seq),p()},sx:{fontSize:14},children:[ut(Kr,{children:ut(i8,{sx:{fontSize:19}})}),"\uD6C4\uC18D \uC5C5\uBB34 \uB9CC\uB4E4\uAE30"]}):null,pr(_r,{onClick:()=>{C&&(u?u(C):Yi(C,O)),p()},sx:{fontSize:14},children:[ut(Kr,{children:O?ut(a8,{sx:{fontSize:19}}):ut(s8,{sx:{fontSize:19}})}),O?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC"]}),C&&!C.is_notice&&!C.is_event&&w.has(String(C.tab_key??""))&&g?pr(_r,{onClick:F=>S(F.currentTarget),sx:{fontSize:14},children:[ut(Kr,{children:ut(l8,{sx:{fontSize:19}})}),"\uBAA9\uD45C\uC5D0 \uB123\uAE30",ut(Nm,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}):null,pr(_r,{onClick:E,disabled:y||!C?.archived&&!(C&&va(C)),sx:{fontSize:14},children:[ut(Kr,{children:C?.archived?ut(u8,{sx:{fontSize:19}}):ut(c8,{sx:{fontSize:19}})}),C?.archived?"\uBCF4\uAD00 \uD574\uC81C":"\uBCF4\uAD00"]}),ut(Ll,{}),pr(_r,{disabled:y,onClick:()=>{k("one")},sx:{fontSize:14,color:"#e5484d"},children:[ut(Kr,{children:ut(ur,{sx:{fontSize:19,color:"#e5484d"}})}),(C?.repeat_group_key??0)>0?"\uC0AD\uC81C (\uC774 \uD68C\uCC28\uB9CC)":"\uC0AD\uC81C"]}),(C?.repeat_group_key??0)>0?pr(_r,{disabled:y,onClick:()=>{k("series")},sx:{fontSize:14,color:"#e5484d"},children:[ut(Kr,{children:ut(ur,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC0AD\uC81C (\uC774\uD6C4 \uBC18\uBCF5 \uC804\uCCB4)"]}):null]})]}),ut(dn,{anchorEl:D?.anchorEl??null,open:!!D,date:D?.task.due_date??"",reminder:D?.task.reminder??"none",hideReminder:!!D?.task.completed,centered:O,onClose:()=>{P(null),p()},onDateChange:F=>{D&&n(D.task.seq,F)},onReminderChange:F=>{D&&c?.(D.task.seq,F)}}),pr(Ju,{transitionDuration:0,anchorEl:L?.anchorEl??null,open:!!L,onClose:()=>{q(null),p()},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...j,children:[ut(_r,{selected:!L?.task.tab_key,onClick:()=>{L&&a(L.task.seq,""),q(null),p()},sx:{fontSize:14,minWidth:170},children:"\uC5C6\uC74C"}),b.filter(F=>!F.archived).map(F=>ut(_r,{selected:L?.task.tab_key===F.key,onClick:()=>{L&&a(L.task.seq,F.key),q(null),p()},sx:{fontSize:14,minWidth:170},children:F.label},F.key))]}),ut(Ju,{transitionDuration:0,anchorEl:N,open:!!N,onClose:()=>S(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...l.filter(F=>`custom-${F.group_seq}`===String(C?.tab_key??"")).map(F=>({seq:F.seq,label:hn(F)}))].map(F=>pr(_r,{onClick:()=>{C&&g?.(C.seq,F.seq),S(null),p()},sx:{fontSize:14,minWidth:160,gap:1},children:[F.label,(C?.sprint_seq??0)===F.seq?ut(Zk,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},F.seq))})]})}import{Checkbox as f8,Divider as d8,Menu as h8,MenuItem as zm}from"@mui/material";import{jsx as jl,jsxs as Fm}from"react/jsx-runtime";function lW({anchorEl:e,labelOptions:p,selectedKeys:b,onToggle:l,onClear:i,onClose:s}){return Fm(h8,{transitionDuration:0,anchorEl:e,open:!!e,onClose:s,children:[p.map(r=>{let t=b.includes(r.key);return Fm(zm,{onClick:()=>l(r.key),sx:{fontSize:14,minWidth:190,gap:1},children:[jl(f8,{size:"small",checked:t,sx:{p:0}}),jl(Ot,{option:r})]},r.key)}),jl(d8,{}),jl(zm,{disabled:b.length===0,onClick:()=>{i(),s()},sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{Divider as p8,Menu as m8,MenuItem as qm}from"@mui/material";import g8 from"@mui/icons-material/Check";import b8 from"@mui/icons-material/SettingsOutlined";import{jsx as Qu,jsxs as ef}from"react/jsx-runtime";function mW(e){let{anchorEl:p,sprints:b,value:l,onSelect:i,onManage:s,onClose:r}=e;return ef(m8,{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:hn(t)}))].map(t=>ef(qm,{onClick:()=>{i(t.seq),r()},sx:{fontSize:14,minWidth:180,gap:1},children:[t.label,l===t.seq?Qu(g8,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},t.seq)),Qu(p8,{}),ef(qm,{onClick:()=>{r(),s()},sx:{fontSize:14,gap:1},children:[Qu(b8,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uAD00\uB9AC\u2026"]})]})}var y8={my:"tasks",mine:"tasks",sent:"tasks",notice:"notice",bug:"bug",archive:"archive",done:"done",report:"report"};function x8(e){return y8[e]??"tasks"}var Hm={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"},$m=["list","calendar","month","card","kanban","sprint","timeline"],v8=["list","card"];function yW(e){let p=x8(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:$m,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:v8,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:$m,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 w8}from"react";import{useKeyboardState as _8}from"@ehfuse/keyboard-state";var Wm=[{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 kW(e,p={}){let{enabled:b=!0,views:l}=p,{onCreateTask:i,onFocusSearch:s,onToggleHelp:r,onChangeView:t,onRefresh:n,onEscape:c}=e,o=l?l.join(","):"",a=w8(()=>{let f=[];if(i&&f.push({key:"n",callback:i,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}}),c&&f.push({key:"escape",callback:c,options:{allowInEditable:!0}}),t)for(let d of Um(o?o.split(","):void 0))f.push({key:d.key,callback:()=>t(d.view),options:{preventDefault:!0}});return f},[i,s,r,t,n,c,o]);_8(b?a:[])}function Um(e){if(!e)return Wm;let p=new Set(e);return Wm.filter(b=>p.has(b.view))}function tf(e){return[{keys:"N",description:"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D"},{keys:"/",description:"\uAC80\uC0C9"},{keys:"R",description:"\uBAA9\uB85D \uC0C8\uB85C\uACE0\uCE68"},...Um(e).map(p=>({keys:p.key.split(" ").map(b=>b.toUpperCase()).join(" \u2192 "),description:`${Hm[p.view]} \uBCF4\uAE30`})),{keys:"?",description:"\uB2E8\uCD95\uD0A4 \uB3C4\uC6C0\uB9D0"},{keys:"Esc",description:"\uB2EB\uAE30"}]}var SW=tf();import{Box as Zs,Button as k8}from"@mui/material";import S8 from"@mui/icons-material/ArrowRightAlt";import{FormDialog as T8}from"@ehfuse/mui-form-dialog";import{jsx as Zo,jsxs as Vm}from"react/jsx-runtime";function C8({keys:e}){return Zo(Zs,{sx:{display:"flex",alignItems:"center",gap:.5,justifyContent:"flex-end"},children:e.split(" \u2192 ").map((p,b)=>Vm(Zs,{sx:{display:"flex",alignItems:"center",gap:.5},children:[b>0?Zo(S8,{sx:{fontSize:18,color:"#9a9a97"}}):null,Zo(Zs,{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 EW({open:e,onClose:p,views:b}){let l=tf(b);return Zo(T8,{open:e,onClose:p,maxWidth:"xs",title:"\uB2E8\uCD95\uD0A4",locale:"ko",titleIcons:{delete:{visible:!1}},tabs:{visible:!1},sectionContentPaddingTop:0,sections:[{id:"shortcuts",showTitle:!1,children:Zo(Zs,{sx:{display:"grid",gridTemplateColumns:"auto 1fr",columnGap:2,rowGap:1.25,alignItems:"center",fontSize:14,color:"#37352f"},children:l.map(i=>Vm(Zs,{sx:{display:"contents"},children:[Zo(C8,{keys:i.keys}),Zo("span",{children:i.description})]},i.keys))})}],actions:{showCancelButton:!1,right:Zo(k8,{variant:"contained",onClick:p,children:"\uB2EB\uAE30"})}})}import{useEffect as Km,useRef as B8,useState as os}from"react";import{Box as rr,Button as An,IconButton as rf,Menu as Gm,MenuItem as Ym,Switch as I8,Tooltip as Xm}from"@mui/material";import{FormDialog as Zm}from"@ehfuse/mui-form-dialog";import nf from"@mui/icons-material/Add";import M8 from"@mui/icons-material/ArrowRightAlt";import E8 from"@mui/icons-material/BoltOutlined";import R8 from"@mui/icons-material/Close";import O8 from"@mui/icons-material/EditOutlined";import{ErrorAlert as Jm}from"@ehfuse/alerts";import{ClearTextField as Js,LabelSelect as an}from"@ehfuse/mui-form-controls";import{Fragment as e0,jsx as Ke,jsxs as yn}from"react/jsx-runtime";var of=[{value:"created",label:"\uC5C5\uBB34 \uB4F1\uB85D \uC2DC",hint:"\uC0C8 \uC5C5\uBB34\uAC00 \uB9CC\uB4E4\uC5B4\uC9C4 \uC9C1\uD6C4 \uD55C \uBC88 \uC2E4\uD589\uD569\uB2C8\uB2E4."},{value:"status_changed",label:"\uC0C1\uD0DC \uBCC0\uACBD \uC2DC",hint:"\uC0C1\uD0DC\uAC00 \uC2E4\uC81C\uB85C \uBC14\uB010 \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4."},{value:"commented",label:"\uB313\uAE00\uC774 \uB2EC\uB838\uC744 \uB54C",hint:"\uB313\uAE00\uC774 \uC0C8\uB85C \uB2EC\uB9AC\uAC70\uB098 \uC218\uC815\uB41C \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4(\uD68C\uC2E0\uC744 \uBC1B\uC740 \uC790\uB9AC)."},{value:"manager_assigned",label:"\uCC45\uC784\uC790\uAC00 \uC9C0\uC815\uB410\uC744 \uB54C",hint:"\uCC45\uC784\uC790\uAC00 \uC0C8\uB85C \uC9C0\uC815\uB418\uAC70\uB098 \uBC14\uB010 \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4."},{value:"attachment_added",label:"\uCCA8\uBD80\uAC00 \uC62C\uB77C\uC654\uC744 \uB54C",hint:"\uC5C5\uBB34\uC5D0 \uD30C\uC77C\uC774 \uCCA8\uBD80\uB41C \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4(\uC99D\uBE59 \uC811\uC218 \uC790\uB9AC)."},{value:"field_changed",label:"\uD544\uB4DC\uAC00 \uBC14\uB00C\uC5C8\uC744 \uB54C",hint:"\uC9C0\uC815\uD55C \uD544\uB4DC\uAC00 \uC2E4\uC81C\uB85C \uBC14\uB010 \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4(\uD544\uB4DC\uB97C \uC548 \uACE0\uB974\uBA74 \uC544\uBB34 \uC218\uC815\uC5D0\uB098 \uC2E4\uD589)."},{value:"overdue",label:"\uB9C8\uAC10 \uACBD\uACFC \uC2DC",hint:"\uB9C8\uAC10\uC774 \uC9C0\uB09C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uB97C \uB9E4\uC77C \uC810\uAC80\uD574 \uC2E4\uD589\uD569\uB2C8\uB2E4."}],Qs=[{value:"due_date",label:"\uB9C8\uAC10\uC77C\uC2DC"},{value:"start_date",label:"\uC2DC\uC791\uC77C\uC2DC"},{value:"priority",label:"\uC911\uC694\uB3C4"},{value:"manager_account_seq",label:"\uCC45\uC784\uC790"},{value:"receiver_account_seqs",label:"\uCC38\uC870\uC790"},{value:"label_keys",label:"\uB77C\uBCA8"},{value:"group_seq",label:"\uD504\uB85C\uC81D\uD2B8"},{value:"sprint_seq",label:"\uBAA9\uD45C"},{value:"content",label:"\uB0B4\uC6A9"},{value:"note",label:"\uBE44\uACE0"}],ql=[{value:"high",label:"\uB192\uC74C"},{value:"medium",label:"\uC911\uAC04"},{value:"low",label:"\uB0AE\uC74C"}];function zl(){return{name:"",trigger:"created",enabled:!0,sort_no:0,condition:{},action:{}}}function Fl(e){return tn.find(p=>p.key===e)?.name??e}function A8(e,p,b){let{condition:l,action:i}=e,s=[];if(l.group_seq){let n=p.find(c=>Vo(c.key)===l.group_seq);s.push(`\uD504\uB85C\uC81D\uD2B8=${n?.label??`#${l.group_seq}`}`)}l.is_bug===!0&&s.push("\uC624\uB958\uB9CC"),l.is_event===!0&&s.push("\uC77C\uC815\uB9CC"),l.priority&&s.push(`\uC911\uC694\uB3C4=${ql.find(n=>n.value===l.priority)?.label}`),l.label_key&&s.push(`\uB77C\uBCA8=${b.find(n=>n.key===l.label_key)?.name??l.label_key}`),l.title_contains&&s.push(`\uC81C\uBAA9\uC5D0 "${l.title_contains}" \uD3EC\uD568`),l.status&&s.push(`\uC0C1\uD0DC=${Fl(l.status)}`),l.from_status&&s.push(`${Fl(l.from_status)}\uC5D0\uC11C`),l.to_status&&s.push(`${Fl(l.to_status)}\uB85C`),l.manager_empty===!0&&s.push("\uCC45\uC784\uC790 \uC5C6\uC74C"),l.manager_empty===!1&&s.push("\uCC45\uC784\uC790 \uC788\uC74C"),l.manager_account_seq&&s.push(`\uCC45\uC784\uC790=${l.manager_name||`\uACC4\uC815 #${l.manager_account_seq}`}`),l.receiver_account_seq&&s.push(`\uCC38\uC870\uC790\uC5D0 ${l.receiver_name||`\uACC4\uC815 #${l.receiver_account_seq}`}`),l.changed_field&&s.push(`${Qs.find(n=>n.value===l.changed_field)?.label??l.changed_field} \uBCC0\uACBD`),l.comment_contains&&s.push(`\uB313\uAE00\uC5D0 "${l.comment_contains}" \uD3EC\uD568`),l.comment_by_others===!0&&s.push("\uB0A8\uC774 \uC4F4 \uB313\uAE00"),typeof l.overdue_days=="number"&&s.push(`${l.overdue_days}\uC77C \uACBD\uACFC`);let r=[];i.set_status&&r.push(`\uC0C1\uD0DC=${Fl(i.set_status)}`),i.set_priority&&r.push(`\uC911\uC694\uB3C4=${ql.find(n=>n.value===i.set_priority)?.label}`),i.assign_manager_account_seq&&r.push(`\uCC45\uC784\uC790=${i.assign_manager_name||"\uC9C0\uC815"}`),i.add_receiver_account_seq&&r.push(`\uCC38\uC870\uC790 + ${i.add_receiver_name||"\uC9C0\uC815"}`),i.add_label_key&&r.push(`\uB77C\uBCA8 + ${b.find(n=>n.key===i.add_label_key)?.name??i.add_label_key}`),i.apply_content_template_seq&&r.push(`\uBCF8\uBB38 \uC591\uC2DD=${i.apply_content_template_name||"\uC9C0\uC815"}`),i.notify_account_seq&&r.push("\uC54C\uB9BC \uBC1C\uC1A1");let t=of.find(n=>n.value===e.trigger)?.label??e.trigger;return{left:s.length>0?`${t} \xB7 ${s.join(", ")}`:t,right:r.join(", ")||"\uB3D9\uC791 \uC5C6\uC74C"}}var Qm={fontSize:16,fontWeight:700,color:"#37352f"},D8={display:"flex",alignItems:"center",gap:1},P8={width:104,flexShrink:0,fontSize:16,color:"#37352f"};function VW({open:e,rules:p,customTabs:b,statusOptions:l,contentTemplates:i=[],onPickAccount:s,onClose:r,onCreate:t,onUpdate:n,onToggle:c,onRemove:o}){let[a,f]=os(!1),[d,u]=os(0),[g,m]=os(zl()),[x,_]=os(!1),B=B8(null),[O,j]=os(null),[D,P]=os(null);Km(()=>{if(e)return;let H=window.setTimeout(()=>{f(!1),u(0),m(zl())},500);return()=>window.clearTimeout(H)},[e]),Km(()=>{if(!a)return;let H=window.setTimeout(()=>B.current?.focus(),120);return()=>window.clearTimeout(H)},[a]);let L=d>0,q=g.trigger,N=()=>{f(!1),u(0),m(zl())},S=(H,Z)=>{m(J=>{let G={...J.condition};return Z===""||Z===void 0||Z===null?delete G[H]:G[H]=Z,{...J,condition:G}})},C=(H,Z)=>{m(J=>{let G={...J.action};return Z===""||Z===void 0||Z===null?delete G[H]:G[H]=Z,{...J,action:G}})},M=H=>{m(Z=>{let J={...Z.condition};return H!=="status_changed"&&(delete J.from_status,delete J.to_status),H!=="overdue"&&delete J.overdue_days,H!=="field_changed"&&delete J.changed_field,H!=="commented"&&(delete J.comment_contains,delete J.comment_by_others),H==="field_changed"&&J.changed_field===void 0&&(J.changed_field=Qs[0]?.value??""),{...Z,trigger:H,condition:J}})},h=b.filter(H=>!H.archived),y=l.map(H=>({value:H.key,label:H.name})),v=tn.map(H=>({value:H.key,label:H.name})),w=h.map(H=>({value:String(Vo(H.key)),label:H.label})),{condition:k,action:T}=g,E=k.is_bug!==void 0||k.is_event!==void 0,F=[...k.group_seq===void 0&&w.length>0?[{key:"group_seq",label:"\uD504\uB85C\uC81D\uD2B8\uAC00 ~\uC778 \uACBD\uC6B0"}]:[],...E?[]:[{key:"kind",label:"\uC885\uB958\uAC00 \uC624\uB958/\uC77C\uC815\uC778 \uACBD\uC6B0"}],...k.priority===void 0?[{key:"priority",label:"\uC911\uC694\uB3C4\uAC00 ~\uC778 \uACBD\uC6B0"}]:[],...k.label_key===void 0&&y.length>0?[{key:"label_key",label:"\uB77C\uBCA8\uC774 \uBD99\uC5B4 \uC788\uB294 \uACBD\uC6B0"}]:[],...k.title_contains===void 0?[{key:"title_contains",label:"\uC81C\uBAA9\uC5D0 ~ \uB2E8\uC5B4\uAC00 \uD3EC\uD568\uB41C \uACBD\uC6B0"}]:[],...k.manager_empty===void 0?[{key:"manager_empty",label:"\uCC45\uC784\uC790\uAC00 \uC5C6\uB294/\uC788\uB294 \uACBD\uC6B0"}]:[],...s&&k.manager_account_seq===void 0?[{key:"manager_account",label:"\uCC45\uC784\uC790\uAC00 ~\uC778 \uACBD\uC6B0"}]:[],...s&&k.receiver_account_seq===void 0?[{key:"receiver_account",label:"\uCC38\uC870\uC790\uC5D0 ~\uAC00 \uD3EC\uD568\uB41C \uACBD\uC6B0"}]:[],...q==="status_changed"&&k.from_status===void 0?[{key:"from_status",label:"\uC774 \uC0C1\uD0DC\uC5D0\uC11C \uBC14\uB010 \uACBD\uC6B0"}]:[],...q==="status_changed"&&k.to_status===void 0?[{key:"to_status",label:"\uC774 \uC0C1\uD0DC\uB85C \uBC14\uB010 \uACBD\uC6B0"}]:[],...q==="field_changed"&&k.changed_field===void 0?[{key:"changed_field",label:"~ \uD544\uB4DC\uAC00 \uBCC0\uACBD\uB41C \uACBD\uC6B0"}]:[],...q==="commented"&&k.comment_contains===void 0?[{key:"comment_contains",label:"\uB313\uAE00\uC5D0 ~ \uB2E8\uC5B4\uAC00 \uD3EC\uD568\uB41C \uACBD\uC6B0"}]:[],...q==="commented"&&k.comment_by_others===void 0?[{key:"comment_by_others",label:"\uCC45\uC784\uC790\uAC00 \uC544\uB2CC \uC0AC\uB78C\uC774 \uC4F4 \uACBD\uC6B0"}]:[],...q==="overdue"&&k.overdue_days===void 0?[{key:"overdue_days",label:"\uB9C8\uAC10 \uD6C4 \uBA70\uCE60 \uC9C0\uB09C \uACBD\uC6B0"}]:[]],$=async H=>{if(!s)return;let Z=H==="manager_account"?k.manager_account_seq??0:k.receiver_account_seq??0,J=await s(Z);J&&m(G=>{let X={...G.condition};return H==="manager_account"?(X.manager_account_seq=J.accountSeq,X.manager_name=J.name):(X.receiver_account_seq=J.accountSeq,X.receiver_name=J.name),{...G,condition:X}})},U=H=>{j(null),H==="group_seq"?S("group_seq",Number(w[0]?.value)||0):H==="kind"?S("is_bug",!0):H==="priority"?S("priority","high"):H==="label_key"?S("label_key",y[0]?.value??""):H==="title_contains"?m(Z=>({...Z,condition:{...Z.condition,title_contains:""}})):H==="manager_empty"?S("manager_empty",!0):H==="manager_account"||H==="receiver_account"?$(H):H==="from_status"?S("from_status",tn[0]?.key??""):H==="to_status"?S("to_status",tn[0]?.key??""):H==="changed_field"?S("changed_field",Qs[0]?.value??""):H==="comment_contains"?m(Z=>({...Z,condition:{...Z.condition,comment_contains:""}})):H==="comment_by_others"?S("comment_by_others",!0):H==="overdue_days"&&S("overdue_days",1)},A=H=>{if(H==="kind"){S("is_bug",""),S("is_event","");return}if(H==="manager_account"){S("manager_account_seq",""),S("manager_name","");return}if(H==="receiver_account"){S("receiver_account_seq",""),S("receiver_name","");return}S(H==="group_seq"?"group_seq":H,"")},W=[...T.set_status===void 0?[{key:"set_status",label:"\uC0C1\uD0DC \uBC14\uAFB8\uAE30"}]:[],...T.set_priority===void 0?[{key:"set_priority",label:"\uC911\uC694\uB3C4 \uBC14\uAFB8\uAE30"}]:[],...T.add_label_key===void 0&&y.length>0?[{key:"add_label_key",label:"\uB77C\uBCA8 \uBD99\uC774\uAE30"}]:[],...s&&T.assign_manager_account_seq===void 0?[{key:"assign_manager",label:"\uCC45\uC784\uC790 \uC9C0\uC815\uD558\uAE30"}]:[],...s&&T.add_receiver_account_seq===void 0?[{key:"add_receiver",label:"\uCC38\uC870\uC790 \uCD94\uAC00\uD558\uAE30"}]:[],...i.length>0&&T.apply_content_template_seq===void 0?[{key:"apply_content_template",label:"\uBCF8\uBB38 \uC591\uC2DD \uCC44\uC6B0\uAE30"}]:[],...s&&T.notify_account_seq===void 0?[{key:"notify",label:"\uC54C\uB9BC \uBCF4\uB0B4\uAE30"}]:[]],R=async H=>{if(!s)return;let Z=H==="assign_manager"?T.assign_manager_account_seq??0:H==="add_receiver"?T.add_receiver_account_seq??0:T.notify_account_seq??0,J=await s(Z);J&&m(G=>{let X={...G.action};return H==="assign_manager"?(X.assign_manager_account_seq=J.accountSeq,X.assign_manager_name=J.name):H==="add_receiver"?(X.add_receiver_account_seq=J.accountSeq,X.add_receiver_name=J.name):(X.notify_account_seq=J.accountSeq,X.notify_name=J.name),{...G,action:X}})},I=H=>{if(P(null),H==="set_status")C("set_status",tn[0]?.key??"");else if(H==="set_priority")C("set_priority","high");else if(H==="add_label_key")C("add_label_key",y[0]?.value??"");else if(H==="apply_content_template"){let Z=i[0];m(J=>({...J,action:{...J.action,apply_content_template_seq:Z?.seq??0,apply_content_template_name:Z?.name??""}}))}else R(H)},z=H=>{H==="assign_manager"?(C("assign_manager_account_seq",""),C("assign_manager_name","")):H==="add_receiver"?(C("add_receiver_account_seq",""),C("add_receiver_name","")):H==="apply_content_template"?(C("apply_content_template_seq",""),C("apply_content_template_name","")):H==="notify"?(C("notify_account_seq",""),C("notify_name",""),C("notify_message","")):C(H,"")},V=async()=>{if(!g.name.trim()){Jm({message:"\uADDC\uCE59 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694."});return}if(Object.keys(g.action).length===0){Jm({message:"\uB3D9\uC791\uC744 \uD558\uB098 \uC774\uC0C1 \uCD94\uAC00\uD558\uC138\uC694."});return}let H=L?g.sort_no:p.reduce((J,G)=>Math.max(J,G.sort_no),0)+1;_(!0);let Z=L?await n(d,{...g,sort_no:H}):await t({...g,sort_no:H});_(!1),Z&&N()},Y=(H,Z,J,G)=>yn(rr,{sx:D8,children:[Ke(rr,{sx:P8,children:H}),yn(rr,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:G?"column":"row",alignItems:G?"stretch":"center",gap:G?.5:1},children:[Z,G?Ke(rr,{sx:{fontSize:13.5,color:"#37352f"},children:G}):null]}),Ke(Xm,{title:"\uC774 \uC904 \uBE7C\uAE30",arrow:!0,disableInteractive:!0,children:Ke(rf,{size:"small","aria-label":`${H} \uC904 \uBE7C\uAE30`,onClick:J,children:Ke(R8,{sx:{fontSize:16}})})})]}),K=()=>yn(rr,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[Ke(Js,{size:"medium",label:"\uADDC\uCE59 \uC774\uB984",inputRef:B,placeholder:"\uC608: \uC811\uC218 \uC624\uB958 \uC790\uB3D9 \uBC30\uC815",value:g.name,onChange:H=>m(Z=>({...Z,name:H.target.value}))}),Ke(rr,{sx:{display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"},children:of.map(H=>{let Z=q===H.value;return Ke(An,{disableElevation:!0,variant:Z?"contained":"outlined",color:Z?"primary":"inherit",onClick:()=>M(H.value),sx:{borderRadius:99,px:1.75,...Z?{}:{color:"#57564f",borderColor:"#d9d9d6"}},children:H.label},H.value)})}),Ke(rr,{sx:{fontSize:13,color:"#787774",mt:-.5},children:of.find(H=>H.value===q)?.hint}),yn(rr,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[Ke(rr,{sx:Qm,children:"\uC5B4\uB5A4 \uC5C5\uBB34\uC77C \uB54C"}),F.length>0?Ke(An,{size:"small",startIcon:Ke(nf,{sx:{fontSize:16}}),onClick:H=>j(H.currentTarget),sx:{color:"#2563eb",minWidth:0},children:"\uC870\uAC74 \uCD94\uAC00"}):null]}),k.group_seq!==void 0?Y("\uD504\uB85C\uC81D\uD2B8",Ke(an,{size:"medium",fullWidth:!0,label:"",value:String(k.group_seq),options:w,onChange:H=>S("group_seq",Number(H.target.value)||"")}),()=>A("group_seq")):null,E?Y("\uC885\uB958",Ke(an,{size:"medium",fullWidth:!0,label:"",value:k.is_bug?"bug":"event",options:[{value:"bug",label:"\uC624\uB958\uB9CC"},{value:"event",label:"\uC77C\uC815\uB9CC"}],onChange:H=>{let Z=H.target.value==="bug";S("is_bug",Z?!0:""),S("is_event",Z?"":!0)}}),()=>A("kind")):null,k.priority!==void 0?Y("\uC911\uC694\uB3C4",Ke(an,{size:"medium",fullWidth:!0,label:"",value:k.priority,options:ql,onChange:H=>S("priority",H.target.value)}),()=>A("priority")):null,k.label_key!==void 0?Y("\uB77C\uBCA8",Ke(an,{size:"medium",fullWidth:!0,label:"",value:k.label_key,options:y,onChange:H=>S("label_key",H.target.value)}),()=>A("label_key")):null,k.title_contains!==void 0?Y("\uC81C\uBAA9",Ke(Js,{size:"medium",fullWidth:!0,placeholder:"\uD3EC\uD568\uD560 \uB0B1\uB9D0 (\uC608: \uAE34\uAE09)",value:k.title_contains,onChange:H=>m(Z=>({...Z,condition:{...Z.condition,title_contains:H.target.value}}))}),()=>A("title_contains")):null,k.manager_empty!==void 0?Y("\uCC45\uC784\uC790",Ke(an,{size:"medium",fullWidth:!0,label:"",value:k.manager_empty?"empty":"assigned",options:[{value:"empty",label:"\uC5C6\uC74C"},{value:"assigned",label:"\uC788\uC74C"}],onChange:H=>S("manager_empty",H.target.value==="empty")}),()=>A("manager_empty")):null,k.manager_account_seq!==void 0?Y("\uCC45\uC784\uC790",Ke(An,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{$("manager_account")},children:k.manager_name||`\uACC4\uC815 #${k.manager_account_seq}`}),()=>A("manager_account")):null,k.receiver_account_seq!==void 0?Y("\uCC38\uC870\uC790",Ke(An,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{$("receiver_account")},children:k.receiver_name||`\uACC4\uC815 #${k.receiver_account_seq}`}),()=>A("receiver_account")):null,k.from_status!==void 0?Y("\uC774 \uC0C1\uD0DC\uC5D0\uC11C",Ke(an,{size:"medium",fullWidth:!0,label:"",value:k.from_status,options:v,onChange:H=>S("from_status",H.target.value)}),()=>A("from_status")):null,k.to_status!==void 0?Y("\uC774 \uC0C1\uD0DC\uB85C",Ke(an,{size:"medium",fullWidth:!0,label:"",value:k.to_status,options:v,onChange:H=>S("to_status",H.target.value)}),()=>A("to_status")):null,k.changed_field!==void 0?Y("\uBCC0\uACBD \uD544\uB4DC",Ke(an,{size:"medium",fullWidth:!0,label:"",value:k.changed_field,options:Qs,onChange:H=>S("changed_field",H.target.value)}),()=>A("changed_field")):null,k.comment_contains!==void 0?Y("\uB313\uAE00 \uB0B1\uB9D0",Ke(Js,{size:"medium",fullWidth:!0,placeholder:"\uD3EC\uD568\uD560 \uB0B1\uB9D0 (\uC608: \uD68C\uC2E0)",value:k.comment_contains,onChange:H=>m(Z=>({...Z,condition:{...Z.condition,comment_contains:H.target.value}}))}),()=>A("comment_contains")):null,k.comment_by_others!==void 0?Y("\uB313\uAE00 \uC791\uC131\uC790",Ke(an,{size:"medium",fullWidth:!0,label:"",value:k.comment_by_others?"others":"any",options:[{value:"others",label:"\uCC45\uC784\uC790\uAC00 \uC544\uB2CC \uC0AC\uB78C"},{value:"any",label:"\uB204\uAD6C\uB4E0"}],onChange:H=>S("comment_by_others",H.target.value==="others")}),()=>A("comment_by_others")):null,k.overdue_days!==void 0?Y("\uACBD\uACFC\uC77C",Ke(Js,{size:"medium",fullWidth:!0,type:"number",value:String(k.overdue_days),onChange:H=>S("overdue_days",Math.max(0,Number(H.target.value)||0)),helperText:"\uB9C8\uAC10 \uD6C4 \uBA70\uCE60 \uC9C0\uB0AC\uC744 \uB54C\uBD80\uD130 \uC2E4\uD589\uD560\uC9C0"}),()=>A("overdue_days")):null,Object.keys(k).length===0?Ke(rr,{sx:{fontSize:13.5,color:"#9a9a97"},children:"\uC870\uAC74\uC774 \uC5C6\uC73C\uBA74 \uBAA8\uB4E0 \uC5C5\uBB34\uC5D0 \uC2E4\uD589\uB429\uB2C8\uB2E4."}):null,yn(rr,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[Ke(rr,{sx:Qm,children:"\uBB34\uC5C7\uC744 \uD560\uAE4C\uC694"}),W.length>0?Ke(An,{size:"small",startIcon:Ke(nf,{sx:{fontSize:16}}),onClick:H=>P(H.currentTarget),sx:{color:"#2563eb",minWidth:0},children:"\uB3D9\uC791 \uCD94\uAC00"}):null]}),T.set_status!==void 0?Y("\uC0C1\uD0DC",Ke(an,{size:"medium",fullWidth:!0,label:"",value:T.set_status,options:v,onChange:H=>C("set_status",H.target.value)}),()=>z("set_status")):null,T.set_priority!==void 0?Y("\uC911\uC694\uB3C4",Ke(an,{size:"medium",fullWidth:!0,label:"",value:T.set_priority,options:ql,onChange:H=>C("set_priority",H.target.value)}),()=>z("set_priority")):null,T.apply_content_template_seq!==void 0?Y("\uBCF8\uBB38 \uC591\uC2DD",Ke(an,{size:"medium",fullWidth:!0,label:"",value:String(T.apply_content_template_seq),options:i.map(H=>({value:String(H.seq),label:H.name})),onChange:H=>{let Z=i.find(J=>String(J.seq)===String(H.target.value));m(J=>({...J,action:{...J.action,apply_content_template_seq:Z?.seq??0,apply_content_template_name:Z?.name??""}}))}}),()=>z("apply_content_template"),"\uBCF8\uBB38\uC774 \uBE44\uC5B4 \uC788\uC744 \uB54C\uB9CC \uCC44\uC6C1\uB2C8\uB2E4(\uC4F4 \uB0B4\uC6A9\uC744 \uB36E\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4)"):null,T.add_label_key!==void 0?Y("\uB77C\uBCA8",Ke(an,{size:"medium",fullWidth:!0,label:"",value:T.add_label_key,options:y,onChange:H=>C("add_label_key",H.target.value)}),()=>z("add_label_key")):null,T.assign_manager_account_seq!==void 0?Y("\uCC45\uC784\uC790",Ke(An,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{R("assign_manager")},children:T.assign_manager_name||`\uACC4\uC815 #${T.assign_manager_account_seq}`}),()=>z("assign_manager")):null,T.add_receiver_account_seq!==void 0?Y("\uCC38\uC870\uC790",Ke(An,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{R("add_receiver")},children:T.add_receiver_name||`\uACC4\uC815 #${T.add_receiver_account_seq}`}),()=>z("add_receiver")):null,T.notify_account_seq!==void 0?Y("\uC54C\uB9BC",yn(e0,{children:[Ke(An,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{R("notify")},sx:{flexShrink:0},children:T.notify_name||`\uACC4\uC815 #${T.notify_account_seq}`}),Ke(Js,{size:"medium",fullWidth:!0,placeholder:"\uC54C\uB9BC \uBB38\uAD6C(\uBE44\uC6B0\uBA74 \uAE30\uBCF8 \uBB38\uAD6C)",value:T.notify_message??"",onChange:H=>C("notify_message",H.target.value)})]}),()=>z("notify")):null,Object.keys(T).length===0?Ke(rr,{sx:{fontSize:13.5,color:"#9a9a97"},children:'"+ \uB3D9\uC791 \uCD94\uAC00" \uB85C \uD560 \uC77C\uC744 \uD558\uB098 \uC774\uC0C1 \uACE8\uB77C \uC8FC\uC138\uC694.'}):null,Ke(Gm,{transitionDuration:0,anchorEl:O,open:!!O,onClose:()=>j(null),children:F.map(H=>Ke(Ym,{dense:!0,onClick:()=>U(H.key),sx:{fontSize:14},children:H.label},H.key))}),Ke(Gm,{transitionDuration:0,anchorEl:D,open:!!D,onClose:()=>P(null),children:W.map(H=>Ke(Ym,{dense:!0,onClick:()=>I(H.key),sx:{fontSize:14},children:H.label},H.key))})]});return yn(e0,{children:[Ke(Zm,{open:e,onClose:r,maxWidth:"sm",title:"\uC790\uB3D9\uD654 \uADDC\uCE59",locale:"ko",titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-rule-manage",tabs:{visible:!1},contentPaddingX:0,contentTopPadding:0,contentBottomPadding:0,sectionContentPaddingTop:0,sections:[{id:"rules",title:"",showTitle:!1,children:yn(rr,{sx:{display:"flex",flexDirection:"column",px:2.5,py:2},children:[p.length===0?yn(rr,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[Ke(E8,{sx:{fontSize:48,color:"#d9d9d6"}}),Ke(rr,{sx:{fontSize:15},children:"\uB4F1\uB85D\uB41C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):null,p.map(H=>yn(rr,{sx:{display:"flex",alignItems:"center",gap:2,py:1,"&:not(:last-of-type)":{borderBottom:"1px solid #ececea"},opacity:H.enabled?1:.5},children:[Ke(Xm,{title:H.enabled?"\uC0AC\uC6A9 \uC911":"\uAEBC\uC9D0",arrow:!0,disableInteractive:!0,children:Ke(I8,{size:"small",inputProps:{"aria-label":`${H.name} \uADDC\uCE59 \uC0AC\uC6A9`},checked:H.enabled,onChange:(Z,J)=>c(H.seq,J)})}),yn(rr,{sx:{flex:1,minWidth:0},children:[Ke(rr,{sx:{fontSize:16,fontWeight:600,color:"#37352f"},children:H.name}),(()=>{let Z=A8(H,b,l);return yn(rr,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5,fontSize:15,color:"#6f6f6c"},children:[Ke(rr,{component:"span",children:Z.left}),Ke(M8,{sx:{fontSize:18,color:"#9a9a97",flexShrink:0}}),Ke(rr,{component:"span",children:Z.right})]})})()]}),Ke(rf,{size:"small","aria-label":`${H.name} \uADDC\uCE59 \uC218\uC815`,onClick:()=>{u(H.seq),m({name:H.name,trigger:H.trigger,enabled:H.enabled,sort_no:H.sort_no,condition:{...H.condition,...H.trigger==="field_changed"&&H.condition.changed_field===void 0?{changed_field:Qs[0]?.value??""}:{}},action:{...H.action}}),f(!0)},children:Ke(O8,{sx:{fontSize:18}})}),Ke(rf,{size:"small","aria-label":`${H.name} \uADDC\uCE59 \uC0AD\uC81C`,onClick:()=>o(H.seq),children:Ke(ur,{sx:{fontSize:18}})})]},H.seq))]})}],actions:{showCancelButton:!1,left:Ke(An,{startIcon:Ke(nf,{}),onClick:()=>{u(0),m(zl()),f(!0)},sx:{color:"#2563eb"},children:"\uC0C8 \uADDC\uCE59"}),right:Ke(An,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}}),Ke(Zm,{open:a,onClose:N,maxWidth:"sm",title:L?"\uADDC\uCE59 \uC218\uC815":"\uC0C8 \uADDC\uCE59",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-rule-form",tabs:{visible:!1},sectionContentPaddingTop:0,sections:[{id:"rule-form",title:"",showTitle:!1,children:K()}],actions:{showCancelButton:!0,right:Ke(An,{variant:"contained",onClick:()=>{V()},disabled:x,children:L?"\uC218\uC815":"\uADDC\uCE59 \uCD94\uAC00"})}})]})}import{useEffect as N8,useState as ea}from"react";import{Box as sr,Button as wi,IconButton as _i,Tooltip as ki}from"@mui/material";import t0 from"@mui/icons-material/Add";import L8 from"@mui/icons-material/EditOutlined";import j8 from"@mui/icons-material/ContentCopyOutlined";import z8 from"@mui/icons-material/ArrowUpward";import F8 from"@mui/icons-material/ArrowDownward";import q8 from"@mui/icons-material/ExpandMore";import $8 from"@mui/icons-material/ExpandLess";import H8 from"@mui/icons-material/PlaylistAddCheckOutlined";import{FormDialog as r0}from"@ehfuse/mui-form-dialog";import{ClearTextField as $l,LabelSelect as n0,NumberField as o0}from"@ehfuse/mui-form-controls";import W8 from"@ehfuse/overlay-scrollbar";import{ConfirmDialog as U8,ErrorAlert as i0}from"@ehfuse/alerts";import{Fragment as G8,jsx as Qe,jsxs as xn}from"react/jsx-runtime";var V8=[{value:"high",label:"\uB192\uC74C"},{value:"medium",label:"\uC911\uAC04"},{value:"low",label:"\uB0AE\uC74C"}];function Hl(){return{name:"",description:"",group_seq:0,items:[]}}function K8(){return{title:"",due_offset_days:0,priority:"medium"}}function pU({open:e,templates:p,customTabs:b,onPickAccount:l,onClose:i,onCreate:s,onUpdate:r,onRemove:t,onRun:n}){let[c,o]=ea(!1),[a,f]=ea(0),[d,u]=ea(Hl()),[g,m]=ea(-1),[x,_]=ea(!1);N8(()=>{if(e)return;let N=window.setTimeout(()=>{o(!1),f(0),u(Hl()),m(-1)},500);return()=>window.clearTimeout(N)},[e]);let B=b.filter(N=>!N.archived).map(N=>({value:String(Vo(N.key)),label:N.label})),O=(N,S)=>{u(C=>({...C,items:C.items.map((M,h)=>h===N?{...M,...S}:M)}))},j=(N,S)=>{u(C=>{let M=[...C.items],h=N+S;return h<0||h>=M.length?C:([M[N],M[h]]=[M[h],M[N]],{...C,items:M})}),m(-1)},D=async N=>{if(!l)return;let S=await l(d.items[N]?.manager_account_seq??0);S&&O(N,{manager_account_seq:S.accountSeq,manager_name:S.name})},P=async()=>{let N=d.name.trim();if(!N){i0({message:"\uD15C\uD50C\uB9BF \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694."});return}let S=d.items.filter(h=>h.title.trim().length>0);if(S.length===0){i0({message:"\uC5C5\uBB34 \uD56D\uBAA9\uC744 \uD55C \uC904 \uC774\uC0C1 \uB123\uC73C\uC138\uC694."});return}_(!0);let C={...d,name:N,items:S},M=a>0?await r(a,C):await s(C);_(!1),M&&(o(!1),f(0),u(Hl()))},L=Qe(sr,{children:p.length===0?xn(sr,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[Qe(H8,{sx:{fontSize:48,color:"#d9d9d6"}}),Qe(sr,{sx:{fontSize:13.5},children:"\uB4F1\uB85D\uB41C \uD15C\uD50C\uB9BF\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):p.map(N=>xn(sr,{sx:{display:"flex",alignItems:"center",gap:2,py:1.75,"&:not(:last-of-type)::after":{content:'""',display:"block",my:1.75,borderBottom:"1px solid #f0efed"}},children:[xn(sr,{sx:{flex:1,minWidth:0},children:[Qe(sr,{sx:{fontSize:18,fontWeight:600,color:"#37352f"},children:N.name}),xn(sr,{sx:{fontSize:14,color:"#787774",mt:.25},children:["\uC5C5\uBB34 ",N.items.length,"\uAC74",N.description?` \xB7 ${N.description}`:""]})]}),n?Qe(wi,{size:"medium",variant:"outlined",onClick:()=>n(N),sx:{flexShrink:0},children:"\uC2E4\uD589"}):null,Qe(ki,{title:"\uC218\uC815",arrow:!0,disableInteractive:!0,children:Qe(_i,{size:"medium","aria-label":`${N.name} \uD15C\uD50C\uB9BF \uC218\uC815`,onClick:()=>{f(N.seq),u({name:N.name,description:N.description??"",group_seq:N.group_seq??0,items:N.items.map(S=>({...S}))}),m(-1),o(!0)},children:Qe(L8,{sx:{fontSize:19}})})}),Qe(ki,{title:"\uBCF5\uC81C",arrow:!0,disableInteractive:!0,children:Qe(_i,{size:"medium","aria-label":`${N.name} \uD15C\uD50C\uB9BF \uBCF5\uC81C`,onClick:()=>{f(0),u({name:`${N.name} \uC0AC\uBCF8`,description:N.description??"",group_seq:N.group_seq??0,items:N.items.map(S=>({...S}))}),m(-1),o(!0)},children:Qe(j8,{sx:{fontSize:18}})})}),Qe(ki,{title:"\uC0AD\uC81C",arrow:!0,disableInteractive:!0,children:Qe(_i,{size:"medium","aria-label":`${N.name} \uD15C\uD50C\uB9BF \uC0AD\uC81C`,onClick:()=>{(async()=>await U8({title:"\uD15C\uD50C\uB9BF \uC0AD\uC81C",message:`"${N.name}" \uD15C\uD50C\uB9BF\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&t(N.seq))()},children:Qe(ur,{sx:{fontSize:18}})})})]},N.seq))}),q=xn(sr,{sx:{display:"flex",flexDirection:"column",gap:2},children:[Qe($l,{size:"medium",label:"\uD15C\uD50C\uB9BF \uC774\uB984",placeholder:"\uC608: \uC2E0\uADDC \uC785\uC0AC\uC790 \uC628\uBCF4\uB529",fullWidth:!0,value:d.name,onChange:N=>u(S=>({...S,name:N.target.value}))}),Qe($l,{size:"medium",label:"\uC124\uBA85",placeholder:"\uBAA9\uB85D\uC5D0\uC11C \uBB34\uC5C7\uC778\uC9C0 \uC54C\uC544\uBCFC \uD55C \uC904(\uC120\uD0DD)",fullWidth:!0,value:d.description??"",onChange:N=>u(S=>({...S,description:N.target.value}))}),B.length>0?Qe(n0,{size:"medium",fullWidth:!0,label:"\uB9CC\uB4E4 \uACF3(\uD504\uB85C\uC81D\uD2B8)",value:String(d.group_seq??0),options:[{value:"0",label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568"},...B],onChange:N=>u(S=>({...S,group_seq:Number(N.target.value)||0}))}):null,xn(sr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Qe(sr,{sx:{fontSize:16,fontWeight:700,color:"#37352f"},children:"\uC5C5\uBB34 \uD56D\uBAA9"}),Qe(sr,{sx:{fontSize:13.5,color:"#37352f"},children:"\uB0A0\uC9DC\uB294 \uC2E4\uD589\uD560 \uB54C \uACE0\uB974\uB294 \uAE30\uC900\uC77C\uC5D0\uC11C \uACC4\uC0B0\uB429\uB2C8\uB2E4."}),Qe(wi,{size:"medium",startIcon:Qe(t0,{sx:{fontSize:18}}),onClick:()=>{u(N=>({...N,items:[...N.items,K8()]})),m(d.items.length)},sx:{ml:"auto",flexShrink:0},children:"\uD56D\uBAA9 \uCD94\uAC00"})]}),d.items.length===0?Qe(sr,{sx:{fontSize:14,color:"#9a9a97",py:2},children:'\uC544\uC9C1 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. "\uD56D\uBAA9 \uCD94\uAC00" \uB85C \uC808\uCC28\uB97C \uC21C\uC11C\uB300\uB85C \uC801\uC73C\uC138\uC694.'}):Qe(sr,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:Qe(W8,{style:{maxHeight:360},thumb:{width:6},children:d.items.map((N,S)=>xn(sr,{sx:{borderBottom:"1px solid #f2f2f0",px:2,py:2},children:[xn(sr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Qe(sr,{sx:{width:24,flexShrink:0,fontSize:16,color:"#9a9a97"},children:S+1}),Qe($l,{size:"medium",fullWidth:!0,placeholder:"\uC5C5\uBB34 \uC81C\uBAA9",value:N.title,onChange:C=>O(S,{title:C.target.value})}),Qe(sr,{sx:{width:136,flexShrink:0},children:Qe(o0,{size:"medium",fullWidth:!0,label:"\uC2DC\uC791 D+",thousandSeparator:!1,align:"right",value:N.start_offset_days??null,onValueChange:C=>O(S,{start_offset_days:C===null?void 0:Math.trunc(Number(C))})})}),Qe(sr,{sx:{width:136,flexShrink:0},children:Qe(o0,{size:"medium",fullWidth:!0,label:"\uB9C8\uAC10 D+",thousandSeparator:!1,align:"right",value:N.due_offset_days??null,onValueChange:C=>O(S,{due_offset_days:C===null?void 0:Math.trunc(Number(C))})})}),Qe(ki,{title:"\uC704\uB85C",arrow:!0,disableInteractive:!0,children:Qe(_i,{size:"medium","aria-label":`${S+1}\uBC88 \uD56D\uBAA9 \uC704\uB85C`,disabled:S===0,onClick:()=>j(S,-1),children:Qe(z8,{sx:{fontSize:18}})})}),Qe(ki,{title:"\uC544\uB798\uB85C",arrow:!0,disableInteractive:!0,children:Qe(_i,{size:"medium","aria-label":`${S+1}\uBC88 \uD56D\uBAA9 \uC544\uB798\uB85C`,disabled:S===d.items.length-1,onClick:()=>j(S,1),children:Qe(F8,{sx:{fontSize:18}})})}),Qe(ki,{title:g===S?"\uC811\uAE30":"\uB354 \uC801\uAE30",arrow:!0,disableInteractive:!0,children:Qe(_i,{size:"medium","aria-label":`${S+1}\uBC88 \uD56D\uBAA9 \uC0C1\uC138`,onClick:()=>m(g===S?-1:S),children:g===S?Qe($8,{sx:{fontSize:20}}):Qe(q8,{sx:{fontSize:20}})})}),Qe(ki,{title:"\uD56D\uBAA9 \uC0AD\uC81C",arrow:!0,disableInteractive:!0,children:Qe(_i,{size:"medium","aria-label":`${S+1}\uBC88 \uD56D\uBAA9 \uC0AD\uC81C`,onClick:()=>{u(C=>({...C,items:C.items.filter((M,h)=>h!==S)})),m(-1)},children:Qe(ur,{sx:{fontSize:18}})})})]}),g===S?xn(sr,{sx:{display:"flex",flexDirection:"column",gap:2,pl:"36px",pt:2},children:[xn(sr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Qe(sr,{sx:{width:160,flexShrink:0},children:Qe(n0,{size:"medium",fullWidth:!0,label:"\uC911\uC694\uB3C4",value:N.priority??"medium",options:V8,onChange:C=>O(S,{priority:C.target.value})})}),l?xn(wi,{size:"medium",variant:"outlined",onClick:()=>{D(S)},children:["\uCC45\uC784\uC790: ",N.manager_name||"\uC9C0\uC815 \uC548 \uD568"]}):null,N.manager_account_seq?Qe(wi,{size:"medium",onClick:()=>O(S,{manager_account_seq:0,manager_name:""}),children:"\uCC45\uC784\uC790 \uBE44\uC6B0\uAE30"}):null]}),Qe($l,{size:"medium",fullWidth:!0,label:"\uD560\uC77C(\uC904\uBC14\uAFC8\uC73C\uB85C \uAD6C\uBD84)",multiline:!0,minRows:2,value:(N.checklist??[]).join(`
41
+ `)}function cp(e){navigator.clipboard.writeText(e).then(()=>w5("\uC5C5\uBB34 \uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>v5("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uB0B4\uC6A9\uC744 \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD574 \uC8FC\uC138\uC694."))}function Yi(e,p){let b=_5(e);if(p&&typeof navigator.share=="function"){navigator.share({text:b}).catch(l=>{l?.name!=="AbortError"&&cp(b)});return}cp(b)}import{Fragment as E5,jsx as Bt,jsxs as up}from"react/jsx-runtime";function fp({task:e,myAccountSeq:p=0,onToggleCompleted:b,onChangeTitle:l,onChangeIcon:i,onChangeIconColor:s,onClose:r,appBarMode:t=!1,activityItems:n,activityLoading:c,onLoadActivity:o,onPrint:a,onDelete:f,canDelete:d}){let u=Nt(),[g,m]=zs(!1),[x,_]=zs(null),[B,O]=zs(null),[j,D]=zs(null),[P,L]=zs(null),q=!!e.is_notice,N=!!e.is_event,S=q?_t(e.icon||nr):N?_t(e.icon||lr):null,C=q&&p>0&&(e.author_account_seq??0)===p,M=!io(e,p),h=!!f&&(d??(p>0&&(e.author_account_seq??0)===p)),y=!N&&(q?C:(e.author_account_seq??0)===p||(e.manager_account_seq??0)===p);return up(E5,{children:[up(Xi,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[t&&r?Bt(Zi,{"aria-label":"\uB4A4\uB85C",onClick:r,sx:{color:"#37352f",ml:-1},children:Bt(T5,{})}):null,y&&!t?Bt(Ji,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${rn(e.completed_time)} \uC644\uB8CC`:"",arrow:!0,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:Bt(Xi,{sx:{display:"flex",flexShrink:0,mr:1},children:Bt(Pn,{onClick:v=>L({anchorEl:v.currentTarget,nextCompleted:!e.completed}),children:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC\uD558\uAE30"})})}):null,t||!S?null:N&&!M?Bt(Ji,{title:"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,enterDelay:400,disableInteractive:!0,children:Bt(k5,{onClick:v=>O(v.currentTarget),sx:{display:"flex",p:.5,borderRadius:1,color:e.icon_color||"#1e3a8a","&:hover":{bgcolor:"#f2f2f0"}},children:Bt(S,{sx:{fontSize:20}})})}):Bt(Xi,{sx:{display:"flex",px:.5,color:e.icon_color||(q?"#e5484d":"#1e3a8a")},children:Bt(S,{sx:{fontSize:20}})}),x!==null?Bt(Xi,{component:"input",autoFocus:!0,spellCheck:!1,value:x,onChange:v=>_(v.target.value),onBlur:()=>{x.trim()&&x.trim()!==e.title&&l(e.seq,x.trim()),_(null)},onKeyDown:v=>{v.key==="Enter"&&v.target.blur(),v.key==="Escape"&&_(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0}}):t?Bt(Xi,{sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:q?"\uACF5\uC9C0":N?"\uC77C\uC815":e.is_bug?"\uC624\uB958":"\uC5C5\uBB34"}):Bt(Xi,{onClick:M?void 0:()=>_(e.title),sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:M?"default":"text",textDecoration:e.completed?"line-through":"none"},children:e.title}),o?Bt(Ji,{title:"\uD65C\uB3D9",arrow:!0,children:Bt(Zi,{"aria-label":"\uD65C\uB3D9",onClick:()=>m(!0),sx:{color:"#6b7280"},children:Bt(I5,{sx:{fontSize:20}})})}):null,Bt(Ji,{title:u?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:Bt(Zi,{"aria-label":u?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>Yi(e,u),sx:{color:"#6b7280"},children:u?Bt(C5,{sx:{fontSize:20}}):Bt(B5,{sx:{fontSize:20}})})}),a?Bt(Ji,{title:"\uC778\uC1C4",arrow:!0,children:Bt(Zi,{"aria-label":"\uC778\uC1C4",onClick:()=>a(e),sx:{color:"#6b7280"},children:Bt(M5,{sx:{fontSize:20}})})}):null,h?Bt(Ji,{title:"\uC0AD\uC81C",arrow:!0,children:Bt(Zi,{"aria-label":"\uC0AD\uC81C",onClick:v=>D(v.currentTarget),sx:{color:"#6b7280","&:hover":{color:"#e5484d"}},children:Bt(ur,{sx:{fontSize:20}})})}):null,r&&!t?Bt(Zi,{"aria-label":"\uB2EB\uAE30",onClick:r,sx:{color:"#6b7280"},children:Bt(S5,{})}):null]}),Bt(At,{open:!!P,anchorEl:P?.anchorEl??null,title:P?.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:P?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>L(null),onConfirm:()=>{P&&b(e.seq,P.nextCompleted),L(null)}}),Bt(Lo,{anchorEl:B,value:e.icon??"",color:e.icon_color??"",onSelect:v=>{i(e.seq,v),O(null)},onSelectColor:s?v=>s(e.seq,v):void 0,onClose:()=>O(null)}),Bt(At,{open:!!j,anchorEl:j,title:"\uC774 \uC5C5\uBB34\uB97C \uD734\uC9C0\uD1B5\uC73C\uB85C \uBCF4\uB0B4\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uC0AD\uC81C",onCancel:()=>D(null),onConfirm:()=>{D(null),f?.(e)}}),Bt(Sl,{open:g,taskSeq:e.seq,items:n,loading:c,onLoad:o,onClose:()=>m(!1)})]})}import{useState as gn}from"react";import{Box as Zt,Button as Qi,ButtonBase as bp,Checkbox as F5,Divider as gi,Menu as Bu,MenuItem as Iu}from"@mui/material";import q5 from"@mui/icons-material/ExpandLess";import $5 from"@mui/icons-material/ExpandMore";import H5 from"@mui/icons-material/ConfirmationNumberOutlined";import yp from"@mui/icons-material/Check";import W5 from"@mui/icons-material/DirectionsRunOutlined";import U5 from"@mui/icons-material/SpeedOutlined";import Mu from"@mui/icons-material/CheckCircle";import V5 from"@mui/icons-material/CheckCircleOutlineOutlined";import Eu from"@mui/icons-material/CheckCircleOutlined";import xp from"@mui/icons-material/AccessTimeOutlined";import K5 from"@mui/icons-material/AutorenewOutlined";import G5 from"@mui/icons-material/LabelOutlined";import Y5 from"@mui/icons-material/PersonOutlineOutlined";import X5 from"@mui/icons-material/SubjectOutlined";import Z5 from"@mui/icons-material/StickyNote2Outlined";import J5 from"@mui/icons-material/PanToolAltOutlined";import vp from"@mui/icons-material/LockOutlined";import wp from"@mui/icons-material/PublicOutlined";import _p from"@mui/icons-material/Group";import Q5 from"@mui/icons-material/Repeat";import e4 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as kp,InfoAlert as t4}from"@ehfuse/alerts";import{DatePicker as r4}from"@ehfuse/mui-datetime-picker";import{useState as R5}from"react";import{TextField as O5}from"@ehfuse/mui-form-controls";import{jsx as A5}from"react/jsx-runtime";function dp({value:e,onCommit:p,onDraftChange:b,readOnly:l=!1}){let[i,s]=R5(null);return A5(O5,{value:i??e,placeholder:l?"":"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",slotProps:{input:{readOnly:l}},onChange:r=>{s(r.target.value),b?.(r.target.value)},onBlur:()=>{i!==null&&i.trim()!==e&&p(i),s(null)},onKeyDown:r=>{r.key==="Enter"&&r.target.blur(),r.key==="Escape"&&s(null)},sx:{mt:1}})}import{useMemo as Su,useState as Tu}from"react";import{Box as Rr,Button as mp,IconButton as D5}from"@mui/material";import P5 from"@mui/icons-material/AccountTreeOutlined";import N5 from"@mui/icons-material/LinkOutlined";import L5 from"@mui/icons-material/Close";import j5 from"@mui/icons-material/RedoOutlined";function mi(e){return e.relations??[]}function gj(e,p,b){return mi(e).some(l=>l.type===b&&l.task_seq===p.seq)||mi(p).some(l=>l.type===b&&l.task_seq===e.seq)}function hp(e){return`${e.created_time??""}|${String(e.seq).padStart(12,"0")}`}function _u(e,p){let b=new Map(p.map(d=>[d.seq,d]));b.set(e.seq,e);let l=new Map,i=(d,u)=>{l.has(d)||l.set(d,new Set),l.has(u)||l.set(u,new Set),l.get(d).add(u),l.get(u).add(d)};for(let d of b.values())for(let u of mi(d))u.type==="follow_up"&&b.has(u.task_seq)&&i(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 l.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)=>hp(d).localeCompare(hp(u))),n=new Set;for(let d of mi(e))d.type==="related"&&n.add(d.task_seq);for(let d of b.values())d.seq!==e.seq&&mi(d).some(u=>u.type==="related"&&u.task_seq===e.seq)&&n.add(d.seq);let c=[...n].map(d=>b.get(d)).filter(d=>d!==void 0&&d.seq!==e.seq),o=[...b.values()].filter(d=>d.seq!==e.seq&&mi(d).some(u=>u.type==="duplicate_of"&&u.task_seq===e.seq)),a=mi(e).find(d=>d.type==="duplicate_of")?.task_seq,f=a?b.get(a)??null:null;return{lineage:t,related:c,duplicates:o,duplicateOf:f}}function ku(e,p){let b=_u(e,p);return(b.lineage.length>=2?b.lineage.length-1:0)+b.related.length+b.duplicates.length+(b.duplicateOf?1:0)}function pp(e,p){return ku(e,p)>0}import{Fragment as z5,jsx as Xt,jsxs as Mn}from"react/jsx-runtime";function Cu({item:e,caption:p,onOpen:b,onUnlink:l}){let i=e.is_notice||e.is_event?_t(e.icon||(e.is_notice?nr:lr)):null;return Mn(Rr,{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?Xt(Rr,{component:"span",sx:{flexShrink:0,px:.6,py:.1,borderRadius:.75,fontSize:11.5,fontWeight:500,color:"#8a6d1d",bgcolor:"#faf1d7"},children:p}):null,i?Xt(i,{sx:{fontSize:16,flexShrink:0,color:e.icon_color||"#1e3a8a"}}):null,Mn(Rr,{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]}),Xt(Ot,{option:cr(e),small:!0}),l?Xt(D5,{className:"taskbox-relation-unlink",size:"small","aria-label":"\uC5F0\uACB0 \uD574\uC81C",onClick:l,sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:Xt(L5,{sx:{fontSize:15}})}):null]})}function gp({task:e,tasks:p,readOnly:b=!1,onOpenTask:l,onLink:i,onUnlink:s,onCreateFollowUp:r}){let[t,n]=Tu(!1),[c,o]=Tu(null),[a,f]=Tu(null),d=Su(()=>_u(e,p),[e,p]),u=d.lineage.length>=2,g=Su(()=>ku(e,p),[e,p]),m=Su(()=>{let _=new Set;for(let B of d.lineage)_.add(B.seq);for(let B of d.related)_.add(B.seq);for(let B of d.duplicates)_.add(B.seq);return d.duplicateOf&&_.add(d.duplicateOf.seq),[..._]},[d]),x=(_,B,O)=>{f({anchorEl:_,targetSeq:B,type:O})};return Mn(mn,{icon:Xt(P5,{sx:{fontSize:19,display:"block"}}),title:Mn(z5,{children:["\uAD00\uB828 \uC5C5\uBB34",g>0?Xt(Rr,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:g}):null]}),titleExtra:b?null:Mn(Rr,{sx:{ml:"auto",display:"flex",alignItems:"center",gap:.5},children:[r?Xt(mp,{size:"small",color:"inherit",startIcon:Xt(j5,{sx:{fontSize:16}}),onClick:_=>o(_.currentTarget),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uD6C4\uC18D \uC5C5\uBB34"}):null,i?Xt(mp,{size:"small",color:"inherit",startIcon:Xt(N5,{sx:{fontSize:16}}),onClick:()=>n(!0),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uC5F0\uACB0"}):null]}),children:[Mn(Rr,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:[u?Xt(Rr,{sx:{mb:d.related.length||d.duplicates.length||d.duplicateOf?1:0},children:d.lineage.map((_,B)=>{let O=_.seq===e.seq,j=B===d.lineage.length-1;return Mn(Rr,{sx:{display:"flex",gap:1},children:[Mn(Rr,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:14,flexShrink:0,pt:1.1},children:[Xt(Rr,{sx:{width:O?9:7,height:O?9:7,borderRadius:"50%",bgcolor:O?"#2f80ed":_.completed?"#9a9a97":"#c9c8c5",flexShrink:0}}),j?null:Xt(Rr,{sx:{width:"2px",flex:1,bgcolor:"#e6e6e3"}})]}),Mn(Rr,{sx:{flex:1,minWidth:0,pb:j?0:.5},children:[Mn(Rr,{sx:{display:"flex",alignItems:"center",gap:.75},children:[Mn(Rr,{component:"span",onClick:!O&&l?()=>l(_.seq):void 0,sx:{minWidth:0,fontSize:14,fontWeight:O?600:400,color:O?"#2f80ed":_.completed?"#9a9a97":"#37352f",textDecoration:_.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...!O&&l?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[_.ticket_no?`${_.ticket_no} `:"",_.title]}),Xt(Ot,{option:cr(_),small:!0})]}),Xt(Rr,{sx:{fontSize:12,color:"#9a9a97"},children:_.completed&&_.completed_time?`${_.completed_time} \uC644\uB8CC`:_.created_time??""})]})]},_.seq)})}):null,d.duplicateOf?Xt(Cu,{item:d.duplicateOf,caption:"\uC6D0\uBCF8",onOpen:l?()=>l(d.duplicateOf.seq):void 0,onUnlink:!b&&s?_=>x(_.currentTarget,d.duplicateOf.seq,"duplicate_of"):void 0}):null,d.duplicates.map(_=>Xt(Cu,{item:_,caption:"\uC911\uBCF5",onOpen:l?()=>l(_.seq):void 0,onUnlink:!b&&s?B=>x(B.currentTarget,_.seq,"duplicate_of"):void 0},`dup-${_.seq}`)),d.related.map(_=>Xt(Cu,{item:_,onOpen:l?()=>l(_.seq):void 0,onUnlink:!b&&s?B=>x(B.currentTarget,_.seq,"related"):void 0},`rel-${_.seq}`)),g===0?Xt(Rr,{sx:{px:1.25,py:.75,fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]}),i?Xt(fl,{open:t,task:e,tasks:p,excludeSeqs:m,onClose:()=>n(!1),onSubmit:(_,B)=>i(e.seq,_,B)}):null,Xt(At,{open:!!c,anchorEl:c,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:()=>o(null),onConfirm:()=>{r?.(e.seq),o(null)}}),Xt(At,{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 Fr,jsx as we,jsxs as Wt}from"react/jsx-runtime";function Uo({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return we(Zt,{component:"span",sx:{color:"#9a9a97"},children:e})}function Sp({task:e,customTabs:p,statusOptions:b,avatarSrcByName:l,onChangeStatus:i,onChangeLabels:s,onAddLabelOption:r,onChangeProject:t,onAddProject:n,onChangeDate:c,onChangeReminder:o,onMemberEdit:a,onChangePriority:f,onChangeVisibility:d,onChangeRepeat:u,departments:g=[],onChangeEventTime:m,onChangeEventPlace:x,onChangeEventAddress:_,onChangeNote:B,onChangeNoteDraft:O,onChangeContent:j,contentTemplates:D,onSaveContentTemplate:P,onRemoveContentTemplate:L,contentLoading:q=!1,onChangeContentHeight:N,onAddChecklistItem:S,onToggleChecklistItem:C,onRemoveChecklistItem:M,onUpdateChecklistItem:h,onReorderChecklist:y,onConvertChecklistToTask:v,onOpenChecklistTask:w,onLinkChecklistTask:k,resolveChecklistTask:T,relatedTasksPool:E,onOpenRelatedTask:F,onLinkRelatedTask:$,onUnlinkRelatedTask:U,onCreateFollowUpTask:A,onAddAttachments:W,onRemoveAttachment:R,onPreview:I,onDownload:z,onUpdateComment:V,onRemoveComment:Y,onToggleCommentReaction:K,currentUserName:H="",myAccountSeq:Z=0,noticeAdmin:J=!1,hideProject:G=!1,hideLabel:X=!1,showTitle:ee=!1,onChangeTitle:ne,onToggleCompleted:re,onChangeIcon:ie,onChangeIconColor:le,employees:me=[],onAckConfirm:ve,onRequestConfirm:_e,onChangeBugField:Pe,sprints:he=[],sprintProject:fe=!1,hideSprint:We=!1,onChangeSprint:Ne,onChangeStoryPoints:se,onChangeResolution:Be,onClaimTask:ye,onVerifyBug:xe}){let[Ue,Te]=gn(null),[ue,Ee]=gn(null),[ke,Ie]=gn(null),[lt,Le]=gn(null),[$e,Tt]=gn(!1),je={[Tn]:$e?{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"}},[Fe,xt]=gn(null),[Ze,He]=gn(null),[vt,Ye]=gn(null),[te,ce]=gn(null),[pe,Se]=gn(null),[Xe,Re]=gn(null),[De,yt]=gn(null),Ae=!!e.is_notice,Ce=!!e.is_event,tt=!!e.is_bug,st=!!ye&&Ca(e,Z),dt=!!ye&&Ba(e,Z),wt=!!xe&&tt&&!!e.completed&&Z>0&&(e.author_account_seq??0)===Z&&!(e.acks??[]).some(oe=>oe.account_seq===Z),pt=!io(e,Z),Ut=!e.is_event&&(e.is_notice?Z>0&&(e.author_account_seq??0)===Z:(e.author_account_seq??0)===Z||(e.manager_account_seq??0)===Z),qt=e.is_notice||e.is_event?_t(e.icon||(e.is_notice?nr:lr)):null,Pt=Ae?!Ta(e,Z):pt,Vt=st||dt?Wt(Pn,{onClick:oe=>yt(oe.currentTarget),children:[we(J5,{sx:{fontSize:16,mr:.5}}),"\uAC00\uC838\uAC00\uAE30"]}):null,Q=Ae?xl(e,me):"",ae=Ae?Wh(e,me,Z):null,ge=Ae?null:Fa(e,Z),be=!!(ge&&ge.total>0||Ae&&ae),Me=!Ae,ze=Wt(Fr,{children:[we(mt,{icon:we(Y5,{sx:{fontSize:17}}),label:"\uC791\uC131\uC790",sx:[Un(9),je??null,...Ce?[]:[er(1)]],children:e.created_by?Wt(Fr,{children:[we(Lr,{names:[e.created_by],size:20,avatarSrcByName:l}),e.created_by]}):we(Uo,{})}),we(mt,{icon:we(xp,{sx:{fontSize:17}}),label:"\uC791\uC131\uC77C\uC2DC",sx:[Un(11),je??null,...Ce?[]:[er(2)]],children:e.created_time?rn(e.created_time):we(Uo,{})})]});return Wt(Fr,{children:[ee?Wt(Zt,{sx:{px:2,pt:2,pb:.5,display:"flex",alignItems:"flex-start",gap:1},children:[Ut?we(F5,{checked:e.completed,icon:we(V5,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:we(Mu,{sx:{fontSize:22,color:"#2f80ed"}}),onChange:(oe,it)=>{ke||Ie({anchorEl:oe.currentTarget,nextCompleted:it})},sx:{p:0,mt:.25}}):null,qt?Ce&&!pt?we(bp,{onClick:oe=>Ee(oe.currentTarget),sx:{display:"flex",p:.25,mt:.1,borderRadius:1,color:e.icon_color||"#1e3a8a","&:hover":{bgcolor:"#f2f2f0"}},children:we(qt,{sx:{fontSize:20}})}):we(Zt,{sx:{display:"flex",p:0,mt:.25,color:e.icon_color||(Ae?"#e5484d":"#1e3a8a")},children:we(qt,{sx:{fontSize:20}})}):null,we(Zt,{sx:{flex:1,minWidth:0},children:Ue!==null?we(Zt,{component:"input",autoFocus:!0,spellCheck:!1,value:Ue,onChange:oe=>Te(oe.target.value),onBlur:()=>{Ue.trim()&&Ue.trim()!==e.title&&ne(e.seq,Ue.trim()),Te(null)},onKeyDown:oe=>{oe.key==="Enter"&&oe.target.blur(),oe.key==="Escape"&&Te(null)},sx:{width:"100%",border:"none",outline:"none",font:"inherit",fontSize:19,fontWeight:600,color:"#37352f",p:0,m:0}}):we(Zt,{onClick:()=>Te(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})}),we(At,{open:!!ke,anchorEl:ke?.anchorEl??null,title:ke?.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:ke?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>Ie(null),onConfirm:()=>{ke&&re(e.seq,ke.nextCompleted),Ie(null)}})]}):null,Wt(Zt,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:0,[Tn]:{pb:0,"& > :last-child":{mb:0}}},children:[we(il,{hideProject:G,pinColumns:!0,projectColumn:!Ce&&!X?2:"full",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:l,hideDueDate:!Ce&&!!e.repeat_rule,hideReminder:!!e.repeat_rule,notice:Ae,event:Ce,readOnly:pt,targetSummary:Q,onChangeProject:oe=>t(e.seq,oe),onAddProject:n,onChangeStartDate:oe=>c(e.seq,"start_date",oe),onChangeDueDate:oe=>c(e.seq,"due_date",oe),onChangeReminder:oe=>o(e.seq,oe),onChangePriority:oe=>f(e.seq,oe),onChangeEventTime:oe=>m?.(e.seq,oe),onChangeEventPlace:oe=>x?.(e.seq,oe),onChangeEventAddress:oe=>_?.(e.seq,oe),onMemberEdit:oe=>a(e,oe,null),narrowCollapsedSx:je,reminderLocked:e.completed,managerAction:Vt,leading:Wt(Fr,{children:[wt||Vt&&(Ae||Ce)?Wt(Zt,{sx:{gridColumn:"1 / -1",display:"flex",justifyContent:"flex-start",gap:2,px:2,py:1.5},children:[Ae||Ce?Vt:null,wt?Wt(Fr,{children:[we(Qi,{variant:"contained",size:"large",onClick:()=>xe?.(e.seq,!0),sx:{bgcolor:"#2f80ed"},children:"\uAC80\uC99D\uC644\uB8CC"}),we(Qi,{variant:"outlined",size:"large",color:"error",onClick:()=>xe?.(e.seq,!1),children:"\uC7AC\uC624\uD508"})]}):null]}):null,tt&&e.ticket_no?we(mt,{icon:we(H5,{sx:{fontSize:17}}),label:"\uD2F0\uCF13",sx:er(1),children:we(Zt,{component:"span",sx:{fontVariantNumeric:"tabular-nums"},children:e.ticket_no})}):null,Ce?null:we(Zt,{sx:tt&&e.ticket_no||Me||be?er(tt&&e.ticket_no?2:1):{gridColumn:"1 / -1"},children:we(mt,{icon:we(K5,{sx:{fontSize:17}}),label:"\uC0C1\uD0DC",onClick:pt||e.completed?void 0:oe=>xt(oe),children:we(Ot,{option:cr(e)})})}),Ae?null:(()=>{let oe=wn(e),it=oe==="all"?we(wp,{sx:{fontSize:17,color:"#2f80ed"}}):oe==="group"?we(_p,{sx:{fontSize:17,color:"#d9730d"}}):we(vp,{sx:{fontSize:17}}),Je=oe==="all"?"\uC804\uCCB4\uACF5\uAC1C":oe==="group"?`\uBD80\uC11C\uACF5\uAC1C \xB7 ${g.find(Ge=>Ge.seq===(e.visibility_group_seq??0))?.name??"\uBD80\uC11C"}`:"\uBE44\uACF5\uAC1C";return we(Zt,{sx:Ce?void 0:er(tt?1:2),children:we(mt,{icon:it,label:"\uACF5\uAC1C",onClick:pt||!d?void 0:Ge=>He(Ge),children:Je})})})(),!Ae&&!tt?we(Zt,{sx:Ce?void 0:er(1),children:we(mt,{icon:we(Q5,{sx:{fontSize:17,...e.repeat_rule?{color:"#2f80ed"}:{}}}),label:"\uBC18\uBCF5",onClick:pt||!u?void 0:oe=>Ye(oe),children:e.repeat_rule?el(e.repeat_rule):we(Uo,{label:"\uC5C6\uC74C"})})}):null,!Ae&&!tt&&e.repeat_rule?we(Zt,{sx:Ce?void 0:er(2),children:we(mt,{icon:we(e4,{sx:{fontSize:17}}),label:"\uBC18\uBCF5 \uC885\uB8CC",onClick:pt||!u?void 0:oe=>ce(oe),children:e.repeat_until?`${e.repeat_until}\uAE4C\uC9C0`:we(Uo,{})})}):null,ge&&ge.total>0?we(Zt,{sx:Ce?void 0:er(2),children:we(mt,{icon:we(Eu,{sx:{fontSize:17}}),label:"\uD655\uC778",children:ge.canConfirm?we(Qi,{size:"small",variant:"contained",onClick:()=>ve?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):Wt(Qi,{size:"small",variant:"outlined",color:"inherit",startIcon:ge.myTime?we(Mu,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:oe=>Le({anchorEl:oe.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:[ge.count," / ",ge.total]})})}):null,Ae&&ae?we(Zt,{sx:er(2),children:we(mt,{icon:we(Eu,{sx:{fontSize:17}}),label:"\uD655\uC778",children:we(Zt,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,minWidth:0},children:ae.canAck?we(Qi,{size:"small",variant:"contained",onClick:()=>ve?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):we(Qi,{size:"small",variant:"outlined",color:"inherit",startIcon:ae.acked?we(Mu,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:oe=>Le({anchorEl:oe.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:ae.total>0&&ae.count>=ae.total?"\uC644\uB8CC":Wt(Fr,{children:[ae.count,we(Zt,{component:"span",sx:{mx:.4},children:"/"}),ae.total]})})})})}):null,fe&&!We&&!Ce&&!Ae?Wt(Fr,{children:[we(mt,{icon:we(W5,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:pt?void 0:oe=>Se(oe),sx:er(1),children:(e.sprint_seq??0)>0?he.find(oe=>oe.seq===e.sprint_seq)?.name??"\uC0AD\uC81C\uB41C \uC2A4\uD504\uB9B0\uD2B8":we(Uo,{label:"\uBBF8\uBC30\uC815"})}),we(mt,{icon:we(U5,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",sx:er(2),children:we(xo,{value:(e.story_points??0)>0?String(e.story_points):"",placeholder:"\uBBF8\uCD94\uC815",readOnly:pt,onCommit:oe=>se?.(e.seq,Number(oe.replace(/[^0-9.]/g,""))||0)})})]}):null,Ce||X?null:we(Zt,{sx:[G?{gridColumn:"1 / -1"}:er(1),je??null],children:we(mt,{icon:we(G5,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:pt?void 0:oe=>Re(oe),children:(e.label_keys??[]).length>0?we(Do,{labelKeys:e.label_keys??[],labelOptions:b}):we(Uo,{})})})]}),afterProject:Ce?null:ze,trailing:Wt(Fr,{children:[tt?we(sl,{values:{repro:e.bug_repro??"",device:e.bug_device??"",where:e.bug_where??"",version:e.bug_version??"",resolution:e.resolution??""},readOnly:pt,showResolution:!!e.completed,onChangeRepro:oe=>Pe?.(e.seq,"bug_repro",oe),onChangeDevice:oe=>Pe?.(e.seq,"bug_device",oe),onChangeWhere:oe=>Pe?.(e.seq,"bug_where",oe),onChangeVersion:oe=>Pe?.(e.seq,"bug_version",oe),onChangeResolution:oe=>Be?.(e.seq,oe)}):null,Ce?ze:null,e.completed?Wt(Fr,{children:[we(mt,{icon:we(Eu,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC790",sx:[Un(10),je??null,...Ce?[]:[er(1)]],children:e.completed_by?Wt(Fr,{children:[we(Lr,{names:[e.completed_by],size:20,avatarSrcByName:l}),e.completed_by]}):we(Uo,{})}),we(mt,{icon:we(xp,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC77C\uC2DC",sx:[Un(12),je??null,...Ce?[]:[er(2)]],children:e.completed_time?rn(e.completed_time):we(Uo,{})})]}):null]})}),Wt(Zt,{sx:{display:"none",[Tn]:{display:"block",mt:1.5,mb:0}},children:[we(gi,{sx:{borderColor:"#e6e6e3"}}),we(bp,{onClick:()=>Tt(oe=>!oe),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:$e?Wt(Fr,{children:["\uC811\uAE30 ",we(q5,{sx:{fontSize:18}})]}):Wt(Fr,{children:["\uC815\uBCF4 \uB354\uBCF4\uAE30 ",we($5,{sx:{fontSize:18}})]})})]}),Wt(Zt,{children:[we(gi,{sx:{my:1.5,borderColor:"#e6e6e3",[Tn]:{mt:0,mb:1.25}}}),we(mn,{icon:we(X5,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",titleExtra:D&&!pt?we(ll,{content:e.content??"",templates:D,onApply:oe=>j?.(e.seq,oe),onSave:P,onRemove:L}):void 0,children:we(Zt,{sx:{userSelect:"text"},children:q?we(Zt,{sx:{minHeight:e.content_height||180,display:"flex",alignItems:"center",justifyContent:"center"},children:we(Na,{})}):we(cl,{syncKey:e.seq,value:e.content??"",height:e.content_height??0,onChangeHeight:N?oe=>N(e.seq,oe):void 0,readOnly:pt,onChange:oe=>j(e.seq,oe)})})}),e.is_bug?null:Wt(Fr,{children:[we(gi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(mn,{icon:we(Z5,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:we(Zt,{sx:{userSelect:"text"},children:we(dp,{value:e.note,readOnly:Pt,onCommit:oe=>B(e.seq,oe),onDraftChange:O?oe=>O(e.seq,oe):void 0})})})]}),Ce?null:Wt(Fr,{children:[we(gi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(dl,{taskSeq:e.seq,checklist:e.checklist??[],removeLocked:Pt,onAdd:S,onToggle:C,onRemove:M,onUpdate:h,onReorder:y,onConvertToTask:v,onOpenLinkedTask:w,resolveLinkedTask:T,myAccountSeq:Z,linkCandidates:E,linkBaseTask:e,onLinkExistingTask:k})]}),E&&!Ce&&!Ae&&pp(e,E)?Wt(Fr,{children:[we(gi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(gp,{task:e,tasks:E,readOnly:pt,onOpenTask:F,onLink:$,onUnlink:U,onCreateFollowUp:A})]}):null,we(gi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(gl,{taskSeq:e.seq,attachments:e.attachments??[],removeLocked:Pt,onAdd:W,onRemove:R,onPreview:I?oe=>I({...oe,taskSeq:e.seq}):void 0,onDownload:z?oe=>z({...oe,taskSeq:e.seq}):void 0})]}),we(gi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(ip,{taskSeq:e.seq,comments:e.comments??[],currentUserName:H,myAccountSeq:Z,avatarSrcByName:l,onUpdate:V,onRemove:Y,onToggleReaction:K,onPreview:I?oe=>I({...oe,taskSeq:e.seq}):void 0,onDownload:z?oe=>z({...oe,taskSeq:e.seq}):void 0})]}),we(Ri,{anchorEl:Fe,value:e.status,options:Ae?bs:tt?ti:ys,onSelect:oe=>i(e.seq,oe),onClose:()=>xt(null)}),we(Bu,{transitionDuration:0,anchorEl:vt,open:!!vt,onClose:()=>Ye(null),children:[{value:"",label:"\uC5C6\uC74C"},...Rs].map(oe=>we(Iu,{selected:(e.repeat_rule??"")===oe.value,onClick:()=>{Ye(null),(async()=>{let it=e.repeat_rule??"";if(oe.value===it)return;if(oe.value===""){await kp({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 Je=String(e.due_date??"").slice(0,10);if(!Je){t4(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}it&&!await kp({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,oe.value,tl(Je,oe.value))})()},sx:{fontSize:14,minWidth:140},children:oe.label},oe.value||"none"))}),we(r4,{anchorEl:te,open:!!te,onClose:()=>ce(null),selectedDate:e.repeat_until?new Date(`${e.repeat_until}T00:00:00`):new Date,onDateChange:oe=>{ce(null);let it=nt=>String(nt).padStart(2,"0"),Je=`${oe.getFullYear()}-${it(oe.getMonth()+1)}-${it(oe.getDate())}`,Ge=e.repeat_rule??"";Ge&&u?.(e.seq,Ge,Je)}}),we(Bu,{transitionDuration:0,anchorEl:Ze,open:!!Ze,onClose:()=>He(null),children:[{key:"involved",label:"\uBE44\uACF5\uAC1C",icon:we(vp,{sx:{fontSize:17,color:"#57564f"}}),selected:wn(e)==="involved",onPick:()=>d?.(e.seq,"involved",0)},{key:"all",label:"\uC804\uCCB4\uACF5\uAC1C",icon:we(wp,{sx:{fontSize:17,color:"#2f80ed"}}),selected:wn(e)==="all",onPick:()=>d?.(e.seq,"all",0)},...g.map(oe=>({key:`group-${oe.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${oe.name}`,icon:we(_p,{sx:{fontSize:17,color:"#d9730d"}}),selected:wn(e)==="group"&&(e.visibility_group_seq??0)===oe.seq,onPick:()=>d?.(e.seq,"group",oe.seq)}))].map(oe=>Wt(Iu,{selected:oe.selected,onClick:()=>{oe.onPick(),He(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[oe.icon,oe.label,oe.selected?we(yp,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},oe.key))}),we(Bu,{transitionDuration:0,anchorEl:pe,open:!!pe,onClose:()=>Se(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...he.filter(oe=>`custom-${oe.group_seq}`===String(e.tab_key??"")).map(oe=>({seq:oe.seq,label:hn(oe)}))].map(oe=>Wt(Iu,{onClick:()=>{Ne?.(e.seq,oe.seq),Se(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[oe.label,(e.sprint_seq??0)===oe.seq?we(yp,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},oe.seq))}),we(za,{anchorEl:lt?.anchorEl??null,open:!!lt?.open,acks:e.acks??[],total:ae?.total??ge?.total??0,pendingNames:ae?.pendingNames??ge?.pendingNames??[],avatarSrcByName:l,onRequestConfirm:_e&&(ae?ae.count<ae.total:ge&&ge.count<ge.total)?()=>{_e(e.seq),Le(oe=>oe?{...oe,open:!1}:null)}:void 0,onClose:()=>Le(oe=>oe?{...oe,open:!1}:null)}),we(yl,{anchorEl:Xe,selectedKeys:e.label_keys??[],labelOptions:b,onToggle:oe=>s(e.seq,ka(e.label_keys??[],oe)),onAddLabel:r,onClose:()=>Re(null)}),we(Lo,{anchorEl:ue,value:e.icon??"",color:e.icon_color??"",onSelect:oe=>{ie(e.seq,oe),Ee(null)},onSelectColor:le?oe=>le(e.seq,oe):void 0,onClose:()=>Ee(null)}),we(At,{open:!!De,anchorEl:De,title:st?"\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:()=>yt(null),onConfirm:()=>{ye?.(e.seq),yt(null)}})]})}import{Fragment as c4,jsx as qr,jsxs as Ep}from"react/jsx-runtime";function Zz(){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 Jz({open:e,task:p,onClose:b,onAddComment:l,onSaveFields:i,presentation:s="auto",myAccountSeq:r=0,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:c,onChangeIconColor:o,activityItems:a,activityLoading:f,onLoadActivity:d,onPrint:u,onDelete:g,canDelete:m,...x}){let _=Nt(),B=Cp(null);p&&(B.current=p);let O=p??B.current,[j,D]=Bp(!1),[P,L]=Bp({}),q=Object.keys(P).length>0;Tp(()=>{L({})},[p?.seq,e]);let N=Cp(null);if(Tp(()=>{N.current?.scrollTo({top:0})},[p?.seq]),!O)return null;let S=_&&q?{...O,...P}:O,C=S.checklist??[],M=(T,E)=>{_?L(F=>({...F,...T})):E()},h=()=>{let T=P;L({});let E=O.seq,F=T.title===void 0?void 0:String(T.title).trim();if(i){let $={...T};F!==void 0&&(F?$.title=F:delete $.title),Object.keys($).length>0&&i(E,$),Mp({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"});return}F&&n(E,F),T.icon!==void 0&&c(E,String(T.icon)),T.icon_color!==void 0&&o?.(E,String(T.icon_color)),T.status!==void 0&&x.onChangeStatus(E,T.status),T.label_keys!==void 0&&x.onChangeLabels(E,T.label_keys??[]),T.tab_key!==void 0&&x.onChangeProject(E,String(T.tab_key??"")),T.start_date!==void 0&&x.onChangeDate(E,"start_date",String(T.start_date??"")),T.due_date!==void 0&&x.onChangeDate(E,"due_date",String(T.due_date??"")),T.reminder!==void 0&&x.onChangeReminder(E,T.reminder),T.priority!==void 0&&x.onChangePriority(E,T.priority),T.event_time!==void 0&&x.onChangeEventTime?.(E,String(T.event_time??"")),T.event_place!==void 0&&x.onChangeEventPlace?.(E,String(T.event_place??"")),T.event_address!==void 0&&x.onChangeEventAddress?.(E,String(T.event_address??"")),T.content!==void 0&&x.onChangeContent(E,String(T.content??"")),T.note!==void 0&&x.onChangeNote(E,String(T.note??"")),T.visibility!==void 0&&x.onChangeVisibility?.(E,T.visibility,Number(T.visibility_group_seq??0)),Mp({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"})},y={...x,onChangeStatus:(T,E)=>M({status:E},()=>x.onChangeStatus(T,E)),onChangeLabels:(T,E)=>M({label_keys:E},()=>x.onChangeLabels(T,E)),onChangeProject:(T,E)=>M({tab_key:E},()=>x.onChangeProject(T,E)),onChangeDate:(T,E,F)=>M({[E]:F},()=>x.onChangeDate(T,E,F)),onChangeReminder:(T,E)=>M({reminder:E},()=>x.onChangeReminder(T,E)),onChangePriority:(T,E)=>M({priority:E},()=>x.onChangePriority(T,E)),onChangeEventTime:(T,E)=>M({event_time:E},()=>x.onChangeEventTime?.(T,E)),onChangeEventPlace:(T,E)=>M({event_place:E},()=>x.onChangeEventPlace?.(T,E)),onChangeEventAddress:(T,E)=>M({event_address:E},()=>x.onChangeEventAddress?.(T,E)),onChangeContent:(T,E)=>M({content:E},()=>x.onChangeContent(T,E)),onChangeNote:(T,E)=>M({note:E},()=>x.onChangeNote(T,E)),onMemberEdit:(T,E)=>x.onMemberEdit(T,E,_?F=>L($=>({...$,...F})):null),onChangeNoteDraft:_?(T,E)=>M({note:E},()=>{}):void 0,onChangeVisibility:x.onChangeVisibility?(T,E,F)=>M({visibility:E,visibility_group_seq:F},()=>x.onChangeVisibility?.(T,E,F)):void 0,onAddChecklistItem:(T,E)=>M({checklist:[...C,{label:E,checked:!1}]},()=>x.onAddChecklistItem(T,E)),onToggleChecklistItem:(T,E,F)=>M({checklist:C.map(($,U)=>U===E?{...$,checked:F}:$)},()=>x.onToggleChecklistItem(T,E,F)),onRemoveChecklistItem:(T,E)=>M({checklist:C.filter((F,$)=>$!==E)},()=>x.onRemoveChecklistItem(T,E)),onUpdateChecklistItem:x.onUpdateChecklistItem?(T,E,F)=>M({checklist:C.map(($,U)=>U===E?{...$,label:F}:$)},()=>x.onUpdateChecklistItem?.(T,E,F)):void 0,onReorderChecklist:x.onReorderChecklist?(T,E)=>M({checklist:E},()=>x.onReorderChecklist?.(T,E)):void 0,onLinkChecklistTask:x.onLinkChecklistTask?(T,E,F)=>M({checklist:[...C,{label:F,checked:!1,task_seq:E}]},()=>x.onLinkChecklistTask?.(T,E,F)):void 0},v=qr(Sp,{...y,task:S,myAccountSeq:r,onChangeTitle:(T,E)=>M({title:E},()=>n(T,E)),onToggleCompleted:t,onChangeIcon:(T,E)=>M({icon:E},()=>c(T,E)),onChangeIconColor:(T,E)=>M({icon_color:E},()=>o?.(T,E)),showTitle:_}),w=qr(sp,{onSubmit:(T,E)=>l(S.seq,T,E)},S.seq);return _||s==="dialog"?Ep(c4,{children:[qr(l4,{open:e,onClose:b,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:S.is_notice?"\uACF5\uC9C0\uC0AC\uD56D":S.is_event?"\uC77C\uC815":S.is_bug?"\uC624\uB958":"\uC5C5\uBB34",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[...d?[{icon:qr(s4,{sx:{color:"#6b7280"}}),tooltip:"\uD65C\uB3D9",onClick:()=>D(!0)}]:[],{icon:qr(i4,{sx:{color:"#6b7280"}}),tooltip:"\uACF5\uC720\uD558\uAE30",onClick:()=>Yi(S,!0)},..._?[{raw:!0,icon:qr(n4,{variant:"contained",size:"small",disableElevation:!0,disabled:!q,onClick:q?h:void 0,sx:{ml:1.5,height:32,minWidth:64,px:1.75,py:0,borderRadius:1,fontSize:14,fontWeight:600,bgcolor:"#2f80ed","&:hover":{bgcolor:"#2f80ed"},"&.Mui-disabled":{bgcolor:"#f2f2f0",color:"#c9c8c5"}},children:"\uC800\uC7A5\uD558\uAE30"})}]:[]]},fullScreen:_,maxWidth:_?void 0:"md",width:_?void 0:720,mobilePresentation:_?"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:w},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:qr(Tl,{sx:{userSelect:"none",width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:v})}]},O.seq),qr(Sl,{open:j,taskSeq:S.seq,items:a,loading:f,onLoad:d,onClose:()=>D(!1)})]}):qr(o4,{anchor:"right",open:e,onClose:b,"aria-label":"\uC5C5\uBB34 \uC0C1\uC138",disableAutoFocus:!0,disableEnforceFocus:!0,sx:{zIndex:T=>T.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:Ep(Tl,{sx:{display:"flex",flexDirection:"column",height:"100%",userSelect:"none"},children:[qr(fp,{task:S,myAccountSeq:r,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:c,onChangeIconColor:o,onClose:b,activityItems:a,activityLoading:f,onLoadActivity:d,onPrint:u,onDelete:g,canDelete:m}),qr(Ip,{sx:{borderColor:"#e6e6e3"}}),qr(Tl,{sx:{flex:1,minHeight:0},children:qr(a4,{ref:N,style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:v})}),qr(Ip,{sx:{borderColor:"#37352f"}}),qr(Tl,{sx:{flexShrink:0},children:w})]})})}import{useEffect as y4,useState as So}from"react";import{Box as $r,Button as Du,IconButton as Ap}from"@mui/material";import{FormDialog as Dp}from"@ehfuse/mui-form-dialog";import x4 from"@mui/icons-material/Add";import v4 from"@mui/icons-material/DirectionsRunOutlined";import w4 from"@mui/icons-material/EditOutlined";import{ErrorAlert as Pp}from"@ehfuse/alerts";import{ClearTextField as Np,DateTextField as Lp,LabelSelect as jp}from"@ehfuse/mui-form-controls";import{useEffect as u4,useState as Rp}from"react";import{Box as ko,Button as f4,FormControlLabel as Ru,Radio as Ou,RadioGroup as d4}from"@mui/material";import{FormDialog as h4}from"@ehfuse/mui-form-dialog";import{LabelSelect as p4}from"@ehfuse/mui-form-controls";import m4 from"@ehfuse/overlay-scrollbar";import{Fragment as g4,jsx as Or,jsxs as es}from"react/jsx-runtime";function Op({open:e,sprint:p,remainingTasks:b,sprints:l,onClose:i,onConfirm:s}){let r=l.filter(f=>f.seq!==p?.seq&&f.group_seq===(p?.group_seq??0)&&f.status!=="closed"),[t,n]=Rp("backlog"),[c,o]=Rp(0);u4(()=>{e&&(n(r.length>0?"move":"backlog"),o(r[0]?.seq??0))},[e]);let a=b.length>0;return Or(h4,{open:e,onClose:i,maxWidth:"sm",title:"\uBAA9\uD45C \uB9C8\uAC10",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-close",tabs:{visible:!1},actions:{showCancelButton:!0,right:Or(f4,{variant:"contained",onClick:()=>s({mode:a?t:"keep",moveToSprintSeq:t==="move"?c:0,taskSeqs:b.map(f=>f.seq)}),disabled:a&&t==="move"&&!(c>0),children:"\uB9C8\uAC10"})},sections:[{id:"sprint-close",title:"",showTitle:!1,children:es(ko,{sx:{display:"flex",flexDirection:"column",gap:2},children:[es(ko,{sx:{fontSize:18,color:"#37352f"},children:[Or(ko,{component:"span",sx:{fontWeight:600},children:p?.name??""})," \uBAA9\uD45C\uB97C \uB9C8\uAC10\uD569\uB2C8\uB2E4."]}),a?es(g4,{children:[es(ko,{sx:{fontSize:15,color:"#6f6f6c"},children:["\uB05D\uB098\uC9C0 \uC54A\uC740 \uC5C5\uBB34\uAC00"," ",b.length,"\uAC74 \uC788\uC2B5\uB2C8\uB2E4. \uC5B4\uB5BB\uAC8C \uD560\uAE4C\uC694?"]}),Or(ko,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:Or(m4,{style:{maxHeight:220},thumb:{width:6},children:b.map(f=>es(ko,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,borderBottom:"1px solid #f2f2f0","&:last-of-type":{borderBottom:"none"}},children:[Or(ko,{sx:{flex:1,minWidth:0,fontSize:16,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f.title}),Or(Ot,{option:cr(f)})]},f.seq))})}),es(d4,{value:t,onChange:(f,d)=>n(d),children:[r.length>0?Or(Ru,{value:"move",control:Or(Ou,{size:"small"}),label:"\uB2E4\uC74C \uBAA9\uD45C\uB85C \uC774\uC6D4",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}}):null,t==="move"&&r.length>0?Or(ko,{sx:{pl:4,pb:1},children:Or(p4,{size:"small",label:"",fullWidth:!0,value:String(c),options:r.map(f=>({value:String(f.seq),label:f.name})),onChange:f=>o(Number(f.target.value)||0)})}):null,Or(Ru,{value:"backlog",control:Or(Ou,{size:"small"}),label:"\uBBF8\uBC30\uC815(\uBC31\uB85C\uADF8)\uC73C\uB85C \uBE7C\uAE30",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}}),Or(Ru,{value:"keep",control:Or(Ou,{size:"small"}),label:"\uC774 \uBAA9\uD45C\uC5D0 \uADF8\uB300\uB85C \uB450\uAE30",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}})]})]}):Or(ko,{sx:{fontSize:15,color:"#6f6f6c"},children:"\uB0A8\uC740 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uC774\uB300\uB85C \uB9C8\uAC10\uD558\uBA74 \uBAA9\uD45C\uAC00 \uC885\uB8CC\uB429\uB2C8\uB2E4."})]})}]})}var Au="custom-";function b4(e){return e.startsWith(Au)}function uF(e){return e>0?`${Au}${e}`:""}function Vo(e){if(!b4(e))return 0;let p=Number(e.slice(Au.length));return Number.isInteger(p)&&p>0?p:0}import{Fragment as Fp,jsx as jt,jsxs as Ko}from"react/jsx-runtime";var _4=[{value:"planning",label:"\uACC4\uD68D\uC911"},{value:"active",label:"\uC9C4\uD589\uC911"},{value:"closed",label:"\uC885\uB8CC"}];function zp(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):"-"}function kF({open:e,customTabs:p,sprints:b,onClose:l,onCreate:i,onUpdate:s,onChangeStatus:r,tasks:t=[],onCloseSprint:n,onRemove:c}){let o=p.filter(E=>E.useSprints&&!E.archived),[a,f]=So(""),[d,u]=So(""),[g,m]=So(""),[x,_]=So(""),[B,O]=So(""),[j,D]=So(!1),[P,L]=So(!1),[q,N]=So(null),S=q?t.filter(E=>(E.sprint_seq??0)===q.seq&&!E.completed):[],[C,M]=So(0);y4(()=>{e&&(f(o.length===1?o[0].key:""),u(""),m(""),_(""),O(""),M(0))},[e]);let h=()=>{u(""),m(""),_(""),O(""),M(0),L(!1)},y=E=>{M(E.seq),f(`custom-${E.group_seq}`),u(E.name),m(E.goal),_(E.start_date),O(E.end_date)},v=C>0||P,w=async()=>{let E=Vo(a);if(!E){Pp("\uBAA9\uD45C\uB97C \uB9CC\uB4E4 \uD504\uB85C\uC81D\uD2B8\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}if(!d.trim()){Pp("\uBAA9\uD45C \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}D(!0);try{if(C>0){s(C,{name:d.trim(),goal:g.trim(),start_date:x,end_date:B}),h();return}await i({group_seq:E,name:d.trim(),goal:g.trim(),start_date:x,end_date:B})&&h()}finally{D(!1)}},k=new Map(p.map(E=>[Vo(E.key),E.label])),T=jt($r,{children:o.length===0?jt($r,{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.'}):jt(Fp,{children:jt($r,{children:b.length===0?Ko($r,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[jt(v4,{sx:{fontSize:48,color:"#d9d9d6"}}),jt($r,{sx:{fontSize:13.5},children:"\uB4F1\uB85D\uB41C \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):b.map(E=>Ko($r,{sx:{display:"flex",flexDirection:"column",gap:1,"&:not(:last-of-type)::after":{content:'""',display:"block",my:1.75,borderBottom:"1px solid #f0efed"}},children:[Ko($r,{sx:{minWidth:0},children:[Ko($r,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[jt($r,{component:"span",sx:{fontSize:18,fontWeight:600,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:E.name}),jt($r,{component:"span",sx:{flexShrink:0,px:1,py:.25,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:13,fontWeight:500},children:k.get(E.group_seq)??"\uC0AD\uC81C\uB41C \uD504\uB85C\uC81D\uD2B8"}),Ko($r,{component:"span",sx:{flexShrink:0,fontSize:14,color:"#57564f"},children:[zp(E.start_date)," ~"," ",zp(E.end_date)]})]}),E.goal?jt($r,{sx:{mt:.5,fontSize:14,color:"#787774",lineHeight:1.5},children:E.goal}):null]}),Ko($r,{sx:{display:"flex",alignItems:"center",gap:.5},children:[jt(jp,{label:"\uC0C1\uD0DC",showLabel:!1,size:"small",value:E.status,options:_4.map(F=>({value:F.value,label:F.label})),onChange:F=>{let $=String(F.target.value);if($==="closed"&&n){N(E);return}r(E.seq,$)},sx:{width:104,flexShrink:0}}),jt(Ap,{"aria-label":"\uBAA9\uD45C \uC218\uC815",onClick:()=>y(E),sx:{color:"#9a9a97","&:hover":{color:"#2563eb"}},children:jt(w4,{sx:{fontSize:18}})}),jt(Ap,{"aria-label":"\uBAA9\uD45C \uC0AD\uC81C",onClick:()=>c(E.seq),sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:jt(ur,{style:{width:16,height:16}})})]})]},E.seq))})})});return Ko(Fp,{children:[jt(Dp,{open:e,onClose:l,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:T}],sectionContentPaddingTop:0,actions:{showCancelButton:!0,left:o.length>0?jt(Du,{startIcon:jt(x4,{}),onClick:()=>{h(),L(!0)},sx:{color:"#2563eb"},children:"\uC0C8 \uBAA9\uD45C"}):void 0,right:jt(Du,{variant:"contained",onClick:l,children:"\uD655\uC778"})}}),jt(Op,{open:q!==null,sprint:q,remainingTasks:S,sprints:b,onClose:()=>N(null),onConfirm:E=>{q&&n?.(q.seq,E),N(null)}}),jt(Dp,{open:v,onClose:()=>{L(!1),h()},maxWidth:"sm",title:C>0?"\uBAA9\uD45C \uC218\uC815":"\uC0C8 \uBAA9\uD45C",locale:"ko",backdropClick:!1,tabs:{visible:!1},titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-form",sections:[{id:"sprint-form",title:"",showTitle:!1,children:jt($r,{sx:{pt:1},children:Ko($r,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2.5,mt:1},children:[jt(jp,{label:"\uD504\uB85C\uC81D\uD2B8",size:"medium",value:a,options:o.map(E=>({value:E.key,label:E.label})),onChange:E=>f(String(E.target.value)),disabled:C>0}),jt(Np,{label:"\uBAA9\uD45C \uC774\uB984",size:"medium",placeholder:"\uC608: 8\uC6D4 2\uC8FC\uCC28",value:d,onChange:E=>u(E.target.value)}),jt(Lp,{size:"medium",label:"\uC2DC\uC791\uC77C",value:x,onChange:E=>_(E.target.value)}),jt(Lp,{size:"medium",label:"\uC885\uB8CC\uC77C",value:B,onChange:E=>O(E.target.value)}),jt(Np,{label:"\uC124\uBA85",size:"medium",placeholder:"\uC120\uD0DD \uC785\uB825",value:g,onChange:E=>m(E.target.value),sx:{gridColumn:"1 / -1"}})]})})}],actions:{showCancelButton:!0,right:jt(Du,{variant:"contained",onClick:()=>{w()},disabled:j,children:C>0?"\uC218\uC815":"\uBAA9\uD45C \uB9CC\uB4E4\uAE30"})}})]})}import{useState as qp}from"react";import{Box as xr,Button as Pu,Divider as k4,IconButton as S4,TextField as T4}from"@mui/material";import{FormDialog as C4}from"@ehfuse/mui-form-dialog";import B4 from"@mui/icons-material/OpenInNewOutlined";import I4 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as M4}from"@ehfuse/alerts";import{jsx as zt,jsxs as bi}from"react/jsx-runtime";function AF({open:e,imports:p,onRegister:b,onRemove:l,onClose:i}){let[s,r]=qp(""),[t,n]=qp(!1),c=async()=>{let f=s.trim();if(f){n(!0);try{await b(f)&&r("")}finally{n(!1)}}},o=async f=>{await M4({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?`})&&l(f.seq)},a=bi(xr,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[bi(xr,{sx:{color:"#37352f",lineHeight:1.7},children:["\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC758 \uC77C\uC815\uC744 ",zt("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uD568\uAED8 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.",zt("br",{}),"\uD45C\uC2DC/\uC228\uAE40\uC740 \uC5C5\uBB34\uD568 \uC6B0\uC0C1\uB2E8\uC758 ",zt("b",{children:"\uAD6C\uAE00 \uC77C\uC815"})," \uC2A4\uC704\uCE58\uB85C \uCF1C\uACE0 \uB055\uB2C8\uB2E4."]}),zt(xr,{sx:{fontWeight:700,color:"#37352f",mt:.5},children:"\uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354"}),p.length>0?zt(xr,{sx:{display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1},children:p.map((f,d)=>bi(xr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:.75,borderTop:d>0?"1px solid #efefed":"none"},children:[zt(I4,{sx:{fontSize:18,color:"#0f9d58",flexShrink:0}}),zt(xr,{component:"span",sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),zt(S4,{"aria-label":"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",size:"small",onClick:()=>{o(f)},sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:zt(ur,{sx:{fontSize:18}})})]},f.seq))}):zt(xr,{sx:{color:"#9a9a97",px:.5},children:"\uC544\uC9C1 \uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}),zt(k4,{sx:{my:1,borderColor:"#e6e6e3"}}),zt(xr,{sx:{fontWeight:700,color:"#37352f"},children:"\uC0C8 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30"}),bi(xr,{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:[zt(xr,{children:bi(xr,{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 > ",zt("b",{children:"\uC124\uC815 \uBC0F \uACF5\uC720"}),"\uB97C \uC5FD\uB2C8\uB2E4."]})}),zt(xr,{children:bi(xr,{component:"span",children:[zt("b",{children:"\uCE98\uB9B0\uB354 \uD1B5\uD569"})," \uC139\uC158\uC758 ",zt("b",{children:'"iCal \uD615\uC2DD\uC758 \uBE44\uBC00 \uC8FC\uC18C"'})," \uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),zt(xr,{children:zt(xr,{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."})}),zt(xr,{children:zt(xr,{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."})})]}),bi(xr,{sx:{display:"flex",gap:2,alignItems:"center"},children:[zt(T4,{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}}}),zt(Pu,{variant:"contained",disabled:!s.trim()||t,onClick:()=>{c()},sx:{flexShrink:0},children:t?"\uD655\uC778 \uC911\u2026":"\uB4F1\uB85D"})]})]});return zt(C4,{open:e,onClose:i,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:zt(Pu,{variant:"outlined",startIcon:zt(B4,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:zt(Pu,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})}})}import{Box as To,Button as Fs,TextField as E4}from"@mui/material";import{FormDialog as R4}from"@ehfuse/mui-form-dialog";import O4 from"@mui/icons-material/ContentCopyOutlined";import $p from"@mui/icons-material/OpenInNewOutlined";import{InfoAlert as Hp}from"@ehfuse/alerts";import{Fragment as D4,jsx as ir,jsxs as yi}from"react/jsx-runtime";function A4(e){return`${window.location.origin}/api/v1/taskbox/calendar/${e}.ics`}function qF({open:e,feed:p,feedTaskCount:b,buildFeedUrl:l,onSubscribe:i,onClose:s}){let r=l??A4,t=p.subscribed?r(p.token):"",n=()=>{navigator.clipboard.writeText(t).then(()=>Hp("\uD53C\uB4DC \uC8FC\uC18C\uB97C \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>Hp("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD558\uC138\uC694."))},c=()=>{let a=t.replace(/^https?:\/\//,"webcal://");window.open(`https://calendar.google.com/calendar/r?cid=${encodeURIComponent(a)}`,"_blank")},o=yi(To,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[yi(To,{sx:{color:"#37352f",lineHeight:1.7},children:["\uB0B4\uAC00 \uAD00\uC5EC\uD55C \uC5C5\uBB34\uB97C ",ir("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4."]}),b===0?yi(To,{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.",ir("br",{}),ir("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?yi(D4,{children:[ir(E4,{value:t,fullWidth:!0,label:"\uB0B4 \uD53C\uB4DC \uC8FC\uC18C",slotProps:{input:{readOnly:!0}}}),yi(To,{sx:{display:"flex",gap:2},children:[ir(Fs,{variant:"outlined",startIcon:ir(O4,{}),onClick:n,children:"\uC8FC\uC18C \uBCF5\uC0AC"}),ir(Fs,{variant:"contained",startIcon:ir($p,{}),onClick:c,children:"Google \uCE98\uB9B0\uB354\uC5D0 \uCD94\uAC00"})]}),yi(To,{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:[ir(To,{children:yi("span",{children:["\uBC84\uD2BC\uC774 \uB3D9\uC791\uD558\uC9C0 \uC54A\uC73C\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354 > \uB2E4\uB978 \uCE98\uB9B0\uB354 + > ",ir("b",{children:"URL\uB85C \uCD94\uAC00"}),"\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),ir(To,{children:ir("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."})}),ir(To,{children:ir("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."})}),ir(To,{children:ir("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."})})]})]}):ir(Fs,{variant:"contained",onClick:i,sx:{alignSelf:"flex-start"},children:"\uAD6C\uB3C5 \uC2DC\uC791 (\uD53C\uB4DC \uBC1C\uAE09)"})]});return ir(R4,{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:o}],actions:{showCancelButton:!1,left:ir(Fs,{variant:"outlined",startIcon:ir($p,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:ir(Fs,{variant:"contained",onClick:s,children:"\uB2EB\uAE30"})}})}import{useEffect as P4,useMemo as Nu,useState as Lu}from"react";import{Box as qs,Button as N4,Typography as L4}from"@mui/material";import{FormDialog as j4}from"@ehfuse/mui-form-dialog";import{SearchTextField as z4}from"@ehfuse/mui-form-controls";import{TreeView as F4}from"@ehfuse/tree-view";import{Fragment as V4,jsx as En,jsxs as K4}from"react/jsx-runtime";function Wp(e){return`${e.name}#${e.seq}`}function q4(e){return Number(e.slice(e.lastIndexOf("#")+1))||0}function $4(e){let p=[],b=l=>{for(let i of l.employees??[])p.push(i);for(let i of l.groups??[])b(i)};for(let l of e)b(l);return p}function H4(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 W4(e){let p=[[e.name,e.role_name].filter(Boolean).join(" "),e.department].filter(Boolean).join(" / ");return{id:`emp:${e.seq}`,label:Wp(e),renderLabel:En(qs,{component:"span",sx:{display:"inline-flex",alignItems:"baseline",gap:.75},children:En(qs,{component:"span",sx:{fontWeight:400,color:"text.primary"},children:p})})}}function Up(e,p){let b=(e.groups??[]).map(i=>Up(i,p)).filter(i=>i!==null),l=(e.employees??[]).filter(i=>H4(i,p)).map(W4);return b.length===0&&l.length===0?null:{id:`group:${e.key}`,label:e.name,children:[...b,...l]}}function U4({groups:e,allEmployees:p,initialSelectedSeqs:b,multiple:l,isMobile:i,onSelectionChange:s}){let[r,t]=Lu(""),n=Nu(()=>e.map(o=>Up(o,r.trim().toLowerCase())).filter(o=>o!==null),[e,r]),c=Nu(()=>p.filter(o=>b.includes(o.seq)).map(Wp),[]);return K4(V4,{children:[En(qs,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:En(z4,{size:"small",fullWidth:!0,placeholder:"\uC774\uB984, \uBD80\uC11C \uAC80\uC0C9",onSearch:t,onClear:()=>t(""),sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),En(qs,{sx:i?{display:"flex",flexDirection:"column"}:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:En(F4,{items:n,checkbox:!0,multiSelect:l,selectionMode:"child",showSearch:!1,defaultExpanded:!0,initialSelections:c,onChange:o=>s(o.map(q4).filter(a=>a>0)),styles:{border:"none",borderRadius:"0"}})})]})}function XF({open:e,title:p="\uC9C1\uC6D0 \uC120\uD0DD",hint:b="",groups:l,multiple:i=!1,selectedSeqs:s,confirmText:r="\uD655\uC778",onConfirm:t,onClose:n}){let c=Nt(),[o,a]=Lu([]),[f,d]=Lu(0),u=Nu(()=>$4(l),[l]),g=s??[];P4(()=>{e&&(a(g),d(x=>x+1))},[e]);let m=()=>{let x=u.filter(_=>o.includes(_.seq));t(i?x:x.slice(0,1)),n()};return En(j4,{open:e,onClose:n,title:`${p}${i&&o.length>0?` (${o.length}\uBA85)`:""}`,locale:"ko",fullScreen:c,mobilePresentation:c?"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:En(qs,{sx:{...c?{}:{height:560},display:"flex",flexDirection:"column",border:"1px solid #cccccc",borderRadius:1,...c?{}:{overflow:"hidden"},userSelect:"none"},children:En(U4,{groups:l,allEmployees:u,initialSelectedSeqs:g,multiple:i,isMobile:c,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?En(L4,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.35},children:b}):void 0,right:En(N4,{variant:"contained",onClick:m,children:r})}})}import{useEffect as bk,useMemo as Cm,useState as Gs}from"react";import{Box as Io,Button as Bm}from"@mui/material";import{FormDialog as yk}from"@ehfuse/mui-form-dialog";import{LabelSelect as Ku}from"@ehfuse/mui-form-controls";import xk from"@mui/icons-material/SpeedOutlined";import{useEffect as G4,useState as Y4}from"react";import{Box as Xr,Button as X4}from"@mui/material";import{FormDialog as Z4}from"@ehfuse/mui-form-dialog";import{LabelSelect as J4,NumberField as Vp}from"@ehfuse/mui-form-controls";import Q4 from"@ehfuse/overlay-scrollbar";import{jsx as Hr,jsxs as $s}from"react/jsx-runtime";var e6=[{value:"count",label:"\uBBF8\uC644\uB8CC \uAC74\uC218"},{value:"points",label:"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8"}];function Kp({open:e,capacity:p,employees:b,onClose:l,onSave:i}){let[s,r]=Y4(p??ro);G4(()=>{e&&r(p??ro)},[e,p]);let t=s.basis==="points"?"SP":"\uAC74",n=(c,o)=>{let a=Math.max(0,Math.floor(Number(o)||0));r(f=>{let d={...f.by_account};return a>0?d[c]=a:delete d[c],{...f,by_account:d}})};return Hr(Z4,{open:e,onClose:l,maxWidth:"sm",title:"\uC778\uC6D0 \uC6A9\uB7C9",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-workload-capacity",tabs:{visible:!1},actions:{showCancelButton:!0,right:Hr(X4,{variant:"contained",onClick:()=>{i(s)},children:"\uC800\uC7A5"})},sectionContentPaddingTop:0,sections:[{id:"capacity",title:"",showTitle:!1,children:$s(Xr,{sx:{display:"flex",flexDirection:"column",gap:2},children:[Hr(Xr,{sx:{fontSize:15,color:"#37352f"},children:"\uD55C \uC0AC\uB78C\uC774 \uB3D9\uC2DC\uC5D0 \uC548\uC744 \uC218 \uC788\uB294 \uC591\uC744 \uC815\uD569\uB2C8\uB2E4. \uC774 \uAC12\uC744 \uB118\uAE30\uBA74 \uC6CC\uD06C\uB85C\uB4DC \uCC28\uD2B8\uC5D0\uC11C \uBD89\uAC8C \uD45C\uC2DC\uB429\uB2C8\uB2E4. 0 \uC73C\uB85C \uB450\uBA74 \uC6A9\uB7C9\uC744 \uC4F0\uC9C0 \uC54A\uACE0 \uD300 \uD3C9\uADE0\uC744 \uAE30\uC900\uC73C\uB85C \uBD05\uB2C8\uB2E4."}),$s(Xr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Hr(Xr,{sx:{width:104,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uC138\uB294 \uB2E8\uC704"}),Hr(J4,{size:"medium",fullWidth:!0,label:"",value:s.basis,options:e6,onChange:c=>r(o=>({...o,basis:c.target.value}))})]}),$s(Xr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Hr(Xr,{sx:{width:104,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uAE30\uBCF8 \uC6A9\uB7C9"}),Hr(Vp,{size:"medium",fullWidth:!0,min:0,max:999,thousandSeparator:!1,align:"right",suffix:t,value:s.default_capacity,onValueChange:c=>r(o=>({...o,default_capacity:Math.max(0,Math.floor(Number(c)||0))}))})]}),Hr(Xr,{sx:{pl:"119px",mt:-1.25,fontSize:13.5,color:"#37352f"},children:`\uC804\uC6D0 \uACF5\uD1B5 \uAE30\uC900(${t}) \xB7 0 = \uC6A9\uB7C9 \uC548 \uC500`}),Hr(Xr,{sx:{fontSize:16,fontWeight:700,color:"#37352f"},children:"\uC0AC\uB78C\uBCC4 \uC608\uC678"}),b.length===0?Hr(Xr,{sx:{fontSize:15,color:"#787774"},children:"\uC9C1\uC6D0 \uBAA9\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uAE30\uBCF8 \uC6A9\uB7C9\uB9CC \uC801\uC6A9\uB429\uB2C8\uB2E4."}):Hr(Xr,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:Hr(Q4,{style:{maxHeight:260},thumb:{width:6},children:b.filter(c=>Number(c.account_seq)>0).map(c=>$s(Xr,{sx:{display:"flex",alignItems:"center",gap:1.5,px:2,py:1,borderBottom:"1px solid #f2f2f0","&:last-of-type":{borderBottom:"none"}},children:[$s(Xr,{sx:{flex:1,minWidth:0,fontSize:16,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[c.name,c.department?Hr(Xr,{component:"span",sx:{ml:1,fontSize:14,color:"#787774"},children:c.department}):null]}),Hr(Xr,{sx:{width:132,flexShrink:0},children:Hr(Vp,{size:"small",fullWidth:!0,min:0,max:999,thousandSeparator:!1,align:"right",suffix:t,clearWhenZero:!0,value:s.by_account[Number(c.account_seq)]??0,onValueChange:o=>n(Number(c.account_seq),String(o??""))})})]},c.account_seq))})})]})}]})}import{Box as Bl}from"@mui/material";import{Bar as o6,BarChart as i6,CartesianGrid as s6,Cell as a6,ReferenceLine as l6,ResponsiveContainer as c6,Tooltip as u6,XAxis as f6,YAxis as d6}from"recharts";import{Box as t6}from"@mui/material";import{jsx as r6}from"react/jsx-runtime";function Wr({text:e,height:p}){return r6(t6,{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 n6}from"react";var Cl="#2f80ed",Gp="#a9c9f5",xi="#9a9a97",ju="#2e9e6b",Yn="#3d7eff",zu="#c3c8ce",Hs="#f2a30f",Ws={contentStyle:{fontSize:13.5,color:"#37352f",border:"1px solid #e6e6e3",borderRadius:6},labelStyle:{fontSize:13.5,color:"#37352f",fontWeight:700},itemStyle:{fontSize:13.5}},ts={...Ws,cursor:!1},rs={wrapperStyle:{fontSize:13.5,paddingTop:10},formatter:e=>n6("span",{style:{paddingRight:14,color:"#37352f"}},e)};function dr(e){return{display:"flex",flexDirection:"column",minHeight:0,position:"relative",...typeof e=="string"?{flex:1}:{}}}var Ar={flexShrink:0,mb:1.5,display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"};function Xn(e){return{"& *":{outline:"none"},userSelect:"none",...typeof e=="number"?{height:e,flexShrink:0}:{flex:1,minHeight:0}}}import{jsx as Rn,jsxs as Us}from"react/jsx-runtime";function h6(e,p){let b=p.filter(l=>l.sprint_seq===e.seq&&!l.archived&&l.completed);return{points:b.reduce((l,i)=>l+(i.story_points??0),0),count:b.length}}function Yp({sprints:e,tasks:p,height:b=200}){let i=[...e].sort((o,a)=>`${o.start_date}|${o.seq}`.localeCompare(`${a.start_date}|${a.seq}`)).map(o=>({sprint:o,...h6(o,p)})),s=i.some(o=>o.points>0),r=s?"SP":"\uAC74",t=i.filter(o=>o.sprint.status==="closed").map(o=>s?o.points:o.count),n=t.length>0?Math.round(t.reduce((o,a)=>o+a,0)/t.length*10)/10:null,c=i.map(o=>({\uBAA9\uD45C:`${o.sprint.name}${o.sprint.status!=="closed"?" (\uC9C4\uD589\uC911)":""}`,\uC644\uB8CC:s?o.points:o.count,closed:o.sprint.status==="closed"}));return i.length===0?Rn(Wr,{text:"\uD45C\uC2DC\uD560 \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:b}):Us(Bl,{sx:dr(b),children:[Us(Bl,{sx:{flexShrink:0,mb:1,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Us("span",{children:["\uC644\uB8CC ",s?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uBAA9\uD45C\uBCC4"]}),n!==null?Us("span",{children:["\uD3C9\uADE0(\uC885\uB8CC \uBAA9\uD45C)"," ",Rn(Bl,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:n}),r]}):null]}),Rn(Bl,{sx:Xn(b),children:Rn(c6,{width:"100%",height:"100%",children:Us(i6,{data:c,margin:{top:8,right:12,left:0,bottom:0},barCategoryGap:"28%",children:[Rn(s6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Rn(f6,{dataKey:"\uBAA9\uD45C",tick:{fontSize:13},tickMargin:6,interval:0}),Rn(d6,{tick:{fontSize:13},width:40,allowDecimals:!1}),Rn(u6,{...ts,formatter:o=>`${Number(o??0)}${r}`}),n!==null?Rn(l6,{y:n,stroke:xi,strokeDasharray:"6 5",label:{value:`\uD3C9\uADE0 ${n}${r}`,position:"right",fontSize:13}}):null,Rn(o6,{dataKey:"\uC644\uB8CC",radius:[4,4,0,0],children:c.map(o=>Rn(a6,{fill:o.closed?Cl:Gp},o.\uBAA9\uD45C))})]})})})]})}import{useMemo as p6}from"react";import{Box as Zn}from"@mui/material";import{CartesianGrid as m6,Line as Xp,LineChart as g6,ResponsiveContainer as b6,Tooltip as y6,XAxis as x6,YAxis as v6}from"recharts";import{jsx as Zr,jsxs as Go}from"react/jsx-runtime";function Zp(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?new Date(`${e}T00:00:00`):null}function w6(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function _6(e){return e.slice(5).replace("-",".")}function Jp({sprint:e,tasks:p,todayStr:b,height:l=200,headerLeft:i}){let s=p6(()=>{let a=Zp(e.start_date),f=Zp(e.end_date);if(!a||!f||f<a||Math.round((f.getTime()-a.getTime())/864e5)+1>366)return null;let u=p.filter(P=>P.sprint_seq===e.seq&&!P.archived);if(u.length===0)return{empty:!0};let g=u.some(P=>(P.story_points??0)>0),m=P=>g?P.story_points??0:1,x=u.reduce((P,L)=>P+m(L),0),_=new Map;for(let P of u){if(!P.completed)continue;let L=(P.completed_time??"").slice(0,10),q=/^\d{4}-\d{2}-\d{2}$/.test(L)?L:e.start_date;_.set(q,(_.get(q)??0)+m(P))}let B=[];for(let P=new Date(a);P<=f;P.setDate(P.getDate()+1))B.push(w6(P));let O=x,j=x;return{empty:!1,data:B.map((P,L)=>{let q=B.length===1?0:x*(1-L/(B.length-1));return P<=b&&(O-=_.get(P)??0,j=Math.max(0,O)),{\uB0A0\uC9DC:_6(P),\uC774\uC0C1:Math.round(q*10)/10,\uB0A8\uC740\uB7C9:P<=b?Math.max(0,O):null}}),total:x,usePoints:g,last:j}},[e,p,b]);if(!s)return Go(Zn,{sx:dr(l),children:[i?Zr(Zn,{sx:Ar,children:i}):null,Zr(Wr,{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:l})]});if(s.empty)return Go(Zn,{sx:dr(l),children:[i?Zr(Zn,{sx:Ar,children:i}):null,Zr(Wr,{text:"\uBC30\uC815\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]});let{data:r,total:t,usePoints:n,last:c}=s,o=n?"SP":"\uAC74";return Go(Zn,{sx:dr(l),children:[Go(Zn,{sx:Ar,children:[i?Zr(Zn,{sx:{flexShrink:0},children:i}):null,Go(Zn,{sx:{flex:1,minWidth:220,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Go("span",{children:["\uB0A8\uC740 ",n?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uCD1D ",t]}),Go("span",{children:["\uD604\uC7AC"," ",Zr(Zn,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:c}),o," \uB0A8\uC74C"]})]})]}),Zr(Zn,{sx:Xn(l),children:Zr(b6,{width:"100%",height:"100%",children:Go(g6,{data:r,margin:{top:8,right:12,left:0,bottom:0},children:[Zr(m6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Zr(x6,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),Zr(v6,{tick:{fontSize:13},width:40,allowDecimals:!1}),Zr(y6,{...Ws,formatter:a=>`${Number(a??0)}${o}`}),Zr(Xp,{type:"linear",dataKey:"\uC774\uC0C1",stroke:xi,strokeDasharray:"6 5",strokeWidth:1.5,dot:!1}),Zr(Xp,{type:"monotone",dataKey:"\uB0A8\uC740\uB7C9",stroke:Cl,strokeWidth:2.5,dot:!1,connectNulls:!1})]})})})]})}import{useMemo as im}from"react";import{Box as Jn}from"@mui/material";import{Area as $u,AreaChart as C6,CartesianGrid as B6,Legend as I6,ResponsiveContainer as M6,Tooltip as E6,XAxis as R6,YAxis as O6}from"recharts";function Co(e){let p=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())}`}function Il(e,p=new Date){let b=new Date(p);return b.setMonth(b.getMonth()-e),b}function Tq(e=new Date){return{fromDate:Co(Il(1,e)),toDate:Co(e)}}var qu=864e5,Vs=[0,1,2,3,5,8,13,21];function tm(e){return!e.archived&&!e.linked_only&&!e.is_notice&&!e.is_event}function Fu(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 l=new Date(`${b[1]}T${b[2]??"00:00"}:00`).getTime();return Number.isNaN(l)?null:l}function ns(e){let p=String(e??"").trim();return/^\d{4}-\d{2}-\d{2}/.test(p)?p.slice(0,10):""}function k6(e){let p=ns(e.created_time)||ns(e.start_date)||ns(e.completed_time);if(!p)return null;let b=ns(e.start_date),l=b&&b>p?b:p,i=e.completed?ns(e.completed_time)||p:"";return{created:p,started:l,done:i}}function rm(e,p){let b=/^\d{4}-\d{2}-\d{2}$/.test(p)?new Date(`${p}T00:00:00`):new Date,l=Math.max(2,Math.min(366,Math.round(e))),i=[];for(let s=l-1;s>=0;s-=1)i.push(Co(new Date(b.getTime()-s*qu)));return i}function nm(e,p,b){let l=rm(p,b),i=e.filter(tm).map(k6).filter(n=>n!==null),s=l.map(n=>{let c=0,o=0,a=0;for(let f of i)f.created>n||(f.done&&f.done<=n?c+=1:f.started<=n?o+=1:a+=1);return{day:n,done:c,inProgress:o,waiting:a}}),r=s[s.length-1],t=s.reduce((n,c)=>Math.max(n,c.done+c.inProgress+c.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 S6(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 Qp(e){if(e.length===0)return null;let p=[...e].sort((s,r)=>s-r),b=s=>Math.round(s*10)/10,l=Math.floor(p.length/2),i=p.length%2===1?p[l]:(p[l-1]+p[l])/2;return{count:p.length,median:b(i),average:b(p.reduce((s,r)=>s+r,0)/p.length),p85:b(S6(p,.85))}}function em(e){for(let p=Vs.length-1;p>=0;p-=1)if(e>=Vs[p])return p;return 0}function T6(){return Vs.map((e,p)=>p===Vs.length-1?`${e}\uC77C+`:`${e}~${Vs[p+1]}\uC77C`)}function om(e,p,b){let l=rm(p,b),i=l[0],s=l[l.length-1],r=T6(),t=r.map(()=>0),n=r.map(()=>0),c=[],o=[];for(let a of e){if(!tm(a)||!a.completed)continue;let f=ns(a.completed_time);if(!f||f<i||f>s)continue;let d=Fu(a.completed_time),u=Fu(a.created_time);if(d===null||u===null)continue;let g=Math.max(0,(d-u)/qu);c.push(g),t[em(g)]+=1;let m=Fu(a.start_date);if(m===null||m>d)continue;let x=Math.max(0,(d-Math.max(m,u))/qu);o.push(x),n[em(x)]+=1}return{labels:r,leadCounts:t,cycleCounts:n,lead:Qp(c),cycle:Qp(o)}}import{jsx as Ur,jsxs as Yo}from"react/jsx-runtime";function A6(e){return e.slice(5).replace("-",".")}function sm({tasks:e,todayStr:p,days:b=30,height:l=220,headerLeft:i}){let s=im(()=>nm(e,b,p),[e,b,p]),r=im(()=>s.points.map(n=>({\uB0A0\uC9DC:A6(n.day),\uC644\uB8CC:n.done,\uC9C4\uD589:n.inProgress,\uB300\uAE30:n.waiting})),[s]),t=Yo(Jn,{sx:Ar,children:[i?Ur(Jn,{sx:{flexShrink:0},children:i}):null,Yo(Jn,{sx:{flex:1,minWidth:220,display:"flex",flexDirection:"column",gap:.5},children:[Yo(Jn,{sx:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Yo("span",{children:["\uCD5C\uADFC ",s.points.length,"\uC77C \u2014 \uC811\uC218 ",s.currentTotal,"\uAC74 / \uC644\uB8CC ",s.currentDone,"\uAC74"]}),Yo("span",{children:["\uC9C4\uD589 \uC911"," ",Ur(Jn,{component:"span",sx:{color:Yn,fontWeight:700},children:s.currentWip}),"\uAC74"]})]}),Ur(Jn,{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?Yo(Jn,{sx:dr(l),children:[i?Ur(Jn,{sx:Ar,children:i}):null,Ur(Wr,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC811\uC218\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]}):Yo(Jn,{sx:dr(l),children:[t,Ur(Jn,{sx:Xn(l),children:Ur(M6,{width:"100%",height:"100%",children:Yo(C6,{data:r,margin:{top:8,right:12,left:0,bottom:4},children:[Ur(B6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Ur(R6,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),Ur(O6,{tick:{fontSize:13},width:40,allowDecimals:!1}),Ur(E6,{...Ws,formatter:n=>`${Number(n??0)}\uAC74`}),Ur(I6,{...rs}),Ur($u,{type:"monotone",dataKey:"\uC644\uB8CC",stackId:"flow",stroke:ju,fill:ju,fillOpacity:.9}),Ur($u,{type:"monotone",dataKey:"\uC9C4\uD589",stackId:"flow",stroke:Yn,fill:Yn,fillOpacity:.85}),Ur($u,{type:"monotone",dataKey:"\uB300\uAE30",stackId:"flow",stroke:zu,fill:zu,fillOpacity:.9})]})})})]})}import{useMemo as am}from"react";import{Box as Jr}from"@mui/material";import{Bar as lm,BarChart as D6,CartesianGrid as P6,Legend as N6,ResponsiveContainer as L6,Tooltip as j6,XAxis as z6,YAxis as F6}from"recharts";import{jsx as vr,jsxs as bn}from"react/jsx-runtime";function cm({label:e,color:p,summary:b}){let l=bn(Jr,{sx:{display:"flex",alignItems:"center",gap:.75},children:[vr(Jr,{sx:{width:10,height:10,borderRadius:.5,bgcolor:p,flexShrink:0}}),vr(Jr,{component:"span",sx:{fontWeight:700,color:"#37352f"},children:e})]});return b?bn(Jr,{sx:{display:"contents"},children:[l,bn("span",{children:[b.count,"\uAC74"]}),bn("span",{children:["\uC911\uC559\uAC12"," ",vr(Jr,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:b.median}),"\uC77C"]}),bn("span",{children:["\uD3C9\uADE0 ",b.average,"\uC77C"]}),bn("span",{children:["85% ",b.p85,"\uC77C \uC774\uB0B4"]})]}):bn(Jr,{sx:{display:"contents"},children:[l,vr(Jr,{component:"span",sx:{gridColumn:"span 4",color:"#9a9a97"},children:"\uD45C\uBCF8 \uC5C6\uC74C"})]})}function um({tasks:e,todayStr:p,days:b=30,height:l=200,headerLeft:i}){let s=am(()=>om(e,b,p),[e,b,p]),r=am(()=>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?bn(Jr,{sx:dr(l),children:[bn(Jr,{sx:Ar,children:[i?vr(Jr,{sx:{flexShrink:0},children:i}):null,bn(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:[vr(cm,{label:"\uB9AC\uB4DC\uD0C0\uC784(\uC791\uC131\u2192\uC644\uB8CC)",color:Yn,summary:s.lead}),vr(cm,{label:"\uC0AC\uC774\uD074\uD0C0\uC784(\uC2DC\uC791\u2192\uC644\uB8CC)",color:Hs,summary:s.cycle})]})]}),vr(Jr,{sx:Xn(l),children:vr(L6,{width:"100%",height:"100%",children:bn(D6,{data:r,margin:{top:8,right:12,left:0,bottom:4},barCategoryGap:"24%",children:[vr(P6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),vr(z6,{dataKey:"\uAD6C\uAC04",tick:{fontSize:13},tickMargin:6,interval:0}),vr(F6,{tick:{fontSize:13},width:40,allowDecimals:!1}),vr(j6,{...ts,formatter:t=>`${Number(t??0)}\uAC74`}),vr(N6,{...rs}),vr(lm,{dataKey:"\uB9AC\uB4DC\uD0C0\uC784",fill:Yn,radius:[3,3,0,0]}),vr(lm,{dataKey:"\uC0AC\uC774\uD074\uD0C0\uC784",fill:Hs,radius:[3,3,0,0]})]})})})]}):bn(Jr,{sx:dr(l),children:[i?vr(Jr,{sx:Ar,children:i}):null,vr(Wr,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC644\uB8CC\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]})}import{useMemo as pm}from"react";import{Box as vi}from"@mui/material";import{Bar as Wu,BarChart as U6,CartesianGrid as V6,Cell as K6,Legend as G6,ReferenceLine as mm,ResponsiveContainer as Y6,Tooltip as X6,XAxis as Z6,YAxis as J6}from"recharts";function q6(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(),l=new Date(`${p}T00:00:00`).getTime();return Number.isNaN(b)||Number.isNaN(l)?null:Math.round((l-b)/864e5)}function $6(e,p,b){let l=String(e.due_date??"").slice(0,10),i=q6(p,l);return i===null?"later":i<0?"overdue":i<=b?"soon":"later"}function Ml(e,p){let{todayStr:b,soonDays:l=7,includeUnassigned:i=!0,limit:s,capacity:r}=p,t=r??ro,n=new Map;for(let o of e){if(o.completed||o.archived||o.is_notice||o.is_event||o.linked_only)continue;let a=Number(o.manager_account_seq??0);if(!a&&!i)continue;let f=a?String(o.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",d=n.get(a)??{accountSeq:a,name:f,overdue:0,soon:0,later:0,total:0,points:0,capacity:0,load:0,ratio:0};d[$6(o,b,l)]+=1,d.total+=1,d.points+=Number(o.story_points??0)||0,n.set(a,d)}for(let o of n.values())o.capacity=H6(o.accountSeq,t),o.load=t.basis==="points"?o.points:o.total,o.ratio=o.capacity>0?o.load/o.capacity:0;let c=[...n.values()].sort((o,a)=>o.accountSeq===0!=(a.accountSeq===0)?o.accountSeq===0?1:-1:o.overdue!==a.overdue?a.overdue-o.overdue:o.total!==a.total?a.total-o.total:o.name.localeCompare(a.name));return typeof s=="number"&&s>0?c.slice(0,s):c}function El(e,p){return e.filter(b=>b.completed||b.archived||b.is_notice||b.is_event||b.linked_only?!1:Number(b.manager_account_seq??0)===p).sort((b,l)=>{let i=String(b.due_date??"").slice(0,10),s=String(l.due_date??"").slice(0,10);return!i!=!s?i?-1:1:i!==s?i.localeCompare(s):String(b.title??"").localeCompare(String(l.title??""))})}function H6(e,p){if(!(e>0))return 0;let b=Math.max(0,Math.floor(Number(p.by_account?.[e])||0));return b>0?b:Math.max(0,Math.floor(Number(p.default_capacity)||0))}function Rl(e){return e.capacity>0&&e.load>e.capacity}function fm(e,p){return p>0&&e.total>=p}function dm(e){let p=e.filter(b=>b.accountSeq>0);return p.length===0?0:p.reduce((b,l)=>b+l.total,0)/p.length}function Hu(e,p){let b=new Date(`${e}T00:00:00`);b.setDate(b.getDate()+p);let l=i=>String(i).padStart(2,"0");return`${b.getFullYear()}-${l(b.getMonth()+1)}-${l(b.getDate())}`}function W6(e){let p=new Date(`${e}T00:00:00`);if(Number.isNaN(p.getTime()))return e;let b=(p.getDay()+6)%7;return Hu(e,-b)}function hm(e,p){let{todayStr:b,includeUnassigned:l=!0,weeks:i=6,limit:s}=p,r=W6(b),t=Array.from({length:Math.max(1,i)},(d,u)=>{let g=Hu(r,u*7),m=Hu(g,6),[,x,_]=g.split("-");return{start:g,end:m,label:`${Number(x)}/${Number(_)}`,isCurrent:u===0}}),n=t[t.length-1].end,c=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&&!l)continue;let g=u?String(d.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",m=c.get(u)??{accountSeq:u,name:g,overdue:0,byWeek:new Array(t.length).fill(0),noDue:0,total:0,beyond:0},x=String(d.due_date??"").slice(0,10);if(m.total+=1,!/^\d{4}-\d{2}-\d{2}$/.test(x))m.noDue+=1;else if(x<b)m.overdue+=1;else if(x>n)m.beyond+=1;else{let _=t.findIndex(B=>x>=B.start&&x<=B.end);_>=0?m.byWeek[_]+=1:m.beyond+=1}c.set(u,m)}let o=[...c.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?o.slice(0,s):o,f=a.reduce((d,u)=>Math.max(d,u.overdue,u.noDue,...u.byWeek),0);return{weeks:t,rows:a,maxCell:f}}import{Fragment as gm,jsx as wr,jsxs as Xo}from"react/jsx-runtime";var Ks="#e5484d";function bm({tasks:e,todayStr:p,soonDays:b=7,overloadThreshold:l=0,capacity:i=ro,height:s=200,headerLeft:r,selectedAccountSeq:t=0,onSelectPerson:n}){let c=pm(()=>Ml(e,{todayStr:p,soonDays:b,capacity:i}),[e,p,b,i]),o=pm(()=>dm(c),[c]),a=l>0?l:Math.max(3,Math.ceil(o*1.5)),f=i.default_capacity>0||Object.keys(i.by_account).length>0,d=i.basis==="points"?"SP":"\uAC74",u=c.filter(g=>g.accountSeq>0&&(f?Rl(g):fm(g,a))).length;return c.length===0?Xo(vi,{sx:dr(s),children:[r?wr(vi,{sx:Ar,children:r}):null,wr(Wr,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:s})]}):Xo(vi,{sx:dr(s),children:[Xo(vi,{sx:Ar,children:[r,Xo(vi,{sx:{fontSize:13.5,color:"#37352f"},children:["1\uC778 \uD3C9\uADE0 ",wr("b",{children:o.toFixed(1)}),"\uAC74 \xB7"," ",f?Xo(gm,{children:["\uC6A9\uB7C9 ",wr("b",{children:i.default_capacity||"\uAC1C\uC778\uBCC4"}),i.default_capacity?d:""]}):Xo(gm,{children:["\uACFC\uBD80\uD558 \uAE30\uC900 ",wr("b",{children:a}),"\uAC74"]}),u>0?Xo(vi,{component:"span",sx:{ml:1,color:Ks,fontWeight:700},children:["\uCD08\uACFC ",u,"\uBA85"]}):null]})]}),wr(vi,{sx:Xn(s),children:wr(Y6,{width:"100%",height:"100%",children:Xo(U6,{data:c,layout:"vertical",onClick:n?g=>{let m=c.find(x=>x.name===String(g?.activeLabel??""));m&&n(m.accountSeq===t?0:m.accountSeq)}:void 0,style:n?{cursor:"pointer"}:void 0,margin:{top:4,right:16,bottom:4,left:8},barCategoryGap:c.length>8?4:10,children:[wr(V6,{strokeDasharray:"3 3",horizontal:!1,stroke:"#eceae6"}),wr(Z6,{type:"number",allowDecimals:!1,tick:{fontSize:12}}),wr(J6,{type:"category",dataKey:"name",width:84,tick:{fontSize:12},interval:0}),wr(X6,{...ts,formatter:(g,m)=>[`${Number(g)||0}\uAC74`,String(m)],labelFormatter:g=>{let m=c.find(x=>x.name===g);return!m||!(m.capacity>0)?String(g):`${g} \u2014 \uC6A9\uB7C9 ${m.capacity}${d} \uC911 ${m.load} (${Math.round(m.ratio*100)}%)`}}),wr(G6,{...rs}),o>0?wr(mm,{x:o,stroke:xi,strokeDasharray:"4 4",label:{value:"\uD3C9\uADE0",position:"top",fontSize:11,fill:xi}}):null,i.default_capacity>0?wr(mm,{x:i.default_capacity,stroke:Ks,strokeDasharray:"2 3",label:{value:"\uC6A9\uB7C9",position:"top",fontSize:11,fill:Ks}}):null,wr(Wu,{dataKey:"overdue",name:"\uC9C0\uC5F0",stackId:"load",fill:Ks}),wr(Wu,{dataKey:"soon",name:`\uC784\uBC15(${b}\uC77C)`,stackId:"load",fill:Hs}),wr(Wu,{dataKey:"later",name:"\uC5EC\uC720",stackId:"load",fill:Yn,radius:[0,3,3,0],children:c.map(g=>wr(K6,{fill:f&&Rl(g)?Ks:Yn,fillOpacity:f&&Rl(g)?.45:1,stroke:g.accountSeq===t?"#37352f":void 0,strokeWidth:g.accountSeq===t?1.5:0},g.accountSeq))})]})})})]})}import{useEffect as sk,useState as ak}from"react";import{Box as lk,Button as ck}from"@mui/material";import{FormDialog as uk}from"@ehfuse/mui-form-dialog";import{useState as Q6}from"react";import{Box as hr,Button as ek,Menu as tk,MenuItem as rk}from"@mui/material";import nk from"@mui/icons-material/PersonOutlineOutlined";import ok from"@ehfuse/overlay-scrollbar";import{jsx as Sr,jsxs as Bo}from"react/jsx-runtime";var ym=56,xm=68,vm=96;function ik(e){let p=String(e.due_date??"").slice(0,10);return p?p.slice(5).replace("-","/"):"-"}function wm(e,p){let b=String(e.due_date??"").slice(0,10);return!!b&&b<p}function _m({tasks:e,row:p,todayStr:b,employees:l,rows:i,height:s=200,hideSummary:r=!1,onChangeManager:t,onOpenTask:n}){let[c,o]=Q6(null),a=El(e,p.accountSeq),f=d=>i.find(u=>u.accountSeq===d)?.total??0;return Bo(hr,{sx:{display:"flex",flexDirection:"column",minHeight:0,height:s},children:[r?null:Bo(hr,{sx:{display:"flex",alignItems:"center",gap:1,px:.5,pb:.75,fontSize:14,color:"#37352f"},children:[Sr(hr,{component:"span",sx:{fontWeight:700},children:p.name}),Bo(hr,{component:"span",children:["\uBBF8\uC644\uB8CC ",a.length,"\uAC74"]}),p.capacity>0?Bo(hr,{component:"span",sx:{color:p.load>p.capacity?"#e5484d":"#787774"},children:["\xB7 \uC6A9\uB7C9 ",p.capacity," \uC911 ",p.load]}):null]}),Bo(hr,{sx:{flex:1,minHeight:0,display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:[Bo(hr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,flexShrink:0,bgcolor:"#fafaf9",borderBottom:"1px solid #e6e6e3",fontSize:13.5,fontWeight:600,color:"#37352f"},children:[Sr(hr,{sx:{width:ym,flexShrink:0},children:"\uB9C8\uAC10"}),Sr(hr,{sx:{flex:1,minWidth:0},children:"\uC5C5\uBB34"}),Sr(hr,{sx:{width:xm,flexShrink:0,textAlign:"center"},children:"\uC911\uC694\uB3C4"}),t?Sr(hr,{sx:{width:vm,flexShrink:0,textAlign:"center"},children:"\uCC45\uC784\uC790"}):null]}),Sr(hr,{sx:{flex:1,minHeight:0},children:Sr(ok,{style:{height:"100%"},thumb:{width:6},children:a.length===0?Sr(hr,{sx:{p:2,fontSize:14,color:"#9a9a97"},children:"\uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):a.map(d=>Bo(hr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1.5,borderBottom:"1px solid #f2f2f0"},children:[Sr(hr,{sx:{width:ym,flexShrink:0,fontSize:13.5,color:wm(d,b)?"#e5484d":"#787774",fontWeight:wm(d,b)?700:400},children:ik(d)}),Sr(hr,{onClick:n?()=>n(d.seq):void 0,sx:{flex:1,minWidth:0,fontSize:14.5,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...n?{cursor:"pointer","&:hover":{textDecoration:"underline"}}:{}},children:d.title}),Sr(hr,{sx:{width:xm,flexShrink:0,display:"flex",justifyContent:"center"},children:Sr(Nr,{priority:d.priority})}),t?Sr(hr,{sx:{width:vm,flexShrink:0,display:"flex",justifyContent:"center"},children:Sr(ek,{size:"small",variant:"outlined",startIcon:Sr(nk,{sx:{fontSize:17}}),onClick:u=>o({el:u.currentTarget,taskSeq:d.seq}),children:"\uC62E\uAE30\uAE30"})}):null]},d.seq))})})]}),Sr(tk,{anchorEl:c?.el??null,open:!!c,onClose:()=>o(null),transitionDuration:0,children:l.filter(d=>Number(d.account_seq)>0&&Number(d.account_seq)!==p.accountSeq).map(d=>Bo(rk,{onClick:()=>{c&&t&&t(c.taskSeq,Number(d.account_seq),d.name),o(null)},sx:{fontSize:14,minWidth:200},children:[Sr(hr,{sx:{flex:1},children:d.name}),Bo(hr,{component:"span",sx:{ml:2,fontSize:13,color:"#787774"},children:[f(Number(d.account_seq)),"\uAC74"]})]},d.account_seq))})]})}import{jsx as Ol}from"react/jsx-runtime";function km({open:e,row:p,rows:b,tasks:l,todayStr:i,employees:s,onClose:r,onChangeManager:t,onOpenTask:n}){let[c,o]=ak(p);sk(()=>{p&&o(p)},[p]);let a=p??c,f=a?El(l,a.accountSeq).length:0;return Ol(uk,{open:e,onClose:r,maxWidth:"sm",title:a?`${a.name} \uC5C5\uBB34 (${f})`:"\uC5C5\uBB34",locale:"ko",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-workload-person",tabs:{visible:!1},actions:{showCancelButton:!1,right:Ol(ck,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})},sections:[{id:"person-tasks",title:"",showTitle:!1,children:Ol(lk,{sx:{minHeight:0},children:a?Ol(_m,{tasks:l,row:a,rows:b,todayStr:i,employees:s,height:"min(420px, 52vh)",hideSummary:!0,onChangeManager:t,onOpenTask:n}):null})}]})}import{useMemo as fk}from"react";import{Box as sn,Tooltip as dk}from"@mui/material";import{OverlayScrollbar as hk}from"@ehfuse/overlay-scrollbar";import{jsx as Vr,jsxs as Dl}from"react/jsx-runtime";var Sm="#e5484d",pk="#2f80ed",mk="#9a9a97",Uu=30,gk=96,Al=56;function Vu({count:e,max:p,color:b,title:l}){let i=e>0&&p>0?.18+e/p*.72:0;return Vr(dk,{title:l,arrow:!0,disableInteractive:!0,placement:"top",children:Vr(sn,{sx:{display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #ececea",borderBottom:"1px solid #ececea",bgcolor:i>0?`${b}${Math.round(i*255).toString(16).padStart(2,"0")}`:"transparent",color:i>.55?"#fff":"#37352f",fontSize:12.5,fontWeight:e>0?700:400,fontVariantNumeric:"tabular-nums"},children:e>0?e:""})})}function Tm({tasks:e,todayStr:p,weeks:b=6,height:l=200}){let i=fk(()=>hm(e,{todayStr:p,weeks:b}),[e,p,b]);if(i.rows.length===0)return Vr(sn,{sx:dr(l),children:Vr(Wr,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})});let s=`${gk}px ${Al}px repeat(${i.weeks.length}, minmax(${Al}px, 1fr)) ${Al}px ${Al}px`,r={height:Uu,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 Vr(sn,{sx:dr(l),children:Vr(hk,{style:{height:"100%"},thumb:{width:8},children:Dl(sn,{sx:{display:"grid",gridTemplateColumns:s,minWidth:"fit-content",height:"100%",gridTemplateRows:`${Uu}px repeat(${i.rows.length}, minmax(${Uu}px, 1fr))`},children:[Vr(sn,{sx:{...r,justifyContent:"flex-start",pl:1},children:"\uB2F4\uB2F9\uC790"}),Vr(sn,{sx:{...r,color:Sm},children:"\uC9C0\uC5F0"}),i.weeks.map(t=>Vr(sn,{sx:{...r,...t.isCurrent?{borderBottom:"2px solid #2f80ed"}:{}},children:t.label},t.start)),Vr(sn,{sx:r,children:"\uB9C8\uAC10\uC5C6\uC74C"}),Vr(sn,{sx:r,children:"\uD569\uACC4"}),i.rows.map(t=>Dl(sn,{sx:{display:"contents"},children:[Vr(sn,{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}),Vr(Vu,{count:t.overdue,max:i.maxCell,color:Sm,title:`${t.name} \xB7 \uC9C0\uC5F0 ${t.overdue}\uAC74`}),t.byWeek.map((n,c)=>Vr(Vu,{count:n,max:i.maxCell,color:pk,title:`${t.name} \xB7 ${i.weeks[c].label} \uC8FC \uB9C8\uAC10 ${n}\uAC74`},i.weeks[c].start)),Vr(Vu,{count:t.noDue,max:i.maxCell,color:mk,title:`${t.name} \xB7 \uB9C8\uAC10 \uBBF8\uC815 ${t.noDue}\uAC74`}),Dl(sn,{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?Dl(sn,{component:"span",sx:{ml:.25,fontSize:10.5,color:"#9a9a97"},children:["(+",t.beyond,")"]}):null]})]},t.accountSeq))]})})})}import{Fragment as Im,jsx as Jt,jsxs as Pl}from"react/jsx-runtime";var Mm="min(560px, 62vh)",vk=`calc(${Mm} - 4px)`,wk=[{value:"30",label:"\uCD5C\uADFC 30\uC77C"},{value:"60",label:"\uCD5C\uADFC 60\uC77C"},{value:"90",label:"\uCD5C\uADFC 90\uC77C"}];function H$({open:e,sprints:p,tasks:b,todayStr:l,showSprintCharts:i,capacity:s=ro,capacityEmployees:r=[],onSaveCapacity:t,onChangeTaskManager:n,onOpenTask:c,initialSprintSeq:o=0,onClose:a}){let[f,d]=Gs(0),[u,g]=Gs(30);bk(()=>{if(!e)return;let y=p.find(w=>w.status==="active")??p[0],v=p.find(w=>w.seq===o)??y;d(v?.seq??0)},[e]);let m=Cm(()=>p.find(y=>y.seq===f)??null,[p,f]),x={height:vk,boxSizing:"border-box",px:3,py:2.5,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden"},_=Jt(Ku,{label:"\uBAA9\uD45C",showLabel:!1,showEmptyOption:!1,value:f?String(f):"",options:p.map(y=>({value:String(y.seq),label:hn(y)})),onChange:y=>d(Number(y.target.value)||0),sx:{width:280,flexShrink:0}}),[B,O]=Gs("distribution"),j=Jt(Ku,{label:"\uBCF4\uAE30",showLabel:!1,showEmptyOption:!1,value:B,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:y=>O(y.target.value==="timeline"?"timeline":"distribution"),sx:{width:280,flexShrink:0}}),[D,P]=Gs(!1),[L,q]=Gs(0),N=Cm(()=>Ml(b,{todayStr:l,capacity:s}),[b,l,s]),S=N.find(y=>y.accountSeq===L)??null,C=Pl(Im,{children:[j,t?Jt(Bm,{size:"small",variant:"outlined",startIcon:Jt(xk,{sx:{fontSize:18}}),onClick:()=>P(!0),sx:{flexShrink:0},children:"\uC6A9\uB7C9"}):null]}),M=i??p.length>0,h=Jt(Ku,{label:"\uAE30\uAC04",showLabel:!1,showEmptyOption:!1,value:String(u),options:wk,onChange:y=>g(Number(y.target.value)||30),sx:{width:280,flexShrink:0}});return Pl(Im,{children:[Jt(yk,{open:e,onClose:a,maxWidth:"md",title:"\uC5C5\uBB34 \uCC28\uD2B8",locale:"ko",contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,sectionTitleGap:0,fixedHeight:Mm,contentBottomPadding:0,scrollPastLastSection:!1,tabs:{visible:!0,switchContent:!0,fullWidth:!0},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-charts",sections:[...M?[{id:"velocity",tabTitle:"\uBCA8\uB85C\uC2DC\uD2F0",showTitle:!1,children:Jt(Io,{sx:x,children:Jt(Yp,{sprints:p,tasks:b,height:"100%"})})},{id:"burndown",tabTitle:"\uBC88\uB2E4\uC6B4",showTitle:!1,children:Jt(Io,{sx:x,children:m?Jt(Jp,{sprint:m,tasks:b,todayStr:l,height:"100%",headerLeft:_}):Pl(Io,{sx:dr("100%"),children:[Jt(Io,{sx:Ar,children:_}),Jt(Wr,{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:Jt(Io,{sx:x,children:Jt(sm,{tasks:b,todayStr:l,days:u,height:"100%",headerLeft:h})})}]:[],{id:"workload",tabTitle:"\uC6CC\uD06C\uB85C\uB4DC",showTitle:!1,children:Jt(Io,{sx:x,children:B==="timeline"?Pl(Io,{sx:{display:"flex",flexDirection:"column",height:"100%",minHeight:0},children:[Jt(Io,{sx:Ar,children:C}),Jt(Tm,{tasks:b,todayStr:l,height:"100%"})]}):Jt(bm,{tasks:b,todayStr:l,height:"100%",capacity:s,headerLeft:C,selectedAccountSeq:L,onSelectPerson:n?q:void 0})})},{id:"lead-time",tabTitle:"\uB9AC\uB4DC\uD0C0\uC784",showTitle:!1,children:Jt(Io,{sx:x,children:Jt(um,{tasks:b,todayStr:l,days:u,height:"100%",headerLeft:h})})}],actions:{showCancelButton:!1,right:Jt(Bm,{variant:"contained",onClick:a,children:"\uB2EB\uAE30"})}}),Jt(km,{open:L>0,row:S,rows:N,tasks:b,todayStr:l,employees:r,onClose:()=>q(0),onChangeManager:n,onOpenTask:c}),t?Jt(Kp,{open:D,capacity:s,employees:r,onClose:()=>P(!1),onSave:async y=>{await t(y),P(!1)}}):null]})}import{Checkbox as _k,Divider as kk,Menu as Sk,MenuItem as Gu}from"@mui/material";import{jsx as Ys,jsxs as Em}from"react/jsx-runtime";function G$({anchorEl:e,candidates:p,selectedNames:b,avatarSrcByName:l,onToggle:i,onClear:s,onClose:r}){return Em(Sk,{anchorEl:e,open:!!e,onClose:r,transitionDuration:0,children:[p.length===0?Ys(Gu,{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 Em(Gu,{onClick:()=>i(t),sx:{fontSize:14,minWidth:170,gap:1},children:[Ys(_k,{size:"small",checked:n,sx:{p:0}}),Ys(Lr,{names:[t.name],size:20,avatarSrcByName:l}),t.name]},`${t.accountSeq}-${t.name}`)}),Ys(kk,{}),Ys(Gu,{disabled:b.length===0,onClick:s,sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{useState as Tk}from"react";import{ButtonBase as Ck,Menu as Bk,MenuItem as Ik}from"@mui/material";import Mk from"@mui/icons-material/KeyboardArrowDown";import Ek from"@mui/icons-material/Check";import{Fragment as Rk,jsx as Yu,jsxs as Xu}from"react/jsx-runtime";function rH({value:e,onChange:p,options:b}){let[l,i]=Tk(null),s=b??dc,r=dc.find(t=>t.value===e)?.label??"";return Xu(Rk,{children:[Xu(Ck,{onClick:t=>i(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,Yu(Mk,{sx:{fontSize:17,color:"#9a9a97"}})]}),Yu(Bk,{transitionDuration:0,anchorEl:l,open:!!l,onClose:()=>i(null),children:s.map(t=>Xu(Ik,{selected:t.value===e,onClick:()=>{p(t.value),i(null)},sx:{fontSize:14,minWidth:140,justifyContent:"space-between",gap:1},children:[t.label,t.value===e?Yu(Ek,{sx:{fontSize:16,color:"#2f80ed"}}):null]},t.value))})]})}import{Box as Nl,ButtonBase as Ok}from"@mui/material";import{DateTextField as Rm}from"@ehfuse/mui-form-controls";import{jsx as Xs,jsxs as Om}from"react/jsx-runtime";var Ak=[{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 Am({fromDate:e,toDate:p,onChange:b}){let l=s=>{if(s<=0){b("","");return}b(Co(Il(s)),Co(new Date))},i=s=>s<=0?!e&&!p:!e||!p?!1:e===Co(Il(s))&&p===Co(new Date);return Om(Nl,{sx:{display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[Xs(Nl,{sx:{display:"flex",alignItems:"center",gap:1.5},children:Ak.map(s=>{let r=i(s.months);return Xs(Ok,{onClick:()=>l(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)})}),Om(Nl,{sx:{display:"flex",alignItems:"center",gap:.5},children:[Xs(Rm,{value:e,size:"small",placeholder:"\uC2DC\uC791\uC77C",onChange:s=>b(s.target.value,p),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}}),Xs(Nl,{component:"span",sx:{fontSize:13,color:"#9a9a97"},children:"~"}),Xs(Rm,{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 Dk}from"@mui/material";import{jsx as Dm}from"react/jsx-runtime";function dH({anchorEl:e,fromDate:p,toDate:b,onChange:l,onClose:i}){return Dm(Dk,{transitionDuration:0,anchorEl:e,open:!!e,onClose:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{p:1.5}}},children:Dm(Am,{fromDate:p,toDate:b,onChange:l})})}import{Box as Pk,ButtonBase as Nk,Tab as Lk,Tabs as jk}from"@mui/material";import zk from"@mui/icons-material/Checklist";import Fk from"@mui/icons-material/Face";import qk from"@mui/icons-material/Publish";import $k from"@mui/icons-material/NotificationsOutlined";import Hk from"@mui/icons-material/BugReportOutlined";import Wk from"@mui/icons-material/DescriptionOutlined";import Uk from"@mui/icons-material/Inventory2Outlined";import{jsx as On}from"react/jsx-runtime";function Pm(e,p){return p>0?`${e} (${p})`:e}var TH=[{id:"my",label:"\uC804\uCCB4",icon:On(zk,{sx:{fontSize:18}})},{id:"mine",label:"\uB0B4 \uC5C5\uBB34",icon:On(Fk,{sx:{fontSize:18}})},{id:"sent",label:"\uBCF4\uB0B8 \uC5C5\uBB34",icon:On(qk,{sx:{fontSize:18}})},{id:"bug",label:"\uC624\uB958",icon:On(Hk,{sx:{fontSize:18}})},{id:"notice",label:"\uACF5\uC9C0\uC0AC\uD56D",icon:On($k,{sx:{fontSize:18}})},{id:"archive",label:"\uBCF4\uAD00\uD568",icon:On(Uk,{sx:{fontSize:18}}),hideCount:!0},{id:"report",label:"\uBCF4\uACE0\uC11C",icon:On(Wk,{sx:{fontSize:18}}),hideCount:!0}];function Vk(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 CH({items:e,activeTab:p,counts:b,onChange:l,compact:i=!1}){let s=ct(),r=Vk(s.tabs),t=e;return i?On(Pk,{sx:{display:"flex",flexWrap:"wrap",gap:1.25},children:t.map(n=>{let c=p===n.id;return On(Nk,{onClick:()=>l(n.id),sx:{px:1.5,py:.75,borderRadius:1,fontSize:kr(13.5),fontWeight:500,whiteSpace:"nowrap",border:"1px solid",bgcolor:c?s.tabs.selectedBg:s.tabs.bg,color:c?s.tabs.selectedColor:s.tabs.color,borderColor:c?s.tabs.selectedBg:s.tabs.borderColor},children:Pm(n.label,n.hideCount?0:b[n.id]??0)},n.id)})}):On(jk,{value:p,onChange:(n,c)=>l(c),sx:{minHeight:46,"& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:"12px",minHeight:46}},children:t.map(n=>On(Lk,{value:n.id,label:Pm(n.label,n.hideCount?0:b[n.id]??0),icon:n.icon,iconPosition:"start",sx:r},n.id))})}import{useEffect as Kk,useMemo as Gk,useState as Zu}from"react";import{Divider as Ll,ListItemIcon as Kr,Menu as Ju,MenuItem as _r}from"@mui/material";import Yk from"@mui/icons-material/OpenInNewOutlined";import Xk from"@mui/icons-material/RestoreFromTrashOutlined";import Zk from"@mui/icons-material/Check";import Jk from"@mui/icons-material/CheckCircleOutlined";import Qk from"@mui/icons-material/RadioButtonUnchecked";import e8 from"@mui/icons-material/SendOutlined";import t8 from"@mui/icons-material/EventOutlined";import r8 from"@mui/icons-material/PersonOutlineOutlined";import n8 from"@mui/icons-material/ViewKanbanOutlined";import o8 from"@mui/icons-material/ContentCopyOutlined";import i8 from"@mui/icons-material/NextPlanOutlined";import s8 from"@mui/icons-material/ContentPasteOutlined";import a8 from"@mui/icons-material/ShareOutlined";import l8 from"@mui/icons-material/DirectionsRunOutlined";import Nm from"@mui/icons-material/ChevronRight";import c8 from"@mui/icons-material/ArchiveOutlined";import u8 from"@mui/icons-material/UnarchiveOutlined";import{ConfirmDialog as Lm}from"@ehfuse/alerts";import{Fragment as jm,jsx as ut,jsxs as pr}from"react/jsx-runtime";function nW({target:e,onClose:p,customTabs:b,sprints:l=[],myAccountSeq:i=0,onOpenDetail:s,onToggleCompleted:r,onRequestConfirm:t,onChangeDueDate:n,onChangeReminder:c,onMemberEdit:o,onMoveProject:a,onDuplicate:f,onCreateFollowUp:d,onShare:u,onAssignSprint:g,onArchiveToggle:m,onDelete:x,onRestore:_,onPurge:B}){let O=Nt(),j=Dn(),[D,P]=Zu(null),[L,q]=Zu(null),[N,S]=Zu(null);Kk(()=>{e||(P(null),q(null),S(null))},[e]);let C=e?.task??null,M=!!C?.is_notice,h=!!C?.is_event,y=C?!io(C,i):!1,v=!!C?.deleted,w=Gk(()=>new Set(b.filter(F=>F.useSprints).map(F=>F.key)),[b]),k=async(F="one")=>{let $=C;if(p(),!$)return;await Lm({title:"\uC5C5\uBB34 \uC0AD\uC81C",message:F==="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?`})&&x($.seq,F)},T=async()=>{let F=C;if(p(),!F)return;await Lm({title:"\uC601\uAD6C \uC0AD\uC81C",message:`"${F.title}" \uC5C5\uBB34\uB97C \uC601\uAD6C\uD788 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C? \uB418\uB3CC\uB9B4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.`})&&B?.(F.seq)},E=()=>{C&&m(C.seq,!C.archived),p()};return pr(jm,{children:[pr(Ju,{open:!!e,onClose:p,transitionDuration:0,anchorReference:O?"none":"anchorPosition",anchorPosition:!O&&e?{top:e.position.top,left:e.position.left}:void 0,slotProps:{paper:{sx:{minWidth:190,...O?{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxHeight:"70vh"}:{}}},list:O?{sx:{"& .MuiMenuItem-root":{py:1,minHeight:0}}}:void 0},children:[pr(_r,{onClick:()=>{C&&s(C),p()},sx:{fontSize:14},children:[ut(Kr,{children:ut(Yk,{sx:{fontSize:19}})}),"\uC0C1\uC138 \uC5F4\uAE30"]}),v?ut(Ll,{}):null,v&&_?pr(_r,{onClick:()=>{C&&_(C.seq),p()},sx:{fontSize:14},children:[ut(Kr,{children:ut(Xk,{sx:{fontSize:19}})}),"\uBCF5\uC6D0"]}):null,v&&B?pr(_r,{onClick:()=>{T()},sx:{fontSize:14,color:"#e5484d"},children:[ut(Kr,{children:ut(ur,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC601\uAD6C \uC0AD\uC81C"]}):null,v?null:pr(jm,{children:[pr(_r,{disabled:M?(C?.author_account_seq??0)!==i:(C?.author_account_seq??0)!==i&&(C?.manager_account_seq??0)!==i,onClick:()=>{C&&r(C.seq,!C.completed),p()},sx:{fontSize:14},children:[ut(Kr,{children:C?.completed?ut(Qk,{sx:{fontSize:19}}):ut(Jk,{sx:{fontSize:19}})}),C?.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC"]}),!M&&t?pr(_r,{disabled:!(C?.manager_account_seq??0)&&(C?.receiver_account_seqs??[]).length===0,onClick:()=>{C&&t(C),p()},sx:{fontSize:14},children:[ut(Kr,{children:ut(e8,{sx:{fontSize:19}})}),"\uD655\uC778 \uC694\uCCAD"]}):null,h?null:ut(Ll,{}),h?null:pr(_r,{disabled:y,onClick:F=>{C&&P({anchorEl:F.currentTarget,task:C})},sx:{fontSize:14},children:[ut(Kr,{children:ut(t8,{sx:{fontSize:19}})}),"\uB9C8\uAC10\uC77C\uC2DC \uBCC0\uACBD"]}),!M&&!h&&o?pr(_r,{onClick:()=>{C&&o(C,"manager"),p()},sx:{fontSize:14},children:[ut(Kr,{children:ut(r8,{sx:{fontSize:19}})}),"\uCC45\uC784\uC790 \uBCC0\uACBD"]}):null,h?null:pr(_r,{disabled:y,onClick:F=>{C&&q({anchorEl:F.currentTarget,task:C})},sx:{fontSize:14},children:[ut(Kr,{children:ut(n8,{sx:{fontSize:19}})}),"\uD504\uB85C\uC81D\uD2B8 \uC774\uB3D9",ut(Nm,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}),ut(Ll,{}),f?pr(_r,{disabled:y,onClick:()=>{C&&f(C.seq),p()},sx:{fontSize:14},children:[ut(Kr,{children:ut(o8,{sx:{fontSize:19}})}),"\uBCF5\uC81C"]}):null,d&&C&&!C.is_event&&!C.is_notice?pr(_r,{onClick:()=>{C&&d(C.seq),p()},sx:{fontSize:14},children:[ut(Kr,{children:ut(i8,{sx:{fontSize:19}})}),"\uD6C4\uC18D \uC5C5\uBB34 \uB9CC\uB4E4\uAE30"]}):null,pr(_r,{onClick:()=>{C&&(u?u(C):Yi(C,O)),p()},sx:{fontSize:14},children:[ut(Kr,{children:O?ut(a8,{sx:{fontSize:19}}):ut(s8,{sx:{fontSize:19}})}),O?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC"]}),C&&!C.is_notice&&!C.is_event&&w.has(String(C.tab_key??""))&&g?pr(_r,{onClick:F=>S(F.currentTarget),sx:{fontSize:14},children:[ut(Kr,{children:ut(l8,{sx:{fontSize:19}})}),"\uBAA9\uD45C\uC5D0 \uB123\uAE30",ut(Nm,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}):null,pr(_r,{onClick:E,disabled:y||!C?.archived&&!(C&&va(C)),sx:{fontSize:14},children:[ut(Kr,{children:C?.archived?ut(u8,{sx:{fontSize:19}}):ut(c8,{sx:{fontSize:19}})}),C?.archived?"\uBCF4\uAD00 \uD574\uC81C":"\uBCF4\uAD00"]}),ut(Ll,{}),pr(_r,{disabled:y,onClick:()=>{k("one")},sx:{fontSize:14,color:"#e5484d"},children:[ut(Kr,{children:ut(ur,{sx:{fontSize:19,color:"#e5484d"}})}),(C?.repeat_group_key??0)>0?"\uC0AD\uC81C (\uC774 \uD68C\uCC28\uB9CC)":"\uC0AD\uC81C"]}),(C?.repeat_group_key??0)>0?pr(_r,{disabled:y,onClick:()=>{k("series")},sx:{fontSize:14,color:"#e5484d"},children:[ut(Kr,{children:ut(ur,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC0AD\uC81C (\uC774\uD6C4 \uBC18\uBCF5 \uC804\uCCB4)"]}):null]})]}),ut(dn,{anchorEl:D?.anchorEl??null,open:!!D,date:D?.task.due_date??"",reminder:D?.task.reminder??"none",hideReminder:!!D?.task.completed,centered:O,onClose:()=>{P(null),p()},onDateChange:F=>{D&&n(D.task.seq,F)},onReminderChange:F=>{D&&c?.(D.task.seq,F)}}),pr(Ju,{transitionDuration:0,anchorEl:L?.anchorEl??null,open:!!L,onClose:()=>{q(null),p()},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...j,children:[ut(_r,{selected:!L?.task.tab_key,onClick:()=>{L&&a(L.task.seq,""),q(null),p()},sx:{fontSize:14,minWidth:170},children:"\uC5C6\uC74C"}),b.filter(F=>!F.archived).map(F=>ut(_r,{selected:L?.task.tab_key===F.key,onClick:()=>{L&&a(L.task.seq,F.key),q(null),p()},sx:{fontSize:14,minWidth:170},children:F.label},F.key))]}),ut(Ju,{transitionDuration:0,anchorEl:N,open:!!N,onClose:()=>S(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...l.filter(F=>`custom-${F.group_seq}`===String(C?.tab_key??"")).map(F=>({seq:F.seq,label:hn(F)}))].map(F=>pr(_r,{onClick:()=>{C&&g?.(C.seq,F.seq),S(null),p()},sx:{fontSize:14,minWidth:160,gap:1},children:[F.label,(C?.sprint_seq??0)===F.seq?ut(Zk,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},F.seq))})]})}import{Checkbox as f8,Divider as d8,Menu as h8,MenuItem as zm}from"@mui/material";import{jsx as jl,jsxs as Fm}from"react/jsx-runtime";function lW({anchorEl:e,labelOptions:p,selectedKeys:b,onToggle:l,onClear:i,onClose:s}){return Fm(h8,{transitionDuration:0,anchorEl:e,open:!!e,onClose:s,children:[p.map(r=>{let t=b.includes(r.key);return Fm(zm,{onClick:()=>l(r.key),sx:{fontSize:14,minWidth:190,gap:1},children:[jl(f8,{size:"small",checked:t,sx:{p:0}}),jl(Ot,{option:r})]},r.key)}),jl(d8,{}),jl(zm,{disabled:b.length===0,onClick:()=>{i(),s()},sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{Divider as p8,Menu as m8,MenuItem as qm}from"@mui/material";import g8 from"@mui/icons-material/Check";import b8 from"@mui/icons-material/SettingsOutlined";import{jsx as Qu,jsxs as ef}from"react/jsx-runtime";function mW(e){let{anchorEl:p,sprints:b,value:l,onSelect:i,onManage:s,onClose:r}=e;return ef(m8,{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:hn(t)}))].map(t=>ef(qm,{onClick:()=>{i(t.seq),r()},sx:{fontSize:14,minWidth:180,gap:1},children:[t.label,l===t.seq?Qu(g8,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},t.seq)),Qu(p8,{}),ef(qm,{onClick:()=>{r(),s()},sx:{fontSize:14,gap:1},children:[Qu(b8,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uAD00\uB9AC\u2026"]})]})}var y8={my:"tasks",mine:"tasks",sent:"tasks",notice:"notice",bug:"bug",archive:"archive",done:"done",report:"report"};function x8(e){return y8[e]??"tasks"}var Hm={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"},$m=["list","calendar","month","card","kanban","sprint","timeline"],v8=["list","card"];function yW(e){let p=x8(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:$m,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:v8,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:$m,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 w8}from"react";import{useKeyboardState as _8}from"@ehfuse/keyboard-state";var Wm=[{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 kW(e,p={}){let{enabled:b=!0,views:l}=p,{onCreateTask:i,onFocusSearch:s,onToggleHelp:r,onChangeView:t,onRefresh:n,onEscape:c}=e,o=l?l.join(","):"",a=w8(()=>{let f=[];if(i&&f.push({key:"n",callback:i,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}}),c&&f.push({key:"escape",callback:c,options:{allowInEditable:!0}}),t)for(let d of Um(o?o.split(","):void 0))f.push({key:d.key,callback:()=>t(d.view),options:{preventDefault:!0}});return f},[i,s,r,t,n,c,o]);_8(b?a:[])}function Um(e){if(!e)return Wm;let p=new Set(e);return Wm.filter(b=>p.has(b.view))}function tf(e){return[{keys:"N",description:"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D"},{keys:"/",description:"\uAC80\uC0C9"},{keys:"R",description:"\uBAA9\uB85D \uC0C8\uB85C\uACE0\uCE68"},...Um(e).map(p=>({keys:p.key.split(" ").map(b=>b.toUpperCase()).join(" \u2192 "),description:`${Hm[p.view]} \uBCF4\uAE30`})),{keys:"?",description:"\uB2E8\uCD95\uD0A4 \uB3C4\uC6C0\uB9D0"},{keys:"Esc",description:"\uB2EB\uAE30"}]}var SW=tf();import{Box as Zs,Button as k8}from"@mui/material";import S8 from"@mui/icons-material/ArrowRightAlt";import{FormDialog as T8}from"@ehfuse/mui-form-dialog";import{jsx as Zo,jsxs as Vm}from"react/jsx-runtime";function C8({keys:e}){return Zo(Zs,{sx:{display:"flex",alignItems:"center",gap:.5,justifyContent:"flex-end"},children:e.split(" \u2192 ").map((p,b)=>Vm(Zs,{sx:{display:"flex",alignItems:"center",gap:.5},children:[b>0?Zo(S8,{sx:{fontSize:18,color:"#9a9a97"}}):null,Zo(Zs,{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 EW({open:e,onClose:p,views:b}){let l=tf(b);return Zo(T8,{open:e,onClose:p,maxWidth:"xs",title:"\uB2E8\uCD95\uD0A4",locale:"ko",titleIcons:{delete:{visible:!1}},tabs:{visible:!1},sectionContentPaddingTop:0,sections:[{id:"shortcuts",showTitle:!1,children:Zo(Zs,{sx:{display:"grid",gridTemplateColumns:"auto 1fr",columnGap:2,rowGap:1.25,alignItems:"center",fontSize:14,color:"#37352f"},children:l.map(i=>Vm(Zs,{sx:{display:"contents"},children:[Zo(C8,{keys:i.keys}),Zo("span",{children:i.description})]},i.keys))})}],actions:{showCancelButton:!1,right:Zo(k8,{variant:"contained",onClick:p,children:"\uB2EB\uAE30"})}})}import{useEffect as Km,useRef as B8,useState as os}from"react";import{Box as rr,Button as An,IconButton as rf,Menu as Gm,MenuItem as Ym,Switch as I8,Tooltip as Xm}from"@mui/material";import{FormDialog as Zm}from"@ehfuse/mui-form-dialog";import nf from"@mui/icons-material/Add";import M8 from"@mui/icons-material/ArrowRightAlt";import E8 from"@mui/icons-material/BoltOutlined";import R8 from"@mui/icons-material/Close";import O8 from"@mui/icons-material/EditOutlined";import{ErrorAlert as Jm}from"@ehfuse/alerts";import{ClearTextField as Js,LabelSelect as an}from"@ehfuse/mui-form-controls";import{Fragment as e0,jsx as Ke,jsxs as yn}from"react/jsx-runtime";var of=[{value:"created",label:"\uC5C5\uBB34 \uB4F1\uB85D \uC2DC",hint:"\uC0C8 \uC5C5\uBB34\uAC00 \uB9CC\uB4E4\uC5B4\uC9C4 \uC9C1\uD6C4 \uD55C \uBC88 \uC2E4\uD589\uD569\uB2C8\uB2E4."},{value:"status_changed",label:"\uC0C1\uD0DC \uBCC0\uACBD \uC2DC",hint:"\uC0C1\uD0DC\uAC00 \uC2E4\uC81C\uB85C \uBC14\uB010 \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4."},{value:"commented",label:"\uB313\uAE00\uC774 \uB2EC\uB838\uC744 \uB54C",hint:"\uB313\uAE00\uC774 \uC0C8\uB85C \uB2EC\uB9AC\uAC70\uB098 \uC218\uC815\uB41C \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4(\uD68C\uC2E0\uC744 \uBC1B\uC740 \uC790\uB9AC)."},{value:"manager_assigned",label:"\uCC45\uC784\uC790\uAC00 \uC9C0\uC815\uB410\uC744 \uB54C",hint:"\uCC45\uC784\uC790\uAC00 \uC0C8\uB85C \uC9C0\uC815\uB418\uAC70\uB098 \uBC14\uB010 \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4."},{value:"attachment_added",label:"\uCCA8\uBD80\uAC00 \uC62C\uB77C\uC654\uC744 \uB54C",hint:"\uC5C5\uBB34\uC5D0 \uD30C\uC77C\uC774 \uCCA8\uBD80\uB41C \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4(\uC99D\uBE59 \uC811\uC218 \uC790\uB9AC)."},{value:"field_changed",label:"\uD544\uB4DC\uAC00 \uBC14\uB00C\uC5C8\uC744 \uB54C",hint:"\uC9C0\uC815\uD55C \uD544\uB4DC\uAC00 \uC2E4\uC81C\uB85C \uBC14\uB010 \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4(\uD544\uB4DC\uB97C \uC548 \uACE0\uB974\uBA74 \uC544\uBB34 \uC218\uC815\uC5D0\uB098 \uC2E4\uD589)."},{value:"overdue",label:"\uB9C8\uAC10 \uACBD\uACFC \uC2DC",hint:"\uB9C8\uAC10\uC774 \uC9C0\uB09C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uB97C \uB9E4\uC77C \uC810\uAC80\uD574 \uC2E4\uD589\uD569\uB2C8\uB2E4."}],Qs=[{value:"due_date",label:"\uB9C8\uAC10\uC77C\uC2DC"},{value:"start_date",label:"\uC2DC\uC791\uC77C\uC2DC"},{value:"priority",label:"\uC911\uC694\uB3C4"},{value:"manager_account_seq",label:"\uCC45\uC784\uC790"},{value:"receiver_account_seqs",label:"\uCC38\uC870\uC790"},{value:"label_keys",label:"\uB77C\uBCA8"},{value:"group_seq",label:"\uD504\uB85C\uC81D\uD2B8"},{value:"sprint_seq",label:"\uBAA9\uD45C"},{value:"content",label:"\uB0B4\uC6A9"},{value:"note",label:"\uBE44\uACE0"}],ql=[{value:"high",label:"\uB192\uC74C"},{value:"medium",label:"\uC911\uAC04"},{value:"low",label:"\uB0AE\uC74C"}];function zl(){return{name:"",trigger:"created",enabled:!0,sort_no:0,condition:{},action:{}}}function Fl(e){return tn.find(p=>p.key===e)?.name??e}function A8(e,p,b){let{condition:l,action:i}=e,s=[];if(l.group_seq){let n=p.find(c=>Vo(c.key)===l.group_seq);s.push(`\uD504\uB85C\uC81D\uD2B8=${n?.label??`#${l.group_seq}`}`)}l.is_bug===!0&&s.push("\uC624\uB958\uB9CC"),l.is_event===!0&&s.push("\uC77C\uC815\uB9CC"),l.priority&&s.push(`\uC911\uC694\uB3C4=${ql.find(n=>n.value===l.priority)?.label}`),l.label_key&&s.push(`\uB77C\uBCA8=${b.find(n=>n.key===l.label_key)?.name??l.label_key}`),l.title_contains&&s.push(`\uC81C\uBAA9\uC5D0 "${l.title_contains}" \uD3EC\uD568`),l.status&&s.push(`\uC0C1\uD0DC=${Fl(l.status)}`),l.from_status&&s.push(`${Fl(l.from_status)}\uC5D0\uC11C`),l.to_status&&s.push(`${Fl(l.to_status)}\uB85C`),l.manager_empty===!0&&s.push("\uCC45\uC784\uC790 \uC5C6\uC74C"),l.manager_empty===!1&&s.push("\uCC45\uC784\uC790 \uC788\uC74C"),l.manager_account_seq&&s.push(`\uCC45\uC784\uC790=${l.manager_name||`\uACC4\uC815 #${l.manager_account_seq}`}`),l.receiver_account_seq&&s.push(`\uCC38\uC870\uC790\uC5D0 ${l.receiver_name||`\uACC4\uC815 #${l.receiver_account_seq}`}`),l.changed_field&&s.push(`${Qs.find(n=>n.value===l.changed_field)?.label??l.changed_field} \uBCC0\uACBD`),l.comment_contains&&s.push(`\uB313\uAE00\uC5D0 "${l.comment_contains}" \uD3EC\uD568`),l.comment_by_others===!0&&s.push("\uB0A8\uC774 \uC4F4 \uB313\uAE00"),typeof l.overdue_days=="number"&&s.push(`${l.overdue_days}\uC77C \uACBD\uACFC`);let r=[];i.set_status&&r.push(`\uC0C1\uD0DC=${Fl(i.set_status)}`),i.set_priority&&r.push(`\uC911\uC694\uB3C4=${ql.find(n=>n.value===i.set_priority)?.label}`),i.assign_manager_account_seq&&r.push(`\uCC45\uC784\uC790=${i.assign_manager_name||"\uC9C0\uC815"}`),i.add_receiver_account_seq&&r.push(`\uCC38\uC870\uC790 + ${i.add_receiver_name||"\uC9C0\uC815"}`),i.add_label_key&&r.push(`\uB77C\uBCA8 + ${b.find(n=>n.key===i.add_label_key)?.name??i.add_label_key}`),i.apply_content_template_seq&&r.push(`\uBCF8\uBB38 \uC591\uC2DD=${i.apply_content_template_name||"\uC9C0\uC815"}`),i.notify_account_seq&&r.push("\uC54C\uB9BC \uBC1C\uC1A1");let t=of.find(n=>n.value===e.trigger)?.label??e.trigger;return{left:s.length>0?`${t} \xB7 ${s.join(", ")}`:t,right:r.join(", ")||"\uB3D9\uC791 \uC5C6\uC74C"}}var Qm={fontSize:16,fontWeight:700,color:"#37352f"},D8={display:"flex",alignItems:"center",gap:1},P8={width:104,flexShrink:0,fontSize:16,color:"#37352f"};function VW({open:e,rules:p,customTabs:b,statusOptions:l,contentTemplates:i=[],onPickAccount:s,onClose:r,onCreate:t,onUpdate:n,onToggle:c,onRemove:o}){let[a,f]=os(!1),[d,u]=os(0),[g,m]=os(zl()),[x,_]=os(!1),B=B8(null),[O,j]=os(null),[D,P]=os(null);Km(()=>{if(e)return;let H=window.setTimeout(()=>{f(!1),u(0),m(zl())},500);return()=>window.clearTimeout(H)},[e]),Km(()=>{if(!a)return;let H=window.setTimeout(()=>B.current?.focus(),120);return()=>window.clearTimeout(H)},[a]);let L=d>0,q=g.trigger,N=()=>{f(!1),u(0),m(zl())},S=(H,Z)=>{m(J=>{let G={...J.condition};return Z===""||Z===void 0||Z===null?delete G[H]:G[H]=Z,{...J,condition:G}})},C=(H,Z)=>{m(J=>{let G={...J.action};return Z===""||Z===void 0||Z===null?delete G[H]:G[H]=Z,{...J,action:G}})},M=H=>{m(Z=>{let J={...Z.condition};return H!=="status_changed"&&(delete J.from_status,delete J.to_status),H!=="overdue"&&delete J.overdue_days,H!=="field_changed"&&delete J.changed_field,H!=="commented"&&(delete J.comment_contains,delete J.comment_by_others),H==="field_changed"&&J.changed_field===void 0&&(J.changed_field=Qs[0]?.value??""),{...Z,trigger:H,condition:J}})},h=b.filter(H=>!H.archived),y=l.map(H=>({value:H.key,label:H.name})),v=tn.map(H=>({value:H.key,label:H.name})),w=h.map(H=>({value:String(Vo(H.key)),label:H.label})),{condition:k,action:T}=g,E=k.is_bug!==void 0||k.is_event!==void 0,F=[...k.group_seq===void 0&&w.length>0?[{key:"group_seq",label:"\uD504\uB85C\uC81D\uD2B8\uAC00 ~\uC778 \uACBD\uC6B0"}]:[],...E?[]:[{key:"kind",label:"\uC885\uB958\uAC00 \uC624\uB958/\uC77C\uC815\uC778 \uACBD\uC6B0"}],...k.priority===void 0?[{key:"priority",label:"\uC911\uC694\uB3C4\uAC00 ~\uC778 \uACBD\uC6B0"}]:[],...k.label_key===void 0&&y.length>0?[{key:"label_key",label:"\uB77C\uBCA8\uC774 \uBD99\uC5B4 \uC788\uB294 \uACBD\uC6B0"}]:[],...k.title_contains===void 0?[{key:"title_contains",label:"\uC81C\uBAA9\uC5D0 ~ \uB2E8\uC5B4\uAC00 \uD3EC\uD568\uB41C \uACBD\uC6B0"}]:[],...k.manager_empty===void 0?[{key:"manager_empty",label:"\uCC45\uC784\uC790\uAC00 \uC5C6\uB294/\uC788\uB294 \uACBD\uC6B0"}]:[],...s&&k.manager_account_seq===void 0?[{key:"manager_account",label:"\uCC45\uC784\uC790\uAC00 ~\uC778 \uACBD\uC6B0"}]:[],...s&&k.receiver_account_seq===void 0?[{key:"receiver_account",label:"\uCC38\uC870\uC790\uC5D0 ~\uAC00 \uD3EC\uD568\uB41C \uACBD\uC6B0"}]:[],...q==="status_changed"&&k.from_status===void 0?[{key:"from_status",label:"\uC774 \uC0C1\uD0DC\uC5D0\uC11C \uBC14\uB010 \uACBD\uC6B0"}]:[],...q==="status_changed"&&k.to_status===void 0?[{key:"to_status",label:"\uC774 \uC0C1\uD0DC\uB85C \uBC14\uB010 \uACBD\uC6B0"}]:[],...q==="field_changed"&&k.changed_field===void 0?[{key:"changed_field",label:"~ \uD544\uB4DC\uAC00 \uBCC0\uACBD\uB41C \uACBD\uC6B0"}]:[],...q==="commented"&&k.comment_contains===void 0?[{key:"comment_contains",label:"\uB313\uAE00\uC5D0 ~ \uB2E8\uC5B4\uAC00 \uD3EC\uD568\uB41C \uACBD\uC6B0"}]:[],...q==="commented"&&k.comment_by_others===void 0?[{key:"comment_by_others",label:"\uCC45\uC784\uC790\uAC00 \uC544\uB2CC \uC0AC\uB78C\uC774 \uC4F4 \uACBD\uC6B0"}]:[],...q==="overdue"&&k.overdue_days===void 0?[{key:"overdue_days",label:"\uB9C8\uAC10 \uD6C4 \uBA70\uCE60 \uC9C0\uB09C \uACBD\uC6B0"}]:[]],$=async H=>{if(!s)return;let Z=H==="manager_account"?k.manager_account_seq??0:k.receiver_account_seq??0,J=await s(Z);J&&m(G=>{let X={...G.condition};return H==="manager_account"?(X.manager_account_seq=J.accountSeq,X.manager_name=J.name):(X.receiver_account_seq=J.accountSeq,X.receiver_name=J.name),{...G,condition:X}})},U=H=>{j(null),H==="group_seq"?S("group_seq",Number(w[0]?.value)||0):H==="kind"?S("is_bug",!0):H==="priority"?S("priority","high"):H==="label_key"?S("label_key",y[0]?.value??""):H==="title_contains"?m(Z=>({...Z,condition:{...Z.condition,title_contains:""}})):H==="manager_empty"?S("manager_empty",!0):H==="manager_account"||H==="receiver_account"?$(H):H==="from_status"?S("from_status",tn[0]?.key??""):H==="to_status"?S("to_status",tn[0]?.key??""):H==="changed_field"?S("changed_field",Qs[0]?.value??""):H==="comment_contains"?m(Z=>({...Z,condition:{...Z.condition,comment_contains:""}})):H==="comment_by_others"?S("comment_by_others",!0):H==="overdue_days"&&S("overdue_days",1)},A=H=>{if(H==="kind"){S("is_bug",""),S("is_event","");return}if(H==="manager_account"){S("manager_account_seq",""),S("manager_name","");return}if(H==="receiver_account"){S("receiver_account_seq",""),S("receiver_name","");return}S(H==="group_seq"?"group_seq":H,"")},W=[...T.set_status===void 0?[{key:"set_status",label:"\uC0C1\uD0DC \uBC14\uAFB8\uAE30"}]:[],...T.set_priority===void 0?[{key:"set_priority",label:"\uC911\uC694\uB3C4 \uBC14\uAFB8\uAE30"}]:[],...T.add_label_key===void 0&&y.length>0?[{key:"add_label_key",label:"\uB77C\uBCA8 \uBD99\uC774\uAE30"}]:[],...s&&T.assign_manager_account_seq===void 0?[{key:"assign_manager",label:"\uCC45\uC784\uC790 \uC9C0\uC815\uD558\uAE30"}]:[],...s&&T.add_receiver_account_seq===void 0?[{key:"add_receiver",label:"\uCC38\uC870\uC790 \uCD94\uAC00\uD558\uAE30"}]:[],...i.length>0&&T.apply_content_template_seq===void 0?[{key:"apply_content_template",label:"\uBCF8\uBB38 \uC591\uC2DD \uCC44\uC6B0\uAE30"}]:[],...s&&T.notify_account_seq===void 0?[{key:"notify",label:"\uC54C\uB9BC \uBCF4\uB0B4\uAE30"}]:[]],R=async H=>{if(!s)return;let Z=H==="assign_manager"?T.assign_manager_account_seq??0:H==="add_receiver"?T.add_receiver_account_seq??0:T.notify_account_seq??0,J=await s(Z);J&&m(G=>{let X={...G.action};return H==="assign_manager"?(X.assign_manager_account_seq=J.accountSeq,X.assign_manager_name=J.name):H==="add_receiver"?(X.add_receiver_account_seq=J.accountSeq,X.add_receiver_name=J.name):(X.notify_account_seq=J.accountSeq,X.notify_name=J.name),{...G,action:X}})},I=H=>{if(P(null),H==="set_status")C("set_status",tn[0]?.key??"");else if(H==="set_priority")C("set_priority","high");else if(H==="add_label_key")C("add_label_key",y[0]?.value??"");else if(H==="apply_content_template"){let Z=i[0];m(J=>({...J,action:{...J.action,apply_content_template_seq:Z?.seq??0,apply_content_template_name:Z?.name??""}}))}else R(H)},z=H=>{H==="assign_manager"?(C("assign_manager_account_seq",""),C("assign_manager_name","")):H==="add_receiver"?(C("add_receiver_account_seq",""),C("add_receiver_name","")):H==="apply_content_template"?(C("apply_content_template_seq",""),C("apply_content_template_name","")):H==="notify"?(C("notify_account_seq",""),C("notify_name",""),C("notify_message","")):C(H,"")},V=async()=>{if(!g.name.trim()){Jm({message:"\uADDC\uCE59 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694."});return}if(Object.keys(g.action).length===0){Jm({message:"\uB3D9\uC791\uC744 \uD558\uB098 \uC774\uC0C1 \uCD94\uAC00\uD558\uC138\uC694."});return}let H=L?g.sort_no:p.reduce((J,G)=>Math.max(J,G.sort_no),0)+1;_(!0);let Z=L?await n(d,{...g,sort_no:H}):await t({...g,sort_no:H});_(!1),Z&&N()},Y=(H,Z,J,G)=>yn(rr,{sx:D8,children:[Ke(rr,{sx:P8,children:H}),yn(rr,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:G?"column":"row",alignItems:G?"stretch":"center",gap:G?.5:1},children:[Z,G?Ke(rr,{sx:{fontSize:13.5,color:"#37352f"},children:G}):null]}),Ke(Xm,{title:"\uC774 \uC904 \uBE7C\uAE30",arrow:!0,disableInteractive:!0,children:Ke(rf,{size:"small","aria-label":`${H} \uC904 \uBE7C\uAE30`,onClick:J,children:Ke(R8,{sx:{fontSize:16}})})})]}),K=()=>yn(rr,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[Ke(Js,{size:"medium",label:"\uADDC\uCE59 \uC774\uB984",inputRef:B,placeholder:"\uC608: \uC811\uC218 \uC624\uB958 \uC790\uB3D9 \uBC30\uC815",value:g.name,onChange:H=>m(Z=>({...Z,name:H.target.value}))}),Ke(rr,{sx:{display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"},children:of.map(H=>{let Z=q===H.value;return Ke(An,{disableElevation:!0,variant:Z?"contained":"outlined",color:Z?"primary":"inherit",onClick:()=>M(H.value),sx:{borderRadius:99,px:1.75,...Z?{}:{color:"#57564f",borderColor:"#d9d9d6"}},children:H.label},H.value)})}),Ke(rr,{sx:{fontSize:13,color:"#787774",mt:-.5},children:of.find(H=>H.value===q)?.hint}),yn(rr,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[Ke(rr,{sx:Qm,children:"\uC5B4\uB5A4 \uC5C5\uBB34\uC77C \uB54C"}),F.length>0?Ke(An,{size:"small",startIcon:Ke(nf,{sx:{fontSize:16}}),onClick:H=>j(H.currentTarget),sx:{color:"#2563eb",minWidth:0},children:"\uC870\uAC74 \uCD94\uAC00"}):null]}),k.group_seq!==void 0?Y("\uD504\uB85C\uC81D\uD2B8",Ke(an,{size:"medium",fullWidth:!0,label:"",value:String(k.group_seq),options:w,onChange:H=>S("group_seq",Number(H.target.value)||"")}),()=>A("group_seq")):null,E?Y("\uC885\uB958",Ke(an,{size:"medium",fullWidth:!0,label:"",value:k.is_bug?"bug":"event",options:[{value:"bug",label:"\uC624\uB958\uB9CC"},{value:"event",label:"\uC77C\uC815\uB9CC"}],onChange:H=>{let Z=H.target.value==="bug";S("is_bug",Z?!0:""),S("is_event",Z?"":!0)}}),()=>A("kind")):null,k.priority!==void 0?Y("\uC911\uC694\uB3C4",Ke(an,{size:"medium",fullWidth:!0,label:"",value:k.priority,options:ql,onChange:H=>S("priority",H.target.value)}),()=>A("priority")):null,k.label_key!==void 0?Y("\uB77C\uBCA8",Ke(an,{size:"medium",fullWidth:!0,label:"",value:k.label_key,options:y,onChange:H=>S("label_key",H.target.value)}),()=>A("label_key")):null,k.title_contains!==void 0?Y("\uC81C\uBAA9",Ke(Js,{size:"medium",fullWidth:!0,placeholder:"\uD3EC\uD568\uD560 \uB0B1\uB9D0 (\uC608: \uAE34\uAE09)",value:k.title_contains,onChange:H=>m(Z=>({...Z,condition:{...Z.condition,title_contains:H.target.value}}))}),()=>A("title_contains")):null,k.manager_empty!==void 0?Y("\uCC45\uC784\uC790",Ke(an,{size:"medium",fullWidth:!0,label:"",value:k.manager_empty?"empty":"assigned",options:[{value:"empty",label:"\uC5C6\uC74C"},{value:"assigned",label:"\uC788\uC74C"}],onChange:H=>S("manager_empty",H.target.value==="empty")}),()=>A("manager_empty")):null,k.manager_account_seq!==void 0?Y("\uCC45\uC784\uC790",Ke(An,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{$("manager_account")},children:k.manager_name||`\uACC4\uC815 #${k.manager_account_seq}`}),()=>A("manager_account")):null,k.receiver_account_seq!==void 0?Y("\uCC38\uC870\uC790",Ke(An,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{$("receiver_account")},children:k.receiver_name||`\uACC4\uC815 #${k.receiver_account_seq}`}),()=>A("receiver_account")):null,k.from_status!==void 0?Y("\uC774 \uC0C1\uD0DC\uC5D0\uC11C",Ke(an,{size:"medium",fullWidth:!0,label:"",value:k.from_status,options:v,onChange:H=>S("from_status",H.target.value)}),()=>A("from_status")):null,k.to_status!==void 0?Y("\uC774 \uC0C1\uD0DC\uB85C",Ke(an,{size:"medium",fullWidth:!0,label:"",value:k.to_status,options:v,onChange:H=>S("to_status",H.target.value)}),()=>A("to_status")):null,k.changed_field!==void 0?Y("\uBCC0\uACBD \uD544\uB4DC",Ke(an,{size:"medium",fullWidth:!0,label:"",value:k.changed_field,options:Qs,onChange:H=>S("changed_field",H.target.value)}),()=>A("changed_field")):null,k.comment_contains!==void 0?Y("\uB313\uAE00 \uB0B1\uB9D0",Ke(Js,{size:"medium",fullWidth:!0,placeholder:"\uD3EC\uD568\uD560 \uB0B1\uB9D0 (\uC608: \uD68C\uC2E0)",value:k.comment_contains,onChange:H=>m(Z=>({...Z,condition:{...Z.condition,comment_contains:H.target.value}}))}),()=>A("comment_contains")):null,k.comment_by_others!==void 0?Y("\uB313\uAE00 \uC791\uC131\uC790",Ke(an,{size:"medium",fullWidth:!0,label:"",value:k.comment_by_others?"others":"any",options:[{value:"others",label:"\uCC45\uC784\uC790\uAC00 \uC544\uB2CC \uC0AC\uB78C"},{value:"any",label:"\uB204\uAD6C\uB4E0"}],onChange:H=>S("comment_by_others",H.target.value==="others")}),()=>A("comment_by_others")):null,k.overdue_days!==void 0?Y("\uACBD\uACFC\uC77C",Ke(Js,{size:"medium",fullWidth:!0,type:"number",value:String(k.overdue_days),onChange:H=>S("overdue_days",Math.max(0,Number(H.target.value)||0)),helperText:"\uB9C8\uAC10 \uD6C4 \uBA70\uCE60 \uC9C0\uB0AC\uC744 \uB54C\uBD80\uD130 \uC2E4\uD589\uD560\uC9C0"}),()=>A("overdue_days")):null,Object.keys(k).length===0?Ke(rr,{sx:{fontSize:13.5,color:"#9a9a97"},children:"\uC870\uAC74\uC774 \uC5C6\uC73C\uBA74 \uBAA8\uB4E0 \uC5C5\uBB34\uC5D0 \uC2E4\uD589\uB429\uB2C8\uB2E4."}):null,yn(rr,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[Ke(rr,{sx:Qm,children:"\uBB34\uC5C7\uC744 \uD560\uAE4C\uC694"}),W.length>0?Ke(An,{size:"small",startIcon:Ke(nf,{sx:{fontSize:16}}),onClick:H=>P(H.currentTarget),sx:{color:"#2563eb",minWidth:0},children:"\uB3D9\uC791 \uCD94\uAC00"}):null]}),T.set_status!==void 0?Y("\uC0C1\uD0DC",Ke(an,{size:"medium",fullWidth:!0,label:"",value:T.set_status,options:v,onChange:H=>C("set_status",H.target.value)}),()=>z("set_status")):null,T.set_priority!==void 0?Y("\uC911\uC694\uB3C4",Ke(an,{size:"medium",fullWidth:!0,label:"",value:T.set_priority,options:ql,onChange:H=>C("set_priority",H.target.value)}),()=>z("set_priority")):null,T.apply_content_template_seq!==void 0?Y("\uBCF8\uBB38 \uC591\uC2DD",Ke(an,{size:"medium",fullWidth:!0,label:"",value:String(T.apply_content_template_seq),options:i.map(H=>({value:String(H.seq),label:H.name})),onChange:H=>{let Z=i.find(J=>String(J.seq)===String(H.target.value));m(J=>({...J,action:{...J.action,apply_content_template_seq:Z?.seq??0,apply_content_template_name:Z?.name??""}}))}}),()=>z("apply_content_template"),"\uBCF8\uBB38\uC774 \uBE44\uC5B4 \uC788\uC744 \uB54C\uB9CC \uCC44\uC6C1\uB2C8\uB2E4(\uC4F4 \uB0B4\uC6A9\uC744 \uB36E\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4)"):null,T.add_label_key!==void 0?Y("\uB77C\uBCA8",Ke(an,{size:"medium",fullWidth:!0,label:"",value:T.add_label_key,options:y,onChange:H=>C("add_label_key",H.target.value)}),()=>z("add_label_key")):null,T.assign_manager_account_seq!==void 0?Y("\uCC45\uC784\uC790",Ke(An,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{R("assign_manager")},children:T.assign_manager_name||`\uACC4\uC815 #${T.assign_manager_account_seq}`}),()=>z("assign_manager")):null,T.add_receiver_account_seq!==void 0?Y("\uCC38\uC870\uC790",Ke(An,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{R("add_receiver")},children:T.add_receiver_name||`\uACC4\uC815 #${T.add_receiver_account_seq}`}),()=>z("add_receiver")):null,T.notify_account_seq!==void 0?Y("\uC54C\uB9BC",yn(e0,{children:[Ke(An,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{R("notify")},sx:{flexShrink:0},children:T.notify_name||`\uACC4\uC815 #${T.notify_account_seq}`}),Ke(Js,{size:"medium",fullWidth:!0,placeholder:"\uC54C\uB9BC \uBB38\uAD6C(\uBE44\uC6B0\uBA74 \uAE30\uBCF8 \uBB38\uAD6C)",value:T.notify_message??"",onChange:H=>C("notify_message",H.target.value)})]}),()=>z("notify")):null,Object.keys(T).length===0?Ke(rr,{sx:{fontSize:13.5,color:"#9a9a97"},children:'"+ \uB3D9\uC791 \uCD94\uAC00" \uB85C \uD560 \uC77C\uC744 \uD558\uB098 \uC774\uC0C1 \uACE8\uB77C \uC8FC\uC138\uC694.'}):null,Ke(Gm,{transitionDuration:0,anchorEl:O,open:!!O,onClose:()=>j(null),children:F.map(H=>Ke(Ym,{dense:!0,onClick:()=>U(H.key),sx:{fontSize:14},children:H.label},H.key))}),Ke(Gm,{transitionDuration:0,anchorEl:D,open:!!D,onClose:()=>P(null),children:W.map(H=>Ke(Ym,{dense:!0,onClick:()=>I(H.key),sx:{fontSize:14},children:H.label},H.key))})]});return yn(e0,{children:[Ke(Zm,{open:e,onClose:r,maxWidth:"sm",title:"\uC790\uB3D9\uD654 \uADDC\uCE59",locale:"ko",titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-rule-manage",tabs:{visible:!1},contentPaddingX:0,contentTopPadding:0,contentBottomPadding:0,sectionContentPaddingTop:0,sections:[{id:"rules",title:"",showTitle:!1,children:yn(rr,{sx:{display:"flex",flexDirection:"column",px:2.5,py:2},children:[p.length===0?yn(rr,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[Ke(E8,{sx:{fontSize:48,color:"#d9d9d6"}}),Ke(rr,{sx:{fontSize:15},children:"\uB4F1\uB85D\uB41C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):null,p.map(H=>yn(rr,{sx:{display:"flex",alignItems:"center",gap:2,py:1,"&:not(:last-of-type)":{borderBottom:"1px solid #ececea"},opacity:H.enabled?1:.5},children:[Ke(Xm,{title:H.enabled?"\uC0AC\uC6A9 \uC911":"\uAEBC\uC9D0",arrow:!0,disableInteractive:!0,children:Ke(I8,{size:"small",inputProps:{"aria-label":`${H.name} \uADDC\uCE59 \uC0AC\uC6A9`},checked:H.enabled,onChange:(Z,J)=>c(H.seq,J)})}),yn(rr,{sx:{flex:1,minWidth:0},children:[Ke(rr,{sx:{fontSize:16,fontWeight:600,color:"#37352f"},children:H.name}),(()=>{let Z=A8(H,b,l);return yn(rr,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5,fontSize:15,color:"#6f6f6c"},children:[Ke(rr,{component:"span",children:Z.left}),Ke(M8,{sx:{fontSize:18,color:"#9a9a97",flexShrink:0}}),Ke(rr,{component:"span",children:Z.right})]})})()]}),Ke(rf,{size:"small","aria-label":`${H.name} \uADDC\uCE59 \uC218\uC815`,onClick:()=>{u(H.seq),m({name:H.name,trigger:H.trigger,enabled:H.enabled,sort_no:H.sort_no,condition:{...H.condition,...H.trigger==="field_changed"&&H.condition.changed_field===void 0?{changed_field:Qs[0]?.value??""}:{}},action:{...H.action}}),f(!0)},children:Ke(O8,{sx:{fontSize:18}})}),Ke(rf,{size:"small","aria-label":`${H.name} \uADDC\uCE59 \uC0AD\uC81C`,onClick:()=>o(H.seq),children:Ke(ur,{sx:{fontSize:18}})})]},H.seq))]})}],actions:{showCancelButton:!1,left:Ke(An,{startIcon:Ke(nf,{}),onClick:()=>{u(0),m(zl()),f(!0)},sx:{color:"#2563eb"},children:"\uC0C8 \uADDC\uCE59"}),right:Ke(An,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}}),Ke(Zm,{open:a,onClose:N,maxWidth:"sm",title:L?"\uADDC\uCE59 \uC218\uC815":"\uC0C8 \uADDC\uCE59",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-rule-form",tabs:{visible:!1},sectionContentPaddingTop:0,sections:[{id:"rule-form",title:"",showTitle:!1,children:K()}],actions:{showCancelButton:!0,right:Ke(An,{variant:"contained",onClick:()=>{V()},disabled:x,children:L?"\uC218\uC815":"\uADDC\uCE59 \uCD94\uAC00"})}})]})}import{useEffect as N8,useState as ea}from"react";import{Box as sr,Button as wi,IconButton as _i,Tooltip as ki}from"@mui/material";import t0 from"@mui/icons-material/Add";import L8 from"@mui/icons-material/EditOutlined";import j8 from"@mui/icons-material/ContentCopyOutlined";import z8 from"@mui/icons-material/ArrowUpward";import F8 from"@mui/icons-material/ArrowDownward";import q8 from"@mui/icons-material/ExpandMore";import $8 from"@mui/icons-material/ExpandLess";import H8 from"@mui/icons-material/PlaylistAddCheckOutlined";import{FormDialog as r0}from"@ehfuse/mui-form-dialog";import{ClearTextField as $l,LabelSelect as n0,NumberField as o0}from"@ehfuse/mui-form-controls";import W8 from"@ehfuse/overlay-scrollbar";import{ConfirmDialog as U8,ErrorAlert as i0}from"@ehfuse/alerts";import{Fragment as G8,jsx as Qe,jsxs as xn}from"react/jsx-runtime";var V8=[{value:"high",label:"\uB192\uC74C"},{value:"medium",label:"\uC911\uAC04"},{value:"low",label:"\uB0AE\uC74C"}];function Hl(){return{name:"",description:"",group_seq:0,items:[]}}function K8(){return{title:"",due_offset_days:0,priority:"medium"}}function pU({open:e,templates:p,customTabs:b,onPickAccount:l,onClose:i,onCreate:s,onUpdate:r,onRemove:t,onRun:n}){let[c,o]=ea(!1),[a,f]=ea(0),[d,u]=ea(Hl()),[g,m]=ea(-1),[x,_]=ea(!1);N8(()=>{if(e)return;let N=window.setTimeout(()=>{o(!1),f(0),u(Hl()),m(-1)},500);return()=>window.clearTimeout(N)},[e]);let B=b.filter(N=>!N.archived).map(N=>({value:String(Vo(N.key)),label:N.label})),O=(N,S)=>{u(C=>({...C,items:C.items.map((M,h)=>h===N?{...M,...S}:M)}))},j=(N,S)=>{u(C=>{let M=[...C.items],h=N+S;return h<0||h>=M.length?C:([M[N],M[h]]=[M[h],M[N]],{...C,items:M})}),m(-1)},D=async N=>{if(!l)return;let S=await l(d.items[N]?.manager_account_seq??0);S&&O(N,{manager_account_seq:S.accountSeq,manager_name:S.name})},P=async()=>{let N=d.name.trim();if(!N){i0({message:"\uD15C\uD50C\uB9BF \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694."});return}let S=d.items.filter(h=>h.title.trim().length>0);if(S.length===0){i0({message:"\uC5C5\uBB34 \uD56D\uBAA9\uC744 \uD55C \uC904 \uC774\uC0C1 \uB123\uC73C\uC138\uC694."});return}_(!0);let C={...d,name:N,items:S},M=a>0?await r(a,C):await s(C);_(!1),M&&(o(!1),f(0),u(Hl()))},L=Qe(sr,{children:p.length===0?xn(sr,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[Qe(H8,{sx:{fontSize:48,color:"#d9d9d6"}}),Qe(sr,{sx:{fontSize:13.5},children:"\uB4F1\uB85D\uB41C \uD15C\uD50C\uB9BF\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):p.map(N=>xn(sr,{sx:{display:"flex",alignItems:"center",gap:2,py:1.75,"&:not(:last-of-type)::after":{content:'""',display:"block",my:1.75,borderBottom:"1px solid #f0efed"}},children:[xn(sr,{sx:{flex:1,minWidth:0},children:[Qe(sr,{sx:{fontSize:18,fontWeight:600,color:"#37352f"},children:N.name}),xn(sr,{sx:{fontSize:14,color:"#787774",mt:.25},children:["\uC5C5\uBB34 ",N.items.length,"\uAC74",N.description?` \xB7 ${N.description}`:""]})]}),n?Qe(wi,{size:"medium",variant:"outlined",onClick:()=>n(N),sx:{flexShrink:0},children:"\uC2E4\uD589"}):null,Qe(ki,{title:"\uC218\uC815",arrow:!0,disableInteractive:!0,children:Qe(_i,{size:"medium","aria-label":`${N.name} \uD15C\uD50C\uB9BF \uC218\uC815`,onClick:()=>{f(N.seq),u({name:N.name,description:N.description??"",group_seq:N.group_seq??0,items:N.items.map(S=>({...S}))}),m(-1),o(!0)},children:Qe(L8,{sx:{fontSize:19}})})}),Qe(ki,{title:"\uBCF5\uC81C",arrow:!0,disableInteractive:!0,children:Qe(_i,{size:"medium","aria-label":`${N.name} \uD15C\uD50C\uB9BF \uBCF5\uC81C`,onClick:()=>{f(0),u({name:`${N.name} \uC0AC\uBCF8`,description:N.description??"",group_seq:N.group_seq??0,items:N.items.map(S=>({...S}))}),m(-1),o(!0)},children:Qe(j8,{sx:{fontSize:18}})})}),Qe(ki,{title:"\uC0AD\uC81C",arrow:!0,disableInteractive:!0,children:Qe(_i,{size:"medium","aria-label":`${N.name} \uD15C\uD50C\uB9BF \uC0AD\uC81C`,onClick:()=>{(async()=>await U8({title:"\uD15C\uD50C\uB9BF \uC0AD\uC81C",message:`"${N.name}" \uD15C\uD50C\uB9BF\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&t(N.seq))()},children:Qe(ur,{sx:{fontSize:18}})})})]},N.seq))}),q=xn(sr,{sx:{display:"flex",flexDirection:"column",gap:2},children:[Qe($l,{size:"medium",label:"\uD15C\uD50C\uB9BF \uC774\uB984",placeholder:"\uC608: \uC2E0\uADDC \uC785\uC0AC\uC790 \uC628\uBCF4\uB529",fullWidth:!0,value:d.name,onChange:N=>u(S=>({...S,name:N.target.value}))}),Qe($l,{size:"medium",label:"\uC124\uBA85",placeholder:"\uBAA9\uB85D\uC5D0\uC11C \uBB34\uC5C7\uC778\uC9C0 \uC54C\uC544\uBCFC \uD55C \uC904(\uC120\uD0DD)",fullWidth:!0,value:d.description??"",onChange:N=>u(S=>({...S,description:N.target.value}))}),B.length>0?Qe(n0,{size:"medium",fullWidth:!0,label:"\uB9CC\uB4E4 \uACF3(\uD504\uB85C\uC81D\uD2B8)",value:String(d.group_seq??0),options:[{value:"0",label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568"},...B],onChange:N=>u(S=>({...S,group_seq:Number(N.target.value)||0}))}):null,xn(sr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Qe(sr,{sx:{fontSize:16,fontWeight:700,color:"#37352f"},children:"\uC5C5\uBB34 \uD56D\uBAA9"}),Qe(sr,{sx:{fontSize:13.5,color:"#37352f"},children:"\uB0A0\uC9DC\uB294 \uC2E4\uD589\uD560 \uB54C \uACE0\uB974\uB294 \uAE30\uC900\uC77C\uC5D0\uC11C \uACC4\uC0B0\uB429\uB2C8\uB2E4."}),Qe(wi,{size:"medium",startIcon:Qe(t0,{sx:{fontSize:18}}),onClick:()=>{u(N=>({...N,items:[...N.items,K8()]})),m(d.items.length)},sx:{ml:"auto",flexShrink:0},children:"\uD56D\uBAA9 \uCD94\uAC00"})]}),d.items.length===0?Qe(sr,{sx:{fontSize:14,color:"#9a9a97",py:2},children:'\uC544\uC9C1 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. "\uD56D\uBAA9 \uCD94\uAC00" \uB85C \uC808\uCC28\uB97C \uC21C\uC11C\uB300\uB85C \uC801\uC73C\uC138\uC694.'}):Qe(sr,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:Qe(W8,{style:{maxHeight:360},thumb:{width:6},children:d.items.map((N,S)=>xn(sr,{sx:{borderBottom:"1px solid #f2f2f0",px:2,py:2},children:[xn(sr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Qe(sr,{sx:{width:24,flexShrink:0,fontSize:16,color:"#9a9a97"},children:S+1}),Qe($l,{size:"medium",fullWidth:!0,placeholder:"\uC5C5\uBB34 \uC81C\uBAA9",value:N.title,onChange:C=>O(S,{title:C.target.value})}),Qe(sr,{sx:{width:148,flexShrink:0},children:Qe(o0,{size:"medium",fullWidth:!0,label:"\uC2DC\uC791 D+",thousandSeparator:!1,align:"right",suffix:"\uC77C",value:N.start_offset_days??null,onValueChange:C=>O(S,{start_offset_days:C===null?void 0:Math.trunc(Number(C))})})}),Qe(sr,{sx:{width:148,flexShrink:0},children:Qe(o0,{size:"medium",fullWidth:!0,label:"\uB9C8\uAC10 D+",thousandSeparator:!1,align:"right",suffix:"\uC77C",value:N.due_offset_days??null,onValueChange:C=>O(S,{due_offset_days:C===null?void 0:Math.trunc(Number(C))})})}),Qe(ki,{title:"\uC704\uB85C",arrow:!0,disableInteractive:!0,children:Qe(_i,{size:"medium","aria-label":`${S+1}\uBC88 \uD56D\uBAA9 \uC704\uB85C`,disabled:S===0,onClick:()=>j(S,-1),children:Qe(z8,{sx:{fontSize:18}})})}),Qe(ki,{title:"\uC544\uB798\uB85C",arrow:!0,disableInteractive:!0,children:Qe(_i,{size:"medium","aria-label":`${S+1}\uBC88 \uD56D\uBAA9 \uC544\uB798\uB85C`,disabled:S===d.items.length-1,onClick:()=>j(S,1),children:Qe(F8,{sx:{fontSize:18}})})}),Qe(ki,{title:g===S?"\uC811\uAE30":"\uB354 \uC801\uAE30",arrow:!0,disableInteractive:!0,children:Qe(_i,{size:"medium","aria-label":`${S+1}\uBC88 \uD56D\uBAA9 \uC0C1\uC138`,onClick:()=>m(g===S?-1:S),children:g===S?Qe($8,{sx:{fontSize:20}}):Qe(q8,{sx:{fontSize:20}})})}),Qe(ki,{title:"\uD56D\uBAA9 \uC0AD\uC81C",arrow:!0,disableInteractive:!0,children:Qe(_i,{size:"medium","aria-label":`${S+1}\uBC88 \uD56D\uBAA9 \uC0AD\uC81C`,onClick:()=>{u(C=>({...C,items:C.items.filter((M,h)=>h!==S)})),m(-1)},children:Qe(ur,{sx:{fontSize:18}})})})]}),g===S?xn(sr,{sx:{display:"flex",flexDirection:"column",gap:2,pl:"36px",pt:2},children:[xn(sr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Qe(sr,{sx:{width:160,flexShrink:0},children:Qe(n0,{size:"medium",fullWidth:!0,label:"\uC911\uC694\uB3C4",value:N.priority??"medium",options:V8,onChange:C=>O(S,{priority:C.target.value})})}),l?xn(wi,{size:"medium",variant:"outlined",onClick:()=>{D(S)},children:["\uCC45\uC784\uC790: ",N.manager_name||"\uC9C0\uC815 \uC548 \uD568"]}):null,N.manager_account_seq?Qe(wi,{size:"medium",onClick:()=>O(S,{manager_account_seq:0,manager_name:""}),children:"\uCC45\uC784\uC790 \uBE44\uC6B0\uAE30"}):null]}),Qe($l,{size:"medium",fullWidth:!0,label:"\uD560\uC77C(\uC904\uBC14\uAFC8\uC73C\uB85C \uAD6C\uBD84)",multiline:!0,minRows:2,value:(N.checklist??[]).join(`
42
42
  `),onChange:C=>O(S,{checklist:C.target.value.split(`
43
43
  `)})})]}):null]},S))})})]});return xn(G8,{children:[Qe(r0,{open:e,onClose:i,maxWidth:"md",title:"\uC5C5\uBB34 \uD15C\uD50C\uB9BF",locale:"ko",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-template",tabs:{visible:!1},actions:{showCancelButton:!1,left:Qe(wi,{startIcon:Qe(t0,{sx:{fontSize:18}}),onClick:()=>{f(0),u(Hl()),m(-1),o(!0)},children:"\uC0C8 \uD15C\uD50C\uB9BF"}),right:Qe(wi,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})},sections:[{id:"templates",title:"",showTitle:!1,children:L}]}),Qe(r0,{open:c,onClose:()=>o(!1),maxWidth:"md",title:a>0?"\uD15C\uD50C\uB9BF \uC218\uC815":"\uC0C8 \uD15C\uD50C\uB9BF",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},tabs:{visible:!1},actions:{showCancelButton:!0,right:Qe(wi,{variant:"contained",disabled:x,onClick:()=>{P()},children:"\uC800\uC7A5"})},sections:[{id:"template-form",title:"",showTitle:!1,children:q}]})]})}import{useEffect as s0,useState as a0}from"react";import{Box as Tr,Button as Y8}from"@mui/material";import{FormDialog as X8}from"@ehfuse/mui-form-dialog";import{DateTextField as Z8}from"@ehfuse/mui-form-controls";import J8 from"@ehfuse/overlay-scrollbar";import{jsx as Qr,jsxs as Si}from"react/jsx-runtime";function kU({open:e,template:p,todayStr:b,running:l=!1,onClose:i,onRun:s}){let[r,t]=a0(b),[n,c]=a0(p);s0(()=>{p&&c(p)},[p]),s0(()=>{e&&t(b)},[e]);let o=p??n,a=o?gh(o,r):[];return Qr(X8,{open:e,onClose:i,maxWidth:"sm",title:o?`${o.name} \uC2E4\uD589`:"\uD15C\uD50C\uB9BF \uC2E4\uD589",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-template-run",tabs:{visible:!1},actions:{showCancelButton:!0,right:Qr(Y8,{variant:"contained",disabled:l||a.length===0,onClick:()=>s(a,r),children:l?"\uB9CC\uB4DC\uB294 \uC911\u2026":`\uC5C5\uBB34 ${a.length}\uAC74 \uB9CC\uB4E4\uAE30`})},sections:[{id:"template-run",title:"",showTitle:!1,children:Si(Tr,{sx:{display:"flex",flexDirection:"column",gap:2},children:[Si(Tr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Qr(Tr,{sx:{width:72,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uAE30\uC900\uC77C"}),Qr(Z8,{size:"medium",fullWidth:!0,value:r,onChange:f=>t(f.target.value)})]}),Qr(Tr,{sx:{fontSize:14.5,color:"#37352f"},children:"\uC544\uB798 \uC5C5\uBB34\uAC00 \uD55C\uAEBC\uBC88\uC5D0 \uB9CC\uB4E4\uC5B4\uC9D1\uB2C8\uB2E4. \uB0A0\uC9DC\uB294 \uAE30\uC900\uC77C\uC5D0\uC11C \uACC4\uC0B0\uB41C \uAC12\uC785\uB2C8\uB2E4."}),Si(Tr,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:[Si(Tr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:"#fafaf9",borderBottom:"1px solid #e6e6e3",fontSize:13.5,fontWeight:600,color:"#37352f"},children:[Qr(Tr,{sx:{flex:1,minWidth:0},children:"\uC5C5\uBB34"}),Qr(Tr,{sx:{width:88,flexShrink:0,textAlign:"center"},children:"\uC2DC\uC791"}),Qr(Tr,{sx:{width:88,flexShrink:0,textAlign:"center"},children:"\uB9C8\uAC10"}),Qr(Tr,{sx:{width:96,flexShrink:0,textAlign:"center"},children:"\uCC45\uC784\uC790"})]}),Qr(J8,{style:{maxHeight:320},thumb:{width:6},children:a.length===0?Qr(Tr,{sx:{p:2,fontSize:14,color:"#9a9a97"},children:"\uB9CC\uB4E4 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):a.map((f,d)=>Si(Tr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1.25,borderBottom:"1px solid #f2f2f0",fontSize:14.5,color:"#37352f"},children:[Si(Tr,{sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[f.title,f.checklist.length>0?Si(Tr,{component:"span",sx:{ml:1,fontSize:13,color:"#787774"},children:["\uD560\uC77C ",f.checklist.length]}):null]}),Qr(Tr,{sx:{width:88,flexShrink:0,textAlign:"center",fontSize:13.5,color:f.start_date?"#37352f":"#9a9a97"},children:f.start_date?f.start_date.slice(5):"-"}),Qr(Tr,{sx:{width:88,flexShrink:0,textAlign:"center",fontSize:13.5,color:f.due_date?"#37352f":"#9a9a97"},children:f.due_date?f.due_date.slice(5):"-"}),Qr(Tr,{sx:{width:96,flexShrink:0,textAlign:"center",fontSize:13.5,color:f.manager_name?"#37352f":"#9a9a97",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f.manager_name||"-"})]},d))})]})]})}]})}var Q8={urgent:"\uAE34\uAE09",high:"\uB192\uC74C",normal:"\uC911\uAC04",low:"\uB0AE\uC74C"};function eS(e){return e.length===0?"":e.length<=2?e.join(", "):`${e[0]} \uC678 ${e.length-1}\uBA85`}function sf(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 is(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 af(e,p){let l=String(e.due_date??"").slice(11,16).trim()||String(e.estimated_time??"").trim(),i=sf(e.due_date),s=String(e.start_date??"").slice(11,16).trim(),r=sf(e.start_date),t=(e.receiver_names??[]).filter(Boolean).map(c=>String(c).trim()),n=(e.checklist??[]).length?`${(e.checklist??[]).filter(c=>c.checked).length}/${(e.checklist??[]).length}`:"";return{seq:Number(e.seq??0),title:String(e.title??"").trim(),statusName:cr(e).name,projectLabel:e.tab_key?p.get(String(e.tab_key))??"":"",managerName:String(e.manager_name??"").trim(),receiverNames:eS(t),receiverNamesFull:t.join(", "),startDate:r!=="-"&&s?`${r} ${s}`:r,dueDate:i!=="-"&&l?`${i} ${l}`:i,priorityName:Q8[String(e.priority??"")]??"",checklist:n,note:String(e.note??"").trim(),completed:!!e.completed}}function Dt(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function tS(e,p){if(e===" ")return p*.3;let b=e.codePointAt(0)??0,l=b>=4352&&b<=4607||b>=12288&&b<=40959||b>=44032&&b<=55203||b>=63744&&b<=64255||b>=65280&&b<=65519;return p*(l?1:.55)}function Wl(e,p){let b=0;for(let l of String(e??""))b+=tS(l,p);return b}function ss(e,p){let b=String(e??"").trim();if(!b)return["-"];let l=[],i="";for(let s of b){if(s===`
44
44
  `){i&&l.push(i),i="";continue}let r=`${i}${s}`;if(r.length>p&&i){l.push(i),i=s;continue}i=r}return i&&l.push(i),l.length>0?l:["-"]}function Ti(e,p,b){let l=String(e??"").replace(/\s+/g," ").trim();if(!l)return"";if(Wl(l,b)<=p)return l;let i=Wl("\u2026",b),s="",r=0;for(let t of l){let n=Wl(t,b);if(r+n+i>p)break;s+=t,r+=n}return`${s}\u2026`}var ra=595.28,na=841.89,oa=841.89,ia=595.28,Dr=28,vn=96,ln=44,rS="'Malgun Gothic','\uB9D1\uC740 \uACE0\uB515','Apple SD Gothic Neo','Noto Sans KR',sans-serif",nS="'Batang','\uBC14\uD0D5','AppleMyungjo','Noto Serif KR',serif",ta="#cbd5e1",oS=[`text { font-family: ${rS}; fill: #000000; }`,`.doc-title { font-family: ${nS}; 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: ${ta}; stroke-width: 0.5; }`,`.group { fill: #f8fafc; stroke: ${ta}; stroke-width: 0.5; }`,`.frame { fill: none; stroke: ${ta}; stroke-width: 0.5; }`,`.hline { stroke: ${ta}; stroke-width: 0.5; }`,`.vline { stroke: ${ta}; 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 Mo(e,p,b){let l=b-Dr;return[`<text x="${Dr}" y="46" class="doc-title">${Dt(e.documentTitle)}</text>`,`<text x="${Dr}" y="66" class="doc-sub">${Dt(e.subtitle)}</text>`,`<text x="${l}" y="42" class="doc-meta" text-anchor="end">${Dt(e.facilityName)}</text>`,`<text x="${l}" y="58" class="doc-meta" text-anchor="end">\uCD9C\uB825 ${Dt(is(e.printedAt))}${e.printedBy?` \xB7 ${Dt(e.printedBy)}`:""}</text>`,p?`<text x="${l}" y="74" class="doc-meta" text-anchor="end">${Dt(p)}</text>`:""].join("")}function Eo(e){let{width:p,height:b,body:l,pageIndex:i,pageCount:s}=e;return[`<svg xmlns="http://www.w3.org/2000/svg" width="${p}" height="${b}" viewBox="0 0 ${p} ${b}">`,`<style>${oS}</style>`,`<rect x="0" y="0" width="${p}" height="${b}" fill="#ffffff" />`,l,`<text x="${p/2}" y="${b-22}" class="pageno" text-anchor="middle">${i+1} / ${s}</text>`,"</svg>"].join("")}var cf=oa,c0=ia,Ro=Dr,sa=cf-Dr,la=22,Ci=20,Bi=22,aa=5,u0=vn,f0=ln,l0=c0-46,ca=[{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"}],lf=ca.reduce((e,p,b)=>(e.push(b===0?Ro:e[b-1]+ca[b-1].width),e),[]);function iS(e){let p=[],b=[],l=u0+la,i=(s,r)=>{p.push(b),b=[],l=f0+la,s&&(b.push({kind:"group",label:s,count:r,continued:!0}),l+=Bi)};for(let s of e){s.label&&(l+Bi+Ci>l0&&i("",0),b.push({kind:"group",label:s.label,count:s.rows.length,continued:!1}),l+=Bi);for(let r of s.rows)l+Ci>l0&&i(s.label,s.rows.length),b.push({kind:"row",completed:r.completed,values:ca.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||"-"}})}),l+=Ci}return p.push(b),p.filter((s,r)=>r===0||s.length>0)}function sS(e,p){let b=[];b.push(`<rect x="${Ro}" y="${p}" width="${sa-Ro}" height="${la}" class="head" />`),ca.forEach((i,s)=>{let r=lf[s],t=i.align==="middle"?r+i.width/2:r+aa;b.push(`<text x="${t}" y="${p+la-7}" class="th" text-anchor="${i.align}">${Dt(i.label)}</text>`)});let l=p+la;for(let i of e){if(i.kind==="group"){b.push(`<rect x="${Ro}" y="${l}" width="${sa-Ro}" height="${Bi}" class="group" />`,`<text x="${Ro+aa}" y="${l+Bi-7}" class="gt">${Dt(i.continued?`${i.label} (\uC774\uC5B4\uC11C)`:i.label)}</text>`,`<text x="${sa-aa}" y="${l+Bi-7}" class="gt" text-anchor="end">${i.count}\uAC74</text>`),l+=Bi;continue}ca.forEach((s,r)=>{let t=lf[r],n=s.align==="middle"?t+s.width/2:t+aa;b.push(`<text x="${n}" y="${l+Ci-6}" class="${i.completed?"td done":"td"}" text-anchor="${s.align}">${Dt(Ti(i.values[r]??"",s.width-aa*2,9))}</text>`)}),b.push(`<line x1="${Ro}" y1="${l+Ci}" x2="${sa}" y2="${l+Ci}" class="hline" />`),l+=Ci}return lf.slice(1).forEach(i=>{b.push(`<line x1="${i}" y1="${p}" x2="${i}" y2="${l}" class="vline" />`)}),b.push(`<rect x="${Ro}" y="${p}" width="${sa-Ro}" height="${l-p}" class="frame" />`),b.join("")}async function aS(e,p){let b=iS(p),l=p.reduce((i,s)=>i+s.rows.length,0);return b.map((i,s)=>{let r=s===0?u0:f0,t=[s===0?Mo(e,`\uC804\uCCB4 ${l}\uAC74`,cf):"",sS(i,r)].join("");return Eo({width:cf,height:c0,body:t,pageIndex:s,pageCount:b.length})})}var ff=ra,d0=na,Qn=Dr,Ul=ff-Dr,lS=d0-46,h0=22,cS=68,uS=(Ul-Qn)/2,fS=14,uf=58;function as(e){switch(e.kind){case"title":return 34;case"props":return Math.ceil(e.pairs.length/2)*h0+10;case"section":return 26;default:return fS}}function dS(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(`