@ehfuse/taskbox 0.5.278 → 0.5.280

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=lr(e).name;i&&p.push(`\uC0C1\uD0DC: ${i}`);let s=xp(e.content);s&&p.push("",s);let r=String(e.note??"").trim();return r&&p.push("",`\uBE44\uACE0: ${r}`),p.join(`
41
- `)}function vp(e){navigator.clipboard.writeText(e).then(()=>q5("\uC5C5\uBB34 \uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>F5("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uB0B4\uC6A9\uC744 \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD574 \uC8FC\uC138\uC694."))}function Vi(e,p){let b=$5(e);if(p&&typeof navigator.share=="function"){navigator.share({text:b}).catch(l=>{l?.name!=="AbortError"&&vp(b)});return}vp(b)}import{Fragment as X5,jsx as Bt,jsxs as wp}from"react/jsx-runtime";function _p({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:d,canDelete:f}){let u=Nt(),[g,m]=js(!1),[x,_]=js(null),[B,A]=js(null),[j,D]=js(null),[P,N]=js(null),q=!!e.is_notice,z=!!e.is_event,T=q?_t(e.icon||or):z?_t(e.icon||ar):null,C=q&&p>0&&(e.author_account_seq??0)===p,R=!so(e,p),h=!!d&&(f??(p>0&&(e.author_account_seq??0)===p)),y=!z&&(q?C:(e.author_account_seq??0)===p||(e.manager_account_seq??0)===p);return wp(X5,{children:[wp(Ki,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[t&&r?Bt(Gi,{"aria-label":"\uB4A4\uB85C",onClick:r,sx:{color:"#37352f",ml:-1},children:Bt(U5,{})}):null,y&&!t?Bt(Yi,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${nn(e.completed_time)} \uC644\uB8CC`:"",arrow:!0,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:Bt(Ki,{sx:{display:"flex",flexShrink:0,mr:1},children:Bt(Nn,{onClick:v=>N({anchorEl:v.currentTarget,nextCompleted:!e.completed}),children:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC\uD558\uAE30"})})}):null,t||!T?null:z&&!R?Bt(Yi,{title:"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,enterDelay:400,disableInteractive:!0,children:Bt(H5,{onClick:v=>A(v.currentTarget),sx:{display:"flex",p:.5,borderRadius:1,color:e.icon_color||"#1e3a8a","&:hover":{bgcolor:"#f2f2f0"}},children:Bt(T,{sx:{fontSize:20}})})}):Bt(Ki,{sx:{display:"flex",px:.5,color:e.icon_color||(q?"#e5484d":"#1e3a8a")},children:Bt(T,{sx:{fontSize:20}})}),x!==null?Bt(Ki,{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(Ki,{sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:q?"\uACF5\uC9C0":z?"\uC77C\uC815":e.is_bug?"\uC624\uB958":"\uC5C5\uBB34"}):Bt(Ki,{onClick:R?void 0:()=>_(e.title),sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:R?"default":"text",textDecoration:e.completed?"line-through":"none"},children:e.title}),o?Bt(Yi,{title:"\uD65C\uB3D9",arrow:!0,children:Bt(Gi,{"aria-label":"\uD65C\uB3D9",onClick:()=>m(!0),sx:{color:"#6b7280"},children:Bt(G5,{sx:{fontSize:20}})})}):null,Bt(Yi,{title:u?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:Bt(Gi,{"aria-label":u?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>Vi(e,u),sx:{color:"#6b7280"},children:u?Bt(V5,{sx:{fontSize:20}}):Bt(K5,{sx:{fontSize:20}})})}),a?Bt(Yi,{title:"\uC778\uC1C4",arrow:!0,children:Bt(Gi,{"aria-label":"\uC778\uC1C4",onClick:()=>a(e),sx:{color:"#6b7280"},children:Bt(Y5,{sx:{fontSize:20}})})}):null,h?Bt(Yi,{title:"\uC0AD\uC81C",arrow:!0,children:Bt(Gi,{"aria-label":"\uC0AD\uC81C",onClick:v=>D(v.currentTarget),sx:{color:"#6b7280","&:hover":{color:"#e5484d"}},children:Bt(cr,{sx:{fontSize:20}})})}):null,r&&!t?Bt(Gi,{"aria-label":"\uB2EB\uAE30",onClick:r,sx:{color:"#6b7280"},children:Bt(W5,{})}):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:()=>N(null),onConfirm:()=>{P&&b(e.seq,P.nextCompleted),N(null)}}),Bt(Lo,{anchorEl:B,value:e.icon??"",color:e.icon_color??"",onSelect:v=>{i(e.seq,v),A(null)},onSelectColor:s?v=>s(e.seq,v):void 0,onClose:()=>A(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),d?.(e)}}),Bt(Bl,{open:g,taskSeq:e.seq,items:n,loading:c,onLoad:o,onClose:()=>m(!1)})]})}import{useState as bn}from"react";import{Box as Zt,Button as Xi,ButtonBase as Ip,Checkbox as s4,Divider as bi,Menu as Au,MenuItem as Du}from"@mui/material";import a4 from"@mui/icons-material/ExpandLess";import l4 from"@mui/icons-material/ExpandMore";import c4 from"@mui/icons-material/ConfirmationNumberOutlined";import Ep from"@mui/icons-material/Check";import u4 from"@mui/icons-material/DirectionsRunOutlined";import d4 from"@mui/icons-material/SpeedOutlined";import Pu from"@mui/icons-material/CheckCircle";import f4 from"@mui/icons-material/CheckCircleOutlineOutlined";import Nu from"@mui/icons-material/CheckCircleOutlined";import Mp from"@mui/icons-material/AccessTimeOutlined";import h4 from"@mui/icons-material/AutorenewOutlined";import p4 from"@mui/icons-material/LabelOutlined";import m4 from"@mui/icons-material/PersonOutlineOutlined";import g4 from"@mui/icons-material/SubjectOutlined";import b4 from"@mui/icons-material/StickyNote2Outlined";import y4 from"@mui/icons-material/PanToolAltOutlined";import Rp from"@mui/icons-material/LockOutlined";import Op from"@mui/icons-material/PublicOutlined";import Ap from"@mui/icons-material/Group";import x4 from"@mui/icons-material/Repeat";import v4 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as Dp,InfoAlert as w4}from"@ehfuse/alerts";import{DatePicker as _4}from"@ehfuse/mui-datetime-picker";import{useState as Z5}from"react";import{TextField as J5}from"@ehfuse/mui-form-controls";import{jsx as Q5}from"react/jsx-runtime";function kp({value:e,onCommit:p,onDraftChange:b,readOnly:l=!1}){let[i,s]=Z5(null);return Q5(J5,{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 Mu,useState as Ru}from"react";import{Box as Rr,Button as Cp,IconButton as e4}from"@mui/material";import t4 from"@mui/icons-material/AccountTreeOutlined";import r4 from"@mui/icons-material/LinkOutlined";import n4 from"@mui/icons-material/Close";import o4 from"@mui/icons-material/RedoOutlined";function gi(e){return e.relations??[]}function Zj(e,p,b){return gi(e).some(l=>l.type===b&&l.task_seq===p.seq)||gi(p).some(l=>l.type===b&&l.task_seq===e.seq)}function Sp(e){return`${e.created_time??""}|${String(e.seq).padStart(12,"0")}`}function Iu(e,p){let b=new Map(p.map(f=>[f.seq,f]));b.set(e.seq,e);let l=new Map,i=(f,u)=>{l.has(f)||l.set(f,new Set),l.has(u)||l.set(u,new Set),l.get(f).add(u),l.get(u).add(f)};for(let f of b.values())for(let u of gi(f))u.type==="follow_up"&&b.has(u.task_seq)&&i(f.seq,u.task_seq);let s=new Set([e.seq]),r=[e.seq];for(;r.length>0;){let f=r.shift();for(let u of l.get(f)??[])s.has(u)||(s.add(u),r.push(u))}let t=[...s].map(f=>b.get(f)).filter(f=>!!f).sort((f,u)=>Sp(f).localeCompare(Sp(u))),n=new Set;for(let f of gi(e))f.type==="related"&&n.add(f.task_seq);for(let f of b.values())f.seq!==e.seq&&gi(f).some(u=>u.type==="related"&&u.task_seq===e.seq)&&n.add(f.seq);let c=[...n].map(f=>b.get(f)).filter(f=>f!==void 0&&f.seq!==e.seq),o=[...b.values()].filter(f=>f.seq!==e.seq&&gi(f).some(u=>u.type==="duplicate_of"&&u.task_seq===e.seq)),a=gi(e).find(f=>f.type==="duplicate_of")?.task_seq,d=a?b.get(a)??null:null;return{lineage:t,related:c,duplicates:o,duplicateOf:d}}function Eu(e,p){let b=Iu(e,p);return(b.lineage.length>=2?b.lineage.length-1:0)+b.related.length+b.duplicates.length+(b.duplicateOf?1:0)}function Tp(e,p){return Eu(e,p)>0}import{Fragment as i4,jsx as Xt,jsxs as Mn}from"react/jsx-runtime";function Ou({item:e,caption:p,onOpen:b,onUnlink:l}){let i=e.is_notice||e.is_event?_t(e.icon||(e.is_notice?or:ar)):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:lr(e),small:!0}),l?Xt(e4,{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(n4,{sx:{fontSize:15}})}):null]})}function Bp({task:e,tasks:p,readOnly:b=!1,onOpenTask:l,onLink:i,onUnlink:s,onCreateFollowUp:r}){let[t,n]=Ru(!1),[c,o]=Ru(null),[a,d]=Ru(null),f=Mu(()=>Iu(e,p),[e,p]),u=f.lineage.length>=2,g=Mu(()=>Eu(e,p),[e,p]),m=Mu(()=>{let _=new Set;for(let B of f.lineage)_.add(B.seq);for(let B of f.related)_.add(B.seq);for(let B of f.duplicates)_.add(B.seq);return f.duplicateOf&&_.add(f.duplicateOf.seq),[..._]},[f]),x=(_,B,A)=>{d({anchorEl:_,targetSeq:B,type:A})};return Mn(gn,{icon:Xt(t4,{sx:{fontSize:19,display:"block"}}),title:Mn(i4,{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(Cp,{size:"small",color:"inherit",startIcon:Xt(o4,{sx:{fontSize:16}}),onClick:_=>o(_.currentTarget),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uD6C4\uC18D \uC5C5\uBB34"}):null,i?Xt(Cp,{size:"small",color:"inherit",startIcon:Xt(r4,{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:f.related.length||f.duplicates.length||f.duplicateOf?1:0},children:f.lineage.map((_,B)=>{let A=_.seq===e.seq,j=B===f.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:A?9:7,height:A?9:7,borderRadius:"50%",bgcolor:A?"#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:!A&&l?()=>l(_.seq):void 0,sx:{minWidth:0,fontSize:14,fontWeight:A?600:400,color:A?"#2f80ed":_.completed?"#9a9a97":"#37352f",textDecoration:_.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...!A&&l?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[_.ticket_no?`${_.ticket_no} `:"",_.title]}),Xt(Ot,{option:lr(_),small:!0})]}),Xt(Rr,{sx:{fontSize:12,color:"#9a9a97"},children:_.completed&&_.completed_time?`${_.completed_time} \uC644\uB8CC`:_.created_time??""})]})]},_.seq)})}):null,f.duplicateOf?Xt(Ou,{item:f.duplicateOf,caption:"\uC6D0\uBCF8",onOpen:l?()=>l(f.duplicateOf.seq):void 0,onUnlink:!b&&s?_=>x(_.currentTarget,f.duplicateOf.seq,"duplicate_of"):void 0}):null,f.duplicates.map(_=>Xt(Ou,{item:_,caption:"\uC911\uBCF5",onOpen:l?()=>l(_.seq):void 0,onUnlink:!b&&s?B=>x(B.currentTarget,_.seq,"duplicate_of"):void 0},`dup-${_.seq}`)),f.related.map(_=>Xt(Ou,{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(pl,{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:()=>d(null),onConfirm:()=>{a&&s?.(e.seq,a.targetSeq,a.type),d(null)}})]})}import{Fragment as qr,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 Pp({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:d,onChangeVisibility:f,onChangeRepeat:u,departments:g=[],onChangeEventTime:m,onChangeEventPlace:x,onChangeEventAddress:_,onChangeNote:B,onChangeNoteDraft:A,onChangeContent:j,contentTemplates:D,onSaveContentTemplate:P,onRemoveContentTemplate:N,contentLoading:q=!1,onChangeContentHeight:z,onAddChecklistItem:T,onToggleChecklistItem:C,onRemoveChecklistItem:R,onUpdateChecklistItem:h,onReorderChecklist:y,onConvertChecklistToTask:v,onOpenChecklistTask:w,onLinkChecklistTask:k,resolveChecklistTask:S,relatedTasksPool:E,onOpenRelatedTask:L,onLinkRelatedTask:$,onUnlinkRelatedTask:U,onCreateFollowUpTask:O,onAddAttachments:W,onRemoveAttachment:M,onPreview:I,onDownload:F,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:de=!1,hideSprint:We=!1,onChangeSprint:Ne,onChangeStoryPoints:se,onChangeResolution:Be,onClaimTask:ye,onVerifyBug:xe}){let[Ue,Te]=bn(null),[ue,Me]=bn(null),[ke,Ie]=bn(null),[lt,Le]=bn(null),[$e,Tt]=bn(!1),je={[Cn]:$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]=bn(null),[Ze,He]=bn(null),[vt,Ye]=bn(null),[te,ce]=bn(null),[pe,Se]=bn(null),[Xe,Re]=bn(null),[De,yt]=bn(null),Ae=!!e.is_notice,Ce=!!e.is_event,et=!!e.is_bug,st=!!ye&&Ea(e,Z),ft=!!ye&&Ma(e,Z),wt=!!xe&&et&&!!e.completed&&Z>0&&(e.author_account_seq??0)===Z&&!(e.acks??[]).some(oe=>oe.account_seq===Z),pt=!so(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?or:ar)):null,Pt=Ae?!Ia(e,Z):pt,Vt=st||ft?Wt(Nn,{onClick:oe=>yt(oe.currentTarget),children:[we(y4,{sx:{fontSize:16,mr:.5}}),"\uAC00\uC838\uAC00\uAE30"]}):null,Q=Ae?_l(e,me):"",ae=Ae?tp(e,me,Z):null,ge=Ae?null:Ha(e,Z),be=!!(ge&&ge.total>0||Ae&&ae),Ee=!Ae,ze=Wt(qr,{children:[we(mt,{icon:we(m4,{sx:{fontSize:17}}),label:"\uC791\uC131\uC790",sx:[Vn(9),je??null,...Ce?[]:[tr(1)]],children:e.created_by?Wt(qr,{children:[we(jr,{names:[e.created_by],size:20,avatarSrcByName:l}),e.created_by]}):we(Uo,{})}),we(mt,{icon:we(Mp,{sx:{fontSize:17}}),label:"\uC791\uC131\uC77C\uC2DC",sx:[Vn(11),je??null,...Ce?[]:[tr(2)]],children:e.created_time?nn(e.created_time):we(Uo,{})})]});return Wt(qr,{children:[ee?Wt(Zt,{sx:{px:2,pt:2,pb:.5,display:"flex",alignItems:"flex-start",gap:1},children:[Ut?we(s4,{checked:e.completed,icon:we(f4,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:we(Pu,{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(Ip,{onClick:oe=>Me(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,[Cn]:{pb:0,"& > :last-child":{mb:0}}},children:[we(ll,{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=>d(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(qr,{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(qr,{children:[we(Xi,{variant:"contained",size:"large",onClick:()=>xe?.(e.seq,!0),sx:{bgcolor:"#2f80ed"},children:"\uAC80\uC99D\uC644\uB8CC"}),we(Xi,{variant:"outlined",size:"large",color:"error",onClick:()=>xe?.(e.seq,!1),children:"\uC7AC\uC624\uD508"})]}):null]}):null,et&&e.ticket_no?we(mt,{icon:we(c4,{sx:{fontSize:17}}),label:"\uD2F0\uCF13",sx:tr(1),children:we(Zt,{component:"span",sx:{fontVariantNumeric:"tabular-nums"},children:e.ticket_no})}):null,Ce?null:we(Zt,{sx:et&&e.ticket_no||Ee||be?tr(et&&e.ticket_no?2:1):{gridColumn:"1 / -1"},children:we(mt,{icon:we(h4,{sx:{fontSize:17}}),label:"\uC0C1\uD0DC",onClick:pt||e.completed?void 0:oe=>xt(oe),children:we(Ot,{option:lr(e)})})}),Ae?null:(()=>{let oe=_n(e),it=oe==="all"?we(Op,{sx:{fontSize:17,color:"#2f80ed"}}):oe==="group"?we(Ap,{sx:{fontSize:17,color:"#d9730d"}}):we(Rp,{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:tr(et?1:2),children:we(mt,{icon:it,label:"\uACF5\uAC1C",onClick:pt||!f?void 0:Ge=>He(Ge),children:Je})})})(),!Ae&&!et?we(Zt,{sx:Ce?void 0:tr(1),children:we(mt,{icon:we(x4,{sx:{fontSize:17,...e.repeat_rule?{color:"#2f80ed"}:{}}}),label:"\uBC18\uBCF5",onClick:pt||!u?void 0:oe=>Ye(oe),children:e.repeat_rule?nl(e.repeat_rule):we(Uo,{label:"\uC5C6\uC74C"})})}):null,!Ae&&!et&&e.repeat_rule?we(Zt,{sx:Ce?void 0:tr(2),children:we(mt,{icon:we(v4,{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:tr(2),children:we(mt,{icon:we(Nu,{sx:{fontSize:17}}),label:"\uD655\uC778",children:ge.canConfirm?we(Xi,{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(Xi,{size:"small",variant:"outlined",color:"inherit",startIcon:ge.myTime?we(Pu,{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:tr(2),children:we(mt,{icon:we(Nu,{sx:{fontSize:17}}),label:"\uD655\uC778",children:we(Zt,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,minWidth:0},children:ae.canAck?we(Xi,{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(Xi,{size:"small",variant:"outlined",color:"inherit",startIcon:ae.acked?we(Pu,{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(qr,{children:[ae.count,we(Zt,{component:"span",sx:{mx:.4},children:"/"}),ae.total]})})})})}):null,de&&!We&&!Ce&&!Ae?Wt(qr,{children:[we(mt,{icon:we(u4,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:pt?void 0:oe=>Se(oe),sx:tr(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(d4,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",sx:tr(2),children:we(vo,{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"}:tr(1),je??null],children:we(mt,{icon:we(p4,{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(qr,{children:[et?we(cl,{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(qr,{children:[we(mt,{icon:we(Nu,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC790",sx:[Vn(10),je??null,...Ce?[]:[tr(1)]],children:e.completed_by?Wt(qr,{children:[we(jr,{names:[e.completed_by],size:20,avatarSrcByName:l}),e.completed_by]}):we(Uo,{})}),we(mt,{icon:we(Mp,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC77C\uC2DC",sx:[Vn(12),je??null,...Ce?[]:[tr(2)]],children:e.completed_time?nn(e.completed_time):we(Uo,{})})]}):null]})}),Wt(Zt,{sx:{display:"none",[Cn]:{display:"block",mt:1.5,mb:0}},children:[we(bi,{sx:{borderColor:"#e6e6e3"}}),we(Ip,{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(qr,{children:["\uC811\uAE30 ",we(a4,{sx:{fontSize:18}})]}):Wt(qr,{children:["\uC815\uBCF4 \uB354\uBCF4\uAE30 ",we(l4,{sx:{fontSize:18}})]})})]}),Wt(Zt,{children:[we(bi,{sx:{my:1.5,borderColor:"#e6e6e3",[Cn]:{mt:0,mb:1.25}}}),we(gn,{icon:we(g4,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",titleExtra:D&&!pt?we(dl,{content:e.content??"",templates:D,onApply:oe=>j?.(e.seq,oe),onSave:P,onRemove:N}):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(za,{})}):we(fl,{syncKey:e.seq,value:e.content??"",height:e.content_height??0,onChangeHeight:z?oe=>z(e.seq,oe):void 0,readOnly:pt,onChange:oe=>j(e.seq,oe)})})}),e.is_bug?null:Wt(qr,{children:[we(bi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(gn,{icon:we(b4,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:we(Zt,{sx:{userSelect:"text"},children:we(kp,{value:e.note,readOnly:Pt,onCommit:oe=>B(e.seq,oe),onDraftChange:A?oe=>A(e.seq,oe):void 0})})})]}),Ce?null:Wt(qr,{children:[we(bi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(ml,{taskSeq:e.seq,checklist:e.checklist??[],removeLocked:Pt,onAdd:T,onToggle:C,onRemove:R,onUpdate:h,onReorder:y,onConvertToTask:v,onOpenLinkedTask:w,resolveLinkedTask:S,myAccountSeq:Z,linkCandidates:E,linkBaseTask:e,onLinkExistingTask:k})]}),E&&!Ce&&!Ae&&Tp(e,E)?Wt(qr,{children:[we(bi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(Bp,{task:e,tasks:E,readOnly:pt,onOpenTask:L,onLink:$,onUnlink:U,onCreateFollowUp:O})]}):null,we(bi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(xl,{taskSeq:e.seq,attachments:e.attachments??[],removeLocked:Pt,onAdd:W,onRemove:M,onPreview:I?oe=>I({...oe,taskSeq:e.seq}):void 0,onDownload:F?oe=>F({...oe,taskSeq:e.seq}):void 0})]}),we(bi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(gp,{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:F?oe=>F({...oe,taskSeq:e.seq}):void 0})]}),we(Ii,{anchorEl:Fe,value:e.status,options:Ae?gs:et?ri:bs,onSelect:oe=>i(e.seq,oe),onClose:()=>xt(null)}),we(Au,{transitionDuration:0,anchorEl:vt,open:!!vt,onClose:()=>Ye(null),children:[{value:"",label:"\uC5C6\uC74C"},...Ms].map(oe=>we(Du,{selected:(e.repeat_rule??"")===oe.value,onClick:()=>{Ye(null),(async()=>{let it=e.repeat_rule??"";if(oe.value===it)return;if(oe.value===""){await Dp({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){w4(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 Dp({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,ol(Je,oe.value))})()},sx:{fontSize:14,minWidth:140},children:oe.label},oe.value||"none"))}),we(_4,{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=rt=>String(rt).padStart(2,"0"),Je=`${oe.getFullYear()}-${it(oe.getMonth()+1)}-${it(oe.getDate())}`,Ge=e.repeat_rule??"";Ge&&u?.(e.seq,Ge,Je)}}),we(Au,{transitionDuration:0,anchorEl:Ze,open:!!Ze,onClose:()=>He(null),children:[{key:"involved",label:"\uBE44\uACF5\uAC1C",icon:we(Rp,{sx:{fontSize:17,color:"#57564f"}}),selected:_n(e)==="involved",onPick:()=>f?.(e.seq,"involved",0)},{key:"all",label:"\uC804\uCCB4\uACF5\uAC1C",icon:we(Op,{sx:{fontSize:17,color:"#2f80ed"}}),selected:_n(e)==="all",onPick:()=>f?.(e.seq,"all",0)},...g.map(oe=>({key:`group-${oe.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${oe.name}`,icon:we(Ap,{sx:{fontSize:17,color:"#d9730d"}}),selected:_n(e)==="group"&&(e.visibility_group_seq??0)===oe.seq,onPick:()=>f?.(e.seq,"group",oe.seq)}))].map(oe=>Wt(Du,{selected:oe.selected,onClick:()=>{oe.onPick(),He(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[oe.icon,oe.label,oe.selected?we(Ep,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},oe.key))}),we(Au,{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:pn(oe)}))].map(oe=>Wt(Du,{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(Ep,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},oe.seq))}),we($a,{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(wl,{anchorEl:Xe,selectedKeys:e.label_keys??[],labelOptions:b,onToggle:oe=>s(e.seq,Ca(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),Me(null)},onSelectColor:le?oe=>le(e.seq,oe):void 0,onClose:()=>Me(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 E4,jsx as $r,jsxs as qp}from"react/jsx-runtime";function OF(){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 AF({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:d,onLoadActivity:f,onPrint:u,onDelete:g,canDelete:m,...x}){let _=Nt(),B=Lp(null);p&&(B.current=p);let A=p??B.current,[j,D]=jp(!1),[P,N]=jp({}),q=Object.keys(P).length>0;Np(()=>{N({})},[p?.seq,e]);let z=Lp(null);if(Np(()=>{z.current?.scrollTo({top:0})},[p?.seq]),!A)return null;let T=_&&q?{...A,...P}:A,C=T.checklist??[],R=(S,E)=>{_?N(L=>({...L,...S})):E()},h=()=>{let S=P;N({});let E=A.seq,L=S.title===void 0?void 0:String(S.title).trim();if(i){let $={...S};L!==void 0&&(L?$.title=L:delete $.title),Object.keys($).length>0&&i(E,$),Fp({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"});return}L&&n(E,L),S.icon!==void 0&&c(E,String(S.icon)),S.icon_color!==void 0&&o?.(E,String(S.icon_color)),S.status!==void 0&&x.onChangeStatus(E,S.status),S.label_keys!==void 0&&x.onChangeLabels(E,S.label_keys??[]),S.tab_key!==void 0&&x.onChangeProject(E,String(S.tab_key??"")),S.start_date!==void 0&&x.onChangeDate(E,"start_date",String(S.start_date??"")),S.due_date!==void 0&&x.onChangeDate(E,"due_date",String(S.due_date??"")),S.reminder!==void 0&&x.onChangeReminder(E,S.reminder),S.priority!==void 0&&x.onChangePriority(E,S.priority),S.event_time!==void 0&&x.onChangeEventTime?.(E,String(S.event_time??"")),S.event_place!==void 0&&x.onChangeEventPlace?.(E,String(S.event_place??"")),S.event_address!==void 0&&x.onChangeEventAddress?.(E,String(S.event_address??"")),S.content!==void 0&&x.onChangeContent(E,String(S.content??"")),S.note!==void 0&&x.onChangeNote(E,String(S.note??"")),S.visibility!==void 0&&x.onChangeVisibility?.(E,S.visibility,Number(S.visibility_group_seq??0)),Fp({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"})},y={...x,onChangeStatus:(S,E)=>R({status:E},()=>x.onChangeStatus(S,E)),onChangeLabels:(S,E)=>R({label_keys:E},()=>x.onChangeLabels(S,E)),onChangeProject:(S,E)=>R({tab_key:E},()=>x.onChangeProject(S,E)),onChangeDate:(S,E,L)=>R({[E]:L},()=>x.onChangeDate(S,E,L)),onChangeReminder:(S,E)=>R({reminder:E},()=>x.onChangeReminder(S,E)),onChangePriority:(S,E)=>R({priority:E},()=>x.onChangePriority(S,E)),onChangeEventTime:(S,E)=>R({event_time:E},()=>x.onChangeEventTime?.(S,E)),onChangeEventPlace:(S,E)=>R({event_place:E},()=>x.onChangeEventPlace?.(S,E)),onChangeEventAddress:(S,E)=>R({event_address:E},()=>x.onChangeEventAddress?.(S,E)),onChangeContent:(S,E)=>R({content:E},()=>x.onChangeContent(S,E)),onChangeNote:(S,E)=>R({note:E},()=>x.onChangeNote(S,E)),onMemberEdit:(S,E)=>x.onMemberEdit(S,E,_?L=>N($=>({...$,...L})):null),onChangeNoteDraft:_?(S,E)=>R({note:E},()=>{}):void 0,onChangeVisibility:x.onChangeVisibility?(S,E,L)=>R({visibility:E,visibility_group_seq:L},()=>x.onChangeVisibility?.(S,E,L)):void 0,onAddChecklistItem:(S,E)=>R({checklist:[...C,{label:E,checked:!1}]},()=>x.onAddChecklistItem(S,E)),onToggleChecklistItem:(S,E,L)=>R({checklist:C.map(($,U)=>U===E?{...$,checked:L}:$)},()=>x.onToggleChecklistItem(S,E,L)),onRemoveChecklistItem:(S,E)=>R({checklist:C.filter((L,$)=>$!==E)},()=>x.onRemoveChecklistItem(S,E)),onUpdateChecklistItem:x.onUpdateChecklistItem?(S,E,L)=>R({checklist:C.map(($,U)=>U===E?{...$,label:L}:$)},()=>x.onUpdateChecklistItem?.(S,E,L)):void 0,onReorderChecklist:x.onReorderChecklist?(S,E)=>R({checklist:E},()=>x.onReorderChecklist?.(S,E)):void 0,onLinkChecklistTask:x.onLinkChecklistTask?(S,E,L)=>R({checklist:[...C,{label:L,checked:!1,task_seq:E}]},()=>x.onLinkChecklistTask?.(S,E,L)):void 0},v=$r(Pp,{...y,task:T,myAccountSeq:r,onChangeTitle:(S,E)=>R({title:E},()=>n(S,E)),onToggleCompleted:t,onChangeIcon:(S,E)=>R({icon:E},()=>c(S,E)),onChangeIconColor:(S,E)=>R({icon_color:E},()=>o?.(S,E)),showTitle:_}),w=$r(bp,{onSubmit:(S,E)=>l(T.seq,S,E)},T.seq);return _||s==="dialog"?qp(E4,{children:[$r(I4,{open:e,onClose:b,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:T.is_notice?"\uACF5\uC9C0\uC0AC\uD56D":T.is_event?"\uC77C\uC815":T.is_bug?"\uC624\uB958":"\uC5C5\uBB34",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[...f?[{icon:$r(C4,{sx:{color:"#6b7280"}}),tooltip:"\uD65C\uB3D9",onClick:()=>D(!0)}]:[],{icon:$r(T4,{sx:{color:"#6b7280"}}),tooltip:"\uACF5\uC720\uD558\uAE30",onClick:()=>Vi(T,!0)},..._?[{raw:!0,icon:$r(k4,{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:$r(Il,{sx:{userSelect:"none",width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:v})}]},A.seq),$r(Bl,{open:j,taskSeq:T.seq,items:a,loading:d,onLoad:f,onClose:()=>D(!1)})]}):$r(S4,{anchor:"right",open:e,onClose:b,"aria-label":"\uC5C5\uBB34 \uC0C1\uC138",disableAutoFocus:!0,disableEnforceFocus:!0,sx:{zIndex:S=>S.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:qp(Il,{sx:{display:"flex",flexDirection:"column",height:"100%",userSelect:"none"},children:[$r(_p,{task:T,myAccountSeq:r,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:c,onChangeIconColor:o,onClose:b,activityItems:a,activityLoading:d,onLoadActivity:f,onPrint:u,onDelete:g,canDelete:m}),$r(zp,{sx:{borderColor:"#e6e6e3"}}),$r(Il,{sx:{flex:1,minHeight:0},children:$r(B4,{ref:z,style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:v})}),$r(zp,{sx:{borderColor:"#37352f"}}),$r(Il,{sx:{flexShrink:0},children:w})]})})}import{useEffect as j4,useState as To}from"react";import{Box as Hr,Button as Fu,IconButton as Wp}from"@mui/material";import{FormDialog as Up}from"@ehfuse/mui-form-dialog";import z4 from"@mui/icons-material/Add";import F4 from"@mui/icons-material/DirectionsRunOutlined";import q4 from"@mui/icons-material/EditOutlined";import{ErrorAlert as Vp}from"@ehfuse/alerts";import{ClearTextField as Kp,DateTextField as Gp,LabelSelect as Yp}from"@ehfuse/mui-form-controls";import{useEffect as M4,useState as $p}from"react";import{Box as So,Button as R4,FormControlLabel as Lu,Radio as ju,RadioGroup as O4}from"@mui/material";import{FormDialog as A4}from"@ehfuse/mui-form-dialog";import{LabelSelect as D4}from"@ehfuse/mui-form-controls";import P4 from"@ehfuse/overlay-scrollbar";import{Fragment as N4,jsx as Or,jsxs as Zi}from"react/jsx-runtime";function Hp({open:e,sprint:p,remainingTasks:b,sprints:l,onClose:i,onConfirm:s}){let r=l.filter(d=>d.seq!==p?.seq&&d.group_seq===(p?.group_seq??0)&&d.status!=="closed"),[t,n]=$p("backlog"),[c,o]=$p(0);M4(()=>{e&&(n(r.length>0?"move":"backlog"),o(r[0]?.seq??0))},[e]);let a=b.length>0;return Or(A4,{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(R4,{variant:"contained",onClick:()=>s({mode:a?t:"keep",moveToSprintSeq:t==="move"?c:0,taskSeqs:b.map(d=>d.seq)}),disabled:a&&t==="move"&&!(c>0),children:"\uB9C8\uAC10"})},sections:[{id:"sprint-close",title:"",showTitle:!1,children:Zi(So,{sx:{display:"flex",flexDirection:"column",gap:2},children:[Zi(So,{sx:{fontSize:18,color:"#37352f"},children:[Or(So,{component:"span",sx:{fontWeight:600},children:p?.name??""})," \uBAA9\uD45C\uB97C \uB9C8\uAC10\uD569\uB2C8\uB2E4."]}),a?Zi(N4,{children:[Zi(So,{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(So,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:Or(P4,{style:{maxHeight:220},thumb:{width:6},children:b.map(d=>Zi(So,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,borderBottom:"1px solid #f2f2f0","&:last-of-type":{borderBottom:"none"}},children:[Or(So,{sx:{flex:1,minWidth:0,fontSize:16,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.title}),Or(Ot,{option:lr(d)})]},d.seq))})}),Zi(O4,{value:t,onChange:(d,f)=>n(f),children:[r.length>0?Or(Lu,{value:"move",control:Or(ju,{size:"small"}),label:"\uB2E4\uC74C \uBAA9\uD45C\uB85C \uC774\uC6D4",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}}):null,t==="move"&&r.length>0?Or(So,{sx:{pl:4,pb:1},children:Or(D4,{size:"small",label:"",fullWidth:!0,value:String(c),options:r.map(d=>({value:String(d.seq),label:d.name})),onChange:d=>o(Number(d.target.value)||0)})}):null,Or(Lu,{value:"backlog",control:Or(ju,{size:"small"}),label:"\uBBF8\uBC30\uC815(\uBC31\uB85C\uADF8)\uC73C\uB85C \uBE7C\uAE30",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}}),Or(Lu,{value:"keep",control:Or(ju,{size:"small"}),label:"\uC774 \uBAA9\uD45C\uC5D0 \uADF8\uB300\uB85C \uB450\uAE30",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}})]})]}):Or(So,{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 zu="custom-";function L4(e){return e.startsWith(zu)}function UF(e){return e>0?`${zu}${e}`:""}function Vo(e){if(!L4(e))return 0;let p=Number(e.slice(zu.length));return Number.isInteger(p)&&p>0?p:0}import{Fragment as Zp,jsx as zt,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 Xp(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):"-"}function oq({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,d]=To(""),[f,u]=To(""),[g,m]=To(""),[x,_]=To(""),[B,A]=To(""),[j,D]=To(!1),[P,N]=To(!1),[q,z]=To(null),T=q?t.filter(E=>(E.sprint_seq??0)===q.seq&&!E.completed):[],[C,R]=To(0);j4(()=>{e&&(d(o.length===1?o[0].key:""),u(""),m(""),_(""),A(""),R(0))},[e]);let h=()=>{u(""),m(""),_(""),A(""),R(0),N(!1)},y=E=>{R(E.seq),d(`custom-${E.group_seq}`),u(E.name),m(E.goal),_(E.start_date),A(E.end_date)},v=C>0||P,w=async()=>{let E=Vo(a);if(!E){Vp("\uBAA9\uD45C\uB97C \uB9CC\uB4E4 \uD504\uB85C\uC81D\uD2B8\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}if(!f.trim()){Vp("\uBAA9\uD45C \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}D(!0);try{if(C>0){s(C,{name:f.trim(),goal:g.trim(),start_date:x,end_date:B}),h();return}await i({group_seq:E,name:f.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])),S=zt(Hr,{children:o.length===0?zt(Hr,{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.'}):zt(Zp,{children:zt(Hr,{children:b.length===0?Ko(Hr,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[zt(F4,{sx:{fontSize:48,color:"#d9d9d6"}}),zt(Hr,{sx:{fontSize:13.5},children:"\uB4F1\uB85D\uB41C \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):b.map(E=>Ko(Hr,{sx:{display:"flex",flexDirection:"column",gap:1,"&:not(:last-of-type)::after":{content:'""',display:"block",my:1.75,borderBottom:"1px solid #f0efed"}},children:[Ko(Hr,{sx:{minWidth:0},children:[Ko(Hr,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[zt(Hr,{component:"span",sx:{fontSize:18,fontWeight:600,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:E.name}),zt(Hr,{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(Hr,{component:"span",sx:{flexShrink:0,fontSize:14,color:"#57564f"},children:[Xp(E.start_date)," ~"," ",Xp(E.end_date)]})]}),E.goal?zt(Hr,{sx:{mt:.5,fontSize:14,color:"#787774",lineHeight:1.5},children:E.goal}):null]}),Ko(Hr,{sx:{display:"flex",alignItems:"center",gap:.5},children:[zt(Yp,{label:"\uC0C1\uD0DC",showLabel:!1,size:"small",value:E.status,options:$4.map(L=>({value:L.value,label:L.label})),onChange:L=>{let $=String(L.target.value);if($==="closed"&&n){z(E);return}r(E.seq,$)},sx:{width:104,flexShrink:0}}),zt(Wp,{"aria-label":"\uBAA9\uD45C \uC218\uC815",onClick:()=>y(E),sx:{color:"#9a9a97","&:hover":{color:"#2563eb"}},children:zt(q4,{sx:{fontSize:18}})}),zt(Wp,{"aria-label":"\uBAA9\uD45C \uC0AD\uC81C",onClick:()=>c(E.seq),sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:zt(cr,{style:{width:16,height:16}})})]})]},E.seq))})})});return Ko(Zp,{children:[zt(Up,{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:S}],sectionContentPaddingTop:0,actions:{showCancelButton:!0,left:o.length>0?zt(Fu,{startIcon:zt(z4,{}),onClick:()=>{h(),N(!0)},sx:{color:"#2563eb"},children:"\uC0C8 \uBAA9\uD45C"}):void 0,right:zt(Fu,{variant:"contained",onClick:l,children:"\uD655\uC778"})}}),zt(Hp,{open:q!==null,sprint:q,remainingTasks:T,sprints:b,onClose:()=>z(null),onConfirm:E=>{q&&n?.(q.seq,E),z(null)}}),zt(Up,{open:v,onClose:()=>{N(!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:zt(Hr,{sx:{pt:1},children:Ko(Hr,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2.5,mt:1},children:[zt(Yp,{label:"\uD504\uB85C\uC81D\uD2B8",size:"medium",value:a,options:o.map(E=>({value:E.key,label:E.label})),onChange:E=>d(String(E.target.value)),disabled:C>0}),zt(Kp,{label:"\uBAA9\uD45C \uC774\uB984",size:"medium",placeholder:"\uC608: 8\uC6D4 2\uC8FC\uCC28",value:f,onChange:E=>u(E.target.value)}),zt(Gp,{size:"medium",label:"\uC2DC\uC791\uC77C",value:x,onChange:E=>_(E.target.value)}),zt(Gp,{size:"medium",label:"\uC885\uB8CC\uC77C",value:B,onChange:E=>A(E.target.value)}),zt(Kp,{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:zt(Fu,{variant:"contained",onClick:()=>{w()},disabled:j,children:C>0?"\uC218\uC815":"\uBAA9\uD45C \uB9CC\uB4E4\uAE30"})}})]})}import{Box as Go,Button as tm,Tooltip as H4}from"@mui/material";import{FormDialog as W4}from"@ehfuse/mui-form-dialog";import Qp from"@mui/icons-material/CalendarMonthOutlined";import U4 from"@mui/icons-material/EventOutlined";var qu={google:{key:"google",name:"\uAD6C\uAE00 \uCE98\uB9B0\uB354",homeUrl:"https://calendar.google.com/calendar",defaultCalendarName:"\uAD6C\uAE00 \uCE98\uB9B0\uB354",exportSupported:!0,importSupported:!0,subscribeSteps:["\uBC84\uD2BC\uC774 \uB3D9\uC791\uD558\uC9C0 \uC54A\uC73C\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354 > \uB2E4\uB978 \uCE98\uB9B0\uB354 + > **URL\uB85C \uCD94\uAC00**\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.","\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.","\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."],importSteps:["\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 > **\uC124\uC815 \uBC0F \uACF5\uC720**\uB97C \uC5FD\uB2C8\uB2E4.","**\uCE98\uB9B0\uB354 \uD1B5\uD569** \uC139\uC158\uC758 **iCal \uD615\uC2DD\uC758 \uBE44\uBC00 \uC8FC\uC18C**\uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."],importPlaceholder:"https://calendar.google.com/calendar/ical/\u2026/basic.ics",buildSubscribeUrl:e=>`https://calendar.google.com/calendar/r?cid=${encodeURIComponent(e.replace(/^https?:\/\//,"webcal://"))}`},apple:{key:"apple",name:"\uC560\uD50C \uCE98\uB9B0\uB354",homeUrl:"https://www.icloud.com/calendar",defaultCalendarName:"\uC560\uD50C \uCE98\uB9B0\uB354",exportSupported:!0,importSupported:!0,subscribeSteps:["\uC544\uC774\uD3F0\xB7\uC544\uC774\uD328\uB4DC: **\uC124\uC815 > \uCE98\uB9B0\uB354 > \uACC4\uC815 > \uACC4\uC815 \uCD94\uAC00 > \uAE30\uD0C0 > \uAD6C\uB3C5 \uCE98\uB9B0\uB354 \uCD94\uAC00**\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.","\uB9E5: \uCE98\uB9B0\uB354 \uC571 > **\uD30C\uC77C > \uC0C8\uB85C\uC6B4 \uCE98\uB9B0\uB354 \uAD6C\uB3C5**\uC5D0 \uBD99\uC5EC\uB123\uC2B5\uB2C8\uB2E4.","iCloud.com(\uC6F9)\uC5D0\uC11C\uB294 \uAD6C\uB3C5\uC744 \uCD94\uAC00\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 \uAE30\uAE30\uC5D0\uC11C \uCD94\uAC00\uD558\uBA74 iCloud \uB85C \uB3D9\uAE30\uD654\uB429\uB2C8\uB2E4."],importSteps:["iCloud.com > \uCE98\uB9B0\uB354\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354 \uC606 **\uACF5\uC720 \uC544\uC774\uCF58**\uC744 \uB204\uB985\uB2C8\uB2E4.","**\uACF5\uC6A9 \uCE98\uB9B0\uB354**\uB97C \uCF1C\uACE0 \uB098\uC624\uB294 **\uB9C1\uD06C\uB97C \uBCF5\uC0AC**\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694(webcal:// \uC8FC\uC18C\uB3C4 \uADF8\uB300\uB85C \uB429\uB2C8\uB2E4)."],importPlaceholder:"webcal://p00-calendars.icloud.com/published/\u2026",importWarning:"\uC560\uD50C\uC740 **\uACF5\uC6A9 \uCE98\uB9B0\uB354**\uB85C \uBC14\uAFD4\uC57C \uC8FC\uC18C\uAC00 \uB098\uC635\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC544\uB294 \uC0AC\uB78C\uC740 \uADF8 \uCE98\uB9B0\uB354\uB97C \uBCFC \uC218 \uC788\uC73C\uB2C8, \uAC1C\uC778 \uC77C\uC815\uC774 \uB2F4\uAE34 \uCE98\uB9B0\uB354\uB294 \uACF5\uAC1C\uD558\uC9C0 \uB9C8\uC138\uC694."},naver:{key:"naver",name:"\uB124\uC774\uBC84 \uCE98\uB9B0\uB354",homeUrl:"https://calendar.naver.com",defaultCalendarName:"\uB124\uC774\uBC84 \uCE98\uB9B0\uB354",exportSupported:!0,importSupported:!0,subscribeSteps:["\uB124\uC774\uBC84 \uCE98\uB9B0\uB354 > \uC67C\uCABD **\uB0B4 \uCE98\uB9B0\uB354** \uC606 **+** > **URL\uB85C \uAD6C\uB3C5\uD558\uAE30**\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.","\uB124\uC774\uBC84\uAC00 \uD53C\uB4DC\uB97C \uC8FC\uAE30\uC801\uC73C\uB85C \uAC00\uC838\uAC00\uBBC0\uB85C \uBCC0\uACBD\uC0AC\uD56D \uBC18\uC601\uC774 \uB2A6\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4.","\uB0B4\uBCF4\uB0B4\uAE30\uB97C \uADF8\uB9CC\uD558\uB824\uBA74 \uB124\uC774\uBC84 \uCE98\uB9B0\uB354\uC5D0\uC11C \uAD6C\uB3C5\uD55C \uCE98\uB9B0\uB354\uB97C \uC0AD\uC81C\uD558\uBA74 \uB429\uB2C8\uB2E4."],importSteps:["\uB124\uC774\uBC84 \uCE98\uB9B0\uB354 > \uC67C\uCABD **\uCE98\uB9B0\uB354 \uC124\uC815**(\uD1B1\uB2C8)\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354\uB97C \uACE0\uB985\uB2C8\uB2E4.","**\uC678\uBD80 \uACF5\uAC1C** \uD56D\uBAA9\uC5D0\uC11C **\uCE98\uB9B0\uB354 \uACF5\uAC1C**\uB97C \uCCB4\uD06C\uD558\uBA74 \uB098\uC624\uB294 **iCal \uC8FC\uC18C**\uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."],importPlaceholder:"https://calendar.naver.com/\u2026(iCal \uC8FC\uC18C)",importWarning:"\uB124\uC774\uBC84\uB294 **\uCE98\uB9B0\uB354\uB97C \uACF5\uAC1C**\uD574\uC57C iCal \uC8FC\uC18C\uAC00 \uB098\uC635\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC544\uB294 \uC0AC\uB78C\uC740 \uADF8 \uCE98\uB9B0\uB354\uB97C \uBCFC \uC218 \uC788\uC73C\uB2C8, \uAC1C\uC778 \uC77C\uC815\uC774 \uB2F4\uAE34 \uCE98\uB9B0\uB354\uB294 \uACF5\uAC1C\uD558\uC9C0 \uB9C8\uC138\uC694."},kakao:{key:"kakao",name:"\uCE74\uCE74\uC624 \uCE98\uB9B0\uB354",homeUrl:"https://kakaowork.com",defaultCalendarName:"\uCE74\uCE74\uC624 \uCE98\uB9B0\uB354",exportSupported:!1,importSupported:!0,exportBlockedReason:"\uCE74\uCE74\uC624\uD1A1 \uD1A1\uCE98\uB9B0\uB354\uB294 \uC678\uBD80 \uC8FC\uC18C\uB97C \uAD6C\uB3C5\uD558\uB294 \uAE30\uB2A5\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uCE74\uCE74\uC624\uB85C \uBCF4\uB0B4\uB824\uBA74 \uCE74\uCE74\uC624\uC6CC\uD06C \uCE98\uB9B0\uB354\uB97C \uC4F0\uAC70\uB098, \uB2E4\uB978 \uCE98\uB9B0\uB354\uB85C \uB0B4\uBCF4\uB0B4\uC138\uC694.",subscribeSteps:[],importSteps:["**\uCE74\uCE74\uC624\uC6CC\uD06C** \uCE98\uB9B0\uB354 > \uB0B4 \uCE98\uB9B0\uB354\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354\uC758 \uC124\uC815\uC744 \uC5FD\uB2C8\uB2E4.","**\uC678\uBD80 \uCE98\uB9B0\uB354\uB85C \uACF5\uC720** \uD56D\uBAA9\uC758 **iCal(.ics) \uB9C1\uD06C**\uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."],importPlaceholder:"https://\u2026(\uCE74\uCE74\uC624\uC6CC\uD06C iCal \uB9C1\uD06C).ics",importWarning:"\uCE74\uCE74\uC624\uD1A1\uC758 **\uD1A1\uCE98\uB9B0\uB354\uB294 iCal \uC8FC\uC18C\uB97C \uB0B4\uC8FC\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4** \u2014 \uAC00\uC838\uC624\uAE30\uAC00 \uB418\uB294 \uAC83\uC740 \uC5C5\uBB34\uC6A9 **\uCE74\uCE74\uC624\uC6CC\uD06C** \uCE98\uB9B0\uB354\uC785\uB2C8\uB2E4."}},Jp=Object.values(qu);function El(e){return qu[e??"google"]??qu.google}import{jsx as kr,jsxs as Ml}from"react/jsx-runtime";function hq({open:e,feedSubscribed:p=!1,importCount:b=0,onOpenExport:l,onOpenImport:i,onClose:s}){let r=Ml(Go,{sx:{display:"flex",flexDirection:"column",gap:2},children:[Ml(Go,{sx:{color:"#37352f",lineHeight:1.7},children:[kr("b",{children:"\uB0B4\uBCF4\uB0B4\uAE30"}),"\uB294 \uB0B4 \uC5C5\uBB34\uB97C \uB2E4\uB978 \uCE98\uB9B0\uB354\uC5D0\uC11C ",kr("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uBCF4\uAC8C \uD558\uACE0, ",kr("b",{children:"\uAC00\uC838\uC624\uAE30"}),"\uB294 \uADF8 \uCE98\uB9B0\uB354\uC758 \uC77C\uC815\uC744 \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uACB9\uCCD0 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.",kr("br",{}),"\uB450 \uBC29\uD5A5 \uBAA8\uB450 \uC6D0\uBCF8\uC744 \uACE0\uCE58\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."]}),kr(Go,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:Jp.map((t,n)=>Ml(Go,{sx:{display:"flex",alignItems:"center",gap:2,px:2,py:1.75,borderTop:n>0?"1px solid #f2f2f0":"none"},children:[kr(Qp,{sx:{fontSize:22,color:"#787774",flexShrink:0}}),Ml(Go,{sx:{flex:1,minWidth:0},children:[kr(Go,{sx:{fontSize:16,color:"#37352f"},children:t.name}),t.exportBlockedReason??t.importBlockedReason?kr(Go,{sx:{fontSize:13.5,color:"#8a6d1d",mt:.25,lineHeight:1.6},children:t.exportBlockedReason??t.importBlockedReason}):null]}),kr(em,{label:"\uB0B4\uBCF4\uB0B4\uAE30",icon:kr(Qp,{sx:{fontSize:17}}),supported:t.exportSupported,reason:t.exportBlockedReason,active:p,onClick:()=>l(t.key)}),kr(em,{label:"\uAC00\uC838\uC624\uAE30",icon:kr(U4,{sx:{fontSize:17}}),supported:t.importSupported,reason:t.importBlockedReason,active:b>0,onClick:()=>i(t.key)})]},t.key))})]});return kr(W4,{open:e,onClose:s,width:680,title:"\uCE98\uB9B0\uB354 \uC5F0\uB3D9",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-link",sections:[{id:"calendar-link",showTitle:!1,children:r}],actions:{showCancelButton:!1,right:kr(tm,{variant:"contained",onClick:s,children:"\uB2EB\uAE30"})}})}function em({label:e,icon:p,supported:b,reason:l,active:i,onClick:s}){let r=kr(Go,{component:"span",sx:{flexShrink:0},children:kr(tm,{size:"medium",variant:i?"contained":"outlined",startIcon:p,disabled:!b,onClick:s,sx:{minWidth:108},children:e})});return b?r:kr(H4,{title:l??"\uC774 \uC11C\uBE44\uC2A4\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",arrow:!0,children:r})}import{useState as rm}from"react";import{Box as yr,Button as Hu,Divider as G4,IconButton as Y4,TextField as X4}from"@mui/material";import{FormDialog as Z4}from"@ehfuse/mui-form-dialog";import J4 from"@mui/icons-material/OpenInNewOutlined";import Q4 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as e6}from"@ehfuse/alerts";import{Fragment as V4}from"react";import{Fragment as K4,jsx as $u}from"react/jsx-runtime";function zs({text:e}){let p=String(e??"").split("**");return $u(K4,{children:p.map((b,l)=>l%2===1?$u("b",{children:b},l):$u(V4,{children:b},l))})}import{jsx as jt,jsxs as Fs}from"react/jsx-runtime";function Iq({open:e,imports:p,provider:b,onRegister:l,onRemove:i,onClose:s}){let r=El(b),[t,n]=rm(""),[c,o]=rm(!1),a=async()=>{let u=t.trim();if(u){o(!0);try{await l(u)&&n("")}finally{o(!1)}}},d=async u=>{await e6({title:"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",message:`"${u.name||r.defaultCalendarName}" \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&i(u.seq)},f=Fs(yr,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[Fs(yr,{sx:{color:"#37352f",lineHeight:1.7},children:[r.name,"\uC758 \uC77C\uC815\uC744 ",jt("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uD568\uAED8 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.",jt("br",{}),"\uD45C\uC2DC/\uC228\uAE40\uC740 \uC5C5\uBB34\uD568 \uC6B0\uC0C1\uB2E8\uC758 ",jt("b",{children:"\uC678\uBD80 \uC77C\uC815"})," \uC2A4\uC704\uCE58\uB85C \uCF1C\uACE0 \uB055\uB2C8\uB2E4."]}),jt(yr,{sx:{fontWeight:700,color:"#37352f",mt:.5},children:"\uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354"}),p.length>0?jt(yr,{sx:{display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1},children:p.map((u,g)=>Fs(yr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:.75,borderTop:g>0?"1px solid #efefed":"none"},children:[jt(Q4,{sx:{fontSize:18,color:"#0f9d58",flexShrink:0}}),jt(yr,{component:"span",sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u.name||r.defaultCalendarName}),jt(Y4,{"aria-label":"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",size:"small",onClick:()=>{d(u)},sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:jt(cr,{sx:{fontSize:18}})})]},u.seq))}):jt(yr,{sx:{color:"#9a9a97",px:.5},children:"\uC544\uC9C1 \uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}),jt(G4,{sx:{my:1,borderColor:"#e6e6e3"}}),jt(yr,{sx:{fontWeight:700,color:"#37352f"},children:"\uC0C8 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30"}),Fs(yr,{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:[r.importSteps.map(u=>jt(yr,{children:jt(yr,{component:"span",children:jt(zs,{text:u})})},u)),jt(yr,{children:jt(yr,{component:"span",children:"\uB4F1\uB85D\uD55C \uC8FC\uC18C\uB294 \uC11C\uBC84\uC5D0 \uC800\uC7A5\uB418\uBA70 \uB2E4\uB978 \uC9C1\uC6D0\uC5D0\uAC8C \uBCF4\uC774\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})}),jt(yr,{children:jt(yr,{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."})}),r.importWarning?jt(yr,{children:jt(yr,{component:"span",children:jt(zs,{text:r.importWarning})})}):null]}),Fs(yr,{sx:{display:"flex",gap:2,alignItems:"center"},children:[jt(X4,{value:t,onChange:u=>n(u.target.value),fullWidth:!0,label:"iCal \uC8FC\uC18C",placeholder:r.importPlaceholder,slotProps:{input:{spellCheck:!1}}}),jt(Hu,{variant:"contained",disabled:!t.trim()||c,onClick:()=>{a()},sx:{flexShrink:0},children:c?"\uD655\uC778 \uC911\u2026":"\uB4F1\uB85D"})]})]});return jt(Z4,{open:e,onClose:s,width:680,title:`${r.name} \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:f}],actions:{showCancelButton:!1,left:jt(Hu,{variant:"outlined",startIcon:jt(J4,{sx:{fontSize:16}}),onClick:()=>window.open(r.homeUrl,"_blank"),children:r.name}),right:jt(Hu,{variant:"contained",onClick:s,children:"\uB2EB\uAE30"})}})}import{Box as yi,Button as qs,TextField as t6}from"@mui/material";import{FormDialog as r6}from"@ehfuse/mui-form-dialog";import n6 from"@mui/icons-material/ContentCopyOutlined";import nm from"@mui/icons-material/OpenInNewOutlined";import{InfoAlert as om}from"@ehfuse/alerts";import{Fragment as i6,jsx as Sr,jsxs as xi}from"react/jsx-runtime";function o6(e){return`${window.location.origin}/api/v1/taskbox/calendar/${e}.ics`}function jq({open:e,feed:p,feedTaskCount:b,provider:l,buildFeedUrl:i,onSubscribe:s,onClose:r}){let t=El(l),n=i??o6,c=p.subscribed?n(p.token):"",o=()=>{navigator.clipboard.writeText(c).then(()=>om("\uD53C\uB4DC \uC8FC\uC18C\uB97C \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>om("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD558\uC138\uC694."))},a=()=>{let f=t.buildSubscribeUrl?.(c);f&&window.open(f,"_blank")},d=xi(yi,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[xi(yi,{sx:{color:"#37352f",lineHeight:1.7},children:["\uB0B4\uAC00 \uAD00\uC5EC\uD55C \uC5C5\uBB34\uB97C ",Sr("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C ",t.name,"\uC5D0\uC11C \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4."]}),b===0?xi(yi,{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.",Sr("br",{}),Sr("b",{children:"\uB9C8\uAC10\uC77C\uC2DC\uAC00 \uC788\uB294 \uB0B4 \uC5C5\uBB34 \uB610\uB294 \uBCF4\uB0B8\uC5C5\uBB34"}),"\uAC00 \uC0DD\uAE30\uBA74"," ",p.subscribed?`${t.name}\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?xi(i6,{children:[Sr(t6,{value:c,fullWidth:!0,label:"\uB0B4 \uD53C\uB4DC \uC8FC\uC18C",slotProps:{input:{readOnly:!0}}}),xi(yi,{sx:{display:"flex",gap:2},children:[Sr(qs,{variant:"outlined",startIcon:Sr(n6,{}),onClick:o,children:"\uC8FC\uC18C \uBCF5\uC0AC"}),t.buildSubscribeUrl?xi(qs,{variant:"contained",startIcon:Sr(nm,{}),onClick:a,children:[t.name,"\uC5D0 \uCD94\uAC00"]}):null]}),xi(yi,{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:[t.subscribeSteps.map(f=>Sr(yi,{children:Sr("span",{children:Sr(zs,{text:f})})},f)),Sr(yi,{children:Sr("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."})})]})]}):Sr(qs,{variant:"contained",onClick:s,sx:{alignSelf:"flex-start"},children:"\uAD6C\uB3C5 \uC2DC\uC791 (\uD53C\uB4DC \uBC1C\uAE09)"})]});return Sr(r6,{open:e,onClose:r,width:680,title:`${t.name}\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:d}],actions:{showCancelButton:!1,left:Sr(qs,{variant:"outlined",startIcon:Sr(nm,{sx:{fontSize:16}}),onClick:()=>window.open(t.homeUrl,"_blank"),children:t.name}),right:Sr(qs,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}})}import{useEffect as s6,useMemo as Wu,useState as Uu}from"react";import{Box as $s,Button as a6,Typography as l6}from"@mui/material";import{FormDialog as c6}from"@ehfuse/mui-form-dialog";import{SearchTextField as u6}from"@ehfuse/mui-form-controls";import{TreeView as d6}from"@ehfuse/tree-view";import{Fragment as b6,jsx as Rn,jsxs as y6}from"react/jsx-runtime";function im(e){return`${e.name}#${e.seq}`}function f6(e){return Number(e.slice(e.lastIndexOf("#")+1))||0}function h6(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 p6(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 m6(e){let p=[[e.name,e.role_name].filter(Boolean).join(" "),e.department].filter(Boolean).join(" / ");return{id:`emp:${e.seq}`,label:im(e),renderLabel:Rn($s,{component:"span",sx:{display:"inline-flex",alignItems:"baseline",gap:.75},children:Rn($s,{component:"span",sx:{fontWeight:400,color:"text.primary"},children:p})})}}function sm(e,p){let b=(e.groups??[]).map(i=>sm(i,p)).filter(i=>i!==null),l=(e.employees??[]).filter(i=>p6(i,p)).map(m6);return b.length===0&&l.length===0?null:{id:`group:${e.key}`,label:e.name,children:[...b,...l]}}function g6({groups:e,allEmployees:p,initialSelectedSeqs:b,multiple:l,isMobile:i,onSelectionChange:s}){let[r,t]=Uu(""),n=Wu(()=>e.map(o=>sm(o,r.trim().toLowerCase())).filter(o=>o!==null),[e,r]),c=Wu(()=>p.filter(o=>b.includes(o.seq)).map(im),[]);return y6(b6,{children:[Rn($s,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:Rn(u6,{size:"small",fullWidth:!0,placeholder:"\uC774\uB984, \uBD80\uC11C \uAC80\uC0C9",onSearch:t,onClear:()=>t(""),sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),Rn($s,{sx:i?{display:"flex",flexDirection:"column"}:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:Rn(d6,{items:n,checkbox:!0,multiSelect:l,selectionMode:"child",showSearch:!1,defaultExpanded:!0,initialSelections:c,onChange:o=>s(o.map(f6).filter(a=>a>0)),styles:{border:"none",borderRadius:"0"}})})]})}function Kq({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]=Uu([]),[d,f]=Uu(0),u=Wu(()=>h6(l),[l]),g=s??[];s6(()=>{e&&(a(g),f(x=>x+1))},[e]);let m=()=>{let x=u.filter(_=>o.includes(_.seq));t(i?x:x.slice(0,1)),n()};return Rn(c6,{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:Rn($s,{sx:{...c?{}:{height:560},display:"flex",flexDirection:"column",border:"1px solid #cccccc",borderRadius:1,...c?{}:{overflow:"hidden"},userSelect:"none"},children:Rn(g6,{groups:l,allEmployees:u,initialSelectedSeqs:g,multiple:i,isMobile:c,onSelectionChange:a},d)})}],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?Rn(l6,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.35},children:b}):void 0,right:Rn(a6,{variant:"contained",onClick:m,children:r})}})}import{useEffect as $k,useMemo as qm,useState as Ys}from"react";import{Box as Io,Button as $m}from"@mui/material";import{FormDialog as Hk}from"@ehfuse/mui-form-dialog";import{LabelSelect as td}from"@ehfuse/mui-form-controls";import Wk from"@mui/icons-material/SpeedOutlined";import{useEffect as x6,useState as v6}from"react";import{Box as Jr,Button as w6}from"@mui/material";import{FormDialog as _6}from"@ehfuse/mui-form-dialog";import{LabelSelect as k6,NumberField as am}from"@ehfuse/mui-form-controls";import S6 from"@ehfuse/overlay-scrollbar";import{jsx as Wr,jsxs as Hs}from"react/jsx-runtime";var T6=[{value:"count",label:"\uBBF8\uC644\uB8CC \uAC74\uC218"},{value:"points",label:"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8"}];function lm({open:e,capacity:p,employees:b,onClose:l,onSave:i}){let[s,r]=v6(p??no);x6(()=>{e&&r(p??no)},[e,p]);let t=s.basis==="points"?"SP":"\uAC74",n=(c,o)=>{let a=Math.max(0,Math.floor(Number(o)||0));r(d=>{let f={...d.by_account};return a>0?f[c]=a:delete f[c],{...d,by_account:f}})};return Wr(_6,{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:Wr(w6,{variant:"contained",onClick:()=>{i(s)},children:"\uC800\uC7A5"})},sectionContentPaddingTop:0,sections:[{id:"capacity",title:"",showTitle:!1,children:Hs(Jr,{sx:{display:"flex",flexDirection:"column",gap:2},children:[Wr(Jr,{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."}),Hs(Jr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Wr(Jr,{sx:{width:104,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uC138\uB294 \uB2E8\uC704"}),Wr(k6,{size:"medium",fullWidth:!0,label:"",value:s.basis,options:T6,onChange:c=>r(o=>({...o,basis:c.target.value}))})]}),Hs(Jr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Wr(Jr,{sx:{width:104,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uAE30\uBCF8 \uC6A9\uB7C9"}),Wr(am,{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))}))})]}),Wr(Jr,{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`}),Wr(Jr,{sx:{fontSize:16,fontWeight:700,color:"#37352f"},children:"\uC0AC\uB78C\uBCC4 \uC608\uC678"}),b.length===0?Wr(Jr,{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."}):Wr(Jr,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:Wr(S6,{style:{maxHeight:260},thumb:{width:6},children:b.filter(c=>Number(c.account_seq)>0).map(c=>Hs(Jr,{sx:{display:"flex",alignItems:"center",gap:1.5,px:2,py:1,borderBottom:"1px solid #f2f2f0","&:last-of-type":{borderBottom:"none"}},children:[Hs(Jr,{sx:{flex:1,minWidth:0,fontSize:16,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[c.name,c.department?Wr(Jr,{component:"span",sx:{ml:1,fontSize:14,color:"#787774"},children:c.department}):null]}),Wr(Jr,{sx:{width:132,flexShrink:0},children:Wr(am,{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 Ol}from"@mui/material";import{Bar as E6,BarChart as M6,CartesianGrid as R6,Cell as O6,ReferenceLine as A6,ResponsiveContainer as D6,Tooltip as P6,XAxis as N6,YAxis as L6}from"recharts";import{Box as C6}from"@mui/material";import{jsx as B6}from"react/jsx-runtime";function Ur({text:e,height:p}){return B6(C6,{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 I6}from"react";var Rl="#2f80ed",cm="#a9c9f5",vi="#9a9a97",Vu="#2e9e6b",Xn="#3d7eff",Ku="#c3c8ce",Ws="#f2a30f",Us={contentStyle:{fontSize:13.5,color:"#37352f",border:"1px solid #e6e6e3",borderRadius:6},labelStyle:{fontSize:13.5,color:"#37352f",fontWeight:700},itemStyle:{fontSize:13.5}},Ji={...Us,cursor:!1},Qi={wrapperStyle:{fontSize:13.5,paddingTop:10},formatter:e=>I6("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 Zn(e){return{"& *":{outline:"none"},userSelect:"none",...typeof e=="number"?{height:e,flexShrink:0}:{flex:1,minHeight:0}}}import{jsx as On,jsxs as Vs}from"react/jsx-runtime";function j6(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 um({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,...j6(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?On(Ur,{text:"\uD45C\uC2DC\uD560 \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:b}):Vs(Ol,{sx:dr(b),children:[Vs(Ol,{sx:{flexShrink:0,mb:1,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Vs("span",{children:["\uC644\uB8CC ",s?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uBAA9\uD45C\uBCC4"]}),n!==null?Vs("span",{children:["\uD3C9\uADE0(\uC885\uB8CC \uBAA9\uD45C)"," ",On(Ol,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:n}),r]}):null]}),On(Ol,{sx:Zn(b),children:On(D6,{width:"100%",height:"100%",children:Vs(M6,{data:c,margin:{top:8,right:12,left:0,bottom:0},barCategoryGap:"28%",children:[On(R6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),On(N6,{dataKey:"\uBAA9\uD45C",tick:{fontSize:13},tickMargin:6,interval:0}),On(L6,{tick:{fontSize:13},width:40,allowDecimals:!1}),On(P6,{...Ji,formatter:o=>`${Number(o??0)}${r}`}),n!==null?On(A6,{y:n,stroke:vi,strokeDasharray:"6 5",label:{value:`\uD3C9\uADE0 ${n}${r}`,position:"right",fontSize:13}}):null,On(E6,{dataKey:"\uC644\uB8CC",radius:[4,4,0,0],children:c.map(o=>On(O6,{fill:o.closed?Rl:cm},o.\uBAA9\uD45C))})]})})})]})}import{useMemo as z6}from"react";import{Box as Jn}from"@mui/material";import{CartesianGrid as F6,Line as dm,LineChart as q6,ResponsiveContainer as $6,Tooltip as H6,XAxis as W6,YAxis as U6}from"recharts";import{jsx as Qr,jsxs as Yo}from"react/jsx-runtime";function fm(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?new Date(`${e}T00:00:00`):null}function V6(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function K6(e){return e.slice(5).replace("-",".")}function hm({sprint:e,tasks:p,todayStr:b,height:l=200,headerLeft:i}){let s=z6(()=>{let a=fm(e.start_date),d=fm(e.end_date);if(!a||!d||d<a||Math.round((d.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,N)=>P+m(N),0),_=new Map;for(let P of u){if(!P.completed)continue;let N=(P.completed_time??"").slice(0,10),q=/^\d{4}-\d{2}-\d{2}$/.test(N)?N:e.start_date;_.set(q,(_.get(q)??0)+m(P))}let B=[];for(let P=new Date(a);P<=d;P.setDate(P.getDate()+1))B.push(V6(P));let A=x,j=x;return{empty:!1,data:B.map((P,N)=>{let q=B.length===1?0:x*(1-N/(B.length-1));return P<=b&&(A-=_.get(P)??0,j=Math.max(0,A)),{\uB0A0\uC9DC:K6(P),\uC774\uC0C1:Math.round(q*10)/10,\uB0A8\uC740\uB7C9:P<=b?Math.max(0,A):null}}),total:x,usePoints:g,last:j}},[e,p,b]);if(!s)return Yo(Jn,{sx:dr(l),children:[i?Qr(Jn,{sx:Ar,children:i}):null,Qr(Ur,{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 Yo(Jn,{sx:dr(l),children:[i?Qr(Jn,{sx:Ar,children:i}):null,Qr(Ur,{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 Yo(Jn,{sx:dr(l),children:[Yo(Jn,{sx:Ar,children:[i?Qr(Jn,{sx:{flexShrink:0},children:i}):null,Yo(Jn,{sx:{flex:1,minWidth:220,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Yo("span",{children:["\uB0A8\uC740 ",n?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uCD1D ",t]}),Yo("span",{children:["\uD604\uC7AC"," ",Qr(Jn,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:c}),o," \uB0A8\uC74C"]})]})]}),Qr(Jn,{sx:Zn(l),children:Qr($6,{width:"100%",height:"100%",children:Yo(q6,{data:r,margin:{top:8,right:12,left:0,bottom:0},children:[Qr(F6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Qr(W6,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),Qr(U6,{tick:{fontSize:13},width:40,allowDecimals:!1}),Qr(H6,{...Us,formatter:a=>`${Number(a??0)}${o}`}),Qr(dm,{type:"linear",dataKey:"\uC774\uC0C1",stroke:vi,strokeDasharray:"6 5",strokeWidth:1.5,dot:!1}),Qr(dm,{type:"monotone",dataKey:"\uB0A8\uC740\uB7C9",stroke:Rl,strokeWidth:2.5,dot:!1,connectNulls:!1})]})})})]})}import{useMemo as vm}from"react";import{Box as Qn}from"@mui/material";import{Area as Xu,AreaChart as Z6,CartesianGrid as J6,Legend as Q6,ResponsiveContainer as ek,Tooltip as tk,XAxis as rk,YAxis as nk}from"recharts";function Co(e){let p=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())}`}function Al(e,p=new Date){let b=new Date(p);return b.setMonth(b.getMonth()-e),b}function _$(e=new Date){return{fromDate:Co(Al(1,e)),toDate:Co(e)}}var Yu=864e5,Ks=[0,1,2,3,5,8,13,21];function gm(e){return!e.archived&&!e.linked_only&&!e.is_notice&&!e.is_event}function Gu(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 es(e){let p=String(e??"").trim();return/^\d{4}-\d{2}-\d{2}/.test(p)?p.slice(0,10):""}function G6(e){let p=es(e.created_time)||es(e.start_date)||es(e.completed_time);if(!p)return null;let b=es(e.start_date),l=b&&b>p?b:p,i=e.completed?es(e.completed_time)||p:"";return{created:p,started:l,done:i}}function bm(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*Yu)));return i}function ym(e,p,b){let l=bm(p,b),i=e.filter(gm).map(G6).filter(n=>n!==null),s=l.map(n=>{let c=0,o=0,a=0;for(let d of i)d.created>n||(d.done&&d.done<=n?c+=1:d.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 Y6(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 pm(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(Y6(p,.85))}}function mm(e){for(let p=Ks.length-1;p>=0;p-=1)if(e>=Ks[p])return p;return 0}function X6(){return Ks.map((e,p)=>p===Ks.length-1?`${e}\uC77C+`:`${e}~${Ks[p+1]}\uC77C`)}function xm(e,p,b){let l=bm(p,b),i=l[0],s=l[l.length-1],r=X6(),t=r.map(()=>0),n=r.map(()=>0),c=[],o=[];for(let a of e){if(!gm(a)||!a.completed)continue;let d=es(a.completed_time);if(!d||d<i||d>s)continue;let f=Gu(a.completed_time),u=Gu(a.created_time);if(f===null||u===null)continue;let g=Math.max(0,(f-u)/Yu);c.push(g),t[mm(g)]+=1;let m=Gu(a.start_date);if(m===null||m>f)continue;let x=Math.max(0,(f-Math.max(m,u))/Yu);o.push(x),n[mm(x)]+=1}return{labels:r,leadCounts:t,cycleCounts:n,lead:pm(c),cycle:pm(o)}}import{jsx as Vr,jsxs as Xo}from"react/jsx-runtime";function ok(e){return e.slice(5).replace("-",".")}function wm({tasks:e,todayStr:p,days:b=30,height:l=220,headerLeft:i}){let s=vm(()=>ym(e,b,p),[e,b,p]),r=vm(()=>s.points.map(n=>({\uB0A0\uC9DC:ok(n.day),\uC644\uB8CC:n.done,\uC9C4\uD589:n.inProgress,\uB300\uAE30:n.waiting})),[s]),t=Xo(Qn,{sx:Ar,children:[i?Vr(Qn,{sx:{flexShrink:0},children:i}):null,Xo(Qn,{sx:{flex:1,minWidth:220,display:"flex",flexDirection:"column",gap:.5},children:[Xo(Qn,{sx:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Xo("span",{children:["\uCD5C\uADFC ",s.points.length,"\uC77C \u2014 \uC811\uC218 ",s.currentTotal,"\uAC74 / \uC644\uB8CC ",s.currentDone,"\uAC74"]}),Xo("span",{children:["\uC9C4\uD589 \uC911"," ",Vr(Qn,{component:"span",sx:{color:Xn,fontWeight:700},children:s.currentWip}),"\uAC74"]})]}),Vr(Qn,{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?Xo(Qn,{sx:dr(l),children:[i?Vr(Qn,{sx:Ar,children:i}):null,Vr(Ur,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC811\uC218\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]}):Xo(Qn,{sx:dr(l),children:[t,Vr(Qn,{sx:Zn(l),children:Vr(ek,{width:"100%",height:"100%",children:Xo(Z6,{data:r,margin:{top:8,right:12,left:0,bottom:4},children:[Vr(J6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Vr(rk,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),Vr(nk,{tick:{fontSize:13},width:40,allowDecimals:!1}),Vr(tk,{...Us,formatter:n=>`${Number(n??0)}\uAC74`}),Vr(Q6,{...Qi}),Vr(Xu,{type:"monotone",dataKey:"\uC644\uB8CC",stackId:"flow",stroke:Vu,fill:Vu,fillOpacity:.9}),Vr(Xu,{type:"monotone",dataKey:"\uC9C4\uD589",stackId:"flow",stroke:Xn,fill:Xn,fillOpacity:.85}),Vr(Xu,{type:"monotone",dataKey:"\uB300\uAE30",stackId:"flow",stroke:Ku,fill:Ku,fillOpacity:.9})]})})})]})}import{useMemo as _m}from"react";import{Box as en}from"@mui/material";import{Bar as km,BarChart as ik,CartesianGrid as sk,Legend as ak,ResponsiveContainer as lk,Tooltip as ck,XAxis as uk,YAxis as dk}from"recharts";import{jsx as xr,jsxs as yn}from"react/jsx-runtime";function Sm({label:e,color:p,summary:b}){let l=yn(en,{sx:{display:"flex",alignItems:"center",gap:.75},children:[xr(en,{sx:{width:10,height:10,borderRadius:.5,bgcolor:p,flexShrink:0}}),xr(en,{component:"span",sx:{fontWeight:700,color:"#37352f"},children:e})]});return b?yn(en,{sx:{display:"contents"},children:[l,yn("span",{children:[b.count,"\uAC74"]}),yn("span",{children:["\uC911\uC559\uAC12"," ",xr(en,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:b.median}),"\uC77C"]}),yn("span",{children:["\uD3C9\uADE0 ",b.average,"\uC77C"]}),yn("span",{children:["85% ",b.p85,"\uC77C \uC774\uB0B4"]})]}):yn(en,{sx:{display:"contents"},children:[l,xr(en,{component:"span",sx:{gridColumn:"span 4",color:"#9a9a97"},children:"\uD45C\uBCF8 \uC5C6\uC74C"})]})}function Tm({tasks:e,todayStr:p,days:b=30,height:l=200,headerLeft:i}){let s=_m(()=>xm(e,b,p),[e,b,p]),r=_m(()=>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?yn(en,{sx:dr(l),children:[yn(en,{sx:Ar,children:[i?xr(en,{sx:{flexShrink:0},children:i}):null,yn(en,{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:[xr(Sm,{label:"\uB9AC\uB4DC\uD0C0\uC784(\uC791\uC131\u2192\uC644\uB8CC)",color:Xn,summary:s.lead}),xr(Sm,{label:"\uC0AC\uC774\uD074\uD0C0\uC784(\uC2DC\uC791\u2192\uC644\uB8CC)",color:Ws,summary:s.cycle})]})]}),xr(en,{sx:Zn(l),children:xr(lk,{width:"100%",height:"100%",children:yn(ik,{data:r,margin:{top:8,right:12,left:0,bottom:4},barCategoryGap:"24%",children:[xr(sk,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),xr(uk,{dataKey:"\uAD6C\uAC04",tick:{fontSize:13},tickMargin:6,interval:0}),xr(dk,{tick:{fontSize:13},width:40,allowDecimals:!1}),xr(ck,{...Ji,formatter:t=>`${Number(t??0)}\uAC74`}),xr(ak,{...Qi}),xr(km,{dataKey:"\uB9AC\uB4DC\uD0C0\uC784",fill:Xn,radius:[3,3,0,0]}),xr(km,{dataKey:"\uC0AC\uC774\uD074\uD0C0\uC784",fill:Ws,radius:[3,3,0,0]})]})})})]}):yn(en,{sx:dr(l),children:[i?xr(en,{sx:Ar,children:i}):null,xr(Ur,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC644\uB8CC\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]})}import{useMemo as Em}from"react";import{Box as wi}from"@mui/material";import{Bar as Ju,BarChart as gk,CartesianGrid as bk,Cell as yk,Legend as xk,ReferenceLine as Mm,ResponsiveContainer as vk,Tooltip as wk,XAxis as _k,YAxis as kk}from"recharts";function fk(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 hk(e,p,b){let l=String(e.due_date??"").slice(0,10),i=fk(p,l);return i===null?"later":i<0?"overdue":i<=b?"soon":"later"}function Dl(e,p){let{todayStr:b,soonDays:l=7,includeUnassigned:i=!0,limit:s,capacity:r}=p,t=r??no,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 d=a?String(o.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",f=n.get(a)??{accountSeq:a,name:d,overdue:0,soon:0,later:0,total:0,points:0,capacity:0,load:0,ratio:0};f[hk(o,b,l)]+=1,f.total+=1,f.points+=Number(o.story_points??0)||0,n.set(a,f)}for(let o of n.values())o.capacity=pk(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 Pl(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 pk(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 Nl(e){return e.capacity>0&&e.load>e.capacity}function Cm(e,p){return p>0&&e.total>=p}function Bm(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 Zu(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 mk(e){let p=new Date(`${e}T00:00:00`);if(Number.isNaN(p.getTime()))return e;let b=(p.getDay()+6)%7;return Zu(e,-b)}function Im(e,p){let{todayStr:b,includeUnassigned:l=!0,weeks:i=6,limit:s}=p,r=mk(b),t=Array.from({length:Math.max(1,i)},(f,u)=>{let g=Zu(r,u*7),m=Zu(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 f of e){if(f.completed||f.archived||f.is_notice||f.is_event||f.linked_only)continue;let u=Number(f.manager_account_seq??0);if(!u&&!l)continue;let g=u?String(f.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(f.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((f,u)=>f.accountSeq===0!=(u.accountSeq===0)?f.accountSeq===0?1:-1:f.overdue!==u.overdue?u.overdue-f.overdue:f.total!==u.total?u.total-f.total:f.name.localeCompare(u.name)),a=typeof s=="number"&&s>0?o.slice(0,s):o,d=a.reduce((f,u)=>Math.max(f,u.overdue,u.noDue,...u.byWeek),0);return{weeks:t,rows:a,maxCell:d}}import{Fragment as Rm,jsx as vr,jsxs as Zo}from"react/jsx-runtime";var Gs="#e5484d";function Om({tasks:e,todayStr:p,soonDays:b=7,overloadThreshold:l=0,capacity:i=no,height:s=200,headerLeft:r,selectedAccountSeq:t=0,onSelectPerson:n}){let c=Em(()=>Dl(e,{todayStr:p,soonDays:b,capacity:i}),[e,p,b,i]),o=Em(()=>Bm(c),[c]),a=l>0?l:Math.max(3,Math.ceil(o*1.5)),d=i.default_capacity>0||Object.keys(i.by_account).length>0,f=i.basis==="points"?"SP":"\uAC74",u=c.filter(g=>g.accountSeq>0&&(d?Nl(g):Cm(g,a))).length;return c.length===0?Zo(wi,{sx:dr(s),children:[r?vr(wi,{sx:Ar,children:r}):null,vr(Ur,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:s})]}):Zo(wi,{sx:dr(s),children:[Zo(wi,{sx:Ar,children:[r,Zo(wi,{sx:{fontSize:13.5,color:"#37352f"},children:["1\uC778 \uD3C9\uADE0 ",vr("b",{children:o.toFixed(1)}),"\uAC74 \xB7"," ",d?Zo(Rm,{children:["\uC6A9\uB7C9 ",vr("b",{children:i.default_capacity||"\uAC1C\uC778\uBCC4"}),i.default_capacity?f:""]}):Zo(Rm,{children:["\uACFC\uBD80\uD558 \uAE30\uC900 ",vr("b",{children:a}),"\uAC74"]}),u>0?Zo(wi,{component:"span",sx:{ml:1,color:Gs,fontWeight:700},children:["\uCD08\uACFC ",u,"\uBA85"]}):null]})]}),vr(wi,{sx:Zn(s),children:vr(vk,{width:"100%",height:"100%",children:Zo(gk,{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:[vr(bk,{strokeDasharray:"3 3",horizontal:!1,stroke:"#eceae6"}),vr(_k,{type:"number",allowDecimals:!1,tick:{fontSize:12}}),vr(kk,{type:"category",dataKey:"name",width:84,tick:{fontSize:12},interval:0}),vr(wk,{...Ji,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}${f} \uC911 ${m.load} (${Math.round(m.ratio*100)}%)`}}),vr(xk,{...Qi}),o>0?vr(Mm,{x:o,stroke:vi,strokeDasharray:"4 4",label:{value:"\uD3C9\uADE0",position:"top",fontSize:11,fill:vi}}):null,i.default_capacity>0?vr(Mm,{x:i.default_capacity,stroke:Gs,strokeDasharray:"2 3",label:{value:"\uC6A9\uB7C9",position:"top",fontSize:11,fill:Gs}}):null,vr(Ju,{dataKey:"overdue",name:"\uC9C0\uC5F0",stackId:"load",fill:Gs}),vr(Ju,{dataKey:"soon",name:`\uC784\uBC15(${b}\uC77C)`,stackId:"load",fill:Ws}),vr(Ju,{dataKey:"later",name:"\uC5EC\uC720",stackId:"load",fill:Xn,radius:[0,3,3,0],children:c.map(g=>vr(yk,{fill:d&&Nl(g)?Gs:Xn,fillOpacity:d&&Nl(g)?.45:1,stroke:g.accountSeq===t?"#37352f":void 0,strokeWidth:g.accountSeq===t?1.5:0},g.accountSeq))})]})})})]})}import{useEffect as Rk,useState as Ok}from"react";import{Box as Ak,Button as Dk}from"@mui/material";import{FormDialog as Pk}from"@ehfuse/mui-form-dialog";import{useState as Sk}from"react";import{Box as fr,Button as Tk,Menu as Ck,MenuItem as Bk}from"@mui/material";import Ik from"@mui/icons-material/PersonOutlineOutlined";import Ek from"@ehfuse/overlay-scrollbar";import{jsx as Tr,jsxs as Bo}from"react/jsx-runtime";var Am=56,Dm=68,Pm=96;function Mk(e){let p=String(e.due_date??"").slice(0,10);return p?p.slice(5).replace("-","/"):"-"}function Nm(e,p){let b=String(e.due_date??"").slice(0,10);return!!b&&b<p}function Lm({tasks:e,row:p,todayStr:b,employees:l,rows:i,height:s=200,hideSummary:r=!1,onChangeManager:t,onOpenTask:n}){let[c,o]=Sk(null),a=Pl(e,p.accountSeq),d=f=>i.find(u=>u.accountSeq===f)?.total??0;return Bo(fr,{sx:{display:"flex",flexDirection:"column",minHeight:0,height:s},children:[r?null:Bo(fr,{sx:{display:"flex",alignItems:"center",gap:1,px:.5,pb:.75,fontSize:14,color:"#37352f"},children:[Tr(fr,{component:"span",sx:{fontWeight:700},children:p.name}),Bo(fr,{component:"span",children:["\uBBF8\uC644\uB8CC ",a.length,"\uAC74"]}),p.capacity>0?Bo(fr,{component:"span",sx:{color:p.load>p.capacity?"#e5484d":"#787774"},children:["\xB7 \uC6A9\uB7C9 ",p.capacity," \uC911 ",p.load]}):null]}),Bo(fr,{sx:{flex:1,minHeight:0,display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:[Bo(fr,{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:[Tr(fr,{sx:{width:Am,flexShrink:0},children:"\uB9C8\uAC10"}),Tr(fr,{sx:{flex:1,minWidth:0},children:"\uC5C5\uBB34"}),Tr(fr,{sx:{width:Dm,flexShrink:0,textAlign:"center"},children:"\uC911\uC694\uB3C4"}),t?Tr(fr,{sx:{width:Pm,flexShrink:0,textAlign:"center"},children:"\uCC45\uC784\uC790"}):null]}),Tr(fr,{sx:{flex:1,minHeight:0},children:Tr(Ek,{style:{height:"100%"},thumb:{width:6},children:a.length===0?Tr(fr,{sx:{p:2,fontSize:14,color:"#9a9a97"},children:"\uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):a.map(f=>Bo(fr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1.5,borderBottom:"1px solid #f2f2f0"},children:[Tr(fr,{sx:{width:Am,flexShrink:0,fontSize:13.5,color:Nm(f,b)?"#e5484d":"#787774",fontWeight:Nm(f,b)?700:400},children:Mk(f)}),Tr(fr,{onClick:n?()=>n(f.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:f.title}),Tr(fr,{sx:{width:Dm,flexShrink:0,display:"flex",justifyContent:"center"},children:Tr(Lr,{priority:f.priority})}),t?Tr(fr,{sx:{width:Pm,flexShrink:0,display:"flex",justifyContent:"center"},children:Tr(Tk,{size:"small",variant:"outlined",startIcon:Tr(Ik,{sx:{fontSize:17}}),onClick:u=>o({el:u.currentTarget,taskSeq:f.seq}),children:"\uC62E\uAE30\uAE30"})}):null]},f.seq))})})]}),Tr(Ck,{anchorEl:c?.el??null,open:!!c,onClose:()=>o(null),transitionDuration:0,children:l.filter(f=>Number(f.account_seq)>0&&Number(f.account_seq)!==p.accountSeq).map(f=>Bo(Bk,{onClick:()=>{c&&t&&t(c.taskSeq,Number(f.account_seq),f.name),o(null)},sx:{fontSize:14,minWidth:200},children:[Tr(fr,{sx:{flex:1},children:f.name}),Bo(fr,{component:"span",sx:{ml:2,fontSize:13,color:"#787774"},children:[d(Number(f.account_seq)),"\uAC74"]})]},f.account_seq))})]})}import{jsx as Ll}from"react/jsx-runtime";function jm({open:e,row:p,rows:b,tasks:l,todayStr:i,employees:s,onClose:r,onChangeManager:t,onOpenTask:n}){let[c,o]=Ok(p);Rk(()=>{p&&o(p)},[p]);let a=p??c,d=a?Pl(l,a.accountSeq).length:0;return Ll(Pk,{open:e,onClose:r,maxWidth:"sm",title:a?`${a.name} \uC5C5\uBB34 (${d})`:"\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:Ll(Dk,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})},sections:[{id:"person-tasks",title:"",showTitle:!1,children:Ll(Ak,{sx:{minHeight:0},children:a?Ll(Lm,{tasks:l,row:a,rows:b,todayStr:i,employees:s,height:"min(420px, 52vh)",hideSummary:!0,onChangeManager:t,onOpenTask:n}):null})}]})}import{useMemo as Nk}from"react";import{Box as an,Tooltip as Lk}from"@mui/material";import{OverlayScrollbar as jk}from"@ehfuse/overlay-scrollbar";import{jsx as Kr,jsxs as zl}from"react/jsx-runtime";var zm="#e5484d",zk="#2f80ed",Fk="#9a9a97",Qu=30,qk=96,jl=56;function ed({count:e,max:p,color:b,title:l}){let i=e>0&&p>0?.18+e/p*.72:0;return Kr(Lk,{title:l,arrow:!0,disableInteractive:!0,placement:"top",children:Kr(an,{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 Fm({tasks:e,todayStr:p,weeks:b=6,height:l=200}){let i=Nk(()=>Im(e,{todayStr:p,weeks:b}),[e,p,b]);if(i.rows.length===0)return Kr(an,{sx:dr(l),children:Kr(Ur,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})});let s=`${qk}px ${jl}px repeat(${i.weeks.length}, minmax(${jl}px, 1fr)) ${jl}px ${jl}px`,r={height:Qu,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 Kr(an,{sx:dr(l),children:Kr(jk,{style:{height:"100%"},thumb:{width:8},children:zl(an,{sx:{display:"grid",gridTemplateColumns:s,minWidth:"fit-content",height:"100%",gridTemplateRows:`${Qu}px repeat(${i.rows.length}, minmax(${Qu}px, 1fr))`},children:[Kr(an,{sx:{...r,justifyContent:"flex-start",pl:1},children:"\uB2F4\uB2F9\uC790"}),Kr(an,{sx:{...r,color:zm},children:"\uC9C0\uC5F0"}),i.weeks.map(t=>Kr(an,{sx:{...r,...t.isCurrent?{borderBottom:"2px solid #2f80ed"}:{}},children:t.label},t.start)),Kr(an,{sx:r,children:"\uB9C8\uAC10\uC5C6\uC74C"}),Kr(an,{sx:r,children:"\uD569\uACC4"}),i.rows.map(t=>zl(an,{sx:{display:"contents"},children:[Kr(an,{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}),Kr(ed,{count:t.overdue,max:i.maxCell,color:zm,title:`${t.name} \xB7 \uC9C0\uC5F0 ${t.overdue}\uAC74`}),t.byWeek.map((n,c)=>Kr(ed,{count:n,max:i.maxCell,color:zk,title:`${t.name} \xB7 ${i.weeks[c].label} \uC8FC \uB9C8\uAC10 ${n}\uAC74`},i.weeks[c].start)),Kr(ed,{count:t.noDue,max:i.maxCell,color:Fk,title:`${t.name} \xB7 \uB9C8\uAC10 \uBBF8\uC815 ${t.noDue}\uAC74`}),zl(an,{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?zl(an,{component:"span",sx:{ml:.25,fontSize:10.5,color:"#9a9a97"},children:["(+",t.beyond,")"]}):null]})]},t.accountSeq))]})})})}import{Fragment as Hm,jsx as Jt,jsxs as Fl}from"react/jsx-runtime";var Wm="min(560px, 62vh)",Uk=`calc(${Wm} - 4px)`,Vk=[{value:"30",label:"\uCD5C\uADFC 30\uC77C"},{value:"60",label:"\uCD5C\uADFC 60\uC77C"},{value:"90",label:"\uCD5C\uADFC 90\uC77C"}];function FH({open:e,sprints:p,tasks:b,todayStr:l,showSprintCharts:i,capacity:s=no,capacityEmployees:r=[],onSaveCapacity:t,onChangeTaskManager:n,onOpenTask:c,initialSprintSeq:o=0,onClose:a}){let[d,f]=Ys(0),[u,g]=Ys(30);$k(()=>{if(!e)return;let y=p.find(w=>w.status==="active")??p[0],v=p.find(w=>w.seq===o)??y;f(v?.seq??0)},[e]);let m=qm(()=>p.find(y=>y.seq===d)??null,[p,d]),x={height:Uk,boxSizing:"border-box",px:3,py:2.5,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden"},_=Jt(td,{label:"\uBAA9\uD45C",showLabel:!1,showEmptyOption:!1,value:d?String(d):"",options:p.map(y=>({value:String(y.seq),label:pn(y)})),onChange:y=>f(Number(y.target.value)||0),sx:{width:280,flexShrink:0}}),[B,A]=Ys("distribution"),j=Jt(td,{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=>A(y.target.value==="timeline"?"timeline":"distribution"),sx:{width:280,flexShrink:0}}),[D,P]=Ys(!1),[N,q]=Ys(0),z=qm(()=>Dl(b,{todayStr:l,capacity:s}),[b,l,s]),T=z.find(y=>y.accountSeq===N)??null,C=Fl(Hm,{children:[j,t?Jt($m,{size:"small",variant:"outlined",startIcon:Jt(Wk,{sx:{fontSize:18}}),onClick:()=>P(!0),sx:{flexShrink:0},children:"\uC6A9\uB7C9"}):null]}),R=i??p.length>0,h=Jt(td,{label:"\uAE30\uAC04",showLabel:!1,showEmptyOption:!1,value:String(u),options:Vk,onChange:y=>g(Number(y.target.value)||30),sx:{width:280,flexShrink:0}});return Fl(Hm,{children:[Jt(Hk,{open:e,onClose:a,maxWidth:"md",title:"\uC5C5\uBB34 \uCC28\uD2B8",locale:"ko",contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,sectionTitleGap:0,fixedHeight:Wm,contentBottomPadding:0,scrollPastLastSection:!1,tabs:{visible:!0,switchContent:!0,fullWidth:!0},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-charts",sections:[...R?[{id:"velocity",tabTitle:"\uBCA8\uB85C\uC2DC\uD2F0",showTitle:!1,children:Jt(Io,{sx:x,children:Jt(um,{sprints:p,tasks:b,height:"100%"})})},{id:"burndown",tabTitle:"\uBC88\uB2E4\uC6B4",showTitle:!1,children:Jt(Io,{sx:x,children:m?Jt(hm,{sprint:m,tasks:b,todayStr:l,height:"100%",headerLeft:_}):Fl(Io,{sx:dr("100%"),children:[Jt(Io,{sx:Ar,children:_}),Jt(Ur,{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(wm,{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"?Fl(Io,{sx:{display:"flex",flexDirection:"column",height:"100%",minHeight:0},children:[Jt(Io,{sx:Ar,children:C}),Jt(Fm,{tasks:b,todayStr:l,height:"100%"})]}):Jt(Om,{tasks:b,todayStr:l,height:"100%",capacity:s,headerLeft:C,selectedAccountSeq:N,onSelectPerson:n?q:void 0})})},{id:"lead-time",tabTitle:"\uB9AC\uB4DC\uD0C0\uC784",showTitle:!1,children:Jt(Io,{sx:x,children:Jt(Tm,{tasks:b,todayStr:l,days:u,height:"100%",headerLeft:h})})}],actions:{showCancelButton:!1,right:Jt($m,{variant:"contained",onClick:a,children:"\uB2EB\uAE30"})}}),Jt(jm,{open:N>0,row:T,rows:z,tasks:b,todayStr:l,employees:r,onClose:()=>q(0),onChangeManager:n,onOpenTask:c}),t?Jt(lm,{open:D,capacity:s,employees:r,onClose:()=>P(!1),onSave:async y=>{await t(y),P(!1)}}):null]})}import{Checkbox as Kk,Divider as Gk,Menu as Yk,MenuItem as rd}from"@mui/material";import{jsx as Xs,jsxs as Um}from"react/jsx-runtime";function UH({anchorEl:e,candidates:p,selectedNames:b,avatarSrcByName:l,onToggle:i,onClear:s,onClose:r}){return Um(Yk,{anchorEl:e,open:!!e,onClose:r,transitionDuration:0,children:[p.length===0?Xs(rd,{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 Um(rd,{onClick:()=>i(t),sx:{fontSize:14,minWidth:170,gap:1},children:[Xs(Kk,{size:"small",checked:n,sx:{p:0}}),Xs(jr,{names:[t.name],size:20,avatarSrcByName:l}),t.name]},`${t.accountSeq}-${t.name}`)}),Xs(Gk,{}),Xs(rd,{disabled:b.length===0,onClick:s,sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{useState as Xk}from"react";import{ButtonBase as Zk,Menu as Jk,MenuItem as Qk}from"@mui/material";import e8 from"@mui/icons-material/KeyboardArrowDown";import t8 from"@mui/icons-material/Check";import{Fragment as r8,jsx as nd,jsxs as od}from"react/jsx-runtime";function QH({value:e,onChange:p,options:b}){let[l,i]=Xk(null),s=b??bc,r=bc.find(t=>t.value===e)?.label??"";return od(r8,{children:[od(Zk,{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,nd(e8,{sx:{fontSize:17,color:"#9a9a97"}})]}),nd(Jk,{transitionDuration:0,anchorEl:l,open:!!l,onClose:()=>i(null),children:s.map(t=>od(Qk,{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?nd(t8,{sx:{fontSize:16,color:"#2f80ed"}}):null]},t.value))})]})}import{Box as ql,ButtonBase as n8}from"@mui/material";import{DateTextField as Vm}from"@ehfuse/mui-form-controls";import{jsx as Zs,jsxs as Km}from"react/jsx-runtime";var o8=[{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 Gm({fromDate:e,toDate:p,onChange:b}){let l=s=>{if(s<=0){b("","");return}b(Co(Al(s)),Co(new Date))},i=s=>s<=0?!e&&!p:!e||!p?!1:e===Co(Al(s))&&p===Co(new Date);return Km(ql,{sx:{display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[Zs(ql,{sx:{display:"flex",alignItems:"center",gap:1.5},children:o8.map(s=>{let r=i(s.months);return Zs(n8,{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)})}),Km(ql,{sx:{display:"flex",alignItems:"center",gap:.5},children:[Zs(Vm,{value:e,size:"small",placeholder:"\uC2DC\uC791\uC77C",onChange:s=>b(s.target.value,p),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}}),Zs(ql,{component:"span",sx:{fontSize:13,color:"#9a9a97"},children:"~"}),Zs(Vm,{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 i8}from"@mui/material";import{jsx as Ym}from"react/jsx-runtime";function cW({anchorEl:e,fromDate:p,toDate:b,onChange:l,onClose:i}){return Ym(i8,{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:Ym(Gm,{fromDate:p,toDate:b,onChange:l})})}import{Box as s8,ButtonBase as a8,Tab as l8,Tabs as c8}from"@mui/material";import u8 from"@mui/icons-material/Checklist";import d8 from"@mui/icons-material/Face";import f8 from"@mui/icons-material/Publish";import h8 from"@mui/icons-material/NotificationsOutlined";import p8 from"@mui/icons-material/BugReportOutlined";import m8 from"@mui/icons-material/DescriptionOutlined";import g8 from"@mui/icons-material/Inventory2Outlined";import{jsx as An}from"react/jsx-runtime";function Xm(e,p){return p>0?`${e} (${p})`:e}var _W=[{id:"my",label:"\uC804\uCCB4",icon:An(u8,{sx:{fontSize:18}})},{id:"mine",label:"\uB0B4 \uC5C5\uBB34",icon:An(d8,{sx:{fontSize:18}})},{id:"sent",label:"\uBCF4\uB0B8 \uC5C5\uBB34",icon:An(f8,{sx:{fontSize:18}})},{id:"bug",label:"\uC624\uB958",icon:An(p8,{sx:{fontSize:18}})},{id:"notice",label:"\uACF5\uC9C0\uC0AC\uD56D",icon:An(h8,{sx:{fontSize:18}})},{id:"archive",label:"\uBCF4\uAD00\uD568",icon:An(g8,{sx:{fontSize:18}}),hideCount:!0},{id:"report",label:"\uBCF4\uACE0\uC11C",icon:An(m8,{sx:{fontSize:18}}),hideCount:!0}];function b8(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 kW({items:e,activeTab:p,counts:b,onChange:l,compact:i=!1}){let s=ct(),r=b8(s.tabs),t=e;return i?An(s8,{sx:{display:"flex",flexWrap:"wrap",gap:1.25},children:t.map(n=>{let c=p===n.id;return An(a8,{onClick:()=>l(n.id),sx:{px:1.5,py:.75,borderRadius:1,fontSize:_r(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:Xm(n.label,n.hideCount?0:b[n.id]??0)},n.id)})}):An(c8,{value:p,onChange:(n,c)=>l(c),sx:{minHeight:46,"& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:"12px",minHeight:46}},children:t.map(n=>An(l8,{value:n.id,label:Xm(n.label,n.hideCount?0:b[n.id]??0),icon:n.icon,iconPosition:"start",sx:r},n.id))})}import{useEffect as y8,useMemo as x8,useState as id}from"react";import{Divider as $l,ListItemIcon as Gr,Menu as sd,MenuItem as wr}from"@mui/material";import v8 from"@mui/icons-material/OpenInNewOutlined";import w8 from"@mui/icons-material/RestoreFromTrashOutlined";import _8 from"@mui/icons-material/Check";import k8 from"@mui/icons-material/CheckCircleOutlined";import S8 from"@mui/icons-material/RadioButtonUnchecked";import T8 from"@mui/icons-material/SendOutlined";import C8 from"@mui/icons-material/EventOutlined";import B8 from"@mui/icons-material/PersonOutlineOutlined";import I8 from"@mui/icons-material/ViewKanbanOutlined";import E8 from"@mui/icons-material/ContentCopyOutlined";import M8 from"@mui/icons-material/NextPlanOutlined";import R8 from"@mui/icons-material/ContentPasteOutlined";import O8 from"@mui/icons-material/ShareOutlined";import A8 from"@mui/icons-material/DirectionsRunOutlined";import Zm from"@mui/icons-material/ChevronRight";import D8 from"@mui/icons-material/ArchiveOutlined";import P8 from"@mui/icons-material/UnarchiveOutlined";import{ConfirmDialog as Jm}from"@ehfuse/alerts";import{Fragment as Qm,jsx as ut,jsxs as hr}from"react/jsx-runtime";function eU({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:d,onCreateFollowUp:f,onShare:u,onAssignSprint:g,onArchiveToggle:m,onDelete:x,onRestore:_,onPurge:B}){let A=Nt(),j=Pn(),[D,P]=id(null),[N,q]=id(null),[z,T]=id(null);y8(()=>{e||(P(null),q(null),T(null))},[e]);let C=e?.task??null,R=!!C?.is_notice,h=!!C?.is_event,y=C?!so(C,i):!1,v=!!C?.deleted,w=x8(()=>new Set(b.filter(L=>L.useSprints).map(L=>L.key)),[b]),k=async(L="one")=>{let $=C;if(p(),!$)return;await Jm({title:"\uC5C5\uBB34 \uC0AD\uC81C",message:L==="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,L)},S=async()=>{let L=C;if(p(),!L)return;await Jm({title:"\uC601\uAD6C \uC0AD\uC81C",message:`"${L.title}" \uC5C5\uBB34\uB97C \uC601\uAD6C\uD788 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C? \uB418\uB3CC\uB9B4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.`})&&B?.(L.seq)},E=()=>{C&&m(C.seq,!C.archived),p()};return hr(Qm,{children:[hr(sd,{open:!!e,onClose:p,transitionDuration:0,anchorReference:A?"none":"anchorPosition",anchorPosition:!A&&e?{top:e.position.top,left:e.position.left}:void 0,slotProps:{paper:{sx:{minWidth:190,...A?{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxHeight:"70vh"}:{}}},list:A?{sx:{"& .MuiMenuItem-root":{py:1,minHeight:0}}}:void 0},children:[hr(wr,{onClick:()=>{C&&s(C),p()},sx:{fontSize:14},children:[ut(Gr,{children:ut(v8,{sx:{fontSize:19}})}),"\uC0C1\uC138 \uC5F4\uAE30"]}),v?ut($l,{}):null,v&&_?hr(wr,{onClick:()=>{C&&_(C.seq),p()},sx:{fontSize:14},children:[ut(Gr,{children:ut(w8,{sx:{fontSize:19}})}),"\uBCF5\uC6D0"]}):null,v&&B?hr(wr,{onClick:()=>{S()},sx:{fontSize:14,color:"#e5484d"},children:[ut(Gr,{children:ut(cr,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC601\uAD6C \uC0AD\uC81C"]}):null,v?null:hr(Qm,{children:[hr(wr,{disabled:R?(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(Gr,{children:C?.completed?ut(S8,{sx:{fontSize:19}}):ut(k8,{sx:{fontSize:19}})}),C?.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC"]}),!R&&t?hr(wr,{disabled:!(C?.manager_account_seq??0)&&(C?.receiver_account_seqs??[]).length===0,onClick:()=>{C&&t(C),p()},sx:{fontSize:14},children:[ut(Gr,{children:ut(T8,{sx:{fontSize:19}})}),"\uD655\uC778 \uC694\uCCAD"]}):null,h?null:ut($l,{}),h?null:hr(wr,{disabled:y,onClick:L=>{C&&P({anchorEl:L.currentTarget,task:C})},sx:{fontSize:14},children:[ut(Gr,{children:ut(C8,{sx:{fontSize:19}})}),"\uB9C8\uAC10\uC77C\uC2DC \uBCC0\uACBD"]}),!R&&!h&&o?hr(wr,{onClick:()=>{C&&o(C,"manager"),p()},sx:{fontSize:14},children:[ut(Gr,{children:ut(B8,{sx:{fontSize:19}})}),"\uCC45\uC784\uC790 \uBCC0\uACBD"]}):null,h?null:hr(wr,{disabled:y,onClick:L=>{C&&q({anchorEl:L.currentTarget,task:C})},sx:{fontSize:14},children:[ut(Gr,{children:ut(I8,{sx:{fontSize:19}})}),"\uD504\uB85C\uC81D\uD2B8 \uC774\uB3D9",ut(Zm,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}),ut($l,{}),d?hr(wr,{disabled:y,onClick:()=>{C&&d(C.seq),p()},sx:{fontSize:14},children:[ut(Gr,{children:ut(E8,{sx:{fontSize:19}})}),"\uBCF5\uC81C"]}):null,f&&C&&!C.is_event&&!C.is_notice?hr(wr,{onClick:()=>{C&&f(C.seq),p()},sx:{fontSize:14},children:[ut(Gr,{children:ut(M8,{sx:{fontSize:19}})}),"\uD6C4\uC18D \uC5C5\uBB34 \uB9CC\uB4E4\uAE30"]}):null,hr(wr,{onClick:()=>{C&&(u?u(C):Vi(C,A)),p()},sx:{fontSize:14},children:[ut(Gr,{children:A?ut(O8,{sx:{fontSize:19}}):ut(R8,{sx:{fontSize:19}})}),A?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC"]}),C&&!C.is_notice&&!C.is_event&&w.has(String(C.tab_key??""))&&g?hr(wr,{onClick:L=>T(L.currentTarget),sx:{fontSize:14},children:[ut(Gr,{children:ut(A8,{sx:{fontSize:19}})}),"\uBAA9\uD45C\uC5D0 \uB123\uAE30",ut(Zm,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}):null,hr(wr,{onClick:E,disabled:y||!C?.archived&&!(C&&ka(C)),sx:{fontSize:14},children:[ut(Gr,{children:C?.archived?ut(P8,{sx:{fontSize:19}}):ut(D8,{sx:{fontSize:19}})}),C?.archived?"\uBCF4\uAD00 \uD574\uC81C":"\uBCF4\uAD00"]}),ut($l,{}),hr(wr,{disabled:y,onClick:()=>{k("one")},sx:{fontSize:14,color:"#e5484d"},children:[ut(Gr,{children:ut(cr,{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?hr(wr,{disabled:y,onClick:()=>{k("series")},sx:{fontSize:14,color:"#e5484d"},children:[ut(Gr,{children:ut(cr,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC0AD\uC81C (\uC774\uD6C4 \uBC18\uBCF5 \uC804\uCCB4)"]}):null]})]}),ut(hn,{anchorEl:D?.anchorEl??null,open:!!D,date:D?.task.due_date??"",reminder:D?.task.reminder??"none",hideReminder:!!D?.task.completed,centered:A,onClose:()=>{P(null),p()},onDateChange:L=>{D&&n(D.task.seq,L)},onReminderChange:L=>{D&&c?.(D.task.seq,L)}}),hr(sd,{transitionDuration:0,anchorEl:N?.anchorEl??null,open:!!N,onClose:()=>{q(null),p()},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...j,children:[ut(wr,{selected:!N?.task.tab_key,onClick:()=>{N&&a(N.task.seq,""),q(null),p()},sx:{fontSize:14,minWidth:170},children:"\uC5C6\uC74C"}),b.filter(L=>!L.archived).map(L=>ut(wr,{selected:N?.task.tab_key===L.key,onClick:()=>{N&&a(N.task.seq,L.key),q(null),p()},sx:{fontSize:14,minWidth:170},children:L.label},L.key))]}),ut(sd,{transitionDuration:0,anchorEl:z,open:!!z,onClose:()=>T(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...l.filter(L=>`custom-${L.group_seq}`===String(C?.tab_key??"")).map(L=>({seq:L.seq,label:pn(L)}))].map(L=>hr(wr,{onClick:()=>{C&&g?.(C.seq,L.seq),T(null),p()},sx:{fontSize:14,minWidth:160,gap:1},children:[L.label,(C?.sprint_seq??0)===L.seq?ut(_8,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},L.seq))})]})}import{Checkbox as N8,Divider as L8,Menu as j8,MenuItem as e0}from"@mui/material";import{jsx as Hl,jsxs as t0}from"react/jsx-runtime";function iU({anchorEl:e,labelOptions:p,selectedKeys:b,onToggle:l,onClear:i,onClose:s}){return t0(j8,{transitionDuration:0,anchorEl:e,open:!!e,onClose:s,children:[p.map(r=>{let t=b.includes(r.key);return t0(e0,{onClick:()=>l(r.key),sx:{fontSize:14,minWidth:190,gap:1},children:[Hl(N8,{size:"small",checked:t,sx:{p:0}}),Hl(Ot,{option:r})]},r.key)}),Hl(L8,{}),Hl(e0,{disabled:b.length===0,onClick:()=>{i(),s()},sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{Divider as z8,Menu as F8,MenuItem as r0}from"@mui/material";import q8 from"@mui/icons-material/Check";import $8 from"@mui/icons-material/SettingsOutlined";import{jsx as ad,jsxs as ld}from"react/jsx-runtime";function fU(e){let{anchorEl:p,sprints:b,value:l,onSelect:i,onManage:s,onClose:r}=e;return ld(F8,{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:pn(t)}))].map(t=>ld(r0,{onClick:()=>{i(t.seq),r()},sx:{fontSize:14,minWidth:180,gap:1},children:[t.label,l===t.seq?ad(q8,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},t.seq)),ad(z8,{}),ld(r0,{onClick:()=>{r(),s()},sx:{fontSize:14,gap:1},children:[ad($8,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uAD00\uB9AC\u2026"]})]})}var H8={my:"tasks",mine:"tasks",sent:"tasks",notice:"notice",bug:"bug",archive:"archive",done:"done",report:"report"};function W8(e){return H8[e]??"tasks"}var o0={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"},n0=["list","calendar","month","card","kanban","sprint","timeline"],U8=["list","card"];function mU(e){let p=W8(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:n0,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:U8,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:n0,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 V8}from"react";import{useKeyboardState as K8}from"@ehfuse/keyboard-state";var i0=[{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 vU(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=V8(()=>{let d=[];if(i&&d.push({key:"n",callback:i,options:{preventDefault:!0}}),s&&d.push({key:"/",callback:s,options:{preventDefault:!0}}),n&&d.push({key:"r",callback:n,options:{preventDefault:!0}}),r&&d.push({key:"shift+?",callback:r,options:{preventDefault:!0}}),c&&d.push({key:"escape",callback:c,options:{allowInEditable:!0}}),t)for(let f of s0(o?o.split(","):void 0))d.push({key:f.key,callback:()=>t(f.view),options:{preventDefault:!0}});return d},[i,s,r,t,n,c,o]);K8(b?a:[])}function s0(e){if(!e)return i0;let p=new Set(e);return i0.filter(b=>p.has(b.view))}function cd(e){return[{keys:"N",description:"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D"},{keys:"/",description:"\uAC80\uC0C9"},{keys:"R",description:"\uBAA9\uB85D \uC0C8\uB85C\uACE0\uCE68"},...s0(e).map(p=>({keys:p.key.split(" ").map(b=>b.toUpperCase()).join(" \u2192 "),description:`${o0[p.view]} \uBCF4\uAE30`})),{keys:"?",description:"\uB2E8\uCD95\uD0A4 \uB3C4\uC6C0\uB9D0"},{keys:"Esc",description:"\uB2EB\uAE30"}]}var wU=cd();import{Box as Js,Button as G8}from"@mui/material";import Y8 from"@mui/icons-material/ArrowRightAlt";import{FormDialog as X8}from"@ehfuse/mui-form-dialog";import{jsx as Jo,jsxs as a0}from"react/jsx-runtime";function Z8({keys:e}){return Jo(Js,{sx:{display:"flex",alignItems:"center",gap:.5,justifyContent:"flex-end"},children:e.split(" \u2192 ").map((p,b)=>a0(Js,{sx:{display:"flex",alignItems:"center",gap:.5},children:[b>0?Jo(Y8,{sx:{fontSize:18,color:"#9a9a97"}}):null,Jo(Js,{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 BU({open:e,onClose:p,views:b}){let l=cd(b);return Jo(X8,{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:Jo(Js,{sx:{display:"grid",gridTemplateColumns:"auto 1fr",columnGap:2,rowGap:1.25,alignItems:"center",fontSize:14,color:"#37352f"},children:l.map(i=>a0(Js,{sx:{display:"contents"},children:[Jo(Z8,{keys:i.keys}),Jo("span",{children:i.description})]},i.keys))})}],actions:{showCancelButton:!1,right:Jo(G8,{variant:"contained",onClick:p,children:"\uB2EB\uAE30"})}})}import{useEffect as l0,useRef as J8,useState as ts}from"react";import{Box as nr,Button as Dn,IconButton as ud,Menu as c0,MenuItem as u0,Switch as Q8,Tooltip as d0}from"@mui/material";import{FormDialog as f0}from"@ehfuse/mui-form-dialog";import dd from"@mui/icons-material/Add";import eS from"@mui/icons-material/ArrowRightAlt";import tS from"@mui/icons-material/BoltOutlined";import rS from"@mui/icons-material/Close";import nS from"@mui/icons-material/EditOutlined";import{ErrorAlert as h0}from"@ehfuse/alerts";import{ClearTextField as Qs,LabelSelect as ln}from"@ehfuse/mui-form-controls";import{Fragment as m0,jsx as Ke,jsxs as xn}from"react/jsx-runtime";var fd=[{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."}],ea=[{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"}],Vl=[{value:"high",label:"\uB192\uC74C"},{value:"medium",label:"\uC911\uAC04"},{value:"low",label:"\uB0AE\uC74C"}];function Wl(){return{name:"",trigger:"created",enabled:!0,sort_no:0,condition:{},action:{}}}function Ul(e){return rn.find(p=>p.key===e)?.name??e}function oS(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=${Vl.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=${Ul(l.status)}`),l.from_status&&s.push(`${Ul(l.from_status)}\uC5D0\uC11C`),l.to_status&&s.push(`${Ul(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(`${ea.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=${Ul(i.set_status)}`),i.set_priority&&r.push(`\uC911\uC694\uB3C4=${Vl.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=fd.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 p0={fontSize:16,fontWeight:700,color:"#37352f"},iS={display:"flex",alignItems:"center",gap:1},sS={width:104,flexShrink:0,fontSize:16,color:"#37352f"};function HU({open:e,rules:p,customTabs:b,statusOptions:l,contentTemplates:i=[],onPickAccount:s,onClose:r,onCreate:t,onUpdate:n,onToggle:c,onRemove:o}){let[a,d]=ts(!1),[f,u]=ts(0),[g,m]=ts(Wl()),[x,_]=ts(!1),B=J8(null),[A,j]=ts(null),[D,P]=ts(null);l0(()=>{if(e)return;let H=window.setTimeout(()=>{d(!1),u(0),m(Wl())},500);return()=>window.clearTimeout(H)},[e]),l0(()=>{if(!a)return;let H=window.setTimeout(()=>B.current?.focus(),120);return()=>window.clearTimeout(H)},[a]);let N=f>0,q=g.trigger,z=()=>{d(!1),u(0),m(Wl())},T=(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}})},R=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=ea[0]?.value??""),{...Z,trigger:H,condition:J}})},h=b.filter(H=>!H.archived),y=l.map(H=>({value:H.key,label:H.name})),v=rn.map(H=>({value:H.key,label:H.name})),w=h.map(H=>({value:String(Vo(H.key)),label:H.label})),{condition:k,action:S}=g,E=k.is_bug!==void 0||k.is_event!==void 0,L=[...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,H==="manager_account"?"\uCC45\uC784\uC790":"\uCC38\uC870\uC790");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"?T("group_seq",Number(w[0]?.value)||0):H==="kind"?T("is_bug",!0):H==="priority"?T("priority","high"):H==="label_key"?T("label_key",y[0]?.value??""):H==="title_contains"?m(Z=>({...Z,condition:{...Z.condition,title_contains:""}})):H==="manager_empty"?T("manager_empty",!0):H==="manager_account"||H==="receiver_account"?$(H):H==="from_status"?T("from_status",rn[0]?.key??""):H==="to_status"?T("to_status",rn[0]?.key??""):H==="changed_field"?T("changed_field",ea[0]?.value??""):H==="comment_contains"?m(Z=>({...Z,condition:{...Z.condition,comment_contains:""}})):H==="comment_by_others"?T("comment_by_others",!0):H==="overdue_days"&&T("overdue_days",1)},O=H=>{if(H==="kind"){T("is_bug",""),T("is_event","");return}if(H==="manager_account"){T("manager_account_seq",""),T("manager_name","");return}if(H==="receiver_account"){T("receiver_account_seq",""),T("receiver_name","");return}T(H==="group_seq"?"group_seq":H,"")},W=[...S.set_status===void 0?[{key:"set_status",label:"\uC0C1\uD0DC \uBC14\uAFB8\uAE30"}]:[],...S.set_priority===void 0?[{key:"set_priority",label:"\uC911\uC694\uB3C4 \uBC14\uAFB8\uAE30"}]:[],...S.add_label_key===void 0&&y.length>0?[{key:"add_label_key",label:"\uB77C\uBCA8 \uBD99\uC774\uAE30"}]:[],...s&&S.assign_manager_account_seq===void 0?[{key:"assign_manager",label:"\uCC45\uC784\uC790 \uC9C0\uC815\uD558\uAE30"}]:[],...s&&S.add_receiver_account_seq===void 0?[{key:"add_receiver",label:"\uCC38\uC870\uC790 \uCD94\uAC00\uD558\uAE30"}]:[],...i.length>0&&S.apply_content_template_seq===void 0?[{key:"apply_content_template",label:"\uBCF8\uBB38 \uC591\uC2DD \uCC44\uC6B0\uAE30"}]:[],...s&&S.notify_account_seq===void 0?[{key:"notify",label:"\uC54C\uB9BC \uBCF4\uB0B4\uAE30"}]:[]],M=async H=>{if(!s)return;let Z=H==="assign_manager"?S.assign_manager_account_seq??0:H==="add_receiver"?S.add_receiver_account_seq??0:S.notify_account_seq??0,J=await s(Z,H==="assign_manager"?"\uCC45\uC784\uC790":H==="add_receiver"?"\uCC38\uC870\uC790":"\uC54C\uB9BC \uBC1B\uC744 \uC0AC\uB78C");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",rn[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 M(H)},F=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()){h0({message:"\uADDC\uCE59 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694."});return}if(Object.keys(g.action).length===0){h0({message:"\uB3D9\uC791\uC744 \uD558\uB098 \uC774\uC0C1 \uCD94\uAC00\uD558\uC138\uC694."});return}let H=N?g.sort_no:p.reduce((J,G)=>Math.max(J,G.sort_no),0)+1;_(!0);let Z=N?await n(f,{...g,sort_no:H}):await t({...g,sort_no:H});_(!1),Z&&z()},Y=(H,Z,J,G)=>xn(nr,{sx:iS,children:[Ke(nr,{sx:sS,children:H}),xn(nr,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:G?"column":"row",alignItems:G?"stretch":"center",gap:G?.5:1},children:[Z,G?Ke(nr,{sx:{fontSize:13.5,color:"#37352f"},children:G}):null]}),Ke(d0,{title:"\uC774 \uC904 \uBE7C\uAE30",arrow:!0,disableInteractive:!0,children:Ke(ud,{size:"small","aria-label":`${H} \uC904 \uBE7C\uAE30`,onClick:J,children:Ke(rS,{sx:{fontSize:16}})})})]}),K=()=>xn(nr,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[Ke(Qs,{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(nr,{sx:{display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"},children:fd.map(H=>{let Z=q===H.value;return Ke(Dn,{disableElevation:!0,variant:Z?"contained":"outlined",color:Z?"primary":"inherit",onClick:()=>R(H.value),sx:{borderRadius:99,px:1.75,...Z?{}:{color:"#57564f",borderColor:"#d9d9d6"}},children:H.label},H.value)})}),Ke(nr,{sx:{fontSize:13,color:"#787774",mt:-.5},children:fd.find(H=>H.value===q)?.hint}),xn(nr,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[Ke(nr,{sx:p0,children:"\uC5B4\uB5A4 \uC5C5\uBB34\uC77C \uB54C"}),L.length>0?Ke(Dn,{size:"small",startIcon:Ke(dd,{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(ln,{size:"medium",fullWidth:!0,label:"",value:String(k.group_seq),options:w,onChange:H=>T("group_seq",Number(H.target.value)||"")}),()=>O("group_seq")):null,E?Y("\uC885\uB958",Ke(ln,{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";T("is_bug",Z?!0:""),T("is_event",Z?"":!0)}}),()=>O("kind")):null,k.priority!==void 0?Y("\uC911\uC694\uB3C4",Ke(ln,{size:"medium",fullWidth:!0,label:"",value:k.priority,options:Vl,onChange:H=>T("priority",H.target.value)}),()=>O("priority")):null,k.label_key!==void 0?Y("\uB77C\uBCA8",Ke(ln,{size:"medium",fullWidth:!0,label:"",value:k.label_key,options:y,onChange:H=>T("label_key",H.target.value)}),()=>O("label_key")):null,k.title_contains!==void 0?Y("\uC81C\uBAA9",Ke(Qs,{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}}))}),()=>O("title_contains")):null,k.manager_empty!==void 0?Y("\uCC45\uC784\uC790",Ke(ln,{size:"medium",fullWidth:!0,label:"",value:k.manager_empty?"empty":"assigned",options:[{value:"empty",label:"\uC5C6\uC74C"},{value:"assigned",label:"\uC788\uC74C"}],onChange:H=>T("manager_empty",H.target.value==="empty")}),()=>O("manager_empty")):null,k.manager_account_seq!==void 0?Y("\uCC45\uC784\uC790",Ke(Dn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{$("manager_account")},children:k.manager_name||`\uACC4\uC815 #${k.manager_account_seq}`}),()=>O("manager_account")):null,k.receiver_account_seq!==void 0?Y("\uCC38\uC870\uC790",Ke(Dn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{$("receiver_account")},children:k.receiver_name||`\uACC4\uC815 #${k.receiver_account_seq}`}),()=>O("receiver_account")):null,k.from_status!==void 0?Y("\uC774 \uC0C1\uD0DC\uC5D0\uC11C",Ke(ln,{size:"medium",fullWidth:!0,label:"",value:k.from_status,options:v,onChange:H=>T("from_status",H.target.value)}),()=>O("from_status")):null,k.to_status!==void 0?Y("\uC774 \uC0C1\uD0DC\uB85C",Ke(ln,{size:"medium",fullWidth:!0,label:"",value:k.to_status,options:v,onChange:H=>T("to_status",H.target.value)}),()=>O("to_status")):null,k.changed_field!==void 0?Y("\uBCC0\uACBD \uD544\uB4DC",Ke(ln,{size:"medium",fullWidth:!0,label:"",value:k.changed_field,options:ea,onChange:H=>T("changed_field",H.target.value)}),()=>O("changed_field")):null,k.comment_contains!==void 0?Y("\uB313\uAE00 \uB0B1\uB9D0",Ke(Qs,{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}}))}),()=>O("comment_contains")):null,k.comment_by_others!==void 0?Y("\uB313\uAE00 \uC791\uC131\uC790",Ke(ln,{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=>T("comment_by_others",H.target.value==="others")}),()=>O("comment_by_others")):null,k.overdue_days!==void 0?Y("\uACBD\uACFC\uC77C",Ke(Qs,{size:"medium",fullWidth:!0,type:"number",value:String(k.overdue_days),onChange:H=>T("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"}),()=>O("overdue_days")):null,Object.keys(k).length===0?Ke(nr,{sx:{fontSize:13.5,color:"#9a9a97"},children:"\uC870\uAC74\uC774 \uC5C6\uC73C\uBA74 \uBAA8\uB4E0 \uC5C5\uBB34\uC5D0 \uC2E4\uD589\uB429\uB2C8\uB2E4."}):null,xn(nr,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[Ke(nr,{sx:p0,children:"\uBB34\uC5C7\uC744 \uD560\uAE4C\uC694"}),W.length>0?Ke(Dn,{size:"small",startIcon:Ke(dd,{sx:{fontSize:16}}),onClick:H=>P(H.currentTarget),sx:{color:"#2563eb",minWidth:0},children:"\uB3D9\uC791 \uCD94\uAC00"}):null]}),S.set_status!==void 0?Y("\uC0C1\uD0DC",Ke(ln,{size:"medium",fullWidth:!0,label:"",value:S.set_status,options:v,onChange:H=>C("set_status",H.target.value)}),()=>F("set_status")):null,S.set_priority!==void 0?Y("\uC911\uC694\uB3C4",Ke(ln,{size:"medium",fullWidth:!0,label:"",value:S.set_priority,options:Vl,onChange:H=>C("set_priority",H.target.value)}),()=>F("set_priority")):null,S.apply_content_template_seq!==void 0?Y("\uBCF8\uBB38 \uC591\uC2DD",Ke(ln,{size:"medium",fullWidth:!0,label:"",value:String(S.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??""}}))}}),()=>F("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,S.add_label_key!==void 0?Y("\uB77C\uBCA8",Ke(ln,{size:"medium",fullWidth:!0,label:"",value:S.add_label_key,options:y,onChange:H=>C("add_label_key",H.target.value)}),()=>F("add_label_key")):null,S.assign_manager_account_seq!==void 0?Y("\uCC45\uC784\uC790",Ke(Dn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{M("assign_manager")},children:S.assign_manager_name||`\uACC4\uC815 #${S.assign_manager_account_seq}`}),()=>F("assign_manager")):null,S.add_receiver_account_seq!==void 0?Y("\uCC38\uC870\uC790",Ke(Dn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{M("add_receiver")},children:S.add_receiver_name||`\uACC4\uC815 #${S.add_receiver_account_seq}`}),()=>F("add_receiver")):null,S.notify_account_seq!==void 0?Y("\uC54C\uB9BC",xn(m0,{children:[Ke(Dn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{M("notify")},sx:{flexShrink:0},children:S.notify_name||`\uACC4\uC815 #${S.notify_account_seq}`}),Ke(Qs,{size:"medium",fullWidth:!0,placeholder:"\uC54C\uB9BC \uBB38\uAD6C(\uBE44\uC6B0\uBA74 \uAE30\uBCF8 \uBB38\uAD6C)",value:S.notify_message??"",onChange:H=>C("notify_message",H.target.value)})]}),()=>F("notify")):null,Object.keys(S).length===0?Ke(nr,{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(c0,{transitionDuration:0,anchorEl:A,open:!!A,onClose:()=>j(null),children:L.map(H=>Ke(u0,{dense:!0,onClick:()=>U(H.key),sx:{fontSize:14},children:H.label},H.key))}),Ke(c0,{transitionDuration:0,anchorEl:D,open:!!D,onClose:()=>P(null),children:W.map(H=>Ke(u0,{dense:!0,onClick:()=>I(H.key),sx:{fontSize:14},children:H.label},H.key))})]});return xn(m0,{children:[Ke(f0,{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:xn(nr,{sx:{display:"flex",flexDirection:"column",px:2.5,py:2},children:[p.length===0?xn(nr,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[Ke(tS,{sx:{fontSize:48,color:"#d9d9d6"}}),Ke(nr,{sx:{fontSize:15},children:"\uB4F1\uB85D\uB41C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):null,p.map(H=>xn(nr,{sx:{display:"flex",alignItems:"center",gap:2,py:1,"&:not(:last-of-type)":{borderBottom:"1px solid #ececea"},opacity:H.enabled?1:.5},children:[Ke(d0,{title:H.enabled?"\uC0AC\uC6A9 \uC911":"\uAEBC\uC9D0",arrow:!0,disableInteractive:!0,children:Ke(Q8,{size:"small",inputProps:{"aria-label":`${H.name} \uADDC\uCE59 \uC0AC\uC6A9`},checked:H.enabled,onChange:(Z,J)=>c(H.seq,J)})}),xn(nr,{sx:{flex:1,minWidth:0},children:[Ke(nr,{sx:{fontSize:16,fontWeight:600,color:"#37352f"},children:H.name}),(()=>{let Z=oS(H,b,l);return xn(nr,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5,fontSize:15,color:"#6f6f6c"},children:[Ke(nr,{component:"span",children:Z.left}),Ke(eS,{sx:{fontSize:18,color:"#9a9a97",flexShrink:0}}),Ke(nr,{component:"span",children:Z.right})]})})()]}),Ke(ud,{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:ea[0]?.value??""}:{}},action:{...H.action}}),d(!0)},children:Ke(nS,{sx:{fontSize:18}})}),Ke(ud,{size:"small","aria-label":`${H.name} \uADDC\uCE59 \uC0AD\uC81C`,onClick:()=>o(H.seq),children:Ke(cr,{sx:{fontSize:18}})})]},H.seq))]})}],actions:{showCancelButton:!1,left:Ke(Dn,{startIcon:Ke(dd,{}),onClick:()=>{u(0),m(Wl()),d(!0)},sx:{color:"#2563eb"},children:"\uC0C8 \uADDC\uCE59"}),right:Ke(Dn,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}}),Ke(f0,{open:a,onClose:z,maxWidth:"sm",title:N?"\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(Dn,{variant:"contained",onClick:()=>{V()},disabled:x,children:N?"\uC218\uC815":"\uADDC\uCE59 \uCD94\uAC00"})}})]})}import{useEffect as g0,useRef as hd,useState as rs}from"react";import{Box as Qt,Button as ns,IconButton as ta,Tooltip as ra}from"@mui/material";import b0 from"@mui/icons-material/Add";import aS from"@mui/icons-material/EditOutlined";import lS from"@mui/icons-material/ContentCopyOutlined";import cS from"@mui/icons-material/DragIndicator";import uS from"@mui/icons-material/Close";import dS from"@mui/icons-material/PlaylistAddCheckOutlined";import{DndContext as fS,PointerSensor as hS,closestCenter as pS,useSensor as mS,useSensors as gS}from"@dnd-kit/core";import{restrictToParentElement as bS,restrictToVerticalAxis as yS}from"@dnd-kit/modifiers";import{SortableContext as xS,arrayMove as y0,useSortable as vS,verticalListSortingStrategy as wS}from"@dnd-kit/sortable";import{CSS as _S}from"@dnd-kit/utilities";import{FormDialog as x0}from"@ehfuse/mui-form-dialog";import{ClearTextField as pd,LabelSelect as v0,NumberField as w0}from"@ehfuse/mui-form-controls";import kS from"@ehfuse/overlay-scrollbar";import{ConfirmDialog as SS,ErrorAlert as _0}from"@ehfuse/alerts";import{Fragment as ES,jsx as ot,jsxs as vn}from"react/jsx-runtime";var TS=[{value:"high",label:"\uB192\uC74C"},{value:"medium",label:"\uC911\uAC04"},{value:"low",label:"\uB0AE\uC74C"}],k0="\uC5C5\uBB34 \uC81C\uBAA9",md=2,Kl={flex:1,minWidth:0},S0=56,T0=20,CS=`${T0+md*8}px`;function Gl(){return{name:"",description:"",group_seq:0,items:[]}}function BS(){return{title:"",start_offset_days:0,due_offset_days:0,priority:"medium"}}function IS({id:e,children:p}){let{attributes:b,listeners:l,setNodeRef:i,transform:s,transition:r,isDragging:t}=vS({id:e});return ot(Qt,{ref:i,sx:{transform:_S.Transform.toString(s),transition:r,...t?{opacity:.6,position:"relative",zIndex:1}:{}},children:p({handleProps:{...b,...l},dragging:t})})}function uV({open:e,templates:p,customTabs:b,onPickAccount:l,onClose:i,onCreate:s,onUpdate:r,onRemove:t,onRun:n}){let[c,o]=rs(!1),[a,d]=rs(0),[f,u]=rs(Gl()),[g,m]=rs(!1),[x,_]=rs([]),B=hd(0),[A,j]=rs(0),D=hd(null),P=hd(null);g0(()=>{if(e)return;let L=window.setTimeout(()=>{o(!1),d(0),u(Gl()),_([])},500);return()=>window.clearTimeout(L)},[e]);let N=()=>(B.current+=1,`template-item-${B.current}`),q=(L,$)=>{d(L),u($),_($.items.map(()=>N())),o(!0)},z=f.items.map((L,$)=>x[$]??`template-item-fallback-${$}`),T=()=>{let L=P.current?.getScrollContainer()??null;if(L){L.scrollTop=L.scrollHeight;return}let $=D.current?.querySelectorAll("*")??[];for(let U of Array.from($))if(U.scrollHeight>U.clientHeight+1){U.scrollTop=U.scrollHeight;return}},C=()=>{let L=D.current;if(!L)return null;let $=L.querySelectorAll("input[data-template-title]"),U=$.length?$:L.querySelectorAll(`input[placeholder="${k0}"]`);return U.length?U[U.length-1]:null};g0(()=>{if(A===0)return;let L=0,$=0,U=()=>{T();let W=C();W&&document.activeElement!==W&&W.focus(),L+=1,!(W&&document.activeElement===W)&&L<8&&($=window.setTimeout(U,50))},O=window.requestAnimationFrame(U);return()=>{window.cancelAnimationFrame(O),window.clearTimeout($)}},[A]);let R=b.filter(L=>!L.archived).map(L=>({value:String(Vo(L.key)),label:L.label})),h=(L,$)=>{u(U=>({...U,items:U.items.map((O,W)=>W===L?{...O,...$}:O)}))},y=gS(mS(hS,{activationConstraint:{distance:5}})),v=L=>{let $=String(L.active?.id??""),U=String(L.over?.id??"");if(!$||!U||$===U)return;let O=z.indexOf($),W=z.indexOf(U);O<0||W<0||(u(M=>({...M,items:y0(M.items,O,W)})),_(M=>y0(M,O,W)))},w=async L=>{if(!l)return;let $=await l(f.items[L]?.manager_account_seq??0,"\uCC45\uC784\uC790");$&&h(L,{manager_account_seq:$.accountSeq,manager_name:$.name})},k=async()=>{let L=f.name.trim();if(!L){_0({message:"\uD15C\uD50C\uB9BF \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694."});return}let $=f.items.filter(W=>W.title.trim().length>0);if($.length===0){_0({message:"\uC5C5\uBB34 \uD56D\uBAA9\uC744 \uD55C \uC904 \uC774\uC0C1 \uB123\uC73C\uC138\uC694."});return}m(!0);let U={...f,name:L,items:$},O=a>0?await r(a,U):await s(U);m(!1),O&&(o(!1),d(0),u(Gl()))},S=ot(Qt,{children:p.length===0?vn(Qt,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[ot(dS,{sx:{fontSize:48,color:"#d9d9d6"}}),ot(Qt,{sx:{fontSize:13.5},children:"\uB4F1\uB85D\uB41C \uD15C\uD50C\uB9BF\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):p.map(L=>vn(Qt,{sx:{display:"flex",alignItems:"center",gap:2.5,py:1.75,"&:not(:last-of-type)::after":{content:'""',display:"block",my:1.75,borderBottom:"1px solid #f0efed"}},children:[vn(Qt,{sx:{flex:1,minWidth:0},children:[ot(Qt,{sx:{fontSize:18,fontWeight:600,color:"#37352f"},children:L.name}),vn(Qt,{sx:{fontSize:14,color:"#787774",mt:.25},children:["\uC5C5\uBB34 ",L.items.length,"\uAC74",L.description?` \xB7 ${L.description}`:""]})]}),n?ot(ns,{size:"medium",variant:"outlined",onClick:()=>n(L),sx:{flexShrink:0},children:"\uC2E4\uD589"}):null,ot(ra,{title:"\uC218\uC815",arrow:!0,disableInteractive:!0,children:ot(ta,{size:"medium","aria-label":`${L.name} \uD15C\uD50C\uB9BF \uC218\uC815`,onClick:()=>q(L.seq,{name:L.name,description:L.description??"",group_seq:L.group_seq??0,items:L.items.map($=>({...$}))}),children:ot(aS,{sx:{fontSize:19}})})}),ot(ra,{title:"\uBCF5\uC81C",arrow:!0,disableInteractive:!0,children:ot(ta,{size:"medium","aria-label":`${L.name} \uD15C\uD50C\uB9BF \uBCF5\uC81C`,onClick:()=>q(0,{name:`${L.name} \uC0AC\uBCF8`,description:L.description??"",group_seq:L.group_seq??0,items:L.items.map($=>({...$}))}),children:ot(lS,{sx:{fontSize:18}})})}),ot(ra,{title:"\uC0AD\uC81C",arrow:!0,disableInteractive:!0,children:ot(ta,{size:"medium","aria-label":`${L.name} \uD15C\uD50C\uB9BF \uC0AD\uC81C`,onClick:()=>{(async()=>await SS({title:"\uD15C\uD50C\uB9BF \uC0AD\uC81C",message:`"${L.name}" \uD15C\uD50C\uB9BF\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&t(L.seq))()},children:ot(cr,{sx:{fontSize:18}})})})]},L.seq))}),E=vn(Qt,{sx:{display:"flex",flexDirection:"column",gap:3},children:[ot(pd,{size:"medium",label:"\uD15C\uD50C\uB9BF \uC774\uB984",placeholder:"\uC608: \uC2E0\uADDC \uC785\uC0AC\uC790 \uC628\uBCF4\uB529",fullWidth:!0,value:f.name,onChange:L=>u($=>({...$,name:L.target.value}))}),vn(Qt,{sx:{display:"grid",gridTemplateColumns:R.length>0?"1fr 1fr":"1fr",gap:2},children:[ot(pd,{size:"medium",label:"\uC124\uBA85",placeholder:"\uBAA9\uB85D\uC5D0\uC11C \uBB34\uC5C7\uC778\uC9C0 \uC54C\uC544\uBCFC \uD55C \uC904(\uC120\uD0DD)",fullWidth:!0,value:f.description??"",onChange:L=>u($=>({...$,description:L.target.value}))}),R.length>0?ot(v0,{size:"medium",fullWidth:!0,label:"\uB9CC\uB4E4 \uACF3(\uD504\uB85C\uC81D\uD2B8)",value:String(f.group_seq??0),options:[{value:"0",label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568"},...R],onChange:L=>u($=>({...$,group_seq:Number(L.target.value)||0}))}):null]}),vn(Qt,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[ot(Qt,{sx:{fontSize:18,fontWeight:600,color:"#37352f"},children:"\uC5C5\uBB34 \uD56D\uBAA9"}),ot(Qt,{sx:{fontSize:14,color:"#37352f"},children:"\uB0A0\uC9DC\uB294 \uC2E4\uD589\uD560 \uB54C \uACE0\uB974\uB294 \uAE30\uC900\uC77C\uC5D0\uC11C \uACC4\uC0B0\uB429\uB2C8\uB2E4."})]}),f.items.length===0?ot(Qt,{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.'}):ot(Qt,{ref:D,sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:ot(kS,{ref:P,style:{maxHeight:"min(560px, 52vh)"},thumb:{width:6},children:ot(fS,{sensors:y,collisionDetection:pS,modifiers:[yS,bS],onDragEnd:v,children:ot(xS,{items:z,strategy:wS,children:f.items.map((L,$)=>ot(IS,{id:z[$],children:({handleProps:U})=>vn(Qt,{sx:{borderBottom:$===f.items.length-1?"none":"1px solid #f2f2f0",px:md,py:2,gap:2,display:"flex",flexDirection:"column"},children:[vn(Qt,{sx:{display:"flex",alignItems:"center",gap:md},children:[ot(Qt,{...U,"aria-label":`${$+1}\uBC88 \uD56D\uBAA9 \uC21C\uC11C \uC774\uB3D9`,sx:{display:"inline-flex",alignItems:"center",flexShrink:0,color:"#c9c8c5",cursor:"grab","&:active":{cursor:"grabbing"},touchAction:"none",userSelect:"none"},children:ot(cS,{sx:{fontSize:T0}})}),ot(pd,{size:"medium",fullWidth:!0,placeholder:k0,slotProps:{htmlInput:{"data-template-title":$}},value:L.title,onChange:O=>h($,{title:O.target.value})})]}),vn(Qt,{sx:{display:"flex",alignItems:"center",gap:2,pl:CS},children:[ot(Qt,{sx:Kl,children:ot(w0,{size:"medium",fullWidth:!0,label:"\uC2DC\uC791 D+",thousandSeparator:!1,align:"right",suffix:"\uC77C",value:L.start_offset_days??null,onValueChange:O=>h($,{start_offset_days:O===null?void 0:Math.trunc(Number(O))})})}),ot(Qt,{sx:Kl,children:ot(w0,{size:"medium",fullWidth:!0,label:"\uB9C8\uAC10 D+",thousandSeparator:!1,align:"right",suffix:"\uC77C",value:L.due_offset_days??null,onValueChange:O=>h($,{due_offset_days:O===null?void 0:Math.trunc(Number(O))})})}),ot(Qt,{sx:Kl,children:ot(v0,{size:"medium",fullWidth:!0,label:"\uC911\uC694\uB3C4",value:L.priority??"medium",options:TS,onChange:O=>h($,{priority:O.target.value})})}),l?vn(Qt,{sx:{...Kl,position:"relative"},children:[ot(ns,{variant:"outlined",fullWidth:!0,onClick:()=>{w($)},sx:{height:S0,display:"block",textAlign:"left",textTransform:"none",fontSize:16,fontWeight:400,lineHeight:`${S0-2}px`,py:0,px:1.75,pr:L.manager_account_seq?4.5:1.75,borderColor:"#c4c4c4",color:L.manager_name?"#37352f":"#9a9a97",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","&:hover":{borderColor:"#37352f",bgcolor:"transparent"}},children:L.manager_name||"\uCC45\uC784\uC790"}),L.manager_account_seq?ot(ra,{title:"\uCC45\uC784\uC790 \uBE44\uC6B0\uAE30",arrow:!0,disableInteractive:!0,children:ot(ta,{size:"small","aria-label":`${$+1}\uBC88 \uD56D\uBAA9 \uCC45\uC784\uC790 \uBE44\uC6B0\uAE30`,onClick:O=>{O.stopPropagation(),h($,{manager_account_seq:0,manager_name:""})},sx:{position:"absolute",right:6,top:"50%",transform:"translateY(-50%)"},children:ot(uS,{sx:{fontSize:18}})})}):null]}):null,ot(ra,{title:"\uD56D\uBAA9 \uC0AD\uC81C",arrow:!0,disableInteractive:!0,children:ot(ta,{size:"medium","aria-label":`${$+1}\uBC88 \uD56D\uBAA9 \uC0AD\uC81C`,onClick:()=>{u(O=>({...O,items:O.items.filter((W,M)=>M!==$)})),_(O=>O.filter((W,M)=>M!==$))},children:ot(cr,{sx:{fontSize:18}})})})]})]})},z[$]))})})})})]});return vn(ES,{children:[ot(x0,{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:ot(ns,{startIcon:ot(b0,{sx:{fontSize:18}}),onClick:()=>q(0,Gl()),children:"\uC0C8 \uD15C\uD50C\uB9BF"}),right:ot(ns,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})},sectionContentPaddingTop:0,sections:[{id:"templates",title:"",showTitle:!1,children:S}]}),ot(x0,{open:c,onClose:()=>o(!1),maxWidth:"md",title:a>0?"\uD15C\uD50C\uB9BF \uC218\uC815":"\uC0C8 \uD15C\uD50C\uB9BF",locale:"ko",backdropClick:!1,fontScale:{enabled:!0},fontScaleKey:"taskbox-task-template-form",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},tabs:{visible:!1},actions:{showCancelButton:!0,left:ot(ns,{startIcon:ot(b0,{sx:{fontSize:18}}),onClick:()=>{u(L=>({...L,items:[...L.items,BS()]})),_(L=>[...L,N()]),j(L=>L+1)},children:"\uD56D\uBAA9 \uCD94\uAC00"}),right:ot(ns,{variant:"contained",disabled:g,onClick:()=>{k()},children:"\uC800\uC7A5"})},sectionContentPaddingTop:0,sections:[{id:"template-form",title:"",showTitle:!1,children:E}]})]})}import{useEffect as C0,useState as B0}from"react";import{Box as Dr,Button as MS}from"@mui/material";import{FormDialog as RS}from"@ehfuse/mui-form-dialog";import{DateTextField as OS}from"@ehfuse/mui-form-controls";import AS from"@ehfuse/overlay-scrollbar";import{jsx as Yr,jsxs as na}from"react/jsx-runtime";function vV({open:e,template:p,todayStr:b,running:l=!1,onClose:i,onRun:s}){let[r,t]=B0(b),[n,c]=B0(p);C0(()=>{p&&c(p)},[p]),C0(()=>{e&&t(b)},[e]);let o=p??n,a=o?Bh(o,r):[];return Yr(RS,{open:e,onClose:i,maxWidth:"md",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},sectionContentPaddingTop:0,actions:{showCancelButton:!0,right:Yr(MS,{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:na(Dr,{sx:{display:"flex",flexDirection:"column",gap:2},children:[na(Dr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Yr(Dr,{sx:{width:72,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uAE30\uC900\uC77C"}),Yr(OS,{size:"medium",fullWidth:!0,value:r,onChange:d=>t(d.target.value)})]}),Yr(Dr,{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."}),na(Dr,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:[na(Dr,{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:[Yr(Dr,{sx:{flex:1,minWidth:0},children:"\uC5C5\uBB34"}),Yr(Dr,{sx:{width:88,flexShrink:0,textAlign:"center"},children:"\uC2DC\uC791"}),Yr(Dr,{sx:{width:88,flexShrink:0,textAlign:"center"},children:"\uB9C8\uAC10"}),Yr(Dr,{sx:{width:96,flexShrink:0,textAlign:"center"},children:"\uCC45\uC784\uC790"})]}),Yr(AS,{style:{maxHeight:520},thumb:{width:6},children:a.length===0?Yr(Dr,{sx:{p:2,fontSize:14,color:"#9a9a97"},children:"\uB9CC\uB4E4 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):a.map((d,f)=>na(Dr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1.25,borderBottom:f===a.length-1?"none":"1px solid #f2f2f0",fontSize:16,fontWeight:500,color:"#111111"},children:[Yr(Dr,{sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.title}),Yr(Dr,{sx:{width:88,flexShrink:0,textAlign:"center",fontSize:13.5,color:d.start_date?"#37352f":"#9a9a97"},children:Sc(d.start_date)||"-"}),Yr(Dr,{sx:{width:88,flexShrink:0,textAlign:"center",fontSize:13.5,color:d.due_date?"#37352f":"#9a9a97"},children:Sc(d.due_date)||"-"}),Yr(Dr,{sx:{width:96,flexShrink:0,textAlign:"center",fontSize:13.5,color:d.manager_name?"#37352f":"#9a9a97",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.manager_name||"-"})]},f))})]})]})}]})}var DS={urgent:"\uAE34\uAE09",high:"\uB192\uC74C",normal:"\uC911\uAC04",low:"\uB0AE\uC74C"};function PS(e){return e.length===0?"":e.length<=2?e.join(", "):`${e[0]} \uC678 ${e.length-1}\uBA85`}function gd(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 os(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 bd(e,p){let l=String(e.due_date??"").slice(11,16).trim()||String(e.estimated_time??"").trim(),i=gd(e.due_date),s=String(e.start_date??"").slice(11,16).trim(),r=gd(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:lr(e).name,projectLabel:e.tab_key?p.get(String(e.tab_key))??"":"",managerName:String(e.manager_name??"").trim(),receiverNames:PS(t),receiverNamesFull:t.join(", "),startDate:r!=="-"&&s?`${r} ${s}`:r,dueDate:i!=="-"&&l?`${i} ${l}`:i,priorityName:DS[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 NS(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 Yl(e,p){let b=0;for(let l of String(e??""))b+=NS(l,p);return b}function is(e,p){let b=String(e??"").trim();if(!b)return["-"];let l=[],i="";for(let s of b){if(s===`
41
+ `)}function vp(e){navigator.clipboard.writeText(e).then(()=>q5("\uC5C5\uBB34 \uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>F5("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uB0B4\uC6A9\uC744 \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD574 \uC8FC\uC138\uC694."))}function Vi(e,p){let b=$5(e);if(p&&typeof navigator.share=="function"){navigator.share({text:b}).catch(l=>{l?.name!=="AbortError"&&vp(b)});return}vp(b)}import{Fragment as X5,jsx as Bt,jsxs as wp}from"react/jsx-runtime";function _p({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:d,canDelete:f}){let u=Nt(),[g,m]=js(!1),[x,_]=js(null),[B,A]=js(null),[j,D]=js(null),[P,N]=js(null),q=!!e.is_notice,z=!!e.is_event,T=q?_t(e.icon||or):z?_t(e.icon||ar):null,C=q&&p>0&&(e.author_account_seq??0)===p,R=!so(e,p),h=!!d&&(f??(p>0&&(e.author_account_seq??0)===p)),y=!z&&(q?C:(e.author_account_seq??0)===p||(e.manager_account_seq??0)===p);return wp(X5,{children:[wp(Ki,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[t&&r?Bt(Gi,{"aria-label":"\uB4A4\uB85C",onClick:r,sx:{color:"#37352f",ml:-1},children:Bt(U5,{})}):null,y&&!t?Bt(Yi,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${nn(e.completed_time)} \uC644\uB8CC`:"",arrow:!0,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:Bt(Ki,{sx:{display:"flex",flexShrink:0,mr:1},children:Bt(Nn,{onClick:v=>N({anchorEl:v.currentTarget,nextCompleted:!e.completed}),children:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC\uD558\uAE30"})})}):null,t||!T?null:z&&!R?Bt(Yi,{title:"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,enterDelay:400,disableInteractive:!0,children:Bt(H5,{onClick:v=>A(v.currentTarget),sx:{display:"flex",p:.5,borderRadius:1,color:e.icon_color||"#1e3a8a","&:hover":{bgcolor:"#f2f2f0"}},children:Bt(T,{sx:{fontSize:20}})})}):Bt(Ki,{sx:{display:"flex",px:.5,color:e.icon_color||(q?"#e5484d":"#1e3a8a")},children:Bt(T,{sx:{fontSize:20}})}),x!==null?Bt(Ki,{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(Ki,{sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:q?"\uACF5\uC9C0":z?"\uC77C\uC815":e.is_bug?"\uC624\uB958":"\uC5C5\uBB34"}):Bt(Ki,{onClick:R?void 0:()=>_(e.title),sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:R?"default":"text",textDecoration:e.completed?"line-through":"none"},children:e.title}),o?Bt(Yi,{title:"\uD65C\uB3D9",arrow:!0,children:Bt(Gi,{"aria-label":"\uD65C\uB3D9",onClick:()=>m(!0),sx:{color:"#6b7280"},children:Bt(G5,{sx:{fontSize:20}})})}):null,Bt(Yi,{title:u?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:Bt(Gi,{"aria-label":u?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>Vi(e,u),sx:{color:"#6b7280"},children:u?Bt(V5,{sx:{fontSize:20}}):Bt(K5,{sx:{fontSize:20}})})}),a?Bt(Yi,{title:"\uC778\uC1C4",arrow:!0,children:Bt(Gi,{"aria-label":"\uC778\uC1C4",onClick:()=>a(e),sx:{color:"#6b7280"},children:Bt(Y5,{sx:{fontSize:20}})})}):null,h?Bt(Yi,{title:"\uC0AD\uC81C",arrow:!0,children:Bt(Gi,{"aria-label":"\uC0AD\uC81C",onClick:v=>D(v.currentTarget),sx:{color:"#6b7280","&:hover":{color:"#e5484d"}},children:Bt(cr,{sx:{fontSize:20}})})}):null,r&&!t?Bt(Gi,{"aria-label":"\uB2EB\uAE30",onClick:r,sx:{color:"#6b7280"},children:Bt(W5,{})}):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:()=>N(null),onConfirm:()=>{P&&b(e.seq,P.nextCompleted),N(null)}}),Bt(Lo,{anchorEl:B,value:e.icon??"",color:e.icon_color??"",onSelect:v=>{i(e.seq,v),A(null)},onSelectColor:s?v=>s(e.seq,v):void 0,onClose:()=>A(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),d?.(e)}}),Bt(Bl,{open:g,taskSeq:e.seq,items:n,loading:c,onLoad:o,onClose:()=>m(!1)})]})}import{useState as bn}from"react";import{Box as Zt,Button as Xi,ButtonBase as Ip,Checkbox as s4,Divider as bi,Menu as Au,MenuItem as Du}from"@mui/material";import a4 from"@mui/icons-material/ExpandLess";import l4 from"@mui/icons-material/ExpandMore";import c4 from"@mui/icons-material/ConfirmationNumberOutlined";import Ep from"@mui/icons-material/Check";import u4 from"@mui/icons-material/DirectionsRunOutlined";import d4 from"@mui/icons-material/SpeedOutlined";import Pu from"@mui/icons-material/CheckCircle";import f4 from"@mui/icons-material/CheckCircleOutlineOutlined";import Nu from"@mui/icons-material/CheckCircleOutlined";import Mp from"@mui/icons-material/AccessTimeOutlined";import h4 from"@mui/icons-material/AutorenewOutlined";import p4 from"@mui/icons-material/LabelOutlined";import m4 from"@mui/icons-material/PersonOutlineOutlined";import g4 from"@mui/icons-material/SubjectOutlined";import b4 from"@mui/icons-material/StickyNote2Outlined";import y4 from"@mui/icons-material/PanToolAltOutlined";import Rp from"@mui/icons-material/LockOutlined";import Op from"@mui/icons-material/PublicOutlined";import Ap from"@mui/icons-material/Group";import x4 from"@mui/icons-material/Repeat";import v4 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as Dp,InfoAlert as w4}from"@ehfuse/alerts";import{DatePicker as _4}from"@ehfuse/mui-datetime-picker";import{useState as Z5}from"react";import{TextField as J5}from"@ehfuse/mui-form-controls";import{jsx as Q5}from"react/jsx-runtime";function kp({value:e,onCommit:p,onDraftChange:b,readOnly:l=!1}){let[i,s]=Z5(null);return Q5(J5,{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 Mu,useState as Ru}from"react";import{Box as Rr,Button as Cp,IconButton as e4}from"@mui/material";import t4 from"@mui/icons-material/AccountTreeOutlined";import r4 from"@mui/icons-material/LinkOutlined";import n4 from"@mui/icons-material/Close";import o4 from"@mui/icons-material/RedoOutlined";function gi(e){return e.relations??[]}function Zj(e,p,b){return gi(e).some(l=>l.type===b&&l.task_seq===p.seq)||gi(p).some(l=>l.type===b&&l.task_seq===e.seq)}function Sp(e){return`${e.created_time??""}|${String(e.seq).padStart(12,"0")}`}function Iu(e,p){let b=new Map(p.map(f=>[f.seq,f]));b.set(e.seq,e);let l=new Map,i=(f,u)=>{l.has(f)||l.set(f,new Set),l.has(u)||l.set(u,new Set),l.get(f).add(u),l.get(u).add(f)};for(let f of b.values())for(let u of gi(f))u.type==="follow_up"&&b.has(u.task_seq)&&i(f.seq,u.task_seq);let s=new Set([e.seq]),r=[e.seq];for(;r.length>0;){let f=r.shift();for(let u of l.get(f)??[])s.has(u)||(s.add(u),r.push(u))}let t=[...s].map(f=>b.get(f)).filter(f=>!!f).sort((f,u)=>Sp(f).localeCompare(Sp(u))),n=new Set;for(let f of gi(e))f.type==="related"&&n.add(f.task_seq);for(let f of b.values())f.seq!==e.seq&&gi(f).some(u=>u.type==="related"&&u.task_seq===e.seq)&&n.add(f.seq);let c=[...n].map(f=>b.get(f)).filter(f=>f!==void 0&&f.seq!==e.seq),o=[...b.values()].filter(f=>f.seq!==e.seq&&gi(f).some(u=>u.type==="duplicate_of"&&u.task_seq===e.seq)),a=gi(e).find(f=>f.type==="duplicate_of")?.task_seq,d=a?b.get(a)??null:null;return{lineage:t,related:c,duplicates:o,duplicateOf:d}}function Eu(e,p){let b=Iu(e,p);return(b.lineage.length>=2?b.lineage.length-1:0)+b.related.length+b.duplicates.length+(b.duplicateOf?1:0)}function Tp(e,p){return Eu(e,p)>0}import{Fragment as i4,jsx as Xt,jsxs as Mn}from"react/jsx-runtime";function Ou({item:e,caption:p,onOpen:b,onUnlink:l}){let i=e.is_notice||e.is_event?_t(e.icon||(e.is_notice?or:ar)):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:lr(e),small:!0}),l?Xt(e4,{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(n4,{sx:{fontSize:15}})}):null]})}function Bp({task:e,tasks:p,readOnly:b=!1,onOpenTask:l,onLink:i,onUnlink:s,onCreateFollowUp:r}){let[t,n]=Ru(!1),[c,o]=Ru(null),[a,d]=Ru(null),f=Mu(()=>Iu(e,p),[e,p]),u=f.lineage.length>=2,g=Mu(()=>Eu(e,p),[e,p]),m=Mu(()=>{let _=new Set;for(let B of f.lineage)_.add(B.seq);for(let B of f.related)_.add(B.seq);for(let B of f.duplicates)_.add(B.seq);return f.duplicateOf&&_.add(f.duplicateOf.seq),[..._]},[f]),x=(_,B,A)=>{d({anchorEl:_,targetSeq:B,type:A})};return Mn(gn,{icon:Xt(t4,{sx:{fontSize:19,display:"block"}}),title:Mn(i4,{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(Cp,{size:"small",color:"inherit",startIcon:Xt(o4,{sx:{fontSize:16}}),onClick:_=>o(_.currentTarget),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uD6C4\uC18D \uC5C5\uBB34"}):null,i?Xt(Cp,{size:"small",color:"inherit",startIcon:Xt(r4,{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:f.related.length||f.duplicates.length||f.duplicateOf?1:0},children:f.lineage.map((_,B)=>{let A=_.seq===e.seq,j=B===f.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:A?9:7,height:A?9:7,borderRadius:"50%",bgcolor:A?"#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:!A&&l?()=>l(_.seq):void 0,sx:{minWidth:0,fontSize:14,fontWeight:A?600:400,color:A?"#2f80ed":_.completed?"#9a9a97":"#37352f",textDecoration:_.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...!A&&l?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[_.ticket_no?`${_.ticket_no} `:"",_.title]}),Xt(Ot,{option:lr(_),small:!0})]}),Xt(Rr,{sx:{fontSize:12,color:"#9a9a97"},children:_.completed&&_.completed_time?`${_.completed_time} \uC644\uB8CC`:_.created_time??""})]})]},_.seq)})}):null,f.duplicateOf?Xt(Ou,{item:f.duplicateOf,caption:"\uC6D0\uBCF8",onOpen:l?()=>l(f.duplicateOf.seq):void 0,onUnlink:!b&&s?_=>x(_.currentTarget,f.duplicateOf.seq,"duplicate_of"):void 0}):null,f.duplicates.map(_=>Xt(Ou,{item:_,caption:"\uC911\uBCF5",onOpen:l?()=>l(_.seq):void 0,onUnlink:!b&&s?B=>x(B.currentTarget,_.seq,"duplicate_of"):void 0},`dup-${_.seq}`)),f.related.map(_=>Xt(Ou,{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(pl,{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:()=>d(null),onConfirm:()=>{a&&s?.(e.seq,a.targetSeq,a.type),d(null)}})]})}import{Fragment as qr,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 Pp({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:d,onChangeVisibility:f,onChangeRepeat:u,departments:g=[],onChangeEventTime:m,onChangeEventPlace:x,onChangeEventAddress:_,onChangeNote:B,onChangeNoteDraft:A,onChangeContent:j,contentTemplates:D,onSaveContentTemplate:P,onRemoveContentTemplate:N,contentLoading:q=!1,onChangeContentHeight:z,onAddChecklistItem:T,onToggleChecklistItem:C,onRemoveChecklistItem:R,onUpdateChecklistItem:h,onReorderChecklist:y,onConvertChecklistToTask:v,onOpenChecklistTask:w,onLinkChecklistTask:k,resolveChecklistTask:S,relatedTasksPool:E,onOpenRelatedTask:L,onLinkRelatedTask:$,onUnlinkRelatedTask:U,onCreateFollowUpTask:O,onAddAttachments:W,onRemoveAttachment:M,onPreview:I,onDownload:F,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:de=!1,hideSprint:We=!1,onChangeSprint:Ne,onChangeStoryPoints:se,onChangeResolution:Be,onClaimTask:ye,onVerifyBug:xe}){let[Ue,Te]=bn(null),[ue,Me]=bn(null),[ke,Ie]=bn(null),[lt,Le]=bn(null),[$e,Tt]=bn(!1),je={[Cn]:$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]=bn(null),[Ze,He]=bn(null),[vt,Ye]=bn(null),[te,ce]=bn(null),[pe,Se]=bn(null),[Xe,Re]=bn(null),[De,yt]=bn(null),Ae=!!e.is_notice,Ce=!!e.is_event,et=!!e.is_bug,st=!!ye&&Ea(e,Z),ft=!!ye&&Ma(e,Z),wt=!!xe&&et&&!!e.completed&&Z>0&&(e.author_account_seq??0)===Z&&!(e.acks??[]).some(oe=>oe.account_seq===Z),pt=!so(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?or:ar)):null,Pt=Ae?!Ia(e,Z):pt,Vt=st||ft?Wt(Nn,{onClick:oe=>yt(oe.currentTarget),children:[we(y4,{sx:{fontSize:16,mr:.5}}),"\uAC00\uC838\uAC00\uAE30"]}):null,Q=Ae?_l(e,me):"",ae=Ae?tp(e,me,Z):null,ge=Ae?null:Ha(e,Z),be=!!(ge&&ge.total>0||Ae&&ae),Ee=!Ae,ze=Wt(qr,{children:[we(mt,{icon:we(m4,{sx:{fontSize:17}}),label:"\uC791\uC131\uC790",sx:[Vn(9),je??null,...Ce?[]:[tr(1)]],children:e.created_by?Wt(qr,{children:[we(jr,{names:[e.created_by],size:20,avatarSrcByName:l}),e.created_by]}):we(Uo,{})}),we(mt,{icon:we(Mp,{sx:{fontSize:17}}),label:"\uC791\uC131\uC77C\uC2DC",sx:[Vn(11),je??null,...Ce?[]:[tr(2)]],children:e.created_time?nn(e.created_time):we(Uo,{})})]});return Wt(qr,{children:[ee?Wt(Zt,{sx:{px:2,pt:2,pb:.5,display:"flex",alignItems:"flex-start",gap:1},children:[Ut?we(s4,{checked:e.completed,icon:we(f4,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:we(Pu,{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(Ip,{onClick:oe=>Me(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,[Cn]:{pb:0,"& > :last-child":{mb:0}}},children:[we(ll,{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=>d(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(qr,{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(qr,{children:[we(Xi,{variant:"contained",size:"large",onClick:()=>xe?.(e.seq,!0),sx:{bgcolor:"#2f80ed"},children:"\uAC80\uC99D\uC644\uB8CC"}),we(Xi,{variant:"outlined",size:"large",color:"error",onClick:()=>xe?.(e.seq,!1),children:"\uC7AC\uC624\uD508"})]}):null]}):null,et&&e.ticket_no?we(mt,{icon:we(c4,{sx:{fontSize:17}}),label:"\uD2F0\uCF13",sx:tr(1),children:we(Zt,{component:"span",sx:{fontVariantNumeric:"tabular-nums"},children:e.ticket_no})}):null,Ce?null:we(Zt,{sx:et&&e.ticket_no||Ee||be?tr(et&&e.ticket_no?2:1):{gridColumn:"1 / -1"},children:we(mt,{icon:we(h4,{sx:{fontSize:17}}),label:"\uC0C1\uD0DC",onClick:pt||e.completed?void 0:oe=>xt(oe),children:we(Ot,{option:lr(e)})})}),Ae?null:(()=>{let oe=_n(e),it=oe==="all"?we(Op,{sx:{fontSize:17,color:"#2f80ed"}}):oe==="group"?we(Ap,{sx:{fontSize:17,color:"#d9730d"}}):we(Rp,{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:tr(et?1:2),children:we(mt,{icon:it,label:"\uACF5\uAC1C",onClick:pt||!f?void 0:Ge=>He(Ge),children:Je})})})(),!Ae&&!et?we(Zt,{sx:Ce?void 0:tr(1),children:we(mt,{icon:we(x4,{sx:{fontSize:17,...e.repeat_rule?{color:"#2f80ed"}:{}}}),label:"\uBC18\uBCF5",onClick:pt||!u?void 0:oe=>Ye(oe),children:e.repeat_rule?nl(e.repeat_rule):we(Uo,{label:"\uC5C6\uC74C"})})}):null,!Ae&&!et&&e.repeat_rule?we(Zt,{sx:Ce?void 0:tr(2),children:we(mt,{icon:we(v4,{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:tr(2),children:we(mt,{icon:we(Nu,{sx:{fontSize:17}}),label:"\uD655\uC778",children:ge.canConfirm?we(Xi,{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(Xi,{size:"small",variant:"outlined",color:"inherit",startIcon:ge.myTime?we(Pu,{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:tr(2),children:we(mt,{icon:we(Nu,{sx:{fontSize:17}}),label:"\uD655\uC778",children:we(Zt,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,minWidth:0},children:ae.canAck?we(Xi,{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(Xi,{size:"small",variant:"outlined",color:"inherit",startIcon:ae.acked?we(Pu,{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(qr,{children:[ae.count,we(Zt,{component:"span",sx:{mx:.4},children:"/"}),ae.total]})})})})}):null,de&&!We&&!Ce&&!Ae?Wt(qr,{children:[we(mt,{icon:we(u4,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:pt?void 0:oe=>Se(oe),sx:tr(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(d4,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",sx:tr(2),children:we(vo,{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"}:tr(1),je??null],children:we(mt,{icon:we(p4,{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(qr,{children:[et?we(cl,{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(qr,{children:[we(mt,{icon:we(Nu,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC790",sx:[Vn(10),je??null,...Ce?[]:[tr(1)]],children:e.completed_by?Wt(qr,{children:[we(jr,{names:[e.completed_by],size:20,avatarSrcByName:l}),e.completed_by]}):we(Uo,{})}),we(mt,{icon:we(Mp,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC77C\uC2DC",sx:[Vn(12),je??null,...Ce?[]:[tr(2)]],children:e.completed_time?nn(e.completed_time):we(Uo,{})})]}):null]})}),Wt(Zt,{sx:{display:"none",[Cn]:{display:"block",mt:1.5,mb:0}},children:[we(bi,{sx:{borderColor:"#e6e6e3"}}),we(Ip,{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(qr,{children:["\uC811\uAE30 ",we(a4,{sx:{fontSize:18}})]}):Wt(qr,{children:["\uC815\uBCF4 \uB354\uBCF4\uAE30 ",we(l4,{sx:{fontSize:18}})]})})]}),Wt(Zt,{children:[we(bi,{sx:{my:1.5,borderColor:"#e6e6e3",[Cn]:{mt:0,mb:1.25}}}),we(gn,{icon:we(g4,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",titleExtra:D&&!pt?we(dl,{content:e.content??"",templates:D,onApply:oe=>j?.(e.seq,oe),onSave:P,onRemove:N}):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(za,{})}):we(fl,{syncKey:e.seq,value:e.content??"",height:e.content_height??0,onChangeHeight:z?oe=>z(e.seq,oe):void 0,readOnly:pt,onChange:oe=>j(e.seq,oe)})})}),e.is_bug?null:Wt(qr,{children:[we(bi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(gn,{icon:we(b4,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:we(Zt,{sx:{userSelect:"text"},children:we(kp,{value:e.note,readOnly:Pt,onCommit:oe=>B(e.seq,oe),onDraftChange:A?oe=>A(e.seq,oe):void 0})})})]}),Ce?null:Wt(qr,{children:[we(bi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(ml,{taskSeq:e.seq,checklist:e.checklist??[],removeLocked:Pt,onAdd:T,onToggle:C,onRemove:R,onUpdate:h,onReorder:y,onConvertToTask:v,onOpenLinkedTask:w,resolveLinkedTask:S,myAccountSeq:Z,linkCandidates:E,linkBaseTask:e,onLinkExistingTask:k})]}),E&&!Ce&&!Ae&&Tp(e,E)?Wt(qr,{children:[we(bi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(Bp,{task:e,tasks:E,readOnly:pt,onOpenTask:L,onLink:$,onUnlink:U,onCreateFollowUp:O})]}):null,we(bi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(xl,{taskSeq:e.seq,attachments:e.attachments??[],removeLocked:Pt,onAdd:W,onRemove:M,onPreview:I?oe=>I({...oe,taskSeq:e.seq}):void 0,onDownload:F?oe=>F({...oe,taskSeq:e.seq}):void 0})]}),we(bi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(gp,{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:F?oe=>F({...oe,taskSeq:e.seq}):void 0})]}),we(Ii,{anchorEl:Fe,value:e.status,options:Ae?gs:et?ri:bs,onSelect:oe=>i(e.seq,oe),onClose:()=>xt(null)}),we(Au,{transitionDuration:0,anchorEl:vt,open:!!vt,onClose:()=>Ye(null),children:[{value:"",label:"\uC5C6\uC74C"},...Ms].map(oe=>we(Du,{selected:(e.repeat_rule??"")===oe.value,onClick:()=>{Ye(null),(async()=>{let it=e.repeat_rule??"";if(oe.value===it)return;if(oe.value===""){await Dp({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){w4(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 Dp({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,ol(Je,oe.value))})()},sx:{fontSize:14,minWidth:140},children:oe.label},oe.value||"none"))}),we(_4,{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=rt=>String(rt).padStart(2,"0"),Je=`${oe.getFullYear()}-${it(oe.getMonth()+1)}-${it(oe.getDate())}`,Ge=e.repeat_rule??"";Ge&&u?.(e.seq,Ge,Je)}}),we(Au,{transitionDuration:0,anchorEl:Ze,open:!!Ze,onClose:()=>He(null),children:[{key:"involved",label:"\uBE44\uACF5\uAC1C",icon:we(Rp,{sx:{fontSize:17,color:"#57564f"}}),selected:_n(e)==="involved",onPick:()=>f?.(e.seq,"involved",0)},{key:"all",label:"\uC804\uCCB4\uACF5\uAC1C",icon:we(Op,{sx:{fontSize:17,color:"#2f80ed"}}),selected:_n(e)==="all",onPick:()=>f?.(e.seq,"all",0)},...g.map(oe=>({key:`group-${oe.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${oe.name}`,icon:we(Ap,{sx:{fontSize:17,color:"#d9730d"}}),selected:_n(e)==="group"&&(e.visibility_group_seq??0)===oe.seq,onPick:()=>f?.(e.seq,"group",oe.seq)}))].map(oe=>Wt(Du,{selected:oe.selected,onClick:()=>{oe.onPick(),He(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[oe.icon,oe.label,oe.selected?we(Ep,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},oe.key))}),we(Au,{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:pn(oe)}))].map(oe=>Wt(Du,{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(Ep,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},oe.seq))}),we($a,{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(wl,{anchorEl:Xe,selectedKeys:e.label_keys??[],labelOptions:b,onToggle:oe=>s(e.seq,Ca(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),Me(null)},onSelectColor:le?oe=>le(e.seq,oe):void 0,onClose:()=>Me(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 E4,jsx as $r,jsxs as qp}from"react/jsx-runtime";function OF(){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 AF({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:d,onLoadActivity:f,onPrint:u,onDelete:g,canDelete:m,...x}){let _=Nt(),B=Lp(null);p&&(B.current=p);let A=p??B.current,[j,D]=jp(!1),[P,N]=jp({}),q=Object.keys(P).length>0;Np(()=>{N({})},[p?.seq,e]);let z=Lp(null);if(Np(()=>{z.current?.scrollTo({top:0})},[p?.seq]),!A)return null;let T=_&&q?{...A,...P}:A,C=T.checklist??[],R=(S,E)=>{_?N(L=>({...L,...S})):E()},h=()=>{let S=P;N({});let E=A.seq,L=S.title===void 0?void 0:String(S.title).trim();if(i){let $={...S};L!==void 0&&(L?$.title=L:delete $.title),Object.keys($).length>0&&i(E,$),Fp({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"});return}L&&n(E,L),S.icon!==void 0&&c(E,String(S.icon)),S.icon_color!==void 0&&o?.(E,String(S.icon_color)),S.status!==void 0&&x.onChangeStatus(E,S.status),S.label_keys!==void 0&&x.onChangeLabels(E,S.label_keys??[]),S.tab_key!==void 0&&x.onChangeProject(E,String(S.tab_key??"")),S.start_date!==void 0&&x.onChangeDate(E,"start_date",String(S.start_date??"")),S.due_date!==void 0&&x.onChangeDate(E,"due_date",String(S.due_date??"")),S.reminder!==void 0&&x.onChangeReminder(E,S.reminder),S.priority!==void 0&&x.onChangePriority(E,S.priority),S.event_time!==void 0&&x.onChangeEventTime?.(E,String(S.event_time??"")),S.event_place!==void 0&&x.onChangeEventPlace?.(E,String(S.event_place??"")),S.event_address!==void 0&&x.onChangeEventAddress?.(E,String(S.event_address??"")),S.content!==void 0&&x.onChangeContent(E,String(S.content??"")),S.note!==void 0&&x.onChangeNote(E,String(S.note??"")),S.visibility!==void 0&&x.onChangeVisibility?.(E,S.visibility,Number(S.visibility_group_seq??0)),Fp({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"})},y={...x,onChangeStatus:(S,E)=>R({status:E},()=>x.onChangeStatus(S,E)),onChangeLabels:(S,E)=>R({label_keys:E},()=>x.onChangeLabels(S,E)),onChangeProject:(S,E)=>R({tab_key:E},()=>x.onChangeProject(S,E)),onChangeDate:(S,E,L)=>R({[E]:L},()=>x.onChangeDate(S,E,L)),onChangeReminder:(S,E)=>R({reminder:E},()=>x.onChangeReminder(S,E)),onChangePriority:(S,E)=>R({priority:E},()=>x.onChangePriority(S,E)),onChangeEventTime:(S,E)=>R({event_time:E},()=>x.onChangeEventTime?.(S,E)),onChangeEventPlace:(S,E)=>R({event_place:E},()=>x.onChangeEventPlace?.(S,E)),onChangeEventAddress:(S,E)=>R({event_address:E},()=>x.onChangeEventAddress?.(S,E)),onChangeContent:(S,E)=>R({content:E},()=>x.onChangeContent(S,E)),onChangeNote:(S,E)=>R({note:E},()=>x.onChangeNote(S,E)),onMemberEdit:(S,E)=>x.onMemberEdit(S,E,_?L=>N($=>({...$,...L})):null),onChangeNoteDraft:_?(S,E)=>R({note:E},()=>{}):void 0,onChangeVisibility:x.onChangeVisibility?(S,E,L)=>R({visibility:E,visibility_group_seq:L},()=>x.onChangeVisibility?.(S,E,L)):void 0,onAddChecklistItem:(S,E)=>R({checklist:[...C,{label:E,checked:!1}]},()=>x.onAddChecklistItem(S,E)),onToggleChecklistItem:(S,E,L)=>R({checklist:C.map(($,U)=>U===E?{...$,checked:L}:$)},()=>x.onToggleChecklistItem(S,E,L)),onRemoveChecklistItem:(S,E)=>R({checklist:C.filter((L,$)=>$!==E)},()=>x.onRemoveChecklistItem(S,E)),onUpdateChecklistItem:x.onUpdateChecklistItem?(S,E,L)=>R({checklist:C.map(($,U)=>U===E?{...$,label:L}:$)},()=>x.onUpdateChecklistItem?.(S,E,L)):void 0,onReorderChecklist:x.onReorderChecklist?(S,E)=>R({checklist:E},()=>x.onReorderChecklist?.(S,E)):void 0,onLinkChecklistTask:x.onLinkChecklistTask?(S,E,L)=>R({checklist:[...C,{label:L,checked:!1,task_seq:E}]},()=>x.onLinkChecklistTask?.(S,E,L)):void 0},v=$r(Pp,{...y,task:T,myAccountSeq:r,onChangeTitle:(S,E)=>R({title:E},()=>n(S,E)),onToggleCompleted:t,onChangeIcon:(S,E)=>R({icon:E},()=>c(S,E)),onChangeIconColor:(S,E)=>R({icon_color:E},()=>o?.(S,E)),showTitle:_}),w=$r(bp,{onSubmit:(S,E)=>l(T.seq,S,E)},T.seq);return _||s==="dialog"?qp(E4,{children:[$r(I4,{open:e,onClose:b,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:T.is_notice?"\uACF5\uC9C0\uC0AC\uD56D":T.is_event?"\uC77C\uC815":T.is_bug?"\uC624\uB958":"\uC5C5\uBB34",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[...f?[{icon:$r(C4,{sx:{color:"#6b7280"}}),tooltip:"\uD65C\uB3D9",onClick:()=>D(!0)}]:[],{icon:$r(T4,{sx:{color:"#6b7280"}}),tooltip:"\uACF5\uC720\uD558\uAE30",onClick:()=>Vi(T,!0)},..._?[{raw:!0,icon:$r(k4,{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:$r(Il,{sx:{userSelect:"none",width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:v})}]},A.seq),$r(Bl,{open:j,taskSeq:T.seq,items:a,loading:d,onLoad:f,onClose:()=>D(!1)})]}):$r(S4,{anchor:"right",open:e,onClose:b,"aria-label":"\uC5C5\uBB34 \uC0C1\uC138",disableAutoFocus:!0,disableEnforceFocus:!0,sx:{zIndex:S=>S.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:qp(Il,{sx:{display:"flex",flexDirection:"column",height:"100%",userSelect:"none"},children:[$r(_p,{task:T,myAccountSeq:r,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:c,onChangeIconColor:o,onClose:b,activityItems:a,activityLoading:d,onLoadActivity:f,onPrint:u,onDelete:g,canDelete:m}),$r(zp,{sx:{borderColor:"#e6e6e3"}}),$r(Il,{sx:{flex:1,minHeight:0},children:$r(B4,{ref:z,style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:v})}),$r(zp,{sx:{borderColor:"#37352f"}}),$r(Il,{sx:{flexShrink:0},children:w})]})})}import{useEffect as j4,useState as To}from"react";import{Box as Hr,Button as Fu,IconButton as Wp}from"@mui/material";import{FormDialog as Up}from"@ehfuse/mui-form-dialog";import z4 from"@mui/icons-material/Add";import F4 from"@mui/icons-material/DirectionsRunOutlined";import q4 from"@mui/icons-material/EditOutlined";import{ErrorAlert as Vp}from"@ehfuse/alerts";import{ClearTextField as Kp,DateTextField as Gp,LabelSelect as Yp}from"@ehfuse/mui-form-controls";import{useEffect as M4,useState as $p}from"react";import{Box as So,Button as R4,FormControlLabel as Lu,Radio as ju,RadioGroup as O4}from"@mui/material";import{FormDialog as A4}from"@ehfuse/mui-form-dialog";import{LabelSelect as D4}from"@ehfuse/mui-form-controls";import P4 from"@ehfuse/overlay-scrollbar";import{Fragment as N4,jsx as Or,jsxs as Zi}from"react/jsx-runtime";function Hp({open:e,sprint:p,remainingTasks:b,sprints:l,onClose:i,onConfirm:s}){let r=l.filter(d=>d.seq!==p?.seq&&d.group_seq===(p?.group_seq??0)&&d.status!=="closed"),[t,n]=$p("backlog"),[c,o]=$p(0);M4(()=>{e&&(n(r.length>0?"move":"backlog"),o(r[0]?.seq??0))},[e]);let a=b.length>0;return Or(A4,{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(R4,{variant:"contained",onClick:()=>s({mode:a?t:"keep",moveToSprintSeq:t==="move"?c:0,taskSeqs:b.map(d=>d.seq)}),disabled:a&&t==="move"&&!(c>0),children:"\uB9C8\uAC10"})},sections:[{id:"sprint-close",title:"",showTitle:!1,children:Zi(So,{sx:{display:"flex",flexDirection:"column",gap:2},children:[Zi(So,{sx:{fontSize:18,color:"#37352f"},children:[Or(So,{component:"span",sx:{fontWeight:600},children:p?.name??""})," \uBAA9\uD45C\uB97C \uB9C8\uAC10\uD569\uB2C8\uB2E4."]}),a?Zi(N4,{children:[Zi(So,{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(So,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:Or(P4,{style:{maxHeight:220},thumb:{width:6},children:b.map(d=>Zi(So,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,borderBottom:"1px solid #f2f2f0","&:last-of-type":{borderBottom:"none"}},children:[Or(So,{sx:{flex:1,minWidth:0,fontSize:16,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.title}),Or(Ot,{option:lr(d)})]},d.seq))})}),Zi(O4,{value:t,onChange:(d,f)=>n(f),children:[r.length>0?Or(Lu,{value:"move",control:Or(ju,{size:"small"}),label:"\uB2E4\uC74C \uBAA9\uD45C\uB85C \uC774\uC6D4",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}}):null,t==="move"&&r.length>0?Or(So,{sx:{pl:4,pb:1},children:Or(D4,{size:"small",label:"",fullWidth:!0,value:String(c),options:r.map(d=>({value:String(d.seq),label:d.name})),onChange:d=>o(Number(d.target.value)||0)})}):null,Or(Lu,{value:"backlog",control:Or(ju,{size:"small"}),label:"\uBBF8\uBC30\uC815(\uBC31\uB85C\uADF8)\uC73C\uB85C \uBE7C\uAE30",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}}),Or(Lu,{value:"keep",control:Or(ju,{size:"small"}),label:"\uC774 \uBAA9\uD45C\uC5D0 \uADF8\uB300\uB85C \uB450\uAE30",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}})]})]}):Or(So,{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 zu="custom-";function L4(e){return e.startsWith(zu)}function UF(e){return e>0?`${zu}${e}`:""}function Vo(e){if(!L4(e))return 0;let p=Number(e.slice(zu.length));return Number.isInteger(p)&&p>0?p:0}import{Fragment as Zp,jsx as zt,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 Xp(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):"-"}function oq({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,d]=To(""),[f,u]=To(""),[g,m]=To(""),[x,_]=To(""),[B,A]=To(""),[j,D]=To(!1),[P,N]=To(!1),[q,z]=To(null),T=q?t.filter(E=>(E.sprint_seq??0)===q.seq&&!E.completed):[],[C,R]=To(0);j4(()=>{e&&(d(o.length===1?o[0].key:""),u(""),m(""),_(""),A(""),R(0))},[e]);let h=()=>{u(""),m(""),_(""),A(""),R(0),N(!1)},y=E=>{R(E.seq),d(`custom-${E.group_seq}`),u(E.name),m(E.goal),_(E.start_date),A(E.end_date)},v=C>0||P,w=async()=>{let E=Vo(a);if(!E){Vp("\uBAA9\uD45C\uB97C \uB9CC\uB4E4 \uD504\uB85C\uC81D\uD2B8\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}if(!f.trim()){Vp("\uBAA9\uD45C \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}D(!0);try{if(C>0){s(C,{name:f.trim(),goal:g.trim(),start_date:x,end_date:B}),h();return}await i({group_seq:E,name:f.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])),S=zt(Hr,{children:o.length===0?zt(Hr,{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.'}):zt(Zp,{children:zt(Hr,{children:b.length===0?Ko(Hr,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[zt(F4,{sx:{fontSize:48,color:"#d9d9d6"}}),zt(Hr,{sx:{fontSize:13.5},children:"\uB4F1\uB85D\uB41C \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):b.map(E=>Ko(Hr,{sx:{display:"flex",flexDirection:"column",gap:1,"&:not(:last-of-type)::after":{content:'""',display:"block",my:1.75,borderBottom:"1px solid #f0efed"}},children:[Ko(Hr,{sx:{minWidth:0},children:[Ko(Hr,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[zt(Hr,{component:"span",sx:{fontSize:18,fontWeight:600,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:E.name}),zt(Hr,{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(Hr,{component:"span",sx:{flexShrink:0,fontSize:14,color:"#57564f"},children:[Xp(E.start_date)," ~"," ",Xp(E.end_date)]})]}),E.goal?zt(Hr,{sx:{mt:.5,fontSize:14,color:"#787774",lineHeight:1.5},children:E.goal}):null]}),Ko(Hr,{sx:{display:"flex",alignItems:"center",gap:.5},children:[zt(Yp,{label:"\uC0C1\uD0DC",showLabel:!1,size:"small",value:E.status,options:$4.map(L=>({value:L.value,label:L.label})),onChange:L=>{let $=String(L.target.value);if($==="closed"&&n){z(E);return}r(E.seq,$)},sx:{width:104,flexShrink:0}}),zt(Wp,{"aria-label":"\uBAA9\uD45C \uC218\uC815",onClick:()=>y(E),sx:{color:"#9a9a97","&:hover":{color:"#2563eb"}},children:zt(q4,{sx:{fontSize:18}})}),zt(Wp,{"aria-label":"\uBAA9\uD45C \uC0AD\uC81C",onClick:()=>c(E.seq),sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:zt(cr,{style:{width:16,height:16}})})]})]},E.seq))})})});return Ko(Zp,{children:[zt(Up,{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:S}],sectionContentPaddingTop:0,actions:{showCancelButton:!0,left:o.length>0?zt(Fu,{startIcon:zt(z4,{}),onClick:()=>{h(),N(!0)},sx:{color:"#2563eb"},children:"\uC0C8 \uBAA9\uD45C"}):void 0,right:zt(Fu,{variant:"contained",onClick:l,children:"\uD655\uC778"})}}),zt(Hp,{open:q!==null,sprint:q,remainingTasks:T,sprints:b,onClose:()=>z(null),onConfirm:E=>{q&&n?.(q.seq,E),z(null)}}),zt(Up,{open:v,onClose:()=>{N(!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:zt(Hr,{sx:{pt:1},children:Ko(Hr,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2.5,mt:1},children:[zt(Yp,{label:"\uD504\uB85C\uC81D\uD2B8",size:"medium",value:a,options:o.map(E=>({value:E.key,label:E.label})),onChange:E=>d(String(E.target.value)),disabled:C>0}),zt(Kp,{label:"\uBAA9\uD45C \uC774\uB984",size:"medium",placeholder:"\uC608: 8\uC6D4 2\uC8FC\uCC28",value:f,onChange:E=>u(E.target.value)}),zt(Gp,{size:"medium",label:"\uC2DC\uC791\uC77C",value:x,onChange:E=>_(E.target.value)}),zt(Gp,{size:"medium",label:"\uC885\uB8CC\uC77C",value:B,onChange:E=>A(E.target.value)}),zt(Kp,{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:zt(Fu,{variant:"contained",onClick:()=>{w()},disabled:j,children:C>0?"\uC218\uC815":"\uBAA9\uD45C \uB9CC\uB4E4\uAE30"})}})]})}import{Box as Go,Button as tm,Tooltip as H4}from"@mui/material";import{FormDialog as W4}from"@ehfuse/mui-form-dialog";import Qp from"@mui/icons-material/CalendarMonthOutlined";import U4 from"@mui/icons-material/EventOutlined";var qu={google:{key:"google",name:"\uAD6C\uAE00 \uCE98\uB9B0\uB354",homeUrl:"https://calendar.google.com/calendar",defaultCalendarName:"\uAD6C\uAE00 \uCE98\uB9B0\uB354",exportSupported:!0,importSupported:!0,subscribeSteps:["\uBC84\uD2BC\uC774 \uB3D9\uC791\uD558\uC9C0 \uC54A\uC73C\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354 > \uB2E4\uB978 \uCE98\uB9B0\uB354 + > **URL\uB85C \uCD94\uAC00**\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.","\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.","\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."],importSteps:["\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 > **\uC124\uC815 \uBC0F \uACF5\uC720**\uB97C \uC5FD\uB2C8\uB2E4.","**\uCE98\uB9B0\uB354 \uD1B5\uD569** \uC139\uC158\uC758 **iCal \uD615\uC2DD\uC758 \uBE44\uBC00 \uC8FC\uC18C**\uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."],importPlaceholder:"https://calendar.google.com/calendar/ical/\u2026/basic.ics",buildSubscribeUrl:e=>`https://calendar.google.com/calendar/r?cid=${encodeURIComponent(e.replace(/^https?:\/\//,"webcal://"))}`},apple:{key:"apple",name:"\uC560\uD50C \uCE98\uB9B0\uB354",homeUrl:"https://www.icloud.com/calendar",defaultCalendarName:"\uC560\uD50C \uCE98\uB9B0\uB354",exportSupported:!0,importSupported:!0,subscribeSteps:["\uC544\uC774\uD3F0\xB7\uC544\uC774\uD328\uB4DC: **\uC124\uC815 > \uCE98\uB9B0\uB354 > \uACC4\uC815 > \uACC4\uC815 \uCD94\uAC00 > \uAE30\uD0C0 > \uAD6C\uB3C5 \uCE98\uB9B0\uB354 \uCD94\uAC00**\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.","\uB9E5: \uCE98\uB9B0\uB354 \uC571 > **\uD30C\uC77C > \uC0C8\uB85C\uC6B4 \uCE98\uB9B0\uB354 \uAD6C\uB3C5**\uC5D0 \uBD99\uC5EC\uB123\uC2B5\uB2C8\uB2E4.","iCloud.com(\uC6F9)\uC5D0\uC11C\uB294 \uAD6C\uB3C5\uC744 \uCD94\uAC00\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 \uAE30\uAE30\uC5D0\uC11C \uCD94\uAC00\uD558\uBA74 iCloud \uB85C \uB3D9\uAE30\uD654\uB429\uB2C8\uB2E4."],importSteps:["iCloud.com > \uCE98\uB9B0\uB354\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354 \uC606 **\uACF5\uC720 \uC544\uC774\uCF58**\uC744 \uB204\uB985\uB2C8\uB2E4.","**\uACF5\uC6A9 \uCE98\uB9B0\uB354**\uB97C \uCF1C\uACE0 \uB098\uC624\uB294 **\uB9C1\uD06C\uB97C \uBCF5\uC0AC**\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694(webcal:// \uC8FC\uC18C\uB3C4 \uADF8\uB300\uB85C \uB429\uB2C8\uB2E4)."],importPlaceholder:"webcal://p00-calendars.icloud.com/published/\u2026",importWarning:"\uC560\uD50C\uC740 **\uACF5\uC6A9 \uCE98\uB9B0\uB354**\uB85C \uBC14\uAFD4\uC57C \uC8FC\uC18C\uAC00 \uB098\uC635\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC544\uB294 \uC0AC\uB78C\uC740 \uADF8 \uCE98\uB9B0\uB354\uB97C \uBCFC \uC218 \uC788\uC73C\uB2C8, \uAC1C\uC778 \uC77C\uC815\uC774 \uB2F4\uAE34 \uCE98\uB9B0\uB354\uB294 \uACF5\uAC1C\uD558\uC9C0 \uB9C8\uC138\uC694."},naver:{key:"naver",name:"\uB124\uC774\uBC84 \uCE98\uB9B0\uB354",homeUrl:"https://calendar.naver.com",defaultCalendarName:"\uB124\uC774\uBC84 \uCE98\uB9B0\uB354",exportSupported:!0,importSupported:!0,subscribeSteps:["\uB124\uC774\uBC84 \uCE98\uB9B0\uB354 > \uC67C\uCABD **\uB0B4 \uCE98\uB9B0\uB354** \uC606 **+** > **URL\uB85C \uAD6C\uB3C5\uD558\uAE30**\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.","\uB124\uC774\uBC84\uAC00 \uD53C\uB4DC\uB97C \uC8FC\uAE30\uC801\uC73C\uB85C \uAC00\uC838\uAC00\uBBC0\uB85C \uBCC0\uACBD\uC0AC\uD56D \uBC18\uC601\uC774 \uB2A6\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4.","\uB0B4\uBCF4\uB0B4\uAE30\uB97C \uADF8\uB9CC\uD558\uB824\uBA74 \uB124\uC774\uBC84 \uCE98\uB9B0\uB354\uC5D0\uC11C \uAD6C\uB3C5\uD55C \uCE98\uB9B0\uB354\uB97C \uC0AD\uC81C\uD558\uBA74 \uB429\uB2C8\uB2E4."],importSteps:["\uB124\uC774\uBC84 \uCE98\uB9B0\uB354 > \uC67C\uCABD **\uCE98\uB9B0\uB354 \uC124\uC815**(\uD1B1\uB2C8)\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354\uB97C \uACE0\uB985\uB2C8\uB2E4.","**\uC678\uBD80 \uACF5\uAC1C** \uD56D\uBAA9\uC5D0\uC11C **\uCE98\uB9B0\uB354 \uACF5\uAC1C**\uB97C \uCCB4\uD06C\uD558\uBA74 \uB098\uC624\uB294 **iCal \uC8FC\uC18C**\uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."],importPlaceholder:"https://calendar.naver.com/\u2026(iCal \uC8FC\uC18C)",importWarning:"\uB124\uC774\uBC84\uB294 **\uCE98\uB9B0\uB354\uB97C \uACF5\uAC1C**\uD574\uC57C iCal \uC8FC\uC18C\uAC00 \uB098\uC635\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC544\uB294 \uC0AC\uB78C\uC740 \uADF8 \uCE98\uB9B0\uB354\uB97C \uBCFC \uC218 \uC788\uC73C\uB2C8, \uAC1C\uC778 \uC77C\uC815\uC774 \uB2F4\uAE34 \uCE98\uB9B0\uB354\uB294 \uACF5\uAC1C\uD558\uC9C0 \uB9C8\uC138\uC694."},kakao:{key:"kakao",name:"\uCE74\uCE74\uC624 \uCE98\uB9B0\uB354",homeUrl:"https://kakaowork.com",defaultCalendarName:"\uCE74\uCE74\uC624 \uCE98\uB9B0\uB354",exportSupported:!1,importSupported:!0,exportBlockedReason:"\uCE74\uCE74\uC624\uD1A1 \uD1A1\uCE98\uB9B0\uB354\uB294 \uC678\uBD80 \uCE98\uB9B0\uB354 \uC8FC\uC18C\uB97C \uAD6C\uB3C5\uD558\uB294 \uAE30\uB2A5\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uC9C0\uAE08\uC740 \uCE74\uCE74\uC624\uC6CC\uD06C \uCE98\uB9B0\uB354\uB97C \uC4F0\uAC70\uB098 \uB2E4\uB978 \uCE98\uB9B0\uB354\uB85C \uB0B4\uBCF4\uB0B4\uC138\uC694.",subscribeSteps:[],importSteps:["**\uCE74\uCE74\uC624\uC6CC\uD06C** \uCE98\uB9B0\uB354 > \uB0B4 \uCE98\uB9B0\uB354\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354\uC758 \uC124\uC815\uC744 \uC5FD\uB2C8\uB2E4.","**\uC678\uBD80 \uCE98\uB9B0\uB354\uB85C \uACF5\uC720** \uD56D\uBAA9\uC758 **iCal(.ics) \uB9C1\uD06C**\uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."],importPlaceholder:"https://\u2026(\uCE74\uCE74\uC624\uC6CC\uD06C iCal \uB9C1\uD06C).ics",importWarning:"\uCE74\uCE74\uC624\uD1A1\uC758 **\uD1A1\uCE98\uB9B0\uB354\uB294 iCal \uC8FC\uC18C\uB97C \uB0B4\uC8FC\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4** \u2014 \uAC00\uC838\uC624\uAE30\uAC00 \uB418\uB294 \uAC83\uC740 \uC5C5\uBB34\uC6A9 **\uCE74\uCE74\uC624\uC6CC\uD06C** \uCE98\uB9B0\uB354\uC785\uB2C8\uB2E4."}},Jp=Object.values(qu);function El(e){return qu[e??"google"]??qu.google}import{jsx as kr,jsxs as Ml}from"react/jsx-runtime";function hq({open:e,feedSubscribed:p=!1,importCount:b=0,onOpenExport:l,onOpenImport:i,onClose:s}){let r=Ml(Go,{sx:{display:"flex",flexDirection:"column",gap:2},children:[Ml(Go,{sx:{color:"#37352f",lineHeight:1.7},children:[kr("b",{children:"\uB0B4\uBCF4\uB0B4\uAE30"}),"\uB294 \uB0B4 \uC5C5\uBB34\uB97C \uB2E4\uB978 \uCE98\uB9B0\uB354\uC5D0\uC11C ",kr("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uBCF4\uAC8C \uD558\uACE0, ",kr("b",{children:"\uAC00\uC838\uC624\uAE30"}),"\uB294 \uADF8 \uCE98\uB9B0\uB354\uC758 \uC77C\uC815\uC744 \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uACB9\uCCD0 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.",kr("br",{}),"\uB450 \uBC29\uD5A5 \uBAA8\uB450 \uC6D0\uBCF8\uC744 \uACE0\uCE58\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."]}),kr(Go,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:Jp.map((t,n)=>Ml(Go,{sx:{display:"flex",alignItems:"center",gap:2,px:2,py:1.75,borderTop:n>0?"1px solid #f2f2f0":"none"},children:[kr(Qp,{sx:{fontSize:22,color:"#787774",flexShrink:0}}),Ml(Go,{sx:{flex:1,minWidth:0},children:[kr(Go,{sx:{fontSize:16,color:"#37352f"},children:t.name}),t.exportBlockedReason??t.importBlockedReason?kr(Go,{sx:{fontSize:13.5,color:"#8a6d1d",mt:.25,lineHeight:1.6},children:t.exportBlockedReason??t.importBlockedReason}):null]}),kr(em,{label:"\uB0B4\uBCF4\uB0B4\uAE30",icon:kr(Qp,{sx:{fontSize:17}}),supported:t.exportSupported,reason:t.exportBlockedReason,active:p,onClick:()=>l(t.key)}),kr(em,{label:"\uAC00\uC838\uC624\uAE30",icon:kr(U4,{sx:{fontSize:17}}),supported:t.importSupported,reason:t.importBlockedReason,active:b>0,onClick:()=>i(t.key)})]},t.key))})]});return kr(W4,{open:e,onClose:s,width:680,title:"\uCE98\uB9B0\uB354 \uC5F0\uB3D9",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-link",sections:[{id:"calendar-link",showTitle:!1,children:r}],actions:{showCancelButton:!1,right:kr(tm,{variant:"contained",onClick:s,children:"\uB2EB\uAE30"})}})}function em({label:e,icon:p,supported:b,reason:l,active:i,onClick:s}){let r=kr(Go,{component:"span",sx:{flexShrink:0},children:kr(tm,{size:"medium",variant:i?"contained":"outlined",startIcon:p,disabled:!b,onClick:s,sx:{minWidth:108},children:e})});return b?r:kr(H4,{title:l??"\uC774 \uC11C\uBE44\uC2A4\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",arrow:!0,children:r})}import{useState as rm}from"react";import{Box as yr,Button as Hu,Divider as G4,IconButton as Y4,TextField as X4}from"@mui/material";import{FormDialog as Z4}from"@ehfuse/mui-form-dialog";import J4 from"@mui/icons-material/OpenInNewOutlined";import Q4 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as e6}from"@ehfuse/alerts";import{Fragment as V4}from"react";import{Fragment as K4,jsx as $u}from"react/jsx-runtime";function zs({text:e}){let p=String(e??"").split("**");return $u(K4,{children:p.map((b,l)=>l%2===1?$u("b",{children:b},l):$u(V4,{children:b},l))})}import{jsx as jt,jsxs as Fs}from"react/jsx-runtime";function Iq({open:e,imports:p,provider:b,onRegister:l,onRemove:i,onClose:s}){let r=El(b),[t,n]=rm(""),[c,o]=rm(!1),a=async()=>{let u=t.trim();if(u){o(!0);try{await l(u)&&n("")}finally{o(!1)}}},d=async u=>{await e6({title:"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",message:`"${u.name||r.defaultCalendarName}" \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&i(u.seq)},f=Fs(yr,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[Fs(yr,{sx:{color:"#37352f",lineHeight:1.7},children:[r.name,"\uC758 \uC77C\uC815\uC744 ",jt("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uD568\uAED8 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.",jt("br",{}),"\uD45C\uC2DC/\uC228\uAE40\uC740 \uC5C5\uBB34\uD568 \uC6B0\uC0C1\uB2E8\uC758 ",jt("b",{children:"\uC678\uBD80 \uC77C\uC815"})," \uC2A4\uC704\uCE58\uB85C \uCF1C\uACE0 \uB055\uB2C8\uB2E4."]}),jt(yr,{sx:{fontWeight:700,color:"#37352f",mt:.5},children:"\uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354"}),p.length>0?jt(yr,{sx:{display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1},children:p.map((u,g)=>Fs(yr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:.75,borderTop:g>0?"1px solid #efefed":"none"},children:[jt(Q4,{sx:{fontSize:18,color:"#0f9d58",flexShrink:0}}),jt(yr,{component:"span",sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u.name||r.defaultCalendarName}),jt(Y4,{"aria-label":"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",size:"small",onClick:()=>{d(u)},sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:jt(cr,{sx:{fontSize:18}})})]},u.seq))}):jt(yr,{sx:{color:"#9a9a97",px:.5},children:"\uC544\uC9C1 \uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}),jt(G4,{sx:{my:1,borderColor:"#e6e6e3"}}),jt(yr,{sx:{fontWeight:700,color:"#37352f"},children:"\uC0C8 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30"}),Fs(yr,{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:[r.importSteps.map(u=>jt(yr,{children:jt(yr,{component:"span",children:jt(zs,{text:u})})},u)),jt(yr,{children:jt(yr,{component:"span",children:"\uB4F1\uB85D\uD55C \uC8FC\uC18C\uB294 \uC11C\uBC84\uC5D0 \uC800\uC7A5\uB418\uBA70 \uB2E4\uB978 \uC9C1\uC6D0\uC5D0\uAC8C \uBCF4\uC774\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})}),jt(yr,{children:jt(yr,{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."})}),r.importWarning?jt(yr,{children:jt(yr,{component:"span",children:jt(zs,{text:r.importWarning})})}):null]}),Fs(yr,{sx:{display:"flex",gap:2,alignItems:"center"},children:[jt(X4,{value:t,onChange:u=>n(u.target.value),fullWidth:!0,label:"iCal \uC8FC\uC18C",placeholder:r.importPlaceholder,slotProps:{input:{spellCheck:!1}}}),jt(Hu,{variant:"contained",disabled:!t.trim()||c,onClick:()=>{a()},sx:{flexShrink:0},children:c?"\uD655\uC778 \uC911\u2026":"\uB4F1\uB85D"})]})]});return jt(Z4,{open:e,onClose:s,width:680,title:`${r.name} \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:f}],actions:{showCancelButton:!1,left:jt(Hu,{variant:"outlined",startIcon:jt(J4,{sx:{fontSize:16}}),onClick:()=>window.open(r.homeUrl,"_blank"),children:r.name}),right:jt(Hu,{variant:"contained",onClick:s,children:"\uB2EB\uAE30"})}})}import{Box as yi,Button as qs,TextField as t6}from"@mui/material";import{FormDialog as r6}from"@ehfuse/mui-form-dialog";import n6 from"@mui/icons-material/ContentCopyOutlined";import nm from"@mui/icons-material/OpenInNewOutlined";import{InfoAlert as om}from"@ehfuse/alerts";import{Fragment as i6,jsx as Sr,jsxs as xi}from"react/jsx-runtime";function o6(e){return`${window.location.origin}/api/v1/taskbox/calendar/${e}.ics`}function jq({open:e,feed:p,feedTaskCount:b,provider:l,buildFeedUrl:i,onSubscribe:s,onClose:r}){let t=El(l),n=i??o6,c=p.subscribed?n(p.token):"",o=()=>{navigator.clipboard.writeText(c).then(()=>om("\uD53C\uB4DC \uC8FC\uC18C\uB97C \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>om("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD558\uC138\uC694."))},a=()=>{let f=t.buildSubscribeUrl?.(c);f&&window.open(f,"_blank")},d=xi(yi,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[xi(yi,{sx:{color:"#37352f",lineHeight:1.7},children:["\uB0B4\uAC00 \uAD00\uC5EC\uD55C \uC5C5\uBB34\uB97C ",Sr("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C ",t.name,"\uC5D0\uC11C \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4."]}),b===0?xi(yi,{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.",Sr("br",{}),Sr("b",{children:"\uB9C8\uAC10\uC77C\uC2DC\uAC00 \uC788\uB294 \uB0B4 \uC5C5\uBB34 \uB610\uB294 \uBCF4\uB0B8\uC5C5\uBB34"}),"\uAC00 \uC0DD\uAE30\uBA74"," ",p.subscribed?`${t.name}\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?xi(i6,{children:[Sr(t6,{value:c,fullWidth:!0,label:"\uB0B4 \uD53C\uB4DC \uC8FC\uC18C",slotProps:{input:{readOnly:!0}}}),xi(yi,{sx:{display:"flex",gap:2},children:[Sr(qs,{variant:"outlined",startIcon:Sr(n6,{}),onClick:o,children:"\uC8FC\uC18C \uBCF5\uC0AC"}),t.buildSubscribeUrl?xi(qs,{variant:"contained",startIcon:Sr(nm,{}),onClick:a,children:[t.name,"\uC5D0 \uCD94\uAC00"]}):null]}),xi(yi,{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:[t.subscribeSteps.map(f=>Sr(yi,{children:Sr("span",{children:Sr(zs,{text:f})})},f)),Sr(yi,{children:Sr("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."})})]})]}):Sr(qs,{variant:"contained",onClick:s,sx:{alignSelf:"flex-start"},children:"\uAD6C\uB3C5 \uC2DC\uC791 (\uD53C\uB4DC \uBC1C\uAE09)"})]});return Sr(r6,{open:e,onClose:r,width:680,title:`${t.name}\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:d}],actions:{showCancelButton:!1,left:Sr(qs,{variant:"outlined",startIcon:Sr(nm,{sx:{fontSize:16}}),onClick:()=>window.open(t.homeUrl,"_blank"),children:t.name}),right:Sr(qs,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}})}import{useEffect as s6,useMemo as Wu,useState as Uu}from"react";import{Box as $s,Button as a6,Typography as l6}from"@mui/material";import{FormDialog as c6}from"@ehfuse/mui-form-dialog";import{SearchTextField as u6}from"@ehfuse/mui-form-controls";import{TreeView as d6}from"@ehfuse/tree-view";import{Fragment as b6,jsx as Rn,jsxs as y6}from"react/jsx-runtime";function im(e){return`${e.name}#${e.seq}`}function f6(e){return Number(e.slice(e.lastIndexOf("#")+1))||0}function h6(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 p6(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 m6(e){let p=[[e.name,e.role_name].filter(Boolean).join(" "),e.department].filter(Boolean).join(" / ");return{id:`emp:${e.seq}`,label:im(e),renderLabel:Rn($s,{component:"span",sx:{display:"inline-flex",alignItems:"baseline",gap:.75},children:Rn($s,{component:"span",sx:{fontWeight:400,color:"text.primary"},children:p})})}}function sm(e,p){let b=(e.groups??[]).map(i=>sm(i,p)).filter(i=>i!==null),l=(e.employees??[]).filter(i=>p6(i,p)).map(m6);return b.length===0&&l.length===0?null:{id:`group:${e.key}`,label:e.name,children:[...b,...l]}}function g6({groups:e,allEmployees:p,initialSelectedSeqs:b,multiple:l,isMobile:i,onSelectionChange:s}){let[r,t]=Uu(""),n=Wu(()=>e.map(o=>sm(o,r.trim().toLowerCase())).filter(o=>o!==null),[e,r]),c=Wu(()=>p.filter(o=>b.includes(o.seq)).map(im),[]);return y6(b6,{children:[Rn($s,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:Rn(u6,{size:"small",fullWidth:!0,placeholder:"\uC774\uB984, \uBD80\uC11C \uAC80\uC0C9",onSearch:t,onClear:()=>t(""),sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),Rn($s,{sx:i?{display:"flex",flexDirection:"column"}:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:Rn(d6,{items:n,checkbox:!0,multiSelect:l,selectionMode:"child",showSearch:!1,defaultExpanded:!0,initialSelections:c,onChange:o=>s(o.map(f6).filter(a=>a>0)),styles:{border:"none",borderRadius:"0"}})})]})}function Kq({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]=Uu([]),[d,f]=Uu(0),u=Wu(()=>h6(l),[l]),g=s??[];s6(()=>{e&&(a(g),f(x=>x+1))},[e]);let m=()=>{let x=u.filter(_=>o.includes(_.seq));t(i?x:x.slice(0,1)),n()};return Rn(c6,{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:Rn($s,{sx:{...c?{}:{height:560},display:"flex",flexDirection:"column",border:"1px solid #cccccc",borderRadius:1,...c?{}:{overflow:"hidden"},userSelect:"none"},children:Rn(g6,{groups:l,allEmployees:u,initialSelectedSeqs:g,multiple:i,isMobile:c,onSelectionChange:a},d)})}],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?Rn(l6,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.35},children:b}):void 0,right:Rn(a6,{variant:"contained",onClick:m,children:r})}})}import{useEffect as $k,useMemo as qm,useState as Ys}from"react";import{Box as Io,Button as $m}from"@mui/material";import{FormDialog as Hk}from"@ehfuse/mui-form-dialog";import{LabelSelect as td}from"@ehfuse/mui-form-controls";import Wk from"@mui/icons-material/SpeedOutlined";import{useEffect as x6,useState as v6}from"react";import{Box as Jr,Button as w6}from"@mui/material";import{FormDialog as _6}from"@ehfuse/mui-form-dialog";import{LabelSelect as k6,NumberField as am}from"@ehfuse/mui-form-controls";import S6 from"@ehfuse/overlay-scrollbar";import{jsx as Wr,jsxs as Hs}from"react/jsx-runtime";var T6=[{value:"count",label:"\uBBF8\uC644\uB8CC \uAC74\uC218"},{value:"points",label:"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8"}];function lm({open:e,capacity:p,employees:b,onClose:l,onSave:i}){let[s,r]=v6(p??no);x6(()=>{e&&r(p??no)},[e,p]);let t=s.basis==="points"?"SP":"\uAC74",n=(c,o)=>{let a=Math.max(0,Math.floor(Number(o)||0));r(d=>{let f={...d.by_account};return a>0?f[c]=a:delete f[c],{...d,by_account:f}})};return Wr(_6,{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:Wr(w6,{variant:"contained",onClick:()=>{i(s)},children:"\uC800\uC7A5"})},sectionContentPaddingTop:0,sections:[{id:"capacity",title:"",showTitle:!1,children:Hs(Jr,{sx:{display:"flex",flexDirection:"column",gap:2},children:[Wr(Jr,{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."}),Hs(Jr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Wr(Jr,{sx:{width:104,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uC138\uB294 \uB2E8\uC704"}),Wr(k6,{size:"medium",fullWidth:!0,label:"",value:s.basis,options:T6,onChange:c=>r(o=>({...o,basis:c.target.value}))})]}),Hs(Jr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Wr(Jr,{sx:{width:104,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uAE30\uBCF8 \uC6A9\uB7C9"}),Wr(am,{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))}))})]}),Wr(Jr,{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`}),Wr(Jr,{sx:{fontSize:16,fontWeight:700,color:"#37352f"},children:"\uC0AC\uB78C\uBCC4 \uC608\uC678"}),b.length===0?Wr(Jr,{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."}):Wr(Jr,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:Wr(S6,{style:{maxHeight:260},thumb:{width:6},children:b.filter(c=>Number(c.account_seq)>0).map(c=>Hs(Jr,{sx:{display:"flex",alignItems:"center",gap:1.5,px:2,py:1,borderBottom:"1px solid #f2f2f0","&:last-of-type":{borderBottom:"none"}},children:[Hs(Jr,{sx:{flex:1,minWidth:0,fontSize:16,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[c.name,c.department?Wr(Jr,{component:"span",sx:{ml:1,fontSize:14,color:"#787774"},children:c.department}):null]}),Wr(Jr,{sx:{width:132,flexShrink:0},children:Wr(am,{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 Ol}from"@mui/material";import{Bar as E6,BarChart as M6,CartesianGrid as R6,Cell as O6,ReferenceLine as A6,ResponsiveContainer as D6,Tooltip as P6,XAxis as N6,YAxis as L6}from"recharts";import{Box as C6}from"@mui/material";import{jsx as B6}from"react/jsx-runtime";function Ur({text:e,height:p}){return B6(C6,{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 I6}from"react";var Rl="#2f80ed",cm="#a9c9f5",vi="#9a9a97",Vu="#2e9e6b",Xn="#3d7eff",Ku="#c3c8ce",Ws="#f2a30f",Us={contentStyle:{fontSize:13.5,color:"#37352f",border:"1px solid #e6e6e3",borderRadius:6},labelStyle:{fontSize:13.5,color:"#37352f",fontWeight:700},itemStyle:{fontSize:13.5}},Ji={...Us,cursor:!1},Qi={wrapperStyle:{fontSize:13.5,paddingTop:10},formatter:e=>I6("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 Zn(e){return{"& *":{outline:"none"},userSelect:"none",...typeof e=="number"?{height:e,flexShrink:0}:{flex:1,minHeight:0}}}import{jsx as On,jsxs as Vs}from"react/jsx-runtime";function j6(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 um({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,...j6(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?On(Ur,{text:"\uD45C\uC2DC\uD560 \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:b}):Vs(Ol,{sx:dr(b),children:[Vs(Ol,{sx:{flexShrink:0,mb:1,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Vs("span",{children:["\uC644\uB8CC ",s?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uBAA9\uD45C\uBCC4"]}),n!==null?Vs("span",{children:["\uD3C9\uADE0(\uC885\uB8CC \uBAA9\uD45C)"," ",On(Ol,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:n}),r]}):null]}),On(Ol,{sx:Zn(b),children:On(D6,{width:"100%",height:"100%",children:Vs(M6,{data:c,margin:{top:8,right:12,left:0,bottom:0},barCategoryGap:"28%",children:[On(R6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),On(N6,{dataKey:"\uBAA9\uD45C",tick:{fontSize:13},tickMargin:6,interval:0}),On(L6,{tick:{fontSize:13},width:40,allowDecimals:!1}),On(P6,{...Ji,formatter:o=>`${Number(o??0)}${r}`}),n!==null?On(A6,{y:n,stroke:vi,strokeDasharray:"6 5",label:{value:`\uD3C9\uADE0 ${n}${r}`,position:"right",fontSize:13}}):null,On(E6,{dataKey:"\uC644\uB8CC",radius:[4,4,0,0],children:c.map(o=>On(O6,{fill:o.closed?Rl:cm},o.\uBAA9\uD45C))})]})})})]})}import{useMemo as z6}from"react";import{Box as Jn}from"@mui/material";import{CartesianGrid as F6,Line as dm,LineChart as q6,ResponsiveContainer as $6,Tooltip as H6,XAxis as W6,YAxis as U6}from"recharts";import{jsx as Qr,jsxs as Yo}from"react/jsx-runtime";function fm(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?new Date(`${e}T00:00:00`):null}function V6(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function K6(e){return e.slice(5).replace("-",".")}function hm({sprint:e,tasks:p,todayStr:b,height:l=200,headerLeft:i}){let s=z6(()=>{let a=fm(e.start_date),d=fm(e.end_date);if(!a||!d||d<a||Math.round((d.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,N)=>P+m(N),0),_=new Map;for(let P of u){if(!P.completed)continue;let N=(P.completed_time??"").slice(0,10),q=/^\d{4}-\d{2}-\d{2}$/.test(N)?N:e.start_date;_.set(q,(_.get(q)??0)+m(P))}let B=[];for(let P=new Date(a);P<=d;P.setDate(P.getDate()+1))B.push(V6(P));let A=x,j=x;return{empty:!1,data:B.map((P,N)=>{let q=B.length===1?0:x*(1-N/(B.length-1));return P<=b&&(A-=_.get(P)??0,j=Math.max(0,A)),{\uB0A0\uC9DC:K6(P),\uC774\uC0C1:Math.round(q*10)/10,\uB0A8\uC740\uB7C9:P<=b?Math.max(0,A):null}}),total:x,usePoints:g,last:j}},[e,p,b]);if(!s)return Yo(Jn,{sx:dr(l),children:[i?Qr(Jn,{sx:Ar,children:i}):null,Qr(Ur,{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 Yo(Jn,{sx:dr(l),children:[i?Qr(Jn,{sx:Ar,children:i}):null,Qr(Ur,{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 Yo(Jn,{sx:dr(l),children:[Yo(Jn,{sx:Ar,children:[i?Qr(Jn,{sx:{flexShrink:0},children:i}):null,Yo(Jn,{sx:{flex:1,minWidth:220,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Yo("span",{children:["\uB0A8\uC740 ",n?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uCD1D ",t]}),Yo("span",{children:["\uD604\uC7AC"," ",Qr(Jn,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:c}),o," \uB0A8\uC74C"]})]})]}),Qr(Jn,{sx:Zn(l),children:Qr($6,{width:"100%",height:"100%",children:Yo(q6,{data:r,margin:{top:8,right:12,left:0,bottom:0},children:[Qr(F6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Qr(W6,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),Qr(U6,{tick:{fontSize:13},width:40,allowDecimals:!1}),Qr(H6,{...Us,formatter:a=>`${Number(a??0)}${o}`}),Qr(dm,{type:"linear",dataKey:"\uC774\uC0C1",stroke:vi,strokeDasharray:"6 5",strokeWidth:1.5,dot:!1}),Qr(dm,{type:"monotone",dataKey:"\uB0A8\uC740\uB7C9",stroke:Rl,strokeWidth:2.5,dot:!1,connectNulls:!1})]})})})]})}import{useMemo as vm}from"react";import{Box as Qn}from"@mui/material";import{Area as Xu,AreaChart as Z6,CartesianGrid as J6,Legend as Q6,ResponsiveContainer as ek,Tooltip as tk,XAxis as rk,YAxis as nk}from"recharts";function Co(e){let p=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())}`}function Al(e,p=new Date){let b=new Date(p);return b.setMonth(b.getMonth()-e),b}function _$(e=new Date){return{fromDate:Co(Al(1,e)),toDate:Co(e)}}var Yu=864e5,Ks=[0,1,2,3,5,8,13,21];function gm(e){return!e.archived&&!e.linked_only&&!e.is_notice&&!e.is_event}function Gu(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 es(e){let p=String(e??"").trim();return/^\d{4}-\d{2}-\d{2}/.test(p)?p.slice(0,10):""}function G6(e){let p=es(e.created_time)||es(e.start_date)||es(e.completed_time);if(!p)return null;let b=es(e.start_date),l=b&&b>p?b:p,i=e.completed?es(e.completed_time)||p:"";return{created:p,started:l,done:i}}function bm(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*Yu)));return i}function ym(e,p,b){let l=bm(p,b),i=e.filter(gm).map(G6).filter(n=>n!==null),s=l.map(n=>{let c=0,o=0,a=0;for(let d of i)d.created>n||(d.done&&d.done<=n?c+=1:d.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 Y6(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 pm(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(Y6(p,.85))}}function mm(e){for(let p=Ks.length-1;p>=0;p-=1)if(e>=Ks[p])return p;return 0}function X6(){return Ks.map((e,p)=>p===Ks.length-1?`${e}\uC77C+`:`${e}~${Ks[p+1]}\uC77C`)}function xm(e,p,b){let l=bm(p,b),i=l[0],s=l[l.length-1],r=X6(),t=r.map(()=>0),n=r.map(()=>0),c=[],o=[];for(let a of e){if(!gm(a)||!a.completed)continue;let d=es(a.completed_time);if(!d||d<i||d>s)continue;let f=Gu(a.completed_time),u=Gu(a.created_time);if(f===null||u===null)continue;let g=Math.max(0,(f-u)/Yu);c.push(g),t[mm(g)]+=1;let m=Gu(a.start_date);if(m===null||m>f)continue;let x=Math.max(0,(f-Math.max(m,u))/Yu);o.push(x),n[mm(x)]+=1}return{labels:r,leadCounts:t,cycleCounts:n,lead:pm(c),cycle:pm(o)}}import{jsx as Vr,jsxs as Xo}from"react/jsx-runtime";function ok(e){return e.slice(5).replace("-",".")}function wm({tasks:e,todayStr:p,days:b=30,height:l=220,headerLeft:i}){let s=vm(()=>ym(e,b,p),[e,b,p]),r=vm(()=>s.points.map(n=>({\uB0A0\uC9DC:ok(n.day),\uC644\uB8CC:n.done,\uC9C4\uD589:n.inProgress,\uB300\uAE30:n.waiting})),[s]),t=Xo(Qn,{sx:Ar,children:[i?Vr(Qn,{sx:{flexShrink:0},children:i}):null,Xo(Qn,{sx:{flex:1,minWidth:220,display:"flex",flexDirection:"column",gap:.5},children:[Xo(Qn,{sx:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Xo("span",{children:["\uCD5C\uADFC ",s.points.length,"\uC77C \u2014 \uC811\uC218 ",s.currentTotal,"\uAC74 / \uC644\uB8CC ",s.currentDone,"\uAC74"]}),Xo("span",{children:["\uC9C4\uD589 \uC911"," ",Vr(Qn,{component:"span",sx:{color:Xn,fontWeight:700},children:s.currentWip}),"\uAC74"]})]}),Vr(Qn,{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?Xo(Qn,{sx:dr(l),children:[i?Vr(Qn,{sx:Ar,children:i}):null,Vr(Ur,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC811\uC218\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]}):Xo(Qn,{sx:dr(l),children:[t,Vr(Qn,{sx:Zn(l),children:Vr(ek,{width:"100%",height:"100%",children:Xo(Z6,{data:r,margin:{top:8,right:12,left:0,bottom:4},children:[Vr(J6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Vr(rk,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),Vr(nk,{tick:{fontSize:13},width:40,allowDecimals:!1}),Vr(tk,{...Us,formatter:n=>`${Number(n??0)}\uAC74`}),Vr(Q6,{...Qi}),Vr(Xu,{type:"monotone",dataKey:"\uC644\uB8CC",stackId:"flow",stroke:Vu,fill:Vu,fillOpacity:.9}),Vr(Xu,{type:"monotone",dataKey:"\uC9C4\uD589",stackId:"flow",stroke:Xn,fill:Xn,fillOpacity:.85}),Vr(Xu,{type:"monotone",dataKey:"\uB300\uAE30",stackId:"flow",stroke:Ku,fill:Ku,fillOpacity:.9})]})})})]})}import{useMemo as _m}from"react";import{Box as en}from"@mui/material";import{Bar as km,BarChart as ik,CartesianGrid as sk,Legend as ak,ResponsiveContainer as lk,Tooltip as ck,XAxis as uk,YAxis as dk}from"recharts";import{jsx as xr,jsxs as yn}from"react/jsx-runtime";function Sm({label:e,color:p,summary:b}){let l=yn(en,{sx:{display:"flex",alignItems:"center",gap:.75},children:[xr(en,{sx:{width:10,height:10,borderRadius:.5,bgcolor:p,flexShrink:0}}),xr(en,{component:"span",sx:{fontWeight:700,color:"#37352f"},children:e})]});return b?yn(en,{sx:{display:"contents"},children:[l,yn("span",{children:[b.count,"\uAC74"]}),yn("span",{children:["\uC911\uC559\uAC12"," ",xr(en,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:b.median}),"\uC77C"]}),yn("span",{children:["\uD3C9\uADE0 ",b.average,"\uC77C"]}),yn("span",{children:["85% ",b.p85,"\uC77C \uC774\uB0B4"]})]}):yn(en,{sx:{display:"contents"},children:[l,xr(en,{component:"span",sx:{gridColumn:"span 4",color:"#9a9a97"},children:"\uD45C\uBCF8 \uC5C6\uC74C"})]})}function Tm({tasks:e,todayStr:p,days:b=30,height:l=200,headerLeft:i}){let s=_m(()=>xm(e,b,p),[e,b,p]),r=_m(()=>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?yn(en,{sx:dr(l),children:[yn(en,{sx:Ar,children:[i?xr(en,{sx:{flexShrink:0},children:i}):null,yn(en,{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:[xr(Sm,{label:"\uB9AC\uB4DC\uD0C0\uC784(\uC791\uC131\u2192\uC644\uB8CC)",color:Xn,summary:s.lead}),xr(Sm,{label:"\uC0AC\uC774\uD074\uD0C0\uC784(\uC2DC\uC791\u2192\uC644\uB8CC)",color:Ws,summary:s.cycle})]})]}),xr(en,{sx:Zn(l),children:xr(lk,{width:"100%",height:"100%",children:yn(ik,{data:r,margin:{top:8,right:12,left:0,bottom:4},barCategoryGap:"24%",children:[xr(sk,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),xr(uk,{dataKey:"\uAD6C\uAC04",tick:{fontSize:13},tickMargin:6,interval:0}),xr(dk,{tick:{fontSize:13},width:40,allowDecimals:!1}),xr(ck,{...Ji,formatter:t=>`${Number(t??0)}\uAC74`}),xr(ak,{...Qi}),xr(km,{dataKey:"\uB9AC\uB4DC\uD0C0\uC784",fill:Xn,radius:[3,3,0,0]}),xr(km,{dataKey:"\uC0AC\uC774\uD074\uD0C0\uC784",fill:Ws,radius:[3,3,0,0]})]})})})]}):yn(en,{sx:dr(l),children:[i?xr(en,{sx:Ar,children:i}):null,xr(Ur,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC644\uB8CC\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]})}import{useMemo as Em}from"react";import{Box as wi}from"@mui/material";import{Bar as Ju,BarChart as gk,CartesianGrid as bk,Cell as yk,Legend as xk,ReferenceLine as Mm,ResponsiveContainer as vk,Tooltip as wk,XAxis as _k,YAxis as kk}from"recharts";function fk(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 hk(e,p,b){let l=String(e.due_date??"").slice(0,10),i=fk(p,l);return i===null?"later":i<0?"overdue":i<=b?"soon":"later"}function Dl(e,p){let{todayStr:b,soonDays:l=7,includeUnassigned:i=!0,limit:s,capacity:r}=p,t=r??no,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 d=a?String(o.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",f=n.get(a)??{accountSeq:a,name:d,overdue:0,soon:0,later:0,total:0,points:0,capacity:0,load:0,ratio:0};f[hk(o,b,l)]+=1,f.total+=1,f.points+=Number(o.story_points??0)||0,n.set(a,f)}for(let o of n.values())o.capacity=pk(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 Pl(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 pk(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 Nl(e){return e.capacity>0&&e.load>e.capacity}function Cm(e,p){return p>0&&e.total>=p}function Bm(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 Zu(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 mk(e){let p=new Date(`${e}T00:00:00`);if(Number.isNaN(p.getTime()))return e;let b=(p.getDay()+6)%7;return Zu(e,-b)}function Im(e,p){let{todayStr:b,includeUnassigned:l=!0,weeks:i=6,limit:s}=p,r=mk(b),t=Array.from({length:Math.max(1,i)},(f,u)=>{let g=Zu(r,u*7),m=Zu(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 f of e){if(f.completed||f.archived||f.is_notice||f.is_event||f.linked_only)continue;let u=Number(f.manager_account_seq??0);if(!u&&!l)continue;let g=u?String(f.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(f.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((f,u)=>f.accountSeq===0!=(u.accountSeq===0)?f.accountSeq===0?1:-1:f.overdue!==u.overdue?u.overdue-f.overdue:f.total!==u.total?u.total-f.total:f.name.localeCompare(u.name)),a=typeof s=="number"&&s>0?o.slice(0,s):o,d=a.reduce((f,u)=>Math.max(f,u.overdue,u.noDue,...u.byWeek),0);return{weeks:t,rows:a,maxCell:d}}import{Fragment as Rm,jsx as vr,jsxs as Zo}from"react/jsx-runtime";var Gs="#e5484d";function Om({tasks:e,todayStr:p,soonDays:b=7,overloadThreshold:l=0,capacity:i=no,height:s=200,headerLeft:r,selectedAccountSeq:t=0,onSelectPerson:n}){let c=Em(()=>Dl(e,{todayStr:p,soonDays:b,capacity:i}),[e,p,b,i]),o=Em(()=>Bm(c),[c]),a=l>0?l:Math.max(3,Math.ceil(o*1.5)),d=i.default_capacity>0||Object.keys(i.by_account).length>0,f=i.basis==="points"?"SP":"\uAC74",u=c.filter(g=>g.accountSeq>0&&(d?Nl(g):Cm(g,a))).length;return c.length===0?Zo(wi,{sx:dr(s),children:[r?vr(wi,{sx:Ar,children:r}):null,vr(Ur,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:s})]}):Zo(wi,{sx:dr(s),children:[Zo(wi,{sx:Ar,children:[r,Zo(wi,{sx:{fontSize:13.5,color:"#37352f"},children:["1\uC778 \uD3C9\uADE0 ",vr("b",{children:o.toFixed(1)}),"\uAC74 \xB7"," ",d?Zo(Rm,{children:["\uC6A9\uB7C9 ",vr("b",{children:i.default_capacity||"\uAC1C\uC778\uBCC4"}),i.default_capacity?f:""]}):Zo(Rm,{children:["\uACFC\uBD80\uD558 \uAE30\uC900 ",vr("b",{children:a}),"\uAC74"]}),u>0?Zo(wi,{component:"span",sx:{ml:1,color:Gs,fontWeight:700},children:["\uCD08\uACFC ",u,"\uBA85"]}):null]})]}),vr(wi,{sx:Zn(s),children:vr(vk,{width:"100%",height:"100%",children:Zo(gk,{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:[vr(bk,{strokeDasharray:"3 3",horizontal:!1,stroke:"#eceae6"}),vr(_k,{type:"number",allowDecimals:!1,tick:{fontSize:12}}),vr(kk,{type:"category",dataKey:"name",width:84,tick:{fontSize:12},interval:0}),vr(wk,{...Ji,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}${f} \uC911 ${m.load} (${Math.round(m.ratio*100)}%)`}}),vr(xk,{...Qi}),o>0?vr(Mm,{x:o,stroke:vi,strokeDasharray:"4 4",label:{value:"\uD3C9\uADE0",position:"top",fontSize:11,fill:vi}}):null,i.default_capacity>0?vr(Mm,{x:i.default_capacity,stroke:Gs,strokeDasharray:"2 3",label:{value:"\uC6A9\uB7C9",position:"top",fontSize:11,fill:Gs}}):null,vr(Ju,{dataKey:"overdue",name:"\uC9C0\uC5F0",stackId:"load",fill:Gs}),vr(Ju,{dataKey:"soon",name:`\uC784\uBC15(${b}\uC77C)`,stackId:"load",fill:Ws}),vr(Ju,{dataKey:"later",name:"\uC5EC\uC720",stackId:"load",fill:Xn,radius:[0,3,3,0],children:c.map(g=>vr(yk,{fill:d&&Nl(g)?Gs:Xn,fillOpacity:d&&Nl(g)?.45:1,stroke:g.accountSeq===t?"#37352f":void 0,strokeWidth:g.accountSeq===t?1.5:0},g.accountSeq))})]})})})]})}import{useEffect as Rk,useState as Ok}from"react";import{Box as Ak,Button as Dk}from"@mui/material";import{FormDialog as Pk}from"@ehfuse/mui-form-dialog";import{useState as Sk}from"react";import{Box as fr,Button as Tk,Menu as Ck,MenuItem as Bk}from"@mui/material";import Ik from"@mui/icons-material/PersonOutlineOutlined";import Ek from"@ehfuse/overlay-scrollbar";import{jsx as Tr,jsxs as Bo}from"react/jsx-runtime";var Am=56,Dm=68,Pm=96;function Mk(e){let p=String(e.due_date??"").slice(0,10);return p?p.slice(5).replace("-","/"):"-"}function Nm(e,p){let b=String(e.due_date??"").slice(0,10);return!!b&&b<p}function Lm({tasks:e,row:p,todayStr:b,employees:l,rows:i,height:s=200,hideSummary:r=!1,onChangeManager:t,onOpenTask:n}){let[c,o]=Sk(null),a=Pl(e,p.accountSeq),d=f=>i.find(u=>u.accountSeq===f)?.total??0;return Bo(fr,{sx:{display:"flex",flexDirection:"column",minHeight:0,height:s},children:[r?null:Bo(fr,{sx:{display:"flex",alignItems:"center",gap:1,px:.5,pb:.75,fontSize:14,color:"#37352f"},children:[Tr(fr,{component:"span",sx:{fontWeight:700},children:p.name}),Bo(fr,{component:"span",children:["\uBBF8\uC644\uB8CC ",a.length,"\uAC74"]}),p.capacity>0?Bo(fr,{component:"span",sx:{color:p.load>p.capacity?"#e5484d":"#787774"},children:["\xB7 \uC6A9\uB7C9 ",p.capacity," \uC911 ",p.load]}):null]}),Bo(fr,{sx:{flex:1,minHeight:0,display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:[Bo(fr,{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:[Tr(fr,{sx:{width:Am,flexShrink:0},children:"\uB9C8\uAC10"}),Tr(fr,{sx:{flex:1,minWidth:0},children:"\uC5C5\uBB34"}),Tr(fr,{sx:{width:Dm,flexShrink:0,textAlign:"center"},children:"\uC911\uC694\uB3C4"}),t?Tr(fr,{sx:{width:Pm,flexShrink:0,textAlign:"center"},children:"\uCC45\uC784\uC790"}):null]}),Tr(fr,{sx:{flex:1,minHeight:0},children:Tr(Ek,{style:{height:"100%"},thumb:{width:6},children:a.length===0?Tr(fr,{sx:{p:2,fontSize:14,color:"#9a9a97"},children:"\uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):a.map(f=>Bo(fr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1.5,borderBottom:"1px solid #f2f2f0"},children:[Tr(fr,{sx:{width:Am,flexShrink:0,fontSize:13.5,color:Nm(f,b)?"#e5484d":"#787774",fontWeight:Nm(f,b)?700:400},children:Mk(f)}),Tr(fr,{onClick:n?()=>n(f.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:f.title}),Tr(fr,{sx:{width:Dm,flexShrink:0,display:"flex",justifyContent:"center"},children:Tr(Lr,{priority:f.priority})}),t?Tr(fr,{sx:{width:Pm,flexShrink:0,display:"flex",justifyContent:"center"},children:Tr(Tk,{size:"small",variant:"outlined",startIcon:Tr(Ik,{sx:{fontSize:17}}),onClick:u=>o({el:u.currentTarget,taskSeq:f.seq}),children:"\uC62E\uAE30\uAE30"})}):null]},f.seq))})})]}),Tr(Ck,{anchorEl:c?.el??null,open:!!c,onClose:()=>o(null),transitionDuration:0,children:l.filter(f=>Number(f.account_seq)>0&&Number(f.account_seq)!==p.accountSeq).map(f=>Bo(Bk,{onClick:()=>{c&&t&&t(c.taskSeq,Number(f.account_seq),f.name),o(null)},sx:{fontSize:14,minWidth:200},children:[Tr(fr,{sx:{flex:1},children:f.name}),Bo(fr,{component:"span",sx:{ml:2,fontSize:13,color:"#787774"},children:[d(Number(f.account_seq)),"\uAC74"]})]},f.account_seq))})]})}import{jsx as Ll}from"react/jsx-runtime";function jm({open:e,row:p,rows:b,tasks:l,todayStr:i,employees:s,onClose:r,onChangeManager:t,onOpenTask:n}){let[c,o]=Ok(p);Rk(()=>{p&&o(p)},[p]);let a=p??c,d=a?Pl(l,a.accountSeq).length:0;return Ll(Pk,{open:e,onClose:r,maxWidth:"sm",title:a?`${a.name} \uC5C5\uBB34 (${d})`:"\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:Ll(Dk,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})},sections:[{id:"person-tasks",title:"",showTitle:!1,children:Ll(Ak,{sx:{minHeight:0},children:a?Ll(Lm,{tasks:l,row:a,rows:b,todayStr:i,employees:s,height:"min(420px, 52vh)",hideSummary:!0,onChangeManager:t,onOpenTask:n}):null})}]})}import{useMemo as Nk}from"react";import{Box as an,Tooltip as Lk}from"@mui/material";import{OverlayScrollbar as jk}from"@ehfuse/overlay-scrollbar";import{jsx as Kr,jsxs as zl}from"react/jsx-runtime";var zm="#e5484d",zk="#2f80ed",Fk="#9a9a97",Qu=30,qk=96,jl=56;function ed({count:e,max:p,color:b,title:l}){let i=e>0&&p>0?.18+e/p*.72:0;return Kr(Lk,{title:l,arrow:!0,disableInteractive:!0,placement:"top",children:Kr(an,{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 Fm({tasks:e,todayStr:p,weeks:b=6,height:l=200}){let i=Nk(()=>Im(e,{todayStr:p,weeks:b}),[e,p,b]);if(i.rows.length===0)return Kr(an,{sx:dr(l),children:Kr(Ur,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})});let s=`${qk}px ${jl}px repeat(${i.weeks.length}, minmax(${jl}px, 1fr)) ${jl}px ${jl}px`,r={height:Qu,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 Kr(an,{sx:dr(l),children:Kr(jk,{style:{height:"100%"},thumb:{width:8},children:zl(an,{sx:{display:"grid",gridTemplateColumns:s,minWidth:"fit-content",height:"100%",gridTemplateRows:`${Qu}px repeat(${i.rows.length}, minmax(${Qu}px, 1fr))`},children:[Kr(an,{sx:{...r,justifyContent:"flex-start",pl:1},children:"\uB2F4\uB2F9\uC790"}),Kr(an,{sx:{...r,color:zm},children:"\uC9C0\uC5F0"}),i.weeks.map(t=>Kr(an,{sx:{...r,...t.isCurrent?{borderBottom:"2px solid #2f80ed"}:{}},children:t.label},t.start)),Kr(an,{sx:r,children:"\uB9C8\uAC10\uC5C6\uC74C"}),Kr(an,{sx:r,children:"\uD569\uACC4"}),i.rows.map(t=>zl(an,{sx:{display:"contents"},children:[Kr(an,{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}),Kr(ed,{count:t.overdue,max:i.maxCell,color:zm,title:`${t.name} \xB7 \uC9C0\uC5F0 ${t.overdue}\uAC74`}),t.byWeek.map((n,c)=>Kr(ed,{count:n,max:i.maxCell,color:zk,title:`${t.name} \xB7 ${i.weeks[c].label} \uC8FC \uB9C8\uAC10 ${n}\uAC74`},i.weeks[c].start)),Kr(ed,{count:t.noDue,max:i.maxCell,color:Fk,title:`${t.name} \xB7 \uB9C8\uAC10 \uBBF8\uC815 ${t.noDue}\uAC74`}),zl(an,{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?zl(an,{component:"span",sx:{ml:.25,fontSize:10.5,color:"#9a9a97"},children:["(+",t.beyond,")"]}):null]})]},t.accountSeq))]})})})}import{Fragment as Hm,jsx as Jt,jsxs as Fl}from"react/jsx-runtime";var Wm="min(560px, 62vh)",Uk=`calc(${Wm} - 4px)`,Vk=[{value:"30",label:"\uCD5C\uADFC 30\uC77C"},{value:"60",label:"\uCD5C\uADFC 60\uC77C"},{value:"90",label:"\uCD5C\uADFC 90\uC77C"}];function FH({open:e,sprints:p,tasks:b,todayStr:l,showSprintCharts:i,capacity:s=no,capacityEmployees:r=[],onSaveCapacity:t,onChangeTaskManager:n,onOpenTask:c,initialSprintSeq:o=0,onClose:a}){let[d,f]=Ys(0),[u,g]=Ys(30);$k(()=>{if(!e)return;let y=p.find(w=>w.status==="active")??p[0],v=p.find(w=>w.seq===o)??y;f(v?.seq??0)},[e]);let m=qm(()=>p.find(y=>y.seq===d)??null,[p,d]),x={height:Uk,boxSizing:"border-box",px:3,py:2.5,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden"},_=Jt(td,{label:"\uBAA9\uD45C",showLabel:!1,showEmptyOption:!1,value:d?String(d):"",options:p.map(y=>({value:String(y.seq),label:pn(y)})),onChange:y=>f(Number(y.target.value)||0),sx:{width:280,flexShrink:0}}),[B,A]=Ys("distribution"),j=Jt(td,{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=>A(y.target.value==="timeline"?"timeline":"distribution"),sx:{width:280,flexShrink:0}}),[D,P]=Ys(!1),[N,q]=Ys(0),z=qm(()=>Dl(b,{todayStr:l,capacity:s}),[b,l,s]),T=z.find(y=>y.accountSeq===N)??null,C=Fl(Hm,{children:[j,t?Jt($m,{size:"small",variant:"outlined",startIcon:Jt(Wk,{sx:{fontSize:18}}),onClick:()=>P(!0),sx:{flexShrink:0},children:"\uC6A9\uB7C9"}):null]}),R=i??p.length>0,h=Jt(td,{label:"\uAE30\uAC04",showLabel:!1,showEmptyOption:!1,value:String(u),options:Vk,onChange:y=>g(Number(y.target.value)||30),sx:{width:280,flexShrink:0}});return Fl(Hm,{children:[Jt(Hk,{open:e,onClose:a,maxWidth:"md",title:"\uC5C5\uBB34 \uCC28\uD2B8",locale:"ko",contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,sectionTitleGap:0,fixedHeight:Wm,contentBottomPadding:0,scrollPastLastSection:!1,tabs:{visible:!0,switchContent:!0,fullWidth:!0},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-charts",sections:[...R?[{id:"velocity",tabTitle:"\uBCA8\uB85C\uC2DC\uD2F0",showTitle:!1,children:Jt(Io,{sx:x,children:Jt(um,{sprints:p,tasks:b,height:"100%"})})},{id:"burndown",tabTitle:"\uBC88\uB2E4\uC6B4",showTitle:!1,children:Jt(Io,{sx:x,children:m?Jt(hm,{sprint:m,tasks:b,todayStr:l,height:"100%",headerLeft:_}):Fl(Io,{sx:dr("100%"),children:[Jt(Io,{sx:Ar,children:_}),Jt(Ur,{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(wm,{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"?Fl(Io,{sx:{display:"flex",flexDirection:"column",height:"100%",minHeight:0},children:[Jt(Io,{sx:Ar,children:C}),Jt(Fm,{tasks:b,todayStr:l,height:"100%"})]}):Jt(Om,{tasks:b,todayStr:l,height:"100%",capacity:s,headerLeft:C,selectedAccountSeq:N,onSelectPerson:n?q:void 0})})},{id:"lead-time",tabTitle:"\uB9AC\uB4DC\uD0C0\uC784",showTitle:!1,children:Jt(Io,{sx:x,children:Jt(Tm,{tasks:b,todayStr:l,days:u,height:"100%",headerLeft:h})})}],actions:{showCancelButton:!1,right:Jt($m,{variant:"contained",onClick:a,children:"\uB2EB\uAE30"})}}),Jt(jm,{open:N>0,row:T,rows:z,tasks:b,todayStr:l,employees:r,onClose:()=>q(0),onChangeManager:n,onOpenTask:c}),t?Jt(lm,{open:D,capacity:s,employees:r,onClose:()=>P(!1),onSave:async y=>{await t(y),P(!1)}}):null]})}import{Checkbox as Kk,Divider as Gk,Menu as Yk,MenuItem as rd}from"@mui/material";import{jsx as Xs,jsxs as Um}from"react/jsx-runtime";function UH({anchorEl:e,candidates:p,selectedNames:b,avatarSrcByName:l,onToggle:i,onClear:s,onClose:r}){return Um(Yk,{anchorEl:e,open:!!e,onClose:r,transitionDuration:0,children:[p.length===0?Xs(rd,{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 Um(rd,{onClick:()=>i(t),sx:{fontSize:14,minWidth:170,gap:1},children:[Xs(Kk,{size:"small",checked:n,sx:{p:0}}),Xs(jr,{names:[t.name],size:20,avatarSrcByName:l}),t.name]},`${t.accountSeq}-${t.name}`)}),Xs(Gk,{}),Xs(rd,{disabled:b.length===0,onClick:s,sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{useState as Xk}from"react";import{ButtonBase as Zk,Menu as Jk,MenuItem as Qk}from"@mui/material";import e8 from"@mui/icons-material/KeyboardArrowDown";import t8 from"@mui/icons-material/Check";import{Fragment as r8,jsx as nd,jsxs as od}from"react/jsx-runtime";function QH({value:e,onChange:p,options:b}){let[l,i]=Xk(null),s=b??bc,r=bc.find(t=>t.value===e)?.label??"";return od(r8,{children:[od(Zk,{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,nd(e8,{sx:{fontSize:17,color:"#9a9a97"}})]}),nd(Jk,{transitionDuration:0,anchorEl:l,open:!!l,onClose:()=>i(null),children:s.map(t=>od(Qk,{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?nd(t8,{sx:{fontSize:16,color:"#2f80ed"}}):null]},t.value))})]})}import{Box as ql,ButtonBase as n8}from"@mui/material";import{DateTextField as Vm}from"@ehfuse/mui-form-controls";import{jsx as Zs,jsxs as Km}from"react/jsx-runtime";var o8=[{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 Gm({fromDate:e,toDate:p,onChange:b}){let l=s=>{if(s<=0){b("","");return}b(Co(Al(s)),Co(new Date))},i=s=>s<=0?!e&&!p:!e||!p?!1:e===Co(Al(s))&&p===Co(new Date);return Km(ql,{sx:{display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[Zs(ql,{sx:{display:"flex",alignItems:"center",gap:1.5},children:o8.map(s=>{let r=i(s.months);return Zs(n8,{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)})}),Km(ql,{sx:{display:"flex",alignItems:"center",gap:.5},children:[Zs(Vm,{value:e,size:"small",placeholder:"\uC2DC\uC791\uC77C",onChange:s=>b(s.target.value,p),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}}),Zs(ql,{component:"span",sx:{fontSize:13,color:"#9a9a97"},children:"~"}),Zs(Vm,{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 i8}from"@mui/material";import{jsx as Ym}from"react/jsx-runtime";function cW({anchorEl:e,fromDate:p,toDate:b,onChange:l,onClose:i}){return Ym(i8,{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:Ym(Gm,{fromDate:p,toDate:b,onChange:l})})}import{Box as s8,ButtonBase as a8,Tab as l8,Tabs as c8}from"@mui/material";import u8 from"@mui/icons-material/Checklist";import d8 from"@mui/icons-material/Face";import f8 from"@mui/icons-material/Publish";import h8 from"@mui/icons-material/NotificationsOutlined";import p8 from"@mui/icons-material/BugReportOutlined";import m8 from"@mui/icons-material/DescriptionOutlined";import g8 from"@mui/icons-material/Inventory2Outlined";import{jsx as An}from"react/jsx-runtime";function Xm(e,p){return p>0?`${e} (${p})`:e}var _W=[{id:"my",label:"\uC804\uCCB4",icon:An(u8,{sx:{fontSize:18}})},{id:"mine",label:"\uB0B4 \uC5C5\uBB34",icon:An(d8,{sx:{fontSize:18}})},{id:"sent",label:"\uBCF4\uB0B8 \uC5C5\uBB34",icon:An(f8,{sx:{fontSize:18}})},{id:"bug",label:"\uC624\uB958",icon:An(p8,{sx:{fontSize:18}})},{id:"notice",label:"\uACF5\uC9C0\uC0AC\uD56D",icon:An(h8,{sx:{fontSize:18}})},{id:"archive",label:"\uBCF4\uAD00\uD568",icon:An(g8,{sx:{fontSize:18}}),hideCount:!0},{id:"report",label:"\uBCF4\uACE0\uC11C",icon:An(m8,{sx:{fontSize:18}}),hideCount:!0}];function b8(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 kW({items:e,activeTab:p,counts:b,onChange:l,compact:i=!1}){let s=ct(),r=b8(s.tabs),t=e;return i?An(s8,{sx:{display:"flex",flexWrap:"wrap",gap:1.25},children:t.map(n=>{let c=p===n.id;return An(a8,{onClick:()=>l(n.id),sx:{px:1.5,py:.75,borderRadius:1,fontSize:_r(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:Xm(n.label,n.hideCount?0:b[n.id]??0)},n.id)})}):An(c8,{value:p,onChange:(n,c)=>l(c),sx:{minHeight:46,"& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:"12px",minHeight:46}},children:t.map(n=>An(l8,{value:n.id,label:Xm(n.label,n.hideCount?0:b[n.id]??0),icon:n.icon,iconPosition:"start",sx:r},n.id))})}import{useEffect as y8,useMemo as x8,useState as id}from"react";import{Divider as $l,ListItemIcon as Gr,Menu as sd,MenuItem as wr}from"@mui/material";import v8 from"@mui/icons-material/OpenInNewOutlined";import w8 from"@mui/icons-material/RestoreFromTrashOutlined";import _8 from"@mui/icons-material/Check";import k8 from"@mui/icons-material/CheckCircleOutlined";import S8 from"@mui/icons-material/RadioButtonUnchecked";import T8 from"@mui/icons-material/SendOutlined";import C8 from"@mui/icons-material/EventOutlined";import B8 from"@mui/icons-material/PersonOutlineOutlined";import I8 from"@mui/icons-material/ViewKanbanOutlined";import E8 from"@mui/icons-material/ContentCopyOutlined";import M8 from"@mui/icons-material/NextPlanOutlined";import R8 from"@mui/icons-material/ContentPasteOutlined";import O8 from"@mui/icons-material/ShareOutlined";import A8 from"@mui/icons-material/DirectionsRunOutlined";import Zm from"@mui/icons-material/ChevronRight";import D8 from"@mui/icons-material/ArchiveOutlined";import P8 from"@mui/icons-material/UnarchiveOutlined";import{ConfirmDialog as Jm}from"@ehfuse/alerts";import{Fragment as Qm,jsx as ut,jsxs as hr}from"react/jsx-runtime";function eU({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:d,onCreateFollowUp:f,onShare:u,onAssignSprint:g,onArchiveToggle:m,onDelete:x,onRestore:_,onPurge:B}){let A=Nt(),j=Pn(),[D,P]=id(null),[N,q]=id(null),[z,T]=id(null);y8(()=>{e||(P(null),q(null),T(null))},[e]);let C=e?.task??null,R=!!C?.is_notice,h=!!C?.is_event,y=C?!so(C,i):!1,v=!!C?.deleted,w=x8(()=>new Set(b.filter(L=>L.useSprints).map(L=>L.key)),[b]),k=async(L="one")=>{let $=C;if(p(),!$)return;await Jm({title:"\uC5C5\uBB34 \uC0AD\uC81C",message:L==="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,L)},S=async()=>{let L=C;if(p(),!L)return;await Jm({title:"\uC601\uAD6C \uC0AD\uC81C",message:`"${L.title}" \uC5C5\uBB34\uB97C \uC601\uAD6C\uD788 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C? \uB418\uB3CC\uB9B4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.`})&&B?.(L.seq)},E=()=>{C&&m(C.seq,!C.archived),p()};return hr(Qm,{children:[hr(sd,{open:!!e,onClose:p,transitionDuration:0,anchorReference:A?"none":"anchorPosition",anchorPosition:!A&&e?{top:e.position.top,left:e.position.left}:void 0,slotProps:{paper:{sx:{minWidth:190,...A?{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxHeight:"70vh"}:{}}},list:A?{sx:{"& .MuiMenuItem-root":{py:1,minHeight:0}}}:void 0},children:[hr(wr,{onClick:()=>{C&&s(C),p()},sx:{fontSize:14},children:[ut(Gr,{children:ut(v8,{sx:{fontSize:19}})}),"\uC0C1\uC138 \uC5F4\uAE30"]}),v?ut($l,{}):null,v&&_?hr(wr,{onClick:()=>{C&&_(C.seq),p()},sx:{fontSize:14},children:[ut(Gr,{children:ut(w8,{sx:{fontSize:19}})}),"\uBCF5\uC6D0"]}):null,v&&B?hr(wr,{onClick:()=>{S()},sx:{fontSize:14,color:"#e5484d"},children:[ut(Gr,{children:ut(cr,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC601\uAD6C \uC0AD\uC81C"]}):null,v?null:hr(Qm,{children:[hr(wr,{disabled:R?(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(Gr,{children:C?.completed?ut(S8,{sx:{fontSize:19}}):ut(k8,{sx:{fontSize:19}})}),C?.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC"]}),!R&&t?hr(wr,{disabled:!(C?.manager_account_seq??0)&&(C?.receiver_account_seqs??[]).length===0,onClick:()=>{C&&t(C),p()},sx:{fontSize:14},children:[ut(Gr,{children:ut(T8,{sx:{fontSize:19}})}),"\uD655\uC778 \uC694\uCCAD"]}):null,h?null:ut($l,{}),h?null:hr(wr,{disabled:y,onClick:L=>{C&&P({anchorEl:L.currentTarget,task:C})},sx:{fontSize:14},children:[ut(Gr,{children:ut(C8,{sx:{fontSize:19}})}),"\uB9C8\uAC10\uC77C\uC2DC \uBCC0\uACBD"]}),!R&&!h&&o?hr(wr,{onClick:()=>{C&&o(C,"manager"),p()},sx:{fontSize:14},children:[ut(Gr,{children:ut(B8,{sx:{fontSize:19}})}),"\uCC45\uC784\uC790 \uBCC0\uACBD"]}):null,h?null:hr(wr,{disabled:y,onClick:L=>{C&&q({anchorEl:L.currentTarget,task:C})},sx:{fontSize:14},children:[ut(Gr,{children:ut(I8,{sx:{fontSize:19}})}),"\uD504\uB85C\uC81D\uD2B8 \uC774\uB3D9",ut(Zm,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}),ut($l,{}),d?hr(wr,{disabled:y,onClick:()=>{C&&d(C.seq),p()},sx:{fontSize:14},children:[ut(Gr,{children:ut(E8,{sx:{fontSize:19}})}),"\uBCF5\uC81C"]}):null,f&&C&&!C.is_event&&!C.is_notice?hr(wr,{onClick:()=>{C&&f(C.seq),p()},sx:{fontSize:14},children:[ut(Gr,{children:ut(M8,{sx:{fontSize:19}})}),"\uD6C4\uC18D \uC5C5\uBB34 \uB9CC\uB4E4\uAE30"]}):null,hr(wr,{onClick:()=>{C&&(u?u(C):Vi(C,A)),p()},sx:{fontSize:14},children:[ut(Gr,{children:A?ut(O8,{sx:{fontSize:19}}):ut(R8,{sx:{fontSize:19}})}),A?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC"]}),C&&!C.is_notice&&!C.is_event&&w.has(String(C.tab_key??""))&&g?hr(wr,{onClick:L=>T(L.currentTarget),sx:{fontSize:14},children:[ut(Gr,{children:ut(A8,{sx:{fontSize:19}})}),"\uBAA9\uD45C\uC5D0 \uB123\uAE30",ut(Zm,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}):null,hr(wr,{onClick:E,disabled:y||!C?.archived&&!(C&&ka(C)),sx:{fontSize:14},children:[ut(Gr,{children:C?.archived?ut(P8,{sx:{fontSize:19}}):ut(D8,{sx:{fontSize:19}})}),C?.archived?"\uBCF4\uAD00 \uD574\uC81C":"\uBCF4\uAD00"]}),ut($l,{}),hr(wr,{disabled:y,onClick:()=>{k("one")},sx:{fontSize:14,color:"#e5484d"},children:[ut(Gr,{children:ut(cr,{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?hr(wr,{disabled:y,onClick:()=>{k("series")},sx:{fontSize:14,color:"#e5484d"},children:[ut(Gr,{children:ut(cr,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC0AD\uC81C (\uC774\uD6C4 \uBC18\uBCF5 \uC804\uCCB4)"]}):null]})]}),ut(hn,{anchorEl:D?.anchorEl??null,open:!!D,date:D?.task.due_date??"",reminder:D?.task.reminder??"none",hideReminder:!!D?.task.completed,centered:A,onClose:()=>{P(null),p()},onDateChange:L=>{D&&n(D.task.seq,L)},onReminderChange:L=>{D&&c?.(D.task.seq,L)}}),hr(sd,{transitionDuration:0,anchorEl:N?.anchorEl??null,open:!!N,onClose:()=>{q(null),p()},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...j,children:[ut(wr,{selected:!N?.task.tab_key,onClick:()=>{N&&a(N.task.seq,""),q(null),p()},sx:{fontSize:14,minWidth:170},children:"\uC5C6\uC74C"}),b.filter(L=>!L.archived).map(L=>ut(wr,{selected:N?.task.tab_key===L.key,onClick:()=>{N&&a(N.task.seq,L.key),q(null),p()},sx:{fontSize:14,minWidth:170},children:L.label},L.key))]}),ut(sd,{transitionDuration:0,anchorEl:z,open:!!z,onClose:()=>T(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...l.filter(L=>`custom-${L.group_seq}`===String(C?.tab_key??"")).map(L=>({seq:L.seq,label:pn(L)}))].map(L=>hr(wr,{onClick:()=>{C&&g?.(C.seq,L.seq),T(null),p()},sx:{fontSize:14,minWidth:160,gap:1},children:[L.label,(C?.sprint_seq??0)===L.seq?ut(_8,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},L.seq))})]})}import{Checkbox as N8,Divider as L8,Menu as j8,MenuItem as e0}from"@mui/material";import{jsx as Hl,jsxs as t0}from"react/jsx-runtime";function iU({anchorEl:e,labelOptions:p,selectedKeys:b,onToggle:l,onClear:i,onClose:s}){return t0(j8,{transitionDuration:0,anchorEl:e,open:!!e,onClose:s,children:[p.map(r=>{let t=b.includes(r.key);return t0(e0,{onClick:()=>l(r.key),sx:{fontSize:14,minWidth:190,gap:1},children:[Hl(N8,{size:"small",checked:t,sx:{p:0}}),Hl(Ot,{option:r})]},r.key)}),Hl(L8,{}),Hl(e0,{disabled:b.length===0,onClick:()=>{i(),s()},sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{Divider as z8,Menu as F8,MenuItem as r0}from"@mui/material";import q8 from"@mui/icons-material/Check";import $8 from"@mui/icons-material/SettingsOutlined";import{jsx as ad,jsxs as ld}from"react/jsx-runtime";function fU(e){let{anchorEl:p,sprints:b,value:l,onSelect:i,onManage:s,onClose:r}=e;return ld(F8,{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:pn(t)}))].map(t=>ld(r0,{onClick:()=>{i(t.seq),r()},sx:{fontSize:14,minWidth:180,gap:1},children:[t.label,l===t.seq?ad(q8,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},t.seq)),ad(z8,{}),ld(r0,{onClick:()=>{r(),s()},sx:{fontSize:14,gap:1},children:[ad($8,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uAD00\uB9AC\u2026"]})]})}var H8={my:"tasks",mine:"tasks",sent:"tasks",notice:"notice",bug:"bug",archive:"archive",done:"done",report:"report"};function W8(e){return H8[e]??"tasks"}var o0={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"},n0=["list","calendar","month","card","kanban","sprint","timeline"],U8=["list","card"];function mU(e){let p=W8(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:n0,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:U8,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:n0,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 V8}from"react";import{useKeyboardState as K8}from"@ehfuse/keyboard-state";var i0=[{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 vU(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=V8(()=>{let d=[];if(i&&d.push({key:"n",callback:i,options:{preventDefault:!0}}),s&&d.push({key:"/",callback:s,options:{preventDefault:!0}}),n&&d.push({key:"r",callback:n,options:{preventDefault:!0}}),r&&d.push({key:"shift+?",callback:r,options:{preventDefault:!0}}),c&&d.push({key:"escape",callback:c,options:{allowInEditable:!0}}),t)for(let f of s0(o?o.split(","):void 0))d.push({key:f.key,callback:()=>t(f.view),options:{preventDefault:!0}});return d},[i,s,r,t,n,c,o]);K8(b?a:[])}function s0(e){if(!e)return i0;let p=new Set(e);return i0.filter(b=>p.has(b.view))}function cd(e){return[{keys:"N",description:"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D"},{keys:"/",description:"\uAC80\uC0C9"},{keys:"R",description:"\uBAA9\uB85D \uC0C8\uB85C\uACE0\uCE68"},...s0(e).map(p=>({keys:p.key.split(" ").map(b=>b.toUpperCase()).join(" \u2192 "),description:`${o0[p.view]} \uBCF4\uAE30`})),{keys:"?",description:"\uB2E8\uCD95\uD0A4 \uB3C4\uC6C0\uB9D0"},{keys:"Esc",description:"\uB2EB\uAE30"}]}var wU=cd();import{Box as Js,Button as G8}from"@mui/material";import Y8 from"@mui/icons-material/ArrowRightAlt";import{FormDialog as X8}from"@ehfuse/mui-form-dialog";import{jsx as Jo,jsxs as a0}from"react/jsx-runtime";function Z8({keys:e}){return Jo(Js,{sx:{display:"flex",alignItems:"center",gap:.5,justifyContent:"flex-end"},children:e.split(" \u2192 ").map((p,b)=>a0(Js,{sx:{display:"flex",alignItems:"center",gap:.5},children:[b>0?Jo(Y8,{sx:{fontSize:18,color:"#9a9a97"}}):null,Jo(Js,{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 BU({open:e,onClose:p,views:b}){let l=cd(b);return Jo(X8,{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:Jo(Js,{sx:{display:"grid",gridTemplateColumns:"auto 1fr",columnGap:2,rowGap:1.25,alignItems:"center",fontSize:14,color:"#37352f"},children:l.map(i=>a0(Js,{sx:{display:"contents"},children:[Jo(Z8,{keys:i.keys}),Jo("span",{children:i.description})]},i.keys))})}],actions:{showCancelButton:!1,right:Jo(G8,{variant:"contained",onClick:p,children:"\uB2EB\uAE30"})}})}import{useEffect as l0,useRef as J8,useState as ts}from"react";import{Box as nr,Button as Dn,IconButton as ud,Menu as c0,MenuItem as u0,Switch as Q8,Tooltip as d0}from"@mui/material";import{FormDialog as f0}from"@ehfuse/mui-form-dialog";import dd from"@mui/icons-material/Add";import eS from"@mui/icons-material/ArrowRightAlt";import tS from"@mui/icons-material/BoltOutlined";import rS from"@mui/icons-material/Close";import nS from"@mui/icons-material/EditOutlined";import{ErrorAlert as h0}from"@ehfuse/alerts";import{ClearTextField as Qs,LabelSelect as ln}from"@ehfuse/mui-form-controls";import{Fragment as m0,jsx as Ke,jsxs as xn}from"react/jsx-runtime";var fd=[{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."}],ea=[{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"}],Vl=[{value:"high",label:"\uB192\uC74C"},{value:"medium",label:"\uC911\uAC04"},{value:"low",label:"\uB0AE\uC74C"}];function Wl(){return{name:"",trigger:"created",enabled:!0,sort_no:0,condition:{},action:{}}}function Ul(e){return rn.find(p=>p.key===e)?.name??e}function oS(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=${Vl.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=${Ul(l.status)}`),l.from_status&&s.push(`${Ul(l.from_status)}\uC5D0\uC11C`),l.to_status&&s.push(`${Ul(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(`${ea.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=${Ul(i.set_status)}`),i.set_priority&&r.push(`\uC911\uC694\uB3C4=${Vl.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=fd.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 p0={fontSize:16,fontWeight:700,color:"#37352f"},iS={display:"flex",alignItems:"center",gap:1},sS={width:104,flexShrink:0,fontSize:16,color:"#37352f"};function HU({open:e,rules:p,customTabs:b,statusOptions:l,contentTemplates:i=[],onPickAccount:s,onClose:r,onCreate:t,onUpdate:n,onToggle:c,onRemove:o}){let[a,d]=ts(!1),[f,u]=ts(0),[g,m]=ts(Wl()),[x,_]=ts(!1),B=J8(null),[A,j]=ts(null),[D,P]=ts(null);l0(()=>{if(e)return;let H=window.setTimeout(()=>{d(!1),u(0),m(Wl())},500);return()=>window.clearTimeout(H)},[e]),l0(()=>{if(!a)return;let H=window.setTimeout(()=>B.current?.focus(),120);return()=>window.clearTimeout(H)},[a]);let N=f>0,q=g.trigger,z=()=>{d(!1),u(0),m(Wl())},T=(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}})},R=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=ea[0]?.value??""),{...Z,trigger:H,condition:J}})},h=b.filter(H=>!H.archived),y=l.map(H=>({value:H.key,label:H.name})),v=rn.map(H=>({value:H.key,label:H.name})),w=h.map(H=>({value:String(Vo(H.key)),label:H.label})),{condition:k,action:S}=g,E=k.is_bug!==void 0||k.is_event!==void 0,L=[...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,H==="manager_account"?"\uCC45\uC784\uC790":"\uCC38\uC870\uC790");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"?T("group_seq",Number(w[0]?.value)||0):H==="kind"?T("is_bug",!0):H==="priority"?T("priority","high"):H==="label_key"?T("label_key",y[0]?.value??""):H==="title_contains"?m(Z=>({...Z,condition:{...Z.condition,title_contains:""}})):H==="manager_empty"?T("manager_empty",!0):H==="manager_account"||H==="receiver_account"?$(H):H==="from_status"?T("from_status",rn[0]?.key??""):H==="to_status"?T("to_status",rn[0]?.key??""):H==="changed_field"?T("changed_field",ea[0]?.value??""):H==="comment_contains"?m(Z=>({...Z,condition:{...Z.condition,comment_contains:""}})):H==="comment_by_others"?T("comment_by_others",!0):H==="overdue_days"&&T("overdue_days",1)},O=H=>{if(H==="kind"){T("is_bug",""),T("is_event","");return}if(H==="manager_account"){T("manager_account_seq",""),T("manager_name","");return}if(H==="receiver_account"){T("receiver_account_seq",""),T("receiver_name","");return}T(H==="group_seq"?"group_seq":H,"")},W=[...S.set_status===void 0?[{key:"set_status",label:"\uC0C1\uD0DC \uBC14\uAFB8\uAE30"}]:[],...S.set_priority===void 0?[{key:"set_priority",label:"\uC911\uC694\uB3C4 \uBC14\uAFB8\uAE30"}]:[],...S.add_label_key===void 0&&y.length>0?[{key:"add_label_key",label:"\uB77C\uBCA8 \uBD99\uC774\uAE30"}]:[],...s&&S.assign_manager_account_seq===void 0?[{key:"assign_manager",label:"\uCC45\uC784\uC790 \uC9C0\uC815\uD558\uAE30"}]:[],...s&&S.add_receiver_account_seq===void 0?[{key:"add_receiver",label:"\uCC38\uC870\uC790 \uCD94\uAC00\uD558\uAE30"}]:[],...i.length>0&&S.apply_content_template_seq===void 0?[{key:"apply_content_template",label:"\uBCF8\uBB38 \uC591\uC2DD \uCC44\uC6B0\uAE30"}]:[],...s&&S.notify_account_seq===void 0?[{key:"notify",label:"\uC54C\uB9BC \uBCF4\uB0B4\uAE30"}]:[]],M=async H=>{if(!s)return;let Z=H==="assign_manager"?S.assign_manager_account_seq??0:H==="add_receiver"?S.add_receiver_account_seq??0:S.notify_account_seq??0,J=await s(Z,H==="assign_manager"?"\uCC45\uC784\uC790":H==="add_receiver"?"\uCC38\uC870\uC790":"\uC54C\uB9BC \uBC1B\uC744 \uC0AC\uB78C");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",rn[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 M(H)},F=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()){h0({message:"\uADDC\uCE59 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694."});return}if(Object.keys(g.action).length===0){h0({message:"\uB3D9\uC791\uC744 \uD558\uB098 \uC774\uC0C1 \uCD94\uAC00\uD558\uC138\uC694."});return}let H=N?g.sort_no:p.reduce((J,G)=>Math.max(J,G.sort_no),0)+1;_(!0);let Z=N?await n(f,{...g,sort_no:H}):await t({...g,sort_no:H});_(!1),Z&&z()},Y=(H,Z,J,G)=>xn(nr,{sx:iS,children:[Ke(nr,{sx:sS,children:H}),xn(nr,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:G?"column":"row",alignItems:G?"stretch":"center",gap:G?.5:1},children:[Z,G?Ke(nr,{sx:{fontSize:13.5,color:"#37352f"},children:G}):null]}),Ke(d0,{title:"\uC774 \uC904 \uBE7C\uAE30",arrow:!0,disableInteractive:!0,children:Ke(ud,{size:"small","aria-label":`${H} \uC904 \uBE7C\uAE30`,onClick:J,children:Ke(rS,{sx:{fontSize:16}})})})]}),K=()=>xn(nr,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[Ke(Qs,{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(nr,{sx:{display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"},children:fd.map(H=>{let Z=q===H.value;return Ke(Dn,{disableElevation:!0,variant:Z?"contained":"outlined",color:Z?"primary":"inherit",onClick:()=>R(H.value),sx:{borderRadius:99,px:1.75,...Z?{}:{color:"#57564f",borderColor:"#d9d9d6"}},children:H.label},H.value)})}),Ke(nr,{sx:{fontSize:13,color:"#787774",mt:-.5},children:fd.find(H=>H.value===q)?.hint}),xn(nr,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[Ke(nr,{sx:p0,children:"\uC5B4\uB5A4 \uC5C5\uBB34\uC77C \uB54C"}),L.length>0?Ke(Dn,{size:"small",startIcon:Ke(dd,{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(ln,{size:"medium",fullWidth:!0,label:"",value:String(k.group_seq),options:w,onChange:H=>T("group_seq",Number(H.target.value)||"")}),()=>O("group_seq")):null,E?Y("\uC885\uB958",Ke(ln,{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";T("is_bug",Z?!0:""),T("is_event",Z?"":!0)}}),()=>O("kind")):null,k.priority!==void 0?Y("\uC911\uC694\uB3C4",Ke(ln,{size:"medium",fullWidth:!0,label:"",value:k.priority,options:Vl,onChange:H=>T("priority",H.target.value)}),()=>O("priority")):null,k.label_key!==void 0?Y("\uB77C\uBCA8",Ke(ln,{size:"medium",fullWidth:!0,label:"",value:k.label_key,options:y,onChange:H=>T("label_key",H.target.value)}),()=>O("label_key")):null,k.title_contains!==void 0?Y("\uC81C\uBAA9",Ke(Qs,{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}}))}),()=>O("title_contains")):null,k.manager_empty!==void 0?Y("\uCC45\uC784\uC790",Ke(ln,{size:"medium",fullWidth:!0,label:"",value:k.manager_empty?"empty":"assigned",options:[{value:"empty",label:"\uC5C6\uC74C"},{value:"assigned",label:"\uC788\uC74C"}],onChange:H=>T("manager_empty",H.target.value==="empty")}),()=>O("manager_empty")):null,k.manager_account_seq!==void 0?Y("\uCC45\uC784\uC790",Ke(Dn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{$("manager_account")},children:k.manager_name||`\uACC4\uC815 #${k.manager_account_seq}`}),()=>O("manager_account")):null,k.receiver_account_seq!==void 0?Y("\uCC38\uC870\uC790",Ke(Dn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{$("receiver_account")},children:k.receiver_name||`\uACC4\uC815 #${k.receiver_account_seq}`}),()=>O("receiver_account")):null,k.from_status!==void 0?Y("\uC774 \uC0C1\uD0DC\uC5D0\uC11C",Ke(ln,{size:"medium",fullWidth:!0,label:"",value:k.from_status,options:v,onChange:H=>T("from_status",H.target.value)}),()=>O("from_status")):null,k.to_status!==void 0?Y("\uC774 \uC0C1\uD0DC\uB85C",Ke(ln,{size:"medium",fullWidth:!0,label:"",value:k.to_status,options:v,onChange:H=>T("to_status",H.target.value)}),()=>O("to_status")):null,k.changed_field!==void 0?Y("\uBCC0\uACBD \uD544\uB4DC",Ke(ln,{size:"medium",fullWidth:!0,label:"",value:k.changed_field,options:ea,onChange:H=>T("changed_field",H.target.value)}),()=>O("changed_field")):null,k.comment_contains!==void 0?Y("\uB313\uAE00 \uB0B1\uB9D0",Ke(Qs,{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}}))}),()=>O("comment_contains")):null,k.comment_by_others!==void 0?Y("\uB313\uAE00 \uC791\uC131\uC790",Ke(ln,{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=>T("comment_by_others",H.target.value==="others")}),()=>O("comment_by_others")):null,k.overdue_days!==void 0?Y("\uACBD\uACFC\uC77C",Ke(Qs,{size:"medium",fullWidth:!0,type:"number",value:String(k.overdue_days),onChange:H=>T("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"}),()=>O("overdue_days")):null,Object.keys(k).length===0?Ke(nr,{sx:{fontSize:13.5,color:"#9a9a97"},children:"\uC870\uAC74\uC774 \uC5C6\uC73C\uBA74 \uBAA8\uB4E0 \uC5C5\uBB34\uC5D0 \uC2E4\uD589\uB429\uB2C8\uB2E4."}):null,xn(nr,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[Ke(nr,{sx:p0,children:"\uBB34\uC5C7\uC744 \uD560\uAE4C\uC694"}),W.length>0?Ke(Dn,{size:"small",startIcon:Ke(dd,{sx:{fontSize:16}}),onClick:H=>P(H.currentTarget),sx:{color:"#2563eb",minWidth:0},children:"\uB3D9\uC791 \uCD94\uAC00"}):null]}),S.set_status!==void 0?Y("\uC0C1\uD0DC",Ke(ln,{size:"medium",fullWidth:!0,label:"",value:S.set_status,options:v,onChange:H=>C("set_status",H.target.value)}),()=>F("set_status")):null,S.set_priority!==void 0?Y("\uC911\uC694\uB3C4",Ke(ln,{size:"medium",fullWidth:!0,label:"",value:S.set_priority,options:Vl,onChange:H=>C("set_priority",H.target.value)}),()=>F("set_priority")):null,S.apply_content_template_seq!==void 0?Y("\uBCF8\uBB38 \uC591\uC2DD",Ke(ln,{size:"medium",fullWidth:!0,label:"",value:String(S.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??""}}))}}),()=>F("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,S.add_label_key!==void 0?Y("\uB77C\uBCA8",Ke(ln,{size:"medium",fullWidth:!0,label:"",value:S.add_label_key,options:y,onChange:H=>C("add_label_key",H.target.value)}),()=>F("add_label_key")):null,S.assign_manager_account_seq!==void 0?Y("\uCC45\uC784\uC790",Ke(Dn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{M("assign_manager")},children:S.assign_manager_name||`\uACC4\uC815 #${S.assign_manager_account_seq}`}),()=>F("assign_manager")):null,S.add_receiver_account_seq!==void 0?Y("\uCC38\uC870\uC790",Ke(Dn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{M("add_receiver")},children:S.add_receiver_name||`\uACC4\uC815 #${S.add_receiver_account_seq}`}),()=>F("add_receiver")):null,S.notify_account_seq!==void 0?Y("\uC54C\uB9BC",xn(m0,{children:[Ke(Dn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{M("notify")},sx:{flexShrink:0},children:S.notify_name||`\uACC4\uC815 #${S.notify_account_seq}`}),Ke(Qs,{size:"medium",fullWidth:!0,placeholder:"\uC54C\uB9BC \uBB38\uAD6C(\uBE44\uC6B0\uBA74 \uAE30\uBCF8 \uBB38\uAD6C)",value:S.notify_message??"",onChange:H=>C("notify_message",H.target.value)})]}),()=>F("notify")):null,Object.keys(S).length===0?Ke(nr,{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(c0,{transitionDuration:0,anchorEl:A,open:!!A,onClose:()=>j(null),children:L.map(H=>Ke(u0,{dense:!0,onClick:()=>U(H.key),sx:{fontSize:14},children:H.label},H.key))}),Ke(c0,{transitionDuration:0,anchorEl:D,open:!!D,onClose:()=>P(null),children:W.map(H=>Ke(u0,{dense:!0,onClick:()=>I(H.key),sx:{fontSize:14},children:H.label},H.key))})]});return xn(m0,{children:[Ke(f0,{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:xn(nr,{sx:{display:"flex",flexDirection:"column",px:2.5,py:2},children:[p.length===0?xn(nr,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[Ke(tS,{sx:{fontSize:48,color:"#d9d9d6"}}),Ke(nr,{sx:{fontSize:15},children:"\uB4F1\uB85D\uB41C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):null,p.map(H=>xn(nr,{sx:{display:"flex",alignItems:"center",gap:2,py:1,"&:not(:last-of-type)":{borderBottom:"1px solid #ececea"},opacity:H.enabled?1:.5},children:[Ke(d0,{title:H.enabled?"\uC0AC\uC6A9 \uC911":"\uAEBC\uC9D0",arrow:!0,disableInteractive:!0,children:Ke(Q8,{size:"small",inputProps:{"aria-label":`${H.name} \uADDC\uCE59 \uC0AC\uC6A9`},checked:H.enabled,onChange:(Z,J)=>c(H.seq,J)})}),xn(nr,{sx:{flex:1,minWidth:0},children:[Ke(nr,{sx:{fontSize:16,fontWeight:600,color:"#37352f"},children:H.name}),(()=>{let Z=oS(H,b,l);return xn(nr,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5,fontSize:15,color:"#6f6f6c"},children:[Ke(nr,{component:"span",children:Z.left}),Ke(eS,{sx:{fontSize:18,color:"#9a9a97",flexShrink:0}}),Ke(nr,{component:"span",children:Z.right})]})})()]}),Ke(ud,{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:ea[0]?.value??""}:{}},action:{...H.action}}),d(!0)},children:Ke(nS,{sx:{fontSize:18}})}),Ke(ud,{size:"small","aria-label":`${H.name} \uADDC\uCE59 \uC0AD\uC81C`,onClick:()=>o(H.seq),children:Ke(cr,{sx:{fontSize:18}})})]},H.seq))]})}],actions:{showCancelButton:!1,left:Ke(Dn,{startIcon:Ke(dd,{}),onClick:()=>{u(0),m(Wl()),d(!0)},sx:{color:"#2563eb"},children:"\uC0C8 \uADDC\uCE59"}),right:Ke(Dn,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}}),Ke(f0,{open:a,onClose:z,maxWidth:"sm",title:N?"\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(Dn,{variant:"contained",onClick:()=>{V()},disabled:x,children:N?"\uC218\uC815":"\uADDC\uCE59 \uCD94\uAC00"})}})]})}import{useEffect as g0,useRef as hd,useState as rs}from"react";import{Box as Qt,Button as ns,IconButton as ta,Tooltip as ra}from"@mui/material";import b0 from"@mui/icons-material/Add";import aS from"@mui/icons-material/EditOutlined";import lS from"@mui/icons-material/ContentCopyOutlined";import cS from"@mui/icons-material/DragIndicator";import uS from"@mui/icons-material/Close";import dS from"@mui/icons-material/PlaylistAddCheckOutlined";import{DndContext as fS,PointerSensor as hS,closestCenter as pS,useSensor as mS,useSensors as gS}from"@dnd-kit/core";import{restrictToParentElement as bS,restrictToVerticalAxis as yS}from"@dnd-kit/modifiers";import{SortableContext as xS,arrayMove as y0,useSortable as vS,verticalListSortingStrategy as wS}from"@dnd-kit/sortable";import{CSS as _S}from"@dnd-kit/utilities";import{FormDialog as x0}from"@ehfuse/mui-form-dialog";import{ClearTextField as pd,LabelSelect as v0,NumberField as w0}from"@ehfuse/mui-form-controls";import kS from"@ehfuse/overlay-scrollbar";import{ConfirmDialog as SS,ErrorAlert as _0}from"@ehfuse/alerts";import{Fragment as ES,jsx as ot,jsxs as vn}from"react/jsx-runtime";var TS=[{value:"high",label:"\uB192\uC74C"},{value:"medium",label:"\uC911\uAC04"},{value:"low",label:"\uB0AE\uC74C"}],k0="\uC5C5\uBB34 \uC81C\uBAA9",md=2,Kl={flex:1,minWidth:0},S0=56,T0=20,CS=`${T0+md*8}px`;function Gl(){return{name:"",description:"",group_seq:0,items:[]}}function BS(){return{title:"",start_offset_days:0,due_offset_days:0,priority:"medium"}}function IS({id:e,children:p}){let{attributes:b,listeners:l,setNodeRef:i,transform:s,transition:r,isDragging:t}=vS({id:e});return ot(Qt,{ref:i,sx:{transform:_S.Transform.toString(s),transition:r,...t?{opacity:.6,position:"relative",zIndex:1}:{}},children:p({handleProps:{...b,...l},dragging:t})})}function uV({open:e,templates:p,customTabs:b,onPickAccount:l,onClose:i,onCreate:s,onUpdate:r,onRemove:t,onRun:n}){let[c,o]=rs(!1),[a,d]=rs(0),[f,u]=rs(Gl()),[g,m]=rs(!1),[x,_]=rs([]),B=hd(0),[A,j]=rs(0),D=hd(null),P=hd(null);g0(()=>{if(e)return;let L=window.setTimeout(()=>{o(!1),d(0),u(Gl()),_([])},500);return()=>window.clearTimeout(L)},[e]);let N=()=>(B.current+=1,`template-item-${B.current}`),q=(L,$)=>{d(L),u($),_($.items.map(()=>N())),o(!0)},z=f.items.map((L,$)=>x[$]??`template-item-fallback-${$}`),T=()=>{let L=P.current?.getScrollContainer()??null;if(L){L.scrollTop=L.scrollHeight;return}let $=D.current?.querySelectorAll("*")??[];for(let U of Array.from($))if(U.scrollHeight>U.clientHeight+1){U.scrollTop=U.scrollHeight;return}},C=()=>{let L=D.current;if(!L)return null;let $=L.querySelectorAll("input[data-template-title]"),U=$.length?$:L.querySelectorAll(`input[placeholder="${k0}"]`);return U.length?U[U.length-1]:null};g0(()=>{if(A===0)return;let L=0,$=0,U=()=>{T();let W=C();W&&document.activeElement!==W&&W.focus(),L+=1,!(W&&document.activeElement===W)&&L<8&&($=window.setTimeout(U,50))},O=window.requestAnimationFrame(U);return()=>{window.cancelAnimationFrame(O),window.clearTimeout($)}},[A]);let R=b.filter(L=>!L.archived).map(L=>({value:String(Vo(L.key)),label:L.label})),h=(L,$)=>{u(U=>({...U,items:U.items.map((O,W)=>W===L?{...O,...$}:O)}))},y=gS(mS(hS,{activationConstraint:{distance:5}})),v=L=>{let $=String(L.active?.id??""),U=String(L.over?.id??"");if(!$||!U||$===U)return;let O=z.indexOf($),W=z.indexOf(U);O<0||W<0||(u(M=>({...M,items:y0(M.items,O,W)})),_(M=>y0(M,O,W)))},w=async L=>{if(!l)return;let $=await l(f.items[L]?.manager_account_seq??0,"\uCC45\uC784\uC790");$&&h(L,{manager_account_seq:$.accountSeq,manager_name:$.name})},k=async()=>{let L=f.name.trim();if(!L){_0({message:"\uD15C\uD50C\uB9BF \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694."});return}let $=f.items.filter(W=>W.title.trim().length>0);if($.length===0){_0({message:"\uC5C5\uBB34 \uD56D\uBAA9\uC744 \uD55C \uC904 \uC774\uC0C1 \uB123\uC73C\uC138\uC694."});return}m(!0);let U={...f,name:L,items:$},O=a>0?await r(a,U):await s(U);m(!1),O&&(o(!1),d(0),u(Gl()))},S=ot(Qt,{children:p.length===0?vn(Qt,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[ot(dS,{sx:{fontSize:48,color:"#d9d9d6"}}),ot(Qt,{sx:{fontSize:13.5},children:"\uB4F1\uB85D\uB41C \uD15C\uD50C\uB9BF\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):p.map(L=>vn(Qt,{sx:{display:"flex",alignItems:"center",gap:2.5,py:1.75,"&:not(:last-of-type)::after":{content:'""',display:"block",my:1.75,borderBottom:"1px solid #f0efed"}},children:[vn(Qt,{sx:{flex:1,minWidth:0},children:[ot(Qt,{sx:{fontSize:18,fontWeight:600,color:"#37352f"},children:L.name}),vn(Qt,{sx:{fontSize:14,color:"#787774",mt:.25},children:["\uC5C5\uBB34 ",L.items.length,"\uAC74",L.description?` \xB7 ${L.description}`:""]})]}),n?ot(ns,{size:"medium",variant:"outlined",onClick:()=>n(L),sx:{flexShrink:0},children:"\uC2E4\uD589"}):null,ot(ra,{title:"\uC218\uC815",arrow:!0,disableInteractive:!0,children:ot(ta,{size:"medium","aria-label":`${L.name} \uD15C\uD50C\uB9BF \uC218\uC815`,onClick:()=>q(L.seq,{name:L.name,description:L.description??"",group_seq:L.group_seq??0,items:L.items.map($=>({...$}))}),children:ot(aS,{sx:{fontSize:19}})})}),ot(ra,{title:"\uBCF5\uC81C",arrow:!0,disableInteractive:!0,children:ot(ta,{size:"medium","aria-label":`${L.name} \uD15C\uD50C\uB9BF \uBCF5\uC81C`,onClick:()=>q(0,{name:`${L.name} \uC0AC\uBCF8`,description:L.description??"",group_seq:L.group_seq??0,items:L.items.map($=>({...$}))}),children:ot(lS,{sx:{fontSize:18}})})}),ot(ra,{title:"\uC0AD\uC81C",arrow:!0,disableInteractive:!0,children:ot(ta,{size:"medium","aria-label":`${L.name} \uD15C\uD50C\uB9BF \uC0AD\uC81C`,onClick:()=>{(async()=>await SS({title:"\uD15C\uD50C\uB9BF \uC0AD\uC81C",message:`"${L.name}" \uD15C\uD50C\uB9BF\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&t(L.seq))()},children:ot(cr,{sx:{fontSize:18}})})})]},L.seq))}),E=vn(Qt,{sx:{display:"flex",flexDirection:"column",gap:3},children:[ot(pd,{size:"medium",label:"\uD15C\uD50C\uB9BF \uC774\uB984",placeholder:"\uC608: \uC2E0\uADDC \uC785\uC0AC\uC790 \uC628\uBCF4\uB529",fullWidth:!0,value:f.name,onChange:L=>u($=>({...$,name:L.target.value}))}),vn(Qt,{sx:{display:"grid",gridTemplateColumns:R.length>0?"1fr 1fr":"1fr",gap:2},children:[ot(pd,{size:"medium",label:"\uC124\uBA85",placeholder:"\uBAA9\uB85D\uC5D0\uC11C \uBB34\uC5C7\uC778\uC9C0 \uC54C\uC544\uBCFC \uD55C \uC904(\uC120\uD0DD)",fullWidth:!0,value:f.description??"",onChange:L=>u($=>({...$,description:L.target.value}))}),R.length>0?ot(v0,{size:"medium",fullWidth:!0,label:"\uB9CC\uB4E4 \uACF3(\uD504\uB85C\uC81D\uD2B8)",value:String(f.group_seq??0),options:[{value:"0",label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568"},...R],onChange:L=>u($=>({...$,group_seq:Number(L.target.value)||0}))}):null]}),vn(Qt,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[ot(Qt,{sx:{fontSize:18,fontWeight:600,color:"#37352f"},children:"\uC5C5\uBB34 \uD56D\uBAA9"}),ot(Qt,{sx:{fontSize:14,color:"#37352f"},children:"\uB0A0\uC9DC\uB294 \uC2E4\uD589\uD560 \uB54C \uACE0\uB974\uB294 \uAE30\uC900\uC77C\uC5D0\uC11C \uACC4\uC0B0\uB429\uB2C8\uB2E4."})]}),f.items.length===0?ot(Qt,{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.'}):ot(Qt,{ref:D,sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:ot(kS,{ref:P,style:{maxHeight:"min(560px, 52vh)"},thumb:{width:6},children:ot(fS,{sensors:y,collisionDetection:pS,modifiers:[yS,bS],onDragEnd:v,children:ot(xS,{items:z,strategy:wS,children:f.items.map((L,$)=>ot(IS,{id:z[$],children:({handleProps:U})=>vn(Qt,{sx:{borderBottom:$===f.items.length-1?"none":"1px solid #f2f2f0",px:md,py:2,gap:2,display:"flex",flexDirection:"column"},children:[vn(Qt,{sx:{display:"flex",alignItems:"center",gap:md},children:[ot(Qt,{...U,"aria-label":`${$+1}\uBC88 \uD56D\uBAA9 \uC21C\uC11C \uC774\uB3D9`,sx:{display:"inline-flex",alignItems:"center",flexShrink:0,color:"#c9c8c5",cursor:"grab","&:active":{cursor:"grabbing"},touchAction:"none",userSelect:"none"},children:ot(cS,{sx:{fontSize:T0}})}),ot(pd,{size:"medium",fullWidth:!0,placeholder:k0,slotProps:{htmlInput:{"data-template-title":$}},value:L.title,onChange:O=>h($,{title:O.target.value})})]}),vn(Qt,{sx:{display:"flex",alignItems:"center",gap:2,pl:CS},children:[ot(Qt,{sx:Kl,children:ot(w0,{size:"medium",fullWidth:!0,label:"\uC2DC\uC791 D+",thousandSeparator:!1,align:"right",suffix:"\uC77C",value:L.start_offset_days??null,onValueChange:O=>h($,{start_offset_days:O===null?void 0:Math.trunc(Number(O))})})}),ot(Qt,{sx:Kl,children:ot(w0,{size:"medium",fullWidth:!0,label:"\uB9C8\uAC10 D+",thousandSeparator:!1,align:"right",suffix:"\uC77C",value:L.due_offset_days??null,onValueChange:O=>h($,{due_offset_days:O===null?void 0:Math.trunc(Number(O))})})}),ot(Qt,{sx:Kl,children:ot(v0,{size:"medium",fullWidth:!0,label:"\uC911\uC694\uB3C4",value:L.priority??"medium",options:TS,onChange:O=>h($,{priority:O.target.value})})}),l?vn(Qt,{sx:{...Kl,position:"relative"},children:[ot(ns,{variant:"outlined",fullWidth:!0,onClick:()=>{w($)},sx:{height:S0,display:"block",textAlign:"left",textTransform:"none",fontSize:16,fontWeight:400,lineHeight:`${S0-2}px`,py:0,px:1.75,pr:L.manager_account_seq?4.5:1.75,borderColor:"#c4c4c4",color:L.manager_name?"#37352f":"#9a9a97",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","&:hover":{borderColor:"#37352f",bgcolor:"transparent"}},children:L.manager_name||"\uCC45\uC784\uC790"}),L.manager_account_seq?ot(ra,{title:"\uCC45\uC784\uC790 \uBE44\uC6B0\uAE30",arrow:!0,disableInteractive:!0,children:ot(ta,{size:"small","aria-label":`${$+1}\uBC88 \uD56D\uBAA9 \uCC45\uC784\uC790 \uBE44\uC6B0\uAE30`,onClick:O=>{O.stopPropagation(),h($,{manager_account_seq:0,manager_name:""})},sx:{position:"absolute",right:6,top:"50%",transform:"translateY(-50%)"},children:ot(uS,{sx:{fontSize:18}})})}):null]}):null,ot(ra,{title:"\uD56D\uBAA9 \uC0AD\uC81C",arrow:!0,disableInteractive:!0,children:ot(ta,{size:"medium","aria-label":`${$+1}\uBC88 \uD56D\uBAA9 \uC0AD\uC81C`,onClick:()=>{u(O=>({...O,items:O.items.filter((W,M)=>M!==$)})),_(O=>O.filter((W,M)=>M!==$))},children:ot(cr,{sx:{fontSize:18}})})})]})]})},z[$]))})})})})]});return vn(ES,{children:[ot(x0,{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:ot(ns,{startIcon:ot(b0,{sx:{fontSize:18}}),onClick:()=>q(0,Gl()),children:"\uC0C8 \uD15C\uD50C\uB9BF"}),right:ot(ns,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})},sectionContentPaddingTop:0,sections:[{id:"templates",title:"",showTitle:!1,children:S}]}),ot(x0,{open:c,onClose:()=>o(!1),maxWidth:"md",title:a>0?"\uD15C\uD50C\uB9BF \uC218\uC815":"\uC0C8 \uD15C\uD50C\uB9BF",locale:"ko",backdropClick:!1,fontScale:{enabled:!0},fontScaleKey:"taskbox-task-template-form",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},tabs:{visible:!1},actions:{showCancelButton:!0,left:ot(ns,{startIcon:ot(b0,{sx:{fontSize:18}}),onClick:()=>{u(L=>({...L,items:[...L.items,BS()]})),_(L=>[...L,N()]),j(L=>L+1)},children:"\uD56D\uBAA9 \uCD94\uAC00"}),right:ot(ns,{variant:"contained",disabled:g,onClick:()=>{k()},children:"\uC800\uC7A5"})},sectionContentPaddingTop:0,sections:[{id:"template-form",title:"",showTitle:!1,children:E}]})]})}import{useEffect as C0,useState as B0}from"react";import{Box as Dr,Button as MS}from"@mui/material";import{FormDialog as RS}from"@ehfuse/mui-form-dialog";import{DateTextField as OS}from"@ehfuse/mui-form-controls";import AS from"@ehfuse/overlay-scrollbar";import{jsx as Yr,jsxs as na}from"react/jsx-runtime";function vV({open:e,template:p,todayStr:b,running:l=!1,onClose:i,onRun:s}){let[r,t]=B0(b),[n,c]=B0(p);C0(()=>{p&&c(p)},[p]),C0(()=>{e&&t(b)},[e]);let o=p??n,a=o?Bh(o,r):[];return Yr(RS,{open:e,onClose:i,maxWidth:"md",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},sectionContentPaddingTop:0,actions:{showCancelButton:!0,right:Yr(MS,{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:na(Dr,{sx:{display:"flex",flexDirection:"column",gap:2},children:[na(Dr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Yr(Dr,{sx:{width:72,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uAE30\uC900\uC77C"}),Yr(OS,{size:"medium",fullWidth:!0,value:r,onChange:d=>t(d.target.value)})]}),Yr(Dr,{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."}),na(Dr,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:[na(Dr,{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:[Yr(Dr,{sx:{flex:1,minWidth:0},children:"\uC5C5\uBB34"}),Yr(Dr,{sx:{width:88,flexShrink:0,textAlign:"center"},children:"\uC2DC\uC791"}),Yr(Dr,{sx:{width:88,flexShrink:0,textAlign:"center"},children:"\uB9C8\uAC10"}),Yr(Dr,{sx:{width:96,flexShrink:0,textAlign:"center"},children:"\uCC45\uC784\uC790"})]}),Yr(AS,{style:{maxHeight:520},thumb:{width:6},children:a.length===0?Yr(Dr,{sx:{p:2,fontSize:14,color:"#9a9a97"},children:"\uB9CC\uB4E4 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):a.map((d,f)=>na(Dr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1.25,borderBottom:f===a.length-1?"none":"1px solid #f2f2f0",fontSize:16,fontWeight:500,color:"#111111"},children:[Yr(Dr,{sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.title}),Yr(Dr,{sx:{width:88,flexShrink:0,textAlign:"center",fontSize:13.5,color:d.start_date?"#37352f":"#9a9a97"},children:Sc(d.start_date)||"-"}),Yr(Dr,{sx:{width:88,flexShrink:0,textAlign:"center",fontSize:13.5,color:d.due_date?"#37352f":"#9a9a97"},children:Sc(d.due_date)||"-"}),Yr(Dr,{sx:{width:96,flexShrink:0,textAlign:"center",fontSize:13.5,color:d.manager_name?"#37352f":"#9a9a97",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.manager_name||"-"})]},f))})]})]})}]})}var DS={urgent:"\uAE34\uAE09",high:"\uB192\uC74C",normal:"\uC911\uAC04",low:"\uB0AE\uC74C"};function PS(e){return e.length===0?"":e.length<=2?e.join(", "):`${e[0]} \uC678 ${e.length-1}\uBA85`}function gd(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 os(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 bd(e,p){let l=String(e.due_date??"").slice(11,16).trim()||String(e.estimated_time??"").trim(),i=gd(e.due_date),s=String(e.start_date??"").slice(11,16).trim(),r=gd(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:lr(e).name,projectLabel:e.tab_key?p.get(String(e.tab_key))??"":"",managerName:String(e.manager_name??"").trim(),receiverNames:PS(t),receiverNamesFull:t.join(", "),startDate:r!=="-"&&s?`${r} ${s}`:r,dueDate:i!=="-"&&l?`${i} ${l}`:i,priorityName:DS[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 NS(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 Yl(e,p){let b=0;for(let l of String(e??""))b+=NS(l,p);return b}function is(e,p){let b=String(e??"").trim();if(!b)return["-"];let l=[],i="";for(let s of b){if(s===`
42
42
  `){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 _i(e,p,b){let l=String(e??"").replace(/\s+/g," ").trim();if(!l)return"";if(Yl(l,b)<=p)return l;let i=Yl("\u2026",b),s="",r=0;for(let t of l){let n=Yl(t,b);if(r+n+i>p)break;s+=t,r+=n}return`${s}\u2026`}var ia=595.28,sa=841.89,aa=841.89,la=595.28,Pr=28,wn=96,cn=44,LS="'Malgun Gothic','\uB9D1\uC740 \uACE0\uB515','Apple SD Gothic Neo','Noto Sans KR',sans-serif",jS="'Batang','\uBC14\uD0D5','AppleMyungjo','Noto Serif KR',serif",oa="#cbd5e1",zS=[`text { font-family: ${LS}; fill: #000000; }`,`.doc-title { font-family: ${jS}; 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: ${oa}; stroke-width: 0.5; }`,`.group { fill: #f8fafc; stroke: ${oa}; stroke-width: 0.5; }`,`.frame { fill: none; stroke: ${oa}; stroke-width: 0.5; }`,`.hline { stroke: ${oa}; stroke-width: 0.5; }`,`.vline { stroke: ${oa}; 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 Eo(e,p,b){let l=b-Pr;return[`<text x="${Pr}" y="46" class="doc-title">${Dt(e.documentTitle)}</text>`,`<text x="${Pr}" 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(os(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 Mo(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>${zS}</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 xd=aa,E0=la,Ro=Pr,ca=xd-Pr,da=22,ki=20,Si=22,ua=5,M0=wn,R0=cn,I0=E0-46,fa=[{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"}],yd=fa.reduce((e,p,b)=>(e.push(b===0?Ro:e[b-1]+fa[b-1].width),e),[]);function FS(e){let p=[],b=[],l=M0+da,i=(s,r)=>{p.push(b),b=[],l=R0+da,s&&(b.push({kind:"group",label:s,count:r,continued:!0}),l+=Si)};for(let s of e){s.label&&(l+Si+ki>I0&&i("",0),b.push({kind:"group",label:s.label,count:s.rows.length,continued:!1}),l+=Si);for(let r of s.rows)l+ki>I0&&i(s.label,s.rows.length),b.push({kind:"row",completed:r.completed,values:fa.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+=ki}return p.push(b),p.filter((s,r)=>r===0||s.length>0)}function qS(e,p){let b=[];b.push(`<rect x="${Ro}" y="${p}" width="${ca-Ro}" height="${da}" class="head" />`),fa.forEach((i,s)=>{let r=yd[s],t=i.align==="middle"?r+i.width/2:r+ua;b.push(`<text x="${t}" y="${p+da-7}" class="th" text-anchor="${i.align}">${Dt(i.label)}</text>`)});let l=p+da;for(let i of e){if(i.kind==="group"){b.push(`<rect x="${Ro}" y="${l}" width="${ca-Ro}" height="${Si}" class="group" />`,`<text x="${Ro+ua}" y="${l+Si-7}" class="gt">${Dt(i.continued?`${i.label} (\uC774\uC5B4\uC11C)`:i.label)}</text>`,`<text x="${ca-ua}" y="${l+Si-7}" class="gt" text-anchor="end">${i.count}\uAC74</text>`),l+=Si;continue}fa.forEach((s,r)=>{let t=yd[r],n=s.align==="middle"?t+s.width/2:t+ua;b.push(`<text x="${n}" y="${l+ki-6}" class="${i.completed?"td done":"td"}" text-anchor="${s.align}">${Dt(_i(i.values[r]??"",s.width-ua*2,9))}</text>`)}),b.push(`<line x1="${Ro}" y1="${l+ki}" x2="${ca}" y2="${l+ki}" class="hline" />`),l+=ki}return yd.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="${ca-Ro}" height="${l-p}" class="frame" />`),b.join("")}async function $S(e,p){let b=FS(p),l=p.reduce((i,s)=>i+s.rows.length,0);return b.map((i,s)=>{let r=s===0?M0:R0,t=[s===0?Eo(e,`\uC804\uCCB4 ${l}\uAC74`,xd):"",qS(i,r)].join("");return Mo({width:xd,height:E0,body:t,pageIndex:s,pageCount:b.length})})}var wd=ia,O0=sa,eo=Pr,Xl=wd-Pr,HS=O0-46,A0=22,WS=68,US=(Xl-eo)/2,VS=14,vd=58;function ss(e){switch(e.kind){case"title":return 34;case"props":return Math.ceil(e.pairs.length/2)*A0+10;case"section":return 26;default:return VS}}function KS(e){let p=[{kind:"title",text:e.title,ticket:e.ticketNo}];return p.push({kind:"props",pairs:e.properties}),p.push({kind:"section",text:"\uB0B4\uC6A9"}),(e.content.trim()?e.content.split(`
43
43
  `).flatMap(l=>l.trim()?is(l,vd):[""]):["(\uB0B4\uC6A9 \uC5C6\uC74C)"]).forEach(l=>p.push({kind:"line",text:l,muted:!e.content.trim()})),e.checklist.length>0&&(p.push({kind:"section",text:`\uD560\uC77C (${e.checklist.filter(l=>l.checked).length}/${e.checklist.length})`}),e.checklist.forEach(l=>{is(l.label,vd-3).forEach((i,s)=>p.push({kind:s===0?"check":"line",text:i,checked:l.checked}))})),e.includeComments&&e.comments.length>0&&(p.push({kind:"section",text:`\uB313\uAE00 (${e.comments.length})`}),e.comments.forEach(l=>{p.push({kind:"line",text:`${l.author} \xB7 ${l.time}`,muted:!0}),is(l.text,vd).forEach(i=>p.push({kind:"line",text:i}))})),p}function GS(e){let p=[],b=[],l=wn;for(let i of e){let s=ss(i);l+s>HS&&(p.push(b),b=[],l=cn),b.push(i),l+=s}return p.push(b),p}function YS(e,p){switch(e.kind){case"title":{let b=e.ticket?`<text x="${Xl}" y="${p+16}" class="doc-meta" text-anchor="end">${Dt(e.ticket)}</text>`:"";return{markup:`<text x="${eo}" y="${p+16}" class="section" style="font-size:14px">${Dt(e.text)}</text>${b}<line x1="${eo}" y1="${p+24}" x2="${Xl}" y2="${p+24}" class="hline" />`,nextY:p+ss(e)}}case"props":{let b=[];return e.pairs.forEach((l,i)=>{let s=i%2,r=Math.floor(i/2),t=eo+s*US,n=p+r*A0;b.push(`<text x="${t}" y="${n+14}" class="label">${Dt(l.label)}</text>`,`<text x="${t+WS}" y="${n+14}" class="value">${Dt(is(l.value||"-",26)[0]??"-")}</text>`)}),{markup:b.join(""),nextY:p+ss(e)}}case"section":return{markup:`<text x="${eo}" y="${p+16}" class="section">${Dt(e.text)}</text><line x1="${eo}" y1="${p+21}" x2="${Xl}" y2="${p+21}" class="hline" />`,nextY:p+ss(e)};case"check":return{markup:`<text x="${eo}" y="${p+10}" class="td">${e.checked?"\u2611":"\u2610"}</text><text x="${eo+14}" y="${p+10}" class="${e.checked?"td done":"td"}">${Dt(e.text)}</text>`,nextY:p+ss(e)};default:return{markup:`<text x="${eo}" y="${p+10}" class="${e.muted?"td done":"td"}">${Dt(e.text)}</text>`,nextY:p+ss(e)}}}async function XS(e,p){let b=GS(KS(p));return b.map((l,i)=>{let s=i===0?wn:cn,r=[i===0?Eo(e,"",wd):`<text x="${eo}" y="${cn-12}" class="doc-meta">${Dt(`${p.title} (\uC774\uC5B4\uC11C)`)}</text>`];for(let t of l){let n=YS(t,s);r.push(n.markup),s=n.nextY}return Mo({width:wd,height:O0,body:r.join(""),pageIndex:i,pageCount:b.length})})}var kd=aa,N0=la,Zl=Pr,ha=kd-Pr,D0=N0-46,P0=210,Qo=20,_d=24;function ei(e){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))return null;let p=new Date(`${e}T00:00:00`);return Number.isNaN(p.getTime())?null:p}function L0(e,p){return Math.round((p.getTime()-e.getTime())/864e5)}function ZS(e,p){let b=[];e.forEach(r=>{let t=ei(r.startDate),n=ei(r.dueDate);t&&b.push(t),n&&b.push(n)});let l=ei(p)??new Date;if(b.length===0)return{start:l,days:30};let i=new Date(Math.min(...b.map(r=>r.getTime()))),s=new Date(Math.max(...b.map(r=>r.getTime())));return i.setDate(i.getDate()-1),s.setDate(s.getDate()+1),{start:i,days:Math.max(7,L0(i,s)+1)}}async function JS(e,p,b){let l=ZS(p,b),i=Zl+P0,r=(ha-i)/l.days,t=ei(b),n=f=>i+L0(l.start,f)*r,c=Math.max(1,Math.floor((D0-wn-_d)/Qo)),o=Math.max(1,Math.floor((D0-cn-_d)/Qo)),a=[],d=0;for(;d<p.length||a.length===0;){let f=a.length===0?c:o;if(a.push(p.slice(d,d+f)),d+=f,d>=p.length)break}return a.map((f,u)=>{let g=u===0?wn:cn,m=[u===0?Eo(e,`\uC804\uCCB4 ${p.length}\uAC74`,kd):""],x=g+_d;m.push(`<line x1="${Zl}" y1="${x}" x2="${ha}" y2="${x}" class="vline" />`);for(let _=0;_<l.days;_+=1){let B=new Date(l.start);if(B.setDate(B.getDate()+_),B.getDay()!==0&&_!==0)continue;let A=i+_*r;m.push(`<line x1="${A}" y1="${x}" x2="${A}" y2="${x+f.length*Qo}" class="hline" />`,`<text x="${A+2}" y="${x-6}" class="label">${B.getMonth()+1}.${B.getDate()}</text>`)}if(t&&t>=l.start){let _=n(t);_>=i&&_<=ha&&m.push(`<line x1="${_}" y1="${x}" x2="${_}" y2="${x+f.length*Qo}" stroke="#f87171" stroke-width="0.8" />`)}return f.forEach((_,B)=>{let A=x+B*Qo,j=_i(_.title,P0-64,9);m.push(`<text x="${Zl}" y="${A+14}" class="${_.completed?"td done":"td"}">${Dt(j)}</text>`,`<text x="${i-6}" y="${A+14}" class="label" text-anchor="end">${Dt(_.managerName)}</text>`,`<line x1="${Zl}" y1="${A+Qo}" x2="${ha}" y2="${A+Qo}" class="hline" />`);let D=ei(_.startDate)??ei(_.dueDate),P=ei(_.dueDate)??ei(_.startDate);if(!D||!P)return;let N=n(D),q=Math.max(N+r*.8,n(P)+r*.8),z=_.completed?"bar done":_.overdue?"bar overdue":"bar";m.push(`<rect x="${N}" y="${A+5}" width="${Math.max(3,Math.min(q,ha)-N)}" height="${Qo-10}" rx="2" class="${z}" />`)}),Mo({width:kd,height:N0,body:m.join(""),pageIndex:u,pageCount:a.length})})}function QS(e,p,b,l){return{title:e.title,managerName:e.managerName,startDate:String(p??"").slice(0,10),dueDate:String(b??"").slice(0,10),completed:e.completed,overdue:!e.completed&&!!b&&String(b).slice(0,10)<l}}var Sd=ia,z0=sa,as=Pr,Jl=Sd-Pr,j0=z0-46,ls=30,cs=18,F0=12;function eT(e){let p=[],b=[],l=wn,i=(s,r)=>{p.push(b),b=[],l=cn,s&&(b.push({kind:"column",label:s,summary:r,continued:!0,gapBefore:!1}),l+=ls)};for(let s of e){let r=b.length>0,t=r?F0:0;if(l+t+ls+cs>j0?(i("",""),b.push({kind:"column",label:s.label,summary:s.summary,continued:!1,gapBefore:!1}),l+=ls):(b.push({kind:"column",label:s.label,summary:s.summary,continued:!1,gapBefore:r}),l+=t+ls),s.items.length===0){b.push({kind:"empty"}),l+=cs;continue}for(let n of s.items)l+cs>j0&&i(s.label,s.summary),b.push({kind:"item",title:n.title,meta:n.meta,completed:n.completed}),l+=cs}return p.push(b),p}async function tT(e,p,b){let l=eT(p);return l.map((i,s)=>{let r=s===0?wn:cn,t=[s===0?Eo(e,b,Sd):""];for(let n of i){if(n.kind==="column"){n.gapBefore&&(r+=F0),t.push(`<rect x="${as}" y="${r}" width="${Jl-as}" height="${ls-6}" class="group" />`,`<text x="${as+6}" y="${r+16}" class="gt">${Dt(n.continued?`${n.label} (\uC774\uC5B4\uC11C)`:n.label)}</text>`,`<text x="${Jl-6}" y="${r+16}" class="label" text-anchor="end">${Dt(n.summary)}</text>`),r+=ls;continue}if(n.kind==="empty"){t.push(`<text x="${as+12}" y="${r+12}" class="td done">(\uC5C5\uBB34 \uC5C6\uC74C)</text>`),r+=cs;continue}t.push(`<text x="${as+12}" y="${r+12}" class="${n.completed?"td done":"td"}">${Dt(_i(n.title,Jl-as-12-120,9))}</text>`,`<text x="${Jl-6}" y="${r+12}" class="label" text-anchor="end">${Dt(n.meta)}</text>`),r+=cs}return Mo({width:Sd,height:z0,body:t.join(""),pageIndex:s,pageCount:l.length})})}var rT=[{header:"\uADF8\uB8F9",width:16},{header:"\uC81C\uBAA9",width:44},{header:"\uC0C1\uD0DC",width:10},{header:"\uD504\uB85C\uC81D\uD2B8",width:14},{header:"\uCC45\uC784\uC790",width:10},{header:"\uCC38\uC870\uC790",width:22},{header:"\uC2DC\uC791",width:12},{header:"\uB9C8\uAC10",width:14},{header:"\uC911\uC694\uB3C4",width:8},{header:"\uD560\uC77C",width:8},{header:"\uBE44\uACE0",width:30}],nT="FFEEF2F7",Ql="FFCBD5E1";function oT(e){return e.replace(/[\\/:*?"<>|]/g,"_").trim()||"\uC5C5\uBB34\uBAA9\uB85D"}async function iT(e,p){let b=await Promise.resolve().then(()=>X0($0(),1)),l=new b.Workbook,i=l.addWorksheet("\uC5C5\uBB34\uBAA9\uB85D",{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0,fitToWidth:1,fitToHeight:0}});i.columns=rT.map(o=>({header:o.header,width:o.width})),i.spliceRows(1,0,[`${e.documentTitle}`],[`${e.subtitle} \xB7 ${e.facilityName} \xB7 \uCD9C\uB825 ${os(e.printedAt)}${e.printedBy?` \xB7 ${e.printedBy}`:""}`]),i.getRow(1).font={bold:!0,size:14},i.getRow(2).font={size:10,color:{argb:"FF6B7280"}};let s=i.getRow(3);s.font={bold:!0,size:10},s.eachCell(o=>{o.fill={type:"pattern",pattern:"solid",fgColor:{argb:nT}},o.alignment={vertical:"middle",horizontal:"center"}}),p.forEach(o=>{o.rows.forEach(a=>{let d=i.addRow([o.label,a.title,a.statusName,a.projectLabel||"\uAE30\uBCF8",a.managerName,a.receiverNamesFull,a.startDate==="-"?"":a.startDate,a.dueDate==="-"?"":a.dueDate,a.priorityName,a.checklist,a.note]);d.font={size:10,color:{argb:a.completed?"FF9CA3AF":"FF111827"}},d.alignment={vertical:"middle",wrapText:!1}})});let r=i.rowCount;for(let o=3;o<=r;o+=1)i.getRow(o).eachCell({includeEmpty:!0},a=>{a.border={top:{style:"thin",color:{argb:Ql}},left:{style:"thin",color:{argb:Ql}},bottom:{style:"thin",color:{argb:Ql}},right:{style:"thin",color:{argb:Ql}}}});i.views=[{state:"frozen",ySplit:3}];let t=await l.xlsx.writeBuffer(),n=new Blob([t],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),c=os(e.printedAt).replace(/[: ]/g,"").slice(0,13);return{blob:n,fileName:`${oT(e.documentTitle)}_${c}.xlsx`}}function sT(e){return String(e??"").replace(/<br\s*\/?>(?=.)/gi,`
44
44
  `).replace(/<\/(p|div|li|h[1-6])>/gi,`